zepto.min_wev8.js 28.6 KB
var Zepto=function(){function u(t){return null==t?String(t):V[M.call(t)]||"object"}function a(t){return"function"==u(t)}function o(t){return null!=t&&t==t.window}function s(t){return null!=t&&t.nodeType==t.DOCUMENT_NODE}function r(t){return"object"==u(t)}function c(t){return r(t)&&!o(t)&&Object.getPrototypeOf(t)==Object.prototype}function l(t){var e=!!t&&"length"in t&&t.length,n=x.type(t);return"function"!=n&&!o(t)&&("array"==n||0===e||"number"==typeof e&&0<e&&e-1 in t)}function h(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function n(t){return t in e?e[t]:e[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function f(t,e){return"number"!=typeof e||N[h(t)]?e:e+"px"}function i(t){return"children"in t?k.call(t.children):x.map(t.childNodes,function(t){return 1==t.nodeType?t:void 0})}function p(t,e){return null==e?x(t):x(t).filter(e)}function d(t,e,n,i){return a(e)?e.call(t,n,i):e}function m(t,e,n){null==n?t.removeAttribute(e):t.setAttribute(e,n)}function v(t,e){var n=t.className||"",i=n&&n.baseVal!==g;return e===g?i?n.baseVal:n:void(i?n.baseVal=e:t.className=e)}function y(e){try{return e?"true"==e||"false"!=e&&("null"==e?null:+e+""==e?+e:/^[\[\{]/.test(e)?x.parseJSON(e):e):e}catch(t){return e}}var g,j,x,T,b,w,E=[],k=E.slice,C=E.filter,S=window.document,A={},e={},N={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},O=/^\s*<(\w+|!)[^>]*>/,P=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,$=/^(?:body|html)$/i,D=/([A-Z])/g,_=["val","css","html","text","data","width","height","offset"],t=S.createElement("table"),F=S.createElement("tr"),R={tr:S.createElement("tbody"),tbody:t,thead:t,tfoot:t,td:F,th:F,"*":S.createElement("div")},L=/complete|loaded|interactive/,z=/^[\w-]*$/,V={},M=V.toString,q={},U=S.createElement("div"),W={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},H=Array.isArray||function(t){return t instanceof Array};return q.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var n=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var i,r=t.parentNode,o=!r;return o&&(r=U).appendChild(t),i=~q.qsa(r,e).indexOf(t),o&&U.removeChild(t),i},b=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},w=function(n){return C.call(n,function(t,e){return n.indexOf(t)==e})},q.fragment=function(t,e,n){var i,r,o;return P.test(t)&&(i=x(S.createElement(RegExp.$1))),i||(t.replace&&(t=t.replace(Z,"<$1></$2>")),e===g&&(e=O.test(t)&&RegExp.$1),e in R||(e="*"),(o=R[e]).innerHTML=""+t,i=x.each(k.call(o.childNodes),function(){o.removeChild(this)})),c(n)&&(r=x(i),x.each(n,function(t,e){-1<_.indexOf(t)?r[t](e):r.attr(t,e)})),i},q.Z=function(t,e){return(t=t||[]).__proto__=x.fn,t.selector=e||"",t},q.isZ=function(t){return t instanceof q.Z},q.init=function(t,e){var n,i;if(!t)return q.Z();if("string"==typeof t)if("<"==(t=t.trim())[0]&&O.test(t))n=q.fragment(t,RegExp.$1,e),t=null;else{if(e!==g)return x(e).find(t);n=q.qsa(S,t)}else{if(a(t))return x(S).ready(t);if(q.isZ(t))return t;if(H(t))i=t,n=C.call(i,function(t){return null!=t});else if(r(t))n=[t],t=null;else if(O.test(t))n=q.fragment(t.trim(),RegExp.$1,e),t=null;else{if(e!==g)return x(e).find(t);n=q.qsa(S,t)}}return q.Z(n,t)},(x=function(t,e){return q.init(t,e)}).extend=function(e){var n,t=k.call(arguments,1);return"boolean"==typeof e&&(n=e,e=t.shift()),t.forEach(function(t){!function t(e,n,i){for(j in n)i&&(c(n[j])||H(n[j]))?(c(n[j])&&!c(e[j])&&(e[j]={}),H(n[j])&&!H(e[j])&&(e[j]=[]),t(e[j],n[j],i)):n[j]!==g&&(e[j]=n[j])}(e,t,n)}),e},q.qsa=function(t,e){var n,i="#"==e[0],r=!i&&"."==e[0],o=i||r?e.slice(1):e,a=z.test(o);return s(t)&&a&&i?(n=t.getElementById(o))?[n]:[]:1!==t.nodeType&&9!==t.nodeType?[]:k.call(a&&!i?r?t.getElementsByClassName(o):t.getElementsByTagName(e):t.querySelectorAll(e))},x.contains=S.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},x.type=u,x.isFunction=a,x.isWindow=o,x.isArray=H,x.isPlainObject=c,x.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},x.inArray=function(t,e,n){return E.indexOf.call(e,t,n)},x.camelCase=b,x.trim=function(t){return null==t?"":String.prototype.trim.call(t)},x.uuid=0,x.support={},x.expr={},x.map=function(t,e){var n,i,r,o,a=[];if(l(t))for(i=0;i<t.length;i++)null!=(n=e(t[i],i))&&a.push(n);else for(r in t)null!=(n=e(t[r],r))&&a.push(n);return 0<(o=a).length?x.fn.concat.apply([],o):o},x.each=function(t,e){var n,i;if(l(t)){for(n=0;n<t.length;n++)if(!1===e.call(t[n],n,t[n]))return t}else for(i in t)if(!1===e.call(t[i],i,t[i]))return t;return t},x.grep=function(t,e){return C.call(t,e)},window.JSON&&(x.parseJSON=JSON.parse),x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(t,e){V["[object "+e+"]"]=e.toLowerCase()}),x.fn={forEach:E.forEach,reduce:E.reduce,push:E.push,sort:E.sort,indexOf:E.indexOf,concat:E.concat,map:function(n){return x(x.map(this,function(t,e){return n.call(t,e,t)}))},slice:function(){return x(k.apply(this,arguments))},ready:function(t){return L.test(S.readyState)&&S.body?t(x):S.addEventListener("DOMContentLoaded",function(){t(x)},!1),this},get:function(t){return t===g?k.call(this):this[0<=t?t:t+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(n){return E.every.call(this,function(t,e){return!1!==n.call(t,e,t)}),this},filter:function(e){return a(e)?this.not(this.not(e)):x(C.call(this,function(t){return q.matches(t,e)}))},add:function(t,e){return x(w(this.concat(x(t,e))))},is:function(t){return 0<this.length&&q.matches(this[0],t)},not:function(e){var n=[];if(a(e)&&e.call!==g)this.each(function(t){e.call(this,t)||n.push(this)});else{var i="string"==typeof e?this.filter(e):l(e)&&a(e.item)?k.call(e):x(e);this.forEach(function(t){i.indexOf(t)<0&&n.push(t)})}return x(n)},has:function(t){return this.filter(function(){return r(t)?x.contains(this,t):x(this).find(t).size()})},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!r(t)?t:x(t)},last:function(){var t=this[this.length-1];return t&&!r(t)?t:x(t)},find:function(t){var n=this;return t?"object"==typeof t?x(t).filter(function(){var e=this;return E.some.call(n,function(t){return x.contains(t,e)})}):1==this.length?x(q.qsa(this[0],t)):this.map(function(){return q.qsa(this,t)}):x()},closest:function(n,i){var r=[],o="object"==typeof n&&x(n);return this.each(function(t,e){for(;e&&!(o?0<=o.indexOf(e):q.matches(e,n));)e=e!==i&&!s(e)&&e.parentNode;e&&r.indexOf(e)<0&&r.push(e)}),x(r)},parents:function(t){for(var e=[],n=this;0<n.length;)n=x.map(n,function(t){return(t=t.parentNode)&&!s(t)&&e.indexOf(t)<0?(e.push(t),t):void 0});return p(e,t)},parent:function(t){return p(w(this.pluck("parentNode")),t)},children:function(t){return p(this.map(function(){return i(this)}),t)},contents:function(){return this.map(function(){return k.call(this.childNodes)})},siblings:function(t){return p(this.map(function(t,e){return C.call(i(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(e){return x.map(this,function(t){return t[e]})},show:function(){return this.each(function(){var t,e,n;"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=(t=this.nodeName,A[t]||(e=S.createElement(t),S.body.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),A[t]=n),A[t]))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(e){var n=a(e);if(this[0]&&!n)var i=x(e).get(0),r=i.parentNode||1<this.length;return this.each(function(t){x(this).wrapAll(n?e.call(this,t):r?i.cloneNode(!0):i)})},wrapAll:function(t){if(this[0]){x(this[0]).before(t=x(t));for(var e;(e=t.children()).length;)t=e.first();x(t).append(this)}return this},wrapInner:function(r){var o=a(r);return this.each(function(t){var e=x(this),n=e.contents(),i=o?r.call(this,t):r;n.length?n.wrapAll(i):e.append(i)})},unwrap:function(){return this.parent().each(function(){x(this).replaceWith(x(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(e){return this.each(function(){var t=x(this);(e===g?"none"==t.css("display"):e)?t.show():t.hide()})},prev:function(t){return x(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return x(this.pluck("nextElementSibling")).filter(t||"*")},html:function(n){return 0 in arguments?this.each(function(t){var e=this.innerHTML;x(this).empty().append(d(this,n,t,e))}):0 in this?this[0].innerHTML:null},text:function(n){return 0 in arguments?this.each(function(t){var e=d(this,n,t,this.textContent);this.textContent=null==e?"":""+e}):0 in this?this.pluck("textContent").join(""):null},attr:function(e,n){var t;return"string"!=typeof e||1 in arguments?this.each(function(t){if(1===this.nodeType)if(r(e))for(j in e)m(this,j,e[j]);else m(this,e,d(this,n,t,this.getAttribute(e)))}):this.length&&1===this[0].nodeType?!(t=this[0].getAttribute(e))&&e in this[0]?this[0][e]:t:g},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(" ").forEach(function(t){m(this,t)},this)})},prop:function(e,n){return e=W[e]||e,1 in arguments?this.each(function(t){this[e]=d(this,n,t,this[e])}):this[0]&&this[0][e]},data:function(t,e){var n="data-"+t.replace(D,"-$1").toLowerCase(),i=1 in arguments?this.attr(n,e):this.attr(n);return null!==i?y(i):g},val:function(e){return 0 in arguments?(null==e&&(e=""),this.each(function(t){this.value=d(this,e,t,this.value)})):this[0]&&(this[0].multiple?x(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(o){if(o)return this.each(function(t){var e=x(this),n=d(this,o,t,e.offset()),i=e.offsetParent().offset(),r={top:n.top-i.top,left:n.left-i.left};"static"==e.css("position")&&(r.position="relative"),e.css(r)});if(!this.length)return null;if(S.documentElement!==this[0]&&!x.contains(S.documentElement,this[0]))return{top:0,left:0};var t=this[0].getBoundingClientRect();return{left:t.left+window.pageXOffset,top:t.top+window.pageYOffset,width:Math.round(t.width),height:Math.round(t.height)}},css:function(t,e){if(arguments.length<2){var n=this[0];if("string"==typeof t){if(!n)return;return n.style[b(t)]||getComputedStyle(n,"").getPropertyValue(t)}if(H(t)){if(!n)return;var i={},r=getComputedStyle(n,"");return x.each(t,function(t,e){i[e]=n.style[b(e)]||r.getPropertyValue(e)}),i}}var o="";if("string"==u(t))e||0===e?o=h(t)+":"+f(t,e):this.each(function(){this.style.removeProperty(h(t))});else for(j in t)t[j]||0===t[j]?o+=h(j)+":"+f(j,t[j])+";":this.each(function(){this.style.removeProperty(h(j))});return this.each(function(){this.style.cssText+=";"+o})},index:function(t){return t?this.indexOf(x(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return!!t&&E.some.call(this,function(t){return this.test(v(t))},n(t))},addClass:function(n){return n?this.each(function(t){if("className"in this){T=[];var e=v(this);d(this,n,t,e).split(/\s+/g).forEach(function(t){x(this).hasClass(t)||T.push(t)},this),T.length&&v(this,e+(e?" ":"")+T.join(" "))}}):this},removeClass:function(e){return this.each(function(t){if("className"in this){if(e===g)return v(this,"");T=v(this),d(this,e,t,T).split(/\s+/g).forEach(function(t){T=T.replace(n(t)," ")}),v(this,T.trim())}})},toggleClass:function(n,i){return n?this.each(function(t){var e=x(this);d(this,n,t,v(this)).split(/\s+/g).forEach(function(t){(i===g?!e.hasClass(t):i)?e.addClass(t):e.removeClass(t)})}):this},scrollTop:function(t){if(this.length){var e="scrollTop"in this[0];return t===g?e?this[0].scrollTop:this[0].pageYOffset:this.each(e?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var e="scrollLeft"in this[0];return t===g?e?this[0].scrollLeft:this[0].pageXOffset:this.each(e?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),n=this.offset(),i=$.test(e[0].nodeName)?{top:0,left:0}:e.offset();return n.top-=parseFloat(x(t).css("margin-top"))||0,n.left-=parseFloat(x(t).css("margin-left"))||0,i.top+=parseFloat(x(e[0]).css("border-top-width"))||0,i.left+=parseFloat(x(e[0]).css("border-left-width"))||0,{top:n.top-i.top,left:n.left-i.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||S.body;t&&!$.test(t.nodeName)&&"static"==x(t).css("position");)t=t.offsetParent;return t})}},x.fn.detach=x.fn.remove,["width","height"].forEach(function(i){var r=i.replace(/./,function(t){return t[0].toUpperCase()});x.fn[i]=function(e){var t,n=this[0];return e===g?o(n)?n["inner"+r]:s(n)?n.documentElement["scroll"+r]:(t=this.offset())&&t[i]:this.each(function(t){(n=x(this)).css(i,d(this,e,t,n[i]()))})}}),["after","prepend","before","append"].forEach(function(e,a){var s=a%2;x.fn[e]=function(){var n,i,r=x.map(arguments,function(t){var e=[];return"array"==(n=u(t))?(t.forEach(function(t){return t.nodeType!==g?e.push(t):x.zepto.isZ(t)?e=e.concat(t.get()):void(e=e.concat(q.fragment(t)))}),e):"object"==n||null==t?t:q.fragment(t)}),o=1<this.length;return r.length<1?this:this.each(function(t,e){i=s?e:e.parentNode,e=0==a?e.nextSibling:1==a?e.firstChild:2==a?e:null;var n=x.contains(S.documentElement,i);r.forEach(function(t){if(o)t=t.cloneNode(!0);else if(!i)return x(t).remove();i.insertBefore(t,e),n&&function t(e,n){n(e);for(var i=0,r=e.childNodes.length;i<r;i++)t(e.childNodes[i],n)}(t,function(t){if(!(null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src)){var e=t.ownerDocument?t.ownerDocument.defaultView:window;e.eval.call(e,t.innerHTML)}})})})},x.fn[s?e+"To":"insert"+(a?"Before":"After")]=function(t){return x(t)[e](this),this}}),q.Z.prototype=x.fn,q.uniq=w,q.deserializeValue=y,x.zepto=q,x}();window.Zepto=Zepto,void 0===window.$&&(window.$=Zepto),function(l){function h(t){return t._zid||(t._zid=e++)}function a(t,e,n,i){if((e=f(e)).ns)var r=(o=e.ns,new RegExp("(?:^| )"+o.replace(" "," .* ?")+"(?: |$)"));var o;return(b[h(t)]||[]).filter(function(t){return t&&(!e.e||t.e==e.e)&&(!e.ns||r.test(t.ns))&&(!n||h(t.fn)===h(n))&&(!i||t.sel==i)})}function f(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function p(t,e){return t.del&&!n&&t.e in i||!!e}function d(t){return w[t]||n&&i[t]||t}function c(r,t,e,o,a,s,u){var n=h(r),c=b[n]||(b[n]=[]);t.split(/\s/).forEach(function(t){if("ready"==t)return l(document).ready(e);var n=f(t);n.fn=e,n.sel=a,n.e in w&&(e=function(t){var e=t.relatedTarget;return!e||e!==this&&!l.contains(this,e)?n.fn.apply(this,arguments):void 0});var i=(n.del=s)||e;n.proxy=function(t){if(!(t=v(t)).isImmediatePropagationStopped()){t.data=o;var e=i.apply(r,t._args==g?[t]:[t].concat(t._args));return!1===e&&(t.preventDefault(),t.stopPropagation()),e}},n.i=c.length,c.push(n),"addEventListener"in r&&r.addEventListener(d(n.e),n.proxy,p(n,u))})}function m(e,t,n,i,r){var o=h(e);(t||"").split(/\s/).forEach(function(t){a(e,t,n,i).forEach(function(t){delete b[o][t.i],"removeEventListener"in e&&e.removeEventListener(d(t.e),t.proxy,p(t,r))})})}function v(i,r){return(r||!i.isDefaultPrevented)&&(r||(r=i),l.each(t,function(t,e){var n=r[t];i[t]=function(){return this[e]=s,n&&n.apply(r,arguments)},i[e]=E}),i.timeStamp||(i.timeStamp=Date.now()),(r.defaultPrevented!==g?r.defaultPrevented:"returnValue"in r?!1===r.returnValue:r.getPreventDefault&&r.getPreventDefault())&&(i.isDefaultPrevented=s)),i}function y(t){var e,n={originalEvent:t};for(e in t)r.test(e)||t[e]===g||(n[e]=t[e]);return v(n,t)}var g,e=1,j=Array.prototype.slice,x=l.isFunction,T=function(t){return"string"==typeof t},b={},o={},n="onfocusin"in window,i={focus:"focusin",blur:"focusout"},w={mouseenter:"mouseover",mouseleave:"mouseout"};o.click=o.mousedown=o.mouseup=o.mousemove="MouseEvents",l.event={add:c,remove:m},l.proxy=function(t,e){var n=2 in arguments&&j.call(arguments,2);if(x(t)){var i=function(){return t.apply(e,n?n.concat(j.call(arguments)):arguments)};return i._zid=h(t),i}if(T(e))return n?(n.unshift(t[e],t),l.proxy.apply(null,n)):l.proxy(t[e],t);throw new TypeError("expected function")},l.fn.bind=function(t,e,n){return this.on(t,e,n)},l.fn.unbind=function(t,e){return this.off(t,e)},l.fn.one=function(t,e,n,i){return this.on(t,e,n,i,1)};var s=function(){return!0},E=function(){return!1},r=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,t={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};l.fn.delegate=function(t,e,n){return this.on(e,t,n)},l.fn.undelegate=function(t,e,n){return this.off(e,t,n)},l.fn.live=function(t,e){return l(document.body).delegate(this.selector,t,e),this},l.fn.die=function(t,e){return l(document.body).undelegate(this.selector,t,e),this},l.fn.on=function(e,r,n,o,a){var s,u,i=this;return e&&!T(e)?(l.each(e,function(t,e){i.on(t,r,n,e,a)}),i):(T(r)||x(o)||!1===o||(o=n,n=r,r=g),(o===g||!1===n)&&(o=n,n=g),!1===o&&(o=E),i.each(function(t,i){a&&(s=function(t){return m(i,t.type,o),o.apply(this,arguments)}),r&&(u=function(t){var e,n=l(t.target).closest(r,i).get(0);return n&&n!==i?(e=l.extend(y(t),{currentTarget:n,liveFired:i}),(s||o).apply(n,[e].concat(j.call(arguments,1)))):void 0}),c(i,e,o,n,r,u||s)}))},l.fn.off=function(t,n,e){var i=this;return t&&!T(t)?(l.each(t,function(t,e){i.off(t,n,e)}),i):(T(n)||x(e)||!1===e||(e=n,n=g),!1===e&&(e=E),i.each(function(){m(this,t,e,n)}))},l.fn.trigger=function(t,e){return(t=T(t)||l.isPlainObject(t)?l.Event(t):v(t))._args=e,this.each(function(){t.type in i&&"function"==typeof this[t.type]?this[t.type]():"dispatchEvent"in this?this.dispatchEvent(t):l(this).triggerHandler(t,e)})},l.fn.triggerHandler=function(n,i){var r,o;return this.each(function(t,e){(r=y(T(n)?l.Event(n):n))._args=i,r.target=e,l.each(a(e,n.type||n),function(t,e){return o=e.proxy(r),!r.isImmediatePropagationStopped()&&void 0})}),o},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){l.fn[e]=function(t){return 0 in arguments?this.bind(e,t):this.trigger(e)}}),l.Event=function(t,e){T(t)||(t=(e=t).type);var n=document.createEvent(o[t]||"Events"),i=!0;if(e)for(var r in e)"bubbles"==r?i=!!e[r]:n[r]=e[r];return n.initEvent(t,i,!0),v(n)}}(Zepto),function(kh){function mh(t,e,n,i){return t.global?(r=e||Ch,o=n,a=i,s=kh.Event(o),kh(r).trigger(s,a),!s.isDefaultPrevented()):void 0;var r,o,a,s}function ph(t,e){var n=e.context;return!1!==e.beforeSend.call(n,t,e)&&!1!==mh(e,n,"ajaxBeforeSend",[t,e])&&void mh(e,n,"ajaxSend",[t,e])}function qh(t,e,n,i){var r=n.context,o="success";n.success.call(r,t,o,e),i&&i.resolveWith(r,[t,o,e]),mh(n,r,"ajaxSuccess",[e,n,t]),sh(o,e,n)}function rh(t,e,n,i,r){var o=i.context;i.error.call(o,n,e,t),r&&r.rejectWith(o,[n,e,t]),mh(i,o,"ajaxError",[n,i,t||e]),sh(e,n,i)}function sh(t,e,n){var i,r=n.context;n.complete.call(r,e,t),mh(n,r,"ajaxComplete",[e,n]),(i=n).global&&!--kh.active&&mh(i,null,"ajaxStop")}function th(){}function vh(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function xh(t,e,n,i){return kh.isFunction(e)&&(i=n,n=e,e=void 0),kh.isFunction(n)||(i=n,n=void 0),{url:t,data:e,success:n,dataType:i}}var zh,Ah,Bh=+new Date,Ch=window.document,Dh=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,Eh=/^(?:text|application)\/javascript/i,Fh=/^(?:text|application)\/xml/i,Gh="application/json",Hh="text/html",Ih=/^\s*$/,Jh=Ch.createElement("a");Jh.href=window.location.href,kh.active=0,kh.ajaxJSONP=function(n,i){if(!("type"in n))return kh.ajax(n);var r,o,t=n.jsonpCallback,a=(kh.isFunction(t)?t():t)||"Zepto"+Bh++,s=Ch.createElement("script"),u=window[a],e=function(t){kh(s).triggerHandler("error",t||"abort")},c={abort:e};return i&&i.promise(c),kh(s).on("load error",function(t,e){clearTimeout(o),kh(s).off().remove(),"error"!=t.type&&r?qh(r[0],c,n,i):rh(null,e||"error",c,n,i),window[a]=u,r&&kh.isFunction(u)&&u(r[0]),u=r=void 0}),!1===ph(c,n)?e("abort"):(window[a]=function(){r=arguments},s.src=n.url.replace(/\?(.+)=\?/,"?$1="+a),Ch.head.appendChild(s),0<n.timeout&&(o=setTimeout(function(){e("timeout")},n.timeout))),c},kh.ajaxSettings={type:"GET",beforeSend:th,success:th,error:th,complete:th,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:Gh,xml:"application/xml, text/xml",html:Hh,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0},kh.ajax=function(Qi){var Ri,Si,pi,Th,Ti=kh.extend({},Qi||{}),Ui=kh.Deferred&&kh.Deferred();for(zh in kh.ajaxSettings)void 0===Ti[zh]&&(Ti[zh]=kh.ajaxSettings[zh]);(Th=Ti).global&&0==kh.active++&&mh(Th,null,"ajaxStart"),Ti.crossDomain||((Ri=Ch.createElement("a")).href=Ti.url,Ri.href=Ri.href,Ti.crossDomain=Jh.protocol+"//"+Jh.host!=Ri.protocol+"//"+Ri.host),Ti.url||(Ti.url=window.location.toString()),-1<(Si=Ti.url.indexOf("#"))&&(Ti.url=Ti.url.slice(0,Si)),(pi=Ti).processData&&pi.data&&"string"!=kh.type(pi.data)&&(pi.data=kh.param(pi.data,pi.traditional)),!pi.data||pi.type&&"GET"!=pi.type.toUpperCase()&&"jsonp"!=pi.dataType||(pi.url=vh(pi.url,pi.data),pi.data=void 0);var Vi=Ti.dataType,Wi=/\?.+=\?/.test(Ti.url);if(Wi&&(Vi="jsonp"),!1!==Ti.cache&&(Qi&&!0===Qi.cache||"script"!=Vi&&"jsonp"!=Vi)||(Ti.url=vh(Ti.url,"_="+Date.now())),"jsonp"==Vi)return Wi||(Ti.url=vh(Ti.url,Ti.jsonp?Ti.jsonp+"=?":!1===Ti.jsonp?"":"callback=?")),kh.ajaxJSONP(Ti,Ui);var Xi,Yi=Ti.accepts[Vi],Zi={},$i=function(t,e){Zi[t.toLowerCase()]=[t,e]},_i=/^([\w-]+:)\/\//.test(Ti.url)?RegExp.$1:window.location.protocol,aj=Ti.xhr(),bj=aj.setRequestHeader;if(Ui&&Ui.promise(aj),Ti.crossDomain||$i("X-Requested-With","XMLHttpRequest"),$i("Accept",Yi||"*/*"),(Yi=Ti.mimeType||Yi)&&(-1<Yi.indexOf(",")&&(Yi=Yi.split(",",2)[0]),aj.overrideMimeType&&aj.overrideMimeType(Yi)),(Ti.contentType||!1!==Ti.contentType&&Ti.data&&"GET"!=Ti.type.toUpperCase())&&$i("Content-Type",Ti.contentType||"application/x-www-form-urlencoded"),Ti.headers)for(Ah in Ti.headers)$i(Ah,Ti.headers[Ah]);if(aj.setRequestHeader=$i,!(aj.onreadystatechange=function(){if(4==aj.readyState){aj.onreadystatechange=th,clearTimeout(Xi);var fj,gj=!1;if(200<=aj.status&&aj.status<300||304==aj.status||0==aj.status&&"file:"==_i){if(Vi=Vi||((mi=Ti.mimeType||aj.getResponseHeader("content-type"))&&(mi=mi.split(";",2)[0]),mi&&(mi==Hh?"html":mi==Gh?"json":Eh.test(mi)?"script":Fh.test(mi)&&"xml")||"text"),"arraybuffer"==aj.responseType||"blob"==aj.responseType)fj=aj.response;else{fj=aj.responseText;try{"script"==Vi?eval(fj):"xml"==Vi?fj=aj.responseXML:"json"==Vi&&(fj=Ih.test(fj)?null:kh.parseJSON(fj))}catch(t){gj=t}if(gj)return rh(gj,"parsererror",aj,Ti,Ui)}qh(fj,aj,Ti,Ui)}else rh(aj.statusText||null,aj.status?"error":"abort",aj,Ti,Ui)}var mi})===ph(aj,Ti))return aj.abort(),rh(null,"abort",aj,Ti,Ui),aj;var cj=!("async"in Ti)||Ti.async;if(aj.open(Ti.type,Ti.url,cj,Ti.username,Ti.password),Ti.xhrFields)for(Ah in Ti.xhrFields)aj[Ah]=Ti.xhrFields[Ah];for(Ah in Zi)bj.apply(aj,Zi[Ah]);return 0<Ti.timeout&&(Xi=setTimeout(function(){aj.onreadystatechange=th,aj.abort(),rh(null,"timeout",aj,Ti,Ui)},Ti.timeout)),aj.send(Ti.data?Ti.data:null),aj},kh.get=function(){return kh.ajax(xh.apply(null,arguments))},kh.post=function(){var t=xh.apply(null,arguments);return t.type="POST",kh.ajax(t)},kh.getJSON=function(){var t=xh.apply(null,arguments);return t.dataType="json",kh.ajax(t)},kh.fn.load=function(t,e,n){if(!this.length)return this;var i,r=this,o=t.split(/\s/),a=xh(t,e,n),s=a.success;return 1<o.length&&(a.url=o[0],i=o[1]),a.success=function(t){r.html(i?kh("<div>").html(t.replace(Dh,"")).find(i):t),s&&s.apply(r,arguments)},kh.ajax(a),this};var Kh=encodeURIComponent;kh.param=function(t,e){var n=[];return n.add=function(t,e){kh.isFunction(e)&&(e=e()),null==e&&(e=""),this.push(Kh(t)+"="+Kh(e))},function n(i,t,r,o){var a,s=kh.isArray(t),u=kh.isPlainObject(t);kh.each(t,function(t,e){a=kh.type(e),o&&(t=r?o:o+"["+(u||"object"==a||"array"==a?t:"")+"]"),!o&&s?i.add(e.name,e.value):"array"==a||!r&&"object"==a?n(i,e,r,t):i.add(t,e)})}(n,t,e),n.join("&").replace(/%20/g,"+")}}(Zepto),function(o){o.fn.serializeArray=function(){var n,i,e=[],r=function(t){return t.forEach?t.forEach(r):void e.push({name:n,value:t})};return this[0]&&o.each(this[0].elements,function(t,e){i=e.type,(n=e.name)&&"fieldset"!=e.nodeName.toLowerCase()&&!e.disabled&&"submit"!=i&&"reset"!=i&&"button"!=i&&"file"!=i&&("radio"!=i&&"checkbox"!=i||e.checked)&&r(o(e).val())}),e},o.fn.serialize=function(){var e=[];return this.serializeArray().forEach(function(t){e.push(encodeURIComponent(t.name)+"="+encodeURIComponent(t.value))}),e.join("&")},o.fn.submit=function(t){if(0 in arguments)this.bind("submit",t);else if(this.length){var e=o.Event("submit");this.eq(0).trigger(e),e.isDefaultPrevented()||this.get(0).submit()}return this}}(Zepto),function(n){"__proto__"in{}||n.extend(n.zepto,{Z:function(t,e){return t=t||[],n.extend(t,n.fn),t.selector=e||"",t.__Z=!0,t},isZ:function(t){return"array"===n.type(t)&&"__Z"in t}});try{getComputedStyle(void 0)}catch(t){var i=getComputedStyle;window.getComputedStyle=function(t,e){try{return i(t,e)}catch(t){return null}}}}(Zepto),function(i){var t={nextAll:function(t){for(var e=i(),n=this.next();n.length;)(void 0===t||n.is(t))&&(e=e.add(n)),n=n.next();return e},prevAll:function(t){for(var e=i(),n=this.prev();n.length;)(void 0===t||n.is(t))&&(e=e.add(n)),n=n.prev();return e}};i.extend(i.fn,t)}(Zepto),function(f){f.Callbacks=function(i){i=f.extend({},i);var e,n,r,o,a,s,u=[],c=!i.once&&[],l=function(t){for(e=i.memory&&t,n=!0,s=o||0,o=0,a=u.length,r=!0;u&&s<a;++s)if(!1===u[s].apply(t[0],t[1])&&i.stopOnFalse){e=!1;break}r=!1,u&&(c?c.length&&l(c.shift()):e?u.length=0:h.disable())},h={add:function(){if(u){var t=u.length,n=function(t){f.each(t,function(t,e){"function"==typeof e?i.unique&&h.has(e)||u.push(e):e&&e.length&&"string"!=typeof e&&n(e)})};n(arguments),r?a=u.length:e&&(o=t,l(e))}return this},remove:function(){return u&&f.each(arguments,function(t,e){for(var n;-1<(n=f.inArray(e,u,n));)u.splice(n,1),r&&(n<=a&&--a,n<=s&&--s)}),this},has:function(t){return!(!u||!(t?-1<f.inArray(t,u):u.length))},empty:function(){return a=u.length=0,this},disable:function(){return u=c=e=void 0,this},disabled:function(){return!u},lock:function(){return c=void 0,e||h.disable(),this},locked:function(){return!c},fireWith:function(t,e){return!u||n&&!c||(e=[t,(e=e||[]).slice?e.slice():e],r?c.push(e):l(e)),this},fire:function(){return h.fireWith(this,arguments)},fired:function(){return!!n}};return h}}(Zepto),function(l){var h=Array.prototype.slice;function f(t){var r=[["resolve","done",l.Callbacks({once:1,memory:1}),"resolved"],["reject","fail",l.Callbacks({once:1,memory:1}),"rejected"],["notify","progress",l.Callbacks({memory:1})]],o="pending",a={state:function(){return o},always:function(){return s.done(arguments).fail(arguments),this},then:function(){var e=arguments;return f(function(o){l.each(r,function(t,i){var r=l.isFunction(e[t])&&e[t];s[i[1]](function(){var t=r&&r.apply(this,arguments);if(t&&l.isFunction(t.promise))t.promise().done(o.resolve).fail(o.reject).progress(o.notify);else{var e=this===a?o.promise():this,n=r?[t]:arguments;o[i[0]+"With"](e,n)}})}),e=null}).promise()},promise:function(t){return null!=t?l.extend(t,a):a}},s={};return l.each(r,function(t,e){var n=e[2],i=e[3];a[e[1]]=n.add,i&&n.add(function(){o=i},r[1^t][2].disable,r[2][2].lock),s[e[0]]=function(){return s[e[0]+"With"](this===s?a:this,arguments),this},s[e[0]+"With"]=n.fireWith}),a.promise(s),t&&t.call(s,s),s}l.when=function(t){var r,e,n,i=h.call(arguments),o=i.length,a=0,s=1!==o||t&&l.isFunction(t.promise)?o:0,u=1===s?t:f(),c=function(e,n,i){return function(t){n[e]=this,i[e]=1<arguments.length?h.call(arguments):t,i===r?u.notifyWith(n,i):--s||u.resolveWith(n,i)}};if(1<o)for(r=new Array(o),e=new Array(o),n=new Array(o);a<o;++a)i[a]&&l.isFunction(i[a].promise)?i[a].promise().done(c(a,n,i)).fail(u.reject).progress(c(a,e,r)):--s;return s||u.resolveWith(n,i),u.promise()},l.Deferred=f}(Zepto),function(l){var h=function(){var t,e,n,i,r,o,a=arguments[0]||{},s=1,u=arguments.length,c=!1;for("boolean"==typeof a&&(c=a,a=arguments[1]||{},s=2),"object"==typeof a||l.isFunction(a)||(a={}),u===s&&(a=this,--s);s<u;s++)if(null!=(t=arguments[s]))for(e in t)n=a[e],a!==(i=t[e])&&(c&&i&&(l.isPlainObject(i)||(r=l.isArray(i)))?(o=r?(r=!1,n&&l.isArray(n)?n:[]):n&&l.isPlainObject(n)?n:{},a[e]=h(c,o,i)):void 0!==i&&t.hasOwnProperty(e)&&(a[e]=i));return a};l.extend=h}(Zepto);