!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).barba=e()}(this,(function(){function t(t,e){for(var i=0;i-1)&&(f=_,o=o.slice(0,w))}o&&(n.push(o),o="",c=!1);var S=m||v,k=f||a;n.push({name:p||r++,prefix:f,delimiter:k,optional:"?"===b||"*"===b,repeat:"+"===b||"*"===b,pattern:S?E(S):"[^"+x(k===a?k:k+a)+"]+?"})}}return(o||s1?t>0?"forward":"back":0===t?"popstate":t>0?"back":"forward"},e(t,[{key:"current",get:function(){return this.h[this.v]}},{key:"state",get:function(){return this.h[this.h.length-1]}},{key:"previous",get:function(){return this.v<1?null:this.h[this.v-1]}},{key:"size",get:function(){return this.h.length}}]),t}()),O=function(t,e){try{var i=function(){if(!e.next.html)return Promise.resolve(t).then((function(t){var i=e.next;if(t){var n=P.toElement(t);i.namespace=P.getNamespace(n),i.container=P.getContainer(n),i.html=t,A.update({ns:i.namespace});var r=P.toDocument(t);document.title=r.title}}))}();return Promise.resolve(i&&i.then?i.then((function(){})):void 0)}catch(t){return Promise.reject(t)}},M=d,L={__proto__:null,update:O,nextTick:function(){return new Promise((function(t){window.requestAnimationFrame(t)}))},pathToRegexp:M},I=function(){return window.location.origin},D=function(t){return void 0===t&&(t=window.location.href),R(t).port},R=function(t){var e,i=t.match(/:\d+/);if(null===i)/^http/.test(t)&&(e=80),/^https/.test(t)&&(e=443);else{var n=i[0].substring(1);e=parseInt(n,10)}var r,s=t.replace(I(),""),o={},a=s.indexOf("#");a>=0&&(r=s.slice(a+1),s=s.slice(0,a));var l=s.indexOf("?");return l>=0&&(o=z(s.slice(l+1)),s=s.slice(0,l)),{hash:r,path:s,port:e,query:o}},z=function(t){return t.split("&").reduce((function(t,e){var i=e.split("=");return t[i[0]]=i[1],t}),{})},j=function(t){return void 0===t&&(t=window.location.href),t.replace(/(\/#.*|\/|#.*)$/,"")},F={__proto__:null,getHref:function(){return window.location.href},getOrigin:I,getPort:D,getPath:function(t){return void 0===t&&(t=window.location.href),R(t).path},parse:R,parseQuery:z,clean:j};function q(t,e,i){return void 0===e&&(e=2e3),new Promise((function(n,r){var s=new XMLHttpRequest;s.onreadystatechange=function(){if(s.readyState===XMLHttpRequest.DONE)if(200===s.status)n(s.responseText);else if(s.status){var e={status:s.status,statusText:s.statusText};i(t,e),r(e)}},s.ontimeout=function(){var n=new Error("Timeout error ["+e+"]");i(t,n),r(n)},s.onerror=function(){var e=new Error("Fetch error");i(t,e),r(e)},s.open("GET",t),s.timeout=e,s.setRequestHeader("Accept","text/html,application/xhtml+xml,application/xml"),s.setRequestHeader("x-barba","yes"),s.send()}))}function N(t,e){return void 0===e&&(e={}),function(){for(var i=arguments.length,n=new Array(i),r=0;r1?i-1:0),r=1;r1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey},X=function(t){var e=t.el;return e.hasAttribute("target")&&"_blank"===e.target},Y=function(t){var e=t.el;return void 0!==e.protocol&&window.location.protocol!==e.protocol||void 0!==e.hostname&&window.location.hostname!==e.hostname},G=function(t){var e=t.el;return void 0!==e.port&&D()!==D(e.href)},Q=function(t){var e=t.el;return e.getAttribute&&"string"==typeof e.getAttribute("download")},J=function(t){return t.el.hasAttribute(C.prefix+"-"+C.prevent)},Z=function(t){return Boolean(t.el.closest("["+C.prefix+"-"+C.prevent+'="all"]'))},K=function(t){var e=t.href;return j(e)===j()&&D(e)===D()},tt=function(t){function e(e){var i;return(i=t.call(this,e)||this).suite=[],i.tests=new Map,i.init(),i}n(e,t);var i=e.prototype;return i.init=function(){this.add("pushState",U),this.add("exists",$),this.add("newTab",H),this.add("blank",X),this.add("corsDomain",Y),this.add("corsPort",G),this.add("download",Q),this.add("preventSelf",J),this.add("preventAll",Z),this.add("sameUrl",K,!1)},i.add=function(t,e,i){void 0===i&&(i=!0),this.tests.set(t,e),i&&this.suite.push(t)},i.run=function(t,e,i,n){return this.tests.get(t)({el:e,event:i,href:n})},i.checkLink=function(t,e,i){var n=this;return this.suite.some((function(r){return n.run(r,t,e,i)}))},e}(W),et=function(t){function e(i,n){var r;void 0===n&&(n="Barba error");for(var s=arguments.length,o=new Array(s>2?s-2:0),a=2;a0&&c.push(o),(l=this.logger).info.apply(l,["Transition found ["+a.join(",")+"]"].concat(c))}else this.logger.info("No transition found ["+a.join(",")+"]");return s},e.update=function(){var t=this;this.all=this.all.map((function(e){return t.T(e)})).sort((function(t,e){return t.priority-e.priority})).reverse().map((function(t){return delete t.priority,t})),this.page=this.all.filter((function(t){return void 0!==t.leave||void 0!==t.enter})),this.once=this.all.filter((function(t){return void 0!==t.once}))},e.R=function(t,e,i,n,r){var s=!0,o=!1,a=t,l=e.name,c=l,u=l,h=l,d=r?a[r]:a,f="to"===r?i.next:i.current;if(r?d&&d[l]:d[l]){switch(e.type){case"strings":default:var p=Array.isArray(d[c])?d[c]:[d[c]];f[c]&&-1!==p.indexOf(f[c])&&(o=!0),-1===p.indexOf(f[c])&&(s=!1);break;case"object":var m=Array.isArray(d[u])?d[u]:[d[u]];f[u]?(f[u].name&&-1!==m.indexOf(f[u].name)&&(o=!0),-1===m.indexOf(f[u].name)&&(s=!1)):s=!1;break;case"function":d[h](i)?o=!0:s=!1}o&&(r?(n[r]=n[r]||{},n[r][l]=a[r][l]):n[l]=a[l])}return s},e.O=function(t,e,i){var n=0;return(t[e]||t.from&&t.from[e]||t.to&&t.to[e])&&(n+=Math.pow(10,i),t.from&&t.from[e]&&(n+=1),t.to&&t.to[e]&&(n+=2)),n},e.T=function(t){var e=this;t.priority=0;var i=0;return this.A.forEach((function(n,r){i+=e.O(t,n.name,r+1)})),t.priority=i,t},t}(),nt=function(){function t(t){void 0===t&&(t=[]),this.logger=new h("@barba/core"),this.S=!1,this.store=new it(t)}var i=t.prototype;return i.get=function(t,e){return this.store.resolve(t,e)},i.doOnce=function(t){var e=t.data,i=t.transition;try{var n=function(){r.S=!1},r=this,s=i||{};r.S=!0;var o=l((function(){return Promise.resolve(r.j("beforeOnce",e,s)).then((function(){return Promise.resolve(r.once(e,s)).then((function(){return Promise.resolve(r.j("afterOnce",e,s)).then((function(){}))}))}))}),(function(t){r.S=!1,r.logger.debug("Transition error [before/after/once]"),r.logger.error(t)}));return Promise.resolve(o&&o.then?o.then(n):n())}catch(t){return Promise.reject(t)}},i.doPage=function(t){var e=t.data,i=t.transition,n=t.page,r=t.wrapper;try{var s=function(t){if(o)return t;a.S=!1},o=!1,a=this,c=i||{},u=!0===c.sync||!1;a.S=!0;var h=l((function(){function t(){return Promise.resolve(a.j("before",e,c)).then((function(){function t(t){return Promise.resolve(a.remove(e)).then((function(){return Promise.resolve(a.j("after",e,c)).then((function(){}))}))}var i=function(){if(u)return l((function(){return Promise.resolve(a.add(e,r)).then((function(){return Promise.resolve(a.j("beforeLeave",e,c)).then((function(){return Promise.resolve(a.j("beforeEnter",e,c)).then((function(){return Promise.resolve(Promise.all([a.leave(e,c),a.enter(e,c)])).then((function(){return Promise.resolve(a.j("afterLeave",e,c)).then((function(){return Promise.resolve(a.j("afterEnter",e,c)).then((function(){}))}))}))}))}))}))}),(function(t){if(a.M(t))throw new et(t,"Transition error [sync]")}));var t=function(t){return l((function(){var t=function(){if(!1!==i)return Promise.resolve(a.add(e,r)).then((function(){return Promise.resolve(a.j("beforeEnter",e,c)).then((function(){return Promise.resolve(a.enter(e,c,i)).then((function(){return Promise.resolve(a.j("afterEnter",e,c)).then((function(){}))}))}))}))}();if(t&&t.then)return t.then((function(){}))}),(function(t){if(a.M(t))throw new et(t,"Transition error [before/after/enter]")}))},i=!1,s=l((function(){return Promise.resolve(a.j("beforeLeave",e,c)).then((function(){return Promise.resolve(Promise.all([a.leave(e,c),O(n,e)]).then((function(t){return t[0]}))).then((function(t){return i=t,Promise.resolve(a.j("afterLeave",e,c)).then((function(){}))}))}))}),(function(t){if(a.M(t))throw new et(t,"Transition error [before/after/leave]")}));return s&&s.then?s.then(t):t()}();return i&&i.then?i.then(t):t()}))}var i=function(){if(u)return Promise.resolve(O(n,e)).then((function(){}))}();return i&&i.then?i.then(t):t()}),(function(t){if(a.S=!1,t.name&&"BarbaError"===t.name)throw a.logger.debug(t.label),a.logger.error(t.error),t;throw a.logger.debug("Transition error [page]"),a.logger.error(t),t}));return Promise.resolve(h&&h.then?h.then(s):s(h))}catch(t){return Promise.reject(t)}},i.once=function(t,e){try{return Promise.resolve(B.do("once",t,e)).then((function(){return e.once?N(e.once,e)(t):Promise.resolve()}))}catch(t){return Promise.reject(t)}},i.leave=function(t,e){try{return Promise.resolve(B.do("leave",t,e)).then((function(){return e.leave?N(e.leave,e)(t):Promise.resolve()}))}catch(t){return Promise.reject(t)}},i.enter=function(t,e,i){try{return Promise.resolve(B.do("enter",t,e)).then((function(){return e.enter?N(e.enter,e)(t,i):Promise.resolve()}))}catch(t){return Promise.reject(t)}},i.add=function(t,e){try{return P.addContainer(t.next.container,e),B.do("nextAdded",t),Promise.resolve()}catch(t){return Promise.reject(t)}},i.remove=function(t){try{return P.removeContainer(t.current.container),B.do("currentRemoved",t),Promise.resolve()}catch(t){return Promise.reject(t)}},i.M=function(t){return t.message?!/Timeout error|Fetch error/.test(t.message):!t.status},i.j=function(t,e,i){try{return Promise.resolve(B.do(t,e,i)).then((function(){return i[t]?N(i[t],i)(e):Promise.resolve()}))}catch(t){return Promise.reject(t)}},e(t,[{key:"isRunning",get:function(){return this.S},set:function(t){this.S=t}},{key:"hasOnce",get:function(){return this.store.once.length>0}},{key:"hasSelf",get:function(){return this.store.all.some((function(t){return"self"===t.name}))}},{key:"shouldWait",get:function(){return this.store.all.some((function(t){return t.to&&!t.to.route||t.sync}))}}]),t}(),rt=function(){function t(t){var e=this;this.names=["beforeLeave","afterLeave","beforeEnter","afterEnter"],this.byNamespace=new Map,0!==t.length&&(t.forEach((function(t){e.byNamespace.set(t.namespace,t)})),this.names.forEach((function(t){B[t](e.L(t))})))}return t.prototype.L=function(t){var e=this;return function(i){var n=t.match(/enter/i)?i.next:i.current,r=e.byNamespace.get(n.namespace);return r&&r[t]?N(r[t],r)(i):Promise.resolve()}},t}();Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(t){var e=this;do{if(e.matches(t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null});var st={container:null,html:"",namespace:"",url:{hash:"",href:"",path:"",port:null,query:{}}};return new(function(){function t(){this.version="2.9.7",this.schemaPage=st,this.Logger=h,this.logger=new h("@barba/core"),this.plugins=[],this.hooks=B,this.dom=P,this.helpers=L,this.history=A,this.request=q,this.url=F}var n=t.prototype;return n.use=function(t,e){var i=this.plugins;i.indexOf(t)>-1?this.logger.warn("Plugin ["+t.name+"] already installed."):"function"==typeof t.install?(t.install(this,e),i.push(t)):this.logger.warn("Plugin ["+t.name+'] has no "install" method.')},n.init=function(t){var e=void 0===t?{}:t,n=e.transitions,r=void 0===n?[]:n,s=e.views,o=void 0===s?[]:s,a=e.schema,l=void 0===a?C:a,c=e.requestError,u=e.timeout,d=void 0===u?2e3:u,f=e.cacheIgnore,p=void 0!==f&&f,m=e.prefetchIgnore,v=void 0!==m&&m,g=e.preventRunning,y=void 0!==g&&g,b=e.prevent,w=void 0===b?null:b,_=e.debug,x=e.logLevel;if(h.setLevel(!0===(void 0!==_&&_)?"debug":void 0===x?"off":x),this.logger.info(this.version),Object.keys(l).forEach((function(t){C[t]&&(C[t]=l[t])})),this.$=c,this.timeout=d,this.cacheIgnore=p,this.prefetchIgnore=v,this.preventRunning=y,this._=this.dom.getWrapper(),!this._)throw new Error("[@barba/core] No Barba wrapper found");this._.setAttribute("aria-live","polite"),this.q();var E=this.data.current;if(!E.container)throw new Error("[@barba/core] No Barba container found");if(this.cache=new V(p),this.prevent=new tt(v),this.transitions=new nt(r),this.views=new rt(o),null!==w){if("function"!=typeof w)throw new Error("[@barba/core] Prevent should be a function");this.prevent.add("preventCustom",w)}this.history.init(E.url.href,E.namespace),this.B=this.B.bind(this),this.U=this.U.bind(this),this.D=this.D.bind(this),this.F(),this.plugins.forEach((function(t){return t.init()}));var S=this.data;S.trigger="barba",S.next=S.current,S.current=i({},this.schemaPage),this.hooks.do("ready",S),this.once(S),this.q()},n.destroy=function(){this.q(),this.H(),this.history.clear(),this.hooks.clear(),this.plugins=[]},n.force=function(t){window.location.assign(t)},n.go=function(t,e,i){var n;if(void 0===e&&(e="barba"),this.transitions.isRunning)this.force(t);else if(!(n="popstate"===e?this.history.current&&this.url.getPath(this.history.current.url)===this.url.getPath(t):this.prevent.run("sameUrl",null,null,t))||this.transitions.hasSelf)return e=this.history.change(t,e,i),i&&(i.stopPropagation(),i.preventDefault()),this.page(t,e,n)},n.once=function(t){try{var e=this;return Promise.resolve(e.hooks.do("beforeEnter",t)).then((function(){function i(){return Promise.resolve(e.hooks.do("afterEnter",t)).then((function(){}))}var n=function(){if(e.transitions.hasOnce){var i=e.transitions.get(t,{once:!0});return Promise.resolve(e.transitions.doOnce({transition:i,data:t})).then((function(){}))}}();return n&&n.then?n.then(i):i()}))}catch(t){return Promise.reject(t)}},n.page=function(t,e,n){try{var r=function(){var t=s.data;return Promise.resolve(s.hooks.do("page",t)).then((function(){var e=l((function(){var e=s.transitions.get(t,{once:!1,self:n});return Promise.resolve(s.transitions.doPage({data:t,page:o,transition:e,wrapper:s._})).then((function(){s.q()}))}),(function(){0===h.getLevel()&&s.force(t.current.url.href)}));if(e&&e.then)return e.then((function(){}))}))},s=this;s.data.next.url=i({href:t},s.url.parse(t)),s.data.trigger=e;var o=s.cache.has(t)?s.cache.update(t,{action:"click"}).request:s.cache.set(t,s.request(t,s.timeout,s.onRequestError.bind(s,e)),"click").request,a=function(){if(s.transitions.shouldWait)return Promise.resolve(O(o,s.data)).then((function(){}))}();return Promise.resolve(a&&a.then?a.then(r):r())}catch(t){return Promise.reject(t)}},n.onRequestError=function(t){this.transitions.isRunning=!1;for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;nt.length)&&(e=t.length);for(var i=0,n=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function n(){return n=Object.assign?Object.assign.bind():function(t){for(var e=1;e=1;const n=i?1:this.easing(e);this.value=this.from+(this.to-this.from)*n}var n;null==(e=this.onUpdate)||e.call(this,this.value,{completed:i}),i&&this.stop()}stop(){this.isRunning=!1}fromTo(t,e,{lerp:i=.1,duration:n=1,easing:r=(t=>t),onUpdate:s}){this.from=this.value=t,this.to=e,this.lerp=i,this.duration=n,this.easing=r,this.currentTime=0,this.isRunning=!0,this.onUpdate=s}}function o(t,e){let i;return function(){let n=arguments,r=this;clearTimeout(i),i=setTimeout((function(){t.apply(r,n)}),e)}}class a{constructor(t,e){this.onWindowResize=()=>{this.width=window.innerWidth,this.height=window.innerHeight},this.onWrapperResize=()=>{this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight},this.onContentResize=()=>{const t=this.wrapper===window?document.documentElement:this.wrapper;this.scrollHeight=t.scrollHeight,this.scrollWidth=t.scrollWidth},this.wrapper=t,this.content=e,this.wrapper===window?(window.addEventListener("resize",this.onWindowResize,!1),this.onWindowResize()):(this.wrapperResizeObserver=new ResizeObserver(o(this.onWrapperResize,100)),this.wrapperResizeObserver.observe(this.wrapper),this.onWrapperResize()),this.contentResizeObserver=new ResizeObserver(o(this.onContentResize,100)),this.contentResizeObserver.observe(this.content),this.onContentResize()}destroy(){var t,e;window.removeEventListener("resize",this.onWindowResize,!1),null==(t=this.wrapperResizeObserver)||t.disconnect(),null==(e=this.contentResizeObserver)||e.disconnect()}get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}}let l=()=>({events:{},emit(t,...e){let i=this.events[t]||[];for(let t=0,n=i.length;t{var i;this.events[t]=null==(i=this.events[t])?void 0:i.filter((t=>e!==t))}}});class c{constructor(t,{wheelMultiplier:e=1,touchMultiplier:i=2,normalizeWheel:n=!1}){this.onTouchStart=t=>{const{clientX:e,clientY:i}=t.targetTouches?t.targetTouches[0]:t;this.touchStart.x=e,this.touchStart.y=i,this.lastDelta={x:0,y:0}},this.onTouchMove=t=>{const{clientX:e,clientY:i}=t.targetTouches?t.targetTouches[0]:t,n=-(e-this.touchStart.x)*this.touchMultiplier,r=-(i-this.touchStart.y)*this.touchMultiplier;this.touchStart.x=e,this.touchStart.y=i,this.lastDelta={x:n,y:r},this.emitter.emit("scroll",{type:"touch",deltaX:n,deltaY:r,event:t})},this.onTouchEnd=t=>{this.emitter.emit("scroll",{type:"touch",inertia:!0,deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:t})},this.onWheel=t=>{let{deltaX:e,deltaY:i}=t;this.normalizeWheel&&(e=r(-100,e,100),i=r(-100,i,100)),e*=this.wheelMultiplier,i*=this.wheelMultiplier,this.emitter.emit("scroll",{type:"wheel",deltaX:e,deltaY:i,event:t})},this.element=t,this.wheelMultiplier=e,this.touchMultiplier=i,this.normalizeWheel=n,this.touchStart={x:null,y:null},this.emitter=l(),this.element.addEventListener("wheel",this.onWheel,{passive:!1}),this.element.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.element.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.element.addEventListener("touchend",this.onTouchEnd,{passive:!1})}on(t,e){return this.emitter.on(t,e)}destroy(){this.emitter.events={},this.element.removeEventListener("wheel",this.onWheel,{passive:!1}),this.element.removeEventListener("touchstart",this.onTouchStart,{passive:!1}),this.element.removeEventListener("touchmove",this.onTouchMove,{passive:!1}),this.element.removeEventListener("touchend",this.onTouchEnd,{passive:!1})}}class u{constructor({direction:t,gestureDirection:e,mouseMultiplier:i,smooth:r,wrapper:o=window,content:u=document.documentElement,wheelEventsTarget:h=o,smoothWheel:d=null==r||r,smoothTouch:f=!1,syncTouch:p=!1,syncTouchLerp:m=.1,touchInertiaMultiplier:v=35,duration:g,easing:y=(t=>Math.min(1,1.001-Math.pow(2,-10*t))),lerp:b=(g?null:.1),infinite:w=!1,orientation:_=(null!=t?t:"vertical"),gestureOrientation:x=(null!=e?e:"vertical"),touchMultiplier:E=1,wheelMultiplier:S=(null!=i?i:1),normalizeWheel:k=!1}={}){this.onVirtualScroll=({type:t,inertia:e,deltaX:i,deltaY:r,event:s})=>{if(s.ctrlKey)return;const o="touch"===t,a="wheel"===t;if("vertical"===this.options.gestureOrientation&&0===r||"horizontal"===this.options.gestureOrientation&&0===i||o&&"vertical"===this.options.gestureOrientation&&0===this.scroll&&!this.options.infinite&&r<=0)return;if(s.composedPath().find((t=>null==t||null==t.hasAttribute?void 0:t.hasAttribute("data-lenis-prevent"))))return;if(this.isStopped||this.isLocked)return void s.preventDefault();if(this.isSmooth=(this.options.smoothTouch||this.options.syncTouch)&&o||this.options.smoothWheel&&a,!this.isSmooth)return this.isScrolling=!1,void this.animate.stop();s.preventDefault();let l=r;"both"===this.options.gestureOrientation?l=Math.abs(r)>Math.abs(i)?r:i:"horizontal"===this.options.gestureOrientation&&(l=i);const c=o&&this.options.syncTouch,u=o&&e&&Math.abs(l)>1;u&&(l=this.velocity*this.options.touchInertiaMultiplier),this.scrollTo(this.targetScroll+l,n({programmatic:!1},c&&{lerp:u?this.syncTouchLerp:.4}))},this.onScroll=()=>{if(!this.isScrolling){const t=this.animatedScroll;this.animatedScroll=this.targetScroll=this.actualScroll,this.velocity=0,this.direction=Math.sign(this.animatedScroll-t),this.emit()}},t&&console.warn("Lenis: `direction` option is deprecated, use `orientation` instead"),e&&console.warn("Lenis: `gestureDirection` option is deprecated, use `gestureOrientation` instead"),i&&console.warn("Lenis: `mouseMultiplier` option is deprecated, use `wheelMultiplier` instead"),r&&console.warn("Lenis: `smooth` option is deprecated, use `smoothWheel` instead"),window.lenisVersion="1.0.11",o!==document.documentElement&&o!==document.body||(o=window),this.options={wrapper:o,content:u,wheelEventsTarget:h,smoothWheel:d,smoothTouch:f,syncTouch:p,syncTouchLerp:m,touchInertiaMultiplier:v,duration:g,easing:y,lerp:b,infinite:w,gestureOrientation:x,orientation:_,touchMultiplier:E,wheelMultiplier:S,normalizeWheel:k},this.dimensions=new a(o,u),this.rootElement.classList.add("lenis"),this.velocity=0,this.isStopped=!1,this.isSmooth=d||f,this.isScrolling=!1,this.targetScroll=this.animatedScroll=this.actualScroll,this.animate=new s,this.emitter=l(),this.options.wrapper.addEventListener("scroll",this.onScroll,{passive:!1}),this.virtualScroll=new c(h,{touchMultiplier:E,wheelMultiplier:S,normalizeWheel:k}),this.virtualScroll.on("scroll",this.onVirtualScroll)}destroy(){this.emitter.events={},this.options.wrapper.removeEventListener("scroll",this.onScroll,{passive:!1}),this.virtualScroll.destroy()}on(t,e){return this.emitter.on(t,e)}off(t,e){var i;this.emitter.events[t]=null==(i=this.emitter.events[t])?void 0:i.filter((t=>e!==t))}setScroll(t){this.isHorizontal?this.rootElement.scrollLeft=t:this.rootElement.scrollTop=t}emit(){this.emitter.emit("scroll",this)}reset(){this.isLocked=!1,this.isScrolling=!1,this.velocity=0,this.animate.stop()}start(){this.isStopped=!1,this.reset()}stop(){this.isStopped=!0,this.animate.stop(),this.reset()}raf(t){const e=t-(this.time||t);this.time=t,this.animate.advance(.001*e)}scrollTo(t,{offset:e=0,immediate:i=!1,lock:n=!1,duration:s=this.options.duration,easing:o=this.options.easing,lerp:a=!s&&this.options.lerp,onComplete:l=null,force:c=!1,programmatic:u=!0}={}){if(!this.isStopped||c){if(["top","left","start"].includes(t))t=0;else if(["bottom","right","end"].includes(t))t=this.limit;else{var h;let i;if("string"==typeof t?i=document.querySelector(t):null!=(h=t)&&h.nodeType&&(i=t),i){if(this.options.wrapper!==window){const t=this.options.wrapper.getBoundingClientRect();e-=this.isHorizontal?t.left:t.top}const n=i.getBoundingClientRect();t=(this.isHorizontal?n.left:n.top)+this.animatedScroll}}if("number"==typeof t){if(t+=e,t=Math.round(t),this.options.infinite?u&&(this.targetScroll=this.animatedScroll=this.scroll):t=r(0,t,this.limit),i)return this.animatedScroll=this.targetScroll=t,this.setScroll(this.scroll),this.reset(),this.emit(),void(null==l||l());if(!u){if(t===this.targetScroll)return;this.targetScroll=t}this.animate.fromTo(this.animatedScroll,t,{duration:s,easing:o,lerp:a,onUpdate:(t,{completed:e})=>{n&&(this.isLocked=!0),this.isScrolling=!0,this.velocity=t-this.animatedScroll,this.direction=Math.sign(this.velocity),this.animatedScroll=t,this.setScroll(this.scroll),u&&(this.targetScroll=t),e&&(n&&(this.isLocked=!1),requestAnimationFrame((()=>{this.isScrolling=!1})),this.velocity=0,null==l||l()),this.emit()}})}}}get rootElement(){return this.options.wrapper===window?this.options.content:this.options.wrapper}get limit(){return this.isHorizontal?this.dimensions.limit.x:this.dimensions.limit.y}get isHorizontal(){return"horizontal"===this.options.orientation}get actualScroll(){return this.isHorizontal?this.rootElement.scrollLeft:this.rootElement.scrollTop}get scroll(){return this.options.infinite?function(t,e){let i=t%e;return(e>0&&i<0||e<0&&i>0)&&(i+=e),i}(this.animatedScroll,this.limit):this.animatedScroll}get progress(){return 0===this.limit?1:this.scroll/this.limit}get isSmooth(){return this.__isSmooth}set isSmooth(t){this.__isSmooth!==t&&(this.rootElement.classList.toggle("lenis-smooth",t),this.__isSmooth=t)}get isScrolling(){return this.__isScrolling}set isScrolling(t){this.__isScrolling!==t&&(this.rootElement.classList.toggle("lenis-scrolling",t),this.__isScrolling=t)}get isStopped(){return this.__isStopped}set isStopped(t){this.__isStopped!==t&&(this.rootElement.classList.toggle("lenis-stopped",t),this.__isStopped=t)}}var h=function(){function t(t){var e=t.scrollElements,i=t.rootMargin,n=void 0===i?"-1px -1px -1px -1px":i,r=t.IORaf;this.scrollElements=void 0,this.rootMargin=void 0,this.IORaf=void 0,this.observer=void 0,this.scrollElements=e,this.rootMargin=n,this.IORaf=r,this._init()}var e=t.prototype;return e._init=function(){var t=this;this.observer=new IntersectionObserver((function(e){e.forEach((function(e){var i=t.scrollElements.find((function(t){return t.$el===e.target}));e.isIntersecting?(i&&(i.isAlreadyIntersected=!0),t._setInview(e)):i&&i.isAlreadyIntersected&&t._setOutOfView(e)}))}),{rootMargin:this.rootMargin});for(var e,n=i(this.scrollElements);!(e=n()).done;)this.observe(e.value.$el)},e.destroy=function(){this.observer.disconnect()},e.observe=function(t){t&&this.observer.observe(t)},e.unobserve=function(t){t&&this.observer.unobserve(t)},e._setInview=function(t){var e=this.scrollElements.find((function(e){return e.$el===t.target}));this.IORaf&&(null==e||e.setInteractivityOn()),!this.IORaf&&(null==e||e.setInview())},e._setOutOfView=function(t){var e=this.scrollElements.find((function(e){return e.$el===t.target}));this.IORaf&&(null==e||e.setInteractivityOff()),!this.IORaf&&(null==e||e.setOutOfView()),null!=e&&e.attributes.scrollRepeat||this.IORaf||this.unobserve(t.target)},t}();function d(t,e,i,n,r){return i+((r-t)/(e-t)*(n-i)||0)}function f(t,e){return t.reduce((function(t,i){return Math.abs(i-e)1?1:e;if(this.progress=n,n!=this.lastProgress){if(this.lastProgress=n,this.attributes.scrollCssProgress&&this._setCssProgress(n),this.attributes.scrollEventProgress&&this._setCustomEventProgress(n),this.attributes.scrollModuleProgress)for(var r,s=i(this.progressModularModules);!(r=s()).done;){var o=r.value;this.modularInstance&&this.modularInstance.call("onScrollProgress",n,o.moduleName,o.moduleId)}n>0&&n<1&&this.setInview(),0===n&&this.setOutOfView(),1===n&&this.setOutOfView()}},e._setCssProgress=function(t){void 0===t&&(t=0),this.$el.style.setProperty("--progress",t.toString())},e._setCustomEventProgress=function(t){void 0===t&&(t=0);var e=this.attributes.scrollEventProgress;if(e){var i=new CustomEvent(e,{detail:{target:this.$el,progress:t}});window.dispatchEvent(i)}},e._getProgressModularModules=function(){if(this.modularInstance){var t=Object.keys(this.$el.dataset).filter((function(t){return t.includes("module")})),e=Object.entries(this.modularInstance.modules);if(t.length)for(var n,r=i(t);!(n=r()).done;){var s=this.$el.dataset[n.value];if(!s)return;for(var o,a=i(e);!(o=a()).done;){var l=o.value;s in l[1]&&this.progressModularModules.push({moduleName:l[0],moduleId:s})}}}},e._getScrollCallFrom=function(){var t=f([this.intersection.start,this.intersection.end],this.currentScroll);return this.intersection.start===t?"start":"end"},e._dispatchCall=function(t,e){var i,n,r=null==(i=this.attributes.scrollCall)?void 0:i.split(","),s=null==(n=this.attributes)?void 0:n.scrollCallSelf;if(r&&r.length>1){var o,a,l=r[0],c=r[1],u=r[2];a=s?this.$el.dataset["module"+c.trim()]:u,this.modularInstance&&this.modularInstance.call(l.trim(),{target:this.$el,way:t,from:e},c.trim(),null==(o=a)?void 0:o.trim())}else if(r){var h=new CustomEvent(r[0],{detail:{target:this.$el,way:t,from:e}});window.dispatchEvent(h)}},t}(),m=["scrollOffset","scrollPosition","scrollModuleProgress","scrollCssProgress","scrollEventProgress","scrollSpeed"],v=function(){function t(t){var e=t.$el,i=t.modularInstance,n=t.triggerRootMargin,r=t.rafRootMargin,s=t.scrollOrientation;this.$scrollContainer=void 0,this.modularInstance=void 0,this.triggerRootMargin=void 0,this.rafRootMargin=void 0,this.scrollElements=void 0,this.triggeredScrollElements=void 0,this.RAFScrollElements=void 0,this.scrollElementsToUpdate=void 0,this.IOTriggerInstance=void 0,this.IORafInstance=void 0,this.scrollOrientation=void 0,e?(this.$scrollContainer=e,this.modularInstance=i,this.scrollOrientation=s,this.triggerRootMargin=null!=n?n:"-1px -1px -1px -1px",this.rafRootMargin=null!=r?r:"100% 100% 100% 100%",this.scrollElements=[],this.triggeredScrollElements=[],this.RAFScrollElements=[],this.scrollElementsToUpdate=[],this._init()):console.error("Please provide a DOM Element as scrollContainer")}var e=t.prototype;return e._init=function(){var t=this.$scrollContainer.querySelectorAll("[data-scroll]"),e=Array.from(t);this._subscribeScrollElements(e),this.IOTriggerInstance=new h({scrollElements:[].concat(this.triggeredScrollElements),rootMargin:this.triggerRootMargin,IORaf:!1}),this.IORafInstance=new h({scrollElements:[].concat(this.RAFScrollElements),rootMargin:this.rafRootMargin,IORaf:!0})},e.destroy=function(){this.IOTriggerInstance.destroy(),this.IORafInstance.destroy(),this._unsubscribeAllScrollElements()},e.onResize=function(t){for(var e,n=t.currentScroll,r=i(this.RAFScrollElements);!(e=r()).done;)e.value.onResize({currentScroll:n})},e.onRender=function(t){for(var e,n=t.currentScroll,r=t.smooth,s=i(this.scrollElementsToUpdate);!(e=s()).done;)e.value.onRender({currentScroll:n,smooth:r})},e.removeScrollElements=function(t){var e=this,i=t.querySelectorAll("[data-scroll]");if(i.length){for(var n=0;n-1&&(this.IOTriggerInstance.unobserve(r.$el),this.triggeredScrollElements.splice(n,1))}for(var s=0;s-1&&(this.IORafInstance.unobserve(o.$el),this.RAFScrollElements.splice(s,1))}i.forEach((function(t){var i=e.scrollElementsToUpdate.find((function(e){return e.$el===t})),n=e.scrollElements.find((function(e){return e.$el===t}));i&&e._unsubscribeElementUpdate(i),n&&(e.scrollElements=e.scrollElements.filter((function(t){return t.id!=n.id})))}))}},e.addScrollElements=function(t){var e=t.querySelectorAll("[data-scroll]"),i=[];this.scrollElements.forEach((function(t){i.push(t.id)}));var n=Math.max.apply(Math,i)+1,r=Array.from(e);this._subscribeScrollElements(r,n,!0)},e._subscribeScrollElements=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=!1);for(var n=0;ns;)o=o._prev;return o?(e._next=o._next,o._next=e):(e._next=t[i],t[i]=e),e._next?e._next._prev=e:t[n]=e,e._prev=o,e.parent=e._dp=t,e}function I(t,e,i,n){void 0===i&&(i="_first"),void 0===n&&(n="_last");var r=e._prev,s=e._next;r?r._next=s:t[i]===e&&(t[i]=s),s?s._prev=r:t[n]===e&&(t[n]=r),e._next=e._prev=e.parent=null}function D(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0}function R(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var i=t;i;)i._dirty=1,i=i.parent;return t}function z(t,e,i,n){return t._startAt&&(bt?t._startAt.revert(fe):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,n))}function j(t){return t._repeat?Se(t._tTime,t=t.duration()+t._rDelay)*t:0}function F(t,e){return(t-e._start)*e._ts+(0<=e._ts?0:e._dirty?e.totalDuration():e._tDur)}function q(t){return t._end=_(t._start+(t._tDur/Math.abs(t._ts||t._rts||Gt)||0))}function N(t,e){var i=t._dp;return i&&i.smoothChildTiming&&t._ts&&(t._start=_(i._time-(0Gt)&&e.render(i,!0)),R(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur(r=Math.abs(r))&&(s=n,a=r);return s}function ot(t){return D(t),t.scrollTrigger&&t.scrollTrigger.kill(!!bt),t.progress()<1&&Le(t,"onInterrupt"),t}function at(t){if(c()&&t){var e=(t=!t.name&&t.default||t).name,i=r(t),n=e&&!i&&t.init?function(){this._props=[]}:t,s={init:m,render:gi,add:ii,kill:bi,modifier:yi,rawVars:0},o={targetTest:0,get:0,getSetter:fi,aliases:{},register:0};if(qe(),t!==n){if(ye[e])return;P(n,P(O(t,s),o)),Ee(n.prototype,Ee(s,O(t,o))),ye[n.prop=e]=n,t.targetTest&&(_e.push(n),me[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}p(e,n),t.register&&t.register(qi,n,_i)}else t&&Ie.push(t)}function lt(t,e,i){return(6*(t+=t<0?1:1>16,t>>8&De,t&De]:0:Re.black;if(!p){if(","===t.substr(-1)&&(t=t.substr(0,t.length-1)),Re[t])p=Re[t];else if("#"===t.charAt(0)){if(t.length<6&&(t="#"+(n=t.charAt(1))+n+(r=t.charAt(2))+r+(o=t.charAt(3))+o+(5===t.length?t.charAt(4)+t.charAt(4):"")),9===t.length)return[(p=parseInt(t.substr(1,6),16))>>16,p>>8&De,p&De,parseInt(t.substr(7),16)/255];p=[(t=parseInt(t.substr(1),16))>>16,t>>8&De,t&De]}else if("hsl"===t.substr(0,3))if(p=f=t.match(re),e){if(~t.indexOf("="))return p=t.match(se),i&&p.length<4&&(p[3]=1),p}else a=+p[0]%360/360,l=p[1]/100,n=2*(c=p[2]/100)-(r=c<=.5?c*(l+1):c+l-c*l),3=Yt?c.endTime(!1):e._dur;return n(i)&&(isNaN(i)||i in l)?(o=i.charAt(0),a="%"===i.substr(-1),s=i.indexOf("="),"<"===o||">"===o?(0<=s&&(i=i.replace(/=/,"")),("<"===o?c._start:c.endTime(0<=c._repeat))+(parseFloat(i.substr(1))||0)*(a?(s<0?c:r).totalDuration()/100:1)):s<0?(i in l||(l[i]=u),l[i]):(o=parseFloat(i.charAt(s-1)+i.substr(s+1)),a&&r&&(o=o/100*(ne(r)?r[0]:r).totalDuration()),1=i&&te)return n;n=n._next}else for(n=t._last;n&&n._start>=i;){if("isPause"===n.data&&n._start=r._start)&&r._ts&&c!==r){if(r.parent!==this)return this.render(t,e,i);if(r.render(0=this.totalDuration()||!y&&m)&&(h!==this._start&&Math.abs(u)===Math.abs(this._ts)||this._lock||(!t&&g||!(y===v&&0=n&&(s instanceof ai?e&&r.push(s):(i&&r.push(s),t&&r.push.apply(r,s.getChildren(!0,e,i)))),s=s._next;return r},a.getById=function(t){for(var e=this.getChildren(1,1,1),i=e.length;i--;)if(e[i].vars.id===t)return e[i]},a.remove=function(t){return n(t)?this.removeLabel(t):r(t)?this.killTweensOf(t):(I(this,t),t===this._recent&&(this._recent=this._last),R(this))},a.totalTime=function(e,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=_(Fe.time-(0e:!e||o.isActive())&&n.push(o):(i=o.getTweensOf(r,e)).length&&n.push.apply(n,i),o=o._next;return n},a.tweenTo=function(t,e){e=e||{};var i,n=this,r=Ce(n,t),s=e.startAt,o=e.onStart,a=e.onStartParams,l=e.immediateRender,c=ai.to(n,P({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:r,overwrite:"auto",duration:e.duration||Math.abs((r-(s&&"time"in s?s.time:n._time))/n.timeScale())||Gt,onStart:function(){if(n.pause(),!i){var t=e.duration||Math.abs((r-(s&&"time"in s?s.time:n._time))/n.timeScale());c._dur!==t&&$(c,t,0,1).render(c._time,!0,!0),i=1}o&&o.apply(c,a||[])}},e));return l?c.render(0):c},a.tweenFromTo=function(t,e,i){return this.tweenTo(e,P({startAt:{time:Ce(this,t)}},i))},a.recent=function(){return this._recent},a.nextLabel=function(t){return void 0===t&&(t=this._time),st(this,Ce(this,t))},a.previousLabel=function(t){return void 0===t&&(t=this._time),st(this,Ce(this,t),1)},a.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+Gt)},a.shiftChildren=function(t,e,i){void 0===i&&(i=0);for(var n,r=this._first,s=this.labels;r;)r._start>=i&&(r._start+=t,r._end+=t),r=r._next;if(e)for(n in s)s[n]>=i&&(s[n]+=t);return R(this)},a.invalidate=function(e){var i=this._first;for(this._lock=0;i;)i.invalidate(e),i=i._next;return t.prototype.invalidate.call(this,e)},a.clear=function(t){void 0===t&&(t=!0);for(var e,i=this._first;i;)e=i._next,this.remove(i),i=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),R(this)},a.totalDuration=function(t){var e,i,n,r=0,s=this,o=s._last,a=Yt;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-t:t));if(s._dirty){for(n=s.parent;o;)e=o._prev,o._dirty&&o.totalDuration(),a<(i=o._start)&&s._sort&&o._ts&&!s._lock?(s._lock=1,W(s,o,i-o._delay,1)._lock=0):a=i,i<0&&o._ts&&(r-=i,(!n&&!s._dp||n&&n.smoothChildTiming)&&(s._start+=i/s._ts,s._time-=i,s._tTime-=i),s.shiftChildren(-i,!1,-1/0),a=0),o._end>r&&o._ts&&(r=o._end),o=e;$(s,s===_t&&s._time>r?s._time:r,1,1),s._dirty=0}return s._tDur},o.updateRoot=function(t){if(_t._ts&&(k(_t,F(t,_t)),Ct=Fe.frame),Fe.frame>=we){we+=Ht.autoSleep||120;var e=_t._first;if((!e||!e._ts)&&Ht.autoSleep&&Fe._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||Fe.sleep()}}},o}(Ge);function Ze(t,e,i,s,o,l){var c,u,h,d;if(ye[t]&&!1!==(c=new ye[t]).init(o,c.rawVars?e[t]:function(t,e,i,s,o){if(r(t)&&(t=ri(t,o,e,i,s)),!a(t)||t.style&&t.nodeType||ne(t)||ie(t))return n(t)?ri(t,o,e,i,s):t;var l,c={};for(l in t)c[l]=ri(t[l],o,e,i,s);return c}(e[t],s,o,l,i),i,s,l)&&(i._pt=u=new _i(i._pt,o,t,0,1,c.render,c,0,c.priority),i!==Pt))for(h=i._ptLookup[i._targets.indexOf(o)],d=c._props.length;d--;)h[c._props[d]]=u;return c}function Ke(t,e,i,n){var r,s,o=e.ease||n||"power1.inOut";if(ne(e))s=i[t]||(i[t]=[]),e.forEach((function(t,i){return s.push({t:i/(e.length-1)*100,v:t,e:o})}));else for(r in e)s=i[r]||(i[r]=[]),"ease"===r||s.push({t:parseFloat(t),v:e[r],e:o})}P(Je.prototype,{_lock:0,_hasPause:0,_forcing:0});var ti,ei,ii=function(t,e,i,s,o,a,l,c,u,h){r(s)&&(s=s(o||0,t,a));var f,p=t[e],m="get"!==i?i:r(p)?u?t[e.indexOf("set")||!r(t["get"+e.substr(3)])?e:"get"+e.substr(3)](u):t[e]():p,v=r(p)?u?di:hi:ui;if(n(s)&&(~s.indexOf("random(")&&(s=rt(s)),"="===s.charAt(1)&&(!(f=x(m,s)+(G(m)||0))&&0!==f||(s=f))),!h||m!==s||ei)return isNaN(m*s)||""===s?(p||e in t||d(e,s),function(t,e,i,n,r,s,o){var a,l,c,u,h,d,f,p,m=new _i(this._pt,t,e,0,1,vi,null,r),v=0,g=0;for(m.b=i,m.e=n,i+="",(f=~(n+="").indexOf("random("))&&(n=rt(n)),s&&(s(p=[i,n],t,e),i=p[0],n=p[1]),l=i.match(ae)||[];a=ae.exec(n);)u=a[0],h=n.substring(v,a.index),c?c=(c+1)%5:"rgba("===h.substr(-5)&&(c=1),u!==l[g++]&&(d=parseFloat(l[g-1])||0,m._pt={_next:m._pt,p:h||1===g?h:",",s:d,c:"="===u.charAt(1)?x(d,u)-d:parseFloat(u)-d,m:c&&c<4?Math.round:0},v=ae.lastIndex);return m.c=v")})),h.duration();else{for(g in p={},A)"ease"===g||"easeEach"===g||Ke(g,A[g],p,A.easeEach);for(g in p)for(j=p[g].sort((function(t,e){return t.t-e.t})),d=N=0;d=t._tDur||e<0)&&t.ratio===l&&(l&&D(t,1),i||bt||(Le(t,l?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,i);return this},o.targets=function(){return this._targets},o.invalidate=function(e){return e&&this.vars.runBackwards||(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(e),t.prototype.invalidate.call(this,e)},o.resetTo=function(t,e,i,n){At||Fe.wake(),this._ts||this.play();var r=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||ni(this,r),function(t,e,i,n,r,s,o){var a,l,c,u,h=(t._pt&&t._ptCache||(t._ptCache={}))[e];if(!h)for(h=t._ptCache[e]=[],c=t._ptLookup,u=t._targets.length;u--;){if((a=c[u][e])&&a.d&&a.d._pt)for(a=a.d._pt;a&&a.p!==e&&a.fp!==e;)a=a._next;if(!a)return ei=1,t.vars[e]="+=0",ni(t,o),ei=0,1;h.push(a)}for(u=h.length;u--;)(a=(l=h[u])._pt||l).s=!n&&0!==n||r?a.s+(n||0)+s*a.c:n,a.c=i-a.s,l.e&&(l.e=w(i)+G(l.e)),l.b&&(l.b=a.s+G(l.b))}(this,t,e,i,n,this._ease(r/this._dur),r)?this.resetTo(t,e,i,n):(N(this,0),this.parent||L(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},o.kill=function(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?ot(this):this;if(this.timeline){var i=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,ti&&!0!==ti.vars.overwrite)._first||ot(this),this.parent&&i!==this.timeline.totalDuration()&&$(this,this._dur*this.timeline._tDur/i,0,1),this}var r,s,o,a,l,c,u,h=this._targets,d=t?Oe(t):h,f=this._ptLookup,p=this._pt;if((!e||"all"===e)&&function(t,e){for(var i=t.length,n=i===e.length;n&&i--&&t[i]===e[i];);return i<0}(h,d))return"all"===e&&(this._pt=0),ot(this);for(r=this._op=this._op||[],"all"!==e&&(n(e)&&(l={},b(e,(function(t){return l[t]=1})),e=l),e=function(t,e){var i,n,r,s,o=t[0]?g(t[0]).harness:0,a=o&&o.aliases;if(!a)return e;for(n in i=Ee({},e),a)if(n in i)for(r=(s=a[n].split(",")).length;r--;)i[s[r]]=i[n];return i}(h,e)),u=h.length;u--;)if(~d.indexOf(h[u]))for(l in s=f[u],"all"===e?(r[u]=e,a=s,o={}):(o=r[u]=r[u]||{},a=e),a)(c=s&&s[l])&&("kill"in c.d&&!0!==c.d.kill(l)||I(this,c,"_pt"),delete s[l]),"all"!==o&&(o[l]=1);return this._initted&&!this._pt&&p&&ot(this),this},r.to=function(t,e,i){return new r(t,e,i)},r.from=function(t,e){return X(1,arguments)},r.delayedCall=function(t,e,i,n){return new r(e,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:e,onReverseComplete:e,onCompleteParams:i,onReverseCompleteParams:i,callbackScope:n})},r.fromTo=function(t,e,i){return X(2,arguments)},r.set=function(t,e){return e.duration=0,e.repeatDelay||(e.repeat=0),new r(t,e)},r.killTweensOf=function(t,e,i){return _t.killTweensOf(t,e,i)},r}(Ge);function li(t,e,i){return t.setAttribute(e,i)}function ci(t,e,i,n){n.mSet(t,e,n.m.call(n.tween,i,n.mt),n)}P(ai.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),b("staggerTo,staggerFrom,staggerFromTo",(function(t){ai[t]=function(){var e=new Je,i=Ae.call(arguments,0);return i.splice("staggerFromTo"===t?5:4,0,0),e[t].apply(e,i)}}));var ui=function(t,e,i){return t[e]=i},hi=function(t,e,i){return t[e](i)},di=function(t,e,i,n){return t[e](n.fp,i)},fi=function(t,e){return r(t[e])?hi:o(t[e])&&t.setAttribute?li:ui},pi=function(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},mi=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},vi=function(t,e){var i=e._pt,n="";if(!t&&e.b)n=e.b;else if(1===t&&e.e)n=e.e;else{for(;i;)n=i.p+(i.m?i.m(i.s+i.c*t):Math.round(1e4*(i.s+i.c*t))/1e4)+n,i=i._next;n+=e.c}e.set(e.t,e.p,n,e)},gi=function(t,e){for(var i=e._pt;i;)i.r(t,i.d),i=i._next},yi=function(t,e,i,n){for(var r,s=this._pt;s;)r=s._next,s.p===n&&s.modifier(t,e,i),s=r},bi=function(t){for(var e,i,n=this._pt;n;)i=n._next,n.p===t&&!n.op||n.op===t?I(this,n,"_pt"):n.dep||(e=1),n=i;return!e},wi=function(t){for(var e,i,n,r,s=t._pt;s;){for(e=s._next,i=n;i&&i.pr>s.pr;)i=i._next;(s._prev=i?i._prev:r)?s._prev._next=s:n=s,(s._next=i)?i._prev=s:r=s,s=e}t._pt=n},_i=(xi.prototype.modifier=function(t,e,i){this.mSet=this.mSet||this.set,this.set=ci,this.m=t,this.mt=i,this.tween=e},xi);function xi(t,e,i,n,r,s,o,a,l){this.t=e,this.s=n,this.c=r,this.p=i,this.r=s||pi,this.d=o||this,this.set=a||ui,this.pr=l||0,(this._next=t)&&(t._prev=this)}function Ei(t){return(Ci[t]||Pi).map((function(t){return t()}))}function Si(){var t=Date.now(),e=[];2=o;t&&!f&&j(rt,!b),z&&O(e,z,t?"remove":"add")}))},E&&(x=rt.filter((function(t){return!t.sd&&!t.a.isVisible&&t.b.isVisible})).map((function(t){return t.a.element}))),J?(x&&(y=J._abs).push.apply(y,q(rt,x)),J._run.push(m)):(x&&N(q(rt,x)),m());var vt=J?J.timeline:tt;return vt.revert=function(){return _t(vt,1,1)},vt}function Y(t){for(var e,i=t.idLookup={},n=t.alt={},r=t.elementStates,s=r.length;s--;)i[(e=r[s]).id]?n[e.id]=e:i[e.id]=e}var G,Q,J,Z,K,tt,et,it,nt,rt=1,st={},ot=180/Math.PI,at=Math.PI/180,lt={},ct={},ut={},ht=C("onStart,onUpdate,onComplete,onReverseComplete,onInterrupt"),dt=C("transform,transformOrigin,width,height,position,top,left,opacity,zIndex,maxWidth,maxHeight,minWidth,minHeight"),ft={zIndex:1,kill:1,simple:1,spin:1,clearProps:1,targets:1,toggleClass:1,onComplete:1,onUpdate:1,onInterrupt:1,onStart:1,delay:1,repeat:1,repeatDelay:1,yoyo:1,scale:1,fade:1,absolute:1,props:1,onEnter:1,onLeave:1,custom:1,paused:1,nested:1,prune:1,absoluteOnLeave:1},pt={zIndex:1,simple:1,clearProps:1,scale:1,absolute:1,fitChild:1,getVars:1,props:1},mt={},vt="paddingTop,paddingRight,paddingBottom,paddingLeft,gridArea,transition".split(","),gt=function(t,e,i,n){return t instanceof kt?t:t instanceof xt?function(t,e){return e&&t.idLookup[gt(e).id]||t.elementStates[0]}(t,n):new kt("string"==typeof t?P(t)||console.warn(t+" not found"):t,e,i)},yt=function(t,e,i,n,r,s){var o,a,l,c,u,h,d,f=t.element,p=t.cache,m=t.parent,v=t.x,g=t.y,y=e.width,b=e.height,w=e.scaleX,_=e.scaleY,x=e.rotation,E=e.bounds,S=s&&et&&et(f,"transform"),T=t,C=e.matrix,P=C.e,O=C.f,M=t.bounds.width!==E.width||t.bounds.height!==E.height||t.scaleX!==w||t.scaleY!==_||t.rotation!==x,L=!M&&t.simple&&e.simple&&!r;return L||!m?(w=_=1,x=o=0):(h=(u=function(t){var e=t._gsap||Q.core.getCache(t);return e.gmCache===Q.ticker.frame?e.gMatrix:(e.gmCache=Q.ticker.frame,e.gMatrix=k(t,!0,!1,!0))}(m)).clone().multiply(e.ctm?e.matrix.clone().multiply(e.ctm):e.matrix),x=A(Math.atan2(h.b,h.a)*ot),o=A(Math.atan2(h.c,h.d)*ot+x)%360,w=Math.sqrt(Math.pow(h.a,2)+Math.pow(h.b,2)),_=Math.sqrt(Math.pow(h.c,2)+Math.pow(h.d,2))*Math.cos(o*at),r&&(r=G(r)[0],c=Q.getProperty(r),d=r.getBBox&&"function"==typeof r.getBBox&&r.getBBox(),T={scaleX:c("scaleX"),scaleY:c("scaleY"),width:d?d.width:Math.ceil(parseFloat(c("width","px"))),height:d?d.height:parseFloat(c("height","px"))}),p.rotation=x+"deg",p.skewX=o+"deg"),i?(w*=y!==T.width&&T.width?y/T.width:1,_*=b!==T.height&&T.height?b/T.height:1,p.scaleX=w,p.scaleY=_):(y=tt(y*w/T.scaleX,0),b=tt(b*_/T.scaleY,0),f.style.width=y+"px",f.style.height=b+"px"),n&&B(f,e.props),L||!m?(v+=P-t.matrix.e,g+=O-t.matrix.f):M||m!==e.parent?(p.renderTransform(1,p),h=k(r||f,!1,!1,!0),a=u.apply({x:h.e,y:h.f}),v+=(l=u.apply({x:P,y:O})).x-a.x,g+=l.y-a.y):(u.e=u.f=0,v+=(l=u.apply({x:P-t.matrix.e,y:O-t.matrix.f})).x,g+=l.y),v=tt(v,.02),g=tt(g,.02),!s||s instanceof kt?(p.x=v+"px",p.y=g+"px",p.renderTransform(1,p)):S&&S.revert(),s&&(s.x=v,s.y=g,s.rotation=x,s.skewX=o,i?(s.scaleX=w,s.scaleY=_):(s.width=y,s.height=b)),s||p},bt=[],wt="width,height,overflowX,overflowY".split(","),_t=function(t,e,i){if(t&&t.progress()<1&&(!t.paused()||i))return e&&(function t(e){e.vars.onInterrupt&&e.vars.onInterrupt.apply(e,e.vars.onInterruptParams||[]),e.getChildren(!0,!1,!0).forEach(t)}(t),e<2&&t.progress(1),t.kill()),!0},xt=((nt=Et.prototype).update=function(t){var e=this;return this.elementStates=this.targets.map((function(t){return new kt(t,e.props,e.simple)})),Y(this),this.interrupt(t),this.recordInlineStyles(),this},nt.clear=function(){return this.targets.length=this.elementStates.length=0,Y(this),this},nt.fit=function(t,e,i){for(var n,r,s=D(this.elementStates.slice(0),!1,!0),o=(t||this).idLookup,a=0;a",this.addState(this.options.iconState),this.setSkewing(this.options.skewingIcon)},e.removeIcon=function(){this.removeState(this.options.iconState),this.removeSkewing()},e.setMedia=function(t){var e=this;clearTimeout(this.mediaInt),t&&(this.mediaBox.innerHTML="",this.mediaBox.appendChild(t)),this.mediaInt=setTimeout((function(){return e.addState(e.options.mediaState)}),20),this.setSkewing(this.options.skewingMedia)},e.removeMedia=function(){var t=this;clearTimeout(this.mediaInt),this.removeState(this.options.mediaState),this.mediaInt=setTimeout((function(){return t.mediaBox.innerHTML=""}),this.options.hideMediaTimeout),this.removeSkewing()},e.setImg=function(t){this.mediaImg||(this.mediaImg=new Image),this.mediaImg.src!==t&&(this.mediaImg.src=t),this.setMedia(this.mediaImg)},e.removeImg=function(){this.removeMedia()},e.setVideo=function(t){this.mediaVideo||(this.mediaVideo=document.createElement("video"),this.mediaVideo.muted=!0,this.mediaVideo.loop=!0,this.mediaVideo.autoplay=!0),this.mediaVideo.src!==t&&(this.mediaVideo.src=t,this.mediaVideo.load()),this.mediaVideo.play(),this.setMedia(this.mediaVideo)},e.removeVideo=function(){this.mediaVideo&&this.mediaVideo.readyState>2&&this.mediaVideo.pause(),this.removeMedia()},e.on=function(t,e){this.events[t]instanceof Array||this.off(t),this.events[t].push(e)},e.off=function(t,e){this.events[t]=e?this.events[t].filter((function(t){return t!==e})):[]},e.trigger=function(t){var e=arguments,i=this;this.events[t]&&this.events[t].forEach((function(t){return t.call.apply(t,[i,i].concat([].slice.call(e,1)))}))},e.getFromDataset=function(t){var e=t.dataset;return{state:e[this.options.dataAttr],show:e[this.options.dataAttr+"Show"],text:e[this.options.dataAttr+"Text"],icon:e[this.options.dataAttr+"Icon"],img:e[this.options.dataAttr+"Img"],video:e[this.options.dataAttr+"Video"],stick:e[this.options.dataAttr+"Stick"]}},e.destroy=function(){this.trigger("destroy"),this.gsap.ticker.remove(this.ticker),this.container.removeEventListener("mouseleave",this.event.mouseleave),this.container.removeEventListener("mouseenter",this.event.mouseenter),this.container.removeEventListener("mousedown",this.event.mousedown),this.container.removeEventListener("mouseup",this.event.mouseup),this.container.removeEventListener("mousemove",this.event.mousemove),this.container.removeEventListener("mousemove",this.event.mousemoveOnce),this.container.removeEventListener("mouseover",this.event.mouseover),this.container.removeEventListener("mouseout",this.event.mouseout),this.el&&(this.container.removeChild(this.el),this.el=null,this.mediaImg=null,this.mediaVideo=null)},t}();return t})),function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],(function(i){return e(t,i)})):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,(function(t,e){"use strict";var i=Array.prototype.slice,n=t.console,r=void 0===n?function(){}:function(t){n.error(t)};function s(n,s,a){(a=a||e||t.jQuery)&&(s.prototype.option||(s.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[n]=function(t){return"string"==typeof t?function(t,e,i){var s,o="$()."+n+'("'+e+'")';return t.each((function(t,l){var c=a.data(l,n);if(c){var u=c[e];if(u&&"_"!=e.charAt(0)){var h=u.apply(c,i);s=void 0===s?h:s}else r(o+" is not a valid method")}else r(n+" not initialized. Cannot call methods, i.e. "+o)})),void 0!==s?s:t}(this,t,i.call(arguments,1)):(function(t,e){t.each((function(t,i){var r=a.data(i,n);r?(r.option(e),r._init()):(r=new s(i,e),a.data(i,n,r))}))}(this,t),this)},o(a))}function o(t){!t||t&&t.bridget||(t.bridget=s)}return o(e||t.jQuery),s})),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,(function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{};return(i[t]=i[t]||{})[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var n=this._onceEvents&&this._onceEvents[t],r=0;r