mirror of
https://github.com/locomotivemtl/locomotive-boilerplate.git
synced 2026-01-15 00:55:08 +08:00
20 lines
71 KiB
JavaScript
20 lines
71 KiB
JavaScript
(()=>{var de=Object.create;var q=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames,wt=Object.getOwnPropertySymbols,pe=Object.getPrototypeOf,Et=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable;var St=(i,n,t)=>n in i?q(i,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[n]=t,kt=(i,n)=>{for(var t in n||(n={}))Et.call(n,t)&&St(i,t,n[t]);if(wt)for(var t of wt(n))ye.call(n,t)&&St(i,t,n[t]);return i};var ge=(i,n)=>()=>(i&&(n=i(i=0)),n);var be=(i,n)=>()=>(n||i((n={exports:{}}).exports,n),n.exports),At=(i,n)=>{for(var t in n)q(i,t,{get:n[t],enumerable:!0})},we=(i,n,t,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of me(n))!Et.call(i,s)&&s!==t&&q(i,s,{get:()=>n[s],enumerable:!(e=ve(n,s))||e.enumerable});return i};var Se=(i,n,t)=>(t=i!=null?de(pe(i)):{},we(n||!i||!i.__esModule?q(t,"default",{value:i,enumerable:!0}):t,i));var I=(i,n,t)=>new Promise((e,s)=>{var r=l=>{try{a(t.next(l))}catch(c){s(c)}},o=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?e(l.value):Promise.resolve(l.value).then(r,o);a((t=t.apply(i,n)).next())});var se=be((ne,nt)=>{(function(i,n){typeof define=="function"&&define.amd?define([],function(){return i.svg4everybody=n()}):typeof nt=="object"&&nt.exports?nt.exports=n():i.svg4everybody=n()})(ne,function(){function i(s,r,o){if(o){var a=document.createDocumentFragment(),l=!r.hasAttribute("viewBox")&&o.getAttribute("viewBox");l&&r.setAttribute("viewBox",l);for(var c=o.cloneNode(!0);c.childNodes.length;)a.appendChild(c.firstChild);s.appendChild(a)}}function n(s){s.onreadystatechange=function(){if(s.readyState===4){var r=s._cachedDocument;r||(r=s._cachedDocument=document.implementation.createHTMLDocument(""),r.body.innerHTML=s.responseText,s._cachedTarget={}),s._embeds.splice(0).map(function(o){var a=s._cachedTarget[o.id];a||(a=s._cachedTarget[o.id]=r.getElementById(o.id)),i(o.parent,o.svg,a)})}},s.onreadystatechange()}function t(s){function r(){for(var T=0;T<C.length;){var k=C[T],w=k.parentNode,d=e(w),m=k.getAttribute("xlink:href")||k.getAttribute("href");if(!m&&a.attributeName&&(m=k.getAttribute(a.attributeName)),d&&m){if(o)if(!a.validate||a.validate(m,d,k)){w.removeChild(k);var b=m.split("#"),y=b.shift(),A=b.join("#");if(y.length){var g=h[y];g||(g=h[y]=new XMLHttpRequest,g.open("GET",y),g.send(),g._embeds=[]),g._embeds.push({parent:w,svg:d,id:A}),n(g)}else i(w,d,document.getElementById(A))}else++T,++L}else++T}(!C.length||C.length-L>0)&&p(r,67)}var o,a=Object(s),l=/\bTrident\/[567]\b|\bMSIE (?:9|10)\.0\b/,c=/\bAppleWebKit\/(\d+)\b/,f=/\bEdge\/12\.(\d+)\b/,u=/\bEdge\/.(\d+)\b/,v=window.top!==window.self;o="polyfill"in a?a.polyfill:l.test(navigator.userAgent)||(navigator.userAgent.match(f)||[])[1]<10547||(navigator.userAgent.match(c)||[])[1]<537||u.test(navigator.userAgent)&&v;var h={},p=window.requestAnimationFrame||setTimeout,C=document.getElementsByTagName("use"),L=0;o&&r()}function e(s){for(var r=s;r.nodeName.toLowerCase()!=="svg"&&(r=r.parentNode););return r}return t})});var oe={};At(oe,{gridHelper:()=>Di});function Di({gutterCssVar:i=xi,marginCssVar:n=Oi,rgbaColor:t=Li}={}){let e=document.createElement("div");document.body.append(e),re(e,t),Mi(e,i,n),Ii(e,t)}function Mi(i,n,t){let e=i.style;e.zIndex="10000",e.position="fixed",e.top="0",e.left="0",e.display="flex",e.width="100%",e.height="100%",e.columnGap=`var(${n}, 0)`,e.paddingLeft=`var(${t}, 0)`,e.paddingRight=`var(${t}, 0)`,e.pointerEvents="none",e.visibility="hidden"}function re(i,n){i.innerHTML="";let t=Number(window.getComputedStyle(i).getPropertyValue("--grid-columns")),e;for(var s=0;s<t;s++)e=document.createElement("div"),e.style.flex="1 1 0",e.style.backgroundColor=n,i.appendChild(e)}function Ii(i,n){window.addEventListener("resize",re(i,n));let t=!1,e=!1;document.addEventListener("keydown",s=>{s.key=="Control"?t=!0:t&&s.key=="g"&&(e?i.style.visibility="hidden":i.style.visibility="visible",e=!e)}),document.addEventListener("keyup",s=>{s.key=="Control"&&(t=!1)})}var xi,Oi,Li,ae=ge(()=>{xi="--grid-gutter",Oi="--grid-margin",Li="rgba(255, 0, 0, .1)"});function K(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?K=function(n){return typeof n}:K=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},K(i)}function _t(i,n){if(!(i instanceof n))throw new TypeError("Cannot call a class as a function")}function Tt(i,n){for(var t=0;t<n.length;t++){var e=n[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(i,e.key,e)}}function xt(i,n,t){return n&&Tt(i.prototype,n),t&&Tt(i,t),i}function Ct(i,n,t){return n in i?Object.defineProperty(i,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[n]=t,i}function X(i,n){return Ae(i)||Ce(i,n)||Ot(i,n)||xe()}function Ee(i){return ke(i)||Te(i)||Ot(i)||_e()}function ke(i){if(Array.isArray(i))return at(i)}function Ae(i){if(Array.isArray(i))return i}function Te(i){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(i))return Array.from(i)}function Ce(i,n){if(!(typeof Symbol=="undefined"||!(Symbol.iterator in Object(i)))){var t=[],e=!0,s=!1,r=void 0;try{for(var o=i[Symbol.iterator](),a;!(e=(a=o.next()).done)&&(t.push(a.value),!(n&&t.length===n));e=!0);}catch(l){s=!0,r=l}finally{try{!e&&o.return!=null&&o.return()}finally{if(s)throw r}}return t}}function Ot(i,n){if(i){if(typeof i=="string")return at(i,n);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return at(i,n)}}function at(i,n){(n==null||n>i.length)&&(n=i.length);for(var t=0,e=new Array(n);t<n;t++)e[t]=i[t];return e}function _e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var H=function(){function i(n){_t(this,i),this.mAttr="data-"+n.dataName,this.mCaptureEvents=["mouseenter","mouseleave"],this.el=n.el}return xt(i,[{key:"mInit",value:function(t){var e=this;this.modules=t,this.mCheckEventTarget=this.mCheckEventTarget.bind(this),this.events&&Object.keys(this.events).forEach(function(s){return e.mAddEvent(s)})}},{key:"mUpdate",value:function(t){this.modules=t}},{key:"mDestroy",value:function(){var t=this;this.events&&Object.keys(this.events).forEach(function(e){return t.mRemoveEvent(e)})}},{key:"mAddEvent",value:function(t){var e=!!this.mCaptureEvents.includes(t);this.el.addEventListener(t,this.mCheckEventTarget,e)}},{key:"mRemoveEvent",value:function(t){var e=!!this.mCaptureEvents.includes(t);this.el.removeEventListener(t,this.mCheckEventTarget,e)}},{key:"mCheckEventTarget",value:function(t){var e=this.events[t.type];if(typeof e=="string")this[e](t);else{var s="["+this.mAttr+"]",r=t.target;if(this.mCaptureEvents.includes(t.type))r.matches(s)&&this.mCallEventMethod(t,e,r);else for(;r&&r!==document&&!(r.matches(s)&&this.mCallEventMethod(t,e,r)!="undefined");)r=r.parentNode}}},{key:"mCallEventMethod",value:function(t,e,s){var r=s.getAttribute(this.mAttr);if(e.hasOwnProperty(r)){var o=e[r];t.hasOwnProperty("currentTarget")||Object.defineProperty(t,"currentTarget",{value:s}),t.hasOwnProperty("curTarget")||Object.defineProperty(t,"curTarget",{value:s}),this[o](t)}}},{key:"$",value:function(t,e){var s=t.indexOf("."),r=t.indexOf("#"),o=t.indexOf("["),a=[s,r,o].filter(function(v){return v!=-1}),l=!1,c=t,f="",u=this.el;return a.length&&(l=Math.min.apply(Math,Ee(a)),c=t.slice(0,l),f=t.slice(l)),K(e)=="object"&&(u=e),u.querySelectorAll("["+this.mAttr+"="+c+"]"+f)}},{key:"parent",value:function(t,e){for(var s="["+this.mAttr+"="+t+"]",r=e.parentNode;r&&r!==document;){if(r.matches(s))return r;r=r.parentNode}}},{key:"getData",value:function(t,e){var s=e||this.el;return s.getAttribute(this.mAttr+"-"+t)}},{key:"setData",value:function(t,e,s){var r=s||this.el;return r.setAttribute(this.mAttr+"-"+t,e)}},{key:"call",value:function(t,e,s,r){var o=this;e&&!s&&(s=e,e=!1),this.modules[s]&&(r?this.modules[s][r]&&this.modules[s][r][t](e):Object.keys(this.modules[s]).forEach(function(a){o.modules[s][a][t](e)}))}},{key:"on",value:function(t,e,s,r){var o=this;this.modules[e]&&(r?this.modules[e][r].el.addEventListener(t,function(a){return s(a)}):Object.keys(this.modules[e]).forEach(function(a){o.modules[e][a].el.addEventListener(t,function(l){return s(l)})}))}},{key:"init",value:function(){}},{key:"destroy",value:function(){}}]),i}(),Oe=function(){function i(n){_t(this,i),this.app,this.modules=n.modules,this.currentModules={},this.activeModules={},this.newModules={},this.moduleId=0}return xt(i,[{key:"init",value:function(t,e){var s=this,r=e||document,o=r.querySelectorAll("*");t&&!this.app&&(this.app=t),this.activeModules.app={app:this.app},o.forEach(function(a){Array.from(a.attributes).forEach(function(l){if(l.name.startsWith("data-module")){var c=!1,f=l.name.split("-").splice(2),u=s.toCamel(f);if(s.modules[u]?c=!0:s.modules[s.toUpper(u)]&&(u=s.toUpper(u),c=!0),c){var v={el:a,name:u,dataName:f.join("-")},h=new s.modules[u](v),p=l.value;p||(s.moduleId++,p="m"+s.moduleId,a.setAttribute(l.name,p)),s.addActiveModule(u,p,h);var C=u+"-"+p;e?s.newModules[C]=h:s.currentModules[C]=h}}})}),Object.entries(this.currentModules).forEach(function(a){var l=X(a,2),c=l[0],f=l[1];if(e){var u=c.split("-"),v=u.shift(),h=u.pop();s.addActiveModule(v,h,f)}else s.initModule(f)})}},{key:"initModule",value:function(t){t.mInit(this.activeModules),t.init()}},{key:"addActiveModule",value:function(t,e,s){this.activeModules[t]?Object.assign(this.activeModules[t],Ct({},e,s)):this.activeModules[t]=Ct({},e,s)}},{key:"update",value:function(t){var e=this;this.init(this.app,t),Object.entries(this.currentModules).forEach(function(s){var r=X(s,2),o=r[0],a=r[1];a.mUpdate(e.activeModules)}),Object.entries(this.newModules).forEach(function(s){var r=X(s,2),o=r[0],a=r[1];e.initModule(a)}),Object.assign(this.currentModules,this.newModules)}},{key:"destroy",value:function(t){t?this.destroyScope(t):this.destroyModules()}},{key:"destroyScope",value:function(t){var e=this,s=t.querySelectorAll("*");s.forEach(function(r){Array.from(r.attributes).forEach(function(o){if(o.name.startsWith("data-module")){var a=o.value,l=o.name.split("-").splice(2),c=e.toCamel(l)+"-"+a,f=!1;e.currentModules[c]?f=!0:e.currentModules[e.toUpper(c)]&&(c=e.toUpper(c),f=!0),f&&(e.destroyModule(e.currentModules[c]),delete e.currentModules[c])}})}),this.activeModules={},this.newModules={}}},{key:"destroyModules",value:function(){var t=this;Object.entries(this.currentModules).forEach(function(e){var s=X(e,2),r=s[0],o=s[1];t.destroyModule(o)}),this.currentModules=[]}},{key:"destroyModule",value:function(t){t.mDestroy(),t.destroy()}},{key:"toCamel",value:function(t){var e=this;return t.reduce(function(s,r){return s+e.toUpper(r)})}},{key:"toUpper",value:function(t){return t.charAt(0).toUpperCase()+t.slice(1)}}]),i}(),Lt=Oe;var vt={};At(vt,{Example:()=>$,Load:()=>Z,Scroll:()=>it});var Mt="fonts"in document;function Le(i,n){for(let[t,e]of Object.entries(n))switch(t){case"family":{if(G(i[t])!==e)return!1;break}case"weight":{if(i[t]!=e)return!1;break}default:{if(i[t]!==e)return!1;break}}return!0}function De(i,n){let t=G(i.family);return G(t)===n||n.endsWith(G(t))&&(n.match(i.weight)||n.match(i.style)),!0}function Me(i){let n=[];for(let t of document.fonts)Le(t,i)&&n.push(t);return n}function Ie(i){let n=[];for(let t of document.fonts)De(t,i)&&n.push(t);return n}function It(i){Array.isArray(i)||(i=[i]);let n=new Set;return i.forEach(t=>{if(t)switch(typeof t){case"string":n.add(...Ie(t));return;case"object":n.add(...Me(t));return}throw new TypeError("Expected font query to be font shorthand or font reference")}),[...n]}function Pt(i,n=!1){return I(this,null,function*(){var t;if(((t=i.size)!=null?t:i.length)===0)throw new TypeError("Expected at least one font");return yield Pe([...i],n)})}function Dt(i){return I(this,null,function*(){return yield(i.status==="unloaded"?i.load():i.loaded).then(n=>n,n=>i)})}function Pe(i,n=!1){return I(this,null,function*(){n&&console.group("[loadFonts:API]",i.length,"/",document.fonts.size);let t=[];for(let e of i)e instanceof FontFace?(document.fonts.has(e)||document.fonts.add(e),t.push(Dt(e))):t.push(...It(e).map(s=>Dt(s)));return n&&console.groupEnd(),yield Promise.all(t)})}function G(i){return i.replace(/['"]+/g,"")}function Rt(i){return I(this,null,function*(){let n=It(i);return yield Promise.all(n.map(t=>t.loaded))})}var $=class extends H{constructor(i){super(i)}init(){Rt(lt).then(i=>this.onFontsLoaded(i))}onFontsLoaded(i){console.log("Example: Eager Fonts Loaded!",i)}};function Re(i,n){if(!(i instanceof n))throw new TypeError("Cannot call a class as a function")}function Bt(i,n){for(var t=0;t<n.length;t++){var e=n[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(i,e.key,e)}}function Be(i,n,t){return n&&Bt(i.prototype,n),t&&Bt(i,t),i}function je(i,n){return He(i)||We(i,n)||ze(i,n)||Ne()}function He(i){if(Array.isArray(i))return i}function We(i,n){var t=i==null?null:typeof Symbol!="undefined"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var e=[],s=!0,r=!1,o,a;try{for(t=t.call(i);!(s=(o=t.next()).done)&&(e.push(o.value),!(n&&e.length===n));s=!0);}catch(l){r=!0,a=l}finally{try{!s&&t.return!=null&&t.return()}finally{if(r)throw a}}return e}}function ze(i,n){if(i){if(typeof i=="string")return jt(i,n);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return jt(i,n)}}function jt(i,n){(n==null||n>i.length)&&(n=i.length);for(var t=0,e=new Array(n);t<n;t++)e[t]=i[t];return e}function Ne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Ye=function(){function i(n){Re(this,i),this.defaults={name:"load",loadingClass:"is-loading",loadedClass:"is-loaded",readyClass:"is-ready",transitionsPrefix:"is-",transitionsHistory:!0,enterDelay:0,exitDelay:0,loadedDelay:0,isLoaded:!1,isEntered:!1,isUrl:!1,transitionContainer:null,popstateIgnore:!1},Object.assign(this,this.defaults,n),this.options=n,this.namespace="modular",this.html=document.documentElement,this.href=window.location.href,this.container="data-"+this.name+"-container",this.subContainer=!1,this.prevTransition=null,this.loadAttributes=["src","srcset","style","href"],this.isInserted=!1,this.isLoading=!1,this.enterTimeout=!1,this.controller=new AbortController,this.classContainer=this.html,this.isChrome=navigator.userAgent.indexOf("Chrome")!=-1,this.init()}return Be(i,[{key:"init",value:function(){var t=this;window.addEventListener("popstate",function(e){return t.checkState(e)},!1),this.html.addEventListener("click",function(e){return t.checkClick(e)},!1),this.loadEls(document)}},{key:"checkClick",value:function(t){if(!t.ctrlKey&&!t.metaKey)for(var e=t.target;e&&e!==document;){if(e.matches("a")&&e.getAttribute("download")==null){var s=e.getAttribute("href");!s.startsWith("#")&&!s.startsWith("mailto:")&&!s.startsWith("tel:")&&(t.preventDefault(),this.reset(),this.getClickOptions(e));break}e=e.parentNode}}},{key:"checkState",value:function(){typeof this.popstateIgnore=="string"&&window.location.href.indexOf(this.popstateIgnore)>-1||(this.reset(),this.getStateOptions())}},{key:"reset",value:function(){this.isLoading&&(this.controller.abort(),this.isLoading=!1,this.controller=new AbortController),window.clearTimeout(this.enterTimeout),this.isInserted&&this.removeContainer(),this.classContainer=this.html,Object.assign(this,this.defaults,this.options)}},{key:"getClickOptions",value:function(t){this.transition=t.getAttribute("data-"+this.name),this.isUrl=t.getAttribute("data-"+this.name+"-url");var e=t.getAttribute("href"),s=t.getAttribute("target");if(s=="_blank"){window.open(e,"_blank");return}if(this.transition=="false"){window.location=e;return}this.setOptions(e,!0)}},{key:"getStateOptions",value:function(){this.transitionsHistory?this.transition=history.state:this.transition=!1;var t=window.location.href;this.setOptions(t)}},{key:"goTo",value:function(t,e,s){this.reset(),this.transition=e,this.isUrl=s,this.setOptions(t,!0)}},{key:"setOptions",value:function(t,e){var s="["+this.container+"]",r;this.transition&&this.transition!="true"&&(this.transitionContainer="["+this.container+'="'+this.transition+'"]',this.loadingClass=this.transitions[this.transition].loadingClass||this.loadingClass,this.loadedClass=this.transitions[this.transition].loadedClass||this.loadedClass,this.readyClass=this.transitions[this.transition].readyClass||this.readyClass,this.transitionsPrefix=this.transitions[this.transition].transitionsPrefix||this.transitionsPrefix,this.enterDelay=this.transitions[this.transition].enterDelay||this.enterDelay,this.exitDelay=this.transitions[this.transition].exitDelay||this.exitDelay,this.loadedDelay=this.transitions[this.transition].loadedDelay||this.loadedDelay,r=document.querySelector(this.transitionContainer)),r?(s=this.transitionContainer,this.oldContainer=r,this.classContainer=this.oldContainer.parentNode,this.subContainer||history.replaceState(this.transition,null,this.href),this.subContainer=!0):(this.oldContainer=document.querySelector(s),this.subContainer&&history.replaceState(this.prevTransition,null,this.href),this.subContainer=!1),this.href=t,this.parentContainer=this.oldContainer.parentNode,this.isUrl===""||this.isUrl!=null&&this.isUrl!="false"&&this.isUrl!=!1?history.pushState(this.transition,null,t):(this.oldContainer.classList.add("is-old"),this.setLoading(),this.startEnterDelay(),this.loadHref(t,s,e))}},{key:"setLoading",value:function(){this.classContainer.classList.remove(this.loadedClass,this.readyClass),this.classContainer.classList.add(this.loadingClass),this.classContainer.classList.remove(this.transitionsPrefix+this.prevTransition),this.transition&&this.classContainer.classList.add(this.transitionsPrefix+this.transition),this.subContainer||(this.prevTransition=this.transition);var t=new Event(this.namespace+"loading");window.dispatchEvent(t)}},{key:"startEnterDelay",value:function(){var t=this;this.enterTimeout=window.setTimeout(function(){t.isEntered=!0,t.isLoaded&&t.transitionContainers()},this.enterDelay)}},{key:"loadHref",value:function(t,e,s){var r=this;this.isLoading=!0;var o=this.controller.signal;fetch(t,{signal:o}).then(function(a){return a.text()}).then(function(a){s&&history.pushState(r.transition,null,t);var l=new DOMParser;r.data=l.parseFromString(a,"text/html"),r.newContainer=r.data.querySelector(e),r.newContainer.classList.add("is-new"),r.parentNewContainer=r.newContainer.parentNode,r.hideContainer(),r.parentContainer.insertBefore(r.newContainer,r.oldContainer),r.isInserted=!0,r.setSvgs(),r.isLoaded=!0,r.isEntered&&r.transitionContainers(),r.loadEls(r.newContainer),r.isLoading=!1}).catch(function(a){window.location=t})}},{key:"transitionContainers",value:function(){var t=this;this.setAttributes(),this.showContainer(),this.setLoaded(),setTimeout(function(){t.removeContainer(),t.setReady()},this.exitDelay)}},{key:"setSvgs",value:function(){if(this.isChrome){var t=this.newContainer.querySelectorAll("use");t.length&&t.forEach(function(e){var s=e.getAttribute("xlink:href");if(s)e.parentNode.innerHTML='<use xlink:href="'+s+'"></use>';else{var r=e.getAttribute("href");r&&(e.parentNode.innerHTML='<use href="'+r+'"></use>')}})}}},{key:"setAttributes",value:function(){var t=this,e=this.data.getElementsByTagName("title")[0],s=this.data.head.querySelector('meta[name="description"]'),r=document.head.querySelector('meta[name="description"]'),o,a;this.subContainer?(a=this.parentNewContainer,o=document.querySelector(this.transitionContainer).parentNode):(a=this.data.querySelector("html"),o=document.querySelector("html"));var l=Object.assign({},a.dataset);e&&(document.title=e.innerText),r&&s&&r.setAttribute("content",s.getAttribute("content")),l&&Object.entries(l).forEach(function(c){var f=je(c,2),u=f[0],v=f[1];o.setAttribute("data-"+t.toDash(u),v)})}},{key:"toDash",value:function(t){return t.split(/(?=[A-Z])/).join("-").toLowerCase()}},{key:"hideContainer",value:function(){this.newContainer.style.visibility="hidden",this.newContainer.style.height=0,this.newContainer.style.overflow="hidden"}},{key:"showContainer",value:function(){this.newContainer.style.visibility="",this.newContainer.style.height="",this.newContainer.style.overflow=""}},{key:"loadEls",value:function(t){var e=this,s=[];this.loadAttributes.forEach(function(r){var o="data-"+e.name+"-"+r,a=t.querySelectorAll("["+o+"]");a.length&&a.forEach(function(l){var c=l.getAttribute(o);if(l.setAttribute(r,c),r=="src"||r=="srcset"){var f=new Promise(function(u){l.onload=function(){return u(l)}});s.push(f)}})}),Promise.all(s).then(function(r){var o=new Event(e.namespace+"images");window.dispatchEvent(o)})}},{key:"setLoaded",value:function(){var t=this;this.classContainer.classList.remove(this.loadingClass),setTimeout(function(){t.classContainer.classList.add(t.loadedClass)},this.loadedDelay);var e=new Event(this.namespace+"loaded");window.dispatchEvent(e)}},{key:"removeContainer",value:function(){this.parentContainer.removeChild(this.oldContainer),this.newContainer.classList.remove("is-new"),this.isInserted=!1}},{key:"setReady",value:function(){this.classContainer.classList.add(this.readyClass);var t=new Event(this.namespace+"ready");window.dispatchEvent(t)}},{key:"on",value:function(t,e){var s=this;window.addEventListener(this.namespace+t,function(){switch(t){case"loading":return e(s.transition,s.oldContainer);case"loaded":return e(s.transition,s.oldContainer,s.newContainer);case"ready":return e(s.transition,s.newContainer);default:return e()}},!1)}}]),i}(),Ht=Ye;var Z=class extends H{constructor(i){super(i)}init(){new Ht({enterDelay:0,transitions:{customTransition:{}}}).on("loaded",(n,t,e)=>{this.call("destroy",t,"app"),this.call("update",e,"app")})}};var Fe=i=>({url:i.src,width:i.naturalWidth,height:i.naturalHeight,ratio:i.naturalWidth/i.naturalHeight}),Ve=(i,n={})=>new Promise((t,e)=>{let s=new Image;n.crossOrigin&&(s.crossOrigin=n.crossOrigin);let r=()=>{t(kt({element:s},Fe(s)))};s.decode?(s.src=i,s.decode().then(r).catch(o=>{e(o)})):(s.onload=r,s.onerror=o=>{e(o)},s.src=i)}),Wt=[],zt=(i,n,t)=>I(void 0,null,function*(){let e=n||i.dataset.src,s=Wt.find(r=>r.url===e);if(!s){if(s=yield Ve(e),!s.url)return;Wt.push(s)}i.src!==e&&(i.tagName==="IMG"?i.src=s.url:i.style.backgroundImage=`url(${s.url})`,requestAnimationFrame(()=>{let r=i.closest(".c-lazy");r&&(r.classList.add("-lazy-loaded"),r.style.backgroundImage=""),i.classList.add("-lazy-loaded"),t==null||t()}))});function tt(i,n){if(!(i instanceof n))throw new TypeError("Cannot call a class as a function")}function Nt(i,n){for(var t=0;t<n.length;t++){var e=n[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(i,e.key,e)}}function et(i,n,t){return n&&Nt(i.prototype,n),t&&Nt(i,t),i}function Ue(i,n,t){return n in i?Object.defineProperty(i,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[n]=t,i}function Yt(i,n){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(i);n&&(e=e.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),t.push.apply(t,e)}return t}function ct(i){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Yt(Object(t),!0).forEach(function(e){Ue(i,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Yt(Object(t)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(t,e))})}return i}function Vt(i,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(n&&n.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),n&&ft(i,n)}function D(i){return D=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},D(i)}function ft(i,n){return ft=Object.setPrototypeOf||function(e,s){return e.__proto__=s,e},ft(i,n)}function qe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(i){return!1}}function Ut(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Xe(i,n){return n&&(typeof n=="object"||typeof n=="function")?n:Ut(i)}function qt(i){var n=qe();return function(){var e=D(i),s;if(n){var r=D(this).constructor;s=Reflect.construct(e,arguments,r)}else s=e.apply(this,arguments);return Xe(this,s)}}function Ke(i,n){for(;!Object.prototype.hasOwnProperty.call(i,n)&&(i=D(i),i!==null););return i}function R(i,n,t){return typeof Reflect!="undefined"&&Reflect.get?R=Reflect.get:R=function(s,r,o){var a=Ke(s,r);if(a){var l=Object.getOwnPropertyDescriptor(a,r);return l.get?l.get.call(o):l.value}},R(i,n,t||i)}function W(i,n){return Ze(i)||Qe(i,n)||Xt(i,n)||ei()}function Ge(i){return $e(i)||Je(i)||Xt(i)||ti()}function $e(i){if(Array.isArray(i))return dt(i)}function Ze(i){if(Array.isArray(i))return i}function Je(i){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(i))return Array.from(i)}function Qe(i,n){if(!(typeof Symbol=="undefined"||!(Symbol.iterator in Object(i)))){var t=[],e=!0,s=!1,r=void 0;try{for(var o=i[Symbol.iterator](),a;!(e=(a=o.next()).done)&&(t.push(a.value),!(n&&t.length===n));e=!0);}catch(l){s=!0,r=l}finally{try{!e&&o.return!=null&&o.return()}finally{if(s)throw r}}return t}}function Xt(i,n){if(i){if(typeof i=="string")return dt(i,n);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return dt(i,n)}}function dt(i,n){(n==null||n>i.length)&&(n=i.length);for(var t=0,e=new Array(n);t<n;t++)e[t]=i[t];return e}function ti(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ei(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var z={el:document,name:"scroll",offset:[0,0],repeat:!1,smooth:!1,initPosition:{x:0,y:0},direction:"vertical",gestureDirection:"vertical",reloadOnContextChange:!1,lerp:.1,class:"is-inview",scrollbarContainer:!1,scrollbarClass:"c-scrollbar",scrollingClass:"has-scroll-scrolling",draggingClass:"has-scroll-dragging",smoothClass:"has-scroll-smooth",initClass:"has-scroll-init",getSpeed:!1,getDirection:!1,scrollFromAnywhere:!1,multiplier:1,firefoxMultiplier:50,touchMultiplier:2,resetNativeScroll:!0,tablet:{smooth:!1,direction:"vertical",gestureDirection:"vertical",breakpoint:1024},smartphone:{smooth:!1,direction:"vertical",gestureDirection:"vertical"}},Kt=function(){function i(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};tt(this,i),Object.assign(this,z,n),this.smartphone=z.smartphone,n.smartphone&&Object.assign(this.smartphone,n.smartphone),this.tablet=z.tablet,n.tablet&&Object.assign(this.tablet,n.tablet),this.namespace="locomotive",this.html=document.documentElement,this.windowHeight=window.innerHeight,this.windowWidth=window.innerWidth,this.windowMiddle={x:this.windowWidth/2,y:this.windowHeight/2},this.els={},this.currentElements={},this.listeners={},this.hasScrollTicking=!1,this.hasCallEventSet=!1,this.checkScroll=this.checkScroll.bind(this),this.checkResize=this.checkResize.bind(this),this.checkEvent=this.checkEvent.bind(this),this.instance={scroll:{x:0,y:0},limit:{x:this.html.offsetWidth,y:this.html.offsetHeight},currentElements:this.currentElements},this.isMobile?this.isTablet?this.context="tablet":this.context="smartphone":this.context="desktop",this.isMobile&&(this.direction=this[this.context].direction),this.direction==="horizontal"?this.directionAxis="x":this.directionAxis="y",this.getDirection&&(this.instance.direction=null),this.getDirection&&(this.instance.speed=0),this.html.classList.add(this.initClass),window.addEventListener("resize",this.checkResize,!1)}return et(i,[{key:"init",value:function(){this.initEvents()}},{key:"checkScroll",value:function(){this.dispatchScroll()}},{key:"checkResize",value:function(){var t=this;this.resizeTick||(this.resizeTick=!0,requestAnimationFrame(function(){t.resize(),t.resizeTick=!1}))}},{key:"resize",value:function(){}},{key:"checkContext",value:function(){if(this.reloadOnContextChange){this.isMobile=/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1||this.windowWidth<this.tablet.breakpoint,this.isTablet=this.isMobile&&this.windowWidth>=this.tablet.breakpoint;var t=this.context;if(this.isMobile?this.isTablet?this.context="tablet":this.context="smartphone":this.context="desktop",t!=this.context){var e=t=="desktop"?this.smooth:this[t].smooth,s=this.context=="desktop"?this.smooth:this[this.context].smooth;e!=s&&window.location.reload()}}}},{key:"initEvents",value:function(){var t=this;this.scrollToEls=this.el.querySelectorAll("[data-".concat(this.name,"-to]")),this.setScrollTo=this.setScrollTo.bind(this),this.scrollToEls.forEach(function(e){e.addEventListener("click",t.setScrollTo,!1)})}},{key:"setScrollTo",value:function(t){t.preventDefault(),this.scrollTo(t.currentTarget.getAttribute("data-".concat(this.name,"-href"))||t.currentTarget.getAttribute("href"),{offset:t.currentTarget.getAttribute("data-".concat(this.name,"-offset"))})}},{key:"addElements",value:function(){}},{key:"detectElements",value:function(t){var e=this,s=this.instance.scroll.y,r=s+this.windowHeight,o=this.instance.scroll.x,a=o+this.windowWidth;Object.entries(this.els).forEach(function(l){var c=W(l,2),f=c[0],u=c[1];if(u&&(!u.inView||t)&&(e.direction==="horizontal"?a>=u.left&&o<u.right&&e.setInView(u,f):r>=u.top&&s<u.bottom&&e.setInView(u,f)),u&&u.inView)if(e.direction==="horizontal"){var v=u.right-u.left;u.progress=(e.instance.scroll.x-(u.left-e.windowWidth))/(v+e.windowWidth),(a<u.left||o>u.right)&&e.setOutOfView(u,f)}else{var h=u.bottom-u.top;u.progress=(e.instance.scroll.y-(u.top-e.windowHeight))/(h+e.windowHeight),(r<u.top||s>u.bottom)&&e.setOutOfView(u,f)}}),this.hasScrollTicking=!1}},{key:"setInView",value:function(t,e){this.els[e].inView=!0,t.el.classList.add(t.class),this.currentElements[e]=t,t.call&&this.hasCallEventSet&&(this.dispatchCall(t,"enter"),t.repeat||(this.els[e].call=!1))}},{key:"setOutOfView",value:function(t,e){var s=this;this.els[e].inView=!1,Object.keys(this.currentElements).forEach(function(r){r===e&&delete s.currentElements[r]}),t.call&&this.hasCallEventSet&&this.dispatchCall(t,"exit"),t.repeat&&t.el.classList.remove(t.class)}},{key:"dispatchCall",value:function(t,e){this.callWay=e,this.callValue=t.call.split(",").map(function(r){return r.trim()}),this.callObj=t,this.callValue.length==1&&(this.callValue=this.callValue[0]);var s=new Event(this.namespace+"call");this.el.dispatchEvent(s)}},{key:"dispatchScroll",value:function(){var t=new Event(this.namespace+"scroll");this.el.dispatchEvent(t)}},{key:"setEvents",value:function(t,e){this.listeners[t]||(this.listeners[t]=[]);var s=this.listeners[t];s.push(e),s.length===1&&this.el.addEventListener(this.namespace+t,this.checkEvent,!1),t==="call"&&(this.hasCallEventSet=!0,this.detectElements(!0))}},{key:"unsetEvents",value:function(t,e){if(this.listeners[t]){var s=this.listeners[t],r=s.indexOf(e);r<0||(s.splice(r,1),s.index===0&&this.el.removeEventListener(this.namespace+t,this.checkEvent,!1))}}},{key:"checkEvent",value:function(t){var e=this,s=t.type.replace(this.namespace,""),r=this.listeners[s];!r||r.length===0||r.forEach(function(o){switch(s){case"scroll":return o(e.instance);case"call":return o(e.callValue,e.callWay,e.callObj);default:return o()}})}},{key:"startScroll",value:function(){}},{key:"stopScroll",value:function(){}},{key:"setScroll",value:function(t,e){this.instance.scroll={x:0,y:0}}},{key:"destroy",value:function(){var t=this;window.removeEventListener("resize",this.checkResize,!1),Object.keys(this.listeners).forEach(function(e){t.el.removeEventListener(t.namespace+e,t.checkEvent,!1)}),this.listeners={},this.scrollToEls.forEach(function(e){e.removeEventListener("click",t.setScrollTo,!1)}),this.html.classList.remove(this.initClass)}}]),i}(),ii=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Gt(i,n){return n={exports:{}},i(n,n.exports),n.exports}var $t=Gt(function(i,n){(function(){function t(){var e=window,s=document;if("scrollBehavior"in s.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;var r=e.HTMLElement||e.Element,o=468,a={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||u,scrollIntoView:r.prototype.scrollIntoView},l=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function c(d){var m=["MSIE ","Trident/","Edge/"];return new RegExp(m.join("|")).test(d)}var f=c(e.navigator.userAgent)?1:0;function u(d,m){this.scrollLeft=d,this.scrollTop=m}function v(d){return .5*(1-Math.cos(Math.PI*d))}function h(d){if(d===null||typeof d!="object"||d.behavior===void 0||d.behavior==="auto"||d.behavior==="instant")return!0;if(typeof d=="object"&&d.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+d.behavior+" is not a valid value for enumeration ScrollBehavior.")}function p(d,m){if(m==="Y")return d.clientHeight+f<d.scrollHeight;if(m==="X")return d.clientWidth+f<d.scrollWidth}function C(d,m){var b=e.getComputedStyle(d,null)["overflow"+m];return b==="auto"||b==="scroll"}function L(d){var m=p(d,"Y")&&C(d,"Y"),b=p(d,"X")&&C(d,"X");return m||b}function T(d){for(;d!==s.body&&L(d)===!1;)d=d.parentNode||d.host;return d}function k(d){var m=l(),b,y,A,g=(m-d.startTime)/o;g=g>1?1:g,b=v(g),y=d.startX+(d.x-d.startX)*b,A=d.startY+(d.y-d.startY)*b,d.method.call(d.scrollable,y,A),(y!==d.x||A!==d.y)&&e.requestAnimationFrame(k.bind(e,d))}function w(d,m,b){var y,A,g,S,B=l();d===s.body?(y=e,A=e.scrollX||e.pageXOffset,g=e.scrollY||e.pageYOffset,S=a.scroll):(y=d,A=d.scrollLeft,g=d.scrollTop,S=u),k({scrollable:y,method:S,startTime:B,startX:A,startY:g,x:m,y:b})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(h(arguments[0])===!0){a.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}w.call(e,s.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(h(arguments[0])){a.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}w.call(e,s.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},r.prototype.scroll=r.prototype.scrollTo=function(){if(arguments[0]!==void 0){if(h(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");a.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}var d=arguments[0].left,m=arguments[0].top;w.call(this,this,typeof d=="undefined"?this.scrollLeft:~~d,typeof m=="undefined"?this.scrollTop:~~m)}},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(h(arguments[0])===!0){a.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},r.prototype.scrollIntoView=function(){if(h(arguments[0])===!0){a.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}var d=T(this),m=d.getBoundingClientRect(),b=this.getBoundingClientRect();d!==s.body?(w.call(this,d,d.scrollLeft+b.left-m.left,d.scrollTop+b.top-m.top),e.getComputedStyle(d).position!=="fixed"&&e.scrollBy({left:m.left,top:m.top,behavior:"smooth"})):e.scrollBy({left:b.left,top:b.top,behavior:"smooth"})}}i.exports={polyfill:t}})()}),Zi=$t.polyfill,ni=function(i){Vt(t,i);var n=qt(t);function t(){var e,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return tt(this,t),e=n.call(this,s),e.resetNativeScroll&&(history.scrollRestoration&&(history.scrollRestoration="manual"),window.scrollTo(0,0)),window.addEventListener("scroll",e.checkScroll,!1),window.smoothscrollPolyfill===void 0&&(window.smoothscrollPolyfill=$t,window.smoothscrollPolyfill.polyfill()),e}return et(t,[{key:"init",value:function(){this.instance.scroll.y=window.pageYOffset,this.addElements(),this.detectElements(),R(D(t.prototype),"init",this).call(this)}},{key:"checkScroll",value:function(){var s=this;R(D(t.prototype),"checkScroll",this).call(this),this.getDirection&&this.addDirection(),this.getSpeed&&(this.addSpeed(),this.speedTs=Date.now()),this.instance.scroll.y=window.pageYOffset,Object.entries(this.els).length&&(this.hasScrollTicking||(requestAnimationFrame(function(){s.detectElements()}),this.hasScrollTicking=!0))}},{key:"addDirection",value:function(){window.pageYOffset>this.instance.scroll.y?this.instance.direction!=="down"&&(this.instance.direction="down"):window.pageYOffset<this.instance.scroll.y&&this.instance.direction!=="up"&&(this.instance.direction="up")}},{key:"addSpeed",value:function(){window.pageYOffset!=this.instance.scroll.y?this.instance.speed=(window.pageYOffset-this.instance.scroll.y)/Math.max(1,Date.now()-this.speedTs):this.instance.speed=0}},{key:"resize",value:function(){Object.entries(this.els).length&&(this.windowHeight=window.innerHeight,this.updateElements())}},{key:"addElements",value:function(){var s=this;this.els={};var r=this.el.querySelectorAll("[data-"+this.name+"]");r.forEach(function(o,a){var l=o.getBoundingClientRect(),c=o.dataset[s.name+"Class"]||s.class,f=typeof o.dataset[s.name+"Id"]=="string"?o.dataset[s.name+"Id"]:a,u,v,h=typeof o.dataset[s.name+"Offset"]=="string"?o.dataset[s.name+"Offset"].split(","):s.offset,p=o.dataset[s.name+"Repeat"],C=o.dataset[s.name+"Call"],L=o.dataset[s.name+"Target"],T;L!==void 0?T=document.querySelector("".concat(L)):T=o;var k=T.getBoundingClientRect();u=k.top+s.instance.scroll.y,v=k.left+s.instance.scroll.x;var w=u+T.offsetHeight,d=v+T.offsetWidth;p=="false"?p=!1:p!=null?p=!0:p=s.repeat;var m=s.getRelativeOffset(h);u=u+m[0],w=w-m[1];var b={el:o,targetEl:T,id:f,class:c,top:u,bottom:w,left:v,right:d,offset:h,progress:0,repeat:p,inView:!1,call:C};s.els[f]=b,o.classList.contains(c)&&s.setInView(s.els[f],f)})}},{key:"updateElements",value:function(){var s=this;Object.entries(this.els).forEach(function(r){var o=W(r,2),a=o[0],l=o[1],c=l.targetEl.getBoundingClientRect().top+s.instance.scroll.y,f=c+l.targetEl.offsetHeight,u=s.getRelativeOffset(l.offset);s.els[a].top=c+u[0],s.els[a].bottom=f-u[1]}),this.hasScrollTicking=!1}},{key:"getRelativeOffset",value:function(s){var r=[0,0];if(s)for(var o=0;o<s.length;o++)typeof s[o]=="string"?s[o].includes("%")?r[o]=parseInt(s[o].replace("%","")*this.windowHeight/100):r[o]=parseInt(s[o]):r[o]=s[o];return r}},{key:"scrollTo",value:function(s){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=parseInt(r.offset)||0,a=r.callback?r.callback:!1;if(typeof s=="string"){if(s==="top")s=this.html;else if(s==="bottom")s=this.html.offsetHeight-window.innerHeight;else if(s=document.querySelector(s),!s)return}else if(typeof s=="number")s=parseInt(s);else if(!(s&&s.tagName)){console.warn("`target` parameter is not valid");return}typeof s!="number"?o=s.getBoundingClientRect().top+o+this.instance.scroll.y:o=s+o;var l=function(){return parseInt(window.pageYOffset)===parseInt(o)};if(a)if(l()){a();return}else{var c=function f(){l()&&(window.removeEventListener("scroll",f),a())};window.addEventListener("scroll",c)}window.scrollTo({top:o,behavior:r.duration===0?"auto":"smooth"})}},{key:"update",value:function(){this.addElements(),this.detectElements()}},{key:"destroy",value:function(){R(D(t.prototype),"destroy",this).call(this),window.removeEventListener("scroll",this.checkScroll,!1)}}]),t}(Kt);var Ft=Object.getOwnPropertySymbols,si=Object.prototype.hasOwnProperty,ri=Object.prototype.propertyIsEnumerable;function oi(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function ai(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var n={},t=0;t<10;t++)n["_"+String.fromCharCode(t)]=t;var e=Object.getOwnPropertyNames(n).map(function(r){return n[r]});if(e.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(r){s[r]=r}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch(r){return!1}}var li=ai()?Object.assign:function(i,n){for(var t,e=oi(i),s,r=1;r<arguments.length;r++){t=Object(arguments[r]);for(var o in t)si.call(t,o)&&(e[o]=t[o]);if(Ft){s=Ft(t);for(var a=0;a<s.length;a++)ri.call(t,s[a])&&(e[s[a]]=t[s[a]])}}return e};function Zt(){}Zt.prototype={on:function(i,n,t){var e=this.e||(this.e={});return(e[i]||(e[i]=[])).push({fn:n,ctx:t}),this},once:function(i,n,t){var e=this;function s(){e.off(i,s),n.apply(t,arguments)}return s._=n,this.on(i,s,t)},emit:function(i){var n=[].slice.call(arguments,1),t=((this.e||(this.e={}))[i]||[]).slice(),e=0,s=t.length;for(e;e<s;e++)t[e].fn.apply(t[e].ctx,n);return this},off:function(i,n){var t=this.e||(this.e={}),e=t[i],s=[];if(e&&n)for(var r=0,o=e.length;r<o;r++)e[r].fn!==n&&e[r].fn._!==n&&s.push(e[r]);return s.length?t[i]=s:delete t[i],this}};var ci=Zt,hi=Gt(function(i,n){(function(){var t;t=n!==null?n:this,t.Lethargy=function(){function e(s,r,o,a){this.stability=s!=null?Math.abs(s):8,this.sensitivity=r!=null?1+Math.abs(r):100,this.tolerance=o!=null?1+Math.abs(o):1.1,this.delay=a!=null?a:150,this.lastUpDeltas=function(){var l,c,f;for(f=[],l=1,c=this.stability*2;1<=c?l<=c:l>=c;1<=c?l++:l--)f.push(null);return f}.call(this),this.lastDownDeltas=function(){var l,c,f;for(f=[],l=1,c=this.stability*2;1<=c?l<=c:l>=c;1<=c?l++:l--)f.push(null);return f}.call(this),this.deltasTimestamp=function(){var l,c,f;for(f=[],l=1,c=this.stability*2;1<=c?l<=c:l>=c;1<=c?l++:l--)f.push(null);return f}.call(this)}return e.prototype.check=function(s){var r;return s=s.originalEvent||s,s.wheelDelta!=null?r=s.wheelDelta:s.deltaY!=null?r=s.deltaY*-40:(s.detail!=null||s.detail===0)&&(r=s.detail*-40),this.deltasTimestamp.push(Date.now()),this.deltasTimestamp.shift(),r>0?(this.lastUpDeltas.push(r),this.lastUpDeltas.shift(),this.isInertia(1)):(this.lastDownDeltas.push(r),this.lastDownDeltas.shift(),this.isInertia(-1))},e.prototype.isInertia=function(s){var r,o,a,l,c,f,u;return r=s===-1?this.lastDownDeltas:this.lastUpDeltas,r[0]===null?s:this.deltasTimestamp[this.stability*2-2]+this.delay>Date.now()&&r[0]===r[this.stability*2-1]?!1:(a=r.slice(0,this.stability),o=r.slice(this.stability,this.stability*2),u=a.reduce(function(v,h){return v+h}),c=o.reduce(function(v,h){return v+h}),f=u/a.length,l=c/o.length,Math.abs(f)<Math.abs(l*this.tolerance)&&this.sensitivity<Math.abs(l)?s:!1)},e.prototype.showLastUpDeltas=function(){return this.lastUpDeltas},e.prototype.showLastDownDeltas=function(){return this.lastDownDeltas},e}()}).call(ii)}),_=function(){return{hasWheelEvent:"onwheel"in document,hasMouseWheelEvent:"onmousewheel"in document,hasTouch:"ontouchstart"in window||window.TouchEvent||window.DocumentTouch&&document instanceof DocumentTouch,hasTouchWin:navigator.msMaxTouchPoints&&navigator.msMaxTouchPoints>1,hasPointer:!!window.navigator.msPointerEnabled,hasKeyDown:"onkeydown"in document,isFirefox:navigator.userAgent.indexOf("Firefox")>-1}}(),ui=Object.prototype.toString,fi=Object.prototype.hasOwnProperty,di=function(i){if(!i)return console.warn("bindAll requires at least one argument.");var n=Array.prototype.slice.call(arguments,1);if(n.length===0)for(var t in i)fi.call(i,t)&&typeof i[t]=="function"&&ui.call(i[t])=="[object Function]"&&n.push(t);for(var e=0;e<n.length;e++){var s=n[e];i[s]=vi(i[s],i)}};function vi(i,n){return function(){return i.apply(n,arguments)}}var mi=hi.Lethargy,j="virtualscroll",pi=x,Y={LEFT:37,UP:38,RIGHT:39,DOWN:40,SPACE:32};function x(i){di(this,"_onWheel","_onMouseWheel","_onTouchStart","_onTouchMove","_onKeyDown"),this.el=window,i&&i.el&&(this.el=i.el,delete i.el),this.options=li({mouseMultiplier:1,touchMultiplier:2,firefoxMultiplier:15,keyStep:120,preventTouch:!1,unpreventTouchClass:"vs-touchmove-allowed",limitInertia:!1,useKeyboard:!0,useTouch:!0},i),this.options.limitInertia&&(this._lethargy=new mi),this._emitter=new ci,this._event={y:0,x:0,deltaX:0,deltaY:0},this.touchStartX=null,this.touchStartY=null,this.bodyTouchAction=null,this.options.passive!==void 0&&(this.listenerOptions={passive:this.options.passive})}x.prototype._notify=function(i){var n=this._event;n.x+=n.deltaX,n.y+=n.deltaY,this._emitter.emit(j,{x:n.x,y:n.y,deltaX:n.deltaX,deltaY:n.deltaY,originalEvent:i})};x.prototype._onWheel=function(i){var n=this.options;if(!(this._lethargy&&this._lethargy.check(i)===!1)){var t=this._event;t.deltaX=i.wheelDeltaX||i.deltaX*-1,t.deltaY=i.wheelDeltaY||i.deltaY*-1,_.isFirefox&&i.deltaMode==1&&(t.deltaX*=n.firefoxMultiplier,t.deltaY*=n.firefoxMultiplier),t.deltaX*=n.mouseMultiplier,t.deltaY*=n.mouseMultiplier,this._notify(i)}};x.prototype._onMouseWheel=function(i){if(!(this.options.limitInertia&&this._lethargy.check(i)===!1)){var n=this._event;n.deltaX=i.wheelDeltaX?i.wheelDeltaX:0,n.deltaY=i.wheelDeltaY?i.wheelDeltaY:i.wheelDelta,this._notify(i)}};x.prototype._onTouchStart=function(i){var n=i.targetTouches?i.targetTouches[0]:i;this.touchStartX=n.pageX,this.touchStartY=n.pageY};x.prototype._onTouchMove=function(i){var n=this.options;n.preventTouch&&!i.target.classList.contains(n.unpreventTouchClass)&&i.preventDefault();var t=this._event,e=i.targetTouches?i.targetTouches[0]:i;t.deltaX=(e.pageX-this.touchStartX)*n.touchMultiplier,t.deltaY=(e.pageY-this.touchStartY)*n.touchMultiplier,this.touchStartX=e.pageX,this.touchStartY=e.pageY,this._notify(i)};x.prototype._onKeyDown=function(i){var n=this._event;n.deltaX=n.deltaY=0;var t=window.innerHeight-40;switch(i.keyCode){case Y.LEFT:case Y.UP:n.deltaY=this.options.keyStep;break;case Y.RIGHT:case Y.DOWN:n.deltaY=-this.options.keyStep;break;case i.shiftKey:n.deltaY=t;break;case Y.SPACE:n.deltaY=-t;break;default:return}this._notify(i)};x.prototype._bind=function(){_.hasWheelEvent&&this.el.addEventListener("wheel",this._onWheel,this.listenerOptions),_.hasMouseWheelEvent&&this.el.addEventListener("mousewheel",this._onMouseWheel,this.listenerOptions),_.hasTouch&&this.options.useTouch&&(this.el.addEventListener("touchstart",this._onTouchStart,this.listenerOptions),this.el.addEventListener("touchmove",this._onTouchMove,this.listenerOptions)),_.hasPointer&&_.hasTouchWin&&(this.bodyTouchAction=document.body.style.msTouchAction,document.body.style.msTouchAction="none",this.el.addEventListener("MSPointerDown",this._onTouchStart,!0),this.el.addEventListener("MSPointerMove",this._onTouchMove,!0)),_.hasKeyDown&&this.options.useKeyboard&&document.addEventListener("keydown",this._onKeyDown)};x.prototype._unbind=function(){_.hasWheelEvent&&this.el.removeEventListener("wheel",this._onWheel),_.hasMouseWheelEvent&&this.el.removeEventListener("mousewheel",this._onMouseWheel),_.hasTouch&&(this.el.removeEventListener("touchstart",this._onTouchStart),this.el.removeEventListener("touchmove",this._onTouchMove)),_.hasPointer&&_.hasTouchWin&&(document.body.style.msTouchAction=this.bodyTouchAction,this.el.removeEventListener("MSPointerDown",this._onTouchStart,!0),this.el.removeEventListener("MSPointerMove",this._onTouchMove,!0)),_.hasKeyDown&&this.options.useKeyboard&&document.removeEventListener("keydown",this._onKeyDown)};x.prototype.on=function(i,n){this._emitter.on(j,i,n);var t=this._emitter.e;t&&t[j]&&t[j].length===1&&this._bind()};x.prototype.off=function(i,n){this._emitter.off(j,i,n);var t=this._emitter.e;(!t[j]||t[j].length<=0)&&this._unbind()};x.prototype.reset=function(){var i=this._event;i.x=0,i.y=0};x.prototype.destroy=function(){this._emitter.off(),this._unbind()};function ht(i,n,t){return(1-t)*i+t*n}function O(i){var n={};if(window.getComputedStyle){var t=getComputedStyle(i),e=t.transform||t.webkitTransform||t.mozTransform,s=e.match(/^matrix3d\((.+)\)$/);return s?(n.x=s?parseFloat(s[1].split(", ")[12]):0,n.y=s?parseFloat(s[1].split(", ")[13]):0):(s=e.match(/^matrix\((.+)\)$/),n.x=s?parseFloat(s[1].split(", ")[4]):0,n.y=s?parseFloat(s[1].split(", ")[5]):0),n}}function ut(i){for(var n=[];i&&i!==document;i=i.parentNode)n.push(i);return n}var yi=4,gi=.001,bi=1e-7,wi=10,F=11,J=1/(F-1),Si=typeof Float32Array=="function";function Jt(i,n){return 1-3*n+3*i}function Qt(i,n){return 3*n-6*i}function te(i){return 3*i}function Q(i,n,t){return((Jt(n,t)*i+Qt(n,t))*i+te(n))*i}function ee(i,n,t){return 3*Jt(n,t)*i*i+2*Qt(n,t)*i+te(n)}function Ei(i,n,t,e,s){var r,o,a=0;do o=n+(t-n)/2,r=Q(o,e,s)-i,r>0?t=o:n=o;while(Math.abs(r)>bi&&++a<wi);return o}function ki(i,n,t,e){for(var s=0;s<yi;++s){var r=ee(n,t,e);if(r===0)return n;var o=Q(n,t,e)-i;n-=o/r}return n}function Ai(i){return i}var Ti=function(n,t,e,s){if(!(0<=n&&n<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(n===t&&e===s)return Ai;for(var r=Si?new Float32Array(F):new Array(F),o=0;o<F;++o)r[o]=Q(o*J,n,e);function a(l){for(var c=0,f=1,u=F-1;f!==u&&r[f]<=l;++f)c+=J;--f;var v=(l-r[f])/(r[f+1]-r[f]),h=c+v*J,p=ee(h,n,e);return p>=gi?ki(l,h,n,e):p===0?h:Ei(l,c,c+J,n,e)}return function(c){return c===0?0:c===1?1:Q(a(c),t,s)}},P={LEFT:37,UP:38,RIGHT:39,DOWN:40,SPACE:32,TAB:9,PAGEUP:33,PAGEDOWN:34,HOME:36,END:35},Ci=function(i){Vt(t,i);var n=qt(t);function t(){var e,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return tt(this,t),history.scrollRestoration&&(history.scrollRestoration="manual"),window.scrollTo(0,0),e=n.call(this,s),e.inertia&&(e.lerp=e.inertia*.1),e.isScrolling=!1,e.isDraggingScrollbar=!1,e.isTicking=!1,e.hasScrollTicking=!1,e.parallaxElements={},e.stop=!1,e.scrollbarContainer=s.scrollbarContainer,e.checkKey=e.checkKey.bind(Ut(e)),window.addEventListener("keydown",e.checkKey,!1),e}return et(t,[{key:"init",value:function(){var s=this;this.html.classList.add(this.smoothClass),this.html.setAttribute("data-".concat(this.name,"-direction"),this.direction),this.instance=ct({delta:{x:this.initPosition.x,y:this.initPosition.y},scroll:{x:this.initPosition.x,y:this.initPosition.y}},this.instance),this.vs=new pi({el:this.scrollFromAnywhere?document:this.el,mouseMultiplier:navigator.platform.indexOf("Win")>-1?1:.4,firefoxMultiplier:this.firefoxMultiplier,touchMultiplier:this.touchMultiplier,useKeyboard:!1,passive:!0}),this.vs.on(function(r){s.stop||s.isDraggingScrollbar||requestAnimationFrame(function(){s.updateDelta(r),s.isScrolling||s.startScrolling()})}),this.setScrollLimit(),this.initScrollBar(),this.addSections(),this.addElements(),this.checkScroll(!0),this.transformElements(!0,!0),R(D(t.prototype),"init",this).call(this)}},{key:"setScrollLimit",value:function(){if(this.instance.limit.y=this.el.offsetHeight-this.windowHeight,this.direction==="horizontal"){for(var s=0,r=this.el.children,o=0;o<r.length;o++)s+=r[o].offsetWidth;this.instance.limit.x=s-this.windowWidth}}},{key:"startScrolling",value:function(){this.startScrollTs=Date.now(),this.isScrolling=!0,this.checkScroll(),this.html.classList.add(this.scrollingClass)}},{key:"stopScrolling",value:function(){cancelAnimationFrame(this.checkScrollRaf),this.startScrollTs=void 0,this.scrollToRaf&&(cancelAnimationFrame(this.scrollToRaf),this.scrollToRaf=null),this.isScrolling=!1,this.instance.scroll.y=Math.round(this.instance.scroll.y),this.html.classList.remove(this.scrollingClass)}},{key:"checkKey",value:function(s){var r=this;if(this.stop){s.keyCode==P.TAB&&requestAnimationFrame(function(){r.html.scrollTop=0,document.body.scrollTop=0,r.html.scrollLeft=0,document.body.scrollLeft=0});return}switch(s.keyCode){case P.TAB:requestAnimationFrame(function(){r.html.scrollTop=0,document.body.scrollTop=0,r.html.scrollLeft=0,document.body.scrollLeft=0,r.scrollTo(document.activeElement,{offset:-window.innerHeight/2})});break;case P.UP:this.isActiveElementScrollSensitive()&&(this.instance.delta[this.directionAxis]-=240);break;case P.DOWN:this.isActiveElementScrollSensitive()&&(this.instance.delta[this.directionAxis]+=240);break;case P.PAGEUP:this.instance.delta[this.directionAxis]-=window.innerHeight;break;case P.PAGEDOWN:this.instance.delta[this.directionAxis]+=window.innerHeight;break;case P.HOME:this.instance.delta[this.directionAxis]-=this.instance.limit[this.directionAxis];break;case P.END:this.instance.delta[this.directionAxis]+=this.instance.limit[this.directionAxis];break;case P.SPACE:this.isActiveElementScrollSensitive()&&(s.shiftKey?this.instance.delta[this.directionAxis]-=window.innerHeight:this.instance.delta[this.directionAxis]+=window.innerHeight);break;default:return}this.instance.delta[this.directionAxis]<0&&(this.instance.delta[this.directionAxis]=0),this.instance.delta[this.directionAxis]>this.instance.limit[this.directionAxis]&&(this.instance.delta[this.directionAxis]=this.instance.limit[this.directionAxis]),this.stopScrolling(),this.isScrolling=!0,this.checkScroll(),this.html.classList.add(this.scrollingClass)}},{key:"isActiveElementScrollSensitive",value:function(){return!(document.activeElement instanceof HTMLInputElement)&&!(document.activeElement instanceof HTMLTextAreaElement)&&!(document.activeElement instanceof HTMLButtonElement)&&!(document.activeElement instanceof HTMLSelectElement)}},{key:"checkScroll",value:function(){var s=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(r||this.isScrolling||this.isDraggingScrollbar){this.hasScrollTicking||(this.checkScrollRaf=requestAnimationFrame(function(){return s.checkScroll()}),this.hasScrollTicking=!0),this.updateScroll();var o=Math.abs(this.instance.delta[this.directionAxis]-this.instance.scroll[this.directionAxis]),a=Date.now()-this.startScrollTs;if(!this.animatingScroll&&a>100&&(o<.5&&this.instance.delta[this.directionAxis]!=0||o<.5&&this.instance.delta[this.directionAxis]==0)&&this.stopScrolling(),Object.entries(this.sections).forEach(function(c){var f=W(c,2),u=f[0],v=f[1];v.persistent||s.instance.scroll[s.directionAxis]>v.offset[s.directionAxis]&&s.instance.scroll[s.directionAxis]<v.limit[s.directionAxis]?(s.direction==="horizontal"?s.transform(v.el,-s.instance.scroll[s.directionAxis],0):s.transform(v.el,0,-s.instance.scroll[s.directionAxis]),v.inView||(v.inView=!0,v.el.style.opacity=1,v.el.style.pointerEvents="all",v.el.setAttribute("data-".concat(s.name,"-section-inview"),""))):((v.inView||r)&&(v.inView=!1,v.el.style.opacity=0,v.el.style.pointerEvents="none",v.el.removeAttribute("data-".concat(s.name,"-section-inview"))),s.transform(v.el,0,0))}),this.getDirection&&this.addDirection(),this.getSpeed&&(this.addSpeed(),this.speedTs=Date.now()),this.detectElements(),this.transformElements(),this.hasScrollbar){var l=this.instance.scroll[this.directionAxis]/this.instance.limit[this.directionAxis]*this.scrollBarLimit[this.directionAxis];this.direction==="horizontal"?this.transform(this.scrollbarThumb,l,0):this.transform(this.scrollbarThumb,0,l)}R(D(t.prototype),"checkScroll",this).call(this),this.hasScrollTicking=!1}}},{key:"resize",value:function(){this.windowHeight=window.innerHeight,this.windowWidth=window.innerWidth,this.checkContext(),this.windowMiddle={x:this.windowWidth/2,y:this.windowHeight/2},this.update()}},{key:"updateDelta",value:function(s){var r,o=this[this.context]&&this[this.context].gestureDirection?this[this.context].gestureDirection:this.gestureDirection;o==="both"?r=s.deltaX+s.deltaY:o==="vertical"?r=s.deltaY:o==="horizontal"?r=s.deltaX:r=s.deltaY,this.instance.delta[this.directionAxis]-=r*this.multiplier,this.instance.delta[this.directionAxis]<0&&(this.instance.delta[this.directionAxis]=0),this.instance.delta[this.directionAxis]>this.instance.limit[this.directionAxis]&&(this.instance.delta[this.directionAxis]=this.instance.limit[this.directionAxis])}},{key:"updateScroll",value:function(s){this.isScrolling||this.isDraggingScrollbar?this.instance.scroll[this.directionAxis]=ht(this.instance.scroll[this.directionAxis],this.instance.delta[this.directionAxis],this.lerp):this.instance.scroll[this.directionAxis]>this.instance.limit[this.directionAxis]?this.setScroll(this.instance.scroll[this.directionAxis],this.instance.limit[this.directionAxis]):this.instance.scroll.y<0?this.setScroll(this.instance.scroll[this.directionAxis],0):this.setScroll(this.instance.scroll[this.directionAxis],this.instance.delta[this.directionAxis])}},{key:"addDirection",value:function(){this.instance.delta.y>this.instance.scroll.y?this.instance.direction!=="down"&&(this.instance.direction="down"):this.instance.delta.y<this.instance.scroll.y&&this.instance.direction!=="up"&&(this.instance.direction="up"),this.instance.delta.x>this.instance.scroll.x?this.instance.direction!=="right"&&(this.instance.direction="right"):this.instance.delta.x<this.instance.scroll.x&&this.instance.direction!=="left"&&(this.instance.direction="left")}},{key:"addSpeed",value:function(){this.instance.delta[this.directionAxis]!=this.instance.scroll[this.directionAxis]?this.instance.speed=(this.instance.delta[this.directionAxis]-this.instance.scroll[this.directionAxis])/Math.max(1,Date.now()-this.speedTs):this.instance.speed=0}},{key:"initScrollBar",value:function(){if(this.scrollbar=document.createElement("span"),this.scrollbarThumb=document.createElement("span"),this.scrollbar.classList.add("".concat(this.scrollbarClass)),this.scrollbarThumb.classList.add("".concat(this.scrollbarClass,"_thumb")),this.scrollbar.append(this.scrollbarThumb),this.scrollbarContainer?this.scrollbarContainer.append(this.scrollbar):document.body.append(this.scrollbar),this.getScrollBar=this.getScrollBar.bind(this),this.releaseScrollBar=this.releaseScrollBar.bind(this),this.moveScrollBar=this.moveScrollBar.bind(this),this.scrollbarThumb.addEventListener("mousedown",this.getScrollBar),window.addEventListener("mouseup",this.releaseScrollBar),window.addEventListener("mousemove",this.moveScrollBar),this.hasScrollbar=!1,this.direction=="horizontal"){if(this.instance.limit.x+this.windowWidth<=this.windowWidth)return}else if(this.instance.limit.y+this.windowHeight<=this.windowHeight)return;this.hasScrollbar=!0,this.scrollbarBCR=this.scrollbar.getBoundingClientRect(),this.scrollbarHeight=this.scrollbarBCR.height,this.scrollbarWidth=this.scrollbarBCR.width,this.direction==="horizontal"?this.scrollbarThumb.style.width="".concat(this.scrollbarWidth*this.scrollbarWidth/(this.instance.limit.x+this.scrollbarWidth),"px"):this.scrollbarThumb.style.height="".concat(this.scrollbarHeight*this.scrollbarHeight/(this.instance.limit.y+this.scrollbarHeight),"px"),this.scrollbarThumbBCR=this.scrollbarThumb.getBoundingClientRect(),this.scrollBarLimit={x:this.scrollbarWidth-this.scrollbarThumbBCR.width,y:this.scrollbarHeight-this.scrollbarThumbBCR.height}}},{key:"reinitScrollBar",value:function(){if(this.hasScrollbar=!1,this.direction=="horizontal"){if(this.instance.limit.x+this.windowWidth<=this.windowWidth)return}else if(this.instance.limit.y+this.windowHeight<=this.windowHeight)return;this.hasScrollbar=!0,this.scrollbarBCR=this.scrollbar.getBoundingClientRect(),this.scrollbarHeight=this.scrollbarBCR.height,this.scrollbarWidth=this.scrollbarBCR.width,this.direction==="horizontal"?this.scrollbarThumb.style.width="".concat(this.scrollbarWidth*this.scrollbarWidth/(this.instance.limit.x+this.scrollbarWidth),"px"):this.scrollbarThumb.style.height="".concat(this.scrollbarHeight*this.scrollbarHeight/(this.instance.limit.y+this.scrollbarHeight),"px"),this.scrollbarThumbBCR=this.scrollbarThumb.getBoundingClientRect(),this.scrollBarLimit={x:this.scrollbarWidth-this.scrollbarThumbBCR.width,y:this.scrollbarHeight-this.scrollbarThumbBCR.height}}},{key:"destroyScrollBar",value:function(){this.scrollbarThumb.removeEventListener("mousedown",this.getScrollBar),window.removeEventListener("mouseup",this.releaseScrollBar),window.removeEventListener("mousemove",this.moveScrollBar),this.scrollbar.remove()}},{key:"getScrollBar",value:function(s){this.isDraggingScrollbar=!0,this.checkScroll(),this.html.classList.remove(this.scrollingClass),this.html.classList.add(this.draggingClass)}},{key:"releaseScrollBar",value:function(s){this.isDraggingScrollbar=!1,this.isScrolling&&this.html.classList.add(this.scrollingClass),this.html.classList.remove(this.draggingClass)}},{key:"moveScrollBar",value:function(s){var r=this;this.isDraggingScrollbar&&requestAnimationFrame(function(){var o=(s.clientX-r.scrollbarBCR.left)*100/r.scrollbarWidth*r.instance.limit.x/100,a=(s.clientY-r.scrollbarBCR.top)*100/r.scrollbarHeight*r.instance.limit.y/100;a>0&&a<r.instance.limit.y&&(r.instance.delta.y=a),o>0&&o<r.instance.limit.x&&(r.instance.delta.x=o)})}},{key:"addElements",value:function(){var s=this;this.els={},this.parallaxElements={};var r=this.el.querySelectorAll("[data-".concat(this.name,"]"));r.forEach(function(o,a){var l=ut(o),c=Object.entries(s.sections).map(function(ot){var bt=W(ot,2),Pi=bt[0],fe=bt[1];return fe}).find(function(ot){return l.includes(ot.el)}),f=o.dataset[s.name+"Class"]||s.class,u=typeof o.dataset[s.name+"Id"]=="string"?o.dataset[s.name+"Id"]:"el"+a,v,h,p=o.dataset[s.name+"Repeat"],C=o.dataset[s.name+"Call"],L=o.dataset[s.name+"Position"],T=o.dataset[s.name+"Delay"],k=o.dataset[s.name+"Direction"],w=typeof o.dataset[s.name+"Sticky"]=="string",d=o.dataset[s.name+"Speed"]?parseFloat(o.dataset[s.name+"Speed"])/10:!1,m=typeof o.dataset[s.name+"Offset"]=="string"?o.dataset[s.name+"Offset"].split(","):s.offset,b=o.dataset[s.name+"Target"],y;b!==void 0?y=document.querySelector("".concat(b)):y=o;var A=y.getBoundingClientRect();c===null||c.inView?(v=A.top+s.instance.scroll.y-O(y).y,h=A.left+s.instance.scroll.x-O(y).x):(v=A.top-O(c.el).y-O(y).y,h=A.left-O(c.el).x-O(y).x);var g=v+y.offsetHeight,S=h+y.offsetWidth,B={x:(S-h)/2+h,y:(g-v)/2+v};if(w){var rt=o.getBoundingClientRect(),U=rt.top,pt=rt.left,yt={x:pt-h,y:U-v};v+=window.innerHeight,h+=window.innerWidth,g=U+y.offsetHeight-o.offsetHeight-yt[s.directionAxis],S=pt+y.offsetWidth-o.offsetWidth-yt[s.directionAxis],B={x:(S-h)/2+h,y:(g-v)/2+v}}p=="false"?p=!1:p!=null?p=!0:p=s.repeat;var M=[0,0];if(m)if(s.direction==="horizontal"){for(var E=0;E<m.length;E++)typeof m[E]=="string"?m[E].includes("%")?M[E]=parseInt(m[E].replace("%","")*s.windowWidth/100):M[E]=parseInt(m[E]):M[E]=m[E];h=h+M[0],S=S-M[1]}else{for(var E=0;E<m.length;E++)typeof m[E]=="string"?m[E].includes("%")?M[E]=parseInt(m[E].replace("%","")*s.windowHeight/100):M[E]=parseInt(m[E]):M[E]=m[E];v=v+M[0],g=g-M[1]}var gt={el:o,id:u,class:f,section:c,top:v,middle:B,bottom:g,left:h,right:S,offset:m,progress:0,repeat:p,inView:!1,call:C,speed:d,delay:T,position:L,target:y,direction:k,sticky:w};s.els[u]=gt,o.classList.contains(f)&&s.setInView(s.els[u],u),(d!==!1||w)&&(s.parallaxElements[u]=gt)})}},{key:"addSections",value:function(){var s=this;this.sections={};var r=this.el.querySelectorAll("[data-".concat(this.name,"-section]"));r.length===0&&(r=[this.el]),r.forEach(function(o,a){var l=typeof o.dataset[s.name+"Id"]=="string"?o.dataset[s.name+"Id"]:"section"+a,c=o.getBoundingClientRect(),f={x:c.left-window.innerWidth*1.5-O(o).x,y:c.top-window.innerHeight*1.5-O(o).y},u={x:f.x+c.width+window.innerWidth*2,y:f.y+c.height+window.innerHeight*2},v=typeof o.dataset[s.name+"Persistent"]=="string";o.setAttribute("data-scroll-section-id",l);var h={el:o,offset:f,limit:u,inView:!1,persistent:v,id:l};s.sections[l]=h})}},{key:"transform",value:function(s,r,o,a){var l;if(!a)l="matrix3d(1,0,0.00,0,0.00,1,0.00,0,0,0,1,0,".concat(r,",").concat(o,",0,1)");else{var c=O(s),f=ht(c.x,r,a),u=ht(c.y,o,a);l="matrix3d(1,0,0.00,0,0.00,1,0.00,0,0,0,1,0,".concat(f,",").concat(u,",0,1)")}s.style.webkitTransform=l,s.style.msTransform=l,s.style.transform=l}},{key:"transformElements",value:function(s){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.instance.scroll.x+this.windowWidth,l=this.instance.scroll.y+this.windowHeight,c={x:this.instance.scroll.x+this.windowMiddle.x,y:this.instance.scroll.y+this.windowMiddle.y};Object.entries(this.parallaxElements).forEach(function(f){var u=W(f,2),v=u[0],h=u[1],p=!1;if(s&&(p=0),h.inView||o)switch(h.position){case"top":p=r.instance.scroll[r.directionAxis]*-h.speed;break;case"elementTop":p=(l-h.top)*-h.speed;break;case"bottom":p=(r.instance.limit[r.directionAxis]-l+r.windowHeight)*h.speed;break;case"left":p=r.instance.scroll[r.directionAxis]*-h.speed;break;case"elementLeft":p=(a-h.left)*-h.speed;break;case"right":p=(r.instance.limit[r.directionAxis]-a+r.windowHeight)*h.speed;break;default:p=(c[r.directionAxis]-h.middle[r.directionAxis])*-h.speed;break}h.sticky&&(h.inView?r.direction==="horizontal"?p=r.instance.scroll.x-h.left+window.innerWidth:p=r.instance.scroll.y-h.top+window.innerHeight:r.direction==="horizontal"?r.instance.scroll.x<h.left-window.innerWidth&&r.instance.scroll.x<h.left-window.innerWidth/2?p=0:r.instance.scroll.x>h.right&&r.instance.scroll.x>h.right+100?p=h.right-h.left+window.innerWidth:p=!1:r.instance.scroll.y<h.top-window.innerHeight&&r.instance.scroll.y<h.top-window.innerHeight/2?p=0:r.instance.scroll.y>h.bottom&&r.instance.scroll.y>h.bottom+100?p=h.bottom-h.top+window.innerHeight:p=!1),p!==!1&&(h.direction==="horizontal"||r.direction==="horizontal"&&h.direction!=="vertical"?r.transform(h.el,p,0,s?!1:h.delay):r.transform(h.el,0,p,s?!1:h.delay))})}},{key:"scrollTo",value:function(s){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=parseInt(o.offset)||0,l=isNaN(parseInt(o.duration))?1e3:parseInt(o.duration),c=o.easing||[.25,0,.35,1],f=!!o.disableLerp,u=o.callback?o.callback:!1;if(c=Ti.apply(void 0,Ge(c)),typeof s=="string"){if(s==="top")s=0;else if(s==="bottom")s=this.instance.limit.y;else if(s==="left")s=0;else if(s==="right")s=this.instance.limit.x;else if(s=document.querySelector(s),!s)return}else if(typeof s=="number")s=parseInt(s);else if(!(s&&s.tagName)){console.warn("`target` parameter is not valid");return}if(typeof s!="number"){var v=ut(s).includes(this.el);if(!v)return;var h=s.getBoundingClientRect(),p=h.top,C=h.left,L=ut(s),T=L.find(function(g){return Object.entries(r.sections).map(function(S){var B=W(S,2),rt=B[0],U=B[1];return U}).find(function(S){return S.el==g})}),k=0;T?k=O(T)[this.directionAxis]:k=-this.instance.scroll[this.directionAxis],this.direction==="horizontal"?a=C+a-k:a=p+a-k}else a=s+a;var w=parseFloat(this.instance.delta[this.directionAxis]),d=Math.max(0,Math.min(a,this.instance.limit[this.directionAxis])),m=d-w,b=function(S){f?r.direction==="horizontal"?r.setScroll(w+m*S,r.instance.delta.y):r.setScroll(r.instance.delta.x,w+m*S):r.instance.delta[r.directionAxis]=w+m*S};this.animatingScroll=!0,this.stopScrolling(),this.startScrolling();var y=Date.now(),A=function g(){var S=(Date.now()-y)/l;S>1?(b(1),r.animatingScroll=!1,l==0&&r.update(),u&&u()):(r.scrollToRaf=requestAnimationFrame(g),b(c(S)))};A()}},{key:"update",value:function(){this.setScrollLimit(),this.addSections(),this.addElements(),this.detectElements(),this.updateScroll(),this.transformElements(!0),this.reinitScrollBar(),this.checkScroll(!0)}},{key:"startScroll",value:function(){this.stop=!1}},{key:"stopScroll",value:function(){this.stop=!0}},{key:"setScroll",value:function(s,r){this.instance=ct(ct({},this.instance),{},{scroll:{x:s,y:r},delta:{x:s,y:r},speed:0})}},{key:"destroy",value:function(){R(D(t.prototype),"destroy",this).call(this),this.stopScrolling(),this.html.classList.remove(this.smoothClass),this.vs.destroy(),this.destroyScrollBar(),window.removeEventListener("keydown",this.checkKey,!1)}}]),t}(Kt),_i=function(){function i(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};tt(this,i),this.options=n,Object.assign(this,z,n),this.smartphone=z.smartphone,n.smartphone&&Object.assign(this.smartphone,n.smartphone),this.tablet=z.tablet,n.tablet&&Object.assign(this.tablet,n.tablet),!this.smooth&&this.direction=="horizontal"&&console.warn("\u{1F6A8} `smooth:false` & `horizontal` direction are not yet compatible"),!this.tablet.smooth&&this.tablet.direction=="horizontal"&&console.warn("\u{1F6A8} `smooth:false` & `horizontal` direction are not yet compatible (tablet)"),!this.smartphone.smooth&&this.smartphone.direction=="horizontal"&&console.warn("\u{1F6A8} `smooth:false` & `horizontal` direction are not yet compatible (smartphone)"),this.init()}return et(i,[{key:"init",value:function(){if(this.options.isMobile=/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1||window.innerWidth<this.tablet.breakpoint,this.options.isTablet=this.options.isMobile&&window.innerWidth>=this.tablet.breakpoint,this.smooth&&!this.options.isMobile||this.tablet.smooth&&this.options.isTablet||this.smartphone.smooth&&this.options.isMobile&&!this.options.isTablet?this.scroll=new Ci(this.options):this.scroll=new ni(this.options),this.scroll.init(),window.location.hash){var t=window.location.hash.slice(1,window.location.hash.length),e=document.getElementById(t);e&&this.scroll.scrollTo(e)}}},{key:"update",value:function(){this.scroll.update()}},{key:"start",value:function(){this.scroll.startScroll()}},{key:"stop",value:function(){this.scroll.stopScroll()}},{key:"scrollTo",value:function(t,e){this.scroll.scrollTo(t,e)}},{key:"setScroll",value:function(t,e){this.scroll.setScroll(t,e)}},{key:"on",value:function(t,e){this.scroll.setEvents(t,e)}},{key:"off",value:function(t,e){this.scroll.unsetEvents(t,e)}},{key:"destroy",value:function(){this.scroll.destroy()}}]),i}();var ie=_i;var it=class extends H{constructor(i){super(i)}init(){this.scroll=new ie({el:this.el,smooth:!0}),this.scroll.on("call",(i,n,t,e)=>{this.call(i[0],{way:n,obj:t},i[1],i[2])}),this.scroll.on("scroll",i=>{})}lazyLoad(i){zt(i.obj.el,null,()=>{})}destroy(){this.scroll.destroy()}};var le=Se(se(),1);var mt="production",V=config=Object.freeze({ENV:mt,IS_PROD:mt==="production",IS_DEV:mt==="development",CSS_CLASS:{LOADING:"is-loading",READY:"is-ready",LOADED:"is-loaded"}});var st;I(void 0,null,function*(){if(V.IS_DEV){let i=yield Promise.resolve().then(()=>(ae(),oe));st=i==null?void 0:i.gridHelper}});function ce(){(0,le.default)(),st==null||st()}var N=document.documentElement,fn=document.body,dn=N.hasAttribute("data-debug");var he=new Lt({modules:vt});window.onload=i=>{let n=document.getElementById("main-css");n?n.isLoaded?ue():n.addEventListener("load",t=>{ue()}):console.warn('The "main-css" stylesheet not found')};var lt=[{family:"Source Sans",style:"normal",weight:400},{family:"Source Sans",style:"normal",weight:700}];function ue(){ce(),he.init(he),N.classList.add("is-loaded"),N.classList.add("is-ready"),N.classList.remove("is-loading"),Mt&&Pt(lt,V.IS_DEV).then(i=>{N.classList.add("fonts-loaded"),V.IS_DEV&&(console.group("Eager fonts loaded!",i.length,"/",document.fonts.size),console.group("State of eager fonts:"),i.forEach(n=>console.log(n.family,n.style,n.weight,n.status)),console.groupEnd(),console.group("State of all fonts:"),document.fonts.forEach(n=>console.log(n.family,n.style,n.weight,n.status)),console.groupEnd())})}})();
|
|
/*! Bundled license information:
|
|
|
|
svg4everybody/dist/svg4everybody.js:
|
|
(*! svg4everybody v2.1.9 | github.com/jonathantneal/svg4everybody *)
|
|
|
|
locomotive-scroll/dist/locomotive-scroll.esm.js:
|
|
(*
|
|
object-assign
|
|
(c) Sindre Sorhus
|
|
@license MIT
|
|
*)
|
|
*/
|
|
//# sourceMappingURL=app.js.map
|