diff --git a/dist/spa-apis.js b/dist/spa-apis.js index f9bd7a6..d34f901 100644 --- a/dist/spa-apis.js +++ b/dist/spa-apis.js @@ -448,7 +448,7 @@ requestAnimationFrame(function() { $el.get(0).offsetWidth properties[transitionName] = '0.4s' - $el.css(properties).emulateTransitionEnd(function() { + $el.css(properties).emulateTransitionEndBySpa(function() { // 过渡动画结束后移除 transition properties = {} properties[transitionName] = '' @@ -466,7 +466,7 @@ } // transitionEnd 回调 - $.fn.emulateTransitionEnd = function(callback, duration) { + $.fn.emulateTransitionEndBySpa = function(callback, duration) { var called = false, $el = $(this), endtimer diff --git a/dist/spa-apis.min.js b/dist/spa-apis.min.js index 45cfe4d..6bc2f06 100644 --- a/dist/spa-apis.min.js +++ b/dist/spa-apis.min.js @@ -5,4 +5,4 @@ * Licensed under MIT https://raw.github.com/zhaoda/spa/master/LICENSE */ -!function(a){"use strict";function b(a){return a=a||v.href,a.replace(/^[^#]*#?\/?(.*)\/?$/,"$1")}function c(a){return"[object RegExp]"==Object.prototype.toString.call(a)}function d(a){return a=a.replace(R,"\\$&").replace(O,"(?:$1)?").replace(P,function(a,b){return b?a:"([^/]+)"}).replace(Q,"(.*?)"),"^"+a+"$"}function e(b,c){var d=b.exec(c).slice(1),e=[];return a.each(d,function(a,b){b&&e.push(decodeURIComponent(b))}),e}function f(a,b){K[a.data("id")],K[b.data("id")];a.css({zIndex:E}),b.css({zIndex:F})}function g(b,c,d,e){var f=a(".spa-page-body",b),g=(a(".spa-page-body",c),{});!T&&(d="defaultInOut"),X[d]||(d="defaultInOut"),z&&(z=!1,d="defaultInOut"),g.opacity=1,!Y(d)&&T&&(g[T]="translate(0, 0) scale(1, 1)"),f.css(g),W[d].apply(b,[b,c,e])}function h(a){event.stopPropagation(),event.preventDefault()}if(!a.os){var i={},j=navigator.userAgent,k=(navigator.platform,j.match(/(Android);?[\s\/]+([\d.]+)?/)),l=j.match(/(iPad).*OS\s([\d_]+)/),m=j.match(/(iPod)(.*OS\s([\d_]+))?/),n=!l&&j.match(/(iPhone\sOS)\s([\d_]+)/);k&&(i.android=!0,i.version=k[2]),n&&!m&&(i.ios=i.iphone=!0,i.version=n[2].replace(/_/g,".")),l&&(i.ios=i.ipad=!0,i.version=l[2].replace(/_/g,".")),m&&(i.ios=i.ipod=!0,i.version=m[3]?m[3].replace(/_/g,"."):null),a.os=i}var o,p,q,r,s,t=a(window),u=a(document),v=window.location,w=window.history,x=!1,y=!1,z=!0,A={},B={},C=[],D=2e3,E=2001,F=2002,G=0,H={},I={},J=[],K={},L="body {position: relative; margin: 0; padding: 0; width: 100%; overflow: hidden;} .spa-fullscreen {position: absolute; left: 0; top: 0; margin: 0; padding: 0; width: 100%; visibility: hidden; overflow: hidden; z-index: -1; } .spa-page {position: absolute; left: 0; top: 0; bottom: 0; right: 0; margin: 0; padding: 0; overflow: hidden; z-index: 2000; -webkit-transform: translateZ(0); -webkit-backface-visibility: hidden; -webkit-transform-style: preserve-3d;} .spa-page-bg {position: absolute; left: 0; top: 0; bottom: 0; right: 0; margin: 0; padding: 0; } .spa-page-body {position: absolute; left: 0; top: 0; bottom: 0; right: 0; margin: 0; padding: 0; overflow: hidden; -webkit-transform: translateZ(0); -webkit-backface-visibility: hidden; -webkit-transform-style: preserve-3d;} .spa-scroll {overflow: auto;} .spa-scroll-touch {-webkit-overflow-scrolling: touch; } .spa-scroll-x {overflow-y: hidden;} .spa-scroll-y {overflow-x: hidden;} .spa-cover {display: none; position: absolute; left: 0; right: 0; top: 0; bottom: 0; text-align: center; z-index: 5000; } .spa-loader {display: none; position: absolute; left: 0; right: 0; top: 0; bottom: 0; text-align: center; overflow: hidden; z-index: 5001; }",M='
',N=".spa-loader-animate {position: absolute; top: 50%; left: 50%;} .spa-loader-animate .bg {position: absolute; width: 64px; height: 64px; margin: 0 auto; top: -32px; left: -32px; border-radius: 50%; background: #2C3E50; opacity: 0.5;} .spa-loader-animate .ball {display: block; float: left; padding: 8px; margin-top: -8px; margin-left: -10px; -webkit-border-radius: 50%; -moz-border-radius: 50%; -ms-border-radius: 50%; -o-border-radius: 50%; border-radius: 50%;} .spa-loader-animate span:nth-child(2) {background: #16A085; -webkit-animation: move-left 800ms ease-in-out infinite alternate; -moz-animation: move-left 800ms ease-in-out infinite alternate; -ms-animation: move-left 800ms ease-in-out infinite alternate; -animation: move-left 800ms ease-in-out infinite alternate;} .spa-loader-animate .ball:nth-child(3) {background: #E67E22; -webkit-animation: move-right 800ms ease-in-out infinite alternate; -moz-animation: move-right 800ms ease-in-out infinite alternate; -ms-animation: move-right 800ms ease-in-out infinite alternate; animation: move-right 800ms ease-in-out infinite alternate;} @-webkit-keyframes move-left {to {-webkit-transform: translate(20px, 0); transform: translate(20px, 0); background: #e85932;}} @-webkit-keyframes move-right {to {-webkit-transform: translate(-20px, 0); transform: translate(-20px, 0); background: #44bbcc;}}";a.spa={},a.spa.getViewData=function(a){return K[a.data("id")]},a.spa.getCurPage=function(){return s},a.spa.version="1.0.7",u.on("spa:addstyle",function(b,c){a("head").append('")}),function(){var b,c,d,e,f=function(){d=Math.max(t.height(),window.innerHeight),e=Math.max(t.width(),window.innerWidth),q.css({height:2*d}),window.scrollTo(0,0),o.data("innerHeight",window.innerHeight),d=Math.max(t.height(),window.innerHeight),q.height()!=d&&(o.css({width:e,height:d}),q.css({width:e,height:d}))};t.on("spa:adjustfullscreen"+(a.os.ios?" orientationchange":""),function(a){void 0!==b&&(cancelAnimationFrame(b),b=void 0),b=requestAnimationFrame(f)}),a.os.android&&t.on("orientationchange",function(a){clearTimeout(c),c=setTimeout(f,500)}),t.on("resize",function(a){clearTimeout(c),c=setTimeout(f,200)})}(),u.on("spa:scroll",function(b,c){var d=a(b.target),e=c&&c.direction||"";d.addClass("spa-scroll"+(e?" spa-scroll-"+e:""))}),u.on("spa:removescroll",function(b,c){var d=a(b.target);d.removeClass("spa-scroll spa-scroll-x spa-scroll-y")}),a.os.ios&&u.on("touchstart",".spa-scroll, .spa-scroll-x, .spa-scroll-y",function(b){var c=a(b.currentTarget),d=c.prop("scrollTop"),e=c.prop("scrollLeft"),f=c.height(),g=c.width(),h=c.prop("scrollHeight"),i=c.prop("scrollWidth");(c.hasClass("spa-scroll")||c.hasClass("spa-scroll-x"))&&(0>=e&&c.prop("scrollLeft",1),e+g>=i&&c.prop("scrollLeft",i-g-1)),(c.hasClass("spa-scroll")||c.hasClass("spa-scroll-y"))&&(0>=d&&c.prop("scrollTop",1),d+f>=h&&c.prop("scrollTop",d-1))}),t.on("popstate",function(a){if(x){if(r&&"block"===r.css("display"))return!1;if(s&&s.hasClass("spa-panel")){var c=s.data("id"),d=K[c],e=d.prevPage;return e.trigger("spa:openpage"),!1}var f=b();if(!C.length||C[C.length-1]!==f){C.push(f);var g=H[f],h=a.state||{};if(p&&(h=p,p=void 0),g){var i=g.data("id"),j=K[i];j.oldpushData=j.pushData,j.pushData=h,g.trigger("spa:openpage")}else u.trigger("spa:createpage",{hash:f,pushData:h})}}});var O=/\((.*?)\)/g,P=/(\(\?)?:\w+/g,Q=/\*\w+/g,R=/[\-{}\[\]+?.,\\\^$|#\s]/g,S={route:"",animate:"",classname:"",view:function(){return{title:"",body:""}},init:function(){},beforeopen:function(){},afteropen:function(){},beforeclose:function(){},afterclose:function(){}};u.on("spa:route",function(b,e){var f=Array.prototype.slice.call(arguments,1);if(f.length>1)return a.each(f,function(a,b){u.trigger("spa:route",b)}),!1;var g=e.route||"";c(g)||(g=d(g)),e.animate&&!a.isFunction(e.animate)&&Y(e.animate)&&(e.animate=""),A[g]=a.extend({},S,e)});var T,U,V,W={},X={};!function(){var a,b={"-webkit-transition":["-webkit-transform","webkitTransitionEnd"],"-moz-transition":["-moz-transform","transitionend"],"-ms-transition":["-ms-transform","msTransitionEnd"],"-o-transition":["-o-transform","oTransitionEnd"],transition:["transform","transitionend"]},c=document.createElement("div");for(a in b)if(void 0!==c.style[a]){U=a,T=b[a][0],V=b[a][1];break}}(),a.fn.emulateTransition=function(b,c){var d=a(this);return requestAnimationFrame(function(){d.get(0).offsetWidth,b[U]="0.4s",d.css(b).emulateTransitionEnd(function(){b={},b[U]="",d.css(b),c&&c()})}),d},a.fn.transition||(a.fn.transition=a.fn.emulateTransition),a.fn.emulateTransitionEnd=function(b,c){var d,e=!1,f=a(this);c=c||500,f.one(V,function(){e=!0,clearTimeout(d),b.call(f)});var g=function(){e||f.trigger(V)};return d=setTimeout(g,c),f},W.defaultInOut=function(a,b,c){f(b,a),c()},u.on("spa:addTransitPageAnimates",function(b,c){var d=[];a.each(c,function(a,b){d.push(a)}),a.each(d,function(a,b){a%2===0?X[b]=d[a+1]:X[b]=d[a-1]}),a.extend(W,c)}),u.trigger("spa:addTransitPageAnimates",{fadeIn:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{opacity:0}),h={opacity:1};g.opacity=0,e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},fadeOut:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={opacity:0};e.emulateTransition(g,function(){f(c,b),d()})},slideInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(100%, 0)",h[T]="translate(0%, 0)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutRight:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(100%, 0)",e.emulateTransition(g,function(){f(c,b),d()})},slideInRight:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(-100%, 0)",h[T]="translate(0%, 0)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutLeft:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(-100%, 0)",e.emulateTransition(g,function(){f(c,b),d()})},slideInUp:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(0, 100%)",h[T]="translate(0, 0%)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutDown:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(0, 100%)",e.emulateTransition(g,function(){f(c,b),d()})},slideInDown:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(0, -100%)",h[T]="translate(0, 0%)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutUp:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(0, -100%)",e.emulateTransition(g,function(){f(c,b),d()})},pushInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(-100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(-100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushInRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(-100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(-100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushInUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, 100%)",j[T]="translate(0%, 0)",k[T]="translate(0, -100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, -100%)",j[T]="translate(0%, 0)",k[T]="translate(0, 100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushInDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, -100%)",j[T]="translate(0%, 0)",k[T]="translate(0, 100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, 100%)",j[T]="translate(0%, 0)",k[T]="translate(0, -100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},zoomIn:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="scale(0, 0)",h[T]="scale(1, 1)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},zoomOut:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="scale(0, 0)",e.emulateTransition(g,function(){f(c,b),d()})},overlayInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().width()),h={left:"auto",width:g},i={};i[T]="translate(0px, 0)",e.css(h),g=2*g-e.prop("clientWidth"),h={width:g},h[T]="translate("+g+"px, 0)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutRight:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.width(),h={},i={width:"auto",left:0};h[T]="translate("+g+"px, 0)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},overlayInRight:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().width()),h={right:"auto",width:g},i={};i[T]="translate(0px, 0)",e.css(h),g=2*g-e.prop("clientWidth"),h={width:g},h[T]="translate("+(0-g)+"px, 0)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutLeft:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.width(),h={},i={width:"auto",right:0};h[T]="translate("+(0-g)+"px, 0)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},overlayInUp:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().height()),h={top:"auto",height:g},i={};i[T]="translate(0, 0px)",e.css(h),g=2*g-e.prop("clientHeight"),h={height:g},h[T]="translate(0, "+g+"px)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutDown:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.height(),h={},i={height:"auto",top:0};h[T]="translate(0, "+g+"px)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},overlayInDown:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().height()),h={bottom:"auto",height:g},i={};i[T]="translate(0, 0px)",e.css(h),g=2*g-e.prop("clientHeight"),h={height:g},h[T]="translate(0, "+(0-g)+"px)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutUp:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.height(),h={},i={height:"auto",bottom:0};h[T]="translate(0, "+(0-g)+"px)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},revealInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i={left:"auto",width:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.width()-e.prop("clientWidth"),e.css({width:h}),j[T]="translate("+(0-h)+"px, 0)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.width(),{});h[T]="translate(0px, 0)",f(c,b),e.emulateTransition(h,function(){g.css({width:"auto",left:0}),d()})},revealInRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i={right:"auto",width:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.width()-e.prop("clientWidth"),e.css({width:h}),j[T]="translate("+h+"px, 0)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.width(),{});h[T]="translate(0px, 0)",f(c,b),e.emulateTransition(h,function(){g.css({width:"auto",right:0}),d()})},revealInUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i={top:"auto",height:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.height()-e.prop("clientHeight"),e.css({height:h}),j[T]="translate(0, "+(0-h)+"px)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.height(),{});h[T]="translate(0, 0px)",f(c,b),e.emulateTransition(h,function(){g.css({height:"auto",top:0}),d()})},revealInDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i={bottom:"auto",height:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.height()-e.prop("clientHeight"),e.css({height:h}),j[T]="translate(0, "+h+"px)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.height(),{});h[T]="translate(0, 0px)",f(c,b),e.emulateTransition(h,function(){g.css({height:"auto",bottom:0}),d()})},pushPartInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i=0,j={left:"auto",width:h},k={},l={};e.css(j),h=2*e.width()-e.prop("clientWidth"),j={width:h},j[T]="translate("+h+"px, 0)",k[T]="translate(0px, 0)",l[T]="translate("+(0-h)+"px, 0)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.width(),i=0,j={},k={},l={width:"auto",left:0};j[T]="translate(0px, 0)",k[T]="translate("+h+"px, 0)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})},pushPartInRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i=0,j={right:"auto",width:h},k={},l={};e.css(j),h=2*e.width()-e.prop("clientWidth"),j={width:h},j[T]="translate("+(0-h)+"px, 0)",l[T]="translate("+h+"px, 0)",k[T]="translate(0px, 0)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.width(),i=0,j={},k={},l={width:"auto",right:0};j[T]="translate(0px, 0)",k[T]="translate("+(0-h)+"px, 0)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})},pushPartInUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i=0,j={top:"auto",height:h},k={},l={};e.css(j),h=2*e.height()-e.prop("clientHeight"),j={height:h},j[T]="translate(0, "+h+"px)",k[T]="translate(0, 0px)",l[T]="translate(0, "+(0-h)+"px)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.height(),i=0,j={},k={},l={height:"auto",top:0};j[T]="translate(0, 0px)",k[T]="translate(0, "+h+"px)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})},pushPartInDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i=0,j={bottom:"auto",height:h},k={},l={};e.css(j),h=2*e.height()-e.prop("clientHeight"),j={height:h},j[T]="translate(0, "+(0-h)+"px)",k[T]="translate(0, 0px)",l[T]="translate(0, "+h+"px)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.height(),i=0,j={},k={},l={height:"auto",bottom:0};j[T]="translate(0, 0px)",k[T]="translate(0, "+(0-h)+"px)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})}});var Y=function(){var a=/^(overlay|reveal|pushPart).*$/;return function(b){return a.test(b)}}(),Z=function(){var a=0;return function(){return a++}}();u.on("spa:createpage",function(b,d){u.trigger("spa:openloader");var f,g,h,i=d.hash,j=d.pushData;if(a.each(A,function(a,b){return g=new RegExp(a),g.test(i)?(f=a,h=b,!1):void(g=!1)}),c(g)){var k,l,m=(h.classname?" spa-page-"+h.classname:"")+(h.nocache?" no-cache":""),n=a('
'),o=Z();n.data("id",o),k={id:o,hash:i,pushData:j,requestData:e(g,i),route:f,el:n},K[o]=k,!h.nocache&&u.trigger("spa:viewcache",{view:n}),l=h.view.call(n,k),a.isPlainObject(l)&&u.trigger("spa:initpage",[n,l])}}),u.on("spa:initpage",function(b,c,d){var e=c.data("id"),f=K[e],g=A[f.route];a.each(["init","beforeopen","afteropen","beforeclose","afterclose"],function(a,b){d[b]&&(g[b]=d[b])}),f.viewData=d,u.trigger("spa:closeloader"),a(".spa-page-body",c).html(d.body),o.append(c),c.trigger("spa:openpage")}),u.on("spa:openpage",".spa-page",function(c,d){var e=a(c.currentTarget),f=e.data("id"),h=K[f],i=A[h.route],j=h.hash,k=h.pushData,l=(h.oldpushData,h.requestData,h.viewData),m=k.title||l.title,n=!1,p=k.animate||i.animate;s||(o.append('
'),s=a(".spa-page-empty"));var q=s.data("id"),r=K[q]||{};if(!k.animate&&r.prevPage&&r.prevPage.data("id")===f){var v=r.prevAnimate;v&&!a.isFunction(v)&&(p=X[v]),n=!0}var w,x;if(s.hasClass("spa-panel")){var z=B[s.data("id")];w=z.beforeclose,x=z.afterclose}else if(r.route){var C=A[r.route];w=C.beforeclose,x=C.afterclose,u.trigger("spa:navigate",{hash:j,title:m,pushData:k,replace:!0})}var F=function(){e.data("spa:init")||(e.data("spa:init",!0),i.init.call(e,h),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",e).addClass("spa-scroll-touch")),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",s).removeClass("spa-scroll-touch"),x&&x.call(s,r),s.hasClass("no-cache")&&s.remove(),s.hasClass("spa-panel")?(s.css({zIndex:D}),h.prevPage&&h.prevPage.css({zIndex:E})):n||(h.prevPage=s),i.afteropen.call(e,h),s=e,h.hash!==b()?(y=!1,t.trigger("popstate")):(a.isFunction(d)&&d.call(e),y=!1)};w&&w.call(s,r),i.beforeopen.call(e,h),!n&&(h.prevAnimate=p),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",e).addClass("spa-scroll-touch"),n||r.prevPage&&r.prevPage.css({zIndex:D}),a.isFunction(p)?p(e,s,F):g(e,s,p,F),u.trigger("spa:viewcachesort",{view:e})});var $={id:"",animate:"",classname:"",view:function(){return{body:""}},init:function(){},beforeopen:function(){},afteropen:function(){},beforeclose:function(){},afterclose:function(){}};u.on("spa:panel",function(b,c){var d=Array.prototype.slice.call(arguments,1);return d.length>1?(a.each(d,function(a,b){u.trigger("spa:panel",b)}),!1):void(c.id&&!B[c.id]&&(B[c.id]=a.extend({},$,c)))}),u.on("spa:createpanel",function(b,c,d){var e=B[c];if(e){u.trigger("spa:openloader");var f,g,h=e.classname?" spa-panel-"+e.classname:"",i=a('
');i.data("id",c),f={id:c,pushData:d,el:i},K[c]=f,u.trigger("spa:viewcache",{view:i}),g=e.view.call(i,f),a.isPlainObject(g)&&i.trigger("spa:initpanel",[i,g])}}),u.on("spa:initpanel",function(b,c,d){var e=c.data("id"),f=K[e],g=f.pushData,h=B[e];a.each(["init","beforeopen","afteropen","beforeclose","afterclose"],function(a,b){d[b]&&(h[b]=d[b])}),f.viewData=d,a(".spa-page-body",c).html(d.body),o.append(c),u.trigger("spa:closeloader"),c.trigger("spa:openpanel",[e,g])}),u.on("spa:openpanel",function(b,c,d){if(r&&"block"===r.css("display"))return!1;var e=I[c];if(d||(d={}),e){if(y)return!1;y=!0;var f=B[c],h=d.animate||f.animate;if(s.hasClass("spa-panel")){var i=K[s.data("id")].prevPage;return i.trigger("spa:openpage",[function(){u.trigger("spa:openpanel",[c,d])}]),!1}var j=K[c];j.oldpushData=j.pushData,j.pushData=d,f.beforeopen.call(e,j);var k=function(){e.data("spa:init")||(e.data("spa:init",!0),f.init.call(e,j),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&setTimeout(function(){a(".spa-scroll",e).addClass("spa-scroll-touch")},17)),j.prevPage=s,f.afteropen.call(e,j),s=e,y=!1};j.prevAnimate=h,a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",e).addClass("spa-scroll-touch");var l=s.data("id"),m=K[l]||{};m.prevPage&&m.prevPage.css({zIndex:D}),a.isFunction(h)?h(e,s,k):g(e,s,h,k),u.trigger("spa:viewcachesort",{view:e})}else u.trigger("spa:createpanel",[c,d])}),u.on("spa:closepanel",function(b,c){var d=a(b.target),e=d.data("id"),f=K[e];if(c&&c.id&&(d=a(".spa-panel-"+c.id)),s.hasClass("spa-panel")&&s.data("id")===e){var g=f.prevPage;g.trigger("spa:openpage")}}),u.on("click touchstart",".spa-panel",function(b){var c=a(b.currentTarget),d=a(b.target);(d.hasClass("spa-page-bg")||d.hasClass("spa-panel"))&&(b.stopPropagation(),b.preventDefault(),c.trigger("spa:closepanel"))}),u.on("spa:viewcachecount",function(a,b){G=b.count}),u.on("spa:viewcache",function(b,c){var d,e,f=c.view,g=f.data("id");if(f.hasClass("spa-panel")?(d="panle",e=g,I[e]=f):(d="page",e=K[g].hash,H[e]=f),J.unshift(d+":"+e),0!==G&&J.length>G){var h,i,j,k,l=J.splice(G);a.each(l,function(b,c){h=c.split(":",2),i=h[0],j=h[1],k="page"==i?H:I,a("img",k[j]).remove(),k[j].html("").remove(),delete k[j]})}}),u.on("spa:viewcachesort",function(a,b){var c,d,e,f,g=b.view,h=g.data("id");g.hasClass("spa-panel")?(c="panle",d=h):(c="page",d=K[h].hash),e=c+":"+d,f=J.indexOf(e),-1!==f&&(J.splice(f,1),J.unshift(e))}),u.on("spa:navigate",function(b,c){var d=c.hash||"",e=c.title||"",f=c.pushData||{},g=c.replace||!1,h=c.url||"";if(e&&(document.title=e),d=h+"#"+d,g)w.replaceState(f,e,d);else{if(!s.hasClass("spa-panel")&&C.length&&"#"+C[C.length-1]===d)return;if(y)return!1;y=!0,w.pushState(f,e,d),!a.isEmptyObject(f)&&(p=f),t.trigger("popstate")}}),u.on("spa:loader",function(a,b){b.body&&(M=b.body),b.style&&(N=b.style)});var _;u.on("spa:openloader",function(a){_=setTimeout(function(){_=void 0,r.show()},300)}),u.on("spa:closeloader",function(a){_?(clearTimeout(_),_=void 0):r.hide()}),u.on("spa:boot",function(b,c){o=a("body"),u.trigger("spa:addstyle",L+N),o.append('
'+M+"
"),q=a(".spa-fullscreen"),u.trigger("spa:adjustfullscreen"),r=a(".spa-loader"),r.on("click select mousedown mousemove mouseup touchstart touchmove touchend",h),x=!0,t.trigger("popstate"),c&&c.callback&&c.callback()})}(window.Zepto||window.jQuery||window.$),function(){"use strict";for(var a=0,b=["ms","moz","webkit","o"],c=0;c'+c+"")}),function(){var b,c,d,e,f=function(){d=Math.max(t.height(),window.innerHeight),e=Math.max(t.width(),window.innerWidth),q.css({height:2*d}),window.scrollTo(0,0),o.data("innerHeight",window.innerHeight),d=Math.max(t.height(),window.innerHeight),q.height()!=d&&(o.css({width:e,height:d}),q.css({width:e,height:d}))};t.on("spa:adjustfullscreen"+(a.os.ios?" orientationchange":""),function(a){void 0!==b&&(cancelAnimationFrame(b),b=void 0),b=requestAnimationFrame(f)}),a.os.android&&t.on("orientationchange",function(a){clearTimeout(c),c=setTimeout(f,500)}),t.on("resize",function(a){clearTimeout(c),c=setTimeout(f,200)})}(),u.on("spa:scroll",function(b,c){var d=a(b.target),e=c&&c.direction||"";d.addClass("spa-scroll"+(e?" spa-scroll-"+e:""))}),u.on("spa:removescroll",function(b,c){var d=a(b.target);d.removeClass("spa-scroll spa-scroll-x spa-scroll-y")}),a.os.ios&&u.on("touchstart",".spa-scroll, .spa-scroll-x, .spa-scroll-y",function(b){var c=a(b.currentTarget),d=c.prop("scrollTop"),e=c.prop("scrollLeft"),f=c.height(),g=c.width(),h=c.prop("scrollHeight"),i=c.prop("scrollWidth");(c.hasClass("spa-scroll")||c.hasClass("spa-scroll-x"))&&(0>=e&&c.prop("scrollLeft",1),e+g>=i&&c.prop("scrollLeft",i-g-1)),(c.hasClass("spa-scroll")||c.hasClass("spa-scroll-y"))&&(0>=d&&c.prop("scrollTop",1),d+f>=h&&c.prop("scrollTop",d-1))}),t.on("popstate",function(a){if(x){if(r&&"block"===r.css("display"))return!1;if(s&&s.hasClass("spa-panel")){var c=s.data("id"),d=K[c],e=d.prevPage;return e.trigger("spa:openpage"),!1}var f=b();if(!C.length||C[C.length-1]!==f){C.push(f);var g=H[f],h=a.state||{};if(p&&(h=p,p=void 0),g){var i=g.data("id"),j=K[i];j.oldpushData=j.pushData,j.pushData=h,g.trigger("spa:openpage")}else u.trigger("spa:createpage",{hash:f,pushData:h})}}});var O=/\((.*?)\)/g,P=/(\(\?)?:\w+/g,Q=/\*\w+/g,R=/[\-{}\[\]+?.,\\\^$|#\s]/g,S={route:"",animate:"",classname:"",view:function(){return{title:"",body:""}},init:function(){},beforeopen:function(){},afteropen:function(){},beforeclose:function(){},afterclose:function(){}};u.on("spa:route",function(b,e){var f=Array.prototype.slice.call(arguments,1);if(f.length>1)return a.each(f,function(a,b){u.trigger("spa:route",b)}),!1;var g=e.route||"";c(g)||(g=d(g)),e.animate&&!a.isFunction(e.animate)&&Y(e.animate)&&(e.animate=""),A[g]=a.extend({},S,e)});var T,U,V,W={},X={};!function(){var a,b={"-webkit-transition":["-webkit-transform","webkitTransitionEnd"],"-moz-transition":["-moz-transform","transitionend"],"-ms-transition":["-ms-transform","msTransitionEnd"],"-o-transition":["-o-transform","oTransitionEnd"],transition:["transform","transitionend"]},c=document.createElement("div");for(a in b)if(void 0!==c.style[a]){U=a,T=b[a][0],V=b[a][1];break}}(),a.fn.emulateTransition=function(b,c){var d=a(this);return requestAnimationFrame(function(){d.get(0).offsetWidth,b[U]="0.4s",d.css(b).emulateTransitionEndBySpa(function(){b={},b[U]="",d.css(b),c&&c()})}),d},a.fn.transition||(a.fn.transition=a.fn.emulateTransition),a.fn.emulateTransitionEndBySpa=function(b,c){var d,e=!1,f=a(this);c=c||500,f.one(V,function(){e=!0,clearTimeout(d),b.call(f)});var g=function(){e||f.trigger(V)};return d=setTimeout(g,c),f},W.defaultInOut=function(a,b,c){f(b,a),c()},u.on("spa:addTransitPageAnimates",function(b,c){var d=[];a.each(c,function(a,b){d.push(a)}),a.each(d,function(a,b){a%2===0?X[b]=d[a+1]:X[b]=d[a-1]}),a.extend(W,c)}),u.trigger("spa:addTransitPageAnimates",{fadeIn:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{opacity:0}),h={opacity:1};g.opacity=0,e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},fadeOut:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={opacity:0};e.emulateTransition(g,function(){f(c,b),d()})},slideInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(100%, 0)",h[T]="translate(0%, 0)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutRight:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(100%, 0)",e.emulateTransition(g,function(){f(c,b),d()})},slideInRight:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(-100%, 0)",h[T]="translate(0%, 0)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutLeft:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(-100%, 0)",e.emulateTransition(g,function(){f(c,b),d()})},slideInUp:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(0, 100%)",h[T]="translate(0, 0%)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutDown:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(0, 100%)",e.emulateTransition(g,function(){f(c,b),d()})},slideInDown:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(0, -100%)",h[T]="translate(0, 0%)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutUp:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(0, -100%)",e.emulateTransition(g,function(){f(c,b),d()})},pushInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(-100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(-100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushInRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(-100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(-100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushInUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, 100%)",j[T]="translate(0%, 0)",k[T]="translate(0, -100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, -100%)",j[T]="translate(0%, 0)",k[T]="translate(0, 100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushInDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, -100%)",j[T]="translate(0%, 0)",k[T]="translate(0, 100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, 100%)",j[T]="translate(0%, 0)",k[T]="translate(0, -100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},zoomIn:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="scale(0, 0)",h[T]="scale(1, 1)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},zoomOut:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="scale(0, 0)",e.emulateTransition(g,function(){f(c,b),d()})},overlayInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().width()),h={left:"auto",width:g},i={};i[T]="translate(0px, 0)",e.css(h),g=2*g-e.prop("clientWidth"),h={width:g},h[T]="translate("+g+"px, 0)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutRight:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.width(),h={},i={width:"auto",left:0};h[T]="translate("+g+"px, 0)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},overlayInRight:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().width()),h={right:"auto",width:g},i={};i[T]="translate(0px, 0)",e.css(h),g=2*g-e.prop("clientWidth"),h={width:g},h[T]="translate("+(0-g)+"px, 0)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutLeft:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.width(),h={},i={width:"auto",right:0};h[T]="translate("+(0-g)+"px, 0)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},overlayInUp:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().height()),h={top:"auto",height:g},i={};i[T]="translate(0, 0px)",e.css(h),g=2*g-e.prop("clientHeight"),h={height:g},h[T]="translate(0, "+g+"px)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutDown:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.height(),h={},i={height:"auto",top:0};h[T]="translate(0, "+g+"px)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},overlayInDown:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().height()),h={bottom:"auto",height:g},i={};i[T]="translate(0, 0px)",e.css(h),g=2*g-e.prop("clientHeight"),h={height:g},h[T]="translate(0, "+(0-g)+"px)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutUp:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.height(),h={},i={height:"auto",bottom:0};h[T]="translate(0, "+(0-g)+"px)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},revealInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i={left:"auto",width:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.width()-e.prop("clientWidth"),e.css({width:h}),j[T]="translate("+(0-h)+"px, 0)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.width(),{});h[T]="translate(0px, 0)",f(c,b),e.emulateTransition(h,function(){g.css({width:"auto",left:0}),d()})},revealInRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i={right:"auto",width:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.width()-e.prop("clientWidth"),e.css({width:h}),j[T]="translate("+h+"px, 0)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.width(),{});h[T]="translate(0px, 0)",f(c,b),e.emulateTransition(h,function(){g.css({width:"auto",right:0}),d()})},revealInUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i={top:"auto",height:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.height()-e.prop("clientHeight"),e.css({height:h}),j[T]="translate(0, "+(0-h)+"px)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.height(),{});h[T]="translate(0, 0px)",f(c,b),e.emulateTransition(h,function(){g.css({height:"auto",top:0}),d()})},revealInDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i={bottom:"auto",height:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.height()-e.prop("clientHeight"),e.css({height:h}),j[T]="translate(0, "+h+"px)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.height(),{});h[T]="translate(0, 0px)",f(c,b),e.emulateTransition(h,function(){g.css({height:"auto",bottom:0}),d()})},pushPartInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i=0,j={left:"auto",width:h},k={},l={};e.css(j),h=2*e.width()-e.prop("clientWidth"),j={width:h},j[T]="translate("+h+"px, 0)",k[T]="translate(0px, 0)",l[T]="translate("+(0-h)+"px, 0)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.width(),i=0,j={},k={},l={width:"auto",left:0};j[T]="translate(0px, 0)",k[T]="translate("+h+"px, 0)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})},pushPartInRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i=0,j={right:"auto",width:h},k={},l={};e.css(j),h=2*e.width()-e.prop("clientWidth"),j={width:h},j[T]="translate("+(0-h)+"px, 0)",l[T]="translate("+h+"px, 0)",k[T]="translate(0px, 0)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.width(),i=0,j={},k={},l={width:"auto",right:0};j[T]="translate(0px, 0)",k[T]="translate("+(0-h)+"px, 0)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})},pushPartInUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i=0,j={top:"auto",height:h},k={},l={};e.css(j),h=2*e.height()-e.prop("clientHeight"),j={height:h},j[T]="translate(0, "+h+"px)",k[T]="translate(0, 0px)",l[T]="translate(0, "+(0-h)+"px)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.height(),i=0,j={},k={},l={height:"auto",top:0};j[T]="translate(0, 0px)",k[T]="translate(0, "+h+"px)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})},pushPartInDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i=0,j={bottom:"auto",height:h},k={},l={};e.css(j),h=2*e.height()-e.prop("clientHeight"),j={height:h},j[T]="translate(0, "+(0-h)+"px)",k[T]="translate(0, 0px)",l[T]="translate(0, "+h+"px)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.height(),i=0,j={},k={},l={height:"auto",bottom:0};j[T]="translate(0, 0px)",k[T]="translate(0, "+(0-h)+"px)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})}});var Y=function(){var a=/^(overlay|reveal|pushPart).*$/;return function(b){return a.test(b)}}(),Z=function(){var a=0;return function(){return a++}}();u.on("spa:createpage",function(b,d){u.trigger("spa:openloader");var f,g,h,i=d.hash,j=d.pushData;if(a.each(A,function(a,b){return g=new RegExp(a),g.test(i)?(f=a,h=b,!1):void(g=!1)}),c(g)){var k,l,m=(h.classname?" spa-page-"+h.classname:"")+(h.nocache?" no-cache":""),n=a('
'),o=Z();n.data("id",o),k={id:o,hash:i,pushData:j,requestData:e(g,i),route:f,el:n},K[o]=k,!h.nocache&&u.trigger("spa:viewcache",{view:n}),l=h.view.call(n,k),a.isPlainObject(l)&&u.trigger("spa:initpage",[n,l])}}),u.on("spa:initpage",function(b,c,d){var e=c.data("id"),f=K[e],g=A[f.route];a.each(["init","beforeopen","afteropen","beforeclose","afterclose"],function(a,b){d[b]&&(g[b]=d[b])}),f.viewData=d,u.trigger("spa:closeloader"),a(".spa-page-body",c).html(d.body),o.append(c),c.trigger("spa:openpage")}),u.on("spa:openpage",".spa-page",function(c,d){var e=a(c.currentTarget),f=e.data("id"),h=K[f],i=A[h.route],j=h.hash,k=h.pushData,l=(h.oldpushData,h.requestData,h.viewData),m=k.title||l.title,n=!1,p=k.animate||i.animate;s||(o.append('
'),s=a(".spa-page-empty"));var q=s.data("id"),r=K[q]||{};if(!k.animate&&r.prevPage&&r.prevPage.data("id")===f){var v=r.prevAnimate;v&&!a.isFunction(v)&&(p=X[v]),n=!0}var w,x;if(s.hasClass("spa-panel")){var z=B[s.data("id")];w=z.beforeclose,x=z.afterclose}else if(r.route){var C=A[r.route];w=C.beforeclose,x=C.afterclose,u.trigger("spa:navigate",{hash:j,title:m,pushData:k,replace:!0})}var F=function(){e.data("spa:init")||(e.data("spa:init",!0),i.init.call(e,h),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",e).addClass("spa-scroll-touch")),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",s).removeClass("spa-scroll-touch"),x&&x.call(s,r),s.hasClass("no-cache")&&s.remove(),s.hasClass("spa-panel")?(s.css({zIndex:D}),h.prevPage&&h.prevPage.css({zIndex:E})):n||(h.prevPage=s),i.afteropen.call(e,h),s=e,h.hash!==b()?(y=!1,t.trigger("popstate")):(a.isFunction(d)&&d.call(e),y=!1)};w&&w.call(s,r),i.beforeopen.call(e,h),!n&&(h.prevAnimate=p),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",e).addClass("spa-scroll-touch"),n||r.prevPage&&r.prevPage.css({zIndex:D}),a.isFunction(p)?p(e,s,F):g(e,s,p,F),u.trigger("spa:viewcachesort",{view:e})});var $={id:"",animate:"",classname:"",view:function(){return{body:""}},init:function(){},beforeopen:function(){},afteropen:function(){},beforeclose:function(){},afterclose:function(){}};u.on("spa:panel",function(b,c){var d=Array.prototype.slice.call(arguments,1);return d.length>1?(a.each(d,function(a,b){u.trigger("spa:panel",b)}),!1):void(c.id&&!B[c.id]&&(B[c.id]=a.extend({},$,c)))}),u.on("spa:createpanel",function(b,c,d){var e=B[c];if(e){u.trigger("spa:openloader");var f,g,h=e.classname?" spa-panel-"+e.classname:"",i=a('
');i.data("id",c),f={id:c,pushData:d,el:i},K[c]=f,u.trigger("spa:viewcache",{view:i}),g=e.view.call(i,f),a.isPlainObject(g)&&i.trigger("spa:initpanel",[i,g])}}),u.on("spa:initpanel",function(b,c,d){var e=c.data("id"),f=K[e],g=f.pushData,h=B[e];a.each(["init","beforeopen","afteropen","beforeclose","afterclose"],function(a,b){d[b]&&(h[b]=d[b])}),f.viewData=d,a(".spa-page-body",c).html(d.body),o.append(c),u.trigger("spa:closeloader"),c.trigger("spa:openpanel",[e,g])}),u.on("spa:openpanel",function(b,c,d){if(r&&"block"===r.css("display"))return!1;var e=I[c];if(d||(d={}),e){if(y)return!1;y=!0;var f=B[c],h=d.animate||f.animate;if(s.hasClass("spa-panel")){var i=K[s.data("id")].prevPage;return i.trigger("spa:openpage",[function(){u.trigger("spa:openpanel",[c,d])}]),!1}var j=K[c];j.oldpushData=j.pushData,j.pushData=d,f.beforeopen.call(e,j);var k=function(){e.data("spa:init")||(e.data("spa:init",!0),f.init.call(e,j),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&setTimeout(function(){a(".spa-scroll",e).addClass("spa-scroll-touch")},17)),j.prevPage=s,f.afteropen.call(e,j),s=e,y=!1};j.prevAnimate=h,a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",e).addClass("spa-scroll-touch");var l=s.data("id"),m=K[l]||{};m.prevPage&&m.prevPage.css({zIndex:D}),a.isFunction(h)?h(e,s,k):g(e,s,h,k),u.trigger("spa:viewcachesort",{view:e})}else u.trigger("spa:createpanel",[c,d])}),u.on("spa:closepanel",function(b,c){var d=a(b.target),e=d.data("id"),f=K[e];if(c&&c.id&&(d=a(".spa-panel-"+c.id)),s.hasClass("spa-panel")&&s.data("id")===e){var g=f.prevPage;g.trigger("spa:openpage")}}),u.on("click touchstart",".spa-panel",function(b){var c=a(b.currentTarget),d=a(b.target);(d.hasClass("spa-page-bg")||d.hasClass("spa-panel"))&&(b.stopPropagation(),b.preventDefault(),c.trigger("spa:closepanel"))}),u.on("spa:viewcachecount",function(a,b){G=b.count}),u.on("spa:viewcache",function(b,c){var d,e,f=c.view,g=f.data("id");if(f.hasClass("spa-panel")?(d="panle",e=g,I[e]=f):(d="page",e=K[g].hash,H[e]=f),J.unshift(d+":"+e),0!==G&&J.length>G){var h,i,j,k,l=J.splice(G);a.each(l,function(b,c){h=c.split(":",2),i=h[0],j=h[1],k="page"==i?H:I,a("img",k[j]).remove(),k[j].html("").remove(),delete k[j]})}}),u.on("spa:viewcachesort",function(a,b){var c,d,e,f,g=b.view,h=g.data("id");g.hasClass("spa-panel")?(c="panle",d=h):(c="page",d=K[h].hash),e=c+":"+d,f=J.indexOf(e),-1!==f&&(J.splice(f,1),J.unshift(e))}),u.on("spa:navigate",function(b,c){var d=c.hash||"",e=c.title||"",f=c.pushData||{},g=c.replace||!1,h=c.url||"";if(e&&(document.title=e),d=h+"#"+d,g)w.replaceState(f,e,d);else{if(!s.hasClass("spa-panel")&&C.length&&"#"+C[C.length-1]===d)return;if(y)return!1;y=!0,w.pushState(f,e,d),!a.isEmptyObject(f)&&(p=f),t.trigger("popstate")}}),u.on("spa:loader",function(a,b){b.body&&(M=b.body),b.style&&(N=b.style)});var _;u.on("spa:openloader",function(a){_=setTimeout(function(){_=void 0,r.show()},300)}),u.on("spa:closeloader",function(a){_?(clearTimeout(_),_=void 0):r.hide()}),u.on("spa:boot",function(b,c){o=a("body"),u.trigger("spa:addstyle",L+N),o.append('
'+M+"
"),q=a(".spa-fullscreen"),u.trigger("spa:adjustfullscreen"),r=a(".spa-loader"),r.on("click select mousedown mousemove mouseup touchstart touchmove touchend",h),x=!0,t.trigger("popstate"),c&&c.callback&&c.callback()})}(window.Zepto||window.jQuery||window.$),function(){"use strict";for(var a=0,b=["ms","moz","webkit","o"],c=0;c'+c+"")}),function(){var b,c,d,e,f=function(){d=Math.max(t.height(),window.innerHeight),e=Math.max(t.width(),window.innerWidth),q.css({height:2*d}),window.scrollTo(0,0),o.data("innerHeight",window.innerHeight),d=Math.max(t.height(),window.innerHeight),q.height()!=d&&(o.css({width:e,height:d}),q.css({width:e,height:d}))};t.on("spa:adjustfullscreen"+(a.os.ios?" orientationchange":""),function(a){void 0!==b&&(cancelAnimationFrame(b),b=void 0),b=requestAnimationFrame(f)}),a.os.android&&t.on("orientationchange",function(a){clearTimeout(c),c=setTimeout(f,500)}),t.on("resize",function(a){clearTimeout(c),c=setTimeout(f,200)})}(),u.on("spa:scroll",function(b,c){var d=a(b.target),e=c&&c.direction||"";d.addClass("spa-scroll"+(e?" spa-scroll-"+e:""))}),u.on("spa:removescroll",function(b,c){var d=a(b.target);d.removeClass("spa-scroll spa-scroll-x spa-scroll-y")}),a.os.ios&&u.on("touchstart",".spa-scroll, .spa-scroll-x, .spa-scroll-y",function(b){var c=a(b.currentTarget),d=c.prop("scrollTop"),e=c.prop("scrollLeft"),f=c.height(),g=c.width(),h=c.prop("scrollHeight"),i=c.prop("scrollWidth");(c.hasClass("spa-scroll")||c.hasClass("spa-scroll-x"))&&(0>=e&&c.prop("scrollLeft",1),e+g>=i&&c.prop("scrollLeft",i-g-1)),(c.hasClass("spa-scroll")||c.hasClass("spa-scroll-y"))&&(0>=d&&c.prop("scrollTop",1),d+f>=h&&c.prop("scrollTop",d-1))}),t.on("popstate",function(a){if(x){if(r&&"block"===r.css("display"))return!1;if(s&&s.hasClass("spa-panel")){var c=s.data("id"),d=K[c],e=d.prevPage;return e.trigger("spa:openpage"),!1}var f=b();if(!C.length||C[C.length-1]!==f){C.push(f);var g=H[f],h=a.state||{};if(p&&(h=p,p=void 0),g){var i=g.data("id"),j=K[i];j.oldpushData=j.pushData,j.pushData=h,g.trigger("spa:openpage")}else u.trigger("spa:createpage",{hash:f,pushData:h})}}});var O=/\((.*?)\)/g,P=/(\(\?)?:\w+/g,Q=/\*\w+/g,R=/[\-{}\[\]+?.,\\\^$|#\s]/g,S={route:"",animate:"",classname:"",view:function(){return{title:"",body:""}},init:function(){},beforeopen:function(){},afteropen:function(){},beforeclose:function(){},afterclose:function(){}};u.on("spa:route",function(b,e){var f=Array.prototype.slice.call(arguments,1);if(f.length>1)return a.each(f,function(a,b){u.trigger("spa:route",b)}),!1;var g=e.route||"";c(g)||(g=d(g)),e.animate&&!a.isFunction(e.animate)&&Y(e.animate)&&(e.animate=""),A[g]=a.extend({},S,e)});var T,U,V,W={},X={};!function(){var a,b={"-webkit-transition":["-webkit-transform","webkitTransitionEnd"],"-moz-transition":["-moz-transform","transitionend"],"-ms-transition":["-ms-transform","msTransitionEnd"],"-o-transition":["-o-transform","oTransitionEnd"],transition:["transform","transitionend"]},c=document.createElement("div");for(a in b)if(void 0!==c.style[a]){U=a,T=b[a][0],V=b[a][1];break}}(),a.fn.emulateTransition=function(b,c){var d=a(this);return requestAnimationFrame(function(){d.get(0).offsetWidth,b[U]="0.4s",d.css(b).emulateTransitionEnd(function(){b={},b[U]="",d.css(b),c&&c()})}),d},a.fn.transition||(a.fn.transition=a.fn.emulateTransition),a.fn.emulateTransitionEnd=function(b,c){var d,e=!1,f=a(this);c=c||500,f.one(V,function(){e=!0,clearTimeout(d),b.call(f)});var g=function(){e||f.trigger(V)};return d=setTimeout(g,c),f},W.defaultInOut=function(a,b,c){f(b,a),c()},u.on("spa:addTransitPageAnimates",function(b,c){var d=[];a.each(c,function(a,b){d.push(a)}),a.each(d,function(a,b){a%2===0?X[b]=d[a+1]:X[b]=d[a-1]}),a.extend(W,c)}),u.trigger("spa:addTransitPageAnimates",{fadeIn:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{opacity:0}),h={opacity:1};g.opacity=0,e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},fadeOut:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={opacity:0};e.emulateTransition(g,function(){f(c,b),d()})},slideInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(100%, 0)",h[T]="translate(0%, 0)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutRight:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(100%, 0)",e.emulateTransition(g,function(){f(c,b),d()})},slideInRight:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(-100%, 0)",h[T]="translate(0%, 0)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutLeft:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(-100%, 0)",e.emulateTransition(g,function(){f(c,b),d()})},slideInUp:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(0, 100%)",h[T]="translate(0, 0%)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutDown:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(0, 100%)",e.emulateTransition(g,function(){f(c,b),d()})},slideInDown:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(0, -100%)",h[T]="translate(0, 0%)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutUp:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(0, -100%)",e.emulateTransition(g,function(){f(c,b),d()})},pushInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(-100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(-100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushInRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(-100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(-100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushInUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, 100%)",j[T]="translate(0%, 0)",k[T]="translate(0, -100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, -100%)",j[T]="translate(0%, 0)",k[T]="translate(0, 100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushInDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, -100%)",j[T]="translate(0%, 0)",k[T]="translate(0, 100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, 100%)",j[T]="translate(0%, 0)",k[T]="translate(0, -100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},zoomIn:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="scale(0, 0)",h[T]="scale(1, 1)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},zoomOut:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="scale(0, 0)",e.emulateTransition(g,function(){f(c,b),d()})},overlayInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().width()),h={left:"auto",width:g},i={};i[T]="translate(0px, 0)",e.css(h),g=2*g-e.prop("clientWidth"),h={width:g},h[T]="translate("+g+"px, 0)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutRight:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.width(),h={},i={width:"auto",left:0};h[T]="translate("+g+"px, 0)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},overlayInRight:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().width()),h={right:"auto",width:g},i={};i[T]="translate(0px, 0)",e.css(h),g=2*g-e.prop("clientWidth"),h={width:g},h[T]="translate("+(0-g)+"px, 0)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutLeft:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.width(),h={},i={width:"auto",right:0};h[T]="translate("+(0-g)+"px, 0)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},overlayInUp:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().height()),h={top:"auto",height:g},i={};i[T]="translate(0, 0px)",e.css(h),g=2*g-e.prop("clientHeight"),h={height:g},h[T]="translate(0, "+g+"px)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutDown:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.height(),h={},i={height:"auto",top:0};h[T]="translate(0, "+g+"px)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},overlayInDown:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().height()),h={bottom:"auto",height:g},i={};i[T]="translate(0, 0px)",e.css(h),g=2*g-e.prop("clientHeight"),h={height:g},h[T]="translate(0, "+(0-g)+"px)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutUp:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.height(),h={},i={height:"auto",bottom:0};h[T]="translate(0, "+(0-g)+"px)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},revealInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i={left:"auto",width:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.width()-e.prop("clientWidth"),e.css({width:h}),j[T]="translate("+(0-h)+"px, 0)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.width(),{});h[T]="translate(0px, 0)",f(c,b),e.emulateTransition(h,function(){g.css({width:"auto",left:0}),d()})},revealInRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i={right:"auto",width:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.width()-e.prop("clientWidth"),e.css({width:h}),j[T]="translate("+h+"px, 0)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.width(),{});h[T]="translate(0px, 0)",f(c,b),e.emulateTransition(h,function(){g.css({width:"auto",right:0}),d()})},revealInUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i={top:"auto",height:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.height()-e.prop("clientHeight"),e.css({height:h}),j[T]="translate(0, "+(0-h)+"px)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.height(),{});h[T]="translate(0, 0px)",f(c,b),e.emulateTransition(h,function(){g.css({height:"auto",top:0}),d()})},revealInDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i={bottom:"auto",height:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.height()-e.prop("clientHeight"),e.css({height:h}),j[T]="translate(0, "+h+"px)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.height(),{});h[T]="translate(0, 0px)",f(c,b),e.emulateTransition(h,function(){g.css({height:"auto",bottom:0}),d()})},pushPartInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i=0,j={left:"auto",width:h},k={},l={};e.css(j),h=2*e.width()-e.prop("clientWidth"),j={width:h},j[T]="translate("+h+"px, 0)",k[T]="translate(0px, 0)",l[T]="translate("+(0-h)+"px, 0)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.width(),i=0,j={},k={},l={width:"auto",left:0};j[T]="translate(0px, 0)",k[T]="translate("+h+"px, 0)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})},pushPartInRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i=0,j={right:"auto",width:h},k={},l={};e.css(j),h=2*e.width()-e.prop("clientWidth"),j={width:h},j[T]="translate("+(0-h)+"px, 0)",l[T]="translate("+h+"px, 0)",k[T]="translate(0px, 0)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.width(),i=0,j={},k={},l={width:"auto",right:0};j[T]="translate(0px, 0)",k[T]="translate("+(0-h)+"px, 0)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})},pushPartInUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i=0,j={top:"auto",height:h},k={},l={};e.css(j),h=2*e.height()-e.prop("clientHeight"),j={height:h},j[T]="translate(0, "+h+"px)",k[T]="translate(0, 0px)",l[T]="translate(0, "+(0-h)+"px)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.height(),i=0,j={},k={},l={height:"auto",top:0};j[T]="translate(0, 0px)",k[T]="translate(0, "+h+"px)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})},pushPartInDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i=0,j={bottom:"auto",height:h},k={},l={};e.css(j),h=2*e.height()-e.prop("clientHeight"),j={height:h},j[T]="translate(0, "+(0-h)+"px)",k[T]="translate(0, 0px)",l[T]="translate(0, "+h+"px)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.height(),i=0,j={},k={},l={height:"auto",bottom:0};j[T]="translate(0, 0px)",k[T]="translate(0, "+(0-h)+"px)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})}});var Y=function(){var a=/^(overlay|reveal|pushPart).*$/;return function(b){return a.test(b)}}(),Z=function(){var a=0;return function(){return a++}}();u.on("spa:createpage",function(b,d){u.trigger("spa:openloader");var f,g,h,i=d.hash,j=d.pushData;if(a.each(A,function(a,b){return g=new RegExp(a),g.test(i)?(f=a,h=b,!1):void(g=!1)}),c(g)){var k,l,m=(h.classname?" spa-page-"+h.classname:"")+(h.nocache?" no-cache":""),n=a('
'),o=Z();n.data("id",o),k={id:o,hash:i,pushData:j,requestData:e(g,i),route:f,el:n},K[o]=k,!h.nocache&&u.trigger("spa:viewcache",{view:n}),l=h.view.call(n,k),a.isPlainObject(l)&&u.trigger("spa:initpage",[n,l])}}),u.on("spa:initpage",function(b,c,d){var e=c.data("id"),f=K[e],g=A[f.route];a.each(["init","beforeopen","afteropen","beforeclose","afterclose"],function(a,b){d[b]&&(g[b]=d[b])}),f.viewData=d,u.trigger("spa:closeloader"),a(".spa-page-body",c).html(d.body),o.append(c),c.trigger("spa:openpage")}),u.on("spa:openpage",".spa-page",function(c,d){var e=a(c.currentTarget),f=e.data("id"),h=K[f],i=A[h.route],j=h.hash,k=h.pushData,l=(h.oldpushData,h.requestData,h.viewData),m=k.title||l.title,n=!1,p=k.animate||i.animate;s||(o.append('
'),s=a(".spa-page-empty"));var q=s.data("id"),r=K[q]||{};if(!k.animate&&r.prevPage&&r.prevPage.data("id")===f){var v=r.prevAnimate;v&&!a.isFunction(v)&&(p=X[v]),n=!0}var w,x;if(s.hasClass("spa-panel")){var z=B[s.data("id")];w=z.beforeclose,x=z.afterclose}else if(r.route){var C=A[r.route];w=C.beforeclose,x=C.afterclose,u.trigger("spa:navigate",{hash:j,title:m,pushData:k,replace:!0})}var F=function(){e.data("spa:init")||(e.data("spa:init",!0),i.init.call(e,h),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",e).addClass("spa-scroll-touch")),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",s).removeClass("spa-scroll-touch"),x&&x.call(s,r),s.hasClass("no-cache")&&s.remove(),s.hasClass("spa-panel")?(s.css({zIndex:D}),h.prevPage&&h.prevPage.css({zIndex:E})):n||(h.prevPage=s),i.afteropen.call(e,h),s=e,h.hash!==b()?(y=!1,t.trigger("popstate")):(a.isFunction(d)&&d.call(e),y=!1)};w&&w.call(s,r),i.beforeopen.call(e,h),!n&&(h.prevAnimate=p),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",e).addClass("spa-scroll-touch"),n||r.prevPage&&r.prevPage.css({zIndex:D}),a.isFunction(p)?p(e,s,F):g(e,s,p,F),u.trigger("spa:viewcachesort",{view:e})});var $={id:"",animate:"",classname:"",view:function(){return{body:""}},init:function(){},beforeopen:function(){},afteropen:function(){},beforeclose:function(){},afterclose:function(){}};u.on("spa:panel",function(b,c){var d=Array.prototype.slice.call(arguments,1);return d.length>1?(a.each(d,function(a,b){u.trigger("spa:panel",b)}),!1):void(c.id&&!B[c.id]&&(B[c.id]=a.extend({},$,c)))}),u.on("spa:createpanel",function(b,c,d){var e=B[c];if(e){u.trigger("spa:openloader");var f,g,h=e.classname?" spa-panel-"+e.classname:"",i=a('
');i.data("id",c),f={id:c,pushData:d,el:i},K[c]=f,u.trigger("spa:viewcache",{view:i}),g=e.view.call(i,f),a.isPlainObject(g)&&i.trigger("spa:initpanel",[i,g])}}),u.on("spa:initpanel",function(b,c,d){var e=c.data("id"),f=K[e],g=f.pushData,h=B[e];a.each(["init","beforeopen","afteropen","beforeclose","afterclose"],function(a,b){d[b]&&(h[b]=d[b])}),f.viewData=d,a(".spa-page-body",c).html(d.body),o.append(c),u.trigger("spa:closeloader"),c.trigger("spa:openpanel",[e,g])}),u.on("spa:openpanel",function(b,c,d){if(r&&"block"===r.css("display"))return!1;var e=I[c];if(d||(d={}),e){if(y)return!1;y=!0;var f=B[c],h=d.animate||f.animate;if(s.hasClass("spa-panel")){var i=K[s.data("id")].prevPage;return i.trigger("spa:openpage",[function(){u.trigger("spa:openpanel",[c,d])}]),!1}var j=K[c];j.oldpushData=j.pushData,j.pushData=d,f.beforeopen.call(e,j);var k=function(){e.data("spa:init")||(e.data("spa:init",!0),f.init.call(e,j),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&setTimeout(function(){a(".spa-scroll",e).addClass("spa-scroll-touch")},17)),j.prevPage=s,f.afteropen.call(e,j),s=e,y=!1};j.prevAnimate=h,a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",e).addClass("spa-scroll-touch");var l=s.data("id"),m=K[l]||{};m.prevPage&&m.prevPage.css({zIndex:D}),a.isFunction(h)?h(e,s,k):g(e,s,h,k),u.trigger("spa:viewcachesort",{view:e})}else u.trigger("spa:createpanel",[c,d])}),u.on("spa:closepanel",function(b,c){var d=a(b.target),e=d.data("id"),f=K[e];if(c&&c.id&&(d=a(".spa-panel-"+c.id)),s.hasClass("spa-panel")&&s.data("id")===e){var g=f.prevPage;g.trigger("spa:openpage")}}),u.on("click touchstart",".spa-panel",function(b){var c=a(b.currentTarget),d=a(b.target);(d.hasClass("spa-page-bg")||d.hasClass("spa-panel"))&&(b.stopPropagation(),b.preventDefault(),c.trigger("spa:closepanel"))}),u.on("spa:viewcachecount",function(a,b){G=b.count}),u.on("spa:viewcache",function(b,c){var d,e,f=c.view,g=f.data("id");if(f.hasClass("spa-panel")?(d="panle",e=g,I[e]=f):(d="page",e=K[g].hash,H[e]=f),J.unshift(d+":"+e),0!==G&&J.length>G){var h,i,j,k,l=J.splice(G);a.each(l,function(b,c){h=c.split(":",2),i=h[0],j=h[1],k="page"==i?H:I,a("img",k[j]).remove(),k[j].html("").remove(),delete k[j]})}}),u.on("spa:viewcachesort",function(a,b){var c,d,e,f,g=b.view,h=g.data("id");g.hasClass("spa-panel")?(c="panle",d=h):(c="page",d=K[h].hash),e=c+":"+d,f=J.indexOf(e),-1!==f&&(J.splice(f,1),J.unshift(e))}),u.on("spa:navigate",function(b,c){var d=c.hash||"",e=c.title||"",f=c.pushData||{},g=c.replace||!1,h=c.url||"";if(e&&(document.title=e),d=h+"#"+d,g)w.replaceState(f,e,d);else{if(!s.hasClass("spa-panel")&&C.length&&"#"+C[C.length-1]===d)return;if(y)return!1;y=!0,w.pushState(f,e,d),!a.isEmptyObject(f)&&(p=f),t.trigger("popstate")}}),u.on("spa:loader",function(a,b){b.body&&(M=b.body),b.style&&(N=b.style)});var _;u.on("spa:openloader",function(a){_=setTimeout(function(){_=void 0,r.show()},300)}),u.on("spa:closeloader",function(a){_?(clearTimeout(_),_=void 0):r.hide()}),u.on("spa:boot",function(b,c){o=a("body"),u.trigger("spa:addstyle",L+N),o.append('
'+M+"
"),q=a(".spa-fullscreen"),u.trigger("spa:adjustfullscreen"),r=a(".spa-loader"),r.on("click select mousedown mousemove mouseup touchstart touchmove touchend",h),x=!0,t.trigger("popstate"),c&&c.callback&&c.callback()})}(window.Zepto||window.jQuery||window.$),function(){"use strict";for(var a=0,b=["ms","moz","webkit","o"],c=0;c'+c+"")}),function(){var b,c,d,e,f=function(){d=Math.max(t.height(),window.innerHeight),e=Math.max(t.width(),window.innerWidth),q.css({height:2*d}),window.scrollTo(0,0),o.data("innerHeight",window.innerHeight),d=Math.max(t.height(),window.innerHeight),q.height()!=d&&(o.css({width:e,height:d}),q.css({width:e,height:d}))};t.on("spa:adjustfullscreen"+(a.os.ios?" orientationchange":""),function(a){void 0!==b&&(cancelAnimationFrame(b),b=void 0),b=requestAnimationFrame(f)}),a.os.android&&t.on("orientationchange",function(a){clearTimeout(c),c=setTimeout(f,500)}),t.on("resize",function(a){clearTimeout(c),c=setTimeout(f,200)})}(),u.on("spa:scroll",function(b,c){var d=a(b.target),e=c&&c.direction||"";d.addClass("spa-scroll"+(e?" spa-scroll-"+e:""))}),u.on("spa:removescroll",function(b,c){var d=a(b.target);d.removeClass("spa-scroll spa-scroll-x spa-scroll-y")}),a.os.ios&&u.on("touchstart",".spa-scroll, .spa-scroll-x, .spa-scroll-y",function(b){var c=a(b.currentTarget),d=c.prop("scrollTop"),e=c.prop("scrollLeft"),f=c.height(),g=c.width(),h=c.prop("scrollHeight"),i=c.prop("scrollWidth");(c.hasClass("spa-scroll")||c.hasClass("spa-scroll-x"))&&(0>=e&&c.prop("scrollLeft",1),e+g>=i&&c.prop("scrollLeft",i-g-1)),(c.hasClass("spa-scroll")||c.hasClass("spa-scroll-y"))&&(0>=d&&c.prop("scrollTop",1),d+f>=h&&c.prop("scrollTop",d-1))}),t.on("popstate",function(a){if(x){if(r&&"block"===r.css("display"))return!1;if(s&&s.hasClass("spa-panel")){var c=s.data("id"),d=K[c],e=d.prevPage;return e.trigger("spa:openpage"),!1}var f=b();if(!C.length||C[C.length-1]!==f){C.push(f);var g=H[f],h=a.state||{};if(p&&(h=p,p=void 0),g){var i=g.data("id"),j=K[i];j.oldpushData=j.pushData,j.pushData=h,g.trigger("spa:openpage")}else u.trigger("spa:createpage",{hash:f,pushData:h})}}});var O=/\((.*?)\)/g,P=/(\(\?)?:\w+/g,Q=/\*\w+/g,R=/[\-{}\[\]+?.,\\\^$|#\s]/g,S={route:"",animate:"",classname:"",view:function(){return{title:"",body:""}},init:function(){},beforeopen:function(){},afteropen:function(){},beforeclose:function(){},afterclose:function(){}};u.on("spa:route",function(b,e){var f=Array.prototype.slice.call(arguments,1);if(f.length>1)return a.each(f,function(a,b){u.trigger("spa:route",b)}),!1;var g=e.route||"";c(g)||(g=d(g)),e.animate&&!a.isFunction(e.animate)&&Y(e.animate)&&(e.animate=""),A[g]=a.extend({},S,e)});var T,U,V,W={},X={};!function(){var a,b={"-webkit-transition":["-webkit-transform","webkitTransitionEnd"],"-moz-transition":["-moz-transform","transitionend"],"-ms-transition":["-ms-transform","msTransitionEnd"],"-o-transition":["-o-transform","oTransitionEnd"],transition:["transform","transitionend"]},c=document.createElement("div");for(a in b)if(void 0!==c.style[a]){U=a,T=b[a][0],V=b[a][1];break}}(),a.fn.emulateTransition=function(b,c){var d=a(this);return requestAnimationFrame(function(){d.get(0).offsetWidth,b[U]="0.4s",d.css(b).emulateTransitionEndBySpa(function(){b={},b[U]="",d.css(b),c&&c()})}),d},a.fn.transition||(a.fn.transition=a.fn.emulateTransition),a.fn.emulateTransitionEndBySpa=function(b,c){var d,e=!1,f=a(this);c=c||500,f.one(V,function(){e=!0,clearTimeout(d),b.call(f)});var g=function(){e||f.trigger(V)};return d=setTimeout(g,c),f},W.defaultInOut=function(a,b,c){f(b,a),c()},u.on("spa:addTransitPageAnimates",function(b,c){var d=[];a.each(c,function(a,b){d.push(a)}),a.each(d,function(a,b){a%2===0?X[b]=d[a+1]:X[b]=d[a-1]}),a.extend(W,c)}),u.trigger("spa:addTransitPageAnimates",{fadeIn:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{opacity:0}),h={opacity:1};g.opacity=0,e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},fadeOut:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={opacity:0};e.emulateTransition(g,function(){f(c,b),d()})},slideInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(100%, 0)",h[T]="translate(0%, 0)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutRight:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(100%, 0)",e.emulateTransition(g,function(){f(c,b),d()})},slideInRight:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(-100%, 0)",h[T]="translate(0%, 0)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutLeft:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(-100%, 0)",e.emulateTransition(g,function(){f(c,b),d()})},slideInUp:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(0, 100%)",h[T]="translate(0, 0%)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutDown:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(0, 100%)",e.emulateTransition(g,function(){f(c,b),d()})},slideInDown:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(0, -100%)",h[T]="translate(0, 0%)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutUp:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(0, -100%)",e.emulateTransition(g,function(){f(c,b),d()})},pushInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(-100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(-100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushInRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(-100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(-100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushInUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, 100%)",j[T]="translate(0%, 0)",k[T]="translate(0, -100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, -100%)",j[T]="translate(0%, 0)",k[T]="translate(0, 100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushInDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, -100%)",j[T]="translate(0%, 0)",k[T]="translate(0, 100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, 100%)",j[T]="translate(0%, 0)",k[T]="translate(0, -100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},zoomIn:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="scale(0, 0)",h[T]="scale(1, 1)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},zoomOut:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="scale(0, 0)",e.emulateTransition(g,function(){f(c,b),d()})},overlayInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().width()),h={left:"auto",width:g},i={};i[T]="translate(0px, 0)",e.css(h),g=2*g-e.prop("clientWidth"),h={width:g},h[T]="translate("+g+"px, 0)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutRight:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.width(),h={},i={width:"auto",left:0};h[T]="translate("+g+"px, 0)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},overlayInRight:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().width()),h={right:"auto",width:g},i={};i[T]="translate(0px, 0)",e.css(h),g=2*g-e.prop("clientWidth"),h={width:g},h[T]="translate("+(0-g)+"px, 0)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutLeft:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.width(),h={},i={width:"auto",right:0};h[T]="translate("+(0-g)+"px, 0)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},overlayInUp:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().height()),h={top:"auto",height:g},i={};i[T]="translate(0, 0px)",e.css(h),g=2*g-e.prop("clientHeight"),h={height:g},h[T]="translate(0, "+g+"px)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutDown:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.height(),h={},i={height:"auto",top:0};h[T]="translate(0, "+g+"px)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},overlayInDown:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().height()),h={bottom:"auto",height:g},i={};i[T]="translate(0, 0px)",e.css(h),g=2*g-e.prop("clientHeight"),h={height:g},h[T]="translate(0, "+(0-g)+"px)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutUp:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.height(),h={},i={height:"auto",bottom:0};h[T]="translate(0, "+(0-g)+"px)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},revealInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i={left:"auto",width:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.width()-e.prop("clientWidth"),e.css({width:h}),j[T]="translate("+(0-h)+"px, 0)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.width(),{});h[T]="translate(0px, 0)",f(c,b),e.emulateTransition(h,function(){g.css({width:"auto",left:0}),d()})},revealInRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i={right:"auto",width:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.width()-e.prop("clientWidth"),e.css({width:h}),j[T]="translate("+h+"px, 0)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.width(),{});h[T]="translate(0px, 0)",f(c,b),e.emulateTransition(h,function(){g.css({width:"auto",right:0}),d()})},revealInUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i={top:"auto",height:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.height()-e.prop("clientHeight"),e.css({height:h}),j[T]="translate(0, "+(0-h)+"px)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.height(),{});h[T]="translate(0, 0px)",f(c,b),e.emulateTransition(h,function(){g.css({height:"auto",top:0}),d()})},revealInDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i={bottom:"auto",height:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.height()-e.prop("clientHeight"),e.css({height:h}),j[T]="translate(0, "+h+"px)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.height(),{});h[T]="translate(0, 0px)",f(c,b),e.emulateTransition(h,function(){g.css({height:"auto",bottom:0}),d()})},pushPartInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i=0,j={left:"auto",width:h},k={},l={};e.css(j),h=2*e.width()-e.prop("clientWidth"),j={width:h},j[T]="translate("+h+"px, 0)",k[T]="translate(0px, 0)",l[T]="translate("+(0-h)+"px, 0)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.width(),i=0,j={},k={},l={width:"auto",left:0};j[T]="translate(0px, 0)",k[T]="translate("+h+"px, 0)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})},pushPartInRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i=0,j={right:"auto",width:h},k={},l={};e.css(j),h=2*e.width()-e.prop("clientWidth"),j={width:h},j[T]="translate("+(0-h)+"px, 0)",l[T]="translate("+h+"px, 0)",k[T]="translate(0px, 0)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.width(),i=0,j={},k={},l={width:"auto",right:0};j[T]="translate(0px, 0)",k[T]="translate("+(0-h)+"px, 0)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})},pushPartInUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i=0,j={top:"auto",height:h},k={},l={};e.css(j),h=2*e.height()-e.prop("clientHeight"),j={height:h},j[T]="translate(0, "+h+"px)",k[T]="translate(0, 0px)",l[T]="translate(0, "+(0-h)+"px)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.height(),i=0,j={},k={},l={height:"auto",top:0};j[T]="translate(0, 0px)",k[T]="translate(0, "+h+"px)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})},pushPartInDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i=0,j={bottom:"auto",height:h},k={},l={};e.css(j),h=2*e.height()-e.prop("clientHeight"),j={height:h},j[T]="translate(0, "+(0-h)+"px)",k[T]="translate(0, 0px)",l[T]="translate(0, "+h+"px)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.height(),i=0,j={},k={},l={height:"auto",bottom:0};j[T]="translate(0, 0px)",k[T]="translate(0, "+(0-h)+"px)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})}});var Y=function(){var a=/^(overlay|reveal|pushPart).*$/;return function(b){return a.test(b)}}(),Z=function(){var a=0;return function(){return a++}}();u.on("spa:createpage",function(b,d){u.trigger("spa:openloader");var f,g,h,i=d.hash,j=d.pushData;if(a.each(A,function(a,b){return g=new RegExp(a),g.test(i)?(f=a,h=b,!1):void(g=!1)}),c(g)){var k,l,m=(h.classname?" spa-page-"+h.classname:"")+(h.nocache?" no-cache":""),n=a('
'),o=Z();n.data("id",o),k={id:o,hash:i,pushData:j,requestData:e(g,i),route:f,el:n},K[o]=k,!h.nocache&&u.trigger("spa:viewcache",{view:n}),l=h.view.call(n,k),a.isPlainObject(l)&&u.trigger("spa:initpage",[n,l])}}),u.on("spa:initpage",function(b,c,d){var e=c.data("id"),f=K[e],g=A[f.route];a.each(["init","beforeopen","afteropen","beforeclose","afterclose"],function(a,b){d[b]&&(g[b]=d[b])}),f.viewData=d,u.trigger("spa:closeloader"),a(".spa-page-body",c).html(d.body),o.append(c),c.trigger("spa:openpage")}),u.on("spa:openpage",".spa-page",function(c,d){var e=a(c.currentTarget),f=e.data("id"),h=K[f],i=A[h.route],j=h.hash,k=h.pushData,l=(h.oldpushData,h.requestData,h.viewData),m=k.title||l.title,n=!1,p=k.animate||i.animate;s||(o.append('
'),s=a(".spa-page-empty"));var q=s.data("id"),r=K[q]||{};if(!k.animate&&r.prevPage&&r.prevPage.data("id")===f){var v=r.prevAnimate;v&&!a.isFunction(v)&&(p=X[v]),n=!0}var w,x;if(s.hasClass("spa-panel")){var z=B[s.data("id")];w=z.beforeclose,x=z.afterclose}else if(r.route){var C=A[r.route];w=C.beforeclose,x=C.afterclose,u.trigger("spa:navigate",{hash:j,title:m,pushData:k,replace:!0})}var F=function(){e.data("spa:init")||(e.data("spa:init",!0),i.init.call(e,h),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",e).addClass("spa-scroll-touch")),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",s).removeClass("spa-scroll-touch"),x&&x.call(s,r),s.hasClass("no-cache")&&s.remove(),s.hasClass("spa-panel")?(s.css({zIndex:D}),h.prevPage&&h.prevPage.css({zIndex:E})):n||(h.prevPage=s),i.afteropen.call(e,h),s=e,h.hash!==b()?(y=!1,t.trigger("popstate")):(a.isFunction(d)&&d.call(e),y=!1)};w&&w.call(s,r),i.beforeopen.call(e,h),!n&&(h.prevAnimate=p),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",e).addClass("spa-scroll-touch"),n||r.prevPage&&r.prevPage.css({zIndex:D}),a.isFunction(p)?p(e,s,F):g(e,s,p,F),u.trigger("spa:viewcachesort",{view:e})});var $={id:"",animate:"",classname:"",view:function(){return{body:""}},init:function(){},beforeopen:function(){},afteropen:function(){},beforeclose:function(){},afterclose:function(){}};u.on("spa:panel",function(b,c){var d=Array.prototype.slice.call(arguments,1);return d.length>1?(a.each(d,function(a,b){u.trigger("spa:panel",b)}),!1):void(c.id&&!B[c.id]&&(B[c.id]=a.extend({},$,c)))}),u.on("spa:createpanel",function(b,c,d){var e=B[c];if(e){u.trigger("spa:openloader");var f,g,h=e.classname?" spa-panel-"+e.classname:"",i=a('
');i.data("id",c),f={id:c,pushData:d,el:i},K[c]=f,u.trigger("spa:viewcache",{view:i}),g=e.view.call(i,f),a.isPlainObject(g)&&i.trigger("spa:initpanel",[i,g])}}),u.on("spa:initpanel",function(b,c,d){var e=c.data("id"),f=K[e],g=f.pushData,h=B[e];a.each(["init","beforeopen","afteropen","beforeclose","afterclose"],function(a,b){d[b]&&(h[b]=d[b])}),f.viewData=d,a(".spa-page-body",c).html(d.body),o.append(c),u.trigger("spa:closeloader"),c.trigger("spa:openpanel",[e,g])}),u.on("spa:openpanel",function(b,c,d){if(r&&"block"===r.css("display"))return!1;var e=I[c];if(d||(d={}),e){if(y)return!1;y=!0;var f=B[c],h=d.animate||f.animate;if(s.hasClass("spa-panel")){var i=K[s.data("id")].prevPage;return i.trigger("spa:openpage",[function(){u.trigger("spa:openpanel",[c,d])}]),!1}var j=K[c];j.oldpushData=j.pushData,j.pushData=d,f.beforeopen.call(e,j);var k=function(){e.data("spa:init")||(e.data("spa:init",!0),f.init.call(e,j),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&setTimeout(function(){a(".spa-scroll",e).addClass("spa-scroll-touch")},17)),j.prevPage=s,f.afteropen.call(e,j),s=e,y=!1};j.prevAnimate=h,a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",e).addClass("spa-scroll-touch");var l=s.data("id"),m=K[l]||{};m.prevPage&&m.prevPage.css({zIndex:D}),a.isFunction(h)?h(e,s,k):g(e,s,h,k),u.trigger("spa:viewcachesort",{view:e})}else u.trigger("spa:createpanel",[c,d])}),u.on("spa:closepanel",function(b,c){var d=a(b.target),e=d.data("id"),f=K[e];if(c&&c.id&&(d=a(".spa-panel-"+c.id)),s.hasClass("spa-panel")&&s.data("id")===e){var g=f.prevPage;g.trigger("spa:openpage")}}),u.on("click touchstart",".spa-panel",function(b){var c=a(b.currentTarget),d=a(b.target);(d.hasClass("spa-page-bg")||d.hasClass("spa-panel"))&&(b.stopPropagation(),b.preventDefault(),c.trigger("spa:closepanel"))}),u.on("spa:viewcachecount",function(a,b){G=b.count}),u.on("spa:viewcache",function(b,c){var d,e,f=c.view,g=f.data("id");if(f.hasClass("spa-panel")?(d="panle",e=g,I[e]=f):(d="page",e=K[g].hash,H[e]=f),J.unshift(d+":"+e),0!==G&&J.length>G){var h,i,j,k,l=J.splice(G);a.each(l,function(b,c){h=c.split(":",2),i=h[0],j=h[1],k="page"==i?H:I,a("img",k[j]).remove(),k[j].html("").remove(),delete k[j]})}}),u.on("spa:viewcachesort",function(a,b){var c,d,e,f,g=b.view,h=g.data("id");g.hasClass("spa-panel")?(c="panle",d=h):(c="page",d=K[h].hash),e=c+":"+d,f=J.indexOf(e),-1!==f&&(J.splice(f,1),J.unshift(e))}),u.on("spa:navigate",function(b,c){var d=c.hash||"",e=c.title||"",f=c.pushData||{},g=c.replace||!1,h=c.url||"";if(e&&(document.title=e),d=h+"#"+d,g)w.replaceState(f,e,d);else{if(!s.hasClass("spa-panel")&&C.length&&"#"+C[C.length-1]===d)return;if(y)return!1;y=!0,w.pushState(f,e,d),!a.isEmptyObject(f)&&(p=f),t.trigger("popstate")}}),u.on("spa:loader",function(a,b){b.body&&(M=b.body),b.style&&(N=b.style)});var _;u.on("spa:openloader",function(a){_=setTimeout(function(){_=void 0,r.show()},300)}),u.on("spa:closeloader",function(a){_?(clearTimeout(_),_=void 0):r.hide()}),u.on("spa:boot",function(b,c){o=a("body"),u.trigger("spa:addstyle",L+N),o.append('
'+M+"
"),q=a(".spa-fullscreen"),u.trigger("spa:adjustfullscreen"),r=a(".spa-loader"),r.on("click select mousedown mousemove mouseup touchstart touchmove touchend",h),x=!0,t.trigger("popstate"),c&&c.callback&&c.callback()})}(window.Zepto||window.jQuery||window.$),function(){"use strict";for(var a=0,b=["ms","moz","webkit","o"],c=0;c