vevet 2.0.1-dev.9 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cdn/index.js +1 -1
- package/build/cjs/app/Application.js +8 -8
- package/build/cjs/app/events/PageLoad.js +3 -3
- package/build/cjs/app/events/Viewport.js +5 -5
- package/build/cjs/base/Callbacks.js +3 -3
- package/build/cjs/base/Module.js +16 -7
- package/build/cjs/base/MutableProp.js +10 -10
- package/build/cjs/components/animation-frame/AnimationFrame.js +1 -1
- package/build/cjs/components/canvas/Ctx2D.js +7 -3
- package/build/cjs/components/canvas/Ctx2DPrerender.js +17 -3
- package/build/cjs/components/cursor/CustomCursor.js +12 -12
- package/build/cjs/components/dragger/Dragger.js +8 -8
- package/build/cjs/components/dragger/DraggerMove.js +2 -2
- package/build/cjs/components/loading/Preloader.js +5 -5
- package/build/cjs/components/loading/ProgressPreloader.js +17 -5
- package/build/cjs/components/page/Page.js +37 -9
- package/build/cjs/components/scroll/plugins/SmoothScrollKeyboardPlugin.js +2 -2
- package/build/cjs/components/scroll/scrollable/ScrollEventsBase.js +1 -1
- package/build/cjs/components/scroll/scrollable/ScrollView.js +133 -73
- package/build/cjs/components/scroll/scrollbar/Bar.js +18 -15
- package/build/cjs/components/scroll/scrollbar/ScrollBar.js +9 -7
- package/build/cjs/components/scroll/smooth-scroll/SmoothScroll.js +26 -22
- package/build/cjs/components/text/SplitText.js +34 -12
- package/build/cjs/components/timeline/StaticTimeline.js +4 -4
- package/build/cjs/components/timeline/Timeline.js +2 -2
- package/build/cjs/handlers/wheel/WheelHandler.js +4 -4
- package/build/cjs/utils/common/mergeWithoutArrays.js +1 -1
- package/build/cjs/utils/common/randID.js +2 -2
- package/build/cjs/utils/listeners/onScroll.js +66 -28
- package/build/cjs/utils/math/{boundVal.js → clamp.js} +3 -3
- package/build/cjs/utils/math/clampScope.js +16 -0
- package/build/cjs/utils/math/inScope.js +10 -0
- package/build/cjs/utils/math/index.js +13 -7
- package/build/cjs/utils/math/scoped.js +18 -0
- package/build/cjs/utils/math/{spreadScopeProgress.js → spreadScope.js} +2 -2
- package/build/cjs/utils/math/wrap.js +13 -0
- package/build/es/base/Module.js +2 -4
- package/build/es/components/animation-frame/AnimationFrame.js +2 -2
- package/build/es/components/canvas/Ctx2D.js +6 -2
- package/build/es/components/canvas/Ctx2DPrerender.js +16 -2
- package/build/es/components/loading/ProgressPreloader.js +14 -2
- package/build/es/components/page/Page.js +32 -8
- package/build/es/components/scroll/scrollable/ScrollView.js +112 -62
- package/build/es/components/scroll/scrollbar/Bar.js +9 -6
- package/build/es/components/scroll/scrollbar/ScrollBar.js +3 -1
- package/build/es/components/scroll/smooth-scroll/SmoothScroll.js +13 -9
- package/build/es/components/text/SplitText.js +25 -3
- package/build/es/components/timeline/StaticTimeline.js +3 -3
- package/build/es/components/timeline/Timeline.js +2 -2
- package/build/es/utils/listeners/onScroll.js +65 -28
- package/build/es/utils/math/{boundVal.js → clamp.js} +2 -2
- package/build/es/utils/math/clampScope.js +8 -0
- package/build/es/utils/math/inScope.js +6 -0
- package/build/es/utils/math/index.js +7 -4
- package/build/es/utils/math/scoped.js +14 -0
- package/build/es/utils/math/{spreadScopeProgress.js → spreadScope.js} +1 -1
- package/build/es/utils/math/wrap.js +10 -0
- package/build/types/base/Module.d.ts.map +1 -1
- package/build/types/components/canvas/Ctx2D.d.ts +9 -0
- package/build/types/components/canvas/Ctx2D.d.ts.map +1 -1
- package/build/types/components/canvas/Ctx2DPrerender.d.ts +1 -1
- package/build/types/components/canvas/Ctx2DPrerender.d.ts.map +1 -1
- package/build/types/components/loading/ProgressPreloader.d.ts +7 -0
- package/build/types/components/loading/ProgressPreloader.d.ts.map +1 -1
- package/build/types/components/page/Page.d.ts +2 -0
- package/build/types/components/page/Page.d.ts.map +1 -1
- package/build/types/components/scroll/scrollable/ScrollView.d.ts +40 -14
- package/build/types/components/scroll/scrollable/ScrollView.d.ts.map +1 -1
- package/build/types/components/scroll/scrollbar/Bar.d.ts.map +1 -1
- package/build/types/components/scroll/scrollbar/ScrollBar.d.ts +4 -0
- package/build/types/components/scroll/scrollbar/ScrollBar.d.ts.map +1 -1
- package/build/types/components/scroll/smooth-scroll/SmoothScroll.d.ts +4 -0
- package/build/types/components/scroll/smooth-scroll/SmoothScroll.d.ts.map +1 -1
- package/build/types/components/text/SplitText.d.ts +10 -0
- package/build/types/components/text/SplitText.d.ts.map +1 -1
- package/build/types/utils/listeners/onScroll.d.ts +10 -6
- package/build/types/utils/listeners/onScroll.d.ts.map +1 -1
- package/build/types/utils/math/clamp.d.ts +5 -0
- package/build/types/utils/math/clamp.d.ts.map +1 -0
- package/build/types/utils/math/clampScope.d.ts +5 -0
- package/build/types/utils/math/clampScope.d.ts.map +1 -0
- package/build/types/utils/math/inScope.d.ts +5 -0
- package/build/types/utils/math/inScope.d.ts.map +1 -0
- package/build/types/utils/math/index.d.ts +7 -4
- package/build/types/utils/math/index.d.ts.map +1 -1
- package/build/types/utils/math/scoped.d.ts +12 -0
- package/build/types/utils/math/scoped.d.ts.map +1 -0
- package/build/types/utils/math/spreadScope.d.ts +5 -0
- package/build/types/utils/math/spreadScope.d.ts.map +1 -0
- package/build/types/utils/math/wrap.d.ts +5 -0
- package/build/types/utils/math/wrap.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/ts/base/Module.ts +5 -4
- package/src/ts/components/animation-frame/AnimationFrame.ts +2 -2
- package/src/ts/components/canvas/Ctx2D.ts +16 -1
- package/src/ts/components/canvas/Ctx2DPrerender.ts +19 -6
- package/src/ts/components/loading/ProgressPreloader.ts +21 -2
- package/src/ts/components/page/Page.ts +34 -8
- package/src/ts/components/scroll/scrollable/ScrollView.ts +155 -86
- package/src/ts/components/scroll/scrollbar/Bar.ts +9 -6
- package/src/ts/components/scroll/scrollbar/ScrollBar.ts +7 -0
- package/src/ts/components/scroll/smooth-scroll/SmoothScroll.ts +17 -8
- package/src/ts/components/text/SplitText.ts +38 -2
- package/src/ts/components/timeline/StaticTimeline.ts +4 -4
- package/src/ts/components/timeline/Timeline.ts +2 -2
- package/src/ts/utils/listeners/onScroll.ts +101 -38
- package/src/ts/utils/math/{boundVal.ts → clamp.ts} +3 -3
- package/src/ts/utils/math/clampScope.ts +16 -0
- package/src/ts/utils/math/inScope.ts +9 -0
- package/src/ts/utils/math/index.ts +12 -6
- package/src/ts/utils/math/scoped.ts +17 -0
- package/src/ts/utils/math/{spreadScopeProgress.ts → spreadScope.ts} +2 -2
- package/src/ts/utils/math/wrap.ts +18 -0
- package/build/cjs/components/scroll/custom-scroll/CustomScroll.js +0 -517
- package/build/cjs/components/split-text/SplitText.js +0 -233
- package/build/cjs/utils/math/scopeProgress.js +0 -25
- package/build/es/components/scroll/custom-scroll/CustomScroll.js +0 -486
- package/build/es/components/split-text/SplitText.js +0 -199
- package/build/es/utils/math/scopeProgress.js +0 -22
- package/build/types/components/scroll/custom-scroll/CustomScroll.d.ts +0 -322
- package/build/types/components/scroll/custom-scroll/CustomScroll.d.ts.map +0 -1
- package/build/types/components/split-text/SplitText.d.ts +0 -118
- package/build/types/components/split-text/SplitText.d.ts.map +0 -1
- package/build/types/utils/math/boundVal.d.ts +0 -5
- package/build/types/utils/math/boundVal.d.ts.map +0 -1
- package/build/types/utils/math/scopeProgress.d.ts +0 -20
- package/build/types/utils/math/scopeProgress.d.ts.map +0 -1
- package/build/types/utils/math/spreadScopeProgress.d.ts +0 -5
- package/build/types/utils/math/spreadScopeProgress.d.ts.map +0 -1
- package/src/ts/utils/math/scopeProgress.ts +0 -23
package/build/cdn/index.js
CHANGED
|
@@ -9,4 +9,4 @@ GitHub Repository: https://github.com/antonbobrov/vevet
|
|
|
9
9
|
|
|
10
10
|
Powered by Anton Bobrov | https://github.com/antonbobrov
|
|
11
11
|
*/
|
|
12
|
-
(()=>{var t={554:(t,e,n)=>{t=n.nmd(t);var r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",s="[object Function]",a="[object Object]",c=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[i]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l[s]=l["[object Map]"]=l["[object Number]"]=l[a]=l["[object RegExp]"]=l["[object Set]"]=l["[object String]"]=l["[object WeakMap]"]=!1;var f="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,h="object"==typeof self&&self&&self.Object===Object&&self,p=f||h||Function("return this")(),d=e&&!e.nodeType&&e,y=d&&t&&!t.nodeType&&t,v=y&&y.exports===d,_=v&&f.process,b=function(){try{var t=y&&y.require&&y.require("util").types;return t||_&&_.binding&&_.binding("util")}catch(e){}}(),g=b&&b.isTypedArray;function m(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var w,O,P,k=Array.prototype,j=Function.prototype,E=Object.prototype,S=p["__core-js_shared__"],x=j.toString,T=E.hasOwnProperty,R=(w=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",L=E.toString,C=x.call(Object),D=RegExp("^"+x.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=v?p.Buffer:void 0,W=p.Symbol,B=p.Uint8Array,I=M?M.allocUnsafe:void 0,F=(O=Object.getPrototypeOf,P=Object,function(t){return O(P(t))}),A=Object.create,H=E.propertyIsEnumerable,z=k.splice,N=W?W.toStringTag:void 0,V=function(){try{var t=dt(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),X=M?M.isBuffer:void 0,Q=Math.max,U=Date.now,Y=dt(p,"Map"),$=dt(Object,"create"),q=function(){function t(){}return function(e){if(!Et(e))return{};if(A)return A(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function K(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function J(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function G(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Z(t){var e=this.__data__=new J(t);this.size=e.size}function tt(t,e){var n=wt(t),r=!n&&mt(t),o=!n&&!r&&Pt(t),i=!n&&!r&&!o&&xt(t),s=n||r||o||i,a=s?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],c=a.length;for(var u in t)!e&&!T.call(t,u)||s&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||yt(u,c))||a.push(u);return a}function et(t,e,n){(void 0!==n&&!gt(t[e],n)||void 0===n&&!(e in t))&&ot(t,e,n)}function nt(t,e,n){var r=t[e];T.call(t,e)&>(r,n)&&(void 0!==n||e in t)||ot(t,e,n)}function rt(t,e){for(var n=t.length;n--;)if(gt(t[n][0],e))return n;return-1}function ot(t,e,n){"__proto__"==e&&V?V(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}K.prototype.clear=function(){this.__data__=$?$(null):{},this.size=0},K.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},K.prototype.get=function(t){var e=this.__data__;if($){var n=e[t];return n===r?void 0:n}return T.call(e,t)?e[t]:void 0},K.prototype.has=function(t){var e=this.__data__;return $?void 0!==e[t]:T.call(e,t)},K.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=$&&void 0===e?r:e,this},J.prototype.clear=function(){this.__data__=[],this.size=0},J.prototype.delete=function(t){var e=this.__data__,n=rt(e,t);return!(n<0)&&(n==e.length-1?e.pop():z.call(e,n,1),--this.size,!0)},J.prototype.get=function(t){var e=this.__data__,n=rt(e,t);return n<0?void 0:e[n][1]},J.prototype.has=function(t){return rt(this.__data__,t)>-1},J.prototype.set=function(t,e){var n=this.__data__,r=rt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},G.prototype.clear=function(){this.size=0,this.__data__={hash:new K,map:new(Y||J),string:new K}},G.prototype.delete=function(t){var e=pt(this,t).delete(t);return this.size-=e?1:0,e},G.prototype.get=function(t){return pt(this,t).get(t)},G.prototype.has=function(t){return pt(this,t).has(t)},G.prototype.set=function(t,e){var n=pt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Z.prototype.clear=function(){this.__data__=new J,this.size=0},Z.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Z.prototype.get=function(t){return this.__data__.get(t)},Z.prototype.has=function(t){return this.__data__.has(t)},Z.prototype.set=function(t,e){var n=this.__data__;if(n instanceof J){var r=n.__data__;if(!Y||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new G(r)}return n.set(t,e),this.size=n.size,this};var it,st=function(t,e,n){for(var r=-1,o=Object(t),i=n(t),s=i.length;s--;){var a=i[it?s:++r];if(!1===e(o[a],a,o))break}return t};function at(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":N&&N in Object(t)?function(t){var e=T.call(t,N),n=t[N];try{t[N]=void 0;var r=!0}catch(i){}var o=L.call(t);r&&(e?t[N]=n:delete t[N]);return o}(t):function(t){return L.call(t)}(t)}function ct(t){return St(t)&&at(t)==i}function ut(t){return!(!Et(t)||function(t){return!!R&&R in t}(t))&&(kt(t)?D:c).test(function(t){if(null!=t){try{return x.call(t)}catch(e){}try{return t+""}catch(e){}}return""}(t))}function lt(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=vt(t),n=[];for(var r in t)("constructor"!=r||!e&&T.call(t,r))&&n.push(r);return n}function ft(t,e,n,r,o){t!==e&&st(e,(function(i,s){if(o||(o=new Z),Et(i))!function(t,e,n,r,o,i,s){var c=_t(t,n),u=_t(e,n),l=s.get(u);if(l)return void et(t,n,l);var f=i?i(c,u,n+"",t,e,s):void 0,h=void 0===f;if(h){var p=wt(u),d=!p&&Pt(u),y=!p&&!d&&xt(u);f=u,p||d||y?wt(c)?f=c:St(m=c)&&Ot(m)?f=function(t,e){var n=-1,r=t.length;e||(e=Array(r));for(;++n<r;)e[n]=t[n];return e}(c):d?(h=!1,f=function(t,e){if(e)return t.slice();var n=t.length,r=I?I(n):new t.constructor(n);return t.copy(r),r}(u,!0)):y?(h=!1,v=u,_=!0?(b=v.buffer,g=new b.constructor(b.byteLength),new B(g).set(new B(b)),g):v.buffer,f=new v.constructor(_,v.byteOffset,v.length)):f=[]:function(t){if(!St(t)||at(t)!=a)return!1;var e=F(t);if(null===e)return!0;var n=T.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&x.call(n)==C}(u)||mt(u)?(f=c,mt(c)?f=function(t){return function(t,e,n,r){var o=!n;n||(n={});var i=-1,s=e.length;for(;++i<s;){var a=e[i],c=r?r(n[a],t[a],a,n,t):void 0;void 0===c&&(c=t[a]),o?ot(n,a,c):nt(n,a,c)}return n}(t,Tt(t))}(c):Et(c)&&!kt(c)||(f=function(t){return"function"!=typeof t.constructor||vt(t)?{}:q(F(t))}(u))):h=!1}var v,_,b,g;var m;h&&(s.set(u,f),o(f,u,r,i,s),s.delete(u));et(t,n,f)}(t,e,s,n,ft,r,o);else{var c=r?r(_t(t,s),i,s+"",t,e,o):void 0;void 0===c&&(c=i),et(t,s,c)}}),Tt)}function ht(t,e){return bt(function(t,e,n){return e=Q(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=Q(r.length-e,0),s=Array(i);++o<i;)s[o]=r[e+o];o=-1;for(var a=Array(e+1);++o<e;)a[o]=r[o];return a[e]=n(s),m(t,this,a)}}(t,e,Ct),t+"")}function pt(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function dt(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return ut(n)?n:void 0}function yt(t,e){var n=typeof t;return!!(e=null==e?o:e)&&("number"==n||"symbol"!=n&&u.test(t))&&t>-1&&t%1==0&&t<e}function vt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||E)}function _t(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var bt=function(t){var e=0,n=0;return function(){var r=U(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(V?function(t,e){return V(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:Ct);function gt(t,e){return t===e||t!=t&&e!=e}var mt=ct(function(){return arguments}())?ct:function(t){return St(t)&&T.call(t,"callee")&&!H.call(t,"callee")},wt=Array.isArray;function Ot(t){return null!=t&&jt(t.length)&&!kt(t)}var Pt=X||function(){return!1};function kt(t){if(!Et(t))return!1;var e=at(t);return e==s||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function jt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function St(t){return null!=t&&"object"==typeof t}var xt=g?function(t){return function(e){return t(e)}}(g):function(t){return St(t)&&jt(t.length)&&!!l[at(t)]};function Tt(t){return Ot(t)?tt(t,!0):lt(t)}var Rt,Lt=(Rt=function(t,e,n,r){ft(t,e,n,r)},ht((function(t,e){var n=-1,r=e.length,o=r>1?e[r-1]:void 0,i=r>2?e[2]:void 0;for(o=Rt.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(t,e,n){if(!Et(n))return!1;var r=typeof e;return!!("number"==r?Ot(n)&&yt(e,n.length):"string"==r&&e in n)&>(n[e],t)}(e[0],e[1],i)&&(o=r<3?void 0:o,r=1),t=Object(t);++n<r;){var s=e[n];s&&Rt(t,s,n,o)}return t})));function Ct(t){return t}t.exports=Lt},796:(t,e,n)=>{t.exports=n(643)},264:t=>{"use strict";var e=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:e,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:e&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:e&&!!window.screen,isInWorker:!e};t.exports=n},518:t=>{var e,n,r,o,i,s,a,c,u,l,f,h,p,d,y,v=!1;function _(){if(!v){v=!0;var t=navigator.userAgent,_=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(t),b=/(Mac OS X)|(Windows)|(Linux)/.exec(t);if(h=/\b(iPhone|iP[ao]d)/.exec(t),p=/\b(iP[ao]d)/.exec(t),l=/Android/i.exec(t),d=/FBAN\/\w+;/i.exec(t),y=/Mobile/i.exec(t),f=!!/Win64/.exec(t),_){(e=_[1]?parseFloat(_[1]):_[5]?parseFloat(_[5]):NaN)&&document&&document.documentMode&&(e=document.documentMode);var g=/(?:Trident\/(\d+.\d+))/.exec(t);s=g?parseFloat(g[1])+4:e,n=_[2]?parseFloat(_[2]):NaN,r=_[3]?parseFloat(_[3]):NaN,(o=_[4]?parseFloat(_[4]):NaN)?(_=/(?:Chrome\/(\d+\.\d+))/.exec(t),i=_&&_[1]?parseFloat(_[1]):NaN):i=NaN}else e=n=r=i=o=NaN;if(b){if(b[1]){var m=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(t);a=!m||parseFloat(m[1].replace("_","."))}else a=!1;c=!!b[2],u=!!b[3]}else a=c=u=!1}}var b={ie:function(){return _()||e},ieCompatibilityMode:function(){return _()||s>e},ie64:function(){return b.ie()&&f},firefox:function(){return _()||n},opera:function(){return _()||r},webkit:function(){return _()||o},safari:function(){return b.webkit()},chrome:function(){return _()||i},windows:function(){return _()||c},osx:function(){return _()||a},linux:function(){return _()||u},iphone:function(){return _()||h},mobile:function(){return _()||h||p||l||y},nativeApp:function(){return _()||d},android:function(){return _()||l},ipad:function(){return _()||p}};t.exports=b},534:(t,e,n)=>{"use strict";var r,o=n(264);o.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),t.exports=function(t,e){if(!o.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,i=n in document;if(!i){var s=document.createElement("div");s.setAttribute(n,"return;"),i="function"==typeof s[n]}return!i&&r&&"wheel"===t&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}},643:(t,e,n)=>{"use strict";var r=n(518),o=n(534);function i(t){var e=0,n=0,r=0,o=0;return"detail"in t&&(n=t.detail),"wheelDelta"in t&&(n=-t.wheelDelta/120),"wheelDeltaY"in t&&(n=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=n,n=0),r=10*e,o=10*n,"deltaY"in t&&(o=t.deltaY),"deltaX"in t&&(r=t.deltaX),(r||o)&&t.deltaMode&&(1==t.deltaMode?(r*=40,o*=40):(r*=800,o*=800)),r&&!e&&(e=r<1?-1:1),o&&!n&&(n=o<1?-1:1),{spinX:e,spinY:n,pixelX:r,pixelY:o}}i.getEventType=function(){return r.firefox()?"DOMMouseScroll":o("wheel")?"wheel":"mousewheel"},t.exports=i}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,loaded:!1,exports:{}};return t[r](i,i.exports,n),i.loaded=!0,i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{"use strict";var t={};n.r(t),n.d(t,{mergeWithoutArrays:()=>u,randID:()=>s,timeoutCallback:()=>l});var e={};n.r(e),n.d(e,{boundVal:()=>K,lerp:()=>J,scopeProgress:()=>G,spreadScopeProgress:()=>Z});var r={};n.r(r),n.d(r,{intersectionObserverSupported:()=>St,onScroll:()=>Et});var o={};n.r(o);var i={};function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id",e="".concat(+new Date,"_").concat(Math.round(1e3*Math.random()));return"".concat(t,"_").concat(e)}n.r(i),n.d(i,{AnimationFrame:()=>ht,Application:()=>Re,Callbacks:()=>T,Component:()=>q,Ctx2D:()=>ho,Ctx2DPrerender:()=>So,CustomCursor:()=>us,Dragger:()=>Cr,DraggerDirection:()=>Zr,DraggerMove:()=>zr,GeneralTypes:()=>o,Module:()=>F,MutableProp:()=>D,Page:()=>Ge,PageLoad:()=>ke,Plugin:()=>Ae,Preloader:()=>sr,ProgressPreloader:()=>gr,ScrollBar:()=>Vo,ScrollEventsBase:()=>ni,ScrollView:()=>yi,SmoothScroll:()=>jt,SmoothScrollDragPlugin:()=>Ii,SmoothScrollKeyboardPlugin:()=>ki,SplitText:()=>Ki,StaticTimeline:()=>Mn,Timeline:()=>Yn,Viewport:()=>ve,WheelHandler:()=>pn,utils:()=>ls});var a=n(554),c=n.n(a);function u(t,e){return c()(t,e,(function(t,e){if(Array.isArray(t))return e}))}function l(t,e){0===e?t():setTimeout((function(){t()}),e)}function f(t,e){return h(t,e)}function h(t,e){return t===e||null!==t&&h(t.parentNode,e)}function p(t){return t instanceof HTMLElement||t instanceof Element}function d(t){return t instanceof Window}function y(t,e){if(d(t))return t;if(p(t))return t;if(void 0!==e){const n=y(e);if(n)return n.querySelector(t)}return document.querySelector(t)}function v(t,e){if(t instanceof NodeList)return t;if(p(t))return[t];if(Array.isArray(t))return t;if(void 0!==e){const n=y(e);if(n)return n.querySelectorAll(t)}return document.querySelectorAll(t)}function _(t,e,n){const r=e.split(" ");for(let o=0;o<r.length;o++)void 0===n?t.classList.toggle(r[o]):n?t.classList.add(r[o]):t.classList.remove(r[o])}function b(t,e={}){const n=document.createElement(t);if(e.class&&function(t,e){if(t instanceof Element)_(t,e,!0);else for(let n=0;n<t.length;n++)_(t[n],e,!0)}(n,e.class),e.id&&n.setAttribute("id",e.id),e.attr)for(let r=0,o=e.attr.length;r<o;r++){const t=e.attr[r];n.setAttribute(t[0],t[1])}if(e.parent&&e.parent.appendChild(n),e.html&&(n.innerHTML=e.html),e.children)for(let r=0,o=e.children.length;r<o;r++)n.appendChild(e.children[r]);return n}const g=[];function m(t,e,n,r){if(void 0!==r){const o={passive:!1,once:!1};r.once&&(o.once=!0),r.passive&&(o.passive=!0),t.addEventListener(e,n,o)}else t.addEventListener(e,n);const o=`${Math.random()}-${+new Date}`;return g.push({id:o,el:t,target:e,callback:n}),{id:o,remove:w.bind(this,o)}}function w(t){const e=[];for(let n=0,r=g.length;n<r;n++){const r=g[n];r.id===t?r.el.removeEventListener(r.target,r.callback):e.push(r)}}var O=n(796),P=n.n(O);function k(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function j(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?k(Object(n),!0).forEach((function(e){x(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function E(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function S(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function x(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var T=function(){function t(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];E(this,t),x(this,"_app",void 0),x(this,"_callbacks",void 0),this._app=window.vevetApp,this._callbacks=[],e&&this._init()}var e,n,r;return e=t,(n=[{key:"callbacks",get:function(){return this._callbacks}},{key:"_init",value:function(){this._constructor(),this._setEvents()}},{key:"_constructor",value:function(){}},{key:"_setEvents",value:function(){}},{key:"add",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=s("callback"),o={id:r,on:!0,data:j({target:t,do:e},n)};return this._callbacks.push(o),this._onAdd(r),{id:r,remove:this.remove.bind(this,r)}}},{key:"_onAdd",value:function(t){}},{key:"remove",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=!1,o=this._callbacks.filter((function(o){return o.id!==t||!(!o.data.protected||n)||(e._onRemove(t),r=!0,!1)}));return this._callbacks=o,r}},{key:"_onRemove",value:function(t){}},{key:"removeAll",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._callbacks.length>0;)this.remove(this._callbacks[0].id,t)}},{key:"turn",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.get(t);return!!n&&(n.on=e,this._onTurn(t),!0)}},{key:"_onTurn",value:function(t){}},{key:"get",value:function(t){var e=this._callbacks.filter((function(e){return e.id===t}));return e.length>0&&e[0]}},{key:"_trigger",value:function(t,e){if(t.on){var n=t.data,r=n.timeout,o=n.once,i=t.data.do;r?l(e?this._triggerFunc.bind(this,i,e):this._triggerFunc.bind(this,i,!1),r):e?this._triggerFunc(i,e):this._triggerFunc(i,!1),o&&this.remove(t.id)}}},{key:"_triggerFunc",value:function(t,e){e?t(e):t()}},{key:"tbt",value:function(t,e){var n=this;this._callbacks.forEach((function(r){r.data.target===t&&n._trigger(r,e)}))}},{key:"destroy",value:function(){this.removeAll(!0)}}])&&S(e.prototype,n),r&&S(e,r),t}();function R(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function L(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function C(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var D=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"Responsive Prop";R(this,t),C(this,"_initProp",void 0),C(this,"_onResponsive",void 0),C(this,"_onChange",void 0),C(this,"_name",void 0),C(this,"_app",void 0),C(this,"_refProp",void 0),C(this,"_prop",void 0),C(this,"_responsiveRules",[]),C(this,"_viewportCallback",void 0),this._initProp=e,this._onResponsive=n,this._onChange=r,this._name=o,this._app=window.vevetApp,this._refProp=u({},e),this._prop=u({},e)}var e,n,r;return e=t,(n=[{key:"prop",get:function(){return this._prop}},{key:"addResponsiveProp",value:function(t){this._responsiveRules.push(t),void 0===this._viewportCallback&&(this._viewportCallback=this._app.viewport.add("w",this._responseProp.bind(this,!0),{name:this._name})),this._responseProp()}},{key:"_responseProp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._responsiveRules,n=this._app,r=n.viewport,o=r.width,i=!1,s=u({},this._refProp);e.forEach((function(t){var e=t.settings,a=t.breakpoint;if("number"==typeof a)o<=t.breakpoint&&(i=u(s,e));else if("string"==typeof a){var c=a.toLowerCase();("d"===c&&r.isDesktop||"t"===c&&r.isTablet||"p"===c&&r.isPhone)&&(i=u(s,e)),("phone"===c&&n.isPhone||"tablet"===c&&n.isTablet||"mobile"===c&&n.isMobile)&&(i=u(s,e))}})),this._prop=u(this._prop,i||this._refProp),t&&this._onResponsive()}},{key:"changeProp",value:function(t){this._prop=u(this._prop,t),this._refProp=u(this._refProp,t),this._onChange(t)}},{key:"destroy",value:function(){this._viewportCallback&&this._viewportCallback.remove()}}])&&L(e.prototype,n),r&&L(e,r),t}();function M(){throw new Error('Vevet.Application does not exist yet. \nCall "new Vevet.Application()" before using all the stuff')}function W(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function B(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function I(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var F=function(){function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];W(this,t),I(this,"_mutableProp",void 0),I(this,"_callbacks",void 0),I(this,"_listeners",void 0),I(this,"_app",void 0),I(this,"_inited",!1),I(this,"_destroyed",void 0),I(this,"_viewportCallbacks",[]),window.vevetApp?this._app=window.vevetApp:M(),this._destroyed=!1,this._listeners=[],this._callbacks=new T;var r=u(this._getDefaultProp(),e||{});this._mutableProp=new D(r,this._onPropResponsive.bind(this),this._onPropChange.bind(this),this.name),n&&this.init()}var e,n,r;return e=t,(n=[{key:"_getDefaultProp",value:function(){return{parent:!1}}},{key:"prop",get:function(){return this._mutableProp.prop}},{key:"callbacks",get:function(){return this._callbacks}},{key:"prefix",get:function(){return""}},{key:"name",get:function(){return this.constructor.name}},{key:"inited",get:function(){return this._inited}},{key:"destroyed",get:function(){return this._destroyed}},{key:"addResponsiveProp",value:function(t){if(this._inited)throw new Error("Responsive properties cannot be added because the class instance is already initialized");this._mutableProp.addResponsiveProp(t)}},{key:"changeProp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._mutableProp.changeProp(t),this._callbacks.tbt("changeProp",!1)}},{key:"_onPropResponsive",value:function(){this._onPropMutate()}},{key:"_onPropChange",value:function(t){this._onPropMutate()}},{key:"_onPropMutate",value:function(){}},{key:"init",value:function(){var t=this;this._inited||(this._inited=!0,this._constructor(),this._setEvents(),this.prop.parent&&this.prop.parent.addCallback("destroy",(function(){t.destroy()})))}},{key:"_constructor",value:function(){}},{key:"_setEvents",value:function(){}},{key:"addViewportCallback",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{name:this.constructor.name},r=this._app.viewport.add(t,e,n);return this._viewportCallbacks.push(r),r}},{key:"addCallback",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.callbacks.add(t,e,n);return r}},{key:"addEventListeners",value:function(t,e,n,r){var o=m(t,e,n,r);return this._listeners.push(o),o}},{key:"destroy",value:function(){this.destroyed||this._destroy()}},{key:"_destroy",value:function(){this._callbacks.tbt("destroy",!1),this._callbacks.destroy(),this._mutableProp.destroy(),this._viewportCallbacks.forEach((function(t){t.remove()})),this._listeners.forEach((function(t){t.remove()})),this._destroyed=!0}}])&&B(e.prototype,n),r&&B(e,r),t}();function A(t){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function H(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function z(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function N(t,e,n){return(N="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Y(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function V(t,e){return(V=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function X(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Y(t);if(e){var o=Y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Q(this,n)}}function Q(t,e){return!e||"object"!==A(e)&&"function"!=typeof e?U(t):e}function U(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Y(t){return(Y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function $(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var q=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&V(t,e)}(i,t);var e,n,r,o=X(i);function i(){var t;H(this,i);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return $(U(t=o.call.apply(o,[this].concat(n))),"_plugins",void 0),t}return e=i,(n=[{key:"addPlugin",value:function(t){void 0===this._plugins&&(this._plugins=[]),this._plugins.push(t),t.inited||t.initPlugin(this)}},{key:"_destroyPlugins",value:function(){this._plugins&&this._plugins.forEach((function(t){t.destroy()}))}},{key:"_destroy",value:function(){N(Y(i.prototype),"_destroy",this).call(this),this._destroyPlugins()}}])&&z(e.prototype,n),r&&z(e,r),i}(F);function K(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,1];return t<e[0]?e[0]:t>e[1]?e[1]:t}function J(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.001,o=t*(1-n)+e*n,i=Math.abs(e-o);return i<=r?e:o}function G(t,e){return(t-e[0])/(e[1]-e[0])}function Z(t,e){for(var n=[],r=1/(t-e*(t-1)),o=0;o<t;o+=1){var i=r*(1-e)*o,s=i+r;n.push([i,s])}return n}function tt(t){return(tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function et(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function nt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?et(Object(n),!0).forEach((function(e){ft(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):et(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function rt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ot(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function it(t,e,n){return(it="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=lt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function st(t,e){return(st=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function at(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=lt(t);if(e){var o=lt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ct(this,n)}}function ct(t,e){return!e||"object"!==tt(e)&&"function"!=typeof e?ut(t):e}function ut(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function lt(t){return(lt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ft(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ht=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&st(t,e)}(i,t);var e,n,r,o=at(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return rt(this,i),ft(ut(e=o.call(this,t,!1)),"_isPlaying",void 0),ft(ut(e),"_frame",void 0),ft(ut(e),"_frameIndex",void 0),ft(ut(e),"_timeStamp",void 0),ft(ut(e),"_prevFrameTime",void 0),e._isPlaying=!1,e._frame=null,e._frameIndex=-1,e._timeStamp=null,e._prevFrameTime=null,n&&e.init(),e}return e=i,(n=[{key:"isPlaying",get:function(){return this._isPlaying}},{key:"_getDefaultProp",value:function(){return nt(nt({},it(lt(i.prototype),"_getDefaultProp",this).call(this)),{},{fps:140,run:!1})}},{key:"_constructor",value:function(){it(lt(i.prototype),"_constructor",this).call(this),this._create()}},{key:"_create",value:function(){this.prop.run&&this.play()}},{key:"_onPropMutate",value:function(){this._frameIndex=-1,this._timeStamp=null,this._prevFrameTime=null,this.prop.run?this._play():this._pause()}},{key:"play",value:function(){this.destroyed||this.prop.run||this.changeProp({run:!0})}},{key:"_play",value:function(){this.isPlaying||(this._isPlaying=!0,this._frame=window.requestAnimationFrame(this._animate.bind(this)))}},{key:"pause",value:function(){this.prop.run&&this.changeProp({run:!1})}},{key:"_pause",value:function(){this.isPlaying&&(this._frame&&(window.cancelAnimationFrame(this._frame),this._frame=null),this._isPlaying=!1)}},{key:"_animate",value:function(t){if(this._isPlaying){this._frame=window.requestAnimationFrame(this._animate.bind(this));var e=+new Date;null==this._timeStamp&&(this._timeStamp=t),null==this._prevFrameTime&&(this._prevFrameTime=e);var n=Math.floor((t-this._timeStamp)/(1e3/this.prop.fps));if(!(n<=this._frameIndex)){this._frameIndex=n;var r=e-this._prevFrameTime,o=K(0===r?1e3/60:Math.floor(1e3/r),[1,1/0]);this.callbacks.tbt("frame",{fps:this.prop.fps,realFPS:o,prevFrameDuration:e-this._prevFrameTime}),this._prevFrameTime=+new Date}}}},{key:"_destroy",value:function(){this.pause(),it(lt(i.prototype),"_destroy",this).call(this)}}])&&ot(e.prototype,n),r&&ot(e,r),i}(q);function pt(t){return(pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function yt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?dt(Object(n),!0).forEach((function(e){kt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):dt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function vt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function bt(t,e,n){return(bt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Pt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function gt(t,e){return(gt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function mt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Pt(t);if(e){var o=Pt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return wt(this,n)}}function wt(t,e){return!e||"object"!==pt(e)&&"function"!=typeof e?Ot(t):e}function Ot(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pt(t){return(Pt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function kt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var jt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&>(t,e)}(i,t);var e,n,r,o=mt(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];vt(this,i),kt(Ot(e=o.call(this,t,!1)),"_outer",void 0),kt(Ot(e),"_container",void 0),kt(Ot(e),"_containerExists",void 0),kt(Ot(e),"_elements",void 0),kt(Ot(e),"_elementsLength",void 0),kt(Ot(e),"_targetLeft",void 0),kt(Ot(e),"_targetTop",void 0),kt(Ot(e),"_scrollLeft",void 0),kt(Ot(e),"_scrollTop",void 0),kt(Ot(e),"_scrollWidth",void 0),kt(Ot(e),"_scrollHeight",void 0),kt(Ot(e),"_clientWidth",void 0),kt(Ot(e),"_clientHeight",void 0),kt(Ot(e),"_instant",void 0),kt(Ot(e),"_animationFrame",void 0),kt(Ot(e),"_outerAnimationFrameEvent",void 0),kt(Ot(e),"_currentFPS",void 0);var r=e.prop.selectors;if(e._targetLeft=0,e._targetTop=0,e._scrollLeft=0,e._scrollTop=0,e._scrollWidth=0,e._scrollHeight=0,e._clientWidth=0,e._clientHeight=0,e._instant=!1,e._animationFrame=void 0,e._outerAnimationFrameEvent=void 0,e._currentFPS=60,e._outer=y(r.outer),!(e._outer instanceof HTMLElement))throw new Error("".concat(r.outer," is not a HTMLElement"));e._outer.classList.add(e.prefix);var s=y(".".concat(e.prefix,"__container"),e.outer);return p(s)?(e._container=s,e._containerExists=!0):(e._container=b("div",{class:"".concat(e.prefix,"__container"),parent:e.outer,children:Array.from(e.outer.children)}),e._containerExists=!1),r.elements?e._elements=Array.from(v(r.elements,e._outer)):e._elements=[e._container],e._elementsLength=e._elements.length,e._elements.forEach((function(t){t.style.willChange="transform"})),n&&e.init(),e}return e=i,(n=[{key:"prefix",get:function(){return"".concat(this._app.prefix,"smooth-scroll")}},{key:"outer",get:function(){return this._outer}},{key:"container",get:function(){return this._container}},{key:"elements",get:function(){return this._elements}},{key:"targetLeft",get:function(){return this._targetLeft},set:function(t){this.targetLeftBound=t,this._enable()}},{key:"targetLeftBound",get:function(){return this._targetLeft},set:function(t){var e=this.prop.overscroll&&this.prop.isHorizontal?-this.prop.overscroll.max:0,n=this.maxScrollableWidth+(this.prop.overscroll&&this.prop.isHorizontal?this.prop.overscroll.max:0);this._targetLeft=K(t,[e,n])}},{key:"targetTop",get:function(){return this._targetTop},set:function(t){this.targetTopBound=t,this._enable()}},{key:"targetTopBound",get:function(){return this._targetTop},set:function(t){var e=this.prop.overscroll&&!this.prop.isHorizontal?-this.prop.overscroll.max:0,n=this.maxScrollableHeight+(this.prop.overscroll&&!this.prop.isHorizontal?this.prop.overscroll.max:0);this._targetTop=K(t,[e,n])}},{key:"scrollLeft",get:function(){return this._scrollLeft},set:function(t){this.targetLeftBound=t,this._scrollLeft=this._targetLeft,this._enable()}},{key:"scrollTop",get:function(){return this._scrollTop},set:function(t){this.targetTopBound=t,this._scrollTop=this._targetTop,this._enable()}},{key:"scrollWidth",get:function(){return this._scrollWidth}},{key:"scrollHeight",get:function(){return this._scrollHeight}},{key:"clientWidth",get:function(){return this._clientWidth}},{key:"clientHeight",get:function(){return this._clientHeight}},{key:"maxScrollableWidth",get:function(){return this.scrollWidth-this.clientWidth}},{key:"maxScrollableHeight",get:function(){return this.scrollHeight-this.clientHeight}},{key:"_getDefaultProp",value:function(){return yt(yt({},bt(Pt(i.prototype),"_getDefaultProp",this).call(this)),{},{selectors:{outer:"#".concat(this.prefix),elements:!1},enabled:!0,animationFrame:!1,recalculateSizes:!0,useWheel:!0,autoStop:!0,isHorizontal:!1,stopPropagation:!0,useWillChange:!0,render:{lerp:.1,lerpToFixed:2,approximation:.1,normalizeLerp:!1},overscroll:{friction:.5,max:250}})}},{key:"_constructor",value:function(){bt(Pt(i.prototype),"_constructor",this).call(this),this._toggle()}},{key:"_setEvents",value:function(){var t=this;this.resize(),this.addViewportCallback("",(function(){t.resize(!0)})),this.addEventListeners(this.outer,"wheel",(function(e){t._handleWheel(e)})),this.addEventListeners(this.outer,"scroll",(function(){t.outer.scrollTop=0,t.outer.scrollLeft=0}))}},{key:"_onPropMutate",value:function(){bt(Pt(i.prototype),"_onPropMutate",this).call(this),this.resize(),this._toggle()}},{key:"resize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.container,n=this.outer;this._clientWidth=n.clientWidth,this._clientHeight=n.clientHeight,this._scrollWidth=K(e.clientWidth,[this.clientWidth,1/0]),this._scrollHeight=K(e.clientHeight,[this.clientHeight,1/0]),t&&(this._instant=!0),t&&(this.targetLeft=parseInt(this.targetLeft.toFixed(0),10),this.targetTop=parseInt(this.targetTop.toFixed(0),10));var r=this.maxScrollableHeight>0||this.maxScrollableWidth>0;n.classList.toggle("has-scroll",r),n.classList.toggle("no-scroll",!r),this._updateElementsProp(),this.callbacks.tbt("resize",!1)}},{key:"_recalculateSizes",value:function(){var t=this.container,e=t.clientHeight,n=t.clientWidth;e===this.scrollHeight&&n===this.scrollWidth||this.resize()}},{key:"_updateElementsProp",value:function(){for(var t=0;t<this._elementsLength;t+=1){var e=this._elements[t];e.smoothScrollLeft=this.scrollLeft,e.smoothScrollTop=this.scrollTop;var n=e.getAttribute("".concat(this.prefix,"-ease"));if(n)try{e.smoothScrollLerpEase=parseFloat(n)}catch(r){}}}},{key:"_handleWheel",value:function(t){var e=this.prop;if(e.enabled&&e.useWheel){(e.stopPropagation||!e.stopPropagation&&(this.scrollLeft>0&&this.scrollLeft<this.maxScrollableWidth||this.scrollTop>0&&this.scrollTop<this.maxScrollableHeight))&&(t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault());var n=P()(t);this.targetLeftBound+=e.isHorizontal?n.pixelY:n.pixelX,this.targetTopBound+=e.isHorizontal?n.pixelX:n.pixelY,this._enable(),this.callbacks.tbt("wheel",t)}}},{key:"_toggle",value:function(){this.prop.enabled?this._enable():this._disable()}},{key:"_enable",value:function(){var t=this;this.prop.enabled&&(this.prop.animationFrame&&!this._outerAnimationFrameEvent?this._outerAnimationFrameEvent=this.prop.animationFrame.addCallback("frame",(function(e){t._currentFPS=e.realFPS,t.render()})):(this._animationFrame||(this._animationFrame=new ht,this._animationFrame.addCallback("frame",(function(e){t._currentFPS=e.realFPS,t.render()}))),this._animationFrame.play()))}},{key:"_disable",value:function(){this._outerAnimationFrameEvent&&this.prop.animationFrame&&this._outerAnimationFrameEvent.remove(),this._animationFrame&&this._animationFrame.pause()}},{key:"render",value:function(){var t=this.prop;t.recalculateSizes&&this._recalculateSizes(),this._calcScroll(),this._calcElements(),this._renderElements(),this._instant&&(this._instant=!1),this.callbacks.tbt("scroll",!1);var e=Math.abs(this.targetTop-this.scrollTop);0===Math.abs(this.targetLeft-this.scrollLeft)&&0===e&&t.autoStop&&(this._disable(),this.callbacks.tbt("approximate",!1))}},{key:"_calcScroll",value:function(){var t=this.prop.overscroll;t&&(this.targetLeft<0?this.targetLeftBound=this._lerp(this.targetLeftBound,0,t.friction):this.targetLeft>this.maxScrollableWidth&&(this.targetLeftBound=this._lerp(this.targetLeftBound,this.maxScrollableWidth,t.friction)),this.targetTop<0?this.targetTopBound=this._lerp(this.targetTopBound,0,t.friction):this.targetTop>this.maxScrollableHeight&&(this.targetTopBound=this._lerp(this.targetTopBound,this.maxScrollableHeight,t.friction))),this._scrollLeft=this._lerp(this.scrollLeft,this.targetLeft),this._scrollTop=this._lerp(this.scrollTop,this.targetTop)}},{key:"_calcElements",value:function(){for(var t=this._getLerpEase(),e=0;e<this._elementsLength;e+=1){var n=this._elements[e],r=this._getLerpEase(n);r===t?(n.smoothScrollLeft=this._scrollLeft,n.smoothScrollTop=this._scrollTop):(n.smoothScrollLeft=this._lerp(n.smoothScrollLeft,this._targetLeft,r),n.smoothScrollTop=this._lerp(n.smoothScrollTop,this._targetTop,r))}}},{key:"_lerp",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._getLerpEase(),r=this.prop.render,o=r.lerpToFixed,i=r.approximation,s=this._instant?1:n,a=J(t,e,s,i);if("number"==typeof o){var c=Math.round(Math.abs(o));return parseFloat(a.toFixed(c))}return a}},{key:"_getLerpEase",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.prop.render,n=e.lerp,r=e.normalizeLerp,o=r?60/this._currentFPS:1;return t&&t.smoothScrollLerpEase||n*o}},{key:"_renderElements",value:function(){for(var t=0;t<this._elementsLength;t+=1){var e=this._elements[t],n=-e.smoothScrollLeft,r=-e.smoothScrollTop;e.style.transform="matrix3d(1,0,0.00,0,0.00,1,0.00,0,0,0,1,0, ".concat(n,", ").concat(r,", 0,1)")}}},{key:"scrollTo",value:function(){var t=arguments;if(1===t.length&&"object"===pt(t[0])){var e=t[0],n=e.top,r=e.left,o=e.behavior;void 0!==r&&("smooth"===o?this.targetLeftBound=r:this.scrollLeft=r),void 0!==n&&("smooth"===o?this.targetTopBound=n:this.scrollTop=n),"smooth"===o&&this._enable()}"number"!=typeof t[0]&&"number"!=typeof t[1]||("number"==typeof t[0]&&(this.scrollLeft=t[0]),"number"==typeof t[1]&&(this.scrollTop=t[1]))}},{key:"_destroy",value:function(){if(bt(Pt(i.prototype),"_destroy",this).call(this),this._disable(),this._animationFrame&&this._animationFrame.destroy(),!this._containerExists){for(;this._container.firstChild;)this._outer.appendChild(this._container.firstChild);this._container.remove()}this._outer.classList.remove(this.prefix),this._elements.forEach((function(t){t.style.transform="",t.style.willChange=""}))}}])&&_t(e.prototype,n),r&&_t(e,r),i}(q);function Et(t,e,n){var r,o=[];t instanceof jt?t.addCallback("scroll",(function(){e({scrollTop:t.scrollTop,scrollLeft:t.scrollLeft})})):(r="string"==typeof t?y(t):t)&&o.push(m(r,"scroll",(function(){var t=r instanceof Window?r.pageYOffset:r.scrollTop,n=r instanceof Window?r.pageXOffset:r.scrollLeft;e({scrollTop:t,scrollLeft:n})}),n?{passive:n.passive}:void 0));return{remove:function(){o.forEach((function(t){t.remove()}))}}}function St(){return"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype}var xt=/iPhone/i,Tt=/iPod/i,Rt=/iPad/i,Lt=/\biOS-universal(?:.+)Mac\b/i,Ct=/\bAndroid(?:.+)Mobile\b/i,Dt=/Android/i,Mt=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Wt=/Silk/i,Bt=/Windows Phone/i,It=/\bWindows(?:.+)ARM\b/i,Ft=/BlackBerry/i,At=/BB10/i,Ht=/Opera Mini/i,zt=/\b(CriOS|Chrome)(?:.+)Mobile/i,Nt=/Mobile(?:.+)Firefox\b/i,Vt=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};function Xt(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var n=e.userAgent,r=n.split("[FBAN");void 0!==r[1]&&(n=r[0]),void 0!==(r=n.split("Twitter"))[1]&&(n=r[0]);var o=function(t){return function(e){return e.test(t)}}(n),i={apple:{phone:o(xt)&&!o(Bt),ipod:o(Tt),tablet:!o(xt)&&(o(Rt)||Vt(e))&&!o(Bt),universal:o(Lt),device:(o(xt)||o(Tt)||o(Rt)||o(Lt)||Vt(e))&&!o(Bt)},amazon:{phone:o(Mt),tablet:!o(Mt)&&o(Wt),device:o(Mt)||o(Wt)},android:{phone:!o(Bt)&&o(Mt)||!o(Bt)&&o(Ct),tablet:!o(Bt)&&!o(Mt)&&!o(Ct)&&(o(Wt)||o(Dt)),device:!o(Bt)&&(o(Mt)||o(Wt)||o(Ct)||o(Dt))||o(/\bokhttp\b/i)},windows:{phone:o(Bt),tablet:o(It),device:o(Bt)||o(It)},other:{blackberry:o(Ft),blackberry10:o(At),opera:o(Ht),firefox:o(Nt),chrome:o(zt),device:o(Ft)||o(At)||o(Ht)||o(Nt)||o(zt)},any:!1,phone:!1,tablet:!1};return i.any=i.apple.device||i.android.device||i.windows.device||i.other.device,i.phone=i.apple.phone||i.android.phone||i.windows.phone,i.tablet=i.apple.tablet||i.android.tablet||i.windows.tablet,i}var Qt,Ut,Yt=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r},$t=function(t,e,n){this.name=t,this.version=e,this.os=n,this.type="browser"},qt=function(t){this.version=t,this.type="node",this.name="node",this.os=process.platform},Kt=function(t,e,n,r){this.name=t,this.version=e,this.os=n,this.bot=r,this.type="bot-device"},Jt=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},Gt=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},Zt=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,te=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],ee=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function ne(t){return t?oe(t):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new Gt:"undefined"!=typeof navigator?oe(navigator.userAgent):"undefined"!=typeof process&&process.version?new qt(process.version.slice(1)):null}function re(t){return""!==t&&te.reduce((function(e,n){var r=n[0],o=n[1];if(e)return e;var i=o.exec(t);return!!i&&[r,i]}),!1)}function oe(t){var e=re(t);if(!e)return null;var n=e[0],r=e[1];if("searchbot"===n)return new Jt;var o=r[1]&&r[1].split(/[._]/).slice(0,3);o?o.length<3&&(o=Yt(o,function(t){for(var e=[],n=0;n<t;n++)e.push("0");return e}(3-o.length))):o=[];var i=o.join("."),s=function(t){for(var e=0,n=ee.length;e<n;e++){var r=ee[e],o=r[0];if(r[1].exec(t))return o}return null}(t),a=Zt.exec(t);return a&&a[1]?new Kt(n,i,s,a[1]):new $t(n,i,s)}class ie extends Error{constructor(t){super(t||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}}class se{static fn(t){return(...e)=>new se(((n,r,o)=>{e.push(o),t(...e).then(n,r)}))}constructor(t){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise(((e,n)=>{this._reject=n;const r=t=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(t)};Object.defineProperties(r,{shouldReject:{get:()=>this._rejectOnCancel,set:t=>{this._rejectOnCancel=t}}}),t((t=>{this._isCanceled&&r.shouldReject||(this._isPending=!1,e(t))}),(t=>{this._isPending=!1,n(t)}),r)}))}then(t,e){return this._promise.then(t,e)}catch(t){return this._promise.catch(t)}finally(t){return this._promise.finally(t)}cancel(t){if(this._isPending&&!this._isCanceled){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(const t of this._cancelHandlers)t()}catch(e){return void this._reject(e)}this._rejectOnCancel&&this._reject(new ie(t))}}get isCanceled(){return this._isCanceled}}function ae(t){return(ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ce(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ue(t,e,n){return(ue="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=de(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function le(t,e){return(le=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function fe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=de(t);if(e){var o=de(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return he(this,n)}}function he(t,e){return!e||"object"!==ae(e)&&"function"!=typeof e?pe(t):e}function pe(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function de(t){return(de=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ye(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.setPrototypeOf(se.prototype,Promise.prototype),function(t){t.Desktop="desktop",t.Tablet="tablet",t.Phone="phone"}(Qt||(Qt={})),function(t){t.Landscape="landscape",t.Portrait="portrait"}(Ut||(Ut={}));var ve=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&le(t,e)}(i,t);var e,n,r,o=fe(i);function i(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),ye(pe(t=o.call(this,!1)),"_width",void 0),ye(pe(t),"_height",void 0),ye(pe(t),"_prevSize",void 0),ye(pe(t),"_isDesktop",void 0),ye(pe(t),"_isTablet",void 0),ye(pe(t),"_isPhone",void 0),t._width=0,t._height=0,t._prevSize={w:0,h:0},t._isDesktop=!1,t._isTablet=!1,t._isPhone=!1,t._init(),t}return e=i,(n=[{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"vw",get:function(){return this.width/100}},{key:"vh",get:function(){return this.height/100}},{key:"prevSize",get:function(){return this._prevSize}},{key:"isLandscape",get:function(){return this.width>this.height}},{key:"isPortrait",get:function(){return this.width<this.height}},{key:"isDesktop",get:function(){return this._isDesktop}},{key:"isTablet",get:function(){return this._isTablet}},{key:"isPhone",get:function(){return this._isPhone}},{key:"dpr",get:function(){return void 0!==window.devicePixelRatio?window.devicePixelRatio:1}},{key:"lowerDesktopDPR",get:function(){return this._app.isDesktop?1:this.dpr}},{key:"_constructor",value:function(){ue(de(i.prototype),"_constructor",this).call(this),this._setValues()}},{key:"_setEvents",value:function(){var t=this;window.addEventListener("resize",(function(){l((function(){t._onResize()}),t._app.prop.viewportResizeTimeout)}))}},{key:"_setValues",value:function(){var t=this._app,e=t.html,n=t.prop;this._width=e.clientWidth,this._height=e.clientHeight,this._prevSize={w:this._width,h:this._height};var r=this.width;this._isDesktop=r>=n.tablet,this._isTablet=r<=n.tablet&&r>n.phone,this._isPhone=r<=n.phone,this._updateClasses(),this._updateCSSVars()}},{key:"_updateClasses",value:function(){var t=[Qt.Desktop,Qt.Tablet,Qt.Phone];this.isDesktop?this._updateBreakpointClasses(Qt.Desktop,t):this.isTablet?this._updateBreakpointClasses(Qt.Tablet,t):this._updateBreakpointClasses(Qt.Phone,t);var e=[Ut.Landscape,Ut.Portrait];this.isLandscape?this._updateBreakpointClasses(Ut.Landscape,e):this.isPortrait?this._updateBreakpointClasses(Ut.Portrait,e):this._updateBreakpointClasses("",e)}},{key:"_updateBreakpointClasses",value:function(t,e){var n=this._app.html,r=this._app.prefix;e.forEach((function(e){e===t?n.classList.add("".concat(r,"viewport-").concat(e)):n.classList.remove("".concat(r,"viewport-").concat(e))}))}},{key:"_updateCSSVars",value:function(){var t=this._app.html;t.style.setProperty("--vw","".concat(this.vw,"px")),t.style.setProperty("--vh","".concat(this.vh,"px"))}},{key:"_onResize",value:function(){var t=this._prevSize.w,e=this._prevSize.h;this._setValues();var n=this.width,r=this.height,o={widthChanged:n!==t,heightChanged:r!==e,orientationChanged:n>r!=t>e};n!==t&&r===e&&this.tbt("w_",o),r!==e&&n===t&&this.tbt("h_",o),n!==t&&r!==e&&(this.tbt("wh",o),this.tbt("hw",o)),n!==t&&this.tbt("w",o),r!==e&&this.tbt("h",o),this.tbt("",o)}}])&&ce(e.prototype,n),r&&ce(e,r),i}(T);function _e(t){return(_e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function be(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ge(t,e){return(ge=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function me(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Pe(t);if(e){var o=Pe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return we(this,n)}}function we(t,e){return!e||"object"!==_e(e)&&"function"!=typeof e?Oe(t):e}function Oe(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pe(t){return(Pe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ke=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ge(t,e)}(i,t);var e,n,r,o=me(i);function i(){var t,e,n,r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=o.call(this,!1),e=Oe(t),r=void 0,(n="_loaded")in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,t._loaded=!1,t._init(),t}return e=i,(n=[{key:"loaded",get:function(){return this._loaded}},{key:"_setEvents",value:function(){var t=this;"complete"===document.readyState?this._handleLoaded():window.addEventListener("load",(function(){t._handleLoaded()}))}},{key:"_handleLoaded",value:function(){var t=this._app,e=t.prefix;this._loaded=!0,t.html.classList.remove("".concat(e,"loading")),t.body.classList.remove("".concat(e,"loading")),t.html.classList.add("".concat(e,"loaded")),this.tbt("",!1)}},{key:"onLoaded",value:function(t){if(!this.loaded)return this.add("",t.bind(this));t()}}])&&be(e.prototype,n),r&&be(e,r),i}(T);function je(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ee(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?je(Object(n),!0).forEach((function(e){Te(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):je(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Se(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Te(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Re=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Se(this,t),Te(this,"_prop",void 0),Te(this,"_prefix",void 0),Te(this,"_isPhone",void 0),Te(this,"_isTablet",void 0),Te(this,"_isMobile",void 0),Te(this,"_isDesktop",void 0),Te(this,"_osName",void 0),Te(this,"_browserName",void 0),Te(this,"_pages",[]),Te(this,"_page",!1),Te(this,"_pageLoad",void 0),Te(this,"_viewport",void 0),window.vevetApp)throw new Error("Vevet Application already exists!");this._prop=Ee(Ee({},this.defaultProp),e),this._prefix=this.prop.prefix,this._sayHi(),window.vevetApp=this;var n=Xt();this._isPhone=n.phone,this.html.classList.toggle("".concat(this.prefix,"phone"),this._isPhone),this._isTablet=n.tablet,this.html.classList.toggle("".concat(this.prefix,"tablet"),this._isTablet),this._isMobile=n.phone||n.tablet,this.html.classList.toggle("".concat(this.prefix,"mobile"),this._isMobile),this._isDesktop=!this._isMobile,this.html.classList.toggle("".concat(this.prefix,"desktop"),this._isDesktop);var r=ne();if(null!=r&&r.os){var o=r.os.split(" ")[0].toLowerCase();this.html.classList.add("".concat(this.prefix,"os-").concat(o)),this._osName=o}else this._osName="";if(null!=r&&r.name){var i=r.name.toLowerCase();this.html.classList.add("".concat(this.prefix,"browser-").concat(i)),this._browserName=i}else this._browserName="";this._pageLoad=new ke,this._viewport=new ve}var e,n,r;return e=t,(n=[{key:"prop",get:function(){return this._prop}},{key:"defaultProp",get:function(){return{tablet:1199,phone:899,prefix:"v-",easing:[.25,.1,.25,1],viewportResizeTimeout:0}}},{key:"prefix",get:function(){return this._prefix}},{key:"isPhone",get:function(){return this._isPhone}},{key:"isTablet",get:function(){return this._isTablet}},{key:"isMobile",get:function(){return this._isMobile}},{key:"isDesktop",get:function(){return this._isDesktop}},{key:"osName",get:function(){return this._osName}},{key:"browserName",get:function(){return this._browserName}},{key:"doc",get:function(){return document}},{key:"html",get:function(){return document.documentElement}},{key:"body",get:function(){return document.body}},{key:"pages",get:function(){return this._pages}},{key:"page",get:function(){return this._page},set:function(t){this._page=t}},{key:"onPageCreated",value:function(){var t=this;return new se((function(e){t._page?t._page.onCreate().then((function(){e(t.page)})):setTimeout((function(){t.onPageCreated().then((function(){e(t.page)}))}),30)}))}},{key:"onPageShown",value:function(){var t=this;return new se((function(e){t.onPageCreated().then((function(){t._page&&t._page.onShow().then((function(){e(t.page)}))}))}))}},{key:"pageLoad",get:function(){return this._pageLoad}},{key:"onPageLoaded",value:function(){var t=this;return new se((function(e){t._pageLoad.onLoaded((function(){e()}))}))}},{key:"viewport",get:function(){return this._viewport}},{key:"_sayHi",value:function(){var t=["padding: 1rem 1.5rem;","background: #5F2580;","font: 1rem/1 Arial;","color: #ffffff;"].join("");console.log("%c%s",t,"Vevet")}}])&&xe(e.prototype,n),r&&xe(e,r),t}();function Le(t){return(Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ce(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function De(t,e,n){return(De="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Fe(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Me(t,e){return(Me=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function We(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Fe(t);if(e){var o=Fe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Be(this,n)}}function Be(t,e){return!e||"object"!==Le(e)&&"function"!=typeof e?Ie(t):e}function Ie(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Fe(t){return(Fe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ae=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Me(t,e)}(i,t);var e,n,r,o=We(i);function i(t){var e,n,r,s;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t,!1),n=Ie(e),s=void 0,(r="_component")in n?Object.defineProperty(n,r,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[r]=s,e}return e=i,(n=[{key:"component",get:function(){return this._component}},{key:"init",value:function(){if(!this._component)throw new Error("Component is not set. Be sure that initlugin is called before.");De(Fe(i.prototype),"init",this).call(this)}},{key:"initPlugin",value:function(t){this._inited||(this._component=t,this.init())}}])&&Ce(e.prototype,n),r&&Ce(e,r),i}(F);function He(t){return(He="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ze(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ne(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ze(Object(n),!0).forEach((function(e){Je(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ze(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ve(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Qe(t,e,n){return(Qe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ke(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Ue(t,e){return(Ue=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ye(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ke(t);if(e){var o=Ke(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return $e(this,n)}}function $e(t,e){return!e||"object"!==He(e)&&"function"!=typeof e?qe(t):e}function qe(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ke(t){return(Ke=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Je(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ge=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ue(t,e)}(i,t);var e,n,r,o=Ye(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Ve(this,i),Je(qe(e=o.call(this,t,!1)),"_created",void 0),Je(qe(e),"_shown",void 0),Je(qe(e),"_hidden",void 0),Je(qe(e),"_viaAJAX",void 0),e._created=!1,e._shown=!1,e._hidden=!1,e._destroyed=!1,e._viaAJAX=!1,n&&e.init(),e}return e=i,(n=[{key:"created",get:function(){return this._created}},{key:"shown",get:function(){return this._shown}},{key:"hidden",get:function(){return this._hidden}},{key:"viaAJAX",get:function(){return this._viaAJAX}},{key:"pageClassName",get:function(){return"".concat(this._app.prefix,"page-").concat(this.prop.name)}},{key:"_getDefaultProp",value:function(){return Ne(Ne({},Qe(Ke(i.prototype),"_getDefaultProp",this).call(this)),{},{name:"home"})}},{key:"create",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(n,r){t.canCreate().then((function(){t.created||(t._created=!0,t._shown=!1,t._hidden=!1,t._destroyed=!1,t._viaAJAX=e,t._app.page=t,t._app.html.classList.add(t.pageClassName),t._create().then((function(){t.callbacks.tbt("create",!1),n()})))})).catch((function(){r()}))}))}},{key:"_create",value:function(){return new Promise((function(t){t()}))}},{key:"canCreate",value:function(){var t=this;return new Promise((function(e,n){t.created?n():e()}))}},{key:"show",value:function(){var t=this;return new Promise((function(e,n){t.canShow().then((function(){t.shown||(t._created=!0,t._shown=!0,t._hidden=!1,t._destroyed=!1,t._show().then((function(){t.callbacks.tbt("show",!1),e()})))})).catch((function(){n()}))}))}},{key:"_show",value:function(){return new Promise((function(t){t()}))}},{key:"canShow",value:function(){var t=this;return new Promise((function(e,n){!t.created||t.shown?n():e()}))}},{key:"hide",value:function(){var t=this;return new Promise((function(e,n){t.canHide().then((function(){t.hidden||(t._created=!0,t._shown=!1,t._hidden=!0,t._destroyed=!1,t._hide().then((function(){t.callbacks.tbt("hide",!1),e()})))})).catch((function(){n()}))}))}},{key:"_hide",value:function(){return new Promise((function(t){t()}))}},{key:"canHide",value:function(){var t=this;return new Promise((function(e,n){t.created&&t.shown&&!t.hidden?e():n()}))}},{key:"destroy",value:function(){var t=this;return new Promise((function(e,n){t.canDestroy().then((function(){t.destroyed||(t._created=!1,t._shown=!1,t._hidden=!0,t._destroyed=!0,t._app.page=!1,t._app.html.classList.remove(t.pageClassName),t._destroy().then((function(){e()})))})).catch((function(){n()}))}))}},{key:"_destroy",value:function(){var t=this;return new Promise((function(e){Qe(Ke(i.prototype),"_destroy",t).call(t),e()}))}},{key:"canDestroy",value:function(){var t=this;return new Promise((function(e,n){t.created&&t.hidden&&!t.destroyed?e():n()}))}},{key:"onCreate",value:function(){var t=this;return new se((function(e){t.created?e():t.addCallback("create",(function(){e()}),{once:!0})}))}},{key:"onShow",value:function(){var t=this;return new se((function(e){t.shown?e():t.addCallback("show",(function(){e()}),{once:!0})}))}},{key:"onHide",value:function(){var t=this;return new se((function(e){t.hidden?e():t.addCallback("hide",(function(){e()}),{once:!0})}))}}])&&Xe(e.prototype,n),r&&Xe(e,r),i}(q);function Ze(t){return(Ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function en(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?tn(Object(n),!0).forEach((function(e){fn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function nn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function on(t,e){return(on=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function sn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ln(t);if(e){var o=ln(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return an(this,n)}}function an(t,e){return!e||"object"!==Ze(e)&&"function"!=typeof e?cn(t):e}function cn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function un(t,e,n){return(un="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ln(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function ln(t){return(ln=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function fn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var hn,pn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&on(t,e)}(i,t);var e,n,r,o=sn(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return nn(this,i),fn(cn(e=o.call(this,t,!1)),"_wheelListener",void 0),fn(cn(e),"_lockWheel",void 0),fn(cn(e),"_lockWheelTimeout",void 0),e._wheelListener=void 0,e._lockWheel=!1,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return en(en({},un(ln(i.prototype),"_getDefaultProp",this).call(this)),{},{container:!1,enabled:!0,stopPropagation:!1,threshold:20})}},{key:"container",get:function(){return this.prop.container?this.prop.container:window}},{key:"_setEvents",value:function(){un(ln(i.prototype),"_setEvents",this).call(this),this.container instanceof Window?this._toggleWheelEvent():(this._listeners.push(m(this.container,"mouseenter",this._handleMouseEnter.bind(this))),this._listeners.push(m(this.container,"mouseleave",this._handleMouseLeave.bind(this))))}},{key:"_onPropMutate",value:function(){un(ln(i.prototype),"_onPropMutate",this).call(this),this._toggleWheelEvent()}},{key:"_handleMouseEnter",value:function(){this.prop.enabled&&this._createWheelEvent()}},{key:"_handleMouseLeave",value:function(){this._destroyWheelEvent()}},{key:"_toggleWheelEvent",value:function(){this.prop.enabled?this._createWheelEvent():this._destroyWheelEvent()}},{key:"_createWheelEvent",value:function(){this._wheelListener||(this._lockWheel=!1,this._lockWheelTimeout&&clearTimeout(this._lockWheelTimeout),this._wheelListener=m(this.container,"wheel",this._handleWheel.bind(this)))}},{key:"_destroyWheelEvent",value:function(){this._wheelListener&&(this._wheelListener.remove(),this._wheelListener=void 0)}},{key:"_handleWheel",value:function(t){var e=this;if(this._wheelListener){if(this.prop.stopPropagation&&(t.preventDefault(),t.stopPropagation()),this._lockWheel)return this._lockWheelTimeout&&clearTimeout(this._lockWheelTimeout),void(this._lockWheelTimeout=setTimeout((function(){e._lockWheel=!1}),300));var n=P()(t),r=this.prop.threshold,o=!1;n.pixelY>r?(this._callbacks.tbt("down",!1),o=!0):n.pixelY<-1*r&&(this._callbacks.tbt("up",!1),o=!0),n.pixelX>r?(this._callbacks.tbt("right",!1),o=!0):n.pixelX<-1*r&&(this._callbacks.tbt("left",!1),o=!0),o&&(this._lockWheel=!0)}}},{key:"_destroy",value:function(){un(ln(i.prototype),"_destroy",this).call(this),this._destroyWheelEvent()}}])&&rn(e.prototype,n),r&&rn(e,r),i}(F);function dn(t,e){const[n,r,o,i]=e;if(n===r&&o===i)return t;const s=[];for(let a=0;a<11;++a)s[a]=yn(.1*a,n,o);return 0===t?0:1===t?1:yn(function(t,e,n){const r=t[0],o=t[2];let i=0,s=1;for(;10!==s&&n[s]<=e;++s)i+=.1;--s;const a=(e-n[s])/(n[s+1]-n[s]),c=i+.1*a,u=gn(c,r,o);if(u>=.001)return function(t,e,n,r){for(let o=0;o<4;++o){const o=gn(e,n,r);if(0===o)return e;e-=(yn(e,n,r)-t)/o}return e}(e,c,r,o);if(0===u)return c;return function(t,e,n,r,o){let i,s,a=0;do{s=e+(n-e)/2,i=yn(s,r,o)-t,i>0?n=s:e=s}while(Math.abs(i)>1e-7&&++a<10);return s}(e,i,i+.1,r,o)}(e,t,s),r,i)}function yn(t,e,n){return((vn(e,n)*t+_n(e,n))*t+bn(e))*t}function vn(t,e){return 1-3*e+3*t}function _n(t,e){return 3*e-6*t}function bn(t){return 3*t}function gn(t,e,n){return 3*vn(e,n)*t*t+2*_n(e,n)*t+bn(e)}function mn(t){const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375}function wn(t,e){switch(e){case hn.easeInSine:return n=t,1-Math.cos(n*Math.PI/2);case hn.easeOutSine:return function(t){return Math.sin(t*Math.PI/2)}(t);case hn.easeInOutSine:return function(t){return-(Math.cos(Math.PI*t)-1)/2}(t);case hn.easeInQuad:return function(t){return Math.pow(t,2)}(t);case hn.easeOutQuad:return function(t){return 1-Math.pow(1-t,2)}(t);case hn.easeInOutQuad:return function(t){return t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2}(t);case hn.easeInCubic:return function(t){return Math.pow(t,3)}(t);case hn.easeOutCubic:return function(t){return 1-Math.pow(1-t,3)}(t);case hn.easeInOutCubic:return function(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}(t);case hn.easeInQuart:return function(t){return Math.pow(t,4)}(t);case hn.easeOutQuart:return function(t){return 1-Math.pow(1-t,4)}(t);case hn.easeInOutQuart:return function(t){return t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2}(t);case hn.easeInQuint:return function(t){return Math.pow(t,5)}(t);case hn.easeOutQuint:return function(t){return 1-Math.pow(1-t,5)}(t);case hn.easeInOutQuint:return function(t){return t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2}(t);case hn.easeInExpo:return function(t){return 0===t?0:Math.pow(2,10*t-10)}(t);case hn.easeOutExpo:return function(t){return 1===t?1:1-Math.pow(2,-10*t)}(t);case hn.easeInOutExpo:return function(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}(t);case hn.easeInCirc:return function(t){return 1-Math.sqrt(1-Math.pow(t,2))}(t);case hn.easeOutCirc:return function(t){return Math.sqrt(1-Math.pow(t-1,2))}(t);case hn.easeInOutCirc:return function(t){return t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2}(t);case hn.easeInBack:return function(t){return 2.70158*t*t*t-1.70158*t*t}(t);case hn.easeOutBack:return function(t){const e=1.70158;return 1+2.70158*Math.pow(t-1,3)+e*Math.pow(t-1,2)}(t);case hn.easeInOutBack:return function(t){const e=2.5949095;return t<.5?Math.pow(2*t,2)*(7.189819*t-e)/2:(Math.pow(2*t-2,2)*((e+1)*(2*t-2)+e)+2)/2}(t);case hn.easeInElastic:return function(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:-Math.pow(2,10*t-10)*Math.sin((10*t-10.75)*e)}(t);case hn.easeOutElastic:return function(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1}(t);case hn.easeInOutElastic:return function(t){const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1}(t);case hn.easeInBounce:return function(t){return 1-mn(1-t)}(t);case hn.easeOutBounce:return mn(t);case hn.easeInOutBounce:return function(t){return t<.5?(1-mn(1-2*t))/2:(1+mn(2*t-1))/2}(t);default:return t}var n}function On(t){return(On="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function kn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Pn(Object(n),!0).forEach((function(e){Dn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Pn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function jn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function En(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Sn(t,e){return(Sn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function xn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Cn(t);if(e){var o=Cn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Tn(this,n)}}function Tn(t,e){return!e||"object"!==On(e)&&"function"!=typeof e?Rn(t):e}function Rn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ln(t,e,n){return(Ln="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Cn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Cn(t){return(Cn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Dn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}!function(t){t.easeInSine="easeInSine",t.easeOutSine="easeOutSine",t.easeInOutSine="easeInOutSine",t.easeInQuad="easeInQuad",t.easeOutQuad="easeOutQuad",t.easeInOutQuad="easeInOutQuad",t.easeInCubic="easeInCubic",t.easeOutCubic="easeOutCubic",t.easeInOutCubic="easeInOutCubic",t.easeInQuart="easeInQuart",t.easeOutQuart="easeOutQuart",t.easeInOutQuart="easeInOutQuart",t.easeInQuint="easeInQuint",t.easeOutQuint="easeOutQuint",t.easeInOutQuint="easeInOutQuint",t.easeInExpo="easeInExpo",t.easeOutExpo="easeOutExpo",t.easeInOutExpo="easeInOutExpo",t.easeInCirc="easeInCirc",t.easeOutCirc="easeOutCirc",t.easeInOutCirc="easeInOutCirc",t.easeInBack="easeInBack",t.easeOutBack="easeOutBack",t.easeInOutBack="easeInOutBack",t.easeInElastic="easeInElastic",t.easeOutElastic="easeOutElastic",t.easeInOutElastic="easeInOutElastic",t.easeInBounce="easeInBounce",t.easeOutBounce="easeOutBounce",t.easeInOutBounce="easeInOutBounce"}(hn||(hn={}));var Mn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Sn(t,e)}(i,t);var e,n,r,o=xn(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return jn(this,i),Dn(Rn(e=o.call(this,t,!1)),"_progress",void 0),Dn(Rn(e),"_easing",void 0),Dn(Rn(e),"_nestedTimelines",void 0),e._progress=0,e._easing=0,e._nestedTimelines=[],n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return kn(kn({},Ln(Cn(i.prototype),"_getDefaultProp",this).call(this)),{},{easing:this._app.prop.easing,scope:[0,1],useNestedEasingProgress:!1})}},{key:"progress",get:function(){return this._progress},set:function(t){this._progress=t,this._handleProgress()}},{key:"easing",get:function(){return this._easing}},{key:"addNestedTimeline",value:function(t){this._nestedTimelines.push(t)}},{key:"_handleProgress",value:function(){this._easing=function(t,e=!1){return e?Array.isArray(e)?dn(t,e):"function"==typeof e?e(t):wn(t,e):t}(this._progress,this.prop.easing),this._callbacks.tbt("progress",{progress:this._progress,easing:this._easing}),this._renderNestedTimelines()}},{key:"_renderNestedTimelines",value:function(){var t=this._nestedTimelines.length;if(0!==t)for(var e=this.prop.useNestedEasingProgress?this.easing:this.progress,n=0,r=t;n<r;n+=1){var o=this._nestedTimelines[n],i=K(G(e,o.prop.nestedScope),[0,1]);o.progress=i}}},{key:"_destroy",value:function(){Ln(Cn(i.prototype),"_destroy",this).call(this),this._nestedTimelines.forEach((function(t){t.destroy()}))}}])&&En(e.prototype,n),r&&En(e,r),i}(q);function Wn(t){return(Wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Bn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function In(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Bn(Object(n),!0).forEach((function(e){Un(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Bn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Fn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function An(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Hn(t,e){return(Hn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function zn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Qn(t);if(e){var o=Qn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Nn(this,n)}}function Nn(t,e){return!e||"object"!==Wn(e)&&"function"!=typeof e?Vn(t):e}function Vn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Xn(t,e,n){return(Xn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Qn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Qn(t){return(Qn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Un(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Yn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Hn(t,e)}(i,t);var e,n,r,o=zn(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Fn(this,i),Un(Vn(e=o.call(this,t,!1)),"_isPlaying",void 0),Un(Vn(e),"_isReversed",void 0),Un(Vn(e),"_isPaused",void 0),Un(Vn(e),"_animationFrame",void 0),Un(Vn(e),"_animationFrameLastTime",void 0),e._isPlaying=!1,e._isReversed=!1,e._isPaused=!1,e._animationFrame=void 0,e._animationFrameLastTime=0,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return In(In({},Xn(Qn(i.prototype),"_getDefaultProp",this).call(this)),{},{duration:1e3,reset:!1,destroyOnEnd:!1})}},{key:"isPlaying",get:function(){return void 0!==this._animationFrame}},{key:"isReversed",get:function(){return this._isReversed}},{key:"isPaused",get:function(){return this._isPaused}},{key:"play",value:function(){this._destroyed||(this.prop.reset&&1===this.progress&&(this._progress=0),this._isReversed=!1,this._isPaused=!1,this.isPlaying||(this._animationFrameLastTime=+new Date,this._animate()))}},{key:"reverse",value:function(){this._destroyed||(this.prop.reset&&0===this.progress&&(this._progress=1),this._isReversed=!0,this._isPaused=!1,this.isPlaying||(this._animationFrameLastTime=+new Date,this._animate()))}},{key:"pause",value:function(){this._destroyed||(this._isPaused=!0,this._animationFrame&&window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}},{key:"_animate",value:function(){if(!this._isPaused){var t=this.isReversed,e=+new Date,n=Math.abs(this._animationFrameLastTime-e);this._animationFrameLastTime=e;var r=n/this.prop.duration/(t?-1:1),o=K(this.progress+r,[0,1]);if(this.progress=o,1===o&&!t||0===o&&t)return this._isReversed=!1,this._isPaused=!1,void(this._animationFrame=void 0);this._animationFrame=window.requestAnimationFrame(this._animate.bind(this))}}},{key:"_handleProgress",value:function(){Xn(Qn(i.prototype),"_handleProgress",this).call(this);var t=this._progress;0===t?this.callbacks.tbt("start",!1):1===t&&(this.callbacks.tbt("end",!1),this.prop.destroyOnEnd&&this.destroy())}},{key:"_destroy",value:function(){this.pause(),Xn(Qn(i.prototype),"_destroy",this).call(this)}}])&&An(e.prototype,n),r&&An(e,r),i}(Mn);function $n(t){return($n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Kn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?qn(Object(n),!0).forEach((function(e){ir(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Jn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Zn(t,e){return(Zn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function tr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=or(t);if(e){var o=or(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return er(this,n)}}function er(t,e){return!e||"object"!==$n(e)&&"function"!=typeof e?nr(t):e}function nr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function rr(t,e,n){return(rr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=or(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function or(t){return(or=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ir(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var sr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Zn(t,e)}(i,t);var e,n,r,o=tr(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Jn(this,i),ir(nr(e=o.call(this,t,!1)),"_container",void 0),ir(nr(e),"_startTime",void 0),ir(nr(e),"_endTime",void 0),ir(nr(e),"_toBeHidden",void 0),ir(nr(e),"_isHidden",void 0),ir(nr(e),"_pageLoadEvent",void 0),e.prop.container){var r=y(e.prop.container);r instanceof HTMLElement&&(e._container=r)}return e._container&&e._container.classList.add(e.prefix),e._startTime=+new Date,e._endTime=1/0,e._toBeHidden=!1,e._isHidden=!1,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Kn(Kn({},rr(or(i.prototype),"_getDefaultProp",this).call(this)),{},{container:"#".concat(this.prefix),hide:250})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"preloader")}},{key:"container",get:function(){return this._container}},{key:"startTime",get:function(){return this._startTime}},{key:"endTime",get:function(){return this._endTime}},{key:"totalTime",get:function(){return this._endTime-this._startTime}},{key:"isHidden",get:function(){return this._isHidden}},{key:"_setEvents",value:function(){var t=this;rr(or(i.prototype),"_setEvents",this).call(this),this._onLoaded().then((function(){t._endTime=+new Date,t._handleLoaded()}))}},{key:"_onLoaded",value:function(){var t=this;return new se((function(e){t._app.pageLoad.loaded?e():t._pageLoadEvent=t._app.pageLoad.add("",(function(){e()}))}))}},{key:"_handleLoaded",value:function(){this.callbacks.tbt("loaded",!1),"boolean"!=typeof this.prop.hide&&this.hideContainer()}},{key:"hideContainer",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"boolean"!=typeof this.prop.hide?this.prop.hide:250;return this.callbacks.tbt("hide",!1),this._toBeHidden=!0,new se((function(n){var r=t._container;if(!r)return t._handleHidden(),void n();r.style.transition="opacity ".concat(e,"ms, visibility ").concat(e,"ms"),r.style.opacity="0",r.style.visibility="hidden",l((function(){r.style.display="none",t._handleHidden(),n()}),e)}))}},{key:"_handleHidden",value:function(){this._isHidden=!0,this.callbacks.tbt("hidden",!1)}},{key:"onHide",value:function(t){if(!this._toBeHidden)return this.callbacks.add("hide",(function(){t()}));t()}},{key:"onHidden",value:function(t){if(!this._isHidden)return this.callbacks.add("hidden",(function(){t()}));t()}},{key:"_destroy",value:function(){var t;rr(or(i.prototype),"_destroy",this).call(this),null===(t=this._pageLoadEvent)||void 0===t||t.remove()}}])&&Gn(e.prototype,n),r&&Gn(e,r),i}(q);function ar(t){return(ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function cr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ur(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?cr(Object(n),!0).forEach((function(e){br(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):cr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function lr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function hr(t,e){return(hr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function pr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=_r(t);if(e){var o=_r(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return dr(this,n)}}function dr(t,e){return!e||"object"!==ar(e)&&"function"!=typeof e?yr(t):e}function yr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function vr(t,e,n){return(vr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_r(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function _r(t){return(_r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function br(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var gr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&hr(t,e)}(i,t);var e,n,r,o=pr(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return lr(this,i),br(yr(e=o.call(this,t,!1)),"_imgs",void 0),br(yr(e),"_videos",void 0),br(yr(e),"_customResources",void 0),br(yr(e),"_resourcesTotal",void 0),br(yr(e),"_resourcesLoaded",void 0),br(yr(e),"_progress",void 0),br(yr(e),"_animationFrame",void 0),br(yr(e),"_endTimeline",void 0),e._imgs=[],e._videos=[],e._customResources=[],e._resourcesTotal=1+e.prop.resources,e._resourcesLoaded=0,e._progress=0,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return ur(ur({},vr(_r(i.prototype),"_getDefaultProp",this).call(this)),{},{resources:0,loaders:{img:!0,video:!0,custom:".js-preload"},calc:{lerp:.1,forceEnd:500}})}},{key:"imgs",get:function(){return this._imgs}},{key:"videos",get:function(){return this._videos}},{key:"customResources",get:function(){return this._customResources}},{key:"resourcesTotal",get:function(){return this._resourcesTotal}},{key:"resourcesLoaded",get:function(){return this._resourcesLoaded}},{key:"loadProgress",get:function(){return this.resourcesLoaded/this.resourcesTotal}},{key:"progress",get:function(){return this._progress},set:function(t){this._progress=t,this._handleProgress()}},{key:"_constructor",value:function(){vr(_r(i.prototype),"_constructor",this).call(this),this._getResources()}},{key:"_setEvents",value:function(){var t=this;vr(_r(i.prototype),"_setEvents",this).call(this);var e=this.prop.calc.lerp;"number"==typeof e&&(this._animationFrame=new ht,this._animationFrame.addCallback("frame",(function(){t.progress=J(t.progress,t.loadProgress,e)})),this._animationFrame.play()),this._preloadResources(),this._app.onPageLoaded().then((function(){t._handleLoadedResource()}))}},{key:"_onLoaded",value:function(){var t=this;return new se((function(e){var n=!1;t.callbacks.add("progress",(function(t){t.progress>=1&&!n&&(e(),n=!0)}),{protected:!0})}))}},{key:"_getResources",value:function(){var t=this,e=this.prop.loaders;e.img&&v("img").forEach((function(e){t._imgs.push(e),t._resourcesTotal+=1})),e.video&&v("video").forEach((function(e){t._videos.push(e),t._resourcesTotal+=1})),e.custom&&(this._customResources=Array.from(v(e.custom)),this._resourcesTotal+=this._customResources.length)}},{key:"_preloadResources",value:function(){var t=this;0===this._resourcesTotal&&(this._resourcesTotal=1,this._handleLoadedResource()),this._imgs.forEach((function(e){if(e.complete)t._handleLoadedResource();else{var n=new Image;e.addEventListener("load",(function(){t._handleLoadedResource()})),e.addEventListener("error",(function(){t._handleLoadedResource()})),n.src=e.src}})),this._videos.forEach((function(e){if(e.readyState>0)t._handleLoadedResource();else{if("none"===e.preload)return void t._handleLoadedResource();e.addEventListener("error",(function(){t._handleLoadedResource()})),e.addEventListener("loadedmetadata",(function(){t._handleLoadedResource()}))}})),this._customResources.forEach((function(e){t._seekCustomResourceLoaded(e).then((function(){t._handleLoadedResource()}))}))}},{key:"_seekCustomResourceLoaded",value:function(t){var e=this;return new Promise((function(n){t.isComplete||t.isLoaded||t.getAttribute("data-is-loaded")||t.getAttribute("is-loaded")?n():setTimeout((function(){e.destroyed||e._seekCustomResourceLoaded(t).then((function(){n()}))}),50)}))}},{key:"addResourcesLoaded",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=0;e<t;e+=1)this._handleLoadedResource()}},{key:"addResourcesTotal",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this._resourcesTotal+=t}},{key:"_handleLoadedResource",value:function(){this.loadProgress>=1||(this._resourcesLoaded+=1,this.callbacks.tbt("resourceLoad",!1),this._animationFrame||(this.progress=this.loadProgress))}},{key:"_handleProgress",value:function(){var t=this;if(this.callbacks.tbt("progress",{progress:this._progress}),this.progress>=1)this._animationFrame&&(this._animationFrame.destroy(),this._animationFrame=void 0);else if("number"==typeof this.prop.calc.forceEnd&&this.loadProgress>=1&&!this._endTimeline){this._animationFrame&&(this._animationFrame.destroy(),this._animationFrame=void 0),this._endTimeline=new Yn({duration:this.prop.calc.forceEnd});var e=this.progress;this._endTimeline.addCallback("progress",(function(n){var r=1-e;t.progress=e+r*n.progress})),this._endTimeline.play()}}},{key:"_destroy",value:function(){vr(_r(i.prototype),"_destroy",this).call(this),this._animationFrame&&this._animationFrame.destroy()}}])&&fr(e.prototype,n),r&&fr(e,r),i}(sr);function mr(t){return(mr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function wr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Or(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?wr(Object(n),!0).forEach((function(e){Lr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Pr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function jr(t,e){return(jr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Er(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Rr(t);if(e){var o=Rr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Sr(this,n)}}function Sr(t,e){return!e||"object"!==mr(e)&&"function"!=typeof e?xr(t):e}function xr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Tr(t,e,n){return(Tr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Rr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Rr(t){return(Rr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Lr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Cr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&jr(t,e)}(i,t);var e,n,r,o=Er(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Pr(this,i),Lr(xr(e=o.call(this,t,!1)),"_container",void 0),Lr(xr(e),"_runtimeEvents",void 0),Lr(xr(e),"_isDragging",void 0),Lr(xr(e),"_pointerID",void 0),Lr(xr(e),"_coords",void 0),Lr(xr(e),"_prevCoords",void 0),Lr(xr(e),"_startCoords",void 0),e._container=y(e.prop.container),!p(e._container)&&!d(e._container))throw new Error("No container");return e._runtimeEvents=[],e._isDragging=!1,e._pointerID=null,e._coords={x:0,y:0},e._prevCoords={x:0,y:0},e._startCoords={x:0,y:0},n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Or(Or({},Tr(Rr(i.prototype),"_getDefaultProp",this).call(this)),{},{container:"#".concat(this.prefix),usePassive:!1,enabled:!0})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"dragger")}},{key:"container",get:function(){return this._container}},{key:"isDragging",get:function(){return this._isDragging}},{key:"coords",get:function(){return this._coords}},{key:"startCoords",get:function(){return this._startCoords}},{key:"_setEvents",value:function(){var t=this.container,e=this.prop.usePassive;this.addEventListeners(t,"mousedown",this._handleStart.bind(this),{passive:e}),this.addEventListeners(t,"touchstart",this._handleStart.bind(this),{passive:e})}},{key:"_addRuntimeEvents",value:function(){var t=this.prop.usePassive;this._runtimeEvents.push(m(window,"mouseup",this._handleEnd.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"touchend",this._handleEnd.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"touchcancel",this.cancel.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"blur",this.cancel.bind(this),{passive:t}))}},{key:"_removeRuntimeEvents",value:function(){this._runtimeEvents.forEach((function(t){t.remove()})),this._runtimeEvents=[]}},{key:"_normalizeEvent",value:function(t){if(t.type.includes("touch")){var e=t,n=e.targetTouches[0]||e.changedTouches[0];return{x:n.clientX,y:n.clientY,id:n.identifier}}var r=t;return{x:r.clientX,y:r.clientY,id:null}}},{key:"_handleStart",value:function(t){if(!this.prop.enabled)return!1;if(this.isDragging)return!1;var e=this._normalizeEvent(t);if("mousedown"===t.type){if(1!==t.which)return!1;t.stopPropagation()}return this._isDragging=!0,this._pointerID=e.id,this._coords={x:e.x,y:e.y},this._prevCoords={x:e.x,y:e.y},this._startCoords={x:e.x,y:e.y},this._addRuntimeEvents(),this.callbacks.tbt("start",{evt:t}),!0}},{key:"_handleEnd",value:function(t){var e=this._normalizeEvent(t);return!(!this.isDragging||e.id!==this._pointerID||(this.cancel(),0))}},{key:"cancel",value:function(){this._removeRuntimeEvents(),this._isDragging=!1,this.callbacks.tbt("end",!1)}},{key:"_destroy",value:function(){Tr(Rr(i.prototype),"_destroy",this).call(this),this._removeRuntimeEvents()}}])&&kr(e.prototype,n),r&&kr(e,r),i}(q);function Dr(t){return(Dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Br(t,e,n){return(Br="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Hr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Ir(t,e){return(Ir=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Fr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Hr(t);if(e){var o=Hr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ar(this,n)}}function Ar(t,e){return!e||"object"!==Dr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Hr(t){return(Hr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var zr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ir(t,e)}(i,t);var e,n,r,o=Fr(i);function i(){return Mr(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"stepCoords",get:function(){return{x:this._coords.x-this._prevCoords.x,y:this._coords.y-this._prevCoords.y}}},{key:"_addRuntimeEvents",value:function(){Br(Hr(i.prototype),"_addRuntimeEvents",this).call(this);var t=this.prop.usePassive;this._runtimeEvents.push(m(window,"mousemove",this._handleMove.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"touchmove",this._handleMove.bind(this),{passive:t}))}},{key:"_handleMove",value:function(t){var e=this._normalizeEvent(t);return!(!this.isDragging||e.id!==this._pointerID||(this._prevCoords={x:this._coords.x,y:this._coords.y},this._coords={x:e.x,y:e.y},this.callbacks.tbt("move",{evt:t,start:this.startCoords,coords:this.coords,step:this.stepCoords}),0))}},{key:"_destroy",value:function(){Br(Hr(i.prototype),"_destroy",this).call(this)}}])&&Wr(e.prototype,n),r&&Wr(e,r),i}(Cr);function Nr(t){return(Nr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Vr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Xr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Vr(Object(n),!0).forEach((function(e){Qr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Vr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Qr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ur(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function $r(t,e,n){return($r="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Gr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function qr(t,e){return(qr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Kr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Gr(t);if(e){var o=Gr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Jr(this,n)}}function Jr(t,e){return!e||"object"!==Nr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Gr(t){return(Gr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Zr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&qr(t,e)}(i,t);var e,n,r,o=Kr(i);function i(){return Ur(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Xr(Xr({},$r(Gr(i.prototype),"_getDefaultProp",this).call(this)),{},{min:75})}},{key:"_handleEnd",value:function(t){var e=$r(Gr(i.prototype),"_handleEnd",this).call(this,t);if(!e)return e;var n=this._normalizeEvent(t),r=this.startCoords,o=Math.abs(this.prop.min);return r.y>n.y&&Math.abs(n.y-r.y)>=o&&this.callbacks.tbt("up",!1),r.y<n.y&&Math.abs(n.y-r.y)>=o&&this.callbacks.tbt("down",!1),r.x>n.x&&Math.abs(n.x-r.x)>=o&&this.callbacks.tbt("left",!1),r.x<n.x&&Math.abs(n.x-r.x)>=o&&this.callbacks.tbt("right",!1),!0}}])&&Yr(e.prototype,n),r&&Yr(e,r),i}(Cr);function to(t){return(to="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function eo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function no(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?eo(Object(n),!0).forEach((function(e){fo(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):eo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ro(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function oo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function io(t,e,n){return(io="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=lo(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function so(t,e){return(so=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ao(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=lo(t);if(e){var o=lo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return co(this,n)}}function co(t,e){return!e||"object"!==to(e)&&"function"!=typeof e?uo(t):e}function uo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function lo(t){return(lo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function fo(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ho=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&so(t,e)}(i,t);var e,n,r,o=ao(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];ro(this,i),fo(uo(e=o.call(this,t,!1)),"_canvas",void 0),fo(uo(e),"_ctx",void 0),fo(uo(e),"_width",void 0),fo(uo(e),"_height",void 0),fo(uo(e),"_dpr",void 0),e._width=0,e._height=0,e._dpr=1;var r=e.prop,s=r.append,a=r.container,c=s&&a?a:void 0;return e._canvas=b("canvas",{parent:c}),e._ctx=e._canvas.getContext("2d"),e.resize(),n&&e.init(),e}return e=i,(n=[{key:"container",get:function(){return this.prop.container}},{key:"canvas",get:function(){return this._canvas}},{key:"ctx",get:function(){return this._ctx}},{key:"width",get:function(){return this._width}},{key:"nonDPRWidth",get:function(){return this.width/this.dpr}},{key:"height",get:function(){return this._height}},{key:"nonDPRHeight",get:function(){return this.height/this.dpr}},{key:"dpr",get:function(){return this._dpr}},{key:"_getDefaultProp",value:function(){return no(no({},io(lo(i.prototype),"_getDefaultProp",this).call(this)),{},{container:!1,append:!0,updateOnResize:!1,width:!1,height:!1,dpr:!1})}},{key:"_setEvents",value:function(){var t=this;if(io(lo(i.prototype),"_setEvents",this).call(this),!1!==this.prop.updateOnResize){var e="boolean"==typeof this.prop.updateOnResize?"":this.prop.updateOnResize;this.addViewportCallback(e,(function(){t.resize()})),this.resize()}}},{key:"_onPropMutate",value:function(){io(lo(i.prototype),"_onPropMutate",this).call(this),this.resize()}},{key:"resize",value:function(){var t=this.prop,e=this.canvas;if(e){var n=this._app.viewport;"number"==typeof t.dpr?this._dpr=t.dpr:this._dpr=n.dpr;var r=this._dpr,o=0,i=0;"number"==typeof t.width&&"number"==typeof t.height?(o=t.width,i=t.height):this.container?(o=this.container.clientWidth,i=this.container.clientHeight):(o=n.width,i=n.height),o*=r,i*=r,this._width=o,this._height=i,e.width=o,e.height=i,this.callbacks.tbt("resize",!1)}}},{key:"_destroy",value:function(){io(lo(i.prototype),"_destroy",this).call(this),this.canvas&&this.canvas.remove()}}])&&oo(e.prototype,n),r&&oo(e,r),i}(q);function po(t){const e=function(t){if("container"in t)return{width:t.container.clientWidth,height:t.container.clientHeight};return{width:t.width,height:t.height}}(t),n=function(t){const{source:e}=t;if(e instanceof HTMLVideoElement)return{width:e.videoWidth,height:e.videoHeight};return{width:e.width,height:e.height}}(t);let r;return"cover"===t.rule?r=function(t,e,n){let r=e.width*yo(t),o=n.height*r/n.width;o/yo(t)<e.height&&(o=e.height*yo(t),r=n.width*o/n.height);const i=(e.width-r)/2,s=(e.height-o)/2;return{width:r,height:o,x:i,y:s}}(t,e,n):"contain"===t.rule?r=function(t,e,n){let r=0,o=0;const i=n.width/n.height;e.width>e.height?(o=e.height,r=o*i,r>e.width&&(r=e.width,o=r/i)):e.height>=e.width&&(r=e.width,o=r/i,o>e.height&&(o=e.height,r=o*i));r*=yo(t),o*=yo(t);const s=(e.width-r)/2,a=(e.height-o)/2;return{width:r,height:o,x:s,y:a}}(t,e,n):"top-left"===t.rule?r=function(t,e){const n=e.width*yo(t),r=e.height*yo(t);return{width:n,height:r,x:0,y:0}}(t,n):"top-right"===t.rule?r=function(t,e,n){const r=n.width*yo(t),o=n.height*yo(t),i=e.width-n.width;return{width:r,height:o,x:i,y:0}}(t,e,n):"bottom-left"===t.rule?r=function(t,e,n){const r=n.width*yo(t),o=n.height*yo(t),i=e.height-n.height;return{width:r,height:o,x:0,y:i}}(t,e,n):"bottom-right"===t.rule?r=function(t,e,n){const r=n.width*yo(t),o=n.height*yo(t),i=e.width-n.width,s=e.height-n.height;return{width:r,height:o,x:i,y:s}}(t,e,n):"center"===t.rule&&(r=function(t,e,n){const r=n.width*yo(t),o=n.height*yo(t),i=(e.width-n.width)/2,s=(e.height-n.height)/2;return{width:r,height:o,x:i,y:s}}(t,e,n)),Object.assign(r,{sourceWidth:n.width,sourceHeight:n.height})}function yo(t){return void 0!==t.scale?t.scale:1}function vo(t){return(vo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function bo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_o(Object(n),!0).forEach((function(e){go(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function go(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Oo(t,e,n){return(Oo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Eo(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Po(t,e){return(Po=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ko(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Eo(t);if(e){var o=Eo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return jo(this,n)}}function jo(t,e){return!e||"object"!==vo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Eo(t){return(Eo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var So=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Po(t,e)}(i,t);var e,n,r,o=ko(i);function i(){return mo(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"_getDefaultProp",value:function(){return bo(bo({},Oo(Eo(i.prototype),"_getDefaultProp",this).call(this)),{},{media:!1,posRule:"cover"})}},{key:"resize",value:function(){Oo(Eo(i.prototype),"resize",this).call(this),this._prerender()}},{key:"_prerender",value:function(){if(0!==this.width&&0!==this.height){var t=this.prop.media;if(t){var e=po({source:t,rule:this.prop.posRule,scale:1,width:this.width,height:this.height});this._ctx.clearRect(0,0,this.width,this.height),this._ctx.drawImage(t,0,0,e.sourceWidth,e.sourceHeight,e.x,e.y,e.width,e.height),this.callbacks.tbt("prerender",!1)}}}}])&&wo(e.prototype,n),r&&wo(e,r),i}(ho);function xo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function To(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ro=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),To(this,"_prop",void 0),To(this,"_outer",void 0),To(this,"_thumb",void 0),To(this,"_outerHeight",void 0),To(this,"_outerWidth",void 0),To(this,"_thumbHeight",void 0),To(this,"_thumbWidth",void 0),To(this,"_scrollVal",void 0),To(this,"_coordsAtDragStart",void 0),To(this,"_listeners",void 0),To(this,"_scrollEvent",void 0),To(this,"_actionTimeout",void 0),To(this,"_dragger",void 0),this._prop=e;var n=e.prefix,r=e.dir,o=e.domParent,i=e.container,s=e.autoHide;this._outerHeight=0,this._outerWidth=0,this._thumbHeight=0,this._thumbWidth=0,this._scrollVal=0,this._coordsAtDragStart={left:0,top:0},this._scrollEvent=void 0,this._actionTimeout=void 0,this._dragger=void 0;var a="".concat(n," ").concat(n,"_").concat(r);i instanceof Window&&(a+=" in-window"),this._outer=b("div",{parent:o,class:a}),this._thumb=b("div",{parent:this._outer,class:"".concat(n,"__thumb ").concat(n,"__thumb_").concat(r)}),s&&this.outer.classList.add("auto-hide"),this._listeners=[],this._setEvents()}var e,n,r;return e=t,(n=[{key:"outer",get:function(){return this._outer}},{key:"thumb",get:function(){return this._thumb}},{key:"prefix",get:function(){return this._prop.prefix}},{key:"isX",get:function(){return"x"===this.prop.dir}},{key:"isY",get:function(){return!this.isX}},{key:"scrollElement",get:function(){return this.prop.container instanceof Window?document.documentElement:this.prop.container}},{key:"scrollLine",get:function(){var t=this.scrollElement;return this.isX?t.scrollWidth-t.clientWidth:t.scrollHeight-t.clientHeight}},{key:"scrollWidth",get:function(){return this.scrollElement.scrollWidth}},{key:"scrollHeight",get:function(){return this.scrollElement.scrollHeight}},{key:"prop",get:function(){return this._prop}},{key:"scrollValues",get:function(){var t=this.prop.container,e=0,n=0;return t instanceof Window?(e=t.pageYOffset,n=t.pageXOffset):t instanceof jt?(e=t.targetTop,n=t.targetLeft):(e=t.scrollTop,n=t.scrollLeft),{left:n,top:e}}},{key:"_setEvents",value:function(){var t=this;this._listeners.push(m(this.outer,"mouseenter",this._handleHover.bind(this,!0))),this._listeners.push(m(this.outer,"mouseleave",this._handleHover.bind(this,!1))),this._scrollEvent=Et(this.prop.container,(function(e){t._handleScroll(e)})),this.prop.isDraggable&&(this._dragger=new zr({container:this.thumb}),this._dragger.addCallback("start",(function(){t.thumb.classList.add("in-action"),t._disableScrollBehaviour(!0),t._coordsAtDragStart=t.scrollValues})),this._dragger.addCallback("move",(function(e){t._handleThumbDrag(e)})),this._dragger.addCallback("end",(function(){t.thumb.classList.remove("in-action"),t._disableScrollBehaviour(!1)})))}},{key:"_disableScrollBehaviour",value:function(t){var e=t?"auto":"unset";(this.prop.container instanceof Window||this.prop.container instanceof HTMLElement)&&(document.documentElement.style.scrollBehavior=e)}},{key:"_handleHover",value:function(t){this.outer.classList.toggle("is-hovered",t)}},{key:"_handleScroll",value:function(t){var e=this;this.prop.optimizeCalculations||this.resize();var n=!1;this.isX?(n=t.scrollLeft!==this._scrollVal,this._scrollVal=t.scrollLeft):(n=t.scrollTop!==this._scrollVal,this._scrollVal=t.scrollTop),n&&(this.prop.autoHide&&n&&(this.outer.classList.add("in-action"),this._actionTimeout&&(clearTimeout(this._actionTimeout),this._actionTimeout=void 0),this._actionTimeout=setTimeout((function(){e.outer.classList.remove("in-action")}),500)),this.prop.optimizeCalculations&&this._renderThumb())}},{key:"_handleThumbDrag",value:function(t){t.evt.preventDefault();var e=this.prop.container,n=(t.coords.x-t.start.x)/(this._outerWidth-this._thumbWidth)*this.scrollLine,r=(t.coords.y-t.start.y)/(this._outerHeight-this._thumbHeight)*this.scrollLine,o=this._coordsAtDragStart,i=o.left,s=o.top;this.isX?i+=n:s+=r,e.scrollTo({top:s,left:i,behavior:e instanceof jt?this.prop.draggableScrollBehavior:"auto"})}},{key:"_renderThumb",value:function(){var t=K(this._scrollVal/this.scrollLine,[0,1]),e=this.isX?(this._outerWidth-this._thumbWidth)*t:0,n=this.isY?(this._outerHeight-this._thumbHeight)*t:0;this._thumb.style.transform="translate(".concat(e,"px, ").concat(n,"px)")}},{key:"resize",value:function(){var t=this.outer,e=this.thumb,n=this.scrollLine,r=this.prop.minSize;if(this._outerHeight=t.clientHeight,this._outerWidth=t.clientWidth,this.prop.autoSize)if(this.isX){var o=K(this._outerWidth/(this.scrollWidth/(this.scrollWidth-n)),[r,1/0]);e.style.width="".concat(o,"px")}else{var i=K(this._outerHeight/(this.scrollHeight/(this.scrollHeight-n)),[r,1/0]);e.style.height="".concat(i,"px")}this._thumbHeight=e.clientHeight,this._thumbWidth=e.clientWidth,t.classList.toggle("is-empty",0===n),this._renderThumb()}},{key:"destroy",value:function(){this._listeners.forEach((function(t){t.remove()})),this._scrollEvent&&this._scrollEvent.remove(),this._actionTimeout&&clearTimeout(this._actionTimeout),this._dragger&&this._dragger.destroy(),this._outer.remove()}}])&&xo(e.prototype,n),r&&xo(e,r),t}();function Lo(t){return(Lo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Co(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Do(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Co(Object(n),!0).forEach((function(e){No(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Co(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Mo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Bo(t,e){return(Bo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Io(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=zo(t);if(e){var o=zo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Fo(this,n)}}function Fo(t,e){return!e||"object"!==Lo(e)&&"function"!=typeof e?Ao(t):e}function Ao(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ho(t,e,n){return(Ho="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=zo(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function zo(t){return(zo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function No(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Vo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Bo(t,e)}(i,t);var e,n,r,o=Io(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Mo(this,i),No(Ao(e=o.call(this,t,!1)),"_container",void 0),No(Ao(e),"_scrollWrapper",void 0),No(Ao(e),"_xBar",void 0),No(Ao(e),"_yBar",void 0);var r=e.prop,s=r.autoHide,a=r.autoSize,c=r.minSize,u=r.optimizeCalculations,l=r.isDraggable,f=r.draggableScrollBehavior;if("string"==typeof e.prop.container){var h=y(e.prop.container);if(!h)throw new Error("No scroll container");e._container=h}else e._container=e.prop.container;if(e.container instanceof Element){var p=e.container.parentElement;p&&(e._scrollWrapper=b("div"),e._scrollWrapper.style.position="relative",e._scrollWrapper.style.display="inline-block",p.insertBefore(e._scrollWrapper,e.container),e._scrollWrapper.appendChild(e.container),e._scrollWrapper.classList.add("".concat(e.prefix,"-wrapper")))}var d={container:e.container,domParent:e.domParent,autoHide:s,autoSize:a,minSize:c,optimizeCalculations:u,prefix:e.prefix,isDraggable:l,draggableScrollBehavior:f};return e._xBar=new Ro(Do({dir:"x"},d)),e._yBar=new Ro(Do({dir:"y"},d)),e.scrollableElement.classList.add("".concat(e.prefix,"-parent")),n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Do(Do({},Ho(zo(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window,domParent:!1,draggable:!0,autoSize:!0,autoHide:!0,minSize:50,optimizeCalculations:!1,isDraggable:!0,draggableScrollBehavior:"smooth"})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"scrollbar")}},{key:"container",get:function(){return this._container}},{key:"scrollableElement",get:function(){var t=this.container;return t instanceof Window?this._app.body:t instanceof Element?t:t.outer}},{key:"domParent",get:function(){var t=this.prop.domParent,e=this.container;return t||(this._scrollWrapper?this._scrollWrapper:e instanceof Window?this._app.body:e instanceof Element?e:e.outer)}},{key:"_setEvents",value:function(){var t=this;Ho(zo(i.prototype),"_setEvents",this).call(this);var e=this.container;e instanceof jt?e.addCallback("resize",(function(){t.resize()}),{name:this.name}):this.addViewportCallback("",(function(){t.resize()})),this.resize()}},{key:"_onPropMutate",value:function(){Ho(zo(i.prototype),"_onPropMutate",this).call(this),this.resize()}},{key:"resize",value:function(){this._xBar.resize(),this._yBar.resize()}},{key:"_destroy",value:function(){if(Ho(zo(i.prototype),"_destroy",this).call(this),this._xBar.destroy(),this._yBar.destroy(),this._scrollWrapper&&this.container instanceof Element){var t=this._scrollWrapper.parentElement;t&&t.insertBefore(this.container,this._scrollWrapper),this._scrollWrapper.remove()}this.scrollableElement.classList.remove("".concat(this.prefix,"-parent"))}}])&&Wo(e.prototype,n),r&&Wo(e,r),i}(q);function Xo(t){return(Xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Uo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Qo(Object(n),!0).forEach((function(e){ei(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Qo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Yo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function qo(t,e){return(qo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ko(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ti(t);if(e){var o=ti(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Jo(this,n)}}function Jo(t,e){return!e||"object"!==Xo(e)&&"function"!=typeof e?Go(t):e}function Go(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Zo(t,e,n){return(Zo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ti(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function ti(t){return(ti=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ei(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ni=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&qo(t,e)}(i,t);var e,n,r,o=Ko(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Yo(this,i),ei(Go(e=o.call(this,t,!1)),"_scrollContainer",void 0),"string"==typeof e.prop.container?e._scrollContainer=y(e.prop.container):e._scrollContainer=e.prop.container,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Uo(Uo({},Zo(ti(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window})}},{key:"scrollContainer",get:function(){return this._scrollContainer}},{key:"scrollableElement",get:function(){return this._scrollContainer instanceof Window?this._app.html:this._scrollContainer}},{key:"domParent",get:function(){var t=this.scrollContainer;return t instanceof Window?this._app.body:t instanceof Element?t:t.outer}},{key:"intersectionRoot",get:function(){var t=this.scrollContainer;return t instanceof Window?null:t instanceof Element?t:t.outer}},{key:"scrollContainerBounding",get:function(){if(this.intersectionRoot){var t=this.intersectionRoot.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}return{top:0,left:0,width:this._app.viewport.width,height:this._app.viewport.height}}}])&&$o(e.prototype,n),r&&$o(e,r),i}(q);function ri(t){return(ri="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function oi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ii(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?oi(Object(n),!0).forEach((function(e){di(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):oi(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function si(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ai(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ci(t,e){return(ci=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ui(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=pi(t);if(e){var o=pi(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return li(this,n)}}function li(t,e){return!e||"object"!==ri(e)&&"function"!=typeof e?fi(t):e}function fi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function hi(t,e,n){return(hi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=pi(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function pi(t){return(pi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function di(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var yi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ci(t,e)}(i,t);var e,n,r,o=ui(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return si(this,i),di(fi(e=o.call(this,t,!1)),"_scrollEvent",void 0),di(fi(e),"_intersectionObserver",void 0),di(fi(e),"_firstStart",void 0),di(fi(e),"_elements",void 0),e._scrollEvent=void 0,e._intersectionObserver=void 0,e._firstStart=!0,e.updateElements(),n&&e.init(),e}return e=i,(n=[{key:"prefix",get:function(){return"".concat(this._app.prefix,"scroll-view")}},{key:"_getDefaultProp",value:function(){return ii(ii({},hi(pi(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window,elements:".".concat(this.prefix,"__el"),threshold:.9,states:"in",classToToggle:"viewed",useDelay:!1,useIntersectionObserver:!0})}},{key:"init",value:function(){hi(pi(i.prototype),"init",this).call(this),this.seekBounding()}},{key:"_setEvents",value:function(){var t=this;hi(pi(i.prototype),"_setEvents",this).call(this),this.resize(),this.addViewportCallback("",(function(){t.resize()}))}},{key:"_onPropMutate",value:function(){hi(pi(i.prototype),"_onPropMutate",this).call(this),this._removeViewEvents(),this.updateElements(),this._setViewEvents()}},{key:"resize",value:function(){this._removeViewEvents(),this._setViewEvents()}},{key:"_setViewEvents",value:function(){var t=this;if(St()&&this.prop.useIntersectionObserver){var e=this.scrollContainerBounding,n=this._firstStart?0:e.width*(1-this.prop.threshold)*-1,r=this._firstStart?0:e.height*(1-this.prop.threshold)*-1;this._intersectionObserver=new IntersectionObserver(this._handleIntersectionObserver.bind(this),{root:this.intersectionRoot,threshold:0,rootMargin:"0px ".concat(n,"px ").concat(r,"px 0px")}),this.elements&&this.elements.forEach((function(e){var n;null===(n=t._intersectionObserver)||void 0===n||n.observe(e)}))}else this._scrollEvent=Et(this.prop.container,this._handleScroll.bind(this))}},{key:"_removeViewEvents",value:function(){this._scrollEvent&&(this._scrollEvent.remove(),this._scrollEvent=void 0),this._intersectionObserver&&(this._intersectionObserver.disconnect(),this._intersectionObserver=void 0)}},{key:"elements",get:function(){return this._elements}},{key:"updateElements",value:function(){var t=this;void 0===this.elements&&(this._elements=[]),this.elements.forEach((function(e){t._intersectionObserver&&t._intersectionObserver.unobserve(e)})),this._elements=Array.from(v(this.prop.elements,this.domParent||void 0)).filter((function(e){return!e.classList.contains(t.prop.classToToggle)})),this._elements.forEach((function(e){t._intersectionObserver&&t._intersectionObserver.observe(e)}))}},{key:"_handleIntersectionObserver",value:function(t){for(var e=!!this._firstStart&&this.scrollContainerBounding,n=0;n<t.length;n+=1){var r=t[n],o=0;this._firstStart&&e&&r.isIntersecting&&(o=this._elementInViewportData(r.target,e).delay),this._handleInOut(r.target,r.isIntersecting,o)}this._processUnusedElements(),this._firstStart&&(this._firstStart=!1,this.resize())}},{key:"_handleScroll",value:function(){this.seekBounding()}},{key:"seekBounding",value:function(){if(!St()||!this.prop.useIntersectionObserver){for(var t=this.scrollContainerBounding,e=0;e<this.elements.length;e+=1){var n=this.elements[e],r=this._elementInViewportData(n,t),o=r.isIntersecting?r.delay:0;this._handleInOut(n,r.isIntersecting,o)}this._processUnusedElements(),this._firstStart&&(this._firstStart=!1)}}},{key:"_elementInViewportData",value:function(t,e){var n=this.prop,r=n.threshold,o=n.states,i=n.useDelay,s=this._firstStart?1:r,a=t.getBoundingClientRect(),c=!1;a.top<e.top+e.height*s&&a.left<e.left+e.width*s&&(c="in"===o||!(a.right<e.left*s||a.bottom<e.top*s));var u=0;return i&&this._firstStart&&(u=K("x"===i.dir?(a.left-e.left)/e.width:(a.top-e.top)/e.height,[0,1])*i.max),{isIntersecting:c,delay:u}}},{key:"_handleInOut",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=this.prop.states;t.scrollViewIn&&e||!t.scrollViewIn&&!e||(t.scrollViewIn=e,l((function(){t.classList.toggle(n.prop.classToToggle,e)}),r),!e||"in"!==o&&"inout"!==o?e||"inout"!==o||l((function(){n.callbacks.tbt("out",t)}),r):l((function(){n.callbacks.tbt("in",t)}),r))}},{key:"_processUnusedElements",value:function(){var t=this;"in"===this.prop.states&&(this._elements.filter((function(t){return t.scrollViewIn})).forEach((function(e){t._intersectionObserver&&t._intersectionObserver.unobserve(e)})),this._elements=this._elements.filter((function(t){return!t.scrollViewIn})))}},{key:"_destroy",value:function(){hi(pi(i.prototype),"_destroy",this).call(this),this._removeViewEvents()}}])&&ai(e.prototype,n),r&&ai(e,r),i}(ni);function vi(t){return(vi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function gi(t,e,n){return(gi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Pi(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function mi(t,e){return(mi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function wi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Pi(t);if(e){var o=Pi(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Oi(this,n)}}function Oi(t,e){return!e||"object"!==vi(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Pi(t){return(Pi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ki=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&mi(t,e)}(i,t);var e,n,r,o=wi(i);function i(){return _i(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"_setEvents",value:function(){var t=this;gi(Pi(i.prototype),"_setEvents",this).call(this),this.addEventListeners(window,"keydown",(function(e){t._handleKeydown(e)}))}},{key:"_handleKeydown",value:function(t){var e=this._component;if(e.prop.enabled)if(9!==t.keyCode){var n=document.activeElement;if(!n||!(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)){var r=this._app.viewport,o=e.outer.getBoundingClientRect();if(o.left<r.width&&o.right>0&&o.top<r.height&&o.bottom>0){var i=40;switch(t.keyCode){case 38:e.targetTop-=i;break;case 40:e.targetTop+=i;break;case 39:e.targetLeft+=i;break;case 37:e.targetLeft-=i;break;case 34:e.targetTop+=400;break;case 33:e.targetTop-=400;break;case 36:e.targetTop=0,e.targetLeft=0;break;case 35:e.targetTop=e.scrollHeight,e.targetLeft=e.scrollWidth;break;case 32:e.targetTop+=200}}}}else this._handleTab()}},{key:"_handleTab",value:function(){var t=this;l((function(){var e=t._component,n=document.activeElement;if(n instanceof HTMLElement&&f(n,e.outer)){var r=e.outer.getBoundingClientRect(),o=n.getBoundingClientRect(),i=e.scrollTop+(o.top-r.top)-(e.clientHeight/2-o.height/2),s=e.scrollLeft+(o.left-r.left)-(e.clientWidth/2-o.width/2);e.targetTop=i,e.targetLeft=s}}),120)}}])&&bi(e.prototype,n),r&&bi(e,r),i}(Ae);function ji(t){return(ji="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ei(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Si(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ei(Object(n),!0).forEach((function(e){Wi(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ei(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function xi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ti(t,e){return(Ti=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ri(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Mi(t);if(e){var o=Mi(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Li(this,n)}}function Li(t,e){return!e||"object"!==ji(e)&&"function"!=typeof e?Ci(t):e}function Ci(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Di(t,e,n){return(Di="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Mi(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Mi(t){return(Mi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Wi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Bi="is-dragging",Ii=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ti(t,e)}(i,t);var e,n,r,o=Ri(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),Wi(Ci(e=o.call(this,t)),"_dragger",void 0),Wi(Ci(e),"_componentEvents",void 0),Wi(Ci(e),"_currentLerp",void 0),e._dragger=void 0,e._componentEvents=[],e._currentLerp=!1,e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Si(Si({},Di(Mi(i.prototype),"_getDefaultProp",this).call(this)),{},{enabled:!0,speed:1,lerp:!1,reverseDir:!1,stopPropagation:!1})}},{key:"isDragging",get:function(){return!!this._dragger&&this._dragger.isDragging}},{key:"_constructor",value:function(){Di(Mi(i.prototype),"_constructor",this).call(this),this._toggleDragger()}},{key:"_onPropMutate",value:function(){Di(Mi(i.prototype),"_onPropMutate",this).call(this),this._toggleDragger()}},{key:"_toggleDragger",value:function(){this.prop.enabled?this._addDragger():this._removeDragger()}},{key:"_addDragger",value:function(){var t=this;if(!this._dragger){var e=this.component;this._dragger=new zr({container:e.outer}),this._dragger.addCallback("start",this._handleDragStart.bind(this)),this._dragger.addCallback("move",(function(e){t._handleDragMove(e)})),this._dragger.addCallback("end",this._handleDragEnd.bind(this)),this._componentEvents.push(e.addCallback("wheel",(function(){var e;null===(e=t._dragger)||void 0===e||e.cancel()})))}}},{key:"_removeDragger",value:function(){this._dragger&&(this._dragger.destroy(),this._dragger=void 0,this._componentEvents.forEach((function(t){t.remove()})),this._componentEvents=[])}},{key:"_handleDragStart",value:function(){var t=this.component;if(t.prop.enabled&&!(t.maxScrollableWidth<=0&&t.maxScrollableHeight<=0)){var e=this.prop.lerp;"boolean"!=typeof e&&(this._currentLerp=t.prop.render.lerp,t.changeProp({render:{lerp:e}})),this._callbacks.tbt("start",!1)}}},{key:"_handleDragMove",value:function(t){var e=this.component;if(e.prop.enabled&&!(e.maxScrollableWidth<=0&&e.maxScrollableHeight<=0)){var n=t.evt,r=this.prop.stopPropagation;if(r){if(!n.cancelable)return;var o=Math.abs(t.coords.x-t.start.x),i=Math.abs(t.coords.y-t.start.y);(o>r.threshold&&"x"===r.dir||i>r.threshold&&"y"===r.dir)&&n.cancelable&&(n.preventDefault(),n.stopPropagation())}var s=this.prop,a=s.speed,c=s.reverseDir,u=t.step.x*a,l=t.step.y*a;e.targetLeft-=c?l:u,e.targetTop-=c?u:l,e.outer.classList.add(Bi),e.container.classList.add(Bi),this._callbacks.tbt("move",!1)}}},{key:"_handleDragEnd",value:function(){var t=this.component;t.outer.classList.remove(Bi),t.container.classList.remove(Bi),"boolean"!=typeof this._currentLerp&&(t.changeProp({render:{lerp:this._currentLerp}}),this._currentLerp=!1),this._callbacks.tbt("end",!1)}},{key:"_destroy",value:function(){Di(Mi(i.prototype),"_destroy",this).call(this),this._removeDragger()}}])&&xi(e.prototype,n),r&&xi(e,r),i}(Ae);function Fi(t){return(Fi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ai(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Hi(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ai(Object(n),!0).forEach((function(e){qi(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ai(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function zi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ni(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Vi(t,e){return(Vi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Xi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=$i(t);if(e){var o=$i(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Qi(this,n)}}function Qi(t,e){return!e||"object"!==Fi(e)&&"function"!=typeof e?Ui(t):e}function Ui(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Yi(t,e,n){return(Yi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=$i(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function $i(t){return($i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function qi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ki=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Vi(t,e)}(i,t);var e,n,r,o=Xi(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(zi(this,i),qi(Ui(e=o.call(this,t,!1)),"_initText",void 0),qi(Ui(e),"_initHTML",void 0),qi(Ui(e),"_isPrimarySplit",void 0),qi(Ui(e),"_container",void 0),qi(Ui(e),"_letters",void 0),qi(Ui(e),"_words",void 0),qi(Ui(e),"_lines",void 0),e.prop.container){var r=y(e.prop.container);r instanceof HTMLElement&&(e._container=r)}return e._container&&e._container.classList.add(e.prefix),e._initHTML=e._container.innerHTML,e._initText=(e._container.innerText||"no rendered text").trim(),e._initText=e._initText.replace(/\s+\n/gm,"\n"),e._isPrimarySplit=!1,e._letters=[],e._words=[],e._lines=[],n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Hi(Hi({},Yi($i(i.prototype),"_getDefaultProp",this).call(this)),{},{container:"#".concat(this.prefix),appendLetters:!0,appendLines:!1})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"split-text")}},{key:"container",get:function(){return this._container}},{key:"letters",get:function(){return this._letters}},{key:"words",get:function(){return this._words}},{key:"lines",get:function(){return this._lines}},{key:"_setEvents",value:function(){var t=this;Yi($i(i.prototype),"_setEvents",this).call(this),this.splitText(),this.prop.appendLines&&this.addViewportCallback("",(function(){t.splitText()}))}},{key:"splitText",value:function(){this._isPrimarySplit||(this.container.innerHTML="",this._splitIntoWords(),this._splitIntoLetters(),this._appendWords(),this._isPrimarySplit=!0),this.prop.appendLines&&this._splitIntoLines(),this.callbacks.tbt("split",!1)}},{key:"_splitIntoWords",value:function(){var t=this,e=this._initText.split(""),n=0;e.forEach((function(e){var r=t._words[n]||{content:"",hasNewLine:!1,el:b("span",{class:"".concat(t.prefix,"__word")}),letters:[]};r.el.style.display="inline-block",t._words[n]=r;var o=e.charCodeAt(0),i=32===o||160===o,s=10===o;i&&(r.whitespace=document.createTextNode(" ")),s&&(r.br=b("br")),r.hasNewLine=s,i||s?n+=1:(r.content+=e,t.prop.appendLetters||(r.el.innerHTML=r.content))}))}},{key:"_appendWords",value:function(){var t=this;this._words.forEach((function(e){t.container.appendChild(e.el),e.whitespace&&t.container.appendChild(e.whitespace),e.br&&t.container.appendChild(e.br)}))}},{key:"_removeWords",value:function(){this._words.forEach((function(t){t.el.remove(),t.whitespace&&t.whitespace.remove(),t.br&&t.br.remove()}))}},{key:"_splitIntoLetters",value:function(){var t=this;this.prop.appendLetters&&(this._words.forEach((function(e){var n=e.content.split(""),r=[];n.forEach((function(n){var o={el:b("span",{class:"".concat(t.prefix,"__letter"),html:n}),content:n,word:e};o.el.style.display="inline-block",t._letters.push(o),r.push(o)})),e.letters=r})),this._letters.forEach((function(t){t.word.el.appendChild(t.el)})))}},{key:"_splitIntoLines",value:function(){var t=this;this._removeLines();var e=!1,n=1/0,r=!1;this.words.forEach((function(o){var i=!1,s=o.el.offsetTop;i=!(!r||!r.br)||s!==n,r=o,n=s,i&&((e={el:b("span",{class:"".concat(t.prefix,"__line")}),content:"",words:[]}).el.style.display="block",t._lines.push(e)),e&&e.words.push(o)})),this._lines.forEach((function(t){t.content=t.words.map((function(t){return t.content})).join(" ")})),this._lines.forEach((function(e){e.words.forEach((function(t){e.el.appendChild(t.el),t.br&&t.br.remove(),t.whitespace&&e.el.appendChild(t.whitespace)})),t.container.appendChild(e.el)}))}},{key:"_removeLines",value:function(){this._lines.forEach((function(t){t.el.remove()})),this._lines=[],this._appendWords()}},{key:"_destroy",value:function(){Yi($i(i.prototype),"_destroy",this).call(this),this._lines=[],this._words=[],this._letters=[],this._container.innerHTML=this._initHTML}}])&&Ni(e.prototype,n),r&&Ni(e,r),i}(q);function Ji(t){return(Ji="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Zi(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Gi(Object(n),!0).forEach((function(e){cs(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Gi(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ts(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function es(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ns(t,e){return(ns=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function rs(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=as(t);if(e){var o=as(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return os(this,n)}}function os(t,e){return!e||"object"!==Ji(e)&&"function"!=typeof e?is(t):e}function is(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ss(t,e,n){return(ss="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=as(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function as(t){return(as=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function cs(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var us=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ns(t,e)}(i,t);var e,n,r,o=rs(i);function i(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];ts(this,i),cs(is(e=o.call(this,t,!1)),"_container",void 0),cs(is(e),"_containerIsWindow",void 0),cs(is(e),"_outerCursor",void 0),cs(is(e),"_innerCursor",void 0),cs(is(e),"_animationFrame",void 0),cs(is(e),"_currentFPS",void 0),cs(is(e),"_canPlay",void 0),cs(is(e),"_x",void 0),cs(is(e),"_xTarget",void 0),cs(is(e),"_y",void 0),cs(is(e),"_yTarget",void 0);var r=y(e.prop.container);if(!r)throw new Error("No cursor container for ".concat(e.prop.container));return e._container=r,e._containerIsWindow=r instanceof Window,e._x=0,e._xTarget=0,e._y=0,e._yTarget=0,e._currentFPS=60,e._canPlay=e.prop.run,n&&e.init(),e}return e=i,(n=[{key:"_getDefaultProp",value:function(){return Zi(Zi({},ss(as(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window,run:!0,hideNativeCursor:!1,render:{lerp:.2,lerpToFixed:2,normalizeLerp:!1},autoStop:!0})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"custom-cursor")}},{key:"container",get:function(){return this._container}},{key:"eventsContainer",get:function(){return this._container}},{key:"domContainer",get:function(){return this.container instanceof Window?this._app.html:this.container}},{key:"outerCursor",get:function(){return this._outerCursor}},{key:"innerCursor",get:function(){return this._innerCursor}},{key:"x",get:function(){return this._x}},{key:"y",get:function(){return this._y}},{key:"_constructor",value:function(){ss(as(i.prototype),"_constructor",this).call(this),this._createCursor()}},{key:"_setEvents",value:function(){var t=this;ss(as(i.prototype),"_setEvents",this).call(this);var e=this.domContainer;this._animationFrame=new ht,this._animationFrame.addCallback("frame",(function(e){t._currentFPS=e.realFPS,t.render()})),this._canPlay&&this.enable(),this.addEventListeners(e,"mouseenter",this._handleMouseEnter.bind(this)),this.addEventListeners(e,"mouseleave",this._handleMouseLeave.bind(this)),this.addEventListeners(e,"mousemove",this._handleMouseMove.bind(this)),this.addEventListeners(e,"mousedown",this._handleMouseDown.bind(this)),this.addEventListeners(e,"mouseup",this._handleMouseUp.bind(this)),this.addEventListeners(window,"blur",this._handleWindowBlur.bind(this))}},{key:"_createCursor",value:function(){var t=this.prefix,e=this.container,n=this.domContainer;this.prop.hideNativeCursor&&(n.style.cursor="none",n.classList.add("hide-defaut-cursor")),n.classList.add("".concat(t,"-container")),this._outerCursor=b("div",{class:"".concat(t," ").concat(e instanceof Window?"in-window":"in-element"," disabled"),parent:n}),this._innerCursor=b("div",{class:"".concat(t,"__inner disabled"),parent:this._outerCursor}),this.callbacks.tbt("create",{outerCursor:this.outerCursor,innerCursor:this.innerCursor})}},{key:"_destroyCursor",value:function(){var t=this.prefix,e=this.domContainer;e.style.cursor="",e.classList.remove("hide-defaut-cursor"),e.classList.remove("".concat(t,"-container")),this._outerCursor.remove(),this._innerCursor.remove()}},{key:"_handleMouseEnter",value:function(t){this._xTarget=t.clientX,this._x=this._xTarget,this._yTarget=t.clientY,this._y=this._yTarget,this.outerCursor.classList.add("in-action")}},{key:"_handleMouseLeave",value:function(){this.outerCursor.classList.remove("in-action")}},{key:"_handleMouseMove",value:function(t){this._xTarget=t.clientX,this._yTarget=t.clientY,this.outerCursor.classList.add("in-action"),this._canPlay&&this._animationFrame.play()}},{key:"_handleMouseDown",value:function(t){1===t.which&&(this.outerCursor.classList.add("click"),this.innerCursor.classList.add("click"))}},{key:"_handleMouseUp",value:function(){this.outerCursor.classList.remove("click"),this.innerCursor.classList.remove("click")}},{key:"_handleWindowBlur",value:function(){this._handleMouseUp()}},{key:"render",value:function(){var t=this.prop,e=this.domContainer,n=t.render,r=n.normalizeLerp,o=n.lerp,i=n.lerpToFixed,s=r?60/this._currentFPS:1;if(this._x=J(this._x,this._xTarget,o*s,.02),this._y=J(this._y,this._yTarget,o*s,.02),"number"==typeof i){var a=Math.round(Math.abs(i));this._x=parseFloat(this._x.toFixed(a)),this._y=parseFloat(this._y.toFixed(a))}var c=this._x,u=this._y;if(!this._containerIsWindow){var l=e.getBoundingClientRect();c-=l.left,u-=l.top}this.outerCursor.style.transform="translate(".concat(c,"px, ").concat(u,"px)"),t.autoStop&&this._x===this._xTarget&&this._y===this._yTarget&&this._animationFrame.pause(),this._callbacks.tbt("render",{x:c,y:u})}},{key:"enable",value:function(){this._canPlay=!0,this._animationFrame.isPlaying||(this.outerCursor.classList.remove("disabled"),this.innerCursor.classList.remove("disabled"),this._animationFrame.play())}},{key:"disable",value:function(){this._canPlay=!1,this._animationFrame.isPlaying&&(this.outerCursor.classList.add("disabled"),this.innerCursor.classList.add("disabled"),this._animationFrame.pause())}},{key:"_destroy",value:function(){ss(as(i.prototype),"_destroy",this).call(this),this._destroyCursor(),this._animationFrame.destroy()}}])&&es(e.prototype,n),r&&es(e,r),i}(q),ls={common:t,listeners:r,math:e};window.Vevet=i})()})();
|
|
12
|
+
(()=>{var t={554:(t,e,r)=>{t=r.nmd(t);var n="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",s="[object Function]",c="[object Object]",a=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[i]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l[s]=l["[object Map]"]=l["[object Number]"]=l[c]=l["[object RegExp]"]=l["[object Set]"]=l["[object String]"]=l["[object WeakMap]"]=!1;var f="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,p="object"==typeof self&&self&&self.Object===Object&&self,h=f||p||Function("return this")(),d=e&&!e.nodeType&&e,y=d&&t&&!t.nodeType&&t,v=y&&y.exports===d,b=v&&f.process,_=function(){try{var t=y&&y.require&&y.require("util").types;return t||b&&b.binding&&b.binding("util")}catch(e){}}(),g=_&&_.isTypedArray;function m(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var w,O,P,k=Array.prototype,j=Function.prototype,E=Object.prototype,S=h["__core-js_shared__"],T=j.toString,x=E.hasOwnProperty,R=(w=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",L=E.toString,D=T.call(Object),C=RegExp("^"+T.call(x).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=v?h.Buffer:void 0,W=h.Symbol,B=h.Uint8Array,I=M?M.allocUnsafe:void 0,F=(O=Object.getPrototypeOf,P=Object,function(t){return O(P(t))}),A=Object.create,H=E.propertyIsEnumerable,z=k.splice,N=W?W.toStringTag:void 0,V=function(){try{var t=yt(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),X=M?M.isBuffer:void 0,Q=Math.max,$=Date.now,U=yt(h,"Map"),Y=yt(Object,"create"),q=function(){function t(){}return function(e){if(!St(e))return{};if(A)return A(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function K(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function J(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function G(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Z(t){var e=this.__data__=new J(t);this.size=e.size}function tt(t,e){var r=Ot(t),n=!r&&wt(t),o=!r&&!n&&kt(t),i=!r&&!n&&!o&&xt(t),s=r||n||o||i,c=s?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],a=c.length;for(var u in t)!e&&!x.call(t,u)||s&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||vt(u,a))||c.push(u);return c}function et(t,e,r){(void 0!==r&&!mt(t[e],r)||void 0===r&&!(e in t))&&ot(t,e,r)}function rt(t,e,r){var n=t[e];x.call(t,e)&&mt(n,r)&&(void 0!==r||e in t)||ot(t,e,r)}function nt(t,e){for(var r=t.length;r--;)if(mt(t[r][0],e))return r;return-1}function ot(t,e,r){"__proto__"==e&&V?V(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}K.prototype.clear=function(){this.__data__=Y?Y(null):{},this.size=0},K.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},K.prototype.get=function(t){var e=this.__data__;if(Y){var r=e[t];return r===n?void 0:r}return x.call(e,t)?e[t]:void 0},K.prototype.has=function(t){var e=this.__data__;return Y?void 0!==e[t]:x.call(e,t)},K.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Y&&void 0===e?n:e,this},J.prototype.clear=function(){this.__data__=[],this.size=0},J.prototype.delete=function(t){var e=this.__data__,r=nt(e,t);return!(r<0)&&(r==e.length-1?e.pop():z.call(e,r,1),--this.size,!0)},J.prototype.get=function(t){var e=this.__data__,r=nt(e,t);return r<0?void 0:e[r][1]},J.prototype.has=function(t){return nt(this.__data__,t)>-1},J.prototype.set=function(t,e){var r=this.__data__,n=nt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},G.prototype.clear=function(){this.size=0,this.__data__={hash:new K,map:new(U||J),string:new K}},G.prototype.delete=function(t){var e=dt(this,t).delete(t);return this.size-=e?1:0,e},G.prototype.get=function(t){return dt(this,t).get(t)},G.prototype.has=function(t){return dt(this,t).has(t)},G.prototype.set=function(t,e){var r=dt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Z.prototype.clear=function(){this.__data__=new J,this.size=0},Z.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Z.prototype.get=function(t){return this.__data__.get(t)},Z.prototype.has=function(t){return this.__data__.has(t)},Z.prototype.set=function(t,e){var r=this.__data__;if(r instanceof J){var n=r.__data__;if(!U||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new G(n)}return r.set(t,e),this.size=r.size,this};var it,st=function(t,e,r){for(var n=-1,o=Object(t),i=r(t),s=i.length;s--;){var c=i[it?s:++n];if(!1===e(o[c],c,o))break}return t};function ct(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":N&&N in Object(t)?function(t){var e=x.call(t,N),r=t[N];try{t[N]=void 0;var n=!0}catch(i){}var o=L.call(t);n&&(e?t[N]=r:delete t[N]);return o}(t):function(t){return L.call(t)}(t)}function at(t){return Tt(t)&&ct(t)==i}function ut(t){return!(!St(t)||function(t){return!!R&&R in t}(t))&&(jt(t)?C:a).test(function(t){if(null!=t){try{return T.call(t)}catch(e){}try{return t+""}catch(e){}}return""}(t))}function lt(t){if(!St(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=bt(t),r=[];for(var n in t)("constructor"!=n||!e&&x.call(t,n))&&r.push(n);return r}function ft(t,e,r,n,o){t!==e&&st(e,(function(i,s){if(o||(o=new Z),St(i))!function(t,e,r,n,o,i,s){var a=_t(t,r),u=_t(e,r),l=s.get(u);if(l)return void et(t,r,l);var f=i?i(a,u,r+"",t,e,s):void 0,p=void 0===f;if(p){var h=Ot(u),d=!h&&kt(u),y=!h&&!d&&xt(u);f=u,h||d||y?Ot(a)?f=a:Tt(m=a)&&Pt(m)?f=function(t,e){var r=-1,n=t.length;e||(e=Array(n));for(;++r<n;)e[r]=t[r];return e}(a):d?(p=!1,f=function(t,e){if(e)return t.slice();var r=t.length,n=I?I(r):new t.constructor(r);return t.copy(n),n}(u,!0)):y?(p=!1,v=u,b=!0?(_=v.buffer,g=new _.constructor(_.byteLength),new B(g).set(new B(_)),g):v.buffer,f=new v.constructor(b,v.byteOffset,v.length)):f=[]:function(t){if(!Tt(t)||ct(t)!=c)return!1;var e=F(t);if(null===e)return!0;var r=x.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&T.call(r)==D}(u)||wt(u)?(f=a,wt(a)?f=function(t){return function(t,e,r,n){var o=!r;r||(r={});var i=-1,s=e.length;for(;++i<s;){var c=e[i],a=n?n(r[c],t[c],c,r,t):void 0;void 0===a&&(a=t[c]),o?ot(r,c,a):rt(r,c,a)}return r}(t,Rt(t))}(a):St(a)&&!jt(a)||(f=function(t){return"function"!=typeof t.constructor||bt(t)?{}:q(F(t))}(u))):p=!1}var v,b,_,g;var m;p&&(s.set(u,f),o(f,u,n,i,s),s.delete(u));et(t,r,f)}(t,e,s,r,ft,n,o);else{var a=n?n(_t(t,s),i,s+"",t,e,o):void 0;void 0===a&&(a=i),et(t,s,a)}}),Rt)}function pt(t,e){return gt(function(t,e,r){return e=Q(void 0===e?t.length-1:e,0),function(){for(var n=arguments,o=-1,i=Q(n.length-e,0),s=Array(i);++o<i;)s[o]=n[e+o];o=-1;for(var c=Array(e+1);++o<e;)c[o]=n[o];return c[e]=r(s),m(t,this,c)}}(t,e,Ct),t+"")}var ht=V?function(t,e){return V(t,"toString",{configurable:!0,enumerable:!1,value:(r=e,function(){return r}),writable:!0});var r}:Ct;function dt(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function yt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return ut(r)?r:void 0}function vt(t,e){var r=typeof t;return!!(e=null==e?o:e)&&("number"==r||"symbol"!=r&&u.test(t))&&t>-1&&t%1==0&&t<e}function bt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||E)}function _t(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var gt=function(t){var e=0,r=0;return function(){var n=$(),o=16-(n-r);if(r=n,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(ht);function mt(t,e){return t===e||t!=t&&e!=e}var wt=at(function(){return arguments}())?at:function(t){return Tt(t)&&x.call(t,"callee")&&!H.call(t,"callee")},Ot=Array.isArray;function Pt(t){return null!=t&&Et(t.length)&&!jt(t)}var kt=X||function(){return!1};function jt(t){if(!St(t))return!1;var e=ct(t);return e==s||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Et(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}function St(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Tt(t){return null!=t&&"object"==typeof t}var xt=g?function(t){return function(e){return t(e)}}(g):function(t){return Tt(t)&&Et(t.length)&&!!l[ct(t)]};function Rt(t){return Pt(t)?tt(t,!0):lt(t)}var Lt,Dt=(Lt=function(t,e,r,n){ft(t,e,r,n)},pt((function(t,e){var r=-1,n=e.length,o=n>1?e[n-1]:void 0,i=n>2?e[2]:void 0;for(o=Lt.length>3&&"function"==typeof o?(n--,o):void 0,i&&function(t,e,r){if(!St(r))return!1;var n=typeof e;return!!("number"==n?Pt(r)&&vt(e,r.length):"string"==n&&e in r)&&mt(r[e],t)}(e[0],e[1],i)&&(o=n<3?void 0:o,n=1),t=Object(t);++r<n;){var s=e[r];s&&Lt(t,s,r,o)}return t})));function Ct(t){return t}t.exports=Dt},796:(t,e,r)=>{t.exports=r(643)},264:t=>{"use strict";var e=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:e,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:e&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:e&&!!window.screen,isInWorker:!e};t.exports=r},518:t=>{var e,r,n,o,i,s,c,a,u,l,f,p,h,d,y,v=!1;function b(){if(!v){v=!0;var t=navigator.userAgent,b=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(t),_=/(Mac OS X)|(Windows)|(Linux)/.exec(t);if(p=/\b(iPhone|iP[ao]d)/.exec(t),h=/\b(iP[ao]d)/.exec(t),l=/Android/i.exec(t),d=/FBAN\/\w+;/i.exec(t),y=/Mobile/i.exec(t),f=!!/Win64/.exec(t),b){(e=b[1]?parseFloat(b[1]):b[5]?parseFloat(b[5]):NaN)&&document&&document.documentMode&&(e=document.documentMode);var g=/(?:Trident\/(\d+.\d+))/.exec(t);s=g?parseFloat(g[1])+4:e,r=b[2]?parseFloat(b[2]):NaN,n=b[3]?parseFloat(b[3]):NaN,(o=b[4]?parseFloat(b[4]):NaN)?(b=/(?:Chrome\/(\d+\.\d+))/.exec(t),i=b&&b[1]?parseFloat(b[1]):NaN):i=NaN}else e=r=n=i=o=NaN;if(_){if(_[1]){var m=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(t);c=!m||parseFloat(m[1].replace("_","."))}else c=!1;a=!!_[2],u=!!_[3]}else c=a=u=!1}}var _={ie:function(){return b()||e},ieCompatibilityMode:function(){return b()||s>e},ie64:function(){return _.ie()&&f},firefox:function(){return b()||r},opera:function(){return b()||n},webkit:function(){return b()||o},safari:function(){return _.webkit()},chrome:function(){return b()||i},windows:function(){return b()||a},osx:function(){return b()||c},linux:function(){return b()||u},iphone:function(){return b()||p},mobile:function(){return b()||p||h||l||y},nativeApp:function(){return b()||d},android:function(){return b()||l},ipad:function(){return b()||h}};t.exports=_},534:(t,e,r)=>{"use strict";var n,o=r(264);o.canUseDOM&&(n=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),t.exports=function(t,e){if(!o.canUseDOM||e&&!("addEventListener"in document))return!1;var r="on"+t,i=r in document;if(!i){var s=document.createElement("div");s.setAttribute(r,"return;"),i="function"==typeof s[r]}return!i&&n&&"wheel"===t&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}},643:(t,e,r)=>{"use strict";var n=r(518),o=r(534);function i(t){var e=0,r=0,n=0,o=0;return"detail"in t&&(r=t.detail),"wheelDelta"in t&&(r=-t.wheelDelta/120),"wheelDeltaY"in t&&(r=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=r,r=0),n=10*e,o=10*r,"deltaY"in t&&(o=t.deltaY),"deltaX"in t&&(n=t.deltaX),(n||o)&&t.deltaMode&&(1==t.deltaMode?(n*=40,o*=40):(n*=800,o*=800)),n&&!e&&(e=n<1?-1:1),o&&!r&&(r=o<1?-1:1),{spinX:e,spinY:r,pixelX:n,pixelY:o}}i.getEventType=function(){return n.firefox()?"DOMMouseScroll":o("wheel")?"wheel":"mousewheel"},t.exports=i}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={id:n,loaded:!1,exports:{}};return t[n](i,i.exports,r),i.loaded=!0,i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{"use strict";var t={};r.r(t),r.d(t,{mergeWithoutArrays:()=>u,randID:()=>s,timeoutCallback:()=>l});var e={};r.r(e),r.d(e,{clamp:()=>Z,clampScope:()=>ot,inScope:()=>nt,lerp:()=>tt,scoped:()=>et,spreadScope:()=>rt,wrap:()=>it});var n={};r.r(n),r.d(n,{intersectionObserverSupported:()=>Bt,onScroll:()=>Wt});var o={};r.r(o);var i={};function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id",e="".concat(+new Date,"_").concat(Math.round(1e3*Math.random()));return"".concat(t,"_").concat(e)}r.r(i),r.d(i,{AnimationFrame:()=>gt,Application:()=>He,Callbacks:()=>x,Component:()=>G,Ctx2D:()=>Mo,Ctx2DPrerender:()=>qo,CustomCursor:()=>Hs,Dragger:()=>Kn,DraggerDirection:()=>mo,DraggerMove:()=>so,GeneralTypes:()=>o,Module:()=>H,MutableProp:()=>C,Page:()=>lr,PageLoad:()=>Me,Plugin:()=>Ke,Preloader:()=>On,ProgressPreloader:()=>Bn,ScrollBar:()=>pi,ScrollEventsBase:()=>Ei,ScrollView:()=>Ni,SmoothScroll:()=>Ct,SmoothScrollDragPlugin:()=>ps,SmoothScrollKeyboardPlugin:()=>Gi,SplitText:()=>Es,StaticTimeline:()=>Ur,Timeline:()=>an,Viewport:()=>Ee,WheelHandler:()=>jr,utils:()=>zs});var c=r(554),a=r.n(c);function u(t,e){return a()(t,e,(function(t,e){if(Array.isArray(t))return e}))}function l(t,e){0===e?t():setTimeout((function(){t()}),e)}function f(t,e){return p(t,e)}function p(t,e){return t===e||null!==t&&p(t.parentNode,e)}function h(t){return t instanceof HTMLElement||t instanceof Element}function d(t){return t instanceof Window}function y(t,e){if(d(t))return t;if(h(t))return t;if(void 0!==e){const r=y(e);if(r)return r.querySelector(t)}return document.querySelector(t)}function v(t,e){if(t instanceof NodeList)return t;if(h(t))return[t];if(Array.isArray(t))return t;if(void 0!==e){const r=y(e);if(r)return r.querySelectorAll(t)}return document.querySelectorAll(t)}function b(t,e,r){const n=e.split(" ");for(let o=0;o<n.length;o++)void 0===r?t.classList.toggle(n[o]):r?t.classList.add(n[o]):t.classList.remove(n[o])}function _(t,e={}){const r=document.createElement(t);if(e.class&&function(t,e){if(t instanceof Element)b(t,e,!0);else for(let r=0;r<t.length;r++)b(t[r],e,!0)}(r,e.class),e.id&&r.setAttribute("id",e.id),e.attr)for(let n=0,o=e.attr.length;n<o;n++){const t=e.attr[n];r.setAttribute(t[0],t[1])}if(e.parent&&e.parent.appendChild(r),e.html&&(r.innerHTML=e.html),e.children)for(let n=0,o=e.children.length;n<o;n++)r.appendChild(e.children[n]);return r}const g=[];function m(t,e,r,n){if(void 0!==n){const o={passive:!1,once:!1};n.once&&(o.once=!0),n.passive&&(o.passive=!0),t.addEventListener(e,r,o)}else t.addEventListener(e,r);const o=`${Math.random()}-${+new Date}`;return g.push({id:o,el:t,target:e,callback:r}),{id:o,remove:w.bind(this,o)}}function w(t){const e=[];for(let r=0,n=g.length;r<n;r++){const n=g[r];n.id===t?n.el.removeEventListener(n.target,n.callback):e.push(n)}}var O=r(796),P=r.n(O);function k(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function j(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?k(Object(r),!0).forEach((function(e){T(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function E(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function S(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function T(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var x=function(){function t(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];E(this,t),T(this,"_app",void 0),T(this,"_callbacks",void 0),this._app=window.vevetApp,this._callbacks=[],e&&this._init()}var e,r,n;return e=t,r=[{key:"callbacks",get:function(){return this._callbacks}},{key:"_init",value:function(){this._constructor(),this._setEvents()}},{key:"_constructor",value:function(){}},{key:"_setEvents",value:function(){}},{key:"add",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=s("callback"),o={id:n,on:!0,data:j({target:t,do:e},r)};return this._callbacks.push(o),this._onAdd(n),{id:n,remove:this.remove.bind(this,n)}}},{key:"_onAdd",value:function(t){}},{key:"remove",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!1,o=this._callbacks.filter((function(o){return o.id!==t||!(!o.data.protected||r)||(e._onRemove(t),n=!0,!1)}));return this._callbacks=o,n}},{key:"_onRemove",value:function(t){}},{key:"removeAll",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._callbacks.length>0;)this.remove(this._callbacks[0].id,t)}},{key:"turn",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.get(t);return!!r&&(r.on=e,this._onTurn(t),!0)}},{key:"_onTurn",value:function(t){}},{key:"get",value:function(t){var e=this._callbacks.filter((function(e){return e.id===t}));return e.length>0&&e[0]}},{key:"_trigger",value:function(t,e){if(t.on){var r=t.data,n=r.timeout,o=r.once,i=t.data.do;n?l(e?this._triggerFunc.bind(this,i,e):this._triggerFunc.bind(this,i,!1),n):e?this._triggerFunc(i,e):this._triggerFunc(i,!1),o&&this.remove(t.id)}}},{key:"_triggerFunc",value:function(t,e){e?t(e):t()}},{key:"tbt",value:function(t,e){var r=this;this._callbacks.forEach((function(n){n.data.target===t&&r._trigger(n,e)}))}},{key:"destroy",value:function(){this.removeAll(!0)}}],r&&S(e.prototype,r),n&&S(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function R(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function L(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function D(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var C=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"Responsive Prop";R(this,t),D(this,"_initProp",void 0),D(this,"_onResponsive",void 0),D(this,"_onChange",void 0),D(this,"_name",void 0),D(this,"_app",void 0),D(this,"_refProp",void 0),D(this,"_prop",void 0),D(this,"_responsiveRules",[]),D(this,"_viewportCallback",void 0),this._initProp=e,this._onResponsive=r,this._onChange=n,this._name=o,this._app=window.vevetApp,this._refProp=u({},e),this._prop=u({},e)}var e,r,n;return e=t,r=[{key:"prop",get:function(){return this._prop}},{key:"addResponsiveProp",value:function(t){this._responsiveRules.push(t),void 0===this._viewportCallback&&(this._viewportCallback=this._app.viewport.add("w",this._responseProp.bind(this,!0),{name:this._name})),this._responseProp()}},{key:"_responseProp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._responsiveRules,r=this._app,n=r.viewport,o=n.width,i=!1,s=u({},this._refProp);e.forEach((function(t){var e=t.settings,c=t.breakpoint;if("number"==typeof c)o<=t.breakpoint&&(i=u(s,e));else if("string"==typeof c){var a=c.toLowerCase();("d"===a&&n.isDesktop||"t"===a&&n.isTablet||"p"===a&&n.isPhone)&&(i=u(s,e)),("phone"===a&&r.isPhone||"tablet"===a&&r.isTablet||"mobile"===a&&r.isMobile)&&(i=u(s,e))}})),this._prop=u(this._prop,i||this._refProp),t&&this._onResponsive()}},{key:"changeProp",value:function(t){this._prop=u(this._prop,t),this._refProp=u(this._refProp,t),this._onChange(t)}},{key:"destroy",value:function(){this._viewportCallback&&this._viewportCallback.remove()}}],r&&L(e.prototype,r),n&&L(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function M(){throw new Error('Vevet.Application does not exist yet. \nCall "new Vevet.Application()" before using all the stuff')}function W(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function B(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?W(Object(r),!0).forEach((function(e){A(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function I(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function F(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function A(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var H=function(){function t(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];I(this,t),A(this,"_mutableProp",void 0),A(this,"_callbacks",void 0),A(this,"_listeners",void 0),A(this,"_app",void 0),A(this,"_inited",!1),A(this,"_destroyed",void 0),A(this,"_viewportCallbacks",[]),window.vevetApp?this._app=window.vevetApp:M(),this._destroyed=!1,this._listeners=[],this._callbacks=new x;var n=u(this._getDefaultProp(),e||{});this._mutableProp=new C(n,this._onPropResponsive.bind(this),this._onPropChange.bind(this),this.name),r&&this.init()}var e,r,n;return e=t,r=[{key:"_getDefaultProp",value:function(){return{parent:!1}}},{key:"prop",get:function(){return this._mutableProp.prop}},{key:"callbacks",get:function(){return this._callbacks}},{key:"prefix",get:function(){return""}},{key:"name",get:function(){return this.constructor.name}},{key:"inited",get:function(){return this._inited}},{key:"destroyed",get:function(){return this._destroyed}},{key:"addResponsiveProp",value:function(t){if(this._inited)throw new Error("Responsive properties cannot be added because the class instance is already initialized");this._mutableProp.addResponsiveProp(t)}},{key:"changeProp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._mutableProp.changeProp(t),this._callbacks.tbt("changeProp",!1)}},{key:"_onPropResponsive",value:function(){this._onPropMutate()}},{key:"_onPropChange",value:function(t){this._onPropMutate()}},{key:"_onPropMutate",value:function(){}},{key:"init",value:function(){var t=this;this._inited||(this._inited=!0,this._constructor(),this._setEvents(),this.prop.parent&&this.prop.parent.addCallback("destroy",(function(){t.destroy()})))}},{key:"_constructor",value:function(){}},{key:"_setEvents",value:function(){}},{key:"addViewportCallback",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this._app.viewport.add(t,e,B(B({},r),{},{name:this.constructor.name}));return this._viewportCallbacks.push(n),n}},{key:"addCallback",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.callbacks.add(t,e,r);return n}},{key:"addEventListeners",value:function(t,e,r,n){var o=m(t,e,r,n);return this._listeners.push(o),o}},{key:"destroy",value:function(){this.destroyed||this._destroy()}},{key:"_destroy",value:function(){this._callbacks.tbt("destroy",!1),this._callbacks.destroy(),this._mutableProp.destroy(),this._viewportCallbacks.forEach((function(t){t.remove()})),this._listeners.forEach((function(t){t.remove()})),this._destroyed=!0}}],r&&F(e.prototype,r),n&&F(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function z(t){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},z(t)}function N(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function V(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function X(){return X="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Q(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},X.apply(this,arguments)}function Q(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=K(t)););return t}function $(t,e){return $=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},$(t,e)}function U(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=K(t);if(e){var o=K(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Y(this,r)}}function Y(t,e){if(e&&("object"===z(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return q(t)}function q(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function K(t){return K=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},K(t)}function J(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var G=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$(t,e)}(i,t);var e,r,n,o=U(i);function i(){var t;N(this,i);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return J(q(t=o.call.apply(o,[this].concat(r))),"_plugins",void 0),t}return e=i,(r=[{key:"addPlugin",value:function(t){void 0===this._plugins&&(this._plugins=[]),this._plugins.push(t),t.inited||t.initPlugin(this)}},{key:"_destroyPlugins",value:function(){this._plugins&&this._plugins.forEach((function(t){t.destroy()}))}},{key:"_destroy",value:function(){X(K(i.prototype),"_destroy",this).call(this),this._destroyPlugins()}}])&&V(e.prototype,r),n&&V(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(H);function Z(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,1];return t<e[0]?e[0]:t>e[1]?e[1]:t}function tt(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.001,o=t*(1-r)+e*r,i=Math.abs(e-o);return i<=n?e:o}function et(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,1],r=(t-e[0])/(e[1]-e[0]);return r}function rt(t,e){for(var r=[],n=1/(t-e*(t-1)),o=0;o<t;o+=1){var i=n*(1-e)*o,s=i+n;r.push([i,s])}return r}function nt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,1];return t>=e[0]&&t<=e[1]}function ot(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,1];return Z(et(t,e),r)}function it(t,e,r){var n=e-t;return function(t,e){return t||0===t?e(t):e}(r,(function(e){return(n+(e-t)%n)%n+t}))}function st(t){return st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(t)}function ct(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function at(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ct(Object(r),!0).forEach((function(e){_t(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ct(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ut(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ft(){return ft="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=pt(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},ft.apply(this,arguments)}function pt(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=bt(t)););return t}function ht(t,e){return ht=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},ht(t,e)}function dt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=bt(t);if(e){var o=bt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return yt(this,r)}}function yt(t,e){if(e&&("object"===st(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return vt(t)}function vt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function bt(t){return bt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},bt(t)}function _t(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var gt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ht(t,e)}(i,t);var e,r,n,o=dt(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return ut(this,i),_t(vt(e=o.call(this,t,!1)),"_isPlaying",void 0),_t(vt(e),"_frame",void 0),_t(vt(e),"_frameIndex",void 0),_t(vt(e),"_timeStamp",void 0),_t(vt(e),"_prevFrameTime",void 0),e._isPlaying=!1,e._frame=null,e._frameIndex=-1,e._timeStamp=null,e._prevFrameTime=null,r&&e.init(),e}return e=i,(r=[{key:"isPlaying",get:function(){return this._isPlaying}},{key:"_getDefaultProp",value:function(){return at(at({},ft(bt(i.prototype),"_getDefaultProp",this).call(this)),{},{fps:140,run:!1})}},{key:"_constructor",value:function(){ft(bt(i.prototype),"_constructor",this).call(this),this._create()}},{key:"_create",value:function(){this.prop.run&&this.play()}},{key:"_onPropMutate",value:function(){this._frameIndex=-1,this._timeStamp=null,this._prevFrameTime=null,this.prop.run?this._play():this._pause()}},{key:"play",value:function(){this.destroyed||this.prop.run||this.changeProp({run:!0})}},{key:"_play",value:function(){this.isPlaying||(this._isPlaying=!0,this._frame=window.requestAnimationFrame(this._animate.bind(this)))}},{key:"pause",value:function(){this.prop.run&&this.changeProp({run:!1})}},{key:"_pause",value:function(){this.isPlaying&&(this._frame&&(window.cancelAnimationFrame(this._frame),this._frame=null),this._isPlaying=!1)}},{key:"_animate",value:function(t){if(this._isPlaying){this._frame=window.requestAnimationFrame(this._animate.bind(this));var e=+new Date;null==this._timeStamp&&(this._timeStamp=t),null==this._prevFrameTime&&(this._prevFrameTime=e);var r=Math.floor((t-this._timeStamp)/(1e3/this.prop.fps));if(!(r<=this._frameIndex)){this._frameIndex=r;var n=e-this._prevFrameTime,o=Z(0===n?1e3/60:Math.floor(1e3/n),[1,1/0]);this.callbacks.tbt("frame",{fps:this.prop.fps,realFPS:o,prevFrameDuration:e-this._prevFrameTime}),this._prevFrameTime=+new Date}}}},{key:"_destroy",value:function(){this.pause(),ft(bt(i.prototype),"_destroy",this).call(this)}}])&<(e.prototype,r),n&<(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(G);function mt(t){return mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mt(t)}function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ot(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?wt(Object(r),!0).forEach((function(e){Dt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Pt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function jt(){return jt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Et(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},jt.apply(this,arguments)}function Et(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Lt(t)););return t}function St(t,e){return St=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},St(t,e)}function Tt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Lt(t);if(e){var o=Lt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return xt(this,r)}}function xt(t,e){if(e&&("object"===mt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Rt(t)}function Rt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Lt(t){return Lt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Lt(t)}function Dt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ct=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&St(t,e)}(i,t);var e,r,n,o=Tt(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Pt(this,i),Dt(Rt(e=o.call(this,t,!1)),"_outer",void 0),Dt(Rt(e),"_container",void 0),Dt(Rt(e),"_containerExists",void 0),Dt(Rt(e),"_elements",void 0),Dt(Rt(e),"_elementsLength",void 0),Dt(Rt(e),"_targetLeft",void 0),Dt(Rt(e),"_targetTop",void 0),Dt(Rt(e),"_scrollLeft",void 0),Dt(Rt(e),"_scrollTop",void 0),Dt(Rt(e),"_scrollWidth",void 0),Dt(Rt(e),"_scrollHeight",void 0),Dt(Rt(e),"_clientWidth",void 0),Dt(Rt(e),"_clientHeight",void 0),Dt(Rt(e),"_instant",void 0),Dt(Rt(e),"_animationFrame",void 0),Dt(Rt(e),"_outerAnimationFrameEvent",void 0),Dt(Rt(e),"_currentFPS",void 0);var n=e.prop.selectors;if(e._targetLeft=0,e._targetTop=0,e._scrollLeft=0,e._scrollTop=0,e._scrollWidth=0,e._scrollHeight=0,e._clientWidth=0,e._clientHeight=0,e._instant=!1,e._animationFrame=void 0,e._outerAnimationFrameEvent=void 0,e._currentFPS=60,e._outer=y(n.outer),!(e._outer instanceof HTMLElement))throw new Error("".concat(n.outer," is not a HTMLElement"));e._outer.classList.add(e.prefix);var s=y(".".concat(e.prefix,"__container"),e.outer);return h(s)?(e._container=s,e._containerExists=!0):(e._container=_("div",{class:"".concat(e.prefix,"__container"),parent:e.outer,children:Array.from(e.outer.children)}),e._containerExists=!1),n.elements?e._elements=Array.from(v(n.elements,e._outer)):e._elements=[e._container],e._elementsLength=e._elements.length,e.prop.useWillChange&&e._elements.forEach((function(t){t.style.willChange="transform"})),r&&e.init(),e}return e=i,r=[{key:"prefix",get:function(){return"".concat(this._app.prefix,"smooth-scroll")}},{key:"outer",get:function(){return this._outer}},{key:"container",get:function(){return this._container}},{key:"elements",get:function(){return this._elements}},{key:"targetLeft",get:function(){return this._targetLeft},set:function(t){this.targetLeftBound=t,this._enable()}},{key:"targetLeftBound",get:function(){return this._targetLeft},set:function(t){var e=this.prop.overscroll&&this.prop.isHorizontal?-this.prop.overscroll.max:0,r=this.maxScrollableWidth+(this.prop.overscroll&&this.prop.isHorizontal?this.prop.overscroll.max:0);this._targetLeft=Z(t,[e,r])}},{key:"targetTop",get:function(){return this._targetTop},set:function(t){this.targetTopBound=t,this._enable()}},{key:"targetTopBound",get:function(){return this._targetTop},set:function(t){var e=this.prop.overscroll&&!this.prop.isHorizontal?-this.prop.overscroll.max:0,r=this.maxScrollableHeight+(this.prop.overscroll&&!this.prop.isHorizontal?this.prop.overscroll.max:0);this._targetTop=Z(t,[e,r])}},{key:"scrollLeft",get:function(){return this._scrollLeft},set:function(t){this.targetLeftBound=t,this._scrollLeft=this._targetLeft,this._enable()}},{key:"scrollTop",get:function(){return this._scrollTop},set:function(t){this.targetTopBound=t,this._scrollTop=this._targetTop,this._enable()}},{key:"scrollWidth",get:function(){return this._scrollWidth}},{key:"scrollHeight",get:function(){return this._scrollHeight}},{key:"clientWidth",get:function(){return this._clientWidth}},{key:"clientHeight",get:function(){return this._clientHeight}},{key:"maxScrollableWidth",get:function(){return this.scrollWidth-this.clientWidth}},{key:"maxScrollableHeight",get:function(){return this.scrollHeight-this.clientHeight}},{key:"_getDefaultProp",value:function(){return Ot(Ot({},jt(Lt(i.prototype),"_getDefaultProp",this).call(this)),{},{selectors:{outer:"#".concat(this.prefix),elements:!1},enabled:!0,animationFrame:!1,recalculateSizes:!0,resizeTimeout:0,useWheel:!0,autoStop:!0,isHorizontal:!1,stopPropagation:!0,useWillChange:!0,render:{lerp:.1,lerpToFixed:2,approximation:.1,normalizeLerp:!1},overscroll:{friction:.5,max:250}})}},{key:"_constructor",value:function(){jt(Lt(i.prototype),"_constructor",this).call(this),this._toggle()}},{key:"_setEvents",value:function(){var t=this;this.resize(),this.addViewportCallback("",(function(){t.resize(!0)}),{timeout:this.prop.resizeTimeout}),this.addEventListeners(this.outer,"wheel",(function(e){t._handleWheel(e)})),this.addEventListeners(this.outer,"scroll",(function(){t.outer.scrollTop=0,t.outer.scrollLeft=0}))}},{key:"_onPropMutate",value:function(){jt(Lt(i.prototype),"_onPropMutate",this).call(this),this.resize(),this._toggle()}},{key:"resize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.container,r=this.outer;this._clientWidth=r.clientWidth,this._clientHeight=r.clientHeight,this._scrollWidth=Z(e.clientWidth,[this.clientWidth,1/0]),this._scrollHeight=Z(e.clientHeight,[this.clientHeight,1/0]),t&&(this._instant=!0),t&&(this.targetLeft=parseInt(this.targetLeft.toFixed(0),10),this.targetTop=parseInt(this.targetTop.toFixed(0),10));var n=this.maxScrollableHeight>0||this.maxScrollableWidth>0;r.classList.toggle("has-scroll",n),r.classList.toggle("no-scroll",!n),this._updateElementsProp(),this.callbacks.tbt("resize",!1)}},{key:"_recalculateSizes",value:function(){var t=this.container,e=t.clientHeight,r=t.clientWidth;e===this.scrollHeight&&r===this.scrollWidth||this.resize()}},{key:"_updateElementsProp",value:function(){for(var t=0;t<this._elementsLength;t+=1){var e=this._elements[t];e.smoothScrollLeft=this.scrollLeft,e.smoothScrollTop=this.scrollTop;var r=e.getAttribute("".concat(this.prefix,"-ease"));if(r)try{e.smoothScrollLerpEase=parseFloat(r)}catch(n){}}}},{key:"_handleWheel",value:function(t){var e=this.prop;if(e.enabled&&e.useWheel){(e.stopPropagation||!e.stopPropagation&&(this.scrollLeft>0&&this.scrollLeft<this.maxScrollableWidth||this.scrollTop>0&&this.scrollTop<this.maxScrollableHeight))&&(t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault());var r=P()(t);this.targetLeftBound+=e.isHorizontal?r.pixelY:r.pixelX,this.targetTopBound+=e.isHorizontal?r.pixelX:r.pixelY,this._enable(),this.callbacks.tbt("wheel",t)}}},{key:"_toggle",value:function(){this.prop.enabled?this._enable():this._disable()}},{key:"_enable",value:function(){var t=this;this.prop.enabled&&(this.prop.animationFrame&&!this._outerAnimationFrameEvent?this._outerAnimationFrameEvent=this.prop.animationFrame.addCallback("frame",(function(e){t._currentFPS=e.realFPS,t.render()})):(this._animationFrame||(this._animationFrame=new gt,this._animationFrame.addCallback("frame",(function(e){t._currentFPS=e.realFPS,t.render()}))),this._animationFrame.play()))}},{key:"_disable",value:function(){this._outerAnimationFrameEvent&&this.prop.animationFrame&&this._outerAnimationFrameEvent.remove(),this._animationFrame&&this._animationFrame.pause()}},{key:"render",value:function(){var t=this.prop;t.recalculateSizes&&this._recalculateSizes(),this._calcScroll(),this._calcElements(),this._renderElements(),this._instant&&(this._instant=!1),this.callbacks.tbt("scroll",!1);var e=Math.abs(this.targetTop-this.scrollTop);0===Math.abs(this.targetLeft-this.scrollLeft)&&0===e&&t.autoStop&&(this._disable(),this.callbacks.tbt("approximate",!1))}},{key:"_calcScroll",value:function(){var t=this.prop.overscroll;t&&(this.targetLeft<0?this.targetLeftBound=this._lerp(this.targetLeftBound,0,t.friction):this.targetLeft>this.maxScrollableWidth&&(this.targetLeftBound=this._lerp(this.targetLeftBound,this.maxScrollableWidth,t.friction)),this.targetTop<0?this.targetTopBound=this._lerp(this.targetTopBound,0,t.friction):this.targetTop>this.maxScrollableHeight&&(this.targetTopBound=this._lerp(this.targetTopBound,this.maxScrollableHeight,t.friction))),this._scrollLeft=this._lerp(this.scrollLeft,this.targetLeft),this._scrollTop=this._lerp(this.scrollTop,this.targetTop)}},{key:"_calcElements",value:function(){for(var t=this._getLerpEase(),e=0;e<this._elementsLength;e+=1){var r=this._elements[e],n=this._getLerpEase(r);n===t?(r.smoothScrollLeft=this._scrollLeft,r.smoothScrollTop=this._scrollTop):(r.smoothScrollLeft=this._lerp(r.smoothScrollLeft,this._targetLeft,n),r.smoothScrollTop=this._lerp(r.smoothScrollTop,this._targetTop,n))}}},{key:"_lerp",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._getLerpEase(),n=this.prop.render,o=n.lerpToFixed,i=n.approximation,s=this._instant?1:r,c=tt(t,e,s,i);if("number"==typeof o){var a=Math.round(Math.abs(o));return parseFloat(c.toFixed(a))}return c}},{key:"_getLerpEase",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.prop.render,r=e.lerp,n=e.normalizeLerp,o=n?60/this._currentFPS:1;return t&&t.smoothScrollLerpEase||r*o}},{key:"_renderElements",value:function(){for(var t=0;t<this._elementsLength;t+=1){var e=this._elements[t],r=-e.smoothScrollLeft,n=-e.smoothScrollTop;e.style.transform="matrix3d(1,0,0.00,0,0.00,1,0.00,0,0,0,1,0, ".concat(r,", ").concat(n,", 0,1)")}}},{key:"scrollTo",value:function(){var t=arguments;if(1===t.length&&"object"===mt(t[0])){var e=t[0],r=e.top,n=e.left,o=e.behavior;void 0!==n&&("smooth"===o?this.targetLeftBound=n:this.scrollLeft=n),void 0!==r&&("smooth"===o?this.targetTopBound=r:this.scrollTop=r),"smooth"===o&&this._enable()}"number"!=typeof t[0]&&"number"!=typeof t[1]||("number"==typeof t[0]&&(this.scrollLeft=t[0]),"number"==typeof t[1]&&(this.scrollTop=t[1]))}},{key:"_destroy",value:function(){if(jt(Lt(i.prototype),"_destroy",this).call(this),this._disable(),this._animationFrame&&this._animationFrame.destroy(),!this._containerExists){for(;this._container.firstChild;)this._outer.appendChild(this._container.firstChild);this._container.remove()}this._outer.classList.remove(this.prefix),this._elements.forEach((function(t){t.style.transform="",t.style.willChange=""}))}}],r&&kt(e.prototype,r),n&&kt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(G),Mt=[];function Wt(t){var e=t.container,r=t.callback,n=t.isPassive,o=void 0!==n&&n,i=Mt.find((function(t){return t.container===e&&t.isPassive===o})),c=s("scroll-event");if(i)i.callbacks.push({id:c,callback:r});else{i={id:s("scroll-event-instance"),container:e,callbacks:[{id:c,callback:r}],isPassive:o,listeners:[]},Mt.push(i);var a=i.listeners;if(e instanceof Ct)a.push(e.addCallback("scroll",(function(){for(var t=e.scrollTop,r=e.scrollLeft,n=0;n<i.callbacks.length;n+=1)i.callbacks[n].callback({scrollTop:t,scrollLeft:r})})));else{var u=e instanceof Window,l=y(e);a.push(m(l,"scroll",(function(){for(var t=u?l.pageYOffset:l.scrollTop,e=u?l.pageXOffset:l.scrollLeft,r=0;r<i.callbacks.length;r+=1)i.callbacks[r].callback({scrollTop:t,scrollLeft:e})}),{passive:o}))}}return{remove:function(){var t=i.callbacks.filter((function(t){return t.id!==c}));i.callbacks=t,0===t.length&&(i.listeners.forEach((function(t){t.remove()})),Mt=Mt.filter((function(t){return t.id!==i.id})))}}}function Bt(){return"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype}var It=/iPhone/i,Ft=/iPod/i,At=/iPad/i,Ht=/\biOS-universal(?:.+)Mac\b/i,zt=/\bAndroid(?:.+)Mobile\b/i,Nt=/Android/i,Vt=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Xt=/Silk/i,Qt=/Windows Phone/i,$t=/\bWindows(?:.+)ARM\b/i,Ut=/BlackBerry/i,Yt=/BB10/i,qt=/Opera Mini/i,Kt=/\b(CriOS|Chrome)(?:.+)Mobile/i,Jt=/Mobile(?:.+)Firefox\b/i,Gt=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};function Zt(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var r=e.userAgent,n=r.split("[FBAN");void 0!==n[1]&&(r=n[0]),void 0!==(n=r.split("Twitter"))[1]&&(r=n[0]);var o=function(t){return function(e){return e.test(t)}}(r),i={apple:{phone:o(It)&&!o(Qt),ipod:o(Ft),tablet:!o(It)&&(o(At)||Gt(e))&&!o(Qt),universal:o(Ht),device:(o(It)||o(Ft)||o(At)||o(Ht)||Gt(e))&&!o(Qt)},amazon:{phone:o(Vt),tablet:!o(Vt)&&o(Xt),device:o(Vt)||o(Xt)},android:{phone:!o(Qt)&&o(Vt)||!o(Qt)&&o(zt),tablet:!o(Qt)&&!o(Vt)&&!o(zt)&&(o(Xt)||o(Nt)),device:!o(Qt)&&(o(Vt)||o(Xt)||o(zt)||o(Nt))||o(/\bokhttp\b/i)},windows:{phone:o(Qt),tablet:o($t),device:o(Qt)||o($t)},other:{blackberry:o(Ut),blackberry10:o(Yt),opera:o(qt),firefox:o(Jt),chrome:o(Kt),device:o(Ut)||o(Yt)||o(qt)||o(Jt)||o(Kt)},any:!1,phone:!1,tablet:!1};return i.any=i.apple.device||i.android.device||i.windows.device||i.other.device,i.phone=i.apple.phone||i.android.phone||i.windows.phone,i.tablet=i.apple.tablet||i.android.tablet||i.windows.tablet,i}var te,ee,re=function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))},ne=function(t,e,r){this.name=t,this.version=e,this.os=r,this.type="browser"},oe=function(t){this.version=t,this.type="node",this.name="node",this.os=process.platform},ie=function(t,e,r,n){this.name=t,this.version=e,this.os=r,this.bot=n,this.type="bot-device"},se=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},ce=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},ae=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,ue=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],le=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function fe(t){return t?he(t):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new ce:"undefined"!=typeof navigator?he(navigator.userAgent):"undefined"!=typeof process&&process.version?new oe(process.version.slice(1)):null}function pe(t){return""!==t&&ue.reduce((function(e,r){var n=r[0],o=r[1];if(e)return e;var i=o.exec(t);return!!i&&[n,i]}),!1)}function he(t){var e=pe(t);if(!e)return null;var r=e[0],n=e[1];if("searchbot"===r)return new se;var o=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);o?o.length<3&&(o=re(re([],o,!0),function(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}(3-o.length),!0)):o=[];var i=o.join("."),s=function(t){for(var e=0,r=le.length;e<r;e++){var n=le[e],o=n[0];if(n[1].exec(t))return o}return null}(t),c=ae.exec(t);return c&&c[1]?new ie(r,i,s,c[1]):new ne(r,i,s)}class de extends Error{constructor(t){super(t||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}}class ye{static fn(t){return(...e)=>new ye(((r,n,o)=>{e.push(o),t(...e).then(r,n)}))}constructor(t){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise(((e,r)=>{this._reject=r;const n=t=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(t)};Object.defineProperties(n,{shouldReject:{get:()=>this._rejectOnCancel,set:t=>{this._rejectOnCancel=t}}}),t((t=>{this._isCanceled&&n.shouldReject||(this._isPending=!1,e(t))}),(t=>{this._isPending=!1,r(t)}),n)}))}then(t,e){return this._promise.then(t,e)}catch(t){return this._promise.catch(t)}finally(t){return this._promise.finally(t)}cancel(t){if(this._isPending&&!this._isCanceled){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(const t of this._cancelHandlers)t()}catch(e){return void this._reject(e)}this._rejectOnCancel&&this._reject(new de(t))}}get isCanceled(){return this._isCanceled}}function ve(t){return ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ve(t)}function be(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function _e(){return _e="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=ge(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},_e.apply(this,arguments)}function ge(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ke(t)););return t}function me(t,e){return me=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},me(t,e)}function we(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ke(t);if(e){var o=ke(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Oe(this,r)}}function Oe(t,e){if(e&&("object"===ve(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Pe(t)}function Pe(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ke(t){return ke=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ke(t)}function je(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Object.setPrototypeOf(ye.prototype,Promise.prototype),function(t){t.Desktop="desktop",t.Tablet="tablet",t.Phone="phone"}(te||(te={})),function(t){t.Landscape="landscape",t.Portrait="portrait"}(ee||(ee={}));var Ee=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&me(t,e)}(i,t);var e,r,n,o=we(i);function i(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),je(Pe(t=o.call(this,!1)),"_width",void 0),je(Pe(t),"_height",void 0),je(Pe(t),"_prevSize",void 0),je(Pe(t),"_isDesktop",void 0),je(Pe(t),"_isTablet",void 0),je(Pe(t),"_isPhone",void 0),t._width=0,t._height=0,t._prevSize={w:0,h:0},t._isDesktop=!1,t._isTablet=!1,t._isPhone=!1,t._init(),t}return e=i,(r=[{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"vw",get:function(){return this.width/100}},{key:"vh",get:function(){return this.height/100}},{key:"prevSize",get:function(){return this._prevSize}},{key:"isLandscape",get:function(){return this.width>this.height}},{key:"isPortrait",get:function(){return this.width<this.height}},{key:"isDesktop",get:function(){return this._isDesktop}},{key:"isTablet",get:function(){return this._isTablet}},{key:"isPhone",get:function(){return this._isPhone}},{key:"dpr",get:function(){return void 0!==window.devicePixelRatio?window.devicePixelRatio:1}},{key:"lowerDesktopDPR",get:function(){return this._app.isDesktop?1:this.dpr}},{key:"_constructor",value:function(){_e(ke(i.prototype),"_constructor",this).call(this),this._setValues()}},{key:"_setEvents",value:function(){var t=this;window.addEventListener("resize",(function(){l((function(){t._onResize()}),t._app.prop.viewportResizeTimeout)}))}},{key:"_setValues",value:function(){var t=this._app,e=t.html,r=t.prop;this._width=e.clientWidth,this._height=e.clientHeight,this._prevSize={w:this._width,h:this._height};var n=this.width;this._isDesktop=n>=r.tablet,this._isTablet=n<=r.tablet&&n>r.phone,this._isPhone=n<=r.phone,this._updateClasses(),this._updateCSSVars()}},{key:"_updateClasses",value:function(){var t=[te.Desktop,te.Tablet,te.Phone];this.isDesktop?this._updateBreakpointClasses(te.Desktop,t):this.isTablet?this._updateBreakpointClasses(te.Tablet,t):this._updateBreakpointClasses(te.Phone,t);var e=[ee.Landscape,ee.Portrait];this.isLandscape?this._updateBreakpointClasses(ee.Landscape,e):this.isPortrait?this._updateBreakpointClasses(ee.Portrait,e):this._updateBreakpointClasses("",e)}},{key:"_updateBreakpointClasses",value:function(t,e){var r=this._app.html,n=this._app.prefix;e.forEach((function(e){e===t?r.classList.add("".concat(n,"viewport-").concat(e)):r.classList.remove("".concat(n,"viewport-").concat(e))}))}},{key:"_updateCSSVars",value:function(){var t=this._app.html;t.style.setProperty("--vw","".concat(this.vw,"px")),t.style.setProperty("--vh","".concat(this.vh,"px"))}},{key:"_onResize",value:function(){var t=this._prevSize.w,e=this._prevSize.h;this._setValues();var r=this.width,n=this.height,o={widthChanged:r!==t,heightChanged:n!==e,orientationChanged:r>n!=t>e};r!==t&&n===e&&this.tbt("w_",o),n!==e&&r===t&&this.tbt("h_",o),r!==t&&n!==e&&(this.tbt("wh",o),this.tbt("hw",o)),r!==t&&this.tbt("w",o),n!==e&&this.tbt("h",o),this.tbt("",o)}}])&&be(e.prototype,r),n&&be(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(x);function Se(t){return Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Se(t)}function Te(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function xe(t,e){return xe=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},xe(t,e)}function Re(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ce(t);if(e){var o=Ce(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Le(this,r)}}function Le(t,e){if(e&&("object"===Se(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return De(t)}function De(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ce(t){return Ce=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ce(t)}var Me=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xe(t,e)}(i,t);var e,r,n,o=Re(i);function i(){var t,e,r,n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=o.call(this,!1),e=De(t),n=void 0,(r="_loaded")in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,t._loaded=!1,t._init(),t}return e=i,(r=[{key:"loaded",get:function(){return this._loaded}},{key:"_setEvents",value:function(){var t=this;"complete"===document.readyState?this._handleLoaded():window.addEventListener("load",(function(){t._handleLoaded()}))}},{key:"_handleLoaded",value:function(){var t=this._app,e=t.prefix;this._loaded=!0,t.html.classList.remove("".concat(e,"loading")),t.body.classList.remove("".concat(e,"loading")),t.html.classList.add("".concat(e,"loaded")),this.tbt("",!1)}},{key:"onLoaded",value:function(t){if(!this.loaded)return this.add("",t.bind(this));t()}}])&&Te(e.prototype,r),n&&Te(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(x);function We(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Be(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?We(Object(r),!0).forEach((function(e){Ae(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):We(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ie(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ae(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var He=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Ie(this,t),Ae(this,"_prop",void 0),Ae(this,"_prefix",void 0),Ae(this,"_isPhone",void 0),Ae(this,"_isTablet",void 0),Ae(this,"_isMobile",void 0),Ae(this,"_isDesktop",void 0),Ae(this,"_osName",void 0),Ae(this,"_browserName",void 0),Ae(this,"_pages",[]),Ae(this,"_page",!1),Ae(this,"_pageLoad",void 0),Ae(this,"_viewport",void 0),window.vevetApp)throw new Error("Vevet Application already exists!");this._prop=Be(Be({},this.defaultProp),e),this._prefix=this.prop.prefix,this._sayHi(),window.vevetApp=this;var r=Zt();this._isPhone=r.phone,this.html.classList.toggle("".concat(this.prefix,"phone"),this._isPhone),this._isTablet=r.tablet,this.html.classList.toggle("".concat(this.prefix,"tablet"),this._isTablet),this._isMobile=r.phone||r.tablet,this.html.classList.toggle("".concat(this.prefix,"mobile"),this._isMobile),this._isDesktop=!this._isMobile,this.html.classList.toggle("".concat(this.prefix,"desktop"),this._isDesktop);var n=fe();if(null!=n&&n.os){var o=n.os.split(" ")[0].toLowerCase();this.html.classList.add("".concat(this.prefix,"os-").concat(o)),this._osName=o}else this._osName="";if(null!=n&&n.name){var i=n.name.toLowerCase();this.html.classList.add("".concat(this.prefix,"browser-").concat(i)),this._browserName=i}else this._browserName="";this._pageLoad=new Me,this._viewport=new Ee}var e,r,n;return e=t,(r=[{key:"prop",get:function(){return this._prop}},{key:"defaultProp",get:function(){return{tablet:1199,phone:899,prefix:"v-",easing:[.25,.1,.25,1],viewportResizeTimeout:0}}},{key:"prefix",get:function(){return this._prefix}},{key:"isPhone",get:function(){return this._isPhone}},{key:"isTablet",get:function(){return this._isTablet}},{key:"isMobile",get:function(){return this._isMobile}},{key:"isDesktop",get:function(){return this._isDesktop}},{key:"osName",get:function(){return this._osName}},{key:"browserName",get:function(){return this._browserName}},{key:"doc",get:function(){return document}},{key:"html",get:function(){return document.documentElement}},{key:"body",get:function(){return document.body}},{key:"pages",get:function(){return this._pages}},{key:"page",get:function(){return this._page},set:function(t){this._page=t}},{key:"onPageCreated",value:function(){var t=this;return new ye((function(e){t._page?t._page.onCreate().then((function(){e(t.page)})):setTimeout((function(){t.onPageCreated().then((function(){e(t.page)}))}),30)}))}},{key:"onPageShown",value:function(){var t=this;return new ye((function(e){t.onPageCreated().then((function(){t._page&&t._page.onShow().then((function(){e(t.page)}))}))}))}},{key:"pageLoad",get:function(){return this._pageLoad}},{key:"onPageLoaded",value:function(){var t=this;return new ye((function(e){t._pageLoad.onLoaded((function(){e()}))}))}},{key:"viewport",get:function(){return this._viewport}},{key:"_sayHi",value:function(){var t=["padding: 1rem 1.5rem;","background: #5F2580;","font: 1rem/1 Arial;","color: #ffffff;"].join("");console.log("%c%s",t,"Vevet")}}])&&Fe(e.prototype,r),n&&Fe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ze(t){return ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ze(t)}function Ne(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ve(){return Ve="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Xe(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},Ve.apply(this,arguments)}function Xe(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=qe(t)););return t}function Qe(t,e){return Qe=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Qe(t,e)}function $e(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=qe(t);if(e){var o=qe(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ue(this,r)}}function Ue(t,e){if(e&&("object"===ze(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ye(t)}function Ye(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function qe(t){return qe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},qe(t)}var Ke=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qe(t,e)}(i,t);var e,r,n,o=$e(i);function i(t){var e,r,n,s;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t,!1),r=Ye(e),s=void 0,(n="_component")in r?Object.defineProperty(r,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[n]=s,e}return e=i,(r=[{key:"component",get:function(){return this._component}},{key:"init",value:function(){if(!this._component)throw new Error("Component is not set. Be sure that initlugin is called before.");Ve(qe(i.prototype),"init",this).call(this)}},{key:"initPlugin",value:function(t){this._inited||(this._component=t,this.init())}}])&&Ne(e.prototype,r),n&&Ne(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(H);function Je(t){return Je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Je(t)}function Ge(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ze(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ge(Object(r),!0).forEach((function(e){ur(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ge(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function tr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function er(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function rr(){return rr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=nr(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},rr.apply(this,arguments)}function nr(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ar(t)););return t}function or(t,e){return or=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},or(t,e)}function ir(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ar(t);if(e){var o=ar(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return sr(this,r)}}function sr(t,e){if(e&&("object"===Je(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return cr(t)}function cr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ar(t){return ar=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ar(t)}function ur(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var lr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&or(t,e)}(i,t);var e,r,n,o=ir(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return tr(this,i),ur(cr(e=o.call(this,t,!1)),"_blocked",void 0),ur(cr(e),"_created",void 0),ur(cr(e),"_shown",void 0),ur(cr(e),"_hidden",void 0),ur(cr(e),"_viaAJAX",void 0),e._blocked=!1,e._created=!1,e._shown=!1,e._hidden=!1,e._destroyed=!1,e._viaAJAX=!1,r&&e.init(),e}return e=i,r=[{key:"blocked",get:function(){return this._blocked}},{key:"created",get:function(){return this._created}},{key:"shown",get:function(){return this._shown}},{key:"hidden",get:function(){return this._hidden}},{key:"viaAJAX",get:function(){return this._viaAJAX}},{key:"pageClassName",get:function(){return"".concat(this._app.prefix,"page-").concat(this.prop.name)}},{key:"_getDefaultProp",value:function(){return Ze(Ze({},rr(ar(i.prototype),"_getDefaultProp",this).call(this)),{},{name:"home"})}},{key:"create",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(r,n){t.canCreate().then((function(){t.created||t.blocked?n():(t._blocked=!0,t._shown=!1,t._hidden=!1,t._destroyed=!1,t._viaAJAX=e,t._app.page=t,t._app.html.classList.add(t.pageClassName),t._create().then((function(){t.callbacks.tbt("create",!1),t._blocked=!1,t._created=!0,r()})).catch((function(){n()})))})).catch((function(){n()}))}))}},{key:"_create",value:function(){return new Promise((function(t){t()}))}},{key:"canCreate",value:function(){var t=this;return new Promise((function(e,r){t.created?r():e()}))}},{key:"show",value:function(){var t=this;return new Promise((function(e,r){t.canShow().then((function(){t.shown||t.blocked?r():(t._blocked=!0,t._created=!0,t._hidden=!1,t._destroyed=!1,t._show().then((function(){t.callbacks.tbt("show",!1),t._blocked=!1,t._shown=!0,e()})).catch((function(){r()})))})).catch((function(){r()}))}))}},{key:"_show",value:function(){return new Promise((function(t){t()}))}},{key:"canShow",value:function(){var t=this;return new Promise((function(e,r){!t.created||t.shown?r():e()}))}},{key:"hide",value:function(){var t=this;return new Promise((function(e,r){t.canHide().then((function(){t.hidden||t.blocked?r():(t._blocked=!0,t._created=!0,t._shown=!1,t._destroyed=!1,t._hide().then((function(){t.callbacks.tbt("hide",!1),t._blocked=!1,t._hidden=!0,e()})).catch((function(){r()})))})).catch((function(){r()}))}))}},{key:"_hide",value:function(){return new Promise((function(t){t()}))}},{key:"canHide",value:function(){var t=this;return new Promise((function(e,r){t.created&&t.shown&&!t.hidden?e():r()}))}},{key:"destroy",value:function(){var t=this;return new Promise((function(e,r){t.canDestroy().then((function(){t.destroyed||t.blocked?r():(t._blocked=!0,t._created=!1,t._shown=!1,t._hidden=!0,t._app.page=!1,t._app.html.classList.remove(t.pageClassName),t._destroy().then((function(){t._blocked=!1,t._destroyed=!0,e()})).catch((function(){r()})))})).catch((function(){r()}))}))}},{key:"_destroy",value:function(){var t=this;return new Promise((function(e){rr(ar(i.prototype),"_destroy",t).call(t),e()}))}},{key:"canDestroy",value:function(){var t=this;return new Promise((function(e,r){t.created&&t.hidden&&!t.destroyed?e():r()}))}},{key:"onCreate",value:function(){var t=this;return new ye((function(e){t.created?e():t.addCallback("create",(function(){e()}),{once:!0})}))}},{key:"onShow",value:function(){var t=this;return new ye((function(e){t.shown?e():t.addCallback("show",(function(){e()}),{once:!0})}))}},{key:"onHide",value:function(){var t=this;return new ye((function(e){t.hidden?e():t.addCallback("hide",(function(){e()}),{once:!0})}))}}],r&&er(e.prototype,r),n&&er(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(G);function fr(t){return fr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fr(t)}function pr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function hr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?pr(Object(r),!0).forEach((function(e){Pr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function dr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function vr(t,e){return vr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},vr(t,e)}function br(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Or(t);if(e){var o=Or(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _r(this,r)}}function _r(t,e){if(e&&("object"===fr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return gr(t)}function gr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mr(){return mr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=wr(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},mr.apply(this,arguments)}function wr(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Or(t)););return t}function Or(t){return Or=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Or(t)}function Pr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var kr,jr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vr(t,e)}(i,t);var e,r,n,o=br(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return dr(this,i),Pr(gr(e=o.call(this,t,!1)),"_wheelListener",void 0),Pr(gr(e),"_lockWheel",void 0),Pr(gr(e),"_lockWheelTimeout",void 0),e._wheelListener=void 0,e._lockWheel=!1,r&&e.init(),e}return e=i,(r=[{key:"_getDefaultProp",value:function(){return hr(hr({},mr(Or(i.prototype),"_getDefaultProp",this).call(this)),{},{container:!1,enabled:!0,stopPropagation:!1,threshold:20})}},{key:"container",get:function(){return this.prop.container?this.prop.container:window}},{key:"_setEvents",value:function(){mr(Or(i.prototype),"_setEvents",this).call(this),this.container instanceof Window?this._toggleWheelEvent():(this._listeners.push(m(this.container,"mouseenter",this._handleMouseEnter.bind(this))),this._listeners.push(m(this.container,"mouseleave",this._handleMouseLeave.bind(this))))}},{key:"_onPropMutate",value:function(){mr(Or(i.prototype),"_onPropMutate",this).call(this),this._toggleWheelEvent()}},{key:"_handleMouseEnter",value:function(){this.prop.enabled&&this._createWheelEvent()}},{key:"_handleMouseLeave",value:function(){this._destroyWheelEvent()}},{key:"_toggleWheelEvent",value:function(){this.prop.enabled?this._createWheelEvent():this._destroyWheelEvent()}},{key:"_createWheelEvent",value:function(){this._wheelListener||(this._lockWheel=!1,this._lockWheelTimeout&&clearTimeout(this._lockWheelTimeout),this._wheelListener=m(this.container,"wheel",this._handleWheel.bind(this)))}},{key:"_destroyWheelEvent",value:function(){this._wheelListener&&(this._wheelListener.remove(),this._wheelListener=void 0)}},{key:"_handleWheel",value:function(t){var e=this;if(this._wheelListener){if(this.prop.stopPropagation&&(t.preventDefault(),t.stopPropagation()),this._lockWheel)return this._lockWheelTimeout&&clearTimeout(this._lockWheelTimeout),void(this._lockWheelTimeout=setTimeout((function(){e._lockWheel=!1}),300));var r=P()(t),n=this.prop.threshold,o=!1;r.pixelY>n?(this._callbacks.tbt("down",!1),o=!0):r.pixelY<-1*n&&(this._callbacks.tbt("up",!1),o=!0),r.pixelX>n?(this._callbacks.tbt("right",!1),o=!0):r.pixelX<-1*n&&(this._callbacks.tbt("left",!1),o=!0),o&&(this._lockWheel=!0)}}},{key:"_destroy",value:function(){mr(Or(i.prototype),"_destroy",this).call(this),this._destroyWheelEvent()}}])&&yr(e.prototype,r),n&&yr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(H);function Er(t,e){const[r,n,o,i]=e;if(r===n&&o===i)return t;const s=[];for(let c=0;c<11;++c)s[c]=Sr(.1*c,r,o);return 0===t?0:1===t?1:Sr(function(t,e,r){const n=t[0],o=t[2];let i=0,s=1;for(;10!==s&&r[s]<=e;++s)i+=.1;--s;const c=(e-r[s])/(r[s+1]-r[s]),a=i+.1*c,u=Lr(a,n,o);if(u>=.001)return function(t,e,r,n){for(let o=0;o<4;++o){const o=Lr(e,r,n);if(0===o)return e;e-=(Sr(e,r,n)-t)/o}return e}(e,a,n,o);if(0===u)return a;return function(t,e,r,n,o){let i,s,c=0;do{s=e+(r-e)/2,i=Sr(s,n,o)-t,i>0?r=s:e=s}while(Math.abs(i)>1e-7&&++c<10);return s}(e,i,i+.1,n,o)}(e,t,s),n,i)}function Sr(t,e,r){return((Tr(e,r)*t+xr(e,r))*t+Rr(e))*t}function Tr(t,e){return 1-3*e+3*t}function xr(t,e){return 3*e-6*t}function Rr(t){return 3*t}function Lr(t,e,r){return 3*Tr(e,r)*t*t+2*xr(e,r)*t+Rr(e)}function Dr(t){const e=7.5625,r=2.75;return t<1/r?e*t*t:t<2/r?e*(t-=1.5/r)*t+.75:t<2.5/r?e*(t-=2.25/r)*t+.9375:e*(t-=2.625/r)*t+.984375}function Cr(t,e){switch(e){case kr.easeInSine:return r=t,1-Math.cos(r*Math.PI/2);case kr.easeOutSine:return function(t){return Math.sin(t*Math.PI/2)}(t);case kr.easeInOutSine:return function(t){return-(Math.cos(Math.PI*t)-1)/2}(t);case kr.easeInQuad:return function(t){return Math.pow(t,2)}(t);case kr.easeOutQuad:return function(t){return 1-Math.pow(1-t,2)}(t);case kr.easeInOutQuad:return function(t){return t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2}(t);case kr.easeInCubic:return function(t){return Math.pow(t,3)}(t);case kr.easeOutCubic:return function(t){return 1-Math.pow(1-t,3)}(t);case kr.easeInOutCubic:return function(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}(t);case kr.easeInQuart:return function(t){return Math.pow(t,4)}(t);case kr.easeOutQuart:return function(t){return 1-Math.pow(1-t,4)}(t);case kr.easeInOutQuart:return function(t){return t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2}(t);case kr.easeInQuint:return function(t){return Math.pow(t,5)}(t);case kr.easeOutQuint:return function(t){return 1-Math.pow(1-t,5)}(t);case kr.easeInOutQuint:return function(t){return t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2}(t);case kr.easeInExpo:return function(t){return 0===t?0:Math.pow(2,10*t-10)}(t);case kr.easeOutExpo:return function(t){return 1===t?1:1-Math.pow(2,-10*t)}(t);case kr.easeInOutExpo:return function(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}(t);case kr.easeInCirc:return function(t){return 1-Math.sqrt(1-Math.pow(t,2))}(t);case kr.easeOutCirc:return function(t){return Math.sqrt(1-Math.pow(t-1,2))}(t);case kr.easeInOutCirc:return function(t){return t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2}(t);case kr.easeInBack:return function(t){return 2.70158*t*t*t-1.70158*t*t}(t);case kr.easeOutBack:return function(t){const e=1.70158;return 1+2.70158*Math.pow(t-1,3)+e*Math.pow(t-1,2)}(t);case kr.easeInOutBack:return function(t){const e=2.5949095;return t<.5?Math.pow(2*t,2)*(7.189819*t-e)/2:(Math.pow(2*t-2,2)*((e+1)*(2*t-2)+e)+2)/2}(t);case kr.easeInElastic:return function(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:-Math.pow(2,10*t-10)*Math.sin((10*t-10.75)*e)}(t);case kr.easeOutElastic:return function(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1}(t);case kr.easeInOutElastic:return function(t){const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1}(t);case kr.easeInBounce:return function(t){return 1-Dr(1-t)}(t);case kr.easeOutBounce:return Dr(t);case kr.easeInOutBounce:return function(t){return t<.5?(1-Dr(1-2*t))/2:(1+Dr(2*t-1))/2}(t);default:return t}var r}function Mr(t){return Mr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mr(t)}function Wr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Br(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Wr(Object(r),!0).forEach((function(e){$r(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Wr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ir(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ar(t,e){return Ar=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Ar(t,e)}function Hr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Qr(t);if(e){var o=Qr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return zr(this,r)}}function zr(t,e){if(e&&("object"===Mr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Nr(t)}function Nr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Vr(){return Vr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Xr(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},Vr.apply(this,arguments)}function Xr(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Qr(t)););return t}function Qr(t){return Qr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Qr(t)}function $r(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}!function(t){t.easeInSine="easeInSine",t.easeOutSine="easeOutSine",t.easeInOutSine="easeInOutSine",t.easeInQuad="easeInQuad",t.easeOutQuad="easeOutQuad",t.easeInOutQuad="easeInOutQuad",t.easeInCubic="easeInCubic",t.easeOutCubic="easeOutCubic",t.easeInOutCubic="easeInOutCubic",t.easeInQuart="easeInQuart",t.easeOutQuart="easeOutQuart",t.easeInOutQuart="easeInOutQuart",t.easeInQuint="easeInQuint",t.easeOutQuint="easeOutQuint",t.easeInOutQuint="easeInOutQuint",t.easeInExpo="easeInExpo",t.easeOutExpo="easeOutExpo",t.easeInOutExpo="easeInOutExpo",t.easeInCirc="easeInCirc",t.easeOutCirc="easeOutCirc",t.easeInOutCirc="easeInOutCirc",t.easeInBack="easeInBack",t.easeOutBack="easeOutBack",t.easeInOutBack="easeInOutBack",t.easeInElastic="easeInElastic",t.easeOutElastic="easeOutElastic",t.easeInOutElastic="easeInOutElastic",t.easeInBounce="easeInBounce",t.easeOutBounce="easeOutBounce",t.easeInOutBounce="easeInOutBounce"}(kr||(kr={}));var Ur=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ar(t,e)}(i,t);var e,r,n,o=Hr(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Ir(this,i),$r(Nr(e=o.call(this,t,!1)),"_progress",void 0),$r(Nr(e),"_easing",void 0),$r(Nr(e),"_nestedTimelines",void 0),e._progress=0,e._easing=0,e._nestedTimelines=[],r&&e.init(),e}return e=i,(r=[{key:"_getDefaultProp",value:function(){return Br(Br({},Vr(Qr(i.prototype),"_getDefaultProp",this).call(this)),{},{easing:this._app.prop.easing,scope:[0,1],useNestedEasingProgress:!1})}},{key:"progress",get:function(){return this._progress},set:function(t){this._progress=t,this._handleProgress()}},{key:"easing",get:function(){return this._easing}},{key:"addNestedTimeline",value:function(t){this._nestedTimelines.push(t)}},{key:"_handleProgress",value:function(){this._easing=function(t,e=!1){return e?Array.isArray(e)?Er(t,e):"function"==typeof e?e(t):Cr(t,e):t}(this._progress,this.prop.easing),this._callbacks.tbt("progress",{progress:this._progress,easing:this._easing}),this._renderNestedTimelines()}},{key:"_renderNestedTimelines",value:function(){var t=this._nestedTimelines.length;if(0!==t)for(var e=this.prop.useNestedEasingProgress?this.easing:this.progress,r=0,n=t;r<n;r+=1){var o=this._nestedTimelines[r],i=Z(et(e,o.prop.nestedScope),[0,1]);o.progress=i}}},{key:"_destroy",value:function(){Vr(Qr(i.prototype),"_destroy",this).call(this),this._nestedTimelines.forEach((function(t){t.destroy()}))}}])&&Fr(e.prototype,r),n&&Fr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(G);function Yr(t){return Yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yr(t)}function qr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Kr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?qr(Object(r),!0).forEach((function(e){cn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Jr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Zr(t,e){return Zr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Zr(t,e)}function tn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=sn(t);if(e){var o=sn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return en(this,r)}}function en(t,e){if(e&&("object"===Yr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return rn(t)}function rn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nn(){return nn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=on(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},nn.apply(this,arguments)}function on(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=sn(t)););return t}function sn(t){return sn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},sn(t)}function cn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var an=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zr(t,e)}(i,t);var e,r,n,o=tn(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Jr(this,i),cn(rn(e=o.call(this,t,!1)),"_isPlaying",void 0),cn(rn(e),"_isReversed",void 0),cn(rn(e),"_isPaused",void 0),cn(rn(e),"_animationFrame",void 0),cn(rn(e),"_animationFrameLastTime",void 0),e._isPlaying=!1,e._isReversed=!1,e._isPaused=!1,e._animationFrame=void 0,e._animationFrameLastTime=0,r&&e.init(),e}return e=i,(r=[{key:"_getDefaultProp",value:function(){return Kr(Kr({},nn(sn(i.prototype),"_getDefaultProp",this).call(this)),{},{duration:1e3,reset:!1,destroyOnEnd:!1})}},{key:"isPlaying",get:function(){return void 0!==this._animationFrame}},{key:"isReversed",get:function(){return this._isReversed}},{key:"isPaused",get:function(){return this._isPaused}},{key:"play",value:function(){this._destroyed||(this.prop.reset&&1===this.progress&&(this._progress=0),this._isReversed=!1,this._isPaused=!1,this.isPlaying||(this._animationFrameLastTime=+new Date,this._animate()))}},{key:"reverse",value:function(){this._destroyed||(this.prop.reset&&0===this.progress&&(this._progress=1),this._isReversed=!0,this._isPaused=!1,this.isPlaying||(this._animationFrameLastTime=+new Date,this._animate()))}},{key:"pause",value:function(){this._destroyed||(this._isPaused=!0,this._animationFrame&&window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}},{key:"_animate",value:function(){if(!this._isPaused){var t=this.isReversed,e=+new Date,r=Math.abs(this._animationFrameLastTime-e);this._animationFrameLastTime=e;var n=r/this.prop.duration/(t?-1:1),o=Z(this.progress+n,[0,1]);if(this.progress=o,1===o&&!t||0===o&&t)return this._isReversed=!1,this._isPaused=!1,void(this._animationFrame=void 0);this._animationFrame=window.requestAnimationFrame(this._animate.bind(this))}}},{key:"_handleProgress",value:function(){nn(sn(i.prototype),"_handleProgress",this).call(this);var t=this._progress;0===t?this.callbacks.tbt("start",!1):1===t&&(this.callbacks.tbt("end",!1),this.prop.destroyOnEnd&&this.destroy())}},{key:"_destroy",value:function(){this.pause(),nn(sn(i.prototype),"_destroy",this).call(this)}}])&&Gr(e.prototype,r),n&&Gr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(Ur);function un(t){return un="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},un(t)}function ln(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function fn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ln(Object(r),!0).forEach((function(e){wn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ln(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function pn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function dn(t,e){return dn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},dn(t,e)}function yn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=mn(t);if(e){var o=mn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return vn(this,r)}}function vn(t,e){if(e&&("object"===un(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return bn(t)}function bn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _n(){return _n="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=gn(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},_n.apply(this,arguments)}function gn(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=mn(t)););return t}function mn(t){return mn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},mn(t)}function wn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var On=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&dn(t,e)}(i,t);var e,r,n,o=yn(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(pn(this,i),wn(bn(e=o.call(this,t,!1)),"_container",void 0),wn(bn(e),"_startTime",void 0),wn(bn(e),"_endTime",void 0),wn(bn(e),"_toBeHidden",void 0),wn(bn(e),"_isHidden",void 0),wn(bn(e),"_pageLoadEvent",void 0),e.prop.container){var n=y(e.prop.container);n instanceof HTMLElement&&(e._container=n)}return e._container&&e._container.classList.add(e.prefix),e._startTime=+new Date,e._endTime=1/0,e._toBeHidden=!1,e._isHidden=!1,r&&e.init(),e}return e=i,r=[{key:"_getDefaultProp",value:function(){return fn(fn({},_n(mn(i.prototype),"_getDefaultProp",this).call(this)),{},{container:"#".concat(this.prefix),hide:250})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"preloader")}},{key:"container",get:function(){return this._container}},{key:"startTime",get:function(){return this._startTime}},{key:"endTime",get:function(){return this._endTime}},{key:"totalTime",get:function(){return this._endTime-this._startTime}},{key:"isHidden",get:function(){return this._isHidden}},{key:"_setEvents",value:function(){var t=this;_n(mn(i.prototype),"_setEvents",this).call(this),this._onLoaded().then((function(){t._endTime=+new Date,t._handleLoaded()}))}},{key:"_onLoaded",value:function(){var t=this;return new ye((function(e){t._app.pageLoad.loaded?e():t._pageLoadEvent=t._app.pageLoad.add("",(function(){e()}))}))}},{key:"_handleLoaded",value:function(){this.callbacks.tbt("loaded",!1),"boolean"!=typeof this.prop.hide&&this.hideContainer()}},{key:"hideContainer",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"boolean"!=typeof this.prop.hide?this.prop.hide:250;return this.callbacks.tbt("hide",!1),this._toBeHidden=!0,new ye((function(r){var n=t._container;if(!n)return t._handleHidden(),void r();n.style.transition="opacity ".concat(e,"ms, visibility ").concat(e,"ms"),n.style.opacity="0",n.style.visibility="hidden",l((function(){n.style.display="none",t._handleHidden(),r()}),e)}))}},{key:"_handleHidden",value:function(){this._isHidden=!0,this.callbacks.tbt("hidden",!1)}},{key:"onHide",value:function(t){if(!this._toBeHidden)return this.callbacks.add("hide",(function(){t()}));t()}},{key:"onHidden",value:function(t){if(!this._isHidden)return this.callbacks.add("hidden",(function(){t()}));t()}},{key:"_destroy",value:function(){var t;_n(mn(i.prototype),"_destroy",this).call(this),null===(t=this._pageLoadEvent)||void 0===t||t.remove()}}],r&&hn(e.prototype,r),n&&hn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(G);function Pn(t){return Pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pn(t)}function kn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function jn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?kn(Object(r),!0).forEach((function(e){Wn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function En(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Sn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Tn(t,e){return Tn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Tn(t,e)}function xn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Mn(t);if(e){var o=Mn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Rn(this,r)}}function Rn(t,e){if(e&&("object"===Pn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ln(t)}function Ln(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Dn(){return Dn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Cn(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},Dn.apply(this,arguments)}function Cn(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Mn(t)););return t}function Mn(t){return Mn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Mn(t)}function Wn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Bn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Tn(t,e)}(i,t);var e,r,n,o=xn(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return En(this,i),Wn(Ln(e=o.call(this,t,!1)),"_imgs",void 0),Wn(Ln(e),"_videos",void 0),Wn(Ln(e),"_customResources",void 0),Wn(Ln(e),"_resourcesTotal",void 0),Wn(Ln(e),"_resourcesLoaded",void 0),Wn(Ln(e),"_progress",void 0),Wn(Ln(e),"_animationFrame",void 0),Wn(Ln(e),"_endTimeline",void 0),e._imgs=[],e._videos=[],e._customResources=[],e._resourcesTotal=1+e.prop.resources,e._resourcesLoaded=0,e._progress=0,r&&e.init(),e}return e=i,r=[{key:"_getDefaultProp",value:function(){return jn(jn({},Dn(Mn(i.prototype),"_getDefaultProp",this).call(this)),{},{resources:0,loaders:{img:!0,video:!0,custom:".js-preload",ignoreClassName:"js-preload-ignore"},calc:{lerp:.1,forceEnd:500}})}},{key:"imgs",get:function(){return this._imgs}},{key:"videos",get:function(){return this._videos}},{key:"customResources",get:function(){return this._customResources}},{key:"resourcesTotal",get:function(){return this._resourcesTotal}},{key:"resourcesLoaded",get:function(){return this._resourcesLoaded}},{key:"loadProgress",get:function(){return this.resourcesLoaded/this.resourcesTotal}},{key:"progress",get:function(){return this._progress},set:function(t){this._progress=t,this._handleProgress()}},{key:"_constructor",value:function(){Dn(Mn(i.prototype),"_constructor",this).call(this),this._getResources()}},{key:"_setEvents",value:function(){var t=this;Dn(Mn(i.prototype),"_setEvents",this).call(this);var e=this.prop.calc.lerp;"number"==typeof e&&(this._animationFrame=new gt,this._animationFrame.addCallback("frame",(function(){t.progress=tt(t.progress,t.loadProgress,e)})),this._animationFrame.play()),this._preloadResources(),this._app.onPageLoaded().then((function(){t._handleLoadedResource()}))}},{key:"_onLoaded",value:function(){var t=this;return new ye((function(e){var r=!1;t.callbacks.add("progress",(function(t){t.progress>=1&&!r&&(e(),r=!0)}),{protected:!0})}))}},{key:"_getResources",value:function(){var t=this,e=this.prop.loaders;e.img&&v("img").forEach((function(r){r.classList.contains(e.ignoreClassName)||(t._imgs.push(r),t._resourcesTotal+=1)})),e.video&&v("video").forEach((function(r){r.classList.contains(e.ignoreClassName)||(t._videos.push(r),t._resourcesTotal+=1)})),e.custom&&(this._customResources=Array.from(v(e.custom)).filter((function(t){return!t.classList.contains(e.ignoreClassName)})),this._resourcesTotal+=this._customResources.length)}},{key:"_preloadResources",value:function(){var t=this;0===this._resourcesTotal&&(this._resourcesTotal=1,this._handleLoadedResource()),this._imgs.forEach((function(e){if(e.complete)t._handleLoadedResource();else{var r=new Image;e.addEventListener("load",(function(){t._handleLoadedResource()})),e.addEventListener("error",(function(){t._handleLoadedResource()})),r.src=e.currentSrc||e.src}})),this._videos.forEach((function(e){if(e.readyState>0)t._handleLoadedResource();else{if("none"===e.preload)return void t._handleLoadedResource();e.addEventListener("error",(function(){t._handleLoadedResource()})),e.addEventListener("loadedmetadata",(function(){t._handleLoadedResource()}))}})),this._customResources.forEach((function(e){t._seekCustomResourceLoaded(e).then((function(){t._handleLoadedResource()}))}))}},{key:"_seekCustomResourceLoaded",value:function(t){var e=this;return new Promise((function(r){t.isComplete||t.isLoaded||t.getAttribute("data-is-loaded")||t.getAttribute("is-loaded")?r():setTimeout((function(){e.destroyed||e._seekCustomResourceLoaded(t).then((function(){r()}))}),50)}))}},{key:"addResourcesLoaded",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=0;e<t;e+=1)this._handleLoadedResource()}},{key:"addResourcesTotal",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this._resourcesTotal+=t}},{key:"_handleLoadedResource",value:function(){this.loadProgress>=1||(this._resourcesLoaded+=1,this.callbacks.tbt("resourceLoad",!1),this._animationFrame||(this.progress=this.loadProgress))}},{key:"_handleProgress",value:function(){var t=this;if(this.callbacks.tbt("progress",{progress:this._progress}),this.progress>=1)this._animationFrame&&(this._animationFrame.destroy(),this._animationFrame=void 0);else if("number"==typeof this.prop.calc.forceEnd&&this.loadProgress>=1&&!this._endTimeline){this._animationFrame&&(this._animationFrame.destroy(),this._animationFrame=void 0),this._endTimeline=new an({duration:this.prop.calc.forceEnd});var e=this.progress;this._endTimeline.addCallback("progress",(function(r){var n=1-e;t.progress=e+n*r.progress})),this._endTimeline.play()}}},{key:"_destroy",value:function(){Dn(Mn(i.prototype),"_destroy",this).call(this),this._animationFrame&&this._animationFrame.destroy()}}],r&&Sn(e.prototype,r),n&&Sn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(On);function In(t){return In="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},In(t)}function Fn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function An(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Fn(Object(r),!0).forEach((function(e){qn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Fn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Hn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Nn(t,e){return Nn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Nn(t,e)}function Vn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Yn(t);if(e){var o=Yn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Xn(this,r)}}function Xn(t,e){if(e&&("object"===In(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Qn(t)}function Qn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $n(){return $n="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Un(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},$n.apply(this,arguments)}function Un(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Yn(t)););return t}function Yn(t){return Yn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Yn(t)}function qn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Kn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Nn(t,e)}(i,t);var e,r,n,o=Vn(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Hn(this,i),qn(Qn(e=o.call(this,t,!1)),"_container",void 0),qn(Qn(e),"_runtimeEvents",void 0),qn(Qn(e),"_isDragging",void 0),qn(Qn(e),"_pointerID",void 0),qn(Qn(e),"_coords",void 0),qn(Qn(e),"_prevCoords",void 0),qn(Qn(e),"_startCoords",void 0),e._container=y(e.prop.container),!h(e._container)&&!d(e._container))throw new Error("No container");return e._runtimeEvents=[],e._isDragging=!1,e._pointerID=null,e._coords={x:0,y:0},e._prevCoords={x:0,y:0},e._startCoords={x:0,y:0},r&&e.init(),e}return e=i,(r=[{key:"_getDefaultProp",value:function(){return An(An({},$n(Yn(i.prototype),"_getDefaultProp",this).call(this)),{},{container:"#".concat(this.prefix),usePassive:!1,enabled:!0})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"dragger")}},{key:"container",get:function(){return this._container}},{key:"isDragging",get:function(){return this._isDragging}},{key:"coords",get:function(){return this._coords}},{key:"startCoords",get:function(){return this._startCoords}},{key:"_setEvents",value:function(){var t=this.container,e=this.prop.usePassive;this.addEventListeners(t,"mousedown",this._handleStart.bind(this),{passive:e}),this.addEventListeners(t,"touchstart",this._handleStart.bind(this),{passive:e})}},{key:"_addRuntimeEvents",value:function(){var t=this.prop.usePassive;this._runtimeEvents.push(m(window,"mouseup",this._handleEnd.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"touchend",this._handleEnd.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"touchcancel",this.cancel.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"blur",this.cancel.bind(this),{passive:t}))}},{key:"_removeRuntimeEvents",value:function(){this._runtimeEvents.forEach((function(t){t.remove()})),this._runtimeEvents=[]}},{key:"_normalizeEvent",value:function(t){if(t.type.includes("touch")){var e=t,r=e.targetTouches[0]||e.changedTouches[0];return{x:r.clientX,y:r.clientY,id:r.identifier}}var n=t;return{x:n.clientX,y:n.clientY,id:null}}},{key:"_handleStart",value:function(t){if(!this.prop.enabled)return!1;if(this.isDragging)return!1;var e=this._normalizeEvent(t);if("mousedown"===t.type){if(1!==t.which)return!1;t.stopPropagation()}return this._isDragging=!0,this._pointerID=e.id,this._coords={x:e.x,y:e.y},this._prevCoords={x:e.x,y:e.y},this._startCoords={x:e.x,y:e.y},this._addRuntimeEvents(),this.callbacks.tbt("start",{evt:t}),!0}},{key:"_handleEnd",value:function(t){var e=this._normalizeEvent(t);return!(!this.isDragging||e.id!==this._pointerID||(this.cancel(),0))}},{key:"cancel",value:function(){this._removeRuntimeEvents(),this._isDragging=!1,this.callbacks.tbt("end",!1)}},{key:"_destroy",value:function(){$n(Yn(i.prototype),"_destroy",this).call(this),this._removeRuntimeEvents()}}])&&zn(e.prototype,r),n&&zn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(G);function Jn(t){return Jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jn(t)}function Gn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Zn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function to(){return to="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=eo(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},to.apply(this,arguments)}function eo(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=io(t)););return t}function ro(t,e){return ro=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},ro(t,e)}function no(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=io(t);if(e){var o=io(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return oo(this,r)}}function oo(t,e){if(e&&("object"===Jn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function io(t){return io=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},io(t)}var so=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ro(t,e)}(i,t);var e,r,n,o=no(i);function i(){return Gn(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"stepCoords",get:function(){return{x:this._coords.x-this._prevCoords.x,y:this._coords.y-this._prevCoords.y}}},{key:"_addRuntimeEvents",value:function(){to(io(i.prototype),"_addRuntimeEvents",this).call(this);var t=this.prop.usePassive;this._runtimeEvents.push(m(window,"mousemove",this._handleMove.bind(this),{passive:t})),this._runtimeEvents.push(m(window,"touchmove",this._handleMove.bind(this),{passive:t}))}},{key:"_handleMove",value:function(t){var e=this._normalizeEvent(t);return!(!this.isDragging||e.id!==this._pointerID||(this._prevCoords={x:this._coords.x,y:this._coords.y},this._coords={x:e.x,y:e.y},this.callbacks.tbt("move",{evt:t,start:this.startCoords,coords:this.coords,step:this.stepCoords}),0))}},{key:"_destroy",value:function(){to(io(i.prototype),"_destroy",this).call(this)}}])&&Zn(e.prototype,r),n&&Zn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(Kn);function co(t){return co="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},co(t)}function ao(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function uo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ao(Object(r),!0).forEach((function(e){lo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ao(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function lo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function po(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ho(){return ho="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=yo(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},ho.apply(this,arguments)}function yo(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=go(t)););return t}function vo(t,e){return vo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},vo(t,e)}function bo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=go(t);if(e){var o=go(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _o(this,r)}}function _o(t,e){if(e&&("object"===co(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function go(t){return go=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},go(t)}var mo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vo(t,e)}(i,t);var e,r,n,o=bo(i);function i(){return fo(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"_getDefaultProp",value:function(){return uo(uo({},ho(go(i.prototype),"_getDefaultProp",this).call(this)),{},{min:75})}},{key:"_handleEnd",value:function(t){var e=ho(go(i.prototype),"_handleEnd",this).call(this,t);if(!e)return e;var r=this._normalizeEvent(t),n=this.startCoords,o=Math.abs(this.prop.min);return n.y>r.y&&Math.abs(r.y-n.y)>=o&&this.callbacks.tbt("up",!1),n.y<r.y&&Math.abs(r.y-n.y)>=o&&this.callbacks.tbt("down",!1),n.x>r.x&&Math.abs(r.x-n.x)>=o&&this.callbacks.tbt("left",!1),n.x<r.x&&Math.abs(r.x-n.x)>=o&&this.callbacks.tbt("right",!1),!0}}])&&po(e.prototype,r),n&&po(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(Kn);function wo(t){return wo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wo(t)}function Oo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Po(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Oo(Object(r),!0).forEach((function(e){Co(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Oo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ko(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function jo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Eo(){return Eo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=So(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},Eo.apply(this,arguments)}function So(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Do(t)););return t}function To(t,e){return To=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},To(t,e)}function xo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Do(t);if(e){var o=Do(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ro(this,r)}}function Ro(t,e){if(e&&("object"===wo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Lo(t)}function Lo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Do(t){return Do=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Do(t)}function Co(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Mo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&To(t,e)}(i,t);var e,r,n,o=xo(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];ko(this,i),Co(Lo(e=o.call(this,t,!1)),"_canvas",void 0),Co(Lo(e),"_ctx",void 0),Co(Lo(e),"_width",void 0),Co(Lo(e),"_height",void 0),Co(Lo(e),"_dpr",void 0),e._width=0,e._height=0,e._dpr=1;var n=e.prop,s=n.append,c=n.container,a=s&&c?c:void 0;return e._canvas=_("canvas",{parent:a}),e._ctx=e._canvas.getContext("2d"),e.prop.initialResize&&e.resize(),r&&e.init(),e}return e=i,(r=[{key:"container",get:function(){return this.prop.container}},{key:"canvas",get:function(){return this._canvas}},{key:"ctx",get:function(){return this._ctx}},{key:"width",get:function(){return this._width}},{key:"nonDPRWidth",get:function(){return this.width/this.dpr}},{key:"height",get:function(){return this._height}},{key:"nonDPRHeight",get:function(){return this.height/this.dpr}},{key:"dpr",get:function(){return this._dpr}},{key:"_getDefaultProp",value:function(){return Po(Po({},Eo(Do(i.prototype),"_getDefaultProp",this).call(this)),{},{container:!1,append:!0,updateOnResize:!1,initialResize:!0,resizeTimeout:0,width:!1,height:!1,dpr:!1})}},{key:"_setEvents",value:function(){var t=this;if(Eo(Do(i.prototype),"_setEvents",this).call(this),!1!==this.prop.updateOnResize){var e="boolean"==typeof this.prop.updateOnResize?"":this.prop.updateOnResize;this.addViewportCallback(e,(function(){t.resize()}),{timeout:this.prop.resizeTimeout}),this.resize()}}},{key:"_onPropMutate",value:function(){Eo(Do(i.prototype),"_onPropMutate",this).call(this),this.resize()}},{key:"resize",value:function(){var t=this.prop,e=this.canvas;if(e){var r=this._app.viewport;"number"==typeof t.dpr?this._dpr=t.dpr:this._dpr=r.dpr;var n=this._dpr,o=0,i=0;"number"==typeof t.width&&"number"==typeof t.height?(o=t.width,i=t.height):this.container?(o=this.container.clientWidth,i=this.container.clientHeight):(o=r.width,i=r.height),o*=n,i*=n,this._width=o,this._height=i,e.width=o,e.height=i,this.callbacks.tbt("resize",!1)}}},{key:"_destroy",value:function(){Eo(Do(i.prototype),"_destroy",this).call(this),this.canvas&&this.canvas.remove()}}])&&jo(e.prototype,r),n&&jo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(G);function Wo(t){const e=function(t){if("container"in t)return{width:t.container.clientWidth,height:t.container.clientHeight};return{width:t.width,height:t.height}}(t),r=function(t){const{source:e}=t;if(t.sourceWidth&&t.sourceHeight)return{width:t.sourceWidth,height:t.sourceHeight};if(e instanceof HTMLVideoElement)return{width:e.videoWidth,height:e.videoHeight};if(e instanceof HTMLImageElement)return{width:e.naturalWidth,height:e.naturalHeight};return{width:e.width,height:e.height}}(t);let n;return"cover"===t.rule?n=function(t,e,r){let n=e.width*Bo(t),o=r.height*n/r.width;o/Bo(t)<e.height&&(o=e.height*Bo(t),n=r.width*o/r.height);const i=(e.width-n)/2,s=(e.height-o)/2;return{width:n,height:o,x:i,y:s}}(t,e,r):"contain"===t.rule?n=function(t,e,r){let n=0,o=0;const i=r.width/r.height;e.width>e.height?(o=e.height,n=o*i,n>e.width&&(n=e.width,o=n/i)):e.height>=e.width&&(n=e.width,o=n/i,o>e.height&&(o=e.height,n=o*i));n*=Bo(t),o*=Bo(t);const s=(e.width-n)/2,c=(e.height-o)/2;return{width:n,height:o,x:s,y:c}}(t,e,r):"top-left"===t.rule?n=function(t,e){const r=e.width*Bo(t),n=e.height*Bo(t);return{width:r,height:n,x:0,y:0}}(t,r):"top-right"===t.rule?n=function(t,e,r){const n=r.width*Bo(t),o=r.height*Bo(t),i=e.width-r.width;return{width:n,height:o,x:i,y:0}}(t,e,r):"bottom-left"===t.rule?n=function(t,e,r){const n=r.width*Bo(t),o=r.height*Bo(t),i=e.height-r.height;return{width:n,height:o,x:0,y:i}}(t,e,r):"bottom-right"===t.rule?n=function(t,e,r){const n=r.width*Bo(t),o=r.height*Bo(t),i=e.width-r.width,s=e.height-r.height;return{width:n,height:o,x:i,y:s}}(t,e,r):"center"===t.rule&&(n=function(t,e,r){const n=r.width*Bo(t),o=r.height*Bo(t),i=(e.width-r.width)/2,s=(e.height-r.height)/2;return{width:n,height:o,x:i,y:s}}(t,e,r)),Object.assign(n,{sourceWidth:r.width,sourceHeight:r.height})}function Bo(t){return void 0!==t.scale?t.scale:1}function Io(t){return Io="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Io(t)}function Fo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ao(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Fo(Object(r),!0).forEach((function(e){Ho(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Fo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ho(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function zo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function No(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Vo(){return Vo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Xo(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},Vo.apply(this,arguments)}function Xo(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Yo(t)););return t}function Qo(t,e){return Qo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Qo(t,e)}function $o(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Yo(t);if(e){var o=Yo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Uo(this,r)}}function Uo(t,e){if(e&&("object"===Io(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Yo(t){return Yo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Yo(t)}var qo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qo(t,e)}(i,t);var e,r,n,o=$o(i);function i(){return zo(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"_getDefaultProp",value:function(){return Ao(Ao({},Vo(Yo(i.prototype),"_getDefaultProp",this).call(this)),{},{media:!1,posRule:"cover"})}},{key:"resize",value:function(){Vo(Yo(i.prototype),"resize",this).call(this),this._prerender()}},{key:"_prerender",value:function(){if(0!==this.width&&0!==this.height){var t=this.prop.media;if(t){var e,r,n;t instanceof Mo?(e=t.canvas,r=t.width,n=t.height):e=t;var o=Wo({source:e,sourceWidth:r,sourceHeight:n,rule:this.prop.posRule,scale:1,width:this.width,height:this.height});this._ctx.clearRect(0,0,this.width,this.height),this._ctx.drawImage(e,o.x,o.y,o.width,o.height),this.callbacks.tbt("prerender",!1)}}}}])&&No(e.prototype,r),n&&No(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(Mo);function Ko(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Jo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Go=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Jo(this,"_prop",void 0),Jo(this,"_outer",void 0),Jo(this,"_thumb",void 0),Jo(this,"_outerHeight",void 0),Jo(this,"_outerWidth",void 0),Jo(this,"_thumbHeight",void 0),Jo(this,"_thumbWidth",void 0),Jo(this,"_scrollVal",void 0),Jo(this,"_coordsAtDragStart",void 0),Jo(this,"_listeners",void 0),Jo(this,"_scrollEvent",void 0),Jo(this,"_actionTimeout",void 0),Jo(this,"_dragger",void 0),this._prop=e;var r=e.prefix,n=e.dir,o=e.domParent,i=e.container,s=e.autoHide;this._outerHeight=0,this._outerWidth=0,this._thumbHeight=0,this._thumbWidth=0,this._scrollVal=0,this._coordsAtDragStart={left:0,top:0},this._scrollEvent=void 0,this._actionTimeout=void 0,this._dragger=void 0;var c="".concat(r," ").concat(r,"_").concat(n);i instanceof Window&&(c+=" in-window"),this._outer=_("div",{parent:o,class:c}),this._thumb=_("div",{parent:this._outer,class:"".concat(r,"__thumb ").concat(r,"__thumb_").concat(n)}),s&&this.outer.classList.add("auto-hide"),this._listeners=[],this._setEvents()}var e,r,n;return e=t,(r=[{key:"outer",get:function(){return this._outer}},{key:"thumb",get:function(){return this._thumb}},{key:"prefix",get:function(){return this._prop.prefix}},{key:"isX",get:function(){return"x"===this.prop.dir}},{key:"isY",get:function(){return!this.isX}},{key:"scrollElement",get:function(){return this.prop.container instanceof Window?document.documentElement:this.prop.container}},{key:"scrollLine",get:function(){var t=this.scrollElement;return this.isX?t.scrollWidth-t.clientWidth:t.scrollHeight-t.clientHeight}},{key:"scrollWidth",get:function(){return this.scrollElement.scrollWidth}},{key:"scrollHeight",get:function(){return this.scrollElement.scrollHeight}},{key:"prop",get:function(){return this._prop}},{key:"scrollValues",get:function(){var t=this.prop.container,e=0,r=0;return t instanceof Window?(e=t.pageYOffset,r=t.pageXOffset):t instanceof Ct?(e=t.targetTop,r=t.targetLeft):(e=t.scrollTop,r=t.scrollLeft),{left:r,top:e}}},{key:"_setEvents",value:function(){var t=this;this._listeners.push(m(this.outer,"mouseenter",this._handleHover.bind(this,!0))),this._listeners.push(m(this.outer,"mouseleave",this._handleHover.bind(this,!1))),this._scrollEvent=Wt({container:this.prop.container,callback:function(e){t._handleScroll(e)}}),this.prop.isDraggable&&(this._dragger=new so({container:this.thumb}),this._dragger.addCallback("start",(function(){t.thumb.classList.add("in-action"),t._disableScrollBehaviour(!0),t._coordsAtDragStart=t.scrollValues})),this._dragger.addCallback("move",(function(e){t._handleThumbDrag(e)})),this._dragger.addCallback("end",(function(){t.thumb.classList.remove("in-action"),t._disableScrollBehaviour(!1)})))}},{key:"_disableScrollBehaviour",value:function(t){var e=t?"auto":"unset";(this.prop.container instanceof Window||this.prop.container instanceof HTMLElement)&&(document.documentElement.style.scrollBehavior=e)}},{key:"_handleHover",value:function(t){this.outer.classList.toggle("is-hovered",t)}},{key:"_handleScroll",value:function(t){var e=this;this.prop.optimizeCalculations||this.resize();var r=!1;this.isX?(r=t.scrollLeft!==this._scrollVal,this._scrollVal=t.scrollLeft):(r=t.scrollTop!==this._scrollVal,this._scrollVal=t.scrollTop),r&&(this.prop.autoHide&&r&&(this.outer.classList.add("in-action"),this._actionTimeout&&(clearTimeout(this._actionTimeout),this._actionTimeout=void 0),this._actionTimeout=setTimeout((function(){e.outer.classList.remove("in-action")}),500)),this.prop.optimizeCalculations&&this._renderThumb())}},{key:"_handleThumbDrag",value:function(t){t.evt.preventDefault();var e=this.prop.container,r=(t.coords.x-t.start.x)/(this._outerWidth-this._thumbWidth)*this.scrollLine,n=(t.coords.y-t.start.y)/(this._outerHeight-this._thumbHeight)*this.scrollLine,o=this._coordsAtDragStart,i=o.left,s=o.top;this.isX?i+=r:s+=n,e.scrollTo({top:s,left:i,behavior:e instanceof Ct?this.prop.draggableScrollBehavior:"auto"})}},{key:"_renderThumb",value:function(){var t=Z(this._scrollVal/this.scrollLine,[0,1]),e=this.isX?(this._outerWidth-this._thumbWidth)*t:0,r=this.isY?(this._outerHeight-this._thumbHeight)*t:0;this._thumb.style.transform="translate(".concat(e,"px, ").concat(r,"px)")}},{key:"resize",value:function(){var t=this.outer,e=this.thumb,r=this.scrollLine,n=this.prop.minSize;if(this._outerHeight=t.clientHeight,this._outerWidth=t.clientWidth,this.prop.autoSize)if(this.isX){var o=Z(this._outerWidth/(this.scrollWidth/(this.scrollWidth-r)),[n,1/0]);e.style.width="".concat(o,"px")}else{var i=Z(this._outerHeight/(this.scrollHeight/(this.scrollHeight-r)),[n,1/0]);e.style.height="".concat(i,"px")}this._thumbHeight=e.clientHeight,this._thumbWidth=e.clientWidth,t.classList.toggle("is-empty",0===r),this._renderThumb()}},{key:"destroy",value:function(){this._listeners.forEach((function(t){t.remove()})),this._scrollEvent&&this._scrollEvent.remove(),this._actionTimeout&&clearTimeout(this._actionTimeout),this._dragger&&this._dragger.destroy(),this._outer.remove()}}])&&Ko(e.prototype,r),n&&Ko(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Zo(t){return Zo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zo(t)}function ti(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ei(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ti(Object(r),!0).forEach((function(e){fi(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ti(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ri(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ni(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function oi(t,e){return oi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},oi(t,e)}function ii(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=li(t);if(e){var o=li(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return si(this,r)}}function si(t,e){if(e&&("object"===Zo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ci(t)}function ci(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ai(){return ai="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=ui(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},ai.apply(this,arguments)}function ui(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=li(t)););return t}function li(t){return li=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},li(t)}function fi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var pi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&oi(t,e)}(i,t);var e,r,n,o=ii(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];ri(this,i),fi(ci(e=o.call(this,t,!1)),"_container",void 0),fi(ci(e),"_scrollWrapper",void 0),fi(ci(e),"_xBar",void 0),fi(ci(e),"_yBar",void 0);var n=e.prop,s=n.autoHide,c=n.autoSize,a=n.minSize,u=n.optimizeCalculations,l=n.isDraggable,f=n.draggableScrollBehavior;if("string"==typeof e.prop.container){var p=y(e.prop.container);if(!p)throw new Error("No scroll container");e._container=p}else e._container=e.prop.container;if(e.container instanceof Element){var h=e.container.parentElement;h&&(e._scrollWrapper=_("div"),e._scrollWrapper.style.position="relative",e._scrollWrapper.style.display="inline-block",h.insertBefore(e._scrollWrapper,e.container),e._scrollWrapper.appendChild(e.container),e._scrollWrapper.classList.add("".concat(e.prefix,"-wrapper")))}var d={container:e.container,domParent:e.domParent,autoHide:s,autoSize:c,minSize:a,optimizeCalculations:u,prefix:e.prefix,isDraggable:l,draggableScrollBehavior:f};return e._xBar=new Go(ei({dir:"x"},d)),e._yBar=new Go(ei({dir:"y"},d)),e.scrollableElement.classList.add("".concat(e.prefix,"-parent")),r&&e.init(),e}return e=i,(r=[{key:"_getDefaultProp",value:function(){return ei(ei({},ai(li(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window,domParent:!1,draggable:!0,autoSize:!0,autoHide:!0,minSize:50,optimizeCalculations:!1,resizeTimeout:0,isDraggable:!0,draggableScrollBehavior:"smooth"})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"scrollbar")}},{key:"container",get:function(){return this._container}},{key:"scrollableElement",get:function(){var t=this.container;return t instanceof Window?this._app.body:t instanceof Element?t:t.outer}},{key:"domParent",get:function(){var t=this.prop.domParent,e=this.container;return t||(this._scrollWrapper?this._scrollWrapper:e instanceof Window?this._app.body:e instanceof Element?e:e.outer)}},{key:"_setEvents",value:function(){var t=this;ai(li(i.prototype),"_setEvents",this).call(this);var e=this.container;e instanceof Ct?e.addCallback("resize",(function(){t.resize()}),{name:this.name}):this.addViewportCallback("",(function(){t.resize()}),{timeout:this.prop.resizeTimeout}),this.resize()}},{key:"_onPropMutate",value:function(){ai(li(i.prototype),"_onPropMutate",this).call(this),this.resize()}},{key:"resize",value:function(){this._xBar.resize(),this._yBar.resize()}},{key:"_destroy",value:function(){if(ai(li(i.prototype),"_destroy",this).call(this),this._xBar.destroy(),this._yBar.destroy(),this._scrollWrapper&&this.container instanceof Element){var t=this._scrollWrapper.parentElement;t&&t.insertBefore(this.container,this._scrollWrapper),this._scrollWrapper.remove()}this.scrollableElement.classList.remove("".concat(this.prefix,"-parent"))}}])&&ni(e.prototype,r),n&&ni(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(G);function hi(t){return hi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hi(t)}function di(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function yi(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?di(Object(r),!0).forEach((function(e){ji(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):di(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function vi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function _i(t,e){return _i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},_i(t,e)}function gi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ki(t);if(e){var o=ki(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return mi(this,r)}}function mi(t,e){if(e&&("object"===hi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return wi(t)}function wi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Oi(){return Oi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Pi(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},Oi.apply(this,arguments)}function Pi(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ki(t)););return t}function ki(t){return ki=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ki(t)}function ji(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ei=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_i(t,e)}(i,t);var e,r,n,o=gi(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return vi(this,i),ji(wi(e=o.call(this,t,!1)),"_scrollContainer",void 0),"string"==typeof e.prop.container?e._scrollContainer=y(e.prop.container):e._scrollContainer=e.prop.container,r&&e.init(),e}return e=i,(r=[{key:"_getDefaultProp",value:function(){return yi(yi({},Oi(ki(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window})}},{key:"scrollContainer",get:function(){return this._scrollContainer}},{key:"scrollableElement",get:function(){return this._scrollContainer instanceof Window?this._app.html:this._scrollContainer}},{key:"domParent",get:function(){var t=this.scrollContainer;return t instanceof Window?this._app.body:t instanceof Element?t:t.outer}},{key:"intersectionRoot",get:function(){var t=this.scrollContainer;return t instanceof Window?null:t instanceof Element?t:t.outer}},{key:"scrollContainerBounding",get:function(){if(this.intersectionRoot){var t=this.intersectionRoot.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}return{top:0,left:0,width:this._app.viewport.width,height:this._app.viewport.height}}}])&&bi(e.prototype,r),n&&bi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(G);function Si(t){return Si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Si(t)}function Ti(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function xi(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ti(Object(r),!0).forEach((function(e){zi(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ti(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ri(t){return function(t){if(Array.isArray(t))return Li(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Li(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Li(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Li(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Di(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ci(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Mi(t,e){return Mi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Mi(t,e)}function Wi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Hi(t);if(e){var o=Hi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Bi(this,r)}}function Bi(t,e){if(e&&("object"===Si(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ii(t)}function Ii(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Fi(){return Fi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Ai(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},Fi.apply(this,arguments)}function Ai(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Hi(t)););return t}function Hi(t){return Hi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Hi(t)}function zi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ni=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Mi(t,e)}(i,t);var e,r,n,o=Wi(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Di(this,i),zi(Ii(e=o.call(this,t,!1)),"_scrollEvent",void 0),zi(Ii(e),"_intersectionObserverIn",void 0),zi(Ii(e),"_intersectionObserverOut",void 0),zi(Ii(e),"_firstStart",void 0),zi(Ii(e),"_elements",void 0),e._scrollEvent=void 0,e._intersectionObserverIn=void 0,e._intersectionObserverOut=void 0,e._firstStart=!0,e._elements=Ri(e.prop.elements),r&&e.init(),e}return e=i,r=[{key:"prefix",get:function(){return"".concat(this._app.prefix,"scroll-view")}},{key:"_getDefaultProp",value:function(){return xi(xi({},Fi(Hi(i.prototype),"_getDefaultProp",this).call(this)),{},{enabled:!0,container:window,elements:[],threshold:.9,states:"in",classToToggle:"viewed",useDelay:!1,useIntersectionObserver:!0,resizeTimeout:0})}},{key:"elements",get:function(){return this._elements}},{key:"init",value:function(){Fi(Hi(i.prototype),"init",this).call(this)}},{key:"_setEvents",value:function(){var t=this;Fi(Hi(i.prototype),"_setEvents",this).call(this),this.resize(),this.addViewportCallback("",(function(){t.resize()}),{timeout:this.prop.resizeTimeout})}},{key:"_onPropMutate",value:function(){Fi(Hi(i.prototype),"_onPropMutate",this).call(this),this.resize()}},{key:"resize",value:function(){this._removeViewEvents(),this.prop.enabled&&(this._setViewEvents(),this.seekBounding())}},{key:"_setViewEvents",value:function(){var t=this;if(Bt()&&this.prop.useIntersectionObserver){var e=this.scrollContainerBounding,r=this._firstStart?0:e.width*(1-this.prop.threshold)*-1,n=this._firstStart?0:e.height*(1-this.prop.threshold)*-1;this._intersectionObserverIn=new IntersectionObserver(this._handleIntersectionObserverIn.bind(this),{root:this.intersectionRoot,threshold:0,rootMargin:"0px ".concat(r,"px ").concat(n,"px 0px")}),this.elements.forEach((function(e){var r;null===(r=t._intersectionObserverIn)||void 0===r||r.observe(e)})),"inout"===this.prop.states&&(this._intersectionObserverOut=new IntersectionObserver(this._handleIntersectionObserverOut.bind(this),{root:this.intersectionRoot,threshold:0,rootMargin:"0px 0px 0px 0px"}),this.elements.forEach((function(e){var r;null===(r=t._intersectionObserverOut)||void 0===r||r.observe(e)})))}else this._scrollEvent=Wt({container:this.prop.container,callback:this._handleScroll.bind(this)})}},{key:"_removeViewEvents",value:function(){var t,e;this._scrollEvent&&(this._scrollEvent.remove(),this._scrollEvent=void 0),null===(t=this._intersectionObserverIn)||void 0===t||t.disconnect(),this._intersectionObserverIn=void 0,null===(e=this._intersectionObserverOut)||void 0===e||e.disconnect(),this._intersectionObserverOut=void 0}},{key:"_handleIntersectionObserverIn",value:function(t){for(var e=!!this._firstStart&&this.scrollContainerBounding,r=0;r<t.length;r+=1){var n=t[r],o=0;this._firstStart&&e&&n.isIntersecting&&(o=this._elementInViewportData(n.target,e).delay),n.isIntersecting&&this._handleInOut(n.target,n.isIntersecting,o)}this._processUnusedElements(),this._firstStart&&(this._firstStart=!1,this.resize())}},{key:"_handleIntersectionObserverOut",value:function(t){for(var e=0;e<t.length;e+=1){var r=t[e];r.isIntersecting||this._handleInOut(r.target,r.isIntersecting,0)}}},{key:"_handleScroll",value:function(){this.seekBounding()}},{key:"seekBounding",value:function(){if(!Bt()||!this.prop.useIntersectionObserver){for(var t=this.scrollContainerBounding,e=0;e<this.elements.length;e+=1){var r=this.elements[e],n=this._elementInViewportData(r,t),o=n.isIntersecting?n.delay:0;"boolean"==typeof n.isIntersecting&&this._handleInOut(r,n.isIntersecting,o)}this._processUnusedElements(),this._firstStart&&(this._firstStart=!1)}}},{key:"_elementInViewportData",value:function(t,e){var r,n=this.prop,o=n.threshold,i=n.states,s=n.useDelay,c=this._firstStart?1:o,a=t.getBoundingClientRect();a.top<e.top+e.height*c&&a.left<e.left+e.width*c?r="in"===i||!(a.right<e.left*c||a.bottom<e.top*c):(a.top>e.top+e.height||a.left>e.left+e.width)&&(r=!1);var u=0;return s&&this._firstStart&&(u=Z("x"===s.dir?(a.left-e.left)/e.width:(a.top-e.top)/e.height,[0,1])*s.max),{isIntersecting:r,delay:u}}},{key:"_handleInOut",value:function(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=this.prop.states;t.scrollViewIn&&e||!t.scrollViewIn&&!e||(t.scrollViewIn=e,this.prop.classToToggle&&l((function(){t.classList.toggle(r.prop.classToToggle,e)}),n),!e||"in"!==o&&"inout"!==o?e||"inout"!==o||l((function(){r.callbacks.tbt("out",t)}),n):l((function(){r.callbacks.tbt("in",t)}),n))}},{key:"_processUnusedElements",value:function(){var t=this;"in"===this.prop.states&&(this._elements.filter((function(t){return t.scrollViewIn})).forEach((function(e){var r,n;null===(r=t._intersectionObserverIn)||void 0===r||r.unobserve(e),null===(n=t._intersectionObserverOut)||void 0===n||n.unobserve(e)})),this._elements=this._elements.filter((function(t){return!t.scrollViewIn})))}},{key:"addElement",value:function(t){var e,r,n=this;return t.scrollViewIn=void 0,this._elements.push(t),null===(e=this._intersectionObserverIn)||void 0===e||e.observe(t),null===(r=this._intersectionObserverOut)||void 0===r||r.observe(t),this.prop.enabled&&this.seekBounding(),{remove:function(){n.removeElement(t)}}}},{key:"removeElement",value:function(t){var e,r;t.scrollViewIn=void 0,this._elements=this._elements.filter((function(e){return e!==t})),null===(e=this._intersectionObserverIn)||void 0===e||e.unobserve(t),null===(r=this._intersectionObserverOut)||void 0===r||r.unobserve(t)}},{key:"removeElements",value:function(){var t=this;this._elements.forEach((function(e){t.removeElement(e)})),this._elements=[]}},{key:"_destroy",value:function(){Fi(Hi(i.prototype),"_destroy",this).call(this),this._removeViewEvents()}}],r&&Ci(e.prototype,r),n&&Ci(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(Ei);function Vi(t){return Vi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vi(t)}function Xi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function $i(){return $i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Ui(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},$i.apply(this,arguments)}function Ui(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ji(t)););return t}function Yi(t,e){return Yi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Yi(t,e)}function qi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ji(t);if(e){var o=Ji(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ki(this,r)}}function Ki(t,e){if(e&&("object"===Vi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ji(t){return Ji=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ji(t)}var Gi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Yi(t,e)}(i,t);var e,r,n,o=qi(i);function i(){return Xi(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"_setEvents",value:function(){var t=this;$i(Ji(i.prototype),"_setEvents",this).call(this),this.addEventListeners(window,"keydown",(function(e){t._handleKeydown(e)}))}},{key:"_handleKeydown",value:function(t){var e=this._component;if(e.prop.enabled)if(9!==t.keyCode){var r=document.activeElement;if(!r||!(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement)){var n=this._app.viewport,o=e.outer.getBoundingClientRect();if(o.left<n.width&&o.right>0&&o.top<n.height&&o.bottom>0){var i=40;switch(t.keyCode){case 38:e.targetTop-=i;break;case 40:e.targetTop+=i;break;case 39:e.targetLeft+=i;break;case 37:e.targetLeft-=i;break;case 34:e.targetTop+=400;break;case 33:e.targetTop-=400;break;case 36:e.targetTop=0,e.targetLeft=0;break;case 35:e.targetTop=e.scrollHeight,e.targetLeft=e.scrollWidth;break;case 32:e.targetTop+=200}}}}else this._handleTab()}},{key:"_handleTab",value:function(){var t=this;l((function(){var e=t._component,r=document.activeElement;if(r instanceof HTMLElement&&f(r,e.outer)){var n=e.outer.getBoundingClientRect(),o=r.getBoundingClientRect(),i=e.scrollTop+(o.top-n.top)-(e.clientHeight/2-o.height/2),s=e.scrollLeft+(o.left-n.left)-(e.clientWidth/2-o.width/2);e.targetTop=i,e.targetLeft=s}}),120)}}])&&Qi(e.prototype,r),n&&Qi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(Ke);function Zi(t){return Zi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zi(t)}function ts(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function es(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ts(Object(r),!0).forEach((function(e){ls(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ts(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function rs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ns(t,e){return ns=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},ns(t,e)}function os(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=us(t);if(e){var o=us(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return is(this,r)}}function is(t,e){if(e&&("object"===Zi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ss(t)}function ss(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function cs(){return cs="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=as(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},cs.apply(this,arguments)}function as(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=us(t)););return t}function us(t){return us=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},us(t)}function ls(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var fs="is-dragging",ps=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ns(t,e)}(i,t);var e,r,n,o=os(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),ls(ss(e=o.call(this,t)),"_dragger",void 0),ls(ss(e),"_componentEvents",void 0),ls(ss(e),"_currentLerp",void 0),e._dragger=void 0,e._componentEvents=[],e._currentLerp=!1,e}return e=i,r=[{key:"_getDefaultProp",value:function(){return es(es({},cs(us(i.prototype),"_getDefaultProp",this).call(this)),{},{enabled:!0,speed:1,lerp:!1,reverseDir:!1,stopPropagation:!1})}},{key:"isDragging",get:function(){return!!this._dragger&&this._dragger.isDragging}},{key:"_constructor",value:function(){cs(us(i.prototype),"_constructor",this).call(this),this._toggleDragger()}},{key:"_onPropMutate",value:function(){cs(us(i.prototype),"_onPropMutate",this).call(this),this._toggleDragger()}},{key:"_toggleDragger",value:function(){this.prop.enabled?this._addDragger():this._removeDragger()}},{key:"_addDragger",value:function(){var t=this;if(!this._dragger){var e=this.component;this._dragger=new so({container:e.outer}),this._dragger.addCallback("start",this._handleDragStart.bind(this)),this._dragger.addCallback("move",(function(e){t._handleDragMove(e)})),this._dragger.addCallback("end",this._handleDragEnd.bind(this)),this._componentEvents.push(e.addCallback("wheel",(function(){var e;null===(e=t._dragger)||void 0===e||e.cancel()})))}}},{key:"_removeDragger",value:function(){this._dragger&&(this._dragger.destroy(),this._dragger=void 0,this._componentEvents.forEach((function(t){t.remove()})),this._componentEvents=[])}},{key:"_handleDragStart",value:function(){var t=this.component;if(t.prop.enabled&&!(t.maxScrollableWidth<=0&&t.maxScrollableHeight<=0)){var e=this.prop.lerp;"boolean"!=typeof e&&(this._currentLerp=t.prop.render.lerp,t.changeProp({render:{lerp:e}})),this._callbacks.tbt("start",!1)}}},{key:"_handleDragMove",value:function(t){var e=this.component;if(e.prop.enabled&&!(e.maxScrollableWidth<=0&&e.maxScrollableHeight<=0)){var r=t.evt,n=this.prop.stopPropagation;if(n){if(!r.cancelable)return;var o=Math.abs(t.coords.x-t.start.x),i=Math.abs(t.coords.y-t.start.y);(o>n.threshold&&"x"===n.dir||i>n.threshold&&"y"===n.dir)&&r.cancelable&&(r.preventDefault(),r.stopPropagation())}var s=this.prop,c=s.speed,a=s.reverseDir,u=t.step.x*c,l=t.step.y*c;e.targetLeft-=a?l:u,e.targetTop-=a?u:l,e.outer.classList.add(fs),e.container.classList.add(fs),this._callbacks.tbt("move",!1)}}},{key:"_handleDragEnd",value:function(){var t=this.component;t.outer.classList.remove(fs),t.container.classList.remove(fs),"boolean"!=typeof this._currentLerp&&(t.changeProp({render:{lerp:this._currentLerp}}),this._currentLerp=!1),this._callbacks.tbt("end",!1)}},{key:"_destroy",value:function(){cs(us(i.prototype),"_destroy",this).call(this),this._removeDragger()}}],r&&rs(e.prototype,r),n&&rs(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(Ke);function hs(t){return hs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hs(t)}function ds(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ys(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ds(Object(r),!0).forEach((function(e){js(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ds(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function vs(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function _s(t,e){return _s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},_s(t,e)}function gs(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ks(t);if(e){var o=ks(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ms(this,r)}}function ms(t,e){if(e&&("object"===hs(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ws(t)}function ws(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Os(){return Os="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Ps(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},Os.apply(this,arguments)}function Ps(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ks(t)););return t}function ks(t){return ks=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ks(t)}function js(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Es=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_s(t,e)}(i,t);var e,r,n,o=gs(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(vs(this,i),js(ws(e=o.call(this,t,!1)),"_initText",void 0),js(ws(e),"_initHTML",void 0),js(ws(e),"_isPrimarySplit",void 0),js(ws(e),"_container",void 0),js(ws(e),"_letters",void 0),js(ws(e),"_words",void 0),js(ws(e),"_lines",void 0),e.prop.container){var n=y(e.prop.container);n instanceof HTMLElement&&(e._container=n)}e._container&&e._container.classList.add(e.prefix),e._initHTML=e._container.innerHTML;var s=e._container.innerText.trim()||e._container.innerHTML.trim();return e._initText=s||"no rendered text",e._initText=e._initText.replace(/\s+\n/gm,"\n"),e._initText=e._initText.replace(/<br>/gm,String.fromCharCode(10)),e._initText=e._initText.replace(/<br\/>/gm,String.fromCharCode(10)),e._initText=e._initText.replace(/<br \/>/gm,String.fromCharCode(10)),e._isPrimarySplit=!1,e._letters=[],e._words=[],e._lines=[],r&&e.init(),e}return e=i,(r=[{key:"_getDefaultProp",value:function(){return ys(ys({},Os(ks(i.prototype),"_getDefaultProp",this).call(this)),{},{container:"#".concat(this.prefix),appendLetters:!0,appendLines:!1,viewportTarget:"",resizeTimeout:0})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"split-text")}},{key:"container",get:function(){return this._container}},{key:"letters",get:function(){return this._letters}},{key:"words",get:function(){return this._words}},{key:"lines",get:function(){return this._lines}},{key:"_setEvents",value:function(){var t=this;Os(ks(i.prototype),"_setEvents",this).call(this),this.splitText(),this.prop.appendLines&&this.addViewportCallback(this.prop.viewportTarget,(function(){t.splitText()}),{timeout:this.prop.resizeTimeout})}},{key:"splitText",value:function(){this._isPrimarySplit||(this.container.innerHTML="",this._splitIntoWords(),this._splitIntoLetters(),this._appendWords(),this._isPrimarySplit=!0),this.prop.appendLines&&this._splitIntoLines(),this.callbacks.tbt("split",!1)}},{key:"_splitIntoWords",value:function(){var t=this,e=this._initText.split(""),r=0;e.forEach((function(e){var n=t._words[r]||{content:"",hasNewLine:!1,el:_("span",{class:"".concat(t.prefix,"__word")}),letters:[]};n.el.style.display="inline-block",t._words[r]=n;var o=e.charCodeAt(0),i=32===o||160===o,s=[45,8208,8211,8212,8722].includes(o),c=10===o;i&&(n.whitespace=document.createTextNode(" ")),c&&(n.br=_("br")),n.hasNewLine=c,i||c?r+=1:(n.content+=e,t.prop.appendLetters||(n.el.innerHTML=n.content),s&&(r+=1))})),this._words=this._words.filter((function(e,r){return 0!==e.content.length||(r>0&&(t._words[r-1].whitespace=e.whitespace,t._words[r-1].br=e.br),!1)}))}},{key:"_appendWords",value:function(){var t=this;this._words.forEach((function(e){t.container.appendChild(e.el),e.whitespace&&t.container.appendChild(e.whitespace),e.br&&t.container.appendChild(e.br)}))}},{key:"_removeWords",value:function(){this._words.forEach((function(t){t.el.remove(),t.whitespace&&t.whitespace.remove(),t.br&&t.br.remove()}))}},{key:"_splitIntoLetters",value:function(){var t=this;this.prop.appendLetters&&(this._words.forEach((function(e){var r=e.content.split(""),n=[];r.forEach((function(r){var o={el:_("span",{class:"".concat(t.prefix,"__letter"),html:r}),content:r,word:e};o.el.style.display="inline-block",t._letters.push(o),n.push(o)})),e.letters=n})),this._letters.forEach((function(t){t.word.el.appendChild(t.el)})))}},{key:"_splitIntoLines",value:function(){var t=this;this._removeLines();var e=!1,r=1/0,n=!1;this.words.forEach((function(o){var i=!1,s=o.el.offsetTop;i=!(!n||!n.br)||s!==r,n=o,r=s,i&&((e={el:_("span",{class:"".concat(t.prefix,"__line")}),content:"",words:[]}).el.style.display="block",t._lines.push(e)),e&&e.words.push(o)})),this._lines.forEach((function(t){t.content=t.words.map((function(t){return t.content})).join(" ")})),this._lines.forEach((function(e){e.words.forEach((function(t){e.el.appendChild(t.el),t.br&&t.br.remove(),t.whitespace&&e.el.appendChild(t.whitespace)})),t.container.appendChild(e.el)}))}},{key:"_removeLines",value:function(){this._lines.forEach((function(t){t.el.remove()})),this._lines=[],this._appendWords()}},{key:"_destroy",value:function(){Os(ks(i.prototype),"_destroy",this).call(this),this._lines=[],this._words=[],this._letters=[],this._container.innerHTML=this._initHTML}}])&&bs(e.prototype,r),n&&bs(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(G);function Ss(t){return Ss="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ss(t)}function Ts(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function xs(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ts(Object(r),!0).forEach((function(e){As(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ts(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Rs(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ls(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ds(t,e){return Ds=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Ds(t,e)}function Cs(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Fs(t);if(e){var o=Fs(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ms(this,r)}}function Ms(t,e){if(e&&("object"===Ss(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ws(t)}function Ws(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Bs(){return Bs="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Is(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},Bs.apply(this,arguments)}function Is(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Fs(t)););return t}function Fs(t){return Fs=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Fs(t)}function As(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Hs=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ds(t,e)}(i,t);var e,r,n,o=Cs(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Rs(this,i),As(Ws(e=o.call(this,t,!1)),"_container",void 0),As(Ws(e),"_containerIsWindow",void 0),As(Ws(e),"_outerCursor",void 0),As(Ws(e),"_innerCursor",void 0),As(Ws(e),"_animationFrame",void 0),As(Ws(e),"_currentFPS",void 0),As(Ws(e),"_canPlay",void 0),As(Ws(e),"_x",void 0),As(Ws(e),"_xTarget",void 0),As(Ws(e),"_y",void 0),As(Ws(e),"_yTarget",void 0);var n=y(e.prop.container);if(!n)throw new Error("No cursor container for ".concat(e.prop.container));return e._container=n,e._containerIsWindow=n instanceof Window,e._x=0,e._xTarget=0,e._y=0,e._yTarget=0,e._currentFPS=60,e._canPlay=e.prop.run,r&&e.init(),e}return e=i,(r=[{key:"_getDefaultProp",value:function(){return xs(xs({},Bs(Fs(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window,run:!0,hideNativeCursor:!1,render:{lerp:.2,lerpToFixed:2,normalizeLerp:!1},autoStop:!0})}},{key:"prefix",get:function(){return"".concat(this._app.prefix,"custom-cursor")}},{key:"container",get:function(){return this._container}},{key:"eventsContainer",get:function(){return this._container}},{key:"domContainer",get:function(){return this.container instanceof Window?this._app.html:this.container}},{key:"outerCursor",get:function(){return this._outerCursor}},{key:"innerCursor",get:function(){return this._innerCursor}},{key:"x",get:function(){return this._x}},{key:"y",get:function(){return this._y}},{key:"_constructor",value:function(){Bs(Fs(i.prototype),"_constructor",this).call(this),this._createCursor()}},{key:"_setEvents",value:function(){var t=this;Bs(Fs(i.prototype),"_setEvents",this).call(this);var e=this.domContainer;this._animationFrame=new gt,this._animationFrame.addCallback("frame",(function(e){t._currentFPS=e.realFPS,t.render()})),this._canPlay&&this.enable(),this.addEventListeners(e,"mouseenter",this._handleMouseEnter.bind(this)),this.addEventListeners(e,"mouseleave",this._handleMouseLeave.bind(this)),this.addEventListeners(e,"mousemove",this._handleMouseMove.bind(this)),this.addEventListeners(e,"mousedown",this._handleMouseDown.bind(this)),this.addEventListeners(e,"mouseup",this._handleMouseUp.bind(this)),this.addEventListeners(window,"blur",this._handleWindowBlur.bind(this))}},{key:"_createCursor",value:function(){var t=this.prefix,e=this.container,r=this.domContainer;this.prop.hideNativeCursor&&(r.style.cursor="none",r.classList.add("hide-defaut-cursor")),r.classList.add("".concat(t,"-container")),this._outerCursor=_("div",{class:"".concat(t," ").concat(e instanceof Window?"in-window":"in-element"," disabled"),parent:r}),this._innerCursor=_("div",{class:"".concat(t,"__inner disabled"),parent:this._outerCursor}),this.callbacks.tbt("create",{outerCursor:this.outerCursor,innerCursor:this.innerCursor})}},{key:"_destroyCursor",value:function(){var t=this.prefix,e=this.domContainer;e.style.cursor="",e.classList.remove("hide-defaut-cursor"),e.classList.remove("".concat(t,"-container")),this._outerCursor.remove(),this._innerCursor.remove()}},{key:"_handleMouseEnter",value:function(t){this._xTarget=t.clientX,this._x=this._xTarget,this._yTarget=t.clientY,this._y=this._yTarget,this.outerCursor.classList.add("in-action")}},{key:"_handleMouseLeave",value:function(){this.outerCursor.classList.remove("in-action")}},{key:"_handleMouseMove",value:function(t){this._xTarget=t.clientX,this._yTarget=t.clientY,this.outerCursor.classList.add("in-action"),this._canPlay&&this._animationFrame.play()}},{key:"_handleMouseDown",value:function(t){1===t.which&&(this.outerCursor.classList.add("click"),this.innerCursor.classList.add("click"))}},{key:"_handleMouseUp",value:function(){this.outerCursor.classList.remove("click"),this.innerCursor.classList.remove("click")}},{key:"_handleWindowBlur",value:function(){this._handleMouseUp()}},{key:"render",value:function(){var t=this.prop,e=this.domContainer,r=t.render,n=r.normalizeLerp,o=r.lerp,i=r.lerpToFixed,s=n?60/this._currentFPS:1;if(this._x=tt(this._x,this._xTarget,o*s,.02),this._y=tt(this._y,this._yTarget,o*s,.02),"number"==typeof i){var c=Math.round(Math.abs(i));this._x=parseFloat(this._x.toFixed(c)),this._y=parseFloat(this._y.toFixed(c))}var a=this._x,u=this._y;if(!this._containerIsWindow){var l=e.getBoundingClientRect();a-=l.left,u-=l.top}this.outerCursor.style.transform="translate(".concat(a,"px, ").concat(u,"px)"),t.autoStop&&this._x===this._xTarget&&this._y===this._yTarget&&this._animationFrame.pause(),this._callbacks.tbt("render",{x:a,y:u})}},{key:"enable",value:function(){this._canPlay=!0,this._animationFrame.isPlaying||(this.outerCursor.classList.remove("disabled"),this.innerCursor.classList.remove("disabled"),this._animationFrame.play())}},{key:"disable",value:function(){this._canPlay=!1,this._animationFrame.isPlaying&&(this.outerCursor.classList.add("disabled"),this.innerCursor.classList.add("disabled"),this._animationFrame.pause())}},{key:"_destroy",value:function(){Bs(Fs(i.prototype),"_destroy",this).call(this),this._destroyCursor(),this._animationFrame.destroy()}}])&&Ls(e.prototype,r),n&&Ls(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(G),zs={common:t,listeners:n,math:e};window.Vevet=i})()})();
|