vevet 2.16.1 → 2.17.0

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.
@@ -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,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:"",C=E.toString,L=T.call(Object),D=RegExp("^"+T.call(x).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=v?h.Buffer:void 0,W=h.Symbol,I=h.Uint8Array,B=M?M.allocUnsafe:void 0,A=(O=Object.getPrototypeOf,P=Object,function(t){return O(P(t))}),z=Object.create,F=E.propertyIsEnumerable,H=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,U=Date.now,$=yt(h,"Map"),Y=yt(Object,"create"),q=function(){function t(){}return function(e){if(!St(e))return{};if(z)return z(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():H.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($||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(!$||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=C.call(t);n&&(e?t[N]=r:delete t[N]);return o}(t):function(t){return C.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)?D: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=B?B(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 I(g).set(new I(_)),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=A(t);if(null===e)return!0;var r=x.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&T.call(r)==L}(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(A(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,Dt),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}:Dt;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=U(),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")&&!F.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 Ct,Lt=(Ct=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=Ct.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&&Ct(t,s,r,o)}return t})));function Dt(t){return t}t.exports=Lt},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,{id:()=>u,mergeWithoutArrays:()=>p,timeoutCallback:()=>h});var e={};r.r(e),r.d(e,{clamp:()=>rt,clampScope:()=>ct,inScope:()=>st,lerp:()=>nt,scoped:()=>ot,spreadScope:()=>it,wrap:()=>at});var n={};r.r(n),r.d(n,{intersectionObserverSupported:()=>Ft,onScroll:()=>zt});var o={};r.r(o),r.d(o,{getValues:()=>Ht,to:()=>ke,toElement:()=>je});var i={};r.r(i),r.d(i,{load:()=>Le,pathsToProps:()=>Me,sizesToSrcSet:()=>De});var s={};r.r(s);var c={};r.r(c),r.d(c,{AnimationFrame:()=>Ot,Application:()=>Ir,Callbacks:()=>L,Component:()=>et,Ctx2D:()=>$o,Ctx2DPrerender:()=>ai,CustomCursor:()=>hc,Dragger:()=>uo,DraggerDirection:()=>Do,DraggerMove:()=>mo,GeneralTypes:()=>s,Module:()=>V,MutableProp:()=>I,Page:()=>Wn,PageLoad:()=>Rr,Plugin:()=>Ur,Preloader:()=>cn,ProgressPreloader:()=>wn,ScrollBar:()=>ji,ScrollEventsBase:()=>zi,ScrollSectionProgress:()=>zs,ScrollView:()=>es,SmoothScroll:()=>Bt,SmoothScrollDragPlugin:()=>js,SmoothScrollKeyboardPlugin:()=>fs,SplitText:()=>Zs,StaticTimeline:()=>ue,Timeline:()=>Pe,Viewport:()=>Or,WheelHandler:()=>qn,utils:()=>dc});var a=0;function u(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";return a+=1,"".concat(t,"_").concat(a)}var l=r(554),f=r.n(l);function p(t,e){return f()(t,e,(function(t,e){if(Array.isArray(t))return e}))}function h(t,e){var r;return 0===e?t():r=setTimeout((function(){t()}),e),{clear:function(){r&&clearTimeout(r)}}}function d(t,e){return y(t,e)}function y(t,e){return t===e||null!==t&&y(t.parentNode,e)}function v(t){return t instanceof HTMLElement||t instanceof Element}function b(t){return t instanceof Window}function _(t,e){if(b(t))return t;if(v(t))return t;if(void 0!==e){const r=_(e);if(r)return r.querySelector(t)}return document.querySelector(t)}function g(t,e){if(t instanceof NodeList)return t;if(v(t))return[t];if(Array.isArray(t))return t;if(void 0!==e){const r=_(e);if(r)return r.querySelectorAll(t)}return document.querySelectorAll(t)}function m(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 w(t,e={}){const r=document.createElement(t);if(e.class&&function(t,e){if(t instanceof Element)m(t,e,!0);else for(let r=0;r<t.length;r++)m(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 O=[];function P(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 O.push({id:o,el:t,target:e,callback:r}),{id:o,remove:k.bind(this,o)}}function k(t){const e=[];for(let r=0,n=O.length;r<n;r++){const n=O[r];n.id===t?n.el.removeEventListener(n.target,n.callback):e.push(n)}}var j=r(796),E=r.n(j);function S(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 T(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?S(Object(r),!0).forEach((function(e){C(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function x(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function R(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 C(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var L=function(){function t(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];x(this,t),C(this,"_app",void 0),C(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=u("callback"),o={id:n,on:!0,data:T({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?h(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&&R(e.prototype,r),n&&R(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function D(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function M(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 W(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var I=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";D(this,t),W(this,"_initProp",void 0),W(this,"_onResponsive",void 0),W(this,"_onChange",void 0),W(this,"_name",void 0),W(this,"_app",void 0),W(this,"_refProp",void 0),W(this,"_prop",void 0),W(this,"_responsiveRules",[]),W(this,"_viewportCallback",void 0),this._initProp=e,this._onResponsive=r,this._onChange=n,this._name=o,this._app=window.vevetApp,this._refProp=p({},e),this._prop=p({},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=p({},this._refProp);e.forEach((function(t){var e=t.settings,c=t.breakpoint;if("number"==typeof c)o<=t.breakpoint&&(i=p(s,e));else if("string"==typeof c){var a=c.toLowerCase();("d"===a&&n.isDesktop||"t"===a&&n.isTablet||"p"===a&&n.isPhone)&&(i=p(s,e)),("phone"===a&&r.isPhone||"tablet"===a&&r.isTablet||"mobile"===a&&r.isMobile)&&(i=p(s,e))}})),this._prop=p(this._prop,i||this._refProp),t&&this._onResponsive()}},{key:"changeProp",value:function(t){this._prop=p(this._prop,t),this._refProp=p(this._refProp,t),this._onChange(t)}},{key:"destroy",value:function(){this._viewportCallback&&this._viewportCallback.remove()}}],r&&M(e.prototype,r),n&&M(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function B(){throw new Error('Vevet.Application does not exist yet. \nCall "new Vevet.Application()" before using all the stuff')}function A(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 z(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?A(Object(r),!0).forEach((function(e){N(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function F(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function H(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 N(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var V=function(){function t(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];F(this,t),N(this,"_mutableProp",void 0),N(this,"_callbacks",void 0),N(this,"_listeners",void 0),N(this,"_app",void 0),N(this,"_inited",!1),N(this,"_destroyed",void 0),N(this,"_viewportCallbacks",[]),window.vevetApp?this._app=window.vevetApp:B(),this._destroyed=!1,this._listeners=[],this._callbacks=new L;var n=p(this._getDefaultProp(),e||{});this._mutableProp=new I(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,z(z({},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=P(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&&H(e.prototype,r),n&&H(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function X(t){return X="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},X(t)}function Q(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function U(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 $(){return $="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Y(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},$.apply(this,arguments)}function Y(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Z(t)););return t}function q(t,e){return q=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},q(t,e)}function K(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=Z(t);if(e){var o=Z(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return J(this,r)}}function J(t,e){if(e&&("object"===X(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return G(t)}function G(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Z(t){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Z(t)}function tt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var et=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&&q(t,e)}(i,t);var e,r,n,o=K(i);function i(){var t;Q(this,i);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return tt(G(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(){$(Z(i.prototype),"_destroy",this).call(this),this._destroyPlugins()}}])&&U(e.prototype,r),n&&U(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(V);function rt(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 nt(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 ot(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 it(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 st(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,1];return t>=e[0]&&t<=e[1]}function ct(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 rt(ot(t,e),r)}function at(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 ut(t){return ut="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},ut(t)}function lt(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 ft(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?lt(Object(r),!0).forEach((function(e){wt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):lt(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 ht(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 dt(){return dt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=yt(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},dt.apply(this,arguments)}function yt(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=mt(t)););return t}function vt(t,e){return vt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},vt(t,e)}function bt(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=mt(t);if(e){var o=mt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _t(this,r)}}function _t(t,e){if(e&&("object"===ut(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return gt(t)}function gt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mt(t){return mt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},mt(t)}function wt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ot=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&&vt(t,e)}(i,t);var e,r,n,o=bt(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return pt(this,i),wt(gt(e=o.call(this,t,!1)),"_isPlaying",void 0),wt(gt(e),"_frame",void 0),wt(gt(e),"_frameIndex",void 0),wt(gt(e),"_timeStamp",void 0),wt(gt(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 ft(ft({},dt(mt(i.prototype),"_getDefaultProp",this).call(this)),{},{fps:140,run:!1})}},{key:"_constructor",value:function(){dt(mt(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=rt(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(),dt(mt(i.prototype),"_destroy",this).call(this)}}])&&ht(e.prototype,r),n&&ht(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(et);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},Pt(t)}function kt(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 jt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?kt(Object(r),!0).forEach((function(e){Wt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Et(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function St(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 Tt(){return Tt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=xt(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},Tt.apply(this,arguments)}function xt(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Mt(t)););return t}function Rt(t,e){return Rt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Rt(t,e)}function Ct(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=Mt(t);if(e){var o=Mt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Lt(this,r)}}function Lt(t,e){if(e&&("object"===Pt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Dt(t)}function Dt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Mt(t){return Mt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Mt(t)}function Wt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var It,Bt=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&&Rt(t,e)}(i,t);var e,r,n,o=Ct(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Et(this,i),Wt(Dt(e=o.call(this,t,!1)),"_outer",void 0),Wt(Dt(e),"_container",void 0),Wt(Dt(e),"_containerExists",void 0),Wt(Dt(e),"_elements",void 0),Wt(Dt(e),"_elementsLength",void 0),Wt(Dt(e),"_targetLeft",void 0),Wt(Dt(e),"_targetTop",void 0),Wt(Dt(e),"_scrollLeft",void 0),Wt(Dt(e),"_scrollTop",void 0),Wt(Dt(e),"_scrollWidth",void 0),Wt(Dt(e),"_scrollHeight",void 0),Wt(Dt(e),"_clientWidth",void 0),Wt(Dt(e),"_clientHeight",void 0),Wt(Dt(e),"_instant",void 0),Wt(Dt(e),"_animationFrame",void 0),Wt(Dt(e),"_outerAnimationFrameEvent",void 0),Wt(Dt(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=_(n.outer),!(e._outer instanceof HTMLElement))throw new Error("".concat(n.outer," is not a HTMLElement"));e._outer.classList.add(e.prefix);var s=_(".".concat(e.prefix,"__container"),e.outer);return v(s)?(e._container=s,e._containerExists=!0):(e._container=w("div",{class:"".concat(e.prefix,"__container"),parent:e.outer,children:Array.from(e.outer.children)}),e._containerExists=!1),n.elements?e._elements=Array.from(g(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=rt(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=rt(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 jt(jt({},Tt(Mt(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(){Tt(Mt(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(){Tt(Mt(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=rt(e.clientWidth,[this.clientWidth,1/0]),this._scrollHeight=rt(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=E()(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 Ot,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=nt(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"===Pt(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(Tt(Mt(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&&St(e.prototype,r),n&&St(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(et),At=[];function zt(t){var e=t.container,r=t.callback,n=t.isPassive,o=void 0!==n&&n,i=At.find((function(t){return t.container===e&&t.isPassive===o})),s=u("scroll-event");if(i)i.callbacks.push({id:s,callback:r});else{i={id:u("scroll-event-instance"),container:e,callbacks:[{id:s,callback:r}],isPassive:o,listeners:[]},At.push(i);var c=i.listeners;if(e instanceof Bt)c.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 a=e instanceof Window,l=_(e);c.push(P(l,"scroll",(function(){for(var t=a?l.pageYOffset:l.scrollTop,e=a?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!==s}));i.callbacks=t,0===t.length&&(i.listeners.forEach((function(t){t.remove()})),At=At.filter((function(t){return t.id!==i.id})))}}}function Ft(){return"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype}function Ht(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;if(t){var e=t instanceof Window?t.pageYOffset:t.scrollTop,r=t instanceof Window?t.pageXOffset:t.scrollLeft;return{scrollTop:e,scrollLeft:r}}}function Nt(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]=Vt(.1*c,r,o);return 0===t?0:1===t?1:Vt(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=$t(a,n,o);if(u>=.001)return function(t,e,r,n){for(let o=0;o<4;++o){const o=$t(e,r,n);if(0===o)return e;e-=(Vt(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=Vt(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 Vt(t,e,r){return((Xt(e,r)*t+Qt(e,r))*t+Ut(e))*t}function Xt(t,e){return 1-3*e+3*t}function Qt(t,e){return 3*e-6*t}function Ut(t){return 3*t}function $t(t,e,r){return 3*Xt(e,r)*t*t+2*Qt(e,r)*t+Ut(e)}function Yt(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 qt(t,e){switch(e){case It.easeInSine:return r=t,1-Math.cos(r*Math.PI/2);case It.easeOutSine:return function(t){return Math.sin(t*Math.PI/2)}(t);case It.easeInOutSine:return function(t){return-(Math.cos(Math.PI*t)-1)/2}(t);case It.easeInQuad:return function(t){return Math.pow(t,2)}(t);case It.easeOutQuad:return function(t){return 1-Math.pow(1-t,2)}(t);case It.easeInOutQuad:return function(t){return t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2}(t);case It.easeInCubic:return function(t){return Math.pow(t,3)}(t);case It.easeOutCubic:return function(t){return 1-Math.pow(1-t,3)}(t);case It.easeInOutCubic:return function(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}(t);case It.easeInQuart:return function(t){return Math.pow(t,4)}(t);case It.easeOutQuart:return function(t){return 1-Math.pow(1-t,4)}(t);case It.easeInOutQuart:return function(t){return t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2}(t);case It.easeInQuint:return function(t){return Math.pow(t,5)}(t);case It.easeOutQuint:return function(t){return 1-Math.pow(1-t,5)}(t);case It.easeInOutQuint:return function(t){return t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2}(t);case It.easeInExpo:return function(t){return 0===t?0:Math.pow(2,10*t-10)}(t);case It.easeOutExpo:return function(t){return 1===t?1:1-Math.pow(2,-10*t)}(t);case It.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 It.easeInCirc:return function(t){return 1-Math.sqrt(1-Math.pow(t,2))}(t);case It.easeOutCirc:return function(t){return Math.sqrt(1-Math.pow(t-1,2))}(t);case It.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 It.easeInBack:return function(t){return 2.70158*t*t*t-1.70158*t*t}(t);case It.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 It.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 It.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 It.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 It.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 It.easeInBounce:return function(t){return 1-Yt(1-t)}(t);case It.easeOutBounce:return Yt(t);case It.easeInOutBounce:return function(t){return t<.5?(1-Yt(1-2*t))/2:(1+Yt(2*t-1))/2}(t);default:return t}var r}function Kt(t){return Kt="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},Kt(t)}function Jt(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 Gt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Jt(Object(r),!0).forEach((function(e){ae(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Jt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Zt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}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 ee(t,e){return ee=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},ee(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 ne(this,r)}}function ne(t,e){if(e&&("object"===Kt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return oe(t)}function oe(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ie(){return ie="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=se(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},ie.apply(this,arguments)}function se(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ce(t)););return t}function ce(t){return ce=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ce(t)}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}!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"}(It||(It={}));var ue=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&&ee(t,e)}(i,t);var e,r,n,o=re(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Zt(this,i),ae(oe(e=o.call(this,t,!1)),"_progress",void 0),ae(oe(e),"_easing",void 0),ae(oe(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 Gt(Gt({},ie(ce(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)?Nt(t,e):"function"==typeof e?e(t):qt(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=rt(ot(e,o.prop.nestedScope),[0,1]);o.progress=i}}},{key:"_destroy",value:function(){ie(ce(i.prototype),"_destroy",this).call(this),this._nestedTimelines.forEach((function(t){t.destroy()}))}}],r&&te(e.prototype,r),n&&te(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(et);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},le(t)}function fe(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 pe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?fe(Object(r),!0).forEach((function(e){Oe(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fe(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function he(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function de(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 ye(t,e){return ye=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},ye(t,e)}function ve(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=we(t);if(e){var o=we(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return be(this,r)}}function be(t,e){if(e&&("object"===le(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _e(t)}function _e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ge(){return ge="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=me(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},ge.apply(this,arguments)}function me(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=we(t)););return t}function we(t){return we=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},we(t)}function Oe(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Pe=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&&ye(t,e)}(i,t);var e,r,n,o=ve(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return he(this,i),Oe(_e(e=o.call(this,t,!1)),"_isPlaying",void 0),Oe(_e(e),"_isReversed",void 0),Oe(_e(e),"_isPaused",void 0),Oe(_e(e),"_animationFrame",void 0),Oe(_e(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 pe(pe({},ge(we(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=rt(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(){ge(we(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(),ge(we(i.prototype),"_destroy",this).call(this)}}])&&de(e.prototype,r),n&&de(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(ue);function ke(t){var e=t.container,r=void 0===e?window:e,n=t.top,o=void 0===n?0:n,i=t.left,s=void 0===i?0:i,c=t.duration,a=void 0===c?250:c;return new Promise((function(t,e){var n=Ht(r);if(n){var i=new Pe({duration:a});return i.addCallback("progress",(function(t){r&&r.scrollTo({top:n.scrollTop+(o-n.scrollTop)*t.easing,left:n.scrollLeft+(s-n.scrollLeft)*t.easing,behavior:"auto"})})),i.addCallback("end",(function(){t()})),void i.play()}e()}))}function je(t){var e=t.container,r=void 0===e?window:e,n=t.el,o=t.top,i=void 0===o?0:o,s=t.left,c=void 0===s?0:s,a=t.duration,u=void 0===a?250:a;return new Promise((function(t,e){var o=Ht(r);if(o){var s=_(n);if(s){var a=s.getBoundingClientRect(),l=rt(a.top+o.scrollTop-i,[0,1/0]),f=rt(a.left+o.scrollLeft-c,[0,1/0]);ke({container:r,top:l,left:f,duration:u}).then((function(){t()})).catch((function(){e()}))}}else e()}))}class Ee 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(((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 Ee(t))}}get isCanceled(){return this._isCanceled}}function Te(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 xe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Te(Object(r),!0).forEach((function(e){Re(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Te(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Re(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(Se.prototype,Promise.prototype);var Ce=[];function Le(t,e){var r=xe(xe({},{crossOrigin:null,useCache:!1}),e),n="string"==typeof t?t:t.src;return new Se((function(e,o){var i=r.useCache&&Ce.find((function(t){return t.src===n}));if(i)e(i.image);else{if("string"==typeof t){var s=new Image;return s.crossOrigin=r.crossOrigin,s.onload=function(){r.useCache&&Ce.push({src:n,image:s}),e(s)},s.onerror=function(){o()},void(s.src=t)}t instanceof HTMLImageElement&&(t.complete?e(t):(t.addEventListener("load",(function(){r.useCache&&Ce.push({src:n,image:t}),e(t)})),t.addEventListener("error",(function(){o()}))))}}))}function De(t){return Object.keys(t).map((function(e){var r=t[e];if(r)return"".concat(r," ").concat(e,"w")})).filter((function(t){return!!t})).join(", ")}function Me(t){var e=window.vevetApp,r=t.original;t.thumb&&(r=t.thumb),e&&e.supportsWebp&&t.thumbWebp&&(r=t.thumbWebp);var n="";return e&&e.supportsWebp&&"sizesWebp"in t&&t.sizesWebp?n=De(t.sizesWebp):"sizes"in t&&t.sizes&&(n=De(t.sizes)),{src:r,srcSet:n}}var We=/iPhone/i,Ie=/iPod/i,Be=/iPad/i,Ae=/\biOS-universal(?:.+)Mac\b/i,ze=/\bAndroid(?:.+)Mobile\b/i,Fe=/Android/i,He=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Ne=/Silk/i,Ve=/Windows Phone/i,Xe=/\bWindows(?:.+)ARM\b/i,Qe=/BlackBerry/i,Ue=/BB10/i,$e=/Opera Mini/i,Ye=/\b(CriOS|Chrome)(?:.+)Mobile/i,qe=/Mobile(?:.+)Firefox\b/i,Ke=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};function Je(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(We)&&!o(Ve),ipod:o(Ie),tablet:!o(We)&&(o(Be)||Ke(e))&&!o(Ve),universal:o(Ae),device:(o(We)||o(Ie)||o(Be)||o(Ae)||Ke(e))&&!o(Ve)},amazon:{phone:o(He),tablet:!o(He)&&o(Ne),device:o(He)||o(Ne)},android:{phone:!o(Ve)&&o(He)||!o(Ve)&&o(ze),tablet:!o(Ve)&&!o(He)&&!o(ze)&&(o(Ne)||o(Fe)),device:!o(Ve)&&(o(He)||o(Ne)||o(ze)||o(Fe))||o(/\bokhttp\b/i)},windows:{phone:o(Ve),tablet:o(Xe),device:o(Ve)||o(Xe)},other:{blackberry:o(Qe),blackberry10:o(Ue),opera:o($e),firefox:o(qe),chrome:o(Ye),device:o(Qe)||o(Ue)||o($e)||o(qe)||o(Ye)},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 Ge,Ze,tr=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))},er=function(t,e,r){this.name=t,this.version=e,this.os=r,this.type="browser"},rr=function(t){this.version=t,this.type="node",this.name="node",this.os=process.platform},nr=function(t,e,r,n){this.name=t,this.version=e,this.os=r,this.bot=n,this.type="bot-device"},or=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},ir=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},sr=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,cr=[["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/]],ar=[["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 ur(t){return t?fr(t):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new ir:"undefined"!=typeof navigator?fr(navigator.userAgent):"undefined"!=typeof process&&process.version?new rr(process.version.slice(1)):null}function lr(t){return""!==t&&cr.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 fr(t){var e=lr(t);if(!e)return null;var r=e[0],n=e[1];if("searchbot"===r)return new or;var o=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);o?o.length<3&&(o=tr(tr([],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=ar.length;e<r;e++){var n=ar[e],o=n[0];if(n[1].exec(t))return o}return null}(t),c=sr.exec(t);return c&&c[1]?new nr(r,i,s,c[1]):new er(r,i,s)}function pr(t){return pr="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},pr(t)}function hr(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 dr(){return dr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=yr(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},dr.apply(this,arguments)}function yr(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=mr(t)););return t}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=mr(t);if(e){var o=mr(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"===pr(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(t){return mr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},mr(t)}function wr(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.Desktop="desktop",t.Tablet="tablet",t.Phone="phone"}(Ge||(Ge={})),function(t){t.Landscape="landscape",t.Portrait="portrait"}(Ze||(Ze={}));var Or=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(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),wr(gr(t=o.call(this,!1)),"_width",void 0),wr(gr(t),"_height",void 0),wr(gr(t),"_radius",void 0),wr(gr(t),"_prevSize",void 0),wr(gr(t),"_isDesktop",void 0),wr(gr(t),"_isTablet",void 0),wr(gr(t),"_isPhone",void 0),wr(gr(t),"_resizeTimeout",void 0),t._width=0,t._height=0,t._radius=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:"radius",get:function(){return Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/2}},{key:"vw",get:function(){return this.width/100}},{key:"vh",get:function(){return this.height/100}},{key:"vr",get:function(){return this.radius/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(){dr(mr(i.prototype),"_constructor",this).call(this),this._setValues()}},{key:"_setEvents",value:function(){var t=this;window.addEventListener("resize",(function(){t._resizeTimeout&&t._resizeTimeout.clear(),t._resizeTimeout=h((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=[Ge.Desktop,Ge.Tablet,Ge.Phone];this.isDesktop?this._updateBreakpointClasses(Ge.Desktop,t):this.isTablet?this._updateBreakpointClasses(Ge.Tablet,t):this._updateBreakpointClasses(Ge.Phone,t);var e=[Ze.Landscape,Ze.Portrait];this.isLandscape?this._updateBreakpointClasses(Ze.Landscape,e):this.isPortrait?this._updateBreakpointClasses(Ze.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")),t.style.setProperty("--vr","".concat(this.vr,"px"))}},{key:"_onResize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._prevSize.w,r=this._prevSize.h;this._setValues();var n=this.width,o=this.height,i={widthChanged:n!==e,heightChanged:o!==r,orientationChanged:n>o!=e>r};(t||n!==e&&o===r)&&this.tbt("w_",i),(t||o!==r&&n===e)&&this.tbt("h_",i),(t||n!==e&&o!==r)&&(this.tbt("wh",i),this.tbt("hw",i)),(t||n!==e)&&this.tbt("w",i),(t||o!==r)&&this.tbt("h",i),this.tbt("",i)}},{key:"forceResize",value:function(){this._onResize(!0)}}],r&&hr(e.prototype,r),n&&hr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(L);function Pr(t){return Pr="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},Pr(t)}function kr(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 jr(t,e){return jr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},jr(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 r,n=xr(t);if(e){var o=xr(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"===Pr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Tr(t)}function Tr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xr(t){return xr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},xr(t)}var Rr=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&&jr(t,e)}(i,t);var e,r,n,o=Er(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=Tr(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()}}])&&kr(e.prototype,r),n&&kr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(L);function Cr(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 Lr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Cr(Object(r),!0).forEach((function(e){Wr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Cr(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 Mr(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 Wr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ir=function(){function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Dr(this,t),Wr(this,"_prop",void 0),Wr(this,"_prefix",void 0),Wr(this,"_isPhone",void 0),Wr(this,"_isTablet",void 0),Wr(this,"_isMobile",void 0),Wr(this,"_isDesktop",void 0),Wr(this,"_osName",void 0),Wr(this,"_browserName",void 0),Wr(this,"_supportsWebp",void 0),Wr(this,"_pages",[]),Wr(this,"_page",!1),Wr(this,"_pageLoad",void 0),Wr(this,"_viewport",void 0),window.vevetApp)throw new Error("Vevet Application already exists!");this._prop=Lr(Lr({},this.defaultProp),r),this._prefix=this.prop.prefix,this._sayHi(),window.vevetApp=this;var n=Je();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 o=ur();if(null!=o&&o.os){var i=o.os.split(" ")[0].toLowerCase();this.html.classList.add("".concat(this.prefix,"os-").concat(i)),this._osName=i}else this._osName="";if(null!=o&&o.name){var s=o.name.toLowerCase();this.html.classList.add("".concat(this.prefix,"browser-").concat(s)),this._browserName=s}else this._browserName="";if(this._pageLoad=new Rr,this._viewport=new Or,this.prop.webpSupport){var c=new Image;c.onload=function(){e._supportsWebp=1===c.width},c.onerror=function(){e._supportsWebp=!1},c.src="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA="}else this._supportsWebp=!1}var e,r,n;return e=t,(r=[{key:"version",get:function(){return"2.16.1"}},{key:"prop",get:function(){return this._prop}},{key:"defaultProp",get:function(){return{sayHi:!0,tablet:1199,phone:899,prefix:"v-",easing:[.25,.1,.25,1],viewportResizeTimeout:0,webpSupport:!1}}},{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:"supportsWebp",get:function(){return this._supportsWebp}},{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(){if(this.prop.sayHi){var t="Vevet ".concat(this.version),e=["padding: 1rem 1.5rem;","background: #5F2580;","font: 1rem/1 Arial;","color: #ffffff;"].join("");console.log("%c%s",e,t)}}}])&&Mr(e.prototype,r),n&&Mr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Br(t){return Br="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},Br(t)}function Ar(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(){return zr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Fr(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},zr.apply(this,arguments)}function Fr(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Qr(t)););return t}function Hr(t,e){return Hr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Hr(t,e)}function Nr(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 Vr(this,r)}}function Vr(t,e){if(e&&("object"===Br(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Xr(t)}function Xr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Qr(t){return Qr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Qr(t)}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&&Hr(t,e)}(i,t);var e,r,n,o=Nr(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=Xr(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.");zr(Qr(i.prototype),"init",this).call(this)}},{key:"initPlugin",value:function(t){this._inited||(this._component=t,this.init())}}])&&Ar(e.prototype,r),n&&Ar(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(V);function $r(t){return $r="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},$r(t)}function Yr(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 qr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Yr(Object(r),!0).forEach((function(e){sn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Kr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jr(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 Gr(t,e){return Gr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Gr(t,e)}function Zr(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=on(t);if(e){var o=on(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return tn(this,r)}}function tn(t,e){if(e&&("object"===$r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return en(t)}function en(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function rn(){return rn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=nn(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},rn.apply(this,arguments)}function nn(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=on(t)););return t}function on(t){return on=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},on(t)}function sn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var cn=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&&Gr(t,e)}(i,t);var e,r,n,o=Zr(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Kr(this,i),sn(en(e=o.call(this,t,!1)),"_container",void 0),sn(en(e),"_startTime",void 0),sn(en(e),"_endTime",void 0),sn(en(e),"_toBeHidden",void 0),sn(en(e),"_isHidden",void 0),sn(en(e),"_pageLoadEvent",void 0),e.prop.container){var n=_(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 qr(qr({},rn(on(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;rn(on(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(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",h((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;rn(on(i.prototype),"_destroy",this).call(this),null===(t=this._pageLoadEvent)||void 0===t||t.remove()}}],r&&Jr(e.prototype,r),n&&Jr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(et);function an(t){return an="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},an(t)}function un(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 ln(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?un(Object(r),!0).forEach((function(e){mn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):un(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function fn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pn(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 hn(t,e){return hn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},hn(t,e)}function dn(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=gn(t);if(e){var o=gn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return yn(this,r)}}function yn(t,e){if(e&&("object"===an(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return vn(t)}function vn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function bn(){return bn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=_n(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},bn.apply(this,arguments)}function _n(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=gn(t)););return t}function gn(t){return gn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},gn(t)}function mn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var wn=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&&hn(t,e)}(i,t);var e,r,n,o=dn(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return fn(this,i),mn(vn(e=o.call(this,t,!1)),"_imgs",void 0),mn(vn(e),"_videos",void 0),mn(vn(e),"_customResources",void 0),mn(vn(e),"_resourcesTotal",void 0),mn(vn(e),"_resourcesLoaded",void 0),mn(vn(e),"_progress",void 0),mn(vn(e),"_animationFrame",void 0),mn(vn(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 ln(ln({},bn(gn(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(){bn(gn(i.prototype),"_constructor",this).call(this),this._getResources()}},{key:"_setEvents",value:function(){var t=this;bn(gn(i.prototype),"_setEvents",this).call(this);var e=this.prop.calc.lerp;"number"==typeof e&&(this._animationFrame=new Ot,this._animationFrame.addCallback("frame",(function(){t.progress=nt(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 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&&g("img").forEach((function(r){r.classList.contains(e.ignoreClassName)||(t._imgs.push(r),t._resourcesTotal+=1)})),e.video&&g("video").forEach((function(r){r.classList.contains(e.ignoreClassName)||(t._videos.push(r),t._resourcesTotal+=1)})),e.custom&&(Array.from(g(e.custom)).forEach((function(e){var r=parseInt(e.getAttribute("data-load-count")||"1",10);r=Number.isNaN(r)?1:rt(r,[1,1/0]);for(var n=1;n<=r;n+=1){var o=n/r;t._customResources.push({el:e,targetProgress:o})}})),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){var n=t.el,o=t.targetProgress,i=0;if(void 0!==n.isComplete?"boolean"==typeof n.isComplete?n.isComplete&&(i=o):"number"==typeof n.isComplete&&(i=n.isComplete):void 0!==n.isLoaded&&("boolean"==typeof n.isLoaded?n.isLoaded&&(i=o):"number"==typeof n.isLoaded&&(i=n.isLoaded)),0===i){var s=n.getAttribute("data-is-loaded");if(null!==s&&""!==s){var c=parseFloat(s);i=Number.isNaN(c)?o:c}}i>=o?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 Pe({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(){bn(gn(i.prototype),"_destroy",this).call(this),this._animationFrame&&this._animationFrame.destroy()}}],r&&pn(e.prototype,r),n&&pn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(cn);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},On(t)}function Pn(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 kn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Pn(Object(r),!0).forEach((function(e){Mn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Pn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,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 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 Sn(){return Sn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Tn(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},Sn.apply(this,arguments)}function Tn(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Dn(t)););return t}function xn(t,e){return xn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},xn(t,e)}function Rn(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=Dn(t);if(e){var o=Dn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Cn(this,r)}}function Cn(t,e){if(e&&("object"===On(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(t){return Dn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Dn(t)}function Mn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Wn=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&&xn(t,e)}(i,t);var e,r,n,o=Rn(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return jn(this,i),Mn(Ln(e=o.call(this,t,!1)),"_blocked",void 0),Mn(Ln(e),"_created",void 0),Mn(Ln(e),"_beforeShown",void 0),Mn(Ln(e),"_shown",void 0),Mn(Ln(e),"_hidden",void 0),Mn(Ln(e),"_viaAJAX",void 0),e._blocked=!1,e._created=!1,e._beforeShown=!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:"beforeShown",get:function(){return this._beforeShown}},{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 kn(kn({},Sn(Dn(i.prototype),"_getDefaultProp",this).call(this)),{},{name:"home",hasInnerPreloader:!1})}},{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._beforeShown=!1,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.callbacks.tbt("beforeshow",!1),t._beforeShown=!0,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(){var t=this._ignorePreventPageShow();return this.addCallback("destroy",(function(){t.cancel()})),new Promise((function(e,r){t.then((function(){e()})).catch((function(){r()}))}))}},{key:"_ignorePreventPageShow",value:function(){var t=this;return new Se((function(e,r){t._destroyed&&r(),0===g("[data-prevent-page-show]").length?e():setTimeout((function(){t._ignorePreventPageShow().then((function(){e()})).catch((function(){r()}))}),30)}))}},{key:"canShow",value:function(){var t=this;return new Promise((function(e,r){!t.created||t.shown?r():t.prop.hasInnerPreloader?new wn({parent:t,container:!1,hide:!1,loaders:{img:!1,video:!1,custom:".js-preload-inner"},calc:{lerp:!1}}).addCallback("loaded",(function(){e()})):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._beforeShown=!1,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._beforeShown=!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){Sn(Dn(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 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:"onBeforeShow",value:function(){var t=this;return new Se((function(e){t.shown||t.beforeShown?e():t.addCallback("beforeshow",(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})}))}}],r&&En(e.prototype,r),n&&En(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(et);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 Bn(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?Bn(Object(r),!0).forEach((function(e){Yn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Bn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function zn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fn(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 Hn(t,e){return Hn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Hn(t,e)}function Nn(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=$n(t);if(e){var o=$n(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"===In(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Xn(t)}function Xn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Qn(){return Qn="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}},Qn.apply(this,arguments)}function Un(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=$n(t)););return t}function $n(t){return $n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},$n(t)}function Yn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var qn=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&&Hn(t,e)}(i,t);var e,r,n,o=Nn(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return zn(this,i),Yn(Xn(e=o.call(this,t,!1)),"_wheelListener",void 0),Yn(Xn(e),"_lockWheel",void 0),Yn(Xn(e),"_lockWheelTimeout",void 0),e._wheelListener=void 0,e._lockWheel=!1,r&&e.init(),e}return e=i,(r=[{key:"_getDefaultProp",value:function(){return An(An({},Qn($n(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(){Qn($n(i.prototype),"_setEvents",this).call(this),this.container instanceof Window?this._toggleWheelEvent():(this._listeners.push(P(this.container,"mouseenter",this._handleMouseEnter.bind(this))),this._listeners.push(P(this.container,"mouseleave",this._handleMouseLeave.bind(this))))}},{key:"_onPropMutate",value:function(){Qn($n(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=P(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=E()(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(){Qn($n(i.prototype),"_destroy",this).call(this),this._destroyWheelEvent()}}])&&Fn(e.prototype,r),n&&Fn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(V);function Kn(t){return Kn="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},Kn(t)}function Jn(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 Gn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Jn(Object(r),!0).forEach((function(e){ao(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Jn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Zn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function to(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(t,e){return eo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},eo(t,e)}function ro(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=co(t);if(e){var o=co(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return no(this,r)}}function no(t,e){if(e&&("object"===Kn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return oo(t)}function oo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function io(){return io="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}},io.apply(this,arguments)}function so(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=co(t)););return t}function co(t){return co=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},co(t)}function ao(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var uo=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&&eo(t,e)}(i,t);var e,r,n,o=ro(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Zn(this,i),ao(oo(e=o.call(this,t,!1)),"_container",void 0),ao(oo(e),"_runtimeEvents",void 0),ao(oo(e),"_isDragging",void 0),ao(oo(e),"_pointerID",void 0),ao(oo(e),"_coords",void 0),ao(oo(e),"_prevCoords",void 0),ao(oo(e),"_startCoords",void 0),e._container=_(e.prop.container),!v(e._container)&&!b(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 Gn(Gn({},io(co(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(P(window,"mouseup",this._handleEnd.bind(this),{passive:t})),this._runtimeEvents.push(P(window,"touchend",this._handleEnd.bind(this),{passive:t})),this._runtimeEvents.push(P(window,"touchcancel",this.cancel.bind(this),{passive:t})),this._runtimeEvents.push(P(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(){io(co(i.prototype),"_destroy",this).call(this),this._removeRuntimeEvents()}}])&&to(e.prototype,r),n&&to(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(et);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},lo(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"===lo(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:"stepCoords",get:function(){return{x:this._coords.x-this._prevCoords.x,y:this._coords.y-this._prevCoords.y}}},{key:"_addRuntimeEvents",value:function(){ho(go(i.prototype),"_addRuntimeEvents",this).call(this);var t=this.prop.usePassive;this._runtimeEvents.push(P(window,"mousemove",this._handleMove.bind(this),{passive:t})),this._runtimeEvents.push(P(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(){ho(go(i.prototype),"_destroy",this).call(this)}}])&&po(e.prototype,r),n&&po(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(uo);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){ko(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,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Eo(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 So(){return So="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=To(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},So.apply(this,arguments)}function To(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Lo(t)););return t}function xo(t,e){return xo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},xo(t,e)}function Ro(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=Lo(t);if(e){var o=Lo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Co(this,r)}}function Co(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 function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Lo(t){return Lo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Lo(t)}var Do=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&&xo(t,e)}(i,t);var e,r,n,o=Ro(i);function i(){return jo(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"_getDefaultProp",value:function(){return Po(Po({},So(Lo(i.prototype),"_getDefaultProp",this).call(this)),{},{min:75})}},{key:"_handleEnd",value:function(t){var e=So(Lo(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}}])&&Eo(e.prototype,r),n&&Eo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(uo);function Mo(t){return Mo="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},Mo(t)}function Wo(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 Io(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Wo(Object(r),!0).forEach((function(e){Uo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Wo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Bo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ao(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 zo(){return zo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Fo(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},zo.apply(this,arguments)}function Fo(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Qo(t)););return t}function Ho(t,e){return Ho=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Ho(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=Qo(t);if(e){var o=Qo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Vo(this,r)}}function Vo(t,e){if(e&&("object"===Mo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Xo(t)}function Xo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Qo(t){return Qo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Qo(t)}function Uo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var $o=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&&Ho(t,e)}(i,t);var e,r,n,o=No(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Bo(this,i),Uo(Xo(e=o.call(this,t,!1)),"_canvas",void 0),Uo(Xo(e),"_ctx",void 0),Uo(Xo(e),"_width",void 0),Uo(Xo(e),"_height",void 0),Uo(Xo(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=w("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:"clientWidth",get:function(){return this.width/this.dpr}},{key:"height",get:function(){return this._height}},{key:"nonDPRHeight",get:function(){return this.height/this.dpr}},{key:"clientHeight",get:function(){return this.height/this.dpr}},{key:"dpr",get:function(){return this._dpr}},{key:"canRender",get:function(){return this.width>0&&this.height>0}},{key:"_getDefaultProp",value:function(){return Io(Io({},zo(Qo(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(zo(Qo(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(){zo(Qo(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(){zo(Qo(i.prototype),"_destroy",this).call(this),this.canvas&&this.canvas.remove()}}])&&Ao(e.prototype,r),n&&Ao(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(et);function Yo(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*qo(t),o=r.height*n/r.width;o/qo(t)<e.height&&(o=e.height*qo(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*=qo(t),o*=qo(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*qo(t),n=e.height*qo(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*qo(t),o=r.height*qo(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*qo(t),o=r.height*qo(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*qo(t),o=r.height*qo(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*qo(t),o=r.height*qo(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 qo(t){return void 0!==t.scale?t.scale:1}function Ko(t){return Ko="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},Ko(t)}function Jo(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 Go(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Jo(Object(r),!0).forEach((function(e){Zo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Jo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Zo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ti(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ei(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 ri(){return ri="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=ni(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},ri.apply(this,arguments)}function ni(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ci(t)););return t}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=ci(t);if(e){var o=ci(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"===Ko(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 ci(t){return ci=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ci(t)}var ai=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(){return ti(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"_getDefaultProp",value:function(){return Go(Go({},ri(ci(i.prototype),"_getDefaultProp",this).call(this)),{},{media:!1,posRule:"cover"})}},{key:"resize",value:function(){ri(ci(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 $o?(e=t.canvas,r=t.width,n=t.height):e=t;var o=Yo({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)}}}}])&&ei(e.prototype,r),n&&ei(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}($o);function ui(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 li(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var fi=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),li(this,"_prop",void 0),li(this,"_outer",void 0),li(this,"_thumb",void 0),li(this,"_outerHeight",void 0),li(this,"_outerWidth",void 0),li(this,"_thumbHeight",void 0),li(this,"_thumbWidth",void 0),li(this,"_scrollVal",void 0),li(this,"_coordsAtDragStart",void 0),li(this,"_listeners",void 0),li(this,"_scrollEvent",void 0),li(this,"_actionTimeout",void 0),li(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=w("div",{parent:o,class:c}),this._thumb=w("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 Bt?(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(P(this.outer,"mouseenter",this._handleHover.bind(this,!0))),this._listeners.push(P(this.outer,"mouseleave",this._handleHover.bind(this,!1))),this._scrollEvent=zt({container:this.prop.container,callback:function(e){t._handleScroll(e)}}),this.prop.isDraggable&&(this._dragger=new mo({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 Bt?this.prop.draggableScrollBehavior:"auto"})}},{key:"_renderThumb",value:function(){var t=rt(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=rt(this._outerWidth/(this.scrollWidth/(this.scrollWidth-r)),[n,1/0]);e.style.width="".concat(o,"px")}else{var i=rt(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()}}])&&ui(e.prototype,r),n&&ui(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function pi(t){return pi="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},pi(t)}function hi(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 di(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?hi(Object(r),!0).forEach((function(e){ki(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hi(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function yi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vi(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 bi(t,e){return bi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},bi(t,e)}function _i(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=Pi(t);if(e){var o=Pi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return gi(this,r)}}function gi(t,e){if(e&&("object"===pi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return mi(t)}function mi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function wi(){return wi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Oi(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},wi.apply(this,arguments)}function Oi(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Pi(t)););return t}function Pi(t){return Pi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Pi(t)}function ki(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ji=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&&bi(t,e)}(i,t);var e,r,n,o=_i(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];yi(this,i),ki(mi(e=o.call(this,t,!1)),"_container",void 0),ki(mi(e),"_scrollWrapper",void 0),ki(mi(e),"_xBar",void 0),ki(mi(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=_(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=w("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 fi(di({dir:"x"},d)),e._yBar=new fi(di({dir:"y"},d)),e.scrollableElement.classList.add("".concat(e.prefix,"-parent")),r&&e.init(),e}return e=i,(r=[{key:"_getDefaultProp",value:function(){return di(di({},wi(Pi(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;wi(Pi(i.prototype),"_setEvents",this).call(this);var e=this.container;e instanceof Bt?e.addCallback("resize",(function(){t.resize()}),{name:this.name}):this.addViewportCallback("",(function(){t.resize()}),{timeout:this.prop.resizeTimeout}),this.resize()}},{key:"_onPropMutate",value:function(){wi(Pi(i.prototype),"_onPropMutate",this).call(this),this.resize()}},{key:"resize",value:function(){this._xBar.resize(),this._yBar.resize()}},{key:"_destroy",value:function(){if(wi(Pi(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"))}}])&&vi(e.prototype,r),n&&vi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(et);function Ei(t){return Ei="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},Ei(t)}function Si(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 Ti(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Si(Object(r),!0).forEach((function(e){Ai(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Si(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function xi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ri(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 Ci(t,e){return Ci=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Ci(t,e)}function Li(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=Bi(t);if(e){var o=Bi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Di(this,r)}}function Di(t,e){if(e&&("object"===Ei(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Mi(t)}function Mi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Wi(){return Wi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Ii(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},Wi.apply(this,arguments)}function Ii(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Bi(t)););return t}function Bi(t){return Bi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Bi(t)}function Ai(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var zi=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&&Ci(t,e)}(i,t);var e,r,n,o=Li(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return xi(this,i),Ai(Mi(e=o.call(this,t,!1)),"_scrollContainer",void 0),"string"==typeof e.prop.container?e._scrollContainer=_(e.prop.container):e._scrollContainer=e.prop.container,r&&e.init(),e}return e=i,(r=[{key:"_getDefaultProp",value:function(){return Ti(Ti({},Wi(Bi(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window,intersectionRoot:!1})}},{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(){if(!1===this.prop.intersectionRoot){var t=this.scrollContainer;return t instanceof Window?null:t instanceof Element?t:t.outer}return this.prop.intersectionRoot}},{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}}}])&&Ri(e.prototype,r),n&&Ri(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(et);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},Fi(t)}function Hi(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 Ni(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Hi(Object(r),!0).forEach((function(e){ts(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Hi(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Vi(t){return function(t){if(Array.isArray(t))return Xi(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 Xi(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 Xi(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 Xi(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 Qi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ui(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 Yi(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=Zi(t);if(e){var o=Zi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return qi(this,r)}}function qi(t,e){if(e&&("object"===Fi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ki(t)}function Ki(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ji(){return Ji="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Gi(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},Ji.apply(this,arguments)}function Gi(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Zi(t)););return t}function Zi(t){return Zi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Zi(t)}function ts(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&&$i(t,e)}(i,t);var e,r,n,o=Yi(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Qi(this,i),ts(Ki(e=o.call(this,t,!1)),"_scrollEvent",void 0),ts(Ki(e),"_intersectionObserverIn",void 0),ts(Ki(e),"_intersectionObserverOut",void 0),ts(Ki(e),"_firstStart",void 0),ts(Ki(e),"_elements",void 0),e._scrollEvent=void 0,e._intersectionObserverIn=void 0,e._intersectionObserverOut=void 0,e._firstStart=!0,e._elements=Vi(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 Ni(Ni({},Ji(Zi(i.prototype),"_getDefaultProp",this).call(this)),{},{enabled:!0,container:window,elements:[],threshold:.9,states:"in",classToToggle:"viewed",useDelay:!1,useIntersectionObserver:!0,viewportTarget:"",resizeTimeout:0})}},{key:"elements",get:function(){return this._elements}},{key:"init",value:function(){Ji(Zi(i.prototype),"init",this).call(this)}},{key:"_setEvents",value:function(){var t=this;Ji(Zi(i.prototype),"_setEvents",this).call(this),this.resize(),this.addViewportCallback(this.prop.viewportTarget,(function(){t.resize()}),{timeout:this.prop.resizeTimeout})}},{key:"_onPropMutate",value:function(){Ji(Zi(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(Ft()&&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=zt({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(!Ft()||!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=rt("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&&h((function(){t.classList.toggle(r.prop.classToToggle,e)}),n),!e||"in"!==o&&"inout"!==o?e||"inout"!==o||h((function(){r.callbacks.tbt("out",t)}),n):h((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(){Ji(Zi(i.prototype),"_destroy",this).call(this),this._removeViewEvents()}}],r&&Ui(e.prototype,r),n&&Ui(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(zi);function rs(t){return rs="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},rs(t)}function ns(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function os(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 is(){return is="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=ss(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},is.apply(this,arguments)}function ss(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ls(t)););return t}function cs(t,e){return cs=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},cs(t,e)}function as(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=ls(t);if(e){var o=ls(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return us(this,r)}}function us(t,e){if(e&&("object"===rs(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 ls(t){return ls=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ls(t)}var fs=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&&cs(t,e)}(i,t);var e,r,n,o=as(i);function i(){return ns(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"_setEvents",value:function(){var t=this;is(ls(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;h((function(){var e=t._component,r=document.activeElement;if(r instanceof HTMLElement&&d(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)}}])&&os(e.prototype,r),n&&os(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(Ur);function ps(t){return ps="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},ps(t)}function hs(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 ds(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?hs(Object(r),!0).forEach((function(e){Ps(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hs(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ys(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 vs(t,e){return vs=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},vs(t,e)}function bs(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=Os(t);if(e){var o=Os(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _s(this,r)}}function _s(t,e){if(e&&("object"===ps(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return gs(t)}function gs(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ms(){return ms="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=ws(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},ms.apply(this,arguments)}function ws(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Os(t)););return t}function Os(t){return Os=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Os(t)}function Ps(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ks="is-dragging",js=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&&vs(t,e)}(i,t);var e,r,n,o=bs(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),Ps(gs(e=o.call(this,t)),"_dragger",void 0),Ps(gs(e),"_componentEvents",void 0),Ps(gs(e),"_currentLerp",void 0),e._dragger=void 0,e._componentEvents=[],e._currentLerp=!1,e}return e=i,r=[{key:"_getDefaultProp",value:function(){return ds(ds({},ms(Os(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(){ms(Os(i.prototype),"_constructor",this).call(this),this._toggleDragger()}},{key:"_onPropMutate",value:function(){ms(Os(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 mo({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(ks),e.container.classList.add(ks),this._callbacks.tbt("move",!1)}}},{key:"_handleDragEnd",value:function(){var t=this.component;t.outer.classList.remove(ks),t.container.classList.remove(ks),"boolean"!=typeof this._currentLerp&&(t.changeProp({render:{lerp:this._currentLerp}}),this._currentLerp=!1),this._callbacks.tbt("end",!1)}},{key:"_destroy",value:function(){ms(Os(i.prototype),"_destroy",this).call(this),this._removeDragger()}}],r&&ys(e.prototype,r),n&&ys(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(Ur);function Es(t){return Es="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},Es(t)}function Ss(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 Ts(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ss(Object(r),!0).forEach((function(e){As(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ss(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function xs(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}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 Cs(t,e){return Cs=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Cs(t,e)}function Ls(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=Bs(t);if(e){var o=Bs(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ds(this,r)}}function Ds(t,e){if(e&&("object"===Es(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ms(t)}function Ms(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ws(){return Ws="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}},Ws.apply(this,arguments)}function Is(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Bs(t)););return t}function Bs(t){return Bs=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Bs(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 zs=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&&Cs(t,e)}(i,t);var e,r,n,o=Ls(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return xs(this,i),As(Ms(e=o.call(this,t,!1)),"_scrollContainer",void 0),As(Ms(e),"_section",void 0),As(Ms(e),"_scrollEvent",void 0),As(Ms(e),"_loadedEvent",void 0),As(Ms(e),"_scopeScroll",void 0),As(Ms(e),"_scopeIn",void 0),As(Ms(e),"_scopeMove",void 0),As(Ms(e),"_scopeOut",void 0),As(Ms(e),"_progress",void 0),"string"==typeof e.prop.container?e._scrollContainer=_(e.prop.container):e._scrollContainer=e.prop.container,"string"==typeof e.prop.section?e._section=_(e.prop.section):e._section=e.prop.section,e._progress=-.001,e._scopeScroll=[0,0],e._scopeIn=[0,0],e._scopeMove=[0,0],e._scopeOut=[0,0],r&&e.init(),e}return e=i,r=[{key:"_getDefaultProp",value:function(){return Ts(Ts({},Ws(Bs(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window,viewportTarget:"",resizeTimeout:0})}},{key:"scrollContainer",get:function(){return this._scrollContainer}},{key:"section",get:function(){return this._section}},{key:"scopeScroll",get:function(){return this._scopeScroll}},{key:"scopeIn",get:function(){return this._scopeIn}},{key:"scopeMove",get:function(){return this._scopeMove}},{key:"scopeOut",get:function(){return this._scopeOut}},{key:"progress",get:function(){return this._progress},set:function(t){this._progress=t}},{key:"init",value:function(){Ws(Bs(i.prototype),"init",this).call(this)}},{key:"_setEvents",value:function(){var t=this;Ws(Bs(i.prototype),"_setEvents",this).call(this),this.addViewportCallback(this.prop.viewportTarget,(function(){t.resize()}),{timeout:this.prop.resizeTimeout}),this._loadedEvent=this._app.onPageLoaded(),this._loadedEvent.then((function(){t.resize()})).catch((function(){})),this._scrollEvent=zt({container:this.prop.container,callback:this._handleScroll.bind(this)})}},{key:"_onPropMutate",value:function(){Ws(Bs(i.prototype),"_onPropMutate",this).call(this),this.resize()}},{key:"progressIn",get:function(){return ct(this.progress,this.scopeIn)||0}},{key:"progressOut",get:function(){return ct(this.progress,this.scopeOut)||0}},{key:"progressMove",get:function(){return ct(this.progress,this.scopeMove)||0}},{key:"_handleScroll",value:function(){var t=Ht(this.scrollContainer);t&&this._render(t)}},{key:"resize",value:function(){var t=Ht(this.scrollContainer);if(t){var e=this.section.getBoundingClientRect(),r=this._app.viewport.height,n=t.scrollTop+e.top-r,o=t.scrollTop+e.top+e.height,i=o-n;this._scopeScroll=[n,o],this._scopeIn=[0,r/i],this._scopeOut=[1-r/i,1],this._scopeMove=[this._scopeIn[1],this._scopeOut[0]],this.callbacks.tbt("resize",!1),this._render(t,!0)}}},{key:"_render",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this._canRender(t,e);r&&this.callbacks.tbt("render",!1)}},{key:"_canRender",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return!1;var r=t.scrollTop,n=this.progress,o=ct(r,[this._scopeScroll[0],this._scopeScroll[1]])||0;return this.progress=o,e||o!==n}},{key:"_destroy",value:function(){var t,e;Ws(Bs(i.prototype),"_destroy",this).call(this),null===(t=this._scrollEvent)||void 0===t||t.remove(),null===(e=this._loadedEvent)||void 0===e||e.cancel()}}],r&&Rs(e.prototype,r),n&&Rs(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(et);function Fs(t){return Fs="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},Fs(t)}function Hs(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 Ns(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Hs(Object(r),!0).forEach((function(e){Gs(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Hs(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 Xs(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 Qs(t,e){return Qs=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Qs(t,e)}function Us(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=Js(t);if(e){var o=Js(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return $s(this,r)}}function $s(t,e){if(e&&("object"===Fs(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ys(t)}function Ys(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function qs(){return qs="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Ks(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},qs.apply(this,arguments)}function Ks(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Js(t)););return t}function Js(t){return Js=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Js(t)}function Gs(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Zs=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&&Qs(t,e)}(i,t);var e,r,n,o=Us(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Vs(this,i),Gs(Ys(e=o.call(this,t,!1)),"_initText",void 0),Gs(Ys(e),"_initHTML",void 0),Gs(Ys(e),"_isPrimarySplit",void 0),Gs(Ys(e),"_container",void 0),Gs(Ys(e),"_letters",void 0),Gs(Ys(e),"_words",void 0),Gs(Ys(e),"_lines",void 0),e.prop.container){var n=_(e.prop.container);n instanceof HTMLElement&&(e._container=n)}e._container.translate=!1,e._container&&e._container.classList.add(e.prefix),e._initHTML=e._container.innerHTML;var s=e._container[e.prop.textSource].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._container.ariaLabel=e._initText,e._isPrimarySplit=!1,e._letters=[],e._words=[],e._lines=[],r&&e.init(),e}return e=i,r=[{key:"_getDefaultProp",value:function(){return Ns(Ns({},qs(Js(i.prototype),"_getDefaultProp",this).call(this)),{},{container:"#".concat(this.prefix),textSource:"innerText",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;qs(Js(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,e=this,r=this._initText.split(""),n=0;r.forEach((function(t){var r=e._words[n]||{content:"",hasNewLine:!1,el:w("span",{class:"".concat(e.prefix,"__word"),attr:[["aria-hidden","true"]]}),letters:[]};r.el.style.display="inline-block",e._words[n]=r;var o=t.charCodeAt(0),i=32===o||160===o,s=[45,8208,8211,8212,8722].includes(o),c=10===o;i&&(r.whitespace=document.createTextNode(" ")),c&&(r.br=w("br")),r.hasNewLine=c,i||c?n+=1:(r.content+=t,e.prop.appendLetters||(r.el.innerHTML=r.content),s&&(n+=1))})),this._words=this._words.filter((function(t,r){return 0!==t.content.length||(r>0&&(e._words[r-1].whitespace=t.whitespace,e._words[r-1].br=t.br),!1)})),this._words.forEach((function(e){t&&t.whitespace&&e.el.classList.add("pre-whitespace"),e.whitespace&&e.el.classList.add("has-whitespace"),t=e}))}},{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:w("span",{class:"".concat(t.prefix,"__letter"),html:r,attr:[["aria-hidden","true"]]}),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:w("span",{class:"".concat(t.prefix,"__line"),attr:[["aria-hidden","true"]]}),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(){qs(Js(i.prototype),"_destroy",this).call(this),this._lines=[],this._words=[],this._letters=[],this._container.innerHTML=this._initHTML}}],r&&Xs(e.prototype,r),n&&Xs(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(et);function tc(t){return tc="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},tc(t)}function ec(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 rc(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ec(Object(r),!0).forEach((function(e){pc(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ec(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function nc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function oc(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 ic(t,e){return ic=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},ic(t,e)}function sc(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=fc(t);if(e){var o=fc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return cc(this,r)}}function cc(t,e){if(e&&("object"===tc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ac(t)}function ac(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function uc(){return uc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=lc(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},uc.apply(this,arguments)}function lc(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=fc(t)););return t}function fc(t){return fc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},fc(t)}function pc(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var hc=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&&ic(t,e)}(i,t);var e,r,n,o=sc(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];nc(this,i),pc(ac(e=o.call(this,t,!1)),"_container",void 0),pc(ac(e),"_containerIsWindow",void 0),pc(ac(e),"_outerCursor",void 0),pc(ac(e),"_innerCursor",void 0),pc(ac(e),"_hoveredEl",void 0),pc(ac(e),"_animationFrame",void 0),pc(ac(e),"_currentFPS",void 0),pc(ac(e),"_canPlay",void 0),pc(ac(e),"_coords",void 0),pc(ac(e),"_targetCoords",void 0);var n=_(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._coords={x:0,y:0,w:0,h:0},e._targetCoords={x:0,y:0,w:0,h:0},e._currentFPS=60,e._canPlay=e.prop.run,r&&e.init(),e}return e=i,r=[{key:"_getDefaultProp",value:function(){return rc(rc({},uc(fc(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window,run:!0,hideNativeCursor:!1,size:{width:50,height:50},render:{lerp:.2,lerpToFixed:2,normalizeLerp:!1},hover:{sticky:!1,autoSize:!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:"hoveredEl",get:function(){return this._hoveredEl},set:function(t){this._hoveredEl=t}},{key:"coords",get:function(){return this._coords}},{key:"targetCoords",get:function(){var t=this.hoveredEl,e=this.prop,r=e.size,n=this._targetCoords.x,o=this._targetCoords.y,i=r.width,s=r.height,c=0;if(t){var a,u,l,f=t.el.getBoundingClientRect();e.hover.sticky&&(n=f.left+f.width/2,o=f.top+f.height/2),e.hover.autoSize&&(i=(null===(a=this.hoveredEl)||void 0===a?void 0:a.width)||f.width,s=(null===(u=this.hoveredEl)||void 0===u?void 0:u.height)||f.height,c=(null===(l=this.hoveredEl)||void 0===l?void 0:l.padding)||0)}return{x:n,y:o,w:i+=2*c,h:s+=2*c}}},{key:"_constructor",value:function(){uc(fc(i.prototype),"_constructor",this).call(this),this._createCursor()}},{key:"_setEvents",value:function(){var t=this;uc(fc(i.prototype),"_setEvents",this).call(this);var e=this.domContainer;this._animationFrame=new Ot,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:"addHoverEl",value:function(t){var e,r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,o=t.el,i=P(o,"mouseenter",(function(){e=h((function(){r.hoveredEl=rc({},t)}),n)})),s=P(o,"mouseleave",(function(){r.hoveredEl=void 0,e&&e.clear()}));return{remove:function(){var t,n;(null===(t=r.hoveredEl)||void 0===t?void 0:t.el)===o&&(r.hoveredEl=void 0),i.remove(),s.remove(),null===(n=e)||void 0===n||n.clear()}}}},{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=w("div",{class:"".concat(t," ").concat(e instanceof Window?"in-window":"in-element"," disabled"),parent:r}),this._innerCursor=w("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._coords.x=t.clientX,this._coords.y=t.clientY,this._targetCoords.x=t.clientX,this._targetCoords.y=t.clientY,this.outerCursor.classList.add("in-action")}},{key:"_handleMouseLeave",value:function(){this.outerCursor.classList.remove("in-action")}},{key:"_handleMouseMove",value:function(t){this._targetCoords.x=t.clientX,this._targetCoords.y=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.targetCoords;this._calcCoords();var r=this._renderElements();t.autoStop&&this.coords.x===e.x&&this.coords.y===e.y&&this.coords.w===e.w&&this.coords.h===e.h&&this._animationFrame.pause(),this._callbacks.tbt("render",r)}},{key:"_calcCoords",value:function(){this._coords.x=this._lerp(this._coords.x,this.targetCoords.x),this._coords.y=this._lerp(this._coords.y,this.targetCoords.y),this._coords.w=this._lerp(this._coords.w,this.targetCoords.w),this._coords.h=this._lerp(this._coords.h,this.targetCoords.h)}},{key:"_lerp",value:function(t,e){var r=this.prop.render,n=r.normalizeLerp,o=r.lerp,i=r.lerpToFixed,s=nt(t,e,o*(n?60/this._currentFPS:1),.02);if("number"==typeof i){var c=Math.round(Math.abs(i));s=parseFloat(s.toFixed(c))}return s}},{key:"_renderElements",value:function(){var t=this.domContainer,e=this.outerCursor,r=this.coords,n=r.x,o=r.y,i=this.coords,s=i.w,c=i.h;if(!this._containerIsWindow){var a=t.getBoundingClientRect();n-=a.left,o-=a.top}return e.style.transform="translate(".concat(n,"px, ").concat(o,"px)"),e.style.setProperty("--cursor-w","".concat(s,"px")),e.style.setProperty("--cursor-h","".concat(c,"px")),{x:n,y:o,w:s,h:c}}},{key:"enable",value:function(){this._canPlay=!0,this.outerCursor.classList.remove("disabled"),this.innerCursor.classList.remove("disabled"),this._animationFrame.play()}},{key:"disable",value:function(){this._canPlay=!1,this.outerCursor.classList.add("disabled"),this.innerCursor.classList.add("disabled"),this._animationFrame.pause()}},{key:"_destroy",value:function(){uc(fc(i.prototype),"_destroy",this).call(this),this._destroyCursor(),this._animationFrame.destroy()}}],r&&oc(e.prototype,r),n&&oc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(et),dc={common:t,listeners:n,math:e,scroll:o,image:i};window.Vevet=c})()})();
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:"",C=E.toString,L=T.call(Object),D=RegExp("^"+T.call(x).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=v?h.Buffer:void 0,W=h.Symbol,I=h.Uint8Array,B=M?M.allocUnsafe:void 0,A=(O=Object.getPrototypeOf,P=Object,function(t){return O(P(t))}),z=Object.create,F=E.propertyIsEnumerable,H=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,U=Date.now,$=yt(h,"Map"),Y=yt(Object,"create"),q=function(){function t(){}return function(e){if(!St(e))return{};if(z)return z(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():H.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($||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(!$||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=C.call(t);n&&(e?t[N]=r:delete t[N]);return o}(t):function(t){return C.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)?D: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=B?B(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 I(g).set(new I(_)),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=A(t);if(null===e)return!0;var r=x.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&T.call(r)==L}(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(A(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,Dt),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}:Dt;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=U(),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")&&!F.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 Ct,Lt=(Ct=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=Ct.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&&Ct(t,s,r,o)}return t})));function Dt(t){return t}t.exports=Lt},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,{id:()=>u,mergeWithoutArrays:()=>p,timeoutCallback:()=>h});var e={};r.r(e),r.d(e,{clamp:()=>nt,clampScope:()=>at,easing:()=>gt,inScope:()=>ct,lerp:()=>ot,scoped:()=>it,spreadScope:()=>st,wrap:()=>ut});var n={};r.r(n),r.d(n,{intersectionObserverSupported:()=>Kt,onScroll:()=>qt});var o={};r.r(o),r.d(o,{getValues:()=>Jt,to:()=>Ee,toElement:()=>Se});var i={};r.r(i),r.d(i,{load:()=>Me,pathsToProps:()=>Ie,sizesToSrcSet:()=>We});var s={};r.r(s);var c={};r.r(c),r.d(c,{AnimationFrame:()=>Dt,Application:()=>Ar,Callbacks:()=>L,Component:()=>rt,Ctx2D:()=>qo,Ctx2DPrerender:()=>li,CustomCursor:()=>yc,Dragger:()=>fo,DraggerDirection:()=>Wo,DraggerMove:()=>Oo,GeneralTypes:()=>s,Module:()=>V,MutableProp:()=>I,Page:()=>Bn,PageLoad:()=>Lr,Plugin:()=>Yr,Preloader:()=>un,ProgressPreloader:()=>Pn,ScrollBar:()=>Si,ScrollEventsBase:()=>Hi,ScrollSectionProgress:()=>Hs,ScrollView:()=>ns,SmoothScroll:()=>$t,SmoothScrollDragPlugin:()=>Ss,SmoothScrollKeyboardPlugin:()=>hs,SplitText:()=>ec,StaticTimeline:()=>fe,Timeline:()=>je,Viewport:()=>kr,WheelHandler:()=>Jn,utils:()=>vc});var a=0;function u(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";return a+=1,"".concat(t,"_").concat(a)}var l=r(554),f=r.n(l);function p(t,e){return f()(t,e,(function(t,e){if(Array.isArray(t))return e}))}function h(t,e){var r;return 0===e?t():r=setTimeout((function(){t()}),e),{clear:function(){r&&clearTimeout(r)}}}function d(t,e){return y(t,e)}function y(t,e){return t===e||null!==t&&y(t.parentNode,e)}function v(t){return t instanceof HTMLElement||t instanceof Element}function b(t){return t instanceof Window}function _(t,e){if(b(t))return t;if(v(t))return t;if(void 0!==e){const r=_(e);if(r)return r.querySelector(t)}return document.querySelector(t)}function g(t,e){if(t instanceof NodeList)return t;if(v(t))return[t];if(Array.isArray(t))return t;if(void 0!==e){const r=_(e);if(r)return r.querySelectorAll(t)}return document.querySelectorAll(t)}function m(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 w(t,e={}){const r=document.createElement(t);if(e.class&&function(t,e){if(t instanceof Element)m(t,e,!0);else for(let r=0;r<t.length;r++)m(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 O=[];function P(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 O.push({id:o,el:t,target:e,callback:r}),{id:o,remove:k.bind(this,o)}}function k(t){const e=[];for(let r=0,n=O.length;r<n;r++){const n=O[r];n.id===t?n.el.removeEventListener(n.target,n.callback):e.push(n)}}var j=r(796),E=r.n(j);function S(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 T(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?S(Object(r),!0).forEach((function(e){C(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function x(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function R(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 C(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var L=function(){function t(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];x(this,t),C(this,"_app",void 0),C(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=u("callback"),o={id:n,on:!0,data:T({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?h(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&&R(e.prototype,r),n&&R(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function D(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function M(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 W(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var I=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";D(this,t),W(this,"_initProp",void 0),W(this,"_onResponsive",void 0),W(this,"_onChange",void 0),W(this,"_name",void 0),W(this,"_app",void 0),W(this,"_refProp",void 0),W(this,"_prop",void 0),W(this,"_responsiveRules",[]),W(this,"_viewportCallback",void 0),this._initProp=e,this._onResponsive=r,this._onChange=n,this._name=o,this._app=window.vevetApp,this._refProp=p({},e),this._prop=p({},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=p({},this._refProp);e.forEach((function(t){var e=t.settings,c=t.breakpoint;if("number"==typeof c)o<=t.breakpoint&&(i=p(s,e));else if("string"==typeof c){var a=c.toLowerCase();("d"===a&&n.isDesktop||"t"===a&&n.isTablet||"p"===a&&n.isPhone)&&(i=p(s,e)),("phone"===a&&r.isPhone||"tablet"===a&&r.isTablet||"mobile"===a&&r.isMobile)&&(i=p(s,e))}})),this._prop=p(this._prop,i||this._refProp),t&&this._onResponsive()}},{key:"changeProp",value:function(t){this._prop=p(this._prop,t),this._refProp=p(this._refProp,t),this._onChange(t)}},{key:"destroy",value:function(){this._viewportCallback&&this._viewportCallback.remove()}}],r&&M(e.prototype,r),n&&M(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function B(){throw new Error('Vevet.Application does not exist yet. \nCall "new Vevet.Application()" before using all the stuff')}function A(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 z(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?A(Object(r),!0).forEach((function(e){N(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function F(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function H(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 N(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var V=function(){function t(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];F(this,t),N(this,"_mutableProp",void 0),N(this,"_callbacks",void 0),N(this,"_listeners",void 0),N(this,"_app",void 0),N(this,"_inited",!1),N(this,"_destroyed",void 0),N(this,"_viewportCallbacks",[]),window.vevetApp?this._app=window.vevetApp:B(),this._destroyed=!1,this._listeners=[],this._callbacks=new L;var n=p(this._getDefaultProp(),e||{});this._mutableProp=new I(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,z(z({},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=P(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&&H(e.prototype,r),n&&H(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function X(t){return X="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},X(t)}function Q(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function U(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 $(){return $="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Y(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},$.apply(this,arguments)}function Y(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Z(t)););return t}function q(t,e){return q=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},q(t,e)}function K(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=Z(t);if(e){var o=Z(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return J(this,r)}}function J(t,e){if(e&&("object"===X(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return G(t)}function G(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Z(t){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Z(t)}function tt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var et,rt=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&&q(t,e)}(i,t);var e,r,n,o=K(i);function i(){var t;Q(this,i);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return tt(G(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(){$(Z(i.prototype),"_destroy",this).call(this),this._destroyPlugins()}}])&&U(e.prototype,r),n&&U(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(V);function nt(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 ot(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 it(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 st(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 ct(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,1];return t>=e[0]&&t<=e[1]}function at(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 nt(it(t,e),r)}function ut(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 lt(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]=ft(.1*c,r,o);return 0===t?0:1===t?1:ft(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=yt(a,n,o);if(u>=.001)return function(t,e,r,n){for(let o=0;o<4;++o){const o=yt(e,r,n);if(0===o)return e;e-=(ft(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=ft(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 ft(t,e,r){return((pt(e,r)*t+ht(e,r))*t+dt(e))*t}function pt(t,e){return 1-3*e+3*t}function ht(t,e){return 3*e-6*t}function dt(t){return 3*t}function yt(t,e,r){return 3*pt(e,r)*t*t+2*ht(e,r)*t+dt(e)}function vt(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 bt(t,e){switch(e){case et.easeInSine:return r=t,1-Math.cos(r*Math.PI/2);case et.easeOutSine:return function(t){return Math.sin(t*Math.PI/2)}(t);case et.easeInOutSine:return function(t){return-(Math.cos(Math.PI*t)-1)/2}(t);case et.easeInQuad:return function(t){return Math.pow(t,2)}(t);case et.easeOutQuad:return function(t){return 1-Math.pow(1-t,2)}(t);case et.easeInOutQuad:return function(t){return t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2}(t);case et.easeInCubic:return function(t){return Math.pow(t,3)}(t);case et.easeOutCubic:return function(t){return 1-Math.pow(1-t,3)}(t);case et.easeInOutCubic:return function(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}(t);case et.easeInQuart:return function(t){return Math.pow(t,4)}(t);case et.easeOutQuart:return function(t){return 1-Math.pow(1-t,4)}(t);case et.easeInOutQuart:return function(t){return t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2}(t);case et.easeInQuint:return function(t){return Math.pow(t,5)}(t);case et.easeOutQuint:return function(t){return 1-Math.pow(1-t,5)}(t);case et.easeInOutQuint:return function(t){return t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2}(t);case et.easeInExpo:return function(t){return 0===t?0:Math.pow(2,10*t-10)}(t);case et.easeOutExpo:return function(t){return 1===t?1:1-Math.pow(2,-10*t)}(t);case et.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 et.easeInCirc:return function(t){return 1-Math.sqrt(1-Math.pow(t,2))}(t);case et.easeOutCirc:return function(t){return Math.sqrt(1-Math.pow(t-1,2))}(t);case et.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 et.easeInBack:return function(t){return 2.70158*t*t*t-1.70158*t*t}(t);case et.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 et.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 et.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 et.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 et.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 et.easeInBounce:return function(t){return 1-vt(1-t)}(t);case et.easeOutBounce:return vt(t);case et.easeInOutBounce:return function(t){return t<.5?(1-vt(1-2*t))/2:(1+vt(2*t-1))/2}(t);default:return t}var r}function _t(t,e=!1){return e?Array.isArray(e)?lt(t,e):"function"==typeof e?e(t):bt(t,e):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"}(et||(et={}));const gt=_t;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){Lt(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=Ct(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=Ct(t);if(e){var o=Ct(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 Ct(t){return Ct=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ct(t)}function Lt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Dt=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];return Pt(this,i),Lt(Rt(e=o.call(this,t,!1)),"_isPlaying",void 0),Lt(Rt(e),"_frame",void 0),Lt(Rt(e),"_frameIndex",void 0),Lt(Rt(e),"_timeStamp",void 0),Lt(Rt(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 Ot(Ot({},jt(Ct(i.prototype),"_getDefaultProp",this).call(this)),{},{fps:140,run:!1})}},{key:"_constructor",value:function(){jt(Ct(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=nt(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(),jt(Ct(i.prototype),"_destroy",this).call(this)}}])&&kt(e.prototype,r),n&&kt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(rt);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 It(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){Ut(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 Bt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function At(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 zt(){return zt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Ft(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},zt.apply(this,arguments)}function Ft(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Qt(t)););return t}function Ht(t,e){return Ht=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Ht(t,e)}function Nt(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=Qt(t);if(e){var o=Qt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Vt(this,r)}}function Vt(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 Xt(t)}function Xt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Qt(t){return Qt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Qt(t)}function Ut(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var $t=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=Nt(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Bt(this,i),Ut(Xt(e=o.call(this,t,!1)),"_outer",void 0),Ut(Xt(e),"_container",void 0),Ut(Xt(e),"_containerExists",void 0),Ut(Xt(e),"_elements",void 0),Ut(Xt(e),"_elementsLength",void 0),Ut(Xt(e),"_targetLeft",void 0),Ut(Xt(e),"_targetTop",void 0),Ut(Xt(e),"_scrollLeft",void 0),Ut(Xt(e),"_scrollTop",void 0),Ut(Xt(e),"_scrollWidth",void 0),Ut(Xt(e),"_scrollHeight",void 0),Ut(Xt(e),"_clientWidth",void 0),Ut(Xt(e),"_clientHeight",void 0),Ut(Xt(e),"_instant",void 0),Ut(Xt(e),"_animationFrame",void 0),Ut(Xt(e),"_outerAnimationFrameEvent",void 0),Ut(Xt(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=_(n.outer),!(e._outer instanceof HTMLElement))throw new Error("".concat(n.outer," is not a HTMLElement"));e._outer.classList.add(e.prefix);var s=_(".".concat(e.prefix,"__container"),e.outer);return v(s)?(e._container=s,e._containerExists=!0):(e._container=w("div",{class:"".concat(e.prefix,"__container"),parent:e.outer,children:Array.from(e.outer.children)}),e._containerExists=!1),n.elements?e._elements=Array.from(g(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=nt(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=nt(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 It(It({},zt(Qt(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(){zt(Qt(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(){zt(Qt(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=nt(e.clientWidth,[this.clientWidth,1/0]),this._scrollHeight=nt(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=E()(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 Dt,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=ot(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(zt(Qt(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&&At(e.prototype,r),n&&At(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(rt),Yt=[];function qt(t){var e=t.container,r=t.callback,n=t.isPassive,o=void 0!==n&&n,i=Yt.find((function(t){return t.container===e&&t.isPassive===o})),s=u("scroll-event");if(i)i.callbacks.push({id:s,callback:r});else{i={id:u("scroll-event-instance"),container:e,callbacks:[{id:s,callback:r}],isPassive:o,listeners:[]},Yt.push(i);var c=i.listeners;if(e instanceof $t)c.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 a=e instanceof Window,l=_(e);c.push(P(l,"scroll",(function(){for(var t=a?l.pageYOffset:l.scrollTop,e=a?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!==s}));i.callbacks=t,0===t.length&&(i.listeners.forEach((function(t){t.remove()})),Yt=Yt.filter((function(t){return t.id!==i.id})))}}}function Kt(){return"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype}function Jt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;if(t){var e=t instanceof Window?t.pageYOffset:t.scrollTop,r=t instanceof Window?t.pageXOffset:t.scrollLeft;return{scrollTop:e,scrollLeft:r}}}function Gt(t){return Gt="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},Gt(t)}function Zt(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 te(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Zt(Object(r),!0).forEach((function(e){le(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Zt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function re(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 ne(t,e){return ne=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},ne(t,e)}function oe(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=ue(t);if(e){var o=ue(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ie(this,r)}}function ie(t,e){if(e&&("object"===Gt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return se(t)}function se(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ce(){return ce="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=ae(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},ce.apply(this,arguments)}function ae(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ue(t)););return t}function ue(t){return ue=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ue(t)}function le(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var fe=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&&ne(t,e)}(i,t);var e,r,n,o=oe(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return ee(this,i),le(se(e=o.call(this,t,!1)),"_progress",void 0),le(se(e),"_easing",void 0),le(se(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 te(te({},ce(ue(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=_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=nt(it(e,o.prop.nestedScope),[0,1]);o.progress=i}}},{key:"_destroy",value:function(){ce(ue(i.prototype),"_destroy",this).call(this),this._nestedTimelines.forEach((function(t){t.destroy()}))}}],r&&re(e.prototype,r),n&&re(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(rt);function pe(t){return pe="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},pe(t)}function he(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 de(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?he(Object(r),!0).forEach((function(e){ke(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):he(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ye(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ve(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 be(t,e){return be=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},be(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=Pe(t);if(e){var o=Pe(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ge(this,r)}}function ge(t,e){if(e&&("object"===pe(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return me(t)}function me(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function we(){return we="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Oe(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},we.apply(this,arguments)}function Oe(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Pe(t)););return t}function Pe(t){return Pe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Pe(t)}function ke(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var je=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&&be(t,e)}(i,t);var e,r,n,o=_e(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return ye(this,i),ke(me(e=o.call(this,t,!1)),"_isPlaying",void 0),ke(me(e),"_isReversed",void 0),ke(me(e),"_isPaused",void 0),ke(me(e),"_animationFrame",void 0),ke(me(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 de(de({},we(Pe(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=nt(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(){we(Pe(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(),we(Pe(i.prototype),"_destroy",this).call(this)}}])&&ve(e.prototype,r),n&&ve(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(fe);function Ee(t){var e=t.container,r=void 0===e?window:e,n=t.top,o=void 0===n?0:n,i=t.left,s=void 0===i?0:i,c=t.duration,a=void 0===c?250:c;return new Promise((function(t,e){var n=Jt(r);if(n){var i=new je({duration:a});return i.addCallback("progress",(function(t){r&&r.scrollTo({top:n.scrollTop+(o-n.scrollTop)*t.easing,left:n.scrollLeft+(s-n.scrollLeft)*t.easing,behavior:"auto"})})),i.addCallback("end",(function(){t()})),void i.play()}e()}))}function Se(t){var e=t.container,r=void 0===e?window:e,n=t.el,o=t.top,i=void 0===o?0:o,s=t.left,c=void 0===s?0:s,a=t.duration,u=void 0===a?250:a;return new Promise((function(t,e){var o=Jt(r);if(o){var s=_(n);if(s){var a=s.getBoundingClientRect(),l=nt(a.top+o.scrollTop-i,[0,1/0]),f=nt(a.left+o.scrollLeft-c,[0,1/0]);Ee({container:r,top:l,left:f,duration:u}).then((function(){t()})).catch((function(){e()}))}}else e()}))}class Te extends Error{constructor(t){super(t||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}}class xe{static fn(t){return(...e)=>new xe(((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 Te(t))}}get isCanceled(){return this._isCanceled}}function Re(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 Ce(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Re(Object(r),!0).forEach((function(e){Le(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Re(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Le(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(xe.prototype,Promise.prototype);var De=[];function Me(t,e){var r=Ce(Ce({},{crossOrigin:null,useCache:!1}),e),n="string"==typeof t?t:t.src;return new xe((function(e,o){var i=r.useCache&&De.find((function(t){return t.src===n}));if(i)e(i.image);else{if("string"==typeof t){var s=new Image;return s.crossOrigin=r.crossOrigin,s.onload=function(){r.useCache&&De.push({src:n,image:s}),e(s)},s.onerror=function(){o()},void(s.src=t)}t instanceof HTMLImageElement&&(t.complete?e(t):(t.addEventListener("load",(function(){r.useCache&&De.push({src:n,image:t}),e(t)})),t.addEventListener("error",(function(){o()}))))}}))}function We(t){return Object.keys(t).map((function(e){var r=t[e];if(r)return"".concat(r," ").concat(e,"w")})).filter((function(t){return!!t})).join(", ")}function Ie(t){var e=window.vevetApp,r=t.original;t.thumb&&(r=t.thumb),e&&e.supportsWebp&&t.thumbWebp&&(r=t.thumbWebp);var n="";return e&&e.supportsWebp&&"sizesWebp"in t&&t.sizesWebp?n=We(t.sizesWebp):"sizes"in t&&t.sizes&&(n=We(t.sizes)),{src:r,srcSet:n}}var Be=/iPhone/i,Ae=/iPod/i,ze=/iPad/i,Fe=/\biOS-universal(?:.+)Mac\b/i,He=/\bAndroid(?:.+)Mobile\b/i,Ne=/Android/i,Ve=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Xe=/Silk/i,Qe=/Windows Phone/i,Ue=/\bWindows(?:.+)ARM\b/i,$e=/BlackBerry/i,Ye=/BB10/i,qe=/Opera Mini/i,Ke=/\b(CriOS|Chrome)(?:.+)Mobile/i,Je=/Mobile(?:.+)Firefox\b/i,Ge=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};function Ze(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(Be)&&!o(Qe),ipod:o(Ae),tablet:!o(Be)&&(o(ze)||Ge(e))&&!o(Qe),universal:o(Fe),device:(o(Be)||o(Ae)||o(ze)||o(Fe)||Ge(e))&&!o(Qe)},amazon:{phone:o(Ve),tablet:!o(Ve)&&o(Xe),device:o(Ve)||o(Xe)},android:{phone:!o(Qe)&&o(Ve)||!o(Qe)&&o(He),tablet:!o(Qe)&&!o(Ve)&&!o(He)&&(o(Xe)||o(Ne)),device:!o(Qe)&&(o(Ve)||o(Xe)||o(He)||o(Ne))||o(/\bokhttp\b/i)},windows:{phone:o(Qe),tablet:o(Ue),device:o(Qe)||o(Ue)},other:{blackberry:o($e),blackberry10:o(Ye),opera:o(qe),firefox:o(Je),chrome:o(Ke),device:o($e)||o(Ye)||o(qe)||o(Je)||o(Ke)},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 tr,er,rr=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))},nr=function(t,e,r){this.name=t,this.version=e,this.os=r,this.type="browser"},or=function(t){this.version=t,this.type="node",this.name="node",this.os=process.platform},ir=function(t,e,r,n){this.name=t,this.version=e,this.os=r,this.bot=n,this.type="bot-device"},sr=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},cr=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},ar=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,ur=[["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/]],lr=[["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 fr(t){return t?hr(t):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new cr:"undefined"!=typeof navigator?hr(navigator.userAgent):"undefined"!=typeof process&&process.version?new or(process.version.slice(1)):null}function pr(t){return""!==t&&ur.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 hr(t){var e=pr(t);if(!e)return null;var r=e[0],n=e[1];if("searchbot"===r)return new sr;var o=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);o?o.length<3&&(o=rr(rr([],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=lr.length;e<r;e++){var n=lr[e],o=n[0];if(n[1].exec(t))return o}return null}(t),c=ar.exec(t);return c&&c[1]?new ir(r,i,s,c[1]):new nr(r,i,s)}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},dr(t)}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(){return vr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=br(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 br(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Or(t)););return t}function _r(t,e){return _r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},_r(t,e)}function gr(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 mr(this,r)}}function mr(t,e){if(e&&("object"===dr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return wr(t)}function wr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");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}!function(t){t.Desktop="desktop",t.Tablet="tablet",t.Phone="phone"}(tr||(tr={})),function(t){t.Landscape="landscape",t.Portrait="portrait"}(er||(er={}));var kr=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&&_r(t,e)}(i,t);var e,r,n,o=gr(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),Pr(wr(t=o.call(this,!1)),"_width",void 0),Pr(wr(t),"_height",void 0),Pr(wr(t),"_radius",void 0),Pr(wr(t),"_prevSize",void 0),Pr(wr(t),"_isDesktop",void 0),Pr(wr(t),"_isTablet",void 0),Pr(wr(t),"_isPhone",void 0),Pr(wr(t),"_resizeTimeout",void 0),t._width=0,t._height=0,t._radius=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:"radius",get:function(){return Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/2}},{key:"vw",get:function(){return this.width/100}},{key:"vh",get:function(){return this.height/100}},{key:"vr",get:function(){return this.radius/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(){vr(Or(i.prototype),"_constructor",this).call(this),this._setValues()}},{key:"_setEvents",value:function(){var t=this;window.addEventListener("resize",(function(){t._resizeTimeout&&t._resizeTimeout.clear(),t._resizeTimeout=h((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=[tr.Desktop,tr.Tablet,tr.Phone];this.isDesktop?this._updateBreakpointClasses(tr.Desktop,t):this.isTablet?this._updateBreakpointClasses(tr.Tablet,t):this._updateBreakpointClasses(tr.Phone,t);var e=[er.Landscape,er.Portrait];this.isLandscape?this._updateBreakpointClasses(er.Landscape,e):this.isPortrait?this._updateBreakpointClasses(er.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")),t.style.setProperty("--vr","".concat(this.vr,"px"))}},{key:"_onResize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._prevSize.w,r=this._prevSize.h;this._setValues();var n=this.width,o=this.height,i={widthChanged:n!==e,heightChanged:o!==r,orientationChanged:n>o!=e>r};(t||n!==e&&o===r)&&this.tbt("w_",i),(t||o!==r&&n===e)&&this.tbt("h_",i),(t||n!==e&&o!==r)&&(this.tbt("wh",i),this.tbt("hw",i)),(t||n!==e)&&this.tbt("w",i),(t||o!==r)&&this.tbt("h",i),this.tbt("",i)}},{key:"forceResize",value:function(){this._onResize(!0)}}],r&&yr(e.prototype,r),n&&yr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(L);function jr(t){return jr="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},jr(t)}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 Sr(t,e){return Sr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Sr(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 r,n=Cr(t);if(e){var o=Cr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return xr(this,r)}}function xr(t,e){if(e&&("object"===jr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Rr(t)}function Rr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Cr(t){return Cr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Cr(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&&Sr(t,e)}(i,t);var e,r,n,o=Tr(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=Rr(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()}}])&&Er(e.prototype,r),n&&Er(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(L);function Dr(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 Mr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Dr(Object(r),!0).forEach((function(e){Br(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Dr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Wr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ir(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 Br(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ar=function(){function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Wr(this,t),Br(this,"_prop",void 0),Br(this,"_prefix",void 0),Br(this,"_isPhone",void 0),Br(this,"_isTablet",void 0),Br(this,"_isMobile",void 0),Br(this,"_isDesktop",void 0),Br(this,"_osName",void 0),Br(this,"_browserName",void 0),Br(this,"_supportsWebp",void 0),Br(this,"_pages",[]),Br(this,"_page",!1),Br(this,"_pageLoad",void 0),Br(this,"_viewport",void 0),window.vevetApp)throw new Error("Vevet Application already exists!");this._prop=Mr(Mr({},this.defaultProp),r),this._prefix=this.prop.prefix,this._sayHi(),window.vevetApp=this;var n=Ze();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 o=fr();if(null!=o&&o.os){var i=o.os.split(" ")[0].toLowerCase();this.html.classList.add("".concat(this.prefix,"os-").concat(i)),this._osName=i}else this._osName="";if(null!=o&&o.name){var s=o.name.toLowerCase();this.html.classList.add("".concat(this.prefix,"browser-").concat(s)),this._browserName=s}else this._browserName="";if(this._pageLoad=new Lr,this._viewport=new kr,this.prop.webpSupport){var c=new Image;c.onload=function(){e._supportsWebp=1===c.width},c.onerror=function(){e._supportsWebp=!1},c.src="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA="}else this._supportsWebp=!1}var e,r,n;return e=t,(r=[{key:"version",get:function(){return"2.17.0"}},{key:"prop",get:function(){return this._prop}},{key:"defaultProp",get:function(){return{sayHi:!0,tablet:1199,phone:899,prefix:"v-",easing:[.25,.1,.25,1],viewportResizeTimeout:0,webpSupport:!1}}},{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:"supportsWebp",get:function(){return this._supportsWebp}},{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 xe((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 xe((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 xe((function(e){t._pageLoad.onLoaded((function(){e()}))}))}},{key:"viewport",get:function(){return this._viewport}},{key:"_sayHi",value:function(){if(this.prop.sayHi){var t="Vevet ".concat(this.version),e=["padding: 1rem 1.5rem;","background: #5F2580;","font: 1rem/1 Arial;","color: #ffffff;"].join("");console.log("%c%s",e,t)}}}])&&Ir(e.prototype,r),n&&Ir(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function zr(t){return zr="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},zr(t)}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 Hr(){return Hr="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}},Hr.apply(this,arguments)}function Nr(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=$r(t)););return t}function Vr(t,e){return Vr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Vr(t,e)}function Xr(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=$r(t);if(e){var o=$r(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Qr(this,r)}}function Qr(t,e){if(e&&("object"===zr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ur(t)}function Ur(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $r(t){return $r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},$r(t)}var Yr=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=Xr(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=Ur(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.");Hr($r(i.prototype),"init",this).call(this)}},{key:"initPlugin",value:function(t){this._inited||(this._component=t,this.init())}}])&&Fr(e.prototype,r),n&&Fr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(V);function qr(t){return qr="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},qr(t)}function Kr(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 Jr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Kr(Object(r),!0).forEach((function(e){an(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Kr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Gr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Zr(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 en(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=cn(t);if(e){var o=cn(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"===qr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return nn(t)}function nn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function on(){return on="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=sn(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},on.apply(this,arguments)}function sn(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=cn(t)););return t}function cn(t){return cn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},cn(t)}function an(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var un=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=en(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Gr(this,i),an(nn(e=o.call(this,t,!1)),"_container",void 0),an(nn(e),"_startTime",void 0),an(nn(e),"_endTime",void 0),an(nn(e),"_toBeHidden",void 0),an(nn(e),"_isHidden",void 0),an(nn(e),"_pageLoadEvent",void 0),e.prop.container){var n=_(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 Jr(Jr({},on(cn(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;on(cn(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 xe((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 xe((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",h((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;on(cn(i.prototype),"_destroy",this).call(this),null===(t=this._pageLoadEvent)||void 0===t||t.remove()}}],r&&Zr(e.prototype,r),n&&Zr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(rt);function ln(t){return ln="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},ln(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 pn(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){On(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 dn(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 yn(t,e){return yn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},yn(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=wn(t);if(e){var o=wn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return bn(this,r)}}function bn(t,e){if(e&&("object"===ln(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _n(t)}function _n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function gn(){return gn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=mn(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},gn.apply(this,arguments)}function mn(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=wn(t)););return t}function wn(t){return wn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},wn(t)}function On(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var 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}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yn(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];return hn(this,i),On(_n(e=o.call(this,t,!1)),"_imgs",void 0),On(_n(e),"_videos",void 0),On(_n(e),"_customResources",void 0),On(_n(e),"_resourcesTotal",void 0),On(_n(e),"_resourcesLoaded",void 0),On(_n(e),"_progress",void 0),On(_n(e),"_animationFrame",void 0),On(_n(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 pn(pn({},gn(wn(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(){gn(wn(i.prototype),"_constructor",this).call(this),this._getResources()}},{key:"_setEvents",value:function(){var t=this;gn(wn(i.prototype),"_setEvents",this).call(this);var e=this.prop.calc.lerp;"number"==typeof e&&(this._animationFrame=new Dt,this._animationFrame.addCallback("frame",(function(){t.progress=ot(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 xe((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&&g("img").forEach((function(r){r.classList.contains(e.ignoreClassName)||(t._imgs.push(r),t._resourcesTotal+=1)})),e.video&&g("video").forEach((function(r){r.classList.contains(e.ignoreClassName)||(t._videos.push(r),t._resourcesTotal+=1)})),e.custom&&(Array.from(g(e.custom)).forEach((function(e){var r=parseInt(e.getAttribute("data-load-count")||"1",10);r=Number.isNaN(r)?1:nt(r,[1,1/0]);for(var n=1;n<=r;n+=1){var o=n/r;t._customResources.push({el:e,targetProgress:o})}})),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){var n=t.el,o=t.targetProgress,i=0;if(void 0!==n.isComplete?"boolean"==typeof n.isComplete?n.isComplete&&(i=o):"number"==typeof n.isComplete&&(i=n.isComplete):void 0!==n.isLoaded&&("boolean"==typeof n.isLoaded?n.isLoaded&&(i=o):"number"==typeof n.isLoaded&&(i=n.isLoaded)),0===i){var s=n.getAttribute("data-is-loaded");if(null!==s&&""!==s){var c=parseFloat(s);i=Number.isNaN(c)?o:c}}i>=o?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 je({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(){gn(wn(i.prototype),"_destroy",this).call(this),this._animationFrame&&this._animationFrame.destroy()}}],r&&dn(e.prototype,r),n&&dn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(un);function kn(t){return kn="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},kn(t)}function jn(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 En(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?jn(Object(r),!0).forEach((function(e){In(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Sn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Tn(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 xn(){return xn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Rn(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},xn.apply(this,arguments)}function Rn(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Wn(t)););return t}function Cn(t,e){return Cn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Cn(t,e)}function Ln(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=Wn(t);if(e){var o=Wn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Dn(this,r)}}function Dn(t,e){if(e&&("object"===kn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Mn(t)}function Mn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Wn(t){return Wn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Wn(t)}function In(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&&Cn(t,e)}(i,t);var e,r,n,o=Ln(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Sn(this,i),In(Mn(e=o.call(this,t,!1)),"_blocked",void 0),In(Mn(e),"_created",void 0),In(Mn(e),"_beforeShown",void 0),In(Mn(e),"_shown",void 0),In(Mn(e),"_hidden",void 0),In(Mn(e),"_viaAJAX",void 0),e._blocked=!1,e._created=!1,e._beforeShown=!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:"beforeShown",get:function(){return this._beforeShown}},{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 En(En({},xn(Wn(i.prototype),"_getDefaultProp",this).call(this)),{},{name:"home",hasInnerPreloader:!1})}},{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._beforeShown=!1,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.callbacks.tbt("beforeshow",!1),t._beforeShown=!0,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(){var t=this._ignorePreventPageShow();return this.addCallback("destroy",(function(){t.cancel()})),new Promise((function(e,r){t.then((function(){e()})).catch((function(){r()}))}))}},{key:"_ignorePreventPageShow",value:function(){var t=this;return new xe((function(e,r){t._destroyed&&r(),0===g("[data-prevent-page-show]").length?e():setTimeout((function(){t._ignorePreventPageShow().then((function(){e()})).catch((function(){r()}))}),30)}))}},{key:"canShow",value:function(){var t=this;return new Promise((function(e,r){!t.created||t.shown?r():t.prop.hasInnerPreloader?new Pn({parent:t,container:!1,hide:!1,loaders:{img:!1,video:!1,custom:".js-preload-inner"},calc:{lerp:!1}}).addCallback("loaded",(function(){e()})):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._beforeShown=!1,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._beforeShown=!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){xn(Wn(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 xe((function(e){t.created?e():t.addCallback("create",(function(){e()}),{once:!0})}))}},{key:"onShow",value:function(){var t=this;return new xe((function(e){t.shown?e():t.addCallback("show",(function(){e()}),{once:!0})}))}},{key:"onBeforeShow",value:function(){var t=this;return new xe((function(e){t.shown||t.beforeShown?e():t.addCallback("beforeshow",(function(){e()}),{once:!0})}))}},{key:"onHide",value:function(){var t=this;return new xe((function(e){t.hidden?e():t.addCallback("hide",(function(){e()}),{once:!0})}))}}],r&&Tn(e.prototype,r),n&&Tn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(rt);function An(t){return An="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},An(t)}function zn(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?zn(Object(r),!0).forEach((function(e){Kn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zn(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 Nn(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 Vn(t,e){return Vn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Vn(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=qn(t);if(e){var o=qn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Qn(this,r)}}function Qn(t,e){if(e&&("object"===An(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Un(t)}function Un(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=Yn(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 Yn(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=qn(t)););return t}function qn(t){return qn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},qn(t)}function Kn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Jn=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&&Vn(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 Hn(this,i),Kn(Un(e=o.call(this,t,!1)),"_wheelListener",void 0),Kn(Un(e),"_lockWheel",void 0),Kn(Un(e),"_lockWheelTimeout",void 0),e._wheelListener=void 0,e._lockWheel=!1,r&&e.init(),e}return e=i,(r=[{key:"_getDefaultProp",value:function(){return Fn(Fn({},$n(qn(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(){$n(qn(i.prototype),"_setEvents",this).call(this),this.container instanceof Window?this._toggleWheelEvent():(this._listeners.push(P(this.container,"mouseenter",this._handleMouseEnter.bind(this))),this._listeners.push(P(this.container,"mouseleave",this._handleMouseLeave.bind(this))))}},{key:"_onPropMutate",value:function(){$n(qn(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=P(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=E()(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(){$n(qn(i.prototype),"_destroy",this).call(this),this._destroyWheelEvent()}}])&&Nn(e.prototype,r),n&&Nn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(V);function Gn(t){return Gn="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},Gn(t)}function Zn(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 to(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Zn(Object(r),!0).forEach((function(e){lo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Zn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function eo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ro(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 no(t,e){return no=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},no(t,e)}function oo(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=uo(t);if(e){var o=uo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return io(this,r)}}function io(t,e){if(e&&("object"===Gn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return so(t)}function so(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function co(){return co="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=ao(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},co.apply(this,arguments)}function ao(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=uo(t)););return t}function uo(t){return uo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},uo(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}var fo=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&&no(t,e)}(i,t);var e,r,n,o=oo(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(eo(this,i),lo(so(e=o.call(this,t,!1)),"_container",void 0),lo(so(e),"_runtimeEvents",void 0),lo(so(e),"_isDragging",void 0),lo(so(e),"_pointerID",void 0),lo(so(e),"_coords",void 0),lo(so(e),"_prevCoords",void 0),lo(so(e),"_startCoords",void 0),e._container=_(e.prop.container),!v(e._container)&&!b(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 to(to({},co(uo(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(P(window,"mouseup",this._handleEnd.bind(this),{passive:t})),this._runtimeEvents.push(P(window,"touchend",this._handleEnd.bind(this),{passive:t})),this._runtimeEvents.push(P(window,"touchcancel",this.cancel.bind(this),{passive:t})),this._runtimeEvents.push(P(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(){co(uo(i.prototype),"_destroy",this).call(this),this._removeRuntimeEvents()}}])&&ro(e.prototype,r),n&&ro(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(rt);function po(t){return po="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},po(t)}function ho(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yo(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=bo(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 bo(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=wo(t)););return t}function _o(t,e){return _o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},_o(t,e)}function go(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=wo(t);if(e){var o=wo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return mo(this,r)}}function mo(t,e){if(e&&("object"===po(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 wo(t){return wo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},wo(t)}var Oo=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&&_o(t,e)}(i,t);var e,r,n,o=go(i);function i(){return ho(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(){vo(wo(i.prototype),"_addRuntimeEvents",this).call(this);var t=this.prop.usePassive;this._runtimeEvents.push(P(window,"mousemove",this._handleMove.bind(this),{passive:t})),this._runtimeEvents.push(P(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(){vo(wo(i.prototype),"_destroy",this).call(this)}}])&&yo(e.prototype,r),n&&yo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(fo);function Po(t){return Po="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},Po(t)}function ko(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 jo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ko(Object(r),!0).forEach((function(e){Eo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ko(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Eo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function So(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function To(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 xo(){return xo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Ro(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},xo.apply(this,arguments)}function Ro(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Mo(t)););return t}function Co(t,e){return Co=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Co(t,e)}function Lo(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=Mo(t);if(e){var o=Mo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Do(this,r)}}function Do(t,e){if(e&&("object"===Po(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 Mo(t){return Mo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Mo(t)}var Wo=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&&Co(t,e)}(i,t);var e,r,n,o=Lo(i);function i(){return So(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"_getDefaultProp",value:function(){return jo(jo({},xo(Mo(i.prototype),"_getDefaultProp",this).call(this)),{},{min:75})}},{key:"_handleEnd",value:function(t){var e=xo(Mo(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}}])&&To(e.prototype,r),n&&To(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(fo);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 Bo(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?Bo(Object(r),!0).forEach((function(e){Yo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Bo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function zo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fo(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=No(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 No(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=$o(t)););return t}function Vo(t,e){return Vo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Vo(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=$o(t);if(e){var o=$o(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Qo(this,r)}}function Qo(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 Uo(t)}function Uo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $o(t){return $o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},$o(t)}function Yo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,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&&Vo(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];zo(this,i),Yo(Uo(e=o.call(this,t,!1)),"_canvas",void 0),Yo(Uo(e),"_ctx",void 0),Yo(Uo(e),"_width",void 0),Yo(Uo(e),"_height",void 0),Yo(Uo(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=w("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:"clientWidth",get:function(){return this.width/this.dpr}},{key:"height",get:function(){return this._height}},{key:"nonDPRHeight",get:function(){return this.height/this.dpr}},{key:"clientHeight",get:function(){return this.height/this.dpr}},{key:"dpr",get:function(){return this._dpr}},{key:"canRender",get:function(){return this.width>0&&this.height>0}},{key:"_getDefaultProp",value:function(){return Ao(Ao({},Ho($o(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(Ho($o(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(){Ho($o(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(){Ho($o(i.prototype),"_destroy",this).call(this),this.canvas&&this.canvas.remove()}}])&&Fo(e.prototype,r),n&&Fo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(rt);function Ko(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*Jo(t),o=r.height*n/r.width;o/Jo(t)<e.height&&(o=e.height*Jo(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*=Jo(t),o*=Jo(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*Jo(t),n=e.height*Jo(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*Jo(t),o=r.height*Jo(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*Jo(t),o=r.height*Jo(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*Jo(t),o=r.height*Jo(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*Jo(t),o=r.height*Jo(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 Jo(t){return void 0!==t.scale?t.scale:1}function Go(t){return Go="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},Go(t)}function Zo(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 ti(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Zo(Object(r),!0).forEach((function(e){ei(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Zo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ei(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,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(){return oi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=ii(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 ii(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ui(t)););return t}function si(t,e){return si=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},si(t,e)}function ci(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=ui(t);if(e){var o=ui(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ai(this,r)}}function ai(t,e){if(e&&("object"===Go(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 ui(t){return ui=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ui(t)}var li=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&&si(t,e)}(i,t);var e,r,n,o=ci(i);function i(){return ri(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"_getDefaultProp",value:function(){return ti(ti({},oi(ui(i.prototype),"_getDefaultProp",this).call(this)),{},{media:!1,posRule:"cover"})}},{key:"resize",value:function(){oi(ui(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 qo?(e=t.canvas,r=t.width,n=t.height):e=t;var o=Ko({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)}}}}])&&ni(e.prototype,r),n&&ni(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(qo);function fi(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 pi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var hi=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),pi(this,"_prop",void 0),pi(this,"_outer",void 0),pi(this,"_thumb",void 0),pi(this,"_outerHeight",void 0),pi(this,"_outerWidth",void 0),pi(this,"_thumbHeight",void 0),pi(this,"_thumbWidth",void 0),pi(this,"_scrollVal",void 0),pi(this,"_coordsAtDragStart",void 0),pi(this,"_listeners",void 0),pi(this,"_scrollEvent",void 0),pi(this,"_actionTimeout",void 0),pi(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=w("div",{parent:o,class:c}),this._thumb=w("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 $t?(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(P(this.outer,"mouseenter",this._handleHover.bind(this,!0))),this._listeners.push(P(this.outer,"mouseleave",this._handleHover.bind(this,!1))),this._scrollEvent=qt({container:this.prop.container,callback:function(e){t._handleScroll(e)}}),this.prop.isDraggable&&(this._dragger=new Oo({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 $t?this.prop.draggableScrollBehavior:"auto"})}},{key:"_renderThumb",value:function(){var t=nt(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=nt(this._outerWidth/(this.scrollWidth/(this.scrollWidth-r)),[n,1/0]);e.style.width="".concat(o,"px")}else{var i=nt(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()}}])&&fi(e.prototype,r),n&&fi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function di(t){return di="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},di(t)}function yi(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 vi(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?yi(Object(r),!0).forEach((function(e){Ei(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):yi(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function bi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _i(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 gi(t,e){return gi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},gi(t,e)}function mi(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 wi(this,r)}}function wi(t,e){if(e&&("object"===di(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Oi(t)}function Oi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pi(){return Pi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=ki(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},Pi.apply(this,arguments)}function ki(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ji(t)););return t}function ji(t){return ji=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ji(t)}function Ei(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Si=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&&gi(t,e)}(i,t);var e,r,n,o=mi(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];bi(this,i),Ei(Oi(e=o.call(this,t,!1)),"_container",void 0),Ei(Oi(e),"_scrollWrapper",void 0),Ei(Oi(e),"_xBar",void 0),Ei(Oi(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=_(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=w("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 hi(vi({dir:"x"},d)),e._yBar=new hi(vi({dir:"y"},d)),e.scrollableElement.classList.add("".concat(e.prefix,"-parent")),r&&e.init(),e}return e=i,(r=[{key:"_getDefaultProp",value:function(){return vi(vi({},Pi(ji(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;Pi(ji(i.prototype),"_setEvents",this).call(this);var e=this.container;e instanceof $t?e.addCallback("resize",(function(){t.resize()}),{name:this.name}):this.addViewportCallback("",(function(){t.resize()}),{timeout:this.prop.resizeTimeout}),this.resize()}},{key:"_onPropMutate",value:function(){Pi(ji(i.prototype),"_onPropMutate",this).call(this),this.resize()}},{key:"resize",value:function(){this._xBar.resize(),this._yBar.resize()}},{key:"_destroy",value:function(){if(Pi(ji(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"))}}])&&_i(e.prototype,r),n&&_i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(rt);function Ti(t){return Ti="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},Ti(t)}function xi(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 Ri(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?xi(Object(r),!0).forEach((function(e){Fi(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xi(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ci(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Li(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 Di(t,e){return Di=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Di(t,e)}function Mi(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=zi(t);if(e){var o=zi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Wi(this,r)}}function Wi(t,e){if(e&&("object"===Ti(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 Bi(){return Bi="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}},Bi.apply(this,arguments)}function Ai(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=zi(t)););return t}function zi(t){return zi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},zi(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 Hi=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&&Di(t,e)}(i,t);var e,r,n,o=Mi(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Ci(this,i),Fi(Ii(e=o.call(this,t,!1)),"_scrollContainer",void 0),"string"==typeof e.prop.container?e._scrollContainer=_(e.prop.container):e._scrollContainer=e.prop.container,r&&e.init(),e}return e=i,(r=[{key:"_getDefaultProp",value:function(){return Ri(Ri({},Bi(zi(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window,intersectionRoot:!1})}},{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(){if(!1===this.prop.intersectionRoot){var t=this.scrollContainer;return t instanceof Window?null:t instanceof Element?t:t.outer}return this.prop.intersectionRoot}},{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}}}])&&Li(e.prototype,r),n&&Li(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(rt);function Ni(t){return Ni="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},Ni(t)}function Vi(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?Vi(Object(r),!0).forEach((function(e){rs(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Vi(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Qi(t){return function(t){if(Array.isArray(t))return Ui(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 Ui(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 Ui(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 Ui(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 $i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yi(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 qi(t,e){return qi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},qi(t,e)}function Ki(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=es(t);if(e){var o=es(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ji(this,r)}}function Ji(t,e){if(e&&("object"===Ni(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Gi(t)}function Gi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Zi(){return Zi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=ts(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},Zi.apply(this,arguments)}function ts(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=es(t)););return t}function es(t){return es=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},es(t)}function rs(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ns=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&&qi(t,e)}(i,t);var e,r,n,o=Ki(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return $i(this,i),rs(Gi(e=o.call(this,t,!1)),"_scrollEvent",void 0),rs(Gi(e),"_intersectionObserverIn",void 0),rs(Gi(e),"_intersectionObserverOut",void 0),rs(Gi(e),"_firstStart",void 0),rs(Gi(e),"_elements",void 0),e._scrollEvent=void 0,e._intersectionObserverIn=void 0,e._intersectionObserverOut=void 0,e._firstStart=!0,e._elements=Qi(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({},Zi(es(i.prototype),"_getDefaultProp",this).call(this)),{},{enabled:!0,container:window,elements:[],threshold:.9,states:"in",classToToggle:"viewed",useDelay:!1,useIntersectionObserver:!0,viewportTarget:"",resizeTimeout:0})}},{key:"elements",get:function(){return this._elements}},{key:"init",value:function(){Zi(es(i.prototype),"init",this).call(this)}},{key:"_setEvents",value:function(){var t=this;Zi(es(i.prototype),"_setEvents",this).call(this),this.resize(),this.addViewportCallback(this.prop.viewportTarget,(function(){t.resize()}),{timeout:this.prop.resizeTimeout})}},{key:"_onPropMutate",value:function(){Zi(es(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(Kt()&&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=qt({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(!Kt()||!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=nt("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&&h((function(){t.classList.toggle(r.prop.classToToggle,e)}),n),!e||"in"!==o&&"inout"!==o?e||"inout"!==o||h((function(){r.callbacks.tbt("out",t)}),n):h((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(){Zi(es(i.prototype),"_destroy",this).call(this),this._removeViewEvents()}}],r&&Yi(e.prototype,r),n&&Yi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(Hi);function os(t){return os="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},os(t)}function is(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ss(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 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=ps(t)););return t}function us(t,e){return us=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},us(t,e)}function ls(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=ps(t);if(e){var o=ps(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return fs(this,r)}}function fs(t,e){if(e&&("object"===os(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 ps(t){return ps=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ps(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&&us(t,e)}(i,t);var e,r,n,o=ls(i);function i(){return is(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"_setEvents",value:function(){var t=this;cs(ps(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;h((function(){var e=t._component,r=document.activeElement;if(r instanceof HTMLElement&&d(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)}}])&&ss(e.prototype,r),n&&ss(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(Yr);function ds(t){return ds="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},ds(t)}function ys(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 vs(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ys(Object(r),!0).forEach((function(e){js(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ys(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}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"===ds(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="is-dragging",Ss=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;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),js(ws(e=o.call(this,t)),"_dragger",void 0),js(ws(e),"_componentEvents",void 0),js(ws(e),"_currentLerp",void 0),e._dragger=void 0,e._componentEvents=[],e._currentLerp=!1,e}return e=i,r=[{key:"_getDefaultProp",value:function(){return vs(vs({},Os(ks(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(){Os(ks(i.prototype),"_constructor",this).call(this),this._toggleDragger()}},{key:"_onPropMutate",value:function(){Os(ks(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 Oo({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(Es),e.container.classList.add(Es),this._callbacks.tbt("move",!1)}}},{key:"_handleDragEnd",value:function(){var t=this.component;t.outer.classList.remove(Es),t.container.classList.remove(Es),"boolean"!=typeof this._currentLerp&&(t.changeProp({render:{lerp:this._currentLerp}}),this._currentLerp=!1),this._callbacks.tbt("end",!1)}},{key:"_destroy",value:function(){Os(ks(i.prototype),"_destroy",this).call(this),this._removeDragger()}}],r&&bs(e.prototype,r),n&&bs(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(Yr);function Ts(t){return Ts="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},Ts(t)}function xs(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 Rs(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?xs(Object(r),!0).forEach((function(e){Fs(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xs(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Cs(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 Ms(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=zs(t);if(e){var o=zs(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ws(this,r)}}function Ws(t,e){if(e&&("object"===Ts(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Is(t)}function Is(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=As(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 As(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=zs(t)););return t}function zs(t){return zs=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},zs(t)}function Fs(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=Ms(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Cs(this,i),Fs(Is(e=o.call(this,t,!1)),"_scrollContainer",void 0),Fs(Is(e),"_section",void 0),Fs(Is(e),"_scrollEvent",void 0),Fs(Is(e),"_loadedEvent",void 0),Fs(Is(e),"_scopeScroll",void 0),Fs(Is(e),"_scopeIn",void 0),Fs(Is(e),"_scopeMove",void 0),Fs(Is(e),"_scopeOut",void 0),Fs(Is(e),"_progress",void 0),"string"==typeof e.prop.container?e._scrollContainer=_(e.prop.container):e._scrollContainer=e.prop.container,"string"==typeof e.prop.section?e._section=_(e.prop.section):e._section=e.prop.section,e._progress=-.001,e._scopeScroll=[0,0],e._scopeIn=[0,0],e._scopeMove=[0,0],e._scopeOut=[0,0],r&&e.init(),e}return e=i,r=[{key:"_getDefaultProp",value:function(){return Rs(Rs({},Bs(zs(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window,viewportTarget:"",resizeTimeout:0})}},{key:"scrollContainer",get:function(){return this._scrollContainer}},{key:"section",get:function(){return this._section}},{key:"scopeScroll",get:function(){return this._scopeScroll}},{key:"scopeIn",get:function(){return this._scopeIn}},{key:"scopeMove",get:function(){return this._scopeMove}},{key:"scopeOut",get:function(){return this._scopeOut}},{key:"progress",get:function(){return this._progress},set:function(t){this._progress=t}},{key:"init",value:function(){Bs(zs(i.prototype),"init",this).call(this)}},{key:"_setEvents",value:function(){var t=this;Bs(zs(i.prototype),"_setEvents",this).call(this),this.addViewportCallback(this.prop.viewportTarget,(function(){t.resize()}),{timeout:this.prop.resizeTimeout}),this._loadedEvent=this._app.onPageLoaded(),this._loadedEvent.then((function(){t.resize()})).catch((function(){})),this._scrollEvent=qt({container:this.prop.container,callback:this._handleScroll.bind(this)})}},{key:"_onPropMutate",value:function(){Bs(zs(i.prototype),"_onPropMutate",this).call(this),this.resize()}},{key:"progressIn",get:function(){return at(this.progress,this.scopeIn)||0}},{key:"progressOut",get:function(){return at(this.progress,this.scopeOut)||0}},{key:"progressMove",get:function(){return at(this.progress,this.scopeMove)||0}},{key:"_handleScroll",value:function(){var t=Jt(this.scrollContainer);t&&this._render(t)}},{key:"resize",value:function(){var t=Jt(this.scrollContainer);if(t){var e=this.section.getBoundingClientRect(),r=this._app.viewport.height,n=t.scrollTop+e.top-r,o=t.scrollTop+e.top+e.height,i=o-n;this._scopeScroll=[n,o],this._scopeIn=[0,r/i],this._scopeOut=[1-r/i,1],this._scopeMove=[this._scopeIn[1],this._scopeOut[0]],this.callbacks.tbt("resize",!1),this._render(t,!0)}}},{key:"_render",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this._canRender(t,e);r&&this.callbacks.tbt("render",!1)}},{key:"_canRender",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return!1;var r=t.scrollTop,n=this.progress,o=at(r,[this._scopeScroll[0],this._scopeScroll[1]])||0;return this.progress=o,e||o!==n}},{key:"_destroy",value:function(){var t,e;Bs(zs(i.prototype),"_destroy",this).call(this),null===(t=this._scrollEvent)||void 0===t||t.remove(),null===(e=this._loadedEvent)||void 0===e||e.cancel()}}],r&&Ls(e.prototype,r),n&&Ls(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(rt);function Ns(t){return Ns="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},Ns(t)}function Vs(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?Vs(Object(r),!0).forEach((function(e){tc(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Vs(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Qs(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Us(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 Ys(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=Zs(t);if(e){var o=Zs(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return qs(this,r)}}function qs(t,e){if(e&&("object"===Ns(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ks(t)}function Ks(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Js(){return Js="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=Gs(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},Js.apply(this,arguments)}function Gs(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Zs(t)););return t}function Zs(t){return Zs=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Zs(t)}function tc(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ec=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=Ys(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Qs(this,i),tc(Ks(e=o.call(this,t,!1)),"_initText",void 0),tc(Ks(e),"_initHTML",void 0),tc(Ks(e),"_isPrimarySplit",void 0),tc(Ks(e),"_container",void 0),tc(Ks(e),"_letters",void 0),tc(Ks(e),"_words",void 0),tc(Ks(e),"_lines",void 0),e.prop.container){var n=_(e.prop.container);n instanceof HTMLElement&&(e._container=n)}e._container.translate=!1,e._container&&e._container.classList.add(e.prefix),e._initHTML=e._container.innerHTML;var s=e._container[e.prop.textSource].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._container.ariaLabel=e._initText,e._isPrimarySplit=!1,e._letters=[],e._words=[],e._lines=[],r&&e.init(),e}return e=i,r=[{key:"_getDefaultProp",value:function(){return Xs(Xs({},Js(Zs(i.prototype),"_getDefaultProp",this).call(this)),{},{container:"#".concat(this.prefix),textSource:"innerText",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;Js(Zs(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,e=this,r=this._initText.split(""),n=0;r.forEach((function(t){var r=e._words[n]||{content:"",hasNewLine:!1,el:w("span",{class:"".concat(e.prefix,"__word"),attr:[["aria-hidden","true"]]}),letters:[]};r.el.style.display="inline-block",e._words[n]=r;var o=t.charCodeAt(0),i=32===o||160===o,s=[45,8208,8211,8212,8722].includes(o),c=10===o;i&&(r.whitespace=document.createTextNode(" ")),c&&(r.br=w("br")),r.hasNewLine=c,i||c?n+=1:(r.content+=t,e.prop.appendLetters||(r.el.innerHTML=r.content),s&&(n+=1))})),this._words=this._words.filter((function(t,r){return 0!==t.content.length||(r>0&&(e._words[r-1].whitespace=t.whitespace,e._words[r-1].br=t.br),!1)})),this._words.forEach((function(e){t&&t.whitespace&&e.el.classList.add("pre-whitespace"),e.whitespace&&e.el.classList.add("has-whitespace"),t=e}))}},{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:w("span",{class:"".concat(t.prefix,"__letter"),html:r,attr:[["aria-hidden","true"]]}),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:w("span",{class:"".concat(t.prefix,"__line"),attr:[["aria-hidden","true"]]}),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(){Js(Zs(i.prototype),"_destroy",this).call(this),this._lines=[],this._words=[],this._letters=[],this._container.innerHTML=this._initHTML}}],r&&Us(e.prototype,r),n&&Us(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(rt);function rc(t){return rc="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},rc(t)}function nc(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 oc(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?nc(Object(r),!0).forEach((function(e){dc(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nc(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ic(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sc(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 cc(t,e){return cc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},cc(t,e)}function ac(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=hc(t);if(e){var o=hc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return uc(this,r)}}function uc(t,e){if(e&&("object"===rc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return lc(t)}function lc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function fc(){return fc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=pc(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},fc.apply(this,arguments)}function pc(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=hc(t)););return t}function hc(t){return hc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},hc(t)}function dc(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var yc=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&&cc(t,e)}(i,t);var e,r,n,o=ac(i);function i(t){var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];ic(this,i),dc(lc(e=o.call(this,t,!1)),"_container",void 0),dc(lc(e),"_containerIsWindow",void 0),dc(lc(e),"_outerCursor",void 0),dc(lc(e),"_innerCursor",void 0),dc(lc(e),"_hoveredEl",void 0),dc(lc(e),"_animationFrame",void 0),dc(lc(e),"_currentFPS",void 0),dc(lc(e),"_canPlay",void 0),dc(lc(e),"_coords",void 0),dc(lc(e),"_targetCoords",void 0);var n=_(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._coords={x:0,y:0,w:0,h:0},e._targetCoords={x:0,y:0,w:0,h:0},e._currentFPS=60,e._canPlay=e.prop.run,r&&e.init(),e}return e=i,r=[{key:"_getDefaultProp",value:function(){return oc(oc({},fc(hc(i.prototype),"_getDefaultProp",this).call(this)),{},{container:window,run:!0,hideNativeCursor:!1,size:{width:50,height:50},render:{lerp:.2,lerpToFixed:2,normalizeLerp:!1},hover:{sticky:!1,autoSize:!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:"hoveredEl",get:function(){return this._hoveredEl},set:function(t){this._hoveredEl=t}},{key:"coords",get:function(){return this._coords}},{key:"targetCoords",get:function(){var t=this.hoveredEl,e=this.prop,r=e.size,n=this._targetCoords.x,o=this._targetCoords.y,i=r.width,s=r.height,c=0;if(t){var a,u,l,f=t.el.getBoundingClientRect();e.hover.sticky&&(n=f.left+f.width/2,o=f.top+f.height/2),e.hover.autoSize&&(i=(null===(a=this.hoveredEl)||void 0===a?void 0:a.width)||f.width,s=(null===(u=this.hoveredEl)||void 0===u?void 0:u.height)||f.height,c=(null===(l=this.hoveredEl)||void 0===l?void 0:l.padding)||0)}return{x:n,y:o,w:i+=2*c,h:s+=2*c}}},{key:"_constructor",value:function(){fc(hc(i.prototype),"_constructor",this).call(this),this._createCursor()}},{key:"_setEvents",value:function(){var t=this;fc(hc(i.prototype),"_setEvents",this).call(this);var e=this.domContainer;this._animationFrame=new Dt,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:"addHoverEl",value:function(t){var e,r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,o=t.el,i=P(o,"mouseenter",(function(){e=h((function(){r.hoveredEl=oc({},t)}),n)})),s=P(o,"mouseleave",(function(){r.hoveredEl=void 0,e&&e.clear()}));return{remove:function(){var t,n;(null===(t=r.hoveredEl)||void 0===t?void 0:t.el)===o&&(r.hoveredEl=void 0),i.remove(),s.remove(),null===(n=e)||void 0===n||n.clear()}}}},{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=w("div",{class:"".concat(t," ").concat(e instanceof Window?"in-window":"in-element"," disabled"),parent:r}),this._innerCursor=w("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._coords.x=t.clientX,this._coords.y=t.clientY,this._targetCoords.x=t.clientX,this._targetCoords.y=t.clientY,this.outerCursor.classList.add("in-action")}},{key:"_handleMouseLeave",value:function(){this.outerCursor.classList.remove("in-action")}},{key:"_handleMouseMove",value:function(t){this._targetCoords.x=t.clientX,this._targetCoords.y=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.targetCoords;this._calcCoords();var r=this._renderElements();t.autoStop&&this.coords.x===e.x&&this.coords.y===e.y&&this.coords.w===e.w&&this.coords.h===e.h&&this._animationFrame.pause(),this._callbacks.tbt("render",r)}},{key:"_calcCoords",value:function(){this._coords.x=this._lerp(this._coords.x,this.targetCoords.x),this._coords.y=this._lerp(this._coords.y,this.targetCoords.y),this._coords.w=this._lerp(this._coords.w,this.targetCoords.w),this._coords.h=this._lerp(this._coords.h,this.targetCoords.h)}},{key:"_lerp",value:function(t,e){var r=this.prop.render,n=r.normalizeLerp,o=r.lerp,i=r.lerpToFixed,s=ot(t,e,o*(n?60/this._currentFPS:1),.02);if("number"==typeof i){var c=Math.round(Math.abs(i));s=parseFloat(s.toFixed(c))}return s}},{key:"_renderElements",value:function(){var t=this.domContainer,e=this.outerCursor,r=this.coords,n=r.x,o=r.y,i=this.coords,s=i.w,c=i.h;if(!this._containerIsWindow){var a=t.getBoundingClientRect();n-=a.left,o-=a.top}return e.style.transform="translate(".concat(n,"px, ").concat(o,"px)"),e.style.setProperty("--cursor-w","".concat(s,"px")),e.style.setProperty("--cursor-h","".concat(c,"px")),{x:n,y:o,w:s,h:c}}},{key:"enable",value:function(){this._canPlay=!0,this.outerCursor.classList.remove("disabled"),this.innerCursor.classList.remove("disabled"),this._animationFrame.play()}},{key:"disable",value:function(){this._canPlay=!1,this.outerCursor.classList.add("disabled"),this.innerCursor.classList.add("disabled"),this._animationFrame.pause()}},{key:"_destroy",value:function(){fc(hc(i.prototype),"_destroy",this).call(this),this._destroyCursor(),this._animationFrame.destroy()}}],r&&sc(e.prototype,r),n&&sc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(rt),vc={common:t,listeners:n,math:e,scroll:o,image:i};window.Vevet=c})()})();
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var easing_progress_1 = __importDefault(require("easing-progress"));
7
+ /**
8
+ * Easing progress
9
+ */
10
+ var easing = easing_progress_1.default;
11
+ exports.default = easing;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.wrap = exports.clampScope = exports.inScope = exports.spreadScope = exports.scoped = exports.lerp = exports.clamp = void 0;
6
+ exports.easing = exports.wrap = exports.clampScope = exports.inScope = exports.spreadScope = exports.scoped = exports.lerp = exports.clamp = void 0;
7
7
  var clamp_1 = __importDefault(require("./clamp"));
8
8
  exports.clamp = clamp_1.default;
9
9
  var lerp_1 = __importDefault(require("./lerp"));
@@ -18,3 +18,5 @@ var clampScope_1 = __importDefault(require("./clampScope"));
18
18
  exports.clampScope = clampScope_1.default;
19
19
  var wrap_1 = __importDefault(require("./wrap"));
20
20
  exports.wrap = wrap_1.default;
21
+ var easing_1 = __importDefault(require("./easing"));
22
+ exports.easing = easing_1.default;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var version = '2.16.1';
3
+ var version = '2.17.0';
4
4
  exports.default = version;
@@ -0,0 +1,6 @@
1
+ import easingProgress from 'easing-progress';
2
+ /**
3
+ * Easing progress
4
+ */
5
+ const easing = easingProgress;
6
+ export default easing;
@@ -5,4 +5,5 @@ import spreadScope from './spreadScope';
5
5
  import inScope from './inScope';
6
6
  import clampScope from './clampScope';
7
7
  import wrap from './wrap';
8
- export { clamp, lerp, scoped, spreadScope, inScope, clampScope, wrap, };
8
+ import easing from './easing';
9
+ export { clamp, lerp, scoped, spreadScope, inScope, clampScope, wrap, easing, };
@@ -1,2 +1,2 @@
1
- const version = '2.16.1';
1
+ const version = '2.17.0';
2
2
  export default version;
@@ -0,0 +1,7 @@
1
+ import easingProgress from 'easing-progress';
2
+ /**
3
+ * Easing progress
4
+ */
5
+ declare const easing: typeof easingProgress;
6
+ export default easing;
7
+ //# sourceMappingURL=easing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"easing.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/math/easing.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,iBAAiB,CAAC;AAE7C;;GAEG;AACH,QAAA,MAAM,MAAM,uBAAiB,CAAC;AAE9B,eAAe,MAAM,CAAC"}
@@ -5,5 +5,6 @@ import spreadScope from './spreadScope';
5
5
  import inScope from './inScope';
6
6
  import clampScope from './clampScope';
7
7
  import wrap from './wrap';
8
- export { clamp, lerp, scoped, spreadScope, inScope, clampScope, wrap, };
8
+ import easing from './easing';
9
+ export { clamp, lerp, scoped, spreadScope, inScope, clampScope, wrap, easing, };
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/math/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,OAAO,EACH,KAAK,EACL,IAAI,EACJ,MAAM,EACN,WAAW,EACX,OAAO,EACP,UAAU,EACV,IAAI,GACP,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/math/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,OAAO,EACH,KAAK,EACL,IAAI,EACJ,MAAM,EACN,WAAW,EACX,OAAO,EACP,UAAU,EACV,IAAI,EACJ,MAAM,GACT,CAAC"}
@@ -1,3 +1,3 @@
1
- declare const version = "2.16.1";
1
+ declare const version = "2.17.0";
2
2
  export default version;
3
3
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vevet",
3
- "version": "2.16.1",
3
+ "version": "2.17.0",
4
4
  "description": "VEVET - A JavaScript library",
5
5
  "browserslist": [
6
6
  "since 2015"
@@ -0,0 +1,8 @@
1
+ import easingProgress from 'easing-progress';
2
+
3
+ /**
4
+ * Easing progress
5
+ */
6
+ const easing = easingProgress;
7
+
8
+ export default easing;
@@ -5,6 +5,7 @@ import spreadScope from './spreadScope';
5
5
  import inScope from './inScope';
6
6
  import clampScope from './clampScope';
7
7
  import wrap from './wrap';
8
+ import easing from './easing';
8
9
 
9
10
  export {
10
11
  clamp,
@@ -14,4 +15,5 @@ export {
14
15
  inScope,
15
16
  clampScope,
16
17
  wrap,
18
+ easing,
17
19
  };
package/src/ts/version.ts CHANGED
@@ -1,2 +1,2 @@
1
- const version = '2.16.1';
1
+ const version = '2.17.0';
2
2
  export default version;