/* skel-layers.js v1.0 | (c) n33 | n33.co | MIT licensed */
skel.registerPlugin("layers",function(e){function dn(e,r,i){var o,u;this.id=e,this.index=i,this[n]={breakpoints:T,states:T,position:T,side:T,animation:bt,orientation:bt,width:0,height:0,zIndex:this.index,html:"",hidden:H,exclusive:Ht,resetScroll:Ht,resetForms:Ht,swipeToClose:Ht,clickToClose:H},t._.extend(this[n],r),this[W]=t._.newDiv(this[n][It]),this[W].id=e,this[W]._layer=this,this[s]=T,this[tt]=T,this[St]=T,this[Qt]=H,u=t._.cacheElement(this.id,this[W],nt,1),u.onAttach=function(){var e=this.object._layer;e[ut]()||e.init(),e.resume()},u.onDetach=function(){var e=this.object._layer;e.suspend()},this[n].states&&this[n].states!=t._.sd?(o=t._[cn](this[n].states),t._[Wt](o,function(e){t._.addCachedElementToState(o[e],u)})):(this[n].breakpoints?o=t._[cn](this[n].breakpoints):o=t._.breakpointList,t._[Wt](o,function(e){t._.addCachedElementToBreakpoint(o[e],u)}))}var t,n="config",r="_skel_layers_translateOrigin",i="cache",s="$element",o="_skel_layers_translate",u="_skel_layers_resetForms",f="_skel_layers_resume",l="exclusiveLayer",c="activeWrapper",h="_skel_layers_promote",p="moveToInactiveWrapper",d="_skel_layers_demote",v="moveToActiveWrapper",m="setTimeout",g="right",y="bottom",b="useActive",w="deactivate",E="width",S="css",x="scrollTop",T=null,N="center",C="_skel_layers_suspend",k="position",L="prototype",A="left",O="wrapper",M="skel-layers-layer-z-index",_="_skel_layers_init",D="children",P="skel-layers-moved",H=!1,B="inactiveWrapper",j="transform",F=".skel-layers-fixed:not(.skel-layers-moved)",I="length",q="height",R="top",U="deviceType",z="touchstart.lock click.lock scroll.lock",W="element",X="stopPropagation",V='
1){for(t=0;t
0&&(t[dt](),t[S](E,(t.data($t)+r)/12*100+"%"))},e.fn[kt]=function(){return e(this).parents()[I]>0},e.fn[dt]=function(){var t=e(this);t[Lt]("class").match(/(\s+|^)([0-9]+)u(\s+|$)/)&&t.data($t,parseInt(RegExp.$2))},e.fn[h]=function(r){var i,s,o;if(this[I]>1){for(i=0;i-1*f&&t>l;break;case g:a=n-1*f&&t<-1*l;break;case R:a=t-1*f&&n>l;break;case y:a=t-1*f&&n<-1*l}if(a)return u[tt]=T,u[St]=T,u[w](),H}if(o[x]()==0&&n<0||s>i-2&&s0)return H}),this[s]=o},dn[L][ut]=function(){return this[s]!==T},dn[L][tn]=function(){return this[s].is(":visible")},dn[L][v]=function(){t[i][c][Ot](this[s])},dn[L][p]=function(){if(!this[s][kt]())return;t[i][B][Ot](this[s])},dn[L].resume=function(r){if(!this[ut]())return;this[s][Et](ln).each(function(){t.parseResume(e(this))}),this[n][it]||this[wt](r)},dn[L].suspend=function(){if(!this[ut]())return;this[s][r](),this[s][Et](ln).each(function(){t.parseSuspend(e(this))}),this[Qt]&&this[w]()},t={cache:{activeWrapper:T,body:T,exclusiveLayer:T,html:T,htmlbody:T,inactiveWrapper:T,layers:{},window:T,wrapper:T},config:{baseZIndex:1e4,layers:{},speed:250,transform:Ht,transformBreakpoints:T,transformTest:T},eventType:en,activate:function(e){t._[Mt](function(){t[i][At][e][wt]()})},deactivate:function(e){t._[Mt](function(){t[i][At][e][w]()})},toggle:function(e){t._[Mt](function(){var n=t[i][At][e];n[tn]()?n[w]():n[wt]()})},getBaseFontSize:function(){return t._[Kt].IEVersion<9?16.5:parseFloat(getComputedStyle(t[i][Yt].get(0)).fontSize)},getHalf:function(e){var t=parseInt(e);return typeof e=="string"&&e.charAt(e[I]-1)=="%"?Math.floor(t/2)+"%":Math.floor(t/2)+Gt},lockView:function(e){t[i][Q][jt]=t[i][Q][x](),t._[Kt][_t]&&t[i][hn][S](on+e,it),t[i][O].on(z,function(e){e[J](),e[X](),t[i][l]&&t[i][l][w]()}),t[i][Q].on(yt,function(e){t[i][l]&&t[i][l][w]()}),t._[Kt][_t]||t[i][Q].on(mt,function(e){t[i][l]&&t[i][l][w]()})},parseInit:function(n){var r,s,o=n.get(0),u=n[Lt]("data-action"),a=n[Lt]("data-args"),c,h;u&&a&&(a=a.split(","));switch(u){case"toggleLayer":case"layerToggle":n[S](st,Vt)[S]("cursor","pointer"),r=function(n){n[J](),n[X]();if(t[i][l])return t[i][l][w](),H;var r=e(this),s=t[i][At][a[0]];s[tn]()?s[w]():s[wt]()},t._[Kt][U]==pn||t._[Kt][U]=="wp"?n.on(en,r):n.on(t.eventType,r);break;case"navList":c=e(an+a[0]),r=c[Et]("a"),s=[],r.each(function(){var t=e(this),n,r;n=Math.max(0,t.parents("li")[I]-1),r=t[Lt]("href"),s.push(''+t.text()+"")}),s[I]>0&&n[It]("");break;case"copyText":c=e(an+a[0]),n[It](c.text());break;case"copyHTML":c=e(an+a[0]),n[It](c[It]());break;case"moveElementContents":c=e(an+a[0]),o[f]=function(){c[D]().each(function(){var t=e(this);n[Ot](t),t[Bt](P)})},o[C]=function(){n[D]().each(function(){var n=e(this);c[Ot](n),n[Xt](P),t.refresh(n)})},o[f]();break;case"moveElement":c=e(an+a[0]),o[f]=function(){e(V+c[Lt]("id")+'" />').insertBefore(c),n[Ot](c),c[Bt](P)},o[C]=function(){e(pt+c[Lt]("id")).replaceWith(c),c[Xt](P),t.refresh(c)},o[f]();break;case"moveCell":c=e(an+a[0]),h=e(an+a[1]),o[f]=function(){e(V+c[Lt]("id")+'" />').insertBefore(c),n[Ot](c),c[S](E,Ft),h&&h[Ct]()},o[C]=function(){e(pt+c[Lt]("id")).replaceWith(c),c[S](E,""),h&&h[S](E,"")},o[f]();break;default:}},parseResume:function(e){var t=e.get(0);t[f]&&t[f]()},parseSuspend:function(e){var t=e.get(0);t[C]&&t[C]()},recalc:function(e,n){var r=t._.parseMeasurement(e),i;switch(r[1]){case"%":i=Math.floor(n*(r[0]/100));break;case"em":i=t.getBaseFontSize()*r[0];break;default:case Gt:i=r[0]}return i},recalcH:function(n){return t.recalc(n,e(window)[q]())},recalcW:function(n){return t.recalc(n,e(window)[E]())},refresh:function(r){var s;t[n][j]&&(r?s=r.filter(F):s=e(F),s[_]()[Jt](t[i][c]))},unlockView:function(e){t._[Kt][_t]&&t[i][hn][S](on+e,Rt),t[i][O].off(z),t[i][Q].off(yt),t._[Kt][_t]||t[i][Q].off(mt)},init:function(){t[n][fn]&&(t[n][j]=t[n][fn]());if(t[n][j]){if(t._[Kt][U]==pn&&t._[Kt].deviceVersion<4||t._[Kt][U]=="wp")t[n][j]=H;t._[Kt].IEVersion<10&&(t[n][j]=H),t[n][qt]&&!t._.hasActive(t._[cn](t[n][qt]))&&(t[n][j]=H)}t.eventType=t._[Kt][_t]?"touchend":en,t.initObjects(),t.initTransforms(),t._[Mt](function(){t.initLayers(),t.initIncludes(),t._.updateState(),t.refresh()})},initIncludes:function(){e(".skel-layers-include").each(function(){t.parseInit(e(this))})},initLayers:function(){var r,s,o,u=1;t._[Wt](t[n][At],function(r){var s;if(!t[n][At][r][It]&&(s=e(an+r))[I]==0)return;o=new dn(r,t[n][At][r],u++),t[i][At][r]=o,s&&(s[D]()[Jt](o[W]),s.remove())})},initObjects:function(){t[i][Q]=e(window),t._[Mt](function(){t[i][It]=e(It),t[i][Yt]=e(Yt),t[i][hn]=e("html,body"),t[i][Yt].wrapInner(''),t[i][O]=e("#skel-layers-wrapper"),t[i][O][S](k,un)[S](A,"0")[S](g,"0")[S](R,"0")[_](),t[i][B]=e('')[Jt](t[i][Yt]),t[i][B][S](q,"100%"),t[i][c]=e('')[Jt](t[i][Yt]),t[i][c][S](k,un),t._[vt](nt,t[i][B][0]),t._[vt]("skel_layers_activeWrapper",t[i][c][0]),t._[vt]("skel_layers_wrapper",t[i][O][0]),e("[autofocus]").focus()})},initTransforms:function(){if(t[n][j])e.fn[r]=function(){return e(this)[o](0,0)},e.fn[o]=function(t,n){return e(this)[S](j,"translate("+t+"px, "+n+"px)")},e.fn[_]=function(){return e(this)[S]("backface-visibility",it)[S]("perspective","500")[Ut]("transition","transform "+t[n][xt]/1e3+"s ease-in-out")};else{var s,u=[];t[i][Q].resize(function(){if(t[n][xt]!=0){var e=t[n][xt];t[n][xt]=0,window[m](function(){t[n][xt]=e,u=[]},e)}}),e.fn[r]=function(){for(var r=0;r