(()=>{var Up=Object.create;var Sa=Object.defineProperty;var Vp=Object.getOwnPropertyDescriptor;var Hp=Object.getOwnPropertyNames;var qp=Object.getPrototypeOf,Gp=Object.prototype.hasOwnProperty;var N=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Wp=(e,t)=>{for(var r in t)Sa(e,r,{get:t[r],enumerable:!0})},$p=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Hp(t))!Gp.call(e,o)&&o!==r&&Sa(e,o,{get:()=>t[o],enumerable:!(n=Vp(t,o))||n.enumerable});return e};var Xt=(e,t,r)=>(r=e!=null?Up(qp(e)):{},$p(t||!e||!e.__esModule?Sa(r,"default",{value:e,enumerable:!0}):r,e));var Il=N((Ma,Pa)=>{(function(e,t){typeof Ma=="object"&&typeof Pa!="undefined"?Pa.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis!="undefined"?globalThis:e||self).LazyLoad=t()})(Ma,function(){"use strict";function e(){return e=Object.assign||function(v){for(var x=1;x<arguments.length;x++){var T=arguments[x];for(var C in T)Object.prototype.hasOwnProperty.call(T,C)&&(v[C]=T[C])}return v},e.apply(this,arguments)}var t=typeof window!="undefined",r=t&&!("onscroll"in window)||typeof navigator!="undefined"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),n=t&&"IntersectionObserver"in window,o=t&&"classList"in document.createElement("p"),a=t&&window.devicePixelRatio>1,i={elements_selector:".lazy",container:r||t?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},l=function(v){return e({},i,v)},c=function(v,x){var T,C="LazyLoad::Initialized",D=new v(x);try{T=new CustomEvent(C,{detail:{instance:D}})}catch(V){(T=document.createEvent("CustomEvent")).initCustomEvent(C,!1,!1,{instance:D})}window.dispatchEvent(T)},s="src",u="srcset",f="sizes",d="poster",p="llOriginalAttrs",m="data",w="loading",y="loaded",I="applied",R="error",q="native",F="data-",Q="ll-status",L=function(v,x){return v.getAttribute(F+x)},G=function(v){return L(v,Q)},B=function(v,x){return function(T,C,D){var V="data-ll-status";D!==null?T.setAttribute(V,D):T.removeAttribute(V)}(v,0,x)},U=function(v){return B(v,null)},ie=function(v){return G(v)===null},he=function(v){return G(v)===q},ye=[w,y,I,R],be=function(v,x,T,C){v&&(C===void 0?T===void 0?v(x):v(x,T):v(x,T,C))},E=function(v,x){o?v.classList.add(x):v.className+=(v.className?" ":"")+x},A=function(v,x){o?v.classList.remove(x):v.className=v.className.replace(new RegExp("(^|\\s+)"+x+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},h=function(v){return v.llTempImage},S=function(v,x){if(x){var T=x._observer;T&&T.unobserve(v)}},O=function(v,x){v&&(v.loadingCount+=x)},k=function(v,x){v&&(v.toLoadCount=x)},$=function(v){for(var x,T=[],C=0;x=v.children[C];C+=1)x.tagName==="SOURCE"&&T.push(x);return T},Z=function(v,x){var T=v.parentNode;T&&T.tagName==="PICTURE"&&$(T).forEach(x)},te=function(v,x){$(v).forEach(x)},re=[s],_e=[s,d],Te=[s,u,f],gt=[m],je=function(v){return!!v[p]},$e=function(v){return v[p]},yt=function(v){return delete v[p]},it=function(v,x){if(!je(v)){var T={};x.forEach(function(C){T[C]=v.getAttribute(C)}),v[p]=T}},Ne=function(v,x){if(je(v)){var T=$e(v);x.forEach(function(C){(function(D,V,j){j?D.setAttribute(V,j):D.removeAttribute(V)})(v,C,T[C])})}},Lt=function(v,x,T){E(v,x.class_applied),B(v,I),T&&(x.unobserve_completed&&S(v,x),be(x.callback_applied,v,T))},Ft=function(v,x,T){E(v,x.class_loading),B(v,w),T&&(O(T,1),be(x.callback_loading,v,T))},Xe=function(v,x,T){T&&v.setAttribute(x,T)},$t=function(v,x){Xe(v,f,L(v,x.data_sizes)),Xe(v,u,L(v,x.data_srcset)),Xe(v,s,L(v,x.data_src))},Re={IMG:function(v,x){Z(v,function(T){it(T,Te),$t(T,x)}),it(v,Te),$t(v,x)},IFRAME:function(v,x){it(v,re),Xe(v,s,L(v,x.data_src))},VIDEO:function(v,x){te(v,function(T){it(T,re),Xe(T,s,L(T,x.data_src))}),it(v,_e),Xe(v,d,L(v,x.data_poster)),Xe(v,s,L(v,x.data_src)),v.load()},OBJECT:function(v,x){it(v,gt),Xe(v,m,L(v,x.data_src))}},st=["IMG","IFRAME","VIDEO","OBJECT"],$r=function(v,x){!x||function(T){return T.loadingCount>0}(x)||function(T){return T.toLoadCount>0}(x)||be(v.callback_finish,x)},Xr=function(v,x,T){v.addEventListener(x,T),v.llEvLisnrs[x]=T},Lp=function(v,x,T){v.removeEventListener(x,T)},Ta=function(v){return!!v.llEvLisnrs},Ea=function(v){if(Ta(v)){var x=v.llEvLisnrs;for(var T in x){var C=x[T];Lp(v,T,C)}delete v.llEvLisnrs}},_l=function(v,x,T){(function(C){delete C.llTempImage})(v),O(T,-1),function(C){C&&(C.toLoadCount-=1)}(T),A(v,x.class_loading),x.unobserve_completed&&S(v,T)},Aa=function(v,x,T){var C=h(v)||v;Ta(C)||function(D,V,j){Ta(D)||(D.llEvLisnrs={});var H=D.tagName==="VIDEO"?"loadeddata":"load";Xr(D,H,V),Xr(D,"error",j)}(C,function(D){(function(V,j,H,ee){var de=he(j);_l(j,H,ee),E(j,H.class_loaded),B(j,y),be(H.callback_loaded,j,ee),de||$r(H,ee)})(0,v,x,T),Ea(C)},function(D){(function(V,j,H,ee){var de=he(j);_l(j,H,ee),E(j,H.class_error),B(j,R),be(H.callback_error,j,ee),H.restore_on_error&&Ne(j,Te),de||$r(H,ee)})(0,v,x,T),Ea(C)})},Ia=function(v,x,T){(function(C){return st.indexOf(C.tagName)>-1})(v)?function(C,D,V){Aa(C,D,V),function(j,H,ee){var de=Re[j.tagName];de&&(de(j,H),Ft(j,H,ee))}(C,D,V)}(v,x,T):function(C,D,V){(function(j){j.llTempImage=document.createElement("IMG")})(C),Aa(C,D,V),function(j){je(j)||(j[p]={backgroundImage:j.style.backgroundImage})}(C),function(j,H,ee){var de=L(j,H.data_bg),Ee=L(j,H.data_bg_hidpi),Ae=a&&Ee?Ee:de;Ae&&(j.style.backgroundImage='url("'.concat(Ae,'")'),h(j).setAttribute(s,Ae),Ft(j,H,ee))}(C,D,V),function(j,H,ee){var de=L(j,H.data_bg_multi),Ee=L(j,H.data_bg_multi_hidpi),Ae=a&&Ee?Ee:de;Ae&&(j.style.backgroundImage=Ae,Lt(j,H,ee))}(C,D,V),function(j,H,ee){var de=L(j,H.data_bg_set);if(de){var Ee=de.split("|"),Ae=Ee.map(function(lt){return"image-set(".concat(lt,")")});j.style.backgroundImage=Ae.join(),j.style.backgroundImage===""&&(Ae=Ee.map(function(lt){return"-webkit-image-set(".concat(lt,")")}),j.style.backgroundImage=Ae.join()),Lt(j,H,ee)}}(C,D,V)}(v,x,T)},wl=function(v){v.removeAttribute(s),v.removeAttribute(u),v.removeAttribute(f)},bl=function(v){Z(v,function(x){Ne(x,Te)}),Ne(v,Te)},Fp={IMG:bl,IFRAME:function(v){Ne(v,re)},VIDEO:function(v){te(v,function(x){Ne(x,re)}),Ne(v,_e),v.load()},OBJECT:function(v){Ne(v,gt)}},Qp=function(v,x){(function(T){var C=Fp[T.tagName];C?C(T):function(D){if(je(D)){var V=$e(D);D.style.backgroundImage=V.backgroundImage}}(T)})(v),function(T,C){ie(T)||he(T)||(A(T,C.class_entered),A(T,C.class_exited),A(T,C.class_applied),A(T,C.class_loading),A(T,C.class_loaded),A(T,C.class_error))}(v,x),U(v),yt(v)},Np=["IMG","IFRAME","VIDEO"],xl=function(v){return v.use_native&&"loading"in HTMLImageElement.prototype},Bp=function(v,x,T){v.forEach(function(C){return function(D){return D.isIntersecting||D.intersectionRatio>0}(C)?function(D,V,j,H){var ee=function(de){return ye.indexOf(G(de))>=0}(D);B(D,"entered"),E(D,j.class_entered),A(D,j.class_exited),function(de,Ee,Ae){Ee.unobserve_entered&&S(de,Ae)}(D,j,H),be(j.callback_enter,D,V,H),ee||Ia(D,j,H)}(C.target,C,x,T):function(D,V,j,H){ie(D)||(E(D,j.class_exited),function(ee,de,Ee,Ae){Ee.cancel_on_exit&&function(lt){return G(lt)===w}(ee)&&ee.tagName==="IMG"&&(Ea(ee),function(lt){Z(lt,function(Ca){wl(Ca)}),wl(lt)}(ee),bl(ee),A(ee,Ee.class_loading),O(Ae,-1),U(ee),be(Ee.callback_cancel,ee,de,Ae))}(D,V,j,H),be(j.callback_exit,D,V,H))}(C.target,C,x,T)})},Tl=function(v){return Array.prototype.slice.call(v)},eo=function(v){return v.container.querySelectorAll(v.elements_selector)},zp=function(v){return function(x){return G(x)===R}(v)},El=function(v,x){return function(T){return Tl(T).filter(ie)}(v||eo(x))},Yr=function(v,x){var T=l(v);this._settings=T,this.loadingCount=0,function(C,D){n&&!xl(C)&&(D._observer=new IntersectionObserver(function(V){Bp(V,C,D)},function(V){return{root:V.container===document?null:V.container,rootMargin:V.thresholds||V.threshold+"px"}}(C)))}(T,this),function(C,D){t&&(D._onlineHandler=function(){(function(V,j){var H;(H=eo(V),Tl(H).filter(zp)).forEach(function(ee){A(ee,V.class_error),U(ee)}),j.update()})(C,D)},window.addEventListener("online",D._onlineHandler))}(T,this),this.update(x)};return Yr.prototype={update:function(v){var x,T,C=this._settings,D=El(v,C);k(this,D.length),!r&&n?xl(C)?function(V,j,H){V.forEach(function(ee){Np.indexOf(ee.tagName)!==-1&&function(de,Ee,Ae){de.setAttribute("loading","lazy"),Aa(de,Ee,Ae),function(lt,Ca){var Al=Re[lt.tagName];Al&&Al(lt,Ca)}(de,Ee),B(de,q)}(ee,j,H)}),k(H,0)}(D,C,this):(T=D,function(V){V.disconnect()}(x=this._observer),function(V,j){j.forEach(function(H){V.observe(H)})}(x,T)):this.loadAll(D)},destroy:function(){this._observer&&this._observer.disconnect(),t&&window.removeEventListener("online",this._onlineHandler),eo(this._settings).forEach(function(v){yt(v)}),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(v){var x=this,T=this._settings;El(v,T).forEach(function(C){S(C,x),Ia(C,T,x)})},restoreAll:function(){var v=this._settings;eo(v).forEach(function(x){Qp(x,v)})}},Yr.load=function(v,x){var T=l(x);Ia(v,T)},Yr.resetStatus=function(v){U(v)},t&&function(v,x){if(x)if(x.length)for(var T,C=0;T=x[C];C+=1)c(v,T);else c(v,x)}(Yr,window.lazyLoadOptions),Yr})});var rc=N((tc,hi)=>{(function(e){"use strict";var t=function(){},r=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.msRequestAnimationFrame||function(s){return setTimeout(s,16)};function n(){var s=this;s.reads=[],s.writes=[],s.raf=r.bind(e),t("initialized",s)}n.prototype={constructor:n,runTasks:function(s){t("run tasks");for(var u;u=s.shift();)u()},measure:function(s,u){t("measure");var f=u?s.bind(u):s;return this.reads.push(f),o(this),f},mutate:function(s,u){t("mutate");var f=u?s.bind(u):s;return this.writes.push(f),o(this),f},clear:function(s){return t("clear",s),i(this.reads,s)||i(this.writes,s)},extend:function(s){if(t("extend",s),typeof s!="object")throw new Error("expected object");var u=Object.create(this);return l(u,s),u.fastdom=this,u.initialize&&u.initialize(),u},catch:null};function o(s){s.scheduled||(s.scheduled=!0,s.raf(a.bind(null,s)),t("flush scheduled"))}function a(s){t("flush");var u=s.writes,f=s.reads,d;try{t("flushing reads",f.length),s.runTasks(f),t("flushing writes",u.length),s.runTasks(u)}catch(p){d=p}if(s.scheduled=!1,(f.length||u.length)&&o(s),d)if(t("task errored",d.message),s.catch)s.catch(d);else throw d}function i(s,u){var f=s.indexOf(u);return!!~f&&!!s.splice(f,1)}function l(s,u){for(var f in u)u.hasOwnProperty(f)&&(s[f]=u[f])}var c=e.fastdom=e.fastdom||new n;typeof define=="function"?define(function(){return c}):typeof hi=="object"&&(hi.exports=c)})(typeof window!="undefined"?window:tc)});var cf=N((oa,uf)=>{(function(e,t){typeof oa=="object"&&typeof uf!="undefined"?t(oa):typeof define=="function"&&define.amd?define(["exports"],t):(e=typeof globalThis!="undefined"?globalThis:e||self,t(e.dynamicMarquee={}))})(oa,function(e){"use strict";function t(E,A){if(!(E instanceof A))throw new TypeError("Cannot call a class as a function")}function r(E,A){for(var h=0;h<A.length;h++){var S=A[h];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(E,S.key,S)}}function n(E,A,h){return A&&r(E.prototype,A),h&&r(E,h),Object.defineProperty(E,"prototype",{writable:!1}),E}function o(E){return a(E)||i(E)||l(E)||s()}function a(E){if(Array.isArray(E))return c(E)}function i(E){if(typeof Symbol!="undefined"&&E[Symbol.iterator]!=null||E["@@iterator"]!=null)return Array.from(E)}function l(E,A){if(E){if(typeof E=="string")return c(E,A);var h=Object.prototype.toString.call(E).slice(8,-1);if(h==="Object"&&E.constructor&&(h=E.constructor.name),h==="Map"||h==="Set")return Array.from(E);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return c(E,A)}}function c(E,A){(A==null||A>E.length)&&(A=E.length);for(var h=0,S=new Array(A);h<A;h++)S[h]=E[h];return S}function s(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var u=function(){function E(A){var h=A.onEnter,S=A.onExit;this._execution=null,this.inBoundary=this.inBoundary.bind(this),this.enter=this.enter.bind(this),this._onEnter=h||null,this._onExit=S||null}return E.prototype.inBoundary=function(){return!!this._execution},E.prototype.enter=function(A){if(this._execution)return A?A(this._execution.onEnterResult):void 0;var h=this._execution={onEnterResult:void 0},S=void 0,O=!1,k=void 0;try{this._onEnter&&(h.onEnterResult=this._onEnter()),A&&(S=A(h.onEnterResult))}catch(Z){O=!0,k=Z}this._execution=null;var $=!O;if(this._onExit)try{this._onExit({onEnterResult:h.onEnterResult,exceptionOccurred:O,retrieveException:function(){return $=!0,k}})}catch(Z){if($)throw Z}if(!$)throw k;return S},E}(),f={RIGHT:"right",DOWN:"down"},d=/px$/;function p(E){if(!d.test(E))throw new Error("String missing `px` suffix");return parseFloat(E.slice(0,-2))}var m=function(){function E(A){var h=this,S;t(this,E),this._$el=A,this._width=null,this._height=null,this._observer="ResizeObserver"in window?new ResizeObserver(function(O){var k=O[O.length-1],$=k.borderBoxSize[0]||k.borderBoxSize;h._width=$.inlineSize,h._height=$.blockSize}):null,(S=this._observer)===null||S===void 0||S.observe(A)}return n(E,[{key:"getWidth",value:function(){if(this._width!==null)return this._width;var h=p(window.getComputedStyle(this._$el).width);return this._observer&&(this._width=h),h}},{key:"getHeight",value:function(){if(this._height!==null)return this._height;var h=p(window.getComputedStyle(this._$el).height);return this._observer&&(this._height=h),h}},{key:"tearDown",value:function(){var h;(h=this._observer)===null||h===void 0||h.disconnect(),this._observer=null}}]),E}(),w=function(){function E(A,h,S){t(this,E);var O=document.createElement("div");O.style.display="block",O.style.opacity="0",O.style.position="absolute",O.style.margin="0",O.style.padding="0",h===f.RIGHT&&(O.style.whiteSpace="nowrap"),this._sizeWatcher=new m(O),O.appendChild(A),this._$container=O,this._$el=A,this._direction=h,this._metadata=S,this._offset=null}return n(E,[{key:"getSize",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},S=h.inverse,O=S===void 0?!1:S,k=this._direction;return O&&(k=k===f.RIGHT?f.DOWN:f.RIGHT),k===f.RIGHT?this._sizeWatcher.getWidth():this._sizeWatcher.getHeight()}},{key:"setOffset",value:function(h){this._offset!==h&&(this._offset=h,this._$container.style.opacity="1",this._direction===f.RIGHT?this._$container.style.left="".concat(h,"px"):this._$container.style.top="".concat(h,"px"))}},{key:"remove",value:function(){this._sizeWatcher.tearDown(),this._$container.parentNode.removeChild(this._$container)}},{key:"getContainer",value:function(){return this._$container}},{key:"getOriginalEl",value:function(){return this._$el}},{key:"getMetadata",value:function(){return this._metadata}}]),E}(),y=3e4,I=function(){function E(A,h){t(this,E),this._$el=A,this._direction=h,this._transitionState=null}return n(E,[{key:"setOffset",value:function(h,S,O){var k=this._transitionState,$=!k||k.rate!==S;if(k&&!O){var Z=performance.now()-k.time;if(Z<y-1e4&&!$)return}if((O||$)&&(this._direction===f.RIGHT?this._$el.style.transform="translateX(".concat(h,"px)"):this._$el.style.transform="translateY(".concat(h,"px)"),this._$el.style.transition="none",this._$el.offsetLeft),S&&(O||$)&&(this._$el.style.transition="transform ".concat(y,"ms linear")),S){var te=h+S/1e3*y;this._direction===f.RIGHT?this._$el.style.transform="translateX(".concat(te,"px)"):this._$el.style.transform="translateY(".concat(te,"px)")}this._transitionState={time:performance.now(),rate:S}}}]),E}();function R(E){window.setTimeout(function(){return E()},0)}function q(E){try{return E()}catch(A){R(function(){throw A})}}function F(E){if(typeof E=="string"||typeof E=="number"){var A=document.createElement("div");return A.textContent=E+"",A}return E}function Q(E){return E.length?E[E.length-1]:null}function L(E){return E.length?E[0]:null}var G=5e5,B=100,U=function(){function E(A){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=h.rate,O=S===void 0?-25:S,k=h.upDown,$=k===void 0?!1:k,Z=h.startOnScreen,te=Z===void 0?!1:Z;t(this,E),this._boundary=new u({onEnter:function(){return{callbacks:[]}},onExit:function(gt){var je=gt.onEnterResult.callbacks;je.forEach(function($e){return R(function(){return $e()})})}}),this._waitingForItem=!0,this._nextItemWouldBeTouching=te,this._rate=O,this._lastEffectiveRate=O,this._justReversedRate=!1,this._correlation=null,this._direction=$?f.DOWN:f.RIGHT,this._onItemRequired=[],this._onItemRemoved=[],this._onAllItemsRemoved=[],this._windowOffset=0,this._containerSize=0,this._containerSizeWatcher=null,this._items=[],this._pendingItem=null,this._visible=!!document.hidden;var re=document.createElement("div");re.style.display="block",re.style.overflow="hidden",re.style.position="relative",this._direction===f.DOWN&&(re.style.height="100%"),this._$window=re,this.windowInverseSize=null,this._updateWindowInverseSize();var _e=document.createElement("div");this._$moving=_e,_e.style.display="block",_e.style.position="absolute",_e.style.left="0",_e.style.right="0",this._slider=new I(_e,this._direction),re.appendChild(_e),A.appendChild(re)}return n(E,[{key:"onItemRequired",value:function(h){this._onItemRequired.push(h)}},{key:"onItemRemoved",value:function(h){this._onItemRemoved.push(h)}},{key:"onAllItemsRemoved",value:function(h){this._onAllItemsRemoved.push(h)}},{key:"getNumItems",value:function(){return this._items.length}},{key:"setRate",value:function(h){h!==this._rate&&(h*this._lastEffectiveRate<0&&(this._justReversedRate=!this._justReversedRate),this._rate=h,h?(this._lastEffectiveRate=h,this._items.length||(this._waitingForItem=!0)):this._waitingForItem=!1,this._tick())}},{key:"getRate",value:function(){return this._rate}},{key:"clear",value:function(){var h=this;this._boundary.enter(function(){h._items.forEach(function(S){var O=S.item;return h._removeItem(O)}),h._items=[],h._waitingForItem=!0,h._nextItemWouldBeTouching=!1,h._updateWindowInverseSize(),h._cleanup()})}},{key:"isWaitingForItem",value:function(){return this._waitingForItem}},{key:"appendItem",value:function(h){var S=this,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},k=O.metadata,$=k===void 0?null:k;this._boundary.enter(function(){if(!S._waitingForItem)throw new Error("No room for item.");h=F(h);var Z=S._items.some(function(te){var re=te.item;return re.getOriginalEl()===h});if(Z)throw new Error("Item already exists.");S._waitingForItem=!1,S._pendingItem=new w(h,S._direction,$),S._tick()})}},{key:"_removeItem",value:function(h){var S=this;this._boundary.enter(function(O){var k=O.callbacks;h.remove(),S._items.splice(S._items.indexOf(h),1),S._onItemRemoved.forEach(function($){k.push(function(){return $(h.getOriginalEl())})})})}},{key:"_updateWindowInverseSize",value:function(){if(this._direction!==f.DOWN){var h=Math.max.apply(Math,o(this._items.map(function(S){var O=S.item;return O.getSize({inverse:!0})})));this.windowInverseSize!==h&&(this.windowInverseSize=h,this._$window.style.height="".concat(h,"px"))}}},{key:"_scheduleRender",value:function(){var h=this;this._renderTimer||(this._renderTimer=window.setTimeout(function(){return h._tick()},B))}},{key:"_cleanup",value:function(){var h;(h=this._containerSizeWatcher)===null||h===void 0||h.tearDown(),this._containerSizeWatcher=null,this._correlation=null,this._windowOffset=0}},{key:"_tick",value:function(){var h=this;this._boundary.enter(function(S){var O=S.callbacks;if(h._renderTimer&&clearTimeout(h._renderTimer),h._renderTimer=null,!h._items.length&&!h._pendingItem){h._cleanup();return}if(h._scheduleRender(),!h._$window.isConnected){h._correlation=null;return}h._containerSizeWatcher||(h._containerSizeWatcher=new m(h._$window));var k=performance.now(),$=!1;if(h._correlation){var Z=k-h._correlation.time;h._windowOffset=h._correlation.offset+h._correlation.rate*-1*(Z/1e3)}else $=!0;if(Math.abs(h._windowOffset)>G){$=!0;var te=h._windowOffset;h._items.forEach(function(Re){return Re.offset-=te}),h._correlation=null,h._windowOffset=0}var re=!document.hidden,_e=re&&h._visible!==re;h._visible=re,h._slider.setOffset(h._windowOffset*-1,h._rate,$||_e),(!h._correlation||h._correlation.rate!==h._rate)&&(h._correlation={time:k,offset:h._windowOffset,rate:h._rate}),h._containerSize=h._direction===f.RIGHT?h._containerSizeWatcher.getWidth():h._containerSizeWatcher.getHeight();var Te=Math.max(h._containerSize,1),gt=h._justReversedRate;h._justReversedRate=!1;var je=h._nextItemWouldBeTouching;h._nextItemWouldBeTouching=null;var $e=null;if(h._pendingItem){h._$moving.appendChild(h._pendingItem.getContainer());var yt=h._rate<=0?Q(h._items):L(h._items);h._rate<=0?h._items=[].concat(o(h._items),[{item:h._pendingItem,appendRate:h._rate,offset:je?yt?yt.offset+yt.item.getSize():h._windowOffset:h._windowOffset+Te}]):h._items=[{item:h._pendingItem,appendRate:h._rate,offset:je?yt?yt.offset-h._pendingItem.getSize():h._windowOffset+Te-h._pendingItem.getSize():h._windowOffset-h._pendingItem.getSize()}].concat(o(h._items)),h._pendingItem=null}var it=B/1e3*Math.abs(h._rate),Ne=!1;if(!h._waitingForItem&&h._items.length){var Lt=L(h._items),Ft=Q(h._items),Xe=h._rate<=0?Ft:Lt;(h._rate<=0&&Ft.offset+Xe.item.getSize()-h._windowOffset<=Te+it||h._rate>0&&Xe.offset-h._windowOffset>-1*it)&&(h._waitingForItem=Ne=!0,$e=gt?null:{$el:Xe.item.getOriginalEl(),metadata:Xe.item.getMetadata()})}if($e&&(h._nextItemWouldBeTouching=!0),h._items=o(h._items).filter(function(Re){var st=Re.item,$r=Re.offset,Xr=h._rate<0?$r+st.getSize()>h._windowOffset:$r<h._windowOffset+Te;return Xr||h._removeItem(st),Xr}),h._items.length||h._onAllItemsRemoved.forEach(function(Re){return O.push(Re)}),h._items.reduce(function(Re,st){return Re!==null&&st.offset<Re&&(st.offset=Re),st.item.setOffset(st.offset),st.offset+st.item.getSize()},null),h._updateWindowInverseSize(),Ne){var $t;h._onItemRequired.some(function(Re){return q(function(){return $t=Re({immediatelyFollowsPrevious:!!$e,touching:$e}),!!$t})}),$t&&h.appendItem($t),h._nextItemWouldBeTouching=!1}})}}]),E}(),ie=function(E){var A={};return E.forEach(function(h,S){A[h]=A[h]||[],A[h].push(S)}),A},he=function(E,A){var h={startString1:0,startString2:0,length:0},S=ie(E),O=[];return A.forEach(function(k,$){var Z,te=[],re=S[k]||[];re.forEach(function(_e){Z=(_e&&O[_e-1]||0)+1,Z>h.length&&(h.length=Z,h.startString1=_e-Z+1,h.startString2=$-Z+1),te[_e]=Z}),O=te}),h},ye=he;function be(E){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,S=-1,O=A.slice(),k=function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,re=(S+te)%O.length;return{builder:O[re],index:re}},$=function(te){var re;if(!(!O.length||!E.isWaitingForItem())){if(h&&te&&((re=te.metadata)===null||re===void 0?void 0:re.isSeperator)!==!0){var _e=F(h());E.appendItem(_e,{metadata:{isSeperator:!0}});return}var Te=k(),gt=Te.builder,je=Te.index;S=je,E.appendItem(F(gt()))}};return E.onItemRequired(function(Z){var te=Z.touching;return $(te)}),$(),{update:function(te){var re=function(){var Te=O.map(function(Ne,Lt){var Ft=O.indexOf(Ne);return Ft<Lt?Ft:Lt}),gt=te.map(function(Ne,Lt){return O.indexOf(Ne)}),je=ye(Te,gt),$e=je.startString1,yt=je.startString2,it=je.length;return S>=$e&&S<$e+it?S+(yt-$e):-1};S=re(),O=te.slice(),$(!1)}}}e.Marquee=U,e.loop=be,Object.defineProperty(e,"__esModule",{value:!0})})});var yf=N((AR,gf)=>{gf.exports=[{name:"Bounce",paramsTypes:{shadow_colour:"vec4",shadow_height:"float",bounces:"float"},defaultParams:{shadow_colour:[0,0,0,.6],shadow_height:.075,bounces:3},glsl:`// Author: Adrian Purser
// License: MIT

uniform vec4 shadow_colour; // = vec4(0.,0.,0.,.6)
uniform float shadow_height; // = 0.075
uniform float bounces; // = 3.0

const float PI = 3.14159265358;

vec4 transition (vec2 uv) {
  float time = progress;
  float stime = sin(time * PI / 2.);
  float phase = time * PI * bounces;
  float y = (abs(cos(phase))) * (1.0 - stime);
  float d = uv.y - y;
  return mix(
    mix(
      getToColor(uv),
      shadow_colour,
      step(d, shadow_height) * (1. - mix(
        ((d / shadow_height) * shadow_colour.a) + (1.0 - shadow_colour.a),
        1.0,
        smoothstep(0.95, 1., progress) // fade-out the shadow at the end
      ))
    ),
    getFromColor(vec2(uv.x, uv.y + (1.0 - y))),
    step(d, 0.0)
  );
}
`,author:"Adrian Purser",license:"MIT",createdAt:"Fri, 10 Nov 2017 17:01:45 +0000",updatedAt:"Sat, 11 Nov 2017 08:50:40 +0100"},{name:"BowTieHorizontal",paramsTypes:{},defaultParams:{},glsl:`// Author: huynx
// License: MIT

vec2 bottom_left = vec2(0.0, 1.0);
vec2 bottom_right = vec2(1.0, 1.0);
vec2 top_left = vec2(0.0, 0.0);
vec2 top_right = vec2(1.0, 0.0);
vec2 center = vec2(0.5, 0.5);

float check(vec2 p1, vec2 p2, vec2 p3)
{
  return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y);
}

bool PointInTriangle (vec2 pt, vec2 p1, vec2 p2, vec2 p3)
{
    bool b1, b2, b3;
    b1 = check(pt, p1, p2) < 0.0;
    b2 = check(pt, p2, p3) < 0.0;
    b3 = check(pt, p3, p1) < 0.0;
    return ((b1 == b2) && (b2 == b3));
}

bool in_left_triangle(vec2 p){
  vec2 vertex1, vertex2, vertex3;
  vertex1 = vec2(progress, 0.5);
  vertex2 = vec2(0.0, 0.5-progress);
  vertex3 = vec2(0.0, 0.5+progress);
  if (PointInTriangle(p, vertex1, vertex2, vertex3))
  {
    return true;
  }
  return false;
}

bool in_right_triangle(vec2 p){
  vec2 vertex1, vertex2, vertex3;
  vertex1 = vec2(1.0-progress, 0.5);
  vertex2 = vec2(1.0, 0.5-progress);
  vertex3 = vec2(1.0, 0.5+progress);
  if (PointInTriangle(p, vertex1, vertex2, vertex3))
  {
    return true;
  }
  return false;
}

float blur_edge(vec2 bot1, vec2 bot2, vec2 top, vec2 testPt)
{
  vec2 lineDir = bot1 - top;
  vec2 perpDir = vec2(lineDir.y, -lineDir.x);
  vec2 dirToPt1 = bot1 - testPt;
  float dist1 = abs(dot(normalize(perpDir), dirToPt1));
  
  lineDir = bot2 - top;
  perpDir = vec2(lineDir.y, -lineDir.x);
  dirToPt1 = bot2 - testPt;
  float min_dist = min(abs(dot(normalize(perpDir), dirToPt1)), dist1);
  
  if (min_dist < 0.005) {
    return min_dist / 0.005;
  }
  else  {
    return 1.0;
  };
}


vec4 transition (vec2 uv) {
  if (in_left_triangle(uv))
  {
    if (progress < 0.1)
    {
      return getFromColor(uv);
    }
    if (uv.x < 0.5)
    {
      vec2 vertex1 = vec2(progress, 0.5);
      vec2 vertex2 = vec2(0.0, 0.5-progress);
      vec2 vertex3 = vec2(0.0, 0.5+progress);
      return mix(
        getFromColor(uv),
        getToColor(uv),
        blur_edge(vertex2, vertex3, vertex1, uv)
      );
    }
    else
    {
      if (progress > 0.0)
      {
        return getToColor(uv);
      }
      else
      {
        return getFromColor(uv);
      }
    }    
  }
  else if (in_right_triangle(uv))
  {
    if (uv.x >= 0.5)
    {
      vec2 vertex1 = vec2(1.0-progress, 0.5);
      vec2 vertex2 = vec2(1.0, 0.5-progress);
      vec2 vertex3 = vec2(1.0, 0.5+progress);
      return mix(
        getFromColor(uv),
        getToColor(uv),
        blur_edge(vertex2, vertex3, vertex1, uv)
      );  
    }
    else
    {
      return getFromColor(uv);
    }
  }
  else {
    return getFromColor(uv);
  }
}`,author:"huynx",license:"MIT",createdAt:"Sat, 24 Mar 2018 12:54:26 +0100",updatedAt:"Sat, 24 Mar 2018 12:54:26 +0100"},{name:"BowTieVertical",paramsTypes:{},defaultParams:{},glsl:`// Author: huynx\r
// License: MIT\r
\r
float check(vec2 p1, vec2 p2, vec2 p3)\r
{\r
  return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y);\r
}\r
\r
bool PointInTriangle (vec2 pt, vec2 p1, vec2 p2, vec2 p3)\r
{\r
    bool b1, b2, b3;\r
    b1 = check(pt, p1, p2) < 0.0;\r
    b2 = check(pt, p2, p3) < 0.0;\r
    b3 = check(pt, p3, p1) < 0.0;\r
    return ((b1 == b2) && (b2 == b3));\r
}\r
\r
bool in_top_triangle(vec2 p){\r
  vec2 vertex1, vertex2, vertex3;\r
  vertex1 = vec2(0.5, progress);\r
  vertex2 = vec2(0.5-progress, 0.0);\r
  vertex3 = vec2(0.5+progress, 0.0);\r
  if (PointInTriangle(p, vertex1, vertex2, vertex3))\r
  {\r
    return true;\r
  }\r
  return false;\r
}\r
\r
bool in_bottom_triangle(vec2 p){\r
  vec2 vertex1, vertex2, vertex3;\r
  vertex1 = vec2(0.5, 1.0 - progress);\r
  vertex2 = vec2(0.5-progress, 1.0);\r
  vertex3 = vec2(0.5+progress, 1.0);\r
  if (PointInTriangle(p, vertex1, vertex2, vertex3))\r
  {\r
    return true;\r
  }\r
  return false;\r
}\r
\r
float blur_edge(vec2 bot1, vec2 bot2, vec2 top, vec2 testPt)\r
{\r
  vec2 lineDir = bot1 - top;\r
  vec2 perpDir = vec2(lineDir.y, -lineDir.x);\r
  vec2 dirToPt1 = bot1 - testPt;\r
  float dist1 = abs(dot(normalize(perpDir), dirToPt1));\r
  \r
  lineDir = bot2 - top;\r
  perpDir = vec2(lineDir.y, -lineDir.x);\r
  dirToPt1 = bot2 - testPt;\r
  float min_dist = min(abs(dot(normalize(perpDir), dirToPt1)), dist1);\r
  \r
  if (min_dist < 0.005) {\r
    return min_dist / 0.005;\r
  }\r
  else  {\r
    return 1.0;\r
  };\r
}\r
\r
\r
vec4 transition (vec2 uv) {\r
  if (in_top_triangle(uv))\r
  {\r
    if (progress < 0.1)\r
    {\r
      return getFromColor(uv);\r
    }\r
    if (uv.y < 0.5)\r
    {\r
      vec2 vertex1 = vec2(0.5, progress);\r
      vec2 vertex2 = vec2(0.5-progress, 0.0);\r
      vec2 vertex3 = vec2(0.5+progress, 0.0);\r
      return mix(\r
        getFromColor(uv),\r
        getToColor(uv),\r
        blur_edge(vertex2, vertex3, vertex1, uv)\r
      );\r
    }\r
    else\r
    {\r
      if (progress > 0.0)\r
      {\r
        return getToColor(uv);\r
      }\r
      else\r
      {\r
        return getFromColor(uv);\r
      }\r
    }    \r
  }\r
  else if (in_bottom_triangle(uv))\r
  {\r
    if (uv.y >= 0.5)\r
    {\r
      vec2 vertex1 = vec2(0.5, 1.0-progress);\r
      vec2 vertex2 = vec2(0.5-progress, 1.0);\r
      vec2 vertex3 = vec2(0.5+progress, 1.0);\r
      return mix(\r
        getFromColor(uv),\r
        getToColor(uv),\r
        blur_edge(vertex2, vertex3, vertex1, uv)\r
      );  \r
    }\r
    else\r
    {\r
      return getFromColor(uv);\r
    }\r
  }\r
  else {\r
    return getFromColor(uv);\r
  }\r
}`,author:"huynx",license:"MIT",createdAt:"Tue, 27 Mar 2018 10:07:54 +0700",updatedAt:"Tue, 27 Mar 2018 10:07:54 +0700"},{name:"ButterflyWaveScrawler",paramsTypes:{amplitude:"float",waves:"float",colorSeparation:"float"},defaultParams:{amplitude:1,waves:30,colorSeparation:.3},glsl:`// Author: mandubian
// License: MIT
uniform float amplitude; // = 1.0
uniform float waves; // = 30.0
uniform float colorSeparation; // = 0.3
float PI = 3.14159265358979323846264;
float compute(vec2 p, float progress, vec2 center) {
vec2 o = p*sin(progress * amplitude)-center;
// horizontal vector
vec2 h = vec2(1., 0.);
// butterfly polar function (don't ask me why this one :))
float theta = acos(dot(o, h)) * waves;
return (exp(cos(theta)) - 2.*cos(4.*theta) + pow(sin((2.*theta - PI) / 24.), 5.)) / 10.;
}
vec4 transition(vec2 uv) {
  vec2 p = uv.xy / vec2(1.0).xy;
  float inv = 1. - progress;
  vec2 dir = p - vec2(.5);
  float dist = length(dir);
  float disp = compute(p, progress, vec2(0.5, 0.5)) ;
  vec4 texTo = getToColor(p + inv*disp);
  vec4 texFrom = vec4(
  getFromColor(p + progress*disp*(1.0 - colorSeparation)).r,
  getFromColor(p + progress*disp).g,
  getFromColor(p + progress*disp*(1.0 + colorSeparation)).b,
  1.0);
  return texTo*progress + texFrom*inv;
}
`,author:"mandubian",license:"MIT",createdAt:"Thu, 1 Jun 2017 11:47:17 +0200",updatedAt:"Thu, 1 Jun 2017 11:47:17 +0200"},{name:"CircleCrop",paramsTypes:{bgcolor:"vec4"},defaultParams:{bgcolor:[0,0,0,1]},glsl:`// License: MIT
// Author: fkuteken
// ported by gre from https://gist.github.com/fkuteken/f63e3009c1143950dee9063c3b83fb88

uniform vec4 bgcolor; // = vec4(0.0, 0.0, 0.0, 1.0)

vec2 ratio2 = vec2(1.0, 1.0 / ratio);
float s = pow(2.0 * abs(progress - 0.5), 3.0);

vec4 transition(vec2 p) {
  float dist = length((vec2(p) - 0.5) * ratio2);
  return mix(
    progress < 0.5 ? getFromColor(p) : getToColor(p), // branching is ok here as we statically depend on progress uniform (branching won't change over pixels)
    bgcolor,
    step(s, dist)
  );
}
`,license:"MIT",author:"fkuteken",createdAt:"Mon, 12 Jun 2017 12:52:34 +0800",updatedAt:"Mon, 12 Jun 2017 12:52:34 +0800"},{name:"ColourDistance",paramsTypes:{power:"float"},defaultParams:{power:5},glsl:`// License: MIT
// Author: P-Seebauer
// ported by gre from https://gist.github.com/P-Seebauer/2a5fa2f77c883dd661f9

uniform float power; // = 5.0

vec4 transition(vec2 p) {
  vec4 fTex = getFromColor(p);
  vec4 tTex = getToColor(p);
  float m = step(distance(fTex, tTex), progress);
  return mix(
    mix(fTex, tTex, m),
    tTex,
    pow(progress, power)
  );
}
`,license:"MIT",author:"P-Seebauer",createdAt:"Mon, 12 Jun 2017 12:57:42 +0800",updatedAt:"Mon, 12 Jun 2017 12:57:42 +0800"},{name:"CrazyParametricFun",paramsTypes:{a:"float",b:"float",amplitude:"float",smoothness:"float"},defaultParams:{a:4,b:1,amplitude:120,smoothness:.1},glsl:`// Author: mandubian
// License: MIT

uniform float a; // = 4
uniform float b; // = 1
uniform float amplitude; // = 120
uniform float smoothness; // = 0.1

vec4 transition(vec2 uv) {
  vec2 p = uv.xy / vec2(1.0).xy;
  vec2 dir = p - vec2(.5);
  float dist = length(dir);
  float x = (a - b) * cos(progress) + b * cos(progress * ((a / b) - 1.) );
  float y = (a - b) * sin(progress) - b * sin(progress * ((a / b) - 1.));
  vec2 offset = dir * vec2(sin(progress  * dist * amplitude * x), sin(progress * dist * amplitude * y)) / smoothness;
  return mix(getFromColor(p + offset), getToColor(p), smoothstep(0.2, 1.0, progress));
}
`,author:"mandubian",license:"MIT",createdAt:"Thu, 1 Jun 2017 13:03:12 +0200",updatedAt:"Thu, 1 Jun 2017 13:03:12 +0200"},{name:"CrossZoom",paramsTypes:{strength:"float"},defaultParams:{strength:.4},glsl:`// License: MIT
// Author: rectalogic
// ported by gre from https://gist.github.com/rectalogic/b86b90161503a0023231

// Converted from https://github.com/rectalogic/rendermix-basic-effects/blob/master/assets/com/rendermix/CrossZoom/CrossZoom.frag
// Which is based on https://github.com/evanw/glfx.js/blob/master/src/filters/blur/zoomblur.js
// With additional easing functions from https://github.com/rectalogic/rendermix-basic-effects/blob/master/assets/com/rendermix/Easing/Easing.glsllib

uniform float strength; // = 0.4

const float PI = 3.141592653589793;

float Linear_ease(in float begin, in float change, in float duration, in float time) {
    return change * time / duration + begin;
}

float Exponential_easeInOut(in float begin, in float change, in float duration, in float time) {
    if (time == 0.0)
        return begin;
    else if (time == duration)
        return begin + change;
    time = time / (duration / 2.0);
    if (time < 1.0)
        return change / 2.0 * pow(2.0, 10.0 * (time - 1.0)) + begin;
    return change / 2.0 * (-pow(2.0, -10.0 * (time - 1.0)) + 2.0) + begin;
}

float Sinusoidal_easeInOut(in float begin, in float change, in float duration, in float time) {
    return -change / 2.0 * (cos(PI * time / duration) - 1.0) + begin;
}

float rand (vec2 co) {
  return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
}

vec3 crossFade(in vec2 uv, in float dissolve) {
    return mix(getFromColor(uv).rgb, getToColor(uv).rgb, dissolve);
}

vec4 transition(vec2 uv) {
    vec2 texCoord = uv.xy / vec2(1.0).xy;

    // Linear interpolate center across center half of the image
    vec2 center = vec2(Linear_ease(0.25, 0.5, 1.0, progress), 0.5);
    float dissolve = Exponential_easeInOut(0.0, 1.0, 1.0, progress);

    // Mirrored sinusoidal loop. 0->strength then strength->0
    float strength = Sinusoidal_easeInOut(0.0, strength, 0.5, progress);

    vec3 color = vec3(0.0);
    float total = 0.0;
    vec2 toCenter = center - texCoord;

    /* randomize the lookup values to hide the fixed number of samples */
    float offset = rand(uv);

    for (float t = 0.0; t <= 40.0; t++) {
        float percent = (t + offset) / 40.0;
        float weight = 4.0 * (percent - percent * percent);
        color += crossFade(texCoord + toCenter * percent * strength, dissolve) * weight;
        total += weight;
    }
    return vec4(color / total, 1.0);
}
`,license:"MIT",author:"rectalogic",createdAt:"Mon, 12 Jun 2017 12:33:07 +0800",updatedAt:"Mon, 12 Jun 2017 12:33:07 +0800"},{name:"Directional",paramsTypes:{direction:"vec2"},defaultParams:{direction:[0,1]},glsl:`// Author: Ga\xEBtan Renaudeau
// License: MIT

uniform vec2 direction; // = vec2(0.0, 1.0)

vec4 transition (vec2 uv) {
  vec2 p = uv + progress * sign(direction);
  vec2 f = fract(p);
  return mix(
    getToColor(f),
    getFromColor(f),
    step(0.0, p.y) * step(p.y, 1.0) * step(0.0, p.x) * step(p.x, 1.0)
  );
}
`,author:"Ga\xEBtan Renaudeau",license:"MIT",createdAt:"Thu, 19 Apr 2018 12:20:29 +0200",updatedAt:"Thu, 19 Apr 2018 12:20:29 +0200"},{name:"DoomScreenTransition",paramsTypes:{bars:"int",amplitude:"float",noise:"float",frequency:"float",dripScale:"float"},defaultParams:{bars:30,amplitude:2,noise:.1,frequency:.5,dripScale:.5},glsl:`// Author: Zeh Fernando
// License: MIT


// Transition parameters --------

// Number of total bars/columns
uniform int bars; // = 30

// Multiplier for speed ratio. 0 = no variation when going down, higher = some elements go much faster
uniform float amplitude; // = 2

// Further variations in speed. 0 = no noise, 1 = super noisy (ignore frequency)
uniform float noise; // = 0.1

// Speed variation horizontally. the bigger the value, the shorter the waves
uniform float frequency; // = 0.5

// How much the bars seem to "run" from the middle of the screen first (sticking to the sides). 0 = no drip, 1 = curved drip
uniform float dripScale; // = 0.5


// The code proper --------

float rand(int num) {
  return fract(mod(float(num) * 67123.313, 12.0) * sin(float(num) * 10.3) * cos(float(num)));
}

float wave(int num) {
  float fn = float(num) * frequency * 0.1 * float(bars);
  return cos(fn * 0.5) * cos(fn * 0.13) * sin((fn+10.0) * 0.3) / 2.0 + 0.5;
}

float drip(int num) {
  return sin(float(num) / float(bars - 1) * 3.141592) * dripScale;
}

float pos(int num) {
  return (noise == 0.0 ? wave(num) : mix(wave(num), rand(num), noise)) + (dripScale == 0.0 ? 0.0 : drip(num));
}

vec4 transition(vec2 uv) {
  int bar = int(uv.x * (float(bars)));
  float scale = 1.0 + pos(bar) * amplitude;
  float phase = progress * scale;
  float posY = uv.y / vec2(1.0).y;
  vec2 p;
  vec4 c;
  if (phase + posY < 1.0) {
    p = vec2(uv.x, uv.y + mix(0.0, vec2(1.0).y, phase)) / vec2(1.0).xy;
    c = getFromColor(p);
  } else {
    p = uv.xy / vec2(1.0).xy;
    c = getToColor(p);
  }

  // Finally, apply the color
  return c;
}
`,author:"Zeh Fernando",license:"MIT",createdAt:"Tue, 30 May 2017 09:39:09 -0700",updatedAt:"Tue, 30 May 2017 09:39:09 -0700"},{name:"Dreamy",paramsTypes:{},defaultParams:{},glsl:`// Author: mikolalysenko
// License: MIT

vec2 offset(float progress, float x, float theta) {
  float phase = progress*progress + progress + theta;
  float shifty = 0.03*progress*cos(10.0*(progress+x));
  return vec2(0, shifty);
}
vec4 transition(vec2 p) {
  return mix(getFromColor(p + offset(progress, p.x, 0.0)), getToColor(p + offset(1.0-progress, p.x, 3.14)), progress);
}
`,author:"mikolalysenko",license:"MIT",createdAt:"Mon, 12 Jun 2017 12:27:38 +0800",updatedAt:"Mon, 12 Jun 2017 12:27:38 +0800"},{name:"DreamyZoom",paramsTypes:{rotation:"float",scale:"float"},defaultParams:{rotation:6,scale:1.2},glsl:`// Author: Zeh Fernando
// License: MIT

// Definitions --------
#define DEG2RAD 0.03926990816987241548078304229099 // 1/180*PI


// Transition parameters --------

// In degrees
uniform float rotation; // = 6

// Multiplier
uniform float scale; // = 1.2


// The code proper --------

vec4 transition(vec2 uv) {
  // Massage parameters
  float phase = progress < 0.5 ? progress * 2.0 : (progress - 0.5) * 2.0;
  float angleOffset = progress < 0.5 ? mix(0.0, rotation * DEG2RAD, phase) : mix(-rotation * DEG2RAD, 0.0, phase);
  float newScale = progress < 0.5 ? mix(1.0, scale, phase) : mix(scale, 1.0, phase);
  
  vec2 center = vec2(0, 0);

  // Calculate the source point
  vec2 assumedCenter = vec2(0.5, 0.5);
  vec2 p = (uv.xy - vec2(0.5, 0.5)) / newScale * vec2(ratio, 1.0);

  // This can probably be optimized (with distance())
  float angle = atan(p.y, p.x) + angleOffset;
  float dist = distance(center, p);
  p.x = cos(angle) * dist / ratio + 0.5;
  p.y = sin(angle) * dist + 0.5;
  vec4 c = progress < 0.5 ? getFromColor(p) : getToColor(p);

  // Finally, apply the color
  return c + (progress < 0.5 ? mix(0.0, 1.0, phase) : mix(1.0, 0.0, phase));
}
`,author:"Zeh Fernando",license:"MIT",createdAt:"Tue, 30 May 2017 10:44:06 -0700",updatedAt:"Tue, 30 May 2017 10:44:06 -0700"},{name:"GlitchDisplace",paramsTypes:{},defaultParams:{},glsl:`// Author: Matt DesLauriers
// License: MIT

highp float random(vec2 co)
{
    highp float a = 12.9898;
    highp float b = 78.233;
    highp float c = 43758.5453;
    highp float dt= dot(co.xy ,vec2(a,b));
    highp float sn= mod(dt,3.14);
    return fract(sin(sn) * c);
}
float voronoi( in vec2 x ) {
    vec2 p = floor( x );
    vec2 f = fract( x );
    float res = 8.0;
    for( float j=-1.; j<=1.; j++ )
    for( float i=-1.; i<=1.; i++ ) {
        vec2  b = vec2( i, j );
        vec2  r = b - f + random( p + b );
        float d = dot( r, r );
        res = min( res, d );
    }
    return sqrt( res );
}

vec2 displace(vec4 tex, vec2 texCoord, float dotDepth, float textureDepth, float strength) {
    float b = voronoi(.003 * texCoord + 2.0);
    float g = voronoi(0.2 * texCoord);
    float r = voronoi(texCoord - 1.0);
    vec4 dt = tex * 1.0;
    vec4 dis = dt * dotDepth + 1.0 - tex * textureDepth;

    dis.x = dis.x - 1.0 + textureDepth*dotDepth;
    dis.y = dis.y - 1.0 + textureDepth*dotDepth;
    dis.x *= strength;
    dis.y *= strength;
    vec2 res_uv = texCoord ;
    res_uv.x = res_uv.x + dis.x - 0.0;
    res_uv.y = res_uv.y + dis.y;
    return res_uv;
}

float ease1(float t) {
  return t == 0.0 || t == 1.0
    ? t
    : t < 0.5
      ? +0.5 * pow(2.0, (20.0 * t) - 10.0)
      : -0.5 * pow(2.0, 10.0 - (t * 20.0)) + 1.0;
}
float ease2(float t) {
  return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);
}



vec4 transition(vec2 uv) {
  vec2 p = uv.xy / vec2(1.0).xy;
  vec4 color1 = getFromColor(p);
  vec4 color2 = getToColor(p);
  vec2 disp = displace(color1, p, 0.33, 0.7, 1.0-ease1(progress));
  vec2 disp2 = displace(color2, p, 0.33, 0.5, ease2(progress));
  vec4 dColor1 = getToColor(disp);
  vec4 dColor2 = getFromColor(disp2);
  float val = ease1(progress);
  vec3 gray = vec3(dot(min(dColor2, dColor1).rgb, vec3(0.299, 0.587, 0.114)));
  dColor2 = vec4(gray, 1.0);
  dColor2 *= 2.0;
  color1 = mix(color1, dColor2, smoothstep(0.0, 0.5, progress));
  color2 = mix(color2, dColor1, smoothstep(1.0, 0.5, progress));
  return mix(color1, color2, val);
  //gl_FragColor = mix(gl_FragColor, dColor, smoothstep(0.0, 0.5, progress));
  
   //gl_FragColor = mix(texture2D(from, p), texture2D(to, p), progress);
}
`,author:"Matt DesLauriers",license:"MIT",createdAt:"Tue, 30 May 2017 14:53:04 -0400",updatedAt:"Tue, 30 May 2017 14:53:04 -0400"},{name:"GlitchMemories",paramsTypes:{},defaultParams:{},glsl:`// author: Gunnar Roth
// based on work from natewave
// license: MIT
vec4 transition(vec2 p) {
  vec2 block = floor(p.xy / vec2(16));
  vec2 uv_noise = block / vec2(64);
  uv_noise += floor(vec2(progress) * vec2(1200.0, 3500.0)) / vec2(64);
  vec2 dist = progress > 0.0 ? (fract(uv_noise) - 0.5) * 0.3 *(1.0 -progress) : vec2(0.0);
  vec2 red = p + dist * 0.2;
  vec2 green = p + dist * .3;
  vec2 blue = p + dist * .5;

  return vec4(mix(getFromColor(red), getToColor(red), progress).r,mix(getFromColor(green), getToColor(green), progress).g,mix(getFromColor(blue), getToColor(blue), progress).b,1.0);
}

`,author:"Gunnar Roth",license:"MIT",createdAt:"Wed, 21 Feb 2018 00:52:15 +0100",updatedAt:"Wed, 21 Feb 2018 19:32:02 +0100"},{name:"GridFlip",paramsTypes:{size:"ivec2",pause:"float",dividerWidth:"float",bgcolor:"vec4",randomness:"float"},defaultParams:{size:[4,4],pause:.1,dividerWidth:.05,bgcolor:[0,0,0,1],randomness:.1},glsl:`// License: MIT
// Author: TimDonselaar
// ported by gre from https://gist.github.com/TimDonselaar/9bcd1c4b5934ba60087bdb55c2ea92e5

uniform ivec2 size; // = ivec2(4)
uniform float pause; // = 0.1
uniform float dividerWidth; // = 0.05
uniform vec4 bgcolor; // = vec4(0.0, 0.0, 0.0, 1.0)
uniform float randomness; // = 0.1
 
float rand (vec2 co) {
  return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
}

float getDelta(vec2 p) {
  vec2 rectanglePos = floor(vec2(size) * p);
  vec2 rectangleSize = vec2(1.0 / vec2(size).x, 1.0 / vec2(size).y);
  float top = rectangleSize.y * (rectanglePos.y + 1.0);
  float bottom = rectangleSize.y * rectanglePos.y;
  float left = rectangleSize.x * rectanglePos.x;
  float right = rectangleSize.x * (rectanglePos.x + 1.0);
  float minX = min(abs(p.x - left), abs(p.x - right));
  float minY = min(abs(p.y - top), abs(p.y - bottom));
  return min(minX, minY);
}

float getDividerSize() {
  vec2 rectangleSize = vec2(1.0 / vec2(size).x, 1.0 / vec2(size).y);
  return min(rectangleSize.x, rectangleSize.y) * dividerWidth;
}

vec4 transition(vec2 p) {
  if(progress < pause) {
    float currentProg = progress / pause;
    float a = 1.0;
    if(getDelta(p) < getDividerSize()) {
      a = 1.0 - currentProg;
    }
    return mix(bgcolor, getFromColor(p), a);
  }
  else if(progress < 1.0 - pause){
    if(getDelta(p) < getDividerSize()) {
      return bgcolor;
    } else {
      float currentProg = (progress - pause) / (1.0 - pause * 2.0);
      vec2 q = p;
      vec2 rectanglePos = floor(vec2(size) * q);
      
      float r = rand(rectanglePos) - randomness;
      float cp = smoothstep(0.0, 1.0 - r, currentProg);
    
      float rectangleSize = 1.0 / vec2(size).x;
      float delta = rectanglePos.x * rectangleSize;
      float offset = rectangleSize / 2.0 + delta;
      
      p.x = (p.x - offset)/abs(cp - 0.5)*0.5 + offset;
      vec4 a = getFromColor(p);
      vec4 b = getToColor(p);
      
      float s = step(abs(vec2(size).x * (q.x - delta) - 0.5), abs(cp - 0.5));
      return mix(bgcolor, mix(b, a, step(cp, 0.5)), s);
    }
  }
  else {
    float currentProg = (progress - 1.0 + pause) / pause;
    float a = 1.0;
    if(getDelta(p) < getDividerSize()) {
      a = currentProg;
    }
    return mix(bgcolor, getToColor(p), a);
  }
}
`,license:"MIT",author:"TimDonselaar",createdAt:"Mon, 12 Jun 2017 11:32:51 +0800",updatedAt:"Mon, 12 Jun 2017 11:32:51 +0800"},{name:"InvertedPageCurl",paramsTypes:{},defaultParams:{},glsl:`// author: Hewlett-Packard
// license: BSD 3 Clause
// Adapted by Sergey Kosarevsky from:
// http://rectalogic.github.io/webvfx/examples_2transition-shader-pagecurl_8html-example.html

/*
Copyright (c) 2010 Hewlett-Packard Development Company, L.P. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

   * Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
   * Redistributions in binary form must reproduce the above
     copyright notice, this list of conditions and the following disclaimer
     in the documentation and/or other materials provided with the
     distribution.
   * Neither the name of Hewlett-Packard nor the names of its
     contributors may be used to endorse or promote products derived from
     this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
in vec2 texCoord;
*/

const float MIN_AMOUNT = -0.16;
const float MAX_AMOUNT = 1.5;
float amount = progress * (MAX_AMOUNT - MIN_AMOUNT) + MIN_AMOUNT;

const float PI = 3.141592653589793;

const float scale = 512.0;
const float sharpness = 3.0;

float cylinderCenter = amount;
// 360 degrees * amount
float cylinderAngle = 2.0 * PI * amount;

const float cylinderRadius = 1.0 / PI / 2.0;

vec3 hitPoint(float hitAngle, float yc, vec3 point, mat3 rrotation)
{
        float hitPoint = hitAngle / (2.0 * PI);
        point.y = hitPoint;
        return rrotation * point;
}

vec4 antiAlias(vec4 color1, vec4 color2, float distanc)
{
        distanc *= scale;
        if (distanc < 0.0) return color2;
        if (distanc > 2.0) return color1;
        float dd = pow(1.0 - distanc / 2.0, sharpness);
        return ((color2 - color1) * dd) + color1;
}

float distanceToEdge(vec3 point)
{
        float dx = abs(point.x > 0.5 ? 1.0 - point.x : point.x);
        float dy = abs(point.y > 0.5 ? 1.0 - point.y : point.y);
        if (point.x < 0.0) dx = -point.x;
        if (point.x > 1.0) dx = point.x - 1.0;
        if (point.y < 0.0) dy = -point.y;
        if (point.y > 1.0) dy = point.y - 1.0;
        if ((point.x < 0.0 || point.x > 1.0) && (point.y < 0.0 || point.y > 1.0)) return sqrt(dx * dx + dy * dy);
        return min(dx, dy);
}

vec4 seeThrough(float yc, vec2 p, mat3 rotation, mat3 rrotation)
{
        float hitAngle = PI - (acos(yc / cylinderRadius) - cylinderAngle);
        vec3 point = hitPoint(hitAngle, yc, rotation * vec3(p, 1.0), rrotation);
        if (yc <= 0.0 && (point.x < 0.0 || point.y < 0.0 || point.x > 1.0 || point.y > 1.0))
        {
            return getToColor(p);
        }

        if (yc > 0.0) return getFromColor(p);

        vec4 color = getFromColor(point.xy);
        vec4 tcolor = vec4(0.0);

        return antiAlias(color, tcolor, distanceToEdge(point));
}

vec4 seeThroughWithShadow(float yc, vec2 p, vec3 point, mat3 rotation, mat3 rrotation)
{
        float shadow = distanceToEdge(point) * 30.0;
        shadow = (1.0 - shadow) / 3.0;

        if (shadow < 0.0) shadow = 0.0; else shadow *= amount;

        vec4 shadowColor = seeThrough(yc, p, rotation, rrotation);
        shadowColor.r -= shadow;
        shadowColor.g -= shadow;
        shadowColor.b -= shadow;

        return shadowColor;
}

vec4 backside(float yc, vec3 point)
{
        vec4 color = getFromColor(point.xy);
        float gray = (color.r + color.b + color.g) / 15.0;
        gray += (8.0 / 10.0) * (pow(1.0 - abs(yc / cylinderRadius), 2.0 / 10.0) / 2.0 + (5.0 / 10.0));
        color.rgb = vec3(gray);
        return color;
}

vec4 behindSurface(vec2 p, float yc, vec3 point, mat3 rrotation)
{
        float shado = (1.0 - ((-cylinderRadius - yc) / amount * 7.0)) / 6.0;
        shado *= 1.0 - abs(point.x - 0.5);

        yc = (-cylinderRadius - cylinderRadius - yc);

        float hitAngle = (acos(yc / cylinderRadius) + cylinderAngle) - PI;
        point = hitPoint(hitAngle, yc, point, rrotation);

        if (yc < 0.0 && point.x >= 0.0 && point.y >= 0.0 && point.x <= 1.0 && point.y <= 1.0 && (hitAngle < PI || amount > 0.5))
        {
                shado = 1.0 - (sqrt(pow(point.x - 0.5, 2.0) + pow(point.y - 0.5, 2.0)) / (71.0 / 100.0));
                shado *= pow(-yc / cylinderRadius, 3.0);
                shado *= 0.5;
        }
        else
        {
                shado = 0.0;
        }
        return vec4(getToColor(p).rgb - shado, 1.0);
}

vec4 transition(vec2 p) {

  const float angle = 100.0 * PI / 180.0;
        float c = cos(-angle);
        float s = sin(-angle);

        mat3 rotation = mat3( c, s, 0,
                                                                -s, c, 0,
                                                                -0.801, 0.8900, 1
                                                                );
        c = cos(angle);
        s = sin(angle);

        mat3 rrotation = mat3(	c, s, 0,
                                                                        -s, c, 0,
                                                                        0.98500, 0.985, 1
                                                                );

        vec3 point = rotation * vec3(p, 1.0);

        float yc = point.y - cylinderCenter;

        if (yc < -cylinderRadius)
        {
                // Behind surface
                return behindSurface(p,yc, point, rrotation);
        }

        if (yc > cylinderRadius)
        {
                // Flat surface
                return getFromColor(p);
        }

        float hitAngle = (acos(yc / cylinderRadius) + cylinderAngle) - PI;

        float hitAngleMod = mod(hitAngle, 2.0 * PI);
        if ((hitAngleMod > PI && amount < 0.5) || (hitAngleMod > PI/2.0 && amount < 0.0))
        {
                return seeThrough(yc, p, rotation, rrotation);
        }

        point = hitPoint(hitAngle, yc, point, rrotation);

        if (point.x < 0.0 || point.y < 0.0 || point.x > 1.0 || point.y > 1.0)
        {
                return seeThroughWithShadow(yc, p, point, rotation, rrotation);
        }

        vec4 color = backside(yc, point);

        vec4 otherColor;
        if (yc < 0.0)
        {
                float shado = 1.0 - (sqrt(pow(point.x - 0.5, 2.0) + pow(point.y - 0.5, 2.0)) / 0.71);
                shado *= pow(-yc / cylinderRadius, 3.0);
                shado *= 0.5;
                otherColor = vec4(0.0, 0.0, 0.0, shado);
        }
        else
        {
                otherColor = getFromColor(p);
        }

        color = antiAlias(color, otherColor, cylinderRadius - abs(yc));

        vec4 cl = seeThroughWithShadow(yc, p, point, rotation, rrotation);
        float dist = distanceToEdge(point);

        return antiAlias(color, cl, dist);
}
`,author:"Hewlett-Packard",license:"BSD 3 Clause",createdAt:"Wed, 21 Feb 2018 01:13:49 +0100",updatedAt:"Wed, 21 Feb 2018 16:00:02 +0100"},{name:"LinearBlur",paramsTypes:{intensity:"float"},defaultParams:{intensity:.1},glsl:`// author: gre
// license: MIT
uniform float intensity; // = 0.1
const int passes = 6;

vec4 transition(vec2 uv) {
    vec4 c1 = vec4(0.0);
    vec4 c2 = vec4(0.0);

    float disp = intensity*(0.5-distance(0.5, progress));
    for (int xi=0; xi<passes; xi++)
    {
        float x = float(xi) / float(passes) - 0.5;
        for (int yi=0; yi<passes; yi++)
        {
            float y = float(yi) / float(passes) - 0.5;
            vec2 v = vec2(x,y);
            float d = disp;
            c1 += getFromColor( uv + d*v);
            c2 += getToColor( uv + d*v);
        }
    }
    c1 /= float(passes*passes);
    c2 /= float(passes*passes);
    return mix(c1, c2, progress);
}
`,author:"gre",license:"MIT",createdAt:"Fri, 23 Feb 2018 15:18:22 +0100",updatedAt:"Fri, 23 Feb 2018 15:18:22 +0100"},{name:"Mosaic",paramsTypes:{endx:"int",endy:"int"},defaultParams:{endx:2,endy:-1},glsl:`// License: MIT
// Author: Xaychru
// ported by gre from https://gist.github.com/Xaychru/130bb7b7affedbda9df5

#define PI 3.14159265358979323
#define POW2(X) X*X
#define POW3(X) X*X*X
uniform int endx; // = 2
uniform int endy; // = -1

float Rand(vec2 v) {
  return fract(sin(dot(v.xy ,vec2(12.9898,78.233))) * 43758.5453);
}
vec2 Rotate(vec2 v, float a) {
  mat2 rm = mat2(cos(a), -sin(a),
                 sin(a), cos(a));
  return rm*v;
}
float CosInterpolation(float x) {
  return -cos(x*PI)/2.+.5;
}
vec4 transition(vec2 uv) {
  vec2 p = uv.xy / vec2(1.0).xy - .5;
  vec2 rp = p;
  float rpr = (progress*2.-1.);
  float z = -(rpr*rpr*2.) + 3.;
  float az = abs(z);
  rp *= az;
  rp += mix(vec2(.5, .5), vec2(float(endx) + .5, float(endy) + .5), POW2(CosInterpolation(progress)));
  vec2 mrp = mod(rp, 1.);
  vec2 crp = rp;
  bool onEnd = int(floor(crp.x))==endx&&int(floor(crp.y))==endy;
  if(!onEnd) {
    float ang = float(int(Rand(floor(crp))*4.))*.5*PI;
    mrp = vec2(.5) + Rotate(mrp-vec2(.5), ang);
  }
  if(onEnd || Rand(floor(crp))>.5) {
    return getToColor(mrp);
  } else {
    return getFromColor(mrp);
  }
}
`,license:"MIT",author:"Xaychru",createdAt:"Mon, 12 Jun 2017 10:26:51 +0800",updatedAt:"Mon, 12 Jun 2017 10:26:51 +0800"},{name:"PolkaDotsCurtain",paramsTypes:{dots:"float",center:"vec2"},defaultParams:{dots:20,center:[0,0]},glsl:`// author: bobylito
// license: MIT
const float SQRT_2 = 1.414213562373;
uniform float dots;// = 20.0;
uniform vec2 center;// = vec2(0, 0);

vec4 transition(vec2 uv) {
  bool nextImage = distance(fract(uv * dots), vec2(0.5, 0.5)) < ( progress / distance(uv, center));
  return nextImage ? getToColor(uv) : getFromColor(uv);
}
`,author:"bobylito",license:"MIT",createdAt:"Tue, 20 Feb 2018 23:41:45 +0100",updatedAt:"Tue, 20 Feb 2018 23:41:45 +0100"},{name:"Radial",paramsTypes:{smoothness:"float"},defaultParams:{smoothness:1},glsl:`// License: MIT
// Author: Xaychru
// ported by gre from https://gist.github.com/Xaychru/ce1d48f0ce00bb379750

uniform float smoothness; // = 1.0

const float PI = 3.141592653589;

vec4 transition(vec2 p) {
  vec2 rp = p*2.-1.;
  return mix(
    getToColor(p),
    getFromColor(p),
    smoothstep(0., smoothness, atan(rp.y,rp.x) - (progress-.5) * PI * 2.5)
  );
}
`,license:"MIT",author:"Xaychru",createdAt:"Mon, 12 Jun 2017 10:36:24 +0800",updatedAt:"Mon, 12 Jun 2017 10:36:24 +0800"},{name:"SimpleZoom",paramsTypes:{zoom_quickness:"float"},defaultParams:{zoom_quickness:.8},glsl:`// Author: 0gust1
// License: MIT

uniform float zoom_quickness; // = 0.8
float nQuick = clamp(zoom_quickness,0.2,1.0);

vec2 zoom(vec2 uv, float amount) {
  return 0.5 + ((uv - 0.5) * (1.0-amount));	
}

vec4 transition (vec2 uv) {
  return mix(
    getFromColor(zoom(uv, smoothstep(0.0, nQuick, progress))),
    getToColor(uv),
   smoothstep(nQuick-0.2, 1.0, progress)
  );
}`,author:"0gust1",license:"MIT",createdAt:"Tue, 6 Mar 2018 00:43:47 +0100",updatedAt:"Tue, 6 Mar 2018 00:43:47 +0100"},{name:"StereoViewer",paramsTypes:{zoom:"float",corner_radius:"float"},defaultParams:{zoom:.88,corner_radius:.22},glsl:`// Tunable parameters
// How much to zoom (out) for the effect ~ 0.5 - 1.0
uniform float zoom; // = 0.88
// Corner radius as a fraction of the image height
uniform float corner_radius;  // = 0.22

// author: Ted Schundler
// license: BSD 2 Clause
// Free for use and modification by anyone with credit

// Copyright (c) 2016, Theodore K Schundler
// All rights reserved.

// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

///////////////////////////////////////////////////////////////////////////////
// Stereo Viewer Toy Transition                                              //
//                                                                           //
// Inspired by ViewMaster / Image3D image viewer devices.                    //
// This effect is similar to what you see when you press the device's lever. //
// There is a quick zoom in / out to make the transition 'valid' for GLSL.io //
///////////////////////////////////////////////////////////////////////////////

const vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
const vec2 c00 = vec2(0.0, 0.0); // the four corner points
const vec2 c01 = vec2(0.0, 1.0);
const vec2 c11 = vec2(1.0, 1.0);
const vec2 c10 = vec2(1.0, 0.0);

// Check if a point is within a given corner
bool in_corner(vec2 p, vec2 corner, vec2 radius) {
  // determine the direction we want to be filled
  vec2 axis = (c11 - corner) - corner;

  // warp the point so we are always testing the bottom left point with the
  // circle centered on the origin
  p = p - (corner + axis * radius);
  p *= axis / radius;
  return (p.x > 0.0 && p.y > -1.0) || (p.y > 0.0 && p.x > -1.0) || dot(p, p) < 1.0;
}

// Check all four corners
// return a float for v2 for anti-aliasing?
bool test_rounded_mask(vec2 p, vec2 corner_size) {
  return
      in_corner(p, c00, corner_size) &&
      in_corner(p, c01, corner_size) &&
      in_corner(p, c10, corner_size) &&
      in_corner(p, c11, corner_size);
}

// Screen blend mode - https://en.wikipedia.org/wiki/Blend_modes
// This more closely approximates what you see than linear blending
vec4 screen(vec4 a, vec4 b) {
  return 1.0 - (1.0 - a) * (1.0 -b);
}

// Given RGBA, find a value that when screened with itself
// will yield the original value.
vec4 unscreen(vec4 c) {
  return 1.0 - sqrt(1.0 - c);
}

// Grab a pixel, only if it isn't masked out by the rounded corners
vec4 sample_with_corners_from(vec2 p, vec2 corner_size) {
  p = (p - 0.5) / zoom + 0.5;
  if (!test_rounded_mask(p, corner_size)) {
    return black;
  }
  return unscreen(getFromColor(p));
}

vec4 sample_with_corners_to(vec2 p, vec2 corner_size) {
  p = (p - 0.5) / zoom + 0.5;
  if (!test_rounded_mask(p, corner_size)) {
    return black;
  }
  return unscreen(getToColor(p));
}

// special sampling used when zooming - extra zoom parameter and don't unscreen
vec4 simple_sample_with_corners_from(vec2 p, vec2 corner_size, float zoom_amt) {
  p = (p - 0.5) / (1.0 - zoom_amt + zoom * zoom_amt) + 0.5;
  if (!test_rounded_mask(p, corner_size)) {
    return black;
  }
  return getFromColor(p);
}

vec4 simple_sample_with_corners_to(vec2 p, vec2 corner_size, float zoom_amt) {
  p = (p - 0.5) / (1.0 - zoom_amt + zoom * zoom_amt) + 0.5;
  if (!test_rounded_mask(p, corner_size)) {
    return black;
  }
  return getToColor(p);
}

// Basic 2D affine transform matrix helpers
// These really shouldn't be used in a fragment shader - I should work out the
// the math for a translate & rotate function as a pair of dot products instead

mat3 rotate2d(float angle, float ratio) {
  float s = sin(angle);
  float c = cos(angle);
  return mat3(
    c, s ,0.0,
    -s, c, 0.0,
    0.0, 0.0, 1.0);
}

mat3 translate2d(float x, float y) {
  return mat3(
    1.0, 0.0, 0,
    0.0, 1.0, 0,
    -x, -y, 1.0);
}

mat3 scale2d(float x, float y) {
  return mat3(
    x, 0.0, 0,
    0.0, y, 0,
    0, 0, 1.0);
}

// Split an image and rotate one up and one down along off screen pivot points
vec4 get_cross_rotated(vec3 p3, float angle, vec2 corner_size, float ratio) {
  angle = angle * angle; // easing
  angle /= 2.4; // works out to be a good number of radians

  mat3 center_and_scale = translate2d(-0.5, -0.5) * scale2d(1.0, ratio);
  mat3 unscale_and_uncenter = scale2d(1.0, 1.0/ratio) * translate2d(0.5,0.5);
  mat3 slide_left = translate2d(-2.0,0.0);
  mat3 slide_right = translate2d(2.0,0.0);
  mat3 rotate = rotate2d(angle, ratio);

  mat3 op_a = center_and_scale * slide_right * rotate * slide_left * unscale_and_uncenter;
  mat3 op_b = center_and_scale * slide_left * rotate * slide_right * unscale_and_uncenter;

  vec4 a = sample_with_corners_from((op_a * p3).xy, corner_size);
  vec4 b = sample_with_corners_from((op_b * p3).xy, corner_size);

  return screen(a, b);
}

// Image stays put, but this time move two masks
vec4 get_cross_masked(vec3 p3, float angle, vec2 corner_size, float ratio) {
  angle = 1.0 - angle;
  angle = angle * angle; // easing
  angle /= 2.4;

  vec4 img;

  mat3 center_and_scale = translate2d(-0.5, -0.5) * scale2d(1.0, ratio);
  mat3 unscale_and_uncenter = scale2d(1.0 / zoom, 1.0 / (zoom * ratio)) * translate2d(0.5,0.5);
  mat3 slide_left = translate2d(-2.0,0.0);
  mat3 slide_right = translate2d(2.0,0.0);
  mat3 rotate = rotate2d(angle, ratio);

  mat3 op_a = center_and_scale * slide_right * rotate * slide_left * unscale_and_uncenter;
  mat3 op_b = center_and_scale * slide_left * rotate * slide_right * unscale_and_uncenter;

  bool mask_a = test_rounded_mask((op_a * p3).xy, corner_size);
  bool mask_b = test_rounded_mask((op_b * p3).xy, corner_size);

  if (mask_a || mask_b) {
    img = sample_with_corners_to(p3.xy, corner_size);
    return screen(mask_a ? img : black, mask_b ? img : black);
  } else {
    return black;
  }
}

vec4 transition(vec2 uv) {
  float a;
  vec2 p=uv.xy/vec2(1.0).xy;
  vec3 p3 = vec3(p.xy, 1.0); // for 2D matrix transforms

  // corner is warped to represent to size after mapping to 1.0, 1.0
  vec2 corner_size = vec2(corner_radius / ratio, corner_radius);

  if (progress <= 0.0) {
    // 0.0: start with the base frame always
    return getFromColor(p);
  } else if (progress < 0.1) {
    // 0.0-0.1: zoom out and add rounded corners
    a = progress / 0.1;
    return  simple_sample_with_corners_from(p, corner_size * a, a);
  } else if (progress < 0.48) {
    // 0.1-0.48: Split original image apart
    a = (progress - 0.1)/0.38;
    return get_cross_rotated(p3, a, corner_size, ratio);
  } else if (progress < 0.9) {
    // 0.48-0.52: black
    // 0.52 - 0.9: unmask new image
    return get_cross_masked(p3, (progress - 0.52)/0.38, corner_size, ratio);
  } else if (progress < 1.0) {
    // zoom out and add rounded corners
    a = (1.0 - progress) / 0.1;
    return simple_sample_with_corners_to(p, corner_size * a, a);
  } else {
    // 1.0 end with base frame
    return getToColor(p);
  }
}
`,author:"Ted Schundler",license:"BSD 2 Clause",createdAt:"Tue, 20 Feb 2018 23:20:29 +0100",updatedAt:"Wed, 21 Feb 2018 15:42:00 +0100"},{name:"Swirl",paramsTypes:{},defaultParams:{},glsl:`// License: MIT
// Author: Sergey Kosarevsky
// ( http://www.linderdaum.com )
// ported by gre from https://gist.github.com/corporateshark/cacfedb8cca0f5ce3f7c

vec4 transition(vec2 UV)
{
	float Radius = 1.0;

	float T = progress;

	UV -= vec2( 0.5, 0.5 );

	float Dist = length(UV);

	if ( Dist < Radius )
	{
		float Percent = (Radius - Dist) / Radius;
		float A = ( T <= 0.5 ) ? mix( 0.0, 1.0, T/0.5 ) : mix( 1.0, 0.0, (T-0.5)/0.5 );
		float Theta = Percent * Percent * A * 8.0 * 3.14159;
		float S = sin( Theta );
		float C = cos( Theta );
		UV = vec2( dot(UV, vec2(C, -S)), dot(UV, vec2(S, C)) );
	}
	UV += vec2( 0.5, 0.5 );

	vec4 C0 = getFromColor(UV);
	vec4 C1 = getToColor(UV);

	return mix( C0, C1, T );
}
`,license:"MIT",author:"Sergey Kosarevsky",createdAt:"Mon, 12 Jun 2017 12:38:27 +0800",updatedAt:"Mon, 12 Jun 2017 12:38:27 +0800"},{name:"WaterDrop",paramsTypes:{amplitude:"float",speed:"float"},defaultParams:{amplitude:30,speed:30},glsl:`// author: Pawe\u0142 P\u0142\xF3ciennik
// license: MIT
uniform float amplitude; // = 30
uniform float speed; // = 30

vec4 transition(vec2 p) {
  vec2 dir = p - vec2(.5);
  float dist = length(dir);

  if (dist > progress) {
    return mix(getFromColor( p), getToColor( p), progress);
  } else {
    vec2 offset = dir * sin(dist * amplitude - progress * speed);
    return mix(getFromColor( p + offset), getToColor( p), progress);
  }
}
`,author:"Pawe\u0142 P\u0142\xF3ciennik",license:"MIT",createdAt:"Wed, 21 Feb 2018 19:37:15 +0100",updatedAt:"Wed, 21 Feb 2018 19:37:15 +0100"},{name:"ZoomInCircles",paramsTypes:{},defaultParams:{},glsl:`// License: MIT
// Author: dycm8009
// ported by gre from https://gist.github.com/dycm8009/948e99b1800e81ad909a

vec2 zoom(vec2 uv, float amount) {
  return 0.5 + ((uv - 0.5) * amount);	
}

vec2 ratio2 = vec2(1.0, 1.0 / ratio);

vec4 transition(vec2 uv) {
  // TODO: some timing are hardcoded but should be one or many parameters
  // TODO: should also be able to configure how much circles
  // TODO: if() branching should be avoided when possible, prefer use of step() & other functions
  vec2 r = 2.0 * ((vec2(uv.xy) - 0.5) * ratio2);
  float pro = progress / 0.8;
  float z = pro * 0.2;
  float t = 0.0;
  if (pro > 1.0) {
    z = 0.2 + (pro - 1.0) * 5.;
    t = clamp((progress - 0.8) / 0.07, 0.0, 1.0);
  }
  if (length(r) < 0.5+z) {
    // uv = zoom(uv, 0.9 - 0.1 * pro);
  }
  else if (length(r) < 0.8+z*1.5) {
    uv = zoom(uv, 1.0 - 0.15 * pro);
    t = t * 0.5;
  }
  else if (length(r) < 1.2+z*2.5) {
    uv = zoom(uv, 1.0 - 0.2 * pro);
    t = t * 0.2;
  }
  else {
    uv = zoom(uv, 1.0 - 0.25 * pro);
  }
  return mix(getFromColor(uv), getToColor(uv), t);
}
`,license:"MIT",author:"dycm8009",createdAt:"Mon, 12 Jun 2017 11:24:34 +0800",updatedAt:"Mon, 12 Jun 2017 11:24:34 +0800"},{name:"angular",paramsTypes:{startingAngle:"float"},defaultParams:{startingAngle:90},glsl:`// Author: Fernando Kuteken
// License: MIT

#define PI 3.141592653589

uniform float startingAngle; // = 90;

vec4 transition (vec2 uv) {
  
  float offset = startingAngle * PI / 180.0;
  float angle = atan(uv.y - 0.5, uv.x - 0.5) + offset;
  float normalizedAngle = (angle + PI) / (2.0 * PI);
  
  normalizedAngle = normalizedAngle - floor(normalizedAngle);

  return mix(
    getFromColor(uv),
    getToColor(uv),
    step(normalizedAngle, progress)
    );
}
`,author:"Fernando Kuteken",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"burn",paramsTypes:{color:"vec3"},defaultParams:{color:[.9,.4,.2]},glsl:`// author: gre
// License: MIT
uniform vec3 color /* = vec3(0.9, 0.4, 0.2) */;
vec4 transition (vec2 uv) {
  return mix(
    getFromColor(uv) + vec4(progress*color, 1.0),
    getToColor(uv) + vec4((1.0-progress)*color, 1.0),
    progress
  );
}
`,author:"gre",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"cannabisleaf",paramsTypes:{},defaultParams:{},glsl:`// Author: @Flexi23
// License: MIT

// inspired by http://www.wolframalpha.com/input/?i=cannabis+curve

vec4 transition (vec2 uv) {
  if(progress == 0.0){
    return getFromColor(uv);
  }
  vec2 leaf_uv = (uv - vec2(0.5))/10./pow(progress,3.5);
	leaf_uv.y += 0.35;
	float r = 0.18;
	float o = atan(leaf_uv.y, leaf_uv.x);
  return mix(getFromColor(uv), getToColor(uv), 1.-step(1. - length(leaf_uv)+r*(1.+sin(o))*(1.+0.9 * cos(8.*o))*(1.+0.1*cos(24.*o))*(0.9+0.05*cos(200.*o)), 1.));
}
`,author:"@Flexi23",license:"MIT",createdAt:"Thu, 1 Jun 2017 15:58:58 +0200",updatedAt:"Thu, 1 Jun 2017 15:58:58 +0200"},{name:"circle",paramsTypes:{center:"vec2",backColor:"vec3"},defaultParams:{center:[.5,.5],backColor:[.1,.1,.1]},glsl:`// Author: Fernando Kuteken
// License: MIT

uniform vec2 center; // = vec2(0.5, 0.5);
uniform vec3 backColor; // = vec3(0.1, 0.1, 0.1);

vec4 transition (vec2 uv) {
  
  float distance = length(uv - center);
  float radius = sqrt(8.0) * abs(progress - 0.5);
  
  if (distance > radius) {
    return vec4(backColor, 1.0);
  }
  else {
    if (progress < 0.5) return getFromColor(uv);
    else return getToColor(uv);
  }
}
`,author:"Fernando Kuteken",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"circleopen",paramsTypes:{smoothness:"float",opening:"bool"},defaultParams:{smoothness:.3,opening:!0},glsl:`// author: gre
// License: MIT
uniform float smoothness; // = 0.3
uniform bool opening; // = true

const vec2 center = vec2(0.5, 0.5);
const float SQRT_2 = 1.414213562373;

vec4 transition (vec2 uv) {
  float x = opening ? progress : 1.-progress;
  float m = smoothstep(-smoothness, 0.0, SQRT_2*distance(center, uv) - x*(1.+smoothness));
  return mix(getFromColor(uv), getToColor(uv), opening ? 1.-m : m);
}
`,author:"gre",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"colorphase",paramsTypes:{fromStep:"vec4",toStep:"vec4"},defaultParams:{fromStep:[0,.2,.4,0],toStep:[.6,.8,1,1]},glsl:`// Author: gre
// License: MIT

// Usage: fromStep and toStep must be in [0.0, 1.0] range 
// and all(fromStep) must be < all(toStep)

uniform vec4 fromStep; // = vec4(0.0, 0.2, 0.4, 0.0)
uniform vec4 toStep; // = vec4(0.6, 0.8, 1.0, 1.0)

vec4 transition (vec2 uv) {
  vec4 a = getFromColor(uv);
  vec4 b = getToColor(uv);
  return mix(a, b, smoothstep(fromStep, toStep, vec4(progress)));
}
`,author:"gre",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"crosshatch",paramsTypes:{center:"vec2",threshold:"float",fadeEdge:"float"},defaultParams:{center:[.5,.5],threshold:3,fadeEdge:.1},glsl:`// License: MIT
// Author: pthrasher
// adapted by gre from https://gist.github.com/pthrasher/04fd9a7de4012cbb03f6

uniform vec2 center; // = vec2(0.5)
uniform float threshold; // = 3.0
uniform float fadeEdge; // = 0.1

float rand(vec2 co) {
  return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
}
vec4 transition(vec2 p) {
  float dist = distance(center, p) / threshold;
  float r = progress - min(rand(vec2(p.y, 0.0)), rand(vec2(0.0, p.x)));
  return mix(getFromColor(p), getToColor(p), mix(0.0, mix(step(dist, r), 1.0, smoothstep(1.0-fadeEdge, 1.0, progress)), smoothstep(0.0, fadeEdge, progress)));    
}
`,license:"MIT",author:"pthrasher",createdAt:"Mon, 12 Jun 2017 10:02:12 +0800",updatedAt:"Mon, 12 Jun 2017 10:02:12 +0800"},{name:"crosswarp",paramsTypes:{},defaultParams:{},glsl:`// Author: Eke P\xE9ter <peterekepeter@gmail.com>
// License: MIT
vec4 transition(vec2 p) {
  float x = progress;
  x=smoothstep(.0,1.0,(x*2.0+p.x-1.0));
  return mix(getFromColor((p-.5)*(1.-x)+.5), getToColor((p-.5)*x+.5), x);
}
`,author:"Eke P\xE9ter <peterekepeter@gmail.com>",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"cube",paramsTypes:{persp:"float",unzoom:"float",reflection:"float",floating:"float"},defaultParams:{persp:.7,unzoom:.3,reflection:.4,floating:3},glsl:`// Author: gre
// License: MIT
uniform float persp; // = 0.7
uniform float unzoom; // = 0.3
uniform float reflection; // = 0.4
uniform float floating; // = 3.0

vec2 project (vec2 p) {
  return p * vec2(1.0, -1.2) + vec2(0.0, -floating/100.);
}

bool inBounds (vec2 p) {
  return all(lessThan(vec2(0.0), p)) && all(lessThan(p, vec2(1.0)));
}

vec4 bgColor (vec2 p, vec2 pfr, vec2 pto) {
  vec4 c = vec4(0.0, 0.0, 0.0, 1.0);
  pfr = project(pfr);
  // FIXME avoid branching might help perf!
  if (inBounds(pfr)) {
    c += mix(vec4(0.0), getFromColor(pfr), reflection * mix(1.0, 0.0, pfr.y));
  }
  pto = project(pto);
  if (inBounds(pto)) {
    c += mix(vec4(0.0), getToColor(pto), reflection * mix(1.0, 0.0, pto.y));
  }
  return c;
}

// p : the position
// persp : the perspective in [ 0, 1 ]
// center : the xcenter in [0, 1] \\ 0.5 excluded
vec2 xskew (vec2 p, float persp, float center) {
  float x = mix(p.x, 1.0-p.x, center);
  return (
    (
      vec2( x, (p.y - 0.5*(1.0-persp) * x) / (1.0+(persp-1.0)*x) )
      - vec2(0.5-distance(center, 0.5), 0.0)
    )
    * vec2(0.5 / distance(center, 0.5) * (center<0.5 ? 1.0 : -1.0), 1.0)
    + vec2(center<0.5 ? 0.0 : 1.0, 0.0)
  );
}

vec4 transition(vec2 op) {
  float uz = unzoom * 2.0*(0.5-distance(0.5, progress));
  vec2 p = -uz*0.5+(1.0+uz) * op;
  vec2 fromP = xskew(
    (p - vec2(progress, 0.0)) / vec2(1.0-progress, 1.0),
    1.0-mix(progress, 0.0, persp),
    0.0
  );
  vec2 toP = xskew(
    p / vec2(progress, 1.0),
    mix(pow(progress, 2.0), 1.0, persp),
    1.0
  );
  // FIXME avoid branching might help perf!
  if (inBounds(fromP)) {
    return getFromColor(fromP);
  }
  else if (inBounds(toP)) {
    return getToColor(toP);
  }
  return bgColor(op, fromP, toP);
}
`,author:"gre",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"directionalwarp",paramsTypes:{direction:"vec2"},defaultParams:{direction:[-1,1]},glsl:`// Author: pschroen
// License: MIT

uniform vec2 direction; // = vec2(-1.0, 1.0)

const float smoothness = 0.5;
const vec2 center = vec2(0.5, 0.5);

vec4 transition (vec2 uv) {
  vec2 v = normalize(direction);
  v /= abs(v.x) + abs(v.y);
  float d = v.x * center.x + v.y * center.y;
  float m = 1.0 - smoothstep(-smoothness, 0.0, v.x * uv.x + v.y * uv.y - (d - 0.5 + progress * (1.0 + smoothness)));
  return mix(getFromColor((uv - 0.5) * (1.0 - m) + 0.5), getToColor((uv - 0.5) * m + 0.5), m);
}
`,author:"pschroen",license:"MIT",createdAt:"Wed, 13 Dec 2017 12:08:49 -0500",updatedAt:"Wed, 13 Dec 2017 12:08:49 -0500"},{name:"directionalwipe",paramsTypes:{direction:"vec2",smoothness:"float"},defaultParams:{direction:[1,-1],smoothness:.5},glsl:`// Author: gre
// License: MIT

uniform vec2 direction; // = vec2(1.0, -1.0)
uniform float smoothness; // = 0.5
 
const vec2 center = vec2(0.5, 0.5);
 
vec4 transition (vec2 uv) {
  vec2 v = normalize(direction);
  v /= abs(v.x)+abs(v.y);
  float d = v.x * center.x + v.y * center.y;
  float m =
    (1.0-step(progress, 0.0)) * // there is something wrong with our formula that makes m not equals 0.0 with progress is 0.0
    (1.0 - smoothstep(-smoothness, 0.0, v.x * uv.x + v.y * uv.y - (d-0.5+progress*(1.+smoothness))));
  return mix(getFromColor(uv), getToColor(uv), m);
}
`,author:"gre",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"displacement",paramsTypes:{displacementMap:"sampler2D",strength:"float"},defaultParams:{displacementMap:null,strength:.5},glsl:`// Author: Travis Fischer
// License: MIT
//
// Adapted from a Codrops article by Robin Delaporte
// https://tympanus.net/Development/DistortionHoverEffect

uniform sampler2D displacementMap;

uniform float strength; // = 0.5

vec4 transition (vec2 uv) {
  float displacement = texture2D(displacementMap, uv).r * strength;

  vec2 uvFrom = vec2(uv.x + progress * displacement, uv.y);
  vec2 uvTo = vec2(uv.x - (1.0 - progress) * displacement, uv.y);

  return mix(
    getFromColor(uvFrom),
    getToColor(uvTo),
    progress
  );
}
`,author:"Travis Fischer",license:"MIT",createdAt:"Tue, 10 Apr 2018 23:03:38 -0400",updatedAt:"Tue, 10 Apr 2018 23:03:38 -0400"},{name:"doorway",paramsTypes:{reflection:"float",perspective:"float",depth:"float"},defaultParams:{reflection:.4,perspective:.4,depth:3},glsl:`// author: gre
// License: MIT 
uniform float reflection; // = 0.4
uniform float perspective; // = 0.4
uniform float depth; // = 3

const vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
const vec2 boundMin = vec2(0.0, 0.0);
const vec2 boundMax = vec2(1.0, 1.0);

bool inBounds (vec2 p) {
  return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));
}

vec2 project (vec2 p) {
  return p * vec2(1.0, -1.2) + vec2(0.0, -0.02);
}

vec4 bgColor (vec2 p, vec2 pto) {
  vec4 c = black;
  pto = project(pto);
  if (inBounds(pto)) {
    c += mix(black, getToColor(pto), reflection * mix(1.0, 0.0, pto.y));
  }
  return c;
}


vec4 transition (vec2 p) {
  vec2 pfr = vec2(-1.), pto = vec2(-1.);
  float middleSlit = 2.0 * abs(p.x-0.5) - progress;
  if (middleSlit > 0.0) {
    pfr = p + (p.x > 0.5 ? -1.0 : 1.0) * vec2(0.5*progress, 0.0);
    float d = 1.0/(1.0+perspective*progress*(1.0-middleSlit));
    pfr.y -= d/2.;
    pfr.y *= d;
    pfr.y += d/2.;
  }
  float size = mix(1.0, depth, 1.-progress);
  pto = (p + vec2(-0.5, -0.5)) * vec2(size, size) + vec2(0.5, 0.5);
  if (inBounds(pfr)) {
    return getFromColor(pfr);
  }
  else if (inBounds(pto)) {
    return getToColor(pto);
  }
  else {
    return bgColor(p, pto);
  }
}
`,author:"gre",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"fade",paramsTypes:{},defaultParams:{},glsl:`// author: gre
// license: MIT

vec4 transition (vec2 uv) {
  return mix(
    getFromColor(uv),
    getToColor(uv),
    progress
  );
}
`,author:"gre",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"fadecolor",paramsTypes:{color:"vec3",colorPhase:"float"},defaultParams:{color:[0,0,0],colorPhase:.4},glsl:`// author: gre
// License: MIT
uniform vec3 color;// = vec3(0.0)
uniform float colorPhase/* = 0.4 */; // if 0.0, there is no black phase, if 0.9, the black phase is very important
vec4 transition (vec2 uv) {
  return mix(
    mix(vec4(color, 1.0), getFromColor(uv), smoothstep(1.0-colorPhase, 0.0, progress)),
    mix(vec4(color, 1.0), getToColor(uv), smoothstep(    colorPhase, 1.0, progress)),
    progress);
}
`,author:"gre",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"fadegrayscale",paramsTypes:{intensity:"float"},defaultParams:{intensity:.3},glsl:`// Author: gre
// License: MIT

uniform float intensity; // = 0.3; // if 0.0, the image directly turn grayscale, if 0.9, the grayscale transition phase is very important
 
vec3 grayscale (vec3 color) {
  return vec3(0.2126*color.r + 0.7152*color.g + 0.0722*color.b);
}
 
vec4 transition (vec2 uv) {
  vec4 fc = getFromColor(uv);
  vec4 tc = getToColor(uv);
  return mix(
    mix(vec4(grayscale(fc.rgb), 1.0), fc, smoothstep(1.0-intensity, 0.0, progress)),
    mix(vec4(grayscale(tc.rgb), 1.0), tc, smoothstep(    intensity, 1.0, progress)),
    progress);
}
`,author:"gre",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"flyeye",paramsTypes:{size:"float",zoom:"float",colorSeparation:"float"},defaultParams:{size:.04,zoom:50,colorSeparation:.3},glsl:`// Author: gre
// License: MIT
uniform float size; // = 0.04
uniform float zoom; // = 50.0
uniform float colorSeparation; // = 0.3

vec4 transition(vec2 p) {
  float inv = 1. - progress;
  vec2 disp = size*vec2(cos(zoom*p.x), sin(zoom*p.y));
  vec4 texTo = getToColor(p + inv*disp);
  vec4 texFrom = vec4(
    getFromColor(p + progress*disp*(1.0 - colorSeparation)).r,
    getFromColor(p + progress*disp).g,
    getFromColor(p + progress*disp*(1.0 + colorSeparation)).b,
    1.0);
  return texTo*progress + texFrom*inv;
}
`,author:"gre",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"heart",paramsTypes:{},defaultParams:{},glsl:`// Author: gre
// License: MIT

float inHeart (vec2 p, vec2 center, float size) {
  if (size==0.0) return 0.0;
  vec2 o = (p-center)/(1.6*size);
  float a = o.x*o.x+o.y*o.y-0.3;
  return step(a*a*a, o.x*o.x*o.y*o.y*o.y);
}
vec4 transition (vec2 uv) {
  return mix(
    getFromColor(uv),
    getToColor(uv),
    inHeart(uv, vec2(0.5, 0.4), progress)
  );
}
`,author:"gre",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"hexagonalize",paramsTypes:{steps:"int",horizontalHexagons:"float"},defaultParams:{steps:50,horizontalHexagons:20},glsl:`// Author: Fernando Kuteken
// License: MIT
// Hexagonal math from: http://www.redblobgames.com/grids/hexagons/

uniform int steps; // = 50;
uniform float horizontalHexagons; //= 20;

struct Hexagon {
  float q;
  float r;
  float s;
};

Hexagon createHexagon(float q, float r){
  Hexagon hex;
  hex.q = q;
  hex.r = r;
  hex.s = -q - r;
  return hex;
}

Hexagon roundHexagon(Hexagon hex){
  
  float q = floor(hex.q + 0.5);
  float r = floor(hex.r + 0.5);
  float s = floor(hex.s + 0.5);

  float deltaQ = abs(q - hex.q);
  float deltaR = abs(r - hex.r);
  float deltaS = abs(s - hex.s);

  if (deltaQ > deltaR && deltaQ > deltaS)
    q = -r - s;
  else if (deltaR > deltaS)
    r = -q - s;
  else
    s = -q - r;

  return createHexagon(q, r);
}

Hexagon hexagonFromPoint(vec2 point, float size) {
  
  point.y /= ratio;
  point = (point - 0.5) / size;
  
  float q = (sqrt(3.0) / 3.0) * point.x + (-1.0 / 3.0) * point.y;
  float r = 0.0 * point.x + 2.0 / 3.0 * point.y;

  Hexagon hex = createHexagon(q, r);
  return roundHexagon(hex);
  
}

vec2 pointFromHexagon(Hexagon hex, float size) {
  
  float x = (sqrt(3.0) * hex.q + (sqrt(3.0) / 2.0) * hex.r) * size + 0.5;
  float y = (0.0 * hex.q + (3.0 / 2.0) * hex.r) * size + 0.5;
  
  return vec2(x, y * ratio);
}

vec4 transition (vec2 uv) {
  
  float dist = 2.0 * min(progress, 1.0 - progress);
  dist = steps > 0 ? ceil(dist * float(steps)) / float(steps) : dist;
  
  float size = (sqrt(3.0) / 3.0) * dist / horizontalHexagons;
  
  vec2 point = dist > 0.0 ? pointFromHexagon(hexagonFromPoint(uv, size), size) : uv;

  return mix(getFromColor(point), getToColor(point), progress);
  
}
`,author:"Fernando Kuteken",license:"MIT",createdAt:"Tue, 30 May 2017 21:55:47 -0300",updatedAt:"Tue, 30 May 2017 21:55:47 -0300"},{name:"kaleidoscope",paramsTypes:{speed:"float",angle:"float",power:"float"},defaultParams:{speed:1,angle:1,power:1.5},glsl:`// Author: nwoeanhinnogaehr
// License: MIT

uniform float speed; // = 1.0;
uniform float angle; // = 1.0;
uniform float power; // = 1.5;

vec4 transition(vec2 uv) {
  vec2 p = uv.xy / vec2(1.0).xy;
  vec2 q = p;
  float t = pow(progress, power)*speed;
  p = p -0.5;
  for (int i = 0; i < 7; i++) {
    p = vec2(sin(t)*p.x + cos(t)*p.y, sin(t)*p.y - cos(t)*p.x);
    t += angle;
    p = abs(mod(p, 2.0) - 1.0);
  }
  abs(mod(p, 1.0));
  return mix(
    mix(getFromColor(q), getToColor(q), progress),
    mix(getFromColor(p), getToColor(p), progress), 1.0 - 2.0*abs(progress - 0.5));
}
`,author:"nwoeanhinnogaehr",license:"MIT",createdAt:"Wed, 31 May 2017 21:48:26 -0400",updatedAt:"Wed, 31 May 2017 21:48:26 -0400"},{name:"luma",paramsTypes:{luma:"sampler2D"},defaultParams:{luma:null},glsl:`// Author: gre
// License: MIT

uniform sampler2D luma;

vec4 transition(vec2 uv) {
  return mix(
    getToColor(uv),
    getFromColor(uv),
    step(progress, texture2D(luma, uv).r)
  );
}
`,author:"gre",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"luminance_melt",paramsTypes:{direction:"bool",l_threshold:"float",above:"bool"},defaultParams:{direction:!0,l_threshold:.8,above:!1},glsl:`// Author: 0gust1
// License: MIT
//My own first transition \u2014 based on crosshatch code (from pthrasher), using  simplex noise formula (copied and pasted)
//-> cooler with high contrasted images (isolated dark subject on light background f.e.)
//TODO : try to rebase it on DoomTransition (from zeh)?
//optimizations :
//luminance (see http://stackoverflow.com/questions/596216/formula-to-determine-brightness-of-rgb-color#answer-596241)
// Y = (R+R+B+G+G+G)/6
//or Y = (R+R+R+B+G+G+G+G)>>3 


//direction of movement :  0 : up, 1, down
uniform bool direction; // = 1 
//luminance threshold
uniform float l_threshold; // = 0.8 
//does the movement takes effect above or below luminance threshold ?
uniform bool above; // = false 


//Random function borrowed from everywhere
float rand(vec2 co){
  return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
}


// Simplex noise :
// Description : Array and textureless GLSL 2D simplex noise function.
//      Author : Ian McEwan, Ashima Arts.
//  Maintainer : ijm
//     Lastmod : 20110822 (ijm)
//     License : MIT  
//               2011 Ashima Arts. All rights reserved.
//               Distributed under the MIT License. See LICENSE file.
//               https://github.com/ashima/webgl-noise
// 

vec3 mod289(vec3 x) {
  return x - floor(x * (1.0 / 289.0)) * 289.0;
}

vec2 mod289(vec2 x) {
  return x - floor(x * (1.0 / 289.0)) * 289.0;
}

vec3 permute(vec3 x) {
  return mod289(((x*34.0)+1.0)*x);
}

float snoise(vec2 v)
  {
  const vec4 C = vec4(0.211324865405187,  // (3.0-sqrt(3.0))/6.0
                      0.366025403784439,  // 0.5*(sqrt(3.0)-1.0)
                     -0.577350269189626,  // -1.0 + 2.0 * C.x
                      0.024390243902439); // 1.0 / 41.0
// First corner
  vec2 i  = floor(v + dot(v, C.yy) );
  vec2 x0 = v -   i + dot(i, C.xx);

// Other corners
  vec2 i1;
  //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0
  //i1.y = 1.0 - i1.x;
  i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);
  // x0 = x0 - 0.0 + 0.0 * C.xx ;
  // x1 = x0 - i1 + 1.0 * C.xx ;
  // x2 = x0 - 1.0 + 2.0 * C.xx ;
  vec4 x12 = x0.xyxy + C.xxzz;
  x12.xy -= i1;

// Permutations
  i = mod289(i); // Avoid truncation effects in permutation
  vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))
		+ i.x + vec3(0.0, i1.x, 1.0 ));

  vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);
  m = m*m ;
  m = m*m ;

// Gradients: 41 points uniformly over a line, mapped onto a diamond.
// The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)

  vec3 x = 2.0 * fract(p * C.www) - 1.0;
  vec3 h = abs(x) - 0.5;
  vec3 ox = floor(x + 0.5);
  vec3 a0 = x - ox;

// Normalise gradients implicitly by scaling m
// Approximation of: m *= inversesqrt( a0*a0 + h*h );
  m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );

// Compute final noise value at P
  vec3 g;
  g.x  = a0.x  * x0.x  + h.x  * x0.y;
  g.yz = a0.yz * x12.xz + h.yz * x12.yw;
  return 130.0 * dot(m, g);
}

// Simplex noise -- end

float luminance(vec4 color){
  //(0.299*R + 0.587*G + 0.114*B)
  return color.r*0.299+color.g*0.587+color.b*0.114;
}

vec2 center = vec2(1.0, direction);

vec4 transition(vec2 uv) {
  vec2 p = uv.xy / vec2(1.0).xy;
  if (progress == 0.0) {
    return getFromColor(p);
  } else if (progress == 1.0) {
    return getToColor(p);
  } else {
    float x = progress;
    float dist = distance(center, p)- progress*exp(snoise(vec2(p.x, 0.0)));
    float r = x - rand(vec2(p.x, 0.1));
    float m;
    if(above){
     m = dist <= r && luminance(getFromColor(p))>l_threshold ? 1.0 : (progress*progress*progress);
    }
    else{
     m = dist <= r && luminance(getFromColor(p))<l_threshold ? 1.0 : (progress*progress*progress);  
    }
    return mix(getFromColor(p), getToColor(p), m);    
  }
}
`,author:"0gust1",license:"MIT",createdAt:"Wed, 24 Jan 2018 19:02:32 +0100",updatedAt:"Wed, 24 Jan 2018 19:02:32 +0100"},{name:"morph",paramsTypes:{strength:"float"},defaultParams:{strength:.1},glsl:`// Author: paniq
// License: MIT
uniform float strength; // = 0.1

vec4 transition(vec2 p) {
  vec4 ca = getFromColor(p);
  vec4 cb = getToColor(p);
  
  vec2 oa = (((ca.rg+ca.b)*0.5)*2.0-1.0);
  vec2 ob = (((cb.rg+cb.b)*0.5)*2.0-1.0);
  vec2 oc = mix(oa,ob,0.5)*strength;
  
  float w0 = progress;
  float w1 = 1.0-w0;
  return mix(getFromColor(p+oc*w0), getToColor(p-oc*w1), progress);
}
`,author:"paniq",license:"MIT",createdAt:"Thu, 10 Aug 2017 00:27:36 +0200",updatedAt:"Thu, 10 Aug 2017 00:32:01 +0200"},{name:"multiply_blend",paramsTypes:{},defaultParams:{},glsl:`// Author: Fernando Kuteken
// License: MIT

vec4 blend(vec4 a, vec4 b) {
  return a * b;
}

vec4 transition (vec2 uv) {
  
  vec4 blended = blend(getFromColor(uv), getToColor(uv));
  
  if (progress < 0.5)
    return mix(getFromColor(uv), blended, 2.0 * progress);
  else
    return mix(blended, getToColor(uv), 2.0 * progress - 1.0);
}

`,author:"Fernando Kuteken",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"perlin",paramsTypes:{scale:"float",smoothness:"float",seed:"float"},defaultParams:{scale:4,smoothness:.01,seed:12.9898},glsl:`// Author: Rich Harris
// License: MIT

#ifdef GL_ES
precision mediump float;
#endif

uniform float scale; // = 4.0
uniform float smoothness; // = 0.01

uniform float seed; // = 12.9898

// http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/
float random(vec2 co)
{
    highp float a = seed;
    highp float b = 78.233;
    highp float c = 43758.5453;
    highp float dt= dot(co.xy ,vec2(a,b));
    highp float sn= mod(dt,3.14);
    return fract(sin(sn) * c);
}

// 2D Noise based on Morgan McGuire @morgan3d
// https://www.shadertoy.com/view/4dS3Wd
float noise (in vec2 st) {
    vec2 i = floor(st);
    vec2 f = fract(st);

    // Four corners in 2D of a tile
    float a = random(i);
    float b = random(i + vec2(1.0, 0.0));
    float c = random(i + vec2(0.0, 1.0));
    float d = random(i + vec2(1.0, 1.0));

    // Smooth Interpolation

    // Cubic Hermine Curve.  Same as SmoothStep()
    vec2 u = f*f*(3.0-2.0*f);
    // u = smoothstep(0.,1.,f);

    // Mix 4 coorners porcentages
    return mix(a, b, u.x) +
            (c - a)* u.y * (1.0 - u.x) +
            (d - b) * u.x * u.y;
}

vec4 transition (vec2 uv) {
  vec4 from = getFromColor(uv);
  vec4 to = getToColor(uv);
  float n = noise(uv * scale);
  
  float p = mix(-smoothness, 1.0 + smoothness, progress);
  float lower = p - smoothness;
  float higher = p + smoothness;
  
  float q = smoothstep(lower, higher, n);
  
  return mix(
    from,
    to,
    1.0 - q
  );
}
`,author:"Rich Harris",license:"MIT",createdAt:"Tue, 23 Jan 2018 21:35:10 -0500",updatedAt:"Wed, 24 Jan 2018 07:35:04 -0500"},{name:"pinwheel",paramsTypes:{speed:"float"},defaultParams:{speed:2},glsl:`// Author: Mr Speaker
// License: MIT

uniform float speed; // = 2.0;

vec4 transition(vec2 uv) {
  
  vec2 p = uv.xy / vec2(1.0).xy;
  
  float circPos = atan(p.y - 0.5, p.x - 0.5) + progress * speed;
  float modPos = mod(circPos, 3.1415 / 4.);
  float signed = sign(progress - modPos);
  
  return mix(getToColor(p), getFromColor(p), step(signed, 0.5));
  
}
`,author:"Mr Speaker",license:"MIT",createdAt:"Tue, 30 May 2017 09:04:31 -0400",updatedAt:"Tue, 30 May 2017 09:04:31 -0400"},{name:"pixelize",paramsTypes:{squaresMin:"ivec2",steps:"int"},defaultParams:{squaresMin:[20,20],steps:50},glsl:`// Author: gre
// License: MIT
// forked from https://gist.github.com/benraziel/c528607361d90a072e98

uniform ivec2 squaresMin/* = ivec2(20) */; // minimum number of squares (when the effect is at its higher level)
uniform int steps /* = 50 */; // zero disable the stepping

float d = min(progress, 1.0 - progress);
float dist = steps>0 ? ceil(d * float(steps)) / float(steps) : d;
vec2 squareSize = 2.0 * dist / vec2(squaresMin);

vec4 transition(vec2 uv) {
  vec2 p = dist>0.0 ? (floor(uv / squareSize) + 0.5) * squareSize : uv;
  return mix(getFromColor(p), getToColor(p), progress);
}
`,author:"gre",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Wed, 31 May 2017 10:58:26 +0200"},{name:"polar_function",paramsTypes:{segments:"int"},defaultParams:{segments:5},glsl:`// Author: Fernando Kuteken
// License: MIT

#define PI 3.14159265359

uniform int segments; // = 5;

vec4 transition (vec2 uv) {
  
  float angle = atan(uv.y - 0.5, uv.x - 0.5) - 0.5 * PI;
  float normalized = (angle + 1.5 * PI) * (2.0 * PI);
  
  float radius = (cos(float(segments) * angle) + 4.0) / 4.0;
  float difference = length(uv - vec2(0.5, 0.5));
  
  if (difference > radius * progress)
    return getFromColor(uv);
  else
    return getToColor(uv);
}
`,author:"Fernando Kuteken",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"randomsquares",paramsTypes:{size:"ivec2",smoothness:"float"},defaultParams:{size:[10,10],smoothness:.5},glsl:`// Author: gre
// License: MIT

uniform ivec2 size; // = ivec2(10, 10)
uniform float smoothness; // = 0.5
 
float rand (vec2 co) {
  return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
}

vec4 transition(vec2 p) {
  float r = rand(floor(vec2(size) * p));
  float m = smoothstep(0.0, -smoothness, r - (progress * (1.0 + smoothness)));
  return mix(getFromColor(p), getToColor(p), m);
}
`,author:"gre",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"ripple",paramsTypes:{amplitude:"float",speed:"float"},defaultParams:{amplitude:100,speed:50},glsl:`// Author: gre
// License: MIT
uniform float amplitude; // = 100.0
uniform float speed; // = 50.0

vec4 transition (vec2 uv) {
  vec2 dir = uv - vec2(.5);
  float dist = length(dir);
  vec2 offset = dir * (sin(progress * dist * amplitude - progress * speed) + .5) / 30.;
  return mix(
    getFromColor(uv + offset),
    getToColor(uv),
    smoothstep(0.2, 1.0, progress)
  );
}
`,author:"gre",license:"MIT",createdAt:"Tue, 30 May 2017 15:15:27 +0200",updatedAt:"Tue, 30 May 2017 15:15:27 +0200"},{name:"rotate_scale_fade",paramsTypes:{center:"vec2",rotations:"float",scale:"float",backColor:"vec4"},defaultParams:{center:[.5,.5],rotations:1,scale:8,backColor:[.15,.15,.15,1]},glsl:`// Author: Fernando Kuteken
// License: MIT

#define PI 3.14159265359

uniform vec2 center; // = vec2(0.5, 0.5);
uniform float rotations; // = 1;
uniform float scale; // = 8;
uniform vec4 backColor; // = vec4(0.15, 0.15, 0.15, 1.0);

vec4 transition (vec2 uv) {
  
  vec2 difference = uv - center;
  vec2 dir = normalize(difference);
  float dist = length(difference);
  
  float angle = 2.0 * PI * rotations * progress;
  
  float c = cos(angle);
  float s = sin(angle);
  
  float currentScale = mix(scale, 1.0, 2.0 * abs(progress - 0.5));
  
  vec2 rotatedDir = vec2(dir.x  * c - dir.y * s, dir.x * s + dir.y * c);
  vec2 rotatedUv = center + rotatedDir * dist / currentScale;
  
  if (rotatedUv.x < 0.0 || rotatedUv.x > 1.0 ||
      rotatedUv.y < 0.0 || rotatedUv.y > 1.0)
    return backColor;
    
  return mix(getFromColor(rotatedUv), getToColor(rotatedUv), progress);
}
`,author:"Fernando Kuteken",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"squareswire",paramsTypes:{squares:"ivec2",direction:"vec2",smoothness:"float"},defaultParams:{squares:[10,10],direction:[1,-.5],smoothness:1.6},glsl:`// Author: gre
// License: MIT
 
uniform ivec2 squares;// = ivec2(10,10)
uniform vec2 direction;// = vec2(1.0, -0.5)
uniform float smoothness; // = 1.6

const vec2 center = vec2(0.5, 0.5);
vec4 transition (vec2 p) {
  vec2 v = normalize(direction);
  v /= abs(v.x)+abs(v.y);
  float d = v.x * center.x + v.y * center.y;
  float offset = smoothness;
  float pr = smoothstep(-offset, 0.0, v.x * p.x + v.y * p.y - (d-0.5+progress*(1.+offset)));
  vec2 squarep = fract(p*vec2(squares));
  vec2 squaremin = vec2(pr/2.0);
  vec2 squaremax = vec2(1.0 - pr/2.0);
  float a = (1.0 - step(progress, 0.0)) * step(squaremin.x, squarep.x) * step(squaremin.y, squarep.y) * step(squarep.x, squaremax.x) * step(squarep.y, squaremax.y);
  return mix(getFromColor(p), getToColor(p), a);
}
`,author:"gre",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"squeeze",paramsTypes:{colorSeparation:"float"},defaultParams:{colorSeparation:.04},glsl:`// Author: gre
// License: MIT
 
uniform float colorSeparation; // = 0.04
 
vec4 transition (vec2 uv) {
  float y = 0.5 + (uv.y-0.5) / (1.0-progress);
  if (y < 0.0 || y > 1.0) {
     return getToColor(uv);
  }
  else {
    vec2 fp = vec2(uv.x, y);
    vec2 off = progress * vec2(0.0, colorSeparation);
    vec4 c = getFromColor(fp);
    vec4 cn = getFromColor(fp - off);
    vec4 cp = getFromColor(fp + off);
    return vec4(cn.r, c.g, cp.b, c.a);
  }
}
`,author:"gre",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"swap",paramsTypes:{reflection:"float",perspective:"float",depth:"float"},defaultParams:{reflection:.4,perspective:.2,depth:3},glsl:`// Author: gre
// License: MIT
// General parameters
uniform float reflection; // = 0.4
uniform float perspective; // = 0.2
uniform float depth; // = 3.0
 
const vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
const vec2 boundMin = vec2(0.0, 0.0);
const vec2 boundMax = vec2(1.0, 1.0);
 
bool inBounds (vec2 p) {
  return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));
}
 
vec2 project (vec2 p) {
  return p * vec2(1.0, -1.2) + vec2(0.0, -0.02);
}
 
vec4 bgColor (vec2 p, vec2 pfr, vec2 pto) {
  vec4 c = black;
  pfr = project(pfr);
  if (inBounds(pfr)) {
    c += mix(black, getFromColor(pfr), reflection * mix(1.0, 0.0, pfr.y));
  }
  pto = project(pto);
  if (inBounds(pto)) {
    c += mix(black, getToColor(pto), reflection * mix(1.0, 0.0, pto.y));
  }
  return c;
}
 
vec4 transition(vec2 p) {
  vec2 pfr, pto = vec2(-1.);
 
  float size = mix(1.0, depth, progress);
  float persp = perspective * progress;
  pfr = (p + vec2(-0.0, -0.5)) * vec2(size/(1.0-perspective*progress), size/(1.0-size*persp*p.x)) + vec2(0.0, 0.5);
 
  size = mix(1.0, depth, 1.-progress);
  persp = perspective * (1.-progress);
  pto = (p + vec2(-1.0, -0.5)) * vec2(size/(1.0-perspective*(1.0-progress)), size/(1.0-size*persp*(0.5-p.x))) + vec2(1.0, 0.5);

  if (progress < 0.5) {
    if (inBounds(pfr)) {
      return getFromColor(pfr);
    }
    if (inBounds(pto)) {
      return getToColor(pto);
    }  
  }
  if (inBounds(pto)) {
    return getToColor(pto);
  }
  if (inBounds(pfr)) {
    return getFromColor(pfr);
  }
  return bgColor(p, pfr, pto);
}
`,author:"gre",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Sun, 18 Feb 2018 17:45:50 +0100"},{name:"undulatingBurnOut",paramsTypes:{smoothness:"float",center:"vec2",color:"vec3"},defaultParams:{smoothness:.03,center:[.5,.5],color:[0,0,0]},glsl:`// License: MIT
// Author: pthrasher
// adapted by gre from https://gist.github.com/pthrasher/8e6226b215548ba12734

uniform float smoothness; // = 0.03
uniform vec2 center; // = vec2(0.5)
uniform vec3 color; // = vec3(0.0)

const float M_PI = 3.14159265358979323846;

float quadraticInOut(float t) {
  float p = 2.0 * t * t;
  return t < 0.5 ? p : -p + (4.0 * t) - 1.0;
}

float getGradient(float r, float dist) {
  float d = r - dist;
  return mix(
    smoothstep(-smoothness, 0.0, r - dist * (1.0 + smoothness)),
    -1.0 - step(0.005, d),
    step(-0.005, d) * step(d, 0.01)
  );
}

float getWave(vec2 p){
  vec2 _p = p - center; // offset from center
  float rads = atan(_p.y, _p.x);
  float degs = degrees(rads) + 180.0;
  vec2 range = vec2(0.0, M_PI * 30.0);
  vec2 domain = vec2(0.0, 360.0);
  float ratio = (M_PI * 30.0) / 360.0;
  degs = degs * ratio;
  float x = progress;
  float magnitude = mix(0.02, 0.09, smoothstep(0.0, 1.0, x));
  float offset = mix(40.0, 30.0, smoothstep(0.0, 1.0, x));
  float ease_degs = quadraticInOut(sin(degs));
  float deg_wave_pos = (ease_degs * magnitude) * sin(x * offset);
  return x + deg_wave_pos;
}

vec4 transition(vec2 p) {
  float dist = distance(center, p);
  float m = getGradient(getWave(p), dist);
  vec4 cfrom = getFromColor(p);
  vec4 cto = getToColor(p);
  return mix(mix(cfrom, cto, m), mix(cfrom, vec4(color, 1.0), 0.75), step(m, -2.0));
}
`,license:"MIT",author:"pthrasher",createdAt:"Mon, 12 Jun 2017 10:23:37 +0800",updatedAt:"Mon, 12 Jun 2017 10:23:37 +0800"},{name:"wind",paramsTypes:{size:"float"},defaultParams:{size:.2},glsl:`// Author: gre
// License: MIT

// Custom parameters
uniform float size; // = 0.2

float rand (vec2 co) {
  return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
}

vec4 transition (vec2 uv) {
  float r = rand(vec2(0, uv.y));
  float m = smoothstep(0.0, -size, uv.x*(1.0-size) + size*r - (progress * (1.0 + size)));
  return mix(
    getFromColor(uv),
    getToColor(uv),
    m
  );
}
`,author:"gre",license:"MIT",createdAt:"Tue, 30 May 2017 14:26:44 +0200",updatedAt:"Tue, 30 May 2017 14:26:44 +0200"},{name:"windowblinds",paramsTypes:{},defaultParams:{},glsl:`// Author: Fabien Benetou
// License: MIT

vec4 transition (vec2 uv) {
  float t = progress;
  
  if (mod(floor(uv.y*100.*progress),2.)==0.)
    t*=2.-.5;
  
  return mix(
    getFromColor(uv),
    getToColor(uv),
    mix(t, progress, smoothstep(0.8, 1.0, progress))
  );
}
`,author:"Fabien Benetou",license:"MIT",createdAt:"Wed, 31 May 2017 14:11:48 +0200",updatedAt:"Wed, 31 May 2017 14:11:48 +0200"},{name:"windowslice",paramsTypes:{count:"float",smoothness:"float"},defaultParams:{count:10,smoothness:.5},glsl:`// Author: gre
// License: MIT

uniform float count; // = 10.0
uniform float smoothness; // = 0.5

vec4 transition (vec2 p) {
  float pr = smoothstep(-smoothness, 0.0, p.x - progress * (1.0 + smoothness));
  float s = step(pr, fract(count * p.x));
  return mix(getFromColor(p), getToColor(p), s);
}
`,author:"gre",license:"MIT",createdAt:"Wed, 28 Mar 2018 17:23:26 +0200",updatedAt:"Wed, 28 Mar 2018 17:23:26 +0200"},{name:"wipeDown",paramsTypes:{},defaultParams:{},glsl:`// Author: Jake Nelson
// License: MIT

vec4 transition(vec2 uv) {
  vec2 p=uv.xy/vec2(1.0).xy;
  vec4 a=getFromColor(p);
  vec4 b=getToColor(p);
  return mix(a, b, step(1.0-p.y,progress));
}
`,author:"Jake Nelson",license:"MIT",createdAt:"Wed, 1 Nov 2017 15:26:01 -0500",updatedAt:"Thu, 2 Nov 2017 18:39:26 -0500"},{name:"wipeLeft",paramsTypes:{},defaultParams:{},glsl:`// Author: Jake Nelson
// License: MIT

vec4 transition(vec2 uv) {
  vec2 p=uv.xy/vec2(1.0).xy;
  vec4 a=getFromColor(p);
  vec4 b=getToColor(p);
  return mix(a, b, step(1.0-p.x,progress));
}
`,author:"Jake Nelson",license:"MIT",createdAt:"Wed, 1 Nov 2017 15:26:28 -0500",updatedAt:"Fri, 3 Nov 2017 18:03:50 +0100"},{name:"wipeRight",paramsTypes:{},defaultParams:{},glsl:`// Author: Jake Nelson
// License: MIT

vec4 transition(vec2 uv) {
  vec2 p=uv.xy/vec2(1.0).xy;
  vec4 a=getFromColor(p);
  vec4 b=getToColor(p);
  return mix(a, b, step(0.0+p.x,progress));
}
`,author:"Jake Nelson",license:"MIT",createdAt:"Wed, 1 Nov 2017 15:27:02 -0500",updatedAt:"Thu, 2 Nov 2017 18:40:22 -0500"},{name:"wipeUp",paramsTypes:{},defaultParams:{},glsl:`// Author: Jake Nelson
// License: MIT

vec4 transition(vec2 uv) {
  vec2 p=uv.xy/vec2(1.0).xy;
  vec4 a=getFromColor(p);
  vec4 b=getToColor(p);
  return mix(a, b, step(0.0+p.y,progress));
}
`,author:"Jake Nelson",license:"MIT",createdAt:"Wed, 1 Nov 2017 15:24:36 -0500",updatedAt:"Thu, 2 Nov 2017 18:37:42 -0500"}]});var Ss=N((IR,_f)=>{"use strict";_f.exports=sy;function sy(e,t){for(var r={},n=0;n<e.length;++n)for(var o=e[n].name,a=o.split("."),i=r,l=0;l<a.length;++l){var c=a[l].split("[");if(c.length>1){c[0]in i||(i[c[0]]=[]),i=i[c[0]];for(var s=1;s<c.length;++s){var u=parseInt(c[s]);s<c.length-1||l<a.length-1?(u in i||(s<c.length-1?i[u]=[]:i[u]={}),i=i[u]):t?i[u]=n:i[u]=e[n].type}}else l<a.length-1?(c[0]in i||(i[c[0]]={}),i=i[c[0]]):t?i[c[0]]=n:i[c[0]]=e[n].type}return r}});var Gn=N((CR,wf)=>{function qn(e,t,r){this.shortMessage=t||"",this.longMessage=r||"",this.rawError=e||"",this.message="gl-shader: "+(t||e||"")+(r?`
`+r:""),this.stack=new Error().stack}qn.prototype=new Error;qn.prototype.name="GLError";qn.prototype.constructor=qn;wf.exports=qn});var Tf=N((SR,xf)=>{"use strict";var ly=Ss(),hr=Gn();xf.exports=uy;function bf(e){return function(){return e}}function Ms(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=t;return r}function uy(e,t,r,n){function o(f){return function(d,p,m){return d.getUniform(p.program,m[f])}}function a(f){return function(p){for(var m=i("",f),w=0;w<m.length;++w){var y=m[w],I=y[0],R=y[1];if(n[R]){var q=p;if(typeof I=="string"&&(I.indexOf(".")===0||I.indexOf("[")===0)){var F=I;if(I.indexOf(".")===0&&(F=I.slice(1)),F.indexOf("]")===F.length-1){var Q=F.indexOf("["),L=F.slice(0,Q),G=F.slice(Q+1,F.length-1);q=L?p[L][G]:p[G]}else q=p[F]}var B=r[R].type,U;switch(B){case"bool":case"int":case"sampler2D":case"samplerCube":e.uniform1i(n[R],q);break;case"float":e.uniform1f(n[R],q);break;default:var ie=B.indexOf("vec");if(0<=ie&&ie<=1&&B.length===4+ie){if(U=B.charCodeAt(B.length-1)-48,U<2||U>4)throw new hr("","Invalid data type");switch(B.charAt(0)){case"b":case"i":e["uniform"+U+"iv"](n[R],q);break;case"v":e["uniform"+U+"fv"](n[R],q);break;default:throw new hr("","Unrecognized data type for vector "+name+": "+B)}}else if(B.indexOf("mat")===0&&B.length===4){if(U=B.charCodeAt(B.length-1)-48,U<2||U>4)throw new hr("","Invalid uniform dimension type for matrix "+name+": "+B);e["uniformMatrix"+U+"fv"](n[R],!1,q);break}else throw new hr("","Unknown uniform data type for "+name+": "+B)}}}}}function i(f,d){if(typeof d!="object")return[[f,d]];var p=[];for(var m in d){var w=d[m],y=f;parseInt(m)+""===m?y+="["+m+"]":y+="."+m,typeof w=="object"?p.push.apply(p,i(y,w)):p.push([y,w])}return p}function l(f){switch(f){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var d=f.indexOf("vec");if(0<=d&&d<=1&&f.length===4+d){var p=f.charCodeAt(f.length-1)-48;if(p<2||p>4)throw new hr("","Invalid data type");return f.charAt(0)==="b"?Ms(p,!1):Ms(p,0)}else if(f.indexOf("mat")===0&&f.length===4){var p=f.charCodeAt(f.length-1)-48;if(p<2||p>4)throw new hr("","Invalid uniform dimension type for matrix "+name+": "+f);return Ms(p*p,0)}else throw new hr("","Unknown uniform data type for "+name+": "+f)}}function c(f,d,p){if(typeof p=="object"){var m=s(p);Object.defineProperty(f,d,{get:bf(m),set:a(p),enumerable:!0,configurable:!1})}else n[p]?Object.defineProperty(f,d,{get:o(p),set:a(p),enumerable:!0,configurable:!1}):f[d]=l(r[p].type)}function s(f){var d;if(Array.isArray(f)){d=new Array(f.length);for(var p=0;p<f.length;++p)c(d,p,f[p])}else{d={};for(var m in f)c(d,m,f[m])}return d}var u=ly(r,!0);return{get:bf(s(u)),set:a(u),enumerable:!0,configurable:!0}}});var If=N((MR,Af)=>{"use strict";Af.exports=dy;var Ps=Gn();function Ef(e,t,r,n,o,a){this._gl=e,this._wrapper=t,this._index=r,this._locations=n,this._dimension=o,this._constFunc=a}var Rs=Ef.prototype;Rs.pointer=function(t,r,n,o){var a=this,i=a._gl,l=a._locations[a._index];i.vertexAttribPointer(l,a._dimension,t||i.FLOAT,!!r,n||0,o||0),i.enableVertexAttribArray(l)};Rs.set=function(e,t,r,n){return this._constFunc(this._locations[this._index],e,t,r,n)};Object.defineProperty(Rs,"location",{get:function(){return this._locations[this._index]},set:function(e){return e!==this._locations[this._index]&&(this._locations[this._index]=e|0,this._wrapper.program=null),e|0}});var cy=[function(e,t,r){return r.length===void 0?e.vertexAttrib1f(t,r):e.vertexAttrib1fv(t,r)},function(e,t,r,n){return r.length===void 0?e.vertexAttrib2f(t,r,n):e.vertexAttrib2fv(t,r)},function(e,t,r,n,o){return r.length===void 0?e.vertexAttrib3f(t,r,n,o):e.vertexAttrib3fv(t,r)},function(e,t,r,n,o,a){return r.length===void 0?e.vertexAttrib4f(t,r,n,o,a):e.vertexAttrib4fv(t,r)}];function js(e,t,r,n,o,a,i){var l=cy[o],c=new Ef(e,t,r,n,o,l);Object.defineProperty(a,i,{set:function(s){return e.disableVertexAttribArray(n[r]),l(e,n[r],s),s},get:function(){return c},enumerable:!0})}function fy(e,t,r,n,o,a,i){for(var l=new Array(o),c=new Array(o),s=0;s<o;++s)js(e,t,r[s],n,o,l,s),c[s]=l[s];Object.defineProperty(l,"location",{set:function(d){if(Array.isArray(d))for(var p=0;p<o;++p)c[p].location=d[p];else for(var p=0;p<o;++p)c[p].location=d+p;return d},get:function(){for(var d=new Array(o),p=0;p<o;++p)d[p]=n[r[p]];return d},enumerable:!0}),l.pointer=function(d,p,m,w){d=d||e.FLOAT,p=!!p,m=m||o*o,w=w||0;for(var y=0;y<o;++y){var I=n[r[y]];e.vertexAttribPointer(I,o,d,p,m,w+y*o),e.enableVertexAttribArray(I)}};var u=new Array(o),f=e["vertexAttrib"+o+"fv"];Object.defineProperty(a,i,{set:function(d){for(var p=0;p<o;++p){var m=n[r[p]];if(e.disableVertexAttribArray(m),Array.isArray(d[0]))f.call(e,m,d[p]);else{for(var w=0;w<o;++w)u[w]=d[o*p+w];f.call(e,m,u)}}return d},get:function(){return l},enumerable:!0})}function dy(e,t,r,n){for(var o={},a=0,i=r.length;a<i;++a){var l=r[a],c=l.name,s=l.type,u=l.locations;switch(s){case"bool":case"int":case"float":js(e,t,u[0],n,1,o,c);break;default:if(s.indexOf("vec")>=0){var f=s.charCodeAt(s.length-1)-48;if(f<2||f>4)throw new Ps("","Invalid data type for attribute "+c+": "+s);js(e,t,u[0],n,f,o,c)}else if(s.indexOf("mat")>=0){var f=s.charCodeAt(s.length-1)-48;if(f<2||f>4)throw new Ps("","Invalid data type for attribute "+c+": "+s);fy(e,t,u,n,f,o,c)}else throw new Ps("","Unknown data type for attribute "+c+": "+s);break}}return o}});var Cf=N(sa=>{(function(){"use strict";var e={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function t(i){return n(a(i),arguments)}function r(i,l){return t.apply(null,[i].concat(l||[]))}function n(i,l){var c=1,s=i.length,u,f="",d,p,m,w,y,I,R,q;for(d=0;d<s;d++)if(typeof i[d]=="string")f+=i[d];else if(typeof i[d]=="object"){if(m=i[d],m.keys)for(u=l[c],p=0;p<m.keys.length;p++){if(u==null)throw new Error(t('[sprintf] Cannot access property "%s" of undefined value "%s"',m.keys[p],m.keys[p-1]));u=u[m.keys[p]]}else m.param_no?u=l[m.param_no]:u=l[c++];if(e.not_type.test(m.type)&&e.not_primitive.test(m.type)&&u instanceof Function&&(u=u()),e.numeric_arg.test(m.type)&&typeof u!="number"&&isNaN(u))throw new TypeError(t("[sprintf] expecting number but found %T",u));switch(e.number.test(m.type)&&(R=u>=0),m.type){case"b":u=parseInt(u,10).toString(2);break;case"c":u=String.fromCharCode(parseInt(u,10));break;case"d":case"i":u=parseInt(u,10);break;case"j":u=JSON.stringify(u,null,m.width?parseInt(m.width):0);break;case"e":u=m.precision?parseFloat(u).toExponential(m.precision):parseFloat(u).toExponential();break;case"f":u=m.precision?parseFloat(u).toFixed(m.precision):parseFloat(u);break;case"g":u=m.precision?String(Number(u.toPrecision(m.precision))):parseFloat(u);break;case"o":u=(parseInt(u,10)>>>0).toString(8);break;case"s":u=String(u),u=m.precision?u.substring(0,m.precision):u;break;case"t":u=String(!!u),u=m.precision?u.substring(0,m.precision):u;break;case"T":u=Object.prototype.toString.call(u).slice(8,-1).toLowerCase(),u=m.precision?u.substring(0,m.precision):u;break;case"u":u=parseInt(u,10)>>>0;break;case"v":u=u.valueOf(),u=m.precision?u.substring(0,m.precision):u;break;case"x":u=(parseInt(u,10)>>>0).toString(16);break;case"X":u=(parseInt(u,10)>>>0).toString(16).toUpperCase();break}e.json.test(m.type)?f+=u:(e.number.test(m.type)&&(!R||m.sign)?(q=R?"+":"-",u=u.toString().replace(e.sign,"")):q="",y=m.pad_char?m.pad_char==="0"?"0":m.pad_char.charAt(1):" ",I=m.width-(q+u).length,w=m.width&&I>0?y.repeat(I):"",f+=m.align?q+u+w:y==="0"?q+w+u:w+q+u)}return f}var o=Object.create(null);function a(i){if(o[i])return o[i];for(var l=i,c,s=[],u=0;l;){if((c=e.text.exec(l))!==null)s.push(c[0]);else if((c=e.modulo.exec(l))!==null)s.push("%");else if((c=e.placeholder.exec(l))!==null){if(c[2]){u|=1;var f=[],d=c[2],p=[];if((p=e.key.exec(d))!==null)for(f.push(p[1]);(d=d.substring(p[0].length))!=="";)if((p=e.key_access.exec(d))!==null)f.push(p[1]);else if((p=e.index_access.exec(d))!==null)f.push(p[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");c[2]=f}else u|=2;if(u===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");s.push({placeholder:c[0],param_no:c[1],keys:c[2],sign:c[3],pad_char:c[4],align:c[5],width:c[6],precision:c[7],type:c[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");l=l.substring(c[0].length)}return o[i]=s}typeof sa!="undefined"&&(sa.sprintf=t,sa.vsprintf=r),typeof window!="undefined"&&(window.sprintf=t,window.vsprintf=r,typeof define=="function"&&define.amd&&define(function(){return{sprintf:t,vsprintf:r}}))})()});var Mf=N((jR,Sf)=>{Sf.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}});var jf=N((RR,Pf)=>{var hy=Mf();Pf.exports=function(t){return hy[t]}});var ks=N((kR,Rf)=>{Rf.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]});var Df=N((DR,kf)=>{kf.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]});var Ds=N((OR,Of)=>{Of.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]});var Ff=N((LR,Lf)=>{var py=ks();Lf.exports=py.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])});var Nf=N((FR,Qf)=>{var Os=Ds();Os=Os.slice().filter(function(e){return!/^(gl\_|texture)/.test(e)});Qf.exports=Os.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])});var $f=N((QR,Wf)=>{Wf.exports=Ey;var my=ks(),Bf=Df(),vy=Ds(),gy=Ff(),yy=Nf(),pt=999,zf=9999,Ls=0,Fs=1,Uf=2,Vf=3,Hf=4,Wn=5,_y=6,wy=7,by=8,qf=9,xy=10,Gf=11,Ty=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function Ey(e){var t=0,r=0,n=pt,o,a,i=[],l=[],c=0,s=0,u=1,f=0,d=0,p=!1,m=!1,w="",y;e=e||{};var I=vy,R=my;e.version==="300 es"&&(I=yy,R=gy);for(var q={},F={},t=0;t<I.length;t++)q[I[t]]=!0;for(var t=0;t<R.length;t++)F[R[t]]=!0;return function(k){return l=[],k!==null?L(k):G()};function Q(k){k.length&&l.push({type:Ty[n],data:k,position:d,line:u,column:f})}function L(k){t=0,k.toString&&(k=k.toString()),w+=k.replace(/\r\n/g,`
`),y=w.length;for(var $;o=w[t],t<y;){switch($=t,n){case Ls:t=ye();break;case Fs:t=he();break;case Uf:t=ie();break;case Vf:t=be();break;case Hf:t=h();break;case Gf:t=A();break;case Wn:t=S();break;case zf:t=O();break;case qf:t=U();break;case pt:t=B();break}if($!==t)switch(w[$]){case`
`:f=0,++u;break;default:++f;break}}return r+=t,w=w.slice(t),l}function G(k){return i.length&&Q(i.join("")),n=xy,Q("(eof)"),l}function B(){return i=i.length?[]:i,a==="/"&&o==="*"?(d=r+t-1,n=Ls,a=o,t+1):a==="/"&&o==="/"?(d=r+t-1,n=Fs,a=o,t+1):o==="#"?(n=Uf,d=r+t,t):/\s/.test(o)?(n=qf,d=r+t,t):(p=/\d/.test(o),m=/[^\w_]/.test(o),d=r+t,n=p?Hf:m?Vf:zf,t)}function U(){return/[^\s]/g.test(o)?(Q(i.join("")),n=pt,t):(i.push(o),a=o,t+1)}function ie(){return(o==="\r"||o===`
`)&&a!=="\\"?(Q(i.join("")),n=pt,t):(i.push(o),a=o,t+1)}function he(){return ie()}function ye(){return o==="/"&&a==="*"?(i.push(o),Q(i.join("")),n=pt,t+1):(i.push(o),a=o,t+1)}function be(){if(a==="."&&/\d/.test(o))return n=Wn,t;if(a==="/"&&o==="*")return n=Ls,t;if(a==="/"&&o==="/")return n=Fs,t;if(o==="."&&i.length){for(;E(i););return n=Wn,t}if(o===";"||o===")"||o==="("){if(i.length)for(;E(i););return Q(o),n=pt,t+1}var k=i.length===2&&o!=="=";if(/[\w_\d\s]/.test(o)||k){for(;E(i););return n=pt,t}return i.push(o),a=o,t+1}function E(k){var $=0,Z,te;do{if(Z=Bf.indexOf(k.slice(0,k.length+$).join("")),te=Bf[Z],Z===-1){if($--+k.length>0)continue;te=k.slice(0,1).join("")}return Q(te),d+=te.length,i=i.slice(te.length),i.length}while(1)}function A(){return/[^a-fA-F0-9]/.test(o)?(Q(i.join("")),n=pt,t):(i.push(o),a=o,t+1)}function h(){return o==="."||/[eE]/.test(o)?(i.push(o),n=Wn,a=o,t+1):o==="x"&&i.length===1&&i[0]==="0"?(n=Gf,i.push(o),a=o,t+1):/[^\d]/.test(o)?(Q(i.join("")),n=pt,t):(i.push(o),a=o,t+1)}function S(){return o==="f"&&(i.push(o),a=o,t+=1),/[eE]/.test(o)||(o==="-"||o==="+")&&/[eE]/.test(a)?(i.push(o),a=o,t+1):/[^\d]/.test(o)?(Q(i.join("")),n=pt,t):(i.push(o),a=o,t+1)}function O(){if(/[^\d\w_]/.test(o)){var k=i.join("");return F[k]?n=by:q[k]?n=wy:n=_y,Q(i.join("")),n=pt,t}return i.push(o),a=o,t+1}}});var Yf=N((NR,Xf)=>{var Ay=$f();Xf.exports=Iy;function Iy(e,t){var r=Ay(t),n=[];return n=n.concat(r(e)),n=n.concat(r(null)),n}});var Jf=N((BR,Kf)=>{Kf.exports=function(t){return atob(t)}});var ed=N((zR,Zf)=>{var Cy=Yf(),Sy=Jf();Zf.exports=My;function My(e){for(var t=Array.isArray(e)?e:Cy(e),r=0;r<t.length;r++){var n=t[r];if(n.type==="preprocessor"){var o=n.data.match(/\#define\s+SHADER_NAME(_B64)?\s+(.+)$/);if(o&&o[2]){var a=o[1],i=o[2];return(a?Sy(i):i).trim()}}}}});var rd=N((UR,td)=>{"use strict";var Dt="",Qs;td.exports=Py;function Py(e,t){if(typeof e!="string")throw new TypeError("expected a string");if(t===1)return e;if(t===2)return e+e;var r=e.length*t;if(Qs!==e||typeof Qs=="undefined")Qs=e,Dt="";else if(Dt.length>=r)return Dt.substr(0,r);for(;r>Dt.length&&t>1;)t&1&&(Dt+=e),t>>=1,e+=e;return Dt+=e,Dt=Dt.substr(0,r),Dt}});var od=N((VR,nd)=>{"use strict";var jy=rd();nd.exports=function(t,r,n){return n=typeof n!="undefined"?n+"":" ",jy(n,r)+t}});var id=N((HR,ad)=>{var Ry=od();ad.exports=ky;function ky(e,t,r){t=typeof t=="number"?t:1,r=r||": ";var n=e.split(/\r?\n/),o=String(n.length+t-1).length;return n.map(function(a,i){var l=i+t,c=String(l).length,s=Ry(l,o-c);return s+r+a}).join(`
`)}});var ld=N((qR,sd)=>{var la=Cf().sprintf,Dy=jf(),Oy=ed(),Ly=id();sd.exports=Fy;function Fy(e,t,r){"use strict";var n=Oy(t)||"of unknown name (see npm glsl-shader-name)",o="unknown type";r!==void 0&&(o=r===Dy.FRAGMENT_SHADER?"fragment":"vertex");for(var a=la(`Error compiling %s shader %s:
`,o,n),i=la("%s%s",a,e),l=e.split(`
`),c={},s=0;s<l.length;s++){var u=l[s];if(!(u===""||u==="\0")){var f=parseInt(u.split(":")[2]);if(isNaN(f))throw new Error(la("Could not parse error: %s",u));c[f]=u}}for(var d=Ly(t).split(`
`),s=0;s<d.length;s++)if(!(!c[s+3]&&!c[s+2]&&!c[s+1])){var p=d[s];if(a+=p+`
`,c[s+1]){var m=c[s+1];m=m.substr(m.split(":",3).join(":").length+1).trim(),a+=la(`^^^ %s

`,m)}}return{long:a.trim(),short:i.trim()}}});var cd=N((GR,ud)=>{ud.exports=Qy;function Qy(e,t){var r={identity:t},n=e.valueOf;return Object.defineProperty(e,"valueOf",{value:function(o){return o!==t?n.apply(this,arguments):r},writable:!0}),r}});var dd=N((WR,fd)=>{var Ny=cd();fd.exports=By;function By(){var e={};return function(t){if((typeof t!="object"||t===null)&&typeof t!="function")throw new Error("Weakmap-shim: Key must be object");var r=t.valueOf(e);return r&&r.identity===e?r:Ny(t,e)}}});var pd=N(($R,hd)=>{var zy=dd();hd.exports=Uy;function Uy(){var e=zy();return{get:function(t,r){var n=e(t);return n.hasOwnProperty("value")?n.value:r},set:function(t,r){return e(t).value=r,this},has:function(t){return"value"in e(t)},delete:function(t){return delete e(t).value}}}});var wd=N(Bs=>{"use strict";Bs.shader=$y;Bs.program=Xy;var Ns=Gn(),Vy=ld(),Hy=typeof WeakMap=="undefined"?pd():WeakMap,md=new Hy,qy=0;function vd(e,t,r,n,o,a,i){this.id=e,this.src=t,this.type=r,this.shader=n,this.count=a,this.programs=[],this.cache=i}vd.prototype.dispose=function(){if(--this.count===0){for(var e=this.cache,t=e.gl,r=this.programs,n=0,o=r.length;n<o;++n){var a=e.programs[r[n]];a&&(delete e.programs[n],t.deleteProgram(a))}t.deleteShader(this.shader),delete e.shaders[this.type===t.FRAGMENT_SHADER|0][this.src]}};function gd(e){this.gl=e,this.shaders=[{},{}],this.programs={}}var yd=gd.prototype;function Gy(e,t,r){var n=e.createShader(t);if(e.shaderSource(n,r),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS)){var o=e.getShaderInfoLog(n);try{var a=Vy(o,r,t)}catch(i){throw console.warn("Failed to format compiler error: "+i),new Ns(o,`Error compiling shader:
`+o)}throw new Ns(o,a.short,a.long)}return n}yd.getShaderReference=function(e,t){var r=this.gl,n=this.shaders[e===r.FRAGMENT_SHADER|0],o=n[t];if(!o||!r.isShader(o.shader)){var a=Gy(r,e,t);o=n[t]=new vd(qy++,t,e,a,[],1,this)}else o.count+=1;return o};function Wy(e,t,r,n,o){var a=e.createProgram();e.attachShader(a,t),e.attachShader(a,r);for(var i=0;i<n.length;++i)e.bindAttribLocation(a,o[i],n[i]);if(e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS)){var l=e.getProgramInfoLog(a);throw new Ns(l,"Error linking program: "+l)}return a}yd.getProgram=function(e,t,r,n){var o=[e.id,t.id,r.join(":"),n.join(":")].join("@"),a=this.programs[o];return(!a||!this.gl.isProgram(a))&&(this.programs[o]=a=Wy(this.gl,e.shader,t.shader,r,n),e.programs.push(o),t.programs.push(o)),a};function _d(e){var t=md.get(e);return t||(t=new gd(e),md.set(e,t)),t}function $y(e,t,r){return _d(e).getShaderReference(t,r)}function Xy(e,t,r,n,o){return _d(e).getProgram(t,r,n,o)}});var Td=N(zs=>{"use strict";zs.uniforms=Yy;zs.attributes=Ky;var bd={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},ua=null;function xd(e,t){if(!ua){var r=Object.keys(bd);ua={};for(var n=0;n<r.length;++n){var o=r[n];ua[e[o]]=bd[o]}}return ua[t]}function Yy(e,t){for(var r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),n=[],o=0;o<r;++o){var a=e.getActiveUniform(t,o);if(a){var i=xd(e,a.type);if(a.size>1)for(var l=0;l<a.size;++l)n.push({name:a.name.replace("[0]","["+l+"]"),type:i});else n.push({name:a.name,type:i})}}return n}function Ky(e,t){for(var r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),n=[],o=0;o<r;++o){var a=e.getActiveAttrib(t,o);a&&n.push({name:a.name,type:xd(e,a.type)})}return n}});var Sd=N((KR,Cd)=>{"use strict";var Jy=Tf(),Zy=If(),Ed=Ss(),Us=wd(),Ad=Td(),e_=Gn();function Id(e){this.gl=e,this.gl.lastAttribCount=0,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}var Vs=Id.prototype;Vs.bind=function(){this.program||this._relink();var e,t=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),r=this.gl.lastAttribCount;if(t>r)for(e=r;e<t;e++)this.gl.enableVertexAttribArray(e);else if(r>t)for(e=t;e<r;e++)this.gl.disableVertexAttribArray(e);this.gl.lastAttribCount=t,this.gl.useProgram(this.program)};Vs.dispose=function(){for(var e=this.gl.lastAttribCount,t=0;t<e;t++)this.gl.disableVertexAttribArray(t);this.gl.lastAttribCount=0,this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null};function t_(e,t){return e.name<t.name?-1:1}Vs.update=function(e,t,r,n){if(!t||arguments.length===1){var o=e;e=o.vertex,t=o.fragment,r=o.uniforms,n=o.attributes}var a=this,i=a.gl,l=a._vref;a._vref=Us.shader(i,i.VERTEX_SHADER,e),l&&l.dispose(),a.vertShader=a._vref.shader;var c=this._fref;if(a._fref=Us.shader(i,i.FRAGMENT_SHADER,t),c&&c.dispose(),a.fragShader=a._fref.shader,!r||!n){var s=i.createProgram();if(i.attachShader(s,a.fragShader),i.attachShader(s,a.vertShader),i.linkProgram(s),!i.getProgramParameter(s,i.LINK_STATUS)){var u=i.getProgramInfoLog(s);throw new e_(u,"Error linking program:"+u)}r=r||Ad.uniforms(i,s),n=n||Ad.attributes(i,s),i.deleteProgram(s)}n=n.slice(),n.sort(t_);var f=[],d=[],p=[],m;for(m=0;m<n.length;++m){var w=n[m];if(w.type.indexOf("mat")>=0){for(var y=w.type.charAt(w.type.length-1)|0,I=new Array(y),R=0;R<y;++R)I[R]=p.length,d.push(w.name+"["+R+"]"),typeof w.location=="number"?p.push(w.location+R):Array.isArray(w.location)&&w.location.length===y&&typeof w.location[R]=="number"?p.push(w.location[R]|0):p.push(-1);f.push({name:w.name,type:w.type,locations:I})}else f.push({name:w.name,type:w.type,locations:[p.length]}),d.push(w.name),typeof w.location=="number"?p.push(w.location|0):p.push(-1)}var q=0;for(m=0;m<p.length;++m)if(p[m]<0){for(;p.indexOf(q)>=0;)q+=1;p[m]=q}var F=new Array(r.length);function Q(){a.program=Us.program(i,a._vref,a._fref,d,p);for(var L=0;L<r.length;++L)F[L]=i.getUniformLocation(a.program,r[L].name)}Q(),a._relink=Q,a.types={uniforms:Ed(r),attributes:Ed(n)},a.attributes=Zy(i,a,f,p),Object.defineProperty(a,"uniforms",Jy(i,a,r,F))};function r_(e,t,r,n,o){var a=new Id(e);return a.update(t,r,n,o),a}Cd.exports=r_});var Md=N(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});var n_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o_=Sd(),a_=i_(o_);function i_(e){return e&&e.__esModule?e:{default:e}}var s_=`attribute vec2 _p;
varying vec2 _uv;
void main() {
gl_Position = vec4(_p,0.0,1.0);
_uv = vec2(0.5, 0.5) * (_p+vec2(1.0, 1.0));
}`,l_={cover:function(t){return".5+(uv-.5)*vec2(min(ratio/"+t+",1.),min("+t+"/ratio,1.))"},contain:function(t){return".5+(uv-.5)*vec2(max(ratio/"+t+",1.),max("+t+"/ratio,1.))"},stretch:function(){return"uv"}},u_=function(t,r){var n=l_[r];if(!n)throw new Error("invalid resizeMode="+r);return"precision highp float;varying vec2 _uv;uniform sampler2D from, to;uniform float progress, ratio, _fromR, _toR;vec4 getFromColor(vec2 uv){return texture2D(from,"+n("_fromR")+");}vec4 getToColor(vec2 uv){return texture2D(to,"+n("_toR")+`);}
`+t+`
void main(){gl_FragColor=transition(_uv);}`};Hs.default=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=n_({resizeMode:"cover"},r),o=n.resizeMode,a=(0,a_.default)(e,s_,u_(t.glsl,o));return a.bind(),a.attributes._p.pointer(),{draw:function(l,c,s){var u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e.drawingBufferWidth,f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:e.drawingBufferHeight,d=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};a.bind(),a.uniforms.ratio=u/f,a.uniforms.progress=l,a.uniforms.from=c.bind(0),a.uniforms.to=s.bind(1),a.uniforms._fromR=c.shape[0]/c.shape[1],a.uniforms._toR=s.shape[0]/s.shape[1];var p=2;for(var m in t.paramsTypes){var w=m in d?d[m]:t.defaultParams[m];if(t.paramsTypes[m]==="sampler2D")if(!w)console.warn("uniform["+m+"]: A texture MUST be defined for uniform sampler2D of a texture");else{if(typeof w.bind!="function")throw new Error("uniform["+m+"]: A gl-texture2d API-like object was expected");a.uniforms[m]=w.bind(p++)}else a.uniforms[m]=w}e.drawArrays(e.TRIANGLES,0,3)},dispose:function(){a.dispose()}}}});var jd=N((ZR,Pd)=>{"use strict";function c_(e){for(var t=new Array(e),r=0;r<e;++r)t[r]=r;return t}Pd.exports=c_});var Dd=N((e4,kd)=>{kd.exports=function(e){return e!=null&&(Rd(e)||f_(e)||!!e._isBuffer)};function Rd(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function f_(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&Rd(e.slice(0,0))}});var Ld=N((t4,Od)=>{var d_=jd(),h_=Dd(),p_=typeof Float64Array!="undefined";function m_(e,t){return e[0]-t[0]}function v_(){var e=this.stride,t=new Array(e.length),r;for(r=0;r<t.length;++r)t[r]=[Math.abs(e[r]),r];t.sort(m_);var n=new Array(t.length);for(r=0;r<n.length;++r)n[r]=t[r][1];return n}function g_(e,t){var r=["View",t,"d",e].join("");t<0&&(r="View_Nil"+e);var n=e==="generic";if(t===-1){var o="function "+r+"(a){this.data=a;};var proto="+r+".prototype;proto.dtype='"+e+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+r+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+r+"(a){return new "+r+"(a);}",w=new Function(o);return w()}else if(t===0){var o="function "+r+"(a,d) {this.data = a;this.offset = d};var proto="+r+".prototype;proto.dtype='"+e+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+r+"_copy() {return new "+r+"(this.data,this.offset)};proto.pick=function "+r+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+r+"_get(){return "+(n?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+r+"_set(v){return "+(n?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+r+"(a,b,c,d){return new "+r+"(a,d)}",w=new Function("TrivialArray",o);return w(ca[e][0])}var o=["'use strict'"],a=d_(t),i=a.map(function(y){return"i"+y}),l="this.offset+"+a.map(function(y){return"this.stride["+y+"]*i"+y}).join("+"),c=a.map(function(y){return"b"+y}).join(","),s=a.map(function(y){return"c"+y}).join(",");o.push("function "+r+"(a,"+c+","+s+",d){this.data=a","this.shape=["+c+"]","this.stride=["+s+"]","this.offset=d|0}","var proto="+r+".prototype","proto.dtype='"+e+"'","proto.dimension="+t),o.push("Object.defineProperty(proto,'size',{get:function "+r+"_size(){return "+a.map(function(y){return"this.shape["+y+"]"}).join("*"),"}})"),t===1?o.push("proto.order=[0]"):(o.push("Object.defineProperty(proto,'order',{get:"),t<4?(o.push("function "+r+"_order(){"),t===2?o.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):t===3&&o.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):o.push("ORDER})")),o.push("proto.set=function "+r+"_set("+i.join(",")+",v){"),n?o.push("return this.data.set("+l+",v)}"):o.push("return this.data["+l+"]=v}"),o.push("proto.get=function "+r+"_get("+i.join(",")+"){"),n?o.push("return this.data.get("+l+")}"):o.push("return this.data["+l+"]}"),o.push("proto.index=function "+r+"_index(",i.join(),"){return "+l+"}"),o.push("proto.hi=function "+r+"_hi("+i.join(",")+"){return new "+r+"(this.data,"+a.map(function(y){return["(typeof i",y,"!=='number'||i",y,"<0)?this.shape[",y,"]:i",y,"|0"].join("")}).join(",")+","+a.map(function(y){return"this.stride["+y+"]"}).join(",")+",this.offset)}");var u=a.map(function(y){return"a"+y+"=this.shape["+y+"]"}),f=a.map(function(y){return"c"+y+"=this.stride["+y+"]"});o.push("proto.lo=function "+r+"_lo("+i.join(",")+"){var b=this.offset,d=0,"+u.join(",")+","+f.join(","));for(var d=0;d<t;++d)o.push("if(typeof i"+d+"==='number'&&i"+d+">=0){d=i"+d+"|0;b+=c"+d+"*d;a"+d+"-=d}");o.push("return new "+r+"(this.data,"+a.map(function(y){return"a"+y}).join(",")+","+a.map(function(y){return"c"+y}).join(",")+",b)}"),o.push("proto.step=function "+r+"_step("+i.join(",")+"){var "+a.map(function(y){return"a"+y+"=this.shape["+y+"]"}).join(",")+","+a.map(function(y){return"b"+y+"=this.stride["+y+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var d=0;d<t;++d)o.push("if(typeof i"+d+"==='number'){d=i"+d+"|0;if(d<0){c+=b"+d+"*(a"+d+"-1);a"+d+"=ceil(-a"+d+"/d)}else{a"+d+"=ceil(a"+d+"/d)}b"+d+"*=d}");o.push("return new "+r+"(this.data,"+a.map(function(y){return"a"+y}).join(",")+","+a.map(function(y){return"b"+y}).join(",")+",c)}");for(var p=new Array(t),m=new Array(t),d=0;d<t;++d)p[d]="a[i"+d+"]",m[d]="b[i"+d+"]";o.push("proto.transpose=function "+r+"_transpose("+i+"){"+i.map(function(y,I){return y+"=("+y+"===undefined?"+I+":"+y+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+r+"(this.data,"+p.join(",")+","+m.join(",")+",this.offset)}"),o.push("proto.pick=function "+r+"_pick("+i+"){var a=[],b=[],c=this.offset");for(var d=0;d<t;++d)o.push("if(typeof i"+d+"==='number'&&i"+d+">=0){c=(c+this.stride["+d+"]*i"+d+")|0}else{a.push(this.shape["+d+"]);b.push(this.stride["+d+"])}");o.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),o.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+a.map(function(y){return"shape["+y+"]"}).join(",")+","+a.map(function(y){return"stride["+y+"]"}).join(",")+",offset)}");var w=new Function("CTOR_LIST","ORDER",o.join(`
`));return w(ca[e],v_)}function y_(e){if(h_(e))return"buffer";if(p_)switch(Object.prototype.toString.call(e)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(e)?"array":"generic"}var ca={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};function __(e,t,r,n){if(e===void 0){var s=ca.array[0];return s([])}else typeof e=="number"&&(e=[e]);t===void 0&&(t=[e.length]);var o=t.length;if(r===void 0){r=new Array(o);for(var a=o-1,i=1;a>=0;--a)r[a]=i,i*=t[a]}if(n===void 0){n=0;for(var a=0;a<o;++a)r[a]<0&&(n-=(t[a]-1)*r[a])}for(var l=y_(e),c=ca[l];c.length<=o+1;)c.push(g_(l,c.length-1));var s=c[o+1];return s(e,t,r,n)}Od.exports=__});var Qd=N((r4,Fd)=>{"use strict";function w_(e,t){for(var r=1,n=e.length,o=e[0],a=e[0],i=1;i<n;++i)if(a=o,o=e[i],t(o,a)){if(i===r){r++;continue}e[r++]=o}return e.length=r,e}function b_(e){for(var t=1,r=e.length,n=e[0],o=e[0],a=1;a<r;++a,o=n)if(o=n,n=e[a],n!==o){if(a===t){t++;continue}e[t++]=n}return e.length=t,e}function x_(e,t,r){return e.length===0?e:t?(r||e.sort(t),w_(e,t)):(r||e.sort(),b_(e))}Fd.exports=x_});var zd=N((n4,Bd)=>{"use strict";var T_=Qd();function Nd(e,t,r){var n=e.length,o=t.arrayArgs.length,a=t.indexArgs.length>0,i=[],l=[],c=0,s=0,u,f;for(u=0;u<n;++u)l.push(["i",u,"=0"].join(""));for(f=0;f<o;++f)for(u=0;u<n;++u)s=c,c=e[u],u===0?l.push(["d",f,"s",u,"=t",f,"p",c].join("")):l.push(["d",f,"s",u,"=(t",f,"p",c,"-s",s,"*t",f,"p",s,")"].join(""));for(l.length>0&&i.push("var "+l.join(",")),u=n-1;u>=0;--u)c=e[u],i.push(["for(i",u,"=0;i",u,"<s",c,";++i",u,"){"].join(""));for(i.push(r),u=0;u<n;++u){for(s=c,c=e[u],f=0;f<o;++f)i.push(["p",f,"+=d",f,"s",u].join(""));a&&(u>0&&i.push(["index[",s,"]-=s",s].join("")),i.push(["++index[",c,"]"].join(""))),i.push("}")}return i.join(`
`)}function E_(e,t,r,n){for(var o=t.length,a=r.arrayArgs.length,i=r.blockSize,l=r.indexArgs.length>0,c=[],s=0;s<a;++s)c.push(["var offset",s,"=p",s].join(""));for(var s=e;s<o;++s)c.push(["for(var j"+s+"=SS[",t[s],"]|0;j",s,">0;){"].join("")),c.push(["if(j",s,"<",i,"){"].join("")),c.push(["s",t[s],"=j",s].join("")),c.push(["j",s,"=0"].join("")),c.push(["}else{s",t[s],"=",i].join("")),c.push(["j",s,"-=",i,"}"].join("")),l&&c.push(["index[",t[s],"]=j",s].join(""));for(var s=0;s<a;++s){for(var u=["offset"+s],f=e;f<o;++f)u.push(["j",f,"*t",s,"p",t[f]].join(""));c.push(["p",s,"=(",u.join("+"),")"].join(""))}c.push(Nd(t,r,n));for(var s=e;s<o;++s)c.push("}");return c.join(`
`)}function A_(e){for(var t=0,r=e[0].length;t<r;){for(var n=1;n<e.length;++n)if(e[n][t]!==e[0][t])return t;++t}return t}function qs(e,t,r){for(var n=e.body,o=[],a=[],i=0;i<e.args.length;++i){var l=e.args[i];if(!(l.count<=0)){var c=new RegExp(l.name,"g"),s="",u=t.arrayArgs.indexOf(i);switch(t.argTypes[i]){case"offset":var f=t.offsetArgIndex.indexOf(i),d=t.offsetArgs[f];u=d.array,s="+q"+f;case"array":s="p"+u+s;var p="l"+i,m="a"+u;if(t.arrayBlockIndices[u]===0)l.count===1?r[u]==="generic"?l.lvalue?(o.push(["var ",p,"=",m,".get(",s,")"].join("")),n=n.replace(c,p),a.push([m,".set(",s,",",p,")"].join(""))):n=n.replace(c,[m,".get(",s,")"].join("")):n=n.replace(c,[m,"[",s,"]"].join("")):r[u]==="generic"?(o.push(["var ",p,"=",m,".get(",s,")"].join("")),n=n.replace(c,p),l.lvalue&&a.push([m,".set(",s,",",p,")"].join(""))):(o.push(["var ",p,"=",m,"[",s,"]"].join("")),n=n.replace(c,p),l.lvalue&&a.push([m,"[",s,"]=",p].join("")));else{for(var w=[l.name],y=[s],I=0;I<Math.abs(t.arrayBlockIndices[u]);I++)w.push("\\s*\\[([^\\]]+)\\]"),y.push("$"+(I+1)+"*t"+u+"b"+I);if(c=new RegExp(w.join(""),"g"),s=y.join("+"),r[u]==="generic")throw new Error("cwise: Generic arrays not supported in combination with blocks!");n=n.replace(c,[m,"[",s,"]"].join(""))}break;case"scalar":n=n.replace(c,"Y"+t.scalarArgs.indexOf(i));break;case"index":n=n.replace(c,"index");break;case"shape":n=n.replace(c,"shape");break}}}return[o.join(`
`),n,a.join(`
`)].join(`
`).trim()}function I_(e){for(var t=new Array(e.length),r=!0,n=0;n<e.length;++n){var o=e[n],a=o.match(/\d+/);a?a=a[0]:a="",o.charAt(0)===0?t[n]="u"+o.charAt(1)+a:t[n]=o.charAt(0)+a,n>0&&(r=r&&t[n]===t[n-1])}return r?t[0]:t.join("")}function C_(e,t){for(var r=t[1].length-Math.abs(e.arrayBlockIndices[0])|0,n=new Array(e.arrayArgs.length),o=new Array(e.arrayArgs.length),a=0;a<e.arrayArgs.length;++a)o[a]=t[2*a],n[a]=t[2*a+1];for(var i=[],l=[],c=[],s=[],u=[],a=0;a<e.arrayArgs.length;++a){e.arrayBlockIndices[a]<0?(c.push(0),s.push(r),i.push(r),l.push(r+e.arrayBlockIndices[a])):(c.push(e.arrayBlockIndices[a]),s.push(e.arrayBlockIndices[a]+r),i.push(0),l.push(e.arrayBlockIndices[a]));for(var f=[],d=0;d<n[a].length;d++)c[a]<=n[a][d]&&n[a][d]<s[a]&&f.push(n[a][d]-c[a]);u.push(f)}for(var p=["SS"],m=["'use strict'"],w=[],d=0;d<r;++d)w.push(["s",d,"=SS[",d,"]"].join(""));for(var a=0;a<e.arrayArgs.length;++a){p.push("a"+a),p.push("t"+a),p.push("p"+a);for(var d=0;d<r;++d)w.push(["t",a,"p",d,"=t",a,"[",c[a]+d,"]"].join(""));for(var d=0;d<Math.abs(e.arrayBlockIndices[a]);++d)w.push(["t",a,"b",d,"=t",a,"[",i[a]+d,"]"].join(""))}for(var a=0;a<e.scalarArgs.length;++a)p.push("Y"+a);if(e.shapeArgs.length>0&&w.push("shape=SS.slice(0)"),e.indexArgs.length>0){for(var y=new Array(r),a=0;a<r;++a)y[a]="0";w.push(["index=[",y.join(","),"]"].join(""))}for(var a=0;a<e.offsetArgs.length;++a){for(var I=e.offsetArgs[a],R=[],d=0;d<I.offset.length;++d)I.offset[d]!==0&&(I.offset[d]===1?R.push(["t",I.array,"p",d].join("")):R.push([I.offset[d],"*t",I.array,"p",d].join("")));R.length===0?w.push("q"+a+"=0"):w.push(["q",a,"=",R.join("+")].join(""))}var q=T_([].concat(e.pre.thisVars).concat(e.body.thisVars).concat(e.post.thisVars));w=w.concat(q),w.length>0&&m.push("var "+w.join(","));for(var a=0;a<e.arrayArgs.length;++a)m.push("p"+a+"|=0");e.pre.body.length>3&&m.push(qs(e.pre,e,o));var F=qs(e.body,e,o),Q=A_(u);Q<r?m.push(E_(Q,u[0],e,F)):m.push(Nd(u[0],e,F)),e.post.body.length>3&&m.push(qs(e.post,e,o)),e.debug&&console.log("-----Generated cwise routine for ",t,`:
`+m.join(`
`)+`
----------`);var L=[e.funcName||"unnamed","_cwise_loop_",n[0].join("s"),"m",Q,I_(o)].join(""),G=new Function(["function ",L,"(",p.join(","),"){",m.join(`
`),"} return ",L].join(""));return G()}Bd.exports=C_});var Vd=N((o4,Ud)=>{"use strict";var S_=zd();function M_(e){var t=["'use strict'","var CACHED={}"],r=[],n=e.funcName+"_cwise_thunk";t.push(["return function ",n,"(",e.shimArgs.join(","),"){"].join(""));for(var o=[],a=[],i=[["array",e.arrayArgs[0],".shape.slice(",Math.max(0,e.arrayBlockIndices[0]),e.arrayBlockIndices[0]<0?","+e.arrayBlockIndices[0]+")":")"].join("")],l=[],c=[],s=0;s<e.arrayArgs.length;++s){var u=e.arrayArgs[s];r.push(["t",u,"=array",u,".dtype,","r",u,"=array",u,".order"].join("")),o.push("t"+u),o.push("r"+u),a.push("t"+u),a.push("r"+u+".join()"),i.push("array"+u+".data"),i.push("array"+u+".stride"),i.push("array"+u+".offset|0"),s>0&&(l.push("array"+e.arrayArgs[0]+".shape.length===array"+u+".shape.length+"+(Math.abs(e.arrayBlockIndices[0])-Math.abs(e.arrayBlockIndices[s]))),c.push("array"+e.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,e.arrayBlockIndices[0])+"]===array"+u+".shape[shapeIndex+"+Math.max(0,e.arrayBlockIndices[s])+"]"))}e.arrayArgs.length>1&&(t.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),t.push("for(var shapeIndex=array"+e.arrayArgs[0]+".shape.length-"+Math.abs(e.arrayBlockIndices[0])+"; shapeIndex-->0;) {"),t.push("if (!("+c.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),t.push("}"));for(var s=0;s<e.scalarArgs.length;++s)i.push("scalar"+e.scalarArgs[s]);r.push(["type=[",a.join(","),"].join()"].join("")),r.push("proc=CACHED[type]"),t.push("var "+r.join(",")),t.push(["if(!proc){","CACHED[type]=proc=compile([",o.join(","),"])}","return proc(",i.join(","),")}"].join("")),e.debug&&console.log(`-----Generated thunk:
`+t.join(`
`)+`
----------`);var f=new Function("compile",t.join(`
`));return f(S_.bind(void 0,e))}Ud.exports=M_});var qd=N((a4,Hd)=>{"use strict";var P_=Vd();function j_(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}function R_(e){var t=new j_;t.pre=e.pre,t.body=e.body,t.post=e.post;var r=e.args.slice(0);t.argTypes=r;for(var n=0;n<r.length;++n){var o=r[n];if(o==="array"||typeof o=="object"&&o.blockIndices){if(t.argTypes[n]="array",t.arrayArgs.push(n),t.arrayBlockIndices.push(o.blockIndices?o.blockIndices:0),t.shimArgs.push("array"+n),n<t.pre.args.length&&t.pre.args[n].count>0)throw new Error("cwise: pre() block may not reference array args");if(n<t.post.args.length&&t.post.args[n].count>0)throw new Error("cwise: post() block may not reference array args")}else if(o==="scalar")t.scalarArgs.push(n),t.shimArgs.push("scalar"+n);else if(o==="index"){if(t.indexArgs.push(n),n<t.pre.args.length&&t.pre.args[n].count>0)throw new Error("cwise: pre() block may not reference array index");if(n<t.body.args.length&&t.body.args[n].lvalue)throw new Error("cwise: body() block may not write to array index");if(n<t.post.args.length&&t.post.args[n].count>0)throw new Error("cwise: post() block may not reference array index")}else if(o==="shape"){if(t.shapeArgs.push(n),n<t.pre.args.length&&t.pre.args[n].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(n<t.body.args.length&&t.body.args[n].lvalue)throw new Error("cwise: body() block may not write to array shape");if(n<t.post.args.length&&t.post.args[n].lvalue)throw new Error("cwise: post() block may not write to array shape")}else if(typeof o=="object"&&o.offset)t.argTypes[n]="offset",t.offsetArgs.push({array:o.array,offset:o.offset}),t.offsetArgIndex.push(n);else throw new Error("cwise: Unknown argument type "+r[n])}if(t.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(t.pre.args.length>r.length)throw new Error("cwise: Too many arguments in pre() block");if(t.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(t.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return t.debug=!!e.printCode||!!e.debug,t.funcName=e.funcName||"cwise",t.blockSize=e.blockSize||64,P_(t)}Hd.exports=R_});var Jd=N(W=>{"use strict";var qe=qd(),fa={body:"",args:[],thisVars:[],localVars:[]};function Gs(e){if(!e)return fa;for(var t=0;t<e.args.length;++t){var r=e.args[t];t===0?e.args[t]={name:r,lvalue:!0,rvalue:!!e.rvalue,count:e.count||1}:e.args[t]={name:r,lvalue:!1,rvalue:!0,count:1}}return e.thisVars||(e.thisVars=[]),e.localVars||(e.localVars=[]),e}function k_(e){return qe({args:e.args,pre:Gs(e.pre),body:Gs(e.body),post:Gs(e.proc),funcName:e.funcName})}function pe(e){for(var t=[],r=0;r<e.args.length;++r)t.push("a"+r);var n=new Function("P",["return function ",e.funcName,"_ndarrayops(",t.join(","),") {P(",t.join(","),");return a0}"].join(""));return n(k_(e))}var Gd={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};(function(){for(var e in Gd){var t=Gd[e];W[e]=pe({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+t+"c"},funcName:e}),W[e+"eq"]=pe({args:["array","array"],body:{args:["a","b"],body:"a"+t+"=b"},rvalue:!0,funcName:e+"eq"}),W[e+"s"]=pe({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+t+"s"},funcName:e+"s"}),W[e+"seq"]=pe({args:["array","scalar"],body:{args:["a","s"],body:"a"+t+"=s"},rvalue:!0,funcName:e+"seq"})}})();var Wd={not:"!",bnot:"~",neg:"-",recip:"1.0/"};(function(){for(var e in Wd){var t=Wd[e];W[e]=pe({args:["array","array"],body:{args:["a","b"],body:"a="+t+"b"},funcName:e}),W[e+"eq"]=pe({args:["array"],body:{args:["a"],body:"a="+t+"a"},rvalue:!0,count:2,funcName:e+"eq"})}})();var $d={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};(function(){for(var e in $d){var t=$d[e];W[e]=pe({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+t+"c"},funcName:e}),W[e+"s"]=pe({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+t+"s"},funcName:e+"s"}),W[e+"eq"]=pe({args:["array","array"],body:{args:["a","b"],body:"a=a"+t+"b"},rvalue:!0,count:2,funcName:e+"eq"}),W[e+"seq"]=pe({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+t+"s"},rvalue:!0,count:2,funcName:e+"seq"})}})();var Xd=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];(function(){for(var e=0;e<Xd.length;++e){var t=Xd[e];W[t]=pe({args:["array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b)",thisVars:["this_f"]},funcName:t}),W[t+"eq"]=pe({args:["array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a"],body:"a=this_f(a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"eq"})}})();var Yd=["max","min","atan2","pow"];(function(){for(var e=0;e<Yd.length;++e){var t=Yd[e];W[t]=pe({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:t}),W[t+"s"]=pe({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:t+"s"}),W[t+"eq"]=pe({args:["array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"eq"}),W[t+"seq"]=pe({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"seq"})}})();var Kd=["atan2","pow"];(function(){for(var e=0;e<Kd.length;++e){var t=Kd[e];W[t+"op"]=pe({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:t+"op"}),W[t+"ops"]=pe({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:t+"ops"}),W[t+"opeq"]=pe({args:["array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"opeq"}),W[t+"opseq"]=pe({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"opseq"})}})();W.any=qe({args:["array"],pre:fa,body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"if(a){return true}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return false"},funcName:"any"});W.all=qe({args:["array"],pre:fa,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1}],body:"if(!x){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"all"});W.sum=qe({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s+=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"sum"});W.prod=qe({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=1"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s*=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"prod"});W.norm2squared=qe({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm2squared"});W.norm2=qe({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return Math.sqrt(this_s)"},funcName:"norm2"});W.norminf=qe({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:4}],body:"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"});W.norm1=qe({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"});W.sup=qe({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}});W.inf=qe({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_<this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}});W.argmin=qe({args:["index","array","shape"],pre:{body:"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}});W.argmax=qe({args:["index","array","shape"],pre:{body:"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}});W.random=pe({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"});W.assign=pe({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"});W.assigns=pe({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"});W.equals=qe({args:["array","array"],pre:fa,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})});var eh=N(ve=>{"use strict";var Ws=32;ve.INT_BITS=Ws;ve.INT_MAX=2147483647;ve.INT_MIN=-1<<Ws-1;ve.sign=function(e){return(e>0)-(e<0)};ve.abs=function(e){var t=e>>Ws-1;return(e^t)-t};ve.min=function(e,t){return t^(e^t)&-(e<t)};ve.max=function(e,t){return e^(e^t)&-(e<t)};ve.isPow2=function(e){return!(e&e-1)&&!!e};ve.log2=function(e){var t,r;return t=(e>65535)<<4,e>>>=t,r=(e>255)<<3,e>>>=r,t|=r,r=(e>15)<<2,e>>>=r,t|=r,r=(e>3)<<1,e>>>=r,t|=r,t|e>>1};ve.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0};ve.popCount=function(e){return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24};function Zd(e){var t=32;return e&=-e,e&&t--,e&65535&&(t-=16),e&16711935&&(t-=8),e&252645135&&(t-=4),e&858993459&&(t-=2),e&1431655765&&(t-=1),t}ve.countTrailingZeros=Zd;ve.nextPow2=function(e){return e+=e===0,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1};ve.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e-(e>>>1)};ve.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,e&=15,27030>>>e&1};var $n=new Array(256);(function(e){for(var t=0;t<256;++t){var r=t,n=t,o=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=r&1,--o;e[t]=n<<o&255}})($n);ve.reverse=function(e){return $n[e&255]<<24|$n[e>>>8&255]<<16|$n[e>>>16&255]<<8|$n[e>>>24&255]};ve.interleave2=function(e,t){return e&=65535,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t&=65535,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1};ve.deinterleave2=function(e,t){return e=e>>>t&1431655765,e=(e|e>>>1)&858993459,e=(e|e>>>2)&252645135,e=(e|e>>>4)&16711935,e=(e|e>>>16)&65535,e<<16>>16};ve.interleave3=function(e,t,r){return e&=1023,e=(e|e<<16)&4278190335,e=(e|e<<8)&251719695,e=(e|e<<4)&3272356035,e=(e|e<<2)&1227133513,t&=1023,t=(t|t<<16)&4278190335,t=(t|t<<8)&251719695,t=(t|t<<4)&3272356035,t=(t|t<<2)&1227133513,e|=t<<1,r&=1023,r=(r|r<<16)&4278190335,r=(r|r<<8)&251719695,r=(r|r<<4)&3272356035,r=(r|r<<2)&1227133513,e|r<<2};ve.deinterleave3=function(e,t){return e=e>>>t&1227133513,e=(e|e>>>2)&3272356035,e=(e|e>>>4)&251719695,e=(e|e>>>8)&4278190335,e=(e|e>>>16)&1023,e<<22>>22};ve.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>Zd(e)+1}});var nh=N((l4,rh)=>{"use strict";function th(e,t,r){var n=e[r]|0;if(n<=0)return[];var o=new Array(n),a;if(r===e.length-1)for(a=0;a<n;++a)o[a]=t;else for(a=0;a<n;++a)o[a]=th(e,t,r+1);return o}function D_(e,t){var r,n;for(r=new Array(e),n=0;n<e;++n)r[n]=t;return r}function O_(e,t){switch(typeof t=="undefined"&&(t=0),typeof e){case"number":if(e>0)return D_(e|0,t);break;case"object":if(typeof e.length=="number")return th(e,t,0);break}return[]}rh.exports=O_});var ih=N(da=>{"use strict";da.byteLength=F_;da.toByteArray=N_;da.fromByteArray=U_;var Ct=[],ot=[],L_=typeof Uint8Array!="undefined"?Uint8Array:Array,$s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(pr=0,oh=$s.length;pr<oh;++pr)Ct[pr]=$s[pr],ot[$s.charCodeAt(pr)]=pr;var pr,oh;ot["-".charCodeAt(0)]=62;ot["_".charCodeAt(0)]=63;function ah(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function F_(e){var t=ah(e),r=t[0],n=t[1];return(r+n)*3/4-n}function Q_(e,t,r){return(t+r)*3/4-r}function N_(e){var t,r=ah(e),n=r[0],o=r[1],a=new L_(Q_(e,n,o)),i=0,l=o>0?n-4:n,c;for(c=0;c<l;c+=4)t=ot[e.charCodeAt(c)]<<18|ot[e.charCodeAt(c+1)]<<12|ot[e.charCodeAt(c+2)]<<6|ot[e.charCodeAt(c+3)],a[i++]=t>>16&255,a[i++]=t>>8&255,a[i++]=t&255;return o===2&&(t=ot[e.charCodeAt(c)]<<2|ot[e.charCodeAt(c+1)]>>4,a[i++]=t&255),o===1&&(t=ot[e.charCodeAt(c)]<<10|ot[e.charCodeAt(c+1)]<<4|ot[e.charCodeAt(c+2)]>>2,a[i++]=t>>8&255,a[i++]=t&255),a}function B_(e){return Ct[e>>18&63]+Ct[e>>12&63]+Ct[e>>6&63]+Ct[e&63]}function z_(e,t,r){for(var n,o=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),o.push(B_(n));return o.join("")}function U_(e){for(var t,r=e.length,n=r%3,o=[],a=16383,i=0,l=r-n;i<l;i+=a)o.push(z_(e,i,i+a>l?l:i+a));return n===1?(t=e[r-1],o.push(Ct[t>>2]+Ct[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],o.push(Ct[t>>10]+Ct[t>>4&63]+Ct[t<<2&63]+"=")),o.join("")}});var sh=N(Xs=>{Xs.read=function(e,t,r,n,o){var a,i,l=o*8-n-1,c=(1<<l)-1,s=c>>1,u=-7,f=r?o-1:0,d=r?-1:1,p=e[t+f];for(f+=d,a=p&(1<<-u)-1,p>>=-u,u+=l;u>0;a=a*256+e[t+f],f+=d,u-=8);for(i=a&(1<<-u)-1,a>>=-u,u+=n;u>0;i=i*256+e[t+f],f+=d,u-=8);if(a===0)a=1-s;else{if(a===c)return i?NaN:(p?-1:1)*(1/0);i=i+Math.pow(2,n),a=a-s}return(p?-1:1)*i*Math.pow(2,a-n)};Xs.write=function(e,t,r,n,o,a){var i,l,c,s=a*8-o-1,u=(1<<s)-1,f=u>>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,m=n?1:-1,w=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,i=u):(i=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-i))<1&&(i--,c*=2),i+f>=1?t+=d/c:t+=d*Math.pow(2,1-f),t*c>=2&&(i++,c/=2),i+f>=u?(l=0,i=u):i+f>=1?(l=(t*c-1)*Math.pow(2,o),i=i+f):(l=t*Math.pow(2,f-1)*Math.pow(2,o),i=0));o>=8;e[r+p]=l&255,p+=m,l/=256,o-=8);for(i=i<<o|l,s+=o;s>0;e[r+p]=i&255,p+=m,i/=256,s-=8);e[r+p-m]|=w*128}});var Eh=N(Hr=>{"use strict";var Ys=ih(),Ur=sh(),lh=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Hr.Buffer=b;Hr.SlowBuffer=$_;Hr.INSPECT_MAX_BYTES=50;var ha=2147483647;Hr.kMaxLength=ha;b.TYPED_ARRAY_SUPPORT=V_();!b.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function V_(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(e){return!1}}Object.defineProperty(b.prototype,"parent",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.buffer}});Object.defineProperty(b.prototype,"offset",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.byteOffset}});function Ot(e){if(e>ha)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,b.prototype),t}function b(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return el(e)}return dh(e,t,r)}b.poolSize=8192;function dh(e,t,r){if(typeof e=="string")return q_(e,t);if(ArrayBuffer.isView(e))return G_(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(St(e,ArrayBuffer)||e&&St(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(St(e,SharedArrayBuffer)||e&&St(e.buffer,SharedArrayBuffer)))return Js(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return b.from(n,t,r);let o=W_(e);if(o)return o;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return b.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}b.from=function(e,t,r){return dh(e,t,r)};Object.setPrototypeOf(b.prototype,Uint8Array.prototype);Object.setPrototypeOf(b,Uint8Array);function hh(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function H_(e,t,r){return hh(e),e<=0?Ot(e):t!==void 0?typeof r=="string"?Ot(e).fill(t,r):Ot(e).fill(t):Ot(e)}b.alloc=function(e,t,r){return H_(e,t,r)};function el(e){return hh(e),Ot(e<0?0:tl(e)|0)}b.allocUnsafe=function(e){return el(e)};b.allocUnsafeSlow=function(e){return el(e)};function q_(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!b.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=ph(e,t)|0,n=Ot(r),o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}function Ks(e){let t=e.length<0?0:tl(e.length)|0,r=Ot(t);for(let n=0;n<t;n+=1)r[n]=e[n]&255;return r}function G_(e){if(St(e,Uint8Array)){let t=new Uint8Array(e);return Js(t.buffer,t.byteOffset,t.byteLength)}return Ks(e)}function Js(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&r===void 0?n=new Uint8Array(e):r===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,r),Object.setPrototypeOf(n,b.prototype),n}function W_(e){if(b.isBuffer(e)){let t=tl(e.length)|0,r=Ot(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||nl(e.length)?Ot(0):Ks(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Ks(e.data)}function tl(e){if(e>=ha)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ha.toString(16)+" bytes");return e|0}function $_(e){return+e!=e&&(e=0),b.alloc(+e)}b.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==b.prototype};b.compare=function(t,r){if(St(t,Uint8Array)&&(t=b.from(t,t.offset,t.byteLength)),St(r,Uint8Array)&&(r=b.from(r,r.offset,r.byteLength)),!b.isBuffer(t)||!b.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;let n=t.length,o=r.length;for(let a=0,i=Math.min(n,o);a<i;++a)if(t[a]!==r[a]){n=t[a],o=r[a];break}return n<o?-1:o<n?1:0};b.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};b.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return b.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;let o=b.allocUnsafe(r),a=0;for(n=0;n<t.length;++n){let i=t[n];if(St(i,Uint8Array))a+i.length>o.length?(b.isBuffer(i)||(i=b.from(i)),i.copy(o,a)):Uint8Array.prototype.set.call(o,i,a);else if(b.isBuffer(i))i.copy(o,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=i.length}return o};function ph(e,t){if(b.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||St(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Zs(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Th(e).length;default:if(o)return n?-1:Zs(e).length;t=(""+t).toLowerCase(),o=!0}}b.byteLength=ph;function X_(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return aw(this,t,r);case"utf8":case"utf-8":return vh(this,t,r);case"ascii":return nw(this,t,r);case"latin1":case"binary":return ow(this,t,r);case"base64":return tw(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return iw(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}b.prototype._isBuffer=!0;function mr(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}b.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<t;r+=2)mr(this,r,r+1);return this};b.prototype.swap32=function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<t;r+=4)mr(this,r,r+3),mr(this,r+1,r+2);return this};b.prototype.swap64=function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<t;r+=8)mr(this,r,r+7),mr(this,r+1,r+6),mr(this,r+2,r+5),mr(this,r+3,r+4);return this};b.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?vh(this,0,t):X_.apply(this,arguments)};b.prototype.toLocaleString=b.prototype.toString;b.prototype.equals=function(t){if(!b.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:b.compare(this,t)===0};b.prototype.inspect=function(){let t="",r=Hr.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};lh&&(b.prototype[lh]=b.prototype.inspect);b.prototype.compare=function(t,r,n,o,a){if(St(t,Uint8Array)&&(t=b.from(t,t.offset,t.byteLength)),!b.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),o===void 0&&(o=0),a===void 0&&(a=this.length),r<0||n>t.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&r>=n)return 0;if(o>=a)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,o>>>=0,a>>>=0,this===t)return 0;let i=a-o,l=n-r,c=Math.min(i,l),s=this.slice(o,a),u=t.slice(r,n);for(let f=0;f<c;++f)if(s[f]!==u[f]){i=s[f],l=u[f];break}return i<l?-1:l<i?1:0};function mh(e,t,r,n,o){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,nl(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0)if(o)r=0;else return-1;if(typeof t=="string"&&(t=b.from(t,n)),b.isBuffer(t))return t.length===0?-1:uh(e,t,r,n,o);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):uh(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function uh(e,t,r,n,o){let a=1,i=e.length,l=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;a=2,i/=2,l/=2,r/=2}function c(u,f){return a===1?u[f]:u.readUInt16BE(f*a)}let s;if(o){let u=-1;for(s=r;s<i;s++)if(c(e,s)===c(t,u===-1?0:s-u)){if(u===-1&&(u=s),s-u+1===l)return u*a}else u!==-1&&(s-=s-u),u=-1}else for(r+l>i&&(r=i-l),s=r;s>=0;s--){let u=!0;for(let f=0;f<l;f++)if(c(e,s+f)!==c(t,f)){u=!1;break}if(u)return s}return-1}b.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1};b.prototype.indexOf=function(t,r,n){return mh(this,t,r,n,!0)};b.prototype.lastIndexOf=function(t,r,n){return mh(this,t,r,n,!1)};function Y_(e,t,r,n){r=Number(r)||0;let o=e.length-r;n?(n=Number(n),n>o&&(n=o)):n=o;let a=t.length;n>a/2&&(n=a/2);let i;for(i=0;i<n;++i){let l=parseInt(t.substr(i*2,2),16);if(nl(l))return i;e[r+i]=l}return i}function K_(e,t,r,n){return pa(Zs(t,e.length-r),e,r,n)}function J_(e,t,r,n){return pa(cw(t),e,r,n)}function Z_(e,t,r,n){return pa(Th(t),e,r,n)}function ew(e,t,r,n){return pa(fw(t,e.length-r),e,r,n)}b.prototype.write=function(t,r,n,o){if(r===void 0)o="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")o=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let a=this.length-r;if((n===void 0||n>a)&&(n=a),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");let i=!1;for(;;)switch(o){case"hex":return Y_(this,t,r,n);case"utf8":case"utf-8":return K_(this,t,r,n);case"ascii":case"latin1":case"binary":return J_(this,t,r,n);case"base64":return Z_(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ew(this,t,r,n);default:if(i)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),i=!0}};b.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function tw(e,t,r){return t===0&&r===e.length?Ys.fromByteArray(e):Ys.fromByteArray(e.slice(t,r))}function vh(e,t,r){r=Math.min(e.length,r);let n=[],o=t;for(;o<r;){let a=e[o],i=null,l=a>239?4:a>223?3:a>191?2:1;if(o+l<=r){let c,s,u,f;switch(l){case 1:a<128&&(i=a);break;case 2:c=e[o+1],(c&192)===128&&(f=(a&31)<<6|c&63,f>127&&(i=f));break;case 3:c=e[o+1],s=e[o+2],(c&192)===128&&(s&192)===128&&(f=(a&15)<<12|(c&63)<<6|s&63,f>2047&&(f<55296||f>57343)&&(i=f));break;case 4:c=e[o+1],s=e[o+2],u=e[o+3],(c&192)===128&&(s&192)===128&&(u&192)===128&&(f=(a&15)<<18|(c&63)<<12|(s&63)<<6|u&63,f>65535&&f<1114112&&(i=f))}}i===null?(i=65533,l=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|i&1023),n.push(i),o+=l}return rw(n)}var ch=4096;function rw(e){let t=e.length;if(t<=ch)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=ch));return r}function nw(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]&127);return n}function ow(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function aw(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let a=t;a<r;++a)o+=dw[e[a]];return o}function iw(e,t,r){let n=e.slice(t,r),o="";for(let a=0;a<n.length-1;a+=2)o+=String.fromCharCode(n[a]+n[a+1]*256);return o}b.prototype.slice=function(t,r){let n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);let o=this.subarray(t,r);return Object.setPrototypeOf(o,b.prototype),o};function xe(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}b.prototype.readUintLE=b.prototype.readUIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||xe(t,r,this.length);let o=this[t],a=1,i=0;for(;++i<r&&(a*=256);)o+=this[t+i]*a;return o};b.prototype.readUintBE=b.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||xe(t,r,this.length);let o=this[t+--r],a=1;for(;r>0&&(a*=256);)o+=this[t+--r]*a;return o};b.prototype.readUint8=b.prototype.readUInt8=function(t,r){return t=t>>>0,r||xe(t,1,this.length),this[t]};b.prototype.readUint16LE=b.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||xe(t,2,this.length),this[t]|this[t+1]<<8};b.prototype.readUint16BE=b.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||xe(t,2,this.length),this[t]<<8|this[t+1]};b.prototype.readUint32LE=b.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||xe(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};b.prototype.readUint32BE=b.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||xe(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};b.prototype.readBigUInt64LE=Gt(function(t){t=t>>>0,Vr(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Xn(t,this.length-8);let o=r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,a=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(o)+(BigInt(a)<<BigInt(32))});b.prototype.readBigUInt64BE=Gt(function(t){t=t>>>0,Vr(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Xn(t,this.length-8);let o=r*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],a=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(o)<<BigInt(32))+BigInt(a)});b.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||xe(t,r,this.length);let o=this[t],a=1,i=0;for(;++i<r&&(a*=256);)o+=this[t+i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*r)),o};b.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||xe(t,r,this.length);let o=r,a=1,i=this[t+--o];for(;o>0&&(a*=256);)i+=this[t+--o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*r)),i};b.prototype.readInt8=function(t,r){return t=t>>>0,r||xe(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};b.prototype.readInt16LE=function(t,r){t=t>>>0,r||xe(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};b.prototype.readInt16BE=function(t,r){t=t>>>0,r||xe(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};b.prototype.readInt32LE=function(t,r){return t=t>>>0,r||xe(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};b.prototype.readInt32BE=function(t,r){return t=t>>>0,r||xe(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};b.prototype.readBigInt64LE=Gt(function(t){t=t>>>0,Vr(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Xn(t,this.length-8);let o=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(o)<<BigInt(32))+BigInt(r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)});b.prototype.readBigInt64BE=Gt(function(t){t=t>>>0,Vr(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Xn(t,this.length-8);let o=(r<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(o)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)});b.prototype.readFloatLE=function(t,r){return t=t>>>0,r||xe(t,4,this.length),Ur.read(this,t,!0,23,4)};b.prototype.readFloatBE=function(t,r){return t=t>>>0,r||xe(t,4,this.length),Ur.read(this,t,!1,23,4)};b.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||xe(t,8,this.length),Ur.read(this,t,!0,52,8)};b.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||xe(t,8,this.length),Ur.read(this,t,!1,52,8)};function Ge(e,t,r,n,o,a){if(!b.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}b.prototype.writeUintLE=b.prototype.writeUIntLE=function(t,r,n,o){if(t=+t,r=r>>>0,n=n>>>0,!o){let l=Math.pow(2,8*n)-1;Ge(this,t,r,n,l,0)}let a=1,i=0;for(this[r]=t&255;++i<n&&(a*=256);)this[r+i]=t/a&255;return r+n};b.prototype.writeUintBE=b.prototype.writeUIntBE=function(t,r,n,o){if(t=+t,r=r>>>0,n=n>>>0,!o){let l=Math.pow(2,8*n)-1;Ge(this,t,r,n,l,0)}let a=n-1,i=1;for(this[r+a]=t&255;--a>=0&&(i*=256);)this[r+a]=t/i&255;return r+n};b.prototype.writeUint8=b.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||Ge(this,t,r,1,255,0),this[r]=t&255,r+1};b.prototype.writeUint16LE=b.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||Ge(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};b.prototype.writeUint16BE=b.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||Ge(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};b.prototype.writeUint32LE=b.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||Ge(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};b.prototype.writeUint32BE=b.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||Ge(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function gh(e,t,r,n,o){xh(t,n,o,e,r,7);let a=Number(t&BigInt(4294967295));e[r++]=a,a=a>>8,e[r++]=a,a=a>>8,e[r++]=a,a=a>>8,e[r++]=a;let i=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=i,i=i>>8,e[r++]=i,i=i>>8,e[r++]=i,i=i>>8,e[r++]=i,r}function yh(e,t,r,n,o){xh(t,n,o,e,r,7);let a=Number(t&BigInt(4294967295));e[r+7]=a,a=a>>8,e[r+6]=a,a=a>>8,e[r+5]=a,a=a>>8,e[r+4]=a;let i=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=i,i=i>>8,e[r+2]=i,i=i>>8,e[r+1]=i,i=i>>8,e[r]=i,r+8}b.prototype.writeBigUInt64LE=Gt(function(t,r=0){return gh(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))});b.prototype.writeBigUInt64BE=Gt(function(t,r=0){return yh(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))});b.prototype.writeIntLE=function(t,r,n,o){if(t=+t,r=r>>>0,!o){let c=Math.pow(2,8*n-1);Ge(this,t,r,n,c-1,-c)}let a=0,i=1,l=0;for(this[r]=t&255;++a<n&&(i*=256);)t<0&&l===0&&this[r+a-1]!==0&&(l=1),this[r+a]=(t/i>>0)-l&255;return r+n};b.prototype.writeIntBE=function(t,r,n,o){if(t=+t,r=r>>>0,!o){let c=Math.pow(2,8*n-1);Ge(this,t,r,n,c-1,-c)}let a=n-1,i=1,l=0;for(this[r+a]=t&255;--a>=0&&(i*=256);)t<0&&l===0&&this[r+a+1]!==0&&(l=1),this[r+a]=(t/i>>0)-l&255;return r+n};b.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||Ge(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};b.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||Ge(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};b.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||Ge(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};b.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||Ge(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};b.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||Ge(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};b.prototype.writeBigInt64LE=Gt(function(t,r=0){return gh(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});b.prototype.writeBigInt64BE=Gt(function(t,r=0){return yh(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function _h(e,t,r,n,o,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function wh(e,t,r,n,o){return t=+t,r=r>>>0,o||_h(e,t,r,4,34028234663852886e22,-34028234663852886e22),Ur.write(e,t,r,n,23,4),r+4}b.prototype.writeFloatLE=function(t,r,n){return wh(this,t,r,!0,n)};b.prototype.writeFloatBE=function(t,r,n){return wh(this,t,r,!1,n)};function bh(e,t,r,n,o){return t=+t,r=r>>>0,o||_h(e,t,r,8,17976931348623157e292,-17976931348623157e292),Ur.write(e,t,r,n,52,8),r+8}b.prototype.writeDoubleLE=function(t,r,n){return bh(this,t,r,!0,n)};b.prototype.writeDoubleBE=function(t,r,n){return bh(this,t,r,!1,n)};b.prototype.copy=function(t,r,n,o){if(!b.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!o&&o!==0&&(o=this.length),r>=t.length&&(r=t.length),r||(r=0),o>0&&o<n&&(o=n),o===n||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-r<o-n&&(o=t.length-r+n);let a=o-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,o):Uint8Array.prototype.set.call(t,this.subarray(n,o),r),a};b.prototype.fill=function(t,r,n,o){if(typeof t=="string"){if(typeof r=="string"?(o=r,r=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!b.isEncoding(o))throw new TypeError("Unknown encoding: "+o);if(t.length===1){let i=t.charCodeAt(0);(o==="utf8"&&i<128||o==="latin1")&&(t=i)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let a;if(typeof t=="number")for(a=r;a<n;++a)this[a]=t;else{let i=b.isBuffer(t)?t:b.from(t,o),l=i.length;if(l===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(a=0;a<n-r;++a)this[a+r]=i[a%l]}return this};var zr={};function rl(e,t,r){zr[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(o){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:o,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}rl("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);rl("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError);rl("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=fh(String(r)):typeof r=="bigint"&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=fh(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);function fh(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function sw(e,t,r){Vr(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&Xn(t,e.length-(r+1))}function xh(e,t,r,n,o,a){if(e>r||e<t){let i=typeof t=="bigint"?"n":"",l;throw a>3?t===0||t===BigInt(0)?l=`>= 0${i} and < 2${i} ** ${(a+1)*8}${i}`:l=`>= -(2${i} ** ${(a+1)*8-1}${i}) and < 2 ** ${(a+1)*8-1}${i}`:l=`>= ${t}${i} and <= ${r}${i}`,new zr.ERR_OUT_OF_RANGE("value",l,e)}sw(n,o,a)}function Vr(e,t){if(typeof e!="number")throw new zr.ERR_INVALID_ARG_TYPE(t,"number",e)}function Xn(e,t,r){throw Math.floor(e)!==e?(Vr(e,r),new zr.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new zr.ERR_BUFFER_OUT_OF_BOUNDS:new zr.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var lw=/[^+/0-9A-Za-z-_]/g;function uw(e){if(e=e.split("=")[0],e=e.trim().replace(lw,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Zs(e,t){t=t||1/0;let r,n=e.length,o=null,a=[];for(let i=0;i<n;++i){if(r=e.charCodeAt(i),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(i+1===n){(t-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(t-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}function cw(e){let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function fw(e,t){let r,n,o,a=[];for(let i=0;i<e.length&&!((t-=2)<0);++i)r=e.charCodeAt(i),n=r>>8,o=r%256,a.push(o),a.push(n);return a}function Th(e){return Ys.toByteArray(uw(e))}function pa(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function St(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function nl(e){return e!==e}var dw=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function Gt(e){return typeof BigInt=="undefined"?hw:e}function hw(){throw new Error("BigInt not supported")}});var Nh=N(Y=>{"use strict";var Wt=eh(),Se=nh(),Ah=Eh().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:Se([32,0]),UINT16:Se([32,0]),UINT32:Se([32,0]),BIGUINT64:Se([32,0]),INT8:Se([32,0]),INT16:Se([32,0]),INT32:Se([32,0]),BIGINT64:Se([32,0]),FLOAT:Se([32,0]),DOUBLE:Se([32,0]),DATA:Se([32,0]),UINT8C:Se([32,0]),BUFFER:Se([32,0])});var pw=typeof Uint8ClampedArray!="undefined",mw=typeof BigUint64Array!="undefined",vw=typeof BigInt64Array!="undefined",ge=window.__TYPEDARRAY_POOL;ge.UINT8C||(ge.UINT8C=Se([32,0]));ge.BIGUINT64||(ge.BIGUINT64=Se([32,0]));ge.BIGINT64||(ge.BIGINT64=Se([32,0]));ge.BUFFER||(ge.BUFFER=Se([32,0]));var ma=ge.DATA,va=ge.BUFFER;Y.free=function(t){if(Ah.isBuffer(t))va[Wt.log2(t.length)].push(t);else{if(Object.prototype.toString.call(t)!=="[object ArrayBuffer]"&&(t=t.buffer),!t)return;var r=t.length||t.byteLength,n=Wt.log2(r)|0;ma[n].push(t)}};function Ih(e){if(e){var t=e.length||e.byteLength,r=Wt.log2(t);ma[r].push(e)}}function gw(e){Ih(e.buffer)}Y.freeUint8=Y.freeUint16=Y.freeUint32=Y.freeBigUint64=Y.freeInt8=Y.freeInt16=Y.freeInt32=Y.freeBigInt64=Y.freeFloat32=Y.freeFloat=Y.freeFloat64=Y.freeDouble=Y.freeUint8Clamped=Y.freeDataView=gw;Y.freeArrayBuffer=Ih;Y.freeBuffer=function(t){va[Wt.log2(t.length)].push(t)};Y.malloc=function(t,r){if(r===void 0||r==="arraybuffer")return We(t);switch(r){case"uint8":return ol(t);case"uint16":return Ch(t);case"uint32":return Sh(t);case"int8":return Mh(t);case"int16":return Ph(t);case"int32":return jh(t);case"float":case"float32":return Rh(t);case"double":case"float64":return kh(t);case"uint8_clamped":return Dh(t);case"bigint64":return Lh(t);case"biguint64":return Oh(t);case"buffer":return Qh(t);case"data":case"dataview":return Fh(t);default:return null}return null};function We(t){var t=Wt.nextPow2(t),r=Wt.log2(t),n=ma[r];return n.length>0?n.pop():new ArrayBuffer(t)}Y.mallocArrayBuffer=We;function ol(e){return new Uint8Array(We(e),0,e)}Y.mallocUint8=ol;function Ch(e){return new Uint16Array(We(2*e),0,e)}Y.mallocUint16=Ch;function Sh(e){return new Uint32Array(We(4*e),0,e)}Y.mallocUint32=Sh;function Mh(e){return new Int8Array(We(e),0,e)}Y.mallocInt8=Mh;function Ph(e){return new Int16Array(We(2*e),0,e)}Y.mallocInt16=Ph;function jh(e){return new Int32Array(We(4*e),0,e)}Y.mallocInt32=jh;function Rh(e){return new Float32Array(We(4*e),0,e)}Y.mallocFloat32=Y.mallocFloat=Rh;function kh(e){return new Float64Array(We(8*e),0,e)}Y.mallocFloat64=Y.mallocDouble=kh;function Dh(e){return pw?new Uint8ClampedArray(We(e),0,e):ol(e)}Y.mallocUint8Clamped=Dh;function Oh(e){return mw?new BigUint64Array(We(8*e),0,e):null}Y.mallocBigUint64=Oh;function Lh(e){return vw?new BigInt64Array(We(8*e),0,e):null}Y.mallocBigInt64=Lh;function Fh(e){return new DataView(We(e),0,e)}Y.mallocDataView=Fh;function Qh(e){e=Wt.nextPow2(e);var t=Wt.log2(e),r=va[t];return r.length>0?r.pop():new Ah(e)}Y.mallocBuffer=Qh;Y.clearCache=function(){for(var t=0;t<32;++t)ge.UINT8[t].length=0,ge.UINT16[t].length=0,ge.UINT32[t].length=0,ge.INT8[t].length=0,ge.INT16[t].length=0,ge.INT32[t].length=0,ge.FLOAT[t].length=0,ge.DOUBLE[t].length=0,ge.BIGUINT64[t].length=0,ge.BIGINT64[t].length=0,ge.UINT8C[t].length=0,ma[t].length=0,va[t].length=0}});var qh=N((p4,Hh)=>{"use strict";var ya=Ld(),sl=Jd(),qr=Nh();Hh.exports=xw;var _a=null,il=null,ga=null;function yw(e){_a=[e.LINEAR,e.NEAREST_MIPMAP_LINEAR,e.LINEAR_MIPMAP_NEAREST,e.LINEAR_MIPMAP_NEAREST],il=[e.NEAREST,e.LINEAR,e.NEAREST_MIPMAP_NEAREST,e.NEAREST_MIPMAP_LINEAR,e.LINEAR_MIPMAP_NEAREST,e.LINEAR_MIPMAP_LINEAR],ga=[e.REPEAT,e.CLAMP_TO_EDGE,e.MIRRORED_REPEAT]}function zh(e){return typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLVideoElement!="undefined"&&e instanceof HTMLVideoElement||typeof ImageData!="undefined"&&e instanceof ImageData}var Uh=function(e,t){sl.muls(e,t,255)};function al(e,t,r){var n=e.gl,o=n.getParameter(n.MAX_TEXTURE_SIZE);if(t<0||t>o||r<0||r>o)throw new Error("gl-texture2d: Invalid texture size");return e._shape=[t,r],e.bind(),n.texImage2D(n.TEXTURE_2D,0,e.format,t,r,0,e.format,e.type,null),e._mipLevels=[0],e}function wa(e,t,r,n,o,a){this.gl=e,this.handle=t,this.format=o,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=e.NEAREST,this._minFilter=e.NEAREST,this._wrapS=e.CLAMP_TO_EDGE,this._wrapT=e.CLAMP_TO_EDGE,this._anisoSamples=1;var i=this,l=[this._wrapS,this._wrapT];Object.defineProperties(l,[{get:function(){return i._wrapS},set:function(s){return i.wrapS=s}},{get:function(){return i._wrapT},set:function(s){return i.wrapT=s}}]),this._wrapVector=l;var c=[this._shape[0],this._shape[1]];Object.defineProperties(c,[{get:function(){return i._shape[0]},set:function(s){return i.width=s}},{get:function(){return i._shape[1]},set:function(s){return i.height=s}}]),this._shapeVector=c}var Yn=wa.prototype;Object.defineProperties(Yn,{minFilter:{get:function(){return this._minFilter},set:function(e){this.bind();var t=this.gl;if(this.type===t.FLOAT&&_a.indexOf(e)>=0&&(t.getExtension("OES_texture_float_linear")||(e=t.NEAREST)),il.indexOf(e)<0)throw new Error("gl-texture2d: Unknown filter mode "+e);return t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e),this._minFilter=e}},magFilter:{get:function(){return this._magFilter},set:function(e){this.bind();var t=this.gl;if(this.type===t.FLOAT&&_a.indexOf(e)>=0&&(t.getExtension("OES_texture_float_linear")||(e=t.NEAREST)),il.indexOf(e)<0)throw new Error("gl-texture2d: Unknown filter mode "+e);return t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e),this._magFilter=e}},mipSamples:{get:function(){return this._anisoSamples},set:function(e){var t=this._anisoSamples;if(this._anisoSamples=Math.max(e,1)|0,t!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(e){if(this.bind(),ga.indexOf(e)<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,e),this._wrapS=e}},wrapT:{get:function(){return this._wrapT},set:function(e){if(this.bind(),ga.indexOf(e)<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,e),this._wrapT=e}},wrap:{get:function(){return this._wrapVector},set:function(e){if(Array.isArray(e)||(e=[e,e]),e.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var t=0;t<2;++t)if(ga.indexOf(e[t])<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);this._wrapS=e[0],this._wrapT=e[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),e}},shape:{get:function(){return this._shapeVector},set:function(e){if(!Array.isArray(e))e=[e|0,e|0];else if(e.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return al(this,e[0]|0,e[1]|0),[e[0]|0,e[1]|0]}},width:{get:function(){return this._shape[0]},set:function(e){return e=e|0,al(this,e,this._shape[1]),e}},height:{get:function(){return this._shape[1]},set:function(e){return e=e|0,al(this,this._shape[0],e),e}}});Yn.bind=function(e){var t=this.gl;return e!==void 0&&t.activeTexture(t.TEXTURE0+(e|0)),t.bindTexture(t.TEXTURE_2D,this.handle),e!==void 0?e|0:t.getParameter(t.ACTIVE_TEXTURE)-t.TEXTURE0};Yn.dispose=function(){this.gl.deleteTexture(this.handle)};Yn.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var e=Math.min(this._shape[0],this._shape[1]),t=0;e>0;++t,e>>>=1)this._mipLevels.indexOf(t)<0&&this._mipLevels.push(t)};Yn.setPixels=function(e,t,r,n){var o=this.gl;this.bind(),Array.isArray(t)?(n=r,r=t[1]|0,t=t[0]|0):(t=t||0,r=r||0),n=n||0;var a=zh(e)?e:e.raw;if(a){var i=this._mipLevels.indexOf(n)<0;i?(o.texImage2D(o.TEXTURE_2D,0,this.format,this.format,this.type,a),this._mipLevels.push(n)):o.texSubImage2D(o.TEXTURE_2D,n,t,r,this.format,this.type,a)}else if(e.shape&&e.stride&&e.data){if(e.shape.length<2||t+e.shape[1]>this._shape[1]>>>n||r+e.shape[0]>this._shape[0]>>>n||t<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");_w(o,t,r,n,this.format,this.type,this._mipLevels,e)}else throw new Error("gl-texture2d: Unsupported data type")};function Vh(e,t){return e.length===3?t[2]===1&&t[1]===e[0]*e[2]&&t[0]===e[2]:t[0]===1&&t[1]===e[0]}function _w(e,t,r,n,o,a,i,l){var c=l.dtype,s=l.shape.slice();if(s.length<2||s.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var u=0,f=0,d=Vh(s,l.stride.slice());c==="float32"?u=e.FLOAT:c==="float64"?(u=e.FLOAT,d=!1,c="float32"):c==="uint8"?u=e.UNSIGNED_BYTE:(u=e.UNSIGNED_BYTE,d=!1,c="uint8");var p=1;if(s.length===2)f=e.LUMINANCE,s=[s[0],s[1],1],l=ya(l.data,s,[l.stride[0],l.stride[1],1],l.offset);else if(s.length===3){if(s[2]===1)f=e.ALPHA;else if(s[2]===2)f=e.LUMINANCE_ALPHA;else if(s[2]===3)f=e.RGB;else if(s[2]===4)f=e.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");p=s[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((f===e.LUMINANCE||f===e.ALPHA)&&(o===e.LUMINANCE||o===e.ALPHA)&&(f=o),f!==o)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var m=l.size,w=i.indexOf(n)<0;if(w&&i.push(n),u===a&&d)l.offset===0&&l.data.length===m?w?e.texImage2D(e.TEXTURE_2D,n,o,s[0],s[1],0,o,a,l.data):e.texSubImage2D(e.TEXTURE_2D,n,t,r,s[0],s[1],o,a,l.data):w?e.texImage2D(e.TEXTURE_2D,n,o,s[0],s[1],0,o,a,l.data.subarray(l.offset,l.offset+m)):e.texSubImage2D(e.TEXTURE_2D,n,t,r,s[0],s[1],o,a,l.data.subarray(l.offset,l.offset+m));else{var y;a===e.FLOAT?y=qr.mallocFloat32(m):y=qr.mallocUint8(m);var I=ya(y,s,[s[2],s[2]*s[0],1]);u===e.FLOAT&&a===e.UNSIGNED_BYTE?Uh(I,l):sl.assign(I,l),w?e.texImage2D(e.TEXTURE_2D,n,o,s[0],s[1],0,o,a,y.subarray(0,m)):e.texSubImage2D(e.TEXTURE_2D,n,t,r,s[0],s[1],o,a,y.subarray(0,m)),a===e.FLOAT?qr.freeFloat32(y):qr.freeUint8(y)}}function ll(e){var t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),t}function Bh(e,t,r,n,o){var a=e.getParameter(e.MAX_TEXTURE_SIZE);if(t<0||t>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(o===e.FLOAT&&!e.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var i=ll(e);return e.texImage2D(e.TEXTURE_2D,0,n,t,r,0,n,o,null),new wa(e,i,t,r,n,o)}function ww(e,t,r,n,o,a){var i=ll(e);return e.texImage2D(e.TEXTURE_2D,0,o,o,a,t),new wa(e,i,r,n,o,a)}function bw(e,t){var r=t.dtype,n=t.shape.slice(),o=e.getParameter(e.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>o||n[1]<0||n[1]>o)throw new Error("gl-texture2d: Invalid texture size");var a=Vh(n,t.stride.slice()),i=0;r==="float32"?i=e.FLOAT:r==="float64"?(i=e.FLOAT,a=!1,r="float32"):r==="uint8"?i=e.UNSIGNED_BYTE:(i=e.UNSIGNED_BYTE,a=!1,r="uint8");var l=0;if(n.length===2)l=e.LUMINANCE,n=[n[0],n[1],1],t=ya(t.data,n,[t.stride[0],t.stride[1],1],t.offset);else if(n.length===3)if(n[2]===1)l=e.ALPHA;else if(n[2]===2)l=e.LUMINANCE_ALPHA;else if(n[2]===3)l=e.RGB;else if(n[2]===4)l=e.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");i===e.FLOAT&&!e.getExtension("OES_texture_float")&&(i=e.UNSIGNED_BYTE,a=!1);var c,s,u=t.size;if(a)t.offset===0&&t.data.length===u?c=t.data:c=t.data.subarray(t.offset,t.offset+u);else{var f=[n[2],n[2]*n[0],1];s=qr.malloc(u,r);var d=ya(s,n,f,0);(r==="float32"||r==="float64")&&i===e.UNSIGNED_BYTE?Uh(d,t):sl.assign(d,t),c=s.subarray(0,u)}var p=ll(e);return e.texImage2D(e.TEXTURE_2D,0,l,n[0],n[1],0,l,i,c),a||qr.free(s),new wa(e,p,n[0],n[1],l,i)}function xw(e){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(_a||yw(e),typeof arguments[1]=="number")return Bh(e,arguments[1],arguments[2],arguments[3]||e.RGBA,arguments[4]||e.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return Bh(e,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||e.RGBA,arguments[3]||e.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var t=arguments[1],r=zh(t)?t:t.raw;if(r)return ww(e,r,t.width|0,t.height|0,arguments[2]||e.RGBA,arguments[3]||e.UNSIGNED_BYTE);if(t.shape&&t.data&&t.stride)return bw(e,t)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}});var Ep=N((hl,pl)=>{(function(e,t){typeof hl=="object"&&typeof pl!="undefined"?pl.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis!="undefined"?globalThis:e||self,e["micro-memoize"]=t())})(hl,function(){"use strict";var e={isEqual:!0,isMatchingKey:!0,isPromise:!0,maxSize:!0,onCacheAdd:!0,onCacheChange:!0,onCacheHit:!0,transformKey:!0},t=Array.prototype.slice;function r(s){var u=s.length;return u?u===1?[s[0]]:u===2?[s[0],s[1]]:u===3?[s[0],s[1],s[2]]:t.call(s,0):[]}function n(s){var u={};for(var f in s)e[f]||(u[f]=s[f]);return u}function o(s){return typeof s=="function"&&s.isMemoized}function a(s,u){return s===u||s!==s&&u!==u}function i(s,u){var f={};for(var d in s)f[d]=s[d];for(var d in u)f[d]=u[d];return f}var l=function(){function s(u){this.keys=[],this.values=[],this.options=u;var f=typeof u.isMatchingKey=="function";f?this.getKeyIndex=this._getKeyIndexFromMatchingKey:u.maxSize>1?this.getKeyIndex=this._getKeyIndexForMany:this.getKeyIndex=this._getKeyIndexForSingle,this.canTransformKey=typeof u.transformKey=="function",this.shouldCloneArguments=this.canTransformKey||f,this.shouldUpdateOnAdd=typeof u.onCacheAdd=="function",this.shouldUpdateOnChange=typeof u.onCacheChange=="function",this.shouldUpdateOnHit=typeof u.onCacheHit=="function"}return Object.defineProperty(s.prototype,"size",{get:function(){return this.keys.length},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"snapshot",{get:function(){return{keys:r(this.keys),size:this.size,values:r(this.values)}},enumerable:!1,configurable:!0}),s.prototype._getKeyIndexFromMatchingKey=function(u){var f=this.options,d=f.isMatchingKey,p=f.maxSize,m=this.keys,w=m.length;if(!w)return-1;if(d(m[0],u))return 0;if(p>1){for(var y=1;y<w;y++)if(d(m[y],u))return y}return-1},s.prototype._getKeyIndexForMany=function(u){var f=this.options.isEqual,d=this.keys,p=d.length;if(!p)return-1;if(p===1)return this._getKeyIndexForSingle(u);var m=u.length,w,y;if(m>1){for(var I=0;I<p;I++)if(w=d[I],w.length===m){for(y=0;y<m&&f(w[y],u[y]);y++);if(y===m)return I}}else for(var I=0;I<p;I++)if(w=d[I],w.length===m&&f(w[0],u[0]))return I;return-1},s.prototype._getKeyIndexForSingle=function(u){var f=this.keys;if(!f.length)return-1;var d=f[0],p=d.length;if(u.length!==p)return-1;var m=this.options.isEqual;if(p>1){for(var w=0;w<p;w++)if(!m(d[w],u[w]))return-1;return 0}return m(d[0],u[0])?0:-1},s.prototype.orderByLru=function(u,f,d){for(var p=this.keys,m=this.values,w=p.length,y=d;y--;)p[y+1]=p[y],m[y+1]=m[y];p[0]=u,m[0]=f;var I=this.options.maxSize;w===I&&d===w?(p.pop(),m.pop()):d>=I&&(p.length=m.length=I)},s.prototype.updateAsyncCache=function(u){var f=this,d=this.options,p=d.onCacheChange,m=d.onCacheHit,w=this.keys[0],y=this.values[0];this.values[0]=y.then(function(I){return f.shouldUpdateOnHit&&m(f,f.options,u),f.shouldUpdateOnChange&&p(f,f.options,u),I},function(I){var R=f.getKeyIndex(w);throw R!==-1&&(f.keys.splice(R,1),f.values.splice(R,1)),I})},s}();function c(s,u){if(u===void 0&&(u={}),o(s))return c(s.fn,i(s.options,u));if(typeof s!="function")throw new TypeError("You must pass a function to `memoize`.");var f=u.isEqual,d=f===void 0?a:f,p=u.isMatchingKey,m=u.isPromise,w=m===void 0?!1:m,y=u.maxSize,I=y===void 0?1:y,R=u.onCacheAdd,q=u.onCacheChange,F=u.onCacheHit,Q=u.transformKey,L=i({isEqual:d,isMatchingKey:p,isPromise:w,maxSize:I,onCacheAdd:R,onCacheChange:q,onCacheHit:F,transformKey:Q},n(u)),G=new l(L),B=G.keys,U=G.values,ie=G.canTransformKey,he=G.shouldCloneArguments,ye=G.shouldUpdateOnAdd,be=G.shouldUpdateOnChange,E=G.shouldUpdateOnHit,A=function(){var h=he?r(arguments):arguments;ie&&(h=Q(h));var S=B.length?G.getKeyIndex(h):-1;if(S!==-1)E&&F(G,L,A),S&&(G.orderByLru(B[S],U[S],S),be&&q(G,L,A));else{var O=s.apply(this,arguments),k=he?h:r(arguments);G.orderByLru(k,O,B.length),w&&G.updateAsyncCache(A),ye&&R(G,L,A),be&&q(G,L,A)}return U[0]};return A.cache=G,A.fn=s,A.isMemoized=!0,A.options=L,A}return c})});var Xp={triggerNewProjectPageLayoutObj:function(e){window.laytheme.trigger("newprojectpagelayoutobj",e),window.Frontend.GlobalEvents.trigger("newprojectpagelayoutobj",e)},triggerProjectPageShown:function(){window.laytheme.trigger("projectpageshown"),window.Frontend.GlobalEvents.trigger("projectpageshown")},triggerNewPage:function(e,t,r){window.laytheme.trigger("newpage",e,t,r),window.Frontend.GlobalEvents.trigger("newpage",e,t,r)},triggerNewPageShown:function(e,t,r){window.laytheme.trigger("newpageshown",e,t,r),window.Frontend.GlobalEvents.trigger("newpageshown",e,t,r)},triggerSwitchedDesktopLayoutToCustomPhoneLayout:function(){window.laytheme.trigger("switched_desktoplayout_to_customphonelayout")},triggerSwitchedCustomPhoneLayoutToDesktopLayout:function(){window.laytheme.trigger("switched_customphonelayout_to_desktoplayout")},triggerGridShown:function(e,t,r,n){window.laytheme.trigger("gridshown",e,t,r,n)},triggerSizeChanged:function(e){window.laytheme.trigger("sizechanged",e)},triggerPushState:function(){window.laytheme.trigger("pushstate")}},Mt=Xp;var yr=Xt(Il());var to=function(e){if(e.hasClass("setsizes")){if(e.attr("sizes")==""){var t=e[0].getBoundingClientRect(),r=gr(t.width);jQuery(this).attr("sizes",r+"px").attr("data-sizes",r+"px")}var n=e.attr("data-srcset");e.attr({srcset:n})}else if(e.hasClass("lay-gif")||e.hasClass("lay-image-original")){var o=e.attr("data-src");e.attr("src",o)}},Cl=function(e,t=0){var r=jQuery("html").hasClass("fp-enabled");if(!r||r&&jQuery(e).closest(".row").length>0&&window.getComputedStyle(jQuery(e).closest(".row")[0]).visibility!="hidden"){var n=e.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight+t&&n.right>0&&n.left<window.innerWidth)return!0}return!1},Yp=function(e,t,r){return e==!0};function Kp(e){var t=e,r=[],n=[],o=[],a=function(){var l=t.find("img.setsizes, img.lay-gif, img.lay-image-original");l.each(function(){Cl(this)?(r.push(this),n.push(!1)):o.push(this)});for(var c=0;c<r.length;c++)(function(u){var f=jQuery(r[u]);to(f),f[0].complete?n[u]=!0:(f[0].addEventListener("load",function(){n[u]=!0}),f[0].addEventListener("error",function(){n[u]=!0}))})(c);if(r.length>0)var s=setInterval(function(){n.every(Yp)&&(i(),clearInterval(s))},30);else i()},i=function(){for(var l=0;l<o.length;l++){var c=jQuery(o[l]);to(c)}};return{loadImages:a}}var Jp=function(e){if(e.length>0)if(g.isTouchDevice){var t=e.find("img.setsizes, img.lay-gif, img.lay-image-original");t.each(function(){to(jQuery(this))})}else{var r=new Kp(e);r.loadImages()}},_t={initLoadImages:Jp,loadImage:to,isInsideViewportHeight:Cl};var Ra=Backbone.Radio.channel("events");window.lazySizes={loader:{unveil:function(e){}}};var Zp=function(){window.laytheme.on("newpageshown",function(){let e=document.querySelector("body>.lay-content #footer-region");e&&e.addEventListener("scroll",()=>{Ra.trigger("scroll")});let t=document.querySelector("body>.lay-content #grid");t&&t.addEventListener("scroll",()=>{Ra.trigger("scroll")})})},M={initModule:function(){Sl(),jQuery(window).trigger("window_width_changed",Sl),pm(),nm(),Zp(),mm(),vm(),kl(),Rl(),hm(),_m(),gm(),ym(),em(),rm()},map:function(e,t,r,n,o){return dm(e,t,r,n,o)},filterURL:function(e){return ro(e)},isInternUrl:function(e){return sm(e)},stringStartsWith:function(e,t){return am(e,t)},fixBody:function(){wm()},unfixBody:function(){bm()},stringifyCatIds:function(e){return Pl(e)},parseIdsString:function(e){return om(e)},fadeInImageOnLoadViaParent:function(e){ka(e)},setSrcAndSrcSetViaParent:function(e){jl(e)},setBodyClasses:function(e){fm(e)},setImageSizesAttribute:function(e){Kr(e)},getImageSrcAndSrcSet:function(e){return tm(e)}},g={orientation:window.innerWidth>window.innerHeight?"landscape":"portrait",previousOrientation:window.innerWidth>window.innerHeight?"landscape":"portrait",isPhoneSize:null,isDesktopSize:null,isTabletSize:null,isNotPhoneSize:null,screenSize:null,breakpoint:parseInt(frontendPassedData.breakpoint,10),tabletBreakpoint:parseInt(frontendPassedData.tabletbreakpoint,10),phoneBreakpoint:parseInt(frontendPassedData.breakpoint,10),isTouchDevice:!1,supportsPlaysInline:!1,showOriginalImages:frontendPassedData.misc_options_showoriginalimages=="on",imageSizes:["265","512","768","1024","1280","1920","2560","3200","3840","4096"]};window.layUpdateImageSizes=function(){Kr(),window.lazyLoadInstance!=null&&window.lazyLoadInstance.update()};var ja=function(){setTimeout(function(){window.lazyLoadInstance==null?window.lazyLoadInstance=new yr.default({elements_selector:".lazyload",class_loaded:"lazyloaded",class_error:"loaded-error",class_loading:"lazyloading"}):window.lazyLoadInstance.update()},0)},em=function(){window.laytheme.on("newpageshown",function(e,t,r){Kr(),cm(),ja(),ka(),um()}),window.laytheme.on("searchresultshown",function(){var e=jQuery("#search-region");Kr(e),jl(e),ka(e),ja()}),jQuery(document.body).on("updated_cart_totals",function(){ja()})},Me=function(e){var t=void 0;switch(e){case"desktop":{var r=[];jQuery(".lay-content").each(function(){r=r.concat(Array.from(this.querySelectorAll("#grid, .cover-region-desktop, #footer")))}),r=r.concat(Array.from(document.querySelectorAll("#lay-woocommerce"))),t=jQuery(r);break}case"phone":{var r=[];jQuery(".lay-content").each(function(){var o=jQuery(this).find("#footer-custom-phone-grid").length!=0,a=jQuery(this).find("#custom-phone-grid").length!=0;o&&a?r=r.concat(Array.from(this.querySelectorAll("#custom-phone-grid, .cover-region-phone, #footer-custom-phone-grid"))):!o&&a?r=r.concat(Array.from(this.querySelectorAll("#custom-phone-grid, .cover-region-phone, #footer"))):o&&!a?r=r.concat(Array.from(this.querySelectorAll("#grid, .cover-region-desktop, #footer-custom-phone-grid"))):!o&&!a&&(r=r.concat(Array.from(this.querySelectorAll("#grid, .cover-region-desktop, #footer"))))}),r=r.concat(Array.from(document.querySelectorAll("#lay-woocommerce"))),t=jQuery(r);break}}return t},Sl=function(){let e=window.innerWidth-document.body.clientWidth;document.body.style.setProperty("--scrollbarWidth",e+"px")},tm=function(e){var t="",r="",n=e.sizes.full;n=ro(n);var o=["_265","_512","_768","_1024","_1280","_1920","_2560","_3200","_3840","_4096"],a=e.sizes;for(var i in a)if(i!="full"){var l=a[i];l=ro(l),t=l+" "+i.substring(1)+"w, "+t;var c=o.indexOf(i);c!==-1&&o.splice(c,1)}for(var s=0;s<o.length;s++)t+=n+" "+o[s].substring(1)+"w, ";t=t.slice(0,-2);var u=a.hasOwnProperty("_265")!=-1?a._265:!1;return u==""||u==!1?r=n:r=u,r=ro(r),{src:r,srcset:t}},rm=function(){jQuery(window).on("fpAfterRender",function(){setTimeout(function(){Oa()},0)})},ka=function(e){typeof e=="undefined"&&(e=jQuery(".lay-content")),e.find("img.setsizes, img.lay-gif, img.lay-image-original").each(function(){var t=this;t.complete?t.classList.add("loaded"):t.addEventListener("load",function(){t.classList.add("loaded")})})},nm=function(){var e=0;jQuery(document).on("scroll",()=>{Ra.trigger("scroll"),window.scrollY>e?document.body.classList.add("lay-scrolled-down"):document.body.classList.remove("lay-scrolled-down"),e=window.scrollY})},Pl=function(e){if(e==""||typeof e=="undefined"||e==null)return"[]";if(typeof e=="string")return e;for(var t=0;t<e.length;t++)e[t]=parseInt(e[t],10);return JSON.stringify(e)},om=function(t){if(t==""||typeof t=="undefined"||t==null)return[];if(Array.isArray(t))return t;for(var t=JSON.parse(t),r=0;r<t.length;r++)t[r]=parseInt(t[r],10);return t},am=function(e,t){return e.slice(0,t.length).toLowerCase()==t.toLowerCase()},im=function(e,t,r){if(t.indexOf("*")===-1)return e.removeClass(t),r?e.addClass(r):e;var n=new RegExp("\\s"+t.replace(/\*/g,"[A-Za-z0-9-_]+").split(" ").join("\\s|\\s")+"\\s","g");return e.each(function(o,a){for(var i=" "+a.className+" ";n.test(i);)i=i.replace(n," ");a.className=jQuery.trim(i)}),r?e.addClass(r):e},sm=function(e){var t=frontendPassedData.siteUrl;t.startsWith("http://")?t=t.substr(7):t.startsWith("https://")&&(t=t.substr(8)),t.startsWith("www.")&&(t=t.substr(4));var r=e;if(r.startsWith("http://")?r=r.substr(7):r.startsWith("https://")&&(r=r.substr(8)),r.startsWith("www.")&&(r=r.substr(4)),r.startsWith(t))return!0},ro=function(e){if(e!==null&&e!=""&&typeof e!="undefined"){if(e.indexOf("cloudfront.net")!==-1)return e;e=lm(e);var t=e.substring(0,5);if(t=="http:"&&frontendPassedData.is_ssl==!0){var r=e.substring(5);e="https:"+r}else if(t=="https"&&(frontendPassedData.is_ssl==!1||frontendPassedData.is_ssl=="")){var r=e.substring(5);e="http"+r}if(frontendPassedData.has_www==1){if(frontendPassedData.is_ssl==!0){if(e.substring(0,12)!="https://www."){var r=e.substring(8);e="https://www."+r}}else if(e.substring(0,11)!="http://www."){var r=e.substring(7);e="http://www."+r}}else if(frontendPassedData.is_ssl==!0){if(e.substring(0,12)=="https://www."){var r=e.substring(12);e="https://"+r}}else if(e.substring(0,11)=="http://www."){var r=e.substring(11);e="http://"+r}}return e},lm=function(e){return e.startsWith("mailto:")||e.startsWith("#")||e.startsWith("tel:")?e:e.substr(0,1)=="/"?frontendPassedData.siteUrl+e:e},um=function(){setTimeout(function(){typeof window.instgrm!="undefined"&&window.instgrm.Embeds.process()},0)},cm=function(){},jl=function(e){e.find("img.setsizes").each(function(){var t=jQuery(this).attr("data-srcset"),r=jQuery(this).attr("data-src");jQuery(this).attr({src:r,srcset:t})}),e.find("img.lay-gif, img.lay-image-original").each(function(){var t=jQuery(this).attr("data-src");jQuery(this).attr("src",t)})},Kr=function(e){typeof e=="undefined"&&(e=jQuery("body")),e.find("img.setsizes:not(.setsizes-objectfit-cover), img.lazyload:not(.setsizes-objectfit-cover)").each(function(){var t=this.getBoundingClientRect().width;if(t==0){var r=jQuery(this).attr("data-ar"),n=this.clientHeight;t=n/r}if(jQuery(this).attr("data-parent-fit")=="cover"){var t=parseInt(jQuery(this).attr("data-w"),10),n=parseInt(jQuery(this).attr("data-h"),10),o=this.parentNode.getBoundingClientRect();if(t/n<o.width/o.height)t=o.width;else{var a=o.height;t=t/n*a}}t=gr(t),jQuery(this).attr("sizes",t+"px").attr("data-sizes",t+"px")}),Oa()},gr=function(e){for(var t=[265,512,768,1024,1280,1920,2560,3200,3840,4096],r=e,n,n=0;n<t.length;n++)if(t[n]>=e){r=t[n];break}return r},Oa=function(e){typeof e=="undefined"&&(e=jQuery("body")),e.find(".background-image img.setsizes.setsizes-objectfit-cover").each(function(){var t=this.parentNode.getBoundingClientRect();(this.parentNode.classList.contains("background-image-style-left_right")||this.parentNode.classList.contains("background-image-style-left")||this.parentNode.classList.contains("background-image-style-right"))&&(t.width=t.width/2);var r=parseInt(jQuery(this).attr("data-w"),10),n=parseInt(jQuery(this).attr("data-h"),10),o=0;if(r/n>t.width/t.height){var a=t.height;o=n/r*a}else o=t.width;o=gr(o),jQuery(this).attr("sizes",parseInt(o,10)+"px")})},fm=function(e){var t="type-"+e.type+" id-"+e.id+" slug-"+e.slug+" page-id-"+e.id+" postid-"+e.id;if(typeof e.catid!="undefined")for(var r=0;r<e.catid.length;r++)t+=" category-"+e.catid[r]+" ";im(jQuery("body"),"type-* id-* slug-* page-id-* postid-* category-*",t),jQuery("body").attr({"data-type":e.type,"data-id":e.id,"data-slug":e.slug,"data-catid":Pl(e.catid),"data-footerid":e.footerid});var n=window.location.href,o=n.substring(n.length-1),a=frontendPassedData.siteUrl.substring(frontendPassedData.siteUrl.length-1);o=="/"&&a!="/"&&(n=n.slice(0,-1)),n==frontendPassedData.siteUrl?jQuery("body").addClass("home"):jQuery("body").removeClass("home")},dm=function(e,t,r,n,o){return n+(o-n)*((e-t)/(r-t))},hm=function(){g.isTouchDevice=navigator.userAgent.match(/(iPhone|iPod|iPad|Android|playbook|silk|BlackBerry|BB10|Windows Phone|Tizen|Bada|webOS|IEMobile|Opera Mini)/),g.isTouchDevice==null&&(g.isTouchDevice=!1)},pm=function(){var e=window.innerWidth;jQuery(window).on("resize",function(){e!=window.innerWidth&&jQuery(window).trigger("window_width_changed"),e=window.innerWidth})},mm=function(){jQuery(window).on("orientationchange window_width_changed",function(){kl(),Rl()}),jQuery(window).on("window_width_changed",_.debounce(function(){Kr()},300))},Rl=function(){g.orientation=window.innerWidth>window.innerHeight?"landscape":"portrait",g.orientation!=g.previousOrientation&&window.laytheme.trigger("orientationchanged",g.orientation),g.previousOrientation=g.orientation},vm=function(){window.innerWidth<=g.phoneBreakpoint?g.screenSize="phone":window.innerWidth<=g.tabletBreakpoint?g.screenSize="tablet":g.screenSize="desktop"},kl=function(){var e=g.screenSize;switch(window.innerWidth<=g.phoneBreakpoint?g.screenSize="phone":window.innerWidth<=g.tabletBreakpoint?g.screenSize="tablet":g.screenSize="desktop",g.screenSize){case"desktop":jQuery("html").addClass("desktop-size").removeClass("tablet-size phone-size"),g.isPhoneSize=!1,g.isTabletSize=!1,g.isDesktopSize=!0,g.isDesktopOrTabletSize=!0;break;case"tablet":jQuery("html").addClass("tablet-size").removeClass("desktop-size phone-size"),g.isPhoneSize=!1,g.isTabletSize=!0,g.isDesktopSize=!1,g.isDesktopOrTabletSize=!0;break;case"phone":jQuery("html").addClass("phone-size").removeClass("desktop-size tablet-size"),g.isPhoneSize=!0,g.isTabletSize=!1,g.isDesktopSize=!1,g.isDesktopOrTabletSize=!1;break}e!=g.screenSize&&Mt.triggerSizeChanged(g.screenSize)},gm=function(){frontendPassedData.image_loading=="instant_load"&&window.laytheme.on("newpageshown",function(){var e=jQuery(".img img.lazyload, .thumb img.lazyload, .background-image img.lazyload").get();e.forEach(function(t){window.lazyLoadInstance&&yr.default.load&&yr.default.load(t)}),setTimeout(function(){var t=jQuery(".lay-carousel-slide.is-selected img").get();t.forEach(function(r){window.lazyLoadInstance&&yr.default.load&&yr.default.load(r)})},200)})},ym=function(){Modernizr.objectfit||(window.laytheme.on("newpageshown",Ml),jQuery(window).on("resize orientationchange",Ml))},Ml=function(){setTimeout(function(){jQuery(".background-image img").each(function(){var e=jQuery(this).attr("data-ar"),t=this.parentNode.getBoundingClientRect(),r=t.height/t.width;typeof e!="undefined"?e>r?(this.classList.add("bgw100"),this.classList.remove("bgh100")):(this.classList.add("bgh100"),this.classList.remove("bgw100")):(this.classList.add("bgw100"),this.classList.remove("bgh100"))}),Oa(),jQuery(".background-video video").each(function(){var e=jQuery(this).attr("data-ar"),t=this.parentNode.getBoundingClientRect(),r=t.height/t.width;typeof e!="undefined"?e>r?(this.classList.add("w100"),this.classList.remove("h100")):(this.classList.add("h100"),this.classList.remove("w100")):(this.classList.add("w100"),this.classList.remove("h100"))})},0)},_m=function(){if(g.supportsPlaysInline=!1,g.isTouchDevice){var e=new MobileDetect(window.navigator.userAgent);if(e.os()=="iOS"&&e.userAgent()=="Safari"&&e.version("Safari")>=10){g.supportsPlaysInline=!0;return}if(e.os()=="AndroidOS"&&e.userAgent()=="Chrome"&&e.version("Chrome")>=53){g.supportsPlaysInline=!0;return}g.supportsPlaysInline=!0}},no=!1,Da=0,wm=function(){if(!no&&(no=!0,jQuery("html").css("overflow-y","hidden"),g.isTouchDevice&&(Da=document.documentElement.scrollTop,document.body.style.top=-Da+"px",setTimeout(function(){document.body.style.position="fixed"},0),jQuery("body").addClass("body-position-fixed")),jQuery.fn.fullpage))try{jQuery.fn.fullpage.setAllowScrolling(!1)}catch(e){}},bm=function(){if(no&&(no=!1,jQuery("html").css("overflow-y",""),g.isTouchDevice&&(document.body.style.position="",jQuery(document).scrollTop(Da),jQuery("body").removeClass("body-position-fixed")),jQuery.fn.fullpage))try{jQuery.fn.fullpage.setAllowScrolling(!0)}catch(e){}},oo=function(e){for(var t=new jQuery.Deferred,r=[],n=0;n<e.length;n++)r.push(!1);for(var n=0;n<e.length;n++)(function(i){var l=e[i];if(l.classList.contains("masonry-initialized"))r[i]=!0;else{var c=new MutationObserver(()=>{l.classList.contains("masonry-initialized")&&(r[i]=!0)});c.observe(l,{attributes:!0,attributeFilter:["class"]})}})(n);var o=setInterval(function(){r.every(xm)&&(t.resolve(),clearInterval(o))},30);return t.promise()},Dl=function(e){var t=e.find(".contains-masonry-layout");if(t.length==0&&(t=e.closest(".contains-masonry-layout")),t.length==0)return[];var r=[];return t.each(function(){r.push(this)}),r},Ol=function(e){var t=e.find(".contains-masonry-layout");if(t.length==0&&(t=e.closest(".contains-masonry-layout")),t.length==0)return[];var r=[];return t.each(function(){ut(this)&&r.push(this)}),r},xm=function(e,t,r){return e==!0},ut=function(e){var t=e.getBoundingClientRect();return t.bottom>0&&t.top<window.innerHeight&&t.right>0&&t.left<window.innerWidth},Ll=function(e,t,r){var n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),a=!1,i=n.left-r,l=n.right+r;o.left>=i&&o.left<=l&&(a=!0),o.right>=i&&o.right<=l&&(a=!0);var c=o.left+o.width/2;return c>=i&&c<=l&&(a=!0),a};var La=Backbone.Radio.channel("events"),Tm={initModule:function(){Em()}},Bl=Tm,Jr={$cover:null},ke={doDarken:!1,doParallax:!1,enabled:!1,frame:!1},Em=function(){frontendPassedData.misc_options_cover=="on"&&(ke.enabled=!0,frontendPassedData.cover_darken_when_scrolling=="on"&&(ke.doDarken=!0),frontendPassedData.cover_parallaxmove_when_scrolling=="on"&&(ke.doParallax=!0),window.laytheme.on("newpage",function(e,t,r){Fa()}),window.laytheme.on("newpageshown",function(){Fa(),Jr.$cover=jQuery(".cover-region"),Jr.$cover.length>0?(jQuery("html").addClass("prevent-overscroll"),Im(),g.isPhoneSize&&frontendPassedData.cover_disable_for_phone==!0?ke.enabled=!1:ke.enabled=!0,Sm(),zl(),Am(),Ul()):jQuery("html").removeClass("prevent-overscroll")}))},Fl=function(e){switch(e){case"desktop":case"tablet":frontendPassedData.cover_disable_for_phone==!0&&ke.enabled==!1&&(ke.enabled=!0,Ul());break;case"phone":frontendPassedData.cover_disable_for_phone==!0&&(ke.enabled=!1,Jr.$cover.attr("style",""),jQuery(".cover-region").removeClass("clickable-cover"),jQuery(".cover-region").on("click"),Fa());break}},Am=function(){jQuery(window).off("window_width_changed",Ql),jQuery(window).on("window_width_changed",Ql)},Im=function(){window.laytheme.off("sizechanged",Fl),window.laytheme.on("sizechanged",Fl)},Ql=function(){Cm()},zl=function(){jQuery(".cover-region").css({top:"",height:"","min-height":""}),jQuery(".cover-region-placeholder, .cover-region .row, .cover-region .row-inner, .cover-region .column-wrap, .cover-inner").css({height:"","min-height":""})},Cm=function(){if(Jr.$cover.is(":visible")&&ke.enabled&&g.isPhoneSize){var e=jQuery(".navbar").height();jQuery(".navbar").is(":visible")||(e=0),jQuery(".cover-region").css({top:e+"px",height:window.innerHeight-e+"px","min-height":window.innerHeight-e+"px"}),jQuery(".cover-region-placeholder, .cover-region .row, .cover-region .row-inner, .cover-region .column-wrap, .cover-inner").css({height:window.innerHeight-e+"px","min-height":window.innerHeight-e+"px"})}else zl()},Fa=function(){La.off("scroll",Qa)},Ul=function(){La.off("scroll",Qa),La.on("scroll",Qa)},Qa=function(){var e=window.scrollY;if(e<=window.innerHeight&&ke.enabled){var t={};if(ke.doDarken){var r=M.map(e,0,window.innerHeight,1,.2);r>1&&(r=1),t.filter="brightness("+r+")",t["-webkit-filter"]="brightness("+r+")"}if(ke.doParallax){var n=M.map(e,0,window.innerHeight,0,window.innerHeight/3);t.transform="translate3d(0,-"+n+"px,0)",t["-webkit-transform"]="translate3d(0,-"+n+"px,0)"}(ke.doParallax||ke.doDarken)&&Jr.$cover.css(t)}},Sm=function(){frontendPassedData.cover_scrolldown_on_click=="on"&&ke.enabled&&(jQuery(".cover-region").addClass("clickable-cover"),jQuery(".cover-region").on("click",function(){var e=jQuery("html, body"),t=jQuery(".cover-content-desktop").offset().top+1,r=g.screenSize;r=="phone"&&(t=jQuery(".cover-content-phone").length>0?jQuery(".cover-content-phone").offset().top+1:t),e.animate({scrollTop:t},400,"easeOutSine",function(){e.off("scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove",Nl)}),e.on("scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove",e,Nl)}))},Nl=function(e){e.data.stop()};var Vl={initModule:function(){frontendPassedData.phone_layout_active=="on"&&(window.laytheme.on("newpageshown",Mm),Pm())}},Pt={mainHasCustomPhoneGrid:!1,footerHasCustomPhoneGrid:!1};var Mm=function(){Pt.mainHasCustomPhoneGrid=jQuery("#custom-phone-grid").length==1,Pt.footerHasCustomPhoneGrid=jQuery("#footer-custom-phone-grid").length==1},Pm=function(){var e=g.screenSize;jQuery(window).on("window_width_changed orientationchange",function(){(g.screenSize=="phone"&&e=="tablet"||g.screenSize=="phone"&&e=="desktop")&&(Pt.mainHasCustomPhoneGrid!=!1||Pt.footerHasCustomPhoneGrid!=!1)?Mt.triggerSwitchedDesktopLayoutToCustomPhoneLayout():(g.screenSize=="tablet"&&e=="phone"||g.screenSize=="desktop"&&e=="phone")&&(Pt.mainHasCustomPhoneGrid!=!1||Pt.footerHasCustomPhoneGrid!=!1)&&Mt.triggerSwitchedCustomPhoneLayoutToDesktopLayout(),e=g.screenSize})};var Gl=["easeInQuad","easeInCubic","easeInQuart","easeInQuint","easeInSine","easeInExpo","easeInCirc","easeInBack","easeOutQuad","easeOutCubic","easeOutQuart","easeOutQuint","easeOutSine","easeOutExpo","easeOutCirc","easeOutBack","easeInBounce","easeInOutQuad","easeInOutCubic","easeInOutQuart","easeInOutQuint","easeInOutSine","easeInOutExpo","easeInOutCirc","easeInOutBack","easeInOutBounce","easeOutBounce","easeOutInQuad","easeOutInCubic","easeOutInQuart","easeOutInQuint","easeOutInSine","easeOutInExpo","easeOutInCirc","easeOutInBack","easeOutInBounce"];Gl.indexOf(frontendPassedData.navigation_transition_in_easing)===-1&&(frontendPassedData.navigation_transition_in_easing="easeInSine");Gl.indexOf(frontendPassedData.navigation_transition_out_easing)===-1&&(frontendPassedData.navigation_transition_out_easing="easeOutSine");var ao="",jm=frontendPassedData.element_transition_on_scroll=="on",Rm={initModule:function(){km(),Fm(),Nm(),Bm()},setTransitionStatus:function(e){ao=e},getTransitionStatus:function(){return ao},doAfterComplete:function(){Yl()}},km=function(){window.laytheme.on("before_content_replacement",function(){(parseInt(frontendPassedData.navigation_transition_out_duration,10)==0||frontendPassedData.navigation_transition_out=="none")&&parseInt(frontendPassedData.navigation_transition_in_duration,10)!=0&&frontendPassedData.navigation_transition_in!="none"&&Wl()})},Na=function(){za==!0&&frontendPassedData.navigation_transition_use_revealing_transition_on_first_visit=="on"&&Om(),za=!1},Dm=function(){var e=document.getElementById("lay-hide-wrap-css");e&&e.remove()},Wl=function(){var e=document.getElementById("lay-hide-wrap-css");if(!e){var t=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(t),t.id="lay-hide-wrap-css",t.appendChild(document.createTextNode("body>.lay-content{opacity: 0;}/* because we need to wait for masonry to initalize before starting animation */.col.type-thumbnailgrid .thumbnail-wrap{opacity: 0;}.col.type-elementgrid .element-wrap{opacity: 0;}"))}},$l=function(e,t){var r=[],n=document.documentElement.classList.contains("fp-enabled"),o=t.indexOf("stagger")!=-1||t.indexOf("up")!=-1||t.indexOf("down")!=-1;return e.each(function(){if(ut(this)){var a=this.closest(".row");if(!n||this.classList.contains("place-freely")||n&&a&&window.getComputedStyle(a).visibility!="hidden")if(o&&this.classList.contains("type-elementgrid"))jQuery(this).find(".element-wrap").each(function(){ut(this)&&r.push(this)});else if(o&&this.classList.contains("type-thumbnailgrid")){var i=jQuery(this).find(".lay-thumbnailgrid-filter-wrap");i.length>0&&ut(i[0])&&r.push(i[0]),jQuery(this).find(".thumbnail-wrap").each(function(){ut(this)&&r.push(this)})}else o&&this.classList.contains("type-productsgrid")?jQuery(this).find(".lay-product").each(function(){ut(this)&&r.push(this)}):o&&this.classList.contains("type-carousel")?jQuery(this).find(".lay-carousel-wrap").each(function(){ut(this)&&r.push(this)}):o&&this.classList.contains("type-news")?jQuery(this).find(".lay-news-element-row, .lay-news-load-more-wrap").each(function(){ut(this)&&r.push(this)}):r.push(this)}}),r},Om=function(){jQuery("head").append('<style id="lay-show-sitetitle-menubar-menu-etc">.sitetitle, .overlay-burger, .laynav, #lay_canvas, .navbar, .lay-fadein, .mobile-title, .burger-wrap,  body #fp-nav, body .fp-slidesNav, .mobile-menu-style-style_desktop_menu{opacity: 1;}</style>'),setTimeout(function(){var e=document.getElementById("lay-hide-sitetitle-menubar-menu-etc");e&&e.remove(),e=document.getElementById("lay-show-sitetitle-menubar-menu-etc"),e&&e.remove()},frontendPassedData.navigation_transition_in_duration)};function Hl(e,t,r,n){let o=r-e,a=n-t;return Math.sqrt(a*a+o*o)}var Xl=function(e,t){for(var r=[],n=0;n<e.length;n++){var o=e[n].getBoundingClientRect(),a;typeof t!="undefined"&&t=="stagger-down"?a=Hl(0,window.innerHeight,o.left,o.top):a=Hl(0,0,o.left,o.top),r.push(a)}e.sort(function(i,l){var c=e.indexOf(i),s=e.indexOf(l);return r[c]-r[s]})},Lm=function(e,t,r){return e==!0},Fm=function(){window.laytheme.on("newpageshown",function(){jQuery("img").each(function(){this.addEventListener("error",function(){this.classList.add("loaded-error")})})})},Qm=function(e,t){var r=[],n=[];if(e.find("img.lazyload, img.lay-gif, img.lay-image-original, img.setsizes, img.lay-image-responsive, img.carousel-img").each(function(){if(this.classList.contains("carousel-img")){if(ut(this)){var l=this.closest(".lay-carousel");if(l.classList.contains("transition-fading")||l.classList.contains("transition-immediate")){var c=this.closest(".lay-carousel-slide");c.classList.contains("is-selected")&&(r.push(this),n.push(!1))}else Ll(l,this,-80)&&(r.push(this),n.push(!1))}}else ut(this)&&(r.push(this),n.push(!1))}),r.length==0){t();return}for(var o=0;o<r.length;o++)(function(l){var c=r[l];if(c.classList.contains("lazyloaded")||c.classList.contains("loaded")||c.classList.contains("loaded-error"))n[l]=!0;else{var s=new MutationObserver(()=>{(c.classList.contains("lazyloaded")||c.classList.contains("loaded")||c.classList.contains("loaded-error"))&&(n[l]=!0)});s.observe(c,{attributes:!0,attributeFilter:["class"]})}})(o);if(r.length>0)var a=setTimeout(function(){t(),clearInterval(i)},2500),i=setInterval(function(){n.every(Lm)&&(t(),clearInterval(i),clearTimeout(a))},30);else t()},za=!0,Pe,Nm=function(){window.laytheme.on("content_ready",function(e){switch(Pe=void 0,e){case"desktop":Pe=["body>.lay-content #grid","body>.lay-content .cover-region-desktop","body>.lay-content #footer"];break;case"phone":var t=jQuery("body>.lay-content #footer-custom-phone-grid").length!=0,r=jQuery("body>.lay-content #custom-phone-grid").length!=0;t&&r?Pe=["body>.lay-content #custom-phone-grid","body>.lay-content .cover-region-phone","body>.lay-content #footer-custom-phone-grid"]:!t&&r?Pe=["body>.lay-content #custom-phone-grid","body>.lay-content .cover-region-phone","body>.lay-content #footer"]:t&&!r?Pe=["body>.lay-content #grid","body>.lay-content .cover-region-desktop","body>.lay-content #footer-custom-phone-grid"]:!t&&!r&&(Pe=["body>.lay-content #grid","body>.lay-content .cover-region-desktop","body>.lay-content #footer"]);break}if(Array.isArray(Pe)&&Pe!=null)for(let n=0;n<Pe.length;n++)Pe[n]=Pe[n]+' .row[data-collapsed="false"] .col:not(.type-stack), '+Pe[n]+" .col.place-freely";za==!0&&frontendPassedData.navigation_transition_use_revealing_transition_on_first_visit=="on"&&window.laytheme.trigger("transition_in")})},Yl=function(){ao="ended",window.laytheme.trigger("transition_navigation_out_completed"),jQuery("a.sitetitle, .laynav a").css("pointer-events",""),Wl()},Bm=function(){window.laytheme.on("transition_out",function(){var e=g.isPhoneSize?parseInt(frontendPassedData.navigation_transition_y_translate_phone,10):parseInt(frontendPassedData.navigation_transition_y_translate_desktop,10),t=jQuery(Pe.join(",")),r=$l(t,frontendPassedData.navigation_transition_out);frontendPassedData.navigation_transition_out.indexOf("stagger")!=-1&&r.length>1&&Xl(r,frontendPassedData.navigation_transition_out);var n=anime.timeline({begin:function(){jQuery('.row[data-collapsed="true"] .col').css("display","none"),jQuery("a.sitetitle, .laynav a, body>.lay-content a, body>.lay-content .col, .clickable-cover").css("pointer-events","none"),jQuery(".thumbnail-wrap, .element-wrap").css({"transition-delay":"",transition:"none"}),jm&&(jQuery(".col").css({"transition-delay":"",transition:"none"}),jQuery("body.lay-transition-elements-on-scroll .row.no-y-offsets:last-child").css("overflow","visible"))},complete:function(){Yl()}}),o=frontendPassedData.navigation_transition_out=="none";if(o)switch(frontendPassedData.navigation_transition_out){case"fade":n.add({targets:"body>.lay-content",opacity:0,easing:frontendPassedData.navigation_transition_out_easing,duration:frontendPassedData.navigation_transition_out_duration});break}else{switch(frontendPassedData.navigation_transition_out){case"stagger-fade":n.add({targets:r,opacity:0,easing:frontendPassedData.navigation_transition_out_easing,duration:frontendPassedData.navigation_transition_out_duration,delay:anime.stagger(100)});break;case"stagger-down":n.add({targets:r,translateY:e,opacity:0,easing:frontendPassedData.navigation_transition_out_easing,duration:frontendPassedData.navigation_transition_out_duration,delay:anime.stagger(100)});break;case"stagger-up":n.add({targets:r,translateY:-e,opacity:0,easing:frontendPassedData.navigation_transition_out_easing,duration:frontendPassedData.navigation_transition_out_duration,delay:anime.stagger(100)});break;case"down":n.add({targets:r,translateY:e,opacity:0,easing:frontendPassedData.navigation_transition_out_easing,duration:frontendPassedData.navigation_transition_out_duration});break;case"up":n.add({targets:r,translateY:-e,opacity:0,easing:frontendPassedData.navigation_transition_out_easing,duration:frontendPassedData.navigation_transition_out_duration});break}n.add({targets:"body>.lay-content",opacity:0,easing:"easeOutSine",duration:100})}}),window.laytheme.on("transition_in",function(){setTimeout(function(){var e=jQuery(Pe.join(",")),t=Ol(e);t.length>0?jQuery.when(oo(t)).then(function(){setTimeout(function(){ql()},50)}).catch(function(r){console.log(r),console.log("Promise Rejected")}):ql()},0)})},ql=function(){ao="started";var e=g.isPhoneSize?parseInt(frontendPassedData.navigation_transition_y_translate_phone,10):parseInt(frontendPassedData.navigation_transition_y_translate_desktop,10),t=jQuery(Pe.join(",")),r=$l(t,frontendPassedData.navigation_transition_in);if(r.length==0){Na(),Ba([]);return}if(frontendPassedData.navigation_transition_out.indexOf("stagger")!=-1&&r.length>1&&Xl(r,frontendPassedData.navigation_transition_in),frontendPassedData.navigation_transition_in!="none")for(var n=0;n<r.length;n++){var o=r[n];o.classList.add("disable-css-transitions")}var a=anime.timeline({autoplay:!1,begin:function(){Na()},complete:function(){Ba(r)}}),i=frontendPassedData.navigation_transition_in=="none"||frontendPassedData.navigation_transition_in=="fade";if(i)switch(frontendPassedData.navigation_transition_in){case"none":a.add({targets:"body>.lay-content",opacity:1,easing:frontendPassedData.navigation_transition_in_easing,duration:0});break;case"fade":a.add({targets:"body>.lay-content",opacity:[0,1],easing:frontendPassedData.navigation_transition_in_easing,duration:frontendPassedData.navigation_transition_in_duration});break}else if(r!=null&&Array.isArray(r)&&r.length>0)switch(a.add({targets:"body>.lay-content",opacity:1,easing:"easeOutSine",duration:100}),frontendPassedData.navigation_transition_in){case"stagger-fade":a.add({targets:r,opacity:[0,1],easing:frontendPassedData.navigation_transition_in_easing,duration:frontendPassedData.navigation_transition_in_duration,delay:anime.stagger(100)});break;case"stagger-up":a.add({targets:r,translateY:[e,0],opacity:[0,1],easing:frontendPassedData.navigation_transition_in_easing,duration:frontendPassedData.navigation_transition_in_duration,delay:anime.stagger(100)});break;case"stagger-down":a.add({targets:r,translateY:[-e,0],opacity:[0,1],easing:frontendPassedData.navigation_transition_in_easing,duration:frontendPassedData.navigation_transition_in_duration,delay:anime.stagger(100)});break;case"up":a.add({targets:r,translateY:[e,0],opacity:[0,1],easing:frontendPassedData.navigation_transition_in_easing,duration:frontendPassedData.navigation_transition_in_duration});break;case"down":a.add({targets:r,translateY:[-e,0],opacity:[0,1],easing:frontendPassedData.navigation_transition_in_easing,duration:frontendPassedData.navigation_transition_in_duration});break}if(frontendPassedData.navigation_transition_in=="none")a.play(),Ba(r),Na();else{var t=jQuery(Pe.join(","));window.location.href.indexOf("#")!=-1?a.play():Qm(t,function(){a.play()})}},Ba=function(e){Dm(),jQuery("body>.lay-content").attr("style","");for(var t=0;t<e.length;t++){var r=e[t];r.classList.remove("disable-css-transitions")}for(var t=0;t<e.length;t++){var r=e[t];r.style.opacity="",!r.classList.contains("has-parallax")&&!r.hasAttribute("data-offsetx")&&!r.hasAttribute("data-offsety")&&(r.style.transform="")}jQuery("a.sitetitle, .laynav a").css("pointer-events",""),window.laytheme.trigger("transition_navigation_in_completed")},Yt=Rm;var zm={showLayout:function(e="",t=""){Hm(e,t)},initModule:function(){Gm()},hideRegions:function(){qm()}},Um={type:null,isFirstLoad:!0,gridObj:null},Va={$body:null},Vm=function(){Va.$body=jQuery("body")};var Ua=null,Hm=function(e,t){var r=Va.$body.attr("data-type"),n=Va.$body.attr("data-id");Um.type=r;var o={action:"get_laytheme_layout",id:n,type:r,password:e};Ua&&Ua.abort(),Ua=jQuery.ajax({url:frontendPassedData.ajax_url,data:o,type:"post",success:a=>{var i=window.JSON.parse(a);if(i.hasOwnProperty("layout")&&i.layout.hasOwnProperty("password")&&i.layout.password=="protected"){window.location.reload();return}e!=""&&(Yt.doAfterComplete(),l=="ended");var l=Yt.getTransitionStatus();l=="ended"?(jQuery("#lay-overlays").html(i.overlays),Kl(t,i.layout)):window.laytheme.once("transition_navigation_out_completed",function(){jQuery("#lay-overlays").html(i.overlays),Kl(t,i.layout)})},error:a=>{console.log("error loading page"),console.log(a)}})},Ha=-1,Kl=function(e,t){window.laytheme.trigger("before_content_replacement"),typeof e=="function"&&e(),frontendPassedData.never_change_scrolling_position=="on"?($resultMarkup=jQuery(t.markup),jQuery("body>.lay-content").find("#grid").replaceWith($resultMarkup.find("#grid")),jQuery("body>.lay-content").find("#custom-phone-grid").length>0&&jQuery("body>.lay-content").find("#custom-phone-grid").replaceWith($resultMarkup.find("#custom-phone-grid")),t.obj.footerid!=Ha&&jQuery("body>.lay-content").find("#footer-region").replaceWith($resultMarkup.find("#footer-region")),Ha=t.obj.footerid):jQuery("body>.lay-content").replaceWith(t.markup),M.setBodyClasses(t.obj),console.log("triggerNewPageShown"),Mt.triggerNewPageShown({},t.type,t.obj),setTimeout(function(){window.laytheme.trigger("transition_in")},0)},qm=function(){window.laytheme.trigger("transition_out")},Gm=function(){Vm(),window.laytheme.once("newpageshown",function(e,t,r){Ha=r.footerid})},Zr=zm;var Wm={initModule:function(){Km()}},io=Backbone.Radio.channel("events"),Jl=Wm,oe={cols:[],scrollY:0,parallaxActive:!1},Zl=function(e){return{"-webkit-transform":e,"-moz-transform":e,"-ms-transform":e,transform:e}},so=function(){oe.scrollY=window.pageYOffset||document.documentElement.scrollTop;for(var e=0;e<oe.cols.length;e++)if(oe.cols[e][1]!=0){var t=oe.cols[e][7],r=oe.cols[e][6],n=oe.cols[e][0][0].getBoundingClientRect(),o=n.top+oe.scrollY,a=o-window.innerHeight-oe.cols[e][2];a<0&&(a=0);var i=o+n.height-oe.cols[e][2],l=M.map(oe.scrollY,a,i,0,100);if(!(l<0||l>100)){oe.cols[e][2]=l*oe.cols[e][1]*11.2;var c=oe.cols[e][2];switch(r){case"px":c+=parseFloat(oe.cols[e][3],10);break;case"vw":case"%":c+=window.innerWidth/100*oe.cols[e][3];break}var s=oe.cols[e][4];oe.cols[e][0].css(Zl("translate("+s+t+", "+c+"px)"))}}},$m=function(){var e=g.screenSize;jQuery(window).on("window_width_changed orientationchange",function(){g.screenSize=="phone"&&e=="tablet"&&Pt.mainHasCustomPhoneGrid==!1?oe.parallaxActive==!0&&(jQuery(".col").css(Zl("")),io.off("scroll",so),oe.parallaxActive=!1):g.screenSize=="tablet"&&e=="phone"&&oe.parallaxActive==!1&&oe.cols.length>0&&(io.on("scroll",so),oe.parallaxActive=!0),oe.parallaxActive&&jQuery(window).trigger("scroll"),e=g.screenSize})},Xm=function(){window.laytheme.on("newpageshown",function(){oe.cols=[],jQuery(".col[data-yvel]").each(function(){var e=jQuery(this).attr("data-yvel");e<1&&(e=1),e=parseFloat(e),e-=1,e=-e;var t=0,r=jQuery(this).attr("data-offsety");typeof r=="undefined"&&(r=0);var n=jQuery(this).attr("data-offsetx");typeof n=="undefined"&&(n=0);var o=jQuery(this).attr("data-offsetymu");o==null&&(o="");var a=jQuery(this).attr("data-offsetxmu");a==null&&(a="");var i=!1;jQuery(this.parentNode.parentNode).hasClass("_100vh")&&this.classList.contains("align-middle")&&(jQuery(this).attr("data-type")=="text"||jQuery(this).attr("data-type")=="html"||this.classList.contains("absolute-position"))&&(i=!0);var l=[jQuery(this),e,t,r,n,i,o,a];oe.cols.push(l)}),io.off("scroll",so),oe.scrollY=0,oe.cols.length>0&&(g.isDesktopOrTabletSize||Pt.mainHasCustomPhoneGrid)&&(io.on("scroll",so),oe.parallaxActive=!0)})},Ym=function(){Xm(),$m()},Km=function(){frontendPassedData.simple_parallax=="on"&&Ym()};var eu=typeof window.WeakMap=="function"&&typeof window.Map=="function",qa=function(){if(eu)return window.WeakMap;function e(t,r){let n=-1;return t.some((o,a)=>{let i=o[0]===r;return i&&(n=a),i}),n}return class{constructor(){this.__entries__=[]}get(t){let r=e(this.__entries__,t);return this.__entries__[r][1]}set(t,r){let n=e(this.__entries__,t);~n?this.__entries__[n][1]=r:this.__entries__.push([t,r])}delete(t){let r=this.__entries__,n=e(r,t);~n&&r.splice(n,1)}has(t){return!!~e(this.__entries__,t)}}}(),tu=function(){return eu?window.Map:class extends qa{get size(){return this.__entries__.length}clear(){this.__entries__.splice(0,this.__entries__.length)}entries(){return this.__entries__.slice()}keys(){return this.__entries__.map(e=>e[0])}values(){return this.__entries__.map(e=>e[1])}forEach(e,t=null){for(let r of this.__entries__)e.call(t,r[1],r[0])}}}();var _r=function(){return window.performance&&window.performance.now?()=>window.performance.now():()=>Date.now()}();var ru=typeof window.MutationObserver=="function",Jm=function(){return window.requestAnimationFrame?window.requestAnimationFrame:e=>setTimeout(()=>e(_r()),1e3/60)}();function nu(e,t=0){let r=!1;return function(...n){r!==!1&&clearTimeout(r),r=setTimeout(()=>{r=!1,e.apply(this,n)},t)}}var en=class{constructor(t=50,r=!1){this._idleTimeout=t,this._trackHovers=r,this._cycleStartTime=-1,this._isUpdateScheduled=!1,this._repeatCycle=!1,this._hoverInitiated=!1,this._mutationsObserver=null,this._isListening=!1,this._observers=[],this.startUpdateCycle=this.startUpdateCycle.bind(this),this.scheduleUpdate=this.scheduleUpdate.bind(this),this._onMutation=this._onMutation.bind(this),this._repeatHandler=nu(this.scheduleUpdate,200),this._onMouseOver=nu(this.startUpdateCycle,200)}get idleTimeout(){return this._idleTimeout}set idleTimeout(t){this._idleTimeout=t}connect(t){this.isConnected(t)||this._observers.push(t),this._isListening||this._initListeners()}disconnect(t){let r=this._observers,n=r.indexOf(t);~n&&r.splice(n,1),!r.length&&this._isListening&&this._removeListeners()}isConnected(t){return!!~this._observers.indexOf(t)}_updateObservers(){let t=!1;for(let r of this._observers)r.updateObservations()&&(t=!0),r.hasEntries()&&r.notifySubscriber();return t}startUpdateCycle(){this._cycleStartTime=_r(),this.scheduleUpdate()}scheduleUpdate(t){if(typeof t=="number"){let n=this._updateObservers();if(this._isUpdateScheduled=!1,!this._wasCycleStarted())return;n?this.startUpdateCycle():this._hasIdleTimeEnded()?this._onCycleEnded():this.scheduleUpdate()}else this._isUpdateScheduled||(Jm(this.scheduleUpdate),this._isUpdateScheduled=!0)}_hasIdleTimeEnded(){return _r()-this._cycleStartTime>this._idleTimeout}_wasCycleStarted(){return this._cycleStartTime!==-1}_onCycleEnded(){this._cycleStartTime=-1,this._repeatCycle&&(this._cycleStartTime=0,this._repeatHandler())}_initListeners(){this._isListening||(this._isListening=!0,window.addEventListener("resize",this.startUpdateCycle,!0),window.addEventListener("scroll",this.scheduleUpdate,!0),this._trackHovers&&this._addHoverListener(),ru?(this._mutationsObserver=new MutationObserver(this._onMutation),this._mutationsObserver.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(this._repeatCycle=!0,window.addEventListener("click",this.startUpdateCycle,!0),this.startUpdateCycle()))}_removeListeners(){this._isListening&&(window.removeEventListener("resize",this.startUpdateCycle,!0),window.removeEventListener("scroll",this.scheduleUpdate,!0),this._removeHoverListener(),ru?this._mutationsObserver&&(this._mutationsObserver.disconnect(),this._mutationsObserver=null):(this._repeatCycle=!1,window.removeEventListener("click",this.startUpdateCycle,!0)),this._isListening=!1)}enableHover(){this._trackHovers=!0,this._isListening&&this._addHoverListener()}disableHover(){this._trackHovers=!1,this._removeHoverListener()}isHoverEnabled(){return this._trackHovers}_addHoverListener(){this._hoverInitiated||(window.addEventListener("mouseover",this._onMouseOver,!0),this._hoverInitiated=!0)}_removeHoverListener(){this._hoverInitiated&&(window.removeEventListener("mouseover",this._onMouseOver,!0),this._hoverInitiated=!1)}_onMutation(t){t.every(n=>n.type!=="attributes")?this.scheduleUpdate():this.startUpdateCycle()}};function Ga(e){let t={};for(let r of Object.keys(e))t[r]={value:e[r]};return Object.defineProperties({},t)}function lo(e=0,t=0,r=0,n=0){return{left:e,top:t,width:r,height:n,bottom:t+n,right:e+r}}function Kt(e){return e===document.documentElement?lo(0,0,e.clientWidth,e.clientHeight):e.getBoundingClientRect()}function Wa(e){return e.width*e.height}function ou(e){return e.height===0&&e.width===0}function au(e,t){return e.top===t.top&&e.left===t.left&&e.right===t.right&&e.bottom===t.bottom}var tn=class{constructor(t,r,n,o,a,i){Object.defineProperties(this,{boundingClientRect:{value:r},intersectionRatio:{value:o},intersectionRect:{value:Ga(n)},rootBounds:{value:Ga(a)},target:{value:t},time:{value:i}})}};var $a=lo();function Zm(e,t){let r=document.documentElement;return e!==r&&!r.contains(e)||!e.contains(t)}function ev(e,t){let r=Math.max(t.left,e.left),n=Math.min(t.right,e.right),o=Math.max(t.top,e.top),a=Math.min(t.bottom,e.bottom),i=n-r,l=a-o;return lo(r,o,i,l)}function tv(e,t,r,n){let o=n,a=t.parentNode,i=!1;for(;!i;){let l=null;a===e||a.nodeType!==1?(i=!0,l=r):window.getComputedStyle(a).overflow!=="visible"&&(l=Kt(a)),l&&(o=ev(o,l)),a=a.parentNode}return o}var rn=class{constructor(t,r){this.target=t,this.observer=r,this.prevTargetRect=$a,this.prevThreshold=0,this.prevRatio=0}updateIntersection(t,r){let n=Kt(this.target),o=this.getIntersectionData(t,r,n),a=+o.exists,i=o.ratio!==this.prevRatio,l=!au(n,this.prevTargetRect),c;if(o.exists&&!ou(n)&&(a=this.observer.getThresholdGreaterThan(o.ratio)),c=a!==this.prevThreshold,this.prevTargetRect=n,this.prevThreshold=a,this.prevRatio=o.ratio,o.exists||(o.ratio=0,o.rect=$a),c){let s=new tn(this.target,n,o.rect,o.ratio,r,_r());this.observer.queueEntry(s)}return{ratioChanged:i,thresholdChanged:c,targetRectChanged:l}}getIntersectionData(t,r,n){let o=this.target;n||(n=Kt(this.target)),r||(r=Kt(t));let a=Zm(t,o),i=a?$a:tv(t,o,r,n),l=!a&&i.width>=0&&i.height>=0,c=Wa(i)/Wa(n)||0;return{rect:i,ratio:c,exists:l}}};function rv(e=0){let t=e;return Array.isArray(e)?e.length||(t=[0]):t=[e],t.map(r=>{if(r=Number(r),window.isFinite(r)){if(r<0||r>1)throw new RangeError("Threshold values must be between 0 and 1.")}else throw new TypeError("The provided double value is non-finite.");return r}).sort()}function nv(e="0px"){if(e=(e+"").split(/\s+/),e.length>4)throw new Error("Extra text found at the end of rootMargin.");e[0]=e[0]||"0px",e[1]=e[1]||e[0],e[2]=e[2]||e[0],e[3]=e[3]||e[1];let t=e.join(" "),r=e.map(n=>{let[,o,a]=/^(-?\d*\.?\d+)(px|%)$/.exec(n)||[],i=a==="px";if(o=parseFloat(o),!window.isFinite(o))throw new Error("rootMargin must be specified in pixels or percent.");return i||(o/=100),{value:o,pixels:i}});return{rawData:t,parsedData:r}}function ov(e,t){t=t.map((n,o)=>{let a=n.value;return n.pixels||(a*=o%2?e.width:e.height),a});let r={top:e.top-t[0],right:e.right+t[1],bottom:e.bottom+t[2],left:e.left-t[3]};return r.width=r.right-r.left,r.height=r.bottom-r.top,r}var nn=class{constructor(t,r={},n,o){if(typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");if(typeof r!="object")throw new TypeError("parameter 2 is not an object.");if("root"in r&&!(r.root instanceof Element))throw new TypeError("member root is not of type Element.");let a=rv(r.threshold),i=nv(r.rootMargin);this.root=r.root||null,this.rootMargin=i.rawData,this.thresholds=Object.freeze(a),this._root=r.root||document.documentElement,this._callback=t,this._rootMargin=i.parsedData,this._targets=new tu,this._quedEntries=[],this._publicObserver=o||this,this.controller=n}observe(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(t instanceof Element))throw new TypeError('parameter 1 is not of type "Element".');let r=this._targets;r.has(t)||(r.set(t,new rn(t,this)),this.controller.isConnected(this)||this.controller.connect(this),this.controller.startUpdateCycle())}unobserve(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(t instanceof Element))throw new TypeError('parameter 1 is not of type "Element".');let r=this._targets;r.has(t)&&r.delete(t),r.size||this.disconnect()}disconnect(){this._targets.clear(),this.controller.disconnect(this)}takeRecords(){return this._quedEntries.splice(0)}notifySubscriber(){let t=this.takeRecords(),r=this._publicObserver;t.length&&this._callback.call(r,t,r)}queueEntry(t){this._quedEntries.push(t)}hasEntries(){return!!this._quedEntries.length}updateObservations(){let t=this._root,r=this.getRootRect(),n=!1;return this._targets.forEach(o=>{let a=o.updateIntersection(t,r);(a.ratioChanged||a.targetRectChanged)&&(n=!0)}),n}getThresholdGreaterThan(t){let r=this.thresholds,n=r.length,o=0;for(;o<n&&r[o]<=t;)++o;return o}getRootRect(){let t=Kt(this._root);return ov(t,this._rootMargin)}};var wr=new en,iu=new qa,uo=class{constructor(t,r){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");let n=new nn(t,r,wr,this);Object.defineProperties(this,{root:{value:n.root},thresholds:{value:n.thresholds},rootMargin:{value:n.rootMargin}}),iu.set(this,n)}static get idleTimeout(){return wr.idleTimeout}static set idleTimeout(t){if(typeof t!="number")throw new TypeError('type of "idleTimeout" value must be a number.');if(typeof t<0)throw new TypeError('"idleTimeout" value must be greater than 0.');wr.idleTimeout=t}static get trackHovers(){return wr.isHoverEnabled()}static set trackHovers(t){if(typeof t!="boolean")throw new TypeError('type of "trackHovers" value must be a boolean.');t?wr.enableHover():wr.disableHover()}};["observe","unobserve","disconnect","takeRecords"].forEach(e=>{uo.prototype[e]=function(){return iu.get(this)[e](...arguments)}});var su=uo;var Xa;typeof window.IntersectionObserver=="function"?Xa=window.IntersectionObserver:Xa=su;var Qt=Xa;var av=function(e){e.find("video.video-lazyload").each(function(){for(var t in this.children){var r=this.children[t];typeof r.tagName=="string"&&r.tagName==="SOURCE"&&r.dataset.src!=null&&(r.src=r.dataset.src)}this.setAttribute("preload","auto");try{this.load()}catch(n){console.log(err)}this.classList.remove("video-lazyload"),this.classList.add("loaded"),this.classList.contains("autoplay")&&this.setAttribute("autoplay","")})},iv=function(e){if(e.classList.contains("video-lazyload")){for(var t in e.children){var r=e.children[t];typeof r.tagName=="string"&&r.tagName==="SOURCE"&&r.dataset.src!=null&&(r.src=r.dataset.src)}e.setAttribute("preload","auto");try{e.load()}catch(n){console.log(n)}e.classList.remove("video-lazyload"),e.classList.add("loaded"),e.classList.contains("autoplay")&&e.setAttribute("autoplay","")}};function sv(t){var t=t,r=function(){var n=t.find("video.video-lazyload");if("IntersectionObserver"in window){var o=new Qt(function(a,i){a.forEach(function(l){if(l.isIntersecting){try{for(var c in l.target.children){var s=l.target.children[c];typeof s.tagName=="string"&&s.tagName==="SOURCE"&&s.dataset.src!=null&&(s.src=s.dataset.src)}l.target.setAttribute("preload","auto"),l.target.load()}catch(u){console.log(u)}l.target.classList.remove("video-lazyload"),l.target.classList.add("loaded"),l.target.classList.contains("autoplay")&&l.target.setAttribute("autoplay",""),o.unobserve(l.target)}})});n.each(function(){o.observe(this)})}};return{init:r}}var lv=function(e){var t=new sv(e);t.init()},uv={loadVideosInstantly:function(e){av(e)},initLazyLoadVideosOnScroll:function(e){lv(e)},loadSpecificVideo:function(e){iv(e)}},wt=uv;var Ya={isIOS:!1,isTouchDevice:!1},cv={initModule:function(){pv()}},lu=cv,fv=function(){jQuery(document).on("click",".lay-mute-unmute-button",function(e){e.stopPropagation(),e.preventDefault(),jQuery(this).toggleClass("unmuted");var t=jQuery(this.parentNode).find("video")[0];if(t.muted=!t.muted,jQuery(this.parentNode).hasClass("video-slide")&&t.muted==!1){var r=jQuery(this).closest(".lay-carousel").find(".lay-mute-unmute-button"),n=jQuery(this);r.each(function(){if(!jQuery(this).is(n)){jQuery(this).removeClass("unmuted");var o=jQuery(this.parentNode).find("video")[0];o.muted=!0}})}})},dv=function(){jQuery(".html5video video").each(function(){var t=this,r=jQuery(this.parentNode).find(".html5video-customplayicon"),n=jQuery(this.parentNode).find(".html5-video-placeholder-image");r.on("click",function(){jQuery(t).one("canplay",function(){this.play()}),wt.loadSpecificVideo(t),jQuery(t).addClass("userinteractedwith-playing"),jQuery(t).removeClass("userinteractedwith-paused"),jQuery(t).show(),jQuery(t)[0].play(),jQuery(this).hide(),n.hide()})}),jQuery(".html5video .html5-video-placeholder-image.playpauseonclick").each(function(){var t=jQuery(this.parentNode).find("video")[0],r=jQuery(this.parentNode).find(".html5video-customplayicon");jQuery(this).on("click",function(){jQuery(t).one("canplay",function(){this.play()}),wt.loadSpecificVideo(t),jQuery(t).addClass("userinteractedwith-playing"),jQuery(t).removeClass("userinteractedwith-paused"),jQuery(t).show(),jQuery(t)[0].play(),jQuery(this).hide(),r.hide()})});var e=".html5video video.playpauseonclick";jQuery(e).on("click",function(){this.paused?(jQuery(this).one("canplay",function(){this.play()}),wt.loadSpecificVideo(this),this.play(),jQuery(this.parentNode).find(".html5video-customplayicon").hide(),this.classList.add("userinteractedwith-playing"),jQuery(this).removeClass("userinteractedwith-paused")):(this.pause(),jQuery(this.parentNode).find(".html5video-customplayicon").show(),jQuery(this).removeClass("userinteractedwith-playing"),this.classList.add("userinteractedwith-paused"))})},hv=function(){frontendPassedData.video_thumbnail_mouseover_behaviour=="play_on_mouseover"&&(jQuery("body").on("mouseenter",".thumb-rel",function(){var e=jQuery(this).find("video");e.length>0&&(jQuery(e[0]).one("canplay",function(){this.play()}),wt.loadSpecificVideo(e[0]),e[0].play())}),jQuery("body").on("mouseleave",".thumb-rel",function(){var e=jQuery(this).find("video");e.length>0&&e[0].pause()}))},pv=function(){Ya.isIOS=/iPad|iPhone|iPod/.test(navigator.platform),Ya.isTouchDevice=navigator.userAgent.match(/(iPhone|iPod|iPad|Android|playbook|silk|BlackBerry|BB10|Windows Phone|Tizen|Bada|webOS|IEMobile|Opera Mini)/),window.laytheme.on("newpageshown",dv),Ya.isTouchDevice||hv(),fv()};var mv={getProjectLinkAttrs:function(e){return _v(e)},getCatId:function(e){return bv(e)},getCatLength:function(e){return ho(e)},showHideProjectArrows:function(e){uu(e)},maybeHideProjectArrowsOnInit:function(){gv()},initModule:function(){Tv()}},fo=mv,K={id:null,catid:null,type:null,projectsMeta:[]},De={$pa_next:null,$pa_prev:null,$body:null},vv=function(){K.catid=M.parseIdsString(De.$body.attr("data-catid")),K.id=De.$body.attr("data-id"),K.type=De.$body.attr("data-type")},Ka=function(e){e==null&&(e=jQuery("body")),jQuery("body").attr("data-type")=="project"&&(e.find('a[href="#laynextproject"], a.laynextproject').each(function(){var t=co("next");typeof t!="undefined"&&jQuery(this).attr({"data-type":"project",href:t.url,"data-catid":M.stringifyCatIds(t.catid),"data-id":t.id,"data-title":t.title})}),e.find('a[href="#layprevproject"], a.layprevproject').each(function(){var t=co("prev");typeof t!="undefined"&&jQuery(this).attr({"data-type":"project",href:t.url,"data-catid":M.stringifyCatIds(t.catid),"data-id":t.id,"data-title":t.title})}))},gv=function(){var e=jQuery("body").attr("data-type");if(e=="project"&&frontendPassedData.show_arrows=="on"){var t=ho(M.parseIdsString(jQuery("body").attr("data-catid")));t<=1&&jQuery(".project-arrow").addClass("hide")}e!="project"&&jQuery(".project-arrow").addClass("hide")},uu=function(){if(frontendPassedData.show_arrows=="on"){var e=jQuery("body").attr("data-type");if(e!="project"&&jQuery(".project-arrow").addClass("hide"),e=="project"){var t=ho(M.parseIdsString(jQuery("body").attr("data-catid")));t<=1?jQuery(".project-arrow").addClass("hide"):frontendPassedData.pa_type!="project-thumbnails"&&jQuery(".project-arrow").removeClass("hide")}e=="project"&&frontendPassedData.pa_type=="project-thumbnails"&&jQuery(".project-arrow").addClass("hide")}},yv=function(e){switch(frontendPassedData.prevnext_navigate_through){case"same_category":var n,o,a=K.id,t=K.catid,r=Ja(t);if(typeof K.projectsMeta[r]=="undefined")return 0;var i=K.projectsMeta[r].length;for(o=0;o<i;o++)if(a==K.projectsMeta[r][o].id){n=o;break}return e=="next"?(n++,n==i&&(n=0)):e=="prev"&&(n--,n<0&&(n=i-1)),n;break;case"all_projects":var n,o,a=K.id,i=K.projectsMeta.length;for(o=0;o<i;o++)if(a==K.projectsMeta[o].id){n=o;break}return e=="next"?(n++,n==i&&(n=0)):e=="prev"&&(n--,n<0&&(n=i-1)),n;break}},_v=function(e){if(typeof obj!="undefined")return'href="'+obj.url+'" data-catid="'+obj.catid+'" data-id="'+obj.id+'" data-title="'+obj.title+'" data-type="project"'},co=function(e){var t=yv(e);if(jQuery.isNumeric(t))switch(frontendPassedData.prevnext_navigate_through){case"same_category":var r=K.catid,n=Ja(r);if(typeof n!="undefined")return{title:K.projectsMeta[n][t].title,url:K.projectsMeta[n][t].url,id:K.projectsMeta[n][t].id,catid:K.projectsMeta[n][t].catid,thumb:K.projectsMeta[n][t].thumb,thumbar:K.projectsMeta[n][t].thumbar};break;case"all_projects":return{title:K.projectsMeta[t].title,url:K.projectsMeta[t].url,id:K.projectsMeta[t].id,catid:K.projectsMeta[t].catid,thumb:K.projectsMeta[t].thumb,thumbar:K.projectsMeta[t].thumbar}}};var wv=function(){if(frontendPassedData.show_arrows=="on"&&De.$body.attr("data-type")=="project"){var e=co("next"),t=co("prev");if(typeof e!="undefined"&&De.$pa_next.attr({"data-title":e.title,"data-catid":M.stringifyCatIds(e.catid),"data-id":e.id,href:e.url}),typeof t!="undefined"&&De.$pa_prev.attr({"data-title":t.title,"data-catid":M.stringifyCatIds(t.catid),"data-id":t.id,href:t.url}),frontendPassedData.pa_type=="project-thumbnails"){if(typeof e!="undefined"){var r='<img src="'+e.thumb._512+'" alt="">';De.$pa_next.html('<div class="pa-thumb-wrap" style="padding-bottom:'+e.thumbar*100+'%;">'+r+"</div>")}if(typeof t!="undefined"){var n='<img src="'+t.thumb._512+'" alt="">';De.$pa_prev.html('<div class="pa-thumb-wrap" style="padding-bottom:'+t.thumbar*100+'%;">'+n+"</div>")}if(frontendPassedData.prevnext_navigate_through=="same_category"){var o=ho(K.catid);o>1&&(De.$pa_next.removeClass("hide"),De.$pa_prev.removeClass("hide"))}else De.$pa_next.removeClass("hide"),De.$pa_prev.removeClass("hide")}}},ho=function(e){if(typeof e!="undefined"&&e!="")if(frontendPassedData.prevnext_navigate_through=="same_category"){var t=Ja(e);return K.projectsMeta[t].length}else return K.projectsMeta.length},bv=function(e){var t=[];switch(frontendPassedData.prevnext_navigate_through){case"same_category":for(var r in K.projectsMeta)for(var n=0;n<K.projectsMeta[r].length;n++)K.projectsMeta[r][n].id==e&&t.push(r);break;case"all_projects":for(var n=0;n<K.projectsMeta.length;n++)e==K.projectsMeta[n].id&&t.push(K.projectsMeta[n].catid);break}return t},Ja=function(e){return Array.isArray(e)?e[0]:e},xv=function(){De.$pa_next=jQuery(".pa-next"),De.$pa_prev=jQuery(".pa-prev"),De.$body=jQuery("body")},Tv=function(){xv(),K.projectsMeta=JSON.parse(frontendPassedData.projectsMeta),window.laytheme.on("newpageshown",function(){uu(),vv(),wv(),Ka()})};var Ev={initModule:function(){Av()}},Av=function(){cu(),Ye.newsMeta=JSON.parse(frontendPassedData.newsMeta),window.laytheme.on("newpageshown",function(){cu(),Za()})},du=Ev,Ye={id:null,catid:null,type:null,newsMeta:[]},cu=function(){Ye.catid=M.parseIdsString(jQuery("body").attr("data-catid")),Ye.id=jQuery("body").attr("data-id"),Ye.type=jQuery("body").attr("data-type")},Iv=function(e){var t,r,n=Ye.id,o=Ye.newsMeta.length;for(r=0;r<o;r++)if(n==Ye.newsMeta[r].id){t=r;break}return e=="next"?(t++,t==o&&(t=0)):e=="prev"&&(t--,t<0&&(t=o-1)),t},fu=function(e){var t=Iv(e);if(jQuery.isNumeric(t))return{title:Ye.newsMeta[t].title,url:Ye.newsMeta[t].url,id:Ye.newsMeta[t].id,catid:Ye.newsMeta[t].catid,thumb:Ye.newsMeta[t].thumb,thumbar:Ye.newsMeta[t].thumbar}},Za=function(e){e==null&&(e=jQuery("body")),jQuery("body").attr("data-type")=="lay_news"&&(e.find('a[href="#laynextproject"], a.laynextproject').each(function(){var t=fu("next");typeof t!="undefined"&&jQuery(this).attr({"data-type":"news",href:t.url,"data-catid":M.stringifyCatIds(t.catid),"data-id":t.id,"data-title":t.title})}),e.find('a[href="#layprevproject"], a.layprevproject').each(function(){var t=fu("prev");typeof t!="undefined"&&jQuery(this).attr({"data-type":"news",href:t.url,"data-catid":M.stringifyCatIds(t.catid),"data-id":t.id,"data-title":t.title})}))};var Cv={initModule:function(){on.$htmlbody=jQuery("html, body"),window.laytheme.on("newpageshown",Sv)}},hu=Cv,on={$htmlbody:null},Sv=function(){jQuery(".scrolltotop").on("click",function(e){e.preventDefault(),e.stopPropagation(),jQuery("html").hasClass("fp-enabled")?jQuery.fn.fullpage.moveTo(1,0):(on.$htmlbody.animate({scrollTop:0},600,"easeOutQuint",function(){on.$htmlbody.off("scroll wheel DOMMouseScroll mousewheel touchmove")}),on.$htmlbody.on("scroll wheel DOMMouseScroll mousewheel touchmove",function(){on.$htmlbody.stop()}))})};var ei=20,an=[],Oe=function(e){this.identifier=e,this.$nav_el=jQuery("nav."+e),this.suffix=e=="primary"?"":"_"+e,this.nav_hide=frontendPassedData.nav_customizer_properties["nav_hide"+this.suffix],this.nav_hidewhenscrollingdown=frontendPassedData.nav_customizer_properties["nav_hidewhenscrollingdown"+this.suffix],this.nav_fadeout_whenscrollingdown=frontendPassedData.nav_customizer_properties["nav_fadeout_whenscrollingdown"+this.suffix],this.max_translate_bottom=-1,this.max_translate_top=-1,this.nav_hidewhenscrolling_show_on_mouseover=frontendPassedData.nav_customizer_properties["nav_hidewhenscrolling_show_on_mouseover"+this.suffix],this.nav_position=frontendPassedData.nav_customizer_properties["nav_position"+this.suffix],this.rect=null,this.height_and_space_around=null,this.set_height_and_space_around()};Oe.prototype.setRect=function(){this.rect=this.$nav_el[0].getBoundingClientRect()};Oe.prototype.set_height_and_space_around=function(){this.setRect(),this.height_and_space_around=this.$nav_el.outerHeight(),this.nav_position.indexOf("top")!=-1?this.height_and_space_around+=this.rect.top:this.height_and_space_around+=window.innerHeight-this.rect.bottom,this.height_and_space_around+=ei};Oe.prototype.show_on_mouseover=function(e){this.nav_hidewhenscrolling_show_on_mouseover&&this.nav_position.indexOf(e)!=-1&&this.show()};Oe.prototype.show=function(){this.nav_hidewhenscrollingdown&&!this.nav_hide&&(window.lay_lightbox_opened==!1||typeof window.lay_lightbox_opened=="undefined")&&this.$nav_el.hasClass("hidden")&&this.$nav_el.removeClass("hidden").css({transform:"",opacity:"","pointer-events":""}),this.nav_fadeout_whenscrollingdown&&!this.nav_hide&&(window.lay_lightbox_opened==!1||typeof window.lay_lightbox_opened=="undefined")&&this.$nav_el.hasClass("hidden")&&this.$nav_el.removeClass("hidden").css({transform:"",opacity:"","pointer-events":""})};Oe.prototype.hide=function(){if((this.nav_fadeout_whenscrollingdown||this.nav_hidewhenscrollingdown)&&g.isDesktopOrTabletSize&&!this.nav_hide){if(this.nav_fadeout_whenscrollingdown&&(this.$nav_el.hasClass("hidden")||this.$nav_el.css({opacity:0,"pointer-events":"none"})),this.setRect(),this.nav_hidewhenscrollingdown&&!this.$nav_el.hasClass("hidden")){var e=0;if(this.nav_position.indexOf("center")!=-1&&(e="-50%"),this.nav_position.indexOf("top")!=-1){var t=this.rect.bottom+ei;t>this.max_translate_top?this.max_translate_top=t:t=this.max_translate_top,this.$nav_el.css("transform","translate("+e+",-"+t+"px)")}else{var t=window.innerHeight-this.rect.top+ei;t>this.max_translate_bottom?this.max_translate_bottom=t:t=this.max_translate_bottom,this.$nav_el.css("transform","translate("+e+","+t+"px)")}}this.$nav_el.addClass("hidden")}};var Mv=function(){switch(parseInt(frontendPassedData.nav_amount,10)){case 1:var e=new Oe("primary");an=[e];break;case 2:var e=new Oe("primary"),t=new Oe("second_menu");an=[e,t];break;case 3:var e=new Oe("primary"),t=new Oe("second_menu"),r=new Oe("third_menu");an=[e,t,r];break;case 4:var e=new Oe("primary"),t=new Oe("second_menu"),r=new Oe("third_menu"),n=new Oe("fourth_menu");an=[e,t,r,n];break}};jQuery(document).ready(function(){Mv()});var Pv=function(){return an},Jt=Pv;var jv=Backbone.Radio.channel("events"),Rv={initModule:function(){Nv()},showAll:function(){mu()},hideAll:function(){Bv()},setJqueryMap:function(){pu()},hideSt:function(){vo()},hideNav:function(){go()},hideNavBar:function(){ti()},showSt:function(){Zt()},getStPos:function(){return kv()}},sn=Rv,Nt={safetyOffset:20,scrollThreshold:50},P={oldScrollY:0,stheight:0,st_pos:"top",st_hidewhenscrollingdown:!1,st_fadeout_whenscrollingdown:!1,st_exists:!0,navbar_exists:!0,navbar_hidewhenscrollingdown:!1,navbar_fadeout_whenscrollingdown:!1,mouseover_target_area_bottom:0,mouseover_target_area_top:0},me={$navbar:null,$st:null},kv=function(){return P.st_pos},Zt=function(){(P.st_hidewhenscrollingdown||P.st_fadeout_whenscrollingdown)&&P.st_exists&&(window.lay_lightbox_opened==!1||typeof window.lay_lightbox_opened=="undefined")&&me.$st.hasClass("hidden")&&me.$st.removeClass("hidden").css({transform:"","pointer-events":"",opacity:""})},vo=function(){if((P.st_hidewhenscrollingdown||P.st_fadeout_whenscrollingdown)&&g.isDesktopOrTabletSize&&P.st_exists&&!me.$st.hasClass("hidden")){if(P.st_hidewhenscrollingdown){var e=me.$st[0].getBoundingClientRect(),t=0;if(frontendPassedData.st_position.indexOf("center")!=-1&&(t="-50%"),P.st_pos=="top"){var r=e.bottom+Nt.safetyOffset;me.$st.css("transform","translate("+t+",-"+r+"px)")}else if(P.st_pos=="bottom"){var r=window.innerHeight-e.top+Nt.safetyOffset;me.$st.css("transform","translate("+t+","+r+"px)")}}P.st_fadeout_whenscrollingdown&&me.$st.css({opacity:0,"pointer-events":"none"}),me.$st.addClass("hidden")}},Dv=function(){jv.on("scroll",function(){var e=window.scrollY;e>0&&e<document.documentElement.scrollHeight-window.innerHeight&&g.isDesktopOrTabletSize&&(e>P.oldScrollY&&e>Nt.scrollThreshold&&(P.startedScrollingUpY=e,go(),vo(),ti()),e<P.oldScrollY&&e<P.startedScrollingUpY-Nt.scrollThreshold/2&&(po(),Zt(),br()),e<Nt.scrollThreshold&&(po(),Zt(),br()),P.oldScrollY=e)}),jQuery(window).on("fpOnLeave",function(e,t){switch(t.direction){case"up":po(),Zt(),br();break;case"down":go(),vo(),ti();break}})},go=function(){for(var e=Jt(),t=0;t<e.length;t++)e[t].hide()},po=function(){for(var e=Jt(),t=0;t<e.length;t++)e[t].show()},pu=function(){P.navbar_exists&&(me.$navbar=jQuery(".navbar")),P.st_exists&&(me.$st=jQuery(".sitetitle"))},ti=function(){if(P.navbar_exists&&(P.navbar_hidewhenscrollingdown||P.navbar_fadeout_whenscrollingdown)&&g.isDesktopOrTabletSize&&!me.$navbar.hasClass("hidden")){if(P.navbar_hidewhenscrollingdown){var e=me.$navbar[0].getBoundingClientRect();if(frontendPassedData.navbar_position=="top"){var t=e.height+Nt.safetyOffset;me.$navbar.css("transform","translateY("+-t+"px)")}else if(frontendPassedData.navbar_position=="bottom"){var t=e.height+Nt.safetyOffset;me.$navbar.css("transform","translateY("+t+"px)")}}P.navbar_fadeout_whenscrollingdown&&me.$navbar.css({opacity:0,"pointer-events":"none"}),me.$navbar.addClass("hidden")}},br=function(){P.navbar_exists&&(P.navbar_hidewhenscrollingdown||P.navbar_fadeout_whenscrollingdown)&&(window.lay_lightbox_opened==!1||typeof window.lay_lightbox_opened=="undefined")&&me.$navbar.removeClass("hidden").css({transform:"","pointer-events":"",opacity:"1"})},mo=function(){if(P.stheight=0,P.st_exists&&(P.st_hidewhenscrollingdown||P.st_fadeout_whenscrollingdown)){var e=me.$st.outerHeight();P.st_pos=="top"||P.st_pos=="center"?e+=me.$st[0].getBoundingClientRect().top:P.st_pos=="bottom"&&(e+=window.innerHeight-me.$st[0].getBoundingClientRect().bottom),e+=Nt.safetyOffset,P.stheight=e}},Ov=function(){jQuery(window).on("window_width_changed",_.debounce(function(){mo();for(var e=Jt(),t=0;t<e.length;t++)e[t].set_height_and_space_around()},300))},Lv=function(){jQuery(window).on("mousemove",_.throttle(function(e){if(g.isDesktopOrTabletSize){var t=Jt();if(e.clientY<=P.mouseover_target_area_top){for(var r=0;r<t.length;r++)t[r].show_on_mouseover("top");P.st_pos=="top"&&Zt(),frontendPassedData.navbar_position=="top"&&br()}if(e.clientY>=window.innerHeight-P.mouseover_target_area_bottom){for(var r=0;r<t.length;r++)t[r].show_on_mouseover("bottom");P.st_pos=="bottom"&&Zt(),frontendPassedData.navbar_position=="bottom"&&br()}}},100))},Fv=function(){var e=0;P.st_pos=="top"&&(e=P.stheight);for(var t=Jt(),r=0;r<t.length;r++)if(t[r].nav_position.indexOf("top")!=-1){var n=t[r].height_and_space_around;n>e&&(e=n)}if(frontendPassedData.navbar_position=="top"&&P.navbar_exists){var o=me.$navbar.height();e=e<o?o:e}P.mouseover_target_area_top=e},Qv=function(){var e=0;P.st_pos=="bottom"&&(e=P.stheight);for(var t=Jt(),r=0;r<t.length;r++)if(t[r].nav_position.indexOf("bottom")!=-1){var n=t[r].height_and_space_around;n>e&&(e=n)}if(frontendPassedData.navbar_position=="bottom"&&P.navbar_exists){var o=me.$navbar.height();e=e<o?o:e}P.mouseover_target_area_bottom=e},Nv=function(){if(frontendPassedData.st_position.indexOf("top")!=-1?P.st_pos="top":frontendPassedData.st_position.indexOf("bottom")!=-1?P.st_pos="bottom":P.st_pos="center",frontendPassedData.st_hidewhenscrollingdown==1?P.st_hidewhenscrollingdown=!0:P.st_hidewhenscrollingdown=!1,frontendPassedData.st_fadeout_whenscrollingdown==1?P.st_fadeout_whenscrollingdown=!0:P.st_fadeout_whenscrollingdown=!1,frontendPassedData.st_hide==1?P.st_exists=!1:P.st_exists=!0,frontendPassedData.navbar_hide==1?P.navbar_exists=!1:P.navbar_exists=!0,frontendPassedData.navbar_fadeout_whenscrollingdown==1?P.navbar_fadeout_whenscrollingdown=!0:P.navbar_fadeout_whenscrollingdown=!1,frontendPassedData.navbar_hidewhenscrollingdown==1?P.navbar_hidewhenscrollingdown=!0:P.navbar_hidewhenscrollingdown=!1,pu(),mo(),Dv(),Ov(),Lv(),Fv(),Qv(),jQuery(".sitetitle").hasClass("img")){var e=jQuery(".sitetitle img")[0];e.complete?mo():e.onload=function(){mo()}}window.laytheme.on("newpageshown",function(){mu()})},Bv=function(){go(),vo(),typeof hideNavBar=="function"&&hideNavBar()},mu=function(){po(),Zt(),br()};var zv={initModule:function(){qv()}},vu=zv,xr=0,se={$body:null,$nav:null,$st:null},Uv=function(){se.$body=jQuery("body"),se.$nav=jQuery("nav.primary"),se.$nav2=jQuery("nav.second_menu"),se.$nav3=jQuery("nav.third_menu"),se.$nav4=jQuery("nav.fourth_menu"),se.$st=jQuery(".sitetitle")},Vv=function(){xr=parseInt(frontendPassedData.maxwidth,10),Uv(),Hv(),gu()},Hv=function(){jQuery(window).on("window_width_changed",gu)},gu=function(){var e=se.$body.innerWidth(),t=frontendPassedData.nav_customizer_properties,r=parseFloat(frontendPassedData.frame_left),n=parseFloat(frontendPassedData.frame_right);if(frontendPassedData.frame_leftright_mu=="%"&&(r=xr/100*r,n=xr/100*n),e>xr&&g.isDesktopOrTabletSize){var o=(e-xr)/2+r,a=(e-xr)/2+n;frontendPassedData.st_position.indexOf("left")!=-1?se.$st.css("left",o+"px"):frontendPassedData.st_position.indexOf("right")!=-1&&se.$st.css("right",a+"px"),t.nav_position.indexOf("left")!=-1?se.$nav.css("left",o+"px"):t.nav_position.indexOf("right")!=-1&&se.$nav.css("right",a+"px"),frontendPassedData.nav_amount>=2&&(t.nav_position_second_menu.indexOf("left")!=-1?se.$nav2.css("left",o+"px"):t.nav_position_second_menu.indexOf("right")!=-1&&se.$nav2.css("right",a+"px")),frontendPassedData.nav_amount>=3&&(t.nav_position_third_menu.indexOf("left")!=-1?se.$nav3.css("left",o+"px"):t.nav_position_third_menu.indexOf("right")!=-1&&se.$nav3.css("right",a+"px")),frontendPassedData.nav_amount>=4&&(t.nav_position_fourth_menu.indexOf("left")!=-1?se.$nav4.css("left",o+"px"):t.nav_position_fourth_menu.indexOf("right")!=-1&&se.$nav4.css("right",a+"px"))}else frontendPassedData.st_position.indexOf("left")!=-1?se.$st.css("left",""):frontendPassedData.st_position.indexOf("right")!=-1&&se.$st.css("right",""),t.nav_position.indexOf("left")!=-1?se.$nav.css("left",""):t.nav_position.indexOf("right")!=-1&&se.$nav.css("right",""),frontendPassedData.nav_amount>=2&&(t.nav_position_second_menu.indexOf("left")!=-1?se.$nav2.css("left",""):t.nav_position_second_menu.indexOf("right")!=-1&&se.$nav2.css("right","")),frontendPassedData.nav_amount>=3&&(t.nav_position_third_menu.indexOf("left")!=-1?se.$nav3.css("left",""):t.nav_position_third_menu.indexOf("right")!=-1&&se.$nav3.css("right","")),frontendPassedData.nav_amount>=4&&(t.nav_position_fourth_menu.indexOf("left")!=-1?se.$nav4.css("left",""):t.nav_position_fourth_menu.indexOf("right")!=-1&&se.$nav4.css("right",""))},qv=function(){frontendPassedData.misc_options_max_width_apply_to_logo_and_nav=="on"&&frontendPassedData.maxwidth!=0&&Vv()};var yu=Backbone.Radio.channel("events"),Gv={initModule:function(){frontendPassedData.mobile_menu_style!="style_desktop_menu"&&Zv()},hideMenu:function(){frontendPassedData.mobile_menu_style!="style_desktop_menu"&&_o()},hideMobileMenu:function(){frontendPassedData.mobile_menu_style!="style_desktop_menu"&&Tr()}},bt=Gv,jt={wWidth:window.innerWidth,oldInnerWidth:window.innerWidth,isOpen:!1},le={$nav:null,$navul:null,$burger:null},Wv=function(){switch(frontendPassedData.mobile_burger_type){case"default":case"default_thin":jQuery(".burger-wrap-default").on("click",_u);break;case"new":jQuery(".burger-wrap-new").on("click",_u);break;case"custom":jQuery(".burger-custom-wrap-close").on("click",function(){le.$nav.hasClass("active")&&_o()}),jQuery(".burger-custom-wrap-open").on("click",function(){le.$nav.hasClass("active")||wu()});break}},wu=function(){switch(le.$nav.addClass("active"),jQuery("body").addClass("mobile-menu-open").removeClass("lay-hide-phone-menu"),jt.isOpen=!0,frontendPassedData.mobile_menu_style){case"style_1":var e=0;frontendPassedData.mobile_hide_menubar!="1"&&(e=jQuery(".navbar")[0].getBoundingClientRect().height),jQuery("body").addClass("animate-mobile-menu"),le.$nav.on("transitionend",function(){jQuery("body").removeClass("animate-mobile-menu")}),le.$nav.css({transform:"translateY("+e+"px)","-webkit-transform":"translateY("+e+"px)",top:0});break;case"style_2":break;case"style_3":var e=0;frontendPassedData.mobile_hide_menubar!="1"&&(e=jQuery(".navbar")[0].getBoundingClientRect().height);var t=e;frontendPassedData.woocommerce_active&&jQuery(".woocommerce-store-notice").length>0&&jQuery(".woocommerce-store-notice").is(":visible")&&(t+=jQuery(".woocommerce-store-notice").outerHeight()),le.$nav.css({height:"calc(100vh - "+e+"px)",top:t+"px"});break}},_u=function(){if(le.$nav.hasClass("active"))_o();else{switch(frontendPassedData.mobile_burger_type){case"new":case"default":case"default_thin":frontendPassedData.mobile_menu_style!="style_2"&&le.$burger.addClass("active");break}wu()}},$v=function(){jQuery(window).on("resize orientationchange",function(){jt.oldInnerWidth=jt.wWidth,jt.wWidth=window.innerWidth,g.isDesktopOrTabletSize?jt.oldInnerWidth<=g.breakpoint&&(Xv(),le.$nav.css({transform:"","-webkit-transform":""}),le.$nav.removeClass("active transition"),frontendPassedData.mobile_menu_style!="style_2"&&le.$burger.removeClass("active"),jQuery("body").removeClass("mobile-menu-open")):(jt.oldInnerWidth>g.breakpoint&&(le.$nav.hasClass("active")||_o(),sn.showAll()),bu())})},bu=function(){if(!g.isDesktopOrTabletSize)switch(frontendPassedData.mobile_menu_style){case"style_1":var e=jQuery(".navbar").outerHeight(),t=window.innerHeight-e;le.$nav.css("max-height",t+"px");break;case"style_2":var t=window.innerHeight;le.$nav.css("max-height",t+"px");break}},Xv=function(){g.isDesktopOrTabletSize&&le.$nav.css("max-height","")},_o=function(){jt.isOpen=!1,g.isPhoneSize?Tr():(frontendPassedData.mobile_menu_style!="style_2"&&le.$burger.removeClass("active"),jQuery("body").removeClass("mobile-menu-open"),le.$nav.removeClass("active").css({transform:"","-webkit-transform":""}))},Tr=function(){if(g.isPhoneSize)switch(jt.isOpen=!1,le.$nav.removeClass("active"),jQuery("body").removeClass("mobile-menu-open"),frontendPassedData.mobile_menu_style!="style_2"&&le.$burger.removeClass("active"),frontendPassedData.mobile_menu_style){case"style_1":var e=le.$navul.outerHeight();e*=-1;var t=jQuery(".navbar").outerHeight();e-=t,jQuery("body").addClass("animate-mobile-menu"),le.$nav.on("transitionend",function(){jQuery("body").removeClass("animate-mobile-menu")}),le.$nav.css({transform:"translateY("+e+"px)","-webkit-transform":"translateY("+e+"px)"});break;case"style_2":break;case"style_3":le.$nav.css({height:""});break}},Yv=function(){le.$nav=jQuery("nav.mobile-nav"),le.$navul=le.$nav.find("ul"),le.$burger=jQuery(".burger-default, .burger-new")},Kv=function(){jQuery("nav.mobile-nav a").on("dragstart",function(e){e.preventDefault()})},yo,ln,ri,Jv=function(){if(frontendPassedData.mobile_navbar_fixed!="")switch(yo=jQuery(".woocommerce-store-notice"),ln=jQuery(".mobile-nav"),ri=jQuery(".navbar"),frontendPassedData.mobile_menu_style){case"style_1":yo.length>0&&ln.length>0&&ri.length>0&&yu.on("scroll",function(){if(jt.isOpen){var e=ri[0].getBoundingClientRect(),t=e.bottom;ln.css("transform","translateY("+t+"px)")}});break;case"style_2":break;case"style_3":yo.length>0&&ln.length>0&&yu.on("scroll",function(){var e=yo[0].getBoundingClientRect(),t=window.scrollY;t>=e.height&&(t=e.height),ln.css("transform","translateY(-"+t+"px)")});break}},Zv=function(){Kv(),Yv(),Jv(),$v(),Wv(),bu(),WebFont.load({custom:{families:frontendPassedData.m_st_fontfamily},active:function(){Tr()},classes:!1}),Tr(),setTimeout(function(){jQuery("body").addClass("mobile-menu-animation-possible")},0),jQuery(document).ready(function(){setTimeout(function(){window.laytheme.on("newpage",Tr)},100)}),window.laytheme.on("searchshown",Tr)};var eg={maybeReload:function(e){return tg(e)}},xu=eg,tg=function(e){var t=e;if(t==null)return!1;var r=t.id,n=t.type,o=!1;switch(n){case"project":var a=frontendPassedData.footer_active_in_projects;if(a=="all")o=frontendPassedData.projectsFooterId;else if(a=="individual"&&frontendPassedData.individual_project_footers!=""){var i=JSON.parse(frontendPassedData.individual_project_footers);_.isObject(i)&&typeof i[r]!="undefined"&&(o=i[r])}break;case"page":var l=frontendPassedData.footer_active_in_pages;if(l=="all")o=frontendPassedData.pagesFooterId;else if(l=="individual"&&frontendPassedData.individual_page_footers!=""){var i=JSON.parse(frontendPassedData.individual_page_footers);_.isObject(i)&&typeof i[r]!="undefined"&&(o=i[r])}break;case"category":var c=frontendPassedData.footer_active_in_categories;if(c=="all")o=frontendPassedData.categoriesFooterId;else if(c=="individual"&&frontendPassedData.individual_category_footers!=""){var i=JSON.parse(frontendPassedData.individual_category_footers);_.isObject(i)&&typeof i[r]!="undefined"&&(o=i[r])}break}var s=frontendPassedData.shortcodes;if(jQuery.isArray(s)&&o!=!1)for(var u=0;u<s.length;u++){var f=s[u];if(f.info.type=="post"&&f.info.id==o)return!0}if((n=="project"||n=="page")&&(n="post"),jQuery.isArray(s)){for(var u=0;u<s.length;u++)if(s[u].info.type==n&&s[u].info.id==r)return!0}return!1};var Tu=function(e){var t=!1,r=!1;return jQuery(".lay-overlay").each(function(){var n=M.filterURL(jQuery(this).attr("data-link"));e==n&&(t=!0),jQuery(this).attr("data-disable-scroll")=="on"&&(r=!0)}),xt(e),t&&(r&&M.fixBody(),setTimeout(function(){jQuery('.lay-overlay[data-link="'+e+'"]').one("transitionend",function(){typeof window.layCarouselFadeCarousel!="undefined"&&typeof window.layCarouselFadeCarousel.loadFirstLazyImage!="undefined"&&window.layCarouselFadeCarousel.loadFirstLazyImage(jQuery(this))}),jQuery('.lay-overlay[data-link="'+e+'"]').addClass("lay-show-overlay"),jQuery('.lay-overlay-bg[data-link="'+e+'"]').addClass("lay-show-overlay-bg"),jQuery("body").addClass("lay-overlay-open")},0)),t},rg=function(){jQuery(document).on("click",".lay-overlay-bg",function(){xt()}),jQuery(document).on("click",".overlay-close",function(){xt()})},ng=function(e){switch(e.which){case 27:M.unfixBody(),setTimeout(function(){xt()},0);break}},xt=function(e){M.unfixBody(),setTimeout(function(){e?(jQuery(".lay-overlay.lay-show-overlay").each(function(){jQuery(this).attr("data-link")!=e&&(this.classList.contains("lay-fade")&&(g.isDesktopSize||g.isTabletSize)||this.classList.contains("lay-phone-fade")&&g.isPhoneSize?(jQuery(this).one("animationend",function(){this.classList.remove("lay-fadeout"),this.classList.remove("lay-show-overlay"),jQuery(this).find(".lay-content")[0].scrollTop=0}),this.classList.add("lay-fadeout")):this.classList.contains("lay-none")&&(g.isDesktopSize||g.isTabletSize)||this.classList.contains("lay-phone-none")&&g.isPhoneSize?(jQuery(this).find(".lay-content")[0].scrollTop=0,jQuery(this).removeClass("lay-show-overlay")):(jQuery(this).one("transitionend",function(){jQuery(this).find(".lay-content")[0].scrollTop=0}),jQuery(this).removeClass("lay-show-overlay")))}),jQuery(".lay-overlay-bg.lay-show-overlay-bg").each(function(){jQuery(this).attr("data-link")!=e&&jQuery(this).removeClass("lay-show-overlay-bg")}),jQuery(".lay-overlay.lay-show-overlay").length>0&&jQuery("body").removeClass("lay-overlay-open")):(jQuery(".lay-overlay.lay-show-overlay").each(function(){this.classList.contains("lay-fade")&&(g.isDesktopSize||g.isTabletSize)||this.classList.contains("lay-phone-fade")&&g.isPhoneSize?(jQuery(this).one("animationend",function(){this.classList.remove("lay-fadeout"),this.classList.remove("lay-show-overlay")}),this.classList.add("lay-fadeout")):this.classList.contains("lay-none")&&(g.isDesktopSize||g.isTabletSize)||this.classList.contains("lay-phone-none")&&g.isPhoneSize?(jQuery(this).find(".lay-content")[0].scrollTop=0,jQuery(this).removeClass("lay-show-overlay")):(jQuery(this).one("transitionend",function(){jQuery(this).find(".lay-content")[0].scrollTop=0}),jQuery(this).removeClass("lay-show-overlay"))}),jQuery(".lay-overlay-bg").removeClass("lay-show-overlay-bg"),jQuery("body").removeClass("lay-overlay-open")),jQuery(".lay-overlay.lay-show-overlay").each(function(){og(jQuery(this))})},0)},og=function(e){typeof e!="undefined"&&(e.find("iframe[src^='//player.vimeo.com/']").each(function(){if(typeof Vimeo!="undefined"){var t=new Vimeo.Player(this);t.pause()}}),e.find("iframe[src^='//www.youtube.com']").each(function(){var t=jQuery(this).data("ytplayer");typeof t=="undefined"&&window.youtubeApiReady?(t=new YT.Player(this,{events:{onReady:function(r){r.target.stopVideo()}}}),jQuery(this).data("ytplayer",t)):typeof t!="undefined"&&typeof t.stopVideo=="function"&&t.stopVideo()}),e.find("video").each(function(){this.pause()}))},ag=function(){document.addEventListener("keydown",ng)},ig=function(){window.laytheme.on("newpageshown",function(){sg()})},sg=function(){jQuery(".lay-overlay a").removeClass("current-link");var e=jQuery("body").attr("data-id"),t=jQuery("body").attr("data-type"),r=jQuery('.lay-overlay a[data-id="'+e+'"][data-type="'+t+'"]');r.length!=0&&r.each(function(){this.classList.add("current-link")});var n=M.parseIdsString(jQuery("body").attr("data-catid"));Array.isArray(n)||(n=[n]);for(var o=0;o<n.length;o++){var a=n[o],r=jQuery('.lay-overlay a[data-catid="'+a+'"][data-type="category"]');r.length!=0&&r.each(function(){this.classList.add("current-link")})}},Eu=function(){rg(),ag(),ig()};var Au=function(){jQuery(document).on("click",'a[data-type]:not([target="_blank"])',function(e){if(jQuery(this.parentNode).hasClass("laycart")&&frontendPassedData.sideCartPluginActive==!0){e.preventDefault(),e.stopPropagation();return}var t=jQuery(this),r=t.attr("href");r=M.filterURL(r);var n=Tu(r);if(n){e.preventDefault(),e.stopPropagation();return}else{if(frontendPassedData.is_customize||window.navigator.userAgent.indexOf("Instagram")!=-1)return;if(jQuery("body").attr("data-type")==jQuery(this).attr("data-type")&&jQuery("body").attr("data-id")==jQuery(this).attr("data-id"))e.preventDefault(),bt.hideMobileMenu();else if(jQuery(this).attr("data-type")!="custom"&&!e.metaKey&&!e.ctrlKey){e.preventDefault();var o=passedDataHistory.title,a=t.attr("data-title");typeof a!="undefined"&&a!=""&&(o=passedDataHistory.titleprefix+_.unescape(t.attr("data-title")));var i=M.parseIdsString(t.attr("data-catid"));frontendPassedData.misc_options_disable_ajax!="on"?Er.pushState({type:t.attr("data-type"),id:t.attr("data-id"),catid:i},o,r):window.location.href=r}}})};var Ke={animationTimer:null,animationInterval:null,animDur:300},lg=function(){Ke.animationTimer=0,clearInterval(Ke.animationInterval),Ke.animationInterval=setInterval(function(){Ke.animationTimer+=50,Ke.animationTimer>=Ke.animDur&&(window.laytheme.trigger("content_fadeout_transition_ended"),clearInterval(Ke.animationInterval))},50)},ug=function(){return clearInterval(Ke.animationInterval),Ke.animationTimer>=Ke.animDur||wo?0:Ke.animDur-Ke.animationTimer},cg=function(){Ke.animDur=parseInt(frontendPassedData.navigation_transition_duration,10)/2,window.laytheme.on("transition_navigation_in_started",function(){wo=!1}),window.laytheme.on("transition_navigation_out_completed",function(){wo=!0})},wo=!1,bo={initModule:function(){cg()},startTimer:function(){lg()},hasElementTransitionEnded:function(){return wo},getTimeToWait:function(){return ug()}};var ni=function(){frontendPassedData.woocommerce_active||(jQuery(".current-menu-parent").removeClass("current-menu-parent"),jQuery(".current-menu-ancestor").removeClass("current-menu-ancestor"),jQuery(".current-menu-item:not(.qtranxs-lang-menu-item)").removeClass("current-menu-item"),jQuery(".current_page_item:not(.qtranxs-lang-menu-item)").removeClass("current_page_item"));var e=[],t=jQuery("body").attr("data-id"),r=jQuery("body").attr("data-type");e=jQuery('nav a[data-id="'+t+'"][data-type="'+r+'"]'),e.length!=0&&e.each(function(){jQuery(this.parentNode).addClass("current-menu-item"),jQuery(this.parentNode.parentNode).closest("li.menu-item").addClass("current-menu-parent")});var n=[];n=M.parseIdsString(jQuery("body").attr("data-catid")),Array.isArray(n)||(n=[n]);for(var o=0;o<n.length;o++){var a=n[o],e=jQuery('nav a[data-catid="'+a+'"][data-type="category"]');e.length!=0&&e.each(function(){jQuery(this.parentNode).addClass("current-menu-item"),jQuery(this.parentNode.parentNode).closest("li.menu-item").addClass("current-menu-parent")})}};var Iu=0,oi=0,Su=0,Cu=0,ai=0,tr={$body:null},fg=function(){return window.history.state},dg=function(){"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual");var e=window.location.href,t={scrollpos:window.scrollY,fullscreenSliderPos:0,type:tr.$body.attr("data-type"),id:tr.$body.attr("data-id"),catid:M.parseIdsString(tr.$body.attr("data-catid"))};window.history.replaceState(t,jQuery("title").text(),e)},hg=function(e,t,r){pg(e)||(Ru(),window.history.pushState(e,t,r),document.title=t,Mt.triggerPushState(),Mu(e))},pg=function(e){return window.history.state==null?!1:window.history.state.id==e.id&&window.history.state.type==e.type},mg=function(){window.addEventListener("popstate",function(e){if(window.location.href.indexOf("#")!=-1,e.state===null&&window.location.href.indexOf("#")!=-1){var t={scrollpos:window.scrollY,type:tr.$body.attr("data-type"),id:tr.$body.attr("data-id"),catid:M.parseIdsString(tr.$body.attr("data-catid"))},r=window.location.href;window.history.replaceState(t,jQuery("title").text(),r)}else window.laytheme.trigger("popstate"),e.state.type==jQuery("body").attr("data-type")&&e.state.id==jQuery("body").attr("data-id")||(Pu(e.state),Mu(e.state))})},vg=function(){document.querySelector("#footer-region")!=null&&(Su=document.querySelector("#footer-region").scrollTop)},Mu=function(e){if(jQuery(".post-password-form").length>0){window.location.reload();return}bo.startTimer(),oi=Iu,Iu=window.scrollY,ai=Cu,Cu=ii;var t=xu.maybeReload(e);if(frontendPassedData.misc_options_disable_ajax=="on"&&(t=!0),t)window.location.reload(!1);else{xt();var r=!1;parseInt(frontendPassedData.navigation_transition_out_duration,10)!=0&&(r=!0),frontendPassedData.navigation_transition_out=="none"&&(r=!1),r?Zr.hideRegions():(Yt.setTransitionStatus("ended"),window.laytheme.trigger("transition_navigation_out_completed")),jQuery("body").attr({"data-type":e.type,"data-id":e.id,"data-catid":M.stringifyCatIds(e.catid)}),ni(),Zr.showLayout("",vg),window.laytheme.trigger("newpage")}},Pu=function(e){window.laytheme.off("newpageshown",ku),window.laytheme.on("newpageshown",ju)},ju=function(){var e=!0;if(window.location.href.indexOf("#")!=-1&&(e=!1,window.location.href.indexOf("#category-")!=-1&&(e=!0)),frontendPassedData.never_change_scrolling_position=="on"&&g.screenSize!="phone"&&(e=!1),frontendPassedData.misc_options_disable_ajax=="on"&&(e=!1),e)if(typeof jQuery.fn.fullpage!="undefined"&&typeof magneticSlidesPassedData!="undefined"&&typeof jQuery.fn.fullpage.silentMoveTo=="function")magneticSlidesPassedData.ms_direction=="horizontal"?jQuery.fn.fullpage.silentMoveTo(1,ai):jQuery.fn.fullpage.silentMoveTo(ai,0);else{var t=jQuery(er.join(",")),r=Dl(t);r.length>0?jQuery.when(oo(r)).then(function(){window.scrollTo(0,oi)}).catch(function(n){console.log(n)}):window.scrollTo(0,oi)}window.laytheme.off("newpageshown",Pu)},Ru=function(){window.laytheme.off("newpageshown",ju),window.laytheme.on("newpageshown",ku)},ku=function(){frontendPassedData.never_change_scrolling_position=="on"&&g.screenSize!="phone"?document.querySelector("#footer-region")!=null&&document.querySelector("#footer-region").scrollTo(0,Su):window.location.href.indexOf("#")==-1&&frontendPassedData.misc_options_disable_ajax!="on"&&window.scrollTo(0,0),window.laytheme.off("newpageshown",Ru)},ii=0,gg=function(){typeof magneticSlidesPassedData!="undefined"&&(magneticSlidesPassedData.ms_direction=="horizontal"?jQuery(window).on("fpAfterSlideLoad",function(e,t){ii=t.slideIndex}):jQuery(window).on("fpAfterLoad",function(e,t){ii=t.index}))},er,yg=function(){window.laytheme.on("content_ready",function(e){switch(er=void 0,e){case"desktop":er=["#grid",".cover-region-desktop","#footer"];break;case"phone":var t=jQuery("#footer-custom-phone-grid").length!=0,r=jQuery("#custom-phone-grid").length!=0;t&&r?er=["#custom-phone-grid",".cover-region-phone","#footer-custom-phone-grid"]:!t&&r?er=["#custom-phone-grid",".cover-region-phone","#footer"]:t&&!r?er=["#grid",".cover-region-desktop","#footer-custom-phone-grid"]:!t&&!r&&(er=["#grid",".cover-region-desktop","#footer"]);break}})},_g=function(){yg(),tr.$body=jQuery("body"),frontendPassedData.misc_options_disable_ajax!="on"&&dg(),ni(),fo.maybeHideProjectArrowsOnInit(),Au(),frontendPassedData.misc_options_disable_ajax!="on"&&mg(),setTimeout(function(){gg()},0)},wg={initModule:_g,getState:fg,pushState:hg},Er=wg;var bg={initModule:function(){g.isTouchDevice&&xg()}},Du=bg,xg=function(){if(frontendPassedData.fi_mo_touchdevice_behaviour=="mo_on_tap"){jQuery(document).on("click","a.thumb[data-type]",function(r){r.stopPropagation(),r.preventDefault()});var e=!1,t;jQuery(document).on("touchstart","a.thumb[data-type]",function(r){clearTimeout(t),this.classList.contains("hover")||(e=!0,t=setTimeout(function(){e=!1},100),r.stopPropagation(),r.preventDefault(),jQuery("a.thumb").removeClass("hover"),this.classList.add("hover"))}),jQuery(document).on("tap","a.thumb[data-type]",function(r){r.stopPropagation(),r.preventDefault(),e==!1&&this.classList.contains("hover")&&Tg(jQuery(this))})}},Tg=function(e){if(frontendPassedData.is_customize)return!1;var t=e.attr("href");if(t=M.filterURL(t),jQuery("body").attr("data-type")==jQuery(this).attr("data-type")&&jQuery("body").attr("data-id")==jQuery(this).attr("data-id"))event.preventDefault(),bt.hideMobileMenu();else if(jQuery(this).attr("data-type")!="custom"&&!event.metaKey&&!event.ctrlKey){event.preventDefault();var r=passedDataHistory.title;typeof e.attr("data-title")!="undefined"&&(r=passedDataHistory.titleprefix+_.unescape(e.attr("data-title")));var n=M.parseIdsString(e.attr("data-catid"));Er.pushState({type:e.attr("data-type"),id:e.attr("data-id"),catid:n},r,t)}};var Eg={polyfill_flexbox:function(){xo()},initModule:function(){Ag(),Lu()}},Ou=Eg,xo=function(){Modernizr.flexbox||(jQuery(".col.align-middle").each(function(){var e=!1,t=jQuery(this);if(g.isPhoneSize?(t.css("margin-top","0"),jQuery(t[0].parentNode.parentNode).hasClass("_100vh")&&jQuery(t[0].parentNode).find(".col").length==1&&(e=!0)):e=!0,e){var r=jQuery(this.parentNode).height(),n=t.height(),o=(r-n)/2;t.css("margin-top",o+"px")}}),jQuery(".col.align-bottom").each(function(){var e=!1,t=jQuery(this);if(g.isPhoneSize?(t.css("margin-top","0"),jQuery(t[0].parentNode.parentNode).hasClass("_100vh")&&jQuery(t[0].parentNode).find(".col").length==1&&(e=!0)):jQuery(t[0].parentNode.parentNode).hasClass("_100vh")&&(e=!0),e){var r=jQuery(this.parentNode).height(),n=t.height(),o=r-n;t.css("margin-top",o+"px")}}))},Ag=function(){Lu(),window.laytheme.on("newpageshown",function(){xo()})},Lu=function(){jQuery(window).on("resize",function(){xo()}),jQuery(window).on("orientationchange",function(){setTimeout(function(){xo()},400)})};var Ig=Marionette.View.extend({tagName:"div",template:_.template(`<div class="mediawrap <%= getSizingClassName() %> <%= getFollowMovementClassName() %>">
            <%= getMedia() %>
        </div>`),events:{click:"onHideClick"},onHideClick:function(){Bt.hide()},onRender:function(){setTimeout(function(){Bt.setReferences(),Bt.prepareBoundary()},0)},onAttach:function(){Bt.initHideAfter()},onResize:function(){var e=window.innerWidth/window.innerHeight,t=this.model.get("width")/this.model.get("height"),r=e>t?"w100":"h100";this.$el.find(".mediawrap").removeClass("w100 h100").addClass(r)},templateContext:function(){return{getFollowMovementClassName:function(){return frontendPassedData.intro_movement==1?"followmovement":""},getMedia:function(){switch(this.type){case"video":return'<video class="media loaded" data-ar="'+this.getAr()+'" playsinline muted autoplay loop src="'+this.url+'"></video>';case"image":return'<img class="lazyload js-intro-image media" data-ar="'+this.getAr()+'" sizes="'+this.getSizes()+'" data-srcset="'+this.getSrcset()+'" src="" alt="">'}},getSizes:function(){var e=1.15*this.width*window.innerHeight/this.height/window.innerWidth;return e=Math.round(Math.max(e,1.15)*100),e+"vw"},getSizingClassName:function(){var e=window.innerWidth/window.innerHeight,t=this.width/this.height,r=e>t?"w100":"h100";return r},getSrcset:function(){var e=[];for(var t in g.imageSizes){var r=this.sizes["_"+g.imageSizes[t]];r=r+" "+g.imageSizes[t]+"w",e.push(r)}return e.join(", ")},getAr:function(){return this.width/this.height},getText:function(){return this.text}}}}),Fu=Ig;var Cg=Marionette.View.extend({className:"intro",template:_.template(`
        <div class="intro-media-region"></div>
        <div class="intro-svg-wrap"><%= getSVGOverlay() %></div>
        <div class="intro_text `+frontendPassedData.intro_text_textformat+`"><%= getText() %></div>
    `),regions:{mediaRegion:".intro-media-region"},templateContext:function(){return{getSVGOverlay:function(){if(frontendPassedData.intro_use_svg_overlay==!0)return'<img class="intro-svg-overlay" src="'+frontendPassedData.intro_svg_url+'" alt="">'},getText:function(){if(frontendPassedData.intro_use_text_overlay==!0)return frontendPassedData.intro_text}}}}),Qu=Cg;var Bu={init:function(e){Uu(e)},hide:function(){Ar()},destroy:function(){un()},unbind:function(){unbind()},initHideAfter:function(){Pg()},getBoundaries:function(){return{boundaryX:tt.boundaryX,boundaryY:tt.boundaryY}},setReferences:function(){Mg()},prepareBoundary:function(){ui()},cancelLoading:function(){Sg()}},Bt=Bu,li,To,zt=null,Eo,zu,tt={boundaryX:0,boundaryY:0,intro:null},Nu={mediaScale:115};window.laytheme.on("customizer_showintro",function(){un(),Uu()});window.laytheme.on("customizer_hideintro",function(){Ar(),jQuery("body").removeClass("intro-loading")});var Sg=function(){jQuery("body").removeClass("intro-loading")},si=function(){var e=null;g.orientation==="landscape"?e=new Backbone.Model(frontendPassedData.intro_landscape):e=new Backbone.Model(frontendPassedData.intro_portrait),To=new Fu({model:e});var t=new Qu,r=Marionette.Application.extend({region:"#intro-region",onStart:function(){this.showView(t),t.showChildView("mediaRegion",To),jQuery("body").removeClass("intro-loading")}}),n=new r;n.start()},Uu=function(){if(jQuery("#intro-region").removeClass("hide"),jQuery("body").removeClass("intro-loading"),!!frontendPassedData.is_frontpage&&frontendPassedData.intro_active){var e=!1;if(g.orientation==="landscape"?jQuery.isEmptyObject(frontendPassedData.intro_landscape)||(e=!0):jQuery.isEmptyObject(frontendPassedData.intro_portrait)||(e=!0),frontendPassedData.intro_use_svg_overlay==!0&&frontendPassedData.intro_svg_url!=""&&(e=!0),frontendPassedData.intro_use_text_overlay==!0&&frontendPassedData.intro_text!=""&&(e=!0),frontendPassedData.intro_hide_on_phone&&window.innerWidth<parseInt(frontendPassedData.breakpoint,10)&&(e=!1),e==!1){un();return}Eo=jQuery("body"),zt=new Particle(0,0),si(),window.laytheme.on("orientationchanged",si),setTimeout(function(){frontendPassedData.intro_movement==!0&&(jg(),Gu())},0),jQuery(window).on("resize",Wu),jQuery(document).on("scroll",Vu)}},Mg=function(){li=jQuery(".intro .mediawrap"),tt.intro=frontendPassedData.intro_landscape,g.orientation==="portrait"&&(tt.intro=frontendPassedData.intro_portrait)},Vu=function(){window.scrollY>10&&Ar()},Pg=function(){var e=parseInt(frontendPassedData.intro_hide_after,10);if(e!=0){var t=To.model.get("type");if(typeof t=="undefined")setTimeout(function(){Ar()},e);else switch(t){case"video":jQuery(".intro video").on("playing",function(){setTimeout(function(){Ar()},e)});break;default:case"image":jQuery(".js-intro-image").length>0&&(jQuery(".js-intro-image")[0].onload=function(){setTimeout(function(){Ar()},e)});break}}},Tt=function(e,t,r,n,o){return n+(o-n)*((Math.min(r,Math.max(t,e))-t)/(r-t))},ui=function(){var e=jQuery(".intro .mediawrap").height(),t=0,r=0;li.hasClass("h100")?(r=e*Nu.mediaScale/100,t=r*tt.intro.width/tt.intro.height):(t=Eo.innerWidth()*Nu.mediaScale/100,r=t*tt.intro.height/tt.intro.width),tt.boundaryX=(t-Eo.innerWidth())/2,tt.boundaryY=(r-e)/2,tt.boundaryX-=2,tt.boundaryY-=2},we=1,jg=function(){ui(),g.isTouchDevice?window.addEventListener("deviceorientation",qu):jQuery(window).on("mousemove",Hu)},Hu=function(e){var t=Tt(e.clientX,0,Eo.innerWidth(),we,-we),r=Tt(e.clientY,0,window.innerHeight,we,-we);zt.updateDestination(t,r)},qu=function(e){var t=e.gamma,r=e.beta;window.orientation==90?(t=Tt(e.beta,-45,45,we,-we),r=Tt(-e.gamma,-20,70,we,-we)):window.orientation==-90?(t=Tt(-e.beta,-45,45,we,-we),r=Tt(e.gamma,-20,70,we,-we)):window.orientation==180?(t=Tt(-e.gamma,-45,45,we,-we),r=Tt(-e.beta,-20,70,we,-we)):(t=Tt(e.gamma,-45,45,we,-we),r=Tt(e.beta,-20,70,we,-we)),zt.updateDestination(t,r)},Gu=function(){zt.update(),li.css({transform:"translate3d("+zt.x+"px, "+zt.y+"px, 0)","-webkit-transform":"translate3d("+zt.x+"px, "+zt.y+"px, 0)"}),zu=requestAnimationFrame(Gu)},un=function(){jQuery("body").removeClass("intro-enabled").addClass("intro-disabled"),jQuery("#intro-region").html("").addClass("hide"),window.laytheme.off("orientationchanged",si),cancelAnimationFrame(zu),window.removeEventListener("deviceorientation",qu),jQuery(window).off("mousemove",Hu),jQuery(window).off("resize",Wu),clearTimeout(Rg)},Wu=function(){To.triggerMethod("resize"),ui()},Rg,Ar=function(e){frontendPassedData.intro_transition_duration==0?un():(jQuery(".intro").on("transitionend",function(){un()}),jQuery(".intro").addClass("animatehide")),typeof e=="function"&&e(),jQuery(document).off("scroll",Vu)};(function(){function e(t,r){this.x=t,this.y=r,this.virtualX=t,this.virtualY=r,this.destX=t,this.destY=r,this.xvelocity=0,this.yvelocity=0}e.prototype.update=function(){var t=Bu.getBoundaries();this.xvelocity=this.destX-this.virtualX,this.yvelocity=this.destY-this.virtualY,Math.abs(this.xvelocity)>.002&&(this.xvelocity*=.03),Math.abs(this.yvelocity)>.002&&(this.yvelocity*=.03),this.virtualX+=this.xvelocity,this.virtualY+=this.yvelocity,this.x=Math.min(1,Math.max(-1,this.virtualX))*t.boundaryX,this.y=Math.min(1,Math.max(-1,this.virtualY))*t.boundaryY},e.prototype.updateDestination=function(t,r){this.destX=t,this.destY=r},window.Particle=e})();var kg=frontendPassedData.search_placeholder_text,ci=!1,$u=Marionette.View.extend({className:function(){return"search-view "+this.getOption("hasNoResultsClass")},hasNoResultsClass:"search-has-no-results",hasResultsClass:"search-has-or-had-results",template:_.template(`
        <div class="close-search"></div>
        <div class="search-inputs">
            <input id="search-query" type="search" class="search-query" placeholder="`+kg+`" autocomplete="off" spellcheck="false">
            <div id="search-autosuggest-list"></div>
        </div>
        <div id="search-results-region"></div>
    `),regions:{results:"#search-results-region",search_autosuggest_list:"#search-autosuggest-list"},events:{"input #search-query":"onInput","focus #search-query":"onFocus","blur #search-query":"onBlur","click .close-search":"onHide"},val:"",onAddClassForHasResults:function(){this.$el.removeClass(this.hasNoResultsClass),this.$el.addClass(this.hasResultsClass)},onAddClassForNoResults:function(){this.$el.addClass(this.hasNoResultsClass),this.$el.removeClass(this.hasResultsClass)},onFocus:function(){this.$el.find("#search-autosuggest-list").show()},onBlur:function(){setTimeout(()=>{this.$el.find("#search-autosuggest-list").hide()},100)},onInput:function(){this.val=this.$el.find("#search-query").val(),Ir.search()},onShow:function(){ci=!0,this.$el.addClass("show"),M.fixBody(),jQuery("#search-query").focus()},onHide:function(){ci&&(this.$el.addClass("hide").removeClass("show"),M.unfixBody(),this.$el.find("#search-query").val(""),this.val="",this.triggerMethod("blur"),Ir.search(),this.triggerMethod("add:class:for:no:results"),ci=!1)},onRender:function(){var e=this;window.laytheme.on("content_fadeout_transition_ended",function(){e.triggerMethod("hide")})}}),Dg=Marionette.View.extend({className:"suggest-item",template:_.template(`
        <span class="suggest"><span class="suggest-prefix"><%= suggestPrefix() %></span><span class="suggest-suffix"><%= suggestSuffix() %></span></span>
    `),events:{click:"clickSuggestItem"},clickSuggestItem:function(e){e.preventDefault(),e.stopPropagation(),Ir.clickSuggestItem(this.$el)},templateContext:function(){return{suggestSuffix:function(){var e=this.suggest,t=this.query;return M.stringStartsWith(e,t)?e.slice(t.length):e},query:jQuery("#search-query").val(),suggestPrefix:function(){var e=this.suggest,t=this.query;return M.stringStartsWith(e,t)?this.query:""}}}}),Xu=Marionette.CollectionView.extend({className:"suggest-collection",childView:Dg,id:"suggest-results"});var di=jQuery.Deferred(),Yu=!1,Ju,Cr,ct,rt,fi=3,Og={shouldSort:!0,includeScore:!1,threshold:.1,location:0,distance:100,maxPatternLength:32,minMatchCharLength:3,ignoreLocation:!0,keys:["title","descr","cats","tags"]},Zu=function(){Yu||jQuery.ajax({url:frontendPassedData.wpapiroot+"laytheme/search/",success:function(e){Ju=new Fuse(e,Og),Yu=!0,di.resolve()}})},Lg=function(){di.state()=="resolved"?Ku():jQuery.when(di).then(function(){Ku()})},Ku=_.debounce(function(){var e=jQuery("#search-query").val();if(ct=e.toLowerCase(),e.length==0){jQuery("#search-autosuggest-list").html(""),jQuery("#search-results-region").html("");return}Cr=Ju.search(e),Cr.length>0&&rt.triggerMethod("add:class:for:has:results");var t=Ug(Cr);t=JSON.stringify(t);var r={action:"get_search_result",found_posts:t};jQuery.ajax({url:frontendPassedData.ajax_url,data:r,type:"post",success:n=>{jQuery("#search-results-region").html(n),setTimeout(function(){window.laytheme.trigger("searchresultshown")},0)},error:n=>{console.log("search error"),console.log(n)}}),frontendPassedData.search_autosuggest_hide==!1&&Fg()},200),Fg=function(){var e=[];for(var t of Cr){t.title.toLowerCase().startsWith(ct)&&e.indexOf(t.title)==-1&&e.push(t.title),t.descr.toLowerCase().startsWith(ct)&&e.indexOf(t.descr)==-1&&e.push(t.descr);for(var r=0;r<t.cats.length;r++){var n=t.cats[r];n.toLowerCase().startsWith(ct)&&e.indexOf(n)==-1&&e.push(n)}for(var r=0;r<t.tags.length;r++){var o=t.tags[r];o.toLowerCase().startsWith(ct)&&e.indexOf(o)==-1&&e.push(o)}if(e.length>fi)break}if(e.length!=0&&ct==e[0].toLowerCase()&&e.splice(0,1),e.length==0)for(var t of Cr){t.title.toLowerCase().indexOf(ct)!==-1&&e.indexOf(t.title)==-1&&e.push(t.title),t.descr.toLowerCase().indexOf(ct)!==-1&&e.indexOf(t.descr)==-1&&e.push(t.descr);for(var r=0;r<t.cats.length;r++){var n=t.cats[r];n.toLowerCase().startsWith(ct)&&e.indexOf(n)==-1&&e.push(n)}for(var r=0;r<t.tags.length;r++){var o=t.tags[r];o.toLowerCase().startsWith(ct)&&e.indexOf(o)==-1&&e.push(o)}if(e.length>fi)break}if(e.length!=0&&ct==e[0].toLowerCase()&&e.splice(0,1),Cr.length!=0){var a=new Xu({collection:new Backbone.Collection(e.slice(0,fi).map(i=>({suggest:i})))});rt.getRegion("search_autosuggest_list").show(a)}else rt.getRegion("search_autosuggest_list").empty()},Qg=function(e){var t=e.find(".suggest").text();jQuery("#search-query").val(t),setTimeout(function(){rt.getRegion("search_autosuggest_list").empty(),rt.triggerMethod("input")},0)},Ng=function(){jQuery('[href="#search"]').on("click",function(e){Zu(),e.preventDefault(),e.stopPropagation(),rt.triggerMethod("show"),window.laytheme.trigger("searchshown")})},Bg=function(){rt=new $u;var e=Marionette.Application.extend({region:"#search-region",onStart:function(){this.showView(rt)}}),t=new e;t.start()},zg=function(){jQuery(document).keyup(function(e){e.which==27&&rt.triggerMethod("hide")})},Ug=function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r].postid;t.push(n)}return t},Vg=function(){window.laytheme.on("customizer_showsearch",function(){Zu(),rt.triggerMethod("show")}),window.laytheme.on("customizer_hidesearch",function(){rt.triggerMethod("hide")}),window.laytheme.on("newpageshown",function(){rt.triggerMethod("hide")})},Hg=function(){window.laytheme.on("searchresultshown",function(){wt.loadVideosInstantly(jQuery("#search-results-region"))})},qg={initModule:function(){Ng(),Bg(),zg(),Vg(),Hg()},search:function(){Lg()},clickSuggestItem:function(e){Qg(e)}},Ir=qg;var Io,Ao,Je=[],Gg=function(){Io=document.querySelectorAll("video.autoplay[playsinline][muted]"),Wg(),ec()},Wg=function(){Je=[],Io.forEach((e,t)=>{Je[t]={playing:!1,playPromise:null}})};window.laytheme.on("content_ready",function(e){switch(e){case"desktop":Ao=jQuery("#grid, .cover-region-desktop");break;case"phone":Ao=jQuery("#custom-phone-grid, .cover-region-phone"),Ao.length==0&&(Ao=jQuery("#grid, .cover-region-desktop"));break}Gg(),ec()});var $g=(e,t)=>{e.forEach(r=>{var n=Array.from(Io).indexOf(r.target);if(r.isIntersecting){if(typeof Je[n]!=null&&Je[n].playing==!1&&!r.target.ended&&!jQuery(r.target).hasClass("userinteractedwith-paused"))try{r.target.readyState>=2?(Je[n].playPromise=r.target.play(),Je[n].playPromise.then(function(){Je[n].playing=!0})):function(o){r.target.addEventListener("canplay",a=>{Je[o].playPromise=r.target.play(),Je[o].playPromise.then(function(){Je[o].playing=!0})})}(n)}catch(o){console.log(o)}}else Je[n]&&Je[n].playing==!0&&(r.target.pause(),Je[n].playing=!1)})},ec=function(){let e=new Qt($g);Io.forEach(t=>{e.observe(t)})};var Co=Xt(rc()),Xg=Backbone.Radio.channel("events"),Yg=function(){let e;window.frontendPassedData.element_transition_on_scroll=="on"&&(window.laytheme.on("newpageshown",function(){let t={threshold:0},r=new Qt(Jg,t);e=document.querySelectorAll(".col.no-parallax.no-offset.no-sticky,.col.no-parallax.no-offset.type-thumbnailgrid a.thumb,.col.no-parallax.no-offset.type-elementgrid .element-wrap,.col.no-parallax.no-offset.type-productsgrid li,.lay-thumbnailgrid-filter-wrap"),setTimeout(function(){e.forEach(n=>{Co.default.measure(()=>{var o=n.getBoundingClientRect().top;Co.default.mutate(()=>{o>window.innerHeight&&!n.classList.contains("no-animation")&&n.classList.add("below")})})})},50),e.forEach(n=>{r.observe(n)})}),Xg.on("scroll",function(){if(window.innerHeight+window.scrollY>=document.body.scrollHeight-90)for(let t=0;t<e.length;t++){let r=e[t];if(r.classList.contains("below")){let n=ac();r.style.transitionDelay=n+"ms",r.classList.remove("below"),r.classList.add("in-view")}}}),jQuery(window).on("fpAfterLoad",function(t,r){e.forEach(n=>{n.closest(".row-"+(r.index-1))?(n.classList.remove("below"),n.classList.add("in-view")):(n.classList.remove("in-view"),n.classList.add("below"))})}),jQuery(window).on("fpAfterSlideLoad",function(t,r){e.forEach(n=>{n.closest(".row-"+r.slideIndex)?(n.classList.remove("below"),n.classList.add("in-view")):(n.classList.remove("in-view"),n.classList.add("below"))})}))};window.laytheme.on("pushstate",function(){oc()});window.laytheme.on("popstate",function(){oc()});window.laytheme.on("newpageshown",function(){setTimeout(function(){Kg()},50)});var vi=!0,Kg=function(){vi=!0},oc=function(){vi=!1},Jg=(e,t)=>{e.forEach(r=>{vi&&Co.default.mutate(()=>{if(r.isIntersecting==!0&&r.target.classList.contains("below")&&(r.boundingClientRect.top>0||r.boundingClientRect.bottom>0)){let n=ac();r.target.style.transitionDelay=n+"ms",r.target.classList.remove("below"),r.target.classList.add("in-view")}r.isIntersecting==!1&&r.boundingClientRect.top>window.innerHeight&&!r.target.classList.contains("no-animation")&&(r.target.style.transitionDelay=0,r.target.classList.add("below"),r.target.classList.remove("in-view"))})})},nc,pi=!1,mi=0,ac=function(){return clearTimeout(nc),nc=setTimeout(function(){pi=!1,mi=0},50),pi&&(mi+=50),pi=!0,mi},Zg={initModule:Yg},ic=Zg;var Ut=void 0,sc=function(){return jQuery(".vertical-fullpage").length>0?"vertical":jQuery(".horizontal-fullpage").length>0?"horizontal":"none"},So=function(e){if(typeof Ut!="undefined"){var t=Ut.find(e),r=t.closest(".row");if(r.length==0)return console.error("no row found"),0;var n=Ut.find(".row"),o=n.index(r);return o}return 0},e0=function(e){var t=window.location.href,r=t.indexOf("#");if(r!==-1&&(t=t.substr(0,r)),e.attr("href").substr(0,1)=="#"||e[0].hasAttribute("data-id")&&e[0].hasAttribute("data-type")&&e.attr("data-id")==jQuery("body").attr("data-id")&&e.attr("data-type")==jQuery("body").attr("data-type"))return!0;var n=e.attr("href"),o=n.indexOf("#"),a=n.substr(0,o);return a==t||a.substr(0,a.length-1)==t||a==t.substr(0,t.length-1)||a.substr(0,a.length-1)==t.substr(0,t.length-1)},t0=function(){jQuery(document).on("click",'.lay-content a[href*="#"]:not([href="#search"]):not([href="#"]):not([href="#laynextproject"]):not([href="#layprevproject"]):not(.scrolltotop), .laynav a[href*="#"]:not([href="#search"]):not([href="#laynextproject"]):not([href="#layprevproject"]):not(.scrolltotop)',function(e){if(jQuery(this).closest("#fp-nav").length>0||jQuery(this).closest(".fp-slidesNav").length>0){e.preventDefault();return}if(e0(jQuery(this))){e.preventDefault(),bt.hideMobileMenu();var t=jQuery(this).attr("href"),r=t.indexOf("#"),n=t.substring(r),o=sc(),a=Ut.find(n);switch(jQuery(a).closest(".lay-overlay").length>0&&(o="none"),o){case"none":if(a.length!=0)if(jQuery(a).closest(".lay-overlay").length>0){var i=a.offset().top;i=cn(i),jQuery(a).closest(".lay-content").animate({scrollTop:i},300,"easeInOutQuad",function(){})}else if(M.unfixBody(),setTimeout(function(){xt()},0),frontendPassedData.never_change_scrolling_position=="on"&&g.screenSize!="phone"){var i=a[0].getBoundingClientRect().top;let f=jQuery("body>.lay-content #grid");jQuery(a).closest("#footer-region").length>0&&(f=jQuery("#footer-region")),i+=f[0].scrollTop,i=cn(i),jQuery(f).animate({scrollTop:i},300,"easeInOutQuad",function(){})}else{var i=a.offset().top;i=cn(i),jQuery("html").animate({scrollTop:i},300,"easeInOutQuad",function(){window.location.hash=n,window.scroll(0,i)})}break;case"vertical":M.unfixBody(),setTimeout(function(){xt()},0);var c=So(n),l=c+1;jQuery(window).one("fpAfterLoad",function(){window.location.hash=n}),jQuery.fn.fullpage.moveTo(l,0);break;case"horizontal":M.unfixBody(),setTimeout(function(){xt()},0);var c=So(n),s=c;jQuery(window).one("fpAfterSlideLoad",function(){window.location.hash=n}),jQuery.fn.fullpage.moveTo(1,s);break}}})},cn=function(e){switch(g.screenSize){case"desktop":case"tablet":jQuery(".navbar").is(":visible")&&(e-=parseInt(jQuery(".navbar").height(),10)),frontendPassedData.anchorscroll_offset_desktop!=""&&jQuery.isNumeric(parseInt(frontendPassedData.anchorscroll_offset_desktop,10))&&(e-=parseInt(frontendPassedData.anchorscroll_offset_desktop,10));break;case"phone":jQuery(".navbar").is(":visible")&&frontendPassedData.mobile_navbar_fixed=="1"&&(e-=parseInt(jQuery(".navbar").height(),10)),frontendPassedData.anchorscroll_offset_phone!=""&&jQuery.isNumeric(parseInt(frontendPassedData.anchorscroll_offset_phone,10))&&(e-=parseInt(frontendPassedData.anchorscroll_offset_phone,10));break}return e},lc=function(){var e=window.location.hash,t=Ut.find(e);if(t.length>0){var r=sc();switch(r){case"none":var n=t.offset().top;if(n=cn(n),frontendPassedData.never_change_scrolling_position=="on"&&g.screenSize!="phone"){let l=jQuery("body>.lay-content #grid");jQuery(t).closest("#footer-region").length>0&&(l=jQuery("#footer-region")),l[0].scroll(0,n)}else window.scroll(0,n);break;case"vertical":var a=So(e),o=a+1;jQuery.fn.fullpage.silentMoveTo(o,0),magneticSlidesPassedData.ms_autoScrolling=="on"&&magneticSlidesPassedData.ms_scrollBar==""&&(console.log("1"),window.scrollTo(0,0));break;case"horizontal":var a=So(e),i=a;jQuery.fn.fullpage.silentMoveTo(1,i),console.log("1"),window.scrollTo(0,0);break}}},r0=function(){jQuery(window).on("hashchange",function(){var e=window.location.hash;Ut!=null&&lc()})},n0=function(){t0(),r0(),window.laytheme.on("content_ready",function(e){Ut=void 0,Ut=Me(e),setTimeout(function(){lc()},50)})},o0={initModule:n0,addSpaceTop:cn},Mo=o0;var a0=navigator.userAgent.match(/(iPhone|iPod|iPad|Android|playbook|silk|BlackBerry|BB10|Windows Phone|Tizen|Bada|webOS|IEMobile|Opera Mini)/),yi;a0===null?yi=!1:yi=!0;var i0=yi?"is-touchdevice":"no-touchdevice";jQuery("body").addClass(i0);var dc=/(iPad|iPhone|iPod)/g.test(navigator.userAgent),uc=window.devicePixelRatio||1,Be={width:window.screen.width*uc,height:window.screen.height*uc},jo=navigator.userAgent.match(/(Macintosh)/),hc=!!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/),_i=!1;jo===null?jo=!1:jo=!0;var rr=!1,wi=!1;Be.width==2048&&Be.height==2732&&(rr=!0,wi=!0);Be.width==1668&&Be.height==2388&&(rr=!0,wi=!0);Be.width==2732&&Be.height==2048&&(rr=!0);Be.width==1536&&Be.height==2048&&(rr=!0);Be.width==1620&&Be.height==2160&&(rr=!0);Be.width==1536&&Be.height==2048&&(rr=!0);jo==!0&&hc==!0&&rr&&(_i=!0);dc===!0||_i?document.documentElement.classList.add("is-ios"):document.documentElement.classList.add("no-ios");var s0=/(iPad)/g.test(navigator.userAgent);s0===!0||_i?wi?document.documentElement.classList.add("is-ipad-without-homebutton"):document.documentElement.classList.add("is-ipad"):document.documentElement.classList.add("no-ipad");var l0=/(iPhone)/g.test(navigator.userAgent),cc=[{name:"iPhone 14 Plus",w:1284,h:2778},{name:"iPhone 14 Pro Max",w:1290,h:2796},{name:"iPhone 14 Pro",w:1179,h:2556},{name:"iPhone 14",w:1170,h:2532},{name:"iPhone 13",w:1170,h:2532},{name:"iPhone 13 mini",w:1080,h:2340},{name:"iPhone 13 Pro Max",w:1284,h:2778},{name:"iPhone 13 Pro",w:1170,h:2532},{name:"iPhone 12",w:1170,h:2532},{name:"iPhone 12 mini",w:1080,h:2340},{name:"iPhone 12 Pro Max",w:1284,h:2778},{name:"iPhone 12 Pro",w:1170,h:2532},{name:"iPhone 11 Pro Max",w:1242,h:2688},{name:"iPhone 11 Pro",w:1125,h:2436},{name:"iPhone 11",w:828,h:1792},{name:"iPhone XR",w:828,h:1792},{name:"iPhone XS Max",w:1242,h:2688},{name:"iPhone XS",w:1125,h:2436},{name:"iPhone X",w:1125,h:2436}],pc=!1;if(dc===!0){for(Po=0;Po<cc.length;Po++)if(gi=cc[Po],Be.width===gi.w&&Be.height===gi.h){pc=!0;break}}var gi,Po;pc?document.documentElement.classList.add("is-iphone-no-homebutton"):l0===!0?document.documentElement.classList.add("is-iphone"):document.documentElement.classList.add("no-iphone");var fc=window.chrome,bi=window.navigator,u0=bi.vendor,c0=typeof window.opr!="undefined",f0=bi.userAgent.indexOf("Edge")>-1,d0=bi.userAgent.match("CriOS"),fn="no-chrome-no-safari";(d0||fc!==null&&typeof fc!="undefined"&&u0==="Google Inc."&&c0===!1&&f0===!1)&&(fn="is-chrome");var h0=navigator.userAgent.toLowerCase(),p0=h0.indexOf("android")>-1;p0===!0&&document.documentElement.classList.add("is-android");hc===!0&&(fn="is-safari");document.documentElement.classList.add(fn);fn!="is-chrome"&&document.documentElement.classList.add("no-chrome");var m0=navigator.userAgent.indexOf("Instagram")>-1;m0?document.documentElement.classList.add("is-instagram-browser"):document.documentElement.classList.add("no-instagram-browser");var xs={};Wp(xs,{VERSION:()=>Ro,after:()=>as,all:()=>Yo,allKeys:()=>ft,any:()=>Ko,assign:()=>ir,before:()=>Sn,bind:()=>qo,bindAll:()=>zc,chain:()=>Ji,chunk:()=>bs,clone:()=>Ui,collect:()=>Ve,compact:()=>vs,compose:()=>os,constant:()=>vn,contains:()=>Fe,countBy:()=>$c,create:()=>zi,debounce:()=>rs,default:()=>ef,defaults:()=>Uo,defer:()=>Uc,delay:()=>Go,detect:()=>Lr,difference:()=>Zo,drop:()=>dr,each:()=>Ce,escape:()=>Fc,every:()=>Yo,extend:()=>zo,extendOwn:()=>ir,filter:()=>nt,find:()=>Lr,findIndex:()=>Or,findKey:()=>Mn,findLastIndex:()=>Wo,findWhere:()=>is,first:()=>Qn,flatten:()=>gs,foldl:()=>Xo,foldr:()=>ss,forEach:()=>Ce,functions:()=>Rr,get:()=>Tn,groupBy:()=>Gc,has:()=>Hi,head:()=>Qn,identity:()=>lr,include:()=>Fe,includes:()=>Fe,indexBy:()=>Wc,indexOf:()=>$o,initial:()=>Fn,inject:()=>Xo,intersection:()=>ys,invert:()=>bn,invoke:()=>qc,isArguments:()=>Pr,isArray:()=>ze,isArrayBuffer:()=>Fo,isBoolean:()=>pn,isDataView:()=>nr,isDate:()=>xc,isElement:()=>Pi,isEmpty:()=>Di,isEqual:()=>Li,isError:()=>Ec,isFinite:()=>ki,isFunction:()=>ue,isMap:()=>kc,isMatch:()=>wn,isNaN:()=>mn,isNull:()=>Mi,isNumber:()=>Oo,isObject:()=>Le,isRegExp:()=>Tc,isSet:()=>Oc,isString:()=>Sr,isSymbol:()=>Lo,isTypedArray:()=>No,isUndefined:()=>hn,isWeakMap:()=>Dc,isWeakSet:()=>Lc,iteratee:()=>kr,keys:()=>X,last:()=>ms,lastIndexOf:()=>Hc,map:()=>Ve,mapObject:()=>qi,matcher:()=>At,matches:()=>At,max:()=>Dn,memoize:()=>es,methods:()=>Rr,min:()=>cs,mixin:()=>Nn,negate:()=>cr,noop:()=>An,now:()=>Vt,object:()=>_s,omit:()=>Yc,once:()=>Vc,pairs:()=>Bi,partial:()=>Ht,partition:()=>Xc,pick:()=>Jo,pluck:()=>fr,property:()=>ur,propertyOf:()=>Gi,random:()=>Dr,range:()=>ws,reduce:()=>Xo,reduceRight:()=>ss,reject:()=>ls,rest:()=>dr,restArguments:()=>ae,result:()=>Yi,sample:()=>Ln,select:()=>nt,shuffle:()=>fs,size:()=>hs,some:()=>Ko,sortBy:()=>ds,sortedIndex:()=>jn,tail:()=>dr,take:()=>Qn,tap:()=>Vi,template:()=>Xi,templateSettings:()=>Bc,throttle:()=>ts,times:()=>Wi,toArray:()=>On,toPath:()=>Vo,transpose:()=>Qr,unescape:()=>Nc,union:()=>Jc,uniq:()=>Fr,unique:()=>Fr,uniqueId:()=>Ki,unzip:()=>Qr,values:()=>Ze,where:()=>us,without:()=>Kc,wrap:()=>ns,zip:()=>Zc});var Ro="1.13.6",xi=typeof self=="object"&&self.self===self&&self||typeof window=="object"&&window.global===window&&window||Function("return this")()||{},dn=Array.prototype,ko=Object.prototype,Ti=typeof Symbol!="undefined"?Symbol.prototype:null,mc=dn.push,Et=dn.slice,Rt=ko.toString,vc=ko.hasOwnProperty,Ei=typeof ArrayBuffer!="undefined",gc=typeof DataView!="undefined",yc=Array.isArray,Ai=Object.keys,Ii=Object.create,Ci=Ei&&ArrayBuffer.isView,_c=isNaN,wc=isFinite,Do=!{toString:null}.propertyIsEnumerable("toString"),Si=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],bc=Math.pow(2,53)-1;function ae(e,t){return t=t==null?e.length-1:+t,function(){for(var r=Math.max(arguments.length-t,0),n=Array(r),o=0;o<r;o++)n[o]=arguments[o+t];switch(t){case 0:return e.call(this,n);case 1:return e.call(this,arguments[0],n);case 2:return e.call(this,arguments[0],arguments[1],n)}var a=Array(t+1);for(o=0;o<t;o++)a[o]=arguments[o];return a[t]=n,e.apply(this,a)}}function Le(e){var t=typeof e;return t==="function"||t==="object"&&!!e}function Mi(e){return e===null}function hn(e){return e===void 0}function pn(e){return e===!0||e===!1||Rt.call(e)==="[object Boolean]"}function Pi(e){return!!(e&&e.nodeType===1)}function J(e){var t="[object "+e+"]";return function(r){return Rt.call(r)===t}}var Sr=J("String");var Oo=J("Number");var xc=J("Date");var Tc=J("RegExp");var Ec=J("Error");var Lo=J("Symbol");var Fo=J("ArrayBuffer");var Ac=J("Function"),v0=xi.document&&xi.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof v0!="function"&&(Ac=function(e){return typeof e=="function"||!1});var ue=Ac;var ji=J("Object");var Qo=gc&&ji(new DataView(new ArrayBuffer(8))),Mr=typeof Map!="undefined"&&ji(new Map);var g0=J("DataView");function y0(e){return e!=null&&ue(e.getInt8)&&Fo(e.buffer)}var nr=Qo?y0:g0;var ze=yc||J("Array");function Ie(e,t){return e!=null&&vc.call(e,t)}var Ri=J("Arguments");(function(){Ri(arguments)||(Ri=function(e){return Ie(e,"callee")})})();var Pr=Ri;function ki(e){return!Lo(e)&&wc(e)&&!isNaN(parseFloat(e))}function mn(e){return Oo(e)&&_c(e)}function vn(e){return function(){return e}}function gn(e){return function(t){var r=e(t);return typeof r=="number"&&r>=0&&r<=bc}}function yn(e){return function(t){return t==null?void 0:t[e]}}var or=yn("byteLength");var Ic=gn(or);var _0=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function w0(e){return Ci?Ci(e)&&!nr(e):Ic(e)&&_0.test(Rt.call(e))}var No=Ei?w0:vn(!1);var ce=yn("length");function b0(e){for(var t={},r=e.length,n=0;n<r;++n)t[e[n]]=!0;return{contains:function(o){return t[o]===!0},push:function(o){return t[o]=!0,e.push(o)}}}function _n(e,t){t=b0(t);var r=Si.length,n=e.constructor,o=ue(n)&&n.prototype||ko,a="constructor";for(Ie(e,a)&&!t.contains(a)&&t.push(a);r--;)a=Si[r],a in e&&e[a]!==o[a]&&!t.contains(a)&&t.push(a)}function X(e){if(!Le(e))return[];if(Ai)return Ai(e);var t=[];for(var r in e)Ie(e,r)&&t.push(r);return Do&&_n(e,t),t}function Di(e){if(e==null)return!0;var t=ce(e);return typeof t=="number"&&(ze(e)||Sr(e)||Pr(e))?t===0:ce(X(e))===0}function wn(e,t){var r=X(t),n=r.length;if(e==null)return!n;for(var o=Object(e),a=0;a<n;a++){var i=r[a];if(t[i]!==o[i]||!(i in o))return!1}return!0}function z(e){if(e instanceof z)return e;if(!(this instanceof z))return new z(e);this._wrapped=e}z.VERSION=Ro;z.prototype.value=function(){return this._wrapped};z.prototype.valueOf=z.prototype.toJSON=z.prototype.value;z.prototype.toString=function(){return String(this._wrapped)};function Bo(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,or(e))}var Cc="[object DataView]";function Oi(e,t,r,n){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var o=typeof e;return o!=="function"&&o!=="object"&&typeof t!="object"?!1:Sc(e,t,r,n)}function Sc(e,t,r,n){e instanceof z&&(e=e._wrapped),t instanceof z&&(t=t._wrapped);var o=Rt.call(e);if(o!==Rt.call(t))return!1;if(Qo&&o=="[object Object]"&&nr(e)){if(!nr(t))return!1;o=Cc}switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return Ti.valueOf.call(e)===Ti.valueOf.call(t);case"[object ArrayBuffer]":case Cc:return Sc(Bo(e),Bo(t),r,n)}var a=o==="[object Array]";if(!a&&No(e)){var i=or(e);if(i!==or(t))return!1;if(e.buffer===t.buffer&&e.byteOffset===t.byteOffset)return!0;a=!0}if(!a){if(typeof e!="object"||typeof t!="object")return!1;var l=e.constructor,c=t.constructor;if(l!==c&&!(ue(l)&&l instanceof l&&ue(c)&&c instanceof c)&&"constructor"in e&&"constructor"in t)return!1}r=r||[],n=n||[];for(var s=r.length;s--;)if(r[s]===e)return n[s]===t;if(r.push(e),n.push(t),a){if(s=e.length,s!==t.length)return!1;for(;s--;)if(!Oi(e[s],t[s],r,n))return!1}else{var u=X(e),f;if(s=u.length,X(t).length!==s)return!1;for(;s--;)if(f=u[s],!(Ie(t,f)&&Oi(e[f],t[f],r,n)))return!1}return r.pop(),n.pop(),!0}function Li(e,t){return Oi(e,t)}function ft(e){if(!Le(e))return[];var t=[];for(var r in e)t.push(r);return Do&&_n(e,t),t}function jr(e){var t=ce(e);return function(r){if(r==null)return!1;var n=ft(r);if(ce(n))return!1;for(var o=0;o<t;o++)if(!ue(r[e[o]]))return!1;return e!==Ni||!ue(r[Fi])}}var Fi="forEach",Mc="has",Qi=["clear","delete"],Pc=["get",Mc,"set"],jc=Qi.concat(Fi,Pc),Ni=Qi.concat(Pc),Rc=["add"].concat(Qi,Fi,Mc);var kc=Mr?jr(jc):J("Map");var Dc=Mr?jr(Ni):J("WeakMap");var Oc=Mr?jr(Rc):J("Set");var Lc=J("WeakSet");function Ze(e){for(var t=X(e),r=t.length,n=Array(r),o=0;o<r;o++)n[o]=e[t[o]];return n}function Bi(e){for(var t=X(e),r=t.length,n=Array(r),o=0;o<r;o++)n[o]=[t[o],e[t[o]]];return n}function bn(e){for(var t={},r=X(e),n=0,o=r.length;n<o;n++)t[e[r[n]]]=r[n];return t}function Rr(e){var t=[];for(var r in e)ue(e[r])&&t.push(r);return t.sort()}function ar(e,t){return function(r){var n=arguments.length;if(t&&(r=Object(r)),n<2||r==null)return r;for(var o=1;o<n;o++)for(var a=arguments[o],i=e(a),l=i.length,c=0;c<l;c++){var s=i[c];(!t||r[s]===void 0)&&(r[s]=a[s])}return r}}var zo=ar(ft);var ir=ar(X);var Uo=ar(ft,!0);function x0(){return function(){}}function xn(e){if(!Le(e))return{};if(Ii)return Ii(e);var t=x0();t.prototype=e;var r=new t;return t.prototype=null,r}function zi(e,t){var r=xn(e);return t&&ir(r,t),r}function Ui(e){return Le(e)?ze(e)?e.slice():zo({},e):e}function Vi(e,t){return t(e),e}function Vo(e){return ze(e)?e:[e]}z.toPath=Vo;function dt(e){return z.toPath(e)}function sr(e,t){for(var r=t.length,n=0;n<r;n++){if(e==null)return;e=e[t[n]]}return r?e:void 0}function Tn(e,t,r){var n=sr(e,dt(t));return hn(n)?r:n}function Hi(e,t){t=dt(t);for(var r=t.length,n=0;n<r;n++){var o=t[n];if(!Ie(e,o))return!1;e=e[o]}return!!r}function lr(e){return e}function At(e){return e=ir({},e),function(t){return wn(t,e)}}function ur(e){return e=dt(e),function(t){return sr(t,e)}}function ht(e,t,r){if(t===void 0)return e;switch(r==null?3:r){case 1:return function(n){return e.call(t,n)};case 3:return function(n,o,a){return e.call(t,n,o,a)};case 4:return function(n,o,a,i){return e.call(t,n,o,a,i)}}return function(){return e.apply(t,arguments)}}function En(e,t,r){return e==null?lr:ue(e)?ht(e,t,r):Le(e)&&!ze(e)?At(e):ur(e)}function kr(e,t){return En(e,t,1/0)}z.iteratee=kr;function ne(e,t,r){return z.iteratee!==kr?z.iteratee(e,t):En(e,t,r)}function qi(e,t,r){t=ne(t,r);for(var n=X(e),o=n.length,a={},i=0;i<o;i++){var l=n[i];a[l]=t(e[l],l,e)}return a}function An(){}function Gi(e){return e==null?An:function(t){return Tn(e,t)}}function Wi(e,t,r){var n=Array(Math.max(0,e));t=ht(t,r,1);for(var o=0;o<e;o++)n[o]=t(o);return n}function Dr(e,t){return t==null&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}var Vt=Date.now||function(){return new Date().getTime()};function In(e){var t=function(a){return e[a]},r="(?:"+X(e).join("|")+")",n=RegExp(r),o=RegExp(r,"g");return function(a){return a=a==null?"":""+a,n.test(a)?a.replace(o,t):a}}var Ho={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};var Fc=In(Ho);var Qc=bn(Ho);var Nc=In(Qc);var Bc=z.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var $i=/(.)^/,T0={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},E0=/\\|'|\r|\n|\u2028|\u2029/g;function A0(e){return"\\"+T0[e]}var I0=/^\s*(\w|\$)+\s*$/;function Xi(e,t,r){!t&&r&&(t=r),t=Uo({},t,z.templateSettings);var n=RegExp([(t.escape||$i).source,(t.interpolate||$i).source,(t.evaluate||$i).source].join("|")+"|$","g"),o=0,a="__p+='";e.replace(n,function(s,u,f,d,p){return a+=e.slice(o,p).replace(E0,A0),o=p+s.length,u?a+=`'+
((__t=(`+u+`))==null?'':_.escape(__t))+
'`:f?a+=`'+
((__t=(`+f+`))==null?'':__t)+
'`:d&&(a+=`';
`+d+`
__p+='`),s}),a+=`';
`;var i=t.variable;if(i){if(!I0.test(i))throw new Error("variable is not a bare identifier: "+i)}else a=`with(obj||{}){
`+a+`}
`,i="obj";a=`var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};
`+a+`return __p;
`;var l;try{l=new Function(i,"_",a)}catch(s){throw s.source=a,s}var c=function(s){return l.call(this,s,z)};return c.source="function("+i+`){
`+a+"}",c}function Yi(e,t,r){t=dt(t);var n=t.length;if(!n)return ue(r)?r.call(e):r;for(var o=0;o<n;o++){var a=e==null?void 0:e[t[o]];a===void 0&&(a=r,o=n),e=ue(a)?a.call(e):a}return e}var C0=0;function Ki(e){var t=++C0+"";return e?e+t:t}function Ji(e){var t=z(e);return t._chain=!0,t}function Cn(e,t,r,n,o){if(!(n instanceof t))return e.apply(r,o);var a=xn(e.prototype),i=e.apply(a,o);return Le(i)?i:a}var Zi=ae(function(e,t){var r=Zi.placeholder,n=function(){for(var o=0,a=t.length,i=Array(a),l=0;l<a;l++)i[l]=t[l]===r?arguments[o++]:t[l];for(;o<arguments.length;)i.push(arguments[o++]);return Cn(e,n,this,this,i)};return n});Zi.placeholder=z;var Ht=Zi;var qo=ae(function(e,t,r){if(!ue(e))throw new TypeError("Bind must be called on a function");var n=ae(function(o){return Cn(e,n,t,this,r.concat(o))});return n});var fe=gn(ce);function Ue(e,t,r,n){if(n=n||[],!t&&t!==0)t=1/0;else if(t<=0)return n.concat(e);for(var o=n.length,a=0,i=ce(e);a<i;a++){var l=e[a];if(fe(l)&&(ze(l)||Pr(l)))if(t>1)Ue(l,t-1,r,n),o=n.length;else for(var c=0,s=l.length;c<s;)n[o++]=l[c++];else r||(n[o++]=l)}return n}var zc=ae(function(e,t){t=Ue(t,!1,!1);var r=t.length;if(r<1)throw new Error("bindAll must be passed function names");for(;r--;){var n=t[r];e[n]=qo(e[n],e)}return e});function es(e,t){var r=function(n){var o=r.cache,a=""+(t?t.apply(this,arguments):n);return Ie(o,a)||(o[a]=e.apply(this,arguments)),o[a]};return r.cache={},r}var Go=ae(function(e,t,r){return setTimeout(function(){return e.apply(null,r)},t)});var Uc=Ht(Go,z,1);function ts(e,t,r){var n,o,a,i,l=0;r||(r={});var c=function(){l=r.leading===!1?0:Vt(),n=null,i=e.apply(o,a),n||(o=a=null)},s=function(){var u=Vt();!l&&r.leading===!1&&(l=u);var f=t-(u-l);return o=this,a=arguments,f<=0||f>t?(n&&(clearTimeout(n),n=null),l=u,i=e.apply(o,a),n||(o=a=null)):!n&&r.trailing!==!1&&(n=setTimeout(c,f)),i};return s.cancel=function(){clearTimeout(n),l=0,n=o=a=null},s}function rs(e,t,r){var n,o,a,i,l,c=function(){var u=Vt()-o;t>u?n=setTimeout(c,t-u):(n=null,r||(i=e.apply(l,a)),n||(a=l=null))},s=ae(function(u){return l=this,a=u,o=Vt(),n||(n=setTimeout(c,t),r&&(i=e.apply(l,a))),i});return s.cancel=function(){clearTimeout(n),n=a=l=null},s}function ns(e,t){return Ht(t,e)}function cr(e){return function(){return!e.apply(this,arguments)}}function os(){var e=arguments,t=e.length-1;return function(){for(var r=t,n=e[t].apply(this,arguments);r--;)n=e[r].call(this,n);return n}}function as(e,t){return function(){if(--e<1)return t.apply(this,arguments)}}function Sn(e,t){var r;return function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=null),r}}var Vc=Ht(Sn,2);function Mn(e,t,r){t=ne(t,r);for(var n=X(e),o,a=0,i=n.length;a<i;a++)if(o=n[a],t(e[o],o,e))return o}function Pn(e){return function(t,r,n){r=ne(r,n);for(var o=ce(t),a=e>0?0:o-1;a>=0&&a<o;a+=e)if(r(t[a],a,t))return a;return-1}}var Or=Pn(1);var Wo=Pn(-1);function jn(e,t,r,n){r=ne(r,n,1);for(var o=r(t),a=0,i=ce(e);a<i;){var l=Math.floor((a+i)/2);r(e[l])<o?a=l+1:i=l}return a}function Rn(e,t,r){return function(n,o,a){var i=0,l=ce(n);if(typeof a=="number")e>0?i=a>=0?a:Math.max(a+l,i):l=a>=0?Math.min(a+1,l):a+l+1;else if(r&&a&&l)return a=r(n,o),n[a]===o?a:-1;if(o!==o)return a=t(Et.call(n,i,l),mn),a>=0?a+i:-1;for(a=e>0?i:l-1;a>=0&&a<l;a+=e)if(n[a]===o)return a;return-1}}var $o=Rn(1,Or,jn);var Hc=Rn(-1,Wo);function Lr(e,t,r){var n=fe(e)?Or:Mn,o=n(e,t,r);if(o!==void 0&&o!==-1)return e[o]}function is(e,t){return Lr(e,At(t))}function Ce(e,t,r){t=ht(t,r);var n,o;if(fe(e))for(n=0,o=e.length;n<o;n++)t(e[n],n,e);else{var a=X(e);for(n=0,o=a.length;n<o;n++)t(e[a[n]],a[n],e)}return e}function Ve(e,t,r){t=ne(t,r);for(var n=!fe(e)&&X(e),o=(n||e).length,a=Array(o),i=0;i<o;i++){var l=n?n[i]:i;a[i]=t(e[l],l,e)}return a}function kn(e){var t=function(r,n,o,a){var i=!fe(r)&&X(r),l=(i||r).length,c=e>0?0:l-1;for(a||(o=r[i?i[c]:c],c+=e);c>=0&&c<l;c+=e){var s=i?i[c]:c;o=n(o,r[s],s,r)}return o};return function(r,n,o,a){var i=arguments.length>=3;return t(r,ht(n,a,4),o,i)}}var Xo=kn(1);var ss=kn(-1);function nt(e,t,r){var n=[];return t=ne(t,r),Ce(e,function(o,a,i){t(o,a,i)&&n.push(o)}),n}function ls(e,t,r){return nt(e,cr(ne(t)),r)}function Yo(e,t,r){t=ne(t,r);for(var n=!fe(e)&&X(e),o=(n||e).length,a=0;a<o;a++){var i=n?n[a]:a;if(!t(e[i],i,e))return!1}return!0}function Ko(e,t,r){t=ne(t,r);for(var n=!fe(e)&&X(e),o=(n||e).length,a=0;a<o;a++){var i=n?n[a]:a;if(t(e[i],i,e))return!0}return!1}function Fe(e,t,r,n){return fe(e)||(e=Ze(e)),(typeof r!="number"||n)&&(r=0),$o(e,t,r)>=0}var qc=ae(function(e,t,r){var n,o;return ue(t)?o=t:(t=dt(t),n=t.slice(0,-1),t=t[t.length-1]),Ve(e,function(a){var i=o;if(!i){if(n&&n.length&&(a=sr(a,n)),a==null)return;i=a[t]}return i==null?i:i.apply(a,r)})});function fr(e,t){return Ve(e,ur(t))}function us(e,t){return nt(e,At(t))}function Dn(e,t,r){var n=-1/0,o=-1/0,a,i;if(t==null||typeof t=="number"&&typeof e[0]!="object"&&e!=null){e=fe(e)?e:Ze(e);for(var l=0,c=e.length;l<c;l++)a=e[l],a!=null&&a>n&&(n=a)}else t=ne(t,r),Ce(e,function(s,u,f){i=t(s,u,f),(i>o||i===-1/0&&n===-1/0)&&(n=s,o=i)});return n}function cs(e,t,r){var n=1/0,o=1/0,a,i;if(t==null||typeof t=="number"&&typeof e[0]!="object"&&e!=null){e=fe(e)?e:Ze(e);for(var l=0,c=e.length;l<c;l++)a=e[l],a!=null&&a<n&&(n=a)}else t=ne(t,r),Ce(e,function(s,u,f){i=t(s,u,f),(i<o||i===1/0&&n===1/0)&&(n=s,o=i)});return n}var S0=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function On(e){return e?ze(e)?Et.call(e):Sr(e)?e.match(S0):fe(e)?Ve(e,lr):Ze(e):[]}function Ln(e,t,r){if(t==null||r)return fe(e)||(e=Ze(e)),e[Dr(e.length-1)];var n=On(e),o=ce(n);t=Math.max(Math.min(t,o),0);for(var a=o-1,i=0;i<t;i++){var l=Dr(i,a),c=n[i];n[i]=n[l],n[l]=c}return n.slice(0,t)}function fs(e){return Ln(e,1/0)}function ds(e,t,r){var n=0;return t=ne(t,r),fr(Ve(e,function(o,a,i){return{value:o,index:n++,criteria:t(o,a,i)}}).sort(function(o,a){var i=o.criteria,l=a.criteria;if(i!==l){if(i>l||i===void 0)return 1;if(i<l||l===void 0)return-1}return o.index-a.index}),"value")}function kt(e,t){return function(r,n,o){var a=t?[[],[]]:{};return n=ne(n,o),Ce(r,function(i,l){var c=n(i,l,r);e(a,i,c)}),a}}var Gc=kt(function(e,t,r){Ie(e,r)?e[r].push(t):e[r]=[t]});var Wc=kt(function(e,t,r){e[r]=t});var $c=kt(function(e,t,r){Ie(e,r)?e[r]++:e[r]=1});var Xc=kt(function(e,t,r){e[r?0:1].push(t)},!0);function hs(e){return e==null?0:fe(e)?e.length:X(e).length}function ps(e,t,r){return t in r}var Jo=ae(function(e,t){var r={},n=t[0];if(e==null)return r;ue(n)?(t.length>1&&(n=ht(n,t[1])),t=ft(e)):(n=ps,t=Ue(t,!1,!1),e=Object(e));for(var o=0,a=t.length;o<a;o++){var i=t[o],l=e[i];n(l,i,e)&&(r[i]=l)}return r});var Yc=ae(function(e,t){var r=t[0],n;return ue(r)?(r=cr(r),t.length>1&&(n=t[1])):(t=Ve(Ue(t,!1,!1),String),r=function(o,a){return!Fe(t,a)}),Jo(e,r,n)});function Fn(e,t,r){return Et.call(e,0,Math.max(0,e.length-(t==null||r?1:t)))}function Qn(e,t,r){return e==null||e.length<1?t==null||r?void 0:[]:t==null||r?e[0]:Fn(e,e.length-t)}function dr(e,t,r){return Et.call(e,t==null||r?1:t)}function ms(e,t,r){return e==null||e.length<1?t==null||r?void 0:[]:t==null||r?e[e.length-1]:dr(e,Math.max(0,e.length-t))}function vs(e){return nt(e,Boolean)}function gs(e,t){return Ue(e,t,!1)}var Zo=ae(function(e,t){return t=Ue(t,!0,!0),nt(e,function(r){return!Fe(t,r)})});var Kc=ae(function(e,t){return Zo(e,t)});function Fr(e,t,r,n){pn(t)||(n=r,r=t,t=!1),r!=null&&(r=ne(r,n));for(var o=[],a=[],i=0,l=ce(e);i<l;i++){var c=e[i],s=r?r(c,i,e):c;t&&!r?((!i||a!==s)&&o.push(c),a=s):r?Fe(a,s)||(a.push(s),o.push(c)):Fe(o,c)||o.push(c)}return o}var Jc=ae(function(e){return Fr(Ue(e,!0,!0))});function ys(e){for(var t=[],r=arguments.length,n=0,o=ce(e);n<o;n++){var a=e[n];if(!Fe(t,a)){var i;for(i=1;i<r&&Fe(arguments[i],a);i++);i===r&&t.push(a)}}return t}function Qr(e){for(var t=e&&Dn(e,ce).length||0,r=Array(t),n=0;n<t;n++)r[n]=fr(e,n);return r}var Zc=ae(Qr);function _s(e,t){for(var r={},n=0,o=ce(e);n<o;n++)t?r[e[n]]=t[n]:r[e[n][0]]=e[n][1];return r}function ws(e,t,r){t==null&&(t=e||0,e=0),r||(r=t<e?-1:1);for(var n=Math.max(Math.ceil((t-e)/r),0),o=Array(n),a=0;a<n;a++,e+=r)o[a]=e;return o}function bs(e,t){if(t==null||t<1)return[];for(var r=[],n=0,o=e.length;n<o;)r.push(Et.call(e,n,n+=t));return r}function Nr(e,t){return e._chain?z(t).chain():t}function Nn(e){return Ce(Rr(e),function(t){var r=z[t]=e[t];z.prototype[t]=function(){var n=[this._wrapped];return mc.apply(n,arguments),Nr(this,r.apply(z,n))}}),z}Ce(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=dn[e];z.prototype[e]=function(){var r=this._wrapped;return r!=null&&(t.apply(r,arguments),(e==="shift"||e==="splice")&&r.length===0&&delete r[0]),Nr(this,r)}});Ce(["concat","join","slice"],function(e){var t=dn[e];z.prototype[e]=function(){var r=this._wrapped;return r!=null&&(r=t.apply(r,arguments)),Nr(this,r)}});var ef=z;var Ts=Nn(xs);Ts._=Ts;var He=Ts;var ta,Es=Backbone.Radio.channel("events"),M0=function(){typeof ta!="undefined"&&ta.each(function(){var e=jQuery(this),t=e.data("config");It(e,t)})},It=function(e,t){var r=g.screenSize,n=t[r].colGutter,o=t[r].colCount,a=typeof t[r].rowGutterMu=="undefined"?"%":t[r].rowGutterMu,i=typeof t[r].colGutterMu=="undefined"?"%":t[r].colGutterMu,l=(1-1/o)*t[r].colGutter,c="calc( 100% / "+o+" - "+l+i+")";e.find(".thumbnail-wrap").css({width:c,"margin-bottom":t[r].rowGutter+a});var s=t.layoutType;switch(s){case"masonry":e.find(".lay-thumbnailgrid-gutter-sizer").css("width",n+i),e.find(".lay-thumbnailgrid-col-sizer").css("width",c);var u=e.data("masonry");typeof u!="undefined"&&u.layout();break;default:e.find(".thumb-collection").css("gap",n+i);break}},Br=function(e,t){var r=g.screenSize;switch(t.layoutType){case"masonry":e.find(".thumb-collection").append('<div class="lay-thumbnailgrid-gutter-sizer"></div><div class="lay-thumbnailgrid-col-sizer"></div>');var n=e.find(".thumb-collection")[0],o=".lay-thumbnailgrid-gutter-sizer",a=typeof t[r].colGutterMu=="undefined"?"%":t[r].colGutterMu;a==="px"&&(o=t[r].colGutter);var i=new Masonry(n,{itemSelector:".thumbnail-wrap",columnWidth:".lay-thumbnailgrid-col-sizer",gutter:o,percentPosition:!0,transitionDuration:0});i.once("layoutComplete",function(){e.closest(".col").addClass("masonry-initialized")}),e.data("masonry",i);break;default:break}},P0=function(){Q0(),jQuery(window).on("window_width_changed",M0),R0(),j0()},rf=function(){var e=window.location.hash;if(ra!=null){var t=ra.find(".thumbs-collection-region.use-filter");t.length>0&&t.each(function(){var r=jQuery(this);Is(r);var n,o=[];if(e.startsWith("#category-")){var a=e.substr(10),i=jQuery('[data-slug="'+a+'"]');i.length>0&&(n=i.attr("data-id"),o=zn(r),Bn(r,n,!0,o))}else if(e==""){var i=jQuery(".lay-filter-default");i.length>0&&(n=i.attr("data-id"),o=zn(r),Bn(r,n,!0,o))}na(r,n,o)})}},j0=function(){jQuery(window).on("hashchange",rf)},na=function(e,t,r){var n=e.data("config"),o=!1;n!=!1&&He.has(n,"showfilter")&&(o=n.showfilter);var a="OR";n!=!1&&He.has(n,"tagFilterBehaviour")&&(a=n.tagFilterBehaviour);var i=!1;n!=!1&&He.has(n,"showtagfilter")&&(i=n.showtagfilter);var l=[];o==!0?e.find('.thumbnail-wrap[data-filterid="'+t+'"]').each(function(){for(var m=jQuery(this).attr("data-tags"),w=M.parseIdsString(m),y=0;y<w.length;y++){var I=w[y];l.indexOf(I)==-1&&l.push(I)}}):i==!0&&o==!1&&(e.find(".thumbnail-wrap").each(function(){for(var m=jQuery(this).attr("data-tags"),w=M.parseIdsString(m),y=0;y<w.length;y++){var I=w[y];l.indexOf(I)==-1&&l.push(I)}}),e.find(".tag-bubble:not(.deselect-tags)").each(function(){var m=parseInt(jQuery(this).attr("data-tag_id"),10);l.indexOf(m)==-1&&jQuery(this).remove()}));var c=e.find(".tag-bubble.lay-tag-active");switch(c.length>0?e.find(".deselect-tags").css("display","").removeClass("lay-filter-hidden"):e.find(".deselect-tags").addClass("lay-filter-hidden"),a){case"AND":var c=e.find(".tag-bubble.lay-tag-active");if(c.length>0){var s=[];c.each(function(){s.push(parseInt(jQuery(this).attr("data-tag_id"),10))});for(var u=[],f=0;f<r.length;f++){var d=r[f];d.show==!0&&(u=He.union(d.ids,u))}for(var f=0;f<l.length;f++){var p=l[f];s.length>0&&He.intersection(s,u).length>0&&u.indexOf(p)!=-1?e.find('.tag-bubble[data-tag_id="'+p+'"]').css("display",""):e.find('.tag-bubble[data-tag_id="'+p+'"]').css("display","none")}}else{e.find(".tag-bubble:not(.deselect-tags)").css("display","none");for(var f=0;f<l.length;f++){var p=l[f];e.find('.tag-bubble[data-tag_id="'+p+'"]').css("display","")}}break;case"OR":default:if(o){e.find(".tag-bubble:not(.deselect-tags)").css("display","none");for(var f=0;f<l.length;f++){var p=l[f];e.find('.tag-bubble[data-tag_id="'+p+'"]').css("display","")}}break}},Is=function(e,t){var r=e.find(".lay-thumbnailgrid-tagfilter");t!=null&&t!=!1&&t.length>0?t.removeClass("lay-tag-active"):e.find(".tag-bubble").removeClass("lay-tag-active");var n=r.find(".tag-bubble"),o=[],a=e.data("config"),i=a!=!1&&He.has(a,"reorder_tags")?a.reorder_tags:!0;if(i){n.each(function(){if(!jQuery(this).hasClass("lay-tag-active")){var s=jQuery(this).attr("data-ix");o.push([this,s])}}),o.sort(function(s,u){return s[1]==u[1]?0:s[1]>u[1]?1:-1});var l="";r.find(".deselect-tags").length>0&&(l+=r.find(".deselect-tags")[0].outerHTML),r.find(".lay-tag-active").each(function(){l+=this.outerHTML});for(var c=0;c<o.length;c++)o[c][0].classList.contains("deselect-tags")||(l+=o[c][0].outerHTML);r.html(l)}},ra=void 0,R0=function(){window.laytheme.on("content_ready",function(e){ra=Me(e);var t=ra.find(".thumbs-collection-region");t.length>0&&t.each(function(){var r=jQuery(this),n=r.data("config"),o=!1;k0(r,n),Br(r,n),It(r,n);var a=window.location.hash;if(a.startsWith("#category-")&&jQuery(this).hasClass("use-filter")){var i=a.substring(10),l=jQuery(this).find('[data-slug="'+i+'"]');if(l.length>0){o=l.attr("data-id");var c=zn(r);Bn(r,o,!1,c)}}else o=n.cat_id,ea(r,n);na(r,o,c),L0(r),O0(r),D0(r),r.addClass("initialized")}),t.each(function(){var r=jQuery(this),n=r.data("config");Br(r,n),It(r,n),jQuery(this).addClass("sized")}),M.setImageSizesAttribute(t)})},k0=function(e,t){if(t.randomorder&&!e.hasClass("was-randomized")){var r=e.find(".thumbnail-wrap").toArray();let n=r.map(o=>({value:o,sort:Math.random()})).sort((o,a)=>o.sort-a.sort).map(({value:o})=>o);e.find(".thumb-collection").html(n),e.addClass("was-randomized")}},ea=function(e,t){if((e.hasClass("use-filter")||e.hasClass("use-tags-filter"))&&He.has(t,"limitThumbnails")&&t.limitThumbnails>0){let r=0,n=e.find(".show-filtered").length>0;e.find(".thumbnail-wrap").each(function(){(jQuery(this).hasClass("show-filtered")||!n)&&(r++,r>t.limitThumbnails?jQuery(this).addClass("hide-because-limit"):jQuery(this).removeClass("hide-because-limit"))})}},D0=function(e){e.off("click",".deselect-tags"),e.on("click",".deselect-tags",function(t){jQuery(this).addClass("lay-filter-hidden");var r=jQuery(t.delegateTarget);Is(r);var n=r.find(".lay-thumbnailgrid-filter-anchor.lay-filter-active"),o=!1;n.length>0&&(o=parseInt(r.find(".lay-thumbnailgrid-filter-anchor.lay-filter-active").attr("data-id"),10));var a=zn(r);Bn(r,o,!0,a);var i=r.data("config"),l="OR";i!=!1&&He.has(i,"tagFilterBehaviour")&&(l=i.tagFilterBehaviour,l=l.toUpperCase()),l=="AND"&&na(r,o,a)})},O0=function(e){e.off("click",".tag-bubble:not(.deselect-tags)"),e.on("click",".tag-bubble:not(.deselect-tags)",function(t){var r=jQuery(t.delegateTarget),n=jQuery(this),o=r.find(".lay-thumbnailgrid-tagfilter"),a=r.data("config"),i=a!=!1&&He.has(a,"reorder_tags")?a.reorder_tags:!0;if(n.hasClass("lay-tag-active"))Is(r,n);else{if(i){var l=o.find(".lay-tag-active").last();l.length>0?n.insertAfter(l):r.find(".deselect-tags").length>0?n.insertAfter(r.find(".deselect-tags")):o.prepend(n)}n.addClass("lay-tag-active");var c=r[0].querySelector(".lay-thumbnailgrid-tagfilter.mobile-one-line"),s=!0;a.hasOwnProperty("reorder_tags")&&(s=a.reorder_tags),c&&s&&c.scrollTo({top:0,left:0,behavior:"smooth"})}var u=r.find(".lay-thumbnailgrid-filter-anchor.lay-filter-active"),f=!1;u.length>0&&(f=parseInt(r.find(".lay-thumbnailgrid-filter-anchor.lay-filter-active").attr("data-id"),10));var d=zn(r);Bn(r,f,!0,d),na(r,f,d)})},L0=function(e){e.off("click",".lay-thumbnailgrid-filter-anchor"),e.on("click",".lay-thumbnailgrid-filter-anchor",function(t){if(jQuery(this).hasClass("lay-filter-active"))jQuery(t.delegateTarget).find(".lay-tag-active").length>0&&rf();else{var r=jQuery(this).attr("data-slug");window.location.hash="category-"+r}})},Bn=function(e,t,r=!0,n=[]){e.find(".lay-filter-active").removeClass("lay-filter-active"),t!==!1&&jQuery('.lay-thumbnailgrid-filter-anchor[data-id="'+t+'"]').addClass("lay-filter-active");var o=e.find(".thumbnail-wrap"),a=e.data("config");if(frontendPassedData.tgf_transition=="fade_out_fade_in"&&r)e.addClass("lay-disable-click lay-transition"),e.find(".thumb-collection").css("opacity",0),setTimeout(function(){switch(As(n),ea(e,a),a.layoutType){case"masonry":It(e,a);break;default:Br(e,a),It(e,a);break}M.setImageSizesAttribute(e),tf(o,function(){e.find(".thumb-collection").css("opacity",1),setTimeout(function(){e.removeClass("lay-disable-click lay-transition")},500)}),Es.trigger("thumbnailGridWasFiltered")},500);else if(frontendPassedData.tgf_transition=="fade_out_fade_in_2"&&r)e.addClass("lay-disable-click"),o.css("transitionDelay","0ms"),o.removeClass("in-view").addClass("below"),setTimeout(function(){switch(As(n),ea(e,a),a.layoutType){case"masonry":It(e,a);break;default:Br(e,a),It(e,a);break}M.setImageSizesAttribute(e),tf(o,function(){var i=0;o.each(function(){var l=jQuery(this);l.css("display")=="block"?(l[0].style.transitionDelay=i*100+"ms",i++,l.removeClass("below").addClass("in-view")):l.removeClass("below in-view")}),e.removeClass("lay-disable-click")}),Es.trigger("thumbnailGridWasFiltered")},550);else{switch(As(n),ea(e,a),a.layoutType){case"masonry":It(e,a);break;default:Br(e,a),It(e,a);break}M.setImageSizesAttribute(e),Es.trigger("thumbnailGridWasFiltered")}},zn=function(e){var t=window.location.hash,r=!1;if(t.startsWith("#category-")){var n=t.substr(10),o=jQuery('[data-slug="'+n+'"]');o.length>0&&(r=o.attr("data-id"))}else if(t==""){var o=jQuery(".lay-filter-default");o.length>0&&(r=o.attr("data-id"))}var a=[];e.find(".tag-bubble.lay-tag-active").each(function(){var u=parseInt(jQuery(this).attr("data-tag_id"),10);a.push(u)});var i=e.find(".thumbnail-wrap"),l=e.data("config"),c=[],s="OR";return l!=!1&&He.has(l,"tagFilterBehaviour")&&(s=l.tagFilterBehaviour,s=s.toUpperCase()),i.each(function(){var u=jQuery(this),f=u.attr("data-tags"),d=M.parseIdsString(f),p={show:!1,$el:u,ids:d},m=!1;switch(s){case"AND":m=He.intersection(d,a).length==a.length;break;case"OR":default:m=He.intersection(d,a).length>0;break}a.length==0&&r!==!1&&parseInt(u.attr("data-filterid"),10)==r||a.length>0&&m&&r!==!1&&parseInt(u.attr("data-filterid"),10)==r||a.length>0&&m&&r===!1||r===!1&&a.length==0?p.show=!0:p.show=!1,c.push(p)}),c},As=function(e){for(var t=0;t<e.length;t++){var r=e[t];r.show==!0?r.$el.css("display","block").addClass("show-filtered").removeClass("hide-filtered"):r.$el.css("display","none").addClass("hide-filtered").removeClass("show-filtered")}},F0=function(e,t,r){return e==!0},tf=function(e,t){var r=[],n=[];e.find("img").each(function(){_t.isInsideViewportHeight(this,90)&&(r.push(this),n.push(!1))});for(var o=0;o<r.length;o++)(function(i){var l=jQuery(r[i]);if(l.hasClass("loaded")||l.hasClass("lazyloaded"))n[i]=!0;else{var c=new MutationObserver(()=>{(l.hasClass("loaded")||l.hasClass("lazyloaded"))&&(n[i]=!0)});c.observe(l[0],{attributes:!0,attributeFilter:["class"]})}})(o);if(r.length>0)var a=setInterval(function(){n.every(F0)&&(t(),clearInterval(a))},30);else t()},Q0=function(){window.laytheme.on("searchresultshown",function(){ta=jQuery(".thumbs-collection-region"),ta.each(function(){if(!jQuery(this).hasClass("initialized")){var e=jQuery(this),t=e.data("config");Br(e,t),It(e,t),jQuery(this).addClass("initialized sized"),t.layoutType=="masonry"&&e.closest(".col").addClass("masonry-initialized")}})})},N0={initModule:P0},nf=N0;var qt,B0=function(){typeof qt!="undefined"&&qt.each(function(){var e=jQuery(this),t=e.data("config");af(e,t)})},af=function(e,t){var r=g.screenSize,n=t[r].colGutter,o=t[r].colCount,a=typeof t[r].rowGutterMu=="undefined"?"%":t[r].rowGutterMu,i=typeof t[r].colGutterMu=="undefined"?"%":t[r].colGutterMu,l=(1-1/o)*t[r].colGutter,c="calc( 100% / "+o+" - "+l+i+")",s={desktop:200,tablet:150,phone:80};let u=typeof t[r].elementHeight=="undefined"?s[r]:t[r].elementHeight;var f=t.layoutType;switch(f){case"masonry":e.find(".element-wrap").css({width:c,"margin-bottom":t[r].rowGutter+a}),e.find(".lay-elementgrid-gutter-sizer").css("width",n+i),e.find(".lay-elementgrid-col-sizer").css("width",c),sf(e,t);break;case"same-height":e.find(".element-wrap").css({"margin-bottom":t[r].rowGutter+a}).find("img, video").css("height",u+"px"),e.find(".element-wrap").css("margin-right",n+i);break;default:e.find(".element-wrap").css({width:c,"margin-bottom":t[r].rowGutter+a}),e.find(".element-wrap").css("margin-right",n+i),e.find(".element-wrap:nth-child("+o+"n)").css("margin-right",0);break}},sf=function(e,t){var r=g.screenSize;switch(t.layoutType){case"masonry":e.find(".lay-elementgrid-gutter-sizer").length==0&&e.find(".element-collection").append('<div class="lay-elementgrid-gutter-sizer"></div><div class="lay-elementgrid-col-sizer"></div>');var n=e.find(".element-collection")[0],o=".lay-elementgrid-gutter-sizer",a=typeof t[r].colGutterMu=="undefined"?"%":t[r].colGutterMu;a==="px"&&(o=t[r].colGutter);var i=new Masonry(n,{itemSelector:".element-wrap",columnWidth:".lay-elementgrid-col-sizer",gutter:o,percentPosition:!0,transitionDuration:0});i.once("layoutComplete",function(){e.closest(".col").addClass("masonry-initialized")}),e.data("masonry",i);break;case"same-height":var l=e.find(".element-wrap"),c=e.find(".elementgrid-row .element-wrap");c.length>0&&c.unwrap();break;default:var l=e.find(".element-wrap"),c=e.find(".elementgrid-row .element-wrap");c.length>0&&c.unwrap();for(var s=t[r].colCount,u=0;u<l.length;u+=s)l.slice(u,u+s).wrapAll('<div class="elementgrid-row '+t.layoutType+'"></div>');break}},of=function(){typeof qt!="undefined"&&qt.each(function(){var e=jQuery(this),t=e.data("config"),r=t.layoutType;if(r==="masonry"){var n=e.data("masonry");typeof n!="undefined"&&n.layout()}})},z0=function(){jQuery(window).on("window_width_changed",of),window.laytheme.on("sizechanged",B0),U0(),setTimeout(function(){of()},1e3)},U0=function(){window.laytheme.on("content_ready",function(e){qt=void 0;var t;t=Me(e),qt=t.find(".elements-collection-region"),qt.each(function(){var r=jQuery(this),n=r.data("config");sf(r,n),af(r,n),this.classList.add("initialized"),n.layoutType=="masonry"&&r.closest(".col").addClass("masonry-initialized")}),M.setImageSizesAttribute(qt)})},V0={initModule:z0},lf=V0;var Vn=Xt(cf());document.fonts.onloadingdone=function(){setTimeout(function(){jQuery(window).trigger("resize")},0)};var Cs,Un=[],H0=function(){};var q0=function(e,t){this.control,this.marquee,this.wasInitialized,this.$marquee=e,this.config=t,this.resizeObserver=null,this.height=0,this.previousHeight=0;function r(){this.marquee!==null&&(this.control=(0,Vn.loop)(this.marquee,[]),this.marquee.clear(),e.empty())}function n(){var o=g.screenSize,a=e[0],i=this.config.speed,l=this.config.reversedirection,c=this.config.startonscreen,s=this.config.textformat,u=this.config.separator,f=this.config[o].imageheight,d=this.config.hasOwnProperty("startonhover")?this.config.startonhover:!1,p=this.config.elements;if(l===!1&&(i*=-1),d===!0&&(i=0),e.length>0&&e.is(":visible")){this.marquee=new Vn.Marquee(a,{rate:i,upDown:!1,startOnScreen:c});for(var m=[],w=0;w<p.length;w++)(function(y,I,R){var q=function(){var F=R[y],Q;switch(F.type){case"text":Q=jQuery(F.cont),Ka(Q),Za(Q),Q.addClass("_"+I+"_no_spaces");break;case"img":var L="";F.sizes.hasOwnProperty("full")&&(L=M.filterURL(F.sizes.full));var G=M.getImageSrcAndSrcSet(F),B=F.w/F.h*f,U="";if(F.hasOwnProperty("imagelink")&&F.imagelink!=null){var ie=F.imagelink.newtab?'target="_blank"':"";U+='<a href="'+M.filterURL(F.imagelink.url)+'" '+ie+' data-type="'+F.imagelink.type+'" data-id="'+F.imagelink.id+'" data-catid="['+F.imagelink.catid+']" data-title="'+F.imagelink.title+'">'}L.indexOf(".gif")!==-1||L.indexOf(".png")!==-1?U+='<img style="width:'+B+"px; height:"+f+'px;" src="'+L+'">':U+='<img sizes="'+B+'px" style="width:'+B+"px; height:"+f+'px;" src="'+G.src+'" srcset="'+G.srcset+'">',F.hasOwnProperty("imagelink")&&F.imagelink!=null&&(U+="</a>"),Q=jQuery(U);break}return Q[0]};m.push(q)})(w,s,p);this.control=(0,Vn.loop)(this.marquee,m,function(){var y=document.createElement("span");return y.classList.add("_"+s),y.innerHTML=u,y}),this.$marquee.data("lay-marquee",this.marquee)}this.wasInitialized=!0}this.init=n,this.destroy=r},G0=function(){jQuery(window).on("window_width_changed",H0),Y0(),X0(),$0()},W0=function(){if(Un.length>0){for(var e=0;e<Un.length;e++){var t=Un[e];t.destroy()}Un=[]}},$0=function(){jQuery("body").on("mouseenter",".marquee-start-on-hover",function(e){var t=jQuery(this).data("config"),r=t.speed,n=t.reversedirection;n==!1&&(r*=-1);var o=jQuery(this).data("lay-marquee");o.setRate(r)}).on("mouseleave",".marquee-start-on-hover",function(e){var t=jQuery(this).data("lay-marquee");t.setRate(0)})},X0=function(){jQuery("body").on("mouseenter",".marquee-pause-on-hover",function(e){var t=jQuery(this).data("lay-marquee");t.setRate(0)}).on("mouseleave",".marquee-pause-on-hover",function(e){var t=jQuery(this).data("config"),r=t.speed,n=t.reversedirection;n==!1&&(r*=-1);var o=jQuery(this).data("lay-marquee");o.setRate(r)})},Y0=function(){window.laytheme.on("content_ready",function(e){Cs=void 0;var t;switch(e){case"desktop":t=jQuery("#grid, .cover-region-desktop, #footer");break;case"phone":var r=jQuery("#footer-custom-phone-grid").length!=0,n=jQuery("#custom-phone-grid").length!=0;r&&n?t=jQuery("#custom-phone-grid, .cover-region-phone, #footer-custom-phone-grid"):!r&&n?t=jQuery("#custom-phone-grid, .cover-region-phone, #footer"):r&&!n?t=jQuery("#grid, .cover-region-desktop, #footer-custom-phone-grid"):!r&&!n&&(t=jQuery("#grid, .cover-region-desktop, #footer"));break}W0(),Cs=t.find(".lay-marquee"),Cs.each(function(){var o=jQuery(this);if(o){var a=o.data("config"),i=new q0(o,a);i.init(),Un.push(i)}})})},K0={initModule:G0},ff=K0;var Hn,J0=function(){typeof Hn!="undefined"&&Hn.each(function(){var e=jQuery(this),t=e.data("config");df(e,t),hf(e,t)})},aa=function(e){return isNaN(Number(e))||e.trim()===""},df=function(e,t){for(var r=t[g.screenSize].sortedColumns,n=[],o=[],a=0;a<r.length;a++){var i=r[a];n.push(i.name),o.push(i.visible)}var l=[],c=-1,s=-1;e.find(".lay-projectindex-filter").each(function(u){var f=0;this.classList.contains("lay-projectindex-filter-title")?f=n.indexOf("title"):this.classList.contains("lay-projectindex-filter-categories")?f=n.indexOf("categories"):this.classList.contains("lay-projectindex-filter-tags")?f=n.indexOf("tags"):this.classList.contains("lay-projectindex-filter-year")&&(f=n.indexOf("year")),jQuery(this).css("order",f),f>c&&o[f]==!0&&(c=f,s=u)}),e.find(".lay-projectindex-filter-wrap").find(".last-visible-projectindex-col").removeClass("last-visible-projectindex-col"),s!=-1&&e.find(".lay-projectindex-filter:nth-child("+(s+1)+")").addClass("last-visible-projectindex-col"),e.find(".lay-projectindex-row").each(function(){var u=jQuery(this),f=-1,d=-1;u.find(">div").each(function(p){var m=0;switch(this.classList[0]){case"lay-projectindex-col-title":m=n.indexOf("title");break;case"lay-projectindex-col-categories":m=n.indexOf("categories");break;case"lay-projectindex-col-tags":m=n.indexOf("tags");break;case"lay-projectindex-col-year":m=n.indexOf("year");break}jQuery(this).css("order",m),m>f&&o[m]==!0&&!this.classList.contains("lay-projectindex-col-empty")&&(f=m,d=p)}),u.find(".last-visible-projectindex-col").removeClass("last-visible-projectindex-col"),d!=-1&&u.find(">div:nth-child("+(d+1)+")").addClass("last-visible-projectindex-col")})},hf=function(e,t){for(var r=e.find(".lay-projectindex-col-title, .lay-projectindex-filter-title"),n=e.find(".lay-projectindex-col-categories, .lay-projectindex-filter-categories"),o=e.find(".lay-projectindex-col-tags, .lay-projectindex-filter-tags"),a=e.find(".lay-projectindex-col-year, .lay-projectindex-filter-year"),i=typeof t.style=="undefined"?"table":t.style,l=aa(t[g.screenSize].tagsWidth),c=aa(t[g.screenSize].categoriesWidth),s=aa(t[g.screenSize].titleWidth),u=aa(t[g.screenSize].yearWidth),f,d,p,m,w=0;w<t[g.screenSize].sortedColumns.length;w++){var y=t[g.screenSize].sortedColumns[w];switch(y.name){case"title":f=y.visible;break;case"categories":d=y.visible;break;case"year":m=y.visible;break;case"tags":p=y.visible;break}}for(var I=[],w=0;w<t[g.screenSize].sortedColumns.length;w++){var y=t[g.screenSize].sortedColumns[w];y.visible===!0&&I.push(y)}for(var R=100,q,F,Q,L,G=I.length,B=G,w=0;w<I.length;w++){var y=I[w];switch(y.name){case"title":s||(R-=Number(t[g.screenSize].titleWidth),B--);break;case"categories":c||(R-=Number(t[g.screenSize].categoriesWidth),B--);break;case"tags":l||(R-=Number(t[g.screenSize].tagsWidth),B--);break;case"year":u?(L=15,R-=L,B--):(R-=Number(t[g.screenSize].yearWidth),B--);break}}for(var w=0;w<I.length;w++){var y=I[w];switch(y.name){case"title":s?q=R/B:q=t[g.screenSize].titleWidth;break;case"categories":c?F=R/B:F=t[g.screenSize].categoriesWidth;break;case"tags":l?Q=R/B:Q=t[g.screenSize].tagsWidth;break;case"year":u?L=15:L=t[g.screenSize].yearWidth;break}}p?(o.show(),i=="table"&&o.css("width",Q+"%")):o.hide(),d?(n.show(),i=="table"&&n.css("width",F+"%")):n.hide(),m?(a.show(),i=="table"&&a.css("width",L+"%")):a.hide(),f?(r.show(),i=="table"&&r.css("width",q+"%")):r.hide()},Z0=function(e,t){e.find(".lay-projectindex-filter-inner").off("click"),e.find(".lay-projectindex-filter-inner").on("click",function(){var r=jQuery(this.parentNode),n=jQuery(this).closest(".lay-projectindex"),o=n.find(".lay-projectindex-row"),a="DESC";r.hasClass("projectindex-filter-active")?r.hasClass("order-ASC")?(r.removeClass("order-ASC").addClass("order-DESC"),a="DESC"):(r.removeClass("order-DESC").addClass("order-ASC"),a="ASC"):(n.find(".projectindex-filter-active").removeClass("projectindex-filter-active"),r.hasClass("lay-projectindex-filter-year")?(r.removeClass("order-ASC").addClass("projectindex-filter-active order-DESC"),a="DESC"):(r.removeClass("order-DESC").addClass("projectindex-filter-active order-ASC"),a="ASC"));var i="";r.hasClass("lay-projectindex-filter-title")?i="title":r.hasClass("lay-projectindex-filter-categories")?i="categories":r.hasClass("lay-projectindex-filter-tags")?i="tags":r.hasClass("lay-projectindex-filter-year")&&(i="date");var l=[];switch(o.each(function(u){switch(i){case"title":l.push({domIx:u,text:jQuery(this).find(".lay-projectindex-col-title").text()});break;case"categories":l.push({domIx:u,text:jQuery(this).find(".lay-projectindex-col-categories").text()});break;case"tags":l.push({domIx:u,text:jQuery(this).find(".lay-projectindex-col-tags").text()});break;case"date":l.push({domIx:u,text:jQuery(this).find(".lay-projectindex-col-year").attr("data-date")});break}}),i){case"title":case"categories":l.sort((u,f)=>u.text.localeCompare(f.text));break;case"tags":l.sort((u,f)=>u.text.localeCompare(f.text,void 0,{numeric:!0,sensitivity:"base"}));break;case"date":l.sort(function(u,f){var d=parseInt(u.text,10),p=parseInt(f.text,10);return d-p});break}a=="DESC"&&(l=l.reverse()),jQuery(".lay-projectindex-first-row").css("border-top",""),jQuery(".lay-projectindex-first-row").removeClass("lay-projectindex-first-row");for(var c=0;c<l.length;c++){var s=l[c];o.eq(s.domIx).css("order",c),c==0&&o.eq(s.domIx).addClass("lay-projectindex-first-row")}jQuery(".lay-projectindex-first-row").css("border-top",t.lineStrokeWidth+"px solid "+t.lineColor),window.laytheme.trigger("projectindex_reordered")})},ey=function(){window.laytheme.on("sizechanged",J0),ty()},ty=function(){window.laytheme.on("newpageshown",function(){Hn=jQuery(".lay-projectindex"),Hn.each(function(){var e=jQuery(this),t=e.data("config");df(e,t),hf(e,t),Z0(e,t),this.classList.add("initialized")}),Hn.each(function(){var e=jQuery(this),t=e.find(".lay-project-index-current-project .projectindex-project-link").attr("data-id"),r=jQuery("body").attr("data-id");r!=t&&(e.find(".lay-project-index-current-project").removeClass("lay-project-index-current-project"),e.find('.projectindex-project-link[data-id="'+r+'"]').closest(".lay-projectindex-row").addClass("lay-project-index-current-project"))})})},ry={initModule:ey},pf=ry;var ia,ny=function(){typeof ia!="undefined"&&ia.each(function(){var e=jQuery(this),t=e.data("config");mf(e,t)})},mf=function(e,t){var r=g.screenSize,n=t[r],o=n.width,a=n.height,i=n.spacebetween,l=t.setwidthorheight;switch(e.find(".lay-icon-inner").css({paddingLeft:i/2+"px",paddingRight:i/2+"px"}),l){case"width":e.find(".lay-icon-inner").css({width:o+"px",height:""});break;case"height":e.find(".lay-icon-inner").css({width:"",height:a+"px"});break}},oy=function(){window.laytheme.on("sizechanged",ny),ay()},ay=function(){window.laytheme.on("newpageshown",function(){ia=jQuery(".lay-socialmedia-icons"),ia.each(function(){var e=jQuery(this),t=e.data("config");mf(e,t),this.classList.add("initialized")})})},iy={initModule:oy},vf=iy;var Wh=Xt(yf()),$h=Xt(Md()),Xh=Xt(qh()),Gh=void 0,ul=void 0,Tw=function(){window.laytheme.on("content_ready",function(e){Gh=Me(e),ul=Gh.find(".lay-webgl-slideshow"),ul.length>0&&setTimeout(()=>{Aw()},100)})},Ew=function(e){if(e.classList.contains("webgl-initialized"))return;e.classList.add("webgl-initialized"),this.el=e;let t={value:0},r=0,n=!0,o,a,i,l=parseInt(e.dataset.transitionspeed,10),c=parseInt(e.dataset.autoplayspeed,10),s=parseInt(e.dataset.autoplaydelay,10),u=e.dataset.transition,f=[];e.querySelectorAll("img").forEach(function(U){var E;let ie=U.src,he=(E=U.dataset)==null?void 0:E.sizes;if(he){he=he.replace("px","");var ye=U.getAttribute("srcset");if(ye){var be=ye.split(", ");be.every(A=>{var h=A.split(" ");return h[1]=parseInt(h[1].replace("w",""),10),h[1]>he?(ie=h[0],!1):!0})}}f.push(ie)});let p=[],m,w,y=e.clientWidth,I=e.clientHeight,R=U=>new Promise((ie,he)=>{let ye=new Image;ye.crossOrigin="anonymous",ye.onload=()=>ie(ye),ye.onerror=he,ye.src=U}),q=()=>{w=this.el.querySelector("canvas"),w.width=y,w.height=I,m=w.getContext("webgl")||w.getContext("experimental-webgl"),m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,!0);let U=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,U),m.bufferData(m.ARRAY_BUFFER,new Float32Array([-1,-1,-1,4,4,-1]),m.STATIC_DRAW),m.viewport(0,0,y,I)},F=U=>{U.forEach(ie=>{let he=(0,Xh.default)(m,ie);he.minFilter=m.LINEAR,he.magFilter=m.LINEAR,p.push(he)})},Q,L=(U,ie=l)=>{U=="next"?(r++,r>f.length-1&&(r=0)):r=U,o=a,a=p[r],Q=anime({targets:t,value:[0,1],elasticity:0,easing:"easeInOutCubic",autoplay:!0,duration:ie,begin:()=>{},complete:()=>{setTimeout(()=>{n&&L("next")},c)},update:he=>{this.transition.draw(t.value,o,a,w.width,w.height)}})},G=()=>{setTimeout(()=>{n&&L("next")},s)};document.addEventListener("visibilitychange",function(U){document.hidden?Q&&(Q.pause(),n=!1):Q&&(Q.play(),n=!0)});let B=()=>{o=p[p.length-1],a=p[0],this.transition.draw(1,o,a,w.width,w.height),this.el.classList.add("lay-webgl-reveal")};Promise.all(f.map(R)).then(U=>{q(),F(U),o=p[p.length-1],a=p[0],this.transition=(0,$h.default)(m,Wh.default.find(ye=>ye.name===u));let ie=(ye,be)=>{ye.forEach(E=>{E.isIntersecting&&(Q||(B(),G()))})};new Qt(ie).observe(e)})},Aw=function(){ul.each(function(){new Ew(this)})},Iw=function(){Tw(),jQuery(window).on("window_width_changed",function(){})},Cw={initModule:Iw},Yh=Cw;jQuery(document).on("click",".lay-news-load-more",function(){var e=jQuery(this.parentNode.parentNode).find(".lay-news-element[data-amount]"),t=e.attr("data-amount");console.log("amt",t);var r=e.find(".hide-news");r.each(function(o){console.log("index",o),console.log("amt",t),o<t&&jQuery(this).addClass("show-news").removeClass("hide-news")});var n=e.find(".hide-news");n.length==0&&jQuery(this).hide()});var Gr,Sw=function(){typeof Gr!="undefined"&&Gr.each(function(){var e=jQuery(this),t=e.data("config");Kh(e,t)})},Kh=function(e,t){var r=g.screenSize,n=t[r].colGutter,o=t[r].colCount,a=typeof t[r].rowGutterMu=="undefined"?"%":t[r].rowGutterMu,i=typeof t[r].colGutterMu=="undefined"?"%":t[r].colGutterMu,l=(1-1/o)*t[r].colGutter,c="calc( 100% / "+o+" - "+l+i+")";e.find("li").css({width:c,"margin-bottom":t[r].rowGutter+a,"margin-left":0});var s=t.layoutType;switch(s){case"masonry":e.find(".lay-productsgrid-gutter-sizer").css("width",n+i),e.find(".lay-productsgrid-col-sizer").css("width",c);var u=e.data("masonry");typeof u!="undefined"&&u.layout();break;default:e.find("li").css("margin-right",n+i),e.find("li:nth-child("+o+"n)").css("margin-right",0);break}},Mw=function(e,t){switch(t.layoutType){case"masonry":var r=e.find("ul.lay-products")[0],n=new Masonry(r,{itemSelector:"li",columnWidth:".lay-productsgrid-col-sizer",gutter:".lay-productsgrid-gutter-sizer",percentPosition:!0,transitionDuration:0});n.once("layoutComplete",function(){e.closest(".col").addClass("masonry-initialized")}),e.data("masonry",n);break;default:break}},Pw=function(){jQuery(window).on("window_width_changed",Sw),jw()},jw=function(){window.laytheme.on("content_ready",function(e){Gr=void 0;var t;t=Me(e),Gr=t.find(".lay-products-thumbnails-grid"),Gr.each(function(){var r=jQuery(this),n=r.data("config");Mw(r,n),Kh(r,n),r.addClass("sized")}),M.setImageSizesAttribute(Gr)})},Rw={initModule:Pw},Jh=Rw;var kw={updateLanguageSwitcherUrls:function(){Zh()},initModule:function(){Dw()}},Dw=function(){frontendPassedData.is_qtranslate_active==1&&window.laytheme.on("newpage",Zh)},Zh=function(){frontendPassedData.is_qtranslate_active==1&&jQuery.ajax({url:frontendPassedData.wpapiroot+"laytheme/v1/get_qtranslate_langswitcher_urls/",data:{url:window.location.href},method:"GET",success:function(e){for(var t=JSON.parse(e),r=0;r<t.length;r++)jQuery(".qtranxs-lang-menu-item-"+t[r][0]+" a").attr("href",t[r][1])}})},ep=kw;var Ow={updateLanguageSwitcherUrls:function(){tp()},initModule:function(){Lw()}},Lw=function(){frontendPassedData.is_polylang_active==1&&window.laytheme.on("newpageshown",tp)},tp=function(){frontendPassedData.is_polylang_active==1&&jQuery.ajax({url:frontendPassedData.wpapiroot+"laytheme/v1/get_polylang_langswitcher_urls/",data:{id:jQuery("body").attr("data-id"),type:jQuery("body").attr("data-type")},method:"GET",success:function(e){var t=JSON.parse(e);if(Array.isArray(t))for(var r=0;r<t.length;r++)typeof t[r][0]=="string"&&jQuery(".lang-item-"+t[r][1]+" a").each(function(){console.log("each!"),jQuery(this).attr("href",t[r][0])})}})},rp=Ow;var Qe,Fw={initModule:function(){Qw()}},mt={desktopContentLoaded:!1,CplContentLoaded:!1},vt={desktopContentLoaded:!1,CplContentLoaded:!1},Qw=function(){op(),window.laytheme.on("newpageshown",op),window.laytheme.on("newpageshown",function(){setTimeout(function(){np()},0)}),window.laytheme.on("sizechanged",function(){np()})},np=function(){switch(g.screenSize){case"desktop":case"tablet":zw();break;case"phone":Uw();break}Nw(),Bw(),setTimeout(function(){var e=g.screenSize=="desktop"||g.screenSize=="tablet"?"desktop":"phone";window.laytheme.trigger("content_ready",e,Qe)},0)},Nw=function(){var e=jQuery("#lay-woocommerce");switch(frontendPassedData.image_loading){case"instant_load":_t.initLoadImages(e),M.fadeInImageOnLoadViaParent(e);break;case"lazy_load":break}},Bw=function(){document.querySelectorAll("video").forEach(function(e){jQuery(e).is(":visible")||e.pause()})},zw=function(){if(!mt.desktopContentLoaded){var e=[];document.querySelectorAll(".lay-content").forEach(function(t){e=e.concat(Array.from(t.querySelectorAll("#grid, .cover-region-desktop")))}),Qe=jQuery(e),Wr(Qe),mt.desktopContentLoaded=!0}vt.desktopContentLoaded||(Qe=jQuery("#footer"),Qe.length>0&&Wr(Qe),vt.desktopContentLoaded=!0)},Uw=function(){if(document.querySelector("body>.lay-content #custom-phone-grid")?mt.hasCPL=!0:mt.hasCPL=!1,document.querySelector("body>.lay-content #footer-custom-phone-grid")?vt.hasCPL=!0:vt.hasCPL=!1,mt.hasCPL){if(!mt.CplContentLoaded){var e=[];document.querySelectorAll(".lay-content").forEach(function(t){e=e.concat(Array.from(t.querySelectorAll("#custom-phone-grid, .cover-region-phone")))}),Qe=jQuery(e),Wr(Qe),mt.CplContentLoaded=!0}}else if(!mt.desktopContentLoaded){var e=[];document.querySelectorAll(".lay-content").forEach(function(r){e=e.concat(Array.from(r.querySelectorAll("#grid, .cover-region-desktop, #custom-phone-grid")))}),Qe=jQuery(e),Wr(Qe),mt.desktopContentLoaded=!0}vt.hasCPL?vt.CplContentLoaded||(Qe=jQuery("#footer-custom-phone-grid"),Wr(Qe),vt.CplContentLoaded=!0):vt.desktopContentLoaded||(Qe=jQuery("#footer"),Qe.length>0&&Wr(Qe),vt.desktopContentLoaded=!0)},Wr=function(e){switch(frontendPassedData.image_loading){case"instant_load":console.log("instant load"),_t.initLoadImages(e),M.fadeInImageOnLoadViaParent(e);break;case"lazy_load":break}switch(frontendPassedData.image_loading){case"instant_load":wt.loadVideosInstantly(e);break;case"lazy_load":wt.initLazyLoadVideosOnScroll(e);break}e.find("iframe[data-src]").each(function(){var t=jQuery(this).attr("data-src");jQuery(this).attr("src",t)}),e.find("[data-embed]").each(function(){var t=jQuery(this).attr("data-embed");jQuery(this).html(t)}),typeof window.layCarousel!="undefined"&&typeof window.layCarousel.loadNotLazyloadingImagesIn!="undefined"&&window.layCarousel.loadNotLazyloadingImagesIn(e),typeof window.layCarouselFadeCarousel!="undefined"&&typeof window.layCarouselFadeCarousel.loadFirstLazyImage!="undefined"&&window.layCarouselFadeCarousel.loadFirstLazyImage(e)},op=function(){mt.desktopContentLoaded=!1,mt.CplContentLoaded=!1,vt.desktopContentLoaded=!1,vt.CplContentLoaded=!1},ap=Fw;var ip=function(){switch(g.screenSize){case"desktop":case"tablet":if(jQuery(".lay-sitewide-background-video").length>0&&jQuery(".lay-sitewide-background-video").attr("src")==null){var e=jQuery(".lay-sitewide-background-video").attr("data-src");jQuery(".lay-sitewide-background-video").attr("src",e)}jQuery(".lay-sitewide-background-video").length>0&&jQuery(".lay-sitewide-background-video")[0].play();break;case"phone":if(jQuery(".lay-sitewide-background-video-mobile").length>0&&jQuery(".lay-sitewide-background-video-mobile").attr("src")==null){var e=jQuery(".lay-sitewide-background-video-mobile").attr("data-src");jQuery(".lay-sitewide-background-video-mobile").attr("src",e)}jQuery(".lay-sitewide-background-video-mobile").length>0&&jQuery(".lay-sitewide-background-video-mobile")[0].play();break}},Vw=function(){ip(),window.laytheme.on("sizechanged",function(){ip()})},Hw={initModule:Vw},sp=Hw;function qw(e){var t=this;this.$container=null,this.$select=e,console.log("this.$select",this.$select),console.log("hello!"),this.default=this.$select.attr("placeholder");var r=this.$select.attr("name");this.$lay_custom_select_el="",console.log("lay_woocommerce_use_swatches",frontendPassedData.lay_woocommerce_use_swatches),this.init=function(n){t.$container=n;var o=this.$select.find("option:selected");o.val()!=""&&frontendPassedData.lay_woocommerce_use_swatches!=1&&(console.log("use selected value!"),t.default=o.text()),this.initMarkup(),this.showVariationImage(t.default),setTimeout(function(){t.bindNewSelect()},0)},this.initMarkup=function(){var n='<div class="lay-woocommerce-variations-select" data-lvs-id="'+this.$select.attr("id")+'" data-lvs-name="'+this.$select.attr("name")+'"><div class="lay-woocommerce-variations-select-selected-field" placeholder="'+this.$select.attr("placeholder")+'">'+this.default+'</div><div class="lay-woocommerce-variations-select-selected-list">';this.$select.find("option").each(function(){if(jQuery(this).attr("value")!=""){var i=this.outerHTML.replace("<option ","<div ").replace("</option>","</div>");n+=i}}),n+="</div></div>";var o=jQuery(n),a=t.$container.find('.lay-woocommerce-variations-select[data-lvs-id="'+this.$select.attr("id")+'"]');a.length>0?(a.after(o),a.remove()):t.$container.append(o),t.$lay_custom_select_el=o},this.showVariationImage=function(){jQuery(".lay-duplicate-image").show(),jQuery(".lay-woocommerce-product-variation-slide").hide();var n=null,o="";if(jQuery(".variations select").each(function(){o+="[data-"+jQuery(this).attr("name")+'="'+this.value+'"]'}),n=jQuery(".lay-woocommerce-product-variation-slide"+o),n.length>0){n.show();var a=n.first()[0].getBoundingClientRect(),i=gr(a.width);n.find("img").attr("sizes",i+"px").attr("data-sizes",i+"px"),jQuery('.lay-woocommerce-gallery .swiper-slide img[data-id="'+n.find("img").attr("data-id")+'"]').not(n.find("img")).each(function(){jQuery(this.parentNode).hide().addClass("lay-duplicate-image")}),g.screenSize!="phone"&&!jQuery(".lay-woocommerce-single-product-wrap").hasClass("carousel")&&(console.log("scroll to!"),a.bottom<400&&jQuery("html").animate({scrollTop:n.first().offset().top},300,"easeInOutQuad",function(){})),window.laytheme.trigger("variation_image_updated")}},this.bindNewSelect=function(){frontendPassedData.lay_woocommerce_use_swatches!=1?(this.$lay_custom_select_el.find(".lay-woocommerce-variations-select-selected-field").on("click",function(){t.$lay_custom_select_el.toggleClass("lay-dropdown-active"),jQuery(".lay-woocommerce-variations-select").not(t.$lay_custom_select_el).removeClass("lay-dropdown-active"),t.$lay_custom_select_el.hasClass("lay-dropdown-active")}),this.$lay_custom_select_el.find(".lay-woocommerce-variations-select-selected-list>div").on("click",function(){var n=jQuery(this).attr("value"),o=jQuery(this).text();t.$lay_custom_select_el.find(".lay-woocommerce-variations-select-selected-field").text(o),t.$select.find("option").removeAttr("selected"),t.$select.find('option[value="'+n+'"]')[0].selected="selected",t.$select.trigger("change"),t.$lay_custom_select_el.removeClass("lay-dropdown-active"),jQuery(".woocommerce-variation-add-to-cart .button").removeClass("added"),t.showVariationImage(n),window.laytheme.trigger("variation_selected",t.$select)})):this.$lay_custom_select_el.find(".lay-woocommerce-variations-select-selected-list>div").on("click",function(){var n=jQuery(this).attr("value");t.$select.find("option").removeAttr("selected"),t.$select.find('option[value="'+n+'"]')[0].selected="selected",t.$select.trigger("change"),t.$lay_custom_select_el.find(".lay-woocommerce-variations-select-selected-list div").removeAttr("selected"),t.$lay_custom_select_el.find('.lay-woocommerce-variations-select-selected-list div[value="'+n+'"]').attr("selected","selected"),jQuery(".woocommerce-variation-add-to-cart .button").removeClass("added"),t.showVariationImage(n)})},this.getCustomSelectEl=function(){return this.$lay_custom_select_el}}var Gw=function(){frontendPassedData.lay_woocommerce_use_swatches!=1&&jQuery(document).on("click",function(e){jQuery(e.target).closest(".lay-woocommerce-variations-select").length==0&&jQuery(".lay-woocommerce-variations-select").removeClass("lay-dropdown-active")})},lp=function(){Gw();var e=[];window.laytheme.on("newpageshown",function(){setTimeout(function(){jQuery(".variations_form").length>0&&jQuery(".variations select").each(function(){var t=new qw(jQuery(this)),r=jQuery(".lay-variable-products-select-container");t.init(r),e.push(t)})},100),window.laytheme.off("variation_selected"),window.laytheme.on("variation_selected",function(t){if(jQuery(".variations select").length>1)for(var r=jQuery(".lay-variable-products-select-container"),n=0;n<e.length;n++)t.is(e[n].$select)||e[n].init(r)})})};var fp,et=0,up=et,vr=!1,dl=0,ba=!1,dp=function(){vr=jQuery("body").hasClass("lay-woocommerce-show-store-notice")},Ww=function(){vr&&(jQuery(".sitetitle.position-top, .laynav.position-top, .navbar.position-top").css("margin-top",et+"px"),!jQuery("body").hasClass("woocommerce-page")&&frontendPassedData.lay_sticky_footer=="on"&&jQuery(".lay-content").css("min-height","calc( 100vh - "+et+"px )"),jQuery(".fp-slidesNav.bottom").css("transform","translate(-50%, -"+et+"px)")),jQuery("body").css("padding-top","")},$w=function(){vr&&(jQuery("body").css("padding-top",dl+et+"px"),jQuery(".navbar, .mobile-title, .lay-mobile-icons-wrap, .mobile-nav.mobile-menu-style-style_desktop_menu").css("margin-top",et+"px"),jQuery(".fp-slidesNav.bottom").css("transform","translate(-50%, -"+et+"px)"))},Xw=function(){jQuery(".sitetitle.position-top, .laynav.position-top, .navbar").css("margin-top",""),jQuery(".navbar, .mobile-title, .lay-mobile-icons-wrap, .mobile-nav.mobile-menu-style-style_desktop_menu").css("margin-top",""),jQuery(".fp-slidesNav.bottom").css("transform",""),jQuery("body").css("padding-top",""),jQuery(".lay-content").css("min-height",""),ba=!1},cl=function(e){switch(e){case"desktop":case"tablet":Ww();break;case"phone":$w();break}},Yw=function(){var e=Backbone.Radio.channel("events"),t=!1;window.laytheme.on("newpageshown",function(){t=!1}),e.on("scroll",function(){if(vr){var r=window.pageYOffset||document.documentElement.scrollTop;r>=et&&t==!1?(t=!0,jQuery("body").addClass("lay-woocommerce-store-notice-scrolled-down")):r<et&&t==!0&&(t=!1,jQuery("body").removeClass("lay-woocommerce-store-notice-scrolled-down"))}})},Kw=function(){jQuery(".woocommerce-store-notice__dismiss-link").on("click",function(){Xw(),jQuery("body").removeClass("lay-woocommerce-show-store-notice").addClass("lay-woocommerce-hide-store-notice"),dp(),jQuery("body").removeClass("lay-woocommerce-store-notice-scrolled-down")})},fl=function(){et=fp.outerHeight()},cp=function(){switch(g.screenSize){case"phone":ba==!1&&(dl=parseInt(jQuery("body").css("padding-top"),10),ba=!0);break;case"tablet":case"desktop":dl=0,ba=!1;break}},hp=function(){Kw(),fp=jQuery(".woocommerce-store-notice.demo_store"),dp(),vr&&(cp(),fl(),cl(g.screenSize),jQuery(window).on("fpAfterRender",function(){jQuery(".fp-slidesNav.bottom").css("transform","translate(-50%, -"+et+"px)")})),Yw(),window.laytheme.on("sizechanged",function(e){vr&&(cp(),fl(),cl(e))}),jQuery(window).on("window_width_changed",function(){vr&&(up=et,fl(),et!=up&&cl(g.screenSize))})};var Jw=function(){frontendPassedData.image_loading=="instant_load"?jQuery(".xoo-wsc-container .xoo-wsc-img-col img").each(function(){this.classList.contains("loaded")||_t.loadImage(jQuery(this))}):window.lazyLoadInstance&&window.lazyLoadInstance.update&&window.lazyLoadInstance.update()},Zw=function(){jQuery(document.body).on("updated_cart_totals",function(){frontendPassedData.image_loading=="instant_load"&&jQuery(".lay-woocommerce-cart-wrap img").each(function(){this.classList.contains("loaded")||(_t.loadImage(jQuery(this)),this.classList.add("loaded"))})})},e1=function(){jQuery(document.body).on("wc_fragments_refreshed",function(){setTimeout(function(){Jw()},0)})},t1=function(){frontendPassedData.sideCartPluginActive==!0&&jQuery(document).on("click",".laycart a, .lay-cart-icon-wrap",function(e){e.preventDefault(),e.stopPropagation(),mp()})},mp=function(){jQuery("body").addClass("xoo-wsc-cart-active"),jQuery(".xoo-wsc-modal").addClass("xoo-wsc-cart-active"),jQuery(document.body).trigger("xoo_wsc_cart_toggled",["show"]),g.isPhoneSize&&bt.hideMobileMenu()},r1=function(){jQuery(".xoo-wsch-close").trigger("click")},n1=function(){if(typeof MutationObserver!="undefined"&&jQuery(".laycart").length>0){var e=jQuery(".desktop-nav .laycart span"),t=jQuery(".lay-cart-icon-wrap"),r=jQuery(".mobile-nav .laycart span"),n=document.getElementsByClassName("xoo-wsc-modal")[0];if(typeof e!="undefined"&&typeof n!="undefined"){var o=new MutationObserver(function(i){var l=jQuery(".xoo-wscb-count").text();(l==""||l==!1||typeof l=="undefined")&&(l=0),l==0?(jQuery(".lay-cart-icon-wrap").addClass("laycarticon-empty").removeClass("laycarticon-not-empty"),jQuery(".laycart").addClass("laycart-empty").removeClass("laycart-not-empty")):(jQuery(".lay-cart-icon-wrap").removeClass("laycarticon-empty").addClass("laycarticon-not-empty"),jQuery(".laycart").removeClass("laycart-empty").addClass("laycart-not-empty"));var c=e.text(),s=c.indexOf("("),u=c.substr(0,s),f=u+="("+l+")";e.text(f),t.text(l)});o.observe(n,{childList:!0});var a=new MutationObserver(function(i){var l=jQuery(".xoo-wscb-count").text();(l==""||l==!1||typeof l=="undefined")&&(l=0);var c=r.text(),s=c.indexOf("("),u=c.substr(0,s),f=u+="("+l+")";r.text(f),t.text(l)});a.observe(n,{childList:!0})}}},Kn,pp=function(){if(jQuery(".lay-woocommerce-single-product-wrap .lay-woocommerce-gallery").length>0&&jQuery(".swiper-slide").length>1)if(g.isPhoneSize||jQuery(".lay-woocommerce-single-product-wrap").hasClass("carousel")){var e=jQuery(".lay-woocommerce-gallery").hasClass("lay-woocommerce-gallery-navigation-enabled");e==!0&&(e={nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}),Kn=new Swiper(".lay-woocommerce-gallery",{containerModifierClass:"lay-woocommerce-gallery-container-",pagination:{el:".swiper-pagination",type:"bullets",clickable:!0},navigation:e,spaceBetween:0,breakpoints:{[parseInt(frontendPassedData.breakpoint,10)]:{spaceBetween:20}}}),window.laytheme.off("variation_image_updated"),window.laytheme.on("variation_image_updated",function(){Kn.update(),Kn.slideTo(0,100)})}else typeof Kn!="undefined"&&(window.laytheme.off("variation_image_updated"),Kn.destroy(!0,!0))},o1=function(){window.laytheme.on("newpageshown",function(){pp()}),window.laytheme.on("sizechanged",function(e){pp()})},a1=function(){jQuery(document).on("click",".js-lay-woocommerce-plus-qty",function(e){var t=jQuery(e.target).closest(".lay-woocommerce-qty-wrap").find("input"),r=parseInt(t.val(),10),n=r,o=parseInt(t.attr("max"),10);r++,r>o&&(r=o),t.val(r),n!=r&&t.trigger("input")}),jQuery(document).on("click",".js-lay-woocommerce-minus-qty",function(e){var t=jQuery(e.target).closest(".lay-woocommerce-qty-wrap").find("input"),r=parseInt(t.val(),10),n=r;r--,r<1&&(r=1),t.val(r),n!=r&&t.trigger("input")})},i1=function(){jQuery(document).on(".cart_item input.input-text.qty:not(#coupon_code)","input",function(){var e=jQuery(this).closest(".cart_item");e.find(".lay-woocommerce-update-cart-button").removeClass("lay-woocommerce-button-disabled")})},s1=function(){jQuery(document).on("click",".lay-woocommerce-tab-title",function(e){this.classList.contains("active")?(jQuery(this).removeClass("active"),jQuery(this).next().removeClass("active")):(jQuery(".lay-woocommerce-tab-title.active").removeClass("active"),this.classList.add("active"),jQuery(".lay-woocommerce-tab-content.active").removeClass("active"),jQuery(this).next().addClass("active"))})},l1=function(){window.laytheme.on("customizer_show_sidecart",function(){mp()}),window.laytheme.on("customizer_hide_sidecart",function(){r1()})},u1=function(){jQuery(function(e){e.scroll_to_notices=function(t){t.length}})},vp=function(){var e=jQuery(".lay-woocommerce-related-products-scroller");e.length>0&&e.each(function(){var t=0;jQuery(this).find("li").each(function(){var r=window.getComputedStyle(this);t+=parseInt(this.getBoundingClientRect().width,10)+parseInt(r.marginRight,10)}),jQuery(this).find("ul").css("width",t+5)})},c1=function(){var e=jQuery(".lay-woocommerce-related-products-scroller");e.length>0&&e.find("ul").css("width","")},f1=function(){jQuery(window).on("window_width_changed",function(){g.screenSize=="phone"?vp():c1()})},d1=function(){jQuery(document).on("input","#coupon_code",function(){jQuery(this).val()!=""?jQuery('.button[name="apply_coupon"]').removeClass("disabled"):jQuery('.button[name="apply_coupon"]').addClass("disabled")})},h1=function(){jQuery("textarea").attr("spellcheck","false"),jQuery("#coupon_code").attr("autocomplete","off")},gp=function(){jQuery(".checkout.woocommerce-checkout input.input-text").each(function(){var e=jQuery(this).val(),t=jQuery(this).closest(".form-row");e!=""&&t.addClass("lay-minimize-label"),t.addClass("lay-show-label")})},p1=function(){jQuery(document).on("focusin",".checkout.woocommerce-checkout input.input-text",function(){var e=jQuery(this).closest(".form-row");e.addClass("lay-label-transition"),setTimeout(function(){e.addClass("lay-minimize-label")},0)}),jQuery(document).on("focusout",".checkout.woocommerce-checkout input.input-text",function(){var e=jQuery(this).closest(".form-row"),t=jQuery(this).val();t==""&&(e.addClass("lay-label-transition"),setTimeout(function(){e.removeClass("lay-minimize-label")},0))})},m1=function(){jQuery(".checkout.woocommerce-checkout select").each(function(){jQuery(this).selectize({create:!1,sortField:"text"})});var e=0,t=0,r=!0;jQuery(document.body).on("country_to_state_changed",function(n,o,a){if(typeof a!="undefined"){a.find(".form-row").removeClass("last-child");var i=a.find(".form-row:last-child").prev(),l=a.find(".form-row:last-child");l.is(":visible")||i.addClass("last-child")}if(o==""&&typeof a!="undefined"){var c="";jQuery(a).find("input#billing_state").length>0?(c=jQuery(a).find("input#billing_state").closest(".form-row").find("label").text(),jQuery(a).find("input#billing_state").attr("placeholder",c)):jQuery(a).find("input#shipping_state").length>0&&(c=jQuery(a).find("input#shipping_state").closest(".form-row").find("label").text(),jQuery(a).find("input#shipping_state").attr("placeholder",c));return}if(typeof a!="undefined"){var s=a.find("select.state_select")[0];if(typeof s=="undefined")return;if(e=jQuery(s).find("option").length,typeof s.selectize!="undefined"&&e!=t&&r==!1&&e!=1){if(jQuery(s).find("option").length>0){var u=s.selectize;jQuery(s).find("option").each(function(){var f=jQuery(this).attr("value"),d=jQuery(this).text();u.addOption({value:f,text:d})}),u.refreshOptions(),setTimeout(function(){u.settings.placeholder=jQuery(s).closest(".form-row").find("label").text(),u.updatePlaceholder()},0)}}else jQuery(s).selectize({create:!1,sortField:"text"});setTimeout(function(){var f=a.find("select.state_select")[0];if(typeof f!="undefined"){var d=f.selectize;d.settings.placeholder=jQuery(f).closest(".form-row").find("label").text(),d.updatePlaceholder()}},0),setTimeout(function(){jQuery(".selectize-control").addClass("select2-container"),gp()},0),t=e,r=!1}})},v1=function(){jQuery("body").on("keydown input","textarea#order_comments",function(){this.style.removeProperty("height"),this.style.height=this.scrollHeight+2+"px"}).on("mousedown","textarea#order_comments",function(){this.style.removeProperty("height"),this.style.height=this.scrollHeight+2+"px"})},g1=function(){jQuery("form.checkout_coupon").appendTo("#lay-coupon-target")},y1=function(){jQuery(".woocommerce-notices-wrapper").on("click",function(){jQuery(this).fadeOut()})},_1=function(){jQuery(document.body).on("updated_cart_totals",function(){})},w1=function(){gp(),p1(),m1(),u1(),o1(),t1(),Zw(),n1(),l1(),a1(),i1(),s1(),e1(),f1(),d1(),h1(),g1(),v1(),frontendPassedData.sideCartPluginActive||_1(),g.screenSize=="phone"&&(vp(),y1())},b1={initModule:function(){w1(),lp(),hp()}},yp=b1;var x1={initModule:function(){return E1()}},T1=function(){var e=!1;jQuery(".laynav.mobile-nav").hasClass("mobile-menu-style-style_desktop_menu")&&(e=!0),jQuery(".laynav.mobile-nav .menu-item-has-children>a").on("click",function(t){t.preventDefault(),t.stopPropagation(),e&&jQuery(".show-submenu-mobile").not(jQuery(this).closest(".menu-item-has-children")).removeClass("show-submenu-mobile"),jQuery(this).closest(".menu-item-has-children").toggleClass("show-submenu-mobile"),e&&jQuery(this).closest(".menu-item-has-children").hasClass("show-submenu-mobile")&&jQuery(window).one("click",function(){jQuery(".show-submenu-mobile").removeClass("show-submenu-mobile")})}),(g.isTouchDevice||frontendPassedData.menu_submenu_show_on=="click")&&jQuery(".laynav.desktop-nav .menu-item-has-children>a").on("click",function(t){t.preventDefault(),t.stopPropagation();var r=jQuery(this).closest(".menu-item-has-children");jQuery(".show-submenu-desktop").not(r).removeClass("show-submenu-desktop"),r.toggleClass("show-submenu-desktop"),r.hasClass("show-submenu-desktop")&&_p()})},_p=function(){jQuery(window).one("click",function(e){frontendPassedData.menu_submenu_keep_open==!0&&jQuery(e.target).closest(".show-submenu-desktop").length==1?_p():jQuery(".show-submenu-desktop").removeClass("show-submenu-desktop")})},E1=function(){T1()},wp=x1;var bp=void 0,A1=function(){window.laytheme.on("content_ready",function(e){bp=Me(e);var t=bp.find(".thumbs-collection-region");t.length>0&&xp()})},xp=function(){switch(g.screenSize){case"desktop":case"tablet":jQuery(".one-col-row .lay-thumbnailgrid-filter-wrap").each(function(){var e=jQuery(this).find(".lay-thumbnailgrid-tagfilter");e.length>0&&e.hasClass("mobile-one-line")&&e.css({width:"",paddingLeft:"",paddingRight:"",transform:""});var t=jQuery(this).find(".lay-thumbnailgrid-filter");t.length>0&&t.hasClass("mobile-one-line")&&t.css({width:"",paddingLeft:"",paddingRight:"",transform:""})});break;case"phone":jQuery(".one-col-row .lay-thumbnailgrid-filter-wrap").each(function(){var e=jQuery(this).find(".lay-thumbnailgrid-tagfilter"),t=0;if(e.length>0&&e.hasClass("mobile-one-line")){var r=e[0].getBoundingClientRect().left,n=e.find(".tag-bubble").first();if(n.length>0){var o=n[0].currentStyle||window.getComputedStyle(n[0]),a=o.marginRight;a=parseInt(a,10);var i=jQuery(this).closest(".row"),l=i[0].currentStyle||window.getComputedStyle(i[0]);e.css({width:window.innerWidth+"px",paddingLeft:l.paddingRight,paddingRight:l.paddingRight}),r!=0&&e.css({transform:"translateX( -"+r+"px )"})}}var c=jQuery(this).find(".lay-thumbnailgrid-filter");if(c.length>0&&c.hasClass("mobile-one-line")){var s=jQuery(this).closest(".col")[0].getBoundingClientRect().left,r=c[0].getBoundingClientRect().left;c.css({width:window.innerWidth+"px",paddingLeft:s+"px",paddingRight:s+"px"}),r!=0&&c.css({transform:"translateX( -"+r+"px )"})}});break}},I1=function(){A1(),jQuery(window).on("window_width_changed",function(){xp()})},C1={initModule:I1},Tp=C1;var Ap=Xt(Ep()),at,S1=function(e,t,r){for(var n=e.split(" "),o=[],a=0;a<n.length;a++){var i=n[a];if(i.indexOf("vh")!==-1||i.indexOf("lvh")!==-1||i.indexOf("svh")!==-1){i=i.replace("vh",""),i=i.replace("svh",""),i=i.replace("lvh","");var l=parseFloat(i);l=t/100*l,o.push(l)}else if(i.indexOf("vw")!==-1){i=i.replace("vw","");let u=parseFloat(i);u=r/100*u,o.push(u)}else if(i.indexOf("px")!==-1){i=i.replace("px","");var l=parseFloat(i);o.push(l)}else o.push(i)}var c=o.join(""),s=Math.round(Ip(c));return s},M1=(0,Ap.default)(S1),ml=function(){if(typeof at!="undefined"&&at.length>0){var e,t,r,n;r=document.styleSheets;var o=!1;for(e=0;e<r.length;e++)t=r[e],t.ownerNode!=null&&t.ownerNode.id=="frontend-style-css"&&(o=t);t.crossOrigin="anonymous";try{var a=[];if(o!=!1){for(var e=0;e<o.cssRules.length;e++){var i=o.cssRules[e];typeof i.selectorText!="undefined"&&i.selectorText.indexOf("_100vh")!=-1&&a.push(i)}at.each(function(){var l="";if(this.classList.contains("_100vh")){var c=this;for(e=0;e<a.length;e++){var s=a[e];c.matches(s.selectorText)&&(l=s.style.minHeight)}jQuery(this).attr("data-original-100vh-height",l)}else if(this.classList.contains("rowcustomheight")){var c=this,u=jQuery(c).clone();for(u[0].classList.add("_100vh"),e=0;e<a.length;e++){var s=a[e];u[0].matches(s.selectorText)&&(l=s.style.minHeight)}jQuery(this).attr("data-original-100vh-height",l);var f=jQuery(this).find(".row-inner.rowcustomheight"),d=f.attr("style");if(typeof d!="undefined"&&d.indexOf("min-height:calc(")!==-1){var p=d.replace("min-height:calc(","");p=p.replace(");",""),jQuery(this).attr("data-original-rowcustomheight",p)}}})}}catch(l){console.error(l)}}};function Ip(e){return Function(`"use strict";return (${e})`)()}var Cp=function(e){if(typeof at!="undefined"&&at.length>0){var t=jQuery(e).attr("data-original-100vh-height");if(typeof t!="undefined"){if(t=="100vh"||t=="100lvh")return window.innerHeight;if(t.indexOf("calc(")!=-1){var r=t.indexOf("calc("),n=t.indexOf(")"),o=t.substring(r+5,n);o=o.replace("100vh","window.innerHeight"),o=o.replace("100svh","window.innerHeight"),o=o.replace("100lvh","window.innerHeight"),o=o.replace("100vw","window.innerWidth"),o=o.replace("px","");var a=Ip(o);return a}}return window.innerHeight}},Jn=function(){P1(),k1()},P1=function(){typeof at!="undefined"&&at.length>0&&at.each(function(){if(jQuery(this).attr("data-collapsed")=="false"){if(this.classList.contains("_100vh"))j1(this);else if(this.classList.contains("rowcustomheight")){var e=R1(this);jQuery(this).css("min-height",e),jQuery(this).find(".rowcustomheight").css("min-height",e)}}})},j1=function(e){if(!jQuery("html").hasClass("fp-enabled")){var t=Cp(e),r=-1;jQuery(e).find(".col.absolute-position").each(function(){var n=this.getBoundingClientRect();n.height>r&&(r=n.height)}),r!==-1&&t<r?(jQuery(e).css("min-height",r),jQuery(e).find("._100vh").css("min-height",r)):(jQuery(e).css("min-height",""),jQuery(e).find("._100vh").css("min-height",""))}},R1=function(e){var t=Cp(e),r=jQuery(e).attr("data-original-rowcustomheight"),n=M1(r,t,window.innerWidth),o=-1;return jQuery(e).find(".col.absolute-position").each(function(){var a=this.getBoundingClientRect();a.height>o&&(o=a.height)}),o!==-1&&n<o?o:r},k1=function(){if(typeof at!="undefined"&&at.length>0){var e=!0,t=jQuery("#custom-phone-grid").length!=0;g.isPhoneSize&&!t&&(e=!1)}},D1=function(){window.laytheme.on("content_ready",function(e){at=void 0;var t;t=Me(e),at=t.find(".row"),ml(),Jn(),setTimeout(function(){Jn()},1e3)})},O1=function(){g.isTouchDevice===!0?(window.laytheme.on("sizechanged",function(){ml()}),jQuery(window).on("window_width_changed orientationchange",function(){})):(window.laytheme.on("sizechanged",function(){ml()}),jQuery(window).on("resize",Jn)),D1()},L1={initModule:O1,doPositioning:Jn},xa=L1;var F1=function(){if(frontendPassedData.shownag=="show"){var e=Date.now();jQuery("body").prepend('<a class="_ts_'+e+'" href="https://laytheme.com" target="_blank">Created with Laytheme.com</a><style>@keyframes fadeIn {0% { opacity: 0; }100% { opacity: 1; }}._ts_'+e+"{color:black;text-decoration:none;border-bottom:none;letter-spacing:0.01em;animation: fadeIn 0.2s;animation-fill-mode: forwards;background:white;position:fixed;bottom:10px;right:10px;color:black;z-index:99999999999999999999999999;font-size:12px;line-height:25px;height:25px;padding-left:10px;padding-right:10px;border:1px solid rgb(230,230,230);border-radius:20px;font-family: Helvetica, sans-serif;transition: opacity 200ms ease;}</style>")}},Q1={initModule:function(){F1()}},Sp=Q1;var Zn=void 0,N1=function(){H1()},B1=function(){},vl=function(e){var t=[];if(e.indexOf(",")===-1)t.push(e);else if(e.indexOf(",")!==-1){let n=e.split(",");for(var r=0;r<n.length;r++)t.push(n[r])}else t.push(e);return t},Mp=function(e){var t=e.attr("data-replacementtext");if(t!=""&&t!=null){var r=_.escape(e.html());e.html(_.unescape(t)),e.attr("data-replacementtext",r),e.toggleClass("lay-text-replaced")}},Pp=function(e){e.toggleClass("expand-link-clicked")},z1=function(){Zn.find("a[data-expand]").off("click"),Zn.find("a[data-expand]").on("click",function(e){e.stopPropagation(),e.preventDefault();var t=jQuery(this),r=t.attr("data-expand"),n=t.attr("data-animationtiming");n.slice(-1)==";"&&(n=n.substring(0,n.length-1));var o=t.attr("data-animation"),a=vl(r),i=t.attr("data-collapseotherrows"),l=t.attr("data-scrolltoexpandedrow");Mp(t),Pp(t);for(var c=null,s=0;s<a.length;s++){var u=jQuery(this).closest(".grid").find(".row-id-"+a[s]);if(u.length>0){var f=u[0].getAttribute("data-collapsed")==="true";f?(V1(u[0],n,o),u[0].setAttribute("data-collapsed","false"),c=u):jp(u[0],n,o)}}if(l=="true"&&c!=null&&c.length>0&&setTimeout(function(){var w=c.offset().top;w=Mo.addSpaceTop(w),t.closest(".lay-overlay").length>0?t.closest(".lay-content").animate({scrollTop:w},300,"easeInOutQuad",function(){var y=c.attr("id");typeof y!="undefined"&&y!=""&&y!=!1&&(window.location.hash=y)}):jQuery("html").animate({scrollTop:w},300,"easeInOutQuad",function(){var y=c.attr("id");typeof y!="undefined"&&y!=""&&y!=!1&&(window.location.hash=y)})},o),i=="true")for(var d=U1(),p=0;p<d.length;p++){var m=d[p];if(a.indexOf(m)==-1){var u=jQuery(this).closest(".grid").find('.row[data-collapsed="false"].row-id-'+m);u.length>0&&(jp(u[0],n,o),jQuery(this).closest(".grid").find('a[href="#expandrow"].lay-text-replaced').each(function(){var y=jQuery(this),I=y.attr("data-expand"),R=vl(I);R.indexOf(m)!=-1&&(Mp(y),Pp(y))}))}}})},U1=function(){var e=[];return Zn.find('a[href="#expandrow"]').each(function(){var t=jQuery(this).attr("data-expand"),r=vl(t);e=_.union(e,r)}),e};function jp(e,t,r){jQuery(e).css({transition:"height "+r+"ms "+t+", min-height "+r+"ms "+t}),e.classList.add("hide-overflow");var n=e.scrollHeight,o=e.style.transition;e.style.transition="",requestAnimationFrame(function(){e.style.height=n+"px",e.style.transition=o,jQuery(e).one("transitionend",function(a){window.laytheme.trigger("lay_row_collapsed")}),requestAnimationFrame(function(){e.style.height="0px",(e.classList.contains("rowcustomheight")||e.classList.contains("_100vh"))&&(e.style.minHeight="0px")})}),e.setAttribute("data-collapsed","true")}function V1(e,t,r){console.log("expandRow"),console.log(e),jQuery(e).css({transition:"height "+r+"ms "+t+", min-height "+r+"ms "+t});var n=e.scrollHeight;e.style.height=n+"px",jQuery(e).one("transitionend",function(o){jQuery(this).attr("data-collapsed")=="false"&&(this.style.height=null,this.classList.remove("hide-overflow"),(e.classList.contains("rowcustomheight")||e.classList.contains("_100vh"))&&xa.doPositioning()),window.laytheme.trigger("lay_row_expanded")}),e.setAttribute("data-collapsed","false")}var H1=function(){window.laytheme.on("content_ready",function(e){Zn=void 0,Zn=Me(e),B1(),z1()})},q1={initModule:N1},Rp=q1;var kp=function(){var e=function(){jQuery(".sitetitle, nav, .navbar, .mobile-title, .lay-mobile-icons-wrap, #lay_canvas").css("display","")},t=function(){jQuery(".sitetitle, nav, .navbar, .mobile-title, .lay-mobile-icons-wrap, #lay_canvas").css("display","none")},r=function(){document.webkitFullscreenElement==null?e():t()};document.onwebkitfullscreenchange=function(){r()}};var G1=Backbone.Radio.channel("events"),Dp=0;G1.on("scroll",function(){window.scrollY>0&&window.scrollY<document.documentElement.scrollHeight-window.innerHeight&&g.isPhoneSize&&(window.scrollY>Dp?document.body.classList.contains("mobile-menu-open")||document.body.classList.add("lay-hide-phone-menu"):document.body.classList.remove("lay-hide-phone-menu"),Dp=window.scrollY)});Eu();ap.initModule();ep.initModule();rp.initModule();frontendPassedData.is_customize!=!0?Bt.init():Bt.cancelLoading();fo.initModule();du.initModule();Er.initModule();M.initModule();Vl.initModule();Zr.initModule();Jl.initModule();lu.initModule();hu.initModule();sn.initModule();vu.initModule();bt.initModule();Du.initModule();Ou.initModule();Bl.initModule();Ir.initModule();ic.initModule();Mo.initModule();nf.initModule();lf.initModule();ff.initModule();pf.initModule();vf.initModule();Jh.initModule();bo.initModule();sp.initModule();wp.initModule();Tp.initModule();xa.initModule();Sp.initModule();Rp.initModule();kp();Yt.initModule();Yh.initModule();var Op=document.body.dataset.type,W1=document.body.dataset.id,$1=document.body.dataset.slug,X1=document.body.dataset.catid,Y1=document.body.dataset.footerid,K1=document.title.replace(passedDataHistory.titleprefix,"");document.addEventListener("DOMContentLoaded",function(){yp.initModule(),setTimeout(function(){window.laytheme.trigger("newpage"),window.laytheme.trigger("newpageshown",{},Op,{id:W1,type:Op,slug:$1,catid:X1,footerid:Y1,title:K1})},0)});window.lt_load_visible_images_then_rest_controller={};window.lt_load_visible_images_then_rest_controller.load_visible_images_then_rest_controller=_t;window.lt_utility_controller={};window.lt_utility_controller.Utility=g;window.lt_utility_controller.utility_controller=M;window.lt_showhide_onscroll_controller={};window.lt_showhide_onscroll_controller.default=sn;frontendPassedData.youtube=="on"&&(gl=document.createElement("script"),gl.src="https://www.youtube.com/iframe_api",yl=document.getElementsByTagName("script")[0],yl.parentNode.insertBefore(gl,yl));var gl,yl;})();
/*! Bundled license information:

repeat-string/index.js:
  (*!
   * repeat-string <https://github.com/jonschlinkert/repeat-string>
   *
   * Copyright (c) 2014-2015, Jon Schlinkert.
   * Licensed under the MIT License.
   *)

pad-left/index.js:
  (*!
   * pad-left <https://github.com/jonschlinkert/pad-left>
   *
   * Copyright (c) 2014-2015, Jon Schlinkert.
   * Licensed under the MIT license.
   *)

is-buffer/index.js:
  (*!
   * Determine if an object is a Buffer
   *
   * @author   Feross Aboukhadijeh <https://feross.org>
   * @license  MIT
   *)

ieee754/index.js:
  (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)

buffer/index.js:
  (*!
   * The buffer module from node.js, for the browser.
   *
   * @author   Feross Aboukhadijeh <https://feross.org>
   * @license  MIT
   *)
*/
