@namiml/web-sdk 3.3.9-dev.202603120740 → 3.3.9-dev.202603130039
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/nami-web.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{css as e,html as t,LitElement as n,unsafeCSS as i,svg as a}from"lit";import{repeat as r}from"lit/directives/repeat.js";function o(e,t){this.v=e,this.k=t}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e){return new o(e,0)}function d(e,t,n){return t=w(t),M(e,S()?Reflect.construct(t,n||[],w(e).constructor):t.apply(e,n))}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!{}.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}(()=>{if("undefined"==typeof globalThis){var e="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:Function("return this")();Object.defineProperty(e,"globalThis",{value:e,writable:!0,enumerable:!1,configurable:!0})}})(),"undefined"!=typeof Element&&"function"!=typeof Element.prototype.getAttributeNames&&(Element.prototype.getAttributeNames=function(){for(var e=this.attributes,t=new Array(e.length),n=0;n<e.length;n+=1)t[n]=e[n].name;return t});var m=0;function f(e){return"__private_"+m+++"_"+e}function v(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,C(i.key),i)}}function p(e,t,n){return t&&v(e.prototype,t),n&&v(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function g(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e))||t){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},y.apply(null,arguments)}function b(){return b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=w(e)););return e}(e,t);if(i){var a=Object.getOwnPropertyDescriptor(i,t);return a.get?a.get.call(arguments.length<3?e:n):a.value}},b.apply(null,arguments)}function w(e){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},w(e)}function k(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&A(e,t)}function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(S=function(){return!!e})()}function E(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}function M(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return u(e)}function P(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function r(n,i,a,r){var u=i&&i.prototype instanceof s?i:s,l=Object.create(u.prototype);return D(l,"_invoke",function(n,i,a){var r,s,u,l=0,d=a||[],h=!1,c={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return r=t,s=0,u=e,c.n=n,o}};function m(n,i){for(s=n,u=i,t=0;!h&&l&&!a&&t<d.length;t++){var a,r=d[t],m=c.p,f=r[2];n>3?(a=f===i)&&(u=r[(s=r[4])?5:(s=3,3)],r[4]=r[5]=e):r[0]<=m&&((a=n<2&&m<r[1])?(s=0,c.v=i,c.n=r[1]):m<f&&(a=n<3||r[0]>i||i>f)&&(r[4]=n,r[5]=i,c.n=f,s=0))}if(a||n>1)return o;throw h=!0,i}return function(a,d,f){if(l>1)throw TypeError("Generator is already running");for(h&&1===d&&m(d,f),s=d,u=f;(t=s<2?e:u)||!h;){r||(s?s<3?(s>1&&(c.n=-1),m(s,u)):c.n=u:c.v=u);try{if(l=2,r){if(s||(a="next"),t=r[a]){if(!(t=t.call(r,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=r.return)&&t.call(r),s<2&&(u=TypeError("The iterator does not provide a '"+a+"' method"),s=1);r=e}else if((t=(h=c.n<0)?u:n.call(i,c))!==o)break}catch(t){r=e,s=1,u=t}finally{l=1}}return{value:t,done:h}}}(n,a,r),!0),l}var o={};function s(){}function u(){}function l(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(D(t={},i,(function(){return this})),t),h=l.prototype=s.prototype=Object.create(d);function c(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,D(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=l,D(h,"constructor",l),D(l,"constructor",u),u.displayName="GeneratorFunction",D(l,a,"GeneratorFunction"),D(h),D(h,a,"Generator"),D(h,i,(function(){return this})),D(h,"toString",(function(){return"[object Generator]"})),(P=function(){return{w:r,m:c}})()}function T(e,t,n,i,a){var r=function(e,t,n,i,a){return new _(P().w(e,t,n,i),a||Promise)}(e,t,n,i,a);return r.next().then((function(e){return e.done?e.value:r.next()}))}function _(e,t){function n(i,a,r,s){try{var u=e[i](a),l=u.value;return l instanceof o?t.resolve(l.v).then((function(e){n("next",e,r,s)}),(function(e){n("throw",e,r,s)})):t.resolve(l).then((function(e){u.value=e,r(u)}),(function(e){return n("throw",e,r,s)}))}catch(e){s(e)}}var i;this.next||(D(_.prototype),D(_.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),D(this,"_invoke",(function(e,a,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}),!0)}function D(e,t,n,i){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}D=function(e,t,n,i){function r(t,n){D(e,t,(function(e){return this._invoke(t,n,e)}))}t?a?a(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(r("next",0),r("throw",1),r("return",2))},D(e,t,n,i)}function A(e,t){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},A(e,t)}function x(e,t,n,i){var a=b(w(e.prototype),t,n);return"function"==typeof a?function(e){return a.apply(n,e)}:a}function C(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function I(e){var t="function"==typeof Map?new Map:void 0;return I=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(S())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,t);var a=new(e.bind.apply(e,i));return n&&A(a,n.prototype),a}(e,arguments,w(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),A(n,e)},I(e)}var L,F,R,W,O,N,j,$,z,B,H,U,G=function(){return p((function e(t){h(this,e),this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=t}),[{key:"shadowRoot",get:function(){return this.__host.__shadowRoot}},{key:"checkValidity",value:function(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}},{key:"reportValidity",value:function(){return!0}},{key:"setFormValue",value:function(){}},{key:"setValidity",value:function(){}}])}(),V=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},X=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},K=e=>{var t;return"boolean"==typeof e?e:null!==(t=null==e?void 0:e.capture)&&void 0!==t&&t},Y=function(){return p((function e(){h(this,e),this.__eventListeners=new Map,this.__captureEventListeners=new Map}),[{key:"addEventListener",value:function(e,t,n){var i;if(null!=t){var a=K(n)?this.__captureEventListeners:this.__eventListeners,r=a.get(e);if(void 0===r)r=new Map,a.set(e,r);else if(r.has(t))return;var o="object"==typeof n&&n?n:{};null===(i=o.signal)||void 0===i||i.addEventListener("abort",(()=>this.removeEventListener(e,t,n))),r.set(t,null!=o?o:{})}}},{key:"removeEventListener",value:function(e,t,n){if(null!=t){var i=K(n)?this.__captureEventListeners:this.__eventListeners,a=i.get(e);void 0!==a&&(a.delete(t),a.size||i.delete(e))}}},{key:"dispatchEvent",value:function(e){var t=[this],n=this.__eventTargetParent;if(e.composed)for(;n;)t.push(n),n=n.__eventTargetParent;else for(;n&&n!==this.__host;)t.push(n),n=n.__eventTargetParent;var i=!1,a=!1,r=0,o=null,s=null,u=null,l=e.stopPropagation,d=e.stopImmediatePropagation;Object.defineProperties(e,{target:y({get:()=>null!=o?o:s},J),srcElement:y({get:()=>e.target},J),currentTarget:y({get:()=>u},J),eventPhase:y({get:()=>r},J),composedPath:y({value:()=>t},J),stopPropagation:y({value:()=>{i=!0,l.call(e)}},J),stopImmediatePropagation:y({value:()=>{a=!0,d.call(e)}},J)});var h=(t,n,i)=>{"function"==typeof t?t(e):"function"==typeof(null==t?void 0:t.handleEvent)&&t.handleEvent(e),n.once&&i.delete(t)},c=()=>(u=null,r=0,!e.defaultPrevented),m=t.slice().reverse();o=this.__host&&e.composed?null:this;for(var f,v=e=>{for(s=this;s.__host&&e.includes(s.__host);)s=s.__host},p=g(m);!(f=p()).done;){var b=f.value;o||s&&s!==b.__host||v(m.slice(m.indexOf(b))),u=b,r=b===e.target?2:1;var w=b.__captureEventListeners.get(e.type);if(w)for(var k,S=g(w);!(k=S()).done;){var E=k.value;if(h(E[0],E[1],w),a)return c()}if(i)return c()}var M=e.bubbles?t:[this];s=null;for(var P,T=g(M);!(P=T()).done;){var _=P.value;o||s&&_!==s.__host||v(M.slice(0,M.indexOf(_)+1)),u=_,r=_===e.target?2:3;var D=_.__eventListeners.get(e.type);if(D)for(var A,x=g(D);!(A=x()).done;){var C=A.value;if(h(C[0],C[1],D),a)return c()}if(i)return c()}return c()}}])}(),q=Y,J={__proto__:null,enumerable:!0};Object.freeze(J);var Q=(B=function(){return p((function e(t,n={}){if(h(this,e),L.set(this,!1),F.set(this,!1),R.set(this,!1),W.set(this,!1),O.set(this,Date.now()),N.set(this,!1),j.set(this,void 0),$.set(this,void 0),z.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,0===arguments.length)throw new Error("The type argument must be specified");if("object"!=typeof n||!n)throw new Error('The "options" argument must be an object');var i=n.bubbles,a=n.cancelable,r=n.composed;V(this,L,!!a,"f"),V(this,F,!!i,"f"),V(this,R,!!r,"f"),V(this,j,`${t}`,"f"),V(this,$,null,"f"),V(this,z,!1,"f")}),[{key:"initEvent",value:function(e,t,n){throw new Error("Method not implemented.")}},{key:"stopImmediatePropagation",value:function(){this.stopPropagation()}},{key:"preventDefault",value:function(){V(this,W,!0,"f")}},{key:"target",get:function(){return X(this,$,"f")}},{key:"currentTarget",get:function(){return X(this,$,"f")}},{key:"srcElement",get:function(){return X(this,$,"f")}},{key:"type",get:function(){return X(this,j,"f")}},{key:"cancelable",get:function(){return X(this,L,"f")}},{key:"defaultPrevented",get:function(){return X(this,L,"f")&&X(this,W,"f")}},{key:"timeStamp",get:function(){return X(this,O,"f")}},{key:"composedPath",value:function(){return X(this,z,"f")?[X(this,$,"f")]:[]}},{key:"returnValue",get:function(){return!X(this,L,"f")||!X(this,W,"f")}},{key:"bubbles",get:function(){return X(this,F,"f")}},{key:"composed",get:function(){return X(this,R,"f")}},{key:"eventPhase",get:function(){return X(this,z,"f")?B.AT_TARGET:B.NONE}},{key:"cancelBubble",get:function(){return X(this,N,"f")},set:function(e){e&&V(this,N,!0,"f")}},{key:"stopPropagation",value:function(){V(this,N,!0,"f")}},{key:"isTrusted",get:function(){return!1}}])}(),L=new WeakMap,F=new WeakMap,R=new WeakMap,W=new WeakMap,O=new WeakMap,N=new WeakMap,j=new WeakMap,$=new WeakMap,z=new WeakMap,B.NONE=0,B.CAPTURING_PHASE=1,B.AT_TARGET=2,B.BUBBLING_PHASE=3,B);Object.defineProperties(Q.prototype,{initEvent:J,stopImmediatePropagation:J,preventDefault:J,target:J,currentTarget:J,srcElement:J,type:J,cancelable:J,defaultPrevented:J,timeStamp:J,composedPath:J,returnValue:J,bubbles:J,composed:J,eventPhase:J,cancelBubble:J,stopPropagation:J,isTrusted:J});var Z=(U=function(){function e(t,n={}){var i,a;return h(this,e),a=d(this,e,[t,n]),H.set(a,void 0),V(a,H,null!==(i=null==n?void 0:n.detail)&&void 0!==i?i:null,"f"),a}return k(e,Q),p(e,[{key:"initCustomEvent",value:function(e,t,n,i){throw new Error("Method not implemented.")}},{key:"detail",get:function(){return X(this,H,"f")}}])}(),H=new WeakMap,U);Object.defineProperties(Z.prototype,{detail:J});var ee,te,ne,ie=Q,ae=Z;null!==(ee=globalThis.Event)&&void 0!==ee||(globalThis.Event=ie),null!==(te=globalThis.CustomEvent)&&void 0!==te||(globalThis.CustomEvent=ae);var re=new WeakMap,oe=e=>{var t=re.get(e);return void 0===t&&re.set(e,t=new Map),t},se=function(){function e(){var t;return h(this,e),(t=d(this,e,arguments)).__shadowRootMode=null,t.__shadowRoot=null,t.__internals=null,t}return k(e,q),p(e,[{key:"attributes",get:function(){return Array.from(oe(this)).map((([e,t])=>({name:e,value:t})))}},{key:"shadowRoot",get:function(){return"closed"===this.__shadowRootMode?null:this.__shadowRoot}},{key:"localName",get:function(){return this.constructor.__localName}},{key:"tagName",get:function(){var e;return null===(e=this.localName)||void 0===e?void 0:e.toUpperCase()}},{key:"setAttribute",value:function(e,t){oe(this).set(e,String(t))}},{key:"removeAttribute",value:function(e){oe(this).delete(e)}},{key:"toggleAttribute",value:function(e,t){return this.hasAttribute(e)?!(void 0===t||!t)||(this.removeAttribute(e),!1):!(void 0!==t&&!t)&&(this.setAttribute(e,""),!0)}},{key:"hasAttribute",value:function(e){return oe(this).has(e)}},{key:"attachShadow",value:function(e){var t={host:this};return this.__shadowRootMode=e.mode,e&&"open"===e.mode&&(this.__shadowRoot=t),t}},{key:"attachInternals",value:function(){if(null!==this.__internals)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");var e=new G(this);return this.__internals=e,e}},{key:"getAttribute",value:function(e){var t=oe(this).get(e);return null!=t?t:null}}])}(),ue=function(){function e(){return h(this,e),d(this,e,arguments)}return k(e,se),p(e)}();function le(){var e,t;return{promise:new Promise(((n,i)=>{e=n,t=i})),resolve:e,reject:t}}function de(e,t,n,i){var a,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(r<3?a(o):r>3?a(t,n,o):a(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o}function he(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)}function ce(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n}null!==(ne=globalThis.litServerRoot)&&void 0!==ne||(globalThis.litServerRoot=Object.defineProperty(new ue,"localName",{get:()=>"lit-server-root"})),new(function(){return p((function e(){h(this,e),this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}),[{key:"define",value:function(e,t){var n,i;if(this.__definitions.has(e)){if("development"!==process.env.NODE_ENV)throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${e}" has already been used with this registry`);console.warn(`'CustomElementRegistry' already has "${e}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.\nMake sure to test your application with a production build as repeat registrations will throw in production.`)}if(this.__reverseDefinitions.has(t))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ${this.__reverseDefinitions.get(t)}`);t.__localName=e,this.__definitions.set(e,{ctor:t,observedAttributes:null!==(n=t.observedAttributes)&&void 0!==n?n:[]}),this.__reverseDefinitions.set(t,e),null===(i=this.__pendingWhenDefineds.get(e))||void 0===i||i.resolve(t),this.__pendingWhenDefineds.delete(e)}},{key:"get",value:function(e){var t=this.__definitions.get(e);return null==t?void 0:t.ctor}},{key:"getName",value:function(e){var t;return null!==(t=this.__reverseDefinitions.get(e))&&void 0!==t?t:null}},{key:"upgrade",value:function(e){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}},{key:"whenDefined",value:function(e){var t,n;return T((function(i){for(;;)switch(i.n){case 0:if(!(t=this.__definitions.get(e))){i.n=1;break}return i.a(2,t.ctor);case 1:return(n=this.__pendingWhenDefineds.get(e))||(n=le(),this.__pendingWhenDefineds.set(e,n)),i.a(2,n.promise)}}),null,this,null,Promise)}}])}()),"undefined"==typeof HTMLElement&&(globalThis.HTMLElement=ue),"function"==typeof SuppressedError&&SuppressedError;var me;!function(e){e.SDK="sdk",e.ML="ml",e.THIRD_PARTY_ANALYTICS="third_party_analytics",e.THIRD_PARTY_TRANSACTIONS="third_party_transactions",e.PAYWALL_PERSONALIZATION="paywall_personalization",e.ANONYMOUS_MODE_CAPABILITY="anonymous_allowed",e.LANGUAGE_MANAGEMENT="language_management",e.ENTITLEMENT_MANAGEMENT="entitlement_management"}(me||(me={}));var fe,ve={},pe=ve.NAMI_SDK_VERSION,ge=void 0===pe?"3.3.9":pe,ye=ve.PLATFORM_ID_REQUIRED,be=void 0===ye?"Platform ID is required":ye,we=ve.DEVICE_ID_REQUIRED,ke=void 0===we?"Device ID is required":we,Se=ve.EXTERNAL_ID_REQUIRED,Ee=void 0===Se?"External ID is required":Se,Me=ve.SDK_NOT_INITIALIZED,Pe=void 0===Me?"SDK has not been initialized. Make sure to call Nami.configure() first!":Me,Te=ve.CAMPAIGN_NOT_AVAILABLE,_e=void 0===Te?"Campaign is not available":Te,De=ve.FLOW_SCREENS_NOT_AVAILABLE,Ae=void 0===De?"Flow screens not available":De,xe=ve.UNABLE_TO_UPDATE_CDP_ID,Ce=void 0===xe?"Unable to update CDP id in anonymous mode":xe,Ie=ve.ANONYMOUS_MODE_ALREADY_ON,Le=void 0===Ie?"Anonymous mode is already turned on.":Ie,Fe=ve.ANONYMOUS_MODE_ALREADY_OFF,Re=void 0===Fe?"Anonymous mode is already turned off.":Fe,We=ve.DEVICE_ID_NOT_SET,Oe=void 0===We?"Nami Device ID is not set":We,Ne=ve.AUTH_DEVICE,je=void 0===Ne?"nami_auth_device":Ne,$e=ve.NAMI_CONFIGURATION,ze=void 0===$e?"nami_configuration":$e,Be=ve.NAMI_PROFILE,He=void 0===Be?"nami_profile":Be,Ue=ve.API_CONFIG,Ge=void 0===Ue?"api_config":Ue,Ve=ve.API_CAMPAIGN_RULES,Xe=void 0===Ve?"api_campaign_rules":Ve,Ke=ve.API_PAYWALLS,Ye=void 0===Ke?"api_paywalls":Ke,qe=ve.API_PRODUCTS,Je=void 0===qe?"api_products":qe,Qe=ve.API_ACTIVE_ENTITLEMENTS,Ze=void 0===Qe?"api_active_entitlements":Qe,et=ve.SERVER_NAMI_ENTITLEMENTS,tt=void 0===et?"server_active_entitlements":et,nt=ve.INITIAL_APP_CONFIG,it=void 0===nt?"initial_app_config":nt,at=ve.INITIAL_CAMPAIGN_RULES,rt=void 0===at?"initial_campaign_rules":at,ot=ve.INITIAL_PAYWALLS,st=void 0===ot?"initial_paywalls":ot,ut=ve.INITIAL_PRODUCTS,lt=void 0===ut?"initial_products":ut,dt=ve.LOCAL_NAMI_ENTITLEMENTS,ht=void 0===dt?"local_active_entitlements":dt,ct=ve.CUSTOMER_ATTRIBUTES_KEY_PREFIX,mt=void 0===ct?"nami_cmr_attributes_":ct,ft=ve.NAMI_CUSTOMER_JOURNEY_STATE,vt=void 0===ft?"nami_customer_journey_state":ft,pt=ve.ANONYMOUS_MODE,gt=void 0===pt?"nami_anonymous_mode_v2":pt,yt=ve.ANONYMOUS_UUID,bt=void 0===yt?"nami_anonymous_uuid":yt,wt=ve.KEY_SESSION_COUNTER,kt=void 0===wt?"nami_session_counter":wt,St=ve.INITIAL_SESSION_COUNTER_VALUE,Et=void 0===St?1:St,Mt=ve.NAMI_LAST_IMPRESSION_ID,Pt=void 0===Mt?"nami_last_impression_id":Mt,Tt=ve.NAMI_PURCHASE_IMPRESSION_ID,_t=void 0===Tt?"nami_purchase_impression_id":Tt,Dt=ve.NAMI_LAUNCH_ID,At=void 0===Dt?"nami_launch_id":Dt,xt=ve.NAMI_SESSION_ID,Ct=void 0===xt?"nami_session_id":xt,It=ve.NAMI_LANGUAGE_CODE,Lt=void 0===It?"nami_language_code":It,Ft=ve.NAMI_PURCHASE_CHANNEL,Rt=void 0===Ft?"nami_purchase_channel":Ft,Wt=ve.API_VERSION,Ot=ve.BASE_URL_PATH,Nt=void 0===Ot?`sdk/${void 0===Wt?"v3":Wt}/platform`:Ot,jt=ve.BASE_URL,$t=void 0===jt?"https://app.namiml.com":jt,zt=ve.BASE_STAGING_URL,Bt=void 0===zt?"https://app-staging.namiml.com":zt,Ht=ve.CUSTOM_HOST_PREFIX,Ut=void 0===Ht?"namiAPIHost=":Ht,Gt=ve.USE_STAGING_API,Vt=void 0===Gt?"useStagingAPI":Gt,Xt=ve.EXTENDED_CLIENT_INFO_PREFIX,Kt=void 0===Xt?"extendedClientInfo":Xt,Yt=ve.EXTENDED_CLIENT_INFO_DELIMITER,qt=void 0===Yt?":":Yt,Jt=ve.VALIDATE_PRODUCT_GROUPS,Qt=void 0===Jt?"validateProductGroups":Jt,Zt=ve.API_MAX_CALLS_LIMIT,en=void 0===Zt?2:Zt,tn=ve.API_RETRY_DELAY_SEC,nn=void 0===tn?2:tn,an=ve.API_TIMEOUT_LIMIT,rn=void 0===an?2e4:an,on=ve.DEVICE_API_TIMEOUT_LIMIT,sn=void 0===on?3e3:on,un=ve.STATUS_BAD_REQUEST,ln=void 0===un?400:un,dn=ve.STATUS_NOT_FOUND,hn=void 0===dn?404:dn,cn=ve.STATUS_CONFLICT,mn=void 0===cn?409:cn,fn=ve.STATUS_INTERNAL_SERVER_ERROR,vn=void 0===fn?500:fn,pn=ve.INITIAL_SUCCESS,gn=void 0===pn?"Initial success":pn,yn=ve.RECONFIG_SUCCESS,bn=void 0===yn?"Reconfig success":yn,wn=ve.ALREADY_CONFIGURED,kn=void 0===wn?"Already configured":wn,Sn=ve.AVAILABLE_CAMPAIGNS_CHANGED,En=void 0===Sn?"AvailableCampaignsChanged":Sn,Mn=ve.PAYWALL_ACTION_EVENT,Pn=void 0===Mn?"PaywallActionEvent":Mn,Tn=ve.AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED,_n=void 0===Tn?"AvailableActiveEntitlementsChanged":Tn,Dn=ve.CUSTOMER_JOURNEY_STATE_CHANGED,An=void 0===Dn?"CustomerJourneyStateChanged":Dn,xn=ve.SKU_TEXT_REGEX,Cn=void 0===xn?/\$\{sku\.(\w+)(:\d+)?\}/g:xn,In=ve.VAR_REGEX,Ln=void 0===In?/\$\{\s*(\w+(\.[a-zA-Z\d_:${}-]{0,99})*?)\s*}/g:In,Fn=ve.SMART_TEXT_PATTERN,Rn=void 0===Fn?"${":Fn,Wn=ve.LIQUID_VARIABLE_REGEX,On=void 0===Wn?/\${[A-Za-z0-9.]+}/g:Wn;!function(e){e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR"}(fe||(fe={}));var Nn={debug:fe.DEBUG,info:fe.INFO,warn:fe.WARN,error:fe.ERROR},jn=function(){return p((function e(){h(this,e),this.currentLogLevel=fe.DEBUG,this.setLogger=e=>{this.currentLogLevel=e?Nn[e]:fe.WARN}}),[{key:"debug",value:function(e,...t){this.shouldLog(fe.DEBUG)&&console.debug(this.formatMessage(fe.DEBUG,e,...t))}},{key:"info",value:function(e,...t){this.shouldLog(fe.INFO)&&console.info(this.formatMessage(fe.INFO,e,...t))}},{key:"warn",value:function(e,...t){this.shouldLog(fe.WARN)&&console.warn(this.formatMessage(fe.WARN,e,...t))}},{key:"error",value:function(e,...t){this.shouldLog(fe.ERROR)&&console.error(this.formatMessage(fe.ERROR,e,...t))}},{key:"shouldLog",value:function(e){return e>=this.currentLogLevel}},{key:"formatMessage",value:function(e,t,...n){var i=fe[e];return`[${(new Date).toISOString()}] [${i}] ${t} ${n=n.map((e=>"object"==typeof e?JSON.stringify(e):e))}`}}])}(),$n=new jn;function zn(e){for(var t=-1,n=null==e?0:e.length,i=0,a=[];++t<n;){var r=e[t];r&&(a[i++]=r)}return a}function Bn(e,t){return e===t||e!=e&&t!=t}function Hn(e,t){for(var n=e.length;n--;)if(Bn(e[n][0],t))return n;return-1}var Un=Array.prototype.splice;function Gn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Gn.prototype.clear=function(){this.__data__=[],this.size=0},Gn.prototype.delete=function(e){var t=this.__data__,n=Hn(t,e);return!(n<0)&&(n==t.length-1?t.pop():Un.call(t,n,1),--this.size,!0)},Gn.prototype.get=function(e){var t=this.__data__,n=Hn(t,e);return n<0?void 0:t[n][1]},Gn.prototype.has=function(e){return Hn(this.__data__,e)>-1},Gn.prototype.set=function(e,t){var n=this.__data__,i=Hn(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};var Vn="object"==typeof global&&global&&global.Object===Object&&global,Xn="object"==typeof self&&self&&self.Object===Object&&self,Kn=Vn||Xn||Function("return this")(),Yn=Kn.Symbol,qn=Object.prototype,Jn=qn.hasOwnProperty,Qn=qn.toString,Zn=Yn?Yn.toStringTag:void 0;var ei=Object.prototype.toString;var ti="[object Null]",ni="[object Undefined]",ii=Yn?Yn.toStringTag:void 0;function ai(e){return null==e?void 0===e?ni:ti:ii&&ii in Object(e)?function(e){var t=Jn.call(e,Zn),n=e[Zn];try{e[Zn]=void 0;var i=!0}catch(e){}var a=Qn.call(e);return i&&(t?e[Zn]=n:delete e[Zn]),a}(e):function(e){return ei.call(e)}(e)}function ri(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var oi="[object AsyncFunction]",si="[object Function]",ui="[object GeneratorFunction]",li="[object Proxy]";function di(e){if(!ri(e))return!1;var t=ai(e);return t==si||t==ui||t==oi||t==li}var hi,ci=Kn["__core-js_shared__"],mi=(hi=/[^.]+$/.exec(ci&&ci.keys&&ci.keys.IE_PROTO||""))?"Symbol(src)_1."+hi:"";var fi=Function.prototype.toString;function vi(e){if(null!=e){try{return fi.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var pi=/^\[object .+?Constructor\]$/,gi=Function.prototype,yi=Object.prototype,bi=gi.toString,wi=yi.hasOwnProperty,ki=RegExp("^"+bi.call(wi).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Si(e){return!(!ri(e)||(t=e,mi&&mi in t))&&(di(e)?ki:pi).test(vi(e));var t}function Ei(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Si(n)?n:void 0}var Mi=Ei(Kn,"Map"),Pi=Ei(Object,"create");var Ti=Object.prototype.hasOwnProperty;var _i=Object.prototype.hasOwnProperty;function Di(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Ai(e,t){var n,i,a=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function xi(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Di.prototype.clear=function(){this.__data__=Pi?Pi(null):{},this.size=0},Di.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Di.prototype.get=function(e){var t=this.__data__;if(Pi){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Ti.call(t,e)?t[e]:void 0},Di.prototype.has=function(e){var t=this.__data__;return Pi?void 0!==t[e]:_i.call(t,e)},Di.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Pi&&void 0===t?"__lodash_hash_undefined__":t,this},xi.prototype.clear=function(){this.size=0,this.__data__={hash:new Di,map:new(Mi||Gn),string:new Di}},xi.prototype.delete=function(e){var t=Ai(this,e).delete(e);return this.size-=t?1:0,t},xi.prototype.get=function(e){return Ai(this,e).get(e)},xi.prototype.has=function(e){return Ai(this,e).has(e)},xi.prototype.set=function(e,t){var n=Ai(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function Ci(e){var t=this.__data__=new Gn(e);this.size=t.size}Ci.prototype.clear=function(){this.__data__=new Gn,this.size=0},Ci.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ci.prototype.get=function(e){return this.__data__.get(e)},Ci.prototype.has=function(e){return this.__data__.has(e)},Ci.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Gn){var i=n.__data__;if(!Mi||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new xi(i)}return n.set(e,t),this.size=n.size,this};function Ii(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new xi;++t<n;)this.add(e[t])}function Li(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}function Fi(e,t){return e.has(t)}Ii.prototype.add=Ii.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ii.prototype.has=function(e){return this.__data__.has(e)};var Ri=1,Wi=2;function Oi(e,t,n,i,a,r){var o=n&Ri,s=e.length,u=t.length;if(s!=u&&!(o&&u>s))return!1;var l=r.get(e),d=r.get(t);if(l&&d)return l==t&&d==e;var h=-1,c=!0,m=n&Wi?new Ii:void 0;for(r.set(e,t),r.set(t,e);++h<s;){var f=e[h],v=t[h];if(i)var p=o?i(v,f,h,t,e,r):i(f,v,h,e,t,r);if(void 0!==p){if(p)continue;c=!1;break}if(m){if(!Li(t,(function(e,t){if(!Fi(m,t)&&(f===e||a(f,e,n,i,r)))return m.push(t)}))){c=!1;break}}else if(f!==v&&!a(f,v,n,i,r)){c=!1;break}}return r.delete(e),r.delete(t),c}var Ni=Kn.Uint8Array;function ji(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n}function $i(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var zi=1,Bi=2,Hi="[object Boolean]",Ui="[object Date]",Gi="[object Error]",Vi="[object Map]",Xi="[object Number]",Ki="[object RegExp]",Yi="[object Set]",qi="[object String]",Ji="[object Symbol]",Qi="[object ArrayBuffer]",Zi="[object DataView]",ea=Yn?Yn.prototype:void 0,ta=ea?ea.valueOf:void 0;function na(e,t){for(var n=-1,i=t.length,a=e.length;++n<i;)e[a+n]=t[n];return e}var ia=Array.isArray;function aa(e,t,n){var i=t(e);return ia(e)?i:na(i,n(e))}function ra(){return[]}var oa=Object.prototype.propertyIsEnumerable,sa=Object.getOwnPropertySymbols,ua=sa?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,i=null==e?0:e.length,a=0,r=[];++n<i;){var o=e[n];t(o,n,e)&&(r[a++]=o)}return r}(sa(e),(function(t){return oa.call(e,t)})))}:ra;function la(e){return null!=e&&"object"==typeof e}function da(e){return la(e)&&"[object Arguments]"==ai(e)}var ha=Object.prototype,ca=ha.hasOwnProperty,ma=ha.propertyIsEnumerable,fa=da(function(){return arguments}())?da:function(e){return la(e)&&ca.call(e,"callee")&&!ma.call(e,"callee")};var va="object"==typeof exports&&exports&&!exports.nodeType&&exports,pa=va&&"object"==typeof module&&module&&!module.nodeType&&module,ga=pa&&pa.exports===va?Kn.Buffer:void 0,ya=(ga?ga.isBuffer:void 0)||function(){return!1},ba=9007199254740991,wa=/^(?:0|[1-9]\d*)$/;function ka(e,t){var n=typeof e;return!!(t=null==t?ba:t)&&("number"==n||"symbol"!=n&&wa.test(e))&&e>-1&&e%1==0&&e<t}var Sa=9007199254740991;function Ea(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Sa}var Ma={};function Pa(e){return function(t){return e(t)}}Ma["[object Float32Array]"]=Ma["[object Float64Array]"]=Ma["[object Int8Array]"]=Ma["[object Int16Array]"]=Ma["[object Int32Array]"]=Ma["[object Uint8Array]"]=Ma["[object Uint8ClampedArray]"]=Ma["[object Uint16Array]"]=Ma["[object Uint32Array]"]=!0,Ma["[object Arguments]"]=Ma["[object Array]"]=Ma["[object ArrayBuffer]"]=Ma["[object Boolean]"]=Ma["[object DataView]"]=Ma["[object Date]"]=Ma["[object Error]"]=Ma["[object Function]"]=Ma["[object Map]"]=Ma["[object Number]"]=Ma["[object Object]"]=Ma["[object RegExp]"]=Ma["[object Set]"]=Ma["[object String]"]=Ma["[object WeakMap]"]=!1;var Ta="object"==typeof exports&&exports&&!exports.nodeType&&exports,_a=Ta&&"object"==typeof module&&module&&!module.nodeType&&module,Da=_a&&_a.exports===Ta&&Vn.process,Aa=function(){try{var e=_a&&_a.require&&_a.require("util").types;return e||Da&&Da.binding&&Da.binding("util")}catch(e){}}(),xa=Aa&&Aa.isTypedArray,Ca=xa?Pa(xa):function(e){return la(e)&&Ea(e.length)&&!!Ma[ai(e)]},Ia=Object.prototype.hasOwnProperty;function La(e,t){var n=ia(e),i=!n&&fa(e),a=!n&&!i&&ya(e),r=!n&&!i&&!a&&Ca(e),o=n||i||a||r,s=o?function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}(e.length,String):[],u=s.length;for(var l in e)!t&&!Ia.call(e,l)||o&&("length"==l||a&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ka(l,u))||s.push(l);return s}var Fa=Object.prototype;function Ra(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Fa)}function Wa(e,t){return function(n){return e(t(n))}}var Oa=Wa(Object.keys,Object),Na=Object.prototype.hasOwnProperty;function ja(e){return null!=e&&Ea(e.length)&&!di(e)}function $a(e){return ja(e)?La(e):function(e){if(!Ra(e))return Oa(e);var t=[];for(var n in Object(e))Na.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}function za(e){return aa(e,$a,ua)}var Ba=1,Ha=Object.prototype.hasOwnProperty;var Ua=Ei(Kn,"DataView"),Ga=Ei(Kn,"Promise"),Va=Ei(Kn,"Set"),Xa=Ei(Kn,"WeakMap"),Ka="[object Map]",Ya="[object Promise]",qa="[object Set]",Ja="[object WeakMap]",Qa="[object DataView]",Za=vi(Ua),er=vi(Mi),tr=vi(Ga),nr=vi(Va),ir=vi(Xa),ar=ai;(Ua&&ar(new Ua(new ArrayBuffer(1)))!=Qa||Mi&&ar(new Mi)!=Ka||Ga&&ar(Ga.resolve())!=Ya||Va&&ar(new Va)!=qa||Xa&&ar(new Xa)!=Ja)&&(ar=function(e){var t=ai(e),n="[object Object]"==t?e.constructor:void 0,i=n?vi(n):"";if(i)switch(i){case Za:return Qa;case er:return Ka;case tr:return Ya;case nr:return qa;case ir:return Ja}return t});var rr=1,or="[object Arguments]",sr="[object Array]",ur="[object Object]",lr=Object.prototype.hasOwnProperty;function dr(e,t,n,i,a,r){var o=ia(e),s=ia(t),u=o?sr:ar(e),l=s?sr:ar(t),d=(u=u==or?ur:u)==ur,h=(l=l==or?ur:l)==ur,c=u==l;if(c&&ya(e)){if(!ya(t))return!1;o=!0,d=!1}if(c&&!d)return r||(r=new Ci),o||Ca(e)?Oi(e,t,n,i,a,r):function(e,t,n,i,a,r,o){switch(n){case Zi:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Qi:return!(e.byteLength!=t.byteLength||!r(new Ni(e),new Ni(t)));case Hi:case Ui:case Xi:return Bn(+e,+t);case Gi:return e.name==t.name&&e.message==t.message;case Ki:case qi:return e==t+"";case Vi:var s=ji;case Yi:var u=i&zi;if(s||(s=$i),e.size!=t.size&&!u)return!1;var l=o.get(e);if(l)return l==t;i|=Bi,o.set(e,t);var d=Oi(s(e),s(t),i,a,r,o);return o.delete(e),d;case Ji:if(ta)return ta.call(e)==ta.call(t)}return!1}(e,t,u,n,i,a,r);if(!(n&rr)){var m=d&&lr.call(e,"__wrapped__"),f=h&&lr.call(t,"__wrapped__");if(m||f){var v=m?e.value():e,p=f?t.value():t;return r||(r=new Ci),a(v,p,n,i,r)}}return!!c&&(r||(r=new Ci),function(e,t,n,i,a,r){var o=n&Ba,s=za(e),u=s.length;if(u!=za(t).length&&!o)return!1;for(var l=u;l--;){var d=s[l];if(!(o?d in t:Ha.call(t,d)))return!1}var h=r.get(e),c=r.get(t);if(h&&c)return h==t&&c==e;var m=!0;r.set(e,t),r.set(t,e);for(var f=o;++l<u;){var v=e[d=s[l]],p=t[d];if(i)var g=o?i(p,v,d,t,e,r):i(v,p,d,e,t,r);if(!(void 0===g?v===p||a(v,p,n,i,r):g)){m=!1;break}f||(f="constructor"==d)}if(m&&!f){var y=e.constructor,b=t.constructor;y==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b||(m=!1)}return r.delete(e),r.delete(t),m}(e,t,n,i,a,r))}function hr(e,t,n,i,a){return e===t||(null==e||null==t||!la(e)&&!la(t)?e!=e&&t!=t:dr(e,t,n,i,hr,a))}var cr=1,mr=2;function fr(e){return e==e&&!ri(e)}function vr(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function pr(e){var t=function(e){for(var t=$a(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,fr(a)]}return t}(e);return 1==t.length&&t[0][2]?vr(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,i){var a=n.length,r=a;if(null==e)return!r;for(e=Object(e);a--;){var o=n[a];if(o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++a<r;){var s=(o=n[a])[0],u=e[s],l=o[1];if(o[2]){if(void 0===u&&!(s in e))return!1}else{var d=new Ci;if(!hr(l,u,cr|mr,i,d))return!1}}return!0}(n,0,t)}}var gr="[object Symbol]";function yr(e){return"symbol"==typeof e||la(e)&&ai(e)==gr}var br=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wr=/^\w*$/;function kr(e,t){if(ia(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!yr(e))||(wr.test(e)||!br.test(e)||null!=t&&e in Object(t))}var Sr="Expected a function";function Er(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(Sr);var n=function(){var i=arguments,a=t?t.apply(this,i):i[0],r=n.cache;if(r.has(a))return r.get(a);var o=e.apply(this,i);return n.cache=r.set(a,o)||r,o};return n.cache=new(Er.Cache||xi),n}Er.Cache=xi;var Mr,Pr,Tr,_r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dr=/\\(\\)?/g,Ar=(Mr=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(_r,(function(e,n,i,a){t.push(i?a.replace(Dr,"$1"):n||e)})),t},Pr=Er(Mr,(function(e){return 500===Tr.size&&Tr.clear(),e})),Tr=Pr.cache,Pr);var xr=1/0,Cr=Yn?Yn.prototype:void 0,Ir=Cr?Cr.toString:void 0;function Lr(e){if("string"==typeof e)return e;if(ia(e))return function(e,t){for(var n=-1,i=null==e?0:e.length,a=Array(i);++n<i;)a[n]=t(e[n],n,e);return a}(e,Lr)+"";if(yr(e))return Ir?Ir.call(e):"";var t=e+"";return"0"==t&&1/e==-xr?"-0":t}function Fr(e){return null==e?"":Lr(e)}function Rr(e,t){return ia(e)?e:kr(e,t)?[e]:Ar(Fr(e))}var Wr=1/0;function Or(e){if("string"==typeof e||yr(e))return e;var t=e+"";return"0"==t&&1/e==-Wr?"-0":t}function Nr(e,t){for(var n=0,i=(t=Rr(t,e)).length;null!=e&&n<i;)e=e[Or(t[n++])];return n&&n==i?e:void 0}function jr(e,t){return null!=e&&t in Object(e)}function $r(e,t){return null!=e&&function(e,t,n){for(var i=-1,a=(t=Rr(t,e)).length,r=!1;++i<a;){var o=Or(t[i]);if(!(r=null!=e&&n(e,o)))break;e=e[o]}return r||++i!=a?r:!!(a=null==e?0:e.length)&&Ea(a)&&ka(o,a)&&(ia(e)||fa(e))}(e,t,jr)}var zr=1,Br=2;function Hr(e,t){return kr(e)&&fr(t)?vr(Or(e),t):function(n){var i=function(e,t,n){var i=null==e?void 0:Nr(e,t);return void 0===i?n:i}(n,e);return void 0===i&&i===t?$r(n,e):hr(t,i,zr|Br)}}function Ur(e){return e}function Gr(e){return kr(e)?(t=Or(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Nr(t,e)}}(e);var t}function Vr(e){return e!=e}function Xr(e,t){return!!(null==e?0:e.length)&&function(e,t,n){return t==t?function(e,t,n){for(var i=n-1,a=e.length;++i<a;)if(e[i]===t)return i;return-1}(e,t,n):function(e,t,n){for(var i=e.length,a=n+-1;++a<i;)if(t(e[a],a,e))return a;return-1}(e,Vr,n)}(e,t,0)>-1}var Kr=Va&&1/$i(new Va([,-0]))[1]==1/0?function(e){return new Va(e)}:function(){},Yr=200;function qr(e,t){return e&&e.length?function(e,t,n){var i=-1,a=Xr,r=e.length,o=!0,s=[],u=s;if(r>=Yr){var l=t?null:Kr(e);if(l)return $i(l);o=!1,a=Fi,u=new Ii}else u=t?[]:s;e:for(;++i<r;){var d=e[i],h=t?t(d):d;if(d=0!==d?d:0,o&&h==h){for(var c=u.length;c--;)if(u[c]===h)continue e;t&&u.push(h),s.push(d)}else a(u,h,n)||(u!==s&&u.push(h),s.push(d))}return s}(e,"function"==typeof(n=t)?n:null==n?Ur:"object"==typeof n?ia(n)?Hr(n[0],n[1]):pr(n):Gr(n)):[];var n}var Jr=function(){return p((function e(){h(this,e),this.memoryStore={}}),[{key:"setDevice",value:function(e){this.setItem(je,e)}},{key:"getDevice",value:function(){return this.getItem(je)}},{key:"resetDevice",value:function(){this.resetItem(je)}},{key:"getAnonymousMode",value:function(){return this.getItem(gt)||!1}},{key:"setAnonymousMode",value:function(e){this.setItem(gt,e)}},{key:"clearAnonymousMode",value:function(){this.resetItem(gt)}},{key:"setAppConfig",value:function(e,t){this.setItem(e,t)}},{key:"getAppConfig",value:function(e){return this.getItem(e)}},{key:"setLanguageCode",value:function(e){this.setItem(Lt,e||"en")}},{key:"getLanguageCode",value:function(){return this.getItem(Lt)||"en"}},{key:"setCampaignRules",value:function(e,t){e!==rt?this.isTtlCacheKey(e)?this.setWithTtl(e,t):this.setItem(e,t):this.memoryStore[rt]=JSON.stringify(t)}},{key:"getCampaignRules",value:function(e){return e===rt?this.memoryStore[rt]?JSON.parse(this.memoryStore[rt]):null:this.isTtlCacheKey(e)?this.getWithTtl(e):this.getItem(e)}},{key:"setPaywalls",value:function(e,t){e!==st?this.isTtlCacheKey(e)?this.setWithTtl(e,t):this.setItem(e,t):this.memoryStore[st]=JSON.stringify(t)}},{key:"getPaywalls",value:function(e){return e===st?this.memoryStore[st]?JSON.parse(this.memoryStore[st]):null:this.isTtlCacheKey(e)?this.getWithTtl(e):this.getItem(e)}},{key:"setActiveEntitlements",value:function(e,t){this.setItem(e,t)}},{key:"getActiveEntitlements",value:function(e){return this.getItem(e)||[]}},{key:"setNamiEntitlements",value:function(e,t){this.setItem(e,t)}},{key:"getNamiEntitlements",value:function(e){return this.getItem(e)||[]}},{key:"setProducts",value:function(e,t){this.setItem(e,t)}},{key:"getProducts",value:function(e){return this.getItem(e)}},{key:"getCachedProducts",value:function(){var e,t,n=null!==(e=this.getItem(Je))&&void 0!==e?e:[];return qr(zn([...null!==(t=this.getItem(lt))&&void 0!==t?t:[],...n]),"sku_ref_id")}},{key:"setNamiConfig",value:function(e){this.setItem(ze,e)}},{key:"getNamiConfig",value:function(){return this.getItem(ze)}},{key:"setCustomerAttribute",value:function(e,t){this.setItem(mt+e,t)}},{key:"getCustomerAttribute",value:function(e){return this.getItem(mt+e)}},{key:"getAllCustomerAttributes",value:function(){return Object.entries(localStorage).filter((([e])=>e.includes(mt))).map((([e,t])=>e.replace(mt,"")+":"+t))}},{key:"getAllCustomerAttributesKeys",value:function(){return Object.keys(localStorage).filter((e=>e.includes(mt))).map((e=>e.replace(mt,"")))}},{key:"clearCustomerAttribute",value:function(e){var t=mt+e,n=this.getItem(t);return n&&this.resetItem(t),!!n}},{key:"clearAllCustomerAttributes",value:function(){Object.keys(localStorage).filter((e=>e.includes(mt))).map((e=>this.resetItem(e)))}},{key:"setNamiProfile",value:function(e){this.setItem(He,e)}},{key:"getNamiProfile",value:function(){return this.getItem(He)}},{key:"removeNamiProfile",value:function(){this.resetItem(He)}},{key:"setCustomerJourneyState",value:function(e){this.setItem(vt,e)}},{key:"getCustomerJourneyState",value:function(){return this.getItem(vt)}},{key:"setSessionCounter",value:function(){var e=this.getItem(kt),t=e?parseInt(e):Et||Et;this.setItem(kt,t+1)}},{key:"getSessionCounter",value:function(){var e=this.getItem(kt);return e?parseInt(e):Et}},{key:"setLastImpressionId",value:function(e){this.setItem(Pt,e)}},{key:"getLastImpressionId",value:function(){var e;return null!==(e=this.getItem(Pt))&&void 0!==e?e:""}},{key:"setPurchaseImpression",value:function(){var e,t=null!==(e=this.getLastImpressionId())&&void 0!==e?e:"";this.setItem(_t,t)}},{key:"getPurchaseImpression",value:function(){var e;return null!==(e=this.getItem(_t))&&void 0!==e?e:""}},{key:"setSessionId",value:function(e){e&&this.setItem(Ct,e)}},{key:"getSessionId",value:function(){var e;return null!==(e=this.getItem(Ct))&&void 0!==e?e:""}},{key:"clearSessionId",value:function(){this.resetItem(Ct)}},{key:"setLaunchId",value:function(e){e&&this.setItem(At,e)}},{key:"getLaunchId",value:function(){var e;return null!==(e=this.getItem(At))&&void 0!==e?e:""}},{key:"clearLaunchId",value:function(){this.resetItem(At)}},{key:"setPurchaseChannel",value:function(e){e&&this.setItem(Rt,e)}},{key:"getPurchaseChannel",value:function(){return this.getItem(Rt)}},{key:"getAnonymousUUID",value:function(){return this.getItem(bt)}},{key:"setAnonymousUUID",value:function(e){this.setItem(bt,e)}},{key:"clearAnonymousUUID",value:function(){this.resetItem(bt)}},{key:"isTtlCacheKey",value:function(e){return e===Xe||e===Ye}},{key:"getCampaignCacheTtl",value:function(){var e,t=this.getAppConfig(Ge)||this.getAppConfig(it);return null!==(e=null==t?void 0:t.campaign_cache_ttl)&&void 0!==e?e:null}},{key:"setWithTtl",value:function(e,t){var n=this.getCampaignCacheTtl();0!==n?null!==n&&n>0?this.setItem(e,{data:t,cachedAt:Date.now()}):this.setItem(e,t):this.memoryStore[e]=JSON.stringify(t)}},{key:"isTimestampedCache",value:function(e){return"object"==typeof e&&null!==e&&"cachedAt"in e&&"data"in e}},{key:"getWithTtl",value:function(e){var t=this.getCampaignCacheTtl(),n=this.memoryStore[e];if(null!=n){if(null===t||0===t)return JSON.parse(n);delete this.memoryStore[e]}var i=this.getItem(e);return null===i?null:null===t?this.isTimestampedCache(i)?i.data:i:this.isTimestampedCache(i)?(Date.now()-i.cachedAt)/1e3>=t?(this.resetItem(e),null):i.data:(this.resetItem(e),null)}},{key:"setItem",value:function(e,t){var n;try{n=JSON.stringify(t)}catch(t){return void $n.error(`Serialization failed for ${e}`,t)}try{localStorage.setItem(e,n)}catch(t){$n.error("Error setting item in localStorage:",t),this.resetItem(e),this.memoryStore[e]=n}}},{key:"getItem",value:function(e){try{var t=localStorage.getItem(e);if(null!==t)return JSON.parse(t)}catch(t){"undefined"!=typeof window&&$n.error("Error getting item from localStorage:",e,": ",t)}var n=this.memoryStore[e];return null!=n?JSON.parse(n):null}},{key:"resetItem",value:function(e){try{localStorage.removeItem(e)}catch(t){"undefined"!=typeof window&&$n.error("Error removing item from localStorage:",e,": ",t)}delete this.memoryStore[e]}},{key:"clear",value:function(){try{localStorage.clear()}catch(e){$n.error("Error clearing localStorage:",e)}this.memoryStore={}}}])}(),Qr=new Jr,Zr=function(){function e(t,n){var i;return h(this,e),(i=d(this,e,[n])).statusCode=t,i.status=t,i.message=`RetryLimitExceededError: ${i.message}`,i}return k(e,I(Error)),p(e)}(),eo=function(){function e(){return h(this,e),d(this,e,arguments)}return k(e,I(Error)),p(e)}(),to=function(){function e(){var t;return h(this,e),(t=d(this,e)).status=409,t.name="ConflictError",t.message="ConflictError: Server responded with conflict",t}return k(e,eo),p(e)}(),no=function(){function e(){return h(this,e),d(this,e,[Pe])}return k(e,I(Error)),p(e)}(),io=function(){function e(){return h(this,e),d(this,e,[be])}return k(e,I(Error)),p(e)}(),ao=function(){function e(){return h(this,e),d(this,e,[ke])}return k(e,I(Error)),p(e)}(),ro=function(){function e(){return h(this,e),d(this,e,[Ee])}return k(e,I(Error)),p(e)}(),oo=function(){function e(){return h(this,e),d(this,e,[_e])}return k(e,I(Error)),p(e)}(),so=function(){function e(){return h(this,e),d(this,e,[Ae])}return k(e,I(Error)),p(e)}(),uo=function(){function e(){return h(this,e),d(this,e,[Le])}return k(e,I(Error)),p(e)}(),lo=function(){function e(){return h(this,e),d(this,e,[Re])}return k(e,I(Error)),p(e)}(),ho=function(){function e(){return h(this,e),d(this,e,[Re])}return k(e,I(Error)),p(e)}(),co=function(){function e(){return h(this,e),d(this,e,[Ce])}return k(e,I(Error)),p(e)}(),mo=function(){function e(t){var n;return h(this,e),(n=d(this,e,[t])).message=`BadRequestError: ${n.message}`,n}return k(e,eo),p(e)}(),fo=function(){function e(t){var n;return h(this,e),(n=d(this,e,[t])).message=`NotFoundError: ${n.message}`,n}return k(e,eo),p(e)}(),vo=function(){function e(t,n){var i;return h(this,e),(i=d(this,e,[n])).statusCode=t,i.message=`ClientError: ${i.message}`,i}return k(e,eo),p(e)}(),po=function(){function e(t){var n;return h(this,e),(n=d(this,e,[t])).message=`ServerError: ${n.message}`,n}return k(e,eo),p(e)}(),go=(e,t)=>{if(e==ln)throw new mo(t);if(e==hn)throw new fo(t);if(e==mn)throw new to;if(e>ln&&e<vn)throw new vo(e,t);if(e>=vn)throw new po(t)};function yo(e,t,n=rn,i=en){var a,r,o;return T((function(s){for(;;)switch(s.n){case 0:return a=0,r=()=>{var o,s;return T((function(u){for(;;)switch(u.n){case 0:return u.n=1,l(bo(e,t,n));case 1:if((o=u.v).ok){u.n=5;break}if(o.status!=mn){u.n=2;break}throw new to;case 2:if(!(++a<=i)){u.n=4;break}return s=1e3*(a+nn),u.n=3,l(new Promise((e=>setTimeout(e,s))));case 3:return u.a(2,r());case 4:throw new Zr(o.status,`Request failed after ${i} retries`);case 5:return u.a(2,o)}}),null,null,null,Promise)},s.n=1,l(r());case 1:return o=s.v,s.a(2,o.json())}}),null,null,null,Promise)}function bo(e,t={},n){var i,a,r;return T((function(o){for(;;)switch(o.n){case 0:return i=new AbortController,a=setTimeout((()=>i.abort()),n),t.signal=i.signal,o.n=1,l(fetch(e,t));case 1:return r=o.v,clearTimeout(a),o.a(2,r)}}),null,null,null,Promise)}function wo(e){for(var t=e.length;--t>=0;)e[t]=0}wo(new Array(576)),wo(new Array(60)),wo(new Array(512)),wo(new Array(256)),wo(new Array(29)),wo(new Array(30));var ko=(e,t,n,i)=>{for(var a=65535&e,r=e>>>16&65535,o=0;0!==n;){n-=o=n>2e3?2e3:n;do{r=r+(a=a+t[i++]|0)|0}while(--o);a%=65521,r%=65521}return a|r<<16},So=new Uint32Array((()=>{for(var e,t=[],n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})()),Eo=(e,t,n,i)=>{var a=So,r=i+n;e^=-1;for(var o=i;o<r;o++)e=e>>>8^a[255&(e^t[o])];return~e},Mo={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Po={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},To=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),_o={assign:function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)To(n,i)&&(e[i]=n[i])}}return e},flattenChunks:e=>{for(var t=0,n=0,i=e.length;n<i;n++)t+=e[n].length;for(var a=new Uint8Array(t),r=0,o=0,s=e.length;r<s;r++){var u=e[r];a.set(u,o),o+=u.length}return a}},Do=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Do=!1}for(var Ao=new Uint8Array(256),xo=0;xo<256;xo++)Ao[xo]=xo>=252?6:xo>=248?5:xo>=240?4:xo>=224?3:xo>=192?2:1;Ao[254]=Ao[254]=1;var Co={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);var t,n,i,a,r,o=e.length,s=0;for(a=0;a<o;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<o&&56320==(64512&(i=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(i-56320),a++),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),r=0,a=0;r<s;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<o&&56320==(64512&(i=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(i-56320),a++),n<128?t[r++]=n:n<2048?(t[r++]=192|n>>>6,t[r++]=128|63&n):n<65536?(t[r++]=224|n>>>12,t[r++]=128|n>>>6&63,t[r++]=128|63&n):(t[r++]=240|n>>>18,t[r++]=128|n>>>12&63,t[r++]=128|n>>>6&63,t[r++]=128|63&n);return t},buf2string:(e,t)=>{var n,i,a=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));var r=new Array(2*a);for(i=0,n=0;n<a;){var o=e[n++];if(o<128)r[i++]=o;else{var s=Ao[o];if(s>4)r[i++]=65533,n+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&n<a;)o=o<<6|63&e[n++],s--;s>1?r[i++]=65533:o<65536?r[i++]=o:(o-=65536,r[i++]=55296|o>>10&1023,r[i++]=56320|1023&o)}}}return((e,t)=>{if(t<65534&&e.subarray&&Do)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));for(var n="",i=0;i<t;i++)n+=String.fromCharCode(e[i]);return n})(r,i)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);for(var n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+Ao[e[n]]>t?n:t}};var Io=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Lo=16209,Fo=function(e,t){var n,i,a,r,o,s,u,l,d,h,c,m,f,v,p,g,y,b,w,k,S,E,M,P,T=e.state;n=e.next_in,M=e.input,i=n+(e.avail_in-5),a=e.next_out,P=e.output,r=a-(t-e.avail_out),o=a+(e.avail_out-257),s=T.dmax,u=T.wsize,l=T.whave,d=T.wnext,h=T.window,c=T.hold,m=T.bits,f=T.lencode,v=T.distcode,p=(1<<T.lenbits)-1,g=(1<<T.distbits)-1;e:do{m<15&&(c+=M[n++]<<m,m+=8,c+=M[n++]<<m,m+=8),y=f[c&p];t:for(;;){if(c>>>=b=y>>>24,m-=b,0===(b=y>>>16&255))P[a++]=65535&y;else{if(!(16&b)){if(64&b){if(32&b){T.mode=16191;break e}e.msg="invalid literal/length code",T.mode=Lo;break e}y=f[(65535&y)+(c&(1<<b)-1)];continue t}for(w=65535&y,(b&=15)&&(m<b&&(c+=M[n++]<<m,m+=8),w+=c&(1<<b)-1,c>>>=b,m-=b),m<15&&(c+=M[n++]<<m,m+=8,c+=M[n++]<<m,m+=8),y=v[c&g];;){if(c>>>=b=y>>>24,m-=b,16&(b=y>>>16&255)){if(k=65535&y,m<(b&=15)&&(c+=M[n++]<<m,(m+=8)<b&&(c+=M[n++]<<m,m+=8)),(k+=c&(1<<b)-1)>s){e.msg="invalid distance too far back",T.mode=Lo;break e}if(c>>>=b,m-=b,k>(b=a-r)){if((b=k-b)>l&&T.sane){e.msg="invalid distance too far back",T.mode=Lo;break e}if(S=0,E=h,0===d){if(S+=u-b,b<w){w-=b;do{P[a++]=h[S++]}while(--b);S=a-k,E=P}}else if(d<b){if(S+=u+d-b,(b-=d)<w){w-=b;do{P[a++]=h[S++]}while(--b);if(S=0,d<w){w-=b=d;do{P[a++]=h[S++]}while(--b);S=a-k,E=P}}}else if(S+=d-b,b<w){w-=b;do{P[a++]=h[S++]}while(--b);S=a-k,E=P}for(;w>2;)P[a++]=E[S++],P[a++]=E[S++],P[a++]=E[S++],w-=3;w&&(P[a++]=E[S++],w>1&&(P[a++]=E[S++]))}else{S=a-k;do{P[a++]=P[S++],P[a++]=P[S++],P[a++]=P[S++],w-=3}while(w>2);w&&(P[a++]=P[S++],w>1&&(P[a++]=P[S++]))}break}if(64&b){e.msg="invalid distance code",T.mode=Lo;break e}y=v[(65535&y)+(c&(1<<b)-1)]}}break}}while(n<i&&a<o);n-=w=m>>3,c&=(1<<(m-=w<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=a<o?o-a+257:257-(a-o),T.hold=c,T.bits=m},Ro=15,Wo=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Oo=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),No=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),jo=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),$o=(e,t,n,i,a,r,o,s)=>{var u,l,d,h,c,m,f,v,p,g=s.bits,y=0,b=0,w=0,k=0,S=0,E=0,M=0,P=0,T=0,_=0,D=null,A=new Uint16Array(16),x=new Uint16Array(16),C=null;for(y=0;y<=Ro;y++)A[y]=0;for(b=0;b<i;b++)A[t[n+b]]++;for(S=g,k=Ro;k>=1&&0===A[k];k--);if(S>k&&(S=k),0===k)return a[r++]=20971520,a[r++]=20971520,s.bits=1,0;for(w=1;w<k&&0===A[w];w++);for(S<w&&(S=w),P=1,y=1;y<=Ro;y++)if(P<<=1,(P-=A[y])<0)return-1;if(P>0&&(0===e||1!==k))return-1;for(x[1]=0,y=1;y<Ro;y++)x[y+1]=x[y]+A[y];for(b=0;b<i;b++)0!==t[n+b]&&(o[x[t[n+b]]++]=b);if(0===e?(D=C=o,m=20):1===e?(D=Wo,C=Oo,m=257):(D=No,C=jo,m=0),_=0,b=0,y=w,c=r,E=S,M=0,d=-1,h=(T=1<<S)-1,1===e&&T>852||2===e&&T>592)return 1;for(;;){f=y-M,o[b]+1<m?(v=0,p=o[b]):o[b]>=m?(v=C[o[b]-m],p=D[o[b]-m]):(v=96,p=0),u=1<<y-M,w=l=1<<E;do{a[c+(_>>M)+(l-=u)]=f<<24|v<<16|p}while(0!==l);for(u=1<<y-1;_&u;)u>>=1;if(0!==u?(_&=u-1,_+=u):_=0,b++,0==--A[y]){if(y===k)break;y=t[n+o[b]]}if(y>S&&(_&h)!==d){for(0===M&&(M=S),c+=w,P=1<<(E=y-M);E+M<k&&!((P-=A[E+M])<=0);)E++,P<<=1;if(T+=1<<E,1===e&&T>852||2===e&&T>592)return 1;a[d=_&h]=S<<24|E<<16|c-r}}return 0!==_&&(a[c+_]=y-M<<24|64<<16),s.bits=S,0},zo=Po.Z_FINISH,Bo=Po.Z_BLOCK,Ho=Po.Z_TREES,Uo=Po.Z_OK,Go=Po.Z_STREAM_END,Vo=Po.Z_NEED_DICT,Xo=Po.Z_STREAM_ERROR,Ko=Po.Z_DATA_ERROR,Yo=Po.Z_MEM_ERROR,qo=Po.Z_BUF_ERROR,Jo=Po.Z_DEFLATED,Qo=16180,Zo=16190,es=16191,ts=16192,ns=16194,is=16199,as=16200,rs=16206,os=16209,ss=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function us(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var ls,ds,hs=e=>{if(!e)return 1;var t=e.state;return!t||t.strm!==e||t.mode<Qo||t.mode>16211?1:0},cs=e=>{if(hs(e))return Xo;var t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Qo,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Uo},ms=e=>{if(hs(e))return Xo;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,cs(e)},fs=(e,t)=>{var n;if(hs(e))return Xo;var i=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Xo:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,ms(e))},vs=(e,t)=>{if(!e)return Xo;var n=new us;e.state=n,n.strm=e,n.window=null,n.mode=Qo;var i=fs(e,t);return i!==Uo&&(e.state=null),i},ps=!0,gs=e=>{if(ps){ls=new Int32Array(512),ds=new Int32Array(32);for(var t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for($o(1,e.lens,0,288,ls,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;$o(2,e.lens,0,32,ds,0,e.work,{bits:5}),ps=!1}e.lencode=ls,e.lenbits=9,e.distcode=ds,e.distbits=5},ys=(e,t,n,i)=>{var a,r=e.state;return null===r.window&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new Uint8Array(r.wsize)),i>=r.wsize?(r.window.set(t.subarray(n-r.wsize,n),0),r.wnext=0,r.whave=r.wsize):((a=r.wsize-r.wnext)>i&&(a=i),r.window.set(t.subarray(n-i,n-i+a),r.wnext),(i-=a)?(r.window.set(t.subarray(n-i,n),0),r.wnext=i,r.whave=r.wsize):(r.wnext+=a,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=a))),0},bs=(e,t)=>{var n,i,a,r,o,s,u,l,d,h,c,m,f,v,p,g,y,b,w,k,S,E,M,P,T=0,_=new Uint8Array(4),D=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(hs(e)||!e.output||!e.input&&0!==e.avail_in)return Xo;(n=e.state).mode===es&&(n.mode=ts),o=e.next_out,a=e.output,u=e.avail_out,r=e.next_in,i=e.input,s=e.avail_in,l=n.hold,d=n.bits,h=s,c=u,E=Uo;e:for(;;)switch(n.mode){case Qo:if(0===n.wrap){n.mode=ts;break}for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(2&n.wrap&&35615===l){0===n.wbits&&(n.wbits=15),n.check=0,_[0]=255&l,_[1]=l>>>8&255,n.check=Eo(n.check,_,2,0),l=0,d=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",n.mode=os;break}if((15&l)!==Jo){e.msg="unknown compression method",n.mode=os;break}if(d-=4,S=8+(15&(l>>>=4)),0===n.wbits&&(n.wbits=S),S>15||S>n.wbits){e.msg="invalid window size",n.mode=os;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&l?16189:es,l=0,d=0;break;case 16181:for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(n.flags=l,(255&n.flags)!==Jo){e.msg="unknown compression method",n.mode=os;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=os;break}n.head&&(n.head.text=l>>8&1),512&n.flags&&4&n.wrap&&(_[0]=255&l,_[1]=l>>>8&255,n.check=Eo(n.check,_,2,0)),l=0,d=0,n.mode=16182;case 16182:for(;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.head&&(n.head.time=l),512&n.flags&&4&n.wrap&&(_[0]=255&l,_[1]=l>>>8&255,_[2]=l>>>16&255,_[3]=l>>>24&255,n.check=Eo(n.check,_,4,0)),l=0,d=0,n.mode=16183;case 16183:for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.head&&(n.head.xflags=255&l,n.head.os=l>>8),512&n.flags&&4&n.wrap&&(_[0]=255&l,_[1]=l>>>8&255,n.check=Eo(n.check,_,2,0)),l=0,d=0,n.mode=16184;case 16184:if(1024&n.flags){for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.length=l,n.head&&(n.head.extra_len=l),512&n.flags&&4&n.wrap&&(_[0]=255&l,_[1]=l>>>8&255,n.check=Eo(n.check,_,2,0)),l=0,d=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&((m=n.length)>s&&(m=s),m&&(n.head&&(S=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(i.subarray(r,r+m),S)),512&n.flags&&4&n.wrap&&(n.check=Eo(n.check,i,m,r)),s-=m,r+=m,n.length-=m),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===s)break e;m=0;do{S=i[r+m++],n.head&&S&&n.length<65536&&(n.head.name+=String.fromCharCode(S))}while(S&&m<s);if(512&n.flags&&4&n.wrap&&(n.check=Eo(n.check,i,m,r)),s-=m,r+=m,S)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=16187;case 16187:if(4096&n.flags){if(0===s)break e;m=0;do{S=i[r+m++],n.head&&S&&n.length<65536&&(n.head.comment+=String.fromCharCode(S))}while(S&&m<s);if(512&n.flags&&4&n.wrap&&(n.check=Eo(n.check,i,m,r)),s-=m,r+=m,S)break e}else n.head&&(n.head.comment=null);n.mode=16188;case 16188:if(512&n.flags){for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(4&n.wrap&&l!==(65535&n.check)){e.msg="header crc mismatch",n.mode=os;break}l=0,d=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=es;break;case 16189:for(;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}e.adler=n.check=ss(l),l=0,d=0,n.mode=Zo;case Zo:if(0===n.havedict)return e.next_out=o,e.avail_out=u,e.next_in=r,e.avail_in=s,n.hold=l,n.bits=d,Vo;e.adler=n.check=1,n.mode=es;case es:if(t===Bo||t===Ho)break e;case ts:if(n.last){l>>>=7&d,d-=7&d,n.mode=rs;break}for(;d<3;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}switch(n.last=1&l,d-=1,3&(l>>>=1)){case 0:n.mode=16193;break;case 1:if(gs(n),n.mode=is,t===Ho){l>>>=2,d-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=os}l>>>=2,d-=2;break;case 16193:for(l>>>=7&d,d-=7&d;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",n.mode=os;break}if(n.length=65535&l,l=0,d=0,n.mode=ns,t===Ho)break e;case ns:n.mode=16195;case 16195:if(m=n.length){if(m>s&&(m=s),m>u&&(m=u),0===m)break e;a.set(i.subarray(r,r+m),o),s-=m,r+=m,u-=m,o+=m,n.length-=m;break}n.mode=es;break;case 16196:for(;d<14;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(n.nlen=257+(31&l),l>>>=5,d-=5,n.ndist=1+(31&l),l>>>=5,d-=5,n.ncode=4+(15&l),l>>>=4,d-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=os;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;d<3;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.lens[D[n.have++]]=7&l,l>>>=3,d-=3}for(;n.have<19;)n.lens[D[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,M={bits:n.lenbits},E=$o(0,n.lens,0,19,n.lencode,0,n.work,M),n.lenbits=M.bits,E){e.msg="invalid code lengths set",n.mode=os;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;g=(T=n.lencode[l&(1<<n.lenbits)-1])>>>16&255,y=65535&T,!((p=T>>>24)<=d);){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(y<16)l>>>=p,d-=p,n.lens[n.have++]=y;else{if(16===y){for(P=p+2;d<P;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(l>>>=p,d-=p,0===n.have){e.msg="invalid bit length repeat",n.mode=os;break}S=n.lens[n.have-1],m=3+(3&l),l>>>=2,d-=2}else if(17===y){for(P=p+3;d<P;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}d-=p,S=0,m=3+(7&(l>>>=p)),l>>>=3,d-=3}else{for(P=p+7;d<P;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}d-=p,S=0,m=11+(127&(l>>>=p)),l>>>=7,d-=7}if(n.have+m>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=os;break}for(;m--;)n.lens[n.have++]=S}}if(n.mode===os)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=os;break}if(n.lenbits=9,M={bits:n.lenbits},E=$o(1,n.lens,0,n.nlen,n.lencode,0,n.work,M),n.lenbits=M.bits,E){e.msg="invalid literal/lengths set",n.mode=os;break}if(n.distbits=6,n.distcode=n.distdyn,M={bits:n.distbits},E=$o(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,M),n.distbits=M.bits,E){e.msg="invalid distances set",n.mode=os;break}if(n.mode=is,t===Ho)break e;case is:n.mode=as;case as:if(s>=6&&u>=258){e.next_out=o,e.avail_out=u,e.next_in=r,e.avail_in=s,n.hold=l,n.bits=d,Fo(e,c),o=e.next_out,a=e.output,u=e.avail_out,r=e.next_in,i=e.input,s=e.avail_in,l=n.hold,d=n.bits,n.mode===es&&(n.back=-1);break}for(n.back=0;g=(T=n.lencode[l&(1<<n.lenbits)-1])>>>16&255,y=65535&T,!((p=T>>>24)<=d);){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(g&&!(240&g)){for(b=p,w=g,k=y;g=(T=n.lencode[k+((l&(1<<b+w)-1)>>b)])>>>16&255,y=65535&T,!(b+(p=T>>>24)<=d);){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}l>>>=b,d-=b,n.back+=b}if(l>>>=p,d-=p,n.back+=p,n.length=y,0===g){n.mode=16205;break}if(32&g){n.back=-1,n.mode=es;break}if(64&g){e.msg="invalid literal/length code",n.mode=os;break}n.extra=15&g,n.mode=16201;case 16201:if(n.extra){for(P=n.extra;d<P;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;g=(T=n.distcode[l&(1<<n.distbits)-1])>>>16&255,y=65535&T,!((p=T>>>24)<=d);){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(!(240&g)){for(b=p,w=g,k=y;g=(T=n.distcode[k+((l&(1<<b+w)-1)>>b)])>>>16&255,y=65535&T,!(b+(p=T>>>24)<=d);){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}l>>>=b,d-=b,n.back+=b}if(l>>>=p,d-=p,n.back+=p,64&g){e.msg="invalid distance code",n.mode=os;break}n.offset=y,n.extra=15&g,n.mode=16203;case 16203:if(n.extra){for(P=n.extra;d<P;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=os;break}n.mode=16204;case 16204:if(0===u)break e;if(m=c-u,n.offset>m){if((m=n.offset-m)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=os;break}m>n.wnext?(m-=n.wnext,f=n.wsize-m):f=n.wnext-m,m>n.length&&(m=n.length),v=n.window}else v=a,f=o-n.offset,m=n.length;m>u&&(m=u),u-=m,n.length-=m;do{a[o++]=v[f++]}while(--m);0===n.length&&(n.mode=as);break;case 16205:if(0===u)break e;a[o++]=n.length,u--,n.mode=as;break;case rs:if(n.wrap){for(;d<32;){if(0===s)break e;s--,l|=i[r++]<<d,d+=8}if(c-=u,e.total_out+=c,n.total+=c,4&n.wrap&&c&&(e.adler=n.check=n.flags?Eo(n.check,a,c,o-c):ko(n.check,a,c,o-c)),c=u,4&n.wrap&&(n.flags?l:ss(l))!==n.check){e.msg="incorrect data check",n.mode=os;break}l=0,d=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(4&n.wrap&&l!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=os;break}l=0,d=0}n.mode=16208;case 16208:E=Go;break e;case os:E=Ko;break e;case 16210:return Yo;default:return Xo}return e.next_out=o,e.avail_out=u,e.next_in=r,e.avail_in=s,n.hold=l,n.bits=d,(n.wsize||c!==e.avail_out&&n.mode<os&&(n.mode<rs||t!==zo))&&ys(e,e.output,e.next_out,c-e.avail_out),h-=e.avail_in,c-=e.avail_out,e.total_in+=h,e.total_out+=c,n.total+=c,4&n.wrap&&c&&(e.adler=n.check=n.flags?Eo(n.check,a,c,e.next_out-c):ko(n.check,a,c,e.next_out-c)),e.data_type=n.bits+(n.last?64:0)+(n.mode===es?128:0)+(n.mode===is||n.mode===ns?256:0),(0===h&&0===c||t===zo)&&E===Uo&&(E=qo),E},ws={inflateReset:ms,inflateReset2:fs,inflateResetKeep:cs,inflateInit:e=>vs(e,15),inflateInit2:vs,inflate:bs,inflateEnd:e=>{if(hs(e))return Xo;var t=e.state;return t.window&&(t.window=null),e.state=null,Uo},inflateGetHeader:(e,t)=>{if(hs(e))return Xo;var n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,Uo):Xo},inflateSetDictionary:(e,t)=>{var n,i=t.length;return hs(e)||0!==(n=e.state).wrap&&n.mode!==Zo?Xo:n.mode===Zo&&ko(1,t,i,0)!==n.check?Ko:ys(e,t,i,i)?(n.mode=16210,Yo):(n.havedict=1,Uo)},inflateInfo:"pako inflate (from Nodeca project)"};var ks=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},Ss=Object.prototype.toString,Es=Po.Z_NO_FLUSH,Ms=Po.Z_FINISH,Ps=Po.Z_OK,Ts=Po.Z_STREAM_END,_s=Po.Z_NEED_DICT,Ds=Po.Z_STREAM_ERROR,As=Po.Z_DATA_ERROR,xs=Po.Z_MEM_ERROR;function Cs(e){this.options=_o.assign({chunkSize:65536,windowBits:15,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Io,this.strm.avail_out=0;var n=ws.inflateInit2(this.strm,t.windowBits);if(n!==Ps)throw new Error(Mo[n]);if(this.header=new ks,ws.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Co.string2buf(t.dictionary):"[object ArrayBuffer]"===Ss.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=ws.inflateSetDictionary(this.strm,t.dictionary))!==Ps))throw new Error(Mo[n])}function Is(e,t){var n=new Cs(t);if(n.push(e),n.err)throw n.msg||Mo[n.err];return n.result}Cs.prototype.push=function(e,t){var n,i,a,r=this.strm,o=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return!1;for(i=t===~~t?t:!0===t?Ms:Es,"[object ArrayBuffer]"===Ss.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(o),r.next_out=0,r.avail_out=o),(n=ws.inflate(r,i))===_s&&s&&((n=ws.inflateSetDictionary(r,s))===Ps?n=ws.inflate(r,i):n===As&&(n=_s));r.avail_in>0&&n===Ts&&r.state.wrap>0&&0!==e[r.next_in];)ws.inflateReset(r),n=ws.inflate(r,i);switch(n){case Ds:case As:case _s:case xs:return this.onEnd(n),this.ended=!0,!1}if(a=r.avail_out,r.next_out&&(0===r.avail_out||n===Ts))if("string"===this.options.to){var u=Co.utf8border(r.output,r.next_out),l=r.next_out-u,d=Co.buf2string(r.output,u);r.next_out=l,r.avail_out=o-l,l&&r.output.set(r.output.subarray(u,u+l),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(n!==Ps||0!==a){if(n===Ts)return n=ws.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},Cs.prototype.onData=function(e){this.chunks.push(e)},Cs.prototype.onEnd=function(e){e===Ps&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=_o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Ls={Inflate:Cs,inflate:Is,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Is(e,t)},ungzip:Is,constants:Po}.ungzip,Fs=e=>{var t;if(null!=e&&e.includes(Vt))t=Bt;else{var n=null==e?void 0:e.find((e=>e.includes(Ut)));t=n?n.split("=")[1]:$t}return(t=t.replace(/\/$/,""))+"/"+Nt},Rs=e=>{var t,n,i=Qr.getAppConfig(Ge)||Qr.getAppConfig(it);return null!==(t=null==i||null===(n=i.capabilities)||void 0===n?void 0:n.includes(e))&&void 0!==t&&t},Ws=e=>{var t=!Rs(me.THIRD_PARTY_TRANSACTIONS);return e&&!t&&$n.info(`[${e}] Your plan does not have purchase management features.`),t};function Os(e){try{var t=function(e){if("undefined"!=typeof Buffer)return new Uint8Array(Buffer.from(e,"base64"));for(var t=atob(e),n=t.length,i=new Uint8Array(n),a=0;a<n;a++)i[a]=t.charCodeAt(a);return i}(e.trim()),n=Ls(t),i=(new TextDecoder).decode(n);return JSON.parse(i)}catch(e){return}}function Ns(e,t,n){var i=n.value;return n.value=function(...e){if(!this.platformID)throw new io;return i.apply(this,e)},n}function js(e,t,n){var i=n.value;return n.value=function(...e){var t=Qr.getDevice();if(null==t||!t.id)throw new ao;return i.apply(this,e)},n}var $s,zs=function(){return p((function e(){h(this,e);var t=Qr.getNamiConfig();!this.platformID&&t&&this.configure(t)}),[{key:"deviceID",get:function(){var e;return null===(e=Qr.getDevice())||void 0===e?void 0:e.id}},{key:"configure",value:function(e){this.baseURL=Fs(e.namiCommands),this.platformID=e.appPlatformID}},{key:"login",value:function(e){var t,n;return T((function(i){for(;;)switch(i.n){case 0:if(e){i.n=1;break}throw new ro;case 1:return t=`device/${this.deviceID}/login/`,n={external_id:e},i.n=2,l(this.requestBodyAPI(t,n,"PUT"));case 2:return i.a(2,i.v)}}),null,this,null,Promise)}},{key:"logout",value:function(){var e;return T((function(t){for(;;)switch(t.n){case 0:return e=`device/${this.deviceID}/logout/`,t.n=1,l(this.requestBodyAPI(e,{},"PUT"));case 1:return t.a(2,t.v)}}),null,this,null,Promise)}},{key:"startSession",value:function(e){var t,n;return T((function(i){for(;;)switch(i.n){case 0:return t=`device/${this.deviceID}/session/`,i.n=1,l(this.requestBodyAPI(t,{start_time:e,app_env:"production"}));case 1:n=i.v,Qr.setSessionCounter(),n.id&&Qr.setSessionId(n.id);case 2:return i.a(2)}}),null,this,null,Promise)}},{key:"postImpression",value:function(e){var t,n;return T((function(i){for(;;)switch(i.n){case 0:return t=`device/${this.deviceID}/impression/`,i.n=1,l(this.requestBodyAPI(t,e,"POST",!0));case 1:(n=i.v).id&&Qr.setLastImpressionId(n.id);case 2:return i.a(2)}}),null,this,null,Promise)}},{key:"postConversion",value:function(e){var t;return T((function(n){for(;;)switch(n.n){case 0:return t=`device/${this.deviceID}/transaction/`,n.n=1,l(this.requestBodyAPI(t,e,"POST",!0));case 1:return n.a(2)}}),null,this,null,Promise)}},{key:"purchaseValidation",value:function(e){var t;return T((function(n){for(;;)switch(n.n){case 0:return t=`device/${this.deviceID}/purchase_event/`,n.n=1,l(this.requestBodyAPI(t,e,"PUT"));case 1:return n.a(2)}}),null,this,null,Promise)}},{key:"fetchAPI",value:function(e,t,n){var i;return T((function(a){for(;;)switch(a.n){case 0:return i=`${this.baseURL}/${this.platformID}/`+e,a.n=1,l(yo(i,void 0,t,n));case 1:return a.a(2,a.v)}}),null,this,null,Promise)}},{key:"requestBodyAPI",value:function(e,t,n="POST",i=!1,a,r){var o,s;return T((function(u){for(;;)switch(u.n){case 0:return o=`${this.baseURL}/${this.platformID}/`+e,s={method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:i},u.n=1,l(yo(o,s,a,r));case 1:return u.a(2,u.v)}}),null,this,null,Promise)}}],[{key:"configure",value:function(e){this.instance.configure(e)}}])}();function Bs(e){return null!=(null==e?void 0:e.flow)}zs.instance=new zs,de([js],zs.prototype,"login",null),de([js],zs.prototype,"logout",null),de([js],zs.prototype,"startSession",null),de([js],zs.prototype,"postImpression",null),de([js],zs.prototype,"postConversion",null),de([js],zs.prototype,"purchaseValidation",null),de([Ns],zs.prototype,"fetchAPI",null),de([Ns],zs.prototype,"requestBodyAPI",null),function(e){e.DEFAULT="default",e.LABEL="label",e.UNKNOWN="unknown",e.URL="url"}($s||($s={}));var Hs=()=>{var e;return null!==(e=Qr.getPaywalls(st))&&void 0!==e?e:[]},Us=()=>{var e;return null!==(e=Qr.getPaywalls(Ye))&&void 0!==e?e:[]},Gs=()=>qr(zn([...Us(),...Hs()]),"id"),Vs=e=>Gs().find((t=>t.id===e)),Xs=e=>{var t=Gs(),n=new Set(t.map((e=>e.id)));return e.every((e=>n.has(e)))};function Ks(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ys,qs={exports:{}};var Js=(Ys||(Ys=1,qs.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var a=t[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(i,a,function(t){return e[t]}.bind(null,a));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}({17:function(e,t,n){t.__esModule=!0,t.default=void 0;var i=n(18),a=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,i){void 0===i&&(i=!1);var a=e.getVersionPrecision(t),r=e.getVersionPrecision(n),o=Math.max(a,r),s=0,u=e.map([t,n],(function(t){var n=o-e.getVersionPrecision(t),i=t+new Array(n+1).join(".0");return e.map(i.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(i&&(s=o-Math.min(a,r)),o-=1;o>=s;){if(u[0][o]>u[1][o])return 1;if(u[0][o]===u[1][o]){if(o===s)return 0;o-=1}else if(u[0][o]<u[1][o])return-1}},e.map=function(e,t){var n,i=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)i.push(t(e[n]));return i},e.find=function(e,t){var n,i;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,i=e.length;n<i;n+=1){var a=e[n];if(t(a,n))return a}},e.assign=function(e){for(var t,n,i=e,a=arguments.length,r=new Array(a>1?a-1:0),o=1;o<a;o++)r[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[e].concat(r));var s=function(){var e=r[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){i[t]=e[t]}))};for(t=0,n=r.length;t<n;t+=1)s();return e},e.getBrowserAlias=function(e){return i.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return i.BROWSER_MAP[e]||""},e}();t.default=a,e.exports=t.default},18:function(e,t,n){t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,n){t.__esModule=!0,t.default=void 0;var i,a=(i=n(91))&&i.__esModule?i:{default:i},r=n(18);function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var s=function(){function e(){}var t,n,i;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new a.default(e,t)},e.parse=function(e){return new a.default(e).getResult()},t=e,i=[{key:"BROWSER_MAP",get:function(){return r.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return r.ENGINE_MAP}},{key:"OS_MAP",get:function(){return r.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return r.PLATFORMS_MAP}}],(n=null)&&o(t.prototype,n),i&&o(t,i),e}();t.default=s,e.exports=t.default},91:function(e,t,n){t.__esModule=!0,t.default=void 0;var i=u(n(92)),a=u(n(93)),r=u(n(94)),o=u(n(95)),s=u(n(17));function u(e){return e&&e.__esModule?e:{default:e}}var l=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=s.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=s.default.find(a.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=s.default.find(r.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=s.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return s.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},i=0,a={},r=0;if(Object.keys(e).forEach((function(t){var o=e[t];"string"==typeof o?(a[t]=o,r+=1):"object"==typeof o&&(n[t]=o,i+=1)})),i>0){var o=Object.keys(n),u=s.default.find(o,(function(e){return t.isOS(e)}));if(u){var l=this.satisfies(n[u]);if(void 0!==l)return l}var d=s.default.find(o,(function(e){return t.isPlatform(e)}));if(d){var h=this.satisfies(n[d]);if(void 0!==h)return h}}if(r>0){var c=Object.keys(a),m=s.default.find(c,(function(e){return t.isBrowser(e,!0)}));if(void 0!==m)return this.compareVersion(a[m])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),i=e.toLowerCase(),a=s.default.getBrowserTypeByAlias(i);return t&&a&&(i=a.toLowerCase()),i===n},t.compareVersion=function(e){var t=[0],n=e,i=!1,a=this.getBrowserVersion();if("string"==typeof a)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(i=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(i=!0,n=e.substr(1)),t.indexOf(s.default.compareVersions(a,n,i))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=l,e.exports=t.default},92:function(e,t,n){t.__esModule=!0,t.default=void 0;var i,a=(i=n(17))&&i.__esModule?i:{default:i},r=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=a.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=a.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=a.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=a.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=a.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=a.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=a.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=a.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=a.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=a.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=a.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=a.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=a.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=a.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=a.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=a.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=a.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=a.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=a.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=a.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=a.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=a.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=a.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=a.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=a.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=a.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=a.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:a.default.getFirstMatch(t,e),version:a.default.getSecondMatch(t,e)}}}];t.default=o,e.exports=t.default},93:function(e,t,n){t.__esModule=!0,t.default=void 0;var i,a=(i=n(17))&&i.__esModule?i:{default:i},r=n(18),o=[{test:[/Roku\/DVP/],describe:function(e){var t=a.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:r.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=a.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=a.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=a.default.getWindowsVersionName(t);return{name:r.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:r.OS_MAP.iOS},n=a.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=a.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=a.default.getMacOSVersionName(t),i={name:r.OS_MAP.MacOS,version:t};return n&&(i.versionName=n),i}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=a.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:r.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=a.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=a.default.getAndroidVersionName(t),i={name:r.OS_MAP.Android,version:t};return n&&(i.versionName=n),i}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=a.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:r.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=a.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||a.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||a.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:r.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=a.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=a.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:r.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:r.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=a.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.PlayStation4,version:t}}}];t.default=o,e.exports=t.default},94:function(e,t,n){t.__esModule=!0,t.default=void 0;var i,a=(i=n(17))&&i.__esModule?i:{default:i},r=n(18),o=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=a.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:r.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=a.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:r.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:r.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:r.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:r.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:r.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.tv}}}];t.default=o,e.exports=t.default},95:function(e,t,n){t.__esModule=!0,t.default=void 0;var i,a=(i=n(17))&&i.__esModule?i:{default:i},r=n(18),o=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:r.ENGINE_MAP.Blink};var t=a.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:r.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:r.ENGINE_MAP.Trident},n=a.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:r.ENGINE_MAP.Presto},n=a.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:r.ENGINE_MAP.Gecko},n=a.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:r.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:r.ENGINE_MAP.WebKit},n=a.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=o,e.exports=t.default}})),qs.exports),Qs=Ks(Js),Zs="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},eu="function"==typeof Zs.BigInt,tu=eu?Zs.BigInt.bind(Zs):void 0,nu=eu?tu("0xffffffffffffffffffffffffffffffff"):null,iu=eu?tu("0x100000000000000000000000000000000"):null,au=eu?tu(0):null,ru=eu?tu(1):null,ou=eu?tu(8):null,su=eu?tu(1e4):null,uu=16,lu=1/uu,du={tablet:"tablet",mobile:"phone",tv:"television",desktop:"desktop"},hu=e=>{if("undefined"==typeof window)return{os_version:"X.X.X",os_name:"Server",browser_name:"Unknown",browser_version:"X.X.X",sdk_client:"web",sdk_version:ge,language:"en"};var t=Qs.getParser(window.navigator.userAgent),n=t.getPlatform(),i={os_version:t.getOSVersion(),os_name:t.getOSName(),browser_name:t.getBrowserName(),browser_version:t.getBrowserVersion(),sdk_client:"web",sdk_version:ge,language:window.navigator.language};if(n.type&&(i.form_factor=du[n.type]),n.model&&(i.device_model=n.model),e&&e.length>0){var a=(e=>{var t=e.find((e=>e.includes(Kt))),n={platform:"",version:""};if(t){var i=t.split(qt);n.platform=i[1],n.version=i[2]}return n})(e);i.extended_platform=a.platform,i.extended_platform_version=a.version}return i},cu=()=>{var e=Qr.getNamiConfig();if(e&&e.formFactor)return e.formFactor;if("undefined"==typeof window)return du.desktop;var t=Qs.getParser(window.navigator.userAgent).getPlatform();return t.type?du[t.type]:du.desktop},mu={"1280x720":.67,"1920x1080":1,"3840x2160":2,"7680x4320":4};var fu=()=>{var e=window,t=e.innerWidth,n=e.innerHeight;return Math.min(t/1920,n/1080)||1};function vu(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function pu(e){if(!eu||!nu)return bu(e);try{var t=nu,n=function(e){if(!tu)throw new Error("BigInt is not supported in this environment");var t=e.replace(/-/g,"");return tu("0x"+t)}(e);return Number(n)/Number(t)*100}catch(t){throw $n.error(`Error calculating audience split position for UUID ${e}`,t),new Error(`Invalid UUID format: ${e}`)}}function gu(e){if(!tu)throw new Error("BigInt is not supported in this environment");var t=e.toString(16).padStart(32,"0");t=t.substring(0,12)+"4"+t.substring(13);var n=3&parseInt(t[16],16)|8;return(t=t.substring(0,16)+n.toString(16)+t.substring(17)).slice(0,8)+"-"+t.slice(8,12)+"-"+t.slice(12,16)+"-"+t.slice(16,20)+"-"+t.slice(20)}function yu(e,t=.5){if(!Number.isFinite(e))throw new Error("Invalid target");if(!Number.isFinite(t))throw new Error("Invalid tolerance");var n=Math.max(0,Math.min(100,e)),i=Math.max(0,Math.min(50,t)),a=e=>Math.round(100*e),r=Math.max(0,a(n-i)),o=Math.min(1e4,a(n+i));if(!(eu&&nu&&tu&&su))return function(e,t){for(var n=Math.max(0,Math.min(100,e-t)),i=Math.min(100,Math.max(0,e+t)),a=vu(),r=Number.POSITIVE_INFINITY,o=50,s=0;s<o;s++){var u=vu(),l=bu(u);if(l>=n&&l<=i)return u;var d=wu(l,n,i);d<r&&(r=d,a=u)}return a}(n,i);var s=nu,u=tu,l=su,d=e=>s*u(e)/l,h=d(r),c=d(o);if(c<=h)return gu(h);var m=h+function(e){if(!tu||null===iu||null===ru||null===au||null===ou)throw new Error("BigInt is not supported in this environment");var t=tu,n=au,i=ru,a=ou,r=iu;if(e<n)throw new Error("n must be non-negative");if(e===n)return n;for(var o=new Uint8Array(16),s=e+i,u=r/s*s-i,l=0;l<10;){crypto.getRandomValues(o);for(var d,h=n,c=g(o);!(d=c()).done;)h=h<<a|t(d.value);if(h<=u)return h%s;l++}try{crypto.getRandomValues(o);for(var m,f=n,v=g(o);!(m=v()).done;)f=f<<a|t(m.value);var p=f%s;return $n.warn("randomBigInt: reached max rejection attempts, using modulo fallback",{n:e.toString(),attempts:l}),p}catch(e){throw $n.error("randomBigInt: failed to generate random values",e),new Error("randomBigInt: unable to generate random value")}}(c-h);return gu(m)}function bu(e){var t=function(e){var t=e.replace(/-/g,"").toLowerCase();if(!/^[0-9a-f]{32}$/.test(t))throw new Error(`Invalid UUID format: ${e}`);for(var n=0,i=t.length-1;i>=0;i--){n=(n+parseInt(t[i],uu))*lu}return n}(e);return 100*t}function wu(e,t,n){return e<t?t-e:e>n?e-n:0}var ku,Su=e=>{try{return Boolean(new URL(e))}catch(e){return!1}},Eu=(e,t,n)=>e?e.flatMap((e=>{var i;if(i="string"==typeof n?e.segments.filter((e=>e.form_factors.some((e=>e.form_factor===n)))):e.segments,0===i.length)return[];var a=((e,t)=>{for(var n,i=[...e].sort(((e,t)=>e.split-t.split)),a=g(i);!(n=a()).done;){var r=n.value;if(t<=r.split)return r}return i[i.length-1]})(i,t);return{form_factors:a.form_factors,paywall:a.paywall,flow:a.flow,segment:a.segment,split:a.split,conversion_event_type:a.conversion_event_type,conversion_event_url:a.conversion_event_url,rule:e.rule,name:e.name,type:e.type,value:e.value,external_segment:e.external_segment}})):[],Mu=()=>{var e,t,n=null!==(e=Qr.getCampaignRules(Xe))&&void 0!==e?e:[],i=null!==(t=Qr.getCampaignRules(rt))&&void 0!==t?t:[],a=cu(),r=zn([...n,...i]).filter((e=>{var t;return null===(t=e.form_factors)||void 0===t?void 0:t.some((e=>e.form_factor===a))}));return qr(r,"rule")},Pu=e=>{var t,n=null!==(t=Qr.getCampaignRules(e))&&void 0!==t?t:[],i=cu();return zn(n).filter((e=>{var t;return null===(t=e.form_factors)||void 0===t?void 0:t.some((e=>e.form_factor===i))}))},Tu=()=>Pu(rt),_u=()=>Pu(Xe),Du=(e,t,n,i)=>{var a=e().find((e=>i?e.type==i&&e.value==n:e.type==$s.DEFAULT));if(!a)return{};var r=t().find((e=>(null==a?void 0:a.paywall)===e.id));return{campaign:a,paywall:r}},Au=(e,t)=>{var n=Du(_u,Us,e,t);if(n.campaign&&n.paywall)return{campaign:n.campaign,paywall:n.paywall};var i=Du(Tu,Hs,e,t);return i.campaign&&i.paywall?{campaign:i.campaign,paywall:i.paywall}:n.campaign||n.paywall?{campaign:n.campaign,paywall:n.paywall}:{campaign:i.campaign,paywall:i.paywall}},xu="object"==typeof Reflect?Reflect:null,Cu=xu&&"function"==typeof xu.apply?xu.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};ku=xu&&"function"==typeof xu.ownKeys?xu.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var Iu=Number.isNaN||function(e){return e!=e};function Lu(){Lu.init.call(this)}Lu.EventEmitter=Lu,Lu.prototype._events=void 0,Lu.prototype._eventsCount=0,Lu.prototype._maxListeners=void 0;var Fu=10;function Ru(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function Wu(e){return void 0===e._maxListeners?Lu.defaultMaxListeners:e._maxListeners}function Ou(e,t,n,i){var a,r,o,s;if(Ru(n),void 0===(r=e._events)?(r=e._events=Object.create(null),e._eventsCount=0):(void 0!==r.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),r=e._events),o=r[t]),void 0===o)o=r[t]=n,++e._eventsCount;else if("function"==typeof o?o=r[t]=i?[n,o]:[o,n]:i?o.unshift(n):o.push(n),(a=Wu(e))>0&&o.length>a&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return e}function Nu(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function ju(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=Nu.bind(i);return a.listener=n,i.wrapFn=a,a}function $u(e,t,n){var i=e._events;if(void 0===i)return[];var a=i[t];return void 0===a?[]:"function"==typeof a?n?[a.listener||a]:[a]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(a):Bu(a,a.length)}function zu(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function Bu(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e[i];return n}Object.defineProperty(Lu,"defaultMaxListeners",{enumerable:!0,get:function(){return Fu},set:function(e){if("number"!=typeof e||e<0||Iu(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Fu=e}}),Lu.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Lu.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||Iu(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},Lu.prototype.getMaxListeners=function(){return Wu(this)},Lu.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,a=this._events;if(void 0!==a)i=i&&void 0===a.error;else if(!i)return!1;if(i){var r;if(t.length>0&&(r=t[0]),r instanceof Error)throw r;var o=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw o.context=r,o}var s=a[e];if(void 0===s)return!1;if("function"==typeof s)Cu(s,this,t);else for(var u=s.length,l=Bu(s,u),d=0;d<u;++d)Cu(l[d],this,t);return!0},Lu.prototype.addListener=function(e,t){return Ou(this,e,t,!1)},Lu.prototype.on=Lu.prototype.addListener,Lu.prototype.prependListener=function(e,t){return Ou(this,e,t,!0)},Lu.prototype.once=function(e,t){return Ru(t),this.on(e,ju(this,e,t)),this},Lu.prototype.prependOnceListener=function(e,t){return Ru(t),this.prependListener(e,ju(this,e,t)),this},Lu.prototype.removeListener=function(e,t){var n,i,a,r,o;if(Ru(t),void 0===(i=this._events))return this;if(void 0===(n=i[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(a=-1,r=n.length-1;r>=0;r--)if(n[r]===t||n[r].listener===t){o=n[r].listener,a=r;break}if(a<0)return this;0===a?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,a),1===n.length&&(i[e]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",e,o||t)}return this},Lu.prototype.off=Lu.prototype.removeListener,Lu.prototype.removeAllListeners=function(e){var t,n,i;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var a,r=Object.keys(n);for(i=0;i<r.length;++i)"removeListener"!==(a=r[i])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},Lu.prototype.listeners=function(e){return $u(this,e,!0)},Lu.prototype.rawListeners=function(e){return $u(this,e,!1)},Lu.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):zu.call(e,t)},Lu.prototype.listenerCount=zu,Lu.prototype.eventNames=function(){return this._eventsCount>0?ku(this._events):[]};var Hu=function(){function e(){h(this,e),this.emitter=new Lu}return p(e,[{key:"on",value:function(e,t){this.emitter.on(e,t)}},{key:"off",value:function(e,t){this.emitter.off(e,t)}},{key:"emit",value:function(e,...t){this.emitter.emit(e,...t)}},{key:"addListener",value:function(e,t){this.emitter.addListener(e,t)}},{key:"removeListener",value:function(e,t){this.emitter.removeListener(e,t)}},{key:"removeAllListeners",value:function(e){e?this.emitter.removeAllListeners(e):this.emitter.removeAllListeners()}},{key:"listeners",value:function(e){return this.emitter.listeners(e)}},{key:"listenerCount",value:function(e){return this.emitter.listenerCount(e)}}],[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}])}(),Uu=function(){return p((function e(){h(this,e),this.disableCampaignUpdates=!1,this.currentFormFactor=cu()}),[{key:"configure",value:function(e,t,n=[]){this.currentFormFactor=e,this.splitPosition=t,this.disableCampaignUpdates=n.includes("disableCampaignUpdates")}},{key:"fetchCampaignRules",value:function(e){var t,n,i,a;return T((function(r){for(;;)switch(r.n){case 0:if(i=Qr.getDevice(),!this.disableCampaignUpdates){r.n=1;break}return $n.info("Campaign updates disabled by configuration. Skipping fetch."),r.a(2,[]);case 1:if(null!=i&&i.id){r.n=3;break}return r.n=2,l(this.getAnonymousCampaigns());case 2:a=r.v,r.n=5;break;case 3:return r.n=4,l(this.getCampaigns(i.id));case 4:a=r.v;case 5:return a=null===(t=a)||void 0===t?void 0:t.filter((e=>{var t;return e.paywall&&e.form_factors.some((e=>e.form_factor===this.currentFormFactor))||e.flow&&(null===(t=e.flow)||void 0===t||null===(t=t.object)||void 0===t||null===(t=t.form_factors)||void 0===t?void 0:t.some((e=>e.form_factor===this.currentFormFactor)))})),a=null===(n=a)||void 0===n?void 0:n.filter((t=>{if(t.paywall){var n=e.find((e=>e.id==t.paywall));if(n)return t}else if(t.flow)return t})),Qr.setCampaignRules(Xe,a),this.invokeAvailableCampaignsResponseHandler(),r.a(2,a)}}),null,this,null,Promise)}},{key:"invokeAvailableCampaignsResponseHandler",value:function(){var e=Hu.getInstance().listeners(En),t=Mu();e.forEach((e=>e(t)))}},{key:"getAnonymousCampaigns",value:function(e=ge){var t,n,i,a,r;return T((function(o){for(;;)switch(o.p=o.n){case 0:return t=`campaign_rules/?sdk_version=${e}`,o.p=1,o.n=2,l(zs.instance.fetchAPI(t));case 2:return i=o.v,o.a(2,Eu(null!==(n=i.results)&&void 0!==n?n:[],this.splitPosition,this.currentFormFactor));case 3:if(o.p=3,r=o.v,a=this.fallbackData()){o.n=4;break}throw $n.error(go(r.status,t)),r;case 4:return o.a(2,a.results)}}),null,this,[[1,3]],Promise)}},{key:"getCampaigns",value:function(e){var t,n,i,a;return T((function(r){for(;;)switch(r.p=r.n){case 0:return n=`device/${e}/campaign_rules/`,r.p=1,r.n=2,l(zs.instance.fetchAPI(n));case 2:i=r.v,r.n=4;break;case 3:if(r.p=3,a=r.v,i=this.fallbackData()){r.n=4;break}throw $n.error(go(a.status,n)),a;case 4:return r.a(2,(null===(t=i)||void 0===t?void 0:t.results)||[])}}),null,this,[[1,3]],Promise)}},{key:"fallbackData",value:function(){var e=Qr.getCampaignRules(Xe)||Qr.getCampaignRules(rt);return e?{count:e.length,results:e}:null}}])}();function Gu(e,t){return hr(e,t)}Uu.instance=new Uu;var Vu=function(){return p((function e(){h(this,e)}),[{key:"createOrUpdateDevice",value:function(e,t,n){var i=Qr.getDevice();if(null==i||!i.id){var a,r=y({},e,{id:null!==(a=null!=t?t:this.getAnonymousUUID())&&void 0!==a?a:vu()});return{id:r.id,device:this.createDevice(r,n)}}return this.isEqualDevices(i,e)?{id:i.id,device:Promise.resolve(i)}:{id:i.id,device:this.updateDevice(i.id,e)}}},{key:"createDevice",value:function(e,t){var n,i;return T((function(a){for(;;)switch(a.p=a.n){case 0:return a.p=0,a.n=1,l(this.requestAPIData("device/",e,void 0,void 0,0));case 1:if(!(n=a.v)){a.n=2;break}Qr.setDevice(n),a.n=3;break;case 2:return $n.info("Device creation returned null, switching to anon mode for this session"),null==t||t.setInMemoryAnonymousMode(!0),a.a(2,null);case 3:return a.a(2,n);case 4:if(a.p=4,i=a.v,console.error("Error creating device:",i),!(i instanceof Zr)){a.n=5;break}return $n.info("Retry limit exceeded, switching to anon mode for this session"),null==t||t.setInMemoryAnonymousMode(!0),a.a(2,null);case 5:throw i;case 6:return a.a(2)}}),null,this,[[0,4]],Promise)}},{key:"updateDevice",value:function(e,t){var n;return T((function(i){for(;;)switch(i.n){case 0:return i.n=1,l(this.requestAPIData(`device/${e}/`,t,"PUT"));case 1:return(n=i.v)&&Qr.setDevice(n),i.a(2,n)}}),null,this,null,Promise)}},{key:"updateDeviceField",value:function(e,t){var n,i,a;return T((function(r){for(;;)switch(r.n){case 0:if(n={[e]:t},null!=(i=Qr.getDevice())&&i.id){r.n=1;break}throw new ao;case 1:return r.n=2,l(this.requestAPIData(`device/${i.id}/`,n,"PATCH"));case 2:return(a=r.v)&&Qr.setDevice(a),r.a(2,a)}}),null,this,null,Promise)}},{key:"requestAPIData",value:function(e,t,n="POST",i=sn,a){var r,o;return T((function(s){for(;;)switch(s.p=s.n){case 0:return s.p=0,s.n=1,l(zs.instance.requestBodyAPI(e,t,n,!1,i,a));case 1:r=s.v,s.n=5;break;case 2:if(s.p=2,!((o=s.v)instanceof io)){s.n=3;break}throw o;case 3:if(!("device/"===e&&o instanceof Zr)){s.n=4;break}throw o;case 4:if(r=Qr.getDevice()){s.n=5;break}return $n.error(go(o.status,e)),s.a(2,null);case 5:return s.a(2,r)}}),null,null,[[0,2]],Promise)}},{key:"isEqualDevices",value:function(e,t){var n=y({},e,t);return Gu(Object.keys(e).reduce(((e,t)=>(e[t]=n[t],e)),{}),e)}},{key:"getOrCreateAnonymousUUID",value:function(){var e=Qr.getAnonymousUUID();return e||(e=vu(),Qr.setAnonymousUUID(e)),e}},{key:"getAnonymousUUID",value:function(){var e=Qr.getAnonymousUUID();return e?(Qr.clearAnonymousUUID(),e):null}}])}();Vu.instance=new Vu;var Xu=function(){return p((function e(){h(this,e)}),[{key:"fetchProducts",value:function(){var e,t,n,i;return T((function(a){for(;;)switch(a.p=a.n){case 0:if(!Rs(me.THIRD_PARTY_TRANSACTIONS)){a.n=1;break}return a.a(2,[]);case 1:return a.p=1,a.n=2,l(zs.instance.fetchAPI("products/"));case 2:n=a.v,a.n=4;break;case 3:if(a.p=3,i=a.v,n=this.fallbackData()){a.n=4;break}throw $n.error(go(i.status,"products/")),i;case 4:return null!==(e=n)&&void 0!==e&&e.results&&Qr.setProducts(Je,n.results),a.a(2,(null===(t=n)||void 0===t?void 0:t.results)||[])}}),null,this,[[1,3]],Promise)}},{key:"fallbackData",value:function(){var e=Qr.getProducts(Je)||Qr.getProducts(lt);return e?{count:e.length,results:e}:null}}])}();Xu.instance=new Xu;var Ku=function(){return p((function e(){h(this,e)}),[{key:"fetchPaywalls",value:function(){var e,t;return T((function(n){for(;;)switch(n.n){case 0:if(null!=(e=Qr.getDevice())&&e.id){n.n=2;break}return n.n=1,l(this.getAnonymousPaywalls());case 1:t=n.v,n.n=4;break;case 2:return n.n=3,l(this.getPaywalls(e.id));case 3:t=n.v;case 4:return t&&Qr.setPaywalls(Ye,t),n.a(2,t)}}),null,this,null,Promise)}},{key:"getAnonymousPaywalls",value:function(e=ge){var t,n,i,a;return T((function(r){for(;;)switch(r.p=r.n){case 0:return n=`paywalls/?sdk_version=${e}`,i=null,r.p=1,r.n=2,l(zs.instance.fetchAPI(n));case 2:i=r.v,r.n=4;break;case 3:if(r.p=3,a=r.v,i=this.fallbackData()){r.n=4;break}throw $n.error(go(a.status,n)),a;case 4:return r.a(2,(null===(t=i)||void 0===t?void 0:t.results)||[])}}),null,this,[[1,3]],Promise)}},{key:"getPaywalls",value:function(e){var t,n,i,a;return T((function(r){for(;;)switch(r.p=r.n){case 0:return n=`device/${e}/paywalls/`,r.p=1,r.n=2,l(zs.instance.fetchAPI(n));case 2:i=r.v,r.n=4;break;case 3:if(r.p=3,a=r.v,i=this.fallbackData()){r.n=4;break}throw $n.error(go(a.status,n)),a;case 4:return r.a(2,(null===(t=i)||void 0===t?void 0:t.results)||[])}}),null,this,[[1,3]],Promise)}},{key:"fallbackData",value:function(){var e=Qr.getPaywalls(Ye)||Qr.getPaywalls(st);return e?{count:e.length,results:e}:null}}])}();Ku.instance=new Ku;var Yu=function(){return p((function e(){h(this,e)}),[{key:"fetchConfig",value:function(){var e,t;return T((function(n){for(;;)switch(n.p=n.n){case 0:return n.p=0,n.n=1,l(zs.instance.fetchAPI("config/"));case 1:e=n.v,n.n=3;break;case 2:if(n.p=2,t=n.v,e=Qr.getAppConfig(Ge)||Qr.getAppConfig(it)){n.n=3;break}throw $n.error(go(t.status,"config/")),t;case 3:return e&&Qr.setAppConfig(Ge,e),n.a(2,e)}}),null,null,[[0,2]],Promise)}}])}();Yu.instance=new Yu;var qu=null;function Ju(){return!!Qr.getAnonymousMode()||!!qu&&qu.isInMemoryAnonymousMode()}var Qu=function(){return p((function e(){h(this,e)}),[{key:"startSession",value:function(){var e;return T((function(t){for(;;)switch(t.p=t.n){case 0:if(!Ju()){t.n=1;break}return $n.debug("Skipping session start call - anonymous mode"),t.a(2);case 1:return t.p=1,t.n=2,l(zs.instance.startSession(new Date));case 2:t.n=4;break;case 3:t.p=3,e=t.v,$n.error("error on start session: ",e);case 4:return t.a(2)}}),null,null,[[1,3]],Promise)}}])}();Qu.instance=new Qu;var Zu=function(){return p((function e(){h(this,e)}),null,[{key:"allPurchases",value:function(){return[]}}])}();Zu.instance=new Zu;var el={en:{nami_day:"day",nami_day_plural:"days",nami_week:"week",nami_week_plural:"weeks",nami_month:"month",nami_month_plural:"months",nami_year:"year",nami_year_plural:"years",nami_day_abbrev:"day",nami_day_abbrev_plural:"days",nami_week_abbrev:"wk",nami_week_abbrev_plural:"wks",nami_month_abbrev:"mo",nami_month_abbrev_plural:"mos",nami_year_abbrev:"yr",nami_year_abbrev_plural:"yrs",nami_daily:"daily",nami_weekly:"weekly",nami_biweekly:"bi-weekly",nami_monthly:"monthly",nami_bimonthly:"bi-monthly",nami_quarterly:"quarterly",nami_biannually:"bi-annually",nami_yearly:"yearly"},af:{nami_day_abbrev:"dag",nami_day_abbrev_plural:"dae",nami_week_abbrev:"week",nami_week_abbrev_plural:"weke",nami_month_abbrev:"ma",nami_month_abbrev_plural:"maande",nami_year_abbrev:"jr",nami_year_abbrev_plural:"jare",nami_daily:"daagliks",nami_weekly:"weekliks",nami_biweekly:"tweeweekliks",nami_monthly:"maandeliks",nami_bimonthly:"tweemaandeliks",nami_quarterly:"kwartaalliks",nami_biannually:"tweejaarliks",nami_yearly:"jaarliks"},am:{nami_day_abbrev:"ቀን",nami_day_abbrev_plural:"ቀናት",nami_week_abbrev:"ሳምንት",nami_week_abbrev_plural:"ሳምንታት",nami_month_abbrev:"ወር",nami_month_abbrev_plural:"ሞስ",nami_year_abbrev:"ዓመት",nami_year_abbrev_plural:"ዓመታት",nami_daily:"በየቀኑ",nami_weekly:"ሳምንታዊ",nami_biweekly:"በየሁለት ሳምንቱ",nami_monthly:"ወርሃዊ",nami_bimonthly:"በየሁለት ወሩ",nami_quarterly:"በየሩብ ዓመቱ",nami_biannually:"በየሁለት ዓመቱ",nami_yearly:"ዓመታዊ"},ar:{nami_day_abbrev:"يوم",nami_day_abbrev_plural:"أيام",nami_week_abbrev:"أسبوع",nami_week_abbrev_plural:"أسابيع",nami_month_abbrev:"شهر",nami_month_abbrev_plural:"موس",nami_year_abbrev:"سنة",nami_year_abbrev_plural:"سنوات",nami_daily:"يوميًا",nami_weekly:"أسبوعي",nami_biweekly:"كل أسبوعين",nami_monthly:"شهريا",nami_bimonthly:"كل شهرين",nami_quarterly:"ربع سنوي",nami_biannually:"مرتين في السنة",nami_yearly:"سنوي"},bg:{nami_day_abbrev:"ден",nami_day_abbrev_plural:"дни",nami_week_abbrev:"седмица",nami_week_abbrev_plural:"седмици",nami_month_abbrev:"мо",nami_month_abbrev_plural:"мос",nami_year_abbrev:"год.",nami_year_abbrev_plural:"години",nami_daily:"ежедневно",nami_weekly:"седмично",nami_biweekly:"двуседмичен",nami_monthly:"месечно",nami_bimonthly:"двумесечно",nami_quarterly:"тримесечно",nami_biannually:"два пъти годишно",nami_yearly:"годишно"},ca:{nami_day_abbrev:"dia",nami_day_abbrev_plural:"dies",nami_week_abbrev:"setmana",nami_week_abbrev_plural:"setmanes",nami_month_abbrev:"mes",nami_month_abbrev_plural:"mesos",nami_year_abbrev:"any",nami_year_abbrev_plural:"anys",nami_daily:"diàriament",nami_weekly:"setmanal",nami_biweekly:"quinzenal",nami_monthly:"mensual",nami_bimonthly:"bimensual",nami_quarterly:"trimestral",nami_biannually:"bianualment",nami_yearly:"anual"},cs:{nami_day_abbrev:"den",nami_day_abbrev_plural:"dny",nami_week_abbrev:"týden",nami_week_abbrev_plural:"týdny",nami_month_abbrev:"měsíc",nami_month_abbrev_plural:"měsíce",nami_year_abbrev:"rok",nami_year_abbrev_plural:"roky",nami_daily:"denní",nami_weekly:"týdně",nami_biweekly:"dvoutýdenní",nami_monthly:"měsíční",nami_bimonthly:"dvouměsíčník",nami_quarterly:"čtvrtletní",nami_biannually:"pololetně",nami_yearly:"roční"},de:{nami_day_abbrev:"Tag",nami_day_abbrev_plural:"Tage",nami_week_abbrev:"Woche",nami_week_abbrev_plural:"Wochen",nami_month_abbrev:"Monat",nami_month_abbrev_plural:"Monate",nami_year_abbrev:"Jahr",nami_year_abbrev_plural:"Jahre",nami_daily:"täglich",nami_weekly:"wöchentlich",nami_biweekly:"zweiwöchentlich",nami_monthly:"monatlich",nami_bimonthly:"zweimonatlich",nami_quarterly:"vierteljährlich",nami_biannually:"halbjährlich",nami_yearly:"jährlich"},el:{nami_day_abbrev:"ημέρα",nami_day_abbrev_plural:"ημέρες",nami_week_abbrev:"εβδομάδα",nami_week_abbrev_plural:"εβδομάδες",nami_month_abbrev:"μήνα",nami_month_abbrev_plural:"μην",nami_year_abbrev:"έτος",nami_year_abbrev_plural:"χρόνια",nami_daily:"καθημερινά",nami_weekly:"εβδομαδιαίος",nami_biweekly:"ανά δύο εβδομάδες",nami_monthly:"μηνιαίος",nami_bimonthly:"διμηνιαίος",nami_quarterly:"τριμηνιαίος",nami_biannually:"ανά εξάμηνο",nami_yearly:"ετήσια"},es:{nami_day_abbrev:"día",nami_day_abbrev_plural:"días",nami_week_abbrev:"semana",nami_week_abbrev_plural:"semanas",nami_month_abbrev:"mes",nami_month_abbrev_plural:"meses",nami_year_abbrev:"año",nami_year_abbrev_plural:"años",nami_daily:"diario",nami_weekly:"semanal",nami_biweekly:"quincenal",nami_monthly:"mensual",nami_bimonthly:"bimensual",nami_quarterly:"trimestral",nami_biannually:"semestral",nami_yearly:"anual"},et:{nami_day_abbrev:"päev",nami_day_abbrev_plural:"päevad",nami_week_abbrev:"nädal",nami_week_abbrev_plural:"nädalat",nami_month_abbrev:"kuu",nami_month_abbrev_plural:"kuud",nami_year_abbrev:"aasta",nami_year_abbrev_plural:"aastat",nami_daily:"iga päev",nami_weekly:"iganädalane",nami_biweekly:"iga kahe nädala tagant",nami_monthly:"igakuine",nami_bimonthly:"kaks korda kuus",nami_quarterly:"kvartali",nami_biannually:"kaks korda aastas",nami_yearly:"iga-aastane"},fa:{nami_day_abbrev:"روز",nami_day_abbrev_plural:"روزها",nami_week_abbrev:"هفته",nami_week_abbrev_plural:"هفتهها",nami_month_abbrev:"مو",nami_month_abbrev_plural:"موش",nami_year_abbrev:"سال",nami_year_abbrev_plural:"سال",nami_daily:"روزانه",nami_weekly:"هفتگی",nami_biweekly:"دو هفتهای",nami_monthly:"ماهانه",nami_bimonthly:"دوماهه",nami_quarterly:"سه ماهه",nami_biannually:"دوسالانه",nami_yearly:"سالانه"},fi:{nami_day_abbrev:"päivä",nami_day_abbrev_plural:"päivää",nami_week_abbrev:"viikko",nami_week_abbrev_plural:"viikkoa",nami_month_abbrev:"kuukausi",nami_month_abbrev_plural:"kuukaudet",nami_year_abbrev:"vuosi",nami_year_abbrev_plural:"vuotta",nami_daily:"päivittäin",nami_weekly:"viikoittain",nami_biweekly:"joka toinen viikko",nami_monthly:"kuukausittain",nami_bimonthly:"kahdesti kuussa",nami_quarterly:"neljännesvuosittain",nami_biannually:"puolivuosittain",nami_yearly:"vuosittain"},fr:{nami_day_abbrev:"jour",nami_day_abbrev_plural:"jours",nami_week_abbrev:"semaine",nami_week_abbrev_plural:"semaines",nami_month_abbrev:"mois",nami_month_abbrev_plural:"mois",nami_year_abbrev:"année",nami_year_abbrev_plural:"ans",nami_daily:"tous les jours",nami_weekly:"hebdomadaire",nami_biweekly:"bihebdomadaire",nami_monthly:"mensuel",nami_bimonthly:"bimensuel",nami_quarterly:"trimestriel",nami_biannually:"bisannuel",nami_yearly:"annuel"},hi:{nami_day_abbrev:"दिन",nami_day_abbrev_plural:"दिन",nami_week_abbrev:"सप्त",nami_week_abbrev_plural:"सप्त",nami_month_abbrev:"महीना",nami_month_abbrev_plural:"महीने",nami_year_abbrev:"साल",nami_year_abbrev_plural:"वर्षीय",nami_daily:"दैनिक",nami_weekly:"साप्ताहिक",nami_biweekly:"द्वि-साप्ताहिक",nami_monthly:"महीने के",nami_bimonthly:"द्विमासिक",nami_quarterly:"त्रैमासिक",nami_biannually:"द्वि-वार्षिक रूप",nami_yearly:"वार्षिक"},hr:{nami_day_abbrev:"dan",nami_day_abbrev_plural:"dana",nami_week_abbrev:"tjedan",nami_week_abbrev_plural:"tjedni",nami_month_abbrev:"mjesec",nami_month_abbrev_plural:"mjeseca",nami_year_abbrev:"god.",nami_year_abbrev_plural:"godina",nami_daily:"dnevno",nami_weekly:"tjedno",nami_biweekly:"dvotjedno",nami_monthly:"mjesečno",nami_bimonthly:"dvomjesečno",nami_quarterly:"tromjesečno",nami_biannually:"dvogodišnje",nami_yearly:"godišnje"},hu:{nami_day_abbrev:"nap",nami_day_abbrev_plural:"napok",nami_week_abbrev:"hét",nami_week_abbrev_plural:"hetek",nami_month_abbrev:"hónap",nami_month_abbrev_plural:"hónap",nami_year_abbrev:"év",nami_year_abbrev_plural:"év",nami_daily:"napi",nami_weekly:"heti",nami_biweekly:"kéthetente",nami_monthly:"havi",nami_bimonthly:"kéthavonta",nami_quarterly:"negyedévenként",nami_biannually:"félévente",nami_yearly:"évi"},id:{nami_day_abbrev:"hari",nami_day_abbrev_plural:"hari",nami_week_abbrev:"minggu",nami_week_abbrev_plural:"minggu",nami_month_abbrev:"bulan",nami_month_abbrev_plural:"bulan",nami_year_abbrev:"tahun",nami_year_abbrev_plural:"tahun",nami_daily:"sehari-hari",nami_weekly:"mingguan",nami_biweekly:"dua kali seminggu",nami_monthly:"bulanan",nami_bimonthly:"dua bulanan",nami_quarterly:"triwulanan",nami_biannually:"dua tahunan",nami_yearly:"tahunan"},it:{nami_day_abbrev:"giorno",nami_day_abbrev_plural:"giorni",nami_week_abbrev:"settimana",nami_week_abbrev_plural:"settimane",nami_month_abbrev:"mese",nami_month_abbrev_plural:"mesi",nami_year_abbrev:"anno",nami_year_abbrev_plural:"anni",nami_daily:"quotidiano",nami_weekly:"settimanale",nami_biweekly:"bisettimanale",nami_monthly:"mensile",nami_bimonthly:"bimestrale",nami_quarterly:"trimestrale",nami_biannually:"semestralmente",nami_yearly:"annuale"},he:{nami_day_abbrev:"יְוֹם",nami_day_abbrev_plural:"ימים",nami_week_abbrev:"שבוע",nami_week_abbrev_plural:"שבועות",nami_month_abbrev:"מו",nami_month_abbrev_plural:"מוֹס",nami_year_abbrev:"שנה",nami_year_abbrev_plural:"שנים",nami_daily:"יוֹמִי",nami_weekly:"שְׁבוּעִי",nami_biweekly:"דו-שבועי",nami_monthly:"יַרחוֹן",nami_bimonthly:"דו-חודשי",nami_quarterly:"רִבעוֹן",nami_biannually:"דו-שנתי",nami_yearly:"שְׁנָתִי"},ja:{nami_day_abbrev:"日",nami_day_abbrev_plural:"日",nami_week_abbrev:"週",nami_week_abbrev_plural:"週",nami_month_abbrev:"モ",nami_month_abbrev_plural:"モス",nami_year_abbrev:"年",nami_year_abbrev_plural:"年",nami_daily:"毎日",nami_weekly:"毎週",nami_biweekly:"隔週",nami_monthly:"毎月",nami_bimonthly:"隔月",nami_quarterly:"四半期ごと",nami_biannually:"半年ごと",nami_yearly:"毎年"},ko:{nami_day_abbrev:"낮",nami_day_abbrev_plural:"날",nami_week_abbrev:"주",nami_week_abbrev_plural:"주",nami_month_abbrev:"모",nami_month_abbrev_plural:"모스",nami_year_abbrev:"년",nami_year_abbrev_plural:"년",nami_daily:"일일",nami_weekly:"주간",nami_biweekly:"격주 간행물",nami_monthly:"월간 간행물",nami_bimonthly:"격월",nami_quarterly:"계간지",nami_biannually:"반년마다",nami_yearly:"매년"},lt:{nami_day_abbrev:"diena",nami_day_abbrev_plural:"dienos",nami_week_abbrev:"savaitė",nami_week_abbrev_plural:"savaitės",nami_month_abbrev:"mėn.",nami_month_abbrev_plural:"mėn.",nami_year_abbrev:"metai",nami_year_abbrev_plural:"metų",nami_daily:"kasdien",nami_weekly:"kas savaitę",nami_biweekly:"kas dvi savaites",nami_monthly:"mėnesinis",nami_bimonthly:"kas du mėnesius",nami_quarterly:"ketvirtinis",nami_biannually:"kas du kartus per metus",nami_yearly:"kasmet"},lv:{nami_day_abbrev:"diena",nami_day_abbrev_plural:"dienas",nami_week_abbrev:"nedēļa",nami_week_abbrev_plural:"nedēļas",nami_month_abbrev:"mēn.",nami_month_abbrev_plural:"mēn.",nami_year_abbrev:"gads",nami_year_abbrev_plural:"gadi",nami_daily:"ikdienas",nami_weekly:"iknedēļas",nami_biweekly:"divreiz nedēļā",nami_monthly:"ikmēneša",nami_bimonthly:"divreiz mēnesī",nami_quarterly:"ceturksnī",nami_biannually:"divreiz gadā",nami_yearly:"katru gadu"},ms:{nami_day_abbrev:"hari",nami_day_abbrev_plural:"hari",nami_week_abbrev:"minggu",nami_week_abbrev_plural:"minggu",nami_month_abbrev:"bulan",nami_month_abbrev_plural:"bulan",nami_year_abbrev:"tahun",nami_year_abbrev_plural:"tahun",nami_daily:"setiap hari",nami_weekly:"mingguan",nami_biweekly:"dua minggu sekali",nami_monthly:"bulanan",nami_bimonthly:"dua kali sebulan",nami_quarterly:"suku tahunan",nami_biannually:"dua kali setahun",nami_yearly:"tahunan"},nl:{nami_day_abbrev:"dag",nami_day_abbrev_plural:"dagen",nami_week_abbrev:"week",nami_week_abbrev_plural:"weken",nami_month_abbrev:"maand",nami_month_abbrev_plural:"maanden",nami_year_abbrev:"jaar",nami_year_abbrev_plural:"jaren",nami_daily:"dagelijks",nami_weekly:"wekelijks",nami_biweekly:"tweewekelijks",nami_monthly:"maandelijks",nami_bimonthly:"tweemaandelijks",nami_quarterly:"kwartaal",nami_biannually:"halfjaarlijks",nami_yearly:"jaarlijks"},no:{nami_day_abbrev:"dag",nami_day_abbrev_plural:"dager",nami_week_abbrev:"uke",nami_week_abbrev_plural:"uker",nami_month_abbrev:"måned",nami_month_abbrev_plural:"måned",nami_year_abbrev:"år",nami_year_abbrev_plural:"år",nami_daily:"daglig",nami_weekly:"ukentlig",nami_biweekly:"annenhver uke",nami_monthly:"månedlig",nami_bimonthly:"annenhver måned",nami_quarterly:"kvartalsvis",nami_biannually:"to ganger i året",nami_yearly:"årlig"},pl:{nami_day_abbrev:"dzień",nami_day_abbrev_plural:"dni",nami_week_abbrev:"tydzień",nami_week_abbrev_plural:"tygodni",nami_month_abbrev:"miesiąc",nami_month_abbrev_plural:"miesiące",nami_year_abbrev:"rok",nami_year_abbrev_plural:"lat",nami_daily:"codziennie",nami_weekly:"tygodnik",nami_biweekly:"dwutygodniowy",nami_monthly:"miesięczny",nami_bimonthly:"dwumiesięczny",nami_quarterly:"kwartalny",nami_biannually:"dwa razy w roku",nami_yearly:"rocznie"},pt:{nami_day_abbrev:"dia",nami_day_abbrev_plural:"dias",nami_week_abbrev:"semana",nami_week_abbrev_plural:"semanas",nami_month_abbrev:"mês",nami_month_abbrev_plural:"meses",nami_year_abbrev:"ano",nami_year_abbrev_plural:"anos",nami_daily:"diário",nami_weekly:"semanalmente",nami_biweekly:"quinzenal",nami_monthly:"mensal",nami_bimonthly:"bimestral",nami_quarterly:"trimestral",nami_biannually:"bianualmente",nami_yearly:"anual"},ro:{nami_day_abbrev:"zi",nami_day_abbrev_plural:"zile",nami_week_abbrev:"săptămână",nami_week_abbrev_plural:"săptămâni",nami_month_abbrev:"lună",nami_month_abbrev_plural:"luni",nami_year_abbrev:"an",nami_year_abbrev_plural:"ani",nami_daily:"zilnic",nami_weekly:"săptămânal",nami_biweekly:"la două săptămâni",nami_monthly:"lunar",nami_bimonthly:"bilunar",nami_quarterly:"trimestrial",nami_biannually:"bianual",nami_yearly:"anual"},ru:{nami_day_abbrev:"день",nami_day_abbrev_plural:"дни",nami_week_abbrev:"нед",nami_week_abbrev_plural:"недели",nami_month_abbrev:"мо",nami_month_abbrev_plural:"мос",nami_year_abbrev:"год",nami_year_abbrev_plural:"лет",nami_daily:"ежедневно",nami_weekly:"еженедельный",nami_biweekly:"раз в две недели",nami_monthly:"ежемесячно",nami_bimonthly:"раз в два месяца",nami_quarterly:"ежеквартальный",nami_biannually:"раз в два года",nami_yearly:"ежегодно"},sk:{nami_day_abbrev:"deň",nami_day_abbrev_plural:"dni",nami_week_abbrev:"týždeň",nami_week_abbrev_plural:"týždne",nami_month_abbrev:"mesiac",nami_month_abbrev_plural:"mesiacov",nami_year_abbrev:"rok",nami_year_abbrev_plural:"rokov",nami_daily:"denne",nami_weekly:"týždenne",nami_biweekly:"dvojtýždenne",nami_monthly:"mesačne",nami_bimonthly:"dvojmesačne",nami_quarterly:"štvrťročne",nami_biannually:"polročne",nami_yearly:"ročne"},sl:{nami_day_abbrev:"dan",nami_day_abbrev_plural:"dni",nami_week_abbrev:"teden",nami_week_abbrev_plural:"tedni",nami_month_abbrev:"mesec",nami_month_abbrev_plural:"mesecev",nami_year_abbrev:"leto",nami_year_abbrev_plural:"let",nami_daily:"dnevno",nami_weekly:"tedensko",nami_biweekly:"dvotedensko",nami_monthly:"mesečno",nami_bimonthly:"dvomesečno",nami_quarterly:"četrtletno",nami_biannually:"polletno",nami_yearly:"letno"},sr:{nami_day_abbrev:"дан",nami_day_abbrev_plural:"дана",nami_week_abbrev:"недеља",nami_week_abbrev_plural:"недеље",nami_month_abbrev:"мо",nami_month_abbrev_plural:"мос",nami_year_abbrev:"год.",nami_year_abbrev_plural:"године",nami_daily:"свакодневно",nami_weekly:"недељно",nami_biweekly:"двонедељно",nami_monthly:"месечно",nami_bimonthly:"двомесечно",nami_quarterly:"квартално",nami_biannually:"два пута годишње",nami_yearly:"годишње"},sv:{nami_day_abbrev:"dag",nami_day_abbrev_plural:"dagar",nami_week_abbrev:"vecka",nami_week_abbrev_plural:"veckor",nami_month_abbrev:"mån",nami_month_abbrev_plural:"månader",nami_year_abbrev:"år",nami_year_abbrev_plural:"år",nami_daily:"dagligen",nami_weekly:"varje vecka",nami_biweekly:"som utkommer varannan vecka",nami_monthly:"månatlig",nami_bimonthly:"varannan månad",nami_quarterly:"kvartalsvis",nami_biannually:"vartannat år",nami_yearly:"årlig"},sw:{nami_day_abbrev:"siku",nami_day_abbrev_plural:"siku",nami_week_abbrev:"wiki",nami_week_abbrev_plural:"wiki",nami_month_abbrev:"mwezi",nami_month_abbrev_plural:"miezi",nami_year_abbrev:"mwaka",nami_year_abbrev_plural:"miaka",nami_daily:"kila siku",nami_weekly:"kila wiki",nami_biweekly:"kila wiki mbili",nami_monthly:"kila mwezi",nami_bimonthly:"kila baada ya miezi miwili",nami_quarterly:"robo mwaka",nami_biannually:"kila baada ya miaka miwili",nami_yearly:"kila mwaka"},th:{nami_day_abbrev:"วัน",nami_day_abbrev_plural:"วัน",nami_week_abbrev:"สัปดาห์",nami_week_abbrev_plural:"สัปดาห์",nami_month_abbrev:"โม",nami_month_abbrev_plural:"มอส",nami_year_abbrev:"ปี",nami_year_abbrev_plural:"ปี",nami_daily:"รายวัน",nami_weekly:"รายสัปดาห์",nami_biweekly:"สองสัปดาห์ครั้ง",nami_monthly:"รายเดือน",nami_bimonthly:"สองเดือนครั้ง",nami_quarterly:"ไตรมาส",nami_biannually:"ทุกสองปี",nami_yearly:"ทุกปี"},tr:{nami_day_abbrev:"gün",nami_day_abbrev_plural:"günler",nami_week_abbrev:"hafta",nami_week_abbrev_plural:"haftalar",nami_month_abbrev:"ay",nami_month_abbrev_plural:"aylar",nami_year_abbrev:"yıl",nami_year_abbrev_plural:"yıllar",nami_daily:"günlük",nami_weekly:"haftalık",nami_biweekly:"iki haftada bir",nami_monthly:"aylık",nami_bimonthly:"iki ayda bir",nami_quarterly:"üç aylık",nami_biannually:"iki yılda bir",nami_yearly:"yıllık"},uk:{nami_day_abbrev:"день",nami_day_abbrev_plural:"дні",nami_week_abbrev:"тиждень",nami_week_abbrev_plural:"тижні",nami_month_abbrev:"місяць",nami_month_abbrev_plural:"мос",nami_year_abbrev:"рік",nami_year_abbrev_plural:"років",nami_daily:"щоденно",nami_weekly:"щотижня",nami_biweekly:"раз на два тижні",nami_monthly:"щомісяця",nami_bimonthly:"раз на два місяці",nami_quarterly:"щоквартально",nami_biannually:"раз на півроку",nami_yearly:"щорічно"},vi:{nami_day_abbrev:"ngày",nami_day_abbrev_plural:"ngày",nami_week_abbrev:"tuần",nami_week_abbrev_plural:"tuần",nami_month_abbrev:"tháng",nami_month_abbrev_plural:"tháng",nami_year_abbrev:"năm",nami_year_abbrev_plural:"năm",nami_daily:"hằng ngày",nami_weekly:"hàng tuần",nami_biweekly:"hai tuần một lần",nami_monthly:"hàng tháng",nami_bimonthly:"hai tháng một lần",nami_quarterly:"hàng quý",nami_biannually:"hai năm một lần",nami_yearly:"hàng năm"},"zh-CN":{nami_day_abbrev:"天",nami_day_abbrev_plural:"天",nami_week_abbrev:"周",nami_week_abbrev_plural:"周",nami_month_abbrev:"莫",nami_month_abbrev_plural:"莫斯",nami_year_abbrev:"年",nami_year_abbrev_plural:"年",nami_daily:"日常的",nami_weekly:"每周",nami_biweekly:"每两周一次",nami_monthly:"月度",nami_bimonthly:"双月刊",nami_quarterly:"季刊",nami_biannually:"每半年",nami_yearly:"每年"},"zh-TW":{nami_day_abbrev:"天",nami_day_abbrev_plural:"天",nami_week_abbrev:"週",nami_week_abbrev_plural:"週",nami_month_abbrev:"莫",nami_month_abbrev_plural:"莫斯",nami_year_abbrev:"年",nami_year_abbrev_plural:"年",nami_daily:"日常的",nami_weekly:"每週",nami_biweekly:"每兩週一次",nami_monthly:"每月",nami_bimonthly:"雙月刊",nami_quarterly:"季刊",nami_biannually:"每半年",nami_yearly:"每年"},zu:{nami_day_abbrev:"usuku",nami_day_abbrev_plural:"izinsuku",nami_week_abbrev:"isonto",nami_week_abbrev_plural:"amasonto",nami_month_abbrev:"inyanga",nami_month_abbrev_plural:"i-mos",nami_year_abbrev:"unyaka",nami_year_abbrev_plural:"iminyaka",nami_daily:"nsuku zonke",nami_weekly:"masonto onke",nami_biweekly:"kabili ngesonto",nami_monthly:"nyanga zonke",nami_bimonthly:"kabili ngenyanga",nami_quarterly:"njalo ngekota",nami_biannually:"kabili ngonyaka",nami_yearly:"minyaka yonke"}},tl="en";function nl(e){var t,n,i=function(e){if(!e)return tl;var t=e.trim();if(el[t])return t;var n=t.toLowerCase(),i=n.split("-")[0];return el[i]?i:"zh"===i?n.includes("tw")||n.includes("hk")?"zh-TW":"zh-CN":tl}(Qr.getLanguageCode()),a=null!==(t=el[i])&&void 0!==t?t:el[tl];return null!==(n=null==a?void 0:a[e])&&void 0!==n?n:e}var il=e=>"subscription"===e;function al(e){if(il(null==e?void 0:e.product_type)){var t=ol(e);if(t.length>0)return t[0].billingPeriod}return null}function rl(e){var t=function(e){if(!e)return[];var t=e.offers.filter((e=>"promo"===e.offer_type));return sl(t,e.subscription_period)}(e).find((e=>0===e.priceAmountMicros));return(null==t?void 0:t.billingPeriod)||null}function ol(e){return e?sl(e.offers.filter((e=>"default"===e.offer_type)),e.subscription_period):[]}function sl(e,t){return e.map((e=>ul(e,t)))}function ul(e,t){var n,i,a,r,o,s,u,l;if(!e)return{};var d=null!==(n=null===(i=e.promo_period)||void 0===i?void 0:i.count)&&void 0!==n?n:null==t?void 0:t.count,h=null!==(a=null===(r=e.promo_period)||void 0===r?void 0:r.type)&&void 0!==a?a:null==t?void 0:t.type,c=null!==(o=null===(s=e.promo_price)||void 0===s?void 0:s.price)&&void 0!==o?o:e.price,m=null!==(u=null===(l=e.promo_price)||void 0===l?void 0:l.currency)&&void 0!==u?u:e.currency;return{priceAmountMicros:1e6*c,priceCurrencyCode:m,billingPeriod:h?`P${d}${h[0].toUpperCase()}`:"",formattedPrice:hl(m).format(c)}}function ll(e,t=!1,n=!1,i=!1,a=!1){if(!e)return null;var r=e.match(/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/);if(!r)return null;var o=r.slice(1).map((e=>parseInt(e))),s=o[0],u=o[1],l=o[2],d=o[3],h=(e,t,n,i,r)=>{var o=(e=>a?`${e}_abbrev`:e)(r),s=(e=>a?`${e}_abbrev_plural`:`${e}_plural`)(r),u=nl(o),l=nl(s);return a||u!==o||(u=nl(`${r}_abbrev`)),a||l!==s||(l=nl(`${r}_abbrev_plural`)),i?e.toString():n?1===e||t?u:l:1===e||t?`${e} ${u}`:`${e} ${l}`};switch(e.at(-1)){case"D":return h(d,t,n,i,"nami_day");case"W":return h(l,t,n,i,"nami_week");case"M":return h(u,t,n,i,"nami_month");case"Y":return h(s,t,n,i,"nami_year")}return null}function dl(e){var t;if(!e||e.length<2)return!1;var n=null===(t=e.at(-1))||void 0===t?void 0:t.toUpperCase();return"M"===n||"Y"===n}function hl(e){var t={maximumFractionDigits:2,minimumFractionDigits:0};try{return new Intl.NumberFormat(navigator.language,y({},t,{style:"currency",currency:e}))}catch(e){return new Intl.NumberFormat(navigator.language,y({},t,{style:"currency",currency:"USD"}))}}var cl=(e,t,n)=>e&&t&&n?n.format(e-t):null,ml=(e,t,n,i)=>{if(e&&t&&n&&i){var a=100*(1-e/(n/i*t));return`${Math.round(a)}%`}return null},fl=(e,t)=>{if(""!=t){var n=parseInt(t)-1;return n>=0&&n<(null==e?void 0:e.length)?e[n]:null==e?void 0:e.find((e=>e.sku_ref_id===t))}},vl=e=>gl(e.priceAmountMicros)/pl(e.billingPeriod),pl=e=>{var t=parseInt(e[1]);return e.includes("Y")&&(t*=12),t},gl=e=>e/1e6;function yl(e){return parseFloat((Math.round(e)/100).toFixed(2))}var bl=(e,t,n=[])=>({price:()=>Sl(e),name:()=>null==e?void 0:e.name,title:()=>null==e?void 0:e.name,description:()=>null==e?void 0:e.description,duration:()=>El(e),durationSingular:()=>El(e,!0),period:()=>El(e,!1,!0),periodNumber:()=>El(e,!1,!1,!0),freeTrialDuration:()=>Ml(e),freeTrialDurationSingular:()=>Ml(e,!0),freeTrialPeriod:()=>Ml(e,!1,!0),freeTrialPeriodNumber:()=>Ml(e,!1,!1,!0),pricePerMonth:()=>Pl(e),pricePerMonthRounded:()=>Pl(e,!0),periodInMonths:()=>Tl(e),durationInMonths:()=>_l(e),durationInMonthsSingular:()=>_l(e,!0),periodNumberInMonths:()=>Dl(e),percentagePriceDifferenceFromSku:()=>Al(e,t,n),priceDifferenceFromSku:()=>xl(e,t,n),promoEligible:()=>null===Cl(e)&&null!==Il(e,t),freeTrialEligible:()=>null!==Cl(e),promo:()=>{var n;return null===(n=Il(e,t))||void 0===n?void 0:n.offer_ref_id},promoCode:()=>"XXXXX",promoPrice:()=>{var n;return null===(n=Ll(e,t))||void 0===n?void 0:n.formattedPrice},promoPeriod:()=>Fl(e,t,!1,!0),promoPeriodNumber:()=>Fl(e,t,!1,!1,!0),promoDuration:()=>Fl(e,t),promoDurationSingular:()=>Fl(e,t,!0),introEligible:()=>!1,pricePerDay:()=>Rl(e),pricePerWeek:()=>Wl(e),pricePerWeekRounded:()=>Wl(e,!0),introductoryPrice:()=>Ol(e,t),introductoryPeriod:()=>Nl(e,t,!1,!0),introductoryPeriodNumber:()=>Nl(e,t,!1,!1,!0),introductoryDuration:()=>Nl(e,t),introductoryDurationSingular:()=>Nl(e,t,!0),introductoryPricePerMonth:()=>jl(e,t),introductoryPricePerMonthRounded:()=>jl(e,t,!0),durationAbbrev:()=>El(e,!1,!1,!1,!0),freeTrialDurationAbbrev:()=>Ml(e,!1,!1,!1,!0),introductoryDurationAbbrev:()=>Nl(e,t,!1,!1,!1,!0),promoDurationAbbrev:()=>Fl(e,t,!1,!1,!1,!0),promoDurationPhase2Abbrev:()=>Fl(e,t,!0,!0,!1,!0),durationInMonthsAbbrev:()=>_l(e,!1,!1,!1,!0),durationSingularAbbrev:()=>El(e,!0,!1,!1,!0),freeTrialDurationSingularAbbrev:()=>Ml(e,!0,!1,!1,!0),introductoryDurationSingularAbbrev:()=>Nl(e,t,!0,!1,!1,!0),promoDurationSingularAbbrev:()=>Fl(e,t,!0,!1,!1,!0),promoDurationSingularPhase2Abbrev:()=>Fl(e,t,!0,!0,!1,!0),durationInMonthsSingularAbbrev:()=>_l(e,!0,!1,!1,!0),periodAbbrev:()=>El(e,!1,!0,!1,!0),freeTrialPeriodAbbrev:()=>Ml(e,!1,!0,!1,!0),introductoryPeriodAbbrev:()=>Nl(e,t,!1,!0,!1,!0),promoPeriodAbbrev:()=>Fl(e,t,!1,!0,!1,!0),promoPeriodPhase2Abbrev:()=>Fl(e,t,!1,!0,!0,!0),periodInMonthsAbbrev:()=>_l(e,!1,!0,!1,!0),periodly:()=>function(e){if(!e)return null;var t=e.match(/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/);if(!t)return null;var n=t[1],i=t[2],a=t[3],r=t[4],o=void 0!==n?parseInt(n,10):0,s=void 0!==i?parseInt(i,10):0,u=void 0!==a?parseInt(a,10):0;return(void 0!==r?parseInt(r,10):0)>0?null:u>0?1===u?nl("nami_weekly"):2===u?nl("nami_biweekly"):null:s>0?nl(1===s?"nami_monthly":2===s?"nami_bimonthly":3===s?"nami_quarterly":6===s?"nami_biannually":12===s?"nami_yearly":"nami_monthly"):o>0?nl("nami_yearly"):null}(al(e)),iso_subscription_duration:()=>zl(e),invalid:()=>!1,unavailable:()=>!1}),wl=()=>Object.keys(bl({})),kl=(e,t,n,i=[])=>{if(!t)return null;var a=bl(t,n,i);return a[e]?a[e]():null},Sl=e=>{var t=ol(e);return t&&t.length?t[0].formattedPrice:null},El=(e,t,n,i,a)=>ll(al(e),t,n,i,a),Ml=(e,t,n,i,a)=>ll(rl(e),t,n,i,a),Pl=(e,t)=>{var n=ol(e);if(!n||0===n.length)return null;var i=vl(n[0]);return i?hl(n[0].priceCurrencyCode).format(t?Math.round(i):i):null},Tl=(e,t)=>{var n=ol(e);if(!n||0===n.length)return null;var i=n[0].billingPeriod;return dl(i)?ll("P1Y"===i?"P12M":i,!1,!1,!1,t):null},_l=(e,t,n,i,a)=>{var r=ol(e);if(!r||0===r.length)return null;var o=r[0].billingPeriod;return dl(o)?ll("P1Y"===o?"P12M":o,t,n,i,a):null},Dl=e=>{if(!e)return 0;var t=ol(e);return t&&t.length?pl(t[0].billingPeriod):0},Al=(e,t,n=[])=>{var i,a=ol(e);if(!a||0===a.length)return null;var r=null===(i=fl(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return ml(yl(a[0].priceAmountMicros),Dl(e));var o=ol(r);return ml(yl(a[0].priceAmountMicros),Dl(e),(null==o?void 0:o.length)>0?yl(o[0].priceAmountMicros):0,Dl(r))},xl=(e,t,n=[])=>{var i,a=ol(e);if(!a||0===a.length)return null;var r=null===(i=fl(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return cl(vl(a[0]));var o=ol(r);return cl(vl(a[0]),vl(o[0]),hl(o[0].priceCurrencyCode))},Cl=e=>rl(e),Il=(e,t)=>{if(!e)return null;var n=e.offers.filter((e=>"promo"===e.offer_type));if(!t)return n[0]||null;var i=n[parseInt(t)];return i?i||null:n.find((e=>e.offer_ref_id===t))||null},Ll=(e,t)=>e?ul(Il(e,t),e.subscription_period):null,Fl=(e,t,n,i,a,r)=>{var o=Ll(e,t);return ll((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},Rl=(e,t)=>{var n=ol(e);if(!n||0===n.length)return null;var i,a,r=gl(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=pl(i))?30.437*a:1);return r?hl(n[0].priceCurrencyCode).format(r):null},Wl=(e,t)=>{var n=ol(e);if(!n||0===n.length)return null;var i,a,r=gl(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=pl(i))?52*a/12:1);return r?hl(n[0].priceCurrencyCode).format(t?Math.round(r):r):null},Ol=(e,t)=>{var n=$l(e,t);return(null==n?void 0:n.formattedPrice)||null},Nl=(e,t,n,i,a,r)=>{var o=$l(e,t);return ll((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},jl=(e,t,n)=>{var i=$l(e,t);if(i){var a=gl(i.priceAmountMicros),r=pl(i.billingPeriod),o=n?Math.round(a/r):a/r;return hl(i.priceCurrencyCode).format(o)}},$l=(e,t)=>{return e?(t?(n=e.offers[parseInt(t)])||(n=e.offers.find((e=>e.offer_ref_id===t))||null):n=e.offers[0],ul(n,e.subscription_period)):null;var n},zl=e=>{var t=al(e);return t?"P7D"===t?"P1W":t:null};function Bl(e,t,n){var i=e.length;return n=void 0===n?i:n,!t&&n>=i?e:function(e,t,n){var i=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(n=n>a?a:n)<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var r=Array(a);++i<a;)r[i]=e[i+t];return r}(e,t,n)}var Hl=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function Ul(e){return Hl.test(e)}var Gl="\\ud800-\\udfff",Vl="["+Gl+"]",Xl="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Kl="\\ud83c[\\udffb-\\udfff]",Yl="[^"+Gl+"]",ql="(?:\\ud83c[\\udde6-\\uddff]){2}",Jl="[\\ud800-\\udbff][\\udc00-\\udfff]",Ql="(?:"+Xl+"|"+Kl+")"+"?",Zl="[\\ufe0e\\ufe0f]?",ed=Zl+Ql+("(?:\\u200d(?:"+[Yl,ql,Jl].join("|")+")"+Zl+Ql+")*"),td="(?:"+[Yl+Xl+"?",Xl,ql,Jl,Vl].join("|")+")",nd=RegExp(Kl+"(?="+Kl+")|"+td+ed,"g");function id(e){return Ul(e)?function(e){return e.match(nd)||[]}(e):function(e){return e.split("")}(e)}var ad,rd=(ad="toUpperCase",function(e){var t=Ul(e=Fr(e))?id(e):void 0,n=t?t[0]:e.charAt(0),i=t?Bl(t,1).join(""):e.slice(1);return n[ad]()+i});var od,sd=(od={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},function(e){return null==od?void 0:od[e]}),ud=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ld=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var dd=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var hd=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var cd="\\ud800-\\udfff",md="\\u2700-\\u27bf",fd="a-z\\xdf-\\xf6\\xf8-\\xff",vd="A-Z\\xc0-\\xd6\\xd8-\\xde",pd="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",gd="["+pd+"]",yd="\\d+",bd="["+md+"]",wd="["+fd+"]",kd="[^"+cd+pd+yd+md+fd+vd+"]",Sd="(?:\\ud83c[\\udde6-\\uddff]){2}",Ed="[\\ud800-\\udbff][\\udc00-\\udfff]",Md="["+vd+"]",Pd="(?:"+wd+"|"+kd+")",Td="(?:"+Md+"|"+kd+")",_d="(?:['’](?:d|ll|m|re|s|t|ve))?",Dd="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ad="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",xd="[\\ufe0e\\ufe0f]?",Cd=xd+Ad+("(?:\\u200d(?:"+["[^"+cd+"]",Sd,Ed].join("|")+")"+xd+Ad+")*"),Id="(?:"+[bd,Sd,Ed].join("|")+")"+Cd,Ld=RegExp([Md+"?"+wd+"+"+_d+"(?="+[gd,Md,"$"].join("|")+")",Td+"+"+Dd+"(?="+[gd,Md+Pd,"$"].join("|")+")",Md+"?"+Pd+"+"+_d,Md+"+"+Dd,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",yd,Id].join("|"),"g");function Fd(e,t,n){return e=Fr(e),void 0===t?function(e){return hd.test(e)}(e)?function(e){return e.match(Ld)||[]}(e):function(e){return e.match(dd)||[]}(e):e.match(t)||[]}var Rd=RegExp("['’]","g");var Wd,Od=(Wd=function(e,t,n){return t=t.toLowerCase(),e+(n?rd(Fr(t).toLowerCase()):t)},function(e){return function(e,t,n){for(var i=-1,a=null==e?0:e.length;++i<a;)n=t(n,e[i],i,e);return n}(Fd(function(e){return(e=Fr(e))&&e.replace(ud,sd).replace(ld,"")}(e).replace(Rd,"")),Wd,"")});function Nd(e,t,n,i){var a=n.flatMap((e=>e.products)).find((e=>e.id===t.selectedProducts[t.currentGroupId]));return $d(Gd(e,null==a?void 0:a.sku_ref_id),a,i)}function jd(e,t,n){var i,a,r=null!==(i=null===(a=t.find((e=>e.id===n)))||void 0===a?void 0:a.products)&&void 0!==i?i:[];return r.forEach((t=>{t.product_details=Gd(e,t.sku_ref_id||""),t.variables=$d(t.product_details,t,r)})),r}function $d(e,t,n){if(!t)return{};var i=t.variables;if(!i)return y({},t);Object.keys(i).forEach((t=>{if(zd(i[t])){var a=Hd(i[t],e,n);i[t]=function(e){if(!e||e.includes("null")||e.includes("undefined"))return"";if(/\$\{\s*(launch\.customAttributes\.|sku\.)\w+\s*}/.test(e))return"";return e}(a)}}));var a={};return wl().forEach((t=>{if(void 0===i[t]){var r=kl(t,e,void 0,n);null!==r&&(a[t]=r)}})),y({},t,a,i)}function zd(e){return"string"==typeof e&&e.includes(Rn)}function Bd(e,t,n){return t?(Object.keys(t).forEach((i=>{zd(t[i])&&(t[i]=t[Od(i)]=Hd(t[i],e,n))})),y({},t)):{}}var Hd=(e,t,n)=>e.replace(Cn,((i,a)=>{var r,o,s,u,l=(null===(r=Cn.exec(e))||void 0===r?void 0:r.slice(1))||[];a=null!==(o=l[0])&&void 0!==o?o:a;var d=null!==(s=null===(u=l[1])||void 0===u?void 0:u.replace(":",""))&&void 0!==s?s:"";return kl(a,t,d,n)}));function Ud(e,t){return t.flatMap((e=>e.products)).some((t=>1==kl("freeTrialEligible",Gd(e,t.sku_ref_id))))}function Gd(e=[],t=""){return e.find((e=>e.product_ref_id===t))||null}var Vd=function(){try{var e=Ei(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();function Xd(e,t,n){"__proto__"==t&&Vd?Vd(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Kd=Object.prototype.hasOwnProperty;function Yd(e,t,n){var i=e[t];Kd.call(e,t)&&Bn(i,n)&&(void 0!==n||t in e)||Xd(e,t,n)}function qd(e,t,n,i){var a=!n;n||(n={});for(var r=-1,o=t.length;++r<o;){var s=t[r],u=void 0;void 0===u&&(u=e[s]),a?Xd(n,s,u):Yd(n,s,u)}return n}var Jd=Object.prototype.hasOwnProperty;function Qd(e){if(!ri(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Ra(e),n=[];for(var i in e)("constructor"!=i||!t&&Jd.call(e,i))&&n.push(i);return n}function Zd(e){return ja(e)?La(e,!0):Qd(e)}var eh="object"==typeof exports&&exports&&!exports.nodeType&&exports,th=eh&&"object"==typeof module&&module&&!module.nodeType&&module,nh=th&&th.exports===eh?Kn.Buffer:void 0,ih=nh?nh.allocUnsafe:void 0;var ah=Wa(Object.getPrototypeOf,Object),rh=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)na(t,ua(e)),e=ah(e);return t}:ra;function oh(e){return aa(e,Zd,rh)}var sh=Object.prototype.hasOwnProperty;function uh(e){var t=new e.constructor(e.byteLength);return new Ni(t).set(new Ni(e)),t}var lh=/\w*$/;var dh=Yn?Yn.prototype:void 0,hh=dh?dh.valueOf:void 0;var ch="[object Boolean]",mh="[object Date]",fh="[object Map]",vh="[object Number]",ph="[object RegExp]",gh="[object Set]",yh="[object String]",bh="[object Symbol]",wh="[object ArrayBuffer]",kh="[object DataView]",Sh="[object Float32Array]",Eh="[object Float64Array]",Mh="[object Int8Array]",Ph="[object Int16Array]",Th="[object Int32Array]",_h="[object Uint8Array]",Dh="[object Uint8ClampedArray]",Ah="[object Uint16Array]",xh="[object Uint32Array]";function Ch(e,t,n){var i,a=e.constructor;switch(t){case wh:return uh(e);case ch:case mh:return new a(+e);case kh:return function(e,t){var n=t?uh(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case Sh:case Eh:case Mh:case Ph:case Th:case _h:case Dh:case Ah:case xh:return function(e,t){var n=t?uh(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case fh:return new a;case vh:case yh:return new a(e);case ph:return function(e){var t=new e.constructor(e.source,lh.exec(e));return t.lastIndex=e.lastIndex,t}(e);case gh:return new a;case bh:return i=e,hh?Object(hh.call(i)):{}}}var Ih=Object.create,Lh=function(){function e(){}return function(t){if(!ri(t))return{};if(Ih)return Ih(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var Fh=Aa&&Aa.isMap,Rh=Fh?Pa(Fh):function(e){return la(e)&&"[object Map]"==ar(e)};var Wh=Aa&&Aa.isSet,Oh=Wh?Pa(Wh):function(e){return la(e)&&"[object Set]"==ar(e)},Nh=1,jh=2,$h=4,zh="[object Arguments]",Bh="[object Function]",Hh="[object GeneratorFunction]",Uh="[object Object]",Gh={};function Vh(e,t,n,i,a,r){var o,s=t&Nh,u=t&jh,l=t&$h;if(void 0!==o)return o;if(!ri(e))return e;var d=ia(e);if(d){if(o=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&sh.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!s)return function(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}(e,o)}else{var h=ar(e),c=h==Bh||h==Hh;if(ya(e))return function(e,t){if(t)return e.slice();var n=e.length,i=ih?ih(n):new e.constructor(n);return e.copy(i),i}(e,s);if(h==Uh||h==zh||c&&!a){if(o=u||c?{}:function(e){return"function"!=typeof e.constructor||Ra(e)?{}:Lh(ah(e))}(e),!s)return u?function(e,t){return qd(e,rh(e),t)}(e,function(e,t){return e&&qd(t,Zd(t),e)}(o,e)):function(e,t){return qd(e,ua(e),t)}(e,function(e,t){return e&&qd(t,$a(t),e)}(o,e))}else{if(!Gh[h])return a?e:{};o=Ch(e,h,s)}}r||(r=new Ci);var m=r.get(e);if(m)return m;r.set(e,o),Oh(e)?e.forEach((function(i){o.add(Vh(i,t,n,i,e,r))})):Rh(e)&&e.forEach((function(i,a){o.set(a,Vh(i,t,n,a,e,r))}));var f=d?void 0:(l?u?oh:za:u?Zd:$a)(e);return function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););}(f||e,(function(i,a){f&&(i=e[a=i]),Yd(o,a,Vh(i,t,n,a,e,r))})),o}Gh[zh]=Gh["[object Array]"]=Gh["[object ArrayBuffer]"]=Gh["[object DataView]"]=Gh["[object Boolean]"]=Gh["[object Date]"]=Gh["[object Float32Array]"]=Gh["[object Float64Array]"]=Gh["[object Int8Array]"]=Gh["[object Int16Array]"]=Gh["[object Int32Array]"]=Gh["[object Map]"]=Gh["[object Number]"]=Gh[Uh]=Gh["[object RegExp]"]=Gh["[object Set]"]=Gh["[object String]"]=Gh["[object Symbol]"]=Gh["[object Uint8Array]"]=Gh["[object Uint8ClampedArray]"]=Gh["[object Uint16Array]"]=Gh["[object Uint32Array]"]=!0,Gh["[object Error]"]=Gh[Bh]=Gh["[object WeakMap]"]=!1;var Xh=(e,t,n)=>{var i=Object.getOwnPropertyDescriptor(e,t);if(!i||i.configurable)try{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n,writable:!1})}catch(i){try{e[t]=n}catch(e){}}},Kh=function(){return p((function e(){h(this,e),this.listeners=new Map}),[{key:"addEventListener",value:function(e,t,n){var i;if(t){var a=(e=>"boolean"==typeof e?{capture:e}:null!=e?e:{})(n),r=null!==(i=this.listeners.get(e))&&void 0!==i?i:[];if(!r.some((e=>e.listener===t))){var o={listener:t,once:Boolean(a.once)};if(a.signal){if(a.signal.aborted)return;o.signal=a.signal,o.abortHandler=()=>this.removeEventListener(e,t),a.signal.addEventListener("abort",o.abortHandler,{once:!0})}r.push(o),this.listeners.set(e,r)}}}},{key:"removeEventListener",value:function(e,t){if(t){var n=this.listeners.get(e);if(n&&0!==n.length){for(var i=n.length-1;i>=0;i-=1){var a=n[i];a.listener===t&&(a.signal&&a.abortHandler&&a.signal.removeEventListener("abort",a.abortHandler),n.splice(i,1))}0===n.length&&this.listeners.delete(e)}}}},{key:"dispatchEvent",value:function(e){var t,n;if(!e||"string"!=typeof e.type)throw new TypeError('Failed to execute "dispatchEvent": event type must be a string.');var i=this.listeners.get(e.type);if(!i||0===i.length)return!0;Xh(e,"target",this);var a=!1,r=null===(t=e.stopImmediatePropagation)||void 0===t?void 0:t.bind(e),o=null===(n=e.stopPropagation)||void 0===n?void 0:n.bind(e),s=()=>{a=!0,null==r||r()},u=()=>{e.cancelBubble=!0,null==o||o()};e.stopImmediatePropagation=s,e.stopPropagation=u;for(var l,d,h=g(i.slice());!(l=h()).done;){var c=l.value;if(a)break;Xh(e,"currentTarget",this),"function"==typeof c.listener?c.listener.call(this,e):"object"==typeof(d=c.listener)&&null!==d&&"handleEvent"in d&&c.listener.handleEvent.call(c.listener,e),c.once&&this.removeEventListener(e.type,c.listener)}if(r)e.stopImmediatePropagation=r;else try{delete e.stopImmediatePropagation}catch(t){e.stopImmediatePropagation=s}if(o)e.stopPropagation=o;else try{delete e.stopPropagation}catch(t){e.stopPropagation=u}return Xh(e,"currentTarget",null),!e.defaultPrevented}}])}(),Yh=[],qh={paywallId:"",livePaywalls:[],selectedPaywall:void 0,selectedCampaign:void 0,campaignRules:[],anySkuHasTrialOffer:!1,anySkuHasIntroOffer:!1,anySkuHasPromoOffer:!1,isLoggedIn:!1,darkMode:!1,safeAreaTop:0,groups:[],selectedProducts:{},formStates:{},timerStates:{},currentPage:"page1",currentGroupId:"",currentGroupName:"",fullScreenPresentation:!1,launch:{productGroups:[],customAttributes:{},customObject:{},currentGroup:""},sku:{},orientation:"portrait",focusedState:!1,platformId:"",mediaList:{},skuItems:[],customer:{},hasNotch:!1,purchaseInProgress:!1,formFactor:"desktop",slides:{},userInteractionEnabled:!0,currentSlideIndex:void 0},Jh=function(){function e(t,n,i){var a;h(this,e),(a=d(this,e)).host=null,a.subscribers=new Set,a.productDetails=Yh,a.filteredSkuMenus=[],a.state=Vh(qh,5);var r=Qr.getNamiProfile();return a.state.isLoggedIn=!(null==r||!r.externalId),a.setPaywall(t,n,i),a.defineDynamicStateProps(),a.subscribers=new Set,a}return k(e,Kh),p(e,[{key:"subscribe",value:function(e){return this.subscribers.add(e),()=>this.unsubscribe(e)}},{key:"unsubscribe",value:function(e){this.subscribers.delete(e)}},{key:"emitEvent",value:function(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t}))}},{key:"onEvent",value:function(e,t){var n=e=>t(e.detail);return this.addEventListener(e,n),()=>this.removeEventListener(e,n)}},{key:"hostConnected",value:function(){}},{key:"hostDisconnected",value:function(){this.subscribers.clear()}},{key:"defineDynamicStateProps",value:function(){Object.defineProperty(this.state,"tvQuality",{get:this.getTVQuality.bind(this),enumerable:!1,configurable:!0}),Object.defineProperty(this.state,"viewportWidth",{get:this.getViewportWidth.bind(this),enumerable:!1,configurable:!0}),Object.defineProperty(this.state,"viewportHeight",{get:this.getViewportHeight.bind(this),enumerable:!1,configurable:!0})}},{key:"setState",value:function(e){this.state=e,this.defineDynamicStateProps(),this.subscribers.forEach((e=>e())),this.host&&this.host.requestUpdate()}},{key:"setProductDetails",value:function(e){this.productDetails=e}},{key:"getProductDetails",value:function(){return this.productDetails}},{key:"setCurrentGroupData",value:function(e,t){var n=Nd(this.productDetails,this.state,this.filteredSkuMenus,jd(this.productDetails,this.filteredSkuMenus,this.state.currentGroupId));this.setState(y({},this.state,{currentGroupId:e,currentGroupName:t,sku:n}))}},{key:"setFormState",value:function(e,t){this.setState(y({},this.state,{formStates:y({},this.state.formStates,{[e]:t})}))}},{key:"setTimerState",value:function(e,t,n,i){this.setState(y({},this.state,{timerStates:y({},this.state.timerStates,{[e]:{remainingSeconds:t,savedAt:n,hasEmittedCompletion:i}})}))}},{key:"getTimerState",value:function(e){return this.state.timerStates[e]}},{key:"getCurrentGroupId",value:function(){return this.state.currentGroupId}},{key:"getCurrentGroupName",value:function(){return this.state.currentGroupName}},{key:"setCurrentFormId",value:function(e,t){var n=this.state.formStates||{},i=y({},n,{[e]:t||!n[e]});this.setState(y({},this.state,{formStates:i}))}},{key:"getCurrentFormId",value:function(e){return this.state.formStates[e]}},{key:"setSelectedProducts",value:function(e){var t=Nd(this.productDetails,this.state,this.filteredSkuMenus,jd(this.productDetails,this.filteredSkuMenus,this.state.currentGroupId));this.setState(y({},this.state,{selectedProducts:e,sku:t}))}},{key:"selectedProducts",value:function(){return this.state.selectedProducts}},{key:"setPaywall",value:function(e,t,n){var i,a,r,o,s,u=y({},this.state,{formFactor:cu(),selectedPaywall:e,selectedCampaign:n}),l=function(e,t,n=[]){var i,a,r=null!==(i=t.productGroups)&&void 0!==i&&i.length?t.productGroups:n.map((e=>e.ref));return{customAttributes:t.customAttributes,productGroups:r,customObject:y({},e.customObject,t.customObject),currentGroup:null!==(a=t.currentGroup)&&void 0!==a?a:""}}((u=y({},u,null===(i=e.template)||void 0===i?void 0:i.initialState)).launch,t,e.sku_menus);(this.filteredSkuMenus=null!==(a=e.sku_menus)&&void 0!==a?a:[],l.productGroups.length&&(this.filteredSkuMenus=this.filteredSkuMenus.filter((e=>l.productGroups.includes(e.ref)))),""!==l.currentGroup&&u.groups.length&&null!==(r=e.template)&&void 0!==r&&r.displaySingleGroup)&&(u.currentGroupId=null!==(o=null===(s=u.groups.find((e=>e.ref==l.currentGroup)))||void 0===s?void 0:s.id)&&void 0!==o?o:"");if(""===u.currentGroupId&&1===this.filteredSkuMenus.length){var d,h=u.groups.find((e=>e.ref==this.filteredSkuMenus[0].ref));u.currentGroupId=null!==(d=null==h?void 0:h.id)&&void 0!==d?d:u.currentGroupId}var c=jd(this.productDetails,this.filteredSkuMenus,u.currentGroupId);u.skuItems=c,u.launch=l,u.anySkuHasTrialOffer=Ud(this.productDetails,this.filteredSkuMenus),u.anySkuHasPromoOffer=function(e,t){return!Ud(e,t)&&t.flatMap((e=>e.products)).some((t=>1==kl("promoEligible",Gd(e,t.sku_ref_id))))}(this.productDetails,this.filteredSkuMenus),u.paywallId=e.id,u.sku=Nd(this.productDetails,u,this.filteredSkuMenus,c),this.setState(u)}},{key:"getSelectedPaywall",value:function(){return this.state.selectedPaywall}},{key:"getSelectedCampaign",value:function(){return this.state.selectedCampaign}},{key:"getCurrentPlacementLabel",value:function(){var e,t;return null!==(e=this.state.selectedCampaign)&&void 0!==e&&e.value?this.state.selectedCampaign.value:null!==(t=this.flow)&&void 0!==t&&null!==(t=t.campaign)&&void 0!==t&&t.value?this.flow.campaign.value:void 0}},{key:"getPaywallActionEventData",value:function(){var e,t,n,i,a,r,o,s,u,l=this.state.selectedCampaign,d=this.state.selectedPaywall;return{paywallId:null!==(e=null==d?void 0:d.id)&&void 0!==e?e:"",paywallName:null!==(t=null==d?void 0:d.name)&&void 0!==t?t:"",campaignId:null!==(n=null==l?void 0:l.rule)&&void 0!==n?n:"",campaignName:null!==(i=null==l?void 0:l.name)&&void 0!==i?i:"",campaignType:null!==(a=null==l?void 0:l.type)&&void 0!==a?a:"",campaignLabel:null!==(r=null==l?void 0:l.value)&&void 0!==r?r:"",campaignUrl:(null==l?void 0:l.type)===$s.URL&&null!==(o=null==l?void 0:l.value)&&void 0!==o?o:"",segmentId:null!==(s=null==l?void 0:l.segment)&&void 0!==s?s:"",externalSegmentId:null!==(u=null==l?void 0:l.external_segment)&&void 0!==u?u:""}}},{key:"paywallId",value:function(){return this.state.paywallId}},{key:"setCurrentPage",value:function(e){this.setState(y({},this.state,{currentPage:e}))}},{key:"setCustomerAttribute",value:function(e){this.setState(y({},this.state,{customer:y({},this.state.customer,e)}))}},{key:"removeCustomerAttribute",value:function(e){delete this.state.customer[e],this.setState(this.state)}},{key:"setIsLoggedIn",value:function(e){this.setState(y({},this.state,{isLoggedIn:e}))}},{key:"setMediaList",value:function(e){this.setState(y({},this.state,{mediaList:e.reduce(((e,t)=>y({},e,{[t.name]:t})))}))}},{key:"setSafeAreaTop",value:function(e){this.setState(y({},this.state,{safeAreaTop:e}))}},{key:"setFullScreenPresentation",value:function(e){this.setState(y({},this.state,{fullScreenPresentation:e}))}},{key:"setFormFactor",value:function(e){this.setState(y({},this.state,{formFactor:e}))}},{key:"getFormFactor",value:function(){return this.state.formFactor}},{key:"getTVQuality",value:function(){var e,t;if("television"!==this.getFormFactor())return"";var n=window.devicePixelRatio||1,i=window.innerWidth||(null===(e=window.screen)||void 0===e?void 0:e.availWidth),a=window.innerHeight||(null===(t=window.screen)||void 0===t?void 0:t.availHeight);if(!i||!a)return"720p";var r=Math.max(i,a)*n,o=Math.min(i,a)*n;return r>=3840||o>=2160?"4K":r>=1920||o>=1080?"1080p":"720p"}},{key:"getViewportWidth",value:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}},{key:"getViewportHeight",value:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}},{key:"setPurchaseInProgress",value:function(e){this.setState(y({},this.state,{purchaseInProgress:e}))}},{key:"setPurchase",value:function(e,t){this.setState(y({},this.state,{purchaseInProgress:e,productBeingPurchased:t}))}},{key:"setTimeSpentOnPaywall",value:function(e){this.setState(y({},this.state,{timeSpentOnPaywall:e}))}},{key:"setAppSuppliedVideoDetails",value:function({url:e,name:t}){this.setState(y({},this.state,{appSuppliedVideoUrl:e,appSuppliedVideoName:t}))}},{key:"resetAppSuppliedVideoDetails",value:function(){delete this.state.appSuppliedVideoUrl,delete this.state.appSuppliedVideoName,this.setState(this.state)}},{key:"setLaunchDetails",value:function(e,t){this.setState(y({},this.state,{launchValue:e,launchType:t}))}},{key:"setOpenHeaderIds",value:function(e,t){e=null!=t&&t.skuId?`${e}_${t.skuId}`:e;var n=[...this.state.openHeaderIds],i=n.indexOf(e);-1!==i?n.splice(i,1):n.push(e),this.setState(y({},this.state,{openHeaderIds:n,currentCollapsibleSku:null!=t?t:null}))}},{key:"getCurrentCollapsibleSku",value:function(){return this.state.currentCollapsibleSku}},{key:"setFlow",value:function(e){this.flow=e}},{key:"setUserInteractionEnabled",value:function(e){this.setState(y({},this.state,{userInteractionEnabled:e})),this.emitEvent("user-interaction-changed",{enabled:e})}},{key:"setUserTags",value:function(e){this.setState(y({},this.state,{userTags:y({},this.state.userTags,e)}))}},{key:"setCurrentSlideIndex",value:function(e){this.state.currentSlideIndex=e}}],[{key:"create",value:function(t,n,i){var a=new e(t,n,i);return this.providers.push(a),a}},{key:"remove",value:function(e){this.providers=this.providers.filter((t=>t!==e))}},{key:"currentProvider",get:function(){return e.providers[0]}},{key:"setCustomerAttribute",value:function(e){this.providers.forEach((t=>{t.setCustomerAttribute(e)}))}},{key:"removeCustomerAttribute",value:function(e){this.providers.forEach((t=>{t.removeCustomerAttribute(e)}))}},{key:"setAppSuppliedVideoDetails",value:function(e){this.providers.forEach((t=>{t.setAppSuppliedVideoDetails(e)}))}},{key:"getSelectedPaywall",value:function(){var e;return null===(e=this.providers[0])||void 0===e?void 0:e.getSelectedPaywall()}},{key:"setUserInteractionEnabled",value:function(e){this.providers.forEach((t=>{t.setUserInteractionEnabled(e)}))}},{key:"setUserTags",value:function(e){this.providers.forEach((t=>{t.setUserTags(e)}))}},{key:"setProductDetails",value:function(e){this.providers.forEach((t=>{t.setProductDetails(e)})),Yh=e}},{key:"setPurchaseInProgress",value:function(e){this.providers.forEach((t=>{t.setPurchaseInProgress(e)}))}},{key:"setIsLoggedIn",value:function(e){this.providers.forEach((t=>{t.setIsLoggedIn(e)}))}},{key:"setPurchase",value:function(e,t){this.providers.forEach((n=>{n.setPurchase(e,t)}))}},{key:"getSelectedSlideIndex",value:function(){var e;return null===(e=this.providers[0])||void 0===e?void 0:e.state.currentSlideIndex}}])}();Jh.providers=[];var Qh=p((function e(){h(this,e),this.refIdToPurchasedSKUs={},this.refIdToRelatedSKUs={},this.refIdToActivePurchases={}}));Qh.instance=new Qh;var Zh=()=>qr(zn([...Qr.getNamiEntitlements(tt),...Qr.getNamiEntitlements(ht)]),"referenceId"),ec=()=>{Hu.getInstance().emit(_n,Zh())};function tc(e){return{id:e.id,skuId:e.sku_ref_id,name:e.name,type:e.sku_type||"unknown",entitlements:e.entitlements,productDetails:"product_details"in e?e.product_details:null}}var nc=function(){return p((function e(){h(this,e)}),[{key:"fetchActiveEntitlements",value:function(){var e,t,n;return T((function(i){for(;;)switch(i.n){case 0:if(e=null,Ju()||Rs(me.THIRD_PARTY_TRANSACTIONS)||!Rs(me.ENTITLEMENT_MANAGEMENT)){i.n=3;break}if(null==(t=Qr.getDevice())||!t.id){i.n=2;break}return i.n=1,l(this.getAPIEntitlements(t.id));case 1:n=i.v,(e=null==n?void 0:n.results)&&(Qr.setActiveEntitlements(Ze,e),this.invokeActiveEntitlementsHandler(e));case 2:i.n=4;break;case 3:Ju()&&$n.debug("Skipping active entitlements update - anonymous mode"),Rs(me.THIRD_PARTY_TRANSACTIONS)&&$n.debug("Skipping active entitlements update - paywalls-only mode"),Rs(me.ENTITLEMENT_MANAGEMENT)||$n.debug("Skipping active entitlements update - no entitlement_management capability");case 4:return i.a(2,e)}}),null,this,null,Promise)}},{key:"getAPIEntitlements",value:function(e){var t,n,i;return T((function(a){for(;;)switch(a.p=a.n){case 0:return t=`device/${e}/active_entitlements/`,n={},a.p=1,a.n=2,l(zs.instance.fetchAPI(t));case 2:n=a.v,a.n=4;break;case 3:throw a.p=3,i=a.v,$n.error(go(i.status,t)),i;case 4:return a.a(2,n)}}),null,null,[[1,3]],Promise)}},{key:"invokeActiveEntitlementsHandler",value:function(e){Ws()&&(e=>{Qr.setNamiEntitlements(tt,e);var t=Qr.getNamiEntitlements(ht),n=new Set(e.map((e=>e.referenceId))),i=t.filter((e=>{var t=n.has(e.referenceId);return t&&$n.debug(`Server granted verified entitlement for ${e.referenceId}, so replacing provisional entitlement grant.`),!t}));i.length!==t.length&&Qr.setNamiEntitlements(ht,i),ec()})(e.map((e=>(e=>{var t=e.entitlement_ref_id;return{name:e.name||"",desc:e.description||"",namiId:"",referenceId:t,relatedSkus:Qh.instance.refIdToRelatedSKUs[t]||[],activePurchases:Qh.instance.refIdToActivePurchases[t]||[],purchasedSkus:Qh.instance.refIdToPurchasedSKUs[t]||[],expires:e.expires?new Date(e.expires).valueOf():0}})(e))))}}])}();nc.instance=new nc;var ic=function(){return p((function e(){h(this,e)}),[{key:"fetchCustomerJourneyState",value:function(){var e,t,n,i;return T((function(a){for(;;)switch(a.p=a.n){case 0:if(!Ju()){a.n=1;break}return $n.debug("Skipping customer journey state update - anonymous mode"),a.a(2,null);case 1:if(null!=(e=Qr.getDevice())&&e.id){a.n=2;break}return a.a(2,null);case 2:return t=`device/${e.id}/profile/`,n=null,a.p=3,a.n=4,l(zs.instance.fetchAPI(t,void 0,0));case 4:n=a.v,a.n=6;break;case 5:throw a.p=5,i=a.v,$n.error(go(i.status,t)),i;case 6:if(!n){a.n=7;break}return Qr.setCustomerJourneyState(n.customer_journey_state),a.a(2,n.customer_journey_state);case 7:return a.a(2,null)}}),null,null,[[3,5]],Promise)}}])}();ic.instance=new ic;var ac=function(){return p((function e(){h(this,e),this.inMemoryAnonymousMode=!1,qu=this}),[{key:"setInMemoryAnonymousMode",value:function(e){this.inMemoryAnonymousMode=e,$n.info(`In-memory anonymous mode ${e?"enabled":"disabled"} due to failed device registration`)}},{key:"isInMemoryAnonymousMode",value:function(){return this.inMemoryAnonymousMode}},{key:"isAnonymousMode",value:function(){return Qr.getAnonymousMode()||this.inMemoryAnonymousMode}},{key:"init",value:function(e){return T((function(t){for(;;)switch(t.n){case 0:return this.setInitialValues(e),Yu.instance.fetchConfig(),t.n=1,l(this.initAndFetchRequiredData(e));case 1:Qu.instance.startSession();case 2:return t.a(2)}}),null,this,null,Promise)}},{key:"setInitialValues",value:function(e){var t=y({},e);delete t.initialConfig,Qr.clearSessionId(),Qr.setNamiConfig(t),Qr.setLanguageCode(e.namiLanguageCode),Qr.setPurchaseChannel(e.purchaseChannel);var n=e.initialConfig;if(n.appConfig||n.platform_config){var i=(null==n?void 0:n.appConfig)||(null==n?void 0:n.platform_config);i&&Qr.setAppConfig(it,i)}null!=n&&n.paywalls&&Qr.setPaywalls(st,n.paywalls),null!=n&&n.products&&Qr.setProducts(lt,n.products)}},{key:"initAnonymousDevice",value:function(){return{deviceId:Vu.instance.getOrCreateAnonymousUUID(),deviceTask:null}}},{key:"initIdentifiedDevice",value:function(e){var t=y({},hu(e.namiCommands),e.formFactor?{form_factor:e.formFactor}:{}),n=function(e){if(e){var t=e.find((e=>e.startsWith("splitPosition=")));if(t){var n=t.split("=")[1],i=Number(n);return n&&!isNaN(i)?yu(i):void 0}}}(e.namiCommands),i=Vu.instance.createOrUpdateDevice(t,n,this);return{deviceId:i.id,deviceTask:i.device}}},{key:"initAndFetchRequiredData",value:function(e,t=0,n=1){var i,a,r,o,s,u,d,h,c,m,f;return T((function(v){for(;;)switch(v.n){case 0:if(o=e.initialConfig,s=null!==(i=e.formFactor)&&void 0!==i?i:cu(),u=this.isAnonymousMode(),d=u?this.initAnonymousDevice():this.initIdentifiedDevice(e),h=d.deviceId,c=d.deviceTask,m=pu(h),o.campaign_rules&&Qr.setCampaignRules(rt,Eu(o.campaign_rules,m,s)),!c){v.n=1;break}return v.n=1,l(c);case 1:if(Uu.instance.configure(s,m,e.namiCommands),f=Promise.all([Xu.instance.fetchProducts(),ic.instance.fetchCustomerJourneyState(),nc.instance.fetchActiveEntitlements(),Ku.instance.fetchPaywalls().then((e=>Uu.instance.fetchCampaignRules(e)))]).catch((i=>{var a;return T((function(r){for(;;)switch(r.n){case 0:if(!(i instanceof to)){r.n=3;break}if(Qr.resetDevice(),!(t<n)){r.n=2;break}return a=100*Math.pow(2,t),r.n=1,l(new Promise((e=>setTimeout(e,a))));case 1:return r.a(2,this.initAndFetchRequiredData(e,t+1,n));case 2:if(u){r.n=3;break}return $n.warn(`Max retries reached for ConflictError. ${i.message}`),this.setInMemoryAnonymousMode(!0),r.a(2,this.initAndFetchRequiredData(e,0,n));case 3:throw i;case 4:return r.a(2)}}),null,this,null,Promise)})),null!==(a=o.campaign_rules)&&void 0!==a&&a.length&&null!==(r=o.paywalls)&&void 0!==r&&r.length){v.n=2;break}return v.n=2,l(f);case 2:f.then((()=>this.reRenderPaywall()));case 3:return v.a(2)}}),null,this,null,Promise)}},{key:"reRenderPaywall",value:function(){if("undefined"!=typeof document){var e=document.querySelector("nami-paywall");null==e||e.setPaywallData()}}}])}();function rc(e){return Array.isArray(e)?e.map(rc):e&&"object"==typeof e?Object.entries(e).reduce(((e,[t,n])=>(void 0!==n&&(e[t]=rc(n)),e)),{}):e}ac.instance=new ac;var oc,sc=!0,uc=!1;function lc(){var e;if("function"==typeof(null===(e=window.VIZIO)||void 0===e||null===(e=e.Chromevox)||void 0===e?void 0:e.isEnabled))try{var t;sc=null===(t=window.VIZIO)||void 0===t||null===(t=t.Chromevox)||void 0===t?void 0:t.isEnabled()}catch(e){}}function dc(){var e;return"undefined"!=typeof window&&void 0!==window.VIZIO&&"function"==typeof(null===(e=window.VIZIO)||void 0===e||null===(e=e.Chromevox)||void 0===e?void 0:e.play)}function hc(e){e.isTrusted&&lc()}function cc(e){e.isTrusted&&(sc=!1)}function mc(e){if(e&&dc()&&sc)try{var t;null===(t=window.VIZIO)||void 0===t||null===(t=t.Chromevox)||void 0===t||t.play(e)}catch(e){}}var fc=function(){function e(){h(this,e),oc.set(this,!1)}return p(e,[{key:"isInitialized",get:function(){return he(this,oc,"f")||null!=Qr.getNamiConfig()}},{key:"initializeSDK",value:function(e){var t,n,i,a,r,o,s;return T((function(u){for(;;)switch(u.n){case 0:if(t=!1,n=!1,i=he(this,oc,"f")?Qr.getNamiConfig():null,$n.setLogger(e.logLevel),null===i){u.n=3;break}if(delete(a=y({},e)).initialConfig,d=i,!Gu(rc(a),rc(d))){u.n=1;break}return $n.warn("Nami SDK is already configured, ignoring this configure call."),u.a(2,{sdkInitialized:!0,configureState:kn});case 1:n=!0;case 2:r=Fs(e.namiCommands),o=Fs(i.namiCommands),e.appPlatformID==i.appPlatformID&&r==o||(t=!0),e.namiLanguageCode===i.namiLanguageCode&&e.logLevel==i.logLevel||(n=!0);case 3:return t&&($n.info("SDK full reconfigure called"),Qr.resetDevice()),ce(this,oc,!0,"f"),zs.configure(e),u.n=4,l(ac.instance.init(e));case 4:return $n.info("SDK successfully initialized!"),s=n||t?bn:gn,!uc&&dc()&&(window.addEventListener("VIZIO_TTS_ENABLED",hc),window.addEventListener("VIZIO_TTS_DISABLED",cc),uc=!0,lc()),u.a(2,{sdkInitialized:!0,configureState:s})}var d}),null,this,null,Promise)}}],[{key:"sdkVersion",value:function(){return ge}},{key:"configure",value:function(t){return T((function(n){for(;;)switch(n.n){case 0:if(t.appPlatformID){n.n=1;break}throw new io;case 1:return this.setInitialConfig(t),n.n=2,l(e.instance.initializeSDK(t));case 2:return n.a(2,n.v)}}),null,this,null,Promise)}},{key:"setInitialConfig",value:function(e){if(null!=e.initialConfig){if("string"==typeof e.initialConfig){$n.warn("[DEPRECATED] NamiConfiguration.initialConfig should be an object");var t=function(e){var t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return JSON.parse(t)}catch(e){return}}(e.initialConfig);if(!t)return $n.error("Failed to parse NamiConfiguration.initialConfig"),void(e.initialConfig={});e.initialConfig=t}if("object"!=typeof e.initialConfig)e.initialConfig={};else if((e=>"object"==typeof e&&"initial_config"in e)(e.initialConfig)){var n=Os(e.initialConfig.initial_config);n?e.initialConfig=n:(e.initialConfig={},$n.error("Failed to parse NamiConfiguration.initialConfig as base64-gzipped JSON"))}}else e.initialConfig={}}}])}();oc=new WeakMap,fc.instance=new fc;var vc,pc,gc,yc=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)},bc=globalThis,wc=bc.ShadowRoot&&(void 0===bc.ShadyCSS||bc.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,kc=Symbol(),Sc=new WeakMap,Ec=function(){return p((function e(t,n,i){if(h(this,e),this._$cssResult$=!0,i!==kc)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}),[{key:"styleSheet",get:function(){var e=this.o,t=this.t;if(wc&&void 0===e){var n=void 0!==t&&1===t.length;n&&(e=Sc.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Sc.set(t,e))}return e}},{key:"toString",value:function(){return this.cssText}}])}(),Mc=(e,t)=>{if(wc)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(var n,i=g(t);!(n=i()).done;){var a=n.value,r=document.createElement("style"),o=bc.litNonce;void 0!==o&&r.setAttribute("nonce",o),r.textContent=a.cssText,e.appendChild(r)}},Pc=wc?e=>e:e=>e instanceof CSSStyleSheet?(e=>{for(var t,n="",i=g(e.cssRules);!(t=i()).done;){n+=t.value.cssText}return(e=>new Ec("string"==typeof e?e:e+"",void 0,kc))(n)})(e):e,Tc=Object.is,_c=Object.defineProperty,Dc=Object.getOwnPropertyDescriptor,Ac=Object.getOwnPropertyNames,xc=Object.getOwnPropertySymbols,Cc=Object.getPrototypeOf,Ic=globalThis,Lc=Ic.trustedTypes,Fc=Lc?Lc.emptyScript:"",Rc=Ic.reactiveElementPolyfillSupport,Wc=(e,t)=>e,Oc={toAttribute(e,t){switch(t){case Boolean:e=e?Fc:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){var n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},Nc=(e,t)=>!Tc(e,t),jc={attribute:!0,type:String,converter:Oc,reflect:!1,useDefault:!1,hasChanged:Nc};null!==(vc=Symbol.metadata)&&void 0!==vc||(Symbol.metadata=Symbol("metadata")),null!==(pc=Ic.litPropertyMetadata)&&void 0!==pc||(Ic.litPropertyMetadata=new WeakMap);var $c=function(){function e(){var t;return h(this,e),(t=d(this,e))._$Ep=void 0,t.isUpdatePending=!1,t.hasUpdated=!1,t._$Em=null,t._$Ev(),t}return k(e,I(HTMLElement)),p(e,[{key:"_$Ev",value:function(){var e;this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),null===(e=this.constructor.l)||void 0===e||e.forEach((e=>e(this)))}},{key:"addController",value:function(e){var t,n;(null!==(t=this._$EO)&&void 0!==t?t:this._$EO=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&(null===(n=e.hostConnected)||void 0===n||n.call(e))}},{key:"removeController",value:function(e){var t;null===(t=this._$EO)||void 0===t||t.delete(e)}},{key:"_$E_",value:function(){for(var e,t=new Map,n=g(this.constructor.elementProperties.keys());!(e=n()).done;){var i=e.value;this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i])}t.size>0&&(this._$Ep=t)}},{key:"createRenderRoot",value:function(){var e,t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return Mc(t,this.constructor.elementStyles),t}},{key:"connectedCallback",value:function(){var e,t;null!==(e=this.renderRoot)&&void 0!==e||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$EO)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}},{key:"enableUpdating",value:function(e){}},{key:"disconnectedCallback",value:function(){var e;null===(e=this._$EO)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}},{key:"attributeChangedCallback",value:function(e,t,n){this._$AK(e,n)}},{key:"_$ET",value:function(e,t){var n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(void 0!==i&&!0===n.reflect){var a,r=(void 0!==(null===(a=n.converter)||void 0===a?void 0:a.toAttribute)?n.converter:Oc).toAttribute(t,n.type);this._$Em=e,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}},{key:"_$AK",value:function(e,t){var n=this.constructor,i=n._$Eh.get(e);if(void 0!==i&&this._$Em!==i){var a,r,o,s=n.getPropertyOptions(i),u="function"==typeof s.converter?{fromAttribute:s.converter}:void 0!==(null===(a=s.converter)||void 0===a?void 0:a.fromAttribute)?s.converter:Oc;this._$Em=i;var l=u.fromAttribute(t,s.type);this[i]=null!==(r=null!=l?l:null===(o=this._$Ej)||void 0===o?void 0:o.get(i))&&void 0!==r?r:l,this._$Em=null}}},{key:"requestUpdate",value:function(e,t,n){if(void 0!==e){var i,a,r=this.constructor,o=this[e];if(null!=n||(n=r.getPropertyOptions(e)),!((null!==(i=n.hasChanged)&&void 0!==i?i:Nc)(o,t)||n.useDefault&&n.reflect&&o===(null===(a=this._$Ej)||void 0===a?void 0:a.get(e))&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}},{key:"C",value:function(e,t,{useDefault:n,reflect:i,wrapped:a},r){var o,s,u;n&&!(null!==(o=this._$Ej)&&void 0!==o?o:this._$Ej=new Map).has(e)&&(this._$Ej.set(e,null!==(s=null!=r?r:t)&&void 0!==s?s:this[e]),!0!==a||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===i&&this._$Em!==e&&(null!==(u=this._$Eq)&&void 0!==u?u:this._$Eq=new Set).add(e))}},{key:"_$EP",value:function(){var e,t;return T((function(n){for(;;)switch(n.p=n.n){case 0:return this.isUpdatePending=!0,n.p=1,n.n=2,l(this._$ES);case 2:n.n=4;break;case 3:n.p=3,t=n.v,Promise.reject(t);case 4:if(e=this.scheduleUpdate(),!(null!=e)){n.n=5;break}return n.n=5,l(e);case 5:return n.a(2,!this.isUpdatePending)}}),null,this,[[1,3]],Promise)}},{key:"scheduleUpdate",value:function(){return this.performUpdate()}},{key:"performUpdate",value:function(){if(this.isUpdatePending){if(!this.hasUpdated){var e;if(null!==(e=this.renderRoot)&&void 0!==e||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(var t,n=g(this._$Ep);!(t=n()).done;){var i=t.value,a=i[0],r=i[1];this[a]=r}this._$Ep=void 0}var o=this.constructor.elementProperties;if(o.size>0)for(var s,u=g(o);!(s=u()).done;){var l=s.value,d=l[0],h=l[1],c=h.wrapped,m=this[d];!0!==c||this._$AL.has(d)||void 0===m||this.C(d,void 0,h,m)}}var f=!1,v=this._$AL;try{var p;(f=this.shouldUpdate(v))?(this.willUpdate(v),null!==(p=this._$EO)&&void 0!==p&&p.forEach((e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(v)):this._$EM()}catch(v){throw f=!1,this._$EM(),v}f&&this._$AE(v)}}},{key:"willUpdate",value:function(e){}},{key:"_$AE",value:function(e){var t;null!==(t=this._$EO)&&void 0!==t&&t.forEach((e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}},{key:"_$EM",value:function(){this._$AL=new Map,this.isUpdatePending=!1}},{key:"updateComplete",get:function(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function(){return this._$ES}},{key:"shouldUpdate",value:function(e){return!0}},{key:"update",value:function(e){this._$Eq&&(this._$Eq=this._$Eq.forEach((e=>this._$ET(e,this[e])))),this._$EM()}},{key:"updated",value:function(e){}},{key:"firstUpdated",value:function(e){}}],[{key:"addInitializer",value:function(e){var t;this._$Ei(),(null!==(t=this.l)&&void 0!==t?t:this.l=[]).push(e)}},{key:"observedAttributes",get:function(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}},{key:"createProperty",value:function(e,t=jc){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){var n=Symbol(),i=this.getPropertyDescriptor(e,n,t);void 0!==i&&_c(this.prototype,e,i)}}},{key:"getPropertyDescriptor",value:function(e,t,n){var i,a=null!==(i=Dc(this.prototype,e))&&void 0!==i?i:{get(){return this[t]},set(e){this[t]=e}},r=a.get,o=a.set;return{get:r,set(t){var i=null==r?void 0:r.call(this);null!=o&&o.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(e){var t;return null!==(t=this.elementProperties.get(e))&&void 0!==t?t:jc}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty(Wc("elementProperties"))){var e=Cc(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty(Wc("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Wc("properties")))for(var e=this.properties,t=0,n=[...Ac(e),...xc(e)];t<n.length;t++){var i=n[t];this.createProperty(i,e[i])}var a=this[Symbol.metadata];if(null!==a){var r=litPropertyMetadata.get(a);if(void 0!==r)for(var o,s=g(r);!(o=s()).done;){var u=o.value,l=u[0],d=u[1];this.elementProperties.set(l,d)}}this._$Eh=new Map;for(var h,c=g(this.elementProperties);!(h=c()).done;){var m=h.value,f=m[0],v=m[1],p=this._$Eu(f,v);void 0!==p&&this._$Eh.set(p,f)}this.elementStyles=this.finalizeStyles(this.styles)}}},{key:"finalizeStyles",value:function(e){var t=[];if(Array.isArray(e))for(var n,i=g(new Set(e.flat(1/0).reverse()));!(n=i()).done;){var a=n.value;t.unshift(Pc(a))}else void 0!==e&&t.push(Pc(e));return t}},{key:"_$Eu",value:function(e,t){var n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}}])}();$c.elementStyles=[],$c.shadowRootOptions={mode:"open"},$c[Wc("elementProperties")]=new Map,$c[Wc("finalized")]=new Map,null!=Rc&&Rc({ReactiveElement:$c}),(null!==(gc=Ic.reactiveElementVersions)&&void 0!==gc?gc:Ic.reactiveElementVersions=[]).push("2.1.1");var zc={attribute:!0,type:String,converter:Oc,reflect:!1,hasChanged:Nc},Bc=(e=zc,t,n)=>{var i=n.kind,a=n.metadata,r=globalThis.litPropertyMetadata.get(a);if(void 0===r&&globalThis.litPropertyMetadata.set(a,r=new Map),"setter"===i&&((e=Object.create(e)).wrapped=!0),r.set(n.name,e),"accessor"===i){var o=n.name;return{set(n){var i=t.get.call(this);t.set.call(this,n),this.requestUpdate(o,i,e)},init(t){return void 0!==t&&this.C(o,void 0,e,t),t}}}if("setter"===i){var s=n.name;return function(n){var i=this[s];t.call(this,n),this.requestUpdate(s,i,e)}}throw Error("Unsupported decorator location: "+i)};function Hc(e){return(t,n)=>"object"==typeof n?Bc(e,t,n):((e,t,n)=>{var i=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),i?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function Uc(e){return Hc(y({},e,{state:!0,attribute:!1}))}function Gc(e){return!e||"object"==typeof e&&0==Object.keys(e).length}var Vc,Xc="entry",Kc="screen",Yc="branch",qc="exit",Jc="unknown";!function(e){e.NAVIGATE="flowNav",e.BACK="flowPrev",e.NEXT="flowNext",e.FINISHED="flowDone",e.DISMISS="flowDismiss",e.EXIT="flowExit",e.HANDOFF="flowHandoff",e.TRACK="trackEvent",e.LOG="logEvent",e.SET_VIDEO="setVideo",e.FLOW_EVENT="flowEvent",e.BLOCK_BACK="blockBackToStep",e.FLOW_ENABLED="flowInteractionEnabled",e.FLOW_DISABLED="flowInteractionDisabled",e.SET_TAGS="setTags",e.PAUSE="flowPause",e.RESUME="flowResume"}(Vc||(Vc={}));var Qc="__handoff_sequence__",Zc="__buy_sku__",em="__default__",tm="__appear__",nm="__disappear__",im="__login_success__",am="__login_failure__",rm="__logout_success__",om="__logout_failure__",sm="__purchase_success__",um="__remoteback__",lm="__tag_update__",dm="and",hm="or",cm="i_contains",mm="equals",fm="i_equals",vm="not_equals",pm="not_i_equals",gm="not_contains",ym="set",bm="notSet",wm=function(){function e(){h(this,e),this.resolvers=new Map,this.namespaceResolvers=new Map}return p(e,[{key:"registerNamespaceResolver",value:function(e,t){this.namespaceResolvers.set(e,t)}},{key:"resetResolvers",value:function(){this.resolvers.clear()}},{key:"evaluate",value:function(e){var t,n=null!==(t=e.filter)&&void 0!==t?t:[];if(0===n.length)return!0;var i=n.map((e=>this.evaluateFilter(e)));switch(e.operator){case dm:return i.every((e=>e));case hm:return i.some((e=>e));default:return i.every((e=>e))}}},{key:"evaluateOrdered",value:function(e){var t;if(!e)return!0;var n=null!==(t=e.filter)&&void 0!==t?t:[];if(0===n.length)return!0;switch(e.operator){case dm:for(var i,a=g(n);!(i=a()).done;){var r=i.value;if(!this.evaluateFilter(r))return!1}return!0;case hm:for(var o,s=g(n);!(o=s()).done;){var u=o.value;if(this.evaluateFilter(u))return!0}return!1;default:for(var l,d=g(n);!(l=d()).done;){var h=l.value;if(!this.evaluateFilter(h))return!1}return!0}}},{key:"evaluateFilter",value:function(e){var t=this.resolve(e.identifier);if(e.operator===ym)return null!=t;if(e.operator===bm)return null==t;if(null==t)return!![vm,pm,gm].includes(e.operator);switch(e.operator){case cm:return Array.isArray(t)?e.values.some((e=>t.some((t=>0===t.localeCompare(e,void 0,{sensitivity:"accent"}))))):(this.log("Resolved value is not an array of strings for i_contains."),!1);case mm:return e.values.some((e=>{if("string"==typeof t)return t===e;if("boolean"==typeof t){var n="true"===e.toLowerCase();return t===n}return this.log("Unsupported type for equals comparison: "+typeof t),!1}));case fm:return e.values.some((e=>{if("string"==typeof t)return 0===t.localeCompare(e,void 0,{sensitivity:"accent"});if("boolean"==typeof t){var n="true"===e.toLowerCase();return t===n}return this.log("Unsupported type for i_equals comparison: "+typeof t),!1}));case vm:return e.values.every((e=>"string"!=typeof t||t!==e));case pm:return e.values.every((e=>"string"!=typeof t||0!==t.localeCompare(e,void 0,{sensitivity:"accent"})));case gm:return e.values.every((e=>"string"!=typeof t||!t.includes(e)));default:return this.log(`Unsupported operator: ${e.operator}`),!1}}},{key:"resolve",value:function(e){var t=this.resolveRaw(e);if(void 0!==t)return t;var n=e.lastIndexOf(".");if(-1!==n){var i=e.slice(0,n),a=e.slice(n+1),r=this.resolveRaw(i);return void 0!==r?this.extractProperty(a,r):void this.log(`Could not resolve base identifier: ${i}`)}}},{key:"resolveRaw",value:function(e){for(var t,n=[...this.namespaceResolvers.keys()].sort(((e,t)=>t.length-e.length)),i=g(n);!(t=i()).done;){var a=t.value;if(e.startsWith(a)){var r=this.namespaceResolvers.get(a);if(r)return r(e)}}}},{key:"extractProperty",value:function(e,t){switch(e){case"last":if(Array.isArray(t))return t[t.length-1];break;case"first":if(Array.isArray(t))return t[0];break;case"count":if(Array.isArray(t))return t.length;if(t&&"object"==typeof t)return Object.keys(t).length;break;default:return}this.log(`Could not extract .${e} from type ${typeof t}`)}},{key:"log",value:function(e){$n.debug(`[NamiConditionEvaluator] ${e}`)}}],[{key:"shared",get:function(){return e.instance||(e.instance=new e),e.instance}}])}(),km=function(){return p((function e(){h(this,e)}),[{key:"register",value:function(){wm.shared.registerNamespaceResolver(this.namespace,(e=>{var t=e.replace(new RegExp(`^${this.namespace}\\.`),"");return this.resolveValue(t)}))}},{key:"resolveKeyPath",value:function(e,t){for(var n,i=t,a=g(e.replace(/\[(\w+)\]/g,".$1").split(".").filter(Boolean));!(n=a()).done;){var r=n.value;if(null==i||"object"!=typeof i)return;i=i[r]}return i}}])}(),Sm=function(){function e(t){var n;return h(this,e),(n=d(this,e)).namespace="LaunchContext",n.context=t,n.register(),n}return k(e,km),p(e,[{key:"resolveValue",value:function(e){if(e.startsWith("customAttributes.")){var t=e.substring(17);return this.resolveKeyPath(t,this.context.customAttributes)}if(e.startsWith("customObject.")){var n=e.substring(13);return this.resolveKeyPath(n,this.context.customObject)}return this.resolveKeyPath(e,{customAttributes:this.context.customAttributes,customObject:this.context.customObject,productGroups:this.context.productGroups})}}])}(),Em=function(){function e(){var t,n,i,a;h(this,e),(a=d(this,e)).namespace="Device";var r=Intl.DateTimeFormat().resolvedOptions().locale.split("-")[1]||"",o=Intl.DateTimeFormat().resolvedOptions().timeZone,s=hu();return a.context={osName:s.os_name,osVersion:s.os_version,appVersion:s.extended_platform_version,sdkVersion:s.sdk_version,deviceModel:s.device_model,screenWidth:window.innerWidth,screenHeight:window.innerHeight,formFactor:s.form_factor,tvQuality:a.tvQuality(null!==(t=s.form_factor)&&void 0!==t?t:"desktop"),tvResolution:a.tvResolution(null!==(n=s.form_factor)&&void 0!==n?n:"desktop"),screenSize:a.screenSizeTier(null!==(i=s.form_factor)&&void 0!==i?i:"desktop"),language:s.language,country:r,timezone:o},a.register(),a}return k(e,km),p(e,[{key:"screenSizeTier",value:function(e){var t=window.screen.width,n=window.screen.height,i=window.devicePixelRatio||1,a=Math.round(t*i),r=Math.round(n*i),o=Math.max(a,r);switch(e){case"phone":return o<1136?"tiny":o<1334?"small":o<1920?"medium":o<2560?"large":"huge";case"tablet":return o<2048?"medium":o<2732?"large":"huge";case"television":return o<1920?"medium":o<3840?"large":"huge";case"desktop":return o<1440?"small":o<2560?"medium":o<3840?"large":"huge";default:return"medium"}}},{key:"tvQuality",value:function(e){if("television"!==e)return"";var t=window.screen.width,n=window.screen.height,i=window.devicePixelRatio||1,a=Math.round(t*i),r=Math.round(n*i),o=Math.max(a,r),s=Math.min(a,r);return o>=3840||s>=2160?"4K":o>=1920||s>=1080?"1080p":"720p"}},{key:"tvResolution",value:function(e){if("television"!==e)return"";var t=window.screen.width,n=window.screen.height,i=window.devicePixelRatio||1,a=Math.round(t*i),r=Math.round(n*i),o=Math.max(a,r),s=Math.min(a,r);return s<720&&o<1280?"SD":s>=720&&s<1080&&o>=1280&&o<1920?"720p":s>=1080&&s<1440&&o>=1920&&o<2560?"1080p":s>=1440&&s<2160&&o>=2560&&o<3840?"1440p":s>=2160&&s<3e3&&o>=3840&&o<5e3?"4K":s>=3e3&&o>=5e3?"8K":"Unknown"}},{key:"resolveValue",value:function(e){return this.resolveKeyPath(e,this.context)}}])}(),Mm=[/(^|_)api(_|$)?key/i,/^key$/i,/^token$/i,/id[_-]?token/i,/access[_-]?token/i,/^auth/i,/password/i,/secret/i,/signature/i,/hmac/i,/^jwt$/i,/^code$/i,/redirect[_-]?uri/i,/return[_-]?url/i,/^state$/i,/^session$/i,/^sid$/i,/^sso$/i,/assertion/i],Pm=function(){function e(){h(this,e),this.params={},"undefined"!=typeof window&&this.setSearchParams()}return p(e,[{key:"setSearchParams",value:function(){this.params=this.extractSafeParams()}},{key:"safeValue",value:function(e){if(!e)return null;try{var t=decodeURIComponent(e).trim();return!t||/^null|undefined$/i.test(t)||((e=>e.includes("://")||/^\/.*\?/.test(e))(t)||(e=>/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+$/.test(e))(t)||(e=>/^[A-Za-z0-9_-]{40,}$/.test(e)||/^[A-Fa-f0-9]{40,}$/.test(e)||/^ya29\./.test(e)||/^sk_/.test(e)||/^ghp_/.test(e))(t))?null:((e,t=128)=>e.length>t?e.slice(0,t):e)(t)}catch(e){return null}}},{key:"extractSafeParams",value:function(){var e=window.location,t={},n=new Set;try{for(var i,a=new URLSearchParams(e.search),r=(e,i)=>{var a=(e=>e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[-\s]/g,"_").toLowerCase())(e);if(!(n.size>=10||(e=>Mm.some((t=>t.test(e))))(a))){var r=this.safeValue(i);r&&(t[a]=r,n.add(a))}},o=g(a.entries());!(i=o()).done;){var s=i.value;r(s[0],s[1])}}catch(e){}return t}}],[{key:"instance",get:function(){return e._instance||(e._instance=new e),e._instance}},{key:"refresh",value:function(){"undefined"!=typeof window&&this.instance.setSearchParams()}}])}();Pm._instance=null;var Tm,_m=()=>Pm.instance.params,Dm=/\{\{\s*([^}]+?)\s*\}\}/g,Am=function(){return p((function e(t){h(this,e),this.flowManager=t,this.urlParams=_m()}),[{key:"resolve",value:function(e){var t,n,i,a,r,o,s,u,l,d,h,c,m=this.flowManager.currentFlow,f=null==m?void 0:m.component;if(e.startsWith("launchContext.")){var v,p=null===(v=this.flowManager.currentFlow)||void 0===v?void 0:v.context;if(p){var g=e.substring(14),y=new Sm(p).resolveValue(g);return null==y?void 0:y.toString()}}else switch(e){case"campaignId":return null==f||null===(t=f.campaign)||void 0===t?void 0:t.rule;case"campaignName":return null==f||null===(n=f.campaign)||void 0===n?void 0:n.name;case"campaignLabel":case"campaignPlacement":return null!==(i=null==f||null===(a=f.campaign)||void 0===a?void 0:a.value)&&void 0!==i?i:void 0;case"campaignSegment":case"campaignSegmentId":return null==f||null===(r=f.campaign)||void 0===r?void 0:r.segment;case"campaignExternalSegment":case"campaignExternalSegmentId":return null!==(o=null==f||null===(s=f.campaign)||void 0===s?void 0:s.external_segment)&&void 0!==o?o:void 0;case"pageName":return null==f||null===(u=f.paywall)||void 0===u?void 0:u.name;case"pageId":return null==f||null===(l=f.paywall)||void 0===l?void 0:l.id;case"flowName":return null==m?void 0:m.name;case"flowId":return null==m?void 0:m.id;case"objectId":return null==f||null===(d=f.campaign)||void 0===d||null===(d=d.flow)||void 0===d?void 0:d.object_id;case"stepName":return null==m||null===(h=m.currentFlowStep)||void 0===h?void 0:h.name;case"buttonText":return null==m||null===(c=m.currentButton)||void 0===c?void 0:c.firstTextValue();case"slideNumber":var b=null==f?void 0:f.getSelectedSlideIndexForCurrentCarousel();return null!=b?`${b+1}`:void 0;default:return}}},{key:"interpolateLiquidVariables",value:function(e){return e.replace(Dm,((e,t)=>{var n,i=null!==(n=this.resolve(t))&&void 0!==n?n:this.urlParams[t];return null!=i?i:""}))}},{key:"interpolateDeep",value:function(e){return"string"==typeof e?this.interpolateLiquidVariables(e):Array.isArray(e)?e.map((e=>this.interpolateDeep(e))):e&&"object"==typeof e?Object.entries(e).reduce(((e,[t,n])=>y({},e,{[t]:this.interpolateDeep(n)})),{}):e}}])}(),xm=function(){function e(){var t;return h(this,e),(t=d(this,e)).namespace="urlParams",t.context=_m(),t.register(),t}return k(e,km),p(e,[{key:"resolveValue",value:function(e){return $n.debug("[URLParamsResolver]","Resolving keyPath",e),this.resolveKeyPath(e,this.context)}}])}(),Cm=function(){function e(){var t;return h(this,e),(t=d(this,e)).namespace="state",t.register(),t}return k(e,km),p(e,[{key:"getContextProvider",value:function(){var e=Jh.providers;if(0!==e.length){var t=e.find((e=>e.flow));return t||e[e.length-1]}}},{key:"resolveValue",value:function(e){var t=this.getContextProvider();if(t){if(e.startsWith("formStates.")){var n=e.substring(11);return t.getCurrentFormId(n)}return this.resolveKeyPath(e,t.state)}}}])}(),Im=function(){function e(t){var n;return h(this,e),(n=d(this,e)).namespace="Placement",n.campaign=t,n.register(),n}return k(e,km),p(e,[{key:"resolveValue",value:function(e){var t;if("label"===e){if(this.campaign&&void 0!==this.campaign.value&&null!==this.campaign.value)return this.campaign.value;var n=Jh.providers;if(0!==n.length){var i=n.find((e=>e.flow));return i?i.getCurrentPlacementLabel():null===(t=n[n.length-1])||void 0===t?void 0:t.getCurrentPlacementLabel()}}}}])}(),Lm=function(){return p((function e(){h(this,e),this.load()}),[{key:"setExternalId",value:function(e){return this.externalId=e,this}},{key:"getExternalId",value:function(){return this.externalId}},{key:"isLoggedIn",value:function(){return!!this.externalId}},{key:"save",value:function(){return this.externalId?Qr.setNamiProfile({externalId:this.externalId}):Qr.removeNamiProfile(),this}},{key:"load",value:function(){var e=Qr.getNamiProfile();e&&(this.externalId=e.externalId),Jh.setIsLoggedIn(!!this.externalId)}},{key:"login",value:function(e){var t;return T((function(n){for(;;)switch(n.n){case 0:return n.n=1,l(zs.instance.login(e));case 1:(t=n.v).external_id&&Jh.setIsLoggedIn(!0),this.setExternalId(t.external_id).save();case 2:return n.a(2)}}),null,this,null,Promise)}},{key:"logout",value:function(){return T((function(e){for(;;)switch(e.n){case 0:return e.n=1,l(zs.instance.logout());case 1:Jh.setIsLoggedIn(!1),this.setExternalId(void 0).save();case 2:return e.a(2)}}),null,this,null,Promise)}}])}();Lm.instance=new Lm,function(e){e.LOGIN="login",e.LOGOUT="logout",e.ADVERTISING_ID_SET="advertising_id_set",e.ADVERTISING_ID_CLEARED="advertising_id_cleared",e.VENDOR_ID_SET="vendor_id_set",e.VENDOR_ID_CLEARED="vendor_id_cleared",e.CUSTOMER_DATA_PLATFORM_ID_SET="customer_data_platform_id_set",e.CUSTOMER_DATA_PLATFORM_ID_CLEARED="customer_data_platform_id_cleared",e.ANONYMOUS_MODE_ON="anonymous_mode_on",e.ANONYMOUS_MODE_OFF="anonymous_mode_off",e.NAMI_DEVICE_ID_SET="nami_device_id_set",e.NAMI_DEVICE_ID_CLEARED="nami_device_id_cleared"}(Tm||(Tm={}));var Fm=function(){return p((function e(){h(this,e),this.emitter=Hu.getInstance(),wm.shared.registerNamespaceResolver("UserTags",(t=>{var n=t.replace("UserTags.",""),i=e.getCustomerAttribute(n);if(null!=i){var a=i.toLowerCase();return"true"===a||"false"===a?"true"===a:isNaN(Number(i))?i:parseInt(i,10)}return null}))}),[{key:"isSDKInitialized",get:function(){return fc.instance.isInitialized}}],[{key:"isLoggedIn",value:function(){return Lm.instance.isLoggedIn()}},{key:"loggedInId",value:function(){return this.instance.isSDKInitialized||$n.debug(Pe),Lm.instance.getExternalId()}},{key:"login",value:function(e){var t,n,i,a,r,o,s;return T((function(u){for(;;)switch(u.p=u.n){case 0:if(this.instance.isSDKInitialized){u.n=1;break}throw t=new no,this.invokeStateHandler(Tm.LOGIN,!1,t),t;case 1:if(!this.inAnonymousMode()){u.n=2;break}throw n=new ho,this.invokeStateHandler(Tm.LOGIN,!1,n),n;case 2:return u.p=2,u.n=3,l(Lm.instance.login(e));case 3:return u.n=4,l(nc.instance.fetchActiveEntitlements());case 4:this.invokeStateHandler(Tm.LOGIN,!0),Om.instance.flowOpen&&(i=Om.instance.currentFlow,(a=null==i?void 0:i.currentFlowStep)&&i.executeLifecycle(a,im)),u.n=6;break;case 5:throw u.p=5,s=u.v,this.invokeStateHandler(Tm.LOGIN,!1,s),Om.instance.flowOpen&&(r=Om.instance.currentFlow,(o=null==r?void 0:r.currentFlowStep)&&r.executeLifecycle(o,am)),s;case 6:return u.a(2)}}),null,this,[[2,5]],Promise)}},{key:"logout",value:function(){var e,t,n,i,a,r,o;return T((function(s){for(;;)switch(s.p=s.n){case 0:if(this.instance.isSDKInitialized){s.n=1;break}throw e=new no,this.invokeStateHandler(Tm.LOGOUT,!1,e),e;case 1:if(!this.inAnonymousMode()){s.n=2;break}throw t=new ho,this.invokeStateHandler(Tm.LOGOUT,!1,t),t;case 2:return s.p=2,s.n=3,l(Lm.instance.logout());case 3:return s.n=4,l(nc.instance.fetchActiveEntitlements());case 4:this.invokeStateHandler(Tm.LOGOUT,!0),Om.instance.flowOpen&&(n=Om.instance.currentFlow,(i=null==n?void 0:n.currentFlowStep)&&n.executeLifecycle(i,rm)),s.n=6;break;case 5:throw s.p=5,o=s.v,this.invokeStateHandler(Tm.LOGOUT,!1,o),Om.instance.flowOpen&&(a=Om.instance.currentFlow,(r=null==a?void 0:a.currentFlowStep)&&a.executeLifecycle(r,om)),o;case 6:return s.a(2)}}),null,this,[[2,5]],Promise)}},{key:"setCustomerDataPlatformId",value:function(e){return T((function(t){for(;;)switch(t.n){case 0:return t.n=1,l(this.updateCustomerDataPlatformId(e));case 1:return t.a(2)}}),null,this,null,Promise)}},{key:"clearCustomerDataPlatformId",value:function(){return T((function(e){for(;;)switch(e.n){case 0:return e.n=1,l(this.updateCustomerDataPlatformId(null));case 1:return e.a(2)}}),null,this,null,Promise)}},{key:"registerAccountStateHandler",value:function(e){return this.instance.emitter.on("accountStateChange",e),()=>{this.instance.emitter.off("accountStateChange",e)}}},{key:"setAnonymousMode",value:function(e){var t,n,i,a,r;return T((function(o){for(;;)switch(o.n){case 0:if(t=e?Tm.ANONYMOUS_MODE_ON:Tm.ANONYMOUS_MODE_OFF,this.instance.isSDKInitialized){o.n=1;break}throw n=new no,this.invokeStateHandler(t,!1,n),n;case 1:if(this.anonymousModeCapability()){o.n=2;break}return $n.warn("Anonymous mode feature is not enabled for your Nami account. Contact support@nami.ml for details."),o.a(2);case 2:if(this.inAnonymousMode()!==e){o.n=3;break}return i=e?new uo:new lo,this.invokeStateHandler(t,!1,i),o.a(2);case 3:if(!e){o.n=4;break}Qr.setAnonymousMode(e),Qr.resetDevice(),this.refetchConfig(),this.invokeStateHandler(Tm.ANONYMOUS_MODE_ON,!0),o.n=6;break;case 4:return Qr.clearAnonymousMode(),r=null===(a=Qr.getNamiConfig())||void 0===a?void 0:a.namiCommands,o.n=5,l(Vu.instance.createOrUpdateDevice(hu(r)));case 5:Qr.clearAnonymousUUID(),this.refetchConfig(),this.invokeStateHandler(Tm.ANONYMOUS_MODE_OFF,!0);case 6:return o.a(2)}}),null,this,null,Promise)}},{key:"inAnonymousMode",value:function(){return!!this.instance.isSDKInitialized&&Ju()}},{key:"setCustomerAttribute",value:function(e,t){if(!this.instance.isSDKInitialized)throw new no;if(Qr.setCustomerAttribute(e,t),Rs(me.PAYWALL_PERSONALIZATION)?(Jh.setCustomerAttribute({[e]:t}),$n.debug(`This customer attribute you set is now available for paywall personalization using the smart text variable: ${e}`)):$n.warn(`The customer attribute ${e} is not available for using on a paywall, because your account's plan does not include paywall personalization. Contact support@nami.ml for details.`),Om.instance.flowOpen){var n=Om.instance.currentFlow;if(n){var i=n.currentFlowStep;i&&n.executeLifecycle(i,lm)}}}},{key:"getCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new no;var t=Qr.getCustomerAttribute(e);return null!=t?Rs(me.PAYWALL_PERSONALIZATION)?$n.debug(`Found customer attribute. ${e} is available for paywall personalization on this device.`):$n.warn(`Found customer attribute. ${e} is not available for use on a paywall because paywall personalization is not included in your account's plan. Contact support@nami.ml for details.`):$n.warn(`No ${e} customer attribute found.`),t}},{key:"getAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new no;return Qr.getAllCustomerAttributes()}},{key:"clearCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new no;Qr.clearCustomerAttribute(e)?(Jh.removeCustomerAttribute(e),$n.warn(`This customer attribute has been cleared. ${e} is no longer available for paywall personalization on this device. A default value will be used if set in the Nami Control Center.`)):$n.warn(`No value to clear for attribute ${e}.`)}},{key:"clearAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new no;Qr.getAllCustomerAttributesKeys().forEach((e=>{Jh.removeCustomerAttribute(e)})),Qr.clearAllCustomerAttributes(),$n.warn("All customer attribute have been cleared. customer's smart text will no longer be personalized for this device. A default value will be used if set in the Nami Control Center.")}},{key:"journeyState",value:function(){if(!this.instance.isSDKInitialized)throw new no;return Qr.getCustomerJourneyState()}},{key:"deviceId",value:function(){var e,t;return this.instance.isSDKInitialized&&null!==(e=null===(t=Qr.getDevice())||void 0===t?void 0:t.id)&&void 0!==e?e:Oe}},{key:"registerJourneyStateHandler",value:function(e){if(Ws("NamiCustomerManager.registerJourneyStateHandler"))return this.instance.emitter.addListener(An,e),()=>{this.instance.emitter.removeListener(An,e)}}},{key:"invokeStateHandler",value:function(e,t,n){this.instance.emitter.emit("accountStateChange",e,t,n)}},{key:"updateCustomerDataPlatformId",value:function(e){var t,n,i,a;return T((function(r){for(;;)switch(r.p=r.n){case 0:if(this.instance.isSDKInitialized){r.n=1;break}throw t=new no,this.invokeStateHandler(Tm.CUSTOMER_DATA_PLATFORM_ID_SET,!1,t),t;case 1:if(this.inAnonymousMode()){r.n=6;break}return r.p=2,r.n=3,l(Vu.instance.updateDeviceField("customer_data_platform_id",e));case 3:this.invokeStateHandler(Tm.CUSTOMER_DATA_PLATFORM_ID_SET,!0),r.n=5;break;case 4:r.p=4,a=r.v,this.invokeStateHandler(Tm.CUSTOMER_DATA_PLATFORM_ID_SET,!1,a);case 5:r.n=7;break;case 6:return $n.info("Unable to set CDP ID in anonymous mode",{deviceId:null===(n=Qr.getDevice())||void 0===n?void 0:n.id,anonymousMode:!0}),i=new co,this.invokeStateHandler(Tm.CUSTOMER_DATA_PLATFORM_ID_SET,!1,i),r.a(2);case 7:return r.a(2)}}),null,this,[[2,4]],Promise)}},{key:"anonymousModeCapability",value:function(){if(!this.instance.isSDKInitialized)return!1;var e=Rs(me.ANONYMOUS_MODE_CAPABILITY),t=Rs(me.THIRD_PARTY_TRANSACTIONS);return e&&t}},{key:"refetchConfig",value:function(){return T((function(e){for(;;)switch(e.n){case 0:if(!this.instance.isSDKInitialized){e.n=1;break}return e.n=1,l(Promise.all([Xu.instance.fetchProducts(),Ku.instance.fetchPaywalls().then((e=>Uu.instance.fetchCampaignRules(e)))]));case 1:return e.a(2)}}),null,this,null,Promise)}}])}();Fm.instance=new Fm;var Rm=function(){return p((function e(t={}){var n,i,a,r,o;h(this,e),this.id=null!==(n=t.id)&&void 0!==n?n:"",this.name=null!==(i=t.name)&&void 0!==i?i:"",this.steps=null!==(a=t.steps)&&void 0!==a?a:[],this.screens=null!==(r=t.screens)&&void 0!==r?r:[],this.resumeFromBookmark=Boolean(t.resume_from_bookmark),this.transition=null!==(o=t.transition)&&void 0!==o?o:"none"}),[{key:"allScreensAvailable",get:function(){return this.screens.length>0&&Xs(this.screens)}}])}(),Wm=function(){function e(t,n,i,a){var r,o;h(this,e),(o=d(this,e,[null!==(r=t.flow.object)&&void 0!==r?r:{}])).stepcrumbs=[],o.branchcrumbs=[],o.activeHandoffSequence=null,o.currentScreenState=null,o.isPaused=!1,o.timerStates={},o.campaign=t,o.component=n,o.context=a,o.manager=i,o.branchcrumbs=[],o.stepcrumbs=[],o.registerResolvers(a);var s=o.findStepByType(Xc);return s&&o.forward(s.id),o}return k(e,Rm),p(e,[{key:"registerResolvers",value:function(e){e&&new Sm(e),new Em,new xm,new Cm,new Im(this.campaign),wm.shared.registerNamespaceResolver("Flow",(e=>{switch(e){case"Flow.stepcrumbs":return this.stepcrumbs.map((e=>e.id));case"Flow.branchcrumbs":return this.branchcrumbs;default:return}}))}},{key:"currentFlowStep",get:function(){return this.stepcrumbs.at(-1)}},{key:"nextStepAvailable",get:function(){return void 0!==this.nextFlowStep}},{key:"previousStepAvailable",get:function(){var e,t=!!this.previousFlowStep,n=!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to),i=this.stepcrumbs.slice(0,-1).some((e=>"screen"===e.type));return t&&n&&i}},{key:"previousFlowStep",get:function(){var e=this.stepcrumbs.length-2;return e>=0?this.stepcrumbs[e]:void 0}},{key:"nextFlowStep",get:function(){return this.nextStep(this.currentFlowStep)}},{key:"getStep",value:function(e){return this.steps.find((t=>t.id===e))}},{key:"findStepByType",value:function(e){return this.steps.find((t=>t.type===e))}},{key:"isStepActive",value:function(e){return!e.branch_tags||!e.branch_tags.length||e.branch_tags.some((e=>this.branchcrumbs.includes(e)))}},{key:"finished",value:function(){this.manager.finishFlow()}},{key:"back",value:function(){this.previousStepAvailable?this.backToPreviousScreenStep():$n.debug("No previous step available")}},{key:"next",value:function(){var e=this.nextFlowStep;e&&this.forward(e.id)}},{key:"backToPreviousScreenStep",value:function(){var e;if(!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to)){for(var t=this.stepcrumbs.length-2;t>=0;t--){var n=this.stepcrumbs[t];if(this.stepcrumbs.pop(),"branch"===n.type&&this.branchcrumbs.length>0&&this.branchcrumbs.pop(),"screen"===n.type&&n.screen){var i,a,r=Vs(n.screen);return r&&this.component.flowNavigateToScreen(r,{transition:this.transition,direction:"backward"}),void(this.currentScreenState=null!==(i=null===(a=Jh.currentProvider)||void 0===a?void 0:a.state)&&void 0!==i?i:null)}}$n.warn("No previous screen step found to return to")}else $n.warn(`Not allowed to go back to ${this.previousFlowStep.id}`)}},{key:"forward",value:function(e){var t=this.getStep(e);if(t){if(this.isStepActive(t))switch(t.type){case Xc:case qc:return this.stepcrumbs.push(t),void this.executeLifecycle(t,em);case Yc:return void this.handleBranchStep(t);case Kc:return void this.handleScreenStep(t);case Jc:return}}else $n.error(`No step found with id: ${e}`)}},{key:"pause",value:function(){var e;this.isPaused?$n.info("Flow is already paused"):(this.isPaused=!0,this.pausedStepID=null===(e=this.currentFlowStep)||void 0===e?void 0:e.id,$n.info("Flow paused"))}},{key:"resumeFromPause",value:function(){if(this.isPaused)if(this.isPaused=!1,this.pausedStepID){var e=this.pausedStepID;this.pausedStepID=void 0,$n.info(`Flow resumed from step ${e}`),this.forward(e)}else $n.warn("No step to resume from");else $n.info("Flow is not paused")}},{key:"executeLifecycle",value:function(e,t,n){var i=e.actions[t];i&&this.executeFullLifecycles(i,n)}},{key:"lifecycles",value:function(e){if(this.currentFlowStep){var t=this.currentFlowStep.actions[e];if(t)return t;$n.info(`No actions found for button ${e} on step ${this.currentFlowStep.id}`)}}},{key:"triggerActions",value:function(e,t,n){var i=this.lifecycles(e);i&&(this.currentButton=t,this.executeFullLifecycles(i,n))}},{key:"executeFullLifecycles",value:function(e,t){for(var n,i=g(e);!(n=i()).done;){var a=n.value;[a.before,a.action,a.after].forEach((e=>null==e?void 0:e.forEach((e=>this.shouldRun(e)&&this.performAction(e,t)))))}}},{key:"triggerBeforeActions",value:function(e,t,n){var i=this.lifecycles(e);if(i){this.currentButton=t;for(var a,r=g(i);!(a=r()).done;){var o;null===(o=a.value.before)||void 0===o||o.forEach((e=>this.shouldRun(e)&&this.performAction(e,n)))}}}},{key:"triggerAfterActions",value:function(e,t,n){var i=this.lifecycles(e);if(i){this.currentButton=t;for(var a,r=g(i);!(a=r()).done;){var o;null===(o=a.value.after)||void 0===o||o.forEach((e=>this.shouldRun(e)&&this.performAction(e,n)))}}}},{key:"currentStepHasHoistedPrimaryActions",value:function(e){var t=this.lifecycles(e);return!!t&&t.some((e=>{var t;return null===(t=e.action)||void 0===t?void 0:t.length}))}},{key:"shouldRun",value:function(e){return!e.conditions||e.conditions.every((e=>wm.shared.evaluate(e)))}},{key:"performAction",value:function(e,t){var n;if(this.currentFlowStep){var i=(null!==(n=e.parameters)&&void 0!==n&&n.delay?+e.parameters.delay:0)||0,a=n=>{var i,a,r,o,s,u,l;if((null===(i=this.currentFlowStep)||void 0===i?void 0:i.id)===n)switch(e.function){case Vc.BACK:this.back();break;case Vc.NEXT:null!==(a=e.parameters)&&void 0!==a&&a.step?this.forward(e.parameters.step):this.next();break;case Vc.NAVIGATE:var d;if(null!==(r=e.parameters)&&void 0!==r&&r.step)(null===(d=this.previousFlowStep)||void 0===d?void 0:d.id)===e.parameters.step?this.back():this.forward(e.parameters.step);else this.next();break;case Vc.FINISHED:case Vc.DISMISS:this.finished();break;case Vc.EXIT:var h=this.steps.find((e=>e.type===qc));h&&this.forward(h.id);break;case Vc.PAUSE:this.pause();break;case Vc.RESUME:this.resumeFromPause();break;case Vc.HANDOFF:if(null!==(o=e.parameters)&&void 0!==o&&o.handoffTag)if(this.manager.handoffStepHandler)if(e.parameters.handoffData)$n.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} ${JSON.stringify(e.parameters.handoffData)}`),this.manager.handoffStepHandler(e.parameters.handoffTag,e.parameters.handoffData);else if(t)$n.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} ${JSON.stringify(t)}`),this.manager.handoffStepHandler(e.parameters.handoffTag,t);else if(e.parameters.handoffFormId){var c=this.getFormData();e.parameters.handoffTag===Qc?this.flowHandoffFormSequence():this.manager.handoffStepHandler(e.parameters.handoffTag,c)}else $n.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} and no data`),this.manager.handoffStepHandler(e.parameters.handoffTag);else $n.debug("No handoffStepHandler found",e);break;case Vc.LOG:var m;if(null!==(s=e.parameters)&&void 0!==s&&s.eventName)$n.info(`logEvent → ${e.parameters.eventName}`);else $n.warn(`Missing 'eventName' in logEvent action ${null!==(m=e.id)&&void 0!==m?m:"unknown"}`);break;case Vc.TRACK:var f;if(null!==(u=e.parameters)&&void 0!==u&&u.eventName)$n.info(`trackEvent → ${e.parameters.eventName}`);else $n.warn(`Missing 'eventName' in logEvent action ${null!==(f=e.id)&&void 0!==f?f:"unknown"}`);break;case Vc.SET_VIDEO:null!==(l=e.parameters)&&void 0!==l&&l.name&&e.parameters.url?Jh.setAppSuppliedVideoDetails({name:e.parameters.name,url:e.parameters.url}):$n.warn("Missing name, url for setting video details");break;case Vc.BLOCK_BACK:var v,p=null===(v=e.parameters)||void 0===v?void 0:v.step,g=p?this.getStep(p):void 0;g?g.allow_back_to=!1:this.currentFlowStep?this.currentFlowStep.allow_back_to=!1:$n.warn("Missing step for blocking back");break;case Vc.FLOW_EVENT:var y,b=new Am(this.manager),w=Object.fromEntries(Object.entries(null!==(y=e.parameters)&&void 0!==y?y:{}).map((([e,t])=>[e,b.interpolateDeep(t)])));this.manager.eventHandler?this.manager.eventHandler(w):$n.warn("Missing event handler",w);break;case Vc.FLOW_ENABLED:Jh.setUserInteractionEnabled(!0);break;case Vc.FLOW_DISABLED:Jh.setUserInteractionEnabled(!1);break;case Vc.SET_TAGS:e.parameters&&(Jh.setUserTags(e.parameters),Object.entries(e.parameters).forEach((([e,t])=>{Fm.setCustomerAttribute(e,t)})));break;default:$n.warn(`Missing action handler for ${e.function}`,e)}else $n.debug(`Skipped action for stale flow step ${n}`)};i?setTimeout(a.bind(this,this.currentFlowStep.id),i):a(this.currentFlowStep.id)}else $n.warn("No current flow step")}},{key:"nextStep",value:function(e){if(e){var t=this.steps.findIndex((t=>t.id===e.id));if(-1!==t){for(var n,i=g(this.steps.slice(t+1));!(n=i()).done;){var a=n.value;if(this.isStepActive(a))return a}$n.debug(`No active next step found after ${e.id}`)}else $n.error(`Could not find next step for step ${e.id}`)}else $n.error("Next step not found")}},{key:"handleScreenStep",value:function(e){var t,n=Vs(null!==(t=e.screen)&&void 0!==t?t:"");e.screen&&n&&this.campaign?(this.stepcrumbs.push(e),this.component.flowNavigateToScreen(n,{transition:this.transition,direction:"forward"})):$n.error("No paywall or campaign found for next step")}},{key:"handleBranchStep",value:function(e){this.stepcrumbs.push(e);for(var t=0,n=Object.entries(e.actions);t<n.length;t++){var i=n[t],a=i[0],r=i[1];if(r)for(var o,s=g(r);!(o=s()).done;){var u=o.value;if(u.action)for(var l,d=g(u.action);!(l=d()).done;){var h,c,m=l.value;if(this.shouldRun(m))return this.branchcrumbs.push(a),null===(h=u.before)||void 0===h||h.forEach((e=>{this.performAction(e)})),u.action.forEach((e=>{this.shouldRun(e)&&this.performAction(e)})),void(null===(c=u.after)||void 0===c||c.forEach((e=>{this.performAction(e)})))}else $n.warn(`No actions defined for branch tag ${a}`)}}$n.warn(`No matching branch condition matched for step ${e.id}`)}},{key:"getFormData",value:function(){var e,t;return y({},null!==(e=null===(t=Jh.currentProvider)||void 0===t||null===(t=t.state)||void 0===t?void 0:t.formStates)&&void 0!==e?e:{})}},{key:"flowHandoffFormSequence",value:function(){var e,t=null===(e=this.currentScreenState)||void 0===e?void 0:e.formStates;if(t){var n=Object.keys(t).sort();if(0!==n.length){var i=n.filter((e=>!0===t[e]));if(0===i.length)return $n.info("No eligible handoff keys after filtering"),void this.manager.resume();this.activeHandoffSequence={formStates:y({},t),remainingKeys:[...i]},this.resumeNextHandoff()}else $n.warn("formStates is empty, no handoffs to perform")}else $n.warn("No formStates available for handoff sequence")}},{key:"resumeNextHandoff",value:function(){var e,t,n=this.activeHandoffSequence;if(!n)return $n.warn("No active handoff sequence to resume"),void this.manager.resume();if(0===n.remainingKeys.length)return $n.info("All handoffs in the sequence are complete"),this.activeHandoffSequence=null,void this.manager.resume();var i=n.remainingKeys.shift(),a=n.formStates[i];$n.debug(`Starting handoff for ${i} → ${String(a)}`),this.activeHandoffSequence=n;var r=`${i}`;null===(e=(t=this.manager).handoffStepHandler)||void 0===e||e.call(t,r,void 0)}}])}(),Om=function(){function e(){h(this,e),this.flowOpen=!1,this.lastAnimatedFlowProgress=new Map,this.navGraphCache=new WeakMap}return p(e,[{key:"resume",value:function(){e.resume()}},{key:"presentFlow",value:function(e,t,n){var i=new Wm(e,t,this,n);return this.flowOpen=!0,this.currentFlow=i,i}},{key:"finishFlow",value:function(){this.flowOpen=!1,this.currentFlow=void 0,this.lastAnimatedFlowProgress.clear()}},{key:"getLastAnimatedFlowProgress",value:function(e){var t;return null!==(t=this.lastAnimatedFlowProgress.get(e))&&void 0!==t?t:0}},{key:"setLastAnimatedFlowProgress",value:function(e,t){this.currentFlow&&this.lastAnimatedFlowProgress.set(e,t)}},{key:"getCurrentFlowProgress",value:function(e){if(!this.currentFlow)return 1;if(!this.currentFlow.currentFlowStep)return 0;var t=this.currentFlow.steps.filter((e=>e.type===Kc));if(0===t.length)return 0;var n=this.currentFlow.stepcrumbs.filter((e=>e.type===Kc));if(0===n.length)return 0;var i=this.buildNavGraph(this.currentFlow),a=this.currentFlow.currentFlowStep,r=this.findBranchPoint(t,i),o=0;if(r)o=this.calculateBranchingProgress(n,t,a,r,i);else{var s=t.findIndex((e=>e.id===a.id));o=s>=0?(s+1)/t.length:0}return o=Math.max(0,Math.min(1,o)),e&&this.setLastAnimatedFlowProgress(e,o),o}},{key:"findBranchPoint",value:function(e,t){for(var n,i=g(e);!(n=i()).done;){var a=n.value;if(this.hasBranching(a,e,t))return a}return null}},{key:"calculateBranchingProgress",value:function(e,t,n,i,a){var r=e.length,o=t.findIndex((e=>e.id===i.id)),s=e.findIndex((e=>e.id===i.id)),u=t.findIndex((e=>e.id===n.id));if(-1===s||n.id===i.id)return(u+1)/(o+2);var l=this.countForwardScreens(n,t,a),d=r+l;return $n.debug(`Branching progress: visited=${r}, remaining=${l}, total=${d}, step=${n.id}`),r/d}},{key:"countForwardScreens",value:function(e,t,n){var i=t.findIndex((t=>t.id===e.id));if(-1===i)return 0;var a=new Set,r=0,o=(e,s)=>{if(!a.has(e)){a.add(e);var u=(n.get(e)||[]).filter((e=>{var n=t.findIndex((t=>t.id===e));return n>i}));if(0!==u.length)for(var l,d=g(u);!(l=d()).done;){var h=l.value;o(h,s+1)}else r=Math.max(r,s)}};return o(e.id,0),r}},{key:"hasBranching",value:function(e,t,n){var i=t.findIndex((t=>t.id===e.id));if(-1===i)return!1;var a=(n.get(e.id)||[]).filter((e=>{var n=t.findIndex((t=>t.id===e));return n>i}));return a.length>1}},{key:"buildNavGraph",value:function(e){var t=this.navGraphCache.get(e);if(t)return t;var n=new Map;e.steps.forEach((e=>{e.actions&&Object.values(e.actions).forEach((t=>{Array.isArray(t)&&t.forEach((t=>{t.action&&t.action.forEach((t=>{if("flowNav"===t.function){var i,a=null===(i=t.parameters)||void 0===i?void 0:i.step;a&&(n.has(e.id)||n.set(e.id,new Set),n.get(e.id).add(a))}}))}))}))}));var i=new Map;return n.forEach(((e,t)=>{i.set(t,Array.from(e))})),this.navGraphCache.set(e,i),i}},{key:"getCurrentFlowStepAutoAdvanceDelay",value:function(){var e,t,n=null===(e=this.currentFlow)||void 0===e?void 0:e.currentFlowStep;if(!n)return null;var i=null===(t=n.actions)||void 0===t?void 0:t[tm];if(!i)return null;for(var a,r=g(i);!(a=r()).done;)for(var o,s,u=g(null!==(o=a.value.action)&&void 0!==o?o:[]);!(s=u()).done;){var l,d=s.value;if((d.function===Vc.NAVIGATE||d.function===Vc.NEXT)&&null!=(null===(l=d.parameters)||void 0===l?void 0:l.delay)){var h=d.parameters.delay,c=Number(h);if(!isNaN(c)&&c>0)return c/1e3}}return null}}],[{key:"instance",get:function(){return e._instance||(e._instance=new e),e._instance}},{key:"registerStepHandoff",value:function(e){this.instance.handoffStepHandler=e}},{key:"registerEventHandler",value:function(e){this.instance.eventHandler=e}},{key:"resume",value:function(){var t=e.instance,n=t.flowOpen,i=t.currentFlow;if(n&&i&&i.currentFlowStep){if(i.activeHandoffSequence)return $n.debug(`Resuming flow at handoff sequence ${i.currentFlowStep.id}`),void i.resumeNextHandoff();$n.debug(`Resuming flow at step ${i.currentFlowStep.id}`),i.executeLifecycle(i.currentFlowStep,"__resume__")}else $n.warn("Cannot resume: no active flow or current step")}},{key:"finish",value:function(){var t=e.instance,n=t.flowOpen,i=t.currentFlow;n&&i&&i.currentFlowStep?($n.debug(`Finishing flow programmatically at step ${i.currentFlowStep.id}`),i.finished()):$n.debug("Cannot finish: no active flow or current step")}},{key:"pause",value:function(){var t=e.instance,n=t.flowOpen,i=t.currentFlow;n&&i&&i.currentFlowStep?!0===i.resumeFromBookmark?i.pause():$n.warn("This flow cannot be paused"):$n.warn("Cannot pause: no active flow or current step")}},{key:"isFlowOpen",value:function(){return e.instance.flowOpen}},{key:"getLastAnimatedFlowProgress",value:function(e){return this.instance.getLastAnimatedFlowProgress(e)}},{key:"setLastAnimatedFlowProgress",value:function(e,t){this.instance.setLastAnimatedFlowProgress(e,t)}},{key:"getCurrentFlowProgress",value:function(e){return this.instance.getCurrentFlowProgress(e)}},{key:"getCurrentFlowStepAutoAdvanceDelay",value:function(){return this.instance.getCurrentFlowStepAutoAdvanceDelay()}}])}();var Nm=e=>{var t;return T((function(n){for(;;)if(0===n.n)return t=new Set(Array.from(document.fonts.values()).map((e=>e.family))),e.forEach((e=>{var n=jm(e);if(!t.has(n)){var i=new FontFace(n,`url(${e.file})`);document.fonts.add(i)}})),n.a(2,document.fonts.ready.then())}),null,null,null,Promise)};function jm(e){return`${e.family}-${e.style}`.replace(/ /g,"")}function $m(e,t,n){var i,a,r,o,s,u,l,d;if("undefined"==typeof window||!e||!t)return $n.debug("Swipe detection is not supported in this environment."),{destroy(){},updateOptions(){}};var h={minDistance:null!==(i=null==n?void 0:n.minDistance)&&void 0!==i?i:30,maxDuration:null!==(a=null==n?void 0:n.maxDuration)&&void 0!==a?a:600,lockAxis:null===(r=null==n?void 0:n.lockAxis)||void 0===r||r,preventScrollOnSwipe:null!==(o=null==n?void 0:n.preventScrollOnSwipe)&&void 0!==o&&o,pointerTypes:null!==(s=null==n?void 0:n.pointerTypes)&&void 0!==s?s:["touch"],passiveListeners:null===(u=null==n?void 0:n.passiveListeners)||void 0===u||u,axisHint:null!==(l=null==n?void 0:n.axisHint)&&void 0!==l?l:"y",edgeLeakThreshold:null!==(d=null==n?void 0:n.edgeLeakThreshold)&&void 0!==d?d:24},c=e.style.touchAction;h.preventScrollOnSwipe&&(e.style.touchAction="none");var m=null,f=0,v=0,p=0,g=0,y=0,b=null,w=null,k=!1,S=!1,E=!1,M=e=>{try{var t=window.getComputedStyle(e);if(!t)return!1;var n=t.overflowY;if("auto"!==n&&"scroll"!==n)return!1;var i=e;return i.scrollHeight>i.clientHeight}catch(e){return!1}},P=e=>h.pointerTypes.includes(e.pointerType),T=t=>{var n=t.composedPath?t.composedPath()[0]:t.target;if(P(t)&&null===m){m=t.pointerId,f=p=t.clientX,v=g=t.clientY,y=performance.now(),b=null,E=!1,k=!1,S=!1,(w="y"===h.axisHint?((e,t)=>{for(var n=e;n&&n!==t&&n instanceof HTMLElement;){var i,a;if(M(n))return n;n=n.parentElement||(null!==(i=null===(a=n.parentNode)||void 0===a?void 0:a.host)&&void 0!==i?i:null)}return null})(n,e):null)||(S=!0);try{var i;null==e||null===(i=e.setPointerCapture)||void 0===i||i.call(e,t.pointerId)}catch(e){try{var a;null==n||null===(a=n.setPointerCapture)||void 0===a||a.call(n,t.pointerId)}catch(e){}}}},_=e=>{if(e.pointerId===m&&P(e)){if(p=e.clientX,g=e.clientY,h.lockAxis&&!b){var n=Math.abs(p-f),i=Math.abs(g-v);(n>2||i>2)&&(b=i>=n?"y":"x")}if("y"===h.axisHint&&("y"===b||!h.lockAxis)){var a=g-v,r=a<0?"up":"down",o=Math.abs(a),s=performance.now()-y,u=o/Math.max(s,1),l=o>=h.minDistance||u>.5;if(w)if(l)S=!0;else if(((e,t)=>!!e&&("down"===t?e.scrollTop>0:e.scrollTop+e.clientHeight<e.scrollHeight-1))(w,r)){if(!(("down"===r&&w.scrollTop<=50||"up"===r&&w.scrollTop+w.clientHeight>=w.scrollHeight-50)&&u>.3))return void(k=!0);S=!0}else S=!0;var d=!w||o>=h.edgeLeakThreshold;if(!E&&!k&&S&&d&&o>=h.minDistance){E=!0;var c=performance.now(),M={direction:"up"===r?"up":"down",distanceX:p-f,distanceY:a,absX:Math.abs(p-f),absY:o,duration:c-y,velocity:o/Math.max(c-y,1),startX:f,startY:v,endX:p,endY:g,startedAt:y,endedAt:c,originalEvent:e};t(M)}}}},D=e=>{if(e.pointerId===m)if(P(e))if(w)A();else if(E||k)A();else{var n,i=performance.now(),a=i-y,r=p-f,o=g-v,s=Math.abs(r),u=Math.abs(o),l="x"===(n=h.lockAxis&&b?b:"x"===h.axisHint?"x":"y"===h.axisHint?"y":s>=u?"x":"y")?s:u,d=a<=h.maxDuration,c=h.minDistance;if(w&&"y"===n&&S&&(c+=h.edgeLeakThreshold),d&&l>=c){var M;M="x"===n?r>0?"right":"left":o>0?"down":"up";var T=l/Math.max(a,1);t({direction:M,distanceX:r,distanceY:o,absX:s,absY:u,duration:a,velocity:T,startX:f,startY:v,endX:p,endY:g,startedAt:y,endedAt:i,originalEvent:e})}A()}else A()},A=()=>{m=null,b=null,y=0,w=null,S=!1,k=!1,E=!1},x=!!h.passiveListeners&&{passive:!0},C=h.passiveListeners?{passive:!0,capture:!0}:{capture:!0};e.addEventListener("pointerdown",T,C),e.addEventListener("pointermove",_,x),e.addEventListener("pointerup",D,x),e.addEventListener("pointercancel",D,x),e.addEventListener("lostpointercapture",D,x);return{destroy:()=>{e.removeEventListener("pointerdown",T,C),e.removeEventListener("pointermove",_,x),e.removeEventListener("pointerup",D,x),e.removeEventListener("pointercancel",D,x),e.removeEventListener("lostpointercapture",D,x),h.preventScrollOnSwipe&&(e.style.touchAction=c),A()},updateOptions:t=>{Object.assign(h,t),"boolean"==typeof t.preventScrollOnSwipe&&(t.preventScrollOnSwipe?e.style.touchAction="none":e.style.touchAction=c)}}}var zm,Bm,Hm,Um,Gm,Vm,Xm,Km,Ym,qm=e=>e,Jm=function(){function e(t,n,i){var a;return h(this,e),(a=d(this,e)).pages=[],a.currentOffset=0,a.formFactor=cu(),a.timeSpentOnPaywall=0,a.animation={transition:"none",direction:"forward"},a._originalBodyStyles={},a._originalDocumentStyles={},a.type=t,a.value=n,a.context=i,a.setPaywallData(),M(a,a)}return k(e,n),p(e,[{key:"setPaywallData",value:function(){var e=Au(this.value,this.type);this.paywall=e.paywall,this.campaign=e.campaign}},{key:"connectedCallback",value:function(){var t;x(e,"connectedCallback",this)([]),null!==(t=window.TVJS)&&void 0!==t&&t.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=this),document.addEventListener("keydown",this.handleKeyDownEvent.bind(this)),this._swipeHandler=$m(this,this.handleSwipeEvent.bind(this),{axisHint:"y",lockAxis:!0,minDistance:25,edgeLeakThreshold:15,preventScrollOnSwipe:!1,pointerTypes:["touch"]}),this.setOriginalStyles()}},{key:"disconnectedCallback",value:function(){var t;x(e,"disconnectedCallback",this)([]),Qr.clearLaunchId(),null!==(t=window.TVJS)&&void 0!==t&&t.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=document.body),document.removeEventListener("keydown",this.handleKeyDownEvent.bind(this)),Hu.getInstance().removeAllListeners(Pn),this.restoreStyles(),this._swipeHandler.destroy()}},{key:"setOriginalStyles",value:function(){"television"===this.formFactor&&(this._originalBodyStyles.overflow=document.body.style.overflow,document.body.style.overflow="hidden"),this._originalBodyStyles.background=document.body.style.background,"phone"===this.formFactor&&(this._originalBodyStyles["overscroll-behavior"]=document.body.style.overscrollBehavior?document.body.style.overscrollBehavior:null,this._originalDocumentStyles["overscroll-behavior"]=document.documentElement.style.overscrollBehavior?document.documentElement.style.overscrollBehavior:null,document.body.style.overscrollBehavior="none",document.documentElement.style.overscrollBehavior="none")}},{key:"restoreStyles",value:function(){Object.entries(this._originalBodyStyles).forEach((([e,t])=>{null!==t?document.body.style.setProperty(e,t):document.body.style.removeProperty(e)})),Object.entries(this._originalDocumentStyles).forEach((([e,t])=>{null!==t?document.documentElement.style.setProperty(e,t):document.documentElement.style.removeProperty(e)}))}},{key:"handleKeyDownEvent",value:function(e){!this.flow||10009!==e.keyCode&&"Backspace"!==e.key&&"GoBack"!==e.key||this.flow.triggerActions(um)}},{key:"handleSwipeEvent",value:function({direction:e}){var t;if("down"===e)null===(t=this.flow)||void 0===t||t.triggerActions("__swipe_down__");else if("up"===e){var n;null===(n=this.flow)||void 0===n||n.triggerActions("__swipe_up__")}}},{key:"firstUpdated",value:function(){this.timeSpentOnPaywall=Date.now(),Bs(this.campaign)&&(this.flow=Om.instance.presentFlow(this.campaign,this,this.context))}},{key:"getAnimationStyles",value:function(e){var t="backward"===this.animation.direction?-1:1;switch(this.animation.transition){case"verticalSlide":return`transform: translateY(${100*(e-this.currentOffset)*t}vh);`;case"slide":return`transform: translateX(${100*(e-this.currentOffset)*t}vw);`;case"fade":return`opacity: ${e===this.currentOffset?1:0};`;default:return""}}},{key:"updatePages",value:function(e){var t;return T((function(n){for(;;)switch(n.n){case 0:if(0!==this.pages.length&&"none"!==this.animation.transition){n.n=1;break}return this.pages=[e],n.a(2);case 1:if((null==(t=this.pages[this.pages.length-1])?void 0:t.id)!==e.id){n.n=2;break}return n.a(2);case 2:return this.pages=[t,e],this.currentOffset=0,n.n=3,l(this.updateComplete);case 3:requestAnimationFrame((()=>{this.currentOffset=1,setTimeout((()=>{this.pages=[e],this.currentOffset=0,this.paywall=e}),250)}));case 4:return n.a(2)}}),null,this,null,Promise)}},{key:"flowNavigateToScreen",value:function(e,t){var n,i;return T((function(a){for(;;)switch(a.n){case 0:return null!==(n=this.flow)&&void 0!==n&&n.previousFlowStep&&this.flow.executeLifecycle(this.flow.previousFlowStep,nm),this.animation=t,a.n=1,l(this.updatePages(e));case 1:null!==(i=this.flow)&&void 0!==i&&i.currentFlowStep&&this.flow.executeLifecycle(this.flow.currentFlowStep,tm);case 2:return a.a(2)}}),null,this,null,Promise)}},{key:"getSelectedSlideIndexForCurrentCarousel",value:function(){return Jh.getSelectedSlideIndex()}},{key:"renderFlow",value:function(){return"undefined"==typeof document?t(zm||(zm=qm``)):t(Bm||(Bm=qm`
|
|
1
|
+
import{css as e,html as t,LitElement as n,unsafeCSS as i,svg as a}from"lit";import{repeat as r}from"lit/directives/repeat.js";function o(e,t){this.v=e,this.k=t}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e){return new o(e,0)}function d(e,t,n){return t=w(t),M(e,S()?Reflect.construct(t,n||[],w(e).constructor):t.apply(e,n))}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!{}.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}(()=>{if("undefined"==typeof globalThis){var e="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:Function("return this")();Object.defineProperty(e,"globalThis",{value:e,writable:!0,enumerable:!1,configurable:!0})}})(),"undefined"!=typeof Element&&"function"!=typeof Element.prototype.getAttributeNames&&(Element.prototype.getAttributeNames=function(){for(var e=this.attributes,t=new Array(e.length),n=0;n<e.length;n+=1)t[n]=e[n].name;return t});var m=0;function f(e){return"__private_"+m+++"_"+e}function v(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,C(i.key),i)}}function p(e,t,n){return t&&v(e.prototype,t),n&&v(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function g(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e))||t){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},y.apply(null,arguments)}function b(){return b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=w(e)););return e}(e,t);if(i){var a=Object.getOwnPropertyDescriptor(i,t);return a.get?a.get.call(arguments.length<3?e:n):a.value}},b.apply(null,arguments)}function w(e){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},w(e)}function k(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&A(e,t)}function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(S=function(){return!!e})()}function E(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}function M(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return u(e)}function P(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function r(n,i,a,r){var u=i&&i.prototype instanceof s?i:s,l=Object.create(u.prototype);return D(l,"_invoke",function(n,i,a){var r,s,u,l=0,d=a||[],h=!1,c={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return r=t,s=0,u=e,c.n=n,o}};function m(n,i){for(s=n,u=i,t=0;!h&&l&&!a&&t<d.length;t++){var a,r=d[t],m=c.p,f=r[2];n>3?(a=f===i)&&(u=r[(s=r[4])?5:(s=3,3)],r[4]=r[5]=e):r[0]<=m&&((a=n<2&&m<r[1])?(s=0,c.v=i,c.n=r[1]):m<f&&(a=n<3||r[0]>i||i>f)&&(r[4]=n,r[5]=i,c.n=f,s=0))}if(a||n>1)return o;throw h=!0,i}return function(a,d,f){if(l>1)throw TypeError("Generator is already running");for(h&&1===d&&m(d,f),s=d,u=f;(t=s<2?e:u)||!h;){r||(s?s<3?(s>1&&(c.n=-1),m(s,u)):c.n=u:c.v=u);try{if(l=2,r){if(s||(a="next"),t=r[a]){if(!(t=t.call(r,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=r.return)&&t.call(r),s<2&&(u=TypeError("The iterator does not provide a '"+a+"' method"),s=1);r=e}else if((t=(h=c.n<0)?u:n.call(i,c))!==o)break}catch(t){r=e,s=1,u=t}finally{l=1}}return{value:t,done:h}}}(n,a,r),!0),l}var o={};function s(){}function u(){}function l(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(D(t={},i,(function(){return this})),t),h=l.prototype=s.prototype=Object.create(d);function c(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,D(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=l,D(h,"constructor",l),D(l,"constructor",u),u.displayName="GeneratorFunction",D(l,a,"GeneratorFunction"),D(h),D(h,a,"Generator"),D(h,i,(function(){return this})),D(h,"toString",(function(){return"[object Generator]"})),(P=function(){return{w:r,m:c}})()}function T(e,t,n,i,a){var r=function(e,t,n,i,a){return new _(P().w(e,t,n,i),a||Promise)}(e,t,n,i,a);return r.next().then((function(e){return e.done?e.value:r.next()}))}function _(e,t){function n(i,a,r,s){try{var u=e[i](a),l=u.value;return l instanceof o?t.resolve(l.v).then((function(e){n("next",e,r,s)}),(function(e){n("throw",e,r,s)})):t.resolve(l).then((function(e){u.value=e,r(u)}),(function(e){return n("throw",e,r,s)}))}catch(e){s(e)}}var i;this.next||(D(_.prototype),D(_.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),D(this,"_invoke",(function(e,a,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}),!0)}function D(e,t,n,i){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}D=function(e,t,n,i){function r(t,n){D(e,t,(function(e){return this._invoke(t,n,e)}))}t?a?a(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(r("next",0),r("throw",1),r("return",2))},D(e,t,n,i)}function A(e,t){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},A(e,t)}function x(e,t,n,i){var a=b(w(e.prototype),t,n);return"function"==typeof a?function(e){return a.apply(n,e)}:a}function C(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function I(e){var t="function"==typeof Map?new Map:void 0;return I=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(S())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,t);var a=new(e.bind.apply(e,i));return n&&A(a,n.prototype),a}(e,arguments,w(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),A(n,e)},I(e)}var L,F,R,W,O,N,j,$,z,B,H,U,G=function(){return p((function e(t){h(this,e),this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=t}),[{key:"shadowRoot",get:function(){return this.__host.__shadowRoot}},{key:"checkValidity",value:function(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}},{key:"reportValidity",value:function(){return!0}},{key:"setFormValue",value:function(){}},{key:"setValidity",value:function(){}}])}(),V=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},X=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},K=e=>{var t;return"boolean"==typeof e?e:null!==(t=null==e?void 0:e.capture)&&void 0!==t&&t},Y=function(){return p((function e(){h(this,e),this.__eventListeners=new Map,this.__captureEventListeners=new Map}),[{key:"addEventListener",value:function(e,t,n){var i;if(null!=t){var a=K(n)?this.__captureEventListeners:this.__eventListeners,r=a.get(e);if(void 0===r)r=new Map,a.set(e,r);else if(r.has(t))return;var o="object"==typeof n&&n?n:{};null===(i=o.signal)||void 0===i||i.addEventListener("abort",(()=>this.removeEventListener(e,t,n))),r.set(t,null!=o?o:{})}}},{key:"removeEventListener",value:function(e,t,n){if(null!=t){var i=K(n)?this.__captureEventListeners:this.__eventListeners,a=i.get(e);void 0!==a&&(a.delete(t),a.size||i.delete(e))}}},{key:"dispatchEvent",value:function(e){var t=[this],n=this.__eventTargetParent;if(e.composed)for(;n;)t.push(n),n=n.__eventTargetParent;else for(;n&&n!==this.__host;)t.push(n),n=n.__eventTargetParent;var i=!1,a=!1,r=0,o=null,s=null,u=null,l=e.stopPropagation,d=e.stopImmediatePropagation;Object.defineProperties(e,{target:y({get:()=>null!=o?o:s},J),srcElement:y({get:()=>e.target},J),currentTarget:y({get:()=>u},J),eventPhase:y({get:()=>r},J),composedPath:y({value:()=>t},J),stopPropagation:y({value:()=>{i=!0,l.call(e)}},J),stopImmediatePropagation:y({value:()=>{a=!0,d.call(e)}},J)});var h=(t,n,i)=>{"function"==typeof t?t(e):"function"==typeof(null==t?void 0:t.handleEvent)&&t.handleEvent(e),n.once&&i.delete(t)},c=()=>(u=null,r=0,!e.defaultPrevented),m=t.slice().reverse();o=this.__host&&e.composed?null:this;for(var f,v=e=>{for(s=this;s.__host&&e.includes(s.__host);)s=s.__host},p=g(m);!(f=p()).done;){var b=f.value;o||s&&s!==b.__host||v(m.slice(m.indexOf(b))),u=b,r=b===e.target?2:1;var w=b.__captureEventListeners.get(e.type);if(w)for(var k,S=g(w);!(k=S()).done;){var E=k.value;if(h(E[0],E[1],w),a)return c()}if(i)return c()}var M=e.bubbles?t:[this];s=null;for(var P,T=g(M);!(P=T()).done;){var _=P.value;o||s&&_!==s.__host||v(M.slice(0,M.indexOf(_)+1)),u=_,r=_===e.target?2:3;var D=_.__eventListeners.get(e.type);if(D)for(var A,x=g(D);!(A=x()).done;){var C=A.value;if(h(C[0],C[1],D),a)return c()}if(i)return c()}return c()}}])}(),q=Y,J={__proto__:null,enumerable:!0};Object.freeze(J);var Q=(B=function(){return p((function e(t,n={}){if(h(this,e),L.set(this,!1),F.set(this,!1),R.set(this,!1),W.set(this,!1),O.set(this,Date.now()),N.set(this,!1),j.set(this,void 0),$.set(this,void 0),z.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,0===arguments.length)throw new Error("The type argument must be specified");if("object"!=typeof n||!n)throw new Error('The "options" argument must be an object');var i=n.bubbles,a=n.cancelable,r=n.composed;V(this,L,!!a,"f"),V(this,F,!!i,"f"),V(this,R,!!r,"f"),V(this,j,`${t}`,"f"),V(this,$,null,"f"),V(this,z,!1,"f")}),[{key:"initEvent",value:function(e,t,n){throw new Error("Method not implemented.")}},{key:"stopImmediatePropagation",value:function(){this.stopPropagation()}},{key:"preventDefault",value:function(){V(this,W,!0,"f")}},{key:"target",get:function(){return X(this,$,"f")}},{key:"currentTarget",get:function(){return X(this,$,"f")}},{key:"srcElement",get:function(){return X(this,$,"f")}},{key:"type",get:function(){return X(this,j,"f")}},{key:"cancelable",get:function(){return X(this,L,"f")}},{key:"defaultPrevented",get:function(){return X(this,L,"f")&&X(this,W,"f")}},{key:"timeStamp",get:function(){return X(this,O,"f")}},{key:"composedPath",value:function(){return X(this,z,"f")?[X(this,$,"f")]:[]}},{key:"returnValue",get:function(){return!X(this,L,"f")||!X(this,W,"f")}},{key:"bubbles",get:function(){return X(this,F,"f")}},{key:"composed",get:function(){return X(this,R,"f")}},{key:"eventPhase",get:function(){return X(this,z,"f")?B.AT_TARGET:B.NONE}},{key:"cancelBubble",get:function(){return X(this,N,"f")},set:function(e){e&&V(this,N,!0,"f")}},{key:"stopPropagation",value:function(){V(this,N,!0,"f")}},{key:"isTrusted",get:function(){return!1}}])}(),L=new WeakMap,F=new WeakMap,R=new WeakMap,W=new WeakMap,O=new WeakMap,N=new WeakMap,j=new WeakMap,$=new WeakMap,z=new WeakMap,B.NONE=0,B.CAPTURING_PHASE=1,B.AT_TARGET=2,B.BUBBLING_PHASE=3,B);Object.defineProperties(Q.prototype,{initEvent:J,stopImmediatePropagation:J,preventDefault:J,target:J,currentTarget:J,srcElement:J,type:J,cancelable:J,defaultPrevented:J,timeStamp:J,composedPath:J,returnValue:J,bubbles:J,composed:J,eventPhase:J,cancelBubble:J,stopPropagation:J,isTrusted:J});var Z=(U=function(){function e(t,n={}){var i,a;return h(this,e),a=d(this,e,[t,n]),H.set(a,void 0),V(a,H,null!==(i=null==n?void 0:n.detail)&&void 0!==i?i:null,"f"),a}return k(e,Q),p(e,[{key:"initCustomEvent",value:function(e,t,n,i){throw new Error("Method not implemented.")}},{key:"detail",get:function(){return X(this,H,"f")}}])}(),H=new WeakMap,U);Object.defineProperties(Z.prototype,{detail:J});var ee,te,ne,ie=Q,ae=Z;null!==(ee=globalThis.Event)&&void 0!==ee||(globalThis.Event=ie),null!==(te=globalThis.CustomEvent)&&void 0!==te||(globalThis.CustomEvent=ae);var re=new WeakMap,oe=e=>{var t=re.get(e);return void 0===t&&re.set(e,t=new Map),t},se=function(){function e(){var t;return h(this,e),(t=d(this,e,arguments)).__shadowRootMode=null,t.__shadowRoot=null,t.__internals=null,t}return k(e,q),p(e,[{key:"attributes",get:function(){return Array.from(oe(this)).map((([e,t])=>({name:e,value:t})))}},{key:"shadowRoot",get:function(){return"closed"===this.__shadowRootMode?null:this.__shadowRoot}},{key:"localName",get:function(){return this.constructor.__localName}},{key:"tagName",get:function(){var e;return null===(e=this.localName)||void 0===e?void 0:e.toUpperCase()}},{key:"setAttribute",value:function(e,t){oe(this).set(e,String(t))}},{key:"removeAttribute",value:function(e){oe(this).delete(e)}},{key:"toggleAttribute",value:function(e,t){return this.hasAttribute(e)?!(void 0===t||!t)||(this.removeAttribute(e),!1):!(void 0!==t&&!t)&&(this.setAttribute(e,""),!0)}},{key:"hasAttribute",value:function(e){return oe(this).has(e)}},{key:"attachShadow",value:function(e){var t={host:this};return this.__shadowRootMode=e.mode,e&&"open"===e.mode&&(this.__shadowRoot=t),t}},{key:"attachInternals",value:function(){if(null!==this.__internals)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");var e=new G(this);return this.__internals=e,e}},{key:"getAttribute",value:function(e){var t=oe(this).get(e);return null!=t?t:null}}])}(),ue=function(){function e(){return h(this,e),d(this,e,arguments)}return k(e,se),p(e)}();function le(){var e,t;return{promise:new Promise(((n,i)=>{e=n,t=i})),resolve:e,reject:t}}function de(e,t,n,i){var a,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(r<3?a(o):r>3?a(t,n,o):a(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o}function he(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)}function ce(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n}null!==(ne=globalThis.litServerRoot)&&void 0!==ne||(globalThis.litServerRoot=Object.defineProperty(new ue,"localName",{get:()=>"lit-server-root"})),new(function(){return p((function e(){h(this,e),this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}),[{key:"define",value:function(e,t){var n,i;if(this.__definitions.has(e)){if("development"!==process.env.NODE_ENV)throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${e}" has already been used with this registry`);console.warn(`'CustomElementRegistry' already has "${e}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.\nMake sure to test your application with a production build as repeat registrations will throw in production.`)}if(this.__reverseDefinitions.has(t))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ${this.__reverseDefinitions.get(t)}`);t.__localName=e,this.__definitions.set(e,{ctor:t,observedAttributes:null!==(n=t.observedAttributes)&&void 0!==n?n:[]}),this.__reverseDefinitions.set(t,e),null===(i=this.__pendingWhenDefineds.get(e))||void 0===i||i.resolve(t),this.__pendingWhenDefineds.delete(e)}},{key:"get",value:function(e){var t=this.__definitions.get(e);return null==t?void 0:t.ctor}},{key:"getName",value:function(e){var t;return null!==(t=this.__reverseDefinitions.get(e))&&void 0!==t?t:null}},{key:"upgrade",value:function(e){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}},{key:"whenDefined",value:function(e){var t,n;return T((function(i){for(;;)switch(i.n){case 0:if(!(t=this.__definitions.get(e))){i.n=1;break}return i.a(2,t.ctor);case 1:return(n=this.__pendingWhenDefineds.get(e))||(n=le(),this.__pendingWhenDefineds.set(e,n)),i.a(2,n.promise)}}),null,this,null,Promise)}}])}()),"undefined"==typeof HTMLElement&&(globalThis.HTMLElement=ue),"function"==typeof SuppressedError&&SuppressedError;var me;!function(e){e.SDK="sdk",e.ML="ml",e.THIRD_PARTY_ANALYTICS="third_party_analytics",e.THIRD_PARTY_TRANSACTIONS="third_party_transactions",e.PAYWALL_PERSONALIZATION="paywall_personalization",e.ANONYMOUS_MODE_CAPABILITY="anonymous_allowed",e.LANGUAGE_MANAGEMENT="language_management",e.ENTITLEMENT_MANAGEMENT="entitlement_management"}(me||(me={}));var fe,ve={},pe=ve.NAMI_SDK_VERSION,ge=void 0===pe?"3.3.9":pe,ye=ve.PLATFORM_ID_REQUIRED,be=void 0===ye?"Platform ID is required":ye,we=ve.DEVICE_ID_REQUIRED,ke=void 0===we?"Device ID is required":we,Se=ve.EXTERNAL_ID_REQUIRED,Ee=void 0===Se?"External ID is required":Se,Me=ve.SDK_NOT_INITIALIZED,Pe=void 0===Me?"SDK has not been initialized. Make sure to call Nami.configure() first!":Me,Te=ve.CAMPAIGN_NOT_AVAILABLE,_e=void 0===Te?"Campaign is not available":Te,De=ve.FLOW_SCREENS_NOT_AVAILABLE,Ae=void 0===De?"Flow screens not available":De,xe=ve.UNABLE_TO_UPDATE_CDP_ID,Ce=void 0===xe?"Unable to update CDP id in anonymous mode":xe,Ie=ve.ANONYMOUS_MODE_ALREADY_ON,Le=void 0===Ie?"Anonymous mode is already turned on.":Ie,Fe=ve.ANONYMOUS_MODE_ALREADY_OFF,Re=void 0===Fe?"Anonymous mode is already turned off.":Fe,We=ve.DEVICE_ID_NOT_SET,Oe=void 0===We?"Nami Device ID is not set":We,Ne=ve.AUTH_DEVICE,je=void 0===Ne?"nami_auth_device":Ne,$e=ve.NAMI_CONFIGURATION,ze=void 0===$e?"nami_configuration":$e,Be=ve.NAMI_PROFILE,He=void 0===Be?"nami_profile":Be,Ue=ve.API_CONFIG,Ge=void 0===Ue?"api_config":Ue,Ve=ve.API_CAMPAIGN_RULES,Xe=void 0===Ve?"api_campaign_rules":Ve,Ke=ve.API_PAYWALLS,Ye=void 0===Ke?"api_paywalls":Ke,qe=ve.API_PRODUCTS,Je=void 0===qe?"api_products":qe,Qe=ve.API_ACTIVE_ENTITLEMENTS,Ze=void 0===Qe?"api_active_entitlements":Qe,et=ve.SERVER_NAMI_ENTITLEMENTS,tt=void 0===et?"server_active_entitlements":et,nt=ve.INITIAL_APP_CONFIG,it=void 0===nt?"initial_app_config":nt,at=ve.INITIAL_CAMPAIGN_RULES,rt=void 0===at?"initial_campaign_rules":at,ot=ve.INITIAL_PAYWALLS,st=void 0===ot?"initial_paywalls":ot,ut=ve.INITIAL_PRODUCTS,lt=void 0===ut?"initial_products":ut,dt=ve.LOCAL_NAMI_ENTITLEMENTS,ht=void 0===dt?"local_active_entitlements":dt,ct=ve.CUSTOMER_ATTRIBUTES_KEY_PREFIX,mt=void 0===ct?"nami_cmr_attributes_":ct,ft=ve.NAMI_CUSTOMER_JOURNEY_STATE,vt=void 0===ft?"nami_customer_journey_state":ft,pt=ve.ANONYMOUS_MODE,gt=void 0===pt?"nami_anonymous_mode_v2":pt,yt=ve.ANONYMOUS_UUID,bt=void 0===yt?"nami_anonymous_uuid":yt,wt=ve.KEY_SESSION_COUNTER,kt=void 0===wt?"nami_session_counter":wt,St=ve.INITIAL_SESSION_COUNTER_VALUE,Et=void 0===St?1:St,Mt=ve.NAMI_LAST_IMPRESSION_ID,Pt=void 0===Mt?"nami_last_impression_id":Mt,Tt=ve.NAMI_PURCHASE_IMPRESSION_ID,_t=void 0===Tt?"nami_purchase_impression_id":Tt,Dt=ve.NAMI_LAUNCH_ID,At=void 0===Dt?"nami_launch_id":Dt,xt=ve.NAMI_SESSION_ID,Ct=void 0===xt?"nami_session_id":xt,It=ve.NAMI_LANGUAGE_CODE,Lt=void 0===It?"nami_language_code":It,Ft=ve.NAMI_PURCHASE_CHANNEL,Rt=void 0===Ft?"nami_purchase_channel":Ft,Wt=ve.API_VERSION,Ot=ve.BASE_URL_PATH,Nt=void 0===Ot?`sdk/${void 0===Wt?"v3":Wt}/platform`:Ot,jt=ve.BASE_URL,$t=void 0===jt?"https://app.namiml.com":jt,zt=ve.BASE_STAGING_URL,Bt=void 0===zt?"https://app-staging.namiml.com":zt,Ht=ve.CUSTOM_HOST_PREFIX,Ut=void 0===Ht?"namiAPIHost=":Ht,Gt=ve.USE_STAGING_API,Vt=void 0===Gt?"useStagingAPI":Gt,Xt=ve.EXTENDED_CLIENT_INFO_PREFIX,Kt=void 0===Xt?"extendedClientInfo":Xt,Yt=ve.EXTENDED_CLIENT_INFO_DELIMITER,qt=void 0===Yt?":":Yt,Jt=ve.VALIDATE_PRODUCT_GROUPS,Qt=void 0===Jt?"validateProductGroups":Jt,Zt=ve.API_MAX_CALLS_LIMIT,en=void 0===Zt?2:Zt,tn=ve.API_RETRY_DELAY_SEC,nn=void 0===tn?2:tn,an=ve.API_TIMEOUT_LIMIT,rn=void 0===an?2e4:an,on=ve.DEVICE_API_TIMEOUT_LIMIT,sn=void 0===on?2e3:on,un=ve.STATUS_BAD_REQUEST,ln=void 0===un?400:un,dn=ve.STATUS_NOT_FOUND,hn=void 0===dn?404:dn,cn=ve.STATUS_CONFLICT,mn=void 0===cn?409:cn,fn=ve.STATUS_INTERNAL_SERVER_ERROR,vn=void 0===fn?500:fn,pn=ve.INITIAL_SUCCESS,gn=void 0===pn?"Initial success":pn,yn=ve.RECONFIG_SUCCESS,bn=void 0===yn?"Reconfig success":yn,wn=ve.ALREADY_CONFIGURED,kn=void 0===wn?"Already configured":wn,Sn=ve.AVAILABLE_CAMPAIGNS_CHANGED,En=void 0===Sn?"AvailableCampaignsChanged":Sn,Mn=ve.PAYWALL_ACTION_EVENT,Pn=void 0===Mn?"PaywallActionEvent":Mn,Tn=ve.AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED,_n=void 0===Tn?"AvailableActiveEntitlementsChanged":Tn,Dn=ve.CUSTOMER_JOURNEY_STATE_CHANGED,An=void 0===Dn?"CustomerJourneyStateChanged":Dn,xn=ve.SKU_TEXT_REGEX,Cn=void 0===xn?/\$\{sku\.(\w+)(:\d+)?\}/g:xn,In=ve.VAR_REGEX,Ln=void 0===In?/\$\{\s*(\w+(\.[a-zA-Z\d_:${}-]{0,99})*?)\s*}/g:In,Fn=ve.SMART_TEXT_PATTERN,Rn=void 0===Fn?"${":Fn,Wn=ve.LIQUID_VARIABLE_REGEX,On=void 0===Wn?/\${[A-Za-z0-9.]+}/g:Wn;!function(e){e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR"}(fe||(fe={}));var Nn={debug:fe.DEBUG,info:fe.INFO,warn:fe.WARN,error:fe.ERROR},jn=function(){return p((function e(){h(this,e),this.currentLogLevel=fe.DEBUG,this.setLogger=e=>{this.currentLogLevel=e?Nn[e]:fe.WARN}}),[{key:"debug",value:function(e,...t){this.shouldLog(fe.DEBUG)&&console.debug(this.formatMessage(fe.DEBUG,e,...t))}},{key:"info",value:function(e,...t){this.shouldLog(fe.INFO)&&console.info(this.formatMessage(fe.INFO,e,...t))}},{key:"warn",value:function(e,...t){this.shouldLog(fe.WARN)&&console.warn(this.formatMessage(fe.WARN,e,...t))}},{key:"error",value:function(e,...t){this.shouldLog(fe.ERROR)&&console.error(this.formatMessage(fe.ERROR,e,...t))}},{key:"shouldLog",value:function(e){return e>=this.currentLogLevel}},{key:"formatMessage",value:function(e,t,...n){var i=fe[e];return`[${(new Date).toISOString()}] [${i}] ${t} ${n=n.map((e=>"object"==typeof e?JSON.stringify(e):e))}`}}])}(),$n=new jn;function zn(e){for(var t=-1,n=null==e?0:e.length,i=0,a=[];++t<n;){var r=e[t];r&&(a[i++]=r)}return a}function Bn(e,t){return e===t||e!=e&&t!=t}function Hn(e,t){for(var n=e.length;n--;)if(Bn(e[n][0],t))return n;return-1}var Un=Array.prototype.splice;function Gn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Gn.prototype.clear=function(){this.__data__=[],this.size=0},Gn.prototype.delete=function(e){var t=this.__data__,n=Hn(t,e);return!(n<0)&&(n==t.length-1?t.pop():Un.call(t,n,1),--this.size,!0)},Gn.prototype.get=function(e){var t=this.__data__,n=Hn(t,e);return n<0?void 0:t[n][1]},Gn.prototype.has=function(e){return Hn(this.__data__,e)>-1},Gn.prototype.set=function(e,t){var n=this.__data__,i=Hn(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};var Vn="object"==typeof global&&global&&global.Object===Object&&global,Xn="object"==typeof self&&self&&self.Object===Object&&self,Kn=Vn||Xn||Function("return this")(),Yn=Kn.Symbol,qn=Object.prototype,Jn=qn.hasOwnProperty,Qn=qn.toString,Zn=Yn?Yn.toStringTag:void 0;var ei=Object.prototype.toString;var ti="[object Null]",ni="[object Undefined]",ii=Yn?Yn.toStringTag:void 0;function ai(e){return null==e?void 0===e?ni:ti:ii&&ii in Object(e)?function(e){var t=Jn.call(e,Zn),n=e[Zn];try{e[Zn]=void 0;var i=!0}catch(e){}var a=Qn.call(e);return i&&(t?e[Zn]=n:delete e[Zn]),a}(e):function(e){return ei.call(e)}(e)}function ri(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var oi="[object AsyncFunction]",si="[object Function]",ui="[object GeneratorFunction]",li="[object Proxy]";function di(e){if(!ri(e))return!1;var t=ai(e);return t==si||t==ui||t==oi||t==li}var hi,ci=Kn["__core-js_shared__"],mi=(hi=/[^.]+$/.exec(ci&&ci.keys&&ci.keys.IE_PROTO||""))?"Symbol(src)_1."+hi:"";var fi=Function.prototype.toString;function vi(e){if(null!=e){try{return fi.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var pi=/^\[object .+?Constructor\]$/,gi=Function.prototype,yi=Object.prototype,bi=gi.toString,wi=yi.hasOwnProperty,ki=RegExp("^"+bi.call(wi).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Si(e){return!(!ri(e)||(t=e,mi&&mi in t))&&(di(e)?ki:pi).test(vi(e));var t}function Ei(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Si(n)?n:void 0}var Mi=Ei(Kn,"Map"),Pi=Ei(Object,"create");var Ti=Object.prototype.hasOwnProperty;var _i=Object.prototype.hasOwnProperty;function Di(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Ai(e,t){var n,i,a=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function xi(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Di.prototype.clear=function(){this.__data__=Pi?Pi(null):{},this.size=0},Di.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Di.prototype.get=function(e){var t=this.__data__;if(Pi){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Ti.call(t,e)?t[e]:void 0},Di.prototype.has=function(e){var t=this.__data__;return Pi?void 0!==t[e]:_i.call(t,e)},Di.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Pi&&void 0===t?"__lodash_hash_undefined__":t,this},xi.prototype.clear=function(){this.size=0,this.__data__={hash:new Di,map:new(Mi||Gn),string:new Di}},xi.prototype.delete=function(e){var t=Ai(this,e).delete(e);return this.size-=t?1:0,t},xi.prototype.get=function(e){return Ai(this,e).get(e)},xi.prototype.has=function(e){return Ai(this,e).has(e)},xi.prototype.set=function(e,t){var n=Ai(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function Ci(e){var t=this.__data__=new Gn(e);this.size=t.size}Ci.prototype.clear=function(){this.__data__=new Gn,this.size=0},Ci.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ci.prototype.get=function(e){return this.__data__.get(e)},Ci.prototype.has=function(e){return this.__data__.has(e)},Ci.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Gn){var i=n.__data__;if(!Mi||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new xi(i)}return n.set(e,t),this.size=n.size,this};function Ii(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new xi;++t<n;)this.add(e[t])}function Li(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}function Fi(e,t){return e.has(t)}Ii.prototype.add=Ii.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ii.prototype.has=function(e){return this.__data__.has(e)};var Ri=1,Wi=2;function Oi(e,t,n,i,a,r){var o=n&Ri,s=e.length,u=t.length;if(s!=u&&!(o&&u>s))return!1;var l=r.get(e),d=r.get(t);if(l&&d)return l==t&&d==e;var h=-1,c=!0,m=n&Wi?new Ii:void 0;for(r.set(e,t),r.set(t,e);++h<s;){var f=e[h],v=t[h];if(i)var p=o?i(v,f,h,t,e,r):i(f,v,h,e,t,r);if(void 0!==p){if(p)continue;c=!1;break}if(m){if(!Li(t,(function(e,t){if(!Fi(m,t)&&(f===e||a(f,e,n,i,r)))return m.push(t)}))){c=!1;break}}else if(f!==v&&!a(f,v,n,i,r)){c=!1;break}}return r.delete(e),r.delete(t),c}var Ni=Kn.Uint8Array;function ji(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n}function $i(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var zi=1,Bi=2,Hi="[object Boolean]",Ui="[object Date]",Gi="[object Error]",Vi="[object Map]",Xi="[object Number]",Ki="[object RegExp]",Yi="[object Set]",qi="[object String]",Ji="[object Symbol]",Qi="[object ArrayBuffer]",Zi="[object DataView]",ea=Yn?Yn.prototype:void 0,ta=ea?ea.valueOf:void 0;function na(e,t){for(var n=-1,i=t.length,a=e.length;++n<i;)e[a+n]=t[n];return e}var ia=Array.isArray;function aa(e,t,n){var i=t(e);return ia(e)?i:na(i,n(e))}function ra(){return[]}var oa=Object.prototype.propertyIsEnumerable,sa=Object.getOwnPropertySymbols,ua=sa?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,i=null==e?0:e.length,a=0,r=[];++n<i;){var o=e[n];t(o,n,e)&&(r[a++]=o)}return r}(sa(e),(function(t){return oa.call(e,t)})))}:ra;function la(e){return null!=e&&"object"==typeof e}function da(e){return la(e)&&"[object Arguments]"==ai(e)}var ha=Object.prototype,ca=ha.hasOwnProperty,ma=ha.propertyIsEnumerable,fa=da(function(){return arguments}())?da:function(e){return la(e)&&ca.call(e,"callee")&&!ma.call(e,"callee")};var va="object"==typeof exports&&exports&&!exports.nodeType&&exports,pa=va&&"object"==typeof module&&module&&!module.nodeType&&module,ga=pa&&pa.exports===va?Kn.Buffer:void 0,ya=(ga?ga.isBuffer:void 0)||function(){return!1},ba=9007199254740991,wa=/^(?:0|[1-9]\d*)$/;function ka(e,t){var n=typeof e;return!!(t=null==t?ba:t)&&("number"==n||"symbol"!=n&&wa.test(e))&&e>-1&&e%1==0&&e<t}var Sa=9007199254740991;function Ea(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Sa}var Ma={};function Pa(e){return function(t){return e(t)}}Ma["[object Float32Array]"]=Ma["[object Float64Array]"]=Ma["[object Int8Array]"]=Ma["[object Int16Array]"]=Ma["[object Int32Array]"]=Ma["[object Uint8Array]"]=Ma["[object Uint8ClampedArray]"]=Ma["[object Uint16Array]"]=Ma["[object Uint32Array]"]=!0,Ma["[object Arguments]"]=Ma["[object Array]"]=Ma["[object ArrayBuffer]"]=Ma["[object Boolean]"]=Ma["[object DataView]"]=Ma["[object Date]"]=Ma["[object Error]"]=Ma["[object Function]"]=Ma["[object Map]"]=Ma["[object Number]"]=Ma["[object Object]"]=Ma["[object RegExp]"]=Ma["[object Set]"]=Ma["[object String]"]=Ma["[object WeakMap]"]=!1;var Ta="object"==typeof exports&&exports&&!exports.nodeType&&exports,_a=Ta&&"object"==typeof module&&module&&!module.nodeType&&module,Da=_a&&_a.exports===Ta&&Vn.process,Aa=function(){try{var e=_a&&_a.require&&_a.require("util").types;return e||Da&&Da.binding&&Da.binding("util")}catch(e){}}(),xa=Aa&&Aa.isTypedArray,Ca=xa?Pa(xa):function(e){return la(e)&&Ea(e.length)&&!!Ma[ai(e)]},Ia=Object.prototype.hasOwnProperty;function La(e,t){var n=ia(e),i=!n&&fa(e),a=!n&&!i&&ya(e),r=!n&&!i&&!a&&Ca(e),o=n||i||a||r,s=o?function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}(e.length,String):[],u=s.length;for(var l in e)!t&&!Ia.call(e,l)||o&&("length"==l||a&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ka(l,u))||s.push(l);return s}var Fa=Object.prototype;function Ra(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Fa)}function Wa(e,t){return function(n){return e(t(n))}}var Oa=Wa(Object.keys,Object),Na=Object.prototype.hasOwnProperty;function ja(e){return null!=e&&Ea(e.length)&&!di(e)}function $a(e){return ja(e)?La(e):function(e){if(!Ra(e))return Oa(e);var t=[];for(var n in Object(e))Na.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}function za(e){return aa(e,$a,ua)}var Ba=1,Ha=Object.prototype.hasOwnProperty;var Ua=Ei(Kn,"DataView"),Ga=Ei(Kn,"Promise"),Va=Ei(Kn,"Set"),Xa=Ei(Kn,"WeakMap"),Ka="[object Map]",Ya="[object Promise]",qa="[object Set]",Ja="[object WeakMap]",Qa="[object DataView]",Za=vi(Ua),er=vi(Mi),tr=vi(Ga),nr=vi(Va),ir=vi(Xa),ar=ai;(Ua&&ar(new Ua(new ArrayBuffer(1)))!=Qa||Mi&&ar(new Mi)!=Ka||Ga&&ar(Ga.resolve())!=Ya||Va&&ar(new Va)!=qa||Xa&&ar(new Xa)!=Ja)&&(ar=function(e){var t=ai(e),n="[object Object]"==t?e.constructor:void 0,i=n?vi(n):"";if(i)switch(i){case Za:return Qa;case er:return Ka;case tr:return Ya;case nr:return qa;case ir:return Ja}return t});var rr=1,or="[object Arguments]",sr="[object Array]",ur="[object Object]",lr=Object.prototype.hasOwnProperty;function dr(e,t,n,i,a,r){var o=ia(e),s=ia(t),u=o?sr:ar(e),l=s?sr:ar(t),d=(u=u==or?ur:u)==ur,h=(l=l==or?ur:l)==ur,c=u==l;if(c&&ya(e)){if(!ya(t))return!1;o=!0,d=!1}if(c&&!d)return r||(r=new Ci),o||Ca(e)?Oi(e,t,n,i,a,r):function(e,t,n,i,a,r,o){switch(n){case Zi:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Qi:return!(e.byteLength!=t.byteLength||!r(new Ni(e),new Ni(t)));case Hi:case Ui:case Xi:return Bn(+e,+t);case Gi:return e.name==t.name&&e.message==t.message;case Ki:case qi:return e==t+"";case Vi:var s=ji;case Yi:var u=i&zi;if(s||(s=$i),e.size!=t.size&&!u)return!1;var l=o.get(e);if(l)return l==t;i|=Bi,o.set(e,t);var d=Oi(s(e),s(t),i,a,r,o);return o.delete(e),d;case Ji:if(ta)return ta.call(e)==ta.call(t)}return!1}(e,t,u,n,i,a,r);if(!(n&rr)){var m=d&&lr.call(e,"__wrapped__"),f=h&&lr.call(t,"__wrapped__");if(m||f){var v=m?e.value():e,p=f?t.value():t;return r||(r=new Ci),a(v,p,n,i,r)}}return!!c&&(r||(r=new Ci),function(e,t,n,i,a,r){var o=n&Ba,s=za(e),u=s.length;if(u!=za(t).length&&!o)return!1;for(var l=u;l--;){var d=s[l];if(!(o?d in t:Ha.call(t,d)))return!1}var h=r.get(e),c=r.get(t);if(h&&c)return h==t&&c==e;var m=!0;r.set(e,t),r.set(t,e);for(var f=o;++l<u;){var v=e[d=s[l]],p=t[d];if(i)var g=o?i(p,v,d,t,e,r):i(v,p,d,e,t,r);if(!(void 0===g?v===p||a(v,p,n,i,r):g)){m=!1;break}f||(f="constructor"==d)}if(m&&!f){var y=e.constructor,b=t.constructor;y==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b||(m=!1)}return r.delete(e),r.delete(t),m}(e,t,n,i,a,r))}function hr(e,t,n,i,a){return e===t||(null==e||null==t||!la(e)&&!la(t)?e!=e&&t!=t:dr(e,t,n,i,hr,a))}var cr=1,mr=2;function fr(e){return e==e&&!ri(e)}function vr(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function pr(e){var t=function(e){for(var t=$a(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,fr(a)]}return t}(e);return 1==t.length&&t[0][2]?vr(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,i){var a=n.length,r=a;if(null==e)return!r;for(e=Object(e);a--;){var o=n[a];if(o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++a<r;){var s=(o=n[a])[0],u=e[s],l=o[1];if(o[2]){if(void 0===u&&!(s in e))return!1}else{var d=new Ci;if(!hr(l,u,cr|mr,i,d))return!1}}return!0}(n,0,t)}}var gr="[object Symbol]";function yr(e){return"symbol"==typeof e||la(e)&&ai(e)==gr}var br=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wr=/^\w*$/;function kr(e,t){if(ia(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!yr(e))||(wr.test(e)||!br.test(e)||null!=t&&e in Object(t))}var Sr="Expected a function";function Er(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(Sr);var n=function(){var i=arguments,a=t?t.apply(this,i):i[0],r=n.cache;if(r.has(a))return r.get(a);var o=e.apply(this,i);return n.cache=r.set(a,o)||r,o};return n.cache=new(Er.Cache||xi),n}Er.Cache=xi;var Mr,Pr,Tr,_r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dr=/\\(\\)?/g,Ar=(Mr=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(_r,(function(e,n,i,a){t.push(i?a.replace(Dr,"$1"):n||e)})),t},Pr=Er(Mr,(function(e){return 500===Tr.size&&Tr.clear(),e})),Tr=Pr.cache,Pr);var xr=1/0,Cr=Yn?Yn.prototype:void 0,Ir=Cr?Cr.toString:void 0;function Lr(e){if("string"==typeof e)return e;if(ia(e))return function(e,t){for(var n=-1,i=null==e?0:e.length,a=Array(i);++n<i;)a[n]=t(e[n],n,e);return a}(e,Lr)+"";if(yr(e))return Ir?Ir.call(e):"";var t=e+"";return"0"==t&&1/e==-xr?"-0":t}function Fr(e){return null==e?"":Lr(e)}function Rr(e,t){return ia(e)?e:kr(e,t)?[e]:Ar(Fr(e))}var Wr=1/0;function Or(e){if("string"==typeof e||yr(e))return e;var t=e+"";return"0"==t&&1/e==-Wr?"-0":t}function Nr(e,t){for(var n=0,i=(t=Rr(t,e)).length;null!=e&&n<i;)e=e[Or(t[n++])];return n&&n==i?e:void 0}function jr(e,t){return null!=e&&t in Object(e)}function $r(e,t){return null!=e&&function(e,t,n){for(var i=-1,a=(t=Rr(t,e)).length,r=!1;++i<a;){var o=Or(t[i]);if(!(r=null!=e&&n(e,o)))break;e=e[o]}return r||++i!=a?r:!!(a=null==e?0:e.length)&&Ea(a)&&ka(o,a)&&(ia(e)||fa(e))}(e,t,jr)}var zr=1,Br=2;function Hr(e,t){return kr(e)&&fr(t)?vr(Or(e),t):function(n){var i=function(e,t,n){var i=null==e?void 0:Nr(e,t);return void 0===i?n:i}(n,e);return void 0===i&&i===t?$r(n,e):hr(t,i,zr|Br)}}function Ur(e){return e}function Gr(e){return kr(e)?(t=Or(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Nr(t,e)}}(e);var t}function Vr(e){return e!=e}function Xr(e,t){return!!(null==e?0:e.length)&&function(e,t,n){return t==t?function(e,t,n){for(var i=n-1,a=e.length;++i<a;)if(e[i]===t)return i;return-1}(e,t,n):function(e,t,n){for(var i=e.length,a=n+-1;++a<i;)if(t(e[a],a,e))return a;return-1}(e,Vr,n)}(e,t,0)>-1}var Kr=Va&&1/$i(new Va([,-0]))[1]==1/0?function(e){return new Va(e)}:function(){},Yr=200;function qr(e,t){return e&&e.length?function(e,t,n){var i=-1,a=Xr,r=e.length,o=!0,s=[],u=s;if(r>=Yr){var l=t?null:Kr(e);if(l)return $i(l);o=!1,a=Fi,u=new Ii}else u=t?[]:s;e:for(;++i<r;){var d=e[i],h=t?t(d):d;if(d=0!==d?d:0,o&&h==h){for(var c=u.length;c--;)if(u[c]===h)continue e;t&&u.push(h),s.push(d)}else a(u,h,n)||(u!==s&&u.push(h),s.push(d))}return s}(e,"function"==typeof(n=t)?n:null==n?Ur:"object"==typeof n?ia(n)?Hr(n[0],n[1]):pr(n):Gr(n)):[];var n}var Jr=function(){return p((function e(){h(this,e),this.memoryStore={}}),[{key:"setDevice",value:function(e){this.setItem(je,e)}},{key:"getDevice",value:function(){return this.getItem(je)}},{key:"resetDevice",value:function(){this.resetItem(je)}},{key:"getAnonymousMode",value:function(){return this.getItem(gt)||!1}},{key:"setAnonymousMode",value:function(e){this.setItem(gt,e)}},{key:"clearAnonymousMode",value:function(){this.resetItem(gt)}},{key:"setAppConfig",value:function(e,t){this.setItem(e,t)}},{key:"getAppConfig",value:function(e){return this.getItem(e)}},{key:"setLanguageCode",value:function(e){this.setItem(Lt,e||"en")}},{key:"getLanguageCode",value:function(){return this.getItem(Lt)||"en"}},{key:"setCampaignRules",value:function(e,t){e!==rt?this.isTtlCacheKey(e)?this.setWithTtl(e,t):this.setItem(e,t):this.memoryStore[rt]=JSON.stringify(t)}},{key:"getCampaignRules",value:function(e){return e===rt?this.memoryStore[rt]?JSON.parse(this.memoryStore[rt]):null:this.isTtlCacheKey(e)?this.getWithTtl(e):this.getItem(e)}},{key:"setPaywalls",value:function(e,t){e!==st?this.isTtlCacheKey(e)?this.setWithTtl(e,t):this.setItem(e,t):this.memoryStore[st]=JSON.stringify(t)}},{key:"getPaywalls",value:function(e){return e===st?this.memoryStore[st]?JSON.parse(this.memoryStore[st]):null:this.isTtlCacheKey(e)?this.getWithTtl(e):this.getItem(e)}},{key:"setActiveEntitlements",value:function(e,t){this.setItem(e,t)}},{key:"getActiveEntitlements",value:function(e){return this.getItem(e)||[]}},{key:"setNamiEntitlements",value:function(e,t){this.setItem(e,t)}},{key:"getNamiEntitlements",value:function(e){return this.getItem(e)||[]}},{key:"setProducts",value:function(e,t){this.setItem(e,t)}},{key:"getProducts",value:function(e){return this.getItem(e)}},{key:"getCachedProducts",value:function(){var e,t,n=null!==(e=this.getItem(Je))&&void 0!==e?e:[];return qr(zn([...null!==(t=this.getItem(lt))&&void 0!==t?t:[],...n]),"sku_ref_id")}},{key:"setNamiConfig",value:function(e){this.setItem(ze,e)}},{key:"getNamiConfig",value:function(){return this.getItem(ze)}},{key:"setCustomerAttribute",value:function(e,t){this.setItem(mt+e,t)}},{key:"getCustomerAttribute",value:function(e){return this.getItem(mt+e)}},{key:"getAllCustomerAttributes",value:function(){return Object.entries(localStorage).filter((([e])=>e.includes(mt))).map((([e,t])=>e.replace(mt,"")+":"+t))}},{key:"getAllCustomerAttributesKeys",value:function(){return Object.keys(localStorage).filter((e=>e.includes(mt))).map((e=>e.replace(mt,"")))}},{key:"clearCustomerAttribute",value:function(e){var t=mt+e,n=this.getItem(t);return n&&this.resetItem(t),!!n}},{key:"clearAllCustomerAttributes",value:function(){Object.keys(localStorage).filter((e=>e.includes(mt))).map((e=>this.resetItem(e)))}},{key:"setNamiProfile",value:function(e){this.setItem(He,e)}},{key:"getNamiProfile",value:function(){return this.getItem(He)}},{key:"removeNamiProfile",value:function(){this.resetItem(He)}},{key:"setCustomerJourneyState",value:function(e){this.setItem(vt,e)}},{key:"getCustomerJourneyState",value:function(){return this.getItem(vt)}},{key:"setSessionCounter",value:function(){var e=this.getItem(kt),t=e?parseInt(e):Et||Et;this.setItem(kt,t+1)}},{key:"getSessionCounter",value:function(){var e=this.getItem(kt);return e?parseInt(e):Et}},{key:"setLastImpressionId",value:function(e){this.setItem(Pt,e)}},{key:"getLastImpressionId",value:function(){var e;return null!==(e=this.getItem(Pt))&&void 0!==e?e:""}},{key:"setPurchaseImpression",value:function(){var e,t=null!==(e=this.getLastImpressionId())&&void 0!==e?e:"";this.setItem(_t,t)}},{key:"getPurchaseImpression",value:function(){var e;return null!==(e=this.getItem(_t))&&void 0!==e?e:""}},{key:"setSessionId",value:function(e){e&&this.setItem(Ct,e)}},{key:"getSessionId",value:function(){var e;return null!==(e=this.getItem(Ct))&&void 0!==e?e:""}},{key:"clearSessionId",value:function(){this.resetItem(Ct)}},{key:"setLaunchId",value:function(e){e&&this.setItem(At,e)}},{key:"getLaunchId",value:function(){var e;return null!==(e=this.getItem(At))&&void 0!==e?e:""}},{key:"clearLaunchId",value:function(){this.resetItem(At)}},{key:"setPurchaseChannel",value:function(e){e&&this.setItem(Rt,e)}},{key:"getPurchaseChannel",value:function(){return this.getItem(Rt)}},{key:"getAnonymousUUID",value:function(){return this.getItem(bt)}},{key:"setAnonymousUUID",value:function(e){this.setItem(bt,e)}},{key:"clearAnonymousUUID",value:function(){this.resetItem(bt)}},{key:"isTtlCacheKey",value:function(e){return e===Xe||e===Ye}},{key:"getCampaignCacheTtl",value:function(){var e,t=this.getAppConfig(Ge)||this.getAppConfig(it);return null!==(e=null==t?void 0:t.campaign_cache_ttl)&&void 0!==e?e:null}},{key:"setWithTtl",value:function(e,t){var n=this.getCampaignCacheTtl();0!==n?null!==n&&n>0?this.setItem(e,{data:t,cachedAt:Date.now()}):this.setItem(e,t):this.memoryStore[e]=JSON.stringify(t)}},{key:"isTimestampedCache",value:function(e){return"object"==typeof e&&null!==e&&"cachedAt"in e&&"data"in e}},{key:"getWithTtl",value:function(e){var t=this.getCampaignCacheTtl(),n=this.memoryStore[e];if(null!=n){if(null===t||0===t)return JSON.parse(n);delete this.memoryStore[e]}var i=this.getItem(e);return null===i?null:null===t?this.isTimestampedCache(i)?i.data:i:this.isTimestampedCache(i)?(Date.now()-i.cachedAt)/1e3>=t?(this.resetItem(e),null):i.data:(this.resetItem(e),null)}},{key:"setItem",value:function(e,t){var n;try{n=JSON.stringify(t)}catch(t){return void $n.error(`Serialization failed for ${e}`,t)}try{localStorage.setItem(e,n)}catch(t){$n.error("Error setting item in localStorage:",t),this.resetItem(e),this.memoryStore[e]=n}}},{key:"getItem",value:function(e){try{var t=localStorage.getItem(e);if(null!==t)return JSON.parse(t)}catch(t){"undefined"!=typeof window&&$n.error("Error getting item from localStorage:",e,": ",t)}var n=this.memoryStore[e];return null!=n?JSON.parse(n):null}},{key:"resetItem",value:function(e){try{localStorage.removeItem(e)}catch(t){"undefined"!=typeof window&&$n.error("Error removing item from localStorage:",e,": ",t)}delete this.memoryStore[e]}},{key:"clear",value:function(){try{localStorage.clear()}catch(e){$n.error("Error clearing localStorage:",e)}this.memoryStore={}}}])}(),Qr=new Jr,Zr=function(){function e(t,n){var i;return h(this,e),(i=d(this,e,[n])).statusCode=t,i.status=t,i.message=`RetryLimitExceededError: ${i.message}`,i}return k(e,I(Error)),p(e)}(),eo=function(){function e(){return h(this,e),d(this,e,arguments)}return k(e,I(Error)),p(e)}(),to=function(){function e(){var t;return h(this,e),(t=d(this,e)).status=409,t.name="ConflictError",t.message="ConflictError: Server responded with conflict",t}return k(e,eo),p(e)}(),no=function(){function e(){return h(this,e),d(this,e,[Pe])}return k(e,I(Error)),p(e)}(),io=function(){function e(){return h(this,e),d(this,e,[be])}return k(e,I(Error)),p(e)}(),ao=function(){function e(){return h(this,e),d(this,e,[ke])}return k(e,I(Error)),p(e)}(),ro=function(){function e(){return h(this,e),d(this,e,[Ee])}return k(e,I(Error)),p(e)}(),oo=function(){function e(){return h(this,e),d(this,e,[_e])}return k(e,I(Error)),p(e)}(),so=function(){function e(){return h(this,e),d(this,e,[Ae])}return k(e,I(Error)),p(e)}(),uo=function(){function e(){return h(this,e),d(this,e,[Le])}return k(e,I(Error)),p(e)}(),lo=function(){function e(){return h(this,e),d(this,e,[Re])}return k(e,I(Error)),p(e)}(),ho=function(){function e(){return h(this,e),d(this,e,[Re])}return k(e,I(Error)),p(e)}(),co=function(){function e(){return h(this,e),d(this,e,[Ce])}return k(e,I(Error)),p(e)}(),mo=function(){function e(t){var n;return h(this,e),(n=d(this,e,[t])).message=`BadRequestError: ${n.message}`,n}return k(e,eo),p(e)}(),fo=function(){function e(t){var n;return h(this,e),(n=d(this,e,[t])).message=`NotFoundError: ${n.message}`,n}return k(e,eo),p(e)}(),vo=function(){function e(t,n){var i;return h(this,e),(i=d(this,e,[n])).statusCode=t,i.message=`ClientError: ${i.message}`,i}return k(e,eo),p(e)}(),po=function(){function e(t){var n;return h(this,e),(n=d(this,e,[t])).message=`ServerError: ${n.message}`,n}return k(e,eo),p(e)}(),go=(e,t)=>{if(e==ln)throw new mo(t);if(e==hn)throw new fo(t);if(e==mn)throw new to;if(e>ln&&e<vn)throw new vo(e,t);if(e>=vn)throw new po(t)};function yo(e,t,n=rn,i=en){var a,r,o;return T((function(s){for(;;)switch(s.n){case 0:return a=0,r=()=>{var o,s;return T((function(u){for(;;)switch(u.n){case 0:return u.n=1,l(bo(e,t,n));case 1:if((o=u.v).ok){u.n=5;break}if(o.status!=mn){u.n=2;break}throw new to;case 2:if(!(++a<=i)){u.n=4;break}return s=1e3*(a+nn),u.n=3,l(new Promise((e=>setTimeout(e,s))));case 3:return u.a(2,r());case 4:throw new Zr(o.status,`Request failed after ${i} retries`);case 5:return u.a(2,o)}}),null,null,null,Promise)},s.n=1,l(r());case 1:return o=s.v,s.a(2,o.json())}}),null,null,null,Promise)}function bo(e,t={},n){var i,a,r;return T((function(o){for(;;)switch(o.n){case 0:return i=new AbortController,a=setTimeout((()=>i.abort()),n),t.signal=i.signal,o.n=1,l(fetch(e,t));case 1:return r=o.v,clearTimeout(a),o.a(2,r)}}),null,null,null,Promise)}function wo(e){for(var t=e.length;--t>=0;)e[t]=0}wo(new Array(576)),wo(new Array(60)),wo(new Array(512)),wo(new Array(256)),wo(new Array(29)),wo(new Array(30));var ko=(e,t,n,i)=>{for(var a=65535&e,r=e>>>16&65535,o=0;0!==n;){n-=o=n>2e3?2e3:n;do{r=r+(a=a+t[i++]|0)|0}while(--o);a%=65521,r%=65521}return a|r<<16},So=new Uint32Array((()=>{for(var e,t=[],n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})()),Eo=(e,t,n,i)=>{var a=So,r=i+n;e^=-1;for(var o=i;o<r;o++)e=e>>>8^a[255&(e^t[o])];return~e},Mo={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Po={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},To=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),_o={assign:function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)To(n,i)&&(e[i]=n[i])}}return e},flattenChunks:e=>{for(var t=0,n=0,i=e.length;n<i;n++)t+=e[n].length;for(var a=new Uint8Array(t),r=0,o=0,s=e.length;r<s;r++){var u=e[r];a.set(u,o),o+=u.length}return a}},Do=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Do=!1}for(var Ao=new Uint8Array(256),xo=0;xo<256;xo++)Ao[xo]=xo>=252?6:xo>=248?5:xo>=240?4:xo>=224?3:xo>=192?2:1;Ao[254]=Ao[254]=1;var Co={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);var t,n,i,a,r,o=e.length,s=0;for(a=0;a<o;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<o&&56320==(64512&(i=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(i-56320),a++),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),r=0,a=0;r<s;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<o&&56320==(64512&(i=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(i-56320),a++),n<128?t[r++]=n:n<2048?(t[r++]=192|n>>>6,t[r++]=128|63&n):n<65536?(t[r++]=224|n>>>12,t[r++]=128|n>>>6&63,t[r++]=128|63&n):(t[r++]=240|n>>>18,t[r++]=128|n>>>12&63,t[r++]=128|n>>>6&63,t[r++]=128|63&n);return t},buf2string:(e,t)=>{var n,i,a=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));var r=new Array(2*a);for(i=0,n=0;n<a;){var o=e[n++];if(o<128)r[i++]=o;else{var s=Ao[o];if(s>4)r[i++]=65533,n+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&n<a;)o=o<<6|63&e[n++],s--;s>1?r[i++]=65533:o<65536?r[i++]=o:(o-=65536,r[i++]=55296|o>>10&1023,r[i++]=56320|1023&o)}}}return((e,t)=>{if(t<65534&&e.subarray&&Do)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));for(var n="",i=0;i<t;i++)n+=String.fromCharCode(e[i]);return n})(r,i)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);for(var n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+Ao[e[n]]>t?n:t}};var Io=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Lo=16209,Fo=function(e,t){var n,i,a,r,o,s,u,l,d,h,c,m,f,v,p,g,y,b,w,k,S,E,M,P,T=e.state;n=e.next_in,M=e.input,i=n+(e.avail_in-5),a=e.next_out,P=e.output,r=a-(t-e.avail_out),o=a+(e.avail_out-257),s=T.dmax,u=T.wsize,l=T.whave,d=T.wnext,h=T.window,c=T.hold,m=T.bits,f=T.lencode,v=T.distcode,p=(1<<T.lenbits)-1,g=(1<<T.distbits)-1;e:do{m<15&&(c+=M[n++]<<m,m+=8,c+=M[n++]<<m,m+=8),y=f[c&p];t:for(;;){if(c>>>=b=y>>>24,m-=b,0===(b=y>>>16&255))P[a++]=65535&y;else{if(!(16&b)){if(64&b){if(32&b){T.mode=16191;break e}e.msg="invalid literal/length code",T.mode=Lo;break e}y=f[(65535&y)+(c&(1<<b)-1)];continue t}for(w=65535&y,(b&=15)&&(m<b&&(c+=M[n++]<<m,m+=8),w+=c&(1<<b)-1,c>>>=b,m-=b),m<15&&(c+=M[n++]<<m,m+=8,c+=M[n++]<<m,m+=8),y=v[c&g];;){if(c>>>=b=y>>>24,m-=b,16&(b=y>>>16&255)){if(k=65535&y,m<(b&=15)&&(c+=M[n++]<<m,(m+=8)<b&&(c+=M[n++]<<m,m+=8)),(k+=c&(1<<b)-1)>s){e.msg="invalid distance too far back",T.mode=Lo;break e}if(c>>>=b,m-=b,k>(b=a-r)){if((b=k-b)>l&&T.sane){e.msg="invalid distance too far back",T.mode=Lo;break e}if(S=0,E=h,0===d){if(S+=u-b,b<w){w-=b;do{P[a++]=h[S++]}while(--b);S=a-k,E=P}}else if(d<b){if(S+=u+d-b,(b-=d)<w){w-=b;do{P[a++]=h[S++]}while(--b);if(S=0,d<w){w-=b=d;do{P[a++]=h[S++]}while(--b);S=a-k,E=P}}}else if(S+=d-b,b<w){w-=b;do{P[a++]=h[S++]}while(--b);S=a-k,E=P}for(;w>2;)P[a++]=E[S++],P[a++]=E[S++],P[a++]=E[S++],w-=3;w&&(P[a++]=E[S++],w>1&&(P[a++]=E[S++]))}else{S=a-k;do{P[a++]=P[S++],P[a++]=P[S++],P[a++]=P[S++],w-=3}while(w>2);w&&(P[a++]=P[S++],w>1&&(P[a++]=P[S++]))}break}if(64&b){e.msg="invalid distance code",T.mode=Lo;break e}y=v[(65535&y)+(c&(1<<b)-1)]}}break}}while(n<i&&a<o);n-=w=m>>3,c&=(1<<(m-=w<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=a<o?o-a+257:257-(a-o),T.hold=c,T.bits=m},Ro=15,Wo=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Oo=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),No=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),jo=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),$o=(e,t,n,i,a,r,o,s)=>{var u,l,d,h,c,m,f,v,p,g=s.bits,y=0,b=0,w=0,k=0,S=0,E=0,M=0,P=0,T=0,_=0,D=null,A=new Uint16Array(16),x=new Uint16Array(16),C=null;for(y=0;y<=Ro;y++)A[y]=0;for(b=0;b<i;b++)A[t[n+b]]++;for(S=g,k=Ro;k>=1&&0===A[k];k--);if(S>k&&(S=k),0===k)return a[r++]=20971520,a[r++]=20971520,s.bits=1,0;for(w=1;w<k&&0===A[w];w++);for(S<w&&(S=w),P=1,y=1;y<=Ro;y++)if(P<<=1,(P-=A[y])<0)return-1;if(P>0&&(0===e||1!==k))return-1;for(x[1]=0,y=1;y<Ro;y++)x[y+1]=x[y]+A[y];for(b=0;b<i;b++)0!==t[n+b]&&(o[x[t[n+b]]++]=b);if(0===e?(D=C=o,m=20):1===e?(D=Wo,C=Oo,m=257):(D=No,C=jo,m=0),_=0,b=0,y=w,c=r,E=S,M=0,d=-1,h=(T=1<<S)-1,1===e&&T>852||2===e&&T>592)return 1;for(;;){f=y-M,o[b]+1<m?(v=0,p=o[b]):o[b]>=m?(v=C[o[b]-m],p=D[o[b]-m]):(v=96,p=0),u=1<<y-M,w=l=1<<E;do{a[c+(_>>M)+(l-=u)]=f<<24|v<<16|p}while(0!==l);for(u=1<<y-1;_&u;)u>>=1;if(0!==u?(_&=u-1,_+=u):_=0,b++,0==--A[y]){if(y===k)break;y=t[n+o[b]]}if(y>S&&(_&h)!==d){for(0===M&&(M=S),c+=w,P=1<<(E=y-M);E+M<k&&!((P-=A[E+M])<=0);)E++,P<<=1;if(T+=1<<E,1===e&&T>852||2===e&&T>592)return 1;a[d=_&h]=S<<24|E<<16|c-r}}return 0!==_&&(a[c+_]=y-M<<24|64<<16),s.bits=S,0},zo=Po.Z_FINISH,Bo=Po.Z_BLOCK,Ho=Po.Z_TREES,Uo=Po.Z_OK,Go=Po.Z_STREAM_END,Vo=Po.Z_NEED_DICT,Xo=Po.Z_STREAM_ERROR,Ko=Po.Z_DATA_ERROR,Yo=Po.Z_MEM_ERROR,qo=Po.Z_BUF_ERROR,Jo=Po.Z_DEFLATED,Qo=16180,Zo=16190,es=16191,ts=16192,ns=16194,is=16199,as=16200,rs=16206,os=16209,ss=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function us(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var ls,ds,hs=e=>{if(!e)return 1;var t=e.state;return!t||t.strm!==e||t.mode<Qo||t.mode>16211?1:0},cs=e=>{if(hs(e))return Xo;var t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Qo,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Uo},ms=e=>{if(hs(e))return Xo;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,cs(e)},fs=(e,t)=>{var n;if(hs(e))return Xo;var i=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Xo:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,ms(e))},vs=(e,t)=>{if(!e)return Xo;var n=new us;e.state=n,n.strm=e,n.window=null,n.mode=Qo;var i=fs(e,t);return i!==Uo&&(e.state=null),i},ps=!0,gs=e=>{if(ps){ls=new Int32Array(512),ds=new Int32Array(32);for(var t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for($o(1,e.lens,0,288,ls,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;$o(2,e.lens,0,32,ds,0,e.work,{bits:5}),ps=!1}e.lencode=ls,e.lenbits=9,e.distcode=ds,e.distbits=5},ys=(e,t,n,i)=>{var a,r=e.state;return null===r.window&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new Uint8Array(r.wsize)),i>=r.wsize?(r.window.set(t.subarray(n-r.wsize,n),0),r.wnext=0,r.whave=r.wsize):((a=r.wsize-r.wnext)>i&&(a=i),r.window.set(t.subarray(n-i,n-i+a),r.wnext),(i-=a)?(r.window.set(t.subarray(n-i,n),0),r.wnext=i,r.whave=r.wsize):(r.wnext+=a,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=a))),0},bs=(e,t)=>{var n,i,a,r,o,s,u,l,d,h,c,m,f,v,p,g,y,b,w,k,S,E,M,P,T=0,_=new Uint8Array(4),D=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(hs(e)||!e.output||!e.input&&0!==e.avail_in)return Xo;(n=e.state).mode===es&&(n.mode=ts),o=e.next_out,a=e.output,u=e.avail_out,r=e.next_in,i=e.input,s=e.avail_in,l=n.hold,d=n.bits,h=s,c=u,E=Uo;e:for(;;)switch(n.mode){case Qo:if(0===n.wrap){n.mode=ts;break}for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(2&n.wrap&&35615===l){0===n.wbits&&(n.wbits=15),n.check=0,_[0]=255&l,_[1]=l>>>8&255,n.check=Eo(n.check,_,2,0),l=0,d=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",n.mode=os;break}if((15&l)!==Jo){e.msg="unknown compression method",n.mode=os;break}if(d-=4,S=8+(15&(l>>>=4)),0===n.wbits&&(n.wbits=S),S>15||S>n.wbits){e.msg="invalid window size",n.mode=os;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&l?16189:es,l=0,d=0;break;case 16181:for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(n.flags=l,(255&n.flags)!==Jo){e.msg="unknown compression method",n.mode=os;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=os;break}n.head&&(n.head.text=l>>8&1),512&n.flags&&4&n.wrap&&(_[0]=255&l,_[1]=l>>>8&255,n.check=Eo(n.check,_,2,0)),l=0,d=0,n.mode=16182;case 16182:for(;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.head&&(n.head.time=l),512&n.flags&&4&n.wrap&&(_[0]=255&l,_[1]=l>>>8&255,_[2]=l>>>16&255,_[3]=l>>>24&255,n.check=Eo(n.check,_,4,0)),l=0,d=0,n.mode=16183;case 16183:for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.head&&(n.head.xflags=255&l,n.head.os=l>>8),512&n.flags&&4&n.wrap&&(_[0]=255&l,_[1]=l>>>8&255,n.check=Eo(n.check,_,2,0)),l=0,d=0,n.mode=16184;case 16184:if(1024&n.flags){for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.length=l,n.head&&(n.head.extra_len=l),512&n.flags&&4&n.wrap&&(_[0]=255&l,_[1]=l>>>8&255,n.check=Eo(n.check,_,2,0)),l=0,d=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&((m=n.length)>s&&(m=s),m&&(n.head&&(S=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(i.subarray(r,r+m),S)),512&n.flags&&4&n.wrap&&(n.check=Eo(n.check,i,m,r)),s-=m,r+=m,n.length-=m),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===s)break e;m=0;do{S=i[r+m++],n.head&&S&&n.length<65536&&(n.head.name+=String.fromCharCode(S))}while(S&&m<s);if(512&n.flags&&4&n.wrap&&(n.check=Eo(n.check,i,m,r)),s-=m,r+=m,S)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=16187;case 16187:if(4096&n.flags){if(0===s)break e;m=0;do{S=i[r+m++],n.head&&S&&n.length<65536&&(n.head.comment+=String.fromCharCode(S))}while(S&&m<s);if(512&n.flags&&4&n.wrap&&(n.check=Eo(n.check,i,m,r)),s-=m,r+=m,S)break e}else n.head&&(n.head.comment=null);n.mode=16188;case 16188:if(512&n.flags){for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(4&n.wrap&&l!==(65535&n.check)){e.msg="header crc mismatch",n.mode=os;break}l=0,d=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=es;break;case 16189:for(;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}e.adler=n.check=ss(l),l=0,d=0,n.mode=Zo;case Zo:if(0===n.havedict)return e.next_out=o,e.avail_out=u,e.next_in=r,e.avail_in=s,n.hold=l,n.bits=d,Vo;e.adler=n.check=1,n.mode=es;case es:if(t===Bo||t===Ho)break e;case ts:if(n.last){l>>>=7&d,d-=7&d,n.mode=rs;break}for(;d<3;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}switch(n.last=1&l,d-=1,3&(l>>>=1)){case 0:n.mode=16193;break;case 1:if(gs(n),n.mode=is,t===Ho){l>>>=2,d-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=os}l>>>=2,d-=2;break;case 16193:for(l>>>=7&d,d-=7&d;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",n.mode=os;break}if(n.length=65535&l,l=0,d=0,n.mode=ns,t===Ho)break e;case ns:n.mode=16195;case 16195:if(m=n.length){if(m>s&&(m=s),m>u&&(m=u),0===m)break e;a.set(i.subarray(r,r+m),o),s-=m,r+=m,u-=m,o+=m,n.length-=m;break}n.mode=es;break;case 16196:for(;d<14;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(n.nlen=257+(31&l),l>>>=5,d-=5,n.ndist=1+(31&l),l>>>=5,d-=5,n.ncode=4+(15&l),l>>>=4,d-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=os;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;d<3;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.lens[D[n.have++]]=7&l,l>>>=3,d-=3}for(;n.have<19;)n.lens[D[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,M={bits:n.lenbits},E=$o(0,n.lens,0,19,n.lencode,0,n.work,M),n.lenbits=M.bits,E){e.msg="invalid code lengths set",n.mode=os;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;g=(T=n.lencode[l&(1<<n.lenbits)-1])>>>16&255,y=65535&T,!((p=T>>>24)<=d);){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(y<16)l>>>=p,d-=p,n.lens[n.have++]=y;else{if(16===y){for(P=p+2;d<P;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(l>>>=p,d-=p,0===n.have){e.msg="invalid bit length repeat",n.mode=os;break}S=n.lens[n.have-1],m=3+(3&l),l>>>=2,d-=2}else if(17===y){for(P=p+3;d<P;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}d-=p,S=0,m=3+(7&(l>>>=p)),l>>>=3,d-=3}else{for(P=p+7;d<P;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}d-=p,S=0,m=11+(127&(l>>>=p)),l>>>=7,d-=7}if(n.have+m>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=os;break}for(;m--;)n.lens[n.have++]=S}}if(n.mode===os)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=os;break}if(n.lenbits=9,M={bits:n.lenbits},E=$o(1,n.lens,0,n.nlen,n.lencode,0,n.work,M),n.lenbits=M.bits,E){e.msg="invalid literal/lengths set",n.mode=os;break}if(n.distbits=6,n.distcode=n.distdyn,M={bits:n.distbits},E=$o(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,M),n.distbits=M.bits,E){e.msg="invalid distances set",n.mode=os;break}if(n.mode=is,t===Ho)break e;case is:n.mode=as;case as:if(s>=6&&u>=258){e.next_out=o,e.avail_out=u,e.next_in=r,e.avail_in=s,n.hold=l,n.bits=d,Fo(e,c),o=e.next_out,a=e.output,u=e.avail_out,r=e.next_in,i=e.input,s=e.avail_in,l=n.hold,d=n.bits,n.mode===es&&(n.back=-1);break}for(n.back=0;g=(T=n.lencode[l&(1<<n.lenbits)-1])>>>16&255,y=65535&T,!((p=T>>>24)<=d);){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(g&&!(240&g)){for(b=p,w=g,k=y;g=(T=n.lencode[k+((l&(1<<b+w)-1)>>b)])>>>16&255,y=65535&T,!(b+(p=T>>>24)<=d);){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}l>>>=b,d-=b,n.back+=b}if(l>>>=p,d-=p,n.back+=p,n.length=y,0===g){n.mode=16205;break}if(32&g){n.back=-1,n.mode=es;break}if(64&g){e.msg="invalid literal/length code",n.mode=os;break}n.extra=15&g,n.mode=16201;case 16201:if(n.extra){for(P=n.extra;d<P;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;g=(T=n.distcode[l&(1<<n.distbits)-1])>>>16&255,y=65535&T,!((p=T>>>24)<=d);){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(!(240&g)){for(b=p,w=g,k=y;g=(T=n.distcode[k+((l&(1<<b+w)-1)>>b)])>>>16&255,y=65535&T,!(b+(p=T>>>24)<=d);){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}l>>>=b,d-=b,n.back+=b}if(l>>>=p,d-=p,n.back+=p,64&g){e.msg="invalid distance code",n.mode=os;break}n.offset=y,n.extra=15&g,n.mode=16203;case 16203:if(n.extra){for(P=n.extra;d<P;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=os;break}n.mode=16204;case 16204:if(0===u)break e;if(m=c-u,n.offset>m){if((m=n.offset-m)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=os;break}m>n.wnext?(m-=n.wnext,f=n.wsize-m):f=n.wnext-m,m>n.length&&(m=n.length),v=n.window}else v=a,f=o-n.offset,m=n.length;m>u&&(m=u),u-=m,n.length-=m;do{a[o++]=v[f++]}while(--m);0===n.length&&(n.mode=as);break;case 16205:if(0===u)break e;a[o++]=n.length,u--,n.mode=as;break;case rs:if(n.wrap){for(;d<32;){if(0===s)break e;s--,l|=i[r++]<<d,d+=8}if(c-=u,e.total_out+=c,n.total+=c,4&n.wrap&&c&&(e.adler=n.check=n.flags?Eo(n.check,a,c,o-c):ko(n.check,a,c,o-c)),c=u,4&n.wrap&&(n.flags?l:ss(l))!==n.check){e.msg="incorrect data check",n.mode=os;break}l=0,d=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(4&n.wrap&&l!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=os;break}l=0,d=0}n.mode=16208;case 16208:E=Go;break e;case os:E=Ko;break e;case 16210:return Yo;default:return Xo}return e.next_out=o,e.avail_out=u,e.next_in=r,e.avail_in=s,n.hold=l,n.bits=d,(n.wsize||c!==e.avail_out&&n.mode<os&&(n.mode<rs||t!==zo))&&ys(e,e.output,e.next_out,c-e.avail_out),h-=e.avail_in,c-=e.avail_out,e.total_in+=h,e.total_out+=c,n.total+=c,4&n.wrap&&c&&(e.adler=n.check=n.flags?Eo(n.check,a,c,e.next_out-c):ko(n.check,a,c,e.next_out-c)),e.data_type=n.bits+(n.last?64:0)+(n.mode===es?128:0)+(n.mode===is||n.mode===ns?256:0),(0===h&&0===c||t===zo)&&E===Uo&&(E=qo),E},ws={inflateReset:ms,inflateReset2:fs,inflateResetKeep:cs,inflateInit:e=>vs(e,15),inflateInit2:vs,inflate:bs,inflateEnd:e=>{if(hs(e))return Xo;var t=e.state;return t.window&&(t.window=null),e.state=null,Uo},inflateGetHeader:(e,t)=>{if(hs(e))return Xo;var n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,Uo):Xo},inflateSetDictionary:(e,t)=>{var n,i=t.length;return hs(e)||0!==(n=e.state).wrap&&n.mode!==Zo?Xo:n.mode===Zo&&ko(1,t,i,0)!==n.check?Ko:ys(e,t,i,i)?(n.mode=16210,Yo):(n.havedict=1,Uo)},inflateInfo:"pako inflate (from Nodeca project)"};var ks=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},Ss=Object.prototype.toString,Es=Po.Z_NO_FLUSH,Ms=Po.Z_FINISH,Ps=Po.Z_OK,Ts=Po.Z_STREAM_END,_s=Po.Z_NEED_DICT,Ds=Po.Z_STREAM_ERROR,As=Po.Z_DATA_ERROR,xs=Po.Z_MEM_ERROR;function Cs(e){this.options=_o.assign({chunkSize:65536,windowBits:15,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Io,this.strm.avail_out=0;var n=ws.inflateInit2(this.strm,t.windowBits);if(n!==Ps)throw new Error(Mo[n]);if(this.header=new ks,ws.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Co.string2buf(t.dictionary):"[object ArrayBuffer]"===Ss.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=ws.inflateSetDictionary(this.strm,t.dictionary))!==Ps))throw new Error(Mo[n])}function Is(e,t){var n=new Cs(t);if(n.push(e),n.err)throw n.msg||Mo[n.err];return n.result}Cs.prototype.push=function(e,t){var n,i,a,r=this.strm,o=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return!1;for(i=t===~~t?t:!0===t?Ms:Es,"[object ArrayBuffer]"===Ss.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(o),r.next_out=0,r.avail_out=o),(n=ws.inflate(r,i))===_s&&s&&((n=ws.inflateSetDictionary(r,s))===Ps?n=ws.inflate(r,i):n===As&&(n=_s));r.avail_in>0&&n===Ts&&r.state.wrap>0&&0!==e[r.next_in];)ws.inflateReset(r),n=ws.inflate(r,i);switch(n){case Ds:case As:case _s:case xs:return this.onEnd(n),this.ended=!0,!1}if(a=r.avail_out,r.next_out&&(0===r.avail_out||n===Ts))if("string"===this.options.to){var u=Co.utf8border(r.output,r.next_out),l=r.next_out-u,d=Co.buf2string(r.output,u);r.next_out=l,r.avail_out=o-l,l&&r.output.set(r.output.subarray(u,u+l),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(n!==Ps||0!==a){if(n===Ts)return n=ws.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},Cs.prototype.onData=function(e){this.chunks.push(e)},Cs.prototype.onEnd=function(e){e===Ps&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=_o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Ls={Inflate:Cs,inflate:Is,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Is(e,t)},ungzip:Is,constants:Po}.ungzip,Fs=e=>{var t;if(null!=e&&e.includes(Vt))t=Bt;else{var n=null==e?void 0:e.find((e=>e.includes(Ut)));t=n?n.split("=")[1]:$t}return(t=t.replace(/\/$/,""))+"/"+Nt},Rs=e=>{var t,n,i=Qr.getAppConfig(Ge)||Qr.getAppConfig(it);return null!==(t=null==i||null===(n=i.capabilities)||void 0===n?void 0:n.includes(e))&&void 0!==t&&t},Ws=e=>{var t=!Rs(me.THIRD_PARTY_TRANSACTIONS);return e&&!t&&$n.info(`[${e}] Your plan does not have purchase management features.`),t};function Os(e){try{var t=function(e){if("undefined"!=typeof Buffer)return new Uint8Array(Buffer.from(e,"base64"));for(var t=atob(e),n=t.length,i=new Uint8Array(n),a=0;a<n;a++)i[a]=t.charCodeAt(a);return i}(e.trim()),n=Ls(t),i=(new TextDecoder).decode(n);return JSON.parse(i)}catch(e){return}}function Ns(e,t,n){var i=n.value;return n.value=function(...e){if(!this.platformID)throw new io;return i.apply(this,e)},n}function js(e,t,n){var i=n.value;return n.value=function(...e){var t=Qr.getDevice();if(null==t||!t.id)throw new ao;return i.apply(this,e)},n}var $s,zs=function(){return p((function e(){h(this,e);var t=Qr.getNamiConfig();!this.platformID&&t&&this.configure(t)}),[{key:"deviceID",get:function(){var e;return null===(e=Qr.getDevice())||void 0===e?void 0:e.id}},{key:"configure",value:function(e){this.baseURL=Fs(e.namiCommands),this.platformID=e.appPlatformID}},{key:"login",value:function(e){var t,n;return T((function(i){for(;;)switch(i.n){case 0:if(e){i.n=1;break}throw new ro;case 1:return t=`device/${this.deviceID}/login/`,n={external_id:e},i.n=2,l(this.requestBodyAPI(t,n,"PUT"));case 2:return i.a(2,i.v)}}),null,this,null,Promise)}},{key:"logout",value:function(){var e;return T((function(t){for(;;)switch(t.n){case 0:return e=`device/${this.deviceID}/logout/`,t.n=1,l(this.requestBodyAPI(e,{},"PUT"));case 1:return t.a(2,t.v)}}),null,this,null,Promise)}},{key:"startSession",value:function(e){var t,n;return T((function(i){for(;;)switch(i.n){case 0:return t=`device/${this.deviceID}/session/`,i.n=1,l(this.requestBodyAPI(t,{start_time:e,app_env:"production"}));case 1:n=i.v,Qr.setSessionCounter(),n.id&&Qr.setSessionId(n.id);case 2:return i.a(2)}}),null,this,null,Promise)}},{key:"postImpression",value:function(e){var t,n;return T((function(i){for(;;)switch(i.n){case 0:return t=`device/${this.deviceID}/impression/`,i.n=1,l(this.requestBodyAPI(t,e,"POST",!0));case 1:(n=i.v).id&&Qr.setLastImpressionId(n.id);case 2:return i.a(2)}}),null,this,null,Promise)}},{key:"postConversion",value:function(e){var t;return T((function(n){for(;;)switch(n.n){case 0:return t=`device/${this.deviceID}/transaction/`,n.n=1,l(this.requestBodyAPI(t,e,"POST",!0));case 1:return n.a(2)}}),null,this,null,Promise)}},{key:"purchaseValidation",value:function(e){var t;return T((function(n){for(;;)switch(n.n){case 0:return t=`device/${this.deviceID}/purchase_event/`,n.n=1,l(this.requestBodyAPI(t,e,"PUT"));case 1:return n.a(2)}}),null,this,null,Promise)}},{key:"fetchAPI",value:function(e,t,n){var i;return T((function(a){for(;;)switch(a.n){case 0:return i=`${this.baseURL}/${this.platformID}/`+e,a.n=1,l(yo(i,void 0,t,n));case 1:return a.a(2,a.v)}}),null,this,null,Promise)}},{key:"requestBodyAPI",value:function(e,t,n="POST",i=!1,a,r){var o,s;return T((function(u){for(;;)switch(u.n){case 0:return o=`${this.baseURL}/${this.platformID}/`+e,s={method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:i},u.n=1,l(yo(o,s,a,r));case 1:return u.a(2,u.v)}}),null,this,null,Promise)}}],[{key:"configure",value:function(e){this.instance.configure(e)}}])}();function Bs(e){return null!=(null==e?void 0:e.flow)}zs.instance=new zs,de([js],zs.prototype,"login",null),de([js],zs.prototype,"logout",null),de([js],zs.prototype,"startSession",null),de([js],zs.prototype,"postImpression",null),de([js],zs.prototype,"postConversion",null),de([js],zs.prototype,"purchaseValidation",null),de([Ns],zs.prototype,"fetchAPI",null),de([Ns],zs.prototype,"requestBodyAPI",null),function(e){e.DEFAULT="default",e.LABEL="label",e.UNKNOWN="unknown",e.URL="url"}($s||($s={}));var Hs=()=>{var e;return null!==(e=Qr.getPaywalls(st))&&void 0!==e?e:[]},Us=()=>{var e;return null!==(e=Qr.getPaywalls(Ye))&&void 0!==e?e:[]},Gs=()=>qr(zn([...Us(),...Hs()]),"id"),Vs=e=>Gs().find((t=>t.id===e)),Xs=e=>{var t=Gs(),n=new Set(t.map((e=>e.id)));return e.every((e=>n.has(e)))};function Ks(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ys,qs={exports:{}};var Js=(Ys||(Ys=1,qs.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var a=t[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(i,a,function(t){return e[t]}.bind(null,a));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}({17:function(e,t,n){t.__esModule=!0,t.default=void 0;var i=n(18),a=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,i){void 0===i&&(i=!1);var a=e.getVersionPrecision(t),r=e.getVersionPrecision(n),o=Math.max(a,r),s=0,u=e.map([t,n],(function(t){var n=o-e.getVersionPrecision(t),i=t+new Array(n+1).join(".0");return e.map(i.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(i&&(s=o-Math.min(a,r)),o-=1;o>=s;){if(u[0][o]>u[1][o])return 1;if(u[0][o]===u[1][o]){if(o===s)return 0;o-=1}else if(u[0][o]<u[1][o])return-1}},e.map=function(e,t){var n,i=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)i.push(t(e[n]));return i},e.find=function(e,t){var n,i;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,i=e.length;n<i;n+=1){var a=e[n];if(t(a,n))return a}},e.assign=function(e){for(var t,n,i=e,a=arguments.length,r=new Array(a>1?a-1:0),o=1;o<a;o++)r[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[e].concat(r));var s=function(){var e=r[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){i[t]=e[t]}))};for(t=0,n=r.length;t<n;t+=1)s();return e},e.getBrowserAlias=function(e){return i.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return i.BROWSER_MAP[e]||""},e}();t.default=a,e.exports=t.default},18:function(e,t,n){t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,n){t.__esModule=!0,t.default=void 0;var i,a=(i=n(91))&&i.__esModule?i:{default:i},r=n(18);function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var s=function(){function e(){}var t,n,i;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new a.default(e,t)},e.parse=function(e){return new a.default(e).getResult()},t=e,i=[{key:"BROWSER_MAP",get:function(){return r.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return r.ENGINE_MAP}},{key:"OS_MAP",get:function(){return r.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return r.PLATFORMS_MAP}}],(n=null)&&o(t.prototype,n),i&&o(t,i),e}();t.default=s,e.exports=t.default},91:function(e,t,n){t.__esModule=!0,t.default=void 0;var i=u(n(92)),a=u(n(93)),r=u(n(94)),o=u(n(95)),s=u(n(17));function u(e){return e&&e.__esModule?e:{default:e}}var l=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=s.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=s.default.find(a.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=s.default.find(r.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=s.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return s.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},i=0,a={},r=0;if(Object.keys(e).forEach((function(t){var o=e[t];"string"==typeof o?(a[t]=o,r+=1):"object"==typeof o&&(n[t]=o,i+=1)})),i>0){var o=Object.keys(n),u=s.default.find(o,(function(e){return t.isOS(e)}));if(u){var l=this.satisfies(n[u]);if(void 0!==l)return l}var d=s.default.find(o,(function(e){return t.isPlatform(e)}));if(d){var h=this.satisfies(n[d]);if(void 0!==h)return h}}if(r>0){var c=Object.keys(a),m=s.default.find(c,(function(e){return t.isBrowser(e,!0)}));if(void 0!==m)return this.compareVersion(a[m])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),i=e.toLowerCase(),a=s.default.getBrowserTypeByAlias(i);return t&&a&&(i=a.toLowerCase()),i===n},t.compareVersion=function(e){var t=[0],n=e,i=!1,a=this.getBrowserVersion();if("string"==typeof a)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(i=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(i=!0,n=e.substr(1)),t.indexOf(s.default.compareVersions(a,n,i))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=l,e.exports=t.default},92:function(e,t,n){t.__esModule=!0,t.default=void 0;var i,a=(i=n(17))&&i.__esModule?i:{default:i},r=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=a.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=a.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=a.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=a.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=a.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=a.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=a.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=a.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=a.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=a.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=a.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=a.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=a.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=a.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=a.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=a.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=a.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=a.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=a.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=a.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=a.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=a.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=a.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=a.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=a.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=a.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=a.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:a.default.getFirstMatch(t,e),version:a.default.getSecondMatch(t,e)}}}];t.default=o,e.exports=t.default},93:function(e,t,n){t.__esModule=!0,t.default=void 0;var i,a=(i=n(17))&&i.__esModule?i:{default:i},r=n(18),o=[{test:[/Roku\/DVP/],describe:function(e){var t=a.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:r.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=a.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=a.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=a.default.getWindowsVersionName(t);return{name:r.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:r.OS_MAP.iOS},n=a.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=a.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=a.default.getMacOSVersionName(t),i={name:r.OS_MAP.MacOS,version:t};return n&&(i.versionName=n),i}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=a.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:r.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=a.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=a.default.getAndroidVersionName(t),i={name:r.OS_MAP.Android,version:t};return n&&(i.versionName=n),i}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=a.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:r.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=a.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||a.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||a.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:r.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=a.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=a.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:r.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:r.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=a.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.PlayStation4,version:t}}}];t.default=o,e.exports=t.default},94:function(e,t,n){t.__esModule=!0,t.default=void 0;var i,a=(i=n(17))&&i.__esModule?i:{default:i},r=n(18),o=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=a.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:r.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=a.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:r.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:r.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:r.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:r.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:r.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.tv}}}];t.default=o,e.exports=t.default},95:function(e,t,n){t.__esModule=!0,t.default=void 0;var i,a=(i=n(17))&&i.__esModule?i:{default:i},r=n(18),o=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:r.ENGINE_MAP.Blink};var t=a.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:r.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:r.ENGINE_MAP.Trident},n=a.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:r.ENGINE_MAP.Presto},n=a.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:r.ENGINE_MAP.Gecko},n=a.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:r.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:r.ENGINE_MAP.WebKit},n=a.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=o,e.exports=t.default}})),qs.exports),Qs=Ks(Js),Zs="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},eu="function"==typeof Zs.BigInt,tu=eu?Zs.BigInt.bind(Zs):void 0,nu=eu?tu("0xffffffffffffffffffffffffffffffff"):null,iu=eu?tu("0x100000000000000000000000000000000"):null,au=eu?tu(0):null,ru=eu?tu(1):null,ou=eu?tu(8):null,su=eu?tu(1e4):null,uu=16,lu=1/uu,du={tablet:"tablet",mobile:"phone",tv:"television",desktop:"desktop"},hu=e=>{if("undefined"==typeof window)return{os_version:"X.X.X",os_name:"Server",browser_name:"Unknown",browser_version:"X.X.X",sdk_client:"web",sdk_version:ge,language:"en"};var t=Qs.getParser(window.navigator.userAgent),n=t.getPlatform(),i={os_version:t.getOSVersion(),os_name:t.getOSName(),browser_name:t.getBrowserName(),browser_version:t.getBrowserVersion(),sdk_client:"web",sdk_version:ge,language:window.navigator.language};if(n.type&&(i.form_factor=du[n.type]),n.model&&(i.device_model=n.model),e&&e.length>0){var a=(e=>{var t=e.find((e=>e.includes(Kt))),n={platform:"",version:""};if(t){var i=t.split(qt);n.platform=i[1],n.version=i[2]}return n})(e);i.extended_platform=a.platform,i.extended_platform_version=a.version}return i},cu=()=>{var e=Qr.getNamiConfig();if(e&&e.formFactor)return e.formFactor;if("undefined"==typeof window)return du.desktop;var t=Qs.getParser(window.navigator.userAgent).getPlatform();return t.type?du[t.type]:du.desktop},mu={"1280x720":.67,"1920x1080":1,"3840x2160":2,"7680x4320":4};var fu=()=>{var e=window,t=e.innerWidth,n=e.innerHeight;return Math.min(t/1920,n/1080)||1};function vu(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function pu(e){if(!eu||!nu)return bu(e);try{var t=nu,n=function(e){if(!tu)throw new Error("BigInt is not supported in this environment");var t=e.replace(/-/g,"");return tu("0x"+t)}(e);return Number(n)/Number(t)*100}catch(t){throw $n.error(`Error calculating audience split position for UUID ${e}`,t),new Error(`Invalid UUID format: ${e}`)}}function gu(e){if(!tu)throw new Error("BigInt is not supported in this environment");var t=e.toString(16).padStart(32,"0");t=t.substring(0,12)+"4"+t.substring(13);var n=3&parseInt(t[16],16)|8;return(t=t.substring(0,16)+n.toString(16)+t.substring(17)).slice(0,8)+"-"+t.slice(8,12)+"-"+t.slice(12,16)+"-"+t.slice(16,20)+"-"+t.slice(20)}function yu(e,t=.5){if(!Number.isFinite(e))throw new Error("Invalid target");if(!Number.isFinite(t))throw new Error("Invalid tolerance");var n=Math.max(0,Math.min(100,e)),i=Math.max(0,Math.min(50,t)),a=e=>Math.round(100*e),r=Math.max(0,a(n-i)),o=Math.min(1e4,a(n+i));if(!(eu&&nu&&tu&&su))return function(e,t){for(var n=Math.max(0,Math.min(100,e-t)),i=Math.min(100,Math.max(0,e+t)),a=vu(),r=Number.POSITIVE_INFINITY,o=50,s=0;s<o;s++){var u=vu(),l=bu(u);if(l>=n&&l<=i)return u;var d=wu(l,n,i);d<r&&(r=d,a=u)}return a}(n,i);var s=nu,u=tu,l=su,d=e=>s*u(e)/l,h=d(r),c=d(o);if(c<=h)return gu(h);var m=h+function(e){if(!tu||null===iu||null===ru||null===au||null===ou)throw new Error("BigInt is not supported in this environment");var t=tu,n=au,i=ru,a=ou,r=iu;if(e<n)throw new Error("n must be non-negative");if(e===n)return n;for(var o=new Uint8Array(16),s=e+i,u=r/s*s-i,l=0;l<10;){crypto.getRandomValues(o);for(var d,h=n,c=g(o);!(d=c()).done;)h=h<<a|t(d.value);if(h<=u)return h%s;l++}try{crypto.getRandomValues(o);for(var m,f=n,v=g(o);!(m=v()).done;)f=f<<a|t(m.value);var p=f%s;return $n.warn("randomBigInt: reached max rejection attempts, using modulo fallback",{n:e.toString(),attempts:l}),p}catch(e){throw $n.error("randomBigInt: failed to generate random values",e),new Error("randomBigInt: unable to generate random value")}}(c-h);return gu(m)}function bu(e){var t=function(e){var t=e.replace(/-/g,"").toLowerCase();if(!/^[0-9a-f]{32}$/.test(t))throw new Error(`Invalid UUID format: ${e}`);for(var n=0,i=t.length-1;i>=0;i--){n=(n+parseInt(t[i],uu))*lu}return n}(e);return 100*t}function wu(e,t,n){return e<t?t-e:e>n?e-n:0}var ku,Su=e=>{try{return Boolean(new URL(e))}catch(e){return!1}},Eu=(e,t,n)=>e?e.flatMap((e=>{var i;if(i="string"==typeof n?e.segments.filter((e=>e.form_factors.some((e=>e.form_factor===n)))):e.segments,0===i.length)return[];var a=((e,t)=>{for(var n,i=[...e].sort(((e,t)=>e.split-t.split)),a=g(i);!(n=a()).done;){var r=n.value;if(t<=r.split)return r}return i[i.length-1]})(i,t);return{form_factors:a.form_factors,paywall:a.paywall,flow:a.flow,segment:a.segment,split:a.split,conversion_event_type:a.conversion_event_type,conversion_event_url:a.conversion_event_url,rule:e.rule,name:e.name,type:e.type,value:e.value,external_segment:e.external_segment}})):[],Mu=()=>{var e,t,n=null!==(e=Qr.getCampaignRules(Xe))&&void 0!==e?e:[],i=null!==(t=Qr.getCampaignRules(rt))&&void 0!==t?t:[],a=cu(),r=zn([...n,...i]).filter((e=>{var t;return null===(t=e.form_factors)||void 0===t?void 0:t.some((e=>e.form_factor===a))}));return qr(r,"rule")},Pu=e=>{var t,n=null!==(t=Qr.getCampaignRules(e))&&void 0!==t?t:[],i=cu();return zn(n).filter((e=>{var t;return null===(t=e.form_factors)||void 0===t?void 0:t.some((e=>e.form_factor===i))}))},Tu=()=>Pu(rt),_u=()=>Pu(Xe),Du=(e,t,n,i)=>{var a=e().find((e=>i?e.type==i&&e.value==n:e.type==$s.DEFAULT));if(!a)return{};var r=t().find((e=>(null==a?void 0:a.paywall)===e.id));return{campaign:a,paywall:r}},Au=(e,t)=>{var n=Du(_u,Us,e,t);if(n.campaign&&n.paywall)return{campaign:n.campaign,paywall:n.paywall};var i=Du(Tu,Hs,e,t);return i.campaign&&i.paywall?{campaign:i.campaign,paywall:i.paywall}:n.campaign||n.paywall?{campaign:n.campaign,paywall:n.paywall}:{campaign:i.campaign,paywall:i.paywall}},xu="object"==typeof Reflect?Reflect:null,Cu=xu&&"function"==typeof xu.apply?xu.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};ku=xu&&"function"==typeof xu.ownKeys?xu.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var Iu=Number.isNaN||function(e){return e!=e};function Lu(){Lu.init.call(this)}Lu.EventEmitter=Lu,Lu.prototype._events=void 0,Lu.prototype._eventsCount=0,Lu.prototype._maxListeners=void 0;var Fu=10;function Ru(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function Wu(e){return void 0===e._maxListeners?Lu.defaultMaxListeners:e._maxListeners}function Ou(e,t,n,i){var a,r,o,s;if(Ru(n),void 0===(r=e._events)?(r=e._events=Object.create(null),e._eventsCount=0):(void 0!==r.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),r=e._events),o=r[t]),void 0===o)o=r[t]=n,++e._eventsCount;else if("function"==typeof o?o=r[t]=i?[n,o]:[o,n]:i?o.unshift(n):o.push(n),(a=Wu(e))>0&&o.length>a&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return e}function Nu(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function ju(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=Nu.bind(i);return a.listener=n,i.wrapFn=a,a}function $u(e,t,n){var i=e._events;if(void 0===i)return[];var a=i[t];return void 0===a?[]:"function"==typeof a?n?[a.listener||a]:[a]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(a):Bu(a,a.length)}function zu(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function Bu(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e[i];return n}Object.defineProperty(Lu,"defaultMaxListeners",{enumerable:!0,get:function(){return Fu},set:function(e){if("number"!=typeof e||e<0||Iu(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Fu=e}}),Lu.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Lu.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||Iu(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},Lu.prototype.getMaxListeners=function(){return Wu(this)},Lu.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,a=this._events;if(void 0!==a)i=i&&void 0===a.error;else if(!i)return!1;if(i){var r;if(t.length>0&&(r=t[0]),r instanceof Error)throw r;var o=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw o.context=r,o}var s=a[e];if(void 0===s)return!1;if("function"==typeof s)Cu(s,this,t);else for(var u=s.length,l=Bu(s,u),d=0;d<u;++d)Cu(l[d],this,t);return!0},Lu.prototype.addListener=function(e,t){return Ou(this,e,t,!1)},Lu.prototype.on=Lu.prototype.addListener,Lu.prototype.prependListener=function(e,t){return Ou(this,e,t,!0)},Lu.prototype.once=function(e,t){return Ru(t),this.on(e,ju(this,e,t)),this},Lu.prototype.prependOnceListener=function(e,t){return Ru(t),this.prependListener(e,ju(this,e,t)),this},Lu.prototype.removeListener=function(e,t){var n,i,a,r,o;if(Ru(t),void 0===(i=this._events))return this;if(void 0===(n=i[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(a=-1,r=n.length-1;r>=0;r--)if(n[r]===t||n[r].listener===t){o=n[r].listener,a=r;break}if(a<0)return this;0===a?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,a),1===n.length&&(i[e]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",e,o||t)}return this},Lu.prototype.off=Lu.prototype.removeListener,Lu.prototype.removeAllListeners=function(e){var t,n,i;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var a,r=Object.keys(n);for(i=0;i<r.length;++i)"removeListener"!==(a=r[i])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},Lu.prototype.listeners=function(e){return $u(this,e,!0)},Lu.prototype.rawListeners=function(e){return $u(this,e,!1)},Lu.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):zu.call(e,t)},Lu.prototype.listenerCount=zu,Lu.prototype.eventNames=function(){return this._eventsCount>0?ku(this._events):[]};var Hu=function(){function e(){h(this,e),this.emitter=new Lu}return p(e,[{key:"on",value:function(e,t){this.emitter.on(e,t)}},{key:"off",value:function(e,t){this.emitter.off(e,t)}},{key:"emit",value:function(e,...t){this.emitter.emit(e,...t)}},{key:"addListener",value:function(e,t){this.emitter.addListener(e,t)}},{key:"removeListener",value:function(e,t){this.emitter.removeListener(e,t)}},{key:"removeAllListeners",value:function(e){e?this.emitter.removeAllListeners(e):this.emitter.removeAllListeners()}},{key:"listeners",value:function(e){return this.emitter.listeners(e)}},{key:"listenerCount",value:function(e){return this.emitter.listenerCount(e)}}],[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}])}(),Uu=function(){return p((function e(){h(this,e),this.disableCampaignUpdates=!1,this.currentFormFactor=cu()}),[{key:"configure",value:function(e,t,n=[]){this.currentFormFactor=e,this.splitPosition=t,this.disableCampaignUpdates=n.includes("disableCampaignUpdates")}},{key:"fetchCampaignRules",value:function(e){var t,n,i,a;return T((function(r){for(;;)switch(r.n){case 0:if(i=Qr.getDevice(),!this.disableCampaignUpdates){r.n=1;break}return $n.info("Campaign updates disabled by configuration. Skipping fetch."),r.a(2,[]);case 1:if(null!=i&&i.id){r.n=3;break}return r.n=2,l(this.getAnonymousCampaigns());case 2:a=r.v,r.n=5;break;case 3:return r.n=4,l(this.getCampaigns(i.id));case 4:a=r.v;case 5:return a=null===(t=a)||void 0===t?void 0:t.filter((e=>{var t;return e.paywall&&e.form_factors.some((e=>e.form_factor===this.currentFormFactor))||e.flow&&(null===(t=e.flow)||void 0===t||null===(t=t.object)||void 0===t||null===(t=t.form_factors)||void 0===t?void 0:t.some((e=>e.form_factor===this.currentFormFactor)))})),a=null===(n=a)||void 0===n?void 0:n.filter((t=>{if(t.paywall){var n=e.find((e=>e.id==t.paywall));if(n)return t}else if(t.flow)return t})),Qr.setCampaignRules(Xe,a),this.invokeAvailableCampaignsResponseHandler(),r.a(2,a)}}),null,this,null,Promise)}},{key:"invokeAvailableCampaignsResponseHandler",value:function(){var e=Hu.getInstance().listeners(En),t=Mu();e.forEach((e=>e(t)))}},{key:"getAnonymousCampaigns",value:function(e=ge){var t,n,i,a,r;return T((function(o){for(;;)switch(o.p=o.n){case 0:return t=`campaign_rules/?sdk_version=${e}`,o.p=1,o.n=2,l(zs.instance.fetchAPI(t));case 2:return i=o.v,o.a(2,Eu(null!==(n=i.results)&&void 0!==n?n:[],this.splitPosition,this.currentFormFactor));case 3:if(o.p=3,r=o.v,a=this.fallbackData()){o.n=4;break}throw $n.error(go(r.status,t)),r;case 4:return o.a(2,a.results)}}),null,this,[[1,3]],Promise)}},{key:"getCampaigns",value:function(e){var t,n,i,a;return T((function(r){for(;;)switch(r.p=r.n){case 0:return n=`device/${e}/campaign_rules/`,r.p=1,r.n=2,l(zs.instance.fetchAPI(n));case 2:i=r.v,r.n=4;break;case 3:if(r.p=3,a=r.v,i=this.fallbackData()){r.n=4;break}throw $n.error(go(a.status,n)),a;case 4:return r.a(2,(null===(t=i)||void 0===t?void 0:t.results)||[])}}),null,this,[[1,3]],Promise)}},{key:"fallbackData",value:function(){var e=Qr.getCampaignRules(Xe)||Qr.getCampaignRules(rt);return e?{count:e.length,results:e}:null}}])}();function Gu(e,t){return hr(e,t)}Uu.instance=new Uu;var Vu=function(){return p((function e(){h(this,e)}),[{key:"createOrUpdateDevice",value:function(e,t,n){var i=Qr.getDevice();if(null==i||!i.id){var a,r=y({},e,{id:null!==(a=null!=t?t:this.getAnonymousUUID())&&void 0!==a?a:vu()});return{id:r.id,device:this.createDevice(r,n)}}return this.isEqualDevices(i,e)?{id:i.id,device:Promise.resolve(i)}:(this.updateDevice(i.id,e),{id:i.id,device:null})}},{key:"createDevice",value:function(e,t){var n,i;return T((function(a){for(;;)switch(a.p=a.n){case 0:return a.p=0,a.n=1,l(this.requestAPIData("device/",e,void 0,void 0,0));case 1:if(!(n=a.v)){a.n=2;break}Qr.setDevice(n),a.n=3;break;case 2:return $n.info("Device creation returned null, switching to anon mode for this session"),null==t||t.setInMemoryAnonymousMode(!0),a.a(2,null);case 3:return a.a(2,n);case 4:if(a.p=4,i=a.v,console.error("Error creating device:",i),!(i instanceof Zr)){a.n=5;break}return $n.info("Retry limit exceeded, switching to anon mode for this session"),null==t||t.setInMemoryAnonymousMode(!0),a.a(2,null);case 5:throw i;case 6:return a.a(2)}}),null,this,[[0,4]],Promise)}},{key:"updateDevice",value:function(e,t){var n;return T((function(i){for(;;)switch(i.n){case 0:return i.n=1,l(this.requestAPIData(`device/${e}/`,t,"PUT"));case 1:return(n=i.v)&&Qr.setDevice(n),i.a(2,n)}}),null,this,null,Promise)}},{key:"updateDeviceField",value:function(e,t){var n,i,a;return T((function(r){for(;;)switch(r.n){case 0:if(n={[e]:t},null!=(i=Qr.getDevice())&&i.id){r.n=1;break}throw new ao;case 1:return r.n=2,l(this.requestAPIData(`device/${i.id}/`,n,"PATCH"));case 2:return(a=r.v)&&Qr.setDevice(a),r.a(2,a)}}),null,this,null,Promise)}},{key:"requestAPIData",value:function(e,t,n="POST",i=sn,a){var r,o;return T((function(s){for(;;)switch(s.p=s.n){case 0:return s.p=0,s.n=1,l(zs.instance.requestBodyAPI(e,t,n,!1,i,a));case 1:r=s.v,s.n=5;break;case 2:if(s.p=2,!((o=s.v)instanceof io)){s.n=3;break}throw o;case 3:if(!("device/"===e&&o instanceof Zr)){s.n=4;break}throw o;case 4:if(r=Qr.getDevice()){s.n=5;break}return $n.error(go(o.status,e)),s.a(2,null);case 5:return s.a(2,r)}}),null,null,[[0,2]],Promise)}},{key:"isEqualDevices",value:function(e,t){var n=y({},e,t);return Gu(Object.keys(e).reduce(((e,t)=>(e[t]=n[t],e)),{}),e)}},{key:"getOrCreateAnonymousUUID",value:function(){var e=Qr.getAnonymousUUID();return e||(e=vu(),Qr.setAnonymousUUID(e)),e}},{key:"getAnonymousUUID",value:function(){var e=Qr.getAnonymousUUID();return e?(Qr.clearAnonymousUUID(),e):null}}])}();Vu.instance=new Vu;var Xu=function(){return p((function e(){h(this,e)}),[{key:"fetchProducts",value:function(){var e,t,n,i;return T((function(a){for(;;)switch(a.p=a.n){case 0:if(!Rs(me.THIRD_PARTY_TRANSACTIONS)){a.n=1;break}return a.a(2,[]);case 1:return a.p=1,a.n=2,l(zs.instance.fetchAPI("products/"));case 2:n=a.v,a.n=4;break;case 3:if(a.p=3,i=a.v,n=this.fallbackData()){a.n=4;break}throw $n.error(go(i.status,"products/")),i;case 4:return null!==(e=n)&&void 0!==e&&e.results&&Qr.setProducts(Je,n.results),a.a(2,(null===(t=n)||void 0===t?void 0:t.results)||[])}}),null,this,[[1,3]],Promise)}},{key:"fallbackData",value:function(){var e=Qr.getProducts(Je)||Qr.getProducts(lt);return e?{count:e.length,results:e}:null}}])}();Xu.instance=new Xu;var Ku=function(){return p((function e(){h(this,e)}),[{key:"fetchPaywalls",value:function(){var e,t;return T((function(n){for(;;)switch(n.n){case 0:if(null!=(e=Qr.getDevice())&&e.id){n.n=2;break}return n.n=1,l(this.getAnonymousPaywalls());case 1:t=n.v,n.n=4;break;case 2:return n.n=3,l(this.getPaywalls(e.id));case 3:t=n.v;case 4:return t&&Qr.setPaywalls(Ye,t),n.a(2,t)}}),null,this,null,Promise)}},{key:"getAnonymousPaywalls",value:function(e=ge){var t,n,i,a;return T((function(r){for(;;)switch(r.p=r.n){case 0:return n=`paywalls/?sdk_version=${e}`,i=null,r.p=1,r.n=2,l(zs.instance.fetchAPI(n));case 2:i=r.v,r.n=4;break;case 3:if(r.p=3,a=r.v,i=this.fallbackData()){r.n=4;break}throw $n.error(go(a.status,n)),a;case 4:return r.a(2,(null===(t=i)||void 0===t?void 0:t.results)||[])}}),null,this,[[1,3]],Promise)}},{key:"getPaywalls",value:function(e){var t,n,i,a;return T((function(r){for(;;)switch(r.p=r.n){case 0:return n=`device/${e}/paywalls/`,r.p=1,r.n=2,l(zs.instance.fetchAPI(n));case 2:i=r.v,r.n=4;break;case 3:if(r.p=3,a=r.v,i=this.fallbackData()){r.n=4;break}throw $n.error(go(a.status,n)),a;case 4:return r.a(2,(null===(t=i)||void 0===t?void 0:t.results)||[])}}),null,this,[[1,3]],Promise)}},{key:"fallbackData",value:function(){var e=Qr.getPaywalls(Ye)||Qr.getPaywalls(st);return e?{count:e.length,results:e}:null}}])}();Ku.instance=new Ku;var Yu=function(){return p((function e(){h(this,e)}),[{key:"fetchConfig",value:function(){var e,t;return T((function(n){for(;;)switch(n.p=n.n){case 0:return n.p=0,n.n=1,l(zs.instance.fetchAPI("config/"));case 1:e=n.v,n.n=3;break;case 2:if(n.p=2,t=n.v,e=Qr.getAppConfig(Ge)||Qr.getAppConfig(it)){n.n=3;break}throw $n.error(go(t.status,"config/")),t;case 3:return e&&Qr.setAppConfig(Ge,e),n.a(2,e)}}),null,null,[[0,2]],Promise)}}])}();Yu.instance=new Yu;var qu=null;function Ju(){return!!Qr.getAnonymousMode()||!!qu&&qu.isInMemoryAnonymousMode()}var Qu=function(){return p((function e(){h(this,e)}),[{key:"startSession",value:function(){var e;return T((function(t){for(;;)switch(t.p=t.n){case 0:if(!Ju()){t.n=1;break}return $n.debug("Skipping session start call - anonymous mode"),t.a(2);case 1:return t.p=1,t.n=2,l(zs.instance.startSession(new Date));case 2:t.n=4;break;case 3:t.p=3,e=t.v,$n.error("error on start session: ",e);case 4:return t.a(2)}}),null,null,[[1,3]],Promise)}}])}();Qu.instance=new Qu;var Zu=function(){return p((function e(){h(this,e)}),null,[{key:"allPurchases",value:function(){return[]}}])}();Zu.instance=new Zu;var el={en:{nami_day:"day",nami_day_plural:"days",nami_week:"week",nami_week_plural:"weeks",nami_month:"month",nami_month_plural:"months",nami_year:"year",nami_year_plural:"years",nami_day_abbrev:"day",nami_day_abbrev_plural:"days",nami_week_abbrev:"wk",nami_week_abbrev_plural:"wks",nami_month_abbrev:"mo",nami_month_abbrev_plural:"mos",nami_year_abbrev:"yr",nami_year_abbrev_plural:"yrs",nami_daily:"daily",nami_weekly:"weekly",nami_biweekly:"bi-weekly",nami_monthly:"monthly",nami_bimonthly:"bi-monthly",nami_quarterly:"quarterly",nami_biannually:"bi-annually",nami_yearly:"yearly"},af:{nami_day_abbrev:"dag",nami_day_abbrev_plural:"dae",nami_week_abbrev:"week",nami_week_abbrev_plural:"weke",nami_month_abbrev:"ma",nami_month_abbrev_plural:"maande",nami_year_abbrev:"jr",nami_year_abbrev_plural:"jare",nami_daily:"daagliks",nami_weekly:"weekliks",nami_biweekly:"tweeweekliks",nami_monthly:"maandeliks",nami_bimonthly:"tweemaandeliks",nami_quarterly:"kwartaalliks",nami_biannually:"tweejaarliks",nami_yearly:"jaarliks"},am:{nami_day_abbrev:"ቀን",nami_day_abbrev_plural:"ቀናት",nami_week_abbrev:"ሳምንት",nami_week_abbrev_plural:"ሳምንታት",nami_month_abbrev:"ወር",nami_month_abbrev_plural:"ሞስ",nami_year_abbrev:"ዓመት",nami_year_abbrev_plural:"ዓመታት",nami_daily:"በየቀኑ",nami_weekly:"ሳምንታዊ",nami_biweekly:"በየሁለት ሳምንቱ",nami_monthly:"ወርሃዊ",nami_bimonthly:"በየሁለት ወሩ",nami_quarterly:"በየሩብ ዓመቱ",nami_biannually:"በየሁለት ዓመቱ",nami_yearly:"ዓመታዊ"},ar:{nami_day_abbrev:"يوم",nami_day_abbrev_plural:"أيام",nami_week_abbrev:"أسبوع",nami_week_abbrev_plural:"أسابيع",nami_month_abbrev:"شهر",nami_month_abbrev_plural:"موس",nami_year_abbrev:"سنة",nami_year_abbrev_plural:"سنوات",nami_daily:"يوميًا",nami_weekly:"أسبوعي",nami_biweekly:"كل أسبوعين",nami_monthly:"شهريا",nami_bimonthly:"كل شهرين",nami_quarterly:"ربع سنوي",nami_biannually:"مرتين في السنة",nami_yearly:"سنوي"},bg:{nami_day_abbrev:"ден",nami_day_abbrev_plural:"дни",nami_week_abbrev:"седмица",nami_week_abbrev_plural:"седмици",nami_month_abbrev:"мо",nami_month_abbrev_plural:"мос",nami_year_abbrev:"год.",nami_year_abbrev_plural:"години",nami_daily:"ежедневно",nami_weekly:"седмично",nami_biweekly:"двуседмичен",nami_monthly:"месечно",nami_bimonthly:"двумесечно",nami_quarterly:"тримесечно",nami_biannually:"два пъти годишно",nami_yearly:"годишно"},ca:{nami_day_abbrev:"dia",nami_day_abbrev_plural:"dies",nami_week_abbrev:"setmana",nami_week_abbrev_plural:"setmanes",nami_month_abbrev:"mes",nami_month_abbrev_plural:"mesos",nami_year_abbrev:"any",nami_year_abbrev_plural:"anys",nami_daily:"diàriament",nami_weekly:"setmanal",nami_biweekly:"quinzenal",nami_monthly:"mensual",nami_bimonthly:"bimensual",nami_quarterly:"trimestral",nami_biannually:"bianualment",nami_yearly:"anual"},cs:{nami_day_abbrev:"den",nami_day_abbrev_plural:"dny",nami_week_abbrev:"týden",nami_week_abbrev_plural:"týdny",nami_month_abbrev:"měsíc",nami_month_abbrev_plural:"měsíce",nami_year_abbrev:"rok",nami_year_abbrev_plural:"roky",nami_daily:"denní",nami_weekly:"týdně",nami_biweekly:"dvoutýdenní",nami_monthly:"měsíční",nami_bimonthly:"dvouměsíčník",nami_quarterly:"čtvrtletní",nami_biannually:"pololetně",nami_yearly:"roční"},de:{nami_day_abbrev:"Tag",nami_day_abbrev_plural:"Tage",nami_week_abbrev:"Woche",nami_week_abbrev_plural:"Wochen",nami_month_abbrev:"Monat",nami_month_abbrev_plural:"Monate",nami_year_abbrev:"Jahr",nami_year_abbrev_plural:"Jahre",nami_daily:"täglich",nami_weekly:"wöchentlich",nami_biweekly:"zweiwöchentlich",nami_monthly:"monatlich",nami_bimonthly:"zweimonatlich",nami_quarterly:"vierteljährlich",nami_biannually:"halbjährlich",nami_yearly:"jährlich"},el:{nami_day_abbrev:"ημέρα",nami_day_abbrev_plural:"ημέρες",nami_week_abbrev:"εβδομάδα",nami_week_abbrev_plural:"εβδομάδες",nami_month_abbrev:"μήνα",nami_month_abbrev_plural:"μην",nami_year_abbrev:"έτος",nami_year_abbrev_plural:"χρόνια",nami_daily:"καθημερινά",nami_weekly:"εβδομαδιαίος",nami_biweekly:"ανά δύο εβδομάδες",nami_monthly:"μηνιαίος",nami_bimonthly:"διμηνιαίος",nami_quarterly:"τριμηνιαίος",nami_biannually:"ανά εξάμηνο",nami_yearly:"ετήσια"},es:{nami_day_abbrev:"día",nami_day_abbrev_plural:"días",nami_week_abbrev:"semana",nami_week_abbrev_plural:"semanas",nami_month_abbrev:"mes",nami_month_abbrev_plural:"meses",nami_year_abbrev:"año",nami_year_abbrev_plural:"años",nami_daily:"diario",nami_weekly:"semanal",nami_biweekly:"quincenal",nami_monthly:"mensual",nami_bimonthly:"bimensual",nami_quarterly:"trimestral",nami_biannually:"semestral",nami_yearly:"anual"},et:{nami_day_abbrev:"päev",nami_day_abbrev_plural:"päevad",nami_week_abbrev:"nädal",nami_week_abbrev_plural:"nädalat",nami_month_abbrev:"kuu",nami_month_abbrev_plural:"kuud",nami_year_abbrev:"aasta",nami_year_abbrev_plural:"aastat",nami_daily:"iga päev",nami_weekly:"iganädalane",nami_biweekly:"iga kahe nädala tagant",nami_monthly:"igakuine",nami_bimonthly:"kaks korda kuus",nami_quarterly:"kvartali",nami_biannually:"kaks korda aastas",nami_yearly:"iga-aastane"},fa:{nami_day_abbrev:"روز",nami_day_abbrev_plural:"روزها",nami_week_abbrev:"هفته",nami_week_abbrev_plural:"هفتهها",nami_month_abbrev:"مو",nami_month_abbrev_plural:"موش",nami_year_abbrev:"سال",nami_year_abbrev_plural:"سال",nami_daily:"روزانه",nami_weekly:"هفتگی",nami_biweekly:"دو هفتهای",nami_monthly:"ماهانه",nami_bimonthly:"دوماهه",nami_quarterly:"سه ماهه",nami_biannually:"دوسالانه",nami_yearly:"سالانه"},fi:{nami_day_abbrev:"päivä",nami_day_abbrev_plural:"päivää",nami_week_abbrev:"viikko",nami_week_abbrev_plural:"viikkoa",nami_month_abbrev:"kuukausi",nami_month_abbrev_plural:"kuukaudet",nami_year_abbrev:"vuosi",nami_year_abbrev_plural:"vuotta",nami_daily:"päivittäin",nami_weekly:"viikoittain",nami_biweekly:"joka toinen viikko",nami_monthly:"kuukausittain",nami_bimonthly:"kahdesti kuussa",nami_quarterly:"neljännesvuosittain",nami_biannually:"puolivuosittain",nami_yearly:"vuosittain"},fr:{nami_day_abbrev:"jour",nami_day_abbrev_plural:"jours",nami_week_abbrev:"semaine",nami_week_abbrev_plural:"semaines",nami_month_abbrev:"mois",nami_month_abbrev_plural:"mois",nami_year_abbrev:"année",nami_year_abbrev_plural:"ans",nami_daily:"tous les jours",nami_weekly:"hebdomadaire",nami_biweekly:"bihebdomadaire",nami_monthly:"mensuel",nami_bimonthly:"bimensuel",nami_quarterly:"trimestriel",nami_biannually:"bisannuel",nami_yearly:"annuel"},hi:{nami_day_abbrev:"दिन",nami_day_abbrev_plural:"दिन",nami_week_abbrev:"सप्त",nami_week_abbrev_plural:"सप्त",nami_month_abbrev:"महीना",nami_month_abbrev_plural:"महीने",nami_year_abbrev:"साल",nami_year_abbrev_plural:"वर्षीय",nami_daily:"दैनिक",nami_weekly:"साप्ताहिक",nami_biweekly:"द्वि-साप्ताहिक",nami_monthly:"महीने के",nami_bimonthly:"द्विमासिक",nami_quarterly:"त्रैमासिक",nami_biannually:"द्वि-वार्षिक रूप",nami_yearly:"वार्षिक"},hr:{nami_day_abbrev:"dan",nami_day_abbrev_plural:"dana",nami_week_abbrev:"tjedan",nami_week_abbrev_plural:"tjedni",nami_month_abbrev:"mjesec",nami_month_abbrev_plural:"mjeseca",nami_year_abbrev:"god.",nami_year_abbrev_plural:"godina",nami_daily:"dnevno",nami_weekly:"tjedno",nami_biweekly:"dvotjedno",nami_monthly:"mjesečno",nami_bimonthly:"dvomjesečno",nami_quarterly:"tromjesečno",nami_biannually:"dvogodišnje",nami_yearly:"godišnje"},hu:{nami_day_abbrev:"nap",nami_day_abbrev_plural:"napok",nami_week_abbrev:"hét",nami_week_abbrev_plural:"hetek",nami_month_abbrev:"hónap",nami_month_abbrev_plural:"hónap",nami_year_abbrev:"év",nami_year_abbrev_plural:"év",nami_daily:"napi",nami_weekly:"heti",nami_biweekly:"kéthetente",nami_monthly:"havi",nami_bimonthly:"kéthavonta",nami_quarterly:"negyedévenként",nami_biannually:"félévente",nami_yearly:"évi"},id:{nami_day_abbrev:"hari",nami_day_abbrev_plural:"hari",nami_week_abbrev:"minggu",nami_week_abbrev_plural:"minggu",nami_month_abbrev:"bulan",nami_month_abbrev_plural:"bulan",nami_year_abbrev:"tahun",nami_year_abbrev_plural:"tahun",nami_daily:"sehari-hari",nami_weekly:"mingguan",nami_biweekly:"dua kali seminggu",nami_monthly:"bulanan",nami_bimonthly:"dua bulanan",nami_quarterly:"triwulanan",nami_biannually:"dua tahunan",nami_yearly:"tahunan"},it:{nami_day_abbrev:"giorno",nami_day_abbrev_plural:"giorni",nami_week_abbrev:"settimana",nami_week_abbrev_plural:"settimane",nami_month_abbrev:"mese",nami_month_abbrev_plural:"mesi",nami_year_abbrev:"anno",nami_year_abbrev_plural:"anni",nami_daily:"quotidiano",nami_weekly:"settimanale",nami_biweekly:"bisettimanale",nami_monthly:"mensile",nami_bimonthly:"bimestrale",nami_quarterly:"trimestrale",nami_biannually:"semestralmente",nami_yearly:"annuale"},he:{nami_day_abbrev:"יְוֹם",nami_day_abbrev_plural:"ימים",nami_week_abbrev:"שבוע",nami_week_abbrev_plural:"שבועות",nami_month_abbrev:"מו",nami_month_abbrev_plural:"מוֹס",nami_year_abbrev:"שנה",nami_year_abbrev_plural:"שנים",nami_daily:"יוֹמִי",nami_weekly:"שְׁבוּעִי",nami_biweekly:"דו-שבועי",nami_monthly:"יַרחוֹן",nami_bimonthly:"דו-חודשי",nami_quarterly:"רִבעוֹן",nami_biannually:"דו-שנתי",nami_yearly:"שְׁנָתִי"},ja:{nami_day_abbrev:"日",nami_day_abbrev_plural:"日",nami_week_abbrev:"週",nami_week_abbrev_plural:"週",nami_month_abbrev:"モ",nami_month_abbrev_plural:"モス",nami_year_abbrev:"年",nami_year_abbrev_plural:"年",nami_daily:"毎日",nami_weekly:"毎週",nami_biweekly:"隔週",nami_monthly:"毎月",nami_bimonthly:"隔月",nami_quarterly:"四半期ごと",nami_biannually:"半年ごと",nami_yearly:"毎年"},ko:{nami_day_abbrev:"낮",nami_day_abbrev_plural:"날",nami_week_abbrev:"주",nami_week_abbrev_plural:"주",nami_month_abbrev:"모",nami_month_abbrev_plural:"모스",nami_year_abbrev:"년",nami_year_abbrev_plural:"년",nami_daily:"일일",nami_weekly:"주간",nami_biweekly:"격주 간행물",nami_monthly:"월간 간행물",nami_bimonthly:"격월",nami_quarterly:"계간지",nami_biannually:"반년마다",nami_yearly:"매년"},lt:{nami_day_abbrev:"diena",nami_day_abbrev_plural:"dienos",nami_week_abbrev:"savaitė",nami_week_abbrev_plural:"savaitės",nami_month_abbrev:"mėn.",nami_month_abbrev_plural:"mėn.",nami_year_abbrev:"metai",nami_year_abbrev_plural:"metų",nami_daily:"kasdien",nami_weekly:"kas savaitę",nami_biweekly:"kas dvi savaites",nami_monthly:"mėnesinis",nami_bimonthly:"kas du mėnesius",nami_quarterly:"ketvirtinis",nami_biannually:"kas du kartus per metus",nami_yearly:"kasmet"},lv:{nami_day_abbrev:"diena",nami_day_abbrev_plural:"dienas",nami_week_abbrev:"nedēļa",nami_week_abbrev_plural:"nedēļas",nami_month_abbrev:"mēn.",nami_month_abbrev_plural:"mēn.",nami_year_abbrev:"gads",nami_year_abbrev_plural:"gadi",nami_daily:"ikdienas",nami_weekly:"iknedēļas",nami_biweekly:"divreiz nedēļā",nami_monthly:"ikmēneša",nami_bimonthly:"divreiz mēnesī",nami_quarterly:"ceturksnī",nami_biannually:"divreiz gadā",nami_yearly:"katru gadu"},ms:{nami_day_abbrev:"hari",nami_day_abbrev_plural:"hari",nami_week_abbrev:"minggu",nami_week_abbrev_plural:"minggu",nami_month_abbrev:"bulan",nami_month_abbrev_plural:"bulan",nami_year_abbrev:"tahun",nami_year_abbrev_plural:"tahun",nami_daily:"setiap hari",nami_weekly:"mingguan",nami_biweekly:"dua minggu sekali",nami_monthly:"bulanan",nami_bimonthly:"dua kali sebulan",nami_quarterly:"suku tahunan",nami_biannually:"dua kali setahun",nami_yearly:"tahunan"},nl:{nami_day_abbrev:"dag",nami_day_abbrev_plural:"dagen",nami_week_abbrev:"week",nami_week_abbrev_plural:"weken",nami_month_abbrev:"maand",nami_month_abbrev_plural:"maanden",nami_year_abbrev:"jaar",nami_year_abbrev_plural:"jaren",nami_daily:"dagelijks",nami_weekly:"wekelijks",nami_biweekly:"tweewekelijks",nami_monthly:"maandelijks",nami_bimonthly:"tweemaandelijks",nami_quarterly:"kwartaal",nami_biannually:"halfjaarlijks",nami_yearly:"jaarlijks"},no:{nami_day_abbrev:"dag",nami_day_abbrev_plural:"dager",nami_week_abbrev:"uke",nami_week_abbrev_plural:"uker",nami_month_abbrev:"måned",nami_month_abbrev_plural:"måned",nami_year_abbrev:"år",nami_year_abbrev_plural:"år",nami_daily:"daglig",nami_weekly:"ukentlig",nami_biweekly:"annenhver uke",nami_monthly:"månedlig",nami_bimonthly:"annenhver måned",nami_quarterly:"kvartalsvis",nami_biannually:"to ganger i året",nami_yearly:"årlig"},pl:{nami_day_abbrev:"dzień",nami_day_abbrev_plural:"dni",nami_week_abbrev:"tydzień",nami_week_abbrev_plural:"tygodni",nami_month_abbrev:"miesiąc",nami_month_abbrev_plural:"miesiące",nami_year_abbrev:"rok",nami_year_abbrev_plural:"lat",nami_daily:"codziennie",nami_weekly:"tygodnik",nami_biweekly:"dwutygodniowy",nami_monthly:"miesięczny",nami_bimonthly:"dwumiesięczny",nami_quarterly:"kwartalny",nami_biannually:"dwa razy w roku",nami_yearly:"rocznie"},pt:{nami_day_abbrev:"dia",nami_day_abbrev_plural:"dias",nami_week_abbrev:"semana",nami_week_abbrev_plural:"semanas",nami_month_abbrev:"mês",nami_month_abbrev_plural:"meses",nami_year_abbrev:"ano",nami_year_abbrev_plural:"anos",nami_daily:"diário",nami_weekly:"semanalmente",nami_biweekly:"quinzenal",nami_monthly:"mensal",nami_bimonthly:"bimestral",nami_quarterly:"trimestral",nami_biannually:"bianualmente",nami_yearly:"anual"},ro:{nami_day_abbrev:"zi",nami_day_abbrev_plural:"zile",nami_week_abbrev:"săptămână",nami_week_abbrev_plural:"săptămâni",nami_month_abbrev:"lună",nami_month_abbrev_plural:"luni",nami_year_abbrev:"an",nami_year_abbrev_plural:"ani",nami_daily:"zilnic",nami_weekly:"săptămânal",nami_biweekly:"la două săptămâni",nami_monthly:"lunar",nami_bimonthly:"bilunar",nami_quarterly:"trimestrial",nami_biannually:"bianual",nami_yearly:"anual"},ru:{nami_day_abbrev:"день",nami_day_abbrev_plural:"дни",nami_week_abbrev:"нед",nami_week_abbrev_plural:"недели",nami_month_abbrev:"мо",nami_month_abbrev_plural:"мос",nami_year_abbrev:"год",nami_year_abbrev_plural:"лет",nami_daily:"ежедневно",nami_weekly:"еженедельный",nami_biweekly:"раз в две недели",nami_monthly:"ежемесячно",nami_bimonthly:"раз в два месяца",nami_quarterly:"ежеквартальный",nami_biannually:"раз в два года",nami_yearly:"ежегодно"},sk:{nami_day_abbrev:"deň",nami_day_abbrev_plural:"dni",nami_week_abbrev:"týždeň",nami_week_abbrev_plural:"týždne",nami_month_abbrev:"mesiac",nami_month_abbrev_plural:"mesiacov",nami_year_abbrev:"rok",nami_year_abbrev_plural:"rokov",nami_daily:"denne",nami_weekly:"týždenne",nami_biweekly:"dvojtýždenne",nami_monthly:"mesačne",nami_bimonthly:"dvojmesačne",nami_quarterly:"štvrťročne",nami_biannually:"polročne",nami_yearly:"ročne"},sl:{nami_day_abbrev:"dan",nami_day_abbrev_plural:"dni",nami_week_abbrev:"teden",nami_week_abbrev_plural:"tedni",nami_month_abbrev:"mesec",nami_month_abbrev_plural:"mesecev",nami_year_abbrev:"leto",nami_year_abbrev_plural:"let",nami_daily:"dnevno",nami_weekly:"tedensko",nami_biweekly:"dvotedensko",nami_monthly:"mesečno",nami_bimonthly:"dvomesečno",nami_quarterly:"četrtletno",nami_biannually:"polletno",nami_yearly:"letno"},sr:{nami_day_abbrev:"дан",nami_day_abbrev_plural:"дана",nami_week_abbrev:"недеља",nami_week_abbrev_plural:"недеље",nami_month_abbrev:"мо",nami_month_abbrev_plural:"мос",nami_year_abbrev:"год.",nami_year_abbrev_plural:"године",nami_daily:"свакодневно",nami_weekly:"недељно",nami_biweekly:"двонедељно",nami_monthly:"месечно",nami_bimonthly:"двомесечно",nami_quarterly:"квартално",nami_biannually:"два пута годишње",nami_yearly:"годишње"},sv:{nami_day_abbrev:"dag",nami_day_abbrev_plural:"dagar",nami_week_abbrev:"vecka",nami_week_abbrev_plural:"veckor",nami_month_abbrev:"mån",nami_month_abbrev_plural:"månader",nami_year_abbrev:"år",nami_year_abbrev_plural:"år",nami_daily:"dagligen",nami_weekly:"varje vecka",nami_biweekly:"som utkommer varannan vecka",nami_monthly:"månatlig",nami_bimonthly:"varannan månad",nami_quarterly:"kvartalsvis",nami_biannually:"vartannat år",nami_yearly:"årlig"},sw:{nami_day_abbrev:"siku",nami_day_abbrev_plural:"siku",nami_week_abbrev:"wiki",nami_week_abbrev_plural:"wiki",nami_month_abbrev:"mwezi",nami_month_abbrev_plural:"miezi",nami_year_abbrev:"mwaka",nami_year_abbrev_plural:"miaka",nami_daily:"kila siku",nami_weekly:"kila wiki",nami_biweekly:"kila wiki mbili",nami_monthly:"kila mwezi",nami_bimonthly:"kila baada ya miezi miwili",nami_quarterly:"robo mwaka",nami_biannually:"kila baada ya miaka miwili",nami_yearly:"kila mwaka"},th:{nami_day_abbrev:"วัน",nami_day_abbrev_plural:"วัน",nami_week_abbrev:"สัปดาห์",nami_week_abbrev_plural:"สัปดาห์",nami_month_abbrev:"โม",nami_month_abbrev_plural:"มอส",nami_year_abbrev:"ปี",nami_year_abbrev_plural:"ปี",nami_daily:"รายวัน",nami_weekly:"รายสัปดาห์",nami_biweekly:"สองสัปดาห์ครั้ง",nami_monthly:"รายเดือน",nami_bimonthly:"สองเดือนครั้ง",nami_quarterly:"ไตรมาส",nami_biannually:"ทุกสองปี",nami_yearly:"ทุกปี"},tr:{nami_day_abbrev:"gün",nami_day_abbrev_plural:"günler",nami_week_abbrev:"hafta",nami_week_abbrev_plural:"haftalar",nami_month_abbrev:"ay",nami_month_abbrev_plural:"aylar",nami_year_abbrev:"yıl",nami_year_abbrev_plural:"yıllar",nami_daily:"günlük",nami_weekly:"haftalık",nami_biweekly:"iki haftada bir",nami_monthly:"aylık",nami_bimonthly:"iki ayda bir",nami_quarterly:"üç aylık",nami_biannually:"iki yılda bir",nami_yearly:"yıllık"},uk:{nami_day_abbrev:"день",nami_day_abbrev_plural:"дні",nami_week_abbrev:"тиждень",nami_week_abbrev_plural:"тижні",nami_month_abbrev:"місяць",nami_month_abbrev_plural:"мос",nami_year_abbrev:"рік",nami_year_abbrev_plural:"років",nami_daily:"щоденно",nami_weekly:"щотижня",nami_biweekly:"раз на два тижні",nami_monthly:"щомісяця",nami_bimonthly:"раз на два місяці",nami_quarterly:"щоквартально",nami_biannually:"раз на півроку",nami_yearly:"щорічно"},vi:{nami_day_abbrev:"ngày",nami_day_abbrev_plural:"ngày",nami_week_abbrev:"tuần",nami_week_abbrev_plural:"tuần",nami_month_abbrev:"tháng",nami_month_abbrev_plural:"tháng",nami_year_abbrev:"năm",nami_year_abbrev_plural:"năm",nami_daily:"hằng ngày",nami_weekly:"hàng tuần",nami_biweekly:"hai tuần một lần",nami_monthly:"hàng tháng",nami_bimonthly:"hai tháng một lần",nami_quarterly:"hàng quý",nami_biannually:"hai năm một lần",nami_yearly:"hàng năm"},"zh-CN":{nami_day_abbrev:"天",nami_day_abbrev_plural:"天",nami_week_abbrev:"周",nami_week_abbrev_plural:"周",nami_month_abbrev:"莫",nami_month_abbrev_plural:"莫斯",nami_year_abbrev:"年",nami_year_abbrev_plural:"年",nami_daily:"日常的",nami_weekly:"每周",nami_biweekly:"每两周一次",nami_monthly:"月度",nami_bimonthly:"双月刊",nami_quarterly:"季刊",nami_biannually:"每半年",nami_yearly:"每年"},"zh-TW":{nami_day_abbrev:"天",nami_day_abbrev_plural:"天",nami_week_abbrev:"週",nami_week_abbrev_plural:"週",nami_month_abbrev:"莫",nami_month_abbrev_plural:"莫斯",nami_year_abbrev:"年",nami_year_abbrev_plural:"年",nami_daily:"日常的",nami_weekly:"每週",nami_biweekly:"每兩週一次",nami_monthly:"每月",nami_bimonthly:"雙月刊",nami_quarterly:"季刊",nami_biannually:"每半年",nami_yearly:"每年"},zu:{nami_day_abbrev:"usuku",nami_day_abbrev_plural:"izinsuku",nami_week_abbrev:"isonto",nami_week_abbrev_plural:"amasonto",nami_month_abbrev:"inyanga",nami_month_abbrev_plural:"i-mos",nami_year_abbrev:"unyaka",nami_year_abbrev_plural:"iminyaka",nami_daily:"nsuku zonke",nami_weekly:"masonto onke",nami_biweekly:"kabili ngesonto",nami_monthly:"nyanga zonke",nami_bimonthly:"kabili ngenyanga",nami_quarterly:"njalo ngekota",nami_biannually:"kabili ngonyaka",nami_yearly:"minyaka yonke"}},tl="en";function nl(e){var t,n,i=function(e){if(!e)return tl;var t=e.trim();if(el[t])return t;var n=t.toLowerCase(),i=n.split("-")[0];return el[i]?i:"zh"===i?n.includes("tw")||n.includes("hk")?"zh-TW":"zh-CN":tl}(Qr.getLanguageCode()),a=null!==(t=el[i])&&void 0!==t?t:el[tl];return null!==(n=null==a?void 0:a[e])&&void 0!==n?n:e}var il=e=>"subscription"===e;function al(e){if(il(null==e?void 0:e.product_type)){var t=ol(e);if(t.length>0)return t[0].billingPeriod}return null}function rl(e){var t=function(e){if(!e)return[];var t=e.offers.filter((e=>"promo"===e.offer_type));return sl(t,e.subscription_period)}(e).find((e=>0===e.priceAmountMicros));return(null==t?void 0:t.billingPeriod)||null}function ol(e){return e?sl(e.offers.filter((e=>"default"===e.offer_type)),e.subscription_period):[]}function sl(e,t){return e.map((e=>ul(e,t)))}function ul(e,t){var n,i,a,r,o,s,u,l;if(!e)return{};var d=null!==(n=null===(i=e.promo_period)||void 0===i?void 0:i.count)&&void 0!==n?n:null==t?void 0:t.count,h=null!==(a=null===(r=e.promo_period)||void 0===r?void 0:r.type)&&void 0!==a?a:null==t?void 0:t.type,c=null!==(o=null===(s=e.promo_price)||void 0===s?void 0:s.price)&&void 0!==o?o:e.price,m=null!==(u=null===(l=e.promo_price)||void 0===l?void 0:l.currency)&&void 0!==u?u:e.currency;return{priceAmountMicros:1e6*c,priceCurrencyCode:m,billingPeriod:h?`P${d}${h[0].toUpperCase()}`:"",formattedPrice:hl(m).format(c)}}function ll(e,t=!1,n=!1,i=!1,a=!1){if(!e)return null;var r=e.match(/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/);if(!r)return null;var o=r.slice(1).map((e=>parseInt(e))),s=o[0],u=o[1],l=o[2],d=o[3],h=(e,t,n,i,r)=>{var o=(e=>a?`${e}_abbrev`:e)(r),s=(e=>a?`${e}_abbrev_plural`:`${e}_plural`)(r),u=nl(o),l=nl(s);return a||u!==o||(u=nl(`${r}_abbrev`)),a||l!==s||(l=nl(`${r}_abbrev_plural`)),i?e.toString():n?1===e||t?u:l:1===e||t?`${e} ${u}`:`${e} ${l}`};switch(e.at(-1)){case"D":return h(d,t,n,i,"nami_day");case"W":return h(l,t,n,i,"nami_week");case"M":return h(u,t,n,i,"nami_month");case"Y":return h(s,t,n,i,"nami_year")}return null}function dl(e){var t;if(!e||e.length<2)return!1;var n=null===(t=e.at(-1))||void 0===t?void 0:t.toUpperCase();return"M"===n||"Y"===n}function hl(e){var t={maximumFractionDigits:2,minimumFractionDigits:0};try{return new Intl.NumberFormat(navigator.language,y({},t,{style:"currency",currency:e}))}catch(e){return new Intl.NumberFormat(navigator.language,y({},t,{style:"currency",currency:"USD"}))}}var cl=(e,t,n)=>e&&t&&n?n.format(e-t):null,ml=(e,t,n,i)=>{if(e&&t&&n&&i){var a=100*(1-e/(n/i*t));return`${Math.round(a)}%`}return null},fl=(e,t)=>{if(""!=t){var n=parseInt(t)-1;return n>=0&&n<(null==e?void 0:e.length)?e[n]:null==e?void 0:e.find((e=>e.sku_ref_id===t))}},vl=e=>gl(e.priceAmountMicros)/pl(e.billingPeriod),pl=e=>{var t=parseInt(e[1]);return e.includes("Y")&&(t*=12),t},gl=e=>e/1e6;function yl(e){return parseFloat((Math.round(e)/100).toFixed(2))}var bl=(e,t,n=[])=>({price:()=>Sl(e),name:()=>null==e?void 0:e.name,title:()=>null==e?void 0:e.name,description:()=>null==e?void 0:e.description,duration:()=>El(e),durationSingular:()=>El(e,!0),period:()=>El(e,!1,!0),periodNumber:()=>El(e,!1,!1,!0),freeTrialDuration:()=>Ml(e),freeTrialDurationSingular:()=>Ml(e,!0),freeTrialPeriod:()=>Ml(e,!1,!0),freeTrialPeriodNumber:()=>Ml(e,!1,!1,!0),pricePerMonth:()=>Pl(e),pricePerMonthRounded:()=>Pl(e,!0),periodInMonths:()=>Tl(e),durationInMonths:()=>_l(e),durationInMonthsSingular:()=>_l(e,!0),periodNumberInMonths:()=>Dl(e),percentagePriceDifferenceFromSku:()=>Al(e,t,n),priceDifferenceFromSku:()=>xl(e,t,n),promoEligible:()=>null===Cl(e)&&null!==Il(e,t),freeTrialEligible:()=>null!==Cl(e),promo:()=>{var n;return null===(n=Il(e,t))||void 0===n?void 0:n.offer_ref_id},promoCode:()=>"XXXXX",promoPrice:()=>{var n;return null===(n=Ll(e,t))||void 0===n?void 0:n.formattedPrice},promoPeriod:()=>Fl(e,t,!1,!0),promoPeriodNumber:()=>Fl(e,t,!1,!1,!0),promoDuration:()=>Fl(e,t),promoDurationSingular:()=>Fl(e,t,!0),introEligible:()=>!1,pricePerDay:()=>Rl(e),pricePerWeek:()=>Wl(e),pricePerWeekRounded:()=>Wl(e,!0),introductoryPrice:()=>Ol(e,t),introductoryPeriod:()=>Nl(e,t,!1,!0),introductoryPeriodNumber:()=>Nl(e,t,!1,!1,!0),introductoryDuration:()=>Nl(e,t),introductoryDurationSingular:()=>Nl(e,t,!0),introductoryPricePerMonth:()=>jl(e,t),introductoryPricePerMonthRounded:()=>jl(e,t,!0),durationAbbrev:()=>El(e,!1,!1,!1,!0),freeTrialDurationAbbrev:()=>Ml(e,!1,!1,!1,!0),introductoryDurationAbbrev:()=>Nl(e,t,!1,!1,!1,!0),promoDurationAbbrev:()=>Fl(e,t,!1,!1,!1,!0),promoDurationPhase2Abbrev:()=>Fl(e,t,!0,!0,!1,!0),durationInMonthsAbbrev:()=>_l(e,!1,!1,!1,!0),durationSingularAbbrev:()=>El(e,!0,!1,!1,!0),freeTrialDurationSingularAbbrev:()=>Ml(e,!0,!1,!1,!0),introductoryDurationSingularAbbrev:()=>Nl(e,t,!0,!1,!1,!0),promoDurationSingularAbbrev:()=>Fl(e,t,!0,!1,!1,!0),promoDurationSingularPhase2Abbrev:()=>Fl(e,t,!0,!0,!1,!0),durationInMonthsSingularAbbrev:()=>_l(e,!0,!1,!1,!0),periodAbbrev:()=>El(e,!1,!0,!1,!0),freeTrialPeriodAbbrev:()=>Ml(e,!1,!0,!1,!0),introductoryPeriodAbbrev:()=>Nl(e,t,!1,!0,!1,!0),promoPeriodAbbrev:()=>Fl(e,t,!1,!0,!1,!0),promoPeriodPhase2Abbrev:()=>Fl(e,t,!1,!0,!0,!0),periodInMonthsAbbrev:()=>_l(e,!1,!0,!1,!0),periodly:()=>function(e){if(!e)return null;var t=e.match(/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/);if(!t)return null;var n=t[1],i=t[2],a=t[3],r=t[4],o=void 0!==n?parseInt(n,10):0,s=void 0!==i?parseInt(i,10):0,u=void 0!==a?parseInt(a,10):0;return(void 0!==r?parseInt(r,10):0)>0?null:u>0?1===u?nl("nami_weekly"):2===u?nl("nami_biweekly"):null:s>0?nl(1===s?"nami_monthly":2===s?"nami_bimonthly":3===s?"nami_quarterly":6===s?"nami_biannually":12===s?"nami_yearly":"nami_monthly"):o>0?nl("nami_yearly"):null}(al(e)),iso_subscription_duration:()=>zl(e),invalid:()=>!1,unavailable:()=>!1}),wl=()=>Object.keys(bl({})),kl=(e,t,n,i=[])=>{if(!t)return null;var a=bl(t,n,i);return a[e]?a[e]():null},Sl=e=>{var t=ol(e);return t&&t.length?t[0].formattedPrice:null},El=(e,t,n,i,a)=>ll(al(e),t,n,i,a),Ml=(e,t,n,i,a)=>ll(rl(e),t,n,i,a),Pl=(e,t)=>{var n=ol(e);if(!n||0===n.length)return null;var i=vl(n[0]);return i?hl(n[0].priceCurrencyCode).format(t?Math.round(i):i):null},Tl=(e,t)=>{var n=ol(e);if(!n||0===n.length)return null;var i=n[0].billingPeriod;return dl(i)?ll("P1Y"===i?"P12M":i,!1,!1,!1,t):null},_l=(e,t,n,i,a)=>{var r=ol(e);if(!r||0===r.length)return null;var o=r[0].billingPeriod;return dl(o)?ll("P1Y"===o?"P12M":o,t,n,i,a):null},Dl=e=>{if(!e)return 0;var t=ol(e);return t&&t.length?pl(t[0].billingPeriod):0},Al=(e,t,n=[])=>{var i,a=ol(e);if(!a||0===a.length)return null;var r=null===(i=fl(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return ml(yl(a[0].priceAmountMicros),Dl(e));var o=ol(r);return ml(yl(a[0].priceAmountMicros),Dl(e),(null==o?void 0:o.length)>0?yl(o[0].priceAmountMicros):0,Dl(r))},xl=(e,t,n=[])=>{var i,a=ol(e);if(!a||0===a.length)return null;var r=null===(i=fl(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return cl(vl(a[0]));var o=ol(r);return cl(vl(a[0]),vl(o[0]),hl(o[0].priceCurrencyCode))},Cl=e=>rl(e),Il=(e,t)=>{if(!e)return null;var n=e.offers.filter((e=>"promo"===e.offer_type));if(!t)return n[0]||null;var i=n[parseInt(t)];return i?i||null:n.find((e=>e.offer_ref_id===t))||null},Ll=(e,t)=>e?ul(Il(e,t),e.subscription_period):null,Fl=(e,t,n,i,a,r)=>{var o=Ll(e,t);return ll((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},Rl=(e,t)=>{var n=ol(e);if(!n||0===n.length)return null;var i,a,r=gl(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=pl(i))?30.437*a:1);return r?hl(n[0].priceCurrencyCode).format(r):null},Wl=(e,t)=>{var n=ol(e);if(!n||0===n.length)return null;var i,a,r=gl(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=pl(i))?52*a/12:1);return r?hl(n[0].priceCurrencyCode).format(t?Math.round(r):r):null},Ol=(e,t)=>{var n=$l(e,t);return(null==n?void 0:n.formattedPrice)||null},Nl=(e,t,n,i,a,r)=>{var o=$l(e,t);return ll((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},jl=(e,t,n)=>{var i=$l(e,t);if(i){var a=gl(i.priceAmountMicros),r=pl(i.billingPeriod),o=n?Math.round(a/r):a/r;return hl(i.priceCurrencyCode).format(o)}},$l=(e,t)=>{return e?(t?(n=e.offers[parseInt(t)])||(n=e.offers.find((e=>e.offer_ref_id===t))||null):n=e.offers[0],ul(n,e.subscription_period)):null;var n},zl=e=>{var t=al(e);return t?"P7D"===t?"P1W":t:null};function Bl(e,t,n){var i=e.length;return n=void 0===n?i:n,!t&&n>=i?e:function(e,t,n){var i=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(n=n>a?a:n)<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var r=Array(a);++i<a;)r[i]=e[i+t];return r}(e,t,n)}var Hl=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function Ul(e){return Hl.test(e)}var Gl="\\ud800-\\udfff",Vl="["+Gl+"]",Xl="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Kl="\\ud83c[\\udffb-\\udfff]",Yl="[^"+Gl+"]",ql="(?:\\ud83c[\\udde6-\\uddff]){2}",Jl="[\\ud800-\\udbff][\\udc00-\\udfff]",Ql="(?:"+Xl+"|"+Kl+")"+"?",Zl="[\\ufe0e\\ufe0f]?",ed=Zl+Ql+("(?:\\u200d(?:"+[Yl,ql,Jl].join("|")+")"+Zl+Ql+")*"),td="(?:"+[Yl+Xl+"?",Xl,ql,Jl,Vl].join("|")+")",nd=RegExp(Kl+"(?="+Kl+")|"+td+ed,"g");function id(e){return Ul(e)?function(e){return e.match(nd)||[]}(e):function(e){return e.split("")}(e)}var ad,rd=(ad="toUpperCase",function(e){var t=Ul(e=Fr(e))?id(e):void 0,n=t?t[0]:e.charAt(0),i=t?Bl(t,1).join(""):e.slice(1);return n[ad]()+i});var od,sd=(od={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},function(e){return null==od?void 0:od[e]}),ud=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ld=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var dd=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var hd=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var cd="\\ud800-\\udfff",md="\\u2700-\\u27bf",fd="a-z\\xdf-\\xf6\\xf8-\\xff",vd="A-Z\\xc0-\\xd6\\xd8-\\xde",pd="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",gd="["+pd+"]",yd="\\d+",bd="["+md+"]",wd="["+fd+"]",kd="[^"+cd+pd+yd+md+fd+vd+"]",Sd="(?:\\ud83c[\\udde6-\\uddff]){2}",Ed="[\\ud800-\\udbff][\\udc00-\\udfff]",Md="["+vd+"]",Pd="(?:"+wd+"|"+kd+")",Td="(?:"+Md+"|"+kd+")",_d="(?:['’](?:d|ll|m|re|s|t|ve))?",Dd="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ad="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",xd="[\\ufe0e\\ufe0f]?",Cd=xd+Ad+("(?:\\u200d(?:"+["[^"+cd+"]",Sd,Ed].join("|")+")"+xd+Ad+")*"),Id="(?:"+[bd,Sd,Ed].join("|")+")"+Cd,Ld=RegExp([Md+"?"+wd+"+"+_d+"(?="+[gd,Md,"$"].join("|")+")",Td+"+"+Dd+"(?="+[gd,Md+Pd,"$"].join("|")+")",Md+"?"+Pd+"+"+_d,Md+"+"+Dd,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",yd,Id].join("|"),"g");function Fd(e,t,n){return e=Fr(e),void 0===t?function(e){return hd.test(e)}(e)?function(e){return e.match(Ld)||[]}(e):function(e){return e.match(dd)||[]}(e):e.match(t)||[]}var Rd=RegExp("['’]","g");var Wd,Od=(Wd=function(e,t,n){return t=t.toLowerCase(),e+(n?rd(Fr(t).toLowerCase()):t)},function(e){return function(e,t,n){for(var i=-1,a=null==e?0:e.length;++i<a;)n=t(n,e[i],i,e);return n}(Fd(function(e){return(e=Fr(e))&&e.replace(ud,sd).replace(ld,"")}(e).replace(Rd,"")),Wd,"")});function Nd(e,t,n,i){var a=n.flatMap((e=>e.products)).find((e=>e.id===t.selectedProducts[t.currentGroupId]));return $d(Gd(e,null==a?void 0:a.sku_ref_id),a,i)}function jd(e,t,n){var i,a,r=null!==(i=null===(a=t.find((e=>e.id===n)))||void 0===a?void 0:a.products)&&void 0!==i?i:[];return r.forEach((t=>{t.product_details=Gd(e,t.sku_ref_id||""),t.variables=$d(t.product_details,t,r)})),r}function $d(e,t,n){if(!t)return{};var i=t.variables;if(!i)return y({},t);Object.keys(i).forEach((t=>{if(zd(i[t])){var a=Hd(i[t],e,n);i[t]=function(e){if(!e||e.includes("null")||e.includes("undefined"))return"";if(/\$\{\s*(launch\.customAttributes\.|sku\.)\w+\s*}/.test(e))return"";return e}(a)}}));var a={};return wl().forEach((t=>{if(void 0===i[t]){var r=kl(t,e,void 0,n);null!==r&&(a[t]=r)}})),y({},t,a,i)}function zd(e){return"string"==typeof e&&e.includes(Rn)}function Bd(e,t,n){return t?(Object.keys(t).forEach((i=>{zd(t[i])&&(t[i]=t[Od(i)]=Hd(t[i],e,n))})),y({},t)):{}}var Hd=(e,t,n)=>e.replace(Cn,((i,a)=>{var r,o,s,u,l=(null===(r=Cn.exec(e))||void 0===r?void 0:r.slice(1))||[];a=null!==(o=l[0])&&void 0!==o?o:a;var d=null!==(s=null===(u=l[1])||void 0===u?void 0:u.replace(":",""))&&void 0!==s?s:"";return kl(a,t,d,n)}));function Ud(e,t){return t.flatMap((e=>e.products)).some((t=>1==kl("freeTrialEligible",Gd(e,t.sku_ref_id))))}function Gd(e=[],t=""){return e.find((e=>e.product_ref_id===t))||null}var Vd=function(){try{var e=Ei(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();function Xd(e,t,n){"__proto__"==t&&Vd?Vd(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Kd=Object.prototype.hasOwnProperty;function Yd(e,t,n){var i=e[t];Kd.call(e,t)&&Bn(i,n)&&(void 0!==n||t in e)||Xd(e,t,n)}function qd(e,t,n,i){var a=!n;n||(n={});for(var r=-1,o=t.length;++r<o;){var s=t[r],u=void 0;void 0===u&&(u=e[s]),a?Xd(n,s,u):Yd(n,s,u)}return n}var Jd=Object.prototype.hasOwnProperty;function Qd(e){if(!ri(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Ra(e),n=[];for(var i in e)("constructor"!=i||!t&&Jd.call(e,i))&&n.push(i);return n}function Zd(e){return ja(e)?La(e,!0):Qd(e)}var eh="object"==typeof exports&&exports&&!exports.nodeType&&exports,th=eh&&"object"==typeof module&&module&&!module.nodeType&&module,nh=th&&th.exports===eh?Kn.Buffer:void 0,ih=nh?nh.allocUnsafe:void 0;var ah=Wa(Object.getPrototypeOf,Object),rh=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)na(t,ua(e)),e=ah(e);return t}:ra;function oh(e){return aa(e,Zd,rh)}var sh=Object.prototype.hasOwnProperty;function uh(e){var t=new e.constructor(e.byteLength);return new Ni(t).set(new Ni(e)),t}var lh=/\w*$/;var dh=Yn?Yn.prototype:void 0,hh=dh?dh.valueOf:void 0;var ch="[object Boolean]",mh="[object Date]",fh="[object Map]",vh="[object Number]",ph="[object RegExp]",gh="[object Set]",yh="[object String]",bh="[object Symbol]",wh="[object ArrayBuffer]",kh="[object DataView]",Sh="[object Float32Array]",Eh="[object Float64Array]",Mh="[object Int8Array]",Ph="[object Int16Array]",Th="[object Int32Array]",_h="[object Uint8Array]",Dh="[object Uint8ClampedArray]",Ah="[object Uint16Array]",xh="[object Uint32Array]";function Ch(e,t,n){var i,a=e.constructor;switch(t){case wh:return uh(e);case ch:case mh:return new a(+e);case kh:return function(e,t){var n=t?uh(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case Sh:case Eh:case Mh:case Ph:case Th:case _h:case Dh:case Ah:case xh:return function(e,t){var n=t?uh(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case fh:return new a;case vh:case yh:return new a(e);case ph:return function(e){var t=new e.constructor(e.source,lh.exec(e));return t.lastIndex=e.lastIndex,t}(e);case gh:return new a;case bh:return i=e,hh?Object(hh.call(i)):{}}}var Ih=Object.create,Lh=function(){function e(){}return function(t){if(!ri(t))return{};if(Ih)return Ih(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var Fh=Aa&&Aa.isMap,Rh=Fh?Pa(Fh):function(e){return la(e)&&"[object Map]"==ar(e)};var Wh=Aa&&Aa.isSet,Oh=Wh?Pa(Wh):function(e){return la(e)&&"[object Set]"==ar(e)},Nh=1,jh=2,$h=4,zh="[object Arguments]",Bh="[object Function]",Hh="[object GeneratorFunction]",Uh="[object Object]",Gh={};function Vh(e,t,n,i,a,r){var o,s=t&Nh,u=t&jh,l=t&$h;if(void 0!==o)return o;if(!ri(e))return e;var d=ia(e);if(d){if(o=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&sh.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!s)return function(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}(e,o)}else{var h=ar(e),c=h==Bh||h==Hh;if(ya(e))return function(e,t){if(t)return e.slice();var n=e.length,i=ih?ih(n):new e.constructor(n);return e.copy(i),i}(e,s);if(h==Uh||h==zh||c&&!a){if(o=u||c?{}:function(e){return"function"!=typeof e.constructor||Ra(e)?{}:Lh(ah(e))}(e),!s)return u?function(e,t){return qd(e,rh(e),t)}(e,function(e,t){return e&&qd(t,Zd(t),e)}(o,e)):function(e,t){return qd(e,ua(e),t)}(e,function(e,t){return e&&qd(t,$a(t),e)}(o,e))}else{if(!Gh[h])return a?e:{};o=Ch(e,h,s)}}r||(r=new Ci);var m=r.get(e);if(m)return m;r.set(e,o),Oh(e)?e.forEach((function(i){o.add(Vh(i,t,n,i,e,r))})):Rh(e)&&e.forEach((function(i,a){o.set(a,Vh(i,t,n,a,e,r))}));var f=d?void 0:(l?u?oh:za:u?Zd:$a)(e);return function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););}(f||e,(function(i,a){f&&(i=e[a=i]),Yd(o,a,Vh(i,t,n,a,e,r))})),o}Gh[zh]=Gh["[object Array]"]=Gh["[object ArrayBuffer]"]=Gh["[object DataView]"]=Gh["[object Boolean]"]=Gh["[object Date]"]=Gh["[object Float32Array]"]=Gh["[object Float64Array]"]=Gh["[object Int8Array]"]=Gh["[object Int16Array]"]=Gh["[object Int32Array]"]=Gh["[object Map]"]=Gh["[object Number]"]=Gh[Uh]=Gh["[object RegExp]"]=Gh["[object Set]"]=Gh["[object String]"]=Gh["[object Symbol]"]=Gh["[object Uint8Array]"]=Gh["[object Uint8ClampedArray]"]=Gh["[object Uint16Array]"]=Gh["[object Uint32Array]"]=!0,Gh["[object Error]"]=Gh[Bh]=Gh["[object WeakMap]"]=!1;var Xh=(e,t,n)=>{var i=Object.getOwnPropertyDescriptor(e,t);if(!i||i.configurable)try{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n,writable:!1})}catch(i){try{e[t]=n}catch(e){}}},Kh=function(){return p((function e(){h(this,e),this.listeners=new Map}),[{key:"addEventListener",value:function(e,t,n){var i;if(t){var a=(e=>"boolean"==typeof e?{capture:e}:null!=e?e:{})(n),r=null!==(i=this.listeners.get(e))&&void 0!==i?i:[];if(!r.some((e=>e.listener===t))){var o={listener:t,once:Boolean(a.once)};if(a.signal){if(a.signal.aborted)return;o.signal=a.signal,o.abortHandler=()=>this.removeEventListener(e,t),a.signal.addEventListener("abort",o.abortHandler,{once:!0})}r.push(o),this.listeners.set(e,r)}}}},{key:"removeEventListener",value:function(e,t){if(t){var n=this.listeners.get(e);if(n&&0!==n.length){for(var i=n.length-1;i>=0;i-=1){var a=n[i];a.listener===t&&(a.signal&&a.abortHandler&&a.signal.removeEventListener("abort",a.abortHandler),n.splice(i,1))}0===n.length&&this.listeners.delete(e)}}}},{key:"dispatchEvent",value:function(e){var t,n;if(!e||"string"!=typeof e.type)throw new TypeError('Failed to execute "dispatchEvent": event type must be a string.');var i=this.listeners.get(e.type);if(!i||0===i.length)return!0;Xh(e,"target",this);var a=!1,r=null===(t=e.stopImmediatePropagation)||void 0===t?void 0:t.bind(e),o=null===(n=e.stopPropagation)||void 0===n?void 0:n.bind(e),s=()=>{a=!0,null==r||r()},u=()=>{e.cancelBubble=!0,null==o||o()};e.stopImmediatePropagation=s,e.stopPropagation=u;for(var l,d,h=g(i.slice());!(l=h()).done;){var c=l.value;if(a)break;Xh(e,"currentTarget",this),"function"==typeof c.listener?c.listener.call(this,e):"object"==typeof(d=c.listener)&&null!==d&&"handleEvent"in d&&c.listener.handleEvent.call(c.listener,e),c.once&&this.removeEventListener(e.type,c.listener)}if(r)e.stopImmediatePropagation=r;else try{delete e.stopImmediatePropagation}catch(t){e.stopImmediatePropagation=s}if(o)e.stopPropagation=o;else try{delete e.stopPropagation}catch(t){e.stopPropagation=u}return Xh(e,"currentTarget",null),!e.defaultPrevented}}])}(),Yh=[],qh={paywallId:"",livePaywalls:[],selectedPaywall:void 0,selectedCampaign:void 0,campaignRules:[],anySkuHasTrialOffer:!1,anySkuHasIntroOffer:!1,anySkuHasPromoOffer:!1,isLoggedIn:!1,darkMode:!1,safeAreaTop:0,groups:[],selectedProducts:{},formStates:{},timerStates:{},currentPage:"page1",currentGroupId:"",currentGroupName:"",fullScreenPresentation:!1,launch:{productGroups:[],customAttributes:{},customObject:{},currentGroup:""},sku:{},orientation:"portrait",focusedState:!1,platformId:"",mediaList:{},skuItems:[],customer:{},hasNotch:!1,purchaseInProgress:!1,formFactor:"desktop",slides:{},userInteractionEnabled:!0,currentSlideIndex:void 0},Jh=function(){function e(t,n,i){var a;h(this,e),(a=d(this,e)).host=null,a.subscribers=new Set,a.productDetails=Yh,a.filteredSkuMenus=[],a.state=Vh(qh,5);var r=Qr.getNamiProfile();return a.state.isLoggedIn=!(null==r||!r.externalId),a.setPaywall(t,n,i),a.defineDynamicStateProps(),a.subscribers=new Set,a}return k(e,Kh),p(e,[{key:"subscribe",value:function(e){return this.subscribers.add(e),()=>this.unsubscribe(e)}},{key:"unsubscribe",value:function(e){this.subscribers.delete(e)}},{key:"emitEvent",value:function(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t}))}},{key:"onEvent",value:function(e,t){var n=e=>t(e.detail);return this.addEventListener(e,n),()=>this.removeEventListener(e,n)}},{key:"hostConnected",value:function(){}},{key:"hostDisconnected",value:function(){this.subscribers.clear()}},{key:"defineDynamicStateProps",value:function(){Object.defineProperty(this.state,"tvQuality",{get:this.getTVQuality.bind(this),enumerable:!1,configurable:!0}),Object.defineProperty(this.state,"viewportWidth",{get:this.getViewportWidth.bind(this),enumerable:!1,configurable:!0}),Object.defineProperty(this.state,"viewportHeight",{get:this.getViewportHeight.bind(this),enumerable:!1,configurable:!0})}},{key:"setState",value:function(e){this.state=e,this.defineDynamicStateProps(),this.subscribers.forEach((e=>e())),this.host&&this.host.requestUpdate()}},{key:"setProductDetails",value:function(e){this.productDetails=e}},{key:"getProductDetails",value:function(){return this.productDetails}},{key:"setCurrentGroupData",value:function(e,t){var n=Nd(this.productDetails,this.state,this.filteredSkuMenus,jd(this.productDetails,this.filteredSkuMenus,this.state.currentGroupId));this.setState(y({},this.state,{currentGroupId:e,currentGroupName:t,sku:n}))}},{key:"setFormState",value:function(e,t){this.setState(y({},this.state,{formStates:y({},this.state.formStates,{[e]:t})}))}},{key:"setTimerState",value:function(e,t,n,i){this.setState(y({},this.state,{timerStates:y({},this.state.timerStates,{[e]:{remainingSeconds:t,savedAt:n,hasEmittedCompletion:i}})}))}},{key:"getTimerState",value:function(e){return this.state.timerStates[e]}},{key:"getCurrentGroupId",value:function(){return this.state.currentGroupId}},{key:"getCurrentGroupName",value:function(){return this.state.currentGroupName}},{key:"setCurrentFormId",value:function(e,t){var n=this.state.formStates||{},i=y({},n,{[e]:t||!n[e]});this.setState(y({},this.state,{formStates:i}))}},{key:"getCurrentFormId",value:function(e){return this.state.formStates[e]}},{key:"setSelectedProducts",value:function(e){var t=Nd(this.productDetails,this.state,this.filteredSkuMenus,jd(this.productDetails,this.filteredSkuMenus,this.state.currentGroupId));this.setState(y({},this.state,{selectedProducts:e,sku:t}))}},{key:"selectedProducts",value:function(){return this.state.selectedProducts}},{key:"setPaywall",value:function(e,t,n){var i,a,r,o,s,u=y({},this.state,{formFactor:cu(),selectedPaywall:e,selectedCampaign:n}),l=function(e,t,n=[]){var i,a,r=null!==(i=t.productGroups)&&void 0!==i&&i.length?t.productGroups:n.map((e=>e.ref));return{customAttributes:t.customAttributes,productGroups:r,customObject:y({},e.customObject,t.customObject),currentGroup:null!==(a=t.currentGroup)&&void 0!==a?a:""}}((u=y({},u,null===(i=e.template)||void 0===i?void 0:i.initialState)).launch,t,e.sku_menus);(this.filteredSkuMenus=null!==(a=e.sku_menus)&&void 0!==a?a:[],l.productGroups.length&&(this.filteredSkuMenus=this.filteredSkuMenus.filter((e=>l.productGroups.includes(e.ref)))),""!==l.currentGroup&&u.groups.length&&null!==(r=e.template)&&void 0!==r&&r.displaySingleGroup)&&(u.currentGroupId=null!==(o=null===(s=u.groups.find((e=>e.ref==l.currentGroup)))||void 0===s?void 0:s.id)&&void 0!==o?o:"");if(""===u.currentGroupId&&1===this.filteredSkuMenus.length){var d,h=u.groups.find((e=>e.ref==this.filteredSkuMenus[0].ref));u.currentGroupId=null!==(d=null==h?void 0:h.id)&&void 0!==d?d:u.currentGroupId}var c=jd(this.productDetails,this.filteredSkuMenus,u.currentGroupId);u.skuItems=c,u.launch=l,u.anySkuHasTrialOffer=Ud(this.productDetails,this.filteredSkuMenus),u.anySkuHasPromoOffer=function(e,t){return!Ud(e,t)&&t.flatMap((e=>e.products)).some((t=>1==kl("promoEligible",Gd(e,t.sku_ref_id))))}(this.productDetails,this.filteredSkuMenus),u.paywallId=e.id,u.sku=Nd(this.productDetails,u,this.filteredSkuMenus,c),this.setState(u)}},{key:"getSelectedPaywall",value:function(){return this.state.selectedPaywall}},{key:"getSelectedCampaign",value:function(){return this.state.selectedCampaign}},{key:"getCurrentPlacementLabel",value:function(){var e,t;return null!==(e=this.state.selectedCampaign)&&void 0!==e&&e.value?this.state.selectedCampaign.value:null!==(t=this.flow)&&void 0!==t&&null!==(t=t.campaign)&&void 0!==t&&t.value?this.flow.campaign.value:void 0}},{key:"getPaywallActionEventData",value:function(){var e,t,n,i,a,r,o,s,u,l=this.state.selectedCampaign,d=this.state.selectedPaywall;return{paywallId:null!==(e=null==d?void 0:d.id)&&void 0!==e?e:"",paywallName:null!==(t=null==d?void 0:d.name)&&void 0!==t?t:"",campaignId:null!==(n=null==l?void 0:l.rule)&&void 0!==n?n:"",campaignName:null!==(i=null==l?void 0:l.name)&&void 0!==i?i:"",campaignType:null!==(a=null==l?void 0:l.type)&&void 0!==a?a:"",campaignLabel:null!==(r=null==l?void 0:l.value)&&void 0!==r?r:"",campaignUrl:(null==l?void 0:l.type)===$s.URL&&null!==(o=null==l?void 0:l.value)&&void 0!==o?o:"",segmentId:null!==(s=null==l?void 0:l.segment)&&void 0!==s?s:"",externalSegmentId:null!==(u=null==l?void 0:l.external_segment)&&void 0!==u?u:""}}},{key:"paywallId",value:function(){return this.state.paywallId}},{key:"setCurrentPage",value:function(e){this.setState(y({},this.state,{currentPage:e}))}},{key:"setCustomerAttribute",value:function(e){this.setState(y({},this.state,{customer:y({},this.state.customer,e)}))}},{key:"removeCustomerAttribute",value:function(e){delete this.state.customer[e],this.setState(this.state)}},{key:"setIsLoggedIn",value:function(e){this.setState(y({},this.state,{isLoggedIn:e}))}},{key:"setMediaList",value:function(e){this.setState(y({},this.state,{mediaList:e.reduce(((e,t)=>y({},e,{[t.name]:t})))}))}},{key:"setSafeAreaTop",value:function(e){this.setState(y({},this.state,{safeAreaTop:e}))}},{key:"setFullScreenPresentation",value:function(e){this.setState(y({},this.state,{fullScreenPresentation:e}))}},{key:"setFormFactor",value:function(e){this.setState(y({},this.state,{formFactor:e}))}},{key:"getFormFactor",value:function(){return this.state.formFactor}},{key:"getTVQuality",value:function(){var e,t;if("television"!==this.getFormFactor())return"";var n=window.devicePixelRatio||1,i=window.innerWidth||(null===(e=window.screen)||void 0===e?void 0:e.availWidth),a=window.innerHeight||(null===(t=window.screen)||void 0===t?void 0:t.availHeight);if(!i||!a)return"720p";var r=Math.max(i,a)*n,o=Math.min(i,a)*n;return r>=3840||o>=2160?"4K":r>=1920||o>=1080?"1080p":"720p"}},{key:"getViewportWidth",value:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}},{key:"getViewportHeight",value:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}},{key:"setPurchaseInProgress",value:function(e){this.setState(y({},this.state,{purchaseInProgress:e}))}},{key:"setPurchase",value:function(e,t){this.setState(y({},this.state,{purchaseInProgress:e,productBeingPurchased:t}))}},{key:"setTimeSpentOnPaywall",value:function(e){this.setState(y({},this.state,{timeSpentOnPaywall:e}))}},{key:"setAppSuppliedVideoDetails",value:function({url:e,name:t}){this.setState(y({},this.state,{appSuppliedVideoUrl:e,appSuppliedVideoName:t}))}},{key:"resetAppSuppliedVideoDetails",value:function(){delete this.state.appSuppliedVideoUrl,delete this.state.appSuppliedVideoName,this.setState(this.state)}},{key:"setLaunchDetails",value:function(e,t){this.setState(y({},this.state,{launchValue:e,launchType:t}))}},{key:"setOpenHeaderIds",value:function(e,t){e=null!=t&&t.skuId?`${e}_${t.skuId}`:e;var n=[...this.state.openHeaderIds],i=n.indexOf(e);-1!==i?n.splice(i,1):n.push(e),this.setState(y({},this.state,{openHeaderIds:n,currentCollapsibleSku:null!=t?t:null}))}},{key:"getCurrentCollapsibleSku",value:function(){return this.state.currentCollapsibleSku}},{key:"setFlow",value:function(e){this.flow=e}},{key:"setUserInteractionEnabled",value:function(e){this.setState(y({},this.state,{userInteractionEnabled:e})),this.emitEvent("user-interaction-changed",{enabled:e})}},{key:"setUserTags",value:function(e){this.setState(y({},this.state,{userTags:y({},this.state.userTags,e)}))}},{key:"setCurrentSlideIndex",value:function(e){this.state.currentSlideIndex=e}}],[{key:"create",value:function(t,n,i){var a=new e(t,n,i);return this.providers.push(a),a}},{key:"remove",value:function(e){this.providers=this.providers.filter((t=>t!==e))}},{key:"currentProvider",get:function(){return e.providers[0]}},{key:"setCustomerAttribute",value:function(e){this.providers.forEach((t=>{t.setCustomerAttribute(e)}))}},{key:"removeCustomerAttribute",value:function(e){this.providers.forEach((t=>{t.removeCustomerAttribute(e)}))}},{key:"setAppSuppliedVideoDetails",value:function(e){this.providers.forEach((t=>{t.setAppSuppliedVideoDetails(e)}))}},{key:"getSelectedPaywall",value:function(){var e;return null===(e=this.providers[0])||void 0===e?void 0:e.getSelectedPaywall()}},{key:"setUserInteractionEnabled",value:function(e){this.providers.forEach((t=>{t.setUserInteractionEnabled(e)}))}},{key:"setUserTags",value:function(e){this.providers.forEach((t=>{t.setUserTags(e)}))}},{key:"setProductDetails",value:function(e){this.providers.forEach((t=>{t.setProductDetails(e)})),Yh=e}},{key:"setPurchaseInProgress",value:function(e){this.providers.forEach((t=>{t.setPurchaseInProgress(e)}))}},{key:"setIsLoggedIn",value:function(e){this.providers.forEach((t=>{t.setIsLoggedIn(e)}))}},{key:"setPurchase",value:function(e,t){this.providers.forEach((n=>{n.setPurchase(e,t)}))}},{key:"getSelectedSlideIndex",value:function(){var e;return null===(e=this.providers[0])||void 0===e?void 0:e.state.currentSlideIndex}}])}();Jh.providers=[];var Qh=p((function e(){h(this,e),this.refIdToPurchasedSKUs={},this.refIdToRelatedSKUs={},this.refIdToActivePurchases={}}));Qh.instance=new Qh;var Zh=()=>qr(zn([...Qr.getNamiEntitlements(tt),...Qr.getNamiEntitlements(ht)]),"referenceId"),ec=()=>{Hu.getInstance().emit(_n,Zh())};function tc(e){return{id:e.id,skuId:e.sku_ref_id,name:e.name,type:e.sku_type||"unknown",entitlements:e.entitlements,productDetails:"product_details"in e?e.product_details:null}}var nc=function(){return p((function e(){h(this,e)}),[{key:"fetchActiveEntitlements",value:function(){var e,t,n;return T((function(i){for(;;)switch(i.n){case 0:if(e=null,Ju()||Rs(me.THIRD_PARTY_TRANSACTIONS)||!Rs(me.ENTITLEMENT_MANAGEMENT)){i.n=3;break}if(null==(t=Qr.getDevice())||!t.id){i.n=2;break}return i.n=1,l(this.getAPIEntitlements(t.id));case 1:n=i.v,(e=null==n?void 0:n.results)&&(Qr.setActiveEntitlements(Ze,e),this.invokeActiveEntitlementsHandler(e));case 2:i.n=4;break;case 3:Ju()&&$n.debug("Skipping active entitlements update - anonymous mode"),Rs(me.THIRD_PARTY_TRANSACTIONS)&&$n.debug("Skipping active entitlements update - paywalls-only mode"),Rs(me.ENTITLEMENT_MANAGEMENT)||$n.debug("Skipping active entitlements update - no entitlement_management capability");case 4:return i.a(2,e)}}),null,this,null,Promise)}},{key:"getAPIEntitlements",value:function(e){var t,n,i;return T((function(a){for(;;)switch(a.p=a.n){case 0:return t=`device/${e}/active_entitlements/`,n={},a.p=1,a.n=2,l(zs.instance.fetchAPI(t));case 2:n=a.v,a.n=4;break;case 3:throw a.p=3,i=a.v,$n.error(go(i.status,t)),i;case 4:return a.a(2,n)}}),null,null,[[1,3]],Promise)}},{key:"invokeActiveEntitlementsHandler",value:function(e){Ws()&&(e=>{Qr.setNamiEntitlements(tt,e);var t=Qr.getNamiEntitlements(ht),n=new Set(e.map((e=>e.referenceId))),i=t.filter((e=>{var t=n.has(e.referenceId);return t&&$n.debug(`Server granted verified entitlement for ${e.referenceId}, so replacing provisional entitlement grant.`),!t}));i.length!==t.length&&Qr.setNamiEntitlements(ht,i),ec()})(e.map((e=>(e=>{var t=e.entitlement_ref_id;return{name:e.name||"",desc:e.description||"",namiId:"",referenceId:t,relatedSkus:Qh.instance.refIdToRelatedSKUs[t]||[],activePurchases:Qh.instance.refIdToActivePurchases[t]||[],purchasedSkus:Qh.instance.refIdToPurchasedSKUs[t]||[],expires:e.expires?new Date(e.expires).valueOf():0}})(e))))}}])}();nc.instance=new nc;var ic=function(){return p((function e(){h(this,e)}),[{key:"fetchCustomerJourneyState",value:function(){var e,t,n,i;return T((function(a){for(;;)switch(a.p=a.n){case 0:if(!Ju()){a.n=1;break}return $n.debug("Skipping customer journey state update - anonymous mode"),a.a(2,null);case 1:if(null!=(e=Qr.getDevice())&&e.id){a.n=2;break}return a.a(2,null);case 2:return t=`device/${e.id}/profile/`,n=null,a.p=3,a.n=4,l(zs.instance.fetchAPI(t,void 0,0));case 4:n=a.v,a.n=6;break;case 5:throw a.p=5,i=a.v,$n.error(go(i.status,t)),i;case 6:if(!n){a.n=7;break}return Qr.setCustomerJourneyState(n.customer_journey_state),a.a(2,n.customer_journey_state);case 7:return a.a(2,null)}}),null,null,[[3,5]],Promise)}}])}();ic.instance=new ic;var ac=function(){return p((function e(){h(this,e),this.inMemoryAnonymousMode=!1,qu=this}),[{key:"setInMemoryAnonymousMode",value:function(e){this.inMemoryAnonymousMode=e,$n.info(`In-memory anonymous mode ${e?"enabled":"disabled"} due to failed device registration`)}},{key:"isInMemoryAnonymousMode",value:function(){return this.inMemoryAnonymousMode}},{key:"isAnonymousMode",value:function(){return Qr.getAnonymousMode()||this.inMemoryAnonymousMode}},{key:"init",value:function(e){return T((function(t){for(;;)switch(t.n){case 0:return this.setInitialValues(e),Yu.instance.fetchConfig(),t.n=1,l(this.initAndFetchRequiredData(e));case 1:Qu.instance.startSession();case 2:return t.a(2)}}),null,this,null,Promise)}},{key:"setInitialValues",value:function(e){var t=y({},e);delete t.initialConfig,Qr.clearSessionId(),Qr.setNamiConfig(t),Qr.setLanguageCode(e.namiLanguageCode),Qr.setPurchaseChannel(e.purchaseChannel);var n=e.initialConfig;if(n.appConfig||n.platform_config){var i=(null==n?void 0:n.appConfig)||(null==n?void 0:n.platform_config);i&&Qr.setAppConfig(it,i)}null!=n&&n.paywalls&&Qr.setPaywalls(st,n.paywalls),null!=n&&n.products&&Qr.setProducts(lt,n.products)}},{key:"initAnonymousDevice",value:function(){return{deviceId:Vu.instance.getOrCreateAnonymousUUID(),deviceTask:null}}},{key:"initIdentifiedDevice",value:function(e){var t=y({},hu(e.namiCommands),e.formFactor?{form_factor:e.formFactor}:{}),n=function(e){if(e){var t=e.find((e=>e.startsWith("splitPosition=")));if(t){var n=t.split("=")[1],i=Number(n);return n&&!isNaN(i)?yu(i):void 0}}}(e.namiCommands),i=Vu.instance.createOrUpdateDevice(t,n,this);return{deviceId:i.id,deviceTask:i.device}}},{key:"initAndFetchRequiredData",value:function(e,t=0,n=1){var i,a,r,o,s,u,d,h,c,m,f;return T((function(v){for(;;)switch(v.n){case 0:if(o=e.initialConfig,s=null!==(i=e.formFactor)&&void 0!==i?i:cu(),u=this.isAnonymousMode(),d=u?this.initAnonymousDevice():this.initIdentifiedDevice(e),h=d.deviceId,c=d.deviceTask,m=pu(h),o.campaign_rules&&Qr.setCampaignRules(rt,Eu(o.campaign_rules,m,s)),!c){v.n=1;break}return v.n=1,l(c);case 1:if(Uu.instance.configure(s,m,e.namiCommands),f=Promise.all([Xu.instance.fetchProducts(),ic.instance.fetchCustomerJourneyState(),nc.instance.fetchActiveEntitlements(),Ku.instance.fetchPaywalls().then((e=>Uu.instance.fetchCampaignRules(e)))]).catch((i=>{var a;return T((function(r){for(;;)switch(r.n){case 0:if(!(i instanceof to)){r.n=3;break}if(Qr.resetDevice(),!(t<n)){r.n=2;break}return a=100*Math.pow(2,t),r.n=1,l(new Promise((e=>setTimeout(e,a))));case 1:return r.a(2,this.initAndFetchRequiredData(e,t+1,n));case 2:if(u){r.n=3;break}return $n.warn(`Max retries reached for ConflictError. ${i.message}`),this.setInMemoryAnonymousMode(!0),r.a(2,this.initAndFetchRequiredData(e,0,n));case 3:throw i;case 4:return r.a(2)}}),null,this,null,Promise)})),null!==(a=o.campaign_rules)&&void 0!==a&&a.length&&null!==(r=o.paywalls)&&void 0!==r&&r.length){v.n=2;break}return v.n=2,l(f);case 2:f.then((()=>this.reRenderPaywall()));case 3:return v.a(2)}}),null,this,null,Promise)}},{key:"reRenderPaywall",value:function(){if("undefined"!=typeof document){var e=document.querySelector("nami-paywall");null==e||e.setPaywallData()}}}])}();function rc(e){return Array.isArray(e)?e.map(rc):e&&"object"==typeof e?Object.entries(e).reduce(((e,[t,n])=>(void 0!==n&&(e[t]=rc(n)),e)),{}):e}ac.instance=new ac;var oc,sc=!0,uc=!1;function lc(){var e;if("function"==typeof(null===(e=window.VIZIO)||void 0===e||null===(e=e.Chromevox)||void 0===e?void 0:e.isEnabled))try{var t;sc=null===(t=window.VIZIO)||void 0===t||null===(t=t.Chromevox)||void 0===t?void 0:t.isEnabled()}catch(e){}}function dc(){var e;return"undefined"!=typeof window&&void 0!==window.VIZIO&&"function"==typeof(null===(e=window.VIZIO)||void 0===e||null===(e=e.Chromevox)||void 0===e?void 0:e.play)}function hc(e){e.isTrusted&&lc()}function cc(e){e.isTrusted&&(sc=!1)}function mc(e){if(e&&dc()&&sc)try{var t;null===(t=window.VIZIO)||void 0===t||null===(t=t.Chromevox)||void 0===t||t.play(e)}catch(e){}}var fc=function(){function e(){h(this,e),oc.set(this,!1)}return p(e,[{key:"isInitialized",get:function(){return he(this,oc,"f")||null!=Qr.getNamiConfig()}},{key:"initializeSDK",value:function(e){var t,n,i,a,r,o,s;return T((function(u){for(;;)switch(u.n){case 0:if(t=!1,n=!1,i=he(this,oc,"f")?Qr.getNamiConfig():null,$n.setLogger(e.logLevel),null===i){u.n=3;break}if(delete(a=y({},e)).initialConfig,d=i,!Gu(rc(a),rc(d))){u.n=1;break}return $n.warn("Nami SDK is already configured, ignoring this configure call."),u.a(2,{sdkInitialized:!0,configureState:kn});case 1:n=!0;case 2:r=Fs(e.namiCommands),o=Fs(i.namiCommands),e.appPlatformID==i.appPlatformID&&r==o||(t=!0),e.namiLanguageCode===i.namiLanguageCode&&e.logLevel==i.logLevel||(n=!0);case 3:return t&&($n.info("SDK full reconfigure called"),Qr.resetDevice()),ce(this,oc,!0,"f"),zs.configure(e),u.n=4,l(ac.instance.init(e));case 4:return $n.info("SDK successfully initialized!"),s=n||t?bn:gn,!uc&&dc()&&(window.addEventListener("VIZIO_TTS_ENABLED",hc),window.addEventListener("VIZIO_TTS_DISABLED",cc),uc=!0,lc()),u.a(2,{sdkInitialized:!0,configureState:s})}var d}),null,this,null,Promise)}}],[{key:"sdkVersion",value:function(){return ge}},{key:"configure",value:function(t){return T((function(n){for(;;)switch(n.n){case 0:if(t.appPlatformID){n.n=1;break}throw new io;case 1:return this.setInitialConfig(t),n.n=2,l(e.instance.initializeSDK(t));case 2:return n.a(2,n.v)}}),null,this,null,Promise)}},{key:"setInitialConfig",value:function(e){if(null!=e.initialConfig){if("string"==typeof e.initialConfig){$n.warn("[DEPRECATED] NamiConfiguration.initialConfig should be an object");var t=function(e){var t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return JSON.parse(t)}catch(e){return}}(e.initialConfig);if(!t)return $n.error("Failed to parse NamiConfiguration.initialConfig"),void(e.initialConfig={});e.initialConfig=t}if("object"!=typeof e.initialConfig)e.initialConfig={};else if((e=>"object"==typeof e&&"initial_config"in e)(e.initialConfig)){var n=Os(e.initialConfig.initial_config);n?e.initialConfig=n:(e.initialConfig={},$n.error("Failed to parse NamiConfiguration.initialConfig as base64-gzipped JSON"))}}else e.initialConfig={}}}])}();oc=new WeakMap,fc.instance=new fc;var vc,pc,gc,yc=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)},bc=globalThis,wc=bc.ShadowRoot&&(void 0===bc.ShadyCSS||bc.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,kc=Symbol(),Sc=new WeakMap,Ec=function(){return p((function e(t,n,i){if(h(this,e),this._$cssResult$=!0,i!==kc)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}),[{key:"styleSheet",get:function(){var e=this.o,t=this.t;if(wc&&void 0===e){var n=void 0!==t&&1===t.length;n&&(e=Sc.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Sc.set(t,e))}return e}},{key:"toString",value:function(){return this.cssText}}])}(),Mc=(e,t)=>{if(wc)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(var n,i=g(t);!(n=i()).done;){var a=n.value,r=document.createElement("style"),o=bc.litNonce;void 0!==o&&r.setAttribute("nonce",o),r.textContent=a.cssText,e.appendChild(r)}},Pc=wc?e=>e:e=>e instanceof CSSStyleSheet?(e=>{for(var t,n="",i=g(e.cssRules);!(t=i()).done;){n+=t.value.cssText}return(e=>new Ec("string"==typeof e?e:e+"",void 0,kc))(n)})(e):e,Tc=Object.is,_c=Object.defineProperty,Dc=Object.getOwnPropertyDescriptor,Ac=Object.getOwnPropertyNames,xc=Object.getOwnPropertySymbols,Cc=Object.getPrototypeOf,Ic=globalThis,Lc=Ic.trustedTypes,Fc=Lc?Lc.emptyScript:"",Rc=Ic.reactiveElementPolyfillSupport,Wc=(e,t)=>e,Oc={toAttribute(e,t){switch(t){case Boolean:e=e?Fc:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){var n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},Nc=(e,t)=>!Tc(e,t),jc={attribute:!0,type:String,converter:Oc,reflect:!1,useDefault:!1,hasChanged:Nc};null!==(vc=Symbol.metadata)&&void 0!==vc||(Symbol.metadata=Symbol("metadata")),null!==(pc=Ic.litPropertyMetadata)&&void 0!==pc||(Ic.litPropertyMetadata=new WeakMap);var $c=function(){function e(){var t;return h(this,e),(t=d(this,e))._$Ep=void 0,t.isUpdatePending=!1,t.hasUpdated=!1,t._$Em=null,t._$Ev(),t}return k(e,I(HTMLElement)),p(e,[{key:"_$Ev",value:function(){var e;this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),null===(e=this.constructor.l)||void 0===e||e.forEach((e=>e(this)))}},{key:"addController",value:function(e){var t,n;(null!==(t=this._$EO)&&void 0!==t?t:this._$EO=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&(null===(n=e.hostConnected)||void 0===n||n.call(e))}},{key:"removeController",value:function(e){var t;null===(t=this._$EO)||void 0===t||t.delete(e)}},{key:"_$E_",value:function(){for(var e,t=new Map,n=g(this.constructor.elementProperties.keys());!(e=n()).done;){var i=e.value;this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i])}t.size>0&&(this._$Ep=t)}},{key:"createRenderRoot",value:function(){var e,t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return Mc(t,this.constructor.elementStyles),t}},{key:"connectedCallback",value:function(){var e,t;null!==(e=this.renderRoot)&&void 0!==e||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$EO)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}},{key:"enableUpdating",value:function(e){}},{key:"disconnectedCallback",value:function(){var e;null===(e=this._$EO)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}},{key:"attributeChangedCallback",value:function(e,t,n){this._$AK(e,n)}},{key:"_$ET",value:function(e,t){var n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(void 0!==i&&!0===n.reflect){var a,r=(void 0!==(null===(a=n.converter)||void 0===a?void 0:a.toAttribute)?n.converter:Oc).toAttribute(t,n.type);this._$Em=e,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}},{key:"_$AK",value:function(e,t){var n=this.constructor,i=n._$Eh.get(e);if(void 0!==i&&this._$Em!==i){var a,r,o,s=n.getPropertyOptions(i),u="function"==typeof s.converter?{fromAttribute:s.converter}:void 0!==(null===(a=s.converter)||void 0===a?void 0:a.fromAttribute)?s.converter:Oc;this._$Em=i;var l=u.fromAttribute(t,s.type);this[i]=null!==(r=null!=l?l:null===(o=this._$Ej)||void 0===o?void 0:o.get(i))&&void 0!==r?r:l,this._$Em=null}}},{key:"requestUpdate",value:function(e,t,n){if(void 0!==e){var i,a,r=this.constructor,o=this[e];if(null!=n||(n=r.getPropertyOptions(e)),!((null!==(i=n.hasChanged)&&void 0!==i?i:Nc)(o,t)||n.useDefault&&n.reflect&&o===(null===(a=this._$Ej)||void 0===a?void 0:a.get(e))&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}},{key:"C",value:function(e,t,{useDefault:n,reflect:i,wrapped:a},r){var o,s,u;n&&!(null!==(o=this._$Ej)&&void 0!==o?o:this._$Ej=new Map).has(e)&&(this._$Ej.set(e,null!==(s=null!=r?r:t)&&void 0!==s?s:this[e]),!0!==a||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===i&&this._$Em!==e&&(null!==(u=this._$Eq)&&void 0!==u?u:this._$Eq=new Set).add(e))}},{key:"_$EP",value:function(){var e,t;return T((function(n){for(;;)switch(n.p=n.n){case 0:return this.isUpdatePending=!0,n.p=1,n.n=2,l(this._$ES);case 2:n.n=4;break;case 3:n.p=3,t=n.v,Promise.reject(t);case 4:if(e=this.scheduleUpdate(),!(null!=e)){n.n=5;break}return n.n=5,l(e);case 5:return n.a(2,!this.isUpdatePending)}}),null,this,[[1,3]],Promise)}},{key:"scheduleUpdate",value:function(){return this.performUpdate()}},{key:"performUpdate",value:function(){if(this.isUpdatePending){if(!this.hasUpdated){var e;if(null!==(e=this.renderRoot)&&void 0!==e||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(var t,n=g(this._$Ep);!(t=n()).done;){var i=t.value,a=i[0],r=i[1];this[a]=r}this._$Ep=void 0}var o=this.constructor.elementProperties;if(o.size>0)for(var s,u=g(o);!(s=u()).done;){var l=s.value,d=l[0],h=l[1],c=h.wrapped,m=this[d];!0!==c||this._$AL.has(d)||void 0===m||this.C(d,void 0,h,m)}}var f=!1,v=this._$AL;try{var p;(f=this.shouldUpdate(v))?(this.willUpdate(v),null!==(p=this._$EO)&&void 0!==p&&p.forEach((e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(v)):this._$EM()}catch(v){throw f=!1,this._$EM(),v}f&&this._$AE(v)}}},{key:"willUpdate",value:function(e){}},{key:"_$AE",value:function(e){var t;null!==(t=this._$EO)&&void 0!==t&&t.forEach((e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}},{key:"_$EM",value:function(){this._$AL=new Map,this.isUpdatePending=!1}},{key:"updateComplete",get:function(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function(){return this._$ES}},{key:"shouldUpdate",value:function(e){return!0}},{key:"update",value:function(e){this._$Eq&&(this._$Eq=this._$Eq.forEach((e=>this._$ET(e,this[e])))),this._$EM()}},{key:"updated",value:function(e){}},{key:"firstUpdated",value:function(e){}}],[{key:"addInitializer",value:function(e){var t;this._$Ei(),(null!==(t=this.l)&&void 0!==t?t:this.l=[]).push(e)}},{key:"observedAttributes",get:function(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}},{key:"createProperty",value:function(e,t=jc){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){var n=Symbol(),i=this.getPropertyDescriptor(e,n,t);void 0!==i&&_c(this.prototype,e,i)}}},{key:"getPropertyDescriptor",value:function(e,t,n){var i,a=null!==(i=Dc(this.prototype,e))&&void 0!==i?i:{get(){return this[t]},set(e){this[t]=e}},r=a.get,o=a.set;return{get:r,set(t){var i=null==r?void 0:r.call(this);null!=o&&o.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(e){var t;return null!==(t=this.elementProperties.get(e))&&void 0!==t?t:jc}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty(Wc("elementProperties"))){var e=Cc(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty(Wc("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Wc("properties")))for(var e=this.properties,t=0,n=[...Ac(e),...xc(e)];t<n.length;t++){var i=n[t];this.createProperty(i,e[i])}var a=this[Symbol.metadata];if(null!==a){var r=litPropertyMetadata.get(a);if(void 0!==r)for(var o,s=g(r);!(o=s()).done;){var u=o.value,l=u[0],d=u[1];this.elementProperties.set(l,d)}}this._$Eh=new Map;for(var h,c=g(this.elementProperties);!(h=c()).done;){var m=h.value,f=m[0],v=m[1],p=this._$Eu(f,v);void 0!==p&&this._$Eh.set(p,f)}this.elementStyles=this.finalizeStyles(this.styles)}}},{key:"finalizeStyles",value:function(e){var t=[];if(Array.isArray(e))for(var n,i=g(new Set(e.flat(1/0).reverse()));!(n=i()).done;){var a=n.value;t.unshift(Pc(a))}else void 0!==e&&t.push(Pc(e));return t}},{key:"_$Eu",value:function(e,t){var n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}}])}();$c.elementStyles=[],$c.shadowRootOptions={mode:"open"},$c[Wc("elementProperties")]=new Map,$c[Wc("finalized")]=new Map,null!=Rc&&Rc({ReactiveElement:$c}),(null!==(gc=Ic.reactiveElementVersions)&&void 0!==gc?gc:Ic.reactiveElementVersions=[]).push("2.1.1");var zc={attribute:!0,type:String,converter:Oc,reflect:!1,hasChanged:Nc},Bc=(e=zc,t,n)=>{var i=n.kind,a=n.metadata,r=globalThis.litPropertyMetadata.get(a);if(void 0===r&&globalThis.litPropertyMetadata.set(a,r=new Map),"setter"===i&&((e=Object.create(e)).wrapped=!0),r.set(n.name,e),"accessor"===i){var o=n.name;return{set(n){var i=t.get.call(this);t.set.call(this,n),this.requestUpdate(o,i,e)},init(t){return void 0!==t&&this.C(o,void 0,e,t),t}}}if("setter"===i){var s=n.name;return function(n){var i=this[s];t.call(this,n),this.requestUpdate(s,i,e)}}throw Error("Unsupported decorator location: "+i)};function Hc(e){return(t,n)=>"object"==typeof n?Bc(e,t,n):((e,t,n)=>{var i=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),i?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function Uc(e){return Hc(y({},e,{state:!0,attribute:!1}))}function Gc(e){return!e||"object"==typeof e&&0==Object.keys(e).length}var Vc,Xc="entry",Kc="screen",Yc="branch",qc="exit",Jc="unknown";!function(e){e.NAVIGATE="flowNav",e.BACK="flowPrev",e.NEXT="flowNext",e.FINISHED="flowDone",e.DISMISS="flowDismiss",e.EXIT="flowExit",e.HANDOFF="flowHandoff",e.TRACK="trackEvent",e.LOG="logEvent",e.SET_VIDEO="setVideo",e.FLOW_EVENT="flowEvent",e.BLOCK_BACK="blockBackToStep",e.FLOW_ENABLED="flowInteractionEnabled",e.FLOW_DISABLED="flowInteractionDisabled",e.SET_TAGS="setTags",e.PAUSE="flowPause",e.RESUME="flowResume"}(Vc||(Vc={}));var Qc="__handoff_sequence__",Zc="__buy_sku__",em="__default__",tm="__appear__",nm="__disappear__",im="__login_success__",am="__login_failure__",rm="__logout_success__",om="__logout_failure__",sm="__purchase_success__",um="__remoteback__",lm="__tag_update__",dm="and",hm="or",cm="i_contains",mm="equals",fm="i_equals",vm="not_equals",pm="not_i_equals",gm="not_contains",ym="set",bm="notSet",wm=function(){function e(){h(this,e),this.resolvers=new Map,this.namespaceResolvers=new Map}return p(e,[{key:"registerNamespaceResolver",value:function(e,t){this.namespaceResolvers.set(e,t)}},{key:"resetResolvers",value:function(){this.resolvers.clear()}},{key:"evaluate",value:function(e){var t,n=null!==(t=e.filter)&&void 0!==t?t:[];if(0===n.length)return!0;var i=n.map((e=>this.evaluateFilter(e)));switch(e.operator){case dm:return i.every((e=>e));case hm:return i.some((e=>e));default:return i.every((e=>e))}}},{key:"evaluateOrdered",value:function(e){var t;if(!e)return!0;var n=null!==(t=e.filter)&&void 0!==t?t:[];if(0===n.length)return!0;switch(e.operator){case dm:for(var i,a=g(n);!(i=a()).done;){var r=i.value;if(!this.evaluateFilter(r))return!1}return!0;case hm:for(var o,s=g(n);!(o=s()).done;){var u=o.value;if(this.evaluateFilter(u))return!0}return!1;default:for(var l,d=g(n);!(l=d()).done;){var h=l.value;if(!this.evaluateFilter(h))return!1}return!0}}},{key:"evaluateFilter",value:function(e){var t=this.resolve(e.identifier);if(e.operator===ym)return null!=t;if(e.operator===bm)return null==t;if(null==t)return!![vm,pm,gm].includes(e.operator);switch(e.operator){case cm:return Array.isArray(t)?e.values.some((e=>t.some((t=>0===t.localeCompare(e,void 0,{sensitivity:"accent"}))))):(this.log("Resolved value is not an array of strings for i_contains."),!1);case mm:return e.values.some((e=>{if("string"==typeof t)return t===e;if("boolean"==typeof t){var n="true"===e.toLowerCase();return t===n}return this.log("Unsupported type for equals comparison: "+typeof t),!1}));case fm:return e.values.some((e=>{if("string"==typeof t)return 0===t.localeCompare(e,void 0,{sensitivity:"accent"});if("boolean"==typeof t){var n="true"===e.toLowerCase();return t===n}return this.log("Unsupported type for i_equals comparison: "+typeof t),!1}));case vm:return e.values.every((e=>"string"!=typeof t||t!==e));case pm:return e.values.every((e=>"string"!=typeof t||0!==t.localeCompare(e,void 0,{sensitivity:"accent"})));case gm:return e.values.every((e=>"string"!=typeof t||!t.includes(e)));default:return this.log(`Unsupported operator: ${e.operator}`),!1}}},{key:"resolve",value:function(e){var t=this.resolveRaw(e);if(void 0!==t)return t;var n=e.lastIndexOf(".");if(-1!==n){var i=e.slice(0,n),a=e.slice(n+1),r=this.resolveRaw(i);return void 0!==r?this.extractProperty(a,r):void this.log(`Could not resolve base identifier: ${i}`)}}},{key:"resolveRaw",value:function(e){for(var t,n=[...this.namespaceResolvers.keys()].sort(((e,t)=>t.length-e.length)),i=g(n);!(t=i()).done;){var a=t.value;if(e.startsWith(a)){var r=this.namespaceResolvers.get(a);if(r)return r(e)}}}},{key:"extractProperty",value:function(e,t){switch(e){case"last":if(Array.isArray(t))return t[t.length-1];break;case"first":if(Array.isArray(t))return t[0];break;case"count":if(Array.isArray(t))return t.length;if(t&&"object"==typeof t)return Object.keys(t).length;break;default:return}this.log(`Could not extract .${e} from type ${typeof t}`)}},{key:"log",value:function(e){$n.debug(`[NamiConditionEvaluator] ${e}`)}}],[{key:"shared",get:function(){return e.instance||(e.instance=new e),e.instance}}])}(),km=function(){return p((function e(){h(this,e)}),[{key:"register",value:function(){wm.shared.registerNamespaceResolver(this.namespace,(e=>{var t=e.replace(new RegExp(`^${this.namespace}\\.`),"");return this.resolveValue(t)}))}},{key:"resolveKeyPath",value:function(e,t){for(var n,i=t,a=g(e.replace(/\[(\w+)\]/g,".$1").split(".").filter(Boolean));!(n=a()).done;){var r=n.value;if(null==i||"object"!=typeof i)return;i=i[r]}return i}}])}(),Sm=function(){function e(t){var n;return h(this,e),(n=d(this,e)).namespace="LaunchContext",n.context=t,n.register(),n}return k(e,km),p(e,[{key:"resolveValue",value:function(e){if(e.startsWith("customAttributes.")){var t=e.substring(17);return this.resolveKeyPath(t,this.context.customAttributes)}if(e.startsWith("customObject.")){var n=e.substring(13);return this.resolveKeyPath(n,this.context.customObject)}return this.resolveKeyPath(e,{customAttributes:this.context.customAttributes,customObject:this.context.customObject,productGroups:this.context.productGroups})}}])}(),Em=function(){function e(){var t,n,i,a;h(this,e),(a=d(this,e)).namespace="Device";var r=Intl.DateTimeFormat().resolvedOptions().locale.split("-")[1]||"",o=Intl.DateTimeFormat().resolvedOptions().timeZone,s=hu();return a.context={osName:s.os_name,osVersion:s.os_version,appVersion:s.extended_platform_version,sdkVersion:s.sdk_version,deviceModel:s.device_model,screenWidth:window.innerWidth,screenHeight:window.innerHeight,formFactor:s.form_factor,tvQuality:a.tvQuality(null!==(t=s.form_factor)&&void 0!==t?t:"desktop"),tvResolution:a.tvResolution(null!==(n=s.form_factor)&&void 0!==n?n:"desktop"),screenSize:a.screenSizeTier(null!==(i=s.form_factor)&&void 0!==i?i:"desktop"),language:s.language,country:r,timezone:o},a.register(),a}return k(e,km),p(e,[{key:"screenSizeTier",value:function(e){var t=window.screen.width,n=window.screen.height,i=window.devicePixelRatio||1,a=Math.round(t*i),r=Math.round(n*i),o=Math.max(a,r);switch(e){case"phone":return o<1136?"tiny":o<1334?"small":o<1920?"medium":o<2560?"large":"huge";case"tablet":return o<2048?"medium":o<2732?"large":"huge";case"television":return o<1920?"medium":o<3840?"large":"huge";case"desktop":return o<1440?"small":o<2560?"medium":o<3840?"large":"huge";default:return"medium"}}},{key:"tvQuality",value:function(e){if("television"!==e)return"";var t=window.screen.width,n=window.screen.height,i=window.devicePixelRatio||1,a=Math.round(t*i),r=Math.round(n*i),o=Math.max(a,r),s=Math.min(a,r);return o>=3840||s>=2160?"4K":o>=1920||s>=1080?"1080p":"720p"}},{key:"tvResolution",value:function(e){if("television"!==e)return"";var t=window.screen.width,n=window.screen.height,i=window.devicePixelRatio||1,a=Math.round(t*i),r=Math.round(n*i),o=Math.max(a,r),s=Math.min(a,r);return s<720&&o<1280?"SD":s>=720&&s<1080&&o>=1280&&o<1920?"720p":s>=1080&&s<1440&&o>=1920&&o<2560?"1080p":s>=1440&&s<2160&&o>=2560&&o<3840?"1440p":s>=2160&&s<3e3&&o>=3840&&o<5e3?"4K":s>=3e3&&o>=5e3?"8K":"Unknown"}},{key:"resolveValue",value:function(e){return this.resolveKeyPath(e,this.context)}}])}(),Mm=[/(^|_)api(_|$)?key/i,/^key$/i,/^token$/i,/id[_-]?token/i,/access[_-]?token/i,/^auth/i,/password/i,/secret/i,/signature/i,/hmac/i,/^jwt$/i,/^code$/i,/redirect[_-]?uri/i,/return[_-]?url/i,/^state$/i,/^session$/i,/^sid$/i,/^sso$/i,/assertion/i],Pm=function(){function e(){h(this,e),this.params={},"undefined"!=typeof window&&this.setSearchParams()}return p(e,[{key:"setSearchParams",value:function(){this.params=this.extractSafeParams()}},{key:"safeValue",value:function(e){if(!e)return null;try{var t=decodeURIComponent(e).trim();return!t||/^null|undefined$/i.test(t)||((e=>e.includes("://")||/^\/.*\?/.test(e))(t)||(e=>/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+$/.test(e))(t)||(e=>/^[A-Za-z0-9_-]{40,}$/.test(e)||/^[A-Fa-f0-9]{40,}$/.test(e)||/^ya29\./.test(e)||/^sk_/.test(e)||/^ghp_/.test(e))(t))?null:((e,t=128)=>e.length>t?e.slice(0,t):e)(t)}catch(e){return null}}},{key:"extractSafeParams",value:function(){var e=window.location,t={},n=new Set;try{for(var i,a=new URLSearchParams(e.search),r=(e,i)=>{var a=(e=>e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[-\s]/g,"_").toLowerCase())(e);if(!(n.size>=10||(e=>Mm.some((t=>t.test(e))))(a))){var r=this.safeValue(i);r&&(t[a]=r,n.add(a))}},o=g(a.entries());!(i=o()).done;){var s=i.value;r(s[0],s[1])}}catch(e){}return t}}],[{key:"instance",get:function(){return e._instance||(e._instance=new e),e._instance}},{key:"refresh",value:function(){"undefined"!=typeof window&&this.instance.setSearchParams()}}])}();Pm._instance=null;var Tm,_m=()=>Pm.instance.params,Dm=/\{\{\s*([^}]+?)\s*\}\}/g,Am=function(){return p((function e(t){h(this,e),this.flowManager=t,this.urlParams=_m()}),[{key:"resolve",value:function(e){var t,n,i,a,r,o,s,u,l,d,h,c,m=this.flowManager.currentFlow,f=null==m?void 0:m.component;if(e.startsWith("launchContext.")){var v,p=null===(v=this.flowManager.currentFlow)||void 0===v?void 0:v.context;if(p){var g=e.substring(14),y=new Sm(p).resolveValue(g);return null==y?void 0:y.toString()}}else switch(e){case"campaignId":return null==f||null===(t=f.campaign)||void 0===t?void 0:t.rule;case"campaignName":return null==f||null===(n=f.campaign)||void 0===n?void 0:n.name;case"campaignLabel":case"campaignPlacement":return null!==(i=null==f||null===(a=f.campaign)||void 0===a?void 0:a.value)&&void 0!==i?i:void 0;case"campaignSegment":case"campaignSegmentId":return null==f||null===(r=f.campaign)||void 0===r?void 0:r.segment;case"campaignExternalSegment":case"campaignExternalSegmentId":return null!==(o=null==f||null===(s=f.campaign)||void 0===s?void 0:s.external_segment)&&void 0!==o?o:void 0;case"pageName":return null==f||null===(u=f.paywall)||void 0===u?void 0:u.name;case"pageId":return null==f||null===(l=f.paywall)||void 0===l?void 0:l.id;case"flowName":return null==m?void 0:m.name;case"flowId":return null==m?void 0:m.id;case"objectId":return null==f||null===(d=f.campaign)||void 0===d||null===(d=d.flow)||void 0===d?void 0:d.object_id;case"stepName":return null==m||null===(h=m.currentFlowStep)||void 0===h?void 0:h.name;case"buttonText":return null==m||null===(c=m.currentButton)||void 0===c?void 0:c.firstTextValue();case"slideNumber":var b=null==f?void 0:f.getSelectedSlideIndexForCurrentCarousel();return null!=b?`${b+1}`:void 0;default:return}}},{key:"interpolateLiquidVariables",value:function(e){return e.replace(Dm,((e,t)=>{var n,i=null!==(n=this.resolve(t))&&void 0!==n?n:this.urlParams[t];return null!=i?i:""}))}},{key:"interpolateDeep",value:function(e){return"string"==typeof e?this.interpolateLiquidVariables(e):Array.isArray(e)?e.map((e=>this.interpolateDeep(e))):e&&"object"==typeof e?Object.entries(e).reduce(((e,[t,n])=>y({},e,{[t]:this.interpolateDeep(n)})),{}):e}}])}(),xm=function(){function e(){var t;return h(this,e),(t=d(this,e)).namespace="urlParams",t.context=_m(),t.register(),t}return k(e,km),p(e,[{key:"resolveValue",value:function(e){return $n.debug("[URLParamsResolver]","Resolving keyPath",e),this.resolveKeyPath(e,this.context)}}])}(),Cm=function(){function e(){var t;return h(this,e),(t=d(this,e)).namespace="state",t.register(),t}return k(e,km),p(e,[{key:"getContextProvider",value:function(){var e=Jh.providers;if(0!==e.length){var t=e.find((e=>e.flow));return t||e[e.length-1]}}},{key:"resolveValue",value:function(e){var t=this.getContextProvider();if(t){if(e.startsWith("formStates.")){var n=e.substring(11);return t.getCurrentFormId(n)}return this.resolveKeyPath(e,t.state)}}}])}(),Im=function(){function e(t){var n;return h(this,e),(n=d(this,e)).namespace="Placement",n.campaign=t,n.register(),n}return k(e,km),p(e,[{key:"resolveValue",value:function(e){var t;if("label"===e){if(this.campaign&&void 0!==this.campaign.value&&null!==this.campaign.value)return this.campaign.value;var n=Jh.providers;if(0!==n.length){var i=n.find((e=>e.flow));return i?i.getCurrentPlacementLabel():null===(t=n[n.length-1])||void 0===t?void 0:t.getCurrentPlacementLabel()}}}}])}(),Lm=function(){return p((function e(){h(this,e),this.load()}),[{key:"setExternalId",value:function(e){return this.externalId=e,this}},{key:"getExternalId",value:function(){return this.externalId}},{key:"isLoggedIn",value:function(){return!!this.externalId}},{key:"save",value:function(){return this.externalId?Qr.setNamiProfile({externalId:this.externalId}):Qr.removeNamiProfile(),this}},{key:"load",value:function(){var e=Qr.getNamiProfile();e&&(this.externalId=e.externalId),Jh.setIsLoggedIn(!!this.externalId)}},{key:"login",value:function(e){var t;return T((function(n){for(;;)switch(n.n){case 0:return n.n=1,l(zs.instance.login(e));case 1:(t=n.v).external_id&&Jh.setIsLoggedIn(!0),this.setExternalId(t.external_id).save();case 2:return n.a(2)}}),null,this,null,Promise)}},{key:"logout",value:function(){return T((function(e){for(;;)switch(e.n){case 0:return e.n=1,l(zs.instance.logout());case 1:Jh.setIsLoggedIn(!1),this.setExternalId(void 0).save();case 2:return e.a(2)}}),null,this,null,Promise)}}])}();Lm.instance=new Lm,function(e){e.LOGIN="login",e.LOGOUT="logout",e.ADVERTISING_ID_SET="advertising_id_set",e.ADVERTISING_ID_CLEARED="advertising_id_cleared",e.VENDOR_ID_SET="vendor_id_set",e.VENDOR_ID_CLEARED="vendor_id_cleared",e.CUSTOMER_DATA_PLATFORM_ID_SET="customer_data_platform_id_set",e.CUSTOMER_DATA_PLATFORM_ID_CLEARED="customer_data_platform_id_cleared",e.ANONYMOUS_MODE_ON="anonymous_mode_on",e.ANONYMOUS_MODE_OFF="anonymous_mode_off",e.NAMI_DEVICE_ID_SET="nami_device_id_set",e.NAMI_DEVICE_ID_CLEARED="nami_device_id_cleared"}(Tm||(Tm={}));var Fm=function(){return p((function e(){h(this,e),this.emitter=Hu.getInstance(),wm.shared.registerNamespaceResolver("UserTags",(t=>{var n=t.replace("UserTags.",""),i=e.getCustomerAttribute(n);if(null!=i){var a=i.toLowerCase();return"true"===a||"false"===a?"true"===a:isNaN(Number(i))?i:parseInt(i,10)}return null}))}),[{key:"isSDKInitialized",get:function(){return fc.instance.isInitialized}}],[{key:"isLoggedIn",value:function(){return Lm.instance.isLoggedIn()}},{key:"loggedInId",value:function(){return this.instance.isSDKInitialized||$n.debug(Pe),Lm.instance.getExternalId()}},{key:"login",value:function(e){var t,n,i,a,r,o,s;return T((function(u){for(;;)switch(u.p=u.n){case 0:if(this.instance.isSDKInitialized){u.n=1;break}throw t=new no,this.invokeStateHandler(Tm.LOGIN,!1,t),t;case 1:if(!this.inAnonymousMode()){u.n=2;break}throw n=new ho,this.invokeStateHandler(Tm.LOGIN,!1,n),n;case 2:return u.p=2,u.n=3,l(Lm.instance.login(e));case 3:return u.n=4,l(nc.instance.fetchActiveEntitlements());case 4:this.invokeStateHandler(Tm.LOGIN,!0),Om.instance.flowOpen&&(i=Om.instance.currentFlow,(a=null==i?void 0:i.currentFlowStep)&&i.executeLifecycle(a,im)),u.n=6;break;case 5:throw u.p=5,s=u.v,this.invokeStateHandler(Tm.LOGIN,!1,s),Om.instance.flowOpen&&(r=Om.instance.currentFlow,(o=null==r?void 0:r.currentFlowStep)&&r.executeLifecycle(o,am)),s;case 6:return u.a(2)}}),null,this,[[2,5]],Promise)}},{key:"logout",value:function(){var e,t,n,i,a,r,o;return T((function(s){for(;;)switch(s.p=s.n){case 0:if(this.instance.isSDKInitialized){s.n=1;break}throw e=new no,this.invokeStateHandler(Tm.LOGOUT,!1,e),e;case 1:if(!this.inAnonymousMode()){s.n=2;break}throw t=new ho,this.invokeStateHandler(Tm.LOGOUT,!1,t),t;case 2:return s.p=2,s.n=3,l(Lm.instance.logout());case 3:return s.n=4,l(nc.instance.fetchActiveEntitlements());case 4:this.invokeStateHandler(Tm.LOGOUT,!0),Om.instance.flowOpen&&(n=Om.instance.currentFlow,(i=null==n?void 0:n.currentFlowStep)&&n.executeLifecycle(i,rm)),s.n=6;break;case 5:throw s.p=5,o=s.v,this.invokeStateHandler(Tm.LOGOUT,!1,o),Om.instance.flowOpen&&(a=Om.instance.currentFlow,(r=null==a?void 0:a.currentFlowStep)&&a.executeLifecycle(r,om)),o;case 6:return s.a(2)}}),null,this,[[2,5]],Promise)}},{key:"setCustomerDataPlatformId",value:function(e){return T((function(t){for(;;)switch(t.n){case 0:return t.n=1,l(this.updateCustomerDataPlatformId(e));case 1:return t.a(2)}}),null,this,null,Promise)}},{key:"clearCustomerDataPlatformId",value:function(){return T((function(e){for(;;)switch(e.n){case 0:return e.n=1,l(this.updateCustomerDataPlatformId(null));case 1:return e.a(2)}}),null,this,null,Promise)}},{key:"registerAccountStateHandler",value:function(e){return this.instance.emitter.on("accountStateChange",e),()=>{this.instance.emitter.off("accountStateChange",e)}}},{key:"setAnonymousMode",value:function(e){var t,n,i,a,r;return T((function(o){for(;;)switch(o.n){case 0:if(t=e?Tm.ANONYMOUS_MODE_ON:Tm.ANONYMOUS_MODE_OFF,this.instance.isSDKInitialized){o.n=1;break}throw n=new no,this.invokeStateHandler(t,!1,n),n;case 1:if(this.anonymousModeCapability()){o.n=2;break}return $n.warn("Anonymous mode feature is not enabled for your Nami account. Contact support@nami.ml for details."),o.a(2);case 2:if(this.inAnonymousMode()!==e){o.n=3;break}return i=e?new uo:new lo,this.invokeStateHandler(t,!1,i),o.a(2);case 3:if(!e){o.n=4;break}Qr.setAnonymousMode(e),Qr.resetDevice(),this.refetchConfig(),this.invokeStateHandler(Tm.ANONYMOUS_MODE_ON,!0),o.n=6;break;case 4:return Qr.clearAnonymousMode(),r=null===(a=Qr.getNamiConfig())||void 0===a?void 0:a.namiCommands,o.n=5,l(Vu.instance.createOrUpdateDevice(hu(r)));case 5:Qr.clearAnonymousUUID(),this.refetchConfig(),this.invokeStateHandler(Tm.ANONYMOUS_MODE_OFF,!0);case 6:return o.a(2)}}),null,this,null,Promise)}},{key:"inAnonymousMode",value:function(){return!!this.instance.isSDKInitialized&&Ju()}},{key:"setCustomerAttribute",value:function(e,t){if(!this.instance.isSDKInitialized)throw new no;if(Qr.setCustomerAttribute(e,t),Rs(me.PAYWALL_PERSONALIZATION)?(Jh.setCustomerAttribute({[e]:t}),$n.debug(`This customer attribute you set is now available for paywall personalization using the smart text variable: ${e}`)):$n.warn(`The customer attribute ${e} is not available for using on a paywall, because your account's plan does not include paywall personalization. Contact support@nami.ml for details.`),Om.instance.flowOpen){var n=Om.instance.currentFlow;if(n){var i=n.currentFlowStep;i&&n.executeLifecycle(i,lm)}}}},{key:"getCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new no;var t=Qr.getCustomerAttribute(e);return null!=t?Rs(me.PAYWALL_PERSONALIZATION)?$n.debug(`Found customer attribute. ${e} is available for paywall personalization on this device.`):$n.warn(`Found customer attribute. ${e} is not available for use on a paywall because paywall personalization is not included in your account's plan. Contact support@nami.ml for details.`):$n.warn(`No ${e} customer attribute found.`),t}},{key:"getAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new no;return Qr.getAllCustomerAttributes()}},{key:"clearCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new no;Qr.clearCustomerAttribute(e)?(Jh.removeCustomerAttribute(e),$n.warn(`This customer attribute has been cleared. ${e} is no longer available for paywall personalization on this device. A default value will be used if set in the Nami Control Center.`)):$n.warn(`No value to clear for attribute ${e}.`)}},{key:"clearAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new no;Qr.getAllCustomerAttributesKeys().forEach((e=>{Jh.removeCustomerAttribute(e)})),Qr.clearAllCustomerAttributes(),$n.warn("All customer attribute have been cleared. customer's smart text will no longer be personalized for this device. A default value will be used if set in the Nami Control Center.")}},{key:"journeyState",value:function(){if(!this.instance.isSDKInitialized)throw new no;return Qr.getCustomerJourneyState()}},{key:"deviceId",value:function(){var e,t;return this.instance.isSDKInitialized&&null!==(e=null===(t=Qr.getDevice())||void 0===t?void 0:t.id)&&void 0!==e?e:Oe}},{key:"registerJourneyStateHandler",value:function(e){if(Ws("NamiCustomerManager.registerJourneyStateHandler"))return this.instance.emitter.addListener(An,e),()=>{this.instance.emitter.removeListener(An,e)}}},{key:"invokeStateHandler",value:function(e,t,n){this.instance.emitter.emit("accountStateChange",e,t,n)}},{key:"updateCustomerDataPlatformId",value:function(e){var t,n,i,a;return T((function(r){for(;;)switch(r.p=r.n){case 0:if(this.instance.isSDKInitialized){r.n=1;break}throw t=new no,this.invokeStateHandler(Tm.CUSTOMER_DATA_PLATFORM_ID_SET,!1,t),t;case 1:if(this.inAnonymousMode()){r.n=6;break}return r.p=2,r.n=3,l(Vu.instance.updateDeviceField("customer_data_platform_id",e));case 3:this.invokeStateHandler(Tm.CUSTOMER_DATA_PLATFORM_ID_SET,!0),r.n=5;break;case 4:r.p=4,a=r.v,this.invokeStateHandler(Tm.CUSTOMER_DATA_PLATFORM_ID_SET,!1,a);case 5:r.n=7;break;case 6:return $n.info("Unable to set CDP ID in anonymous mode",{deviceId:null===(n=Qr.getDevice())||void 0===n?void 0:n.id,anonymousMode:!0}),i=new co,this.invokeStateHandler(Tm.CUSTOMER_DATA_PLATFORM_ID_SET,!1,i),r.a(2);case 7:return r.a(2)}}),null,this,[[2,4]],Promise)}},{key:"anonymousModeCapability",value:function(){if(!this.instance.isSDKInitialized)return!1;var e=Rs(me.ANONYMOUS_MODE_CAPABILITY),t=Rs(me.THIRD_PARTY_TRANSACTIONS);return e&&t}},{key:"refetchConfig",value:function(){return T((function(e){for(;;)switch(e.n){case 0:if(!this.instance.isSDKInitialized){e.n=1;break}return e.n=1,l(Promise.all([Xu.instance.fetchProducts(),Ku.instance.fetchPaywalls().then((e=>Uu.instance.fetchCampaignRules(e)))]));case 1:return e.a(2)}}),null,this,null,Promise)}}])}();Fm.instance=new Fm;var Rm=function(){return p((function e(t={}){var n,i,a,r,o;h(this,e),this.id=null!==(n=t.id)&&void 0!==n?n:"",this.name=null!==(i=t.name)&&void 0!==i?i:"",this.steps=null!==(a=t.steps)&&void 0!==a?a:[],this.screens=null!==(r=t.screens)&&void 0!==r?r:[],this.resumeFromBookmark=Boolean(t.resume_from_bookmark),this.transition=null!==(o=t.transition)&&void 0!==o?o:"none"}),[{key:"allScreensAvailable",get:function(){return this.screens.length>0&&Xs(this.screens)}}])}(),Wm=function(){function e(t,n,i,a){var r,o;h(this,e),(o=d(this,e,[null!==(r=t.flow.object)&&void 0!==r?r:{}])).stepcrumbs=[],o.branchcrumbs=[],o.activeHandoffSequence=null,o.currentScreenState=null,o.isPaused=!1,o.timerStates={},o.campaign=t,o.component=n,o.context=a,o.manager=i,o.branchcrumbs=[],o.stepcrumbs=[],o.registerResolvers(a);var s=o.findStepByType(Xc);return s&&o.forward(s.id),o}return k(e,Rm),p(e,[{key:"registerResolvers",value:function(e){e&&new Sm(e),new Em,new xm,new Cm,new Im(this.campaign),wm.shared.registerNamespaceResolver("Flow",(e=>{switch(e){case"Flow.stepcrumbs":return this.stepcrumbs.map((e=>e.id));case"Flow.branchcrumbs":return this.branchcrumbs;default:return}}))}},{key:"currentFlowStep",get:function(){return this.stepcrumbs.at(-1)}},{key:"nextStepAvailable",get:function(){return void 0!==this.nextFlowStep}},{key:"previousStepAvailable",get:function(){var e,t=!!this.previousFlowStep,n=!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to),i=this.stepcrumbs.slice(0,-1).some((e=>"screen"===e.type));return t&&n&&i}},{key:"previousFlowStep",get:function(){var e=this.stepcrumbs.length-2;return e>=0?this.stepcrumbs[e]:void 0}},{key:"nextFlowStep",get:function(){return this.nextStep(this.currentFlowStep)}},{key:"getStep",value:function(e){return this.steps.find((t=>t.id===e))}},{key:"findStepByType",value:function(e){return this.steps.find((t=>t.type===e))}},{key:"isStepActive",value:function(e){return!e.branch_tags||!e.branch_tags.length||e.branch_tags.some((e=>this.branchcrumbs.includes(e)))}},{key:"finished",value:function(){this.manager.finishFlow()}},{key:"back",value:function(){this.previousStepAvailable?this.backToPreviousScreenStep():$n.debug("No previous step available")}},{key:"next",value:function(){var e=this.nextFlowStep;e&&this.forward(e.id)}},{key:"backToPreviousScreenStep",value:function(){var e;if(!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to)){for(var t=this.stepcrumbs.length-2;t>=0;t--){var n=this.stepcrumbs[t];if(this.stepcrumbs.pop(),"branch"===n.type&&this.branchcrumbs.length>0&&this.branchcrumbs.pop(),"screen"===n.type&&n.screen){var i,a,r=Vs(n.screen);return r&&this.component.flowNavigateToScreen(r,{transition:this.transition,direction:"backward"}),void(this.currentScreenState=null!==(i=null===(a=Jh.currentProvider)||void 0===a?void 0:a.state)&&void 0!==i?i:null)}}$n.warn("No previous screen step found to return to")}else $n.warn(`Not allowed to go back to ${this.previousFlowStep.id}`)}},{key:"forward",value:function(e){var t=this.getStep(e);if(t){if(this.isStepActive(t))switch(t.type){case Xc:case qc:return this.stepcrumbs.push(t),void this.executeLifecycle(t,em);case Yc:return void this.handleBranchStep(t);case Kc:return void this.handleScreenStep(t);case Jc:return}}else $n.error(`No step found with id: ${e}`)}},{key:"pause",value:function(){var e;this.isPaused?$n.info("Flow is already paused"):(this.isPaused=!0,this.pausedStepID=null===(e=this.currentFlowStep)||void 0===e?void 0:e.id,$n.info("Flow paused"))}},{key:"resumeFromPause",value:function(){if(this.isPaused)if(this.isPaused=!1,this.pausedStepID){var e=this.pausedStepID;this.pausedStepID=void 0,$n.info(`Flow resumed from step ${e}`),this.forward(e)}else $n.warn("No step to resume from");else $n.info("Flow is not paused")}},{key:"executeLifecycle",value:function(e,t,n){var i=e.actions[t];i&&this.executeFullLifecycles(i,n)}},{key:"lifecycles",value:function(e){if(this.currentFlowStep){var t=this.currentFlowStep.actions[e];if(t)return t;$n.info(`No actions found for button ${e} on step ${this.currentFlowStep.id}`)}}},{key:"triggerActions",value:function(e,t,n){var i=this.lifecycles(e);i&&(this.currentButton=t,this.executeFullLifecycles(i,n))}},{key:"executeFullLifecycles",value:function(e,t){for(var n,i=g(e);!(n=i()).done;){var a=n.value;[a.before,a.action,a.after].forEach((e=>null==e?void 0:e.forEach((e=>this.shouldRun(e)&&this.performAction(e,t)))))}}},{key:"triggerBeforeActions",value:function(e,t,n){var i=this.lifecycles(e);if(i){this.currentButton=t;for(var a,r=g(i);!(a=r()).done;){var o;null===(o=a.value.before)||void 0===o||o.forEach((e=>this.shouldRun(e)&&this.performAction(e,n)))}}}},{key:"triggerAfterActions",value:function(e,t,n){var i=this.lifecycles(e);if(i){this.currentButton=t;for(var a,r=g(i);!(a=r()).done;){var o;null===(o=a.value.after)||void 0===o||o.forEach((e=>this.shouldRun(e)&&this.performAction(e,n)))}}}},{key:"currentStepHasHoistedPrimaryActions",value:function(e){var t=this.lifecycles(e);return!!t&&t.some((e=>{var t;return null===(t=e.action)||void 0===t?void 0:t.length}))}},{key:"shouldRun",value:function(e){return!e.conditions||e.conditions.every((e=>wm.shared.evaluate(e)))}},{key:"performAction",value:function(e,t){var n;if(this.currentFlowStep){var i=(null!==(n=e.parameters)&&void 0!==n&&n.delay?+e.parameters.delay:0)||0,a=n=>{var i,a,r,o,s,u,l;if((null===(i=this.currentFlowStep)||void 0===i?void 0:i.id)===n)switch(e.function){case Vc.BACK:this.back();break;case Vc.NEXT:null!==(a=e.parameters)&&void 0!==a&&a.step?this.forward(e.parameters.step):this.next();break;case Vc.NAVIGATE:var d;if(null!==(r=e.parameters)&&void 0!==r&&r.step)(null===(d=this.previousFlowStep)||void 0===d?void 0:d.id)===e.parameters.step?this.back():this.forward(e.parameters.step);else this.next();break;case Vc.FINISHED:case Vc.DISMISS:this.finished();break;case Vc.EXIT:var h=this.steps.find((e=>e.type===qc));h&&this.forward(h.id);break;case Vc.PAUSE:this.pause();break;case Vc.RESUME:this.resumeFromPause();break;case Vc.HANDOFF:if(null!==(o=e.parameters)&&void 0!==o&&o.handoffTag)if(this.manager.handoffStepHandler)if(e.parameters.handoffData)$n.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} ${JSON.stringify(e.parameters.handoffData)}`),this.manager.handoffStepHandler(e.parameters.handoffTag,e.parameters.handoffData);else if(t)$n.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} ${JSON.stringify(t)}`),this.manager.handoffStepHandler(e.parameters.handoffTag,t);else if(e.parameters.handoffFormId){var c=this.getFormData();e.parameters.handoffTag===Qc?this.flowHandoffFormSequence():this.manager.handoffStepHandler(e.parameters.handoffTag,c)}else $n.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} and no data`),this.manager.handoffStepHandler(e.parameters.handoffTag);else $n.debug("No handoffStepHandler found",e);break;case Vc.LOG:var m;if(null!==(s=e.parameters)&&void 0!==s&&s.eventName)$n.info(`logEvent → ${e.parameters.eventName}`);else $n.warn(`Missing 'eventName' in logEvent action ${null!==(m=e.id)&&void 0!==m?m:"unknown"}`);break;case Vc.TRACK:var f;if(null!==(u=e.parameters)&&void 0!==u&&u.eventName)$n.info(`trackEvent → ${e.parameters.eventName}`);else $n.warn(`Missing 'eventName' in logEvent action ${null!==(f=e.id)&&void 0!==f?f:"unknown"}`);break;case Vc.SET_VIDEO:null!==(l=e.parameters)&&void 0!==l&&l.name&&e.parameters.url?Jh.setAppSuppliedVideoDetails({name:e.parameters.name,url:e.parameters.url}):$n.warn("Missing name, url for setting video details");break;case Vc.BLOCK_BACK:var v,p=null===(v=e.parameters)||void 0===v?void 0:v.step,g=p?this.getStep(p):void 0;g?g.allow_back_to=!1:this.currentFlowStep?this.currentFlowStep.allow_back_to=!1:$n.warn("Missing step for blocking back");break;case Vc.FLOW_EVENT:var y,b=new Am(this.manager),w=Object.fromEntries(Object.entries(null!==(y=e.parameters)&&void 0!==y?y:{}).map((([e,t])=>[e,b.interpolateDeep(t)])));this.manager.eventHandler?this.manager.eventHandler(w):$n.warn("Missing event handler",w);break;case Vc.FLOW_ENABLED:Jh.setUserInteractionEnabled(!0);break;case Vc.FLOW_DISABLED:Jh.setUserInteractionEnabled(!1);break;case Vc.SET_TAGS:e.parameters&&(Jh.setUserTags(e.parameters),Object.entries(e.parameters).forEach((([e,t])=>{Fm.setCustomerAttribute(e,t)})));break;default:$n.warn(`Missing action handler for ${e.function}`,e)}else $n.debug(`Skipped action for stale flow step ${n}`)};i?setTimeout(a.bind(this,this.currentFlowStep.id),i):a(this.currentFlowStep.id)}else $n.warn("No current flow step")}},{key:"nextStep",value:function(e){if(e){var t=this.steps.findIndex((t=>t.id===e.id));if(-1!==t){for(var n,i=g(this.steps.slice(t+1));!(n=i()).done;){var a=n.value;if(this.isStepActive(a))return a}$n.debug(`No active next step found after ${e.id}`)}else $n.error(`Could not find next step for step ${e.id}`)}else $n.error("Next step not found")}},{key:"handleScreenStep",value:function(e){var t,n=Vs(null!==(t=e.screen)&&void 0!==t?t:"");e.screen&&n&&this.campaign?(this.stepcrumbs.push(e),this.component.flowNavigateToScreen(n,{transition:this.transition,direction:"forward"})):$n.error("No paywall or campaign found for next step")}},{key:"handleBranchStep",value:function(e){this.stepcrumbs.push(e);for(var t=0,n=Object.entries(e.actions);t<n.length;t++){var i=n[t],a=i[0],r=i[1];if(r)for(var o,s=g(r);!(o=s()).done;){var u=o.value;if(u.action)for(var l,d=g(u.action);!(l=d()).done;){var h,c,m=l.value;if(this.shouldRun(m))return this.branchcrumbs.push(a),null===(h=u.before)||void 0===h||h.forEach((e=>{this.performAction(e)})),u.action.forEach((e=>{this.shouldRun(e)&&this.performAction(e)})),void(null===(c=u.after)||void 0===c||c.forEach((e=>{this.performAction(e)})))}else $n.warn(`No actions defined for branch tag ${a}`)}}$n.warn(`No matching branch condition matched for step ${e.id}`)}},{key:"getFormData",value:function(){var e,t;return y({},null!==(e=null===(t=Jh.currentProvider)||void 0===t||null===(t=t.state)||void 0===t?void 0:t.formStates)&&void 0!==e?e:{})}},{key:"flowHandoffFormSequence",value:function(){var e,t=null===(e=this.currentScreenState)||void 0===e?void 0:e.formStates;if(t){var n=Object.keys(t).sort();if(0!==n.length){var i=n.filter((e=>!0===t[e]));if(0===i.length)return $n.info("No eligible handoff keys after filtering"),void this.manager.resume();this.activeHandoffSequence={formStates:y({},t),remainingKeys:[...i]},this.resumeNextHandoff()}else $n.warn("formStates is empty, no handoffs to perform")}else $n.warn("No formStates available for handoff sequence")}},{key:"resumeNextHandoff",value:function(){var e,t,n=this.activeHandoffSequence;if(!n)return $n.warn("No active handoff sequence to resume"),void this.manager.resume();if(0===n.remainingKeys.length)return $n.info("All handoffs in the sequence are complete"),this.activeHandoffSequence=null,void this.manager.resume();var i=n.remainingKeys.shift(),a=n.formStates[i];$n.debug(`Starting handoff for ${i} → ${String(a)}`),this.activeHandoffSequence=n;var r=`${i}`;null===(e=(t=this.manager).handoffStepHandler)||void 0===e||e.call(t,r,void 0)}}])}(),Om=function(){function e(){h(this,e),this.flowOpen=!1,this.lastAnimatedFlowProgress=new Map,this.navGraphCache=new WeakMap}return p(e,[{key:"resume",value:function(){e.resume()}},{key:"presentFlow",value:function(e,t,n){var i=new Wm(e,t,this,n);return this.flowOpen=!0,this.currentFlow=i,i}},{key:"finishFlow",value:function(){this.flowOpen=!1,this.currentFlow=void 0,this.lastAnimatedFlowProgress.clear()}},{key:"getLastAnimatedFlowProgress",value:function(e){var t;return null!==(t=this.lastAnimatedFlowProgress.get(e))&&void 0!==t?t:0}},{key:"setLastAnimatedFlowProgress",value:function(e,t){this.currentFlow&&this.lastAnimatedFlowProgress.set(e,t)}},{key:"getCurrentFlowProgress",value:function(e){if(!this.currentFlow)return 1;if(!this.currentFlow.currentFlowStep)return 0;var t=this.currentFlow.steps.filter((e=>e.type===Kc));if(0===t.length)return 0;var n=this.currentFlow.stepcrumbs.filter((e=>e.type===Kc));if(0===n.length)return 0;var i=this.buildNavGraph(this.currentFlow),a=this.currentFlow.currentFlowStep,r=this.findBranchPoint(t,i),o=0;if(r)o=this.calculateBranchingProgress(n,t,a,r,i);else{var s=t.findIndex((e=>e.id===a.id));o=s>=0?(s+1)/t.length:0}return o=Math.max(0,Math.min(1,o)),e&&this.setLastAnimatedFlowProgress(e,o),o}},{key:"findBranchPoint",value:function(e,t){for(var n,i=g(e);!(n=i()).done;){var a=n.value;if(this.hasBranching(a,e,t))return a}return null}},{key:"calculateBranchingProgress",value:function(e,t,n,i,a){var r=e.length,o=t.findIndex((e=>e.id===i.id)),s=e.findIndex((e=>e.id===i.id)),u=t.findIndex((e=>e.id===n.id));if(-1===s||n.id===i.id)return(u+1)/(o+2);var l=this.countForwardScreens(n,t,a),d=r+l;return $n.debug(`Branching progress: visited=${r}, remaining=${l}, total=${d}, step=${n.id}`),r/d}},{key:"countForwardScreens",value:function(e,t,n){var i=t.findIndex((t=>t.id===e.id));if(-1===i)return 0;var a=new Set,r=0,o=(e,s)=>{if(!a.has(e)){a.add(e);var u=(n.get(e)||[]).filter((e=>{var n=t.findIndex((t=>t.id===e));return n>i}));if(0!==u.length)for(var l,d=g(u);!(l=d()).done;){var h=l.value;o(h,s+1)}else r=Math.max(r,s)}};return o(e.id,0),r}},{key:"hasBranching",value:function(e,t,n){var i=t.findIndex((t=>t.id===e.id));if(-1===i)return!1;var a=(n.get(e.id)||[]).filter((e=>{var n=t.findIndex((t=>t.id===e));return n>i}));return a.length>1}},{key:"buildNavGraph",value:function(e){var t=this.navGraphCache.get(e);if(t)return t;var n=new Map;e.steps.forEach((e=>{e.actions&&Object.values(e.actions).forEach((t=>{Array.isArray(t)&&t.forEach((t=>{t.action&&t.action.forEach((t=>{if("flowNav"===t.function){var i,a=null===(i=t.parameters)||void 0===i?void 0:i.step;a&&(n.has(e.id)||n.set(e.id,new Set),n.get(e.id).add(a))}}))}))}))}));var i=new Map;return n.forEach(((e,t)=>{i.set(t,Array.from(e))})),this.navGraphCache.set(e,i),i}},{key:"getCurrentFlowStepAutoAdvanceDelay",value:function(){var e,t,n=null===(e=this.currentFlow)||void 0===e?void 0:e.currentFlowStep;if(!n)return null;var i=null===(t=n.actions)||void 0===t?void 0:t[tm];if(!i)return null;for(var a,r=g(i);!(a=r()).done;)for(var o,s,u=g(null!==(o=a.value.action)&&void 0!==o?o:[]);!(s=u()).done;){var l,d=s.value;if((d.function===Vc.NAVIGATE||d.function===Vc.NEXT)&&null!=(null===(l=d.parameters)||void 0===l?void 0:l.delay)){var h=d.parameters.delay,c=Number(h);if(!isNaN(c)&&c>0)return c/1e3}}return null}}],[{key:"instance",get:function(){return e._instance||(e._instance=new e),e._instance}},{key:"registerStepHandoff",value:function(e){this.instance.handoffStepHandler=e}},{key:"registerEventHandler",value:function(e){this.instance.eventHandler=e}},{key:"resume",value:function(){var t=e.instance,n=t.flowOpen,i=t.currentFlow;if(n&&i&&i.currentFlowStep){if(i.activeHandoffSequence)return $n.debug(`Resuming flow at handoff sequence ${i.currentFlowStep.id}`),void i.resumeNextHandoff();$n.debug(`Resuming flow at step ${i.currentFlowStep.id}`),i.executeLifecycle(i.currentFlowStep,"__resume__")}else $n.warn("Cannot resume: no active flow or current step")}},{key:"finish",value:function(){var t=e.instance,n=t.flowOpen,i=t.currentFlow;n&&i&&i.currentFlowStep?($n.debug(`Finishing flow programmatically at step ${i.currentFlowStep.id}`),i.finished()):$n.debug("Cannot finish: no active flow or current step")}},{key:"pause",value:function(){var t=e.instance,n=t.flowOpen,i=t.currentFlow;n&&i&&i.currentFlowStep?!0===i.resumeFromBookmark?i.pause():$n.warn("This flow cannot be paused"):$n.warn("Cannot pause: no active flow or current step")}},{key:"isFlowOpen",value:function(){return e.instance.flowOpen}},{key:"getLastAnimatedFlowProgress",value:function(e){return this.instance.getLastAnimatedFlowProgress(e)}},{key:"setLastAnimatedFlowProgress",value:function(e,t){this.instance.setLastAnimatedFlowProgress(e,t)}},{key:"getCurrentFlowProgress",value:function(e){return this.instance.getCurrentFlowProgress(e)}},{key:"getCurrentFlowStepAutoAdvanceDelay",value:function(){return this.instance.getCurrentFlowStepAutoAdvanceDelay()}}])}();var Nm=e=>{var t;return T((function(n){for(;;)if(0===n.n)return t=new Set(Array.from(document.fonts.values()).map((e=>e.family))),e.forEach((e=>{var n=jm(e);if(!t.has(n)){var i=new FontFace(n,`url(${e.file})`);document.fonts.add(i)}})),n.a(2,document.fonts.ready.then())}),null,null,null,Promise)};function jm(e){return`${e.family}-${e.style}`.replace(/ /g,"")}function $m(e,t,n){var i,a,r,o,s,u,l,d;if("undefined"==typeof window||!e||!t)return $n.debug("Swipe detection is not supported in this environment."),{destroy(){},updateOptions(){}};var h={minDistance:null!==(i=null==n?void 0:n.minDistance)&&void 0!==i?i:30,maxDuration:null!==(a=null==n?void 0:n.maxDuration)&&void 0!==a?a:600,lockAxis:null===(r=null==n?void 0:n.lockAxis)||void 0===r||r,preventScrollOnSwipe:null!==(o=null==n?void 0:n.preventScrollOnSwipe)&&void 0!==o&&o,pointerTypes:null!==(s=null==n?void 0:n.pointerTypes)&&void 0!==s?s:["touch"],passiveListeners:null===(u=null==n?void 0:n.passiveListeners)||void 0===u||u,axisHint:null!==(l=null==n?void 0:n.axisHint)&&void 0!==l?l:"y",edgeLeakThreshold:null!==(d=null==n?void 0:n.edgeLeakThreshold)&&void 0!==d?d:24},c=e.style.touchAction;h.preventScrollOnSwipe&&(e.style.touchAction="none");var m=null,f=0,v=0,p=0,g=0,y=0,b=null,w=null,k=!1,S=!1,E=!1,M=e=>{try{var t=window.getComputedStyle(e);if(!t)return!1;var n=t.overflowY;if("auto"!==n&&"scroll"!==n)return!1;var i=e;return i.scrollHeight>i.clientHeight}catch(e){return!1}},P=e=>h.pointerTypes.includes(e.pointerType),T=t=>{var n=t.composedPath?t.composedPath()[0]:t.target;if(P(t)&&null===m){m=t.pointerId,f=p=t.clientX,v=g=t.clientY,y=performance.now(),b=null,E=!1,k=!1,S=!1,(w="y"===h.axisHint?((e,t)=>{for(var n=e;n&&n!==t&&n instanceof HTMLElement;){var i,a;if(M(n))return n;n=n.parentElement||(null!==(i=null===(a=n.parentNode)||void 0===a?void 0:a.host)&&void 0!==i?i:null)}return null})(n,e):null)||(S=!0);try{var i;null==e||null===(i=e.setPointerCapture)||void 0===i||i.call(e,t.pointerId)}catch(e){try{var a;null==n||null===(a=n.setPointerCapture)||void 0===a||a.call(n,t.pointerId)}catch(e){}}}},_=e=>{if(e.pointerId===m&&P(e)){if(p=e.clientX,g=e.clientY,h.lockAxis&&!b){var n=Math.abs(p-f),i=Math.abs(g-v);(n>2||i>2)&&(b=i>=n?"y":"x")}if("y"===h.axisHint&&("y"===b||!h.lockAxis)){var a=g-v,r=a<0?"up":"down",o=Math.abs(a),s=performance.now()-y,u=o/Math.max(s,1),l=o>=h.minDistance||u>.5;if(w)if(l)S=!0;else if(((e,t)=>!!e&&("down"===t?e.scrollTop>0:e.scrollTop+e.clientHeight<e.scrollHeight-1))(w,r)){if(!(("down"===r&&w.scrollTop<=50||"up"===r&&w.scrollTop+w.clientHeight>=w.scrollHeight-50)&&u>.3))return void(k=!0);S=!0}else S=!0;var d=!w||o>=h.edgeLeakThreshold;if(!E&&!k&&S&&d&&o>=h.minDistance){E=!0;var c=performance.now(),M={direction:"up"===r?"up":"down",distanceX:p-f,distanceY:a,absX:Math.abs(p-f),absY:o,duration:c-y,velocity:o/Math.max(c-y,1),startX:f,startY:v,endX:p,endY:g,startedAt:y,endedAt:c,originalEvent:e};t(M)}}}},D=e=>{if(e.pointerId===m)if(P(e))if(w)A();else if(E||k)A();else{var n,i=performance.now(),a=i-y,r=p-f,o=g-v,s=Math.abs(r),u=Math.abs(o),l="x"===(n=h.lockAxis&&b?b:"x"===h.axisHint?"x":"y"===h.axisHint?"y":s>=u?"x":"y")?s:u,d=a<=h.maxDuration,c=h.minDistance;if(w&&"y"===n&&S&&(c+=h.edgeLeakThreshold),d&&l>=c){var M;M="x"===n?r>0?"right":"left":o>0?"down":"up";var T=l/Math.max(a,1);t({direction:M,distanceX:r,distanceY:o,absX:s,absY:u,duration:a,velocity:T,startX:f,startY:v,endX:p,endY:g,startedAt:y,endedAt:i,originalEvent:e})}A()}else A()},A=()=>{m=null,b=null,y=0,w=null,S=!1,k=!1,E=!1},x=!!h.passiveListeners&&{passive:!0},C=h.passiveListeners?{passive:!0,capture:!0}:{capture:!0};e.addEventListener("pointerdown",T,C),e.addEventListener("pointermove",_,x),e.addEventListener("pointerup",D,x),e.addEventListener("pointercancel",D,x),e.addEventListener("lostpointercapture",D,x);return{destroy:()=>{e.removeEventListener("pointerdown",T,C),e.removeEventListener("pointermove",_,x),e.removeEventListener("pointerup",D,x),e.removeEventListener("pointercancel",D,x),e.removeEventListener("lostpointercapture",D,x),h.preventScrollOnSwipe&&(e.style.touchAction=c),A()},updateOptions:t=>{Object.assign(h,t),"boolean"==typeof t.preventScrollOnSwipe&&(t.preventScrollOnSwipe?e.style.touchAction="none":e.style.touchAction=c)}}}var zm,Bm,Hm,Um,Gm,Vm,Xm,Km,Ym,qm=e=>e,Jm=function(){function e(t,n,i){var a;return h(this,e),(a=d(this,e)).pages=[],a.currentOffset=0,a.formFactor=cu(),a.timeSpentOnPaywall=0,a.animation={transition:"none",direction:"forward"},a._originalBodyStyles={},a._originalDocumentStyles={},a.type=t,a.value=n,a.context=i,a.setPaywallData(),M(a,a)}return k(e,n),p(e,[{key:"setPaywallData",value:function(){var e=Au(this.value,this.type);this.paywall=e.paywall,this.campaign=e.campaign}},{key:"connectedCallback",value:function(){var t;x(e,"connectedCallback",this)([]),null!==(t=window.TVJS)&&void 0!==t&&t.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=this),document.addEventListener("keydown",this.handleKeyDownEvent.bind(this)),this._swipeHandler=$m(this,this.handleSwipeEvent.bind(this),{axisHint:"y",lockAxis:!0,minDistance:25,edgeLeakThreshold:15,preventScrollOnSwipe:!1,pointerTypes:["touch"]}),this.setOriginalStyles()}},{key:"disconnectedCallback",value:function(){var t;x(e,"disconnectedCallback",this)([]),Qr.clearLaunchId(),null!==(t=window.TVJS)&&void 0!==t&&t.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=document.body),document.removeEventListener("keydown",this.handleKeyDownEvent.bind(this)),Hu.getInstance().removeAllListeners(Pn),this.restoreStyles(),this._swipeHandler.destroy()}},{key:"setOriginalStyles",value:function(){"television"===this.formFactor&&(this._originalBodyStyles.overflow=document.body.style.overflow,document.body.style.overflow="hidden"),this._originalBodyStyles.background=document.body.style.background,"phone"===this.formFactor&&(this._originalBodyStyles["overscroll-behavior"]=document.body.style.overscrollBehavior?document.body.style.overscrollBehavior:null,this._originalDocumentStyles["overscroll-behavior"]=document.documentElement.style.overscrollBehavior?document.documentElement.style.overscrollBehavior:null,document.body.style.overscrollBehavior="none",document.documentElement.style.overscrollBehavior="none")}},{key:"restoreStyles",value:function(){Object.entries(this._originalBodyStyles).forEach((([e,t])=>{null!==t?document.body.style.setProperty(e,t):document.body.style.removeProperty(e)})),Object.entries(this._originalDocumentStyles).forEach((([e,t])=>{null!==t?document.documentElement.style.setProperty(e,t):document.documentElement.style.removeProperty(e)}))}},{key:"handleKeyDownEvent",value:function(e){!this.flow||10009!==e.keyCode&&"Backspace"!==e.key&&"GoBack"!==e.key||this.flow.triggerActions(um)}},{key:"handleSwipeEvent",value:function({direction:e}){var t;if("down"===e)null===(t=this.flow)||void 0===t||t.triggerActions("__swipe_down__");else if("up"===e){var n;null===(n=this.flow)||void 0===n||n.triggerActions("__swipe_up__")}}},{key:"firstUpdated",value:function(){this.timeSpentOnPaywall=Date.now(),Bs(this.campaign)&&(this.flow=Om.instance.presentFlow(this.campaign,this,this.context))}},{key:"getAnimationStyles",value:function(e){var t="backward"===this.animation.direction?-1:1;switch(this.animation.transition){case"verticalSlide":return`transform: translateY(${100*(e-this.currentOffset)*t}vh);`;case"slide":return`transform: translateX(${100*(e-this.currentOffset)*t}vw);`;case"fade":return`opacity: ${e===this.currentOffset?1:0};`;default:return""}}},{key:"updatePages",value:function(e){var t;return T((function(n){for(;;)switch(n.n){case 0:if(0!==this.pages.length&&"none"!==this.animation.transition){n.n=1;break}return this.pages=[e],n.a(2);case 1:if((null==(t=this.pages[this.pages.length-1])?void 0:t.id)!==e.id){n.n=2;break}return n.a(2);case 2:return this.pages=[t,e],this.currentOffset=0,n.n=3,l(this.updateComplete);case 3:requestAnimationFrame((()=>{this.currentOffset=1,setTimeout((()=>{this.pages=[e],this.currentOffset=0,this.paywall=e}),250)}));case 4:return n.a(2)}}),null,this,null,Promise)}},{key:"flowNavigateToScreen",value:function(e,t){var n,i;return T((function(a){for(;;)switch(a.n){case 0:return null!==(n=this.flow)&&void 0!==n&&n.previousFlowStep&&this.flow.executeLifecycle(this.flow.previousFlowStep,nm),this.animation=t,a.n=1,l(this.updatePages(e));case 1:null!==(i=this.flow)&&void 0!==i&&i.currentFlowStep&&this.flow.executeLifecycle(this.flow.currentFlowStep,tm);case 2:return a.a(2)}}),null,this,null,Promise)}},{key:"getSelectedSlideIndexForCurrentCarousel",value:function(){return Jh.getSelectedSlideIndex()}},{key:"renderFlow",value:function(){return"undefined"==typeof document?t(zm||(zm=qm``)):t(Bm||(Bm=qm`
|
|
2
2
|
<div class="nami-flow-container">
|
|
3
3
|
${0}
|
|
4
4
|
</div>
|