@namiml/web-sdk 3.4.12-dev.202609291805 → 3.4.12-dev.202609302156

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.
@@ -1,4 +1,4 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).NamiWebSdk={})}(this,function(e){"use strict";function t(e,t){this.v=e,this.k=t}function n(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 i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e){return new t(e,0)}function r(e,t,n){return t=v(t),b(e,g()?Reflect.construct(t,n||[],v(e).constructor):t.apply(e,n))}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 l=0;function u(e){return"__private_"+l+++"_"+e}function d(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,T(i.key),i)}}function c(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function h(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return n(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,t):void 0}}(e))||t){i&&(e=i);var a=0;return function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}}}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 m(){return m=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},m.apply(null,arguments)}function f(){return f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=v(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}},f.apply(null,arguments)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function p(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&&P(e,t)}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function(){return!!e})()}function y(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 b(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 i(e)}function w(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function r(n,i,a,r){var l=i&&i.prototype instanceof s?i:s,u=Object.create(l.prototype);return E(u,"_invoke",function(n,i,a){var r,s,l,u=0,d=a||[],c=!1,h={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return r=t,s=0,l=e,h.n=n,o}};function m(n,i){for(s=n,l=i,t=0;!c&&u&&!a&&t<d.length;t++){var a,r=d[t],m=h.p,f=r[2];n>3?(a=f===i)&&(l=r[(s=r[4])?5:(s=3,3)],r[4]=r[5]=e):r[0]<=m&&((a=n<2&&m<r[1])?(s=0,h.v=i,h.n=r[1]):m<f&&(a=n<3||r[0]>i||i>f)&&(r[4]=n,r[5]=i,h.n=f,s=0))}if(a||n>1)return o;throw c=!0,i}return function(a,d,f){if(u>1)throw TypeError("Generator is already running");for(c&&1===d&&m(d,f),s=d,l=f;(t=s<2?e:l)||!c;){r||(s?s<3?(s>1&&(h.n=-1),m(s,l)):h.n=l:h.v=l);try{if(u=2,r){if(s||(a="next"),t=r[a]){if(!(t=t.call(r,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=r.return)&&t.call(r),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);r=e}else if((t=(c=h.n<0)?l:n.call(i,h))!==o)break}catch(t){r=e,s=1,l=t}finally{u=1}}return{value:t,done:c}}}(n,a,r),!0),u}var o={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(E(t={},i,function(){return this}),t),c=u.prototype=s.prototype=Object.create(d);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,E(e,a,"GeneratorFunction")),e.prototype=Object.create(c),e}return l.prototype=u,E(c,"constructor",u),E(u,"constructor",l),l.displayName="GeneratorFunction",E(u,a,"GeneratorFunction"),E(c),E(c,a,"Generator"),E(c,i,function(){return this}),E(c,"toString",function(){return"[object Generator]"}),(w=function(){return{w:r,m:h}})()}function k(e,t,n,i,a){var r=function(e,t,n,i,a){return new S(w().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 S(e,n){function i(a,r,o,s){try{var l=e[a](r),u=l.value;return u instanceof t?n.resolve(u.v).then(function(e){i("next",e,o,s)},function(e){i("throw",e,o,s)}):n.resolve(u).then(function(e){l.value=e,o(l)},function(e){return i("throw",e,o,s)})}catch(e){s(e)}}var a;this.next||(E(S.prototype),E(S.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),E(this,"_invoke",function(e,t,r){function o(){return new n(function(t,n){i(e,r,t,n)})}return a=a?a.then(o,o):o()},!0)}function E(e,t,n,i){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}E=function(e,t,n,i){function r(t,n){E(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))},E(e,t,n,i)}function P(e,t){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},P(e,t)}function _(e,t,n,i){var a=f(v(e.prototype),t,n);return"function"==typeof a?function(e){return a.apply(n,e)}:a}function T(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 M(e){var t="function"==typeof Map?new Map:void 0;return M=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(g())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,t);var a=new(e.bind.apply(e,i));return n&&P(a,n.prototype),a}(e,arguments,v(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),P(n,e)},M(e)}var A,D,x,C,I,L,R,F,O,$,N,W,j=function(){return c(function e(t){o(this,e),this.ariaActiveDescendantElement=null,this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColIndexText="",this.ariaColSpan="",this.ariaControlsElements=null,this.ariaCurrent="",this.ariaDescribedByElements=null,this.ariaDescription="",this.ariaDetailsElements=null,this.ariaDisabled="",this.ariaErrorMessageElements=null,this.ariaExpanded="",this.ariaFlowToElements=null,this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLabelledByElements=null,this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaOwnsElements=null,this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRelevant="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowIndexText="",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(){}}])}(),B=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},z=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)},U={__proto__:null,enumerable:!0};Object.freeze(U);var H=($=function(){return c(function e(t,n={}){if(o(this,e),A.set(this,!1),D.set(this,!1),x.set(this,!1),C.set(this,!1),I.set(this,Date.now()),L.set(this,!1),R.set(this,void 0),F.set(this,void 0),O.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;B(this,A,!!a,"f"),B(this,D,!!i,"f"),B(this,x,!!r,"f"),B(this,R,`${t}`,"f"),B(this,F,null,"f"),B(this,O,!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(){B(this,C,!0,"f")}},{key:"target",get:function(){return z(this,F,"f")}},{key:"currentTarget",get:function(){return z(this,F,"f")}},{key:"srcElement",get:function(){return z(this,F,"f")}},{key:"type",get:function(){return z(this,R,"f")}},{key:"cancelable",get:function(){return z(this,A,"f")}},{key:"defaultPrevented",get:function(){return z(this,A,"f")&&z(this,C,"f")}},{key:"timeStamp",get:function(){return z(this,I,"f")}},{key:"composedPath",value:function(){return z(this,O,"f")?[z(this,F,"f")]:[]}},{key:"returnValue",get:function(){return!z(this,A,"f")||!z(this,C,"f")}},{key:"bubbles",get:function(){return z(this,D,"f")}},{key:"composed",get:function(){return z(this,x,"f")}},{key:"eventPhase",get:function(){return z(this,O,"f")?$.AT_TARGET:$.NONE}},{key:"cancelBubble",get:function(){return z(this,L,"f")},set:function(e){e&&B(this,L,!0,"f")}},{key:"stopPropagation",value:function(){B(this,L,!0,"f")}},{key:"isTrusted",get:function(){return!1}}])}(),A=new WeakMap,D=new WeakMap,x=new WeakMap,C=new WeakMap,I=new WeakMap,L=new WeakMap,R=new WeakMap,F=new WeakMap,O=new WeakMap,$.NONE=0,$.CAPTURING_PHASE=1,$.AT_TARGET=2,$.BUBBLING_PHASE=3,$);Object.defineProperties(H.prototype,{initEvent:U,stopImmediatePropagation:U,preventDefault:U,target:U,currentTarget:U,srcElement:U,type:U,cancelable:U,defaultPrevented:U,timeStamp:U,composedPath:U,returnValue:U,bubbles:U,composed:U,eventPhase:U,cancelBubble:U,stopPropagation:U,isTrusted:U});var G=(W=function(e){function t(e,n={}){var i,a;return o(this,t),a=r(this,t,[e,n]),N.set(a,void 0),B(a,N,null!==(i=null==n?void 0:n.detail)&&void 0!==i?i:null,"f"),a}return p(t,e),c(t,[{key:"initCustomEvent",value:function(e,t,n,i){throw new Error("Method not implemented.")}},{key:"detail",get:function(){return z(this,N,"f")}}])}(H),N=new WeakMap,W);Object.defineProperties(G.prototype,{detail:U});var V,K,X,Y,q=H,J=G;(V=function(){return c(function e(){o(this,e),this.STYLE_RULE=1,this.CHARSET_RULE=2,this.IMPORT_RULE=3,this.MEDIA_RULE=4,this.FONT_FACE_RULE=5,this.PAGE_RULE=6,this.NAMESPACE_RULE=10,this.KEYFRAMES_RULE=7,this.KEYFRAME_RULE=8,this.SUPPORTS_RULE=12,this.COUNTER_STYLE_RULE=11,this.FONT_FEATURE_VALUES_RULE=14,this.MARGIN_RULE=9,this.__parentStyleSheet=null,this.cssText=""},[{key:"parentRule",get:function(){return null}},{key:"parentStyleSheet",get:function(){return this.__parentStyleSheet}},{key:"type",get:function(){return 0}}])}()).STYLE_RULE=1,V.CHARSET_RULE=2,V.IMPORT_RULE=3,V.MEDIA_RULE=4,V.FONT_FACE_RULE=5,V.PAGE_RULE=6,V.NAMESPACE_RULE=10,V.KEYFRAMES_RULE=7,V.KEYFRAME_RULE=8,V.SUPPORTS_RULE=12,V.COUNTER_STYLE_RULE=11,V.FONT_FEATURE_VALUES_RULE=14,V.MARGIN_RULE=9,null!==(K=globalThis.Event)&&void 0!==K||(globalThis.Event=q),null!==(X=globalThis.CustomEvent)&&void 0!==X||(globalThis.CustomEvent=J);var Q=Symbol(),Z=e=>{var t;return"boolean"==typeof e?e:null!==(t=null==e?void 0:e.capture)&&void 0!==t&&t},ee={__proto__:null,enumerable:!0};Object.freeze(ee);var te=function(){return c(function e(){o(this,e),this.__eventListeners=new Map,this.__captureEventListeners=new Map},[{key:"addEventListener",value:function(e,t,n){var i;if(null!=t){var a=Z(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=Z(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.__resolveFullEventPath();!e.composed&&this.__host&&(t=t.slice(0,t.indexOf(this.__host)));var n=!1,i=!1,a=q.NONE,r=null,o=null,s=null,l=e.stopPropagation,u=e.stopImmediatePropagation;Object.defineProperties(e,{target:m({get:()=>null!=r?r:o},ee),srcElement:m({get:()=>e.target},ee),currentTarget:m({get:()=>s},ee),eventPhase:m({get:()=>a},ee),composedPath:m({value:()=>t},ee),stopPropagation:m({value:()=>{n=!0,l.call(e)}},ee),stopImmediatePropagation:m({value:()=>{i=!0,u.call(e)}},ee)});var d=(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=()=>(s=null,a=q.NONE,!e.defaultPrevented),f=t.slice().reverse();r=this.__host&&e.composed?null:this;for(var v,p=e=>{for(o=this;o.__host&&e.includes(o.__host);)o=o.__host},g=h(f);!(v=g()).done;){var y=v.value;r||o&&o!==y.__host||p(f.slice(f.indexOf(y))),s=y,a=y===e.target?q.AT_TARGET:q.CAPTURING_PHASE;var b=y.__captureEventListeners.get(e.type);if(b)for(var w,k=h(b);!(w=k()).done;){var S=w.value;if(d(S[0],S[1],b),i)return c()}if(n)return c()}var E=e.bubbles?t:[this];o=null;for(var P,_=h(E);!(P=_()).done;){var T=P.value;r||o&&T!==o.__host||p(E.slice(0,E.indexOf(T)+1)),s=T,a=T===e.target?q.AT_TARGET:q.BUBBLING_PHASE;var M=T.__eventListeners.get(e.type);if(M)for(var A,D=h(M);!(A=D()).done;){var x=A.value;if(d(x[0],x[1],M),i)return c()}if(n)return c()}return c()}},{key:"__resolveFullEventPath",value:function(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,oe,pe]}}])}(),ne=new WeakMap,ie=e=>{var t=ne.get(e);return void 0===t&&ne.set(e,t=new Map),t},ae=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t,[{key:"getRootNode",value:function(e){var t;if(null!=e&&e.composed)return se;var n=this.__host;return null!==(t=null==n?void 0:n.__shadowRoot)&&void 0!==t?t:se}}])}(te),re=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t,[{key:"adoptedStyleSheets",get:function(){return[]}},{key:"createTreeWalker",value:function(){return{}}},{key:"createTextNode",value:function(){return{}}},{key:"createElement",value:function(){return{}}}])}(ae),oe=new re,se=oe,le=function(e){function t(e){var n;if(o(this,t),n=r(this,t),e!==Q)throw new TypeError("Illegal constructor");return Object.assign(n,globalThis,{CustomElementRegistry:fe,customElements:ve,document:se,Document:re,Element:ue,EventTarget:te,HTMLElement:de,Node:ae,ShadowRoot:he,window:n,Window:le}),n}return p(t,e),c(t)}(ae),ue=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).__shadowRootMode=null,e.__shadowRoot=null,e.__internals=null,e}return p(t,e),c(t,[{key:"attributes",get:function(){return Array.from(ie(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){ie(this).set(e,String(t))}},{key:"removeAttribute",value:function(e){ie(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 ie(this).has(e)}},{key:"attachShadow",value:function(e){this.__shadowRootMode=e.mode;var t=new he(Q,e);return t.__eventTargetParent=this,t.__host=this,this.__shadowRoot=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 j(this);return this.__internals=e,e}},{key:"getAttribute",value:function(e){var t=ie(this).get(e);return null!=t?t:null}}])}(ae),de=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t)}(ue),ce=de,he=function(e){function t(e,n){var i;if(o(this,t),i=r(this,t),e!=e)throw new TypeError("Illegal constructor");return i.mode=n.mode,i}return p(t,e),c(t,[{key:"host",get:function(){return this.__host}}])}(ae);function me(){var e,t;return{promise:new Promise((n,i)=>{e=n,t=i}),resolve:e,reject:t}}null!==(Y=globalThis.litServerRoot)&&void 0!==Y||(globalThis.litServerRoot=Object.defineProperty(new ce,"localName",{get:()=>"lit-server-root"}));var fe=function(){return c(function e(){o(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:"initialize",value:function(e){throw new Error("customElements.initialize is not currently supported in SSR. Please file a bug if you need it.")}},{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 k(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=me(),this.__pendingWhenDefineds.set(e,n)),i.a(2,n.promise)}},null,this,null,Promise)}}])}(),ve=new fe,pe=new le(Q);"undefined"==typeof HTMLElement&&(globalThis.HTMLElement=ce);var ge=["action"],ye=null;var be={storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},getAllKeys:()=>[]},device:{getDeviceData:()=>({os_version:"",os_name:"",browser_name:"",browser_version:"",sdk_client:"",sdk_version:"",language:"en"}),getDeviceFormFactor:()=>"desktop",getDeviceScaleFactor:()=>1,generateUUID:()=>{throw new Error("No platform adapter registered — call registerPlatformAdapters() before Nami.configure()")},getScreenInfo:()=>({width:0,height:0,scale:1}),getLanguage:()=>"en"},ui:{createPaywall:()=>null,reRenderPaywall:()=>{},flowNavigateToScreen:()=>{}}};function we(){return null!=ye?ye:be}function ke(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 Se(e,t,n,i){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 Ee(e,t,n,i,a){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}"function"==typeof SuppressedError&&SuppressedError;var Pe;!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"}(Pe||(Pe={}));var _e,Te={},Me=Te.NAMI_SDK_VERSION,Ae=void 0===Me?"3.4.12":Me,De=Te.NAMI_SDK_PACKAGE_VERSION,xe=void 0===De?"3.4.12-dev.202609291805":De,Ce=Te.PLATFORM_ID_REQUIRED,Ie=void 0===Ce?"Platform ID is required":Ce,Le=Te.DEVICE_ID_REQUIRED,Re=void 0===Le?"Device ID is required":Le,Fe=Te.EXTERNAL_ID_REQUIRED,Oe=void 0===Fe?"External ID is required":Fe,$e=Te.SDK_NOT_INITIALIZED,Ne=void 0===$e?"SDK has not been initialized. Make sure to call Nami.configure() first!":$e,We=Te.CAMPAIGN_NOT_AVAILABLE,je=void 0===We?"Campaign is not available":We,Be=Te.FLOW_SCREENS_NOT_AVAILABLE,ze=void 0===Be?"Flow screens not available":Be,Ue=Te.UNABLE_TO_UPDATE_CDP_ID,He=void 0===Ue?"Unable to update CDP id in anonymous mode":Ue,Ge=Te.ANONYMOUS_MODE_ALREADY_ON,Ve=void 0===Ge?"Anonymous mode is already turned on.":Ge,Ke=Te.ANONYMOUS_MODE_ALREADY_OFF,Xe=void 0===Ke?"Anonymous mode is already turned off.":Ke,Ye=Te.DEVICE_ID_NOT_SET,qe=void 0===Ye?"Nami Device ID is not set":Ye,Je=Te.AUTH_DEVICE,Qe=void 0===Je?"nami_auth_device":Je,Ze=Te.NAMI_CONFIGURATION,et=void 0===Ze?"nami_configuration":Ze,tt=Te.NAMI_PROFILE,nt=void 0===tt?"nami_profile":tt,it=Te.API_CONFIG,at=void 0===it?"api_config":it,rt=Te.API_CAMPAIGN_RULES,ot=void 0===rt?"api_campaign_rules":rt,st=Te.API_PAYWALLS,lt=void 0===st?"api_paywalls":st,ut=Te.API_CAMPAIGN_SESSION_TIMESTAMP,dt=void 0===ut?"api_campaign_session_timestamp":ut,ct=Te.API_PRODUCTS,ht=void 0===ct?"api_products":ct,mt=Te.API_ACTIVE_ENTITLEMENTS,ft=void 0===mt?"api_active_entitlements":mt,vt=Te.SERVER_NAMI_ENTITLEMENTS,pt=void 0===vt?"server_active_entitlements":vt,gt=Te.INITIAL_APP_CONFIG,yt=void 0===gt?"initial_app_config":gt,bt=Te.INITIAL_CAMPAIGN_RULES,wt=void 0===bt?"initial_campaign_rules":bt,kt=Te.INITIAL_PAYWALLS,St=void 0===kt?"initial_paywalls":kt,Et=Te.INITIAL_PRODUCTS,Pt=void 0===Et?"initial_products":Et,_t=Te.LOCAL_NAMI_ENTITLEMENTS,Tt=void 0===_t?"local_active_entitlements":_t,Mt=Te.CUSTOMER_ATTRIBUTES_KEY_PREFIX,At=void 0===Mt?"nami_cmr_attributes_":Mt,Dt=Te.NAMI_CUSTOMER_JOURNEY_STATE,xt=void 0===Dt?"nami_customer_journey_state":Dt,Ct=Te.ANONYMOUS_MODE,It=void 0===Ct?"nami_anonymous_mode_v2":Ct,Lt=Te.ANONYMOUS_UUID,Rt=void 0===Lt?"nami_anonymous_uuid":Lt,Ft=Te.KEY_SESSION_COUNTER,Ot=void 0===Ft?"nami_session_counter":Ft,$t=Te.INITIAL_SESSION_COUNTER_VALUE,Nt=void 0===$t?1:$t,Wt=Te.NAMI_LAST_IMPRESSION_ID,jt=void 0===Wt?"nami_last_impression_id":Wt,Bt=Te.NAMI_PURCHASE_IMPRESSION_ID,zt=void 0===Bt?"nami_purchase_impression_id":Bt,Ut=Te.NAMI_LAUNCH_ID,Ht=void 0===Ut?"nami_launch_id":Ut,Gt=Te.NAMI_SESSION_ID,Vt=void 0===Gt?"nami_session_id":Gt,Kt=Te.NAMI_LANGUAGE_CODE,Xt=void 0===Kt?"nami_language_code":Kt,Yt=Te.NAMI_PURCHASE_CHANNEL,qt=void 0===Yt?"nami_purchase_channel":Yt,Jt=Te.API_VERSION,Qt=Te.BASE_URL_PATH,Zt=void 0===Qt?`sdk/${void 0===Jt?"v3":Jt}/platform`:Qt,en=Te.BASE_URL,tn=void 0===en?"https://app.namiml.com":en,nn=Te.BASE_STAGING_URL,an=void 0===nn?"https://app-staging.namiml.com":nn,rn=Te.CUSTOM_HOST_PREFIX,on=void 0===rn?"namiAPIHost=":rn,sn=Te.USE_STAGING_API,ln=void 0===sn?"useStagingAPI":sn,un=Te.EXTENDED_CLIENT_INFO_PREFIX,dn=void 0===un?"extendedClientInfo":un,cn=Te.EXTENDED_CLIENT_INFO_DELIMITER,hn=void 0===cn?":":cn,mn=Te.VALIDATE_PRODUCT_GROUPS,fn=void 0===mn?"validateProductGroups":mn,vn=Te.LOG_HTTP_REQUESTS,pn=void 0===vn?"logHTTPRequests":vn,gn=Te.LOG_HTTP_TRAFFIC,yn=void 0===gn?"logHTTPTraffic":gn,bn=Te.API_TRAFFIC_OBSERVER,wn=void 0===bn?"apiTrafficObserver":bn,kn=Te.STARTUP_TELEMETRY,Sn=void 0===kn?"startupTelemetry":kn,En=Te.SIMULATE_CONFIG_FETCH_FAILURE,Pn=void 0===En?"simulateConfigFetchFailure":En,_n=Te.SIMULATE_PAYWALL_FETCH_FAILURE,Tn=void 0===_n?"simulatePaywallFetchFailure":_n,Mn=Te.CAMPAIGN_CACHE_TTL_PREFIX,An=void 0===Mn?"campaignCacheTTL=":Mn,Dn=Te.API_MAX_CALLS_LIMIT,xn=void 0===Dn?2:Dn,Cn=Te.API_RETRY_DELAY_SEC,In=void 0===Cn?2:Cn,Ln=Te.API_TIMEOUT_LIMIT,Rn=void 0===Ln?2e4:Ln,Fn=Te.DEVICE_API_TIMEOUT_LIMIT,On=void 0===Fn?2e3:Fn,$n=Te.CONFIG_MAX_ATTEMPTS,Nn=void 0===$n?3:$n,Wn=Te.CONFIG_API_TIMEOUT_LIMIT,jn=void 0===Wn?1e4:Wn,Bn=Te.RESUME_THROTTLE_MS,zn=void 0===Bn?3e4:Bn,Un=Te.STATUS_BAD_REQUEST,Hn=void 0===Un?400:Un,Gn=Te.STATUS_NOT_FOUND,Vn=void 0===Gn?404:Gn,Kn=Te.STATUS_CONFLICT,Xn=void 0===Kn?409:Kn,Yn=Te.STATUS_INTERNAL_SERVER_ERROR,qn=void 0===Yn?500:Yn,Jn=Te.INITIAL_SUCCESS,Qn=void 0===Jn?"Initial success":Jn,Zn=Te.RECONFIG_SUCCESS,ei=void 0===Zn?"Reconfig success":Zn,ti=Te.ALREADY_CONFIGURED,ni=void 0===ti?"Already configured":ti,ii=Te.AVAILABLE_CAMPAIGNS_CHANGED,ai=void 0===ii?"AvailableCampaignsChanged":ii,ri=Te.PAYWALL_ACTION_EVENT,oi=void 0===ri?"PaywallActionEvent":ri,si=Te.AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED,li=void 0===si?"AvailableActiveEntitlementsChanged":si,ui=Te.CUSTOMER_JOURNEY_STATE_CHANGED,di=void 0===ui?"CustomerJourneyStateChanged":ui,ci=Te.SKU_TEXT_REGEX,hi=void 0===ci?/\$\{sku\.(\w+)(:\d+)?\}/g:ci,mi=Te.VAR_REGEX,fi=void 0===mi?/\$\{\s*(\w+(\.[a-zA-Z\d_:${}-]{0,99})*?)\s*}/g:mi,vi=Te.SMART_TEXT_PATTERN,pi=void 0===vi?"${":vi,gi=Te.LIQUID_VARIABLE_REGEX,yi=void 0===gi?/\${[A-Za-z0-9.]+}/g:gi,bi=[Qe,et,nt,at,ot,lt,dt,ht,ft,pt,yt,wt,St,Pt,Tt,xt,It,Rt,Ot,jt,zt,Ht,Vt,Xt,qt];e.LogLevel=void 0,(_e=e.LogLevel||(e.LogLevel={}))[_e.DEBUG=1]="DEBUG",_e[_e.INFO=2]="INFO",_e[_e.WARN=3]="WARN",_e[_e.ERROR=4]="ERROR";var wi={debug:e.LogLevel.DEBUG,info:e.LogLevel.INFO,warn:e.LogLevel.WARN,error:e.LogLevel.ERROR},ki=function(){return c(function t(){o(this,t),this.currentLogLevel=e.LogLevel.DEBUG,this.setLogger=t=>{this.currentLogLevel=t?wi[t]:e.LogLevel.WARN}},[{key:"debug",value:function(t,...n){this.shouldLog(e.LogLevel.DEBUG)&&console.debug(this.formatMessage(e.LogLevel.DEBUG,t,...n))}},{key:"info",value:function(t,...n){this.shouldLog(e.LogLevel.INFO)&&console.info(this.formatMessage(e.LogLevel.INFO,t,...n))}},{key:"warn",value:function(t,...n){this.shouldLog(e.LogLevel.WARN)&&console.warn(this.formatMessage(e.LogLevel.WARN,t,...n))}},{key:"error",value:function(t,...n){this.shouldLog(e.LogLevel.ERROR)&&console.error(this.formatMessage(e.LogLevel.ERROR,t,...n))}},{key:"shouldLog",value:function(e){return e>=this.currentLogLevel}},{key:"formatMessage",value:function(t,n,...i){var a=e.LogLevel[t];return`[${(new Date).toISOString()}] [${a}] ${n} ${i=i.map(e=>"object"==typeof e?JSON.stringify(e):e)}`}}])}(),Si=new ki;function Ei(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 Pi(e,t){return e===t||e!=e&&t!=t}function _i(e,t){for(var n=e.length;n--;)if(Pi(e[n][0],t))return n;return-1}var Ti=Array.prototype.splice;function Mi(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])}}Mi.prototype.clear=function(){this.__data__=[],this.size=0},Mi.prototype.delete=function(e){var t=this.__data__,n=_i(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ti.call(t,n,1),--this.size,!0)},Mi.prototype.get=function(e){var t=this.__data__,n=_i(t,e);return n<0?void 0:t[n][1]},Mi.prototype.has=function(e){return _i(this.__data__,e)>-1},Mi.prototype.set=function(e,t){var n=this.__data__,i=_i(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};var Ai="object"==typeof global&&global&&global.Object===Object&&global,Di="object"==typeof self&&self&&self.Object===Object&&self,xi=Ai||Di||Function("return this")(),Ci=xi.Symbol,Ii=Object.prototype,Li=Ii.hasOwnProperty,Ri=Ii.toString,Fi=Ci?Ci.toStringTag:void 0;var Oi=Object.prototype.toString;var $i=Ci?Ci.toStringTag:void 0;function Ni(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":$i&&$i in Object(e)?function(e){var t=Li.call(e,Fi),n=e[Fi];try{e[Fi]=void 0;var i=!0}catch(e){}var a=Ri.call(e);return i&&(t?e[Fi]=n:delete e[Fi]),a}(e):function(e){return Oi.call(e)}(e)}function Wi(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ji(e){if(!Wi(e))return!1;var t=Ni(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var Bi,zi=xi["__core-js_shared__"],Ui=(Bi=/[^.]+$/.exec(zi&&zi.keys&&zi.keys.IE_PROTO||""))?"Symbol(src)_1."+Bi:"";var Hi=Function.prototype.toString;function Gi(e){if(null!=e){try{return Hi.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var Vi=/^\[object .+?Constructor\]$/,Ki=Function.prototype,Xi=Object.prototype,Yi=Ki.toString,qi=Xi.hasOwnProperty,Ji=RegExp("^"+Yi.call(qi).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Qi(e){return!(!Wi(e)||(t=e,Ui&&Ui in t))&&(ji(e)?Ji:Vi).test(Gi(e));var t}function Zi(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Qi(n)?n:void 0}var ea=Zi(xi,"Map"),ta=Zi(Object,"create");var na=Object.prototype.hasOwnProperty;var ia=Object.prototype.hasOwnProperty;function aa(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 ra(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 oa(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])}}aa.prototype.clear=function(){this.__data__=ta?ta(null):{},this.size=0},aa.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},aa.prototype.get=function(e){var t=this.__data__;if(ta){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return na.call(t,e)?t[e]:void 0},aa.prototype.has=function(e){var t=this.__data__;return ta?void 0!==t[e]:ia.call(t,e)},aa.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ta&&void 0===t?"__lodash_hash_undefined__":t,this},oa.prototype.clear=function(){this.size=0,this.__data__={hash:new aa,map:new(ea||Mi),string:new aa}},oa.prototype.delete=function(e){var t=ra(this,e).delete(e);return this.size-=t?1:0,t},oa.prototype.get=function(e){return ra(this,e).get(e)},oa.prototype.has=function(e){return ra(this,e).has(e)},oa.prototype.set=function(e,t){var n=ra(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function sa(e){var t=this.__data__=new Mi(e);this.size=t.size}sa.prototype.clear=function(){this.__data__=new Mi,this.size=0},sa.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},sa.prototype.get=function(e){return this.__data__.get(e)},sa.prototype.has=function(e){return this.__data__.has(e)},sa.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Mi){var i=n.__data__;if(!ea||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new oa(i)}return n.set(e,t),this.size=n.size,this};function la(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new oa;++t<n;)this.add(e[t])}function ua(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 da(e,t){return e.has(t)}la.prototype.add=la.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},la.prototype.has=function(e){return this.__data__.has(e)};function ca(e,t,n,i,a,r){var o=1&n,s=e.length,l=t.length;if(s!=l&&!(o&&l>s))return!1;var u=r.get(e),d=r.get(t);if(u&&d)return u==t&&d==e;var c=-1,h=!0,m=2&n?new la:void 0;for(r.set(e,t),r.set(t,e);++c<s;){var f=e[c],v=t[c];if(i)var p=o?i(v,f,c,t,e,r):i(f,v,c,e,t,r);if(void 0!==p){if(p)continue;h=!1;break}if(m){if(!ua(t,function(e,t){if(!da(m,t)&&(f===e||a(f,e,n,i,r)))return m.push(t)})){h=!1;break}}else if(f!==v&&!a(f,v,n,i,r)){h=!1;break}}return r.delete(e),r.delete(t),h}var ha=xi.Uint8Array;function ma(e){var t=-1,n=Array(e.size);return e.forEach(function(e,i){n[++t]=[i,e]}),n}function fa(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var va=Ci?Ci.prototype:void 0,pa=va?va.valueOf:void 0;var ga=Array.isArray;var ya=Object.prototype.propertyIsEnumerable,ba=Object.getOwnPropertySymbols,wa=ba?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}(ba(e),function(t){return ya.call(e,t)}))}:function(){return[]};function ka(e){return null!=e&&"object"==typeof e}function Sa(e){return ka(e)&&"[object Arguments]"==Ni(e)}var Ea=Object.prototype,Pa=Ea.hasOwnProperty,_a=Ea.propertyIsEnumerable,Ta=Sa(function(){return arguments}())?Sa:function(e){return ka(e)&&Pa.call(e,"callee")&&!_a.call(e,"callee")};var Ma="object"==typeof e&&e&&!e.nodeType&&e,Aa=Ma&&"object"==typeof module&&module&&!module.nodeType&&module,Da=Aa&&Aa.exports===Ma?xi.Buffer:void 0,xa=(Da?Da.isBuffer:void 0)||function(){return!1},Ca=/^(?:0|[1-9]\d*)$/;function Ia(e,t){var n=typeof e;return!!(t=t??9007199254740991)&&("number"==n||"symbol"!=n&&Ca.test(e))&&e>-1&&e%1==0&&e<t}function La(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var Ra={};function Fa(e){return function(t){return e(t)}}Ra["[object Float32Array]"]=Ra["[object Float64Array]"]=Ra["[object Int8Array]"]=Ra["[object Int16Array]"]=Ra["[object Int32Array]"]=Ra["[object Uint8Array]"]=Ra["[object Uint8ClampedArray]"]=Ra["[object Uint16Array]"]=Ra["[object Uint32Array]"]=!0,Ra["[object Arguments]"]=Ra["[object Array]"]=Ra["[object ArrayBuffer]"]=Ra["[object Boolean]"]=Ra["[object DataView]"]=Ra["[object Date]"]=Ra["[object Error]"]=Ra["[object Function]"]=Ra["[object Map]"]=Ra["[object Number]"]=Ra["[object Object]"]=Ra["[object RegExp]"]=Ra["[object Set]"]=Ra["[object String]"]=Ra["[object WeakMap]"]=!1;var Oa="object"==typeof e&&e&&!e.nodeType&&e,$a=Oa&&"object"==typeof module&&module&&!module.nodeType&&module,Na=$a&&$a.exports===Oa&&Ai.process,Wa=function(){try{var e=$a&&$a.require&&$a.require("util").types;return e||Na&&Na.binding&&Na.binding("util")}catch(e){}}(),ja=Wa&&Wa.isTypedArray,Ba=ja?Fa(ja):function(e){return ka(e)&&La(e.length)&&!!Ra[Ni(e)]},za=Object.prototype.hasOwnProperty;function Ua(e,t){var n=ga(e),i=!n&&Ta(e),a=!n&&!i&&xa(e),r=!n&&!i&&!a&&Ba(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):[],l=s.length;for(var u in e)!za.call(e,u)||o&&("length"==u||a&&("offset"==u||"parent"==u)||r&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Ia(u,l))||s.push(u);return s}var Ha=Object.prototype;function Ga(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ha)}function Va(e,t){return function(n){return e(t(n))}}var Ka=Va(Object.keys,Object),Xa=Object.prototype.hasOwnProperty;function Ya(e){return null!=(t=e)&&La(t.length)&&!ji(t)?Ua(e):function(e){if(!Ga(e))return Ka(e);var t=[];for(var n in Object(e))Xa.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e);var t}function qa(e){return function(e,t,n){var i=t(e);return ga(e)?i:function(e,t){for(var n=-1,i=t.length,a=e.length;++n<i;)e[a+n]=t[n];return e}(i,n(e))}(e,Ya,wa)}var Ja=Object.prototype.hasOwnProperty;var Qa=Zi(xi,"DataView"),Za=Zi(xi,"Promise"),er=Zi(xi,"Set"),tr=Zi(xi,"WeakMap"),nr="[object Map]",ir="[object Promise]",ar="[object Set]",rr="[object WeakMap]",or="[object DataView]",sr=Gi(Qa),lr=Gi(ea),ur=Gi(Za),dr=Gi(er),cr=Gi(tr),hr=Ni;(Qa&&hr(new Qa(new ArrayBuffer(1)))!=or||ea&&hr(new ea)!=nr||Za&&hr(Za.resolve())!=ir||er&&hr(new er)!=ar||tr&&hr(new tr)!=rr)&&(hr=function(e){var t=Ni(e),n="[object Object]"==t?e.constructor:void 0,i=n?Gi(n):"";if(i)switch(i){case sr:return or;case lr:return nr;case ur:return ir;case dr:return ar;case cr:return rr}return t});var mr="[object Arguments]",fr="[object Array]",vr="[object Object]",pr=Object.prototype.hasOwnProperty;function gr(e,t,n,i,a,r){var o=ga(e),s=ga(t),l=o?fr:hr(e),u=s?fr:hr(t),d=(l=l==mr?vr:l)==vr,c=(u=u==mr?vr:u)==vr,h=l==u;if(h&&xa(e)){if(!xa(t))return!1;o=!0,d=!1}if(h&&!d)return r||(r=new sa),o||Ba(e)?ca(e,t,n,i,a,r):function(e,t,n,i,a,r,o){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!r(new ha(e),new ha(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Pi(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=ma;case"[object Set]":var l=1&i;if(s||(s=fa),e.size!=t.size&&!l)return!1;var u=o.get(e);if(u)return u==t;i|=2,o.set(e,t);var d=ca(s(e),s(t),i,a,r,o);return o.delete(e),d;case"[object Symbol]":if(pa)return pa.call(e)==pa.call(t)}return!1}(e,t,l,n,i,a,r);if(!(1&n)){var m=d&&pr.call(e,"__wrapped__"),f=c&&pr.call(t,"__wrapped__");if(m||f){var v=m?e.value():e,p=f?t.value():t;return r||(r=new sa),a(v,p,n,i,r)}}return!!h&&(r||(r=new sa),function(e,t,n,i,a,r){var o=1&n,s=qa(e),l=s.length;if(l!=qa(t).length&&!o)return!1;for(var u=l;u--;){var d=s[u];if(!(o?d in t:Ja.call(t,d)))return!1}var c=r.get(e),h=r.get(t);if(c&&h)return c==t&&h==e;var m=!0;r.set(e,t),r.set(t,e);for(var f=o;++u<l;){var v=e[d=s[u]],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 yr(e,t,n,i,a){return e===t||(null==e||null==t||!ka(e)&&!ka(t)?e!=e&&t!=t:gr(e,t,n,i,yr,a))}function br(e){return e==e&&!Wi(e)}function wr(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function kr(e){var t=function(e){for(var t=Ya(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,br(a)]}return t}(e);return 1==t.length&&t[0][2]?wr(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],l=e[s],u=o[1];if(o[2]){if(void 0===l&&!(s in e))return!1}else if(!yr(u,l,3,i,new sa))return!1}return!0}(n,0,t)}}function Sr(e){return"symbol"==typeof e||ka(e)&&"[object Symbol]"==Ni(e)}var Er=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pr=/^\w*$/;function _r(e,t){if(ga(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Sr(e))||(Pr.test(e)||!Er.test(e)||null!=t&&e in Object(t))}function Tr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");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(Tr.Cache||oa),n}Tr.Cache=oa;var Mr,Ar,Dr,xr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Cr=/\\(\\)?/g,Ir=(Mr=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(xr,function(e,n,i,a){t.push(i?a.replace(Cr,"$1"):n||e)}),t},Ar=Tr(Mr,function(e){return 500===Dr.size&&Dr.clear(),e}),Dr=Ar.cache,Ar);var Lr=Ci?Ci.prototype:void 0,Rr=Lr?Lr.toString:void 0;function Fr(e){if("string"==typeof e)return e;if(ga(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,Fr)+"";if(Sr(e))return Rr?Rr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Or(e,t){return ga(e)?e:_r(e,t)?[e]:Ir(function(e){return null==e?"":Fr(e)}(e))}function $r(e){if("string"==typeof e||Sr(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Nr(e,t){for(var n=0,i=(t=Or(t,e)).length;null!=e&&n<i;)e=e[$r(t[n++])];return n&&n==i?e:void 0}function Wr(e,t){return null!=e&&t in Object(e)}function jr(e,t){return null!=e&&function(e,t,n){for(var i=-1,a=(t=Or(t,e)).length,r=!1;++i<a;){var o=$r(t[i]);if(!(r=null!=e&&n(e,o)))break;e=e[o]}return r||++i!=a?r:!!(a=null==e?0:e.length)&&La(a)&&Ia(o,a)&&(ga(e)||Ta(e))}(e,t,Wr)}function Br(e,t){return _r(e)&&br(t)?wr($r(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?jr(n,e):yr(t,i,3)}}function zr(e){return e}function Ur(e){return _r(e)?(t=$r(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Nr(t,e)}}(e);var t}function Hr(e){return e!=e}function Gr(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,Hr,n)}(e,t,0)>-1}var Vr=er&&1/fa(new er([,-0]))[1]==1/0?function(e){return new er(e)}:function(){};function Kr(e,t){return e&&e.length?function(e,t,n){var i=-1,a=Gr,r=e.length,o=!0,s=[],l=s;if(r>=200){var u=t?null:Vr(e);if(u)return fa(u);o=!1,a=da,l=new la}else l=t?[]:s;e:for(;++i<r;){var d=e[i],c=t?t(d):d;if(d=0!==d?d:0,o&&c==c){for(var h=l.length;h--;)if(l[h]===c)continue e;t&&l.push(c),s.push(d)}else a(l,c,n)||(l!==s&&l.push(c),s.push(d))}return s}(e,"function"==typeof(n=t)?n:null==n?zr:"object"==typeof n?ga(n)?Br(n[0],n[1]):kr(n):Ur(n)):[];var n}var Xr="api_paywall_body:",Yr="api_paywall_body_meta:",qr=function(){return c(function e(t=()=>we().storage,n=500){o(this,e),this.storage=t,this.maxEntries=n,this.memory=null,this.index=null},[{key:"count",get:function(){return this.memory?this.memory.size:this.loadIndex().size}},{key:"evaluateTtl",value:function(e,t=Date.now()){if(0===e){if(this.memory)return;return this.dropPersisted([...this.loadIndex().keys()]),void(this.memory=new Map)}if(this.memory=null,null!==e){var n=[...this.loadIndex().values()].filter(n=>Jr(n,e,t));this.dropPersisted(n.map(e=>e.url))}}},{key:"validEntry",value:function(e,t,n=Date.now()){var i;if(this.memory)return null!==(i=this.memory.get(e))&&void 0!==i?i:null;var a=this.loadIndex().get(e);if(!a)return null;if(null!==t&&t>0&&Jr(a,t,n))return this.dropPersisted([e]),null;var r=this.read(Xr+e);return null===r?(this.dropPersisted([e]),null):{meta:a,body:r}}},{key:"bodyFor",value:function(e){var t,n;return this.memory?null!==(t=null===(n=this.memory.get(e))||void 0===n?void 0:n.body)&&void 0!==t?t:null:this.read(Xr+e)}},{key:"store",value:function(e,t,n,i=Date.now()){var a=m({url:e,savedAt:i},t?{contentHash:t}:{});if(this.memory)return this.memory.set(e,{meta:a,body:n}),!0;var r=this.loadIndex(),o=JSON.stringify(a);return this.write(Xr+e,n)&&this.write(Yr+e,o)?(r.set(e,a),!0):(Si.warn(`Paywall body cache: could not store ${e}; it will be fetched next time`),this.dropPersisted([e]),!1)}},{key:"seedIfAbsent",value:function(e,t,n,i=Date.now()){return!(this.memory?this.memory.has(e):this.loadIndex().has(e))&&this.store(e,t,n,i)}},{key:"remove",value:function(e){this.memory?this.memory.delete(e):this.dropPersisted([e])}},{key:"reconcile",value:function(e){var t=this.memory?[...this.memory.values()].map(e=>e.meta):[...this.loadIndex().values()],n=t.filter(t=>!e.has(t.url)).map(e=>e.url),i=t.filter(t=>e.has(t.url)).sort((e,t)=>e.savedAt-t.savedAt);[...n,...i.slice(0,Math.max(0,i.length-this.maxEntries)).map(e=>e.url)].forEach(e=>this.remove(e))}},{key:"purgeAll",value:function(){var e;this.dropPersisted([...this.loadIndex().keys()]),null===(e=this.memory)||void 0===e||e.clear()}},{key:"loadIndex",value:function(){if(this.index)return this.index;var e;this.index=new Map;try{e=this.storage().getAllKeys()}catch(e){return Si.warn(`Paywall body cache: storage unavailable, caching nothing (${e})`),this.index}for(var t,n=new Set(e.filter(e=>e.startsWith(Xr)).map(e=>e.slice(17))),i=[],a=h(e);!(t=a()).done;){var r=t.value;if(r.startsWith(Yr)){var o=r.slice(22),s=Qr(this.read(r));(null==s?void 0:s.url)===o&&n.has(o)?this.index.set(o,s):i.push(o),n.delete(o)}}return this.dropPersisted([...i,...n]),this.index}},{key:"dropPersisted",value:function(e){for(var t,n=h(e);!(t=n()).done;){var i,a=t.value;null===(i=this.index)||void 0===i||i.delete(a),this.removeKey(Yr+a),this.removeKey(Xr+a)}}},{key:"read",value:function(e){try{return this.storage().getItem(e)}catch(e){return null}}},{key:"write",value:function(e,t){try{this.storage().setItem(e,t)}catch(e){return!1}return this.read(e)===t}},{key:"removeKey",value:function(e){try{this.storage().removeItem(e)}catch(e){}}}])}();function Jr(e,t,n){return(n-e.savedAt)/1e3>=t}function Qr(e){if(null===e)return null;try{var t=JSON.parse(e);return"string"==typeof(null==t?void 0:t.url)&&"number"==typeof(null==t?void 0:t.savedAt)?t:null}catch(e){return null}}var Zr=new qr,eo=function(){return c(function e(){o(this,e),this.memoryStore={}},[{key:"storage",get:function(){return we().storage}},{key:"setDevice",value:function(e){this.setItem(Qe,e)}},{key:"getDevice",value:function(){return this.getItem(Qe)}},{key:"resetDevice",value:function(){this.resetItem(Qe)}},{key:"getAnonymousMode",value:function(){return this.getItem(It)||!1}},{key:"setAnonymousMode",value:function(e){this.setItem(It,e)}},{key:"clearAnonymousMode",value:function(){this.resetItem(It)}},{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(Xt,e||"en")}},{key:"getLanguageCode",value:function(){return this.getItem(Xt)||"en"}},{key:"setCampaignRules",value:function(e,t){e!==wt?e!==ot||0!==this.getCampaignCacheTtl()?this.setItem(e,t):this.memoryStore[ot]=JSON.stringify(t):this.memoryStore[wt]=JSON.stringify(t)}},{key:"getCampaignRules",value:function(e){if(e===wt)return this.memoryStore[wt]?JSON.parse(this.memoryStore[wt]):null;if(e===ot){var t=this.memoryStore[ot];if(null!=t)return JSON.parse(t);var n=this.getItem(ot);if(null===n)return null;if("string"==typeof n)try{n=JSON.parse(n)}catch(e){return n}return this.isLegacyTimestampedCache(n)?n.data:n}return this.getItem(e)}},{key:"setPaywalls",value:function(e,t){e!==St?e!==lt||0!==this.getCampaignCacheTtl()?this.setItem(e,t):this.memoryStore[lt]=JSON.stringify(t):this.memoryStore[St]=JSON.stringify(t)}},{key:"setApiPaywallsFromBodyCache",value:function(e){var t={bodyCacheUrls:e};0!==this.getCampaignCacheTtl()?this.setItem(lt,t):this.memoryStore[lt]=JSON.stringify(t)}},{key:"getPaywalls",value:function(e){if(e===St)return this.memoryStore[St]?JSON.parse(this.memoryStore[St]):null;if(e===lt){var t=this.memoryStore[lt];if(null!=t){var n=JSON.parse(t);return to(n)?no(n.bodyCacheUrls):n}var i=this.getItem(lt);if(null===i)return null;if("string"==typeof i)try{i=JSON.parse(i)}catch(e){return i}return to(i)?no(i.bodyCacheUrls):this.isLegacyTimestampedCache(i)?i.data:i}return 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(ht))&&void 0!==e?e:[];return Kr(Ei([...null!==(t=this.getItem(Pt))&&void 0!==t?t:[],...n]),"sku_ref_id")}},{key:"setNamiConfig",value:function(e){this.setItem(et,e)}},{key:"getNamiConfig",value:function(){return this.getItem(et)}},{key:"setCustomerAttribute",value:function(e,t){this.setItem(At+e,t)}},{key:"getCustomerAttribute",value:function(e){return this.getItem(At+e)}},{key:"getAllCustomerAttributes",value:function(){return this.storage.getAllKeys().map(e=>[e,this.storage.getItem(e)]).filter(([e])=>e.includes(At)).map(([e,t])=>e.replace(At,"")+":"+t)}},{key:"getAllCustomerAttributesKeys",value:function(){return this.storage.getAllKeys().filter(e=>e.includes(At)).map(e=>e.replace(At,""))}},{key:"getAllCustomerAttributesMap",value:function(){var e={};return this.getAllCustomerAttributesKeys().forEach(t=>{var n=this.getCustomerAttribute(t);null!=n&&(e[t]=String(n))}),e}},{key:"clearCustomerAttribute",value:function(e){var t=At+e,n=this.getItem(t);return n&&this.resetItem(t),!!n}},{key:"clearAllCustomerAttributes",value:function(){this.storage.getAllKeys().filter(e=>e.includes(At)).map(e=>this.resetItem(e))}},{key:"setNamiProfile",value:function(e){this.setItem(nt,e)}},{key:"getNamiProfile",value:function(){return this.getItem(nt)}},{key:"removeNamiProfile",value:function(){this.resetItem(nt)}},{key:"setCustomerJourneyState",value:function(e){this.setItem(xt,e)}},{key:"getCustomerJourneyState",value:function(){return this.getItem(xt)}},{key:"setSessionCounter",value:function(){var e=this.getItem(Ot),t=e?parseInt(e):Nt||Nt;this.setItem(Ot,t+1)}},{key:"getSessionCounter",value:function(){var e=this.getItem(Ot);return e?parseInt(e):Nt}},{key:"setLastImpressionId",value:function(e){this.setItem(jt,e)}},{key:"getLastImpressionId",value:function(){var e;return null!==(e=this.getItem(jt))&&void 0!==e?e:""}},{key:"setPurchaseImpression",value:function(){var e,t=null!==(e=this.getLastImpressionId())&&void 0!==e?e:"";this.setItem(zt,t)}},{key:"getPurchaseImpression",value:function(){var e;return null!==(e=this.getItem(zt))&&void 0!==e?e:""}},{key:"setSessionId",value:function(e){e&&this.setItem(Vt,e)}},{key:"getSessionId",value:function(){var e;return null!==(e=this.getItem(Vt))&&void 0!==e?e:""}},{key:"clearSessionId",value:function(){this.resetItem(Vt)}},{key:"setLaunchId",value:function(e){e&&this.setItem(Ht,e)}},{key:"getLaunchId",value:function(){var e;return null!==(e=this.getItem(Ht))&&void 0!==e?e:""}},{key:"clearLaunchId",value:function(){this.resetItem(Ht)}},{key:"setPurchaseChannel",value:function(e){e&&this.setItem(qt,e)}},{key:"getPurchaseChannel",value:function(){return this.getItem(qt)}},{key:"getAnonymousUUID",value:function(){return this.getItem(Rt)}},{key:"setAnonymousUUID",value:function(e){this.setItem(Rt,e)}},{key:"clearAnonymousUUID",value:function(){this.resetItem(Rt)}},{key:"setApiCampaignSessionTimestamp",value:function(){this.setItem(dt,Date.now())}},{key:"getApiCampaignSessionTimestamp",value:function(){return this.getItem(dt)}},{key:"purgeApiCampaignCache",value:function(){this.resetItem(lt),this.resetItem(ot),this.resetItem(dt)}},{key:"getCampaignCacheTtl",value:function(){var e,t,n=null===(e=this.getNamiConfig())||void 0===e||null===(e=e.namiCommands)||void 0===e?void 0:e.filter(e=>e.startsWith(An)).map(e=>e.slice(An.length)).find(e=>/^\d+$/.test(e));if(void 0!==n)return parseInt(n,10);var i=this.getAppConfig(at)||this.getAppConfig(yt);return null!==(t=null==i?void 0:i.campaign_cache_ttl)&&void 0!==t?t:null}},{key:"isLegacyTimestampedCache",value:function(e){return"object"==typeof e&&null!==e&&"cachedAt"in e&&"data"in e}},{key:"setItem",value:function(e,t){var n;try{n=JSON.stringify(t)}catch(t){return void Si.error(`Serialization failed for ${e}`,t)}try{this.storage.setItem(e,n)}catch(t){Si.error("Error setting item in localStorage:",t),this.resetItem(e),this.memoryStore[e]=n}}},{key:"getItem",value:function(e){try{var t=this.storage.getItem(e);if(null!==t)return JSON.parse(t)}catch(t){Si.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{this.storage.removeItem(e)}catch(t){Si.error("Error removing item from localStorage:",e,": ",t)}delete this.memoryStore[e]}},{key:"clearAll",value:function(){bi.forEach(e=>this.resetItem(e)),this.clearAllCustomerAttributes(),this.memoryStore={}}},{key:"clear",value:function(){try{this.storage.clear()}catch(e){Si.error("Error clearing localStorage:",e)}this.memoryStore={}}}])}();function to(e){return"object"==typeof e&&null!==e&&Array.isArray(e.bodyCacheUrls)}function no(e){for(var t,n=[],i=h(e);!(t=i()).done;){var a=t.value,r=Zr.bodyFor(a);if(null!==r)try{n.push(JSON.parse(r))}catch(e){Zr.remove(a)}}return n}var io=new eo,ao=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t,[n])).statusCode=e,i.status=e,i.message=`RetryLimitExceededError: ${i.message}`,i}return p(t,e),c(t)}(M(Error)),ro=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t)}(M(Error)),oo=function(e){function t(){var e;return o(this,t),(e=r(this,t)).status=409,e.name="ConflictError",e.message="ConflictError: Server responded with conflict",e}return p(t,e),c(t)}(ro),so=function(e){function t(){return o(this,t),r(this,t,[Ne])}return p(t,e),c(t)}(M(Error)),lo=function(e){function t(){return o(this,t),r(this,t,[Ie])}return p(t,e),c(t)}(M(Error)),uo=function(e){function t(){return o(this,t),r(this,t,[Re])}return p(t,e),c(t)}(M(Error)),co=function(e){function t(){return o(this,t),r(this,t,[Oe])}return p(t,e),c(t)}(M(Error)),ho=function(e){function t(){return o(this,t),r(this,t,[je])}return p(t,e),c(t)}(M(Error)),mo=function(e){function t(){return o(this,t),r(this,t,[ze])}return p(t,e),c(t)}(M(Error)),fo=function(e){function t(){return o(this,t),r(this,t,[Ve])}return p(t,e),c(t)}(M(Error)),vo=function(e){function t(){return o(this,t),r(this,t,[Xe])}return p(t,e),c(t)}(M(Error)),po=function(e){function t(){return o(this,t),r(this,t,[Xe])}return p(t,e),c(t)}(M(Error)),go=function(e){function t(){return o(this,t),r(this,t,[He])}return p(t,e),c(t)}(M(Error)),yo=function(e){function t(e){var n;return o(this,t),(n=r(this,t,[e])).message=`BadRequestError: ${n.message}`,n}return p(t,e),c(t)}(ro),bo=function(e){function t(e){var n;return o(this,t),(n=r(this,t,[e])).message=`NotFoundError: ${n.message}`,n}return p(t,e),c(t)}(ro),wo=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t,[n])).statusCode=e,i.message=`ClientError: ${i.message}`,i}return p(t,e),c(t)}(ro),ko=function(e){function t(e){var n;return o(this,t),(n=r(this,t,[e])).message=`ServerError: ${n.message}`,n}return p(t,e),c(t)}(ro),So=(e,t)=>{if(e==Hn)throw new yo(t);if(e==Vn)throw new bo(t);if(e==Xn)throw new oo;if(e>Hn&&e<qn)throw new wo(e,t);if(e>=qn)throw new ko(t)};function Eo(e){for(var t=e.length;--t>=0;)e[t]=0}Eo(new Array(576)),Eo(new Array(60)),Eo(new Array(512)),Eo(new Array(256)),Eo(new Array(29)),Eo(new Array(30));var Po=(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},_o=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})()),To=(e,t,n,i)=>{var a=_o,r=i+n;e^=-1;for(var o=i;o<r;o++)e=e>>>8^a[255&(e^t[o])];return-1^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"},Ao=0,Do=4,xo=5,Co=6,Io=0,Lo=1,Ro=2,Fo=-2,Oo=-3,$o=-4,No=-5,Wo=8,jo=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Bo=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)jo(n,i)&&(e[i]=n[i])}}return e},zo=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 l=e[r];a.set(l,o),o+=l.length}return a},Uo=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Uo=!1}for(var Ho=new Uint8Array(256),Go=0;Go<256;Go++)Ho[Go]=Go>=252?6:Go>=248?5:Go>=240?4:Go>=224?3:Go>=192?2:1;Ho[254]=Ho[254]=1;var Vo=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},Ko=(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=Ho[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&&Uo)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)},Xo=(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+Ho[e[n]]>t?n:t};var Yo=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},qo=16209,Jo=function(e,t){var n,i,a,r,o,s,l,u,d,c,h,m,f,v,p,g,y,b,w,k,S,E,P,_,T=e.state;n=e.next_in,P=e.input,i=n+(e.avail_in-5),a=e.next_out,_=e.output,r=a-(t-e.avail_out),o=a+(e.avail_out-257),s=T.dmax,l=T.wsize,u=T.whave,d=T.wnext,c=T.window,h=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&&(h+=P[n++]<<m,m+=8,h+=P[n++]<<m,m+=8),y=f[h&p];t:for(;;){if(h>>>=b=y>>>24,m-=b,0===(b=y>>>16&255))_[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=qo;break e}y=f[(65535&y)+(h&(1<<b)-1)];continue t}for(w=65535&y,(b&=15)&&(m<b&&(h+=P[n++]<<m,m+=8),w+=h&(1<<b)-1,h>>>=b,m-=b),m<15&&(h+=P[n++]<<m,m+=8,h+=P[n++]<<m,m+=8),y=v[h&g];;){if(h>>>=b=y>>>24,m-=b,16&(b=y>>>16&255)){if(k=65535&y,m<(b&=15)&&(h+=P[n++]<<m,(m+=8)<b&&(h+=P[n++]<<m,m+=8)),(k+=h&(1<<b)-1)>s){e.msg="invalid distance too far back",T.mode=qo;break e}if(h>>>=b,m-=b,k>(b=a-r)){if((b=k-b)>u&&T.sane){e.msg="invalid distance too far back",T.mode=qo;break e}if(S=0,E=c,0===d){if(S+=l-b,b<w){w-=b;do{_[a++]=c[S++]}while(--b);S=a-k,E=_}}else if(d<b){if(S+=l+d-b,(b-=d)<w){w-=b;do{_[a++]=c[S++]}while(--b);if(S=0,d<w){w-=b=d;do{_[a++]=c[S++]}while(--b);S=a-k,E=_}}}else if(S+=d-b,b<w){w-=b;do{_[a++]=c[S++]}while(--b);S=a-k,E=_}for(;w>2;)_[a++]=E[S++],_[a++]=E[S++],_[a++]=E[S++],w-=3;w&&(_[a++]=E[S++],w>1&&(_[a++]=E[S++]))}else{S=a-k;do{_[a++]=_[S++],_[a++]=_[S++],_[a++]=_[S++],w-=3}while(w>2);w&&(_[a++]=_[S++],w>1&&(_[a++]=_[S++]))}break}if(64&b){e.msg="invalid distance code",T.mode=qo;break e}y=v[(65535&y)+(h&(1<<b)-1)]}}break}}while(n<i&&a<o);n-=w=m>>3,h&=(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=h,T.bits=m},Qo=15,Zo=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]),es=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]),ts=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]),ns=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]),is=(e,t,n,i,a,r,o,s)=>{var l,u,d,c,h,m,f,v,p,g=s.bits,y=0,b=0,w=0,k=0,S=0,E=0,P=0,_=0,T=0,M=0,A=null,D=new Uint16Array(16),x=new Uint16Array(16),C=null;for(y=0;y<=Qo;y++)D[y]=0;for(b=0;b<i;b++)D[t[n+b]]++;for(S=g,k=Qo;k>=1&&0===D[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===D[w];w++);for(S<w&&(S=w),_=1,y=1;y<=Qo;y++)if(_<<=1,(_-=D[y])<0)return-1;if(_>0&&(0===e||1!==k))return-1;for(x[1]=0,y=1;y<Qo;y++)x[y+1]=x[y]+D[y];for(b=0;b<i;b++)0!==t[n+b]&&(o[x[t[n+b]]++]=b);if(0===e?(A=C=o,m=20):1===e?(A=Zo,C=es,m=257):(A=ts,C=ns,m=0),M=0,b=0,y=w,h=r,E=S,P=0,d=-1,c=(T=1<<S)-1,1===e&&T>852||2===e&&T>592)return 1;for(;;){f=y-P,o[b]+1<m?(v=0,p=o[b]):o[b]>=m?(v=C[o[b]-m],p=A[o[b]-m]):(v=96,p=0),l=1<<y-P,w=u=1<<E;do{a[h+(M>>P)+(u-=l)]=f<<24|v<<16|p}while(0!==u);for(l=1<<y-1;M&l;)l>>=1;if(0!==l?(M&=l-1,M+=l):M=0,b++,0===--D[y]){if(y===k)break;y=t[n+o[b]]}if(y>S&&(M&c)!==d){for(0===P&&(P=S),h+=w,_=1<<(E=y-P);E+P<k&&!((_-=D[E+P])<=0);)E++,_<<=1;if(T+=1<<E,1===e&&T>852||2===e&&T>592)return 1;a[d=M&c]=S<<24|E<<16|h-r}}return 0!==M&&(a[h+M]=y-P<<24|64<<16),s.bits=S,0},as=Do,rs=xo,os=Co,ss=Io,ls=Lo,us=Ro,ds=Fo,cs=Oo,hs=$o,ms=No,fs=Wo,vs=16180,ps=16190,gs=16191,ys=16192,bs=16194,ws=16199,ks=16200,Ss=16206,Es=16209,Ps=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function _s(){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 Ts,Ms,As=e=>{if(!e)return 1;var t=e.state;return!t||t.strm!==e||t.mode<vs||t.mode>16211?1:0},Ds=e=>{if(As(e))return ds;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=vs,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,ss},xs=e=>{if(As(e))return ds;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Ds(e)},Cs=(e,t)=>{var n;if(As(e))return ds;var i=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?ds:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,xs(e))},Is=(e,t)=>{if(!e)return ds;var n=new _s;e.state=n,n.strm=e,n.window=null,n.mode=vs;var i=Cs(e,t);return i!==ss&&(e.state=null),i},Ls=!0,Rs=e=>{if(Ls){Ts=new Int32Array(512),Ms=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(is(1,e.lens,0,288,Ts,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;is(2,e.lens,0,32,Ms,0,e.work,{bits:5}),Ls=!1}e.lencode=Ts,e.lenbits=9,e.distcode=Ms,e.distbits=5},Fs=(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},Os=(e,t)=>{var n,i,a,r,o,s,l,u,d,c,h,m,f,v,p,g,y,b,w,k,S,E,P,_,T=0,M=new Uint8Array(4),A=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(As(e)||!e.output||!e.input&&0!==e.avail_in)return ds;(n=e.state).mode===gs&&(n.mode=ys),o=e.next_out,a=e.output,l=e.avail_out,r=e.next_in,i=e.input,s=e.avail_in,u=n.hold,d=n.bits,c=s,h=l,E=ss;e:for(;;)switch(n.mode){case vs:if(0===n.wrap){n.mode=ys;break}for(;d<16;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}if(2&n.wrap&&35615===u){0===n.wbits&&(n.wbits=15),n.check=0,M[0]=255&u,M[1]=u>>>8&255,n.check=To(n.check,M,2,0),u=0,d=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",n.mode=Es;break}if((15&u)!==fs){e.msg="unknown compression method",n.mode=Es;break}if(d-=4,S=8+(15&(u>>>=4)),0===n.wbits&&(n.wbits=S),S>15||S>n.wbits){e.msg="invalid window size",n.mode=Es;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&u?16189:gs,u=0,d=0;break;case 16181:for(;d<16;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}if(n.flags=u,(255&n.flags)!==fs){e.msg="unknown compression method",n.mode=Es;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=Es;break}n.head&&(n.head.text=u>>8&1),512&n.flags&&4&n.wrap&&(M[0]=255&u,M[1]=u>>>8&255,n.check=To(n.check,M,2,0)),u=0,d=0,n.mode=16182;case 16182:for(;d<32;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}n.head&&(n.head.time=u),512&n.flags&&4&n.wrap&&(M[0]=255&u,M[1]=u>>>8&255,M[2]=u>>>16&255,M[3]=u>>>24&255,n.check=To(n.check,M,4,0)),u=0,d=0,n.mode=16183;case 16183:for(;d<16;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}n.head&&(n.head.xflags=255&u,n.head.os=u>>8),512&n.flags&&4&n.wrap&&(M[0]=255&u,M[1]=u>>>8&255,n.check=To(n.check,M,2,0)),u=0,d=0,n.mode=16184;case 16184:if(1024&n.flags){for(;d<16;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}n.length=u,n.head&&(n.head.extra_len=u),512&n.flags&&4&n.wrap&&(M[0]=255&u,M[1]=u>>>8&255,n.check=To(n.check,M,2,0)),u=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=To(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=To(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=To(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--,u+=i[r++]<<d,d+=8}if(4&n.wrap&&u!==(65535&n.check)){e.msg="header crc mismatch",n.mode=Es;break}u=0,d=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=gs;break;case 16189:for(;d<32;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}e.adler=n.check=Ps(u),u=0,d=0,n.mode=ps;case ps:if(0===n.havedict)return e.next_out=o,e.avail_out=l,e.next_in=r,e.avail_in=s,n.hold=u,n.bits=d,us;e.adler=n.check=1,n.mode=gs;case gs:if(t===rs||t===os)break e;case ys:if(n.last){u>>>=7&d,d-=7&d,n.mode=Ss;break}for(;d<3;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}switch(n.last=1&u,d-=1,3&(u>>>=1)){case 0:n.mode=16193;break;case 1:if(Rs(n),n.mode=ws,t===os){u>>>=2,d-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=Es}u>>>=2,d-=2;break;case 16193:for(u>>>=7&d,d-=7&d;d<32;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}if((65535&u)!=(u>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Es;break}if(n.length=65535&u,u=0,d=0,n.mode=bs,t===os)break e;case bs:n.mode=16195;case 16195:if(m=n.length){if(m>s&&(m=s),m>l&&(m=l),0===m)break e;a.set(i.subarray(r,r+m),o),s-=m,r+=m,l-=m,o+=m,n.length-=m;break}n.mode=gs;break;case 16196:for(;d<14;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}if(n.nlen=257+(31&u),u>>>=5,d-=5,n.ndist=1+(31&u),u>>>=5,d-=5,n.ncode=4+(15&u),u>>>=4,d-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Es;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;d<3;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}n.lens[A[n.have++]]=7&u,u>>>=3,d-=3}for(;n.have<19;)n.lens[A[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,P={bits:n.lenbits},E=is(0,n.lens,0,19,n.lencode,0,n.work,P),n.lenbits=P.bits,E){e.msg="invalid code lengths set",n.mode=Es;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;g=(T=n.lencode[u&(1<<n.lenbits)-1])>>>16&255,y=65535&T,!((p=T>>>24)<=d);){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}if(y<16)u>>>=p,d-=p,n.lens[n.have++]=y;else{if(16===y){for(_=p+2;d<_;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}if(u>>>=p,d-=p,0===n.have){e.msg="invalid bit length repeat",n.mode=Es;break}S=n.lens[n.have-1],m=3+(3&u),u>>>=2,d-=2}else if(17===y){for(_=p+3;d<_;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}d-=p,S=0,m=3+(7&(u>>>=p)),u>>>=3,d-=3}else{for(_=p+7;d<_;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}d-=p,S=0,m=11+(127&(u>>>=p)),u>>>=7,d-=7}if(n.have+m>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Es;break}for(;m--;)n.lens[n.have++]=S}}if(n.mode===Es)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=Es;break}if(n.lenbits=9,P={bits:n.lenbits},E=is(1,n.lens,0,n.nlen,n.lencode,0,n.work,P),n.lenbits=P.bits,E){e.msg="invalid literal/lengths set",n.mode=Es;break}if(n.distbits=6,n.distcode=n.distdyn,P={bits:n.distbits},E=is(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,P),n.distbits=P.bits,E){e.msg="invalid distances set",n.mode=Es;break}if(n.mode=ws,t===os)break e;case ws:n.mode=ks;case ks:if(s>=6&&l>=258){e.next_out=o,e.avail_out=l,e.next_in=r,e.avail_in=s,n.hold=u,n.bits=d,Jo(e,h),o=e.next_out,a=e.output,l=e.avail_out,r=e.next_in,i=e.input,s=e.avail_in,u=n.hold,d=n.bits,n.mode===gs&&(n.back=-1);break}for(n.back=0;g=(T=n.lencode[u&(1<<n.lenbits)-1])>>>16&255,y=65535&T,!((p=T>>>24)<=d);){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}if(g&&!(240&g)){for(b=p,w=g,k=y;g=(T=n.lencode[k+((u&(1<<b+w)-1)>>b)])>>>16&255,y=65535&T,!(b+(p=T>>>24)<=d);){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}u>>>=b,d-=b,n.back+=b}if(u>>>=p,d-=p,n.back+=p,n.length=y,0===g){n.mode=16205;break}if(32&g){n.back=-1,n.mode=gs;break}if(64&g){e.msg="invalid literal/length code",n.mode=Es;break}n.extra=15&g,n.mode=16201;case 16201:if(n.extra){for(_=n.extra;d<_;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}n.length+=u&(1<<n.extra)-1,u>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;g=(T=n.distcode[u&(1<<n.distbits)-1])>>>16&255,y=65535&T,!((p=T>>>24)<=d);){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}if(!(240&g)){for(b=p,w=g,k=y;g=(T=n.distcode[k+((u&(1<<b+w)-1)>>b)])>>>16&255,y=65535&T,!(b+(p=T>>>24)<=d);){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}u>>>=b,d-=b,n.back+=b}if(u>>>=p,d-=p,n.back+=p,64&g){e.msg="invalid distance code",n.mode=Es;break}n.offset=y,n.extra=15&g,n.mode=16203;case 16203:if(n.extra){for(_=n.extra;d<_;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}n.offset+=u&(1<<n.extra)-1,u>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Es;break}n.mode=16204;case 16204:if(0===l)break e;if(m=h-l,n.offset>m){if((m=n.offset-m)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Es;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>l&&(m=l),l-=m,n.length-=m;do{a[o++]=v[f++]}while(--m);0===n.length&&(n.mode=ks);break;case 16205:if(0===l)break e;a[o++]=n.length,l--,n.mode=ks;break;case Ss:if(n.wrap){for(;d<32;){if(0===s)break e;s--,u|=i[r++]<<d,d+=8}if(h-=l,e.total_out+=h,n.total+=h,4&n.wrap&&h&&(e.adler=n.check=n.flags?To(n.check,a,h,o-h):Po(n.check,a,h,o-h)),h=l,4&n.wrap&&(n.flags?u:Ps(u))!==n.check){e.msg="incorrect data check",n.mode=Es;break}u=0,d=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;d<32;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}if(4&n.wrap&&u!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=Es;break}u=0,d=0}n.mode=16208;case 16208:E=ls;break e;case Es:E=cs;break e;case 16210:return hs;default:return ds}return e.next_out=o,e.avail_out=l,e.next_in=r,e.avail_in=s,n.hold=u,n.bits=d,(n.wsize||h!==e.avail_out&&n.mode<Es&&(n.mode<Ss||t!==as))&&Fs(e,e.output,e.next_out,h-e.avail_out),c-=e.avail_in,h-=e.avail_out,e.total_in+=c,e.total_out+=h,n.total+=h,4&n.wrap&&h&&(e.adler=n.check=n.flags?To(n.check,a,h,e.next_out-h):Po(n.check,a,h,e.next_out-h)),e.data_type=n.bits+(n.last?64:0)+(n.mode===gs?128:0)+(n.mode===ws||n.mode===bs?256:0),(0===c&&0===h||t===as)&&E===ss&&(E=ms),E},$s={inflateReset:xs,inflateReset2:Cs,inflateResetKeep:Ds,inflateInit:e=>Is(e,15),inflateInit2:Is,inflate:Os,inflateEnd:e=>{if(As(e))return ds;var t=e.state;return t.window&&(t.window=null),e.state=null,ss},inflateGetHeader:(e,t)=>{if(As(e))return ds;var n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,ss):ds},inflateSetDictionary:(e,t)=>{var n,i=t.length;return As(e)||0!==(n=e.state).wrap&&n.mode!==ps?ds:n.mode===ps&&Po(1,t,i,0)!==n.check?cs:Fs(e,t,i,i)?(n.mode=16210,hs):(n.havedict=1,ss)},inflateInfo:"pako inflate (from Nodeca project)"};var Ns=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},Ws=Object.prototype.toString,js=Ao,Bs=Do,zs=Io,Us=Lo,Hs=Ro,Gs=Fo,Vs=Oo,Ks=$o;function Xs(e){this.options=Bo({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 Yo,this.strm.avail_out=0;var n=$s.inflateInit2(this.strm,t.windowBits);if(n!==zs)throw new Error(Mo[n]);if(this.header=new Ns,$s.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Vo(t.dictionary):"[object ArrayBuffer]"===Ws.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=$s.inflateSetDictionary(this.strm,t.dictionary))!==zs))throw new Error(Mo[n])}Xs.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?Bs:js,"[object ArrayBuffer]"===Ws.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=$s.inflate(r,i))===Hs&&s&&((n=$s.inflateSetDictionary(r,s))===zs?n=$s.inflate(r,i):n===Vs&&(n=Hs));r.avail_in>0&&n===Us&&r.state.wrap>0&&0!==e[r.next_in];)$s.inflateReset(r),n=$s.inflate(r,i);switch(n){case Gs:case Vs:case Hs:case Ks:return this.onEnd(n),this.ended=!0,!1}if(a=r.avail_out,r.next_out&&(0===r.avail_out||n===Us))if("string"===this.options.to){var l=Xo(r.output,r.next_out),u=r.next_out-l,d=Ko(r.output,l);r.next_out=u,r.avail_out=o-u,u&&r.output.set(r.output.subarray(l,l+u),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(n!==zs||0!==a){if(n===Us)return n=$s.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},Xs.prototype.onData=function(e){this.chunks.push(e)},Xs.prototype.onEnd=function(e){e===zs&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=zo(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Ys={ungzip:function(e,t){var n=new Xs(t);if(n.push(e),n.err)throw n.msg||Mo[n.err];return n.result}}.ungzip,qs=e=>{var t;if(null!=e&&e.includes(ln))t=an;else{var n=null==e?void 0:e.find(e=>e.includes(on));t=n?n.split("=")[1]:tn}return(t=t.replace(/\/$/,""))+"/"+Zt},Js=e=>{var t,n,i=io.getAppConfig(at)||io.getAppConfig(yt);return null!==(t=null==i||null===(n=i.capabilities)||void 0===n?void 0:n.includes(e))&&void 0!==t&&t},Qs=()=>io.getCampaignCacheTtl(),Zs=()=>{var e=Qs();if(null!==e)if(0!==e){var t=io.getApiCampaignSessionTimestamp();if(null!==t)(Date.now()-t)/1e3>=e&&io.purgeApiCampaignCache()}else io.purgeApiCampaignCache()},el=e=>{var t=!Js(Pe.THIRD_PARTY_TRANSACTIONS);return e&&!t&&Si.info(`[${e}] Your plan does not have purchase management features.`),t},tl=()=>{var e,t,n=null===(e=io.getNamiConfig())||void 0===e?void 0:e.namiCommands;return null!==(t=null==n?void 0:n.includes(pn))&&void 0!==t&&t},nl=()=>{var e,t,n=null===(e=io.getNamiConfig())||void 0===e?void 0:e.namiCommands;return null!==(t=null==n?void 0:n.includes(yn))&&void 0!==t&&t};function il(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=Ys(t),i=(new TextDecoder).decode(n);return JSON.parse(i)}catch(e){return}}var al=null;function rl(){return null!==al&&(n=null===(e=io.getNamiConfig())||void 0===e?void 0:e.namiCommands,null!==(t=null==n?void 0:n.includes(wn))&&void 0!==t&&t);var e,t,n}function ol(e){if(e)return e.length>4096?e.slice(0,4096):e}function sl(e){try{return new URL(e).pathname}catch(t){return e}}function ll(e){var t=null==e?void 0:e.body;return"string"==typeof t?ol(t):void 0}function ul(e){try{var t;null===(t=al)||void 0===t||t(e)}catch(e){}}function dl(e,t,n,i){var r,o,s,l,u,d,c,h;return k(function(m){for(;;)switch(m.p=m.n){case 0:if(rl()){m.n=1;break}return m.a(2,i());case 1:return o=null!==(r=null==t?void 0:t.method)&&void 0!==r?r:"GET",s=Date.now(),m.p=2,m.n=3,a(i());case 3:l=m.v,m.n=5;break;case 4:throw m.p=4,c=m.v,ul({method:o,url:e,path:sl(e),statusCode:0,durationMs:Date.now()-s,timestamp:new Date,requestBody:ll(t),errorDescription:cl(c),kind:n}),c;case 5:return u=Date.now()-s,m.p=6,h=ol,m.n=7,a(l.clone().text());case 7:d=h(m.v),m.n=9;break;case 8:m.p=8,m.v;case 9:return ul({method:o,url:e,path:sl(e),statusCode:l.status,durationMs:u,timestamp:new Date,requestBody:ll(t),responseBody:d,kind:n}),m.a(2,l)}},null,null,[[6,8],[2,4]],Promise)}function cl(e){return e instanceof Error?e.name?`${e.name}: ${e.message}`:e.message:String(e)}function hl(e,t,n=Rn,i=xn){var r,o,s,l,u,d,c;return k(function(h){for(;;)switch(h.n){case 0:return o=0,s=tl(),l=nl(),u=null!==(r=null==t?void 0:t.method)&&void 0!==r?r:"GET",d=()=>{var r,c,h,m;return k(function(f){for(;;)switch(f.n){case 0:return(s||l)&&Si.debug(`[HTTP] ${u} ${e}`),l&&null!=t&&t.body&&Si.debug(`[HTTP] Request body: ${t.body}`),f.n=1,a(dl(e,t,"api",()=>ml(e,t,n)));case 1:if((r=f.v).ok){f.n=7;break}if(!l){f.n=3;break}return f.n=2,a(r.clone().text());case 2:c=f.v,Si.debug(`[HTTP] Response ${r.status}: ${c}`);case 3:if(r.status!=Xn){f.n=4;break}throw new oo;case 4:if(!(++o<=i)){f.n=6;break}return h=1e3*(o+In),f.n=5,a(new Promise(e=>setTimeout(e,h)));case 5:return f.a(2,d());case 6:throw new ao(r.status,`Request failed after ${i} retries`);case 7:if(!l){f.n=9;break}return f.n=8,a(r.clone().text());case 8:m=f.v,Si.debug(`[HTTP] Response ${r.status}: ${m}`);case 9:return f.a(2,r)}},null,null,null,Promise)},h.n=1,a(d());case 1:return c=h.v,h.a(2,c.json())}},null,null,null,Promise)}function ml(e,t={},n){var i,r,o;return k(function(s){for(;;)switch(s.n){case 0:return i=new AbortController,r=setTimeout(()=>i.abort(),n),t.signal=i.signal,s.n=1,a(fetch(e,t));case 1:return o=s.v,clearTimeout(r),s.a(2,o)}},null,null,null,Promise)}var fl="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof global?global:{},vl="function"==typeof fl.BigInt,pl=vl?fl.BigInt.bind(fl):void 0,gl=vl?pl("0xffffffffffffffffffffffffffffffff"):null,yl=vl?pl("0x100000000000000000000000000000000"):null,bl=vl?pl(0):null,wl=vl?pl(1):null,kl=vl?pl(8):null,Sl=vl?pl(1e4):null,El=fl.crypto,Pl="function"==typeof(null==El?void 0:El.getRandomValues),_l=1/16,Tl=e=>we().device.getDeviceData(e),Ml=()=>{var e=io.getNamiConfig();return e&&e.formFactor?e.formFactor:we().device.getDeviceFormFactor()};function Al(){return we().device.generateUUID()}function Dl(e){if(!vl||!gl)return Il(e);try{var t=gl,n=function(e){if(!pl)throw new Error("BigInt is not supported in this environment");var t=e.replace(/-/g,"");return pl("0x"+t)}(e);return Number(n)/Number(t)*100}catch(t){throw Si.error(`Error calculating audience split position for UUID ${e}`,t),new Error(`Invalid UUID format: ${e}`)}}function xl(e){if(!pl)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 Cl(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(!(vl&&gl&&pl&&Sl))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=Al(),r=Number.POSITIVE_INFINITY,o=50,s=0;s<o;s++){var l=Al(),u=Il(l);if(u>=n&&u<=i)return l;var d=Ll(u,n,i);d<r&&(r=d,a=l)}return a}(n,i);var s=gl,l=pl,u=Sl,d=e=>s*l(e)/u,c=d(r),m=d(o);if(m<=c)return xl(c);var f=c+function(e){if(!pl||null===yl||null===wl||null===bl||null===kl)throw new Error("BigInt is not supported in this environment");var t=pl,n=bl,i=wl,a=kl,r=yl;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,l=r/s*s-i,u=0,d=!1;u<10;){if(Pl)El.getRandomValues(o);else{d||(d=!0,Si.warn("randomBigInt: crypto.getRandomValues unavailable, using Math.random fallback"));for(var c=0;c<o.length;c++)o[c]=Math.floor(256*Math.random())}for(var m,f=n,v=h(o);!(m=v()).done;)f=f<<a|t(m.value);if(f<=l)return f%s;u++}if(Pl)try{El.getRandomValues(o);for(var p,g=n,y=h(o);!(p=y()).done;)g=g<<a|t(p.value);var b=g%s;return Si.warn("randomBigInt: reached max rejection attempts, using modulo fallback",{n:e.toString(),attempts:u}),b}catch(e){throw Si.error("randomBigInt: failed to generate random values",e),new Error("randomBigInt: unable to generate random value")}for(var w,k=n,S=h(o);!(w=S()).done;)k=k<<a|t(w.value);return Si.warn("randomBigInt: reached max rejection attempts without crypto, using modulo fallback",{n:e.toString(),attempts:u}),k%s}(m-c);return xl(f)}function Il(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],16))*_l}return n}(e);return 100*t}function Ll(e,t,n){return e<t?t-e:e>n?e-n:0}function Rl(e,t,n){var i=n.value;return n.value=function(...e){if(!this.platformID)throw new lo;return i.apply(this,e)},n}function Fl(e,t,n){var i=n.value;return n.value=function(...e){var t=io.getDevice();if(null==t||!t.id)throw new uo;return i.apply(this,e)},n}var Ol,$l=function(){function e(){o(this,e);var t=io.getNamiConfig();!this.platformID&&t&&this.configure(t)}return c(e,[{key:"deviceID",get:function(){var e;return null===(e=io.getDevice())||void 0===e?void 0:e.id}},{key:"configure",value:function(e){this.baseURL=qs(e.namiCommands),this.platformID=e.appPlatformID}},{key:"reset",value:function(){this.baseURL=void 0,this.platformID=void 0}},{key:"login",value:function(e){var t,n;return k(function(i){for(;;)switch(i.n){case 0:if(e){i.n=1;break}throw new co;case 1:return t=`device/${this.deviceID}/login/`,n={external_id:e},i.n=2,a(this.requestBodyAPI(t,n,"PUT"));case 2:return i.a(2,i.v)}},null,this,null,Promise)}},{key:"logout",value:function(){var e;return k(function(t){for(;;)switch(t.n){case 0:return e=`device/${this.deviceID}/logout/`,t.n=1,a(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 k(function(i){for(;;)switch(i.n){case 0:return t=`device/${this.deviceID}/session/`,i.n=1,a(this.requestBodyAPI(t,{start_time:e,app_env:"production"}));case 1:n=i.v,io.setSessionCounter(),n.id&&io.setSessionId(n.id);case 2:return i.a(2)}},null,this,null,Promise)}},{key:"postImpression",value:function(t){var n,i,r,o,s,l;return k(function(u){for(;;)switch(u.n){case 0:return o=`device/${this.deviceID}/impression/`,s=null!==(n=t.id)&&void 0!==n?n:Al(),l=m({},t,{id:s,impression_date:null!==(i=t.impression_date)&&void 0!==i?i:(new Date).toISOString()}),io.setLastImpressionId(s),null===(r=e.impressionListener)||void 0===r||r.call(e,s),u.n=1,a(this.requestBodyAPI(o,l,"POST",!0));case 1:return u.a(2)}},null,this,null,Promise)}},{key:"patchImpressionCompletion",value:function(e,t,n){var i;return k(function(r){for(;;)switch(r.n){case 0:return i=`device/${this.deviceID}/impression/${e}/`,r.n=1,a(this.requestBodyAPI(i,{completion_result:t,completion_result_date:n},"PATCH",!0));case 1:return r.a(2)}},null,this,null,Promise)}},{key:"postConversion",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:return t=`device/${this.deviceID}/transaction/`,n.n=1,a(this.requestBodyAPI(t,e,"POST",!0));case 1:return n.a(2)}},null,this,null,Promise)}},{key:"purchaseValidation",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:return t=`device/${this.deviceID}/purchase_event/`,n.n=1,a(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 k(function(r){for(;;)switch(r.n){case 0:return i=`${this.baseURL}/${this.platformID}/`+e,r.n=1,a(hl(i,void 0,t,n));case 1:return r.a(2,r.v)}},null,this,null,Promise)}},{key:"requestBodyAPI",value:function(e,t,n="POST",i=!1,r,o){var s,l;return k(function(u){for(;;)switch(u.n){case 0:return s=`${this.baseURL}/${this.platformID}/`+e,l={method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:i},u.n=1,a(hl(s,l,r,o));case 1:return u.a(2,u.v)}},null,this,null,Promise)}}],[{key:"configure",value:function(e){this.instance.configure(e)}},{key:"reset",value:function(){this.instance.reset()}}])}();function Nl(e){return null!=(null==e?void 0:e.flow)}$l.instance=new $l,ke([Fl],$l.prototype,"login",null),ke([Fl],$l.prototype,"logout",null),ke([Fl],$l.prototype,"startSession",null),ke([Fl],$l.prototype,"postImpression",null),ke([Fl],$l.prototype,"patchImpressionCompletion",null),ke([Fl],$l.prototype,"postConversion",null),ke([Fl],$l.prototype,"purchaseValidation",null),ke([Rl],$l.prototype,"fetchAPI",null),ke([Rl],$l.prototype,"requestBodyAPI",null),e.NamiCampaignRuleType=void 0,(Ol=e.NamiCampaignRuleType||(e.NamiCampaignRuleType={})).DEFAULT="default",Ol.LABEL="label",Ol.UNKNOWN="unknown",Ol.URL="url";var Wl=()=>{var e;return null!==(e=io.getPaywalls(St))&&void 0!==e?e:[]},jl=()=>{var e;return null!==(e=io.getPaywalls(lt))&&void 0!==e?e:[]},Bl=()=>Kr(Ei([...jl(),...Wl()]),"id"),zl=e=>Bl().find(t=>t.id===e),Ul=e=>{var t=Bl(),n=new Set(t.map(e=>e.id));return e.every(e=>n.has(e))};new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z"));var Hl,Gl=e=>{try{return!isNaN(new Date(e).getTime())}catch(e){return!1}},Vl=(e,t,n=new Date)=>{var i=n.getTime(),a=!e||!Gl(e)||new Date(e).getTime()<i,r=!t||!Gl(t)||new Date(t).getTime()>i;return a&&r},Kl=e=>{try{var t=new URL(e);return("http:"===t.protocol||"https:"===t.protocol)&&!!t.hostname}catch(e){return!1}},Xl=e=>{try{var t=new URL(e),n=t.origin+t.pathname,i=new Set;return t.searchParams.forEach((e,t)=>{i.add(`${t}=${e}`)}),{basePath:n,params:i}}catch(e){return}},Yl=(e,t,n)=>{if(!e)return[];var i=e.filter(e=>!Array.isArray(e.segments)).length;return i>0&&Si.warn(`Skipping ${i} of ${e.length} campaign rules with no segments array`),e.flatMap(e=>{if(!Array.isArray(e.segments))return[];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=h(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,paywall_url:a.paywall_url,page_urls:a.page_urls,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}})},ql=()=>{var e,t,n=null!==(e=io.getCampaignRules(ot))&&void 0!==e?e:[],i=null!==(t=io.getCampaignRules(wt))&&void 0!==t?t:[],a=Ml(),r=Ei([...n,...i]).filter(e=>{var t;return null===(t=e.form_factors)||void 0===t?void 0:t.some(e=>e.form_factor===a)}).filter(e=>Vl(e.not_before,e.expires_at)),o=new Set;return r.filter(e=>{var t,n,i=`${null!==(t=e.type)&&void 0!==t?t:""}::${null!==(n=e.value)&&void 0!==n?n:""}`;return!o.has(i)&&(o.add(i),!0)})},Jl=e=>{var t,n=null!==(t=io.getCampaignRules(e))&&void 0!==t?t:[],i=Ml();return Ei(n).filter(e=>{var t;return null===(t=e.form_factors)||void 0===t?void 0:t.some(e=>e.form_factor===i)}).filter(e=>Vl(e.not_before,e.expires_at))},Ql=()=>Jl(wt),Zl=()=>Jl(ot),eu=(t,n,i,a)=>{var r=(()=>{if(!a)return t().find(t=>t.type==e.NamiCampaignRuleType.DEFAULT);if(a===e.NamiCampaignRuleType.URL){var n=t().filter(t=>t.type==e.NamiCampaignRuleType.URL);return((e,t)=>{var n,i,a,r=Xl(e);if(r){for(var o,s,l,u=h(t);!(l=u()).done;){var d=l.value,c=d.value;if(c){var m=Xl(c);if(m&&m.basePath===r.basePath){var f=m.params.size;if(0!==f){for(var v,p=0,g=h(m.params);!(v=g()).done;){var y=v.value;r.params.has(y)&&p++}p===f?(!o||f>o.totalParams)&&(o={campaign:d,totalParams:f}):o||(!s||p>s.score||p===s.score&&f>s.totalParams)&&(s={campaign:d,score:p,totalParams:f})}else o||s||(s={campaign:d,score:0,totalParams:0})}}}return null!==(n=null===(i=o)||void 0===i?void 0:i.campaign)&&void 0!==n?n:null===(a=s)||void 0===a?void 0:a.campaign}})(i,n)}return t().find(e=>e.type==a&&e.value==i)})();if(!r)return{};var o=n().find(e=>(null==r?void 0:r.paywall)===e.id);return{campaign:r,paywall:o}},tu=(e,t)=>{var n=eu(Zl,jl,e,t);if(n.campaign&&n.paywall)return{campaign:n.campaign,paywall:n.paywall};var i=eu(Ql,Wl,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}},nu="object"==typeof Reflect?Reflect:null,iu=nu&&"function"==typeof nu.apply?nu.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};Hl=nu&&"function"==typeof nu.ownKeys?nu.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var au=Number.isNaN||function(e){return e!=e};function ru(){ru.init.call(this)}ru.EventEmitter=ru,ru.prototype._events=void 0,ru.prototype._eventsCount=0,ru.prototype._maxListeners=void 0;var ou=10;function su(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function lu(e){return void 0===e._maxListeners?ru.defaultMaxListeners:e._maxListeners}function uu(e,t,n,i){var a,r,o,s;if(su(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=lu(e))>0&&o.length>a&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return e}function du(){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 cu(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=du.bind(i);return a.listener=n,i.wrapFn=a,a}function hu(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):fu(a,a.length)}function mu(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 fu(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e[i];return n}Object.defineProperty(ru,"defaultMaxListeners",{enumerable:!0,get:function(){return ou},set:function(e){if("number"!=typeof e||e<0||au(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");ou=e}}),ru.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},ru.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||au(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},ru.prototype.getMaxListeners=function(){return lu(this)},ru.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)iu(s,this,t);else for(var l=s.length,u=fu(s,l),d=0;d<l;++d)iu(u[d],this,t);return!0},ru.prototype.addListener=function(e,t){return uu(this,e,t,!1)},ru.prototype.on=ru.prototype.addListener,ru.prototype.prependListener=function(e,t){return uu(this,e,t,!0)},ru.prototype.once=function(e,t){return su(t),this.on(e,cu(this,e,t)),this},ru.prototype.prependOnceListener=function(e,t){return su(t),this.prependListener(e,cu(this,e,t)),this},ru.prototype.removeListener=function(e,t){var n,i,a,r,o;if(su(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},ru.prototype.off=ru.prototype.removeListener,ru.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},ru.prototype.listeners=function(e){return hu(this,e,!0)},ru.prototype.rawListeners=function(e){return hu(this,e,!1)},ru.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):mu.call(e,t)},ru.prototype.listenerCount=mu,ru.prototype.eventNames=function(){return this._eventsCount>0?Hl(this._events):[]};var vu=function(){function e(){o(this,e),this.emitter=new ru}return c(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}}])}(),pu=function(){return c(function e(){o(this,e),this.disableCampaignUpdates=!1,this.useLegacyPaywallFetch=!1,this.currentFormFactor=Ml()},[{key:"configure",value:function(e,t,n=[]){this.currentFormFactor=e,this.splitPosition=t,this.disableCampaignUpdates=n.includes("disableCampaignUpdates"),this.useLegacyPaywallFetch=n.includes("useLegacyPaywallFetch")}},{key:"reset",value:function(){this.currentFormFactor=Ml(),this.splitPosition=void 0,this.disableCampaignUpdates=!1,this.useLegacyPaywallFetch=!1}},{key:"fetchCampaignRules",value:function(e){var t,n,i,r;return k(function(o){for(;;)switch(o.n){case 0:if(i=io.getDevice(),!this.disableCampaignUpdates){o.n=1;break}return Si.info("Campaign updates disabled by configuration. Skipping fetch."),o.a(2,[]);case 1:if(null!=i&&i.id){o.n=3;break}return o.n=2,a(this.getAnonymousCampaigns());case 2:r=o.v,o.n=5;break;case 3:return o.n=4,a(this.getCampaigns(i.id));case 4:r=o.v;case 5:return r=null===(t=r)||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.form_factors)||void 0===t?void 0:t.some(e=>e.form_factor===this.currentFormFactor))}),r=null===(n=r)||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}),io.setCampaignRules(ot,r),io.setApiCampaignSessionTimestamp(),this.invokeAvailableCampaignsResponseHandler(),o.a(2,r)}},null,this,null,Promise)}},{key:"fetchCampaignRulesRaw",value:function(){var e,t,n,i,r;return k(function(o){for(;;)switch(o.n){case 0:if(!this.disableCampaignUpdates){o.n=1;break}return Si.info("Campaign updates disabled by configuration. Skipping fetch."),o.a(2,{campaigns:[],fromNetwork:!1});case 1:if(null==(t=io.getDevice())||!t.id){o.n=3;break}return o.n=2,a(this.fetchCampaigns(t.id));case 2:r=o.v,o.n=5;break;case 3:return o.n=4,a(this.fetchAnonymousCampaigns());case 4:r=o.v;case 5:return i=null===(e=(n=r).campaigns)||void 0===e?void 0:e.filter(e=>{var t;return e.paywall&&e.form_factors.some(e=>e.form_factor===this.currentFormFactor)||e.flow&&(null===(t=e.form_factors)||void 0===t?void 0:t.some(e=>e.form_factor===this.currentFormFactor))}),o.a(2,{campaigns:i,fromNetwork:n.fromNetwork})}},null,this,null,Promise)}},{key:"finalizeCampaignRules",value:function(e,t){var n=new Set([...t.map(e=>e.id),...Wl().map(e=>e.id)]),i=null==e?void 0:e.filter(e=>{return e.paywall?t.find(t=>t.id==e.paywall):!!e.flow&&(!!e.flow.object&&(null!==(i=e.flow.object.screens)&&void 0!==i?i:[]).every(e=>n.has(e)));var i});return io.setCampaignRules(ot,i),io.setApiCampaignSessionTimestamp(),this.invokeAvailableCampaignsResponseHandler(),i}},{key:"invokeAvailableCampaignsResponseHandler",value:function(){var e=vu.getInstance().listeners(ai),t=ql();e.forEach(e=>e(t))}},{key:"getAnonymousCampaigns",value:function(e=Ae){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.fetchAnonymousCampaigns(e));case 1:return t.a(2,t.v.campaigns)}},null,this,null,Promise)}},{key:"getCampaigns",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.fetchCampaigns(e));case 1:return t.a(2,t.v.campaigns)}},null,this,null,Promise)}},{key:"fetchAnonymousCampaigns",value:function(e=Ae){var t,n,i,r,o;return k(function(s){for(;;)switch(s.p=s.n){case 0:return t=`campaign_rules/?sdk_version=${e}`,s.p=1,s.n=2,a($l.instance.fetchAPI(t));case 2:return i=s.v,s.a(2,{campaigns:Yl(null!==(n=i.results)&&void 0!==n?n:[],this.splitPosition,this.currentFormFactor),fromNetwork:!0});case 3:if(s.p=3,o=s.v,r=this.fallbackData()){s.n=4;break}throw Si.error(So(o.status,t)),o;case 4:return s.a(2,{campaigns:r.results,fromNetwork:!1})}},null,this,[[1,3]],Promise)}},{key:"fetchCampaigns",value:function(e){var t,n,i,r;return k(function(o){for(;;)switch(o.p=o.n){case 0:return t=`device/${e}/campaign_rules/`,o.p=1,o.n=2,a($l.instance.fetchAPI(t));case 2:return n=o.v,o.a(2,{campaigns:(null==n?void 0:n.results)||[],fromNetwork:!0});case 3:if(o.p=3,r=o.v,i=this.fallbackData()){o.n=4;break}throw Si.error(So(r.status,t)),r;case 4:return o.a(2,{campaigns:i.results||[],fromNetwork:!1})}},null,this,[[1,3]],Promise)}},{key:"fallbackData",value:function(){var e=io.getCampaignRules(ot)||io.getCampaignRules(wt);return e?{count:e.length,results:e}:null}}],[{key:"extractPaywallUrls",value:function(e){for(var t,n=[],i=h(e);!(t=i()).done;){var a,r=t.value;r.paywall_url&&n.push(r.paywall_url),r.page_urls&&n.push(...Object.values(r.page_urls)),null!==(a=r.flow)&&void 0!==a&&a.page_urls&&n.push(...Object.values(r.flow.page_urls))}return n}},{key:"hasPaywallUrls",value:function(e){return e.some(e=>{var t;return e.paywall_url||e.page_urls||(null===(t=e.flow)||void 0===t?void 0:t.page_urls)})}}])}();function gu(e,t){return yr(e,t)}pu.instance=new pu;var yu=function(){return c(function e(){o(this,e)},[{key:"createOrUpdateDevice",value:function(e,t,n){var i=io.getDevice();if(null==i||!i.id){var a,r=m({},e,{id:null!==(a=null!=t?t:this.getAnonymousUUID())&&void 0!==a?a:Al()});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 k(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,r.n=1,a(this.requestAPIData("device/",e,void 0,void 0,0));case 1:if(!(n=r.v)){r.n=2;break}io.setDevice(n),r.n=3;break;case 2:return Si.info("Device creation returned null, switching to anon mode for this session"),null==t||t.setInMemoryAnonymousMode(!0),r.a(2,null);case 3:return r.a(2,n);case 4:if(r.p=4,i=r.v,console.error("Error creating device:",i),!(i instanceof ao)){r.n=5;break}return Si.info("Retry limit exceeded, switching to anon mode for this session"),null==t||t.setInMemoryAnonymousMode(!0),r.a(2,null);case 5:throw i;case 6:return r.a(2)}},null,this,[[0,4]],Promise)}},{key:"updateDevice",value:function(e,t){var n;return k(function(i){for(;;)switch(i.n){case 0:return i.n=1,a(this.requestAPIData(`device/${e}/`,t,"PUT"));case 1:return(n=i.v)&&io.setDevice(n),i.a(2,n)}},null,this,null,Promise)}},{key:"updateDeviceField",value:function(e,t){var n,i,r;return k(function(o){for(;;)switch(o.n){case 0:if(n={[e]:t},null!=(i=io.getDevice())&&i.id){o.n=1;break}throw new uo;case 1:return o.n=2,a(this.requestAPIData(`device/${i.id}/`,n,"PATCH"));case 2:return(r=o.v)&&io.setDevice(r),o.a(2,r)}},null,this,null,Promise)}},{key:"requestAPIData",value:function(e,t,n="POST",i=On,r){var o,s;return k(function(l){for(;;)switch(l.p=l.n){case 0:return l.p=0,l.n=1,a($l.instance.requestBodyAPI(e,t,n,!1,i,r));case 1:o=l.v,l.n=5;break;case 2:if(l.p=2,!((s=l.v)instanceof lo)){l.n=3;break}throw s;case 3:if(!("device/"===e&&s instanceof ao)){l.n=4;break}throw s;case 4:if(o=io.getDevice()){l.n=5;break}return Si.error(So(s.status,e)),l.a(2,null);case 5:return l.a(2,o)}},null,null,[[0,2]],Promise)}},{key:"isEqualDevices",value:function(e,t){var n=m({},e,t),i=Object.keys(e).reduce((e,t)=>(e[t]=n[t],e),{});return gu(i,e)}},{key:"getOrCreateAnonymousUUID",value:function(){var e=io.getAnonymousUUID();return e||(e=Al(),io.setAnonymousUUID(e)),e}},{key:"getAnonymousUUID",value:function(){var e=io.getAnonymousUUID();return e?(io.clearAnonymousUUID(),e):null}}])}();yu.instance=new yu;var bu=function(){return c(function e(){o(this,e)},[{key:"fetchProducts",value:function(){var e,t,n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:if(!Js(Pe.THIRD_PARTY_TRANSACTIONS)){r.n=1;break}return r.a(2,[]);case 1:return r.p=1,r.n=2,a($l.instance.fetchAPI("products/"));case 2:n=r.v,r.n=4;break;case 3:if(r.p=3,i=r.v,n=this.fallbackData()){r.n=4;break}throw Si.error(So(i.status,"products/")),i;case 4:return null!==(e=n)&&void 0!==e&&e.results&&io.setProducts(ht,n.results),r.a(2,(null===(t=n)||void 0===t?void 0:t.results)||[])}},null,this,[[1,3]],Promise)}},{key:"fallbackData",value:function(){var e=io.getProducts(ht)||io.getProducts(Pt);return e?{count:e.length,results:e}:null}}])}();bu.instance=new bu;var wu=3,ku=200,Su=2e3,Eu=5e3,Pu=2e4,_u=new Set([408,425,429]),Tu=new Set(["ECONNRESET","ECONNREFUSED","ENOTFOUND","ETIMEDOUT"]),Mu=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t,[`CDN fetch failed with non-retryable status ${e} for ${n}`])).name="NonRetryableHttpError",i.status=e,i.url=n,i}return p(t,e),c(t)}(M(Error)),Au=function(e){function t(e,n,i){var a;return o(this,t),(a=r(this,t,[`CDN fetch exhausted ${n} attempts for ${e}${void 0!==i?` (last status ${i})`:""}`])).name="RetryExhaustedError",a.url=e,a.attempts=n,a.lastStatus=i,a}return p(t,e),c(t)}(M(Error));function Du(e,t){if("number"==typeof t)return _u.has(t)||t>=500;if(e&&"object"==typeof e){var n=e;if("AbortError"===n.name)return!0;if(n.code&&Tu.has(n.code))return!0;if(e instanceof TypeError)return!0}return!1}function xu(e,t){var n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:return n=new AbortController,i=setTimeout(()=>n.abort(),t),r.p=1,r.n=2,a(dl(e,{method:"GET"},"cdn",()=>fetch(e,{signal:n.signal})));case 2:return r.a(2,r.v);case 3:return r.p=3,clearTimeout(i),r.f(3);case 4:return r.a(2)}},null,null,[[1,,3,4]],Promise)}var Cu=e=>new Promise(t=>setTimeout(t,e));function Iu(e,t={}){var n,i,r;return k(function(o){for(;;)switch(o.n){case 0:return o.n=1,a(Lu(e,t));case 1:return n=o.v,i=n.data,r=n.retryCount,o.a(2,{data:JSON.parse(i),retryCount:r})}},null,null,null,Promise)}function Lu(e,t={}){var n,i,r,o,s,l,u,d,c,h,m,f,v,p,g,y,b,w,S,E,P,_,T,M,A,D,x,C,I,L,R;return k(function(k){for(;;)switch(k.p=k.n){case 0:d=null!==(n=t.maxAttempts)&&void 0!==n?n:wu,c=null!==(i=t.baseDelayMs)&&void 0!==i?i:ku,h=null!==(r=t.maxDelayMs)&&void 0!==r?r:Su,m=null!==(o=t.budgetMs)&&void 0!==o?o:Pu,f=null!==(s=t.timeoutMs)&&void 0!==s?s:Eu,v=null!==(l=t.randomFn)&&void 0!==l?l:Math.random,p=null!==(u=t.sleepFn)&&void 0!==u?u:Cu,g=tl(),y=nl(),b=Date.now(),w=0;case 1:if(!(w<d)){k.n=16;break}if(!(w>0)){k.n=4;break}if(!((P=Date.now()-b)>=m)){k.n=2;break}return k.a(3,16);case 2:return _=Math.min(c*Math.pow(2,w-1),h),T=_*(v()-.5),M=Math.max(0,m-P),A=Math.min(Math.max(0,_+T),M),k.n=3,a(p(A));case 3:if(!(Date.now()-b>=m)){k.n=4;break}return k.a(3,16);case 4:return k.p=4,(g||y)&&Si.debug(`[HTTP] GET ${e} (cdn attempt ${w+1}/${d})`),k.n=5,a(xu(e,f));case 5:if((D=k.v).ok){k.n=9;break}if(!y){k.n=7;break}return k.n=6,a(D.clone().text());case 6:x=k.v,Si.debug(`[HTTP] Response ${D.status}: ${x}`);case 7:if(S=D.status,!Du(void 0,D.status)){k.n=8;break}return w++,k.a(3,1);case 8:throw new Mu(D.status,e);case 9:if(!y){k.n=11;break}return k.n=10,a(D.clone().text());case 10:C=k.v,Si.debug(`[HTTP] Response ${D.status}: ${C}`);case 11:return k.n=12,a(D.text());case 12:return I=k.v,L=w,k.a(2,{data:I,retryCount:L});case 13:if(k.p=13,!((R=k.v)instanceof Mu)){k.n=14;break}throw R;case 14:if(!Du(R)){k.n=15;break}return E=R,w++,k.a(3,1);case 15:throw R;case 16:if(void 0!==S||void 0===E){k.n=17;break}throw E;case 17:throw new Au(e,w,S);case 18:return k.a(2)}},null,null,[[4,13]],Promise)}function Ru(e){var t=e.split("#")[0].split("?")[1];if(t)for(var n,i=h(t.split("&"));!(n=i()).done;){var a=n.value,r=a.indexOf("=");if("content_hash"===(-1===r?a:a.slice(0,r)))return(-1===r?"":a.slice(r+1))||void 0}}function Fu(e){var t=e.split(/[?#]/)[0],n=/\/paywall\/([^/]+)/.exec(t);return n?n[1]:void 0}var Ou=function(){return c(function e(t=Zr){o(this,e),this.bodyCache=t},[{key:"fetchPaywalls",value:function(){var e,t,n;return k(function(i){for(;;)switch(i.n){case 0:if(null!=(e=io.getDevice())&&e.id){i.n=2;break}return i.n=1,a(this.getAnonymousPaywalls());case 1:t=i.v,i.n=4;break;case 2:return i.n=3,a(this.getPaywalls(e.id));case 3:t=i.v;case 4:if(!t){i.n=5;break}return(n=this.validatePaywalls(t)).length>0&&io.setPaywalls(lt,n),i.a(2,n);case 5:return i.a(2,t)}},null,this,null,Promise)}},{key:"getAnonymousPaywalls",value:function(e=Ae){var t,n,i,r;return k(function(o){for(;;)switch(o.p=o.n){case 0:return n=`paywalls/?sdk_version=${e}`,i=null,o.p=1,o.n=2,a($l.instance.fetchAPI(n));case 2:i=o.v,o.n=4;break;case 3:if(o.p=3,r=o.v,i=this.fallbackData()){o.n=4;break}throw Si.error(So(r.status,n)),r;case 4:return o.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,r;return k(function(o){for(;;)switch(o.p=o.n){case 0:return n=`device/${e}/paywalls/`,o.p=1,o.n=2,a($l.instance.fetchAPI(n));case 2:i=o.v,o.n=4;break;case 3:if(o.p=3,r=o.v,i=this.fallbackData()){o.n=4;break}throw Si.error(So(r.status,n)),r;case 4:return o.a(2,(null===(t=i)||void 0===t?void 0:t.results)||[])}},null,this,[[1,3]],Promise)}},{key:"resolvePaywallsByUrls",value:function(e){var t,n,i,r,o;return k(function(s){for(;;)switch(s.n){case 0:return t=[...new Set(e)],n=Qs(),this.bodyCache.evaluateTtl(n),s.n=1,a(Promise.all(t.map(e=>this.resolvePaywall(e,n))));case 1:return i=s.v,r={paywalls:[],urls:t.length,hashed:t.filter(e=>void 0!==Ru(e)).length,cacheHits:0,fetched:0,cacheAfterFetchFailure:0,failed:0,retryCount:0},o=new Map,i.forEach((e,n)=>{r.retryCount+=e.retryCount,e.paywall?(o.set(e.paywall,t[n]),"cacheHit"===e.paywall.fetchSource?r.cacheHits+=1:"cacheAfterFetchFailure"===e.paywall.fetchSource?r.cacheAfterFetchFailure+=1:r.fetched+=1):r.failed+=1}),r.paywalls=this.validatePaywalls([...o.keys()]),r.paywalls.length>0&&io.setApiPaywallsFromBodyCache(r.paywalls.map(e=>o.get(e))),s.a(2,r)}},null,this,null,Promise)}},{key:"seedFromInitialConfig",value:function(e,t){var n=new Map(t.map(e=>[e.id,e]));this.bodyCache.evaluateTtl(Qs());for(var i,a=0,r=0,o=h(new Set(function(e){for(var t,n=[],i=h(e);!(t=i()).done;)for(var a,r=h(null!==(o=t.value.segments)&&void 0!==o?o:[]);!(a=r()).done;){var o,s,l=a.value;l.paywall_url&&n.push(l.paywall_url),l.page_urls&&n.push(...Object.values(l.page_urls)),null!==(s=l.flow)&&void 0!==s&&s.page_urls&&n.push(...Object.values(l.flow.page_urls))}return n}(e)));!(i=o()).done;){var s=i.value,l=Ru(s),u=Fu(s),d=u?n.get(u):void 0;l&&d&&(a+=1,this.bodyCache.seedIfAbsent(s,l,JSON.stringify(d))&&(r+=1))}Si.info(`Paywall body cache seeded from initial config: seeded=${r}, candidates=${a}`)}},{key:"resolvePaywall",value:function(e,t){var n,i,r,o,s,l,u;return k(function(d){for(;;)switch(d.p=d.n){case 0:if(!(n=Ru(e))){d.n=1;break}if(!(i=this.decodeCached(e,t))){d.n=1;break}return d.a(2,{paywall:Nu(i,"cacheHit",n),retryCount:0});case 1:return r=0,d.p=2,d.n=3,a(this.fetchPaywallText(e));case 3:if(o=d.v,r=o.retryCount,!(s=$u(o.data))){d.n=4;break}return this.bodyCache.store(e,n,o.data),d.a(2,{paywall:Nu(s,"fetched",n),retryCount:r});case 4:Si.error(`Paywall body from ${e} is not a decodable paywall`),d.n=6;break;case 5:d.p=5,u=d.v,Si.error(`Failed to fetch individual paywall: ${u}`);case 6:if(!(l=this.decodeCached(e,t))){d.n=7;break}return Si.warn(`Serving the cached body for ${e} after fetch failure (within campaign_cache_ttl)`),d.a(2,{paywall:Nu(l,"cacheAfterFetchFailure",n),retryCount:r});case 7:return d.a(2,{retryCount:r})}},null,this,[[2,5]],Promise)}},{key:"decodeCached",value:function(e,t){var n=this.bodyCache.validEntry(e,t);if(n){var i=$u(n.body);return i||(Si.warn(`Deleting an undecodable cached paywall body for ${e}`),this.bodyCache.remove(e)),i}}},{key:"fetchPaywallText",value:function(e){var t;return null!==(t=io.getNamiConfig())&&void 0!==t&&null!==(t=t.namiCommands)&&void 0!==t&&t.includes(Tn)?(Si.warn(`${Tn}: failing the fetch for ${e} before the network`),Promise.reject(new Au(e,0))):Lu(e)}},{key:"validatePaywalls",value:function(e){return e.filter(e=>{var t,n=null===(t=e.template)||void 0===t?void 0:t.pages;return!(!Array.isArray(n)||0===n.length)||(Si.warn(`Dropping paywall "${e.id}" from cache: template.pages is missing or empty`),!1)})}},{key:"fallbackData",value:function(){var e=io.getPaywalls(lt)||io.getPaywalls(St);return e?{count:e.length,results:e}:null}}])}();function $u(e){try{var t=JSON.parse(e);return t&&"object"==typeof t&&!Array.isArray(t)?t:void 0}catch(e){return}}function Nu(e,t,n){return m({},e,{fetchSource:t},n?{contentHash:n}:{})}Ou.instance=new Ou;var Wu=function(){return c(function e(){o(this,e)},[{key:"fetchConfig",value:function(){var e,t,n,i,r;return k(function(o){for(;;)switch(o.n){case 0:if(null===(e=io.getNamiConfig())||void 0===e||null===(e=e.namiCommands)||void 0===e||!e.includes(Pn)){o.n=1;break}throw new ao(qn,Pn);case 1:return i=null===(t=io.getNamiConfig())||void 0===t?void 0:t.appPlatformID,o.n=2,a($l.instance.fetchAPI("config/",jn,0));case 2:return r=o.v,(null===(n=io.getNamiConfig())||void 0===n?void 0:n.appPlatformID)===i?io.setAppConfig(at,r):Si.debug("Discarding an app config response for a platform that is no longer configured"),o.a(2,r)}},null,null,null,Promise)}},{key:"fetchConfigForStartup",value:function(e){var t,n,i,r,o,s;return k(function(l){for(;;)switch(l.p=l.n){case 0:if(!e){l.n=1;break}return l.a(2,this.startupOnInitialConfig());case 1:t=Nn,i=1;case 2:if(!(i<=t)){l.n=7;break}return i>1&&Si.debug(`Retrying app config fetch (attempt ${i} of ${t})`),l.p=3,o=ju,l.n=4,a(this.fetchConfig());case 4:return l.a(2,o(l.v));case 5:l.p=5,s=l.v,n=s;case 6:i++,l.n=2;break;case 7:if(!(r=io.getAppConfig(at))){l.n=9;break}if(Bu(r)){l.n=8;break}return l.a(2,{usable:!1,reason:"the cached app config does not grant the 'sdk' capability"});case 8:return Si.info(`App config fetch failed after ${t} attempts - continuing on the cached config`),l.a(2,{usable:!0});case 9:return l.a(2,{usable:!1,reason:`app config fetch failed after ${t} attempts (${zu(n)}) and no initial or cached config is available`})}},null,this,[[3,5]],Promise)}},{key:"startupOnInitialConfig",value:function(){var e=io.getAppConfig(at);return this.fetchConfig().then(e=>{Bu(e)||Si.warn("App config does not grant the 'sdk' capability - it takes effect from the next launch")},e=>{Si.info(`App config fetch failed (${zu(e)}). Initial config is available. Skipping retry.`)}),e&&!Bu(e)?{usable:!1,reason:"the cached app config does not grant the 'sdk' capability"}:{usable:!0}}}])}();function ju(e){return Bu(e)?{usable:!0}:{usable:!1,reason:"app config does not grant the 'sdk' capability"}}function Bu(e){var t,n;return null!==(t=null===(n=e.capabilities)||void 0===n?void 0:n.includes(Pe.SDK))&&void 0!==t&&t}function zu(e){var t=null==e?void 0:e.status;return"number"==typeof t?`HTTP ${t}`:e instanceof Error?e.message:String(e)}Wu.instance=new Wu;var Uu=null;function Hu(){Uu&&Uu.setInMemoryAnonymousMode(!1)}function Gu(){return!!io.getAnonymousMode()||!!Uu&&Uu.isInMemoryAnonymousMode()}var Vu=function(){return c(function e(){o(this,e)},[{key:"startSession",value:function(){var e;return k(function(t){for(;;)switch(t.p=t.n){case 0:if(!Gu()){t.n=1;break}return Si.debug("Skipping session start call - anonymous mode"),t.a(2);case 1:return t.p=1,t.n=2,a($l.instance.startSession(new Date));case 2:t.n=4;break;case 3:t.p=3,e=t.v,Si.error("error on start session: ",e);case 4:return t.a(2)}},null,null,[[1,3]],Promise)}}])}();Vu.instance=new Vu;var Ku=function(){return c(function e(){o(this,e)},null,[{key:"allPurchases",value:function(){return[]}}])}();Ku.instance=new Ku;var Xu={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"}},Yu="en";function qu(e){var t,n,i=function(e){if(!e)return Yu;var t=e.trim();if(Xu[t])return t;var n=t.toLowerCase(),i=n.split("-")[0];return Xu[i]?i:"zh"===i?n.includes("tw")||n.includes("hk")?"zh-TW":"zh-CN":Yu}(io.getLanguageCode()),a=null!==(t=Xu[i])&&void 0!==t?t:Xu[Yu];return null!==(n=null==a?void 0:a[e])&&void 0!==n?n:e}function Ju(e){if("subscription"===(null==e?void 0:e.product_type)){var t=Zu(e);if(t.length>0)return t[0].billingPeriod}return null}function Qu(e){var t=function(e){if(!e)return[];var t=e.offers.filter(e=>"promo"===e.offer_type);return ed(t,e.subscription_period)}(e).find(e=>0===e.priceAmountMicros);return(null==t?void 0:t.billingPeriod)||null}function Zu(e){return e?ed(e.offers.filter(e=>"default"===e.offer_type),e.subscription_period):[]}function ed(e,t){return e.map(e=>td(e,t))}function td(e,t){var n,i,a,r,o,s,l,u;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,c=null!==(a=null===(r=e.promo_period)||void 0===r?void 0:r.type)&&void 0!==a?a:null==t?void 0:t.type,h=null!==(o=null===(s=e.promo_price)||void 0===s?void 0:s.price)&&void 0!==o?o:e.price,m=null!==(l=null===(u=e.promo_price)||void 0===u?void 0:u.currency)&&void 0!==l?l:e.currency;return{priceAmountMicros:1e6*h,priceCurrencyCode:m,billingPeriod:c?`P${d}${c[0].toUpperCase()}`:"",formattedPrice:ad(m).format(h)}}function nd(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],l=o[1],u=o[2],d=o[3],c=(e,t,n,i,r)=>{var o=(e=>a?`${e}_abbrev`:e)(r),s=(e=>a?`${e}_abbrev_plural`:`${e}_plural`)(r),l=qu(o),u=qu(s);return a||l!==o||(l=qu(`${r}_abbrev`)),a||u!==s||(u=qu(`${r}_abbrev_plural`)),i?e.toString():n?1===e||t?l:u:1===e||t?`${e} ${l}`:`${e} ${u}`};switch(e.at(-1)){case"D":return c(d,t,n,i,"nami_day");case"W":return c(u,t,n,i,"nami_week");case"M":return c(l,t,n,i,"nami_month");case"Y":return c(s,t,n,i,"nami_year")}return null}function id(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 ad(e){var t={maximumFractionDigits:2,minimumFractionDigits:0},n=we().device.getLanguage();try{return new Intl.NumberFormat(n,m({},t,{style:"currency",currency:e}))}catch(e){return new Intl.NumberFormat(n,m({},t,{style:"currency",currency:"USD"}))}}var rd=(e,t,n)=>e&&t&&n?n.format(e-t):null,od=(e,t,n,i)=>{if(e&&t&&n&&i){var a=100*(1-e/(n/i*t));return`${Math.round(a)}%`}return null},sd=(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)}},ld=e=>dd(e.priceAmountMicros)/ud(e.billingPeriod),ud=e=>{var t=parseInt(e[1]);return e.includes("Y")&&(t*=12),t},dd=e=>e/1e6;function cd(e){return parseFloat((Math.round(e)/100).toFixed(2))}var hd=(e,t,n=[])=>({price:()=>fd(e),name:()=>null==e?void 0:e.name,title:()=>null==e?void 0:e.name,description:()=>null==e?void 0:e.description,duration:()=>vd(e),durationSingular:()=>vd(e,!0),period:()=>vd(e,!1,!0),periodNumber:()=>vd(e,!1,!1,!0),freeTrialDuration:()=>pd(e),freeTrialDurationSingular:()=>pd(e,!0),freeTrialPeriod:()=>pd(e,!1,!0),freeTrialPeriodNumber:()=>pd(e,!1,!1,!0),pricePerMonth:()=>gd(e),pricePerMonthRounded:()=>gd(e,!0),periodInMonths:()=>yd(e),durationInMonths:()=>bd(e),durationInMonthsSingular:()=>bd(e,!0),periodNumberInMonths:()=>wd(e),percentagePriceDifferenceFromSku:()=>kd(e,t,n),priceDifferenceFromSku:()=>Sd(e,t,n),promoEligible:()=>null===Ed(e)&&null!==Pd(e,t),freeTrialEligible:()=>null!==Ed(e),promo:()=>{var n;return null===(n=Pd(e,t))||void 0===n?void 0:n.offer_ref_id},promoCode:()=>"XXXXX",promoPrice:()=>{var n;return null===(n=_d(e,t))||void 0===n?void 0:n.formattedPrice},promoPeriod:()=>Td(e,t,!1,!0),promoPeriodNumber:()=>Td(e,t,!1,!1,!0),promoDuration:()=>Td(e,t),promoDurationSingular:()=>Td(e,t,!0),introEligible:()=>!1,pricePerDay:()=>Md(e),pricePerWeek:()=>Ad(e),pricePerWeekRounded:()=>Ad(e,!0),introductoryPrice:()=>Dd(e,t),introductoryPeriod:()=>xd(e,t,!1,!0),introductoryPeriodNumber:()=>xd(e,t,!1,!1,!0),introductoryDuration:()=>xd(e,t),introductoryDurationSingular:()=>xd(e,t,!0),introductoryPricePerMonth:()=>Cd(e,t),introductoryPricePerMonthRounded:()=>Cd(e,t,!0),durationAbbrev:()=>vd(e,!1,!1,!1,!0),freeTrialDurationAbbrev:()=>pd(e,!1,!1,!1,!0),introductoryDurationAbbrev:()=>xd(e,t,!1,!1,!1,!0),promoDurationAbbrev:()=>Td(e,t,!1,!1,!1,!0),promoDurationPhase2Abbrev:()=>Td(e,t,!0,!0,!1,!0),durationInMonthsAbbrev:()=>bd(e,!1,!1,!1,!0),durationSingularAbbrev:()=>vd(e,!0,!1,!1,!0),freeTrialDurationSingularAbbrev:()=>pd(e,!0,!1,!1,!0),introductoryDurationSingularAbbrev:()=>xd(e,t,!0,!1,!1,!0),promoDurationSingularAbbrev:()=>Td(e,t,!0,!1,!1,!0),promoDurationSingularPhase2Abbrev:()=>Td(e,t,!0,!0,!1,!0),durationInMonthsSingularAbbrev:()=>bd(e,!0,!1,!1,!0),periodAbbrev:()=>vd(e,!1,!0,!1,!0),freeTrialPeriodAbbrev:()=>pd(e,!1,!0,!1,!0),introductoryPeriodAbbrev:()=>xd(e,t,!1,!0,!1,!0),promoPeriodAbbrev:()=>Td(e,t,!1,!0,!1,!0),promoPeriodPhase2Abbrev:()=>Td(e,t,!1,!0,!0,!0),periodInMonthsAbbrev:()=>bd(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,l=void 0!==a?parseInt(a,10):0;return(void 0!==r?parseInt(r,10):0)>0?null:l>0?1===l?qu("nami_weekly"):2===l?qu("nami_biweekly"):null:s>0?qu(1===s?"nami_monthly":2===s?"nami_bimonthly":3===s?"nami_quarterly":6===s?"nami_biannually":12===s?"nami_yearly":"nami_monthly"):o>0?qu("nami_yearly"):null}(Ju(e)),iso_subscription_duration:()=>Fd(e),bill_term:()=>Rd(e),invalid:()=>!1,unavailable:()=>!1}),md=(e,t,n,i=[])=>{if(!t)return null;var a=hd(t,n,i);return a[e]?a[e]():null},fd=e=>{var t=Zu(e);return t&&t.length?t[0].formattedPrice:null},vd=(e,t,n,i,a)=>nd(Ju(e),t,n,i,a),pd=(e,t,n,i,a)=>nd(Qu(e),t,n,i,a),gd=(e,t)=>{var n=Zu(e);if(!n||0===n.length)return null;var i=ld(n[0]);return i?ad(n[0].priceCurrencyCode).format(t?Math.round(i):i):null},yd=(e,t)=>{var n=Zu(e);if(!n||0===n.length)return null;var i=n[0].billingPeriod;return id(i)?nd("P1Y"===i?"P12M":i,!1,!1,!1,t):null},bd=(e,t,n,i,a)=>{var r=Zu(e);if(!r||0===r.length)return null;var o=r[0].billingPeriod;return id(o)?nd("P1Y"===o?"P12M":o,t,n,i,a):null},wd=e=>{if(!e)return 0;var t=Zu(e);return t&&t.length?ud(t[0].billingPeriod):0},kd=(e,t,n=[])=>{var i,a=Zu(e);if(!a||0===a.length)return null;var r=null===(i=sd(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return od(cd(a[0].priceAmountMicros),wd(e));var o=Zu(r);return od(cd(a[0].priceAmountMicros),wd(e),(null==o?void 0:o.length)>0?cd(o[0].priceAmountMicros):0,wd(r))},Sd=(e,t,n=[])=>{var i,a=Zu(e);if(!a||0===a.length)return null;var r=null===(i=sd(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return rd(ld(a[0]));var o=Zu(r);return rd(ld(a[0]),ld(o[0]),ad(o[0].priceCurrencyCode))},Ed=e=>Qu(e),Pd=(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},_d=(e,t)=>e?td(Pd(e,t),e.subscription_period):null,Td=(e,t,n,i,a,r)=>{var o=_d(e,t);return nd((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},Md=(e,t)=>{var n=Zu(e);if(!n||0===n.length)return null;var i,a,r=dd(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=ud(i))?30.437*a:1);return r?ad(n[0].priceCurrencyCode).format(r):null},Ad=(e,t)=>{var n=Zu(e);if(!n||0===n.length)return null;var i,a,r=dd(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=ud(i))?52*a/12:1);return r?ad(n[0].priceCurrencyCode).format(t?Math.round(r):r):null},Dd=(e,t)=>{var n=Id(e,t);return(null==n?void 0:n.formattedPrice)||null},xd=(e,t,n,i,a,r)=>{var o=Id(e,t);return nd((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},Cd=(e,t,n)=>{var i=Id(e,t);if(i){var a=dd(i.priceAmountMicros),r=ud(i.billingPeriod),o=n?Math.round(a/r):a/r;return ad(i.priceCurrencyCode).format(o)}},Id=(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],td(n,e.subscription_period)):null;var n},Ld={P1D:"daily",P1W:"weekly",P1M:"monthly",P3M:"quarterly",P6M:"semiannual",P1Y:"annual"},Rd=e=>{var t=Fd(e);return t&&Ld[t]||null},Fd=e=>{var t=Ju(e);return t?"P7D"===t?"P1W":t:null};function Od(e,t,n,i){var a=n.flatMap(e=>e.products).find(e=>e.id===t.selectedProducts[t.currentGroupId]);return Nd(Bd(e,null==a?void 0:a.sku_ref_id),a,i)}function $d(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=Bd(e,t.sku_ref_id||""),t.variables=Nd(t.product_details,t,r)}),r}function Nd(e,t,n){if(!t)return{};var i=function(e){if(!Array.isArray(e))return e;var t=e.filter(e=>e&&"object"==typeof e&&"entitlement_ref_id"in e).map(e=>e.entitlement_ref_id);return t.length?t:e}(t.entitlements),a=t.variables;if(!a)return m({},t,{entitlements:i});Object.keys(a).forEach(t=>{if("string"==typeof(r=a[t])&&r.includes(pi)){var i=Wd(a[t],e,n);a[t]=function(e){if(!e||e.includes("null")||e.includes("undefined"))return"";if(/\$\{\s*(launch\.customAttributes\.|sku\.)\w+\s*}/.test(e))return"";return e}(i)}var r});var r={};return Object.keys(hd({})).forEach(t=>{if(void 0===a[t]){var i=md(t,e,void 0,n);null!==i&&(r[t]=i)}}),m({},t,r,a,{entitlements:i})}var Wd=(e,t,n)=>e.replace(hi,(i,a)=>{var r,o,s,l,u=(null===(r=hi.exec(e))||void 0===r?void 0:r.slice(1))||[];a=null!==(o=u[0])&&void 0!==o?o:a;var d=null!==(s=null===(l=u[1])||void 0===l?void 0:l.replace(":",""))&&void 0!==s?s:"";return md(a,t,d,n)});function jd(e,t){return t.flatMap(e=>e.products).some(t=>1==md("freeTrialEligible",Bd(e,t.sku_ref_id)))}function Bd(e=[],t=""){return e.find(e=>e.product_ref_id===t)||null}var zd=function(){try{var e=Zi(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Ud=Object.prototype.hasOwnProperty;function Hd(e,t,n){var i=e[t];Ud.call(e,t)&&Pi(i,n)&&(void 0!==n||t in e)||function(e,t,n){"__proto__"==t&&zd?zd(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}(e,t,n)}var Gd="object"==typeof e&&e&&!e.nodeType&&e,Vd=Gd&&"object"==typeof module&&module&&!module.nodeType&&module,Kd=Vd&&Vd.exports===Gd?xi.Buffer:void 0;Kd&&Kd.allocUnsafe;var Xd=Va(Object.getPrototypeOf,Object),Yd=Object.prototype.hasOwnProperty;function qd(e){var t=new e.constructor(e.byteLength);return new ha(t).set(new ha(e)),t}var Jd=/\w*$/;var Qd=Ci?Ci.prototype:void 0,Zd=Qd?Qd.valueOf:void 0;function ec(e,t,n){var i,a,r,o=e.constructor;switch(t){case"[object ArrayBuffer]":return qd(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return r=qd((a=e).buffer),new a.constructor(r,a.byteOffset,a.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e){var t=qd(e.buffer);return new e.constructor(t,e.byteOffset,e.length)}(e);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,Jd.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Symbol]":return i=e,Zd?Object(Zd.call(i)):{}}}var tc=Object.create,nc=function(){function e(){}return function(t){if(!Wi(t))return{};if(tc)return tc(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var ic=Wa&&Wa.isMap,ac=ic?Fa(ic):function(e){return ka(e)&&"[object Map]"==hr(e)};var rc=Wa&&Wa.isSet,oc=rc?Fa(rc):function(e){return ka(e)&&"[object Set]"==hr(e)},sc="[object Arguments]",lc="[object Function]",uc="[object Object]",dc={};function cc(e,t,n,i,a,r){var o;if(void 0!==o)return o;if(!Wi(e))return e;var s=ga(e);if(s)o=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Yd.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e);else{var l=hr(e),u=l==lc||"[object GeneratorFunction]"==l;if(xa(e))return e.slice();if(l==uc||l==sc||u&&!a)o=u?{}:function(e){return"function"!=typeof e.constructor||Ga(e)?{}:nc(Xd(e))}(e);else{if(!dc[l])return a?e:{};o=ec(e,l)}}r||(r=new sa);var d=r.get(e);if(d)return d;r.set(e,o),oc(e)?e.forEach(function(i){o.add(cc(i,t,n,i,e,r))}):ac(e)&&e.forEach(function(i,a){o.set(a,cc(i,t,n,a,e,r))});var c=s?void 0:qa(e);return function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););}(c||e,function(i,a){c&&(i=e[a=i]),Hd(o,a,cc(i,t,n,a,e,r))}),o}dc[sc]=dc["[object Array]"]=dc["[object ArrayBuffer]"]=dc["[object DataView]"]=dc["[object Boolean]"]=dc["[object Date]"]=dc["[object Float32Array]"]=dc["[object Float64Array]"]=dc["[object Int8Array]"]=dc["[object Int16Array]"]=dc["[object Int32Array]"]=dc["[object Map]"]=dc["[object Number]"]=dc[uc]=dc["[object RegExp]"]=dc["[object Set]"]=dc["[object String]"]=dc["[object Symbol]"]=dc["[object Uint8Array]"]=dc["[object Uint8ClampedArray]"]=dc["[object Uint16Array]"]=dc["[object Uint32Array]"]=!0,dc["[object Error]"]=dc[lc]=dc["[object WeakMap]"]=!1;var hc=e=>"object"==typeof e&&null!==e&&"handleEvent"in e,mc=(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){}}},fc=function(){return c(function e(){o(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;mc(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()},l=()=>{e.cancelBubble=!0,null==o||o()};e.stopImmediatePropagation=s,e.stopPropagation=l;for(var u,d=h(i.slice());!(u=d()).done;){var c=u.value;if(a)break;mc(e,"currentTarget",this),"function"==typeof c.listener?c.listener.call(this,e):hc(c.listener)&&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=l}return mc(e,"currentTarget",null),!e.defaultPrevented}}])}(),vc=[];var pc={paywallId:"",livePaywalls:[],selectedPaywall:void 0,selectedCampaign:void 0,campaignRules:[],anySkuHasTrialOffer:!1,anySkuHasIntroOffer:!1,anySkuHasPromoOffer:!1,isLoggedIn:!1,darkMode:!1,safeAreaTop:0,safeAreaBottom:0,groups:[],selectedProducts:{},formStates:{},formFieldErrors:{},formFieldValidators:{},timerStates:{},currentPage:"page1",pageHistory:["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},gc=function(t){function n(e,t,i){var a;o(this,n),(a=r(this,n)).subscribers=new Set,a.productDetails=vc,a.filteredSkuMenus=[],a.state=cc(pc,5);var s=io.getNamiProfile();return a.state.isLoggedIn=!(null==s||!s.externalId),a.state.customer=m({},a.state.customer,io.getAllCustomerAttributesMap()),a.setPaywall(e,t,i),a.subscribers=new Set,a}return p(n,t),c(n,[{key:"onStateChanged",value:function(){}},{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(function(e,t){if("function"==typeof Event){var n=new Event(e);return Object.defineProperty(n,"detail",{configurable:!0,enumerable:!1,value:t,writable:!1}),n}return{type:e,detail:t,bubbles:!1,cancelBubble:!1,cancelable:!1,composed:!1,currentTarget:null,defaultPrevented:!1,eventPhase:0,isTrusted:!1,returnValue:!0,srcElement:null,target:null,timeStamp:Date.now(),NONE:0,CAPTURING_PHASE:1,AT_TARGET:2,BUBBLING_PHASE:3,composedPath:()=>[],initEvent:()=>{},preventDefault:()=>{},stopImmediatePropagation:()=>{},stopPropagation:()=>{}}}(e,t))}},{key:"onEvent",value:function(e,t){var n=e=>t(e.detail);return this.addEventListener(e,n),()=>this.removeEventListener(e,n)}},{key:"setState",value:function(e){this.state=e,this.subscribers.forEach(e=>e()),this.onStateChanged()}},{key:"setProductDetails",value:function(e){this.productDetails=e}},{key:"getProductDetails",value:function(){return this.productDetails}},{key:"setCurrentGroupData",value:function(e,t){var n=Od(this.productDetails,this.state,this.filteredSkuMenus,$d(this.productDetails,this.filteredSkuMenus,this.state.currentGroupId));this.setState(m({},this.state,{currentGroupId:e,currentGroupName:t,sku:n}))}},{key:"setFormState",value:function(e,t){this.setState(m({},this.state,{formStates:m({},this.state.formStates,{[e]:t})}))}},{key:"registerFormFieldValidator",value:function(e,t){this.setState(m({},this.state,{formFieldValidators:m({},this.state.formFieldValidators,{[e]:t})}))}},{key:"getFormFieldValidators",value:function(){return this.state.formFieldValidators}},{key:"setFormFieldErrors",value:function(e){this.setState(m({},this.state,{formFieldErrors:m({},e)}))}},{key:"setFormFieldError",value:function(e,t){this.setState(m({},this.state,{formFieldErrors:m({},this.state.formFieldErrors,{[e]:t})}))}},{key:"clearFormFieldError",value:function(e){var t=m({},this.state.formFieldErrors);delete t[e],this.setState(m({},this.state,{formFieldErrors:t}))}},{key:"getFormFieldErrors",value:function(){return this.state.formFieldErrors}},{key:"setTimerState",value:function(e,t,n,i){this.setState(m({},this.state,{timerStates:m({},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=m({},n,{[e]:t||!n[e]});this.setState(m({},this.state,{formStates:i}))}},{key:"getCurrentFormId",value:function(e){return this.state.formStates[e]}},{key:"setSelectedProducts",value:function(e){var t=m({},this.state,{selectedProducts:e}),n=Od(this.productDetails,t,this.filteredSkuMenus,$d(this.productDetails,this.filteredSkuMenus,t.currentGroupId));this.setState(m({},t,{sku:n}))}},{key:"selectedProducts",value:function(){return this.state.selectedProducts}},{key:"clearSelectedProduct",value:function(e){var t=this.state.selectedProducts||{};if(e&&null!=t[e]){var n=m({},t);delete n[e],this.setSelectedProducts(n)}}},{key:"setPaywall",value:function(e,t,n){var i,a,r,o,s,l=m({},this.state,{formFactor:Ml(),selectedPaywall:e,selectedCampaign:n});(l=m({},l,null===(i=e.template)||void 0===i?void 0:i.initialState)).platformId=null!==(a=null===(r=io.getNamiConfig())||void 0===r?void 0:r.appPlatformID)&&void 0!==a?a:"";var u,d,c=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:m({},e.customObject,t.customObject),currentGroup:null!==(a=t.currentGroup)&&void 0!==a?a:""}}(l.launch,t,e.sku_menus);(this.filteredSkuMenus=null!==(o=e.sku_menus)&&void 0!==o?o:[],c.productGroups.length&&(this.filteredSkuMenus=this.filteredSkuMenus.filter(e=>c.productGroups.includes(e.ref))),""!==c.currentGroup&&l.groups.length&&null!==(s=e.template)&&void 0!==s&&s.displaySingleGroup)&&(l.currentGroupId=null!==(u=null===(d=l.groups.find(e=>e.ref==c.currentGroup))||void 0===d?void 0:d.id)&&void 0!==u?u:"");if(""===l.currentGroupId&&1===this.filteredSkuMenus.length){var h,f=l.groups.find(e=>e.ref==this.filteredSkuMenus[0].ref);l.currentGroupId=null!==(h=null==f?void 0:f.id)&&void 0!==h?h:l.currentGroupId}var v=$d(this.productDetails,this.filteredSkuMenus,l.currentGroupId);l.skuItems=v,l.launch=c,l.anySkuHasTrialOffer=jd(this.productDetails,this.filteredSkuMenus),l.anySkuHasPromoOffer=function(e,t){return!jd(e,t)&&t.flatMap(e=>e.products).some(t=>1==md("promoEligible",Bd(e,t.sku_ref_id)))}(this.productDetails,this.filteredSkuMenus),l.paywallId=e.id,l.sku=Od(this.productDetails,l,this.filteredSkuMenus,v),l.pageHistory=[l.currentPage],this.setState(l)}},{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 t,n,i,a,r,o,s,l,u,d=this.state.selectedCampaign,c=this.state.selectedPaywall;return{paywallId:null!==(t=null==c?void 0:c.id)&&void 0!==t?t:"",paywallName:null!==(n=null==c?void 0:c.name)&&void 0!==n?n:"",campaignId:null!==(i=null==d?void 0:d.rule)&&void 0!==i?i:"",campaignName:null!==(a=null==d?void 0:d.name)&&void 0!==a?a:"",campaignType:null!==(r=null==d?void 0:d.type)&&void 0!==r?r:"",campaignLabel:null!==(o=null==d?void 0:d.value)&&void 0!==o?o:"",campaignUrl:(null==d?void 0:d.type)===e.NamiCampaignRuleType.URL&&null!==(s=null==d?void 0:d.value)&&void 0!==s?s:"",segmentId:null!==(l=null==d?void 0:d.segment)&&void 0!==l?l:"",externalSegmentId:null!==(u=null==d?void 0:d.external_segment)&&void 0!==u?u:""}}},{key:"paywallId",value:function(){return this.state.paywallId}},{key:"setCurrentPage",value:function(e){if(e&&e!==this.state.currentPage){var t=this.state.pageHistory&&this.state.pageHistory.length?this.state.pageHistory:[this.state.currentPage];this.setState(m({},this.state,{currentPage:e,pageHistory:[...t,e]}))}}},{key:"canGoBackPage",value:function(){var e,t;return(null!==(e=null===(t=this.state.pageHistory)||void 0===t?void 0:t.length)&&void 0!==e?e:0)>1}},{key:"goBackPage",value:function(){var e=this.state.pageHistory&&this.state.pageHistory.length?[...this.state.pageHistory]:[this.state.currentPage];if(e.length<=1)return!1;e.pop();var t=e[e.length-1];return!!t&&(this.setState(m({},this.state,{currentPage:t,pageHistory:e})),!0)}},{key:"setCustomerAttribute",value:function(e){this.setState(m({},this.state,{customer:m({},this.state.customer,e)}))}},{key:"removeCustomerAttribute",value:function(e){var t=m({},this.state.customer);delete t[e],this.setState(m({},this.state,{customer:t}))}},{key:"setIsLoggedIn",value:function(e){this.setState(m({},this.state,{isLoggedIn:e}))}},{key:"setMediaList",value:function(e){this.setState(m({},this.state,{mediaList:e.reduce((e,t)=>m({},e,{[t.name]:t}))}))}},{key:"setSafeAreaTop",value:function(e){this.setState(m({},this.state,{safeAreaTop:e}))}},{key:"setSafeAreaBottom",value:function(e){this.setState(m({},this.state,{safeAreaBottom:e}))}},{key:"setFullScreenPresentation",value:function(e){this.setState(m({},this.state,{fullScreenPresentation:e}))}},{key:"setFormFactor",value:function(e){this.setState(m({},this.state,{formFactor:e}))}},{key:"getFormFactor",value:function(){return this.state.formFactor}},{key:"setPurchaseInProgress",value:function(e){this.setState(m({},this.state,{purchaseInProgress:e}))}},{key:"setPurchase",value:function(e,t){this.setState(m({},this.state,{purchaseInProgress:e,productBeingPurchased:t}))}},{key:"setTimeSpentOnPaywall",value:function(e){this.setState(m({},this.state,{timeSpentOnPaywall:e}))}},{key:"setAppSuppliedVideoDetails",value:function({url:e,name:t}){this.setState(m({},this.state,{appSuppliedVideoUrl:e,appSuppliedVideoName:t}))}},{key:"resetAppSuppliedVideoDetails",value:function(){var e=m({},this.state);delete e.appSuppliedVideoUrl,delete e.appSuppliedVideoName,this.setState(e)}},{key:"setLaunchDetails",value:function(e,t){this.setState(m({},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(m({},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(m({},this.state,{userInteractionEnabled:e})),this.emitEvent("user-interaction-changed",{enabled:e})}},{key:"setUserTags",value:function(e){this.setState(m({},this.state,{customer:m({},this.state.customer,e)}))}},{key:"setCurrentSlideIndex",value:function(e){this.setState(m({},this.state,{currentSlideIndex:e}))}}],[{key:"create",value:function(e,t,i){var a=new n(e,t,i);return this.providers.push(a),a}},{key:"remove",value:function(e){this.providers=this.providers.filter(t=>t!==e)}},{key:"reset",value:function(){this.providers=[]}},{key:"currentProvider",get:function(){return n.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)}),vc=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}}])}(fc);gc.providers=[];var yc=c(function e(){o(this,e),this.refIdToPurchasedSKUs={},this.refIdToRelatedSKUs={},this.refIdToActivePurchases={}});yc.instance=new yc;var bc=()=>Kr(Ei([...io.getNamiEntitlements(pt),...io.getNamiEntitlements(Tt)]),"referenceId"),wc=()=>{vu.getInstance().emit(li,bc())};function kc(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 Sc=function(){return c(function e(){o(this,e)},[{key:"fetchActiveEntitlements",value:function(){var e,t,n;return k(function(i){for(;;)switch(i.n){case 0:if(e=null,Gu()||Js(Pe.THIRD_PARTY_TRANSACTIONS)||!Js(Pe.ENTITLEMENT_MANAGEMENT)){i.n=3;break}if(null==(t=io.getDevice())||!t.id){i.n=2;break}return i.n=1,a(this.getAPIEntitlements(t.id));case 1:n=i.v,(e=null==n?void 0:n.results)&&(io.setActiveEntitlements(ft,e),this.invokeActiveEntitlementsHandler(e));case 2:i.n=4;break;case 3:Gu()&&Si.debug("Skipping active entitlements update - anonymous mode");case 4:return i.a(2,e)}},null,this,null,Promise)}},{key:"getAPIEntitlements",value:function(e){var t,n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:return t=`device/${e}/active_entitlements/`,n={},r.p=1,r.n=2,a($l.instance.fetchAPI(t));case 2:n=r.v,r.n=4;break;case 3:throw r.p=3,i=r.v,Si.error(So(i.status,t)),i;case 4:return r.a(2,n)}},null,null,[[1,3]],Promise)}},{key:"invokeActiveEntitlementsHandler",value:function(e){el()&&(e=>{io.setNamiEntitlements(pt,e);var t=io.getNamiEntitlements(Tt),n=new Set(e.map(e=>e.referenceId)),i=t.filter(e=>{var t=n.has(e.referenceId);return t&&Si.debug(`Server granted verified entitlement for ${e.referenceId}, so replacing provisional entitlement grant.`),!t});i.length!==t.length&&io.setNamiEntitlements(Tt,i),wc()})(e.map(e=>(e=>{var t=e.entitlement_ref_id;return{name:e.name||"",desc:e.description||"",namiId:"",referenceId:t,relatedSkus:yc.instance.refIdToRelatedSKUs[t]||[],activePurchases:yc.instance.refIdToActivePurchases[t]||[],purchasedSkus:yc.instance.refIdToPurchasedSKUs[t]||[],expires:e.expires?new Date(e.expires).valueOf():0}})(e)))}}])}();Sc.instance=new Sc;var Ec=function(){return c(function e(){o(this,e)},[{key:"fetchCustomerJourneyState",value:function(){var e,t,n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:if(!Gu()){r.n=1;break}return Si.debug("Skipping customer journey state update - anonymous mode"),r.a(2,null);case 1:if(null!=(e=io.getDevice())&&e.id){r.n=2;break}return r.a(2,null);case 2:return t=`device/${e.id}/profile/`,n=null,r.p=3,r.n=4,a($l.instance.fetchAPI(t,void 0,0));case 4:n=r.v,r.n=6;break;case 5:throw r.p=5,i=r.v,Si.error(So(i.status,t)),i;case 6:if(!n){r.n=7;break}return io.setCustomerJourneyState(n.customer_journey_state),r.a(2,n.customer_journey_state);case 7:return r.a(2,null)}},null,null,[[3,5]],Promise)}}])}();Ec.instance=new Ec;var Pc="[NamiStartup]",_c=function(){return c(function e(){o(this,e),this.enabled=!1,this.t0=0,this.lastMark=0,this.decodeDuration=0,this.processDuration=0,this.placements=0,this.firstLaunchLogged=!1},[{key:"start",value:function(e){var t;this.enabled=null!==(t=null==e?void 0:e.includes(Sn))&&void 0!==t&&t,this.enabled&&(this.t0=Date.now(),this.lastMark=this.t0,this.decodeDuration=0,this.processDuration=0,this.placements=0,this.firstLaunchLogged=!1)}},{key:"mark",value:function(e,t){if(this.enabled){var n=Date.now(),i=n-this.lastMark;this.lastMark=n,"initial_config_decoded"===e?this.decodeDuration=i:"initial_processed"===e&&(this.processDuration=i,void 0!==(null==t?void 0:t.count)&&(this.placements=t.count));var a=t?" "+Object.entries(t).map(([e,t])=>`${e}=${t}`).join(" "):"";if("ready"===e){var r=n-this.t0;Si.info(`${Pc} phase=${e} ms=${i} total_to_ready=${r}${a}`),Si.info(`${Pc} SUMMARY total_to_ready=${r} decode=${this.decodeDuration} process=${this.processDuration} placements=${this.placements}`)}else Si.info(`${Pc} phase=${e} ms=${i}${a}`)}}},{key:"firstLaunchLookup",value:function(e,t){if(!this.enabled||this.firstLaunchLogged)return t();this.firstLaunchLogged=!0;var n=Date.now(),i=t(),a=Date.now()-n;return Si.info(`${Pc} phase=first_launch_lookup ms=${a} label=${e}`),i}},{key:"serverFetch",value:function(e){var t,n,i;return k(function(r){for(;;)switch(r.n){case 0:if(this.enabled){r.n=1;break}return r.a(2,e());case 1:return t=Date.now(),r.n=2,a(e());case 2:return n=r.v,i=Date.now()-t,Si.info(`${Pc} phase=server_fetch ms=${i} campaigns=${n.length}`),r.a(2,n)}},null,this,null,Promise)}}])}(),Tc=new _c,Mc=function(){return c(function e(){o(this,e),this.inMemoryAnonymousMode=!1,this.isFirstSession=!1,this.startupDisabled=!1,this.hasInitialConfig=!1,this.lastConfig=null,this.lastStartupRunAt=0,this.startupInFlight=!1,Uu=this},[{key:"setInMemoryAnonymousMode",value:function(e){this.inMemoryAnonymousMode=e,Si.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 io.getAnonymousMode()||this.inMemoryAnonymousMode}},{key:"getIsFirstSession",value:function(){return this.isFirstSession}},{key:"isStartupDisabled",value:function(){return this.startupDisabled}},{key:"init",value:function(e){var t;return k(function(n){for(;;)switch(n.p=n.n){case 0:return this.isFirstSession=null===io.getDevice()&&!io.getAnonymousMode(),this.startupDisabled=!1,this.hasInitialConfig=Object.keys(null!==(t=e.initialConfig)&&void 0!==t?t:{}).length>0,this.setInitialValues(e),this.lastConfig=e,this.lastStartupRunAt=Date.now(),this.startupInFlight=!0,n.p=1,n.n=2,a(this.fetchPlatformConfig());case 2:if(n.v){n.n=3;break}return n.a(2);case 3:return n.n=4,a(this.runStartupAfterConfig(e));case 4:return n.p=4,this.startupInFlight=!1,n.f(4);case 5:return n.a(2)}},null,this,[[1,,4,5]],Promise)}},{key:"resume",value:function(){var e,t,n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:if(this.lastConfig&&!this.startupInFlight){r.n=1;break}return r.a(2);case 1:if(!(Date.now()-this.lastStartupRunAt<zn)){r.n=2;break}return Si.debug("Resuming too quickly to call the service."),r.a(2);case 2:return e=this.lastConfig,t=this.startupDisabled,this.lastStartupRunAt=Date.now(),this.startupInFlight=!0,this.startupDisabled=!1,r.p=3,r.n=4,a(this.fetchPlatformConfig());case 4:if(n=!r.v){r.n=5;break}n=!t;case 5:if(!n){r.n=6;break}return r.a(2);case 6:return Si.info("Usable app config on resume - completing the startup that stopped at launch"),r.n=7,a(this.runStartupAfterConfig(e));case 7:r.n=9;break;case 8:r.p=8,i=r.v,Si.warn(`Resume refresh failed: ${i}`);case 9:return r.p=9,this.startupInFlight=!1,r.f(9);case 10:return r.a(2)}},null,this,[[3,8,9,10]],Promise)}},{key:"runStartupAfterConfig",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.initAndFetchRequiredData(e));case 1:Vu.instance.startSession();case 2:return t.a(2)}},null,this,null,Promise)}},{key:"clearResumeState",value:function(){this.lastConfig=null,this.lastStartupRunAt=0,this.startupDisabled=!1}},{key:"fetchPlatformConfig",value:function(){var e;return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(Wu.instance.fetchConfigForStartup(this.hasInitialConfig));case 1:if((e=t.v).usable){t.n=2;break}return this.startupDisabled=!0,Si.error(`Nami startup stopped: ${e.reason}`),t.a(2,!1);case 2:return t.a(2,!0)}},null,this,null,Promise)}},{key:"setInitialValues",value:function(e){var t=m({},e);delete t.initialConfig,io.clearSessionId(),io.setNamiConfig(t),io.setLanguageCode(e.namiLanguageCode),io.setPurchaseChannel(e.purchaseChannel);var n,i=e.initialConfig;if(i.appConfig||i.platform_config){var a=(null==i?void 0:i.appConfig)||(null==i?void 0:i.platform_config);a&&io.setAppConfig(yt,a)}null!=i&&i.paywalls&&(io.setPaywalls(St,i.paywalls.map(e=>m({},e,{fetchSource:"initialConfig"}))),null!==(n=i.campaign_rules)&&void 0!==n&&n.length&&Ou.instance.seedFromInitialConfig(i.campaign_rules,i.paywalls));null!=i&&i.products&&io.setProducts(Pt,i.products)}},{key:"initAnonymousDevice",value:function(){return{deviceId:yu.instance.getOrCreateAnonymousUUID(),deviceTask:null}}},{key:"initIdentifiedDevice",value:function(e){var t=m({},Tl(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)?Cl(i):void 0}}}(e.namiCommands),i=yu.instance.createOrUpdateDevice(t,n,this);return{deviceId:i.id,deviceTask:i.device}}},{key:"initAndFetchRequiredData",value:function(e,t=0,n=1){var i,r,o,s,l,u,d,c,h,m,f,v;return k(function(p){for(;;)switch(p.n){case 0:if(s=e.initialConfig,l=null!==(i=e.formFactor)&&void 0!==i?i:Ml(),u=this.isAnonymousMode(),d=u?this.initAnonymousDevice():this.initIdentifiedDevice(e),c=d.deviceId,h=d.deviceTask,m=Dl(c),s.campaign_rules&&(f=Yl(s.campaign_rules,m,l),io.setCampaignRules(wt,f),Tc.mark("initial_processed",{count:f.length})),!h){p.n=1;break}return p.n=1,a(h);case 1:if(pu.instance.configure(l,m,e.namiCommands),Zs(),v=Promise.all([bu.instance.fetchProducts(),Ec.instance.fetchCustomerJourneyState(),Sc.instance.fetchActiveEntitlements(),Tc.serverFetch(()=>this.fetchCampaignsAndPaywalls())]).catch(i=>{var r;return k(function(o){for(;;)switch(o.n){case 0:if(!(i instanceof oo)){o.n=3;break}if(io.resetDevice(),!(t<n)){o.n=2;break}return r=100*Math.pow(2,t),o.n=1,a(new Promise(e=>setTimeout(e,r)));case 1:return o.a(2,this.initAndFetchRequiredData(e,t+1,n));case 2:if(u){o.n=3;break}return Si.warn(`Max retries reached for ConflictError. ${i.message}`),this.setInMemoryAnonymousMode(!0),o.a(2,this.initAndFetchRequiredData(e,0,n));case 3:throw i;case 4:return o.a(2)}},null,this,null,Promise)}),null!==(r=s.campaign_rules)&&void 0!==r&&r.length&&null!==(o=s.paywalls)&&void 0!==o&&o.length){p.n=2;break}return p.n=2,a(v);case 2:v.then(()=>this.reRenderPaywall());case 3:return p.a(2)}},null,this,null,Promise)}},{key:"fetchCampaignsAndPaywalls",value:function(){var e,t,n,i,r,o,s,l,u,d,c,h,m,f,v,p;return k(function(g){for(;;)switch(g.n){case 0:return e=pu.instance,t=Ou.instance,n=Date.now(),i=Date.now(),g.n=1,a(e.fetchCampaignRulesRaw());case 1:return r=g.v,o=r.campaigns,s=r.fromNetwork,l=Date.now()-i,g.n=2,a(Promise.all(o.filter(e=>{var t;return(null===(t=e.flow)||void 0===t?void 0:t.url)&&!e.flow.object}).map(e=>{var t,n;return k(function(i){for(;;)switch(i.p=i.n){case 0:return i.p=0,i.n=1,a(Iu(e.flow.url));case 1:t=i.v,e.flow.object=t.data,i.n=3;break;case 2:i.p=2,n=i.v,Si.warn(`Error fetching flow object from ${e.flow.url}: ${n}`);case 3:return i.a(2)}},null,null,[[0,2]],Promise)})));case 2:if(u=!e.useLegacyPaywallFetch&&pu.hasPaywallUrls(o),c=null,h=Date.now(),!u||s){g.n=3;break}Si.info("Paywall resolution skipped: campaign_rules were served from the stored copy"),d=jl(),g.n=7;break;case 3:if(!u){g.n=5;break}return m=pu.extractPaywallUrls(o),g.n=4,a(t.resolvePaywallsByUrls(m));case 4:c=g.v,d=c.paywalls,Zr.reconcile(new Set(m)),g.n=7;break;case 5:return g.n=6,a(t.fetchPaywalls());case 6:d=g.v;case 7:return f=Date.now()-h,v=Date.now()-n,u&&!c||(p=c?`, urls=${c.urls}, hashed=${c.hashed}, cache_hits=${c.cacheHits}, fetched=${c.fetched}, cache_after_fetch_failure=${c.cacheAfterFetchFailure}, failed=${c.failed}`:"",Si.debug(`Paywall fetch telemetry: strategy=${u?"individual":"bulk"}, count=${d.length}${p}, total=${v}ms, campaigns=${l}ms, paywalls=${f}ms`+(c?`, retry_count=${c.retryCount}`:""))),g.a(2,e.finalizeCampaignRules(o,d))}},null,null,null,Promise)}},{key:"reRenderPaywall",value:function(){we().ui.reRenderPaywall()}}])}();function Ac(e){return Array.isArray(e)?e.map(Ac):e&&"object"==typeof e?Object.entries(e).reduce((e,[t,n])=>(void 0!==n&&(e[t]=Ac(n)),e),{}):e}function Dc(e,t){return gu(Ac(e),Ac(t))}Mc.instance=new Mc;var xc=function(){return c(function e(){o(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?io.setNamiProfile({externalId:this.externalId}):io.removeNamiProfile(),this}},{key:"load",value:function(){var e=io.getNamiProfile();e&&(this.externalId=e.externalId),gc.setIsLoggedIn(!!this.externalId)}},{key:"loginLocal",value:function(e){this.setExternalId(e).save(),gc.setIsLoggedIn(!0)}},{key:"loginRemote",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:return n.n=1,a($l.instance.login(e));case 1:(t=n.v).external_id&&t.external_id!==this.externalId&&this.setExternalId(t.external_id).save();case 2:return n.a(2)}},null,this,null,Promise)}},{key:"logoutLocal",value:function(){this.setExternalId(void 0).save(),gc.setIsLoggedIn(!1)}},{key:"logoutRemote",value:function(){return k(function(e){for(;;)switch(e.n){case 0:return e.n=1,a($l.instance.logout());case 1:return e.a(2)}},null,null,null,Promise)}},{key:"login",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return this.loginLocal(e),t.n=1,a(this.loginRemote(e));case 1:return t.a(2)}},null,this,null,Promise)}},{key:"logout",value:function(){return k(function(e){for(;;)switch(e.n){case 0:return this.logoutLocal(),e.n=1,a(this.logoutRemote());case 1:return e.a(2)}},null,this,null,Promise)}}])}();xc.instance=new xc;var Cc,Ic,Lc=function(){function e(){o(this,e)}return c(e,[{key:"previous",get:function(){return this._previous}},{key:"record",value:function(e){this._previous=this._current,this._current=e}},{key:"reset",value:function(){this._current=void 0,this._previous=void 0}}],[{key:"shared",get:function(){return this._shared||(this._shared=new e),this._shared}}])}(),Rc=function(){function e(){o(this,e),Cc.set(this,!1),Ic.set(this,null),this.maxLogging=!1}return c(e,[{key:"isInitialized",get:function(){return Se(this,Cc,"f")||null!=io.getNamiConfig()}},{key:"listenForAppForeground",value:function(){var e,t,n;Se(this,Ic,"f")||Ee(this,Ic,null!==(e=null===(t=(n=we().device).onAppForeground)||void 0===t?void 0:t.call(n,()=>{Mc.instance.resume()}))&&void 0!==e?e:null)}},{key:"initializeSDK",value:function(t){var n,i,r,o,s,l,u,d,c,h;return k(function(f){for(;;)switch(f.n){case 0:if(o=!1,s=!1,l=Se(this,Cc,"f")?io.getNamiConfig():null,Si.setLogger(t.logLevel),e.instance.maxLogging=null!==(n=t.maxLogging)&&void 0!==n&&n,null===l){f.n=3;break}if(delete(u=m({},t)).initialConfig,!Dc(u,l)){f.n=1;break}return Si.warn("Nami SDK is already configured, ignoring this configure call."),f.a(2,{sdkInitialized:!0,configureState:ni});case 1:s=!0;case 2:d=qs(t.namiCommands),c=qs(l.namiCommands),t.appPlatformID==l.appPlatformID&&d==c||(o=!0),t.namiLanguageCode===l.namiLanguageCode&&t.logLevel==l.logLevel||(s=!0);case 3:return o&&(Si.info("SDK full reconfigure called"),io.resetDevice()),Ee(this,Cc,!0),$l.configure(t),this.listenForAppForeground(),f.n=4,a(Mc.instance.init(t));case 4:return Si.info("SDK successfully initialized!"),h=s||o?ei:Qn,null===(i=(r=we().ui).postConfigure)||void 0===i||i.call(r),Tc.mark("ready"),f.a(2,{sdkInitialized:!0,configureState:h})}},null,this,null,Promise)}}],[{key:"sdkVersion",value:function(){return Ae}},{key:"sdkPackageVersion",value:function(){return xe}},{key:"reset",value:function(){var t,n,i,r,o;return k(function(s){for(;;)switch(s.n){case 0:return io.clearAll(),Zr.purgeAll(),Hu(),Ee(e.instance,Cc,!1),null===(t=Se(r=e.instance,Ic,"f"))||void 0===t||t.call(r),Ee(e.instance,Ic,null),Mc.instance.clearResumeState(),xc.instance.setExternalId(void 0),gc.reset(),$l.reset(),pu.instance.reset(),Lc.shared.reset(),s.n=1,a(Promise.resolve().then(function(){return Uh}));case 1:o=s.v,o.NamiFlowManager.reset(),null===(n=(i=we().ui).onReset)||void 0===n||n.call(i);case 2:return s.a(2)}},null,null,null,Promise)}},{key:"configure",value:function(t){return k(function(n){for(;;)switch(n.n){case 0:if(Tc.start(t.namiCommands),t.appPlatformID){n.n=1;break}throw new lo;case 1:return this.setInitialConfig(t),Tc.mark("initial_config_decoded"),n.n=2,a(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){Si.debug("[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 Si.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=il(e.initialConfig.initial_config);n?e.initialConfig=n:(e.initialConfig={},Si.error("Failed to parse NamiConfiguration.initialConfig as base64-gzipped JSON"))}}else e.initialConfig={}}}])}();Cc=new WeakMap,Ic=new WeakMap,Rc.instance=new Rc;var Fc,Oc,$c,Nc=new Set(["fullscreen","sheet","compact_sheet","modal"]);e.NamiPaywallManagerEvents=void 0,(Fc=e.NamiPaywallManagerEvents||(e.NamiPaywallManagerEvents={})).BuySku="RegisterBuySKU",Fc.Close="PaywallCloseRequested",Fc.SignIn="PaywallSignInRequested",Fc.Restore="PaywallRestoreRequested",Fc.DeeplinkAction="PaywallDeeplinkAction",e.NamiPaywallAction=void 0,(Oc=e.NamiPaywallAction||(e.NamiPaywallAction={})).BUY_SKU="BUY_SKU",Oc.SELECT_SKU="SELECT_SKU",Oc.RESTORE_PURCHASES="RESTORE_PURCHASES",Oc.SIGN_IN="SIGN_IN",Oc.CLOSE_PAYWALL="CLOSE_PAYWALL",Oc.SHOW_PAYWALL="SHOW_PAYWALL",Oc.PURCHASE_SELECTED_SKU="PURCHASE_SELECTED_SKU",Oc.PURCHASE_SUCCESS="PURCHASE_SUCCESS",Oc.PURCHASE_FAILED="PURCHASE_FAILED",Oc.PURCHASE_CANCELLED="PURCHASE_CANCELLED",Oc.PURCHASE_PENDING="PURCHASE_PENDING",Oc.PURCHASE_UNKNOWN="PURCHASE_UNKNOWN",Oc.PURCHASE_DEFERRED="PURCHASE_DEFERRED",Oc.DEEPLINK="DEEPLINK",Oc.TOGGLE_CHANGE="TOGGLE_CHANGE",Oc.PAGE_CHANGE="PAGE_CHANGE",Oc.SLIDE_CHANGE="SLIDE_CHANGE",Oc.COLLAPSIBLE_DRAWER_OPEN="COLLAPSIBLE_DRAWER_OPEN",Oc.COLLAPSIBLE_DRAWER_CLOSE="COLLAPSIBLE_DRAWER_CLOSE",Oc.VIDEO_STARTED="VIDEO_STARTED",Oc.VIDEO_PAUSED="VIDEO_PAUSED",Oc.VIDEO_RESUMED="VIDEO_RESUMED",Oc.VIDEO_ENDED="VIDEO_ENDED",Oc.VIDEO_CHANGED="VIDEO_CHANGED",Oc.VIDEO_MUTED="VIDEO_MUTED",Oc.VIDEO_UNMUTED="VIDEO_UNMUTED",Oc.COUNTDOWN_TIMER_COMPLETED="COUNTDOWN_TIMER_COMPLETED",Oc.UNKNOWN="UNKNOWN",e.LaunchCampaignError=void 0,($c=e.LaunchCampaignError||(e.LaunchCampaignError={})).DEFAULT_CAMPAIGN_NOT_FOUND="Default campaign not found",$c.LABELED_CAMPAIGN_NOT_FOUND="Labeled campaign not found",$c.CAMPAIGN_DATA_NOT_FOUND="Campaign data not found",$c.PAYWALL_ALREADY_DISPLAYED="Paywall is already being displayed",$c.SDK_NOT_INITIALIZED="SDK has not been initialized",$c.PAYWALL_COULD_NOT_DISPLAY="Failed to display paywall",$c.URL_CAMPAIGN_NOT_FOUND="URL campaign not found",$c.PRODUCT_DATA_NOT_FOUND="Product data not found",$c.PRODUCT_GROUPS_NOT_FOUND="Product groups not found",$c.FLOW_SCREEN_DATA_UNAVILABLE="Flow unavailable due to missing screen data";var Wc,jc="entry",Bc="screen",zc="branch",Uc="exit",Hc="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.SET_TAGS_FROM_FORM="setTagsFromForm",e.PAUSE="flowPause",e.RESUME="flowResume",e.SET_LAUNCH_CONTEXT="setLaunchContext",e.SET_FLOW_PATH="setFlowPath"}(Wc||(Wc={}));var Gc="__handoff_sequence__",Vc={Push:"push",Location:"location",Tracking:"att",Deeplink:"deeplink",Complete:"complete",SignIn:"signin",Restore:"restore",SignInMvpd:"signin_mvpd",BuySku:"buysku",UserData:"userdata"};var Kc={Push:"push",Location:"location",Tracking:"tracking",Camera:"camera",Microphone:"microphone",Photos:"photos",Contacts:"contacts",Bluetooth:"bluetooth",Calendar:"calendar",Biometrics:"biometrics",Health:"health",Motion:"motion",Speech:"speech",LocalNetwork:"localNetwork"},Xc={[Kc.Push]:"push_authorized",[Kc.Location]:"location_authorized",[Kc.Tracking]:"tracking_authorized"},Yc="__buy_sku__",qc="__default__",Jc="__appear__",Qc="__disappear__",Zc="__login_success__",eh="__login_failure__",th="__logout_success__",nh="__logout_failure__",ih="__purchase_success__",ah="__purchase_failure__",rh="__remoteback__",oh="__tag_update__",sh="__permission_granted__",lh="and",uh="or",dh="i_contains",ch="equals",hh="i_equals",mh="not_equals",fh="not_i_equals",vh="not_contains",ph="contains",gh="set",yh="not_set",bh="greater_than",wh="greater_than_or_equal_to",kh="less_than",Sh="less_than_or_equal_to";function Eh(e){if("boolean"==typeof e)return null;if("number"==typeof e)return Number.isFinite(e)?e:null;if("string"==typeof e){var t=e.trim();if(""===t)return null;var n=Number(t);return Number.isFinite(n)?n:null}return null}var Ph=function(){function e(){o(this,e),this.resolvers=new Map,this.namespaceResolvers=new Map}return c(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 lh:return i.every(e=>e);case uh: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 lh:for(var i,a=h(n);!(i=a()).done;){var r=i.value;if(!this.evaluateFilter(r))return!1}return!0;case uh:for(var o,s=h(n);!(o=s()).done;){var l=o.value;if(this.evaluateFilter(l))return!0}return!1;default:for(var u,d=h(n);!(u=d()).done;){var c=u.value;if(!this.evaluateFilter(c))return!1}return!0}}},{key:"evaluateFilter",value:function(e){var t=this.resolve(e.identifier);if(Rc.instance.maxLogging&&Si.debug(`[NamiConditionEvaluator] resolve(${e.identifier}) → ${JSON.stringify(t)} (type: ${typeof t})`),e.operator===gh)return null!=t;if(e.operator===yh)return null==t;if(null==t)return Rc.instance.maxLogging&&Si.debug(`[NamiConditionEvaluator] ${e.identifier} resolved to null — registeredNamespaces: [${[...this.namespaceResolvers.keys()].join(", ")}]`),!![mh,fh,vh].includes(e.operator);switch(e.operator){case dh:return Array.isArray(t)?e.values.some(e=>"string"==typeof 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 ch:return e.values.some(e=>this.strictEquals(t,e,!1));case hh:return e.values.some(e=>this.strictEquals(t,e,!0));case mh:return e.values.every(e=>!this.strictEquals(t,e,!1));case fh:return e.values.every(e=>!this.strictEquals(t,e,!0));case ph:return!(!Array.isArray(t)&&"string"!=typeof t)&&e.values.some(e=>"string"==typeof e&&t.includes(e));case vh:return Array.isArray(t)?e.values.every(e=>!("string"==typeof e&&t.includes(e))):e.values.every(e=>"string"!=typeof t||"string"!=typeof e||!t.includes(e));case bh:case wh:case kh:case Sh:var n=Eh(t);return null===n?(this.log(`Resolved value is not numerically comparable for ${e.operator}`),!1):e.values.some(t=>{var i=Eh(t);if(null===i)return!1;switch(e.operator){case bh:return n>i;case wh:return n>=i;case kh:return n<i;default:return n<=i}});default:return this.log(`Unsupported operator: ${e.operator}`),!1}}},{key:"strictEquals",value:function(e,t,n){return"string"==typeof e&&"string"==typeof t?n?0===e.localeCompare(t,void 0,{sensitivity:"accent"}):e===t:("boolean"==typeof e&&"boolean"==typeof t||"number"==typeof e&&"number"==typeof t)&&e===t}},{key:"resolve",value:function(e){var t=this.resolveRaw(e);if(void 0!==t)return Rc.instance.maxLogging&&Si.debug(`[NamiConditionEvaluator] resolve(${e}) — exact hit: ${JSON.stringify(t)}`),t;var n=e.lastIndexOf(".");if(-1===n);else{var i=e.slice(0,n),a=e.slice(n+1),r=this.resolveRaw(i);if(void 0!==r){var o=this.extractProperty(a,r);return Rc.instance.maxLogging&&Si.debug(`[NamiConditionEvaluator] resolve(${e}) — fallback: base=${i} → ${typeof r}, extract(.${a}) → ${JSON.stringify(o)}`),o}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=h(n);!(t=i()).done;){var a=t.value;if(e.startsWith(a)){var r=this.namespaceResolvers.get(a);if(r){var o=r(e);return Rc.instance.maxLogging&&Si.debug(`[NamiConditionEvaluator] resolveRaw(${e}) — ns=${a} → ${JSON.stringify(o)}`),o}}}}},{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){Si.debug(`[NamiConditionEvaluator] ${e}`)}}],[{key:"shared",get:function(){return e.instance||(e.instance=new e),e.instance}}])}(),_h=function(){return c(function e(){o(this,e)},[{key:"register",value:function(){Ph.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=h(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}}])}(),Th=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t)).namespace="LaunchContext",i.context=e,i.campaign=n,i.register(),i}return p(t,e),c(t,[{key:"resolveValue",value:function(e){var t,n,i,a;if("placement"===e)return null!==(t=null===(n=this.campaign)||void 0===n?void 0:n.value)&&void 0!==t?t:void 0;if("tags"===e)return null!==(i=null===(a=this.campaign)||void 0===a?void 0:a.placement_tags)&&void 0!==i?i:void 0;if(e.startsWith("customAttributes.")){var r=e.substring(17);return this.resolveKeyPath(r,this.context.customAttributes)}if(e.startsWith("customObject.")){var o=e.substring(13);return this.resolveKeyPath(o,this.context.customObject)}return this.resolveKeyPath(e,{customAttributes:this.context.customAttributes,customObject:this.context.customObject,productGroups:this.context.productGroups})}}])}(_h),Mh=function(e){function t(){var e,n,i,a;o(this,t),(a=r(this,t)).namespace="Device";var s=Intl.DateTimeFormat().resolvedOptions().locale.split("-")[1]||"",l=Intl.DateTimeFormat().resolvedOptions().timeZone,u=Tl(),d=we().device.getScreenInfo();return a.context={osName:u.os_name,osVersion:u.os_version,appVersion:u.extended_platform_version,sdkVersion:u.sdk_version,deviceModel:u.device_model,screenWidth:Math.round(d.width),screenHeight:Math.round(d.height),formFactor:u.form_factor,tvQuality:a.tvQuality(null!==(e=u.form_factor)&&void 0!==e?e:"desktop",d),tvResolution:a.tvResolution(null!==(n=u.form_factor)&&void 0!==n?n:"desktop",d),screenSize:a.screenSizeTier(null!==(i=u.form_factor)&&void 0!==i?i:"desktop",d),language:u.language,country:s,timezone:l},a.register(),a}return p(t,e),c(t,[{key:"screenSizeTier",value:function(e,t){var n=Math.round(t.width*t.scale),i=Math.round(t.height*t.scale),a=Math.max(n,i);switch(e){case"phone":return a<1136?"tiny":a<1334?"small":a<1920?"medium":a<2560?"large":"huge";case"tablet":return a<2048?"medium":a<2732?"large":"huge";case"television":return a<1920?"medium":a<3840?"large":"huge";case"desktop":return a<1440?"small":a<2560?"medium":a<3840?"large":"huge";default:return"medium"}}},{key:"tvQuality",value:function(e,t){if("television"!==e)return"";var n=Math.round(t.width*t.scale),i=Math.round(t.height*t.scale),a=Math.max(n,i),r=Math.min(n,i);return a>=3840||r>=2160?"4K":a>=1920||r>=1080?"1080p":"720p"}},{key:"tvResolution",value:function(e,t){if("television"!==e)return"";var n=Math.round(t.width*t.scale),i=Math.round(t.height*t.scale),a=Math.max(n,i),r=Math.min(n,i);return r<720&&a<1280?"SD":r>=720&&r<1080&&a>=1280&&a<1920?"720p":r>=1080&&r<1440&&a>=1920&&a<2560?"1080p":r>=1440&&r<2160&&a>=2560&&a<3840?"1440p":r>=2160&&r<3e3&&a>=3840&&a<5e3?"4K":r>=3e3&&a>=5e3?"8K":"Unknown"}},{key:"resolveValue",value:function(e){return this.resolveKeyPath(e,this.context)}}])}(_h),Ah=[/(^|_)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],Dh=function(){function e(){o(this,e),this.params={},"undefined"!=typeof window&&this.setSearchParams()}return c(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=>Ah.some(t=>t.test(e)))(a))){var r=this.safeValue(i);r&&(t[a]=r,n.add(a))}},o=h(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()}}])}();Dh._instance=null;var xh=()=>Dh.instance.params;function Ch(e){if(null!=e&&""!==e){if("boolean"==typeof e)return e?"true":"false";if("number"==typeof e){if(!Number.isFinite(e))return;return String(e)}return String(e)}}var Ih,Lh=/\{\{\s*([^}]+?)\s*\}\}/g,Rh=/\$\{[^}]+\}/g,Fh=function(){return c(function e(t){o(this,e),this.flowManager=t,this.urlParams=xh()},[{key:"currentScreenPaywall",value:function(){var e,t,n=null===(e=this.flowManager.currentFlow)||void 0===e||null===(e=e.currentFlowStep)||void 0===e?void 0:e.screen;if(n)return(null===(t=this.screenPaywallLookup)||void 0===t?void 0:t.screenId)!==n&&(this.screenPaywallLookup={screenId:n,paywall:zl(n)}),this.screenPaywallLookup.paywall}},{key:"resolve",value:function(e){var t,n,i,a,r,o,s,l,u,d,c,h,m,f,v,p,g,y,b,w,k=this.flowManager.currentFlow,S=null==k?void 0:k.component;if(e.startsWith("launchContext.")){var E=null==k?void 0:k.context;if(E){var P=e.substring(14),_=new Th(E,null==k?void 0:k.campaign).resolveValue(P);return Array.isArray(_)?_.join(","):null==_?void 0:_.toString()}}else{if(e.startsWith("form.")){var T,M=e.substring(5);return Ch(null===(T=gc.currentProvider)||void 0===T?void 0:T.state.formStates[M])}if(e.startsWith("sku.")){var A=null==k?void 0:k.purchasedSku;if(!A)return;var D=e.substring(4);switch(D){case"sku_ref_id":return A.skuRefId;case"name":return A.name;case"entitlement_ref_id":return null!==(t=null===(n=A.entitlements[0])||void 0===n?void 0:n.entitlement_ref_id)&&void 0!==t?t:"";case"entitlement_name":return null!==(i=null===(a=A.entitlements[0])||void 0===a?void 0:a.name)&&void 0!==i?i:"";default:var x=md(D,A.productDetails);return null!=x?String(x):void 0}}switch(e){case"campaignId":return null==S||null===(r=S.campaign)||void 0===r?void 0:r.rule;case"campaignName":return null==S||null===(o=S.campaign)||void 0===o?void 0:o.name;case"campaignLabel":case"campaignPlacement":return null!==(s=null==S||null===(l=S.campaign)||void 0===l?void 0:l.value)&&void 0!==s?s:void 0;case"campaignSegment":case"campaignSegmentId":return null==S||null===(u=S.campaign)||void 0===u?void 0:u.segment;case"campaignExternalSegment":case"campaignExternalSegmentId":return null!==(d=null==S||null===(c=S.campaign)||void 0===c?void 0:c.external_segment)&&void 0!==d?d:void 0;case"pageName":return null!==(h=null===(m=this.currentScreenPaywall())||void 0===m?void 0:m.name)&&void 0!==h?h:null==S||null===(f=S.paywall)||void 0===f?void 0:f.name;case"pageId":return null!==(v=null==k||null===(p=k.currentFlowStep)||void 0===p?void 0:p.screen)&&void 0!==v?v:null==S||null===(g=S.paywall)||void 0===g?void 0:g.id;case"flowName":return null==k?void 0:k.name;case"flowId":return null==k?void 0:k.id;case"objectId":return null==S||null===(y=S.campaign)||void 0===y||null===(y=y.flow)||void 0===y?void 0:y.object_id;case"stepName":return null==k||null===(b=k.currentFlowStep)||void 0===b?void 0:b.name;case"buttonText":var C=null==k?void 0:k.currentButton;if(!C)return;var I=C.firstTextValue;if("function"!=typeof I)return;return I.call(C);case"slideNumber":var L=null==S?void 0:S.getSelectedSlideIndexForCurrentCarousel();return null!=L?`${L+1}`:void 0;case"productGroupId":return(null===(w=gc.currentProvider)||void 0===w?void 0:w.state.currentGroupId)||void 0;case"productGroupName":var R,F,O,$=null===(R=gc.currentProvider)||void 0===R?void 0:R.state;return null!==(F=null==$||null===(O=$.groups)||void 0===O||null===(O=O.find(e=>e.id===$.currentGroupId))||void 0===O?void 0:O.displayName)&&void 0!==F?F:void 0;case"productGroupRef":var N,W,j,B=null===(N=gc.currentProvider)||void 0===N?void 0:N.state;return null!==(W=null==B||null===(j=B.groups)||void 0===j||null===(j=j.find(e=>e.id===B.currentGroupId))||void 0===j?void 0:j.ref)&&void 0!==W?W:void 0;case"flowPath":return null==k?void 0:k.flowPath;default:return}}}},{key:"interpolateLiquidVariables",value:function(e){return e.replace(Lh,(e,t)=>{var n,i=null!==(n=this.resolve(t))&&void 0!==n?n:this.urlParams[t];return null!=i?i:""}).replace(Rh,"")}},{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])=>m({},e,{[t]:this.interpolateDeep(n)}),{}):e}}])}(),Oh=function(e){function t(){var e;return o(this,t),(e=r(this,t)).namespace="urlParams",e.context=xh(),e.register(),e}return p(t,e),c(t,[{key:"resolveValue",value:function(e){return Si.debug("[URLParamsResolver]","Resolving keyPath",e),this.resolveKeyPath(e,this.context)}}])}(_h),$h=function(e){function t(){var e;return o(this,t),(e=r(this,t)).namespace="state",e.register(),e}return p(t,e),c(t,[{key:"getContextProvider",value:function(){var e=gc.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)}}}])}(_h),Nh=function(e){function t(e){var n;return o(this,t),(n=r(this,t)).namespace="Placement",n.campaign=e,n.register(),n}return p(t,e),c(t,[{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=gc.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()}}}}])}(_h),Wh=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).namespace="LastLaunchContext",e}return p(t,e),c(t,[{key:"register",value:function(){_(t,"register",this)([])}},{key:"resolveValue",value:function(e){var t=Lc.shared.previous;if(t){if("placement"===e)return t.placementLabel;if("tags"===e)return t.tags;if(e.startsWith("customAttributes.")){var n=e.substring(17);return this.resolveKeyPath(n,t.customAttributes)}}}}])}(_h);!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"}(Ih||(Ih={}));var jh=e=>{var t;return k(function(n){for(;;)switch(n.p=n.n){case 0:if(!Gu()){n.n=1;break}return Si.info("Skipping transaction post - anonymous mode"),n.a(2);case 1:return n.p=1,n.n=2,a($l.instance.postConversion(e));case 2:n.n=4;break;case 3:n.p=3,t=n.v,Si.error("Error posting conversion",t);case 4:return n.a(2)}},null,null,[[1,3]],Promise)},Bh=function(){return c(function e(){o(this,e),this.emitter=vu.getInstance()},[{key:"sdkInitialized",get:function(){return Rc.instance.isInitialized}}],[{key:"allPaywalls",value:function(){if(!this.instance.sdkInitialized)throw new so;return Bl()}},{key:"setProductDetails",value:function(e){this.instance.productDetails=e,gc.setProductDetails(e)}},{key:"registerSignInHandler",value:function(t){return this.instance.emitter.addListener(e.NamiPaywallManagerEvents.SignIn,t),()=>{this.instance.emitter.removeListener(e.NamiPaywallManagerEvents.SignIn,t)}}},{key:"registerCloseHandler",value:function(t){return this.instance.emitter.addListener(e.NamiPaywallManagerEvents.Close,t),()=>{this.instance.emitter.removeListener(e.NamiPaywallManagerEvents.Close,t)}}},{key:"registerDeeplinkActionHandler",value:function(t){return this.instance.emitter.addListener(e.NamiPaywallManagerEvents.DeeplinkAction,t),()=>{this.instance.emitter.removeListener(e.NamiPaywallManagerEvents.DeeplinkAction,t)}}},{key:"registerBuySkuHandler",value:function(t){return el()&&Si.debug("This handler will not be invoked because this account's plan includes built-in purchase management. Contact support@namiml.com for details."),this.instance.emitter.addListener(e.NamiPaywallManagerEvents.BuySku,t),()=>{this.instance.emitter.removeListener(e.NamiPaywallManagerEvents.BuySku,t)}}},{key:"registerRestoreHandler",value:function(t){return this.instance.emitter.addListener(e.NamiPaywallManagerEvents.Restore,t),()=>{this.instance.emitter.removeListener(e.NamiPaywallManagerEvents.Restore,t)}}},{key:"buySkuComplete",value:function(e){var t,n,i,r,o,s;return k(function(l){for(;;)switch(l.p=l.n){case 0:if(gc.setPurchaseInProgress(!1),zh.instance.flowOpen&&(t=zh.instance.currentFlow,n=null==t?void 0:t.currentFlowStep,t&&n&&t.executeLifecycle(n,ih)),!Gh.inAnonymousMode()){l.n=1;break}return Si.debug("Skipping purchase validation - anonymous mode"),l.a(2);case 1:if(i=io.getSessionId(),r=io.getPurchaseImpression()){l.n=2;break}return Si.debug("Not sending paywall conversion call complete due to unknown impression"),l.a(2);case 2:return l.p=2,l.n=3,a(jh({purchase_env:"production",app_env:"production",impression:r,session:i,amount:e.amount,currency:e.currency,transaction_id:e.transactionId,sku:e.skuId}));case 3:l.n=5;break;case 4:l.p=4,o=l.v,Si.error("Error posting conversion",o);case 5:if(Js(Pe.THIRD_PARTY_TRANSACTIONS)){l.n=9;break}return l.p=6,l.n=7,a($l.instance.purchaseValidation({app_env:"production",payload:"",sku:e.skuId}));case 7:l.n=9;break;case 8:l.p=8,s=l.v,Si.error("Error validating purchase",s);case 9:return l.a(2)}},null,null,[[6,8],[2,4]],Promise)}},{key:"buySkuCancel",value:function(){Js(Pe.THIRD_PARTY_TRANSACTIONS)?gc.setPurchase(!1):Si.warn("Call this method is not needed for this app because Nami is responsible for purchase management. Contact support@nami.ml for details.")}},{key:"setAppSuppliedVideoDetails",value:function(e,t){Kl(e)?(Si.debug(`NamiPaywallManager: setAppSuppliedVideoDetails received valid url ${e}`),gc.setAppSuppliedVideoDetails({url:e,name:t})):Si.debug(`NamiPaywallManager: setAppSuppliedVideoDetails received invalid url ${e}`)}},{key:"allowUserInteraction",value:function(e){Si.debug(`NamiPaywallManager: allowUserInteraction called with ${e}`),gc.setUserInteractionEnabled(e)}}])}();Bh.instance=new Bh,Bh.emitter=vu.getInstance();var zh=function(){function e(){o(this,e),this.flowOpen=!1,this.lastAnimatedFlowProgress=new Map,this.navGraphCache=new WeakMap}return c(e,[{key:"hasHandoffHandler",get:function(){return!!this.handoffStepHandler}},{key:"deliverHandoff",value:function(t,n){var i=this.handoffStepHandler;if(i){var a={tag:t,completed:!1};this.pendingHandoff=a;i(t,n,n=>{if(a.completed)Si.warn(`[NamiFlowManager] complete() called more than once for handoff '${t}' — ignored`);else{var i=e.instance.pendingHandoff;i&&i!==a?Si.warn(`[NamiFlowManager] stale complete() for handoff '${t}' — a newer handoff ('${i.tag}') is pending; ignored`):(a.completed=!0,this.pendingHandoff===a&&(this.pendingHandoff=void 0),e.routeHandoffOutcome(null!=n?n:{kind:"done"}),e.resume())}})}}},{key:"resume",value:function(){e.resume()}},{key:"presentFlow",value:function(t,n,i){var a=new Zh(t,n,this,i);return this.flowOpen=!0,this.currentFlow=a,$l.impressionListener=t=>{var n;null===(n=e.instance.currentFlow)||void 0===n||n.bindImpression(t)},a}},{key:"finishFlow",value:function(){Rc.instance.maxLogging&&Si.debug("[NamiFlowManager] finishFlow() — closing flow"),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===Bc);if(0===t.length)return 0;var n=this.currentFlow.stepcrumbs.filter(e=>e.type===Bc);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=h(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),l=t.findIndex(e=>e.id===n.id);if(-1===s||n.id===i.id)return(l+1)/(o+2);var u=this.countForwardScreens(n,t,a),d=r+u;return Si.debug(`Branching progress: visited=${r}, remaining=${u}, 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 l=(n.get(e)||[]).filter(e=>{var n=t.findIndex(t=>t.id===e);return n>i});if(0!==l.length)for(var u,d=h(l);!(u=d()).done;){var c=u.value;o(c,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[Jc];if(!i)return null;for(var a,r=h(i);!(a=r()).done;)for(var o,s,l=h(null!==(o=a.value.action)&&void 0!==o?o:[]);!(s=l()).done;){var u,d=s.value;if((d.function===Wc.NAVIGATE||d.function===Wc.NEXT)&&null!=(null===(u=d.parameters)||void 0===u?void 0:u.delay)){var c=d.parameters.delay,m=Number(c);if(!isNaN(m)&&m>0)return m/1e3}}return null}}],[{key:"instance",get:function(){return e._instance||(e._instance=new e),e._instance}},{key:"reset",value:function(){var t=e.instance;t.currentFlow=void 0,t.flowOpen=!1,t.lastAnimatedFlowProgress=new Map,t.navGraphCache=new WeakMap,t.pendingHandoff=void 0}},{key:"registerStepHandoff",value:function(e){this.instance.handoffStepHandler=e;var t=e;return()=>{this.instance.handoffStepHandler===t&&(this.instance.handoffStepHandler=void 0)}}},{key:"routeHandoffOutcome",value:function(t){var n=e.instance.currentFlow,i=null==n?void 0:n.currentFlowStep;switch(t.kind){case"done":return;case"permission":if(!n)return;if(n.handoffState.permissions[t.permission]=t.granted,!t.granted)return;i&&n.executeLifecycle(i,sh);var a=Xc[t.permission];return void(a?n.completionSignal(a):Si.debug(`[NamiFlowManager] permission '${t.permission}' granted — no completion_result mapping yet (state/lifecycle only)`));case"purchase":return void("success"===t.result?Bh.buySkuComplete(t.details):(gc.setPurchase(!1),n&&i&&n.executeLifecycle(i,ah)));case"login":if("success"===t.result){var r,o,s=t.details;if(n)n.handoffState.login=m({},null!==(o=s.attributes)&&void 0!==o?o:{});Gh.loggedInId()===s.loginId?n&&i&&n.executeLifecycle(i,Zc):Promise.resolve(Gh.login(s.loginId)).catch(e=>{Si.error("[NamiFlowManager] login from handoff outcome failed",e)});var l=null===(r=io.getDevice())||void 0===r?void 0:r.customer_data_platform_id;s.cdpId&&s.cdpId!==l&&Promise.resolve(Gh.setCustomerDataPlatformId(s.cdpId)).catch(e=>{Si.error("[NamiFlowManager] CDP id write-through from handoff outcome failed",e)})}else n&&i&&n.executeLifecycle(i,eh);return}}},{key:"registerEventHandler",value:function(e){this.instance.eventHandler=e;var t=e;return()=>{this.instance.eventHandler===t&&(this.instance.eventHandler=void 0)}}},{key:"resume",value:function(){var t,n,i,a=e.instance,r=a.flowOpen,o=a.currentFlow;Rc.instance.maxLogging&&Si.debug(`[NamiFlowManager] resume() — flowOpen=${r}, hasFlow=${!!o}, currentStep=${null!==(t=null==o||null===(n=o.currentFlowStep)||void 0===n?void 0:n.id)&&void 0!==t?t:"none"}, isPaused=${null!==(i=null==o?void 0:o.isPaused)&&void 0!==i?i:"N/A"}`);var s=e.instance.pendingHandoff;if(s&&!s.completed&&(s.completed=!0,e.instance.pendingHandoff=void 0,Si.warn(`[NamiFlowManager] resume() called during handoff '${s.tag}' with a v2 handler registered — treated as complete({kind:'done'}); prefer complete(outcome)`)),r&&o&&o.currentFlowStep){if(o.activeHandoffSequence)return Si.debug(`Resuming flow at handoff sequence ${o.currentFlowStep.id}`),void o.resumeNextHandoff();Si.debug(`Resuming flow at step ${o.currentFlowStep.id}`),o.executeLifecycle(o.currentFlowStep,"__resume__")}else Si.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?(Si.debug(`Finishing flow programmatically at step ${i.currentFlowStep.id}`),i.dismiss()):Si.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():Si.warn("This flow cannot be paused"):Si.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()}}])}(),Uh=Object.freeze({__proto__:null,NamiFlowManager:zh}),Hh=()=>{var e,t;return null!==(e=null===(t=io.getNamiConfig())||void 0===t||null===(t=t.namiCommands)||void 0===t?void 0:t.includes("disableAsyncLoginLogout"))&&void 0!==e&&e},Gh=function(){return c(function e(){o(this,e),this.emitter=vu.getInstance(),Ph.shared.registerNamespaceResolver("UserTags",t=>{var n,i=t.replace("UserTags.","");return null!==(n=e.getCustomerAttribute(i))&&void 0!==n?n:null})},[{key:"isSDKInitialized",get:function(){return Rc.instance.isInitialized}}],[{key:"isLoggedIn",value:function(){return xc.instance.isLoggedIn()}},{key:"loggedInId",value:function(){return this.instance.isSDKInitialized||Si.debug(Ne),xc.instance.getExternalId()}},{key:"login",value:function(e){var t,n,i,r,o,s,l,u,d;return k(function(c){for(;;)switch(c.p=c.n){case 0:if(this.instance.isSDKInitialized){c.n=1;break}throw t=new so,this.invokeStateHandler(Ih.LOGIN,!1,t),t;case 1:if(!this.inAnonymousMode()){c.n=2;break}throw n=new po,this.invokeStateHandler(Ih.LOGIN,!1,n),n;case 2:if(Hh()){c.n=3;break}return xc.instance.loginLocal(e),this.invokeStateHandler(Ih.LOGIN,!0),zh.instance.flowOpen&&(i=zh.instance.currentFlow,(r=null==i?void 0:i.currentFlowStep)&&(Rc.instance.maxLogging&&Si.debug(`[NamiCustomerManager] async login success — triggering __login_success__ on step ${r.id}`),i.executeLifecycle(r,Zc))),xc.instance.loginRemote(e).catch(e=>{Si.error("[NamiCustomerManager] async login API failed",e)}),Sc.instance.fetchActiveEntitlements().catch(e=>{Si.error("[NamiCustomerManager] async login entitlement refresh failed",e)}),c.a(2);case 3:return c.p=3,c.n=4,a(xc.instance.login(e));case 4:return c.n=5,a(Sc.instance.fetchActiveEntitlements());case 5:this.invokeStateHandler(Ih.LOGIN,!0),zh.instance.flowOpen&&(o=zh.instance.currentFlow,(s=null==o?void 0:o.currentFlowStep)&&(Rc.instance.maxLogging&&Si.debug(`[NamiCustomerManager] login success — triggering __login_success__ on step ${s.id}`),o.executeLifecycle(s,Zc))),c.n=7;break;case 6:throw c.p=6,d=c.v,this.invokeStateHandler(Ih.LOGIN,!1,d),zh.instance.flowOpen&&(l=zh.instance.currentFlow,(u=null==l?void 0:l.currentFlowStep)&&(Rc.instance.maxLogging&&Si.debug(`[NamiCustomerManager] login failure — triggering __login_failure__ on step ${u.id}`),l.executeLifecycle(u,eh))),d;case 7:return c.a(2)}},null,this,[[3,6]],Promise)}},{key:"logout",value:function(){var e,t,n,i,r,o,s,l,u;return k(function(d){for(;;)switch(d.p=d.n){case 0:if(this.instance.isSDKInitialized){d.n=1;break}throw e=new so,this.invokeStateHandler(Ih.LOGOUT,!1,e),e;case 1:if(!this.inAnonymousMode()){d.n=2;break}throw t=new po,this.invokeStateHandler(Ih.LOGOUT,!1,t),t;case 2:if(Hh()){d.n=3;break}return xc.instance.logoutLocal(),this.invokeStateHandler(Ih.LOGOUT,!0),zh.instance.flowOpen&&(n=zh.instance.currentFlow,(i=null==n?void 0:n.currentFlowStep)&&(Rc.instance.maxLogging&&Si.debug(`[NamiCustomerManager] async logout success — triggering __logout_success__ on step ${i.id}`),n.executeLifecycle(i,th))),xc.instance.logoutRemote().catch(e=>{Si.error("[NamiCustomerManager] async logout API failed",e)}),Sc.instance.fetchActiveEntitlements().catch(e=>{Si.error("[NamiCustomerManager] async logout entitlement refresh failed",e)}),d.a(2);case 3:return d.p=3,d.n=4,a(xc.instance.logout());case 4:return d.n=5,a(Sc.instance.fetchActiveEntitlements());case 5:this.invokeStateHandler(Ih.LOGOUT,!0),zh.instance.flowOpen&&(r=zh.instance.currentFlow,(o=null==r?void 0:r.currentFlowStep)&&r.executeLifecycle(o,th)),d.n=7;break;case 6:throw d.p=6,u=d.v,this.invokeStateHandler(Ih.LOGOUT,!1,u),zh.instance.flowOpen&&(s=zh.instance.currentFlow,(l=null==s?void 0:s.currentFlowStep)&&s.executeLifecycle(l,nh)),u;case 7:return d.a(2)}},null,this,[[3,6]],Promise)}},{key:"setCustomerDataPlatformId",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.updateCustomerDataPlatformId(e));case 1:return t.a(2)}},null,this,null,Promise)}},{key:"clearCustomerDataPlatformId",value:function(){return k(function(e){for(;;)switch(e.n){case 0:return e.n=1,a(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,r,o;return k(function(s){for(;;)switch(s.n){case 0:if(t=e?Ih.ANONYMOUS_MODE_ON:Ih.ANONYMOUS_MODE_OFF,this.instance.isSDKInitialized){s.n=1;break}throw n=new so,this.invokeStateHandler(t,!1,n),n;case 1:if(this.anonymousModeCapability()){s.n=2;break}return Si.warn("Anonymous mode feature is not enabled for your Nami account. Contact support@nami.ml for details."),s.a(2);case 2:if(this.inAnonymousMode()!==e){s.n=3;break}return i=e?new fo:new vo,this.invokeStateHandler(t,!1,i),s.a(2);case 3:if(!e){s.n=4;break}io.setAnonymousMode(e),io.resetDevice(),this.refetchConfig(),this.invokeStateHandler(Ih.ANONYMOUS_MODE_ON,!0),s.n=6;break;case 4:return io.clearAnonymousMode(),Hu(),o=null===(r=io.getNamiConfig())||void 0===r?void 0:r.namiCommands,s.n=5,a(yu.instance.createOrUpdateDevice(Tl(o)));case 5:io.clearAnonymousUUID(),this.refetchConfig(),this.invokeStateHandler(Ih.ANONYMOUS_MODE_OFF,!0);case 6:return s.a(2)}},null,this,null,Promise)}},{key:"inAnonymousMode",value:function(){return!!this.instance.isSDKInitialized&&Gu()}},{key:"setCustomerAttribute",value:function(e,t){if(!this.instance.isSDKInitialized)throw new so;if(io.setCustomerAttribute(e,t),Js(Pe.PAYWALL_PERSONALIZATION)?(gc.setCustomerAttribute({[e]:t}),Si.debug(`This customer attribute you set is now available for paywall personalization using the smart text variable: ${e}`)):Si.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.`),zh.instance.flowOpen){var n=zh.instance.currentFlow;if(n){var i=n.currentFlowStep;i&&n.executeLifecycle(i,oh)}}}},{key:"getCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new so;var t=io.getCustomerAttribute(e);return null!=t?Js(Pe.PAYWALL_PERSONALIZATION)?Si.debug(`Found customer attribute. ${e} is available for paywall personalization on this device.`):Si.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.`):Si.debug(`No ${e} customer attribute found.`),t}},{key:"getAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new so;return io.getAllCustomerAttributes()}},{key:"clearCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new so;io.clearCustomerAttribute(e)?(gc.removeCustomerAttribute(e),Si.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.`)):Si.warn(`No value to clear for attribute ${e}.`)}},{key:"clearAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new so;io.getAllCustomerAttributesKeys().forEach(e=>{gc.removeCustomerAttribute(e)}),io.clearAllCustomerAttributes(),Si.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 so;return io.getCustomerJourneyState()}},{key:"deviceId",value:function(){var e,t;return this.instance.isSDKInitialized&&null!==(e=null===(t=io.getDevice())||void 0===t?void 0:t.id)&&void 0!==e?e:qe}},{key:"registerJourneyStateHandler",value:function(e){if(el("NamiCustomerManager.registerJourneyStateHandler"))return this.instance.emitter.addListener(di,e),()=>{this.instance.emitter.removeListener(di,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,r;return k(function(o){for(;;)switch(o.p=o.n){case 0:if(this.instance.isSDKInitialized){o.n=1;break}throw t=new so,this.invokeStateHandler(Ih.CUSTOMER_DATA_PLATFORM_ID_SET,!1,t),t;case 1:if(this.inAnonymousMode()){o.n=6;break}return o.p=2,o.n=3,a(yu.instance.updateDeviceField("customer_data_platform_id",e));case 3:this.invokeStateHandler(Ih.CUSTOMER_DATA_PLATFORM_ID_SET,!0),o.n=5;break;case 4:o.p=4,r=o.v,this.invokeStateHandler(Ih.CUSTOMER_DATA_PLATFORM_ID_SET,!1,r);case 5:o.n=7;break;case 6:return Si.info("Unable to set CDP ID in anonymous mode",{deviceId:null===(n=io.getDevice())||void 0===n?void 0:n.id,anonymousMode:!0}),i=new go,this.invokeStateHandler(Ih.CUSTOMER_DATA_PLATFORM_ID_SET,!1,i),o.a(2);case 7:return o.a(2)}},null,this,[[2,4]],Promise)}},{key:"anonymousModeCapability",value:function(){if(!this.instance.isSDKInitialized)return!1;var e=Js(Pe.ANONYMOUS_MODE_CAPABILITY),t=Js(Pe.THIRD_PARTY_TRANSACTIONS);return e&&t}},{key:"refetchConfig",value:function(){return k(function(e){for(;;)switch(e.n){case 0:if(!this.instance.isSDKInitialized){e.n=1;break}return e.n=1,a(Promise.all([bu.instance.fetchProducts(),Ou.instance.fetchPaywalls().then(e=>pu.instance.fetchCampaignRules(e))]));case 1:return e.a(2)}},null,this,null,Promise)}}])}();Gh.instance=new Gh;var Vh="This field is required",Kh="Please enter a valid email address",Xh="Please enter at least 2 characters",Yh=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function qh(e,t,n){var i=("string"==typeof n?n:null==n?"":String(n)).trim();return t&&0===i.length?Vh:0!==i.length?"email"!==e||Yh.test(i)?"name"===e&&i.length<2?Xh:void 0:Kh:void 0}var Jh=/^([^:]+)::(.+)$/;var Qh=function(){return c(function e(t={}){var n,i,a,r,s;o(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!==(s=t.transition)&&void 0!==s?s:"none"},[{key:"allScreensAvailable",get:function(){return this.screens.length>0&&Ul(this.screens)}}])}(),Zh=function(e){function t(e,n,i,a){var s,l;o(this,t),(l=r(this,t,[null!==(s=e.flow.object)&&void 0!==s?s:{}])).stepcrumbs=[],l.branchcrumbs=[],l.activeHandoffSequence=null,l.currentScreenState=null,l.isPaused=!1,l.flowPath="",l.timerStates={},l.handoffState={permissions:{}},l.campaign=e,l.component=n,l.context=a,l.manager=i,l.branchcrumbs=[],l.stepcrumbs=[],l.registerResolvers(a);var u=l.findStepByType(jc);return u&&l.forward(u.id),l}return p(t,e),c(t,[{key:"applyLaunchContextAttributes",value:function(e){var t,n;this.context||(this.context={customAttributes:{}},new Th(this.context,this.campaign)),null!==(n=(t=this.context).customAttributes)&&void 0!==n||(t.customAttributes={}),Object.assign(this.context.customAttributes,e)}},{key:"registerResolvers",value:function(e){e&&new Th(e,this.campaign),new Mh,new Oh,new $h,new Nh(this.campaign),(new Wh).register(),Ph.shared.registerNamespaceResolver("Flow",e=>{switch(e){case"Flow.stepcrumbs":return this.stepcrumbs.map(e=>e.id);case"Flow.branchcrumbs":return this.branchcrumbs;default:return}}),Ph.shared.registerNamespaceResolver("login",e=>{var t,n=e.replace(/^login\./,"");return null===(t=this.handoffState.login)||void 0===t?void 0:t[n]}),Ph.shared.registerNamespaceResolver("permissions",e=>{var t=e.replace(/^permissions\./,"");return this.handoffState.permissions[t]}),Ph.shared.registerNamespaceResolver("__first_session__",()=>Mc.instance.getIsFirstSession())}},{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:"flowLog",value:function(e,...t){Rc.instance.maxLogging&&Si.debug(`[NamiFlow] ${e}`,...t)}},{key:"finished",value:function(){var e;this.flowLog(`finished() — closing flow, isPaused=${this.isPaused}, step=${null===(e=this.currentFlowStep)||void 0===e?void 0:e.id}`),this.manager.finishFlow()}},{key:"dismiss",value:function(){this.signalNonCompletion("dismiss_page"),this.finished()}},{key:"back",value:function(){var e;if(!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to)){if(!this.stepcrumbs.slice(0,-1).some(e=>"screen"===e.type))return this.flowLog("back() — no previous screen step, dismissing flow"),void this.dismiss();this.backToPreviousScreenStep()}else Si.debug(`Not allowed to go back to ${this.previousFlowStep.id}`)}},{key:"bindImpression",value:function(e){var t=this.currentFlowStep;if(t){var n=this.completionContext;n&&n.stepId===t.id&&!n.impressionId?n.impressionId=e:this.completionContext={stepId:t.id,impressionId:e,resultSent:!1,pending:[]};var i=t.completion_step;null!=i&&i.enabled&&"page_view"===i.condition&&this.completionSignal("page_view");var a=this.completionContext.pending;this.completionContext.pending=[],a.forEach(e=>this.completionSignal(e))}}},{key:"completionSignal",value:function(e){var t=this.currentFlowStep,n=null==t?void 0:t.completion_step;if(t&&null!=n&&n.enabled&&n.condition===e){var i=this.completionContext;i&&i.stepId===t.id||(i=this.completionContext={stepId:t.id,resultSent:!1,pending:[]}),i.resultSent||(i.impressionId?(i.resultSent=!0,this.patchCompletion(i.impressionId,e)):i.pending.includes(e)||i.pending.push(e))}}},{key:"signalNonCompletion",value:function(e){var t=this.completionContext;t&&t.impressionId&&!t.resultSent&&(t.resultSent=!0,this.patchCompletion(t.impressionId,e))}},{key:"patchCompletion",value:function(e,t){var n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:return this.flowLog(`patchCompletion(${t}) — impression=${e}, step=${null===(n=this.currentFlowStep)||void 0===n?void 0:n.id}`),r.p=1,r.n=2,a($l.instance.patchImpressionCompletion(e,t,(new Date).toISOString()));case 2:r.n=4;break;case 3:r.p=3,i=r.v,Si.error(`[NamiFlow] completion PATCH failed for '${t}'`,i);case 4:return r.a(2)}},null,this,[[1,3]],Promise)}},{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=zl(n.screen);return r&&we().ui.flowNavigateToScreen(r,{transition:this.transition,direction:"backward"}),void(this.currentScreenState=null!==(i=null===(a=gc.currentProvider)||void 0===a?void 0:a.state)&&void 0!==i?i:null)}}Si.warn("No previous screen step found to return to")}else Si.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(this.flowLog(`forward(${e}) — type=${t.type}, name=${t.name}, isPaused=${this.isPaused}`),t.type){case jc:case Uc:return this.stepcrumbs.push(t),void this.executeLifecycle(t,qc);case zc:return void this.handleBranchStep(t);case Bc:return void this.handleScreenStep(t);case Hc:return}else this.flowLog(`forward(${e}) — step not active (branch_tags=${JSON.stringify(t.branch_tags)}, branchcrumbs=${JSON.stringify(this.branchcrumbs)})`);else Si.error(`No step found with id: ${e}`)}},{key:"pause",value:function(){var e;this.isPaused?Si.info("Flow is already paused"):(this.isPaused=!0,this.pausedStepID=null===(e=this.currentFlowStep)||void 0===e?void 0:e.id,this.flowLog(`pause() — pausedStepID=${this.pausedStepID}`),Si.info("Flow paused"))}},{key:"resumeFromPause",value:function(){if(this.isPaused)if(this.isPaused=!1,this.pausedStepID){var e=this.pausedStepID;this.pausedStepID=void 0,this.flowLog(`resumeFromPause() — resuming from step ${e}`),Si.info(`Flow resumed from step ${e}`),this.forward(e)}else Si.warn("No step to resume from");else Si.info("Flow is not paused")}},{key:"executeLifecycle",value:function(e,t,n){t===ih?this.completionSignal("purchase_success"):t===Zc&&this.completionSignal("login_success");var i=e.actions[t];i?(this.flowLog(`executeLifecycle(${t}) — step=${e.id}, isPaused=${this.isPaused}, ${i.length} lifecycle(s)`),this.executeFullLifecycles(i,n)):this.flowLog(`executeLifecycle(${t}) — no actions on step ${e.id}`)}},{key:"lifecycles",value:function(e){if(this.currentFlowStep){var t=this.currentFlowStep.actions[e];if(t)return t;Si.info(`No actions found for button ${e} on step ${this.currentFlowStep.id}`)}}},{key:"isFormSubmitLifecycle",value:function(e){var t=[Wc.SET_TAGS_FROM_FORM,Wc.NEXT,Wc.NAVIGATE];return e.some(e=>[e.before,e.action,e.after].some(e=>null==e?void 0:e.some(e=>t.includes(e.function))))}},{key:"captureBuySkuData",value:function(e,t){var n,i,a;e===Yc&&null!=t&&t.sku&&(this.purchasedSku="sku_ref_id"in(n=t.sku)?{skuRefId:n.sku_ref_id,name:n.name,entitlements:Array.isArray(n.entitlements)?n.entitlements:[],productDetails:null!==(a=n.product_details)&&void 0!==a?a:null}:{skuRefId:n.skuId,name:n.name,entitlements:Array.isArray(n.entitlements)?n.entitlements:[],productDetails:null!==(i=n.productDetails)&&void 0!==i?i:null})}},{key:"triggerActions",value:function(e,t,n){var i,a,r;this.captureBuySkuData(e,n);var o=this.lifecycles(e);if(o){this.flowLog(`triggerActions(${e}) — step=${null===(i=this.currentFlowStep)||void 0===i?void 0:i.id}, isPaused=${this.isPaused}`),this.currentButton=t;var s=null!==(a=null===(r=gc.currentProvider)||void 0===r?void 0:r.state.formFieldValidators)&&void 0!==a?a:{};if(this.isFormSubmitLifecycle(o)&&Object.keys(s).length){var l,u=function(e,t){for(var n={},i=0,a=Object.entries(e);i<a.length;i++){var r,o=a[i],s=o[0],l=o[1],u=qh(l.type,l.required,t[s]);void 0!==u&&(n[s]=null!==(r=l.message)&&void 0!==r?r:u)}return n}(s,this.getFormData());if(null===(l=gc.currentProvider)||void 0===l||l.setFormFieldErrors(u),Object.keys(u).length)return void this.flowLog(`triggerActions(${e}) — HALTED by form validation: ${JSON.stringify(u)}`)}this.executeFullLifecycles(o,n)}}},{key:"executeFullLifecycles",value:function(e,t){for(var n,i=this,a=function(){var e=n.value,a=["before","action","after"];[e.before,e.action,e.after].forEach((e,n)=>null==e?void 0:e.forEach(e=>{var r=i.shouldRun(e);i.flowLog(` ${a[n]}: ${e.function}${e.id?` (${e.id})`:""} — shouldRun=${r}`),r&&i.performAction(e,t)}))},r=h(e);!(n=r()).done;)a()}},{key:"triggerBeforeActions",value:function(e,t,n){this.captureBuySkuData(e,n);var i=this.lifecycles(e);if(i){this.currentButton=t;for(var a,r=h(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){this.captureBuySkuData(e,n);var i=this.lifecycles(e);if(i){this.currentButton=t;for(var a,r=h(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){if(!e.conditions)return!0;var t=e.conditions.every(e=>{var t=Ph.shared.evaluate(e);if(Rc.instance.maxLogging){var n,i,a,r=null!==(n=null===(i=e.filter)||void 0===i?void 0:i.map(e=>`${e.identifier} ${e.operator} ${JSON.stringify(e.values)}`).join(", "))&&void 0!==n?n:"none";Si.debug(`[NamiFlow] condition: [${r}] op=${null!==(a=e.operator)&&void 0!==a?a:"default"} → ${t}`)}return t});return t}},{key:"performAction",value:function(e,t){var n,i;if(this.currentFlowStep){var a=(null!==(n=e.parameters)&&void 0!==n&&n.delay?+e.parameters.delay:0)||0;this.flowLog(`performAction(${e.function}) — step=${this.currentFlowStep.id}, delay=${a}, params=${JSON.stringify(null!==(i=e.parameters)&&void 0!==i?i:{})}`);var r=n=>{var i,a,r,o,s,l,u,d,c;if((null===(i=this.currentFlowStep)||void 0===i?void 0:i.id)===n)switch(e.function){case Wc.BACK:this.back();break;case Wc.NEXT:null!==(a=e.parameters)&&void 0!==a&&a.customAttributes&&this.applyLaunchContextAttributes(e.parameters.customAttributes),null!==(r=e.parameters)&&void 0!==r&&r.step?this.forward(e.parameters.step):this.next();break;case Wc.NAVIGATE:var h;if(null!==(o=e.parameters)&&void 0!==o&&o.customAttributes&&this.applyLaunchContextAttributes(e.parameters.customAttributes),null!==(s=e.parameters)&&void 0!==s&&s.step)(null===(h=this.previousFlowStep)||void 0===h?void 0:h.id)===e.parameters.step?this.back():this.forward(e.parameters.step);else this.next();break;case Wc.FINISHED:this.finished();break;case Wc.DISMISS:this.dismiss();break;case Wc.EXIT:this.signalNonCompletion("skip_page");var m=this.steps.find(e=>e.type===Uc);m&&this.forward(m.id);break;case Wc.PAUSE:this.pause();break;case Wc.RESUME:this.resumeFromPause();break;case Wc.HANDOFF:var f,v,p,g,y,b,w=null===(f=e.parameters)||void 0===f?void 0:f.handoffTag;if(!w)break;if(null!==(v=e.parameters)&&void 0!==v&&v.handoffFormId&&this.completionSignal("form_submitted"),w.startsWith("__")){var k;w===Gc&&null!==(k=e.parameters)&&void 0!==k&&k.handoffFormId?this.flowHandoffFormSequence():(Si.warn(`Ignoring reserved handoff tag '${w}' — resuming flow`),this.manager.resume());break}if(!this.manager.hasHandoffHandler){Si.debug("No handoffStepHandler found",e);break}if(w===Vc.UserData&&null!==(p=e.parameters)&&void 0!==p&&p.handoffFormId){this.manager.deliverHandoff(w,this.buildUserDataEnvelope(e.parameters.handoffFormId));break}null!==(g=e.parameters)&&void 0!==g&&g.handoffData?b=e.parameters.handoffData:t?b=t:null!==(y=e.parameters)&&void 0!==y&&y.handoffFormId&&(b=this.getFormData()),Si.debug(`Invoking handoff handler with ${w}${b?` ${JSON.stringify(b)}`:" and no data"}`),this.manager.deliverHandoff(w,b);break;case Wc.LOG:var S;if(null!==(l=e.parameters)&&void 0!==l&&l.eventName)Si.info(`logEvent → ${e.parameters.eventName}`);else Si.warn(`Missing 'eventName' in logEvent action ${null!==(S=e.id)&&void 0!==S?S:"unknown"}`);break;case Wc.TRACK:var E;if(null!==(u=e.parameters)&&void 0!==u&&u.eventName)Si.info(`trackEvent → ${e.parameters.eventName}`);else Si.warn(`Missing 'eventName' in logEvent action ${null!==(E=e.id)&&void 0!==E?E:"unknown"}`);break;case Wc.SET_VIDEO:null!==(d=e.parameters)&&void 0!==d&&d.name&&e.parameters.url?gc.setAppSuppliedVideoDetails({name:e.parameters.name,url:e.parameters.url}):Si.warn("Missing name, url for setting video details");break;case Wc.BLOCK_BACK:var P,_=null===(P=e.parameters)||void 0===P?void 0:P.step,T=_?this.getStep(_):void 0;T?T.allow_back_to=!1:this.currentFlowStep?this.currentFlowStep.allow_back_to=!1:Si.warn("Missing step for blocking back");break;case Wc.FLOW_EVENT:var M,A=new Fh(this.manager),D=Object.fromEntries(Object.entries(null!==(M=e.parameters)&&void 0!==M?M:{}).map(([e,t])=>[e,A.interpolateDeep(t)]));this.manager.eventHandler?this.manager.eventHandler(D):Si.warn("Missing event handler",D);break;case Wc.FLOW_ENABLED:gc.setUserInteractionEnabled(!0);break;case Wc.FLOW_DISABLED:gc.setUserInteractionEnabled(!1);break;case Wc.SET_TAGS:e.parameters&&(gc.setUserTags(e.parameters),Object.entries(e.parameters).forEach(([e,t])=>{Gh.setCustomerAttribute(e,t)}));break;case Wc.SET_TAGS_FROM_FORM:var x,C=null===(x=e.parameters)||void 0===x?void 0:x.include,I=Array.isArray(C)?new Set(C):void 0,L=this.getFormData(),R={};Object.entries(L).forEach(([e,t])=>{if(!I||I.has(e)){var n=Ch(t);void 0!==n&&(R[e]=n,Gh.setCustomerAttribute(e,n))}}),Object.keys(R).length&&gc.setUserTags(R);break;case Wc.SET_LAUNCH_CONTEXT:var F=e.parameters;null!=F&&F.customAttributes?this.applyLaunchContextAttributes(F.customAttributes):void 0!==(null==F?void 0:F.key)&&void 0!==(null==F?void 0:F.value)&&this.applyLaunchContextAttributes({[F.key]:F.value});break;case Wc.SET_FLOW_PATH:var O,$=null===(O=e.parameters)||void 0===O?void 0:O.flowPath;"string"==typeof $&&(this.flowPath=$);break;default:Si.warn(`Missing action handler for ${e.function}`,e)}else this.flowLog(`performAction(${e.function}) — SKIPPED stale step ${n}, current=${null===(c=this.currentFlowStep)||void 0===c?void 0:c.id}`)};a?setTimeout(r.bind(this,this.currentFlowStep.id),a):r(this.currentFlowStep.id)}else Si.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=h(this.steps.slice(t+1));!(n=i()).done;){var a=n.value;if(this.isStepActive(a))return a}Si.debug(`No active next step found after ${e.id}`)}else Si.error(`Could not find next step for step ${e.id}`)}else Si.error("Next step not found")}},{key:"handleScreenStep",value:function(e){var t,n=zl(null!==(t=e.screen)&&void 0!==t?t:"");e.screen&&n&&this.campaign?(this.stepcrumbs.push(e),we().ui.flowNavigateToScreen(n,{transition:this.transition,direction:"forward"})):Si.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=h(r);!(o=s()).done;){var l=o.value;if(l.action)for(var u,d=h(l.action);!(u=d()).done;){var c,m,f=u.value;if(this.shouldRun(f))return this.branchcrumbs.push(a),null===(c=l.before)||void 0===c||c.forEach(e=>{this.performAction(e)}),l.action.forEach(e=>{this.shouldRun(e)&&this.performAction(e)}),void(null===(m=l.after)||void 0===m||m.forEach(e=>{this.performAction(e)}))}else Si.warn(`No actions defined for branch tag ${a}`)}}Si.warn(`No matching branch condition matched for step ${e.id}`)}},{key:"getFormData",value:function(){var e,t;return m({},null!==(e=null===(t=gc.currentProvider)||void 0===t||null===(t=t.state)||void 0===t?void 0:t.formStates)&&void 0!==e?e:{})}},{key:"buildUserDataEnvelope",value:function(e){var t,n;return{form_id:e,step_id:null!==(t=null===(n=this.currentFlowStep)||void 0===n?void 0:n.id)&&void 0!==t?t:"",collected_at:(new Date).toISOString(),fields:this.getFormData()}}},{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);if(0!==n.length){if(n.some(e=>Jh.test(e))){var i=this.buildHandoffGroups(t);return 0===i.length?(Si.info("No handoff groups after grouping"),void this.manager.resume()):(this.activeHandoffSequence={groups:i},void this.resumeNextHandoff())}var a=n.sort().filter(e=>!0===t[e]);if(0===a.length)return Si.info("No eligible handoff keys after filtering"),void this.manager.resume();this.activeHandoffSequence={formStates:m({},t),remainingKeys:[...a]},this.resumeNextHandoff()}else Si.warn("formStates is empty, no handoffs to perform")}else Si.warn("No formStates available for handoff sequence")}},{key:"buildHandoffGroups",value:function(e){for(var t=new Map,n=0,i=Object.keys(e);n<i.length;n++){var a=i[n],r=a.match(Jh);if(r){var o=r[1],s=r[2];o.startsWith("__")?Si.warn(`Ignoring reserved handoff group tag '${o}'`):(t.has(o)||t.set(o,{}),t.get(o)[s]=e[a])}}return Array.from(t,([e,t])=>({tag:e,data:t})).filter(e=>Object.values(e.data).some(e=>!0===e)).sort((e,t)=>e.tag.localeCompare(t.tag))}},{key:"resumeNextHandoff",value:function(){var e=this.activeHandoffSequence;if(!e)return Si.warn("No active handoff sequence to resume"),void this.manager.resume();if("groups"in e){if(0===e.groups.length)return Si.info("All handoffs in the sequence are complete"),this.activeHandoffSequence=null,void this.manager.resume();var t=e.groups.shift();return function(e){return Object.values(Vc).includes(e)}(t.tag)||Si.warn(`handoff group tag '${t.tag}' is outside the NamiHandoffTag vocabulary — passing through`),this.activeHandoffSequence=e,Si.debug(`Starting grouped handoff for '${t.tag}' → ${JSON.stringify(t.data)}`),void this.manager.deliverHandoff(t.tag,t.data)}if(0===e.remainingKeys.length)return Si.info("All handoffs in the sequence are complete"),this.activeHandoffSequence=null,void this.manager.resume();var n=e.remainingKeys.shift(),i=e.formStates[n];Si.debug(`Starting handoff for ${n} → ${String(i)}`),this.activeHandoffSequence=e,this.manager.deliverHandoff(`${n}`,void 0)}}])}(Qh),em=function(){return c(function e(){o(this,e),this.emitter=vu.getInstance()},[{key:"sdkInitialized",get:function(){return Rc.instance.isInitialized}},{key:"campaignTypeAndLabel",value:function(t,n){var i,a="";return t&&!n&&Kl(t)?(a=t,i=e.NamiCampaignRuleType.URL):t?(a=t,i=e.NamiCampaignRuleType.LABEL):n&&(a=n,i=e.NamiCampaignRuleType.URL),{type:i,value:a}}}],[{key:"allCampaigns",value:function(){if(!this.instance.sdkInitialized)throw new so;return ql()}},{key:"isCampaignAvailable",value:function(e){if(!this.instance.sdkInitialized)throw new so;var t=this.instance.campaignTypeAndLabel(e),n=t.type,i=t.value,a=tu(i,n),r=a.campaign,o=a.paywall;return null!=r&&r.flow?new Qh(r.flow.object).allScreensAvailable:Boolean(r&&o)}},{key:"isFlow",value:function(e,t){if(!this.instance.sdkInitialized)throw new so;var n=this.instance.campaignTypeAndLabel(e,t),i=n.type,a=n.value;return Nl(tu(a,i).campaign)}},{key:"refresh",value:function(){return k(function(e){for(;;)switch(e.n){case 0:if(this.instance.sdkInitialized){e.n=1;break}throw new so;case 1:return Zs(),e.n=2,a(Mc.instance.fetchCampaignsAndPaywalls());case 2:return e.a(2,ql())}},null,this,null,Promise)}},{key:"registerAvailableCampaignsHandler",value:function(e){return this.instance.emitter.addListener(ai,e),()=>{this.instance.emitter.removeListener(ai,e)}}},{key:"launch",value:function(t,n,i,a,r){var o,s,l,u,d,c,h,f,v,p;a=null!=a?a:()=>{},i=null!=i?i:{customAttributes:{}};var g=this.instance.campaignTypeAndLabel(t,n),b=g.type,w=g.value;if(!this.instance.sdkInitialized)throw a(!1,e.LaunchCampaignError.SDK_NOT_INITIALIZED),new so;var k,S=Tc.firstLaunchLookup(w,()=>tu(w,b)),E=S.paywall,P=S.campaign,_=!P||!E&&!P.flow;_&&(k=t||n?t?e.LaunchCampaignError.LABELED_CAMPAIGN_NOT_FOUND:n?e.LaunchCampaignError.URL_CAMPAIGN_NOT_FOUND:e.LaunchCampaignError.CAMPAIGN_DATA_NOT_FOUND:e.LaunchCampaignError.DEFAULT_CAMPAIGN_NOT_FOUND,a(!1,k),E={});var T={campaignId:null!==(o=null==P?void 0:P.rule)&&void 0!==o?o:"",campaignName:null!==(s=null==P?void 0:P.name)&&void 0!==s?s:"",campaignType:null!==(l=null==P?void 0:P.type)&&void 0!==l?l:"",campaignLabel:t?w:"",campaignUrl:n?w:"",paywallId:null!=P&&P.flow?void 0:(null===(u=E)||void 0===u?void 0:u.id)||"",paywallName:null!=P&&P.flow?void 0:(null===(d=E)||void 0===d?void 0:d.name)||"",segmentId:null==P?void 0:P.segment,externalSegmentId:null!==(c=null==P?void 0:P.external_segment)&&void 0!==c?c:null,action:e.NamiPaywallAction.UNKNOWN},M=io.getPurchaseChannel();M&&(T=m({},T,{purchaseChannel:M}));var A,D,x,C,I,L,R,F,O=null===(h=i)||void 0===h?void 0:h.productGroups,$=null===(f=E)||void 0===f||null===(f=f.sku_menus)||void 0===f?void 0:f.map(e=>e.ref);if((x=null===(A=io.getNamiConfig())||void 0===A?void 0:A.namiCommands,null!==(D=null==x?void 0:x.includes(fn))&&void 0!==D&&D&&null!=O&&O.length&&null!=$)&&0==(null==$?void 0:$.filter(e=>null==O?void 0:O.some(t=>t===e))).length)throw a(!1,e.LaunchCampaignError.PRODUCT_GROUPS_NOT_FOUND),new ho;if(null!=P&&P.flow&&!Ul(null!==(v=null===(p=P.flow.object)||void 0===p?void 0:p.screens)&&void 0!==v?v:[]))throw a(!1,e.LaunchCampaignError.FLOW_SCREEN_DATA_UNAVILABLE),new mo;_||Lc.shared.record({placementLabel:null!==(C=null!==(I=null==P?void 0:P.value)&&void 0!==I?I:w)&&void 0!==C?C:"",tags:null!==(L=null==P?void 0:P.placement_tags)&&void 0!==L?L:[],customAttributes:null!==(R=null===(F=i)||void 0===F?void 0:F.customAttributes)&&void 0!==R?R:{}});var N=we().ui.createPaywall(b,w,i),W=Al();return io.setLaunchId(W),r&&this.instance.emitter.addListener(oi,t=>{var n=t.action,i=y(t,ge);r(m({},T,i,{action:null!=n?n:e.NamiPaywallAction.UNKNOWN}))}),setTimeout(()=>a(!0),0),N}},{key:"getProductGroups",value:function(e,t){var n,i,a=this.instance.campaignTypeAndLabel(e,t),r=a.type,o=a.value;return null!==(n=null===(i=tu(o,r).paywall)||void 0===i||null===(i=i.sku_menus)||void 0===i?void 0:i.map(e=>e.ref))&&void 0!==n?n:[]}},{key:"getAllProducts",value:function(e,t){var n,i,a=this.instance.campaignTypeAndLabel(e,t),r=a.type,o=a.value;return null!==(n=null===(i=tu(o,r).paywall)||void 0===i||null===(i=i.sku_menus)||void 0===i?void 0:i.flatMap(e=>{var t,n;return null!==(t=null===(n=e.products)||void 0===n?void 0:n.map(e=>e.sku_ref_id))&&void 0!==t?t:[]}))&&void 0!==n?n:[]}},{key:"getCurrentProducts",value:function(e,t){var n,i,a=this.instance.campaignTypeAndLabel(e,t),r=a.type,o=a.value,s=tu(o,r),l=gc.currentProvider,u=null==l?void 0:l.getCurrentGroupId();return u&&null!==(n=null===(i=s.paywall)||void 0===i||null===(i=i.sku_menus)||void 0===i?void 0:i.filter(e=>e.id===u).flatMap(e=>{var t,n;return null!==(t=null===(n=e.products)||void 0===n?void 0:n.map(e=>e.sku_ref_id))&&void 0!==t?t:[]}))&&void 0!==n?n:[]}}])}();em.instance=new em;var tm=em,nm=Gh,im=function(){return c(function e(){o(this,e),this.emitter=vu.getInstance()},[{key:"sdkInitialized",get:function(){return Rc.instance.isInitialized}}],[{key:"active",value:function(){return el(),bc()}},{key:"isEntitlementActive",value:function(e){return!!el("NamiEntitlementManager.isEntitlementActive")&&this.active().some(t=>t.referenceId==e)}},{key:"refresh",value:function(){return k(function(e){for(;;)switch(e.n){case 0:if(this.instance.sdkInitialized){e.n=1;break}throw new so;case 1:if(el("NamiEntitlementManager.refresh")){e.n=2;break}return e.a(2,[]);case 2:return e.n=3,a(Sc.instance.fetchActiveEntitlements());case 3:return e.a(2,bc())}},null,this,null,Promise)}},{key:"registerActiveEntitlementsHandler",value:function(e){if(el("NamiEntitlementManager.registerActiveEntitlementsHandler"))return this.instance.emitter.addListener(li,e),()=>{this.instance.emitter.removeListener(li,e)}}},{key:"clearProvisionalEntitlementGrants",value:function(){var e=bc();e=e.filter(e=>e.expires&&e.expires>(new Date).valueOf()),io.setNamiEntitlements(Tt,e),this.instance.emitter.emit(li)}}])}();im.instance=new im;var am,rm,om=im,sm=zh,lm=Bh,um=Ku,dm={upperLeft:"border-top-left-radius",upperRight:"border-top-right-radius",lowerLeft:"border-bottom-left-radius",lowerRight:"border-bottom-right-radius"},cm={left:"border-left-style",right:"border-right-style",top:"border-top-style",bottom:"border-bottom-style"},hm="wave",mm="pulse",fm="none";function vm(e){var t,n=null!==(t=e.match(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/))&&void 0!==t?t:[],i=n[0],a=n[1],r=n[2],o=n[3],s=n[4],l=n[5];return{semver:i,major:Number.parseInt(a)||3,minor:Number.parseInt(r)||0,patch:Number.parseInt(o)||0,prerelease:s,buildmetadata:l}}function pm(e,t){e&&(function(e,t){return e.major!==t.major?e.major>t.major?1:-1:e.minor!==t.minor?e.minor>t.minor?1:-1:e.patch!==t.patch?e.patch>t.patch?1:-1:0}(vm(Ae),e)>=0||Si.warn(`Component ${t} requires SDK version ${e.semver} or higher, but current SDK version is ${Ae}`))}function gm(e){return!e||"object"==typeof e&&0==Object.keys(e).length}!function(e){e.DEFAULT="default",e.LABEL="label",e.URL="url"}(am||(am={})),function(e){e.DEEPLINK="deeplink",e.IN_APP="in_app"}(rm||(rm={}));var ym=tm,bm=nm,wm=lm,km=om,Sm=sm,Em=um,Pm=xc,_m=Object.freeze({__proto__:null,NamiCampaignManager:ym,NamiCustomerManager:bm,NamiEntitlementManager:km,NamiFlowManager:Sm,NamiPaywallManager:wm,NamiProfileManager:Pm,NamiPurchaseManager:Em}),Tm=function(){return c(function e(){o(this,e)},[{key:"getItem",value:function(e){try{return localStorage.getItem(e)}catch(e){return null}}},{key:"setItem",value:function(e,t){try{localStorage.setItem(e,t)}catch(e){}}},{key:"removeItem",value:function(e){try{localStorage.removeItem(e)}catch(e){}}},{key:"clear",value:function(){try{localStorage.clear()}catch(e){}}},{key:"getAllKeys",value:function(){try{return Object.keys(localStorage)}catch(e){return[]}}}])}();function Mm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Am,Dm={exports:{}};var xm=(Am||(Am=1,function(e){e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var a=t[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});t.push(0);var n=t[0],i=t[1];if(10===n)switch(i){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}switch(n){case 11:return"Big Sur";case 12:return"Monterey";case 13:return"Ventura";case 14:return"Sonoma";case 15:return"Sequoia";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,l=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(l[0][o]>l[1][o])return 1;if(l[0][o]===l[1][o]){if(o===s)return 0;o-=1}else if(l[0][o]<l[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={AmazonBot:"amazonbot","Amazon Silk":"amazon_silk","Android Browser":"android",BaiduSpider:"baiduspider",Bada:"bada",BingCrawler:"bingcrawler",Brave:"brave",BlackBerry:"blackberry","ChatGPT-User":"chatgpt_user",Chrome:"chrome",ClaudeBot:"claudebot",Chromium:"chromium",Diffbot:"diffbot",DuckDuckBot:"duckduckbot",DuckDuckGo:"duckduckgo",Electron:"electron",Epiphany:"epiphany",FacebookExternalHit:"facebookexternalhit",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot",GPTBot:"gptbot","Internet Explorer":"ie",InternetArchiveCrawler:"internetarchivecrawler","K-Meleon":"k_meleon",LibreWolf:"librewolf",Linespider:"linespider",Maxthon:"maxthon","Meta-ExternalAds":"meta_externalads","Meta-ExternalAgent":"meta_externalagent","Meta-ExternalFetcher":"meta_externalfetcher","Meta-WebIndexer":"meta_webindexer","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver","OAI-SearchBot":"oai_searchbot",Omgilibot:"omgilibot",Opera:"opera","Opera Coast":"opera_coast","Pale Moon":"pale_moon",PerplexityBot:"perplexitybot","Perplexity-User":"perplexity_user",PhantomJS:"phantomjs",PingdomBot:"pingdombot",Puffin:"puffin",QQ:"qq",QQLite:"qqlite",QupZilla:"qupzilla",Roku:"roku",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SlackBot:"slackbot",SeaMonkey:"seamonkey",Sleipnir:"sleipnir","Sogou Browser":"sogou",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat",YahooSlurp:"yahooslurp","Yandex Browser":"yandex",YandexBot:"yandexbot",YouBot:"youbot"},t.BROWSER_MAP={amazonbot:"AmazonBot",amazon_silk:"Amazon Silk",android:"Android Browser",baiduspider:"BaiduSpider",bada:"Bada",bingcrawler:"BingCrawler",blackberry:"BlackBerry",brave:"Brave",chatgpt_user:"ChatGPT-User",chrome:"Chrome",claudebot:"ClaudeBot",chromium:"Chromium",diffbot:"Diffbot",duckduckbot:"DuckDuckBot",duckduckgo:"DuckDuckGo",edge:"Microsoft Edge",electron:"Electron",epiphany:"Epiphany",facebookexternalhit:"FacebookExternalHit",firefox:"Firefox",focus:"Focus",generic:"Generic",google_search:"Google Search",googlebot:"Googlebot",gptbot:"GPTBot",ie:"Internet Explorer",internetarchivecrawler:"InternetArchiveCrawler",k_meleon:"K-Meleon",librewolf:"LibreWolf",linespider:"Linespider",maxthon:"Maxthon",meta_externalads:"Meta-ExternalAds",meta_externalagent:"Meta-ExternalAgent",meta_externalfetcher:"Meta-ExternalFetcher",meta_webindexer:"Meta-WebIndexer",mz:"MZ Browser",naver:"NAVER Whale Browser",oai_searchbot:"OAI-SearchBot",omgilibot:"Omgilibot",opera:"Opera",opera_coast:"Opera Coast",pale_moon:"Pale Moon",perplexitybot:"PerplexityBot",perplexity_user:"Perplexity-User",phantomjs:"PhantomJS",pingdombot:"PingdomBot",puffin:"Puffin",qq:"QQ Browser",qqlite:"QQ Browser Lite",qupzilla:"QupZilla",roku:"Roku",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",slackbot:"SlackBot",sleipnir:"Sleipnir",sogou:"Sogou Browser",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yahooslurp:"YahooSlurp",yandex:"Yandex Browser",yandexbot:"YandexBot",youbot:"YouBot"},t.PLATFORMS_MAP={bot:"bot",desktop:"desktop",mobile:"mobile",tablet:"tablet",tv:"tv"},t.OS_MAP={Android:"Android",Bada:"Bada",BlackBerry:"BlackBerry",ChromeOS:"Chrome OS",HarmonyOS:"HarmonyOS",iOS:"iOS",Linux:"Linux",MacOS:"macOS",PlayStation4:"PlayStation 4",Roku:"Roku",Tizen:"Tizen",WebOS:"WebOS",Windows:"Windows",WindowsPhone:"Windows Phone"},t.ENGINE_MAP={Blink:"Blink",EdgeHTML:"EdgeHTML",Gecko:"Gecko",Presto:"Presto",Trident:"Trident",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,n){if(void 0===t&&(t=!1),void 0===n&&(n=null),"string"!=typeof e)throw new Error("UserAgent should be a string");return new a.default(e,t,n)},e.parse=function(e,t){return void 0===t&&(t=null),new a.default(e,t).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=l(n(92)),a=l(n(93)),r=l(n(94)),o=l(n(95)),s=l(n(17));function l(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(e,t,n){if(void 0===t&&(t=!1),void 0===n&&(n=null),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e;var i=!1;"boolean"==typeof t?(i=t,this._hints=n):this._hints=null!=t&&"object"==typeof t?t:null,this.parsedResult={},!0!==i&&this.parse()}var t=e.prototype;return t.getHints=function(){return this._hints},t.hasBrand=function(e){if(!this._hints||!Array.isArray(this._hints.brands))return!1;var t=e.toLowerCase();return this._hints.brands.some(function(e){return e.brand&&e.brand.toLowerCase()===t})},t.getBrandVersion=function(e){if(this._hints&&Array.isArray(this._hints.brands)){var t=e.toLowerCase(),n=this._hints.brands.find(function(e){return e.brand&&e.brand.toLowerCase()===t});return n?n.version:void 0}},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(Array.isArray(t.test))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)),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(Array.isArray(t.test))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(Array.isArray(t.test))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(Array.isArray(t.test))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),l=s.default.find(o,function(e){return t.isOS(e)});if(l){var u=this.satisfies(n[l]);if(void 0!==u)return u}var d=s.default.find(o,function(e){return t.isPlatform(e)});if(d){var c=this.satisfies(n[d]);if(void 0!==c)return c}}if(r>0){var h=Object.keys(a),m=s.default.find(h,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=u,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:[/gptbot/i],describe:function(e){var t={name:"GPTBot"},n=a.default.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/chatgpt-user/i],describe:function(e){var t={name:"ChatGPT-User"},n=a.default.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/oai-searchbot/i],describe:function(e){var t={name:"OAI-SearchBot"},n=a.default.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(e){var t={name:"ClaudeBot"},n=a.default.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(e){var t={name:"Omgilibot"},n=a.default.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/diffbot/i],describe:function(e){var t={name:"Diffbot"},n=a.default.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/perplexitybot/i],describe:function(e){var t={name:"PerplexityBot"},n=a.default.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/perplexity-user/i],describe:function(e){var t={name:"Perplexity-User"},n=a.default.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/youbot/i],describe:function(e){var t={name:"YouBot"},n=a.default.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/meta-webindexer/i],describe:function(e){var t={name:"Meta-WebIndexer"},n=a.default.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/meta-externalads/i],describe:function(e){var t={name:"Meta-ExternalAds"},n=a.default.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/meta-externalagent/i],describe:function(e){var t={name:"Meta-ExternalAgent"},n=a.default.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/meta-externalfetcher/i],describe:function(e){var t={name:"Meta-ExternalFetcher"},n=a.default.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{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:[/linespider/i],describe:function(e){var t={name:"Linespider"},n=a.default.getFirstMatch(/(?:linespider)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/amazonbot/i],describe:function(e){var t={name:"AmazonBot"},n=a.default.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/bingbot/i],describe:function(e){var t={name:"BingCrawler"},n=a.default.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/baiduspider/i],describe:function(e){var t={name:"BaiduSpider"},n=a.default.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/duckduckbot/i],describe:function(e){var t={name:"DuckDuckBot"},n=a.default.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/ia_archiver/i],describe:function(e){var t={name:"InternetArchiveCrawler"},n=a.default.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{name:"FacebookExternalHit"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(e){var t={name:"SlackBot"},n=a.default.getFirstMatch(/(?:slackbot|slack-imgproxy)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/yahoo!?[\s/]*slurp/i],describe:function(){return{name:"YahooSlurp"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{name:"YandexBot"}}},{test:[/pingdom/i],describe:function(){return{name:"PingdomBot"}}},{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:[/PaleMoon/i],describe:function(e){var t={name:"Pale Moon"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:PaleMoon)[\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:[/librewolf/i],describe:function(e){var t={name:"LibreWolf"},n=a.default.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,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:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe:function(e){var t={name:"Sogou Browser"},n=a.default.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,e),i=a.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e),r=a.default.getFirstMatch(/se ([\d.]+)x/i,e),o=n||i||r;return o&&(t.version=o),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:function(e){return!!e.hasBrand("DuckDuckGo")||e.test(/\sDdg\/[\d.]+$/i)},describe:function(e,t){var n={name:"DuckDuckGo"};if(t){var i=t.getBrandVersion("DuckDuckGo");if(i)return n.version=i,n}var r=a.default.getFirstMatch(/\sDdg\/([\d.]+)$/i,e);return r&&(n.version=r),n}},{test:function(e){return e.hasBrand("Brave")},describe:function(e,t){var n={name:"Brave"};if(t){var i=t.getBrandVersion("Brave");if(i)return n.version=i,n}return n}},{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:[/OpenHarmony/i],describe:function(e){var t=a.default.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.HarmonyOS,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:r.PLATFORMS_MAP.bot,vendor:"Google"}}},{test:[/linespider/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Line"}}},{test:[/amazonbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Amazon"}}},{test:[/gptbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/chatgpt-user/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/oai-searchbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/baiduspider/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Baidu"}}},{test:[/bingbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Bing"}}},{test:[/duckduckbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"DuckDuckGo"}}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Anthropic"}}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Webz.io"}}},{test:[/diffbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Diffbot"}}},{test:[/perplexitybot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/perplexity-user/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/youbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"You.com"}}},{test:[/ia_archiver/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Internet Archive"}}},{test:[/meta-webindexer/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalads/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalagent/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalfetcher/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Slack"}}},{test:[/yahoo/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Yahoo"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Yandex"}}},{test:[/pingdom/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Pingdom"}}},{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:[/Nokia/i],describe:function(e){var t=a.default.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,e),n={type:r.PLATFORMS_MAP.mobile,vendor:"Nokia"};return t&&(n.model=t),n}},{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:[/smart-?tv|smarttv/i],describe:function(){return{type:r.PLATFORMS_MAP.tv}}},{test:[/netcast/i],describe:function(){return{type:r.PLATFORMS_MAP.tv}}},{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}})}(Dm)),Dm.exports),Cm=Mm(xm),Im={tablet:"tablet",mobile:"phone",tv:"television",desktop:"desktop"},Lm={"1280x720":.67,"1920x1080":1,"3840x2160":2,"7680x4320":4},Rm=function(){return c(function e(){o(this,e)},[{key:"getDeviceData",value:function(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:Ae,language:"en"};var t=Cm.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:Ae,language:window.navigator.language};if(n.type&&(i.form_factor=Im[n.type]),n.model&&(i.device_model=n.model),e&&e.length>0){var a=(e=>{var t=e.find(e=>e.includes(dn)),n={platform:"",version:""};if(t){var i=t.split(hn);n.platform=i[1],n.version=i[2]}return n})(e);i.extended_platform=a.platform,i.extended_platform_version=a.version}return i}},{key:"getDeviceFormFactor",value:function(){if("undefined"==typeof window)return"desktop";var e=Cm.getParser(window.navigator.userAgent).getPlatform();return e.type&&Im[e.type]||"desktop"}},{key:"getDeviceScaleFactor",value:function(e){var t;if(e||(e=this.getDeviceFormFactor()),"television"!==e)return 1;var n=window,i=n.innerWidth,a=n.innerHeight,r=i.toString()+"x"+a.toString();return null!==(t=Lm[r])&&void 0!==t?t:Math.min(i/1920,a/1080)||1}},{key:"getScreenInfo",value:function(){var e,t,n,i;return"undefined"==typeof window?{width:1920,height:1080,scale:1}:{width:null!==(e=null===(t=window.screen)||void 0===t?void 0:t.width)&&void 0!==e?e:window.innerWidth,height:null!==(n=null===(i=window.screen)||void 0===i?void 0:i.height)&&void 0!==n?n:window.innerHeight,scale:window.devicePixelRatio||1}}},{key:"getLanguage",value:function(){return"undefined"==typeof window?"en":window.navigator.language||"en"}},{key:"onAppForeground",value:function(e){if("undefined"==typeof document)return()=>{};var t=()=>{"visible"===document.visibilityState&&e()};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)}},{key:"generateUUID",value:function(){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 Fm(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"==typeof SuppressedError&&SuppressedError;var Om,$m,Nm,Wm=globalThis,jm=Wm.ShadowRoot&&(void 0===Wm.ShadyCSS||Wm.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Bm=Symbol(),zm=new WeakMap,Um=function(){return c(function e(t,n,i){if(o(this,e),this._$cssResult$=!0,i!==Bm)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(jm&&void 0===e){var n=void 0!==t&&1===t.length;n&&(e=zm.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&zm.set(t,e))}return e}},{key:"toString",value:function(){return this.cssText}}])}(),Hm=e=>new Um("string"==typeof e?e:e+"",void 0,Bm),Gm=(e,...t)=>{var n=1===e.length?e[0]:t.reduce((t,n,i)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[i+1],e[0]);return new Um(n,e,Bm)},Vm=jm?e=>e:e=>e instanceof CSSStyleSheet?(e=>{for(var t,n="",i=h(e.cssRules);!(t=i()).done;){n+=t.value.cssText}return Hm(n)})(e):e,Km=Object.is,Xm=Object.defineProperty,Ym=Object.getOwnPropertyDescriptor,qm=Object.getOwnPropertyNames,Jm=Object.getOwnPropertySymbols,Qm=Object.getPrototypeOf,Zm=globalThis,ef=Zm.trustedTypes,tf=ef?ef.emptyScript:"",nf=Zm.reactiveElementPolyfillSupport,af=(e,t)=>e,rf={toAttribute(e,t){switch(t){case Boolean:e=e?tf: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}},of=(e,t)=>!Km(e,t),sf={attribute:!0,type:String,converter:rf,reflect:!1,useDefault:!1,hasChanged:of};null!==(Om=Symbol.metadata)&&void 0!==Om||(Symbol.metadata=Symbol("metadata")),null!==($m=Zm.litPropertyMetadata)&&void 0!==$m||(Zm.litPropertyMetadata=new WeakMap);var lf,uf=function(e){function t(){var e;return o(this,t),(e=r(this,t))._$Ep=void 0,e.isUpdatePending=!1,e.hasUpdated=!1,e._$Em=null,e._$Ev(),e}return p(t,e),c(t,[{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=h(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((e,t)=>{if(jm)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(var n,i=h(t);!(n=i()).done;){var a=n.value,r=document.createElement("style"),o=Wm.litNonce;void 0!==o&&r.setAttribute("nonce",o),r.textContent=a.cssText,e.appendChild(r)}})(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:rf).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),l="function"==typeof s.converter?{fromAttribute:s.converter}:void 0!==(null===(a=s.converter)||void 0===a?void 0:a.fromAttribute)?s.converter:rf;this._$Em=i;var u=l.fromAttribute(t,s.type);this[i]=null!==(r=null!=u?u:null===(o=this._$Ej)||void 0===o?void 0:o.get(i))&&void 0!==r?r:u,this._$Em=null}}},{key:"requestUpdate",value:function(e,t,n,i=!1,a){if(void 0!==e){var r,o,s=this.constructor;if(!1===i&&(a=this[e]),null!=n||(n=s.getPropertyOptions(e)),!((null!==(r=n.hasChanged)&&void 0!==r?r:of)(a,t)||n.useDefault&&n.reflect&&a===(null===(o=this._$Ej)||void 0===o?void 0:o.get(e))&&!this.hasAttribute(s._$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,l;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!==(l=this._$Eq)&&void 0!==l?l:this._$Eq=new Set).add(e))}},{key:"_$EP",value:function(){var e,t;return k(function(n){for(;;)switch(n.p=n.n){case 0:return this.isUpdatePending=!0,n.p=1,n.n=2,a(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,a(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=h(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,l=h(o);!(s=l()).done;){var u=s.value,d=u[0],c=u[1],m=c.wrapped,f=this[d];!0!==m||this._$AL.has(d)||void 0===f||this.C(d,void 0,c,f)}}var v=!1,p=this._$AL;try{var g;(v=this.shouldUpdate(p))?(this.willUpdate(p),null!==(g=this._$EO)&&void 0!==g&&g.forEach(e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)}),this.update(p)):this._$EM()}catch(p){throw v=!1,this._$EM(),p}v&&this._$AE(p)}}},{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=sf){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&&Xm(this.prototype,e,i)}}},{key:"getPropertyDescriptor",value:function(e,t,n){var i,a=null!==(i=Ym(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:sf}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty(af("elementProperties"))){var e=Qm(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty(af("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(af("properties")))for(var e=this.properties,t=0,n=[...qm(e),...Jm(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=h(r);!(o=s()).done;){var l=o.value,u=l[0],d=l[1];this.elementProperties.set(u,d)}}this._$Eh=new Map;for(var c,m=h(this.elementProperties);!(c=m()).done;){var f=c.value,v=f[0],p=f[1],g=this._$Eu(v,p);void 0!==g&&this._$Eh.set(g,v)}this.elementStyles=this.finalizeStyles(this.styles)}}},{key:"finalizeStyles",value:function(e){var t=[];if(Array.isArray(e))for(var n,i=h(new Set(e.flat(1/0).reverse()));!(n=i()).done;){var a=n.value;t.unshift(Vm(a))}else void 0!==e&&t.push(Vm(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}}])}(M(HTMLElement));uf.elementStyles=[],uf.shadowRootOptions={mode:"open"},uf[af("elementProperties")]=new Map,uf[af("finalized")]=new Map,null!=nf&&nf({ReactiveElement:uf}),(null!==(Nm=Zm.reactiveElementVersions)&&void 0!==Nm?Nm:Zm.reactiveElementVersions=[]).push("2.1.2");var df=globalThis,cf=e=>e,hf=df.trustedTypes,mf=hf?hf.createPolicy("lit-html",{createHTML:e=>e}):void 0,ff="$lit$",vf=`lit$${Math.random().toFixed(9).slice(2)}$`,pf="?"+vf,gf=`<${pf}>`,yf=document,bf=()=>yf.createComment(""),wf=e=>null===e||"object"!=typeof e&&"function"!=typeof e,kf=Array.isArray,Sf="[ \t\n\f\r]",Ef=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Pf=/-->/g,_f=/>/g,Tf=RegExp(`>|${Sf}(?:([^\\s"'>=/]+)(${Sf}*=${Sf}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Mf=/'/g,Af=/"/g,Df=/^(?:script|style|textarea|title)$/i,xf=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),Cf=xf(1),If=xf(2),Lf=Symbol.for("lit-noChange"),Rf=Symbol.for("lit-nothing"),Ff=new WeakMap,Of=yf.createTreeWalker(yf,129);function $f(e,t){if(!kf(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==mf?mf.createHTML(t):t}var Nf=function(){return c(function e({strings:t,_$litType$:n},i){var a;o(this,e),this.parts=[];var r=0,s=0,l=t.length-1,u=this.parts,d=((e,t)=>{for(var n,i=e.length-1,a=[],r=2===t?"<svg>":3===t?"<math>":"",o=Ef,s=0;s<i;s++){for(var l=e[s],u=void 0,d=void 0,c=-1,h=0;h<l.length&&(o.lastIndex=h,null!==(d=o.exec(l)));)h=o.lastIndex,o===Ef?"!--"===d[1]?o=Pf:void 0!==d[1]?o=_f:void 0!==d[2]?(Df.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Tf):void 0!==d[3]&&(o=Tf):o===Tf?">"===d[0]?(o=null!=n?n:Ef,c=-1):void 0===d[1]?c=-2:(c=o.lastIndex-d[2].length,u=d[1],o=void 0===d[3]?Tf:'"'===d[3]?Af:Mf):o===Af||o===Mf?o=Tf:o===Pf||o===_f?o=Ef:(o=Tf,n=void 0);var m=o===Tf&&e[s+1].startsWith("/>")?" ":"";r+=o===Ef?l+gf:c>=0?(a.push(u),l.slice(0,c)+ff+l.slice(c)+vf+m):l+vf+(-2===c?s:m)}return[$f(e,r+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),a]})(t,n),c=d[0],m=d[1];if(this.el=e.createElement(c,i),Of.currentNode=this.el.content,2===n||3===n){var f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;null!==(a=Of.nextNode())&&u.length<l;){if(1===a.nodeType){if(a.hasAttributes())for(var v,p=h(a.getAttributeNames());!(v=p()).done;){var g=v.value;if(g.endsWith(ff)){var y=m[s++],b=a.getAttribute(g).split(vf),w=/([.?@])?(.*)/.exec(y);u.push({type:1,index:r,name:w[2],strings:b,ctor:"."===w[1]?Uf:"?"===w[1]?Hf:"@"===w[1]?Gf:zf}),a.removeAttribute(g)}else g.startsWith(vf)&&(u.push({type:6,index:r}),a.removeAttribute(g))}if(Df.test(a.tagName)){var k=a.textContent.split(vf),S=k.length-1;if(S>0){a.textContent=hf?hf.emptyScript:"";for(var E=0;E<S;E++)a.append(k[E],bf()),Of.nextNode(),u.push({type:2,index:++r});a.append(k[S],bf())}}}else if(8===a.nodeType)if(a.data===pf)u.push({type:2,index:r});else for(var P=-1;-1!==(P=a.data.indexOf(vf,P+1));)u.push({type:7,index:r}),P+=vf.length-1;r++}},null,[{key:"createElement",value:function(e,t){var n=yf.createElement("template");return n.innerHTML=e,n}}])}();function Wf(e,t,n=e,i){var a,r,o,s,l;if(t===Lf)return t;var u=void 0!==i?null===(a=n._$Co)||void 0===a?void 0:a[i]:n._$Cl,d=wf(t)?void 0:t._$litDirective$;return(null===(r=u)||void 0===r?void 0:r.constructor)!==d&&(null!==(o=u)&&void 0!==o&&null!==(s=o._$AO)&&void 0!==s&&s.call(o,!1),void 0===d?u=void 0:(u=new d(e))._$AT(e,n,i),void 0!==i?(null!==(l=n._$Co)&&void 0!==l?l:n._$Co=[])[i]=u:n._$Cl=u),void 0!==u&&(t=Wf(e,u._$AS(e,t.values),u,i)),t}var jf=function(){return c(function e(t,n){o(this,e),this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n},[{key:"parentNode",get:function(){return this._$AM.parentNode}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"u",value:function(e){var t,n=this._$AD,i=n.el.content,a=n.parts,r=(null!==(t=null==e?void 0:e.creationScope)&&void 0!==t?t:yf).importNode(i,!0);Of.currentNode=r;for(var o=Of.nextNode(),s=0,l=0,u=a[0];void 0!==u;){var d;if(s===u.index){var c=void 0;2===u.type?c=new Bf(o,o.nextSibling,this,e):1===u.type?c=new u.ctor(o,u.name,u.strings,this,e):6===u.type&&(c=new Vf(o,this,e)),this._$AV.push(c),u=a[++l]}s!==(null===(d=u)||void 0===d?void 0:d.index)&&(o=Of.nextNode(),s++)}return Of.currentNode=yf,r}},{key:"p",value:function(e){for(var t,n=0,i=h(this._$AV);!(t=i()).done;){var a=t.value;void 0!==a&&(void 0!==a.strings?(a._$AI(e,a,n),n+=a.strings.length-2):a._$AI(e[n])),n++}}}])}(),Bf=function(){return c(function e(t,n,i,a){var r;o(this,e),this.type=2,this._$AH=Rf,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=i,this.options=a,this._$Cv=null===(r=null==a?void 0:a.isConnected)||void 0===r||r},[{key:"_$AU",get:function(){var e,t;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cv}},{key:"parentNode",get:function(){var e,t=this._$AA.parentNode,n=this._$AM;return void 0!==n&&11===(null===(e=t)||void 0===e?void 0:e.nodeType)&&(t=n.parentNode),t}},{key:"startNode",get:function(){return this._$AA}},{key:"endNode",get:function(){return this._$AB}},{key:"_$AI",value:function(e,t=this){e=Wf(this,e,t),wf(e)?e===Rf||null==e||""===e?(this._$AH!==Rf&&this._$AR(),this._$AH=Rf):e!==this._$AH&&e!==Lf&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>kf(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]))(e)?this.k(e):this._(e)}},{key:"O",value:function(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}},{key:"T",value:function(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}},{key:"_",value:function(e){this._$AH!==Rf&&wf(this._$AH)?this._$AA.nextSibling.data=e:this.T(yf.createTextNode(e)),this._$AH=e}},{key:"$",value:function(e){var t,n=e.values,i=e._$litType$,a="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=Nf.createElement($f(i.h,i.h[0]),this.options)),i);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===a)this._$AH.p(n);else{var r=new jf(a,this),o=r.u(this.options);r.p(n),this.T(o),this._$AH=r}}},{key:"_$AC",value:function(e){var t=Ff.get(e.strings);return void 0===t&&Ff.set(e.strings,t=new Nf(e)),t}},{key:"k",value:function(e){kf(this._$AH)||(this._$AH=[],this._$AR());for(var t,n,i=this._$AH,a=0,r=h(e);!(n=r()).done;){var o=n.value;a===i.length?i.push(t=new _k(this.O(bf()),this.O(bf()),this,this.options)):t=i[a],t._$AI(o),a++}a<i.length&&(this._$AR(t&&t._$AB.nextSibling,a),i.length=a)}},{key:"_$AR",value:function(e=this._$AA.nextSibling,t){for(null===(n=this._$AP)||void 0===n||n.call(this,!1,!0,t);e!==this._$AB;){var n,i=cf(e).nextSibling;cf(e).remove(),e=i}}},{key:"setConnected",value:function(e){var t;void 0===this._$AM&&(this._$Cv=e,null===(t=this._$AP)||void 0===t||t.call(this,e))}}])}(),zf=function(){return c(function e(t,n,i,a,r){o(this,e),this.type=1,this._$AH=Rf,this._$AN=void 0,this.element=t,this.name=n,this._$AM=a,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Rf},[{key:"tagName",get:function(){return this.element.tagName}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(e,t=this,n,i){var a=this.strings,r=!1;if(void 0===a)e=Wf(this,e,t,0),(r=!wf(e)||e!==this._$AH&&e!==Lf)&&(this._$AH=e);else{var o,s,l=e;for(e=a[0],o=0;o<a.length-1;o++)(s=Wf(this,l[n+o],t,o))===Lf&&(s=this._$AH[o]),r||(r=!wf(s)||s!==this._$AH[o]),s===Rf?e=Rf:e!==Rf&&(e+=(null!=s?s:"")+a[o+1]),this._$AH[o]=s}r&&!i&&this.j(e)}},{key:"j",value:function(e){e===Rf?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=e?e:"")}}])}(),Uf=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).type=3,e}return p(t,e),c(t,[{key:"j",value:function(e){this.element[this.name]=e===Rf?void 0:e}}])}(zf),Hf=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).type=4,e}return p(t,e),c(t,[{key:"j",value:function(e){this.element.toggleAttribute(this.name,!!e&&e!==Rf)}}])}(zf),Gf=function(e){function t(e,n,i,a,s){var l;return o(this,t),(l=r(this,t,[e,n,i,a,s])).type=5,l}return p(t,e),c(t,[{key:"_$AI",value:function(e,t=this){var n;if((e=null!==(n=Wf(this,e,t,0))&&void 0!==n?n:Rf)!==Lf){var i=this._$AH,a=e===Rf&&i!==Rf||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==Rf&&(i===Rf||a);a&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}}},{key:"handleEvent",value:function(e){var t,n;"function"==typeof this._$AH?this._$AH.call(null!==(t=null===(n=this.options)||void 0===n?void 0:n.host)&&void 0!==t?t:this.element,e):this._$AH.handleEvent(e)}}])}(zf),Vf=function(){return c(function e(t,n,i){o(this,e),this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i},[{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(e){Wf(this,e)}}])}(),Kf={I:Bf},Xf=df.litHtmlPolyfillSupport;null!=Xf&&Xf(Nf,Bf),(null!==(lf=df.litHtmlVersions)&&void 0!==lf?lf:df.litHtmlVersions=[]).push("3.3.3");var Yf,qf,Jf=globalThis,Qf=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).renderOptions={host:i(e)},e._$Do=void 0,e}return p(t,e),c(t,[{key:"createRenderRoot",value:function(){var e,n,i=_(t,"createRenderRoot",this)([]);return null!==(n=(e=this.renderOptions).renderBefore)&&void 0!==n||(e.renderBefore=i.firstChild),i}},{key:"update",value:function(e){var n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),_(t,"update",this)([e]),this._$Do=((e,t,n)=>{var i,a=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:t,r=a._$litPart$;if(void 0===r){var o,s=null!==(o=null==n?void 0:n.renderBefore)&&void 0!==o?o:null;a._$litPart$=r=new Bf(t.insertBefore(bf(),s),s,void 0,null!=n?n:{})}return r._$AI(e),r})(n,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function(){var e;_(t,"connectedCallback",this)([]),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}},{key:"disconnectedCallback",value:function(){var e;_(t,"disconnectedCallback",this)([]),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}},{key:"render",value:function(){return Lf}}])}(uf);Qf._$litElement$=!0,Qf.finalized=!0,null===(Yf=Jf.litElementHydrateSupport)||void 0===Yf||Yf.call(Jf,{LitElement:Qf});var Zf=Jf.litElementPolyfillSupport;null==Zf||Zf({LitElement:Qf}),(null!==(qf=Jf.litElementVersions)&&void 0!==qf?qf:Jf.litElementVersions=[]).push("4.2.2");var ev,tv,nv=Gm(ev||(ev=(e=>e)`
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).NamiWebSdk={})}(this,function(e){"use strict";function t(e,t){this.v=e,this.k=t}function n(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 i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e){return new t(e,0)}function r(e,t,n){return t=v(t),b(e,g()?Reflect.construct(t,n||[],v(e).constructor):t.apply(e,n))}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 l=0;function u(e){return"__private_"+l+++"_"+e}function d(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,T(i.key),i)}}function c(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function h(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return n(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,t):void 0}}(e))||t){i&&(e=i);var a=0;return function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}}}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 m(){return m=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},m.apply(null,arguments)}function f(){return f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=v(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}},f.apply(null,arguments)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function p(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&&P(e,t)}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function(){return!!e})()}function y(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 b(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 i(e)}function w(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function r(n,i,a,r){var l=i&&i.prototype instanceof s?i:s,u=Object.create(l.prototype);return E(u,"_invoke",function(n,i,a){var r,s,l,u=0,d=a||[],c=!1,h={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return r=t,s=0,l=e,h.n=n,o}};function m(n,i){for(s=n,l=i,t=0;!c&&u&&!a&&t<d.length;t++){var a,r=d[t],m=h.p,f=r[2];n>3?(a=f===i)&&(l=r[(s=r[4])?5:(s=3,3)],r[4]=r[5]=e):r[0]<=m&&((a=n<2&&m<r[1])?(s=0,h.v=i,h.n=r[1]):m<f&&(a=n<3||r[0]>i||i>f)&&(r[4]=n,r[5]=i,h.n=f,s=0))}if(a||n>1)return o;throw c=!0,i}return function(a,d,f){if(u>1)throw TypeError("Generator is already running");for(c&&1===d&&m(d,f),s=d,l=f;(t=s<2?e:l)||!c;){r||(s?s<3?(s>1&&(h.n=-1),m(s,l)):h.n=l:h.v=l);try{if(u=2,r){if(s||(a="next"),t=r[a]){if(!(t=t.call(r,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=r.return)&&t.call(r),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);r=e}else if((t=(c=h.n<0)?l:n.call(i,h))!==o)break}catch(t){r=e,s=1,l=t}finally{u=1}}return{value:t,done:c}}}(n,a,r),!0),u}var o={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(E(t={},i,function(){return this}),t),c=u.prototype=s.prototype=Object.create(d);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,E(e,a,"GeneratorFunction")),e.prototype=Object.create(c),e}return l.prototype=u,E(c,"constructor",u),E(u,"constructor",l),l.displayName="GeneratorFunction",E(u,a,"GeneratorFunction"),E(c),E(c,a,"Generator"),E(c,i,function(){return this}),E(c,"toString",function(){return"[object Generator]"}),(w=function(){return{w:r,m:h}})()}function k(e,t,n,i,a){var r=function(e,t,n,i,a){return new S(w().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 S(e,n){function i(a,r,o,s){try{var l=e[a](r),u=l.value;return u instanceof t?n.resolve(u.v).then(function(e){i("next",e,o,s)},function(e){i("throw",e,o,s)}):n.resolve(u).then(function(e){l.value=e,o(l)},function(e){return i("throw",e,o,s)})}catch(e){s(e)}}var a;this.next||(E(S.prototype),E(S.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),E(this,"_invoke",function(e,t,r){function o(){return new n(function(t,n){i(e,r,t,n)})}return a=a?a.then(o,o):o()},!0)}function E(e,t,n,i){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}E=function(e,t,n,i){function r(t,n){E(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))},E(e,t,n,i)}function P(e,t){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},P(e,t)}function _(e,t,n,i){var a=f(v(e.prototype),t,n);return"function"==typeof a?function(e){return a.apply(n,e)}:a}function T(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 M(e){var t="function"==typeof Map?new Map:void 0;return M=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(g())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,t);var a=new(e.bind.apply(e,i));return n&&P(a,n.prototype),a}(e,arguments,v(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),P(n,e)},M(e)}var A,D,x,C,I,L,R,F,O,$,N,W,j=function(){return c(function e(t){o(this,e),this.ariaActiveDescendantElement=null,this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColIndexText="",this.ariaColSpan="",this.ariaControlsElements=null,this.ariaCurrent="",this.ariaDescribedByElements=null,this.ariaDescription="",this.ariaDetailsElements=null,this.ariaDisabled="",this.ariaErrorMessageElements=null,this.ariaExpanded="",this.ariaFlowToElements=null,this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLabelledByElements=null,this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaOwnsElements=null,this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRelevant="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowIndexText="",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(){}}])}(),B=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},z=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)},U={__proto__:null,enumerable:!0};Object.freeze(U);var H=($=function(){return c(function e(t,n={}){if(o(this,e),A.set(this,!1),D.set(this,!1),x.set(this,!1),C.set(this,!1),I.set(this,Date.now()),L.set(this,!1),R.set(this,void 0),F.set(this,void 0),O.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;B(this,A,!!a,"f"),B(this,D,!!i,"f"),B(this,x,!!r,"f"),B(this,R,`${t}`,"f"),B(this,F,null,"f"),B(this,O,!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(){B(this,C,!0,"f")}},{key:"target",get:function(){return z(this,F,"f")}},{key:"currentTarget",get:function(){return z(this,F,"f")}},{key:"srcElement",get:function(){return z(this,F,"f")}},{key:"type",get:function(){return z(this,R,"f")}},{key:"cancelable",get:function(){return z(this,A,"f")}},{key:"defaultPrevented",get:function(){return z(this,A,"f")&&z(this,C,"f")}},{key:"timeStamp",get:function(){return z(this,I,"f")}},{key:"composedPath",value:function(){return z(this,O,"f")?[z(this,F,"f")]:[]}},{key:"returnValue",get:function(){return!z(this,A,"f")||!z(this,C,"f")}},{key:"bubbles",get:function(){return z(this,D,"f")}},{key:"composed",get:function(){return z(this,x,"f")}},{key:"eventPhase",get:function(){return z(this,O,"f")?$.AT_TARGET:$.NONE}},{key:"cancelBubble",get:function(){return z(this,L,"f")},set:function(e){e&&B(this,L,!0,"f")}},{key:"stopPropagation",value:function(){B(this,L,!0,"f")}},{key:"isTrusted",get:function(){return!1}}])}(),A=new WeakMap,D=new WeakMap,x=new WeakMap,C=new WeakMap,I=new WeakMap,L=new WeakMap,R=new WeakMap,F=new WeakMap,O=new WeakMap,$.NONE=0,$.CAPTURING_PHASE=1,$.AT_TARGET=2,$.BUBBLING_PHASE=3,$);Object.defineProperties(H.prototype,{initEvent:U,stopImmediatePropagation:U,preventDefault:U,target:U,currentTarget:U,srcElement:U,type:U,cancelable:U,defaultPrevented:U,timeStamp:U,composedPath:U,returnValue:U,bubbles:U,composed:U,eventPhase:U,cancelBubble:U,stopPropagation:U,isTrusted:U});var G=(W=function(e){function t(e,n={}){var i,a;return o(this,t),a=r(this,t,[e,n]),N.set(a,void 0),B(a,N,null!==(i=null==n?void 0:n.detail)&&void 0!==i?i:null,"f"),a}return p(t,e),c(t,[{key:"initCustomEvent",value:function(e,t,n,i){throw new Error("Method not implemented.")}},{key:"detail",get:function(){return z(this,N,"f")}}])}(H),N=new WeakMap,W);Object.defineProperties(G.prototype,{detail:U});var V,K,X,Y,q=H,J=G;(V=function(){return c(function e(){o(this,e),this.STYLE_RULE=1,this.CHARSET_RULE=2,this.IMPORT_RULE=3,this.MEDIA_RULE=4,this.FONT_FACE_RULE=5,this.PAGE_RULE=6,this.NAMESPACE_RULE=10,this.KEYFRAMES_RULE=7,this.KEYFRAME_RULE=8,this.SUPPORTS_RULE=12,this.COUNTER_STYLE_RULE=11,this.FONT_FEATURE_VALUES_RULE=14,this.MARGIN_RULE=9,this.__parentStyleSheet=null,this.cssText=""},[{key:"parentRule",get:function(){return null}},{key:"parentStyleSheet",get:function(){return this.__parentStyleSheet}},{key:"type",get:function(){return 0}}])}()).STYLE_RULE=1,V.CHARSET_RULE=2,V.IMPORT_RULE=3,V.MEDIA_RULE=4,V.FONT_FACE_RULE=5,V.PAGE_RULE=6,V.NAMESPACE_RULE=10,V.KEYFRAMES_RULE=7,V.KEYFRAME_RULE=8,V.SUPPORTS_RULE=12,V.COUNTER_STYLE_RULE=11,V.FONT_FEATURE_VALUES_RULE=14,V.MARGIN_RULE=9,null!==(K=globalThis.Event)&&void 0!==K||(globalThis.Event=q),null!==(X=globalThis.CustomEvent)&&void 0!==X||(globalThis.CustomEvent=J);var Q=Symbol(),Z=e=>{var t;return"boolean"==typeof e?e:null!==(t=null==e?void 0:e.capture)&&void 0!==t&&t},ee={__proto__:null,enumerable:!0};Object.freeze(ee);var te=function(){return c(function e(){o(this,e),this.__eventListeners=new Map,this.__captureEventListeners=new Map},[{key:"addEventListener",value:function(e,t,n){var i;if(null!=t){var a=Z(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=Z(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.__resolveFullEventPath();!e.composed&&this.__host&&(t=t.slice(0,t.indexOf(this.__host)));var n=!1,i=!1,a=q.NONE,r=null,o=null,s=null,l=e.stopPropagation,u=e.stopImmediatePropagation;Object.defineProperties(e,{target:m({get:()=>null!=r?r:o},ee),srcElement:m({get:()=>e.target},ee),currentTarget:m({get:()=>s},ee),eventPhase:m({get:()=>a},ee),composedPath:m({value:()=>t},ee),stopPropagation:m({value:()=>{n=!0,l.call(e)}},ee),stopImmediatePropagation:m({value:()=>{i=!0,u.call(e)}},ee)});var d=(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=()=>(s=null,a=q.NONE,!e.defaultPrevented),f=t.slice().reverse();r=this.__host&&e.composed?null:this;for(var v,p=e=>{for(o=this;o.__host&&e.includes(o.__host);)o=o.__host},g=h(f);!(v=g()).done;){var y=v.value;r||o&&o!==y.__host||p(f.slice(f.indexOf(y))),s=y,a=y===e.target?q.AT_TARGET:q.CAPTURING_PHASE;var b=y.__captureEventListeners.get(e.type);if(b)for(var w,k=h(b);!(w=k()).done;){var S=w.value;if(d(S[0],S[1],b),i)return c()}if(n)return c()}var E=e.bubbles?t:[this];o=null;for(var P,_=h(E);!(P=_()).done;){var T=P.value;r||o&&T!==o.__host||p(E.slice(0,E.indexOf(T)+1)),s=T,a=T===e.target?q.AT_TARGET:q.BUBBLING_PHASE;var M=T.__eventListeners.get(e.type);if(M)for(var A,D=h(M);!(A=D()).done;){var x=A.value;if(d(x[0],x[1],M),i)return c()}if(n)return c()}return c()}},{key:"__resolveFullEventPath",value:function(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,oe,pe]}}])}(),ne=new WeakMap,ie=e=>{var t=ne.get(e);return void 0===t&&ne.set(e,t=new Map),t},ae=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t,[{key:"getRootNode",value:function(e){var t;if(null!=e&&e.composed)return se;var n=this.__host;return null!==(t=null==n?void 0:n.__shadowRoot)&&void 0!==t?t:se}}])}(te),re=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t,[{key:"adoptedStyleSheets",get:function(){return[]}},{key:"createTreeWalker",value:function(){return{}}},{key:"createTextNode",value:function(){return{}}},{key:"createElement",value:function(){return{}}}])}(ae),oe=new re,se=oe,le=function(e){function t(e){var n;if(o(this,t),n=r(this,t),e!==Q)throw new TypeError("Illegal constructor");return Object.assign(n,globalThis,{CustomElementRegistry:fe,customElements:ve,document:se,Document:re,Element:ue,EventTarget:te,HTMLElement:de,Node:ae,ShadowRoot:he,window:n,Window:le}),n}return p(t,e),c(t)}(ae),ue=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).__shadowRootMode=null,e.__shadowRoot=null,e.__internals=null,e}return p(t,e),c(t,[{key:"attributes",get:function(){return Array.from(ie(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){ie(this).set(e,String(t))}},{key:"removeAttribute",value:function(e){ie(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 ie(this).has(e)}},{key:"attachShadow",value:function(e){this.__shadowRootMode=e.mode;var t=new he(Q,e);return t.__eventTargetParent=this,t.__host=this,this.__shadowRoot=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 j(this);return this.__internals=e,e}},{key:"getAttribute",value:function(e){var t=ie(this).get(e);return null!=t?t:null}}])}(ae),de=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t)}(ue),ce=de,he=function(e){function t(e,n){var i;if(o(this,t),i=r(this,t),e!=e)throw new TypeError("Illegal constructor");return i.mode=n.mode,i}return p(t,e),c(t,[{key:"host",get:function(){return this.__host}}])}(ae);function me(){var e,t;return{promise:new Promise((n,i)=>{e=n,t=i}),resolve:e,reject:t}}null!==(Y=globalThis.litServerRoot)&&void 0!==Y||(globalThis.litServerRoot=Object.defineProperty(new ce,"localName",{get:()=>"lit-server-root"}));var fe=function(){return c(function e(){o(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:"initialize",value:function(e){throw new Error("customElements.initialize is not currently supported in SSR. Please file a bug if you need it.")}},{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 k(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=me(),this.__pendingWhenDefineds.set(e,n)),i.a(2,n.promise)}},null,this,null,Promise)}}])}(),ve=new fe,pe=new le(Q);"undefined"==typeof HTMLElement&&(globalThis.HTMLElement=ce);var ge=["action"],ye=null;var be={storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},getAllKeys:()=>[]},device:{getDeviceData:()=>({os_version:"",os_name:"",browser_name:"",browser_version:"",sdk_client:"",sdk_version:"",language:"en"}),getDeviceFormFactor:()=>"desktop",getDeviceScaleFactor:()=>1,generateUUID:()=>{throw new Error("No platform adapter registered — call registerPlatformAdapters() before Nami.configure()")},getScreenInfo:()=>({width:0,height:0,scale:1}),getLanguage:()=>"en"},ui:{createPaywall:()=>null,reRenderPaywall:()=>{},flowNavigateToScreen:()=>{}}};function we(){return null!=ye?ye:be}function ke(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 Se(e,t,n,i){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 Ee(e,t,n,i,a){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}"function"==typeof SuppressedError&&SuppressedError;var Pe;!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"}(Pe||(Pe={}));var _e,Te={},Me=Te.NAMI_SDK_VERSION,Ae=void 0===Me?"3.4.12":Me,De=Te.NAMI_SDK_PACKAGE_VERSION,xe=void 0===De?"3.4.12-dev.202609302156":De,Ce=Te.PLATFORM_ID_REQUIRED,Ie=void 0===Ce?"Platform ID is required":Ce,Le=Te.DEVICE_ID_REQUIRED,Re=void 0===Le?"Device ID is required":Le,Fe=Te.EXTERNAL_ID_REQUIRED,Oe=void 0===Fe?"External ID is required":Fe,$e=Te.SDK_NOT_INITIALIZED,Ne=void 0===$e?"SDK has not been initialized. Make sure to call Nami.configure() first!":$e,We=Te.CAMPAIGN_NOT_AVAILABLE,je=void 0===We?"Campaign is not available":We,Be=Te.FLOW_SCREENS_NOT_AVAILABLE,ze=void 0===Be?"Flow screens not available":Be,Ue=Te.UNABLE_TO_UPDATE_CDP_ID,He=void 0===Ue?"Unable to update CDP id in anonymous mode":Ue,Ge=Te.ANONYMOUS_MODE_ALREADY_ON,Ve=void 0===Ge?"Anonymous mode is already turned on.":Ge,Ke=Te.ANONYMOUS_MODE_ALREADY_OFF,Xe=void 0===Ke?"Anonymous mode is already turned off.":Ke,Ye=Te.DEVICE_ID_NOT_SET,qe=void 0===Ye?"Nami Device ID is not set":Ye,Je=Te.AUTH_DEVICE,Qe=void 0===Je?"nami_auth_device":Je,Ze=Te.NAMI_CONFIGURATION,et=void 0===Ze?"nami_configuration":Ze,tt=Te.NAMI_PROFILE,nt=void 0===tt?"nami_profile":tt,it=Te.API_CONFIG,at=void 0===it?"api_config":it,rt=Te.API_CAMPAIGN_RULES,ot=void 0===rt?"api_campaign_rules":rt,st=Te.API_PAYWALLS,lt=void 0===st?"api_paywalls":st,ut=Te.API_CAMPAIGN_SESSION_TIMESTAMP,dt=void 0===ut?"api_campaign_session_timestamp":ut,ct=Te.API_PRODUCTS,ht=void 0===ct?"api_products":ct,mt=Te.API_ACTIVE_ENTITLEMENTS,ft=void 0===mt?"api_active_entitlements":mt,vt=Te.SERVER_NAMI_ENTITLEMENTS,pt=void 0===vt?"server_active_entitlements":vt,gt=Te.INITIAL_APP_CONFIG,yt=void 0===gt?"initial_app_config":gt,bt=Te.INITIAL_CAMPAIGN_RULES,wt=void 0===bt?"initial_campaign_rules":bt,kt=Te.INITIAL_PAYWALLS,St=void 0===kt?"initial_paywalls":kt,Et=Te.INITIAL_PRODUCTS,Pt=void 0===Et?"initial_products":Et,_t=Te.LOCAL_NAMI_ENTITLEMENTS,Tt=void 0===_t?"local_active_entitlements":_t,Mt=Te.CUSTOMER_ATTRIBUTES_KEY_PREFIX,At=void 0===Mt?"nami_cmr_attributes_":Mt,Dt=Te.NAMI_CUSTOMER_JOURNEY_STATE,xt=void 0===Dt?"nami_customer_journey_state":Dt,Ct=Te.ANONYMOUS_MODE,It=void 0===Ct?"nami_anonymous_mode_v2":Ct,Lt=Te.ANONYMOUS_UUID,Rt=void 0===Lt?"nami_anonymous_uuid":Lt,Ft=Te.KEY_SESSION_COUNTER,Ot=void 0===Ft?"nami_session_counter":Ft,$t=Te.INITIAL_SESSION_COUNTER_VALUE,Nt=void 0===$t?1:$t,Wt=Te.NAMI_LAST_IMPRESSION_ID,jt=void 0===Wt?"nami_last_impression_id":Wt,Bt=Te.NAMI_PURCHASE_IMPRESSION_ID,zt=void 0===Bt?"nami_purchase_impression_id":Bt,Ut=Te.NAMI_LAUNCH_ID,Ht=void 0===Ut?"nami_launch_id":Ut,Gt=Te.NAMI_SESSION_ID,Vt=void 0===Gt?"nami_session_id":Gt,Kt=Te.NAMI_LANGUAGE_CODE,Xt=void 0===Kt?"nami_language_code":Kt,Yt=Te.NAMI_PURCHASE_CHANNEL,qt=void 0===Yt?"nami_purchase_channel":Yt,Jt=Te.API_VERSION,Qt=Te.BASE_URL_PATH,Zt=void 0===Qt?`sdk/${void 0===Jt?"v3":Jt}/platform`:Qt,en=Te.BASE_URL,tn=void 0===en?"https://app.namiml.com":en,nn=Te.BASE_STAGING_URL,an=void 0===nn?"https://app-staging.namiml.com":nn,rn=Te.CUSTOM_HOST_PREFIX,on=void 0===rn?"namiAPIHost=":rn,sn=Te.USE_STAGING_API,ln=void 0===sn?"useStagingAPI":sn,un=Te.EXTENDED_CLIENT_INFO_PREFIX,dn=void 0===un?"extendedClientInfo":un,cn=Te.EXTENDED_CLIENT_INFO_DELIMITER,hn=void 0===cn?":":cn,mn=Te.VALIDATE_PRODUCT_GROUPS,fn=void 0===mn?"validateProductGroups":mn,vn=Te.LOG_HTTP_REQUESTS,pn=void 0===vn?"logHTTPRequests":vn,gn=Te.LOG_HTTP_TRAFFIC,yn=void 0===gn?"logHTTPTraffic":gn,bn=Te.API_TRAFFIC_OBSERVER,wn=void 0===bn?"apiTrafficObserver":bn,kn=Te.STARTUP_TELEMETRY,Sn=void 0===kn?"startupTelemetry":kn,En=Te.SIMULATE_CONFIG_FETCH_FAILURE,Pn=void 0===En?"simulateConfigFetchFailure":En,_n=Te.SIMULATE_PAYWALL_FETCH_FAILURE,Tn=void 0===_n?"simulatePaywallFetchFailure":_n,Mn=Te.CAMPAIGN_CACHE_TTL_PREFIX,An=void 0===Mn?"campaignCacheTTL=":Mn,Dn=Te.API_MAX_CALLS_LIMIT,xn=void 0===Dn?2:Dn,Cn=Te.API_RETRY_DELAY_SEC,In=void 0===Cn?2:Cn,Ln=Te.API_TIMEOUT_LIMIT,Rn=void 0===Ln?2e4:Ln,Fn=Te.DEVICE_API_TIMEOUT_LIMIT,On=void 0===Fn?2e3:Fn,$n=Te.CONFIG_MAX_ATTEMPTS,Nn=void 0===$n?3:$n,Wn=Te.CONFIG_API_TIMEOUT_LIMIT,jn=void 0===Wn?1e4:Wn,Bn=Te.RESUME_THROTTLE_MS,zn=void 0===Bn?3e4:Bn,Un=Te.STATUS_BAD_REQUEST,Hn=void 0===Un?400:Un,Gn=Te.STATUS_NOT_FOUND,Vn=void 0===Gn?404:Gn,Kn=Te.STATUS_CONFLICT,Xn=void 0===Kn?409:Kn,Yn=Te.STATUS_INTERNAL_SERVER_ERROR,qn=void 0===Yn?500:Yn,Jn=Te.INITIAL_SUCCESS,Qn=void 0===Jn?"Initial success":Jn,Zn=Te.RECONFIG_SUCCESS,ei=void 0===Zn?"Reconfig success":Zn,ti=Te.ALREADY_CONFIGURED,ni=void 0===ti?"Already configured":ti,ii=Te.AVAILABLE_CAMPAIGNS_CHANGED,ai=void 0===ii?"AvailableCampaignsChanged":ii,ri=Te.PAYWALL_ACTION_EVENT,oi=void 0===ri?"PaywallActionEvent":ri,si=Te.AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED,li=void 0===si?"AvailableActiveEntitlementsChanged":si,ui=Te.CUSTOMER_JOURNEY_STATE_CHANGED,di=void 0===ui?"CustomerJourneyStateChanged":ui,ci=Te.SKU_TEXT_REGEX,hi=void 0===ci?/\$\{sku\.(\w+)(:\d+)?\}/g:ci,mi=Te.VAR_REGEX,fi=void 0===mi?/\$\{\s*(\w+(\.[a-zA-Z\d_:${}-]{0,99})*?)\s*}/g:mi,vi=Te.SMART_TEXT_PATTERN,pi=void 0===vi?"${":vi,gi=Te.LIQUID_VARIABLE_REGEX,yi=void 0===gi?/\${[A-Za-z0-9.]+}/g:gi,bi=[Qe,et,nt,at,ot,lt,dt,ht,ft,pt,yt,wt,St,Pt,Tt,xt,It,Rt,Ot,jt,zt,Ht,Vt,Xt,qt];e.LogLevel=void 0,(_e=e.LogLevel||(e.LogLevel={}))[_e.DEBUG=1]="DEBUG",_e[_e.INFO=2]="INFO",_e[_e.WARN=3]="WARN",_e[_e.ERROR=4]="ERROR";var wi={debug:e.LogLevel.DEBUG,info:e.LogLevel.INFO,warn:e.LogLevel.WARN,error:e.LogLevel.ERROR},ki=function(){return c(function t(){o(this,t),this.currentLogLevel=e.LogLevel.DEBUG,this.setLogger=t=>{this.currentLogLevel=t?wi[t]:e.LogLevel.WARN}},[{key:"debug",value:function(t,...n){this.shouldLog(e.LogLevel.DEBUG)&&console.debug(this.formatMessage(e.LogLevel.DEBUG,t,...n))}},{key:"info",value:function(t,...n){this.shouldLog(e.LogLevel.INFO)&&console.info(this.formatMessage(e.LogLevel.INFO,t,...n))}},{key:"warn",value:function(t,...n){this.shouldLog(e.LogLevel.WARN)&&console.warn(this.formatMessage(e.LogLevel.WARN,t,...n))}},{key:"error",value:function(t,...n){this.shouldLog(e.LogLevel.ERROR)&&console.error(this.formatMessage(e.LogLevel.ERROR,t,...n))}},{key:"shouldLog",value:function(e){return e>=this.currentLogLevel}},{key:"formatMessage",value:function(t,n,...i){var a=e.LogLevel[t];return`[${(new Date).toISOString()}] [${a}] ${n} ${i=i.map(e=>"object"==typeof e?JSON.stringify(e):e)}`}}])}(),Si=new ki;function Ei(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 Pi(e,t){return e===t||e!=e&&t!=t}function _i(e,t){for(var n=e.length;n--;)if(Pi(e[n][0],t))return n;return-1}var Ti=Array.prototype.splice;function Mi(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])}}Mi.prototype.clear=function(){this.__data__=[],this.size=0},Mi.prototype.delete=function(e){var t=this.__data__,n=_i(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ti.call(t,n,1),--this.size,!0)},Mi.prototype.get=function(e){var t=this.__data__,n=_i(t,e);return n<0?void 0:t[n][1]},Mi.prototype.has=function(e){return _i(this.__data__,e)>-1},Mi.prototype.set=function(e,t){var n=this.__data__,i=_i(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};var Ai="object"==typeof global&&global&&global.Object===Object&&global,Di="object"==typeof self&&self&&self.Object===Object&&self,xi=Ai||Di||Function("return this")(),Ci=xi.Symbol,Ii=Object.prototype,Li=Ii.hasOwnProperty,Ri=Ii.toString,Fi=Ci?Ci.toStringTag:void 0;var Oi=Object.prototype.toString;var $i=Ci?Ci.toStringTag:void 0;function Ni(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":$i&&$i in Object(e)?function(e){var t=Li.call(e,Fi),n=e[Fi];try{e[Fi]=void 0;var i=!0}catch(e){}var a=Ri.call(e);return i&&(t?e[Fi]=n:delete e[Fi]),a}(e):function(e){return Oi.call(e)}(e)}function Wi(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ji(e){if(!Wi(e))return!1;var t=Ni(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var Bi,zi=xi["__core-js_shared__"],Ui=(Bi=/[^.]+$/.exec(zi&&zi.keys&&zi.keys.IE_PROTO||""))?"Symbol(src)_1."+Bi:"";var Hi=Function.prototype.toString;function Gi(e){if(null!=e){try{return Hi.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var Vi=/^\[object .+?Constructor\]$/,Ki=Function.prototype,Xi=Object.prototype,Yi=Ki.toString,qi=Xi.hasOwnProperty,Ji=RegExp("^"+Yi.call(qi).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Qi(e){return!(!Wi(e)||(t=e,Ui&&Ui in t))&&(ji(e)?Ji:Vi).test(Gi(e));var t}function Zi(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Qi(n)?n:void 0}var ea=Zi(xi,"Map"),ta=Zi(Object,"create");var na=Object.prototype.hasOwnProperty;var ia=Object.prototype.hasOwnProperty;function aa(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 ra(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 oa(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])}}aa.prototype.clear=function(){this.__data__=ta?ta(null):{},this.size=0},aa.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},aa.prototype.get=function(e){var t=this.__data__;if(ta){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return na.call(t,e)?t[e]:void 0},aa.prototype.has=function(e){var t=this.__data__;return ta?void 0!==t[e]:ia.call(t,e)},aa.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ta&&void 0===t?"__lodash_hash_undefined__":t,this},oa.prototype.clear=function(){this.size=0,this.__data__={hash:new aa,map:new(ea||Mi),string:new aa}},oa.prototype.delete=function(e){var t=ra(this,e).delete(e);return this.size-=t?1:0,t},oa.prototype.get=function(e){return ra(this,e).get(e)},oa.prototype.has=function(e){return ra(this,e).has(e)},oa.prototype.set=function(e,t){var n=ra(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function sa(e){var t=this.__data__=new Mi(e);this.size=t.size}sa.prototype.clear=function(){this.__data__=new Mi,this.size=0},sa.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},sa.prototype.get=function(e){return this.__data__.get(e)},sa.prototype.has=function(e){return this.__data__.has(e)},sa.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Mi){var i=n.__data__;if(!ea||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new oa(i)}return n.set(e,t),this.size=n.size,this};function la(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new oa;++t<n;)this.add(e[t])}function ua(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 da(e,t){return e.has(t)}la.prototype.add=la.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},la.prototype.has=function(e){return this.__data__.has(e)};function ca(e,t,n,i,a,r){var o=1&n,s=e.length,l=t.length;if(s!=l&&!(o&&l>s))return!1;var u=r.get(e),d=r.get(t);if(u&&d)return u==t&&d==e;var c=-1,h=!0,m=2&n?new la:void 0;for(r.set(e,t),r.set(t,e);++c<s;){var f=e[c],v=t[c];if(i)var p=o?i(v,f,c,t,e,r):i(f,v,c,e,t,r);if(void 0!==p){if(p)continue;h=!1;break}if(m){if(!ua(t,function(e,t){if(!da(m,t)&&(f===e||a(f,e,n,i,r)))return m.push(t)})){h=!1;break}}else if(f!==v&&!a(f,v,n,i,r)){h=!1;break}}return r.delete(e),r.delete(t),h}var ha=xi.Uint8Array;function ma(e){var t=-1,n=Array(e.size);return e.forEach(function(e,i){n[++t]=[i,e]}),n}function fa(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var va=Ci?Ci.prototype:void 0,pa=va?va.valueOf:void 0;var ga=Array.isArray;var ya=Object.prototype.propertyIsEnumerable,ba=Object.getOwnPropertySymbols,wa=ba?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}(ba(e),function(t){return ya.call(e,t)}))}:function(){return[]};function ka(e){return null!=e&&"object"==typeof e}function Sa(e){return ka(e)&&"[object Arguments]"==Ni(e)}var Ea=Object.prototype,Pa=Ea.hasOwnProperty,_a=Ea.propertyIsEnumerable,Ta=Sa(function(){return arguments}())?Sa:function(e){return ka(e)&&Pa.call(e,"callee")&&!_a.call(e,"callee")};var Ma="object"==typeof e&&e&&!e.nodeType&&e,Aa=Ma&&"object"==typeof module&&module&&!module.nodeType&&module,Da=Aa&&Aa.exports===Ma?xi.Buffer:void 0,xa=(Da?Da.isBuffer:void 0)||function(){return!1},Ca=/^(?:0|[1-9]\d*)$/;function Ia(e,t){var n=typeof e;return!!(t=t??9007199254740991)&&("number"==n||"symbol"!=n&&Ca.test(e))&&e>-1&&e%1==0&&e<t}function La(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var Ra={};function Fa(e){return function(t){return e(t)}}Ra["[object Float32Array]"]=Ra["[object Float64Array]"]=Ra["[object Int8Array]"]=Ra["[object Int16Array]"]=Ra["[object Int32Array]"]=Ra["[object Uint8Array]"]=Ra["[object Uint8ClampedArray]"]=Ra["[object Uint16Array]"]=Ra["[object Uint32Array]"]=!0,Ra["[object Arguments]"]=Ra["[object Array]"]=Ra["[object ArrayBuffer]"]=Ra["[object Boolean]"]=Ra["[object DataView]"]=Ra["[object Date]"]=Ra["[object Error]"]=Ra["[object Function]"]=Ra["[object Map]"]=Ra["[object Number]"]=Ra["[object Object]"]=Ra["[object RegExp]"]=Ra["[object Set]"]=Ra["[object String]"]=Ra["[object WeakMap]"]=!1;var Oa="object"==typeof e&&e&&!e.nodeType&&e,$a=Oa&&"object"==typeof module&&module&&!module.nodeType&&module,Na=$a&&$a.exports===Oa&&Ai.process,Wa=function(){try{var e=$a&&$a.require&&$a.require("util").types;return e||Na&&Na.binding&&Na.binding("util")}catch(e){}}(),ja=Wa&&Wa.isTypedArray,Ba=ja?Fa(ja):function(e){return ka(e)&&La(e.length)&&!!Ra[Ni(e)]},za=Object.prototype.hasOwnProperty;function Ua(e,t){var n=ga(e),i=!n&&Ta(e),a=!n&&!i&&xa(e),r=!n&&!i&&!a&&Ba(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):[],l=s.length;for(var u in e)!za.call(e,u)||o&&("length"==u||a&&("offset"==u||"parent"==u)||r&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Ia(u,l))||s.push(u);return s}var Ha=Object.prototype;function Ga(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ha)}function Va(e,t){return function(n){return e(t(n))}}var Ka=Va(Object.keys,Object),Xa=Object.prototype.hasOwnProperty;function Ya(e){return null!=(t=e)&&La(t.length)&&!ji(t)?Ua(e):function(e){if(!Ga(e))return Ka(e);var t=[];for(var n in Object(e))Xa.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e);var t}function qa(e){return function(e,t,n){var i=t(e);return ga(e)?i:function(e,t){for(var n=-1,i=t.length,a=e.length;++n<i;)e[a+n]=t[n];return e}(i,n(e))}(e,Ya,wa)}var Ja=Object.prototype.hasOwnProperty;var Qa=Zi(xi,"DataView"),Za=Zi(xi,"Promise"),er=Zi(xi,"Set"),tr=Zi(xi,"WeakMap"),nr="[object Map]",ir="[object Promise]",ar="[object Set]",rr="[object WeakMap]",or="[object DataView]",sr=Gi(Qa),lr=Gi(ea),ur=Gi(Za),dr=Gi(er),cr=Gi(tr),hr=Ni;(Qa&&hr(new Qa(new ArrayBuffer(1)))!=or||ea&&hr(new ea)!=nr||Za&&hr(Za.resolve())!=ir||er&&hr(new er)!=ar||tr&&hr(new tr)!=rr)&&(hr=function(e){var t=Ni(e),n="[object Object]"==t?e.constructor:void 0,i=n?Gi(n):"";if(i)switch(i){case sr:return or;case lr:return nr;case ur:return ir;case dr:return ar;case cr:return rr}return t});var mr="[object Arguments]",fr="[object Array]",vr="[object Object]",pr=Object.prototype.hasOwnProperty;function gr(e,t,n,i,a,r){var o=ga(e),s=ga(t),l=o?fr:hr(e),u=s?fr:hr(t),d=(l=l==mr?vr:l)==vr,c=(u=u==mr?vr:u)==vr,h=l==u;if(h&&xa(e)){if(!xa(t))return!1;o=!0,d=!1}if(h&&!d)return r||(r=new sa),o||Ba(e)?ca(e,t,n,i,a,r):function(e,t,n,i,a,r,o){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!r(new ha(e),new ha(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Pi(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=ma;case"[object Set]":var l=1&i;if(s||(s=fa),e.size!=t.size&&!l)return!1;var u=o.get(e);if(u)return u==t;i|=2,o.set(e,t);var d=ca(s(e),s(t),i,a,r,o);return o.delete(e),d;case"[object Symbol]":if(pa)return pa.call(e)==pa.call(t)}return!1}(e,t,l,n,i,a,r);if(!(1&n)){var m=d&&pr.call(e,"__wrapped__"),f=c&&pr.call(t,"__wrapped__");if(m||f){var v=m?e.value():e,p=f?t.value():t;return r||(r=new sa),a(v,p,n,i,r)}}return!!h&&(r||(r=new sa),function(e,t,n,i,a,r){var o=1&n,s=qa(e),l=s.length;if(l!=qa(t).length&&!o)return!1;for(var u=l;u--;){var d=s[u];if(!(o?d in t:Ja.call(t,d)))return!1}var c=r.get(e),h=r.get(t);if(c&&h)return c==t&&h==e;var m=!0;r.set(e,t),r.set(t,e);for(var f=o;++u<l;){var v=e[d=s[u]],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 yr(e,t,n,i,a){return e===t||(null==e||null==t||!ka(e)&&!ka(t)?e!=e&&t!=t:gr(e,t,n,i,yr,a))}function br(e){return e==e&&!Wi(e)}function wr(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function kr(e){var t=function(e){for(var t=Ya(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,br(a)]}return t}(e);return 1==t.length&&t[0][2]?wr(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],l=e[s],u=o[1];if(o[2]){if(void 0===l&&!(s in e))return!1}else if(!yr(u,l,3,i,new sa))return!1}return!0}(n,0,t)}}function Sr(e){return"symbol"==typeof e||ka(e)&&"[object Symbol]"==Ni(e)}var Er=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pr=/^\w*$/;function _r(e,t){if(ga(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Sr(e))||(Pr.test(e)||!Er.test(e)||null!=t&&e in Object(t))}function Tr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");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(Tr.Cache||oa),n}Tr.Cache=oa;var Mr,Ar,Dr,xr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Cr=/\\(\\)?/g,Ir=(Mr=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(xr,function(e,n,i,a){t.push(i?a.replace(Cr,"$1"):n||e)}),t},Ar=Tr(Mr,function(e){return 500===Dr.size&&Dr.clear(),e}),Dr=Ar.cache,Ar);var Lr=Ci?Ci.prototype:void 0,Rr=Lr?Lr.toString:void 0;function Fr(e){if("string"==typeof e)return e;if(ga(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,Fr)+"";if(Sr(e))return Rr?Rr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Or(e,t){return ga(e)?e:_r(e,t)?[e]:Ir(function(e){return null==e?"":Fr(e)}(e))}function $r(e){if("string"==typeof e||Sr(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Nr(e,t){for(var n=0,i=(t=Or(t,e)).length;null!=e&&n<i;)e=e[$r(t[n++])];return n&&n==i?e:void 0}function Wr(e,t){return null!=e&&t in Object(e)}function jr(e,t){return null!=e&&function(e,t,n){for(var i=-1,a=(t=Or(t,e)).length,r=!1;++i<a;){var o=$r(t[i]);if(!(r=null!=e&&n(e,o)))break;e=e[o]}return r||++i!=a?r:!!(a=null==e?0:e.length)&&La(a)&&Ia(o,a)&&(ga(e)||Ta(e))}(e,t,Wr)}function Br(e,t){return _r(e)&&br(t)?wr($r(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?jr(n,e):yr(t,i,3)}}function zr(e){return e}function Ur(e){return _r(e)?(t=$r(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Nr(t,e)}}(e);var t}function Hr(e){return e!=e}function Gr(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,Hr,n)}(e,t,0)>-1}var Vr=er&&1/fa(new er([,-0]))[1]==1/0?function(e){return new er(e)}:function(){};function Kr(e,t){return e&&e.length?function(e,t,n){var i=-1,a=Gr,r=e.length,o=!0,s=[],l=s;if(r>=200){var u=t?null:Vr(e);if(u)return fa(u);o=!1,a=da,l=new la}else l=t?[]:s;e:for(;++i<r;){var d=e[i],c=t?t(d):d;if(d=0!==d?d:0,o&&c==c){for(var h=l.length;h--;)if(l[h]===c)continue e;t&&l.push(c),s.push(d)}else a(l,c,n)||(l!==s&&l.push(c),s.push(d))}return s}(e,"function"==typeof(n=t)?n:null==n?zr:"object"==typeof n?ga(n)?Br(n[0],n[1]):kr(n):Ur(n)):[];var n}var Xr="api_paywall_body:",Yr="api_paywall_body_meta:",qr=function(){return c(function e(t=()=>we().storage,n=500){o(this,e),this.storage=t,this.maxEntries=n,this.memory=null,this.index=null},[{key:"count",get:function(){return this.memory?this.memory.size:this.loadIndex().size}},{key:"evaluateTtl",value:function(e,t=Date.now()){if(0===e){if(this.memory)return;return this.dropPersisted([...this.loadIndex().keys()]),void(this.memory=new Map)}if(this.memory=null,null!==e){var n=[...this.loadIndex().values()].filter(n=>Jr(n,e,t));this.dropPersisted(n.map(e=>e.url))}}},{key:"validEntry",value:function(e,t,n=Date.now()){var i;if(this.memory)return null!==(i=this.memory.get(e))&&void 0!==i?i:null;var a=this.loadIndex().get(e);if(!a)return null;if(null!==t&&t>0&&Jr(a,t,n))return this.dropPersisted([e]),null;var r=this.read(Xr+e);return null===r?(this.dropPersisted([e]),null):{meta:a,body:r}}},{key:"bodyFor",value:function(e){var t,n;return this.memory?null!==(t=null===(n=this.memory.get(e))||void 0===n?void 0:n.body)&&void 0!==t?t:null:this.read(Xr+e)}},{key:"store",value:function(e,t,n,i=Date.now()){var a=m({url:e,savedAt:i},t?{contentHash:t}:{});if(this.memory)return this.memory.set(e,{meta:a,body:n}),!0;var r=this.loadIndex(),o=JSON.stringify(a);return this.write(Xr+e,n)&&this.write(Yr+e,o)?(r.set(e,a),!0):(Si.warn(`Paywall body cache: could not store ${e}; it will be fetched next time`),this.dropPersisted([e]),!1)}},{key:"seedIfAbsent",value:function(e,t,n,i=Date.now()){return!(this.memory?this.memory.has(e):this.loadIndex().has(e))&&this.store(e,t,n,i)}},{key:"remove",value:function(e){this.memory?this.memory.delete(e):this.dropPersisted([e])}},{key:"reconcile",value:function(e){var t=this.memory?[...this.memory.values()].map(e=>e.meta):[...this.loadIndex().values()],n=t.filter(t=>!e.has(t.url)).map(e=>e.url),i=t.filter(t=>e.has(t.url)).sort((e,t)=>e.savedAt-t.savedAt);[...n,...i.slice(0,Math.max(0,i.length-this.maxEntries)).map(e=>e.url)].forEach(e=>this.remove(e))}},{key:"purgeAll",value:function(){var e;this.dropPersisted([...this.loadIndex().keys()]),null===(e=this.memory)||void 0===e||e.clear()}},{key:"loadIndex",value:function(){if(this.index)return this.index;var e;this.index=new Map;try{e=this.storage().getAllKeys()}catch(e){return Si.warn(`Paywall body cache: storage unavailable, caching nothing (${e})`),this.index}for(var t,n=new Set(e.filter(e=>e.startsWith(Xr)).map(e=>e.slice(17))),i=[],a=h(e);!(t=a()).done;){var r=t.value;if(r.startsWith(Yr)){var o=r.slice(22),s=Qr(this.read(r));(null==s?void 0:s.url)===o&&n.has(o)?this.index.set(o,s):i.push(o),n.delete(o)}}return this.dropPersisted([...i,...n]),this.index}},{key:"dropPersisted",value:function(e){for(var t,n=h(e);!(t=n()).done;){var i,a=t.value;null===(i=this.index)||void 0===i||i.delete(a),this.removeKey(Yr+a),this.removeKey(Xr+a)}}},{key:"read",value:function(e){try{return this.storage().getItem(e)}catch(e){return null}}},{key:"write",value:function(e,t){try{this.storage().setItem(e,t)}catch(e){return!1}return this.read(e)===t}},{key:"removeKey",value:function(e){try{this.storage().removeItem(e)}catch(e){}}}])}();function Jr(e,t,n){return(n-e.savedAt)/1e3>=t}function Qr(e){if(null===e)return null;try{var t=JSON.parse(e);return"string"==typeof(null==t?void 0:t.url)&&"number"==typeof(null==t?void 0:t.savedAt)?t:null}catch(e){return null}}var Zr=new qr,eo=function(){return c(function e(){o(this,e),this.memoryStore={}},[{key:"storage",get:function(){return we().storage}},{key:"setDevice",value:function(e){this.setItem(Qe,e)}},{key:"getDevice",value:function(){return this.getItem(Qe)}},{key:"resetDevice",value:function(){this.resetItem(Qe)}},{key:"getAnonymousMode",value:function(){return this.getItem(It)||!1}},{key:"setAnonymousMode",value:function(e){this.setItem(It,e)}},{key:"clearAnonymousMode",value:function(){this.resetItem(It)}},{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(Xt,e||"en")}},{key:"getLanguageCode",value:function(){return this.getItem(Xt)||"en"}},{key:"setCampaignRules",value:function(e,t){e!==wt?e!==ot||0!==this.getCampaignCacheTtl()?this.setItem(e,t):this.memoryStore[ot]=JSON.stringify(t):this.memoryStore[wt]=JSON.stringify(t)}},{key:"getCampaignRules",value:function(e){if(e===wt)return this.memoryStore[wt]?JSON.parse(this.memoryStore[wt]):null;if(e===ot){var t=this.memoryStore[ot];if(null!=t)return JSON.parse(t);var n=this.getItem(ot);if(null===n)return null;if("string"==typeof n)try{n=JSON.parse(n)}catch(e){return n}return this.isLegacyTimestampedCache(n)?n.data:n}return this.getItem(e)}},{key:"setPaywalls",value:function(e,t){e!==St?e!==lt||0!==this.getCampaignCacheTtl()?this.setItem(e,t):this.memoryStore[lt]=JSON.stringify(t):this.memoryStore[St]=JSON.stringify(t)}},{key:"setApiPaywallsFromBodyCache",value:function(e){var t={bodyCacheUrls:e};0!==this.getCampaignCacheTtl()?this.setItem(lt,t):this.memoryStore[lt]=JSON.stringify(t)}},{key:"getPaywalls",value:function(e){if(e===St)return this.memoryStore[St]?JSON.parse(this.memoryStore[St]):null;if(e===lt){var t=this.memoryStore[lt];if(null!=t){var n=JSON.parse(t);return to(n)?no(n.bodyCacheUrls):n}var i=this.getItem(lt);if(null===i)return null;if("string"==typeof i)try{i=JSON.parse(i)}catch(e){return i}return to(i)?no(i.bodyCacheUrls):this.isLegacyTimestampedCache(i)?i.data:i}return 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(ht))&&void 0!==e?e:[];return Kr(Ei([...null!==(t=this.getItem(Pt))&&void 0!==t?t:[],...n]),"sku_ref_id")}},{key:"setNamiConfig",value:function(e){this.setItem(et,e)}},{key:"getNamiConfig",value:function(){return this.getItem(et)}},{key:"setCustomerAttribute",value:function(e,t){this.setItem(At+e,t)}},{key:"getCustomerAttribute",value:function(e){return this.getItem(At+e)}},{key:"getAllCustomerAttributes",value:function(){return this.storage.getAllKeys().map(e=>[e,this.storage.getItem(e)]).filter(([e])=>e.includes(At)).map(([e,t])=>e.replace(At,"")+":"+t)}},{key:"getAllCustomerAttributesKeys",value:function(){return this.storage.getAllKeys().filter(e=>e.includes(At)).map(e=>e.replace(At,""))}},{key:"getAllCustomerAttributesMap",value:function(){var e={};return this.getAllCustomerAttributesKeys().forEach(t=>{var n=this.getCustomerAttribute(t);null!=n&&(e[t]=String(n))}),e}},{key:"clearCustomerAttribute",value:function(e){var t=At+e,n=this.getItem(t);return n&&this.resetItem(t),!!n}},{key:"clearAllCustomerAttributes",value:function(){this.storage.getAllKeys().filter(e=>e.includes(At)).map(e=>this.resetItem(e))}},{key:"setNamiProfile",value:function(e){this.setItem(nt,e)}},{key:"getNamiProfile",value:function(){return this.getItem(nt)}},{key:"removeNamiProfile",value:function(){this.resetItem(nt)}},{key:"setCustomerJourneyState",value:function(e){this.setItem(xt,e)}},{key:"getCustomerJourneyState",value:function(){return this.getItem(xt)}},{key:"setSessionCounter",value:function(){var e=this.getItem(Ot),t=e?parseInt(e):Nt||Nt;this.setItem(Ot,t+1)}},{key:"getSessionCounter",value:function(){var e=this.getItem(Ot);return e?parseInt(e):Nt}},{key:"setLastImpressionId",value:function(e){this.setItem(jt,e)}},{key:"getLastImpressionId",value:function(){var e;return null!==(e=this.getItem(jt))&&void 0!==e?e:""}},{key:"setPurchaseImpression",value:function(){var e,t=null!==(e=this.getLastImpressionId())&&void 0!==e?e:"";this.setItem(zt,t)}},{key:"getPurchaseImpression",value:function(){var e;return null!==(e=this.getItem(zt))&&void 0!==e?e:""}},{key:"setSessionId",value:function(e){e&&this.setItem(Vt,e)}},{key:"getSessionId",value:function(){var e;return null!==(e=this.getItem(Vt))&&void 0!==e?e:""}},{key:"clearSessionId",value:function(){this.resetItem(Vt)}},{key:"setLaunchId",value:function(e){e&&this.setItem(Ht,e)}},{key:"getLaunchId",value:function(){var e;return null!==(e=this.getItem(Ht))&&void 0!==e?e:""}},{key:"clearLaunchId",value:function(){this.resetItem(Ht)}},{key:"setPurchaseChannel",value:function(e){e&&this.setItem(qt,e)}},{key:"getPurchaseChannel",value:function(){return this.getItem(qt)}},{key:"getAnonymousUUID",value:function(){return this.getItem(Rt)}},{key:"setAnonymousUUID",value:function(e){this.setItem(Rt,e)}},{key:"clearAnonymousUUID",value:function(){this.resetItem(Rt)}},{key:"setApiCampaignSessionTimestamp",value:function(){this.setItem(dt,Date.now())}},{key:"getApiCampaignSessionTimestamp",value:function(){return this.getItem(dt)}},{key:"purgeApiCampaignCache",value:function(){this.resetItem(lt),this.resetItem(ot),this.resetItem(dt)}},{key:"getCampaignCacheTtl",value:function(){var e,t,n=null===(e=this.getNamiConfig())||void 0===e||null===(e=e.namiCommands)||void 0===e?void 0:e.filter(e=>e.startsWith(An)).map(e=>e.slice(An.length)).find(e=>/^\d+$/.test(e));if(void 0!==n)return parseInt(n,10);var i=this.getAppConfig(at)||this.getAppConfig(yt);return null!==(t=null==i?void 0:i.campaign_cache_ttl)&&void 0!==t?t:null}},{key:"isLegacyTimestampedCache",value:function(e){return"object"==typeof e&&null!==e&&"cachedAt"in e&&"data"in e}},{key:"setItem",value:function(e,t){var n;try{n=JSON.stringify(t)}catch(t){return void Si.error(`Serialization failed for ${e}`,t)}try{this.storage.setItem(e,n)}catch(t){Si.error("Error setting item in localStorage:",t),this.resetItem(e),this.memoryStore[e]=n}}},{key:"getItem",value:function(e){try{var t=this.storage.getItem(e);if(null!==t)return JSON.parse(t)}catch(t){Si.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{this.storage.removeItem(e)}catch(t){Si.error("Error removing item from localStorage:",e,": ",t)}delete this.memoryStore[e]}},{key:"clearAll",value:function(){bi.forEach(e=>this.resetItem(e)),this.clearAllCustomerAttributes(),this.memoryStore={}}},{key:"clear",value:function(){try{this.storage.clear()}catch(e){Si.error("Error clearing localStorage:",e)}this.memoryStore={}}}])}();function to(e){return"object"==typeof e&&null!==e&&Array.isArray(e.bodyCacheUrls)}function no(e){for(var t,n=[],i=h(e);!(t=i()).done;){var a=t.value,r=Zr.bodyFor(a);if(null!==r)try{n.push(JSON.parse(r))}catch(e){Zr.remove(a)}}return n}var io=new eo,ao=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t,[n])).statusCode=e,i.status=e,i.message=`RetryLimitExceededError: ${i.message}`,i}return p(t,e),c(t)}(M(Error)),ro=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t)}(M(Error)),oo=function(e){function t(){var e;return o(this,t),(e=r(this,t)).status=409,e.name="ConflictError",e.message="ConflictError: Server responded with conflict",e}return p(t,e),c(t)}(ro),so=function(e){function t(){return o(this,t),r(this,t,[Ne])}return p(t,e),c(t)}(M(Error)),lo=function(e){function t(){return o(this,t),r(this,t,[Ie])}return p(t,e),c(t)}(M(Error)),uo=function(e){function t(){return o(this,t),r(this,t,[Re])}return p(t,e),c(t)}(M(Error)),co=function(e){function t(){return o(this,t),r(this,t,[Oe])}return p(t,e),c(t)}(M(Error)),ho=function(e){function t(){return o(this,t),r(this,t,[je])}return p(t,e),c(t)}(M(Error)),mo=function(e){function t(){return o(this,t),r(this,t,[ze])}return p(t,e),c(t)}(M(Error)),fo=function(e){function t(){return o(this,t),r(this,t,[Ve])}return p(t,e),c(t)}(M(Error)),vo=function(e){function t(){return o(this,t),r(this,t,[Xe])}return p(t,e),c(t)}(M(Error)),po=function(e){function t(){return o(this,t),r(this,t,[Xe])}return p(t,e),c(t)}(M(Error)),go=function(e){function t(){return o(this,t),r(this,t,[He])}return p(t,e),c(t)}(M(Error)),yo=function(e){function t(e){var n;return o(this,t),(n=r(this,t,[e])).message=`BadRequestError: ${n.message}`,n}return p(t,e),c(t)}(ro),bo=function(e){function t(e){var n;return o(this,t),(n=r(this,t,[e])).message=`NotFoundError: ${n.message}`,n}return p(t,e),c(t)}(ro),wo=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t,[n])).statusCode=e,i.message=`ClientError: ${i.message}`,i}return p(t,e),c(t)}(ro),ko=function(e){function t(e){var n;return o(this,t),(n=r(this,t,[e])).message=`ServerError: ${n.message}`,n}return p(t,e),c(t)}(ro),So=(e,t)=>{if(e==Hn)throw new yo(t);if(e==Vn)throw new bo(t);if(e==Xn)throw new oo;if(e>Hn&&e<qn)throw new wo(e,t);if(e>=qn)throw new ko(t)};function Eo(e){for(var t=e.length;--t>=0;)e[t]=0}Eo(new Array(576)),Eo(new Array(60)),Eo(new Array(512)),Eo(new Array(256)),Eo(new Array(29)),Eo(new Array(30));var Po=(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},_o=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})()),To=(e,t,n,i)=>{var a=_o,r=i+n;e^=-1;for(var o=i;o<r;o++)e=e>>>8^a[255&(e^t[o])];return-1^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"},Ao=0,Do=4,xo=5,Co=6,Io=0,Lo=1,Ro=2,Fo=-2,Oo=-3,$o=-4,No=-5,Wo=8,jo=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Bo=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)jo(n,i)&&(e[i]=n[i])}}return e},zo=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 l=e[r];a.set(l,o),o+=l.length}return a},Uo=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Uo=!1}for(var Ho=new Uint8Array(256),Go=0;Go<256;Go++)Ho[Go]=Go>=252?6:Go>=248?5:Go>=240?4:Go>=224?3:Go>=192?2:1;Ho[254]=Ho[254]=1;var Vo=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},Ko=(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=Ho[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&&Uo)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)},Xo=(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+Ho[e[n]]>t?n:t};var Yo=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},qo=16209,Jo=function(e,t){var n,i,a,r,o,s,l,u,d,c,h,m,f,v,p,g,y,b,w,k,S,E,P,_,T=e.state;n=e.next_in,P=e.input,i=n+(e.avail_in-5),a=e.next_out,_=e.output,r=a-(t-e.avail_out),o=a+(e.avail_out-257),s=T.dmax,l=T.wsize,u=T.whave,d=T.wnext,c=T.window,h=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&&(h+=P[n++]<<m,m+=8,h+=P[n++]<<m,m+=8),y=f[h&p];t:for(;;){if(h>>>=b=y>>>24,m-=b,0===(b=y>>>16&255))_[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=qo;break e}y=f[(65535&y)+(h&(1<<b)-1)];continue t}for(w=65535&y,(b&=15)&&(m<b&&(h+=P[n++]<<m,m+=8),w+=h&(1<<b)-1,h>>>=b,m-=b),m<15&&(h+=P[n++]<<m,m+=8,h+=P[n++]<<m,m+=8),y=v[h&g];;){if(h>>>=b=y>>>24,m-=b,16&(b=y>>>16&255)){if(k=65535&y,m<(b&=15)&&(h+=P[n++]<<m,(m+=8)<b&&(h+=P[n++]<<m,m+=8)),(k+=h&(1<<b)-1)>s){e.msg="invalid distance too far back",T.mode=qo;break e}if(h>>>=b,m-=b,k>(b=a-r)){if((b=k-b)>u&&T.sane){e.msg="invalid distance too far back",T.mode=qo;break e}if(S=0,E=c,0===d){if(S+=l-b,b<w){w-=b;do{_[a++]=c[S++]}while(--b);S=a-k,E=_}}else if(d<b){if(S+=l+d-b,(b-=d)<w){w-=b;do{_[a++]=c[S++]}while(--b);if(S=0,d<w){w-=b=d;do{_[a++]=c[S++]}while(--b);S=a-k,E=_}}}else if(S+=d-b,b<w){w-=b;do{_[a++]=c[S++]}while(--b);S=a-k,E=_}for(;w>2;)_[a++]=E[S++],_[a++]=E[S++],_[a++]=E[S++],w-=3;w&&(_[a++]=E[S++],w>1&&(_[a++]=E[S++]))}else{S=a-k;do{_[a++]=_[S++],_[a++]=_[S++],_[a++]=_[S++],w-=3}while(w>2);w&&(_[a++]=_[S++],w>1&&(_[a++]=_[S++]))}break}if(64&b){e.msg="invalid distance code",T.mode=qo;break e}y=v[(65535&y)+(h&(1<<b)-1)]}}break}}while(n<i&&a<o);n-=w=m>>3,h&=(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=h,T.bits=m},Qo=15,Zo=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]),es=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]),ts=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]),ns=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]),is=(e,t,n,i,a,r,o,s)=>{var l,u,d,c,h,m,f,v,p,g=s.bits,y=0,b=0,w=0,k=0,S=0,E=0,P=0,_=0,T=0,M=0,A=null,D=new Uint16Array(16),x=new Uint16Array(16),C=null;for(y=0;y<=Qo;y++)D[y]=0;for(b=0;b<i;b++)D[t[n+b]]++;for(S=g,k=Qo;k>=1&&0===D[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===D[w];w++);for(S<w&&(S=w),_=1,y=1;y<=Qo;y++)if(_<<=1,(_-=D[y])<0)return-1;if(_>0&&(0===e||1!==k))return-1;for(x[1]=0,y=1;y<Qo;y++)x[y+1]=x[y]+D[y];for(b=0;b<i;b++)0!==t[n+b]&&(o[x[t[n+b]]++]=b);if(0===e?(A=C=o,m=20):1===e?(A=Zo,C=es,m=257):(A=ts,C=ns,m=0),M=0,b=0,y=w,h=r,E=S,P=0,d=-1,c=(T=1<<S)-1,1===e&&T>852||2===e&&T>592)return 1;for(;;){f=y-P,o[b]+1<m?(v=0,p=o[b]):o[b]>=m?(v=C[o[b]-m],p=A[o[b]-m]):(v=96,p=0),l=1<<y-P,w=u=1<<E;do{a[h+(M>>P)+(u-=l)]=f<<24|v<<16|p}while(0!==u);for(l=1<<y-1;M&l;)l>>=1;if(0!==l?(M&=l-1,M+=l):M=0,b++,0===--D[y]){if(y===k)break;y=t[n+o[b]]}if(y>S&&(M&c)!==d){for(0===P&&(P=S),h+=w,_=1<<(E=y-P);E+P<k&&!((_-=D[E+P])<=0);)E++,_<<=1;if(T+=1<<E,1===e&&T>852||2===e&&T>592)return 1;a[d=M&c]=S<<24|E<<16|h-r}}return 0!==M&&(a[h+M]=y-P<<24|64<<16),s.bits=S,0},as=Do,rs=xo,os=Co,ss=Io,ls=Lo,us=Ro,ds=Fo,cs=Oo,hs=$o,ms=No,fs=Wo,vs=16180,ps=16190,gs=16191,ys=16192,bs=16194,ws=16199,ks=16200,Ss=16206,Es=16209,Ps=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function _s(){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 Ts,Ms,As=e=>{if(!e)return 1;var t=e.state;return!t||t.strm!==e||t.mode<vs||t.mode>16211?1:0},Ds=e=>{if(As(e))return ds;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=vs,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,ss},xs=e=>{if(As(e))return ds;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Ds(e)},Cs=(e,t)=>{var n;if(As(e))return ds;var i=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?ds:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,xs(e))},Is=(e,t)=>{if(!e)return ds;var n=new _s;e.state=n,n.strm=e,n.window=null,n.mode=vs;var i=Cs(e,t);return i!==ss&&(e.state=null),i},Ls=!0,Rs=e=>{if(Ls){Ts=new Int32Array(512),Ms=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(is(1,e.lens,0,288,Ts,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;is(2,e.lens,0,32,Ms,0,e.work,{bits:5}),Ls=!1}e.lencode=Ts,e.lenbits=9,e.distcode=Ms,e.distbits=5},Fs=(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},Os=(e,t)=>{var n,i,a,r,o,s,l,u,d,c,h,m,f,v,p,g,y,b,w,k,S,E,P,_,T=0,M=new Uint8Array(4),A=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(As(e)||!e.output||!e.input&&0!==e.avail_in)return ds;(n=e.state).mode===gs&&(n.mode=ys),o=e.next_out,a=e.output,l=e.avail_out,r=e.next_in,i=e.input,s=e.avail_in,u=n.hold,d=n.bits,c=s,h=l,E=ss;e:for(;;)switch(n.mode){case vs:if(0===n.wrap){n.mode=ys;break}for(;d<16;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}if(2&n.wrap&&35615===u){0===n.wbits&&(n.wbits=15),n.check=0,M[0]=255&u,M[1]=u>>>8&255,n.check=To(n.check,M,2,0),u=0,d=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",n.mode=Es;break}if((15&u)!==fs){e.msg="unknown compression method",n.mode=Es;break}if(d-=4,S=8+(15&(u>>>=4)),0===n.wbits&&(n.wbits=S),S>15||S>n.wbits){e.msg="invalid window size",n.mode=Es;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&u?16189:gs,u=0,d=0;break;case 16181:for(;d<16;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}if(n.flags=u,(255&n.flags)!==fs){e.msg="unknown compression method",n.mode=Es;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=Es;break}n.head&&(n.head.text=u>>8&1),512&n.flags&&4&n.wrap&&(M[0]=255&u,M[1]=u>>>8&255,n.check=To(n.check,M,2,0)),u=0,d=0,n.mode=16182;case 16182:for(;d<32;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}n.head&&(n.head.time=u),512&n.flags&&4&n.wrap&&(M[0]=255&u,M[1]=u>>>8&255,M[2]=u>>>16&255,M[3]=u>>>24&255,n.check=To(n.check,M,4,0)),u=0,d=0,n.mode=16183;case 16183:for(;d<16;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}n.head&&(n.head.xflags=255&u,n.head.os=u>>8),512&n.flags&&4&n.wrap&&(M[0]=255&u,M[1]=u>>>8&255,n.check=To(n.check,M,2,0)),u=0,d=0,n.mode=16184;case 16184:if(1024&n.flags){for(;d<16;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}n.length=u,n.head&&(n.head.extra_len=u),512&n.flags&&4&n.wrap&&(M[0]=255&u,M[1]=u>>>8&255,n.check=To(n.check,M,2,0)),u=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=To(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=To(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=To(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--,u+=i[r++]<<d,d+=8}if(4&n.wrap&&u!==(65535&n.check)){e.msg="header crc mismatch",n.mode=Es;break}u=0,d=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=gs;break;case 16189:for(;d<32;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}e.adler=n.check=Ps(u),u=0,d=0,n.mode=ps;case ps:if(0===n.havedict)return e.next_out=o,e.avail_out=l,e.next_in=r,e.avail_in=s,n.hold=u,n.bits=d,us;e.adler=n.check=1,n.mode=gs;case gs:if(t===rs||t===os)break e;case ys:if(n.last){u>>>=7&d,d-=7&d,n.mode=Ss;break}for(;d<3;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}switch(n.last=1&u,d-=1,3&(u>>>=1)){case 0:n.mode=16193;break;case 1:if(Rs(n),n.mode=ws,t===os){u>>>=2,d-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=Es}u>>>=2,d-=2;break;case 16193:for(u>>>=7&d,d-=7&d;d<32;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}if((65535&u)!=(u>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Es;break}if(n.length=65535&u,u=0,d=0,n.mode=bs,t===os)break e;case bs:n.mode=16195;case 16195:if(m=n.length){if(m>s&&(m=s),m>l&&(m=l),0===m)break e;a.set(i.subarray(r,r+m),o),s-=m,r+=m,l-=m,o+=m,n.length-=m;break}n.mode=gs;break;case 16196:for(;d<14;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}if(n.nlen=257+(31&u),u>>>=5,d-=5,n.ndist=1+(31&u),u>>>=5,d-=5,n.ncode=4+(15&u),u>>>=4,d-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Es;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;d<3;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}n.lens[A[n.have++]]=7&u,u>>>=3,d-=3}for(;n.have<19;)n.lens[A[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,P={bits:n.lenbits},E=is(0,n.lens,0,19,n.lencode,0,n.work,P),n.lenbits=P.bits,E){e.msg="invalid code lengths set",n.mode=Es;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;g=(T=n.lencode[u&(1<<n.lenbits)-1])>>>16&255,y=65535&T,!((p=T>>>24)<=d);){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}if(y<16)u>>>=p,d-=p,n.lens[n.have++]=y;else{if(16===y){for(_=p+2;d<_;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}if(u>>>=p,d-=p,0===n.have){e.msg="invalid bit length repeat",n.mode=Es;break}S=n.lens[n.have-1],m=3+(3&u),u>>>=2,d-=2}else if(17===y){for(_=p+3;d<_;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}d-=p,S=0,m=3+(7&(u>>>=p)),u>>>=3,d-=3}else{for(_=p+7;d<_;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}d-=p,S=0,m=11+(127&(u>>>=p)),u>>>=7,d-=7}if(n.have+m>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Es;break}for(;m--;)n.lens[n.have++]=S}}if(n.mode===Es)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=Es;break}if(n.lenbits=9,P={bits:n.lenbits},E=is(1,n.lens,0,n.nlen,n.lencode,0,n.work,P),n.lenbits=P.bits,E){e.msg="invalid literal/lengths set",n.mode=Es;break}if(n.distbits=6,n.distcode=n.distdyn,P={bits:n.distbits},E=is(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,P),n.distbits=P.bits,E){e.msg="invalid distances set",n.mode=Es;break}if(n.mode=ws,t===os)break e;case ws:n.mode=ks;case ks:if(s>=6&&l>=258){e.next_out=o,e.avail_out=l,e.next_in=r,e.avail_in=s,n.hold=u,n.bits=d,Jo(e,h),o=e.next_out,a=e.output,l=e.avail_out,r=e.next_in,i=e.input,s=e.avail_in,u=n.hold,d=n.bits,n.mode===gs&&(n.back=-1);break}for(n.back=0;g=(T=n.lencode[u&(1<<n.lenbits)-1])>>>16&255,y=65535&T,!((p=T>>>24)<=d);){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}if(g&&!(240&g)){for(b=p,w=g,k=y;g=(T=n.lencode[k+((u&(1<<b+w)-1)>>b)])>>>16&255,y=65535&T,!(b+(p=T>>>24)<=d);){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}u>>>=b,d-=b,n.back+=b}if(u>>>=p,d-=p,n.back+=p,n.length=y,0===g){n.mode=16205;break}if(32&g){n.back=-1,n.mode=gs;break}if(64&g){e.msg="invalid literal/length code",n.mode=Es;break}n.extra=15&g,n.mode=16201;case 16201:if(n.extra){for(_=n.extra;d<_;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}n.length+=u&(1<<n.extra)-1,u>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;g=(T=n.distcode[u&(1<<n.distbits)-1])>>>16&255,y=65535&T,!((p=T>>>24)<=d);){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}if(!(240&g)){for(b=p,w=g,k=y;g=(T=n.distcode[k+((u&(1<<b+w)-1)>>b)])>>>16&255,y=65535&T,!(b+(p=T>>>24)<=d);){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}u>>>=b,d-=b,n.back+=b}if(u>>>=p,d-=p,n.back+=p,64&g){e.msg="invalid distance code",n.mode=Es;break}n.offset=y,n.extra=15&g,n.mode=16203;case 16203:if(n.extra){for(_=n.extra;d<_;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}n.offset+=u&(1<<n.extra)-1,u>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Es;break}n.mode=16204;case 16204:if(0===l)break e;if(m=h-l,n.offset>m){if((m=n.offset-m)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Es;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>l&&(m=l),l-=m,n.length-=m;do{a[o++]=v[f++]}while(--m);0===n.length&&(n.mode=ks);break;case 16205:if(0===l)break e;a[o++]=n.length,l--,n.mode=ks;break;case Ss:if(n.wrap){for(;d<32;){if(0===s)break e;s--,u|=i[r++]<<d,d+=8}if(h-=l,e.total_out+=h,n.total+=h,4&n.wrap&&h&&(e.adler=n.check=n.flags?To(n.check,a,h,o-h):Po(n.check,a,h,o-h)),h=l,4&n.wrap&&(n.flags?u:Ps(u))!==n.check){e.msg="incorrect data check",n.mode=Es;break}u=0,d=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;d<32;){if(0===s)break e;s--,u+=i[r++]<<d,d+=8}if(4&n.wrap&&u!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=Es;break}u=0,d=0}n.mode=16208;case 16208:E=ls;break e;case Es:E=cs;break e;case 16210:return hs;default:return ds}return e.next_out=o,e.avail_out=l,e.next_in=r,e.avail_in=s,n.hold=u,n.bits=d,(n.wsize||h!==e.avail_out&&n.mode<Es&&(n.mode<Ss||t!==as))&&Fs(e,e.output,e.next_out,h-e.avail_out),c-=e.avail_in,h-=e.avail_out,e.total_in+=c,e.total_out+=h,n.total+=h,4&n.wrap&&h&&(e.adler=n.check=n.flags?To(n.check,a,h,e.next_out-h):Po(n.check,a,h,e.next_out-h)),e.data_type=n.bits+(n.last?64:0)+(n.mode===gs?128:0)+(n.mode===ws||n.mode===bs?256:0),(0===c&&0===h||t===as)&&E===ss&&(E=ms),E},$s={inflateReset:xs,inflateReset2:Cs,inflateResetKeep:Ds,inflateInit:e=>Is(e,15),inflateInit2:Is,inflate:Os,inflateEnd:e=>{if(As(e))return ds;var t=e.state;return t.window&&(t.window=null),e.state=null,ss},inflateGetHeader:(e,t)=>{if(As(e))return ds;var n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,ss):ds},inflateSetDictionary:(e,t)=>{var n,i=t.length;return As(e)||0!==(n=e.state).wrap&&n.mode!==ps?ds:n.mode===ps&&Po(1,t,i,0)!==n.check?cs:Fs(e,t,i,i)?(n.mode=16210,hs):(n.havedict=1,ss)},inflateInfo:"pako inflate (from Nodeca project)"};var Ns=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},Ws=Object.prototype.toString,js=Ao,Bs=Do,zs=Io,Us=Lo,Hs=Ro,Gs=Fo,Vs=Oo,Ks=$o;function Xs(e){this.options=Bo({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 Yo,this.strm.avail_out=0;var n=$s.inflateInit2(this.strm,t.windowBits);if(n!==zs)throw new Error(Mo[n]);if(this.header=new Ns,$s.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Vo(t.dictionary):"[object ArrayBuffer]"===Ws.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=$s.inflateSetDictionary(this.strm,t.dictionary))!==zs))throw new Error(Mo[n])}Xs.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?Bs:js,"[object ArrayBuffer]"===Ws.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=$s.inflate(r,i))===Hs&&s&&((n=$s.inflateSetDictionary(r,s))===zs?n=$s.inflate(r,i):n===Vs&&(n=Hs));r.avail_in>0&&n===Us&&r.state.wrap>0&&0!==e[r.next_in];)$s.inflateReset(r),n=$s.inflate(r,i);switch(n){case Gs:case Vs:case Hs:case Ks:return this.onEnd(n),this.ended=!0,!1}if(a=r.avail_out,r.next_out&&(0===r.avail_out||n===Us))if("string"===this.options.to){var l=Xo(r.output,r.next_out),u=r.next_out-l,d=Ko(r.output,l);r.next_out=u,r.avail_out=o-u,u&&r.output.set(r.output.subarray(l,l+u),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(n!==zs||0!==a){if(n===Us)return n=$s.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},Xs.prototype.onData=function(e){this.chunks.push(e)},Xs.prototype.onEnd=function(e){e===zs&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=zo(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Ys={ungzip:function(e,t){var n=new Xs(t);if(n.push(e),n.err)throw n.msg||Mo[n.err];return n.result}}.ungzip,qs=e=>{var t;if(null!=e&&e.includes(ln))t=an;else{var n=null==e?void 0:e.find(e=>e.includes(on));t=n?n.split("=")[1]:tn}return(t=t.replace(/\/$/,""))+"/"+Zt},Js=e=>{var t,n,i=io.getAppConfig(at)||io.getAppConfig(yt);return null!==(t=null==i||null===(n=i.capabilities)||void 0===n?void 0:n.includes(e))&&void 0!==t&&t},Qs=()=>io.getCampaignCacheTtl(),Zs=()=>{var e=Qs();if(null!==e)if(0!==e){var t=io.getApiCampaignSessionTimestamp();if(null!==t)(Date.now()-t)/1e3>=e&&io.purgeApiCampaignCache()}else io.purgeApiCampaignCache()},el=e=>{var t=!Js(Pe.THIRD_PARTY_TRANSACTIONS);return e&&!t&&Si.info(`[${e}] Your plan does not have purchase management features.`),t},tl=()=>{var e,t,n=null===(e=io.getNamiConfig())||void 0===e?void 0:e.namiCommands;return null!==(t=null==n?void 0:n.includes(pn))&&void 0!==t&&t},nl=()=>{var e,t,n=null===(e=io.getNamiConfig())||void 0===e?void 0:e.namiCommands;return null!==(t=null==n?void 0:n.includes(yn))&&void 0!==t&&t};function il(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=Ys(t),i=(new TextDecoder).decode(n);return JSON.parse(i)}catch(e){return}}var al=null;function rl(){return null!==al&&(n=null===(e=io.getNamiConfig())||void 0===e?void 0:e.namiCommands,null!==(t=null==n?void 0:n.includes(wn))&&void 0!==t&&t);var e,t,n}function ol(e){if(e)return e.length>4096?e.slice(0,4096):e}function sl(e){try{return new URL(e).pathname}catch(t){return e}}function ll(e){var t=null==e?void 0:e.body;return"string"==typeof t?ol(t):void 0}function ul(e){try{var t;null===(t=al)||void 0===t||t(e)}catch(e){}}function dl(e,t,n,i){var r,o,s,l,u,d,c,h;return k(function(m){for(;;)switch(m.p=m.n){case 0:if(rl()){m.n=1;break}return m.a(2,i());case 1:return o=null!==(r=null==t?void 0:t.method)&&void 0!==r?r:"GET",s=Date.now(),m.p=2,m.n=3,a(i());case 3:l=m.v,m.n=5;break;case 4:throw m.p=4,c=m.v,ul({method:o,url:e,path:sl(e),statusCode:0,durationMs:Date.now()-s,timestamp:new Date,requestBody:ll(t),errorDescription:cl(c),kind:n}),c;case 5:return u=Date.now()-s,m.p=6,h=ol,m.n=7,a(l.clone().text());case 7:d=h(m.v),m.n=9;break;case 8:m.p=8,m.v;case 9:return ul({method:o,url:e,path:sl(e),statusCode:l.status,durationMs:u,timestamp:new Date,requestBody:ll(t),responseBody:d,kind:n}),m.a(2,l)}},null,null,[[6,8],[2,4]],Promise)}function cl(e){return e instanceof Error?e.name?`${e.name}: ${e.message}`:e.message:String(e)}function hl(e,t,n=Rn,i=xn){var r,o,s,l,u,d,c;return k(function(h){for(;;)switch(h.n){case 0:return o=0,s=tl(),l=nl(),u=null!==(r=null==t?void 0:t.method)&&void 0!==r?r:"GET",d=()=>{var r,c,h,m;return k(function(f){for(;;)switch(f.n){case 0:return(s||l)&&Si.debug(`[HTTP] ${u} ${e}`),l&&null!=t&&t.body&&Si.debug(`[HTTP] Request body: ${t.body}`),f.n=1,a(dl(e,t,"api",()=>ml(e,t,n)));case 1:if((r=f.v).ok){f.n=7;break}if(!l){f.n=3;break}return f.n=2,a(r.clone().text());case 2:c=f.v,Si.debug(`[HTTP] Response ${r.status}: ${c}`);case 3:if(r.status!=Xn){f.n=4;break}throw new oo;case 4:if(!(++o<=i)){f.n=6;break}return h=1e3*(o+In),f.n=5,a(new Promise(e=>setTimeout(e,h)));case 5:return f.a(2,d());case 6:throw new ao(r.status,`Request failed after ${i} retries`);case 7:if(!l){f.n=9;break}return f.n=8,a(r.clone().text());case 8:m=f.v,Si.debug(`[HTTP] Response ${r.status}: ${m}`);case 9:return f.a(2,r)}},null,null,null,Promise)},h.n=1,a(d());case 1:return c=h.v,h.a(2,c.json())}},null,null,null,Promise)}function ml(e,t={},n){var i,r,o;return k(function(s){for(;;)switch(s.n){case 0:return i=new AbortController,r=setTimeout(()=>i.abort(),n),t.signal=i.signal,s.n=1,a(fetch(e,t));case 1:return o=s.v,clearTimeout(r),s.a(2,o)}},null,null,null,Promise)}var fl="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof global?global:{},vl="function"==typeof fl.BigInt,pl=vl?fl.BigInt.bind(fl):void 0,gl=vl?pl("0xffffffffffffffffffffffffffffffff"):null,yl=vl?pl("0x100000000000000000000000000000000"):null,bl=vl?pl(0):null,wl=vl?pl(1):null,kl=vl?pl(8):null,Sl=vl?pl(1e4):null,El=fl.crypto,Pl="function"==typeof(null==El?void 0:El.getRandomValues),_l=1/16,Tl=e=>we().device.getDeviceData(e),Ml=()=>{var e=io.getNamiConfig();return e&&e.formFactor?e.formFactor:we().device.getDeviceFormFactor()};function Al(){return we().device.generateUUID()}function Dl(e){if(!vl||!gl)return Il(e);try{var t=gl,n=function(e){if(!pl)throw new Error("BigInt is not supported in this environment");var t=e.replace(/-/g,"");return pl("0x"+t)}(e);return Number(n)/Number(t)*100}catch(t){throw Si.error(`Error calculating audience split position for UUID ${e}`,t),new Error(`Invalid UUID format: ${e}`)}}function xl(e){if(!pl)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 Cl(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(!(vl&&gl&&pl&&Sl))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=Al(),r=Number.POSITIVE_INFINITY,o=50,s=0;s<o;s++){var l=Al(),u=Il(l);if(u>=n&&u<=i)return l;var d=Ll(u,n,i);d<r&&(r=d,a=l)}return a}(n,i);var s=gl,l=pl,u=Sl,d=e=>s*l(e)/u,c=d(r),m=d(o);if(m<=c)return xl(c);var f=c+function(e){if(!pl||null===yl||null===wl||null===bl||null===kl)throw new Error("BigInt is not supported in this environment");var t=pl,n=bl,i=wl,a=kl,r=yl;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,l=r/s*s-i,u=0,d=!1;u<10;){if(Pl)El.getRandomValues(o);else{d||(d=!0,Si.warn("randomBigInt: crypto.getRandomValues unavailable, using Math.random fallback"));for(var c=0;c<o.length;c++)o[c]=Math.floor(256*Math.random())}for(var m,f=n,v=h(o);!(m=v()).done;)f=f<<a|t(m.value);if(f<=l)return f%s;u++}if(Pl)try{El.getRandomValues(o);for(var p,g=n,y=h(o);!(p=y()).done;)g=g<<a|t(p.value);var b=g%s;return Si.warn("randomBigInt: reached max rejection attempts, using modulo fallback",{n:e.toString(),attempts:u}),b}catch(e){throw Si.error("randomBigInt: failed to generate random values",e),new Error("randomBigInt: unable to generate random value")}for(var w,k=n,S=h(o);!(w=S()).done;)k=k<<a|t(w.value);return Si.warn("randomBigInt: reached max rejection attempts without crypto, using modulo fallback",{n:e.toString(),attempts:u}),k%s}(m-c);return xl(f)}function Il(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],16))*_l}return n}(e);return 100*t}function Ll(e,t,n){return e<t?t-e:e>n?e-n:0}function Rl(e,t,n){var i=n.value;return n.value=function(...e){if(!this.platformID)throw new lo;return i.apply(this,e)},n}function Fl(e,t,n){var i=n.value;return n.value=function(...e){var t=io.getDevice();if(null==t||!t.id)throw new uo;return i.apply(this,e)},n}var Ol,$l=function(){function e(){o(this,e);var t=io.getNamiConfig();!this.platformID&&t&&this.configure(t)}return c(e,[{key:"deviceID",get:function(){var e;return null===(e=io.getDevice())||void 0===e?void 0:e.id}},{key:"configure",value:function(e){this.baseURL=qs(e.namiCommands),this.platformID=e.appPlatformID}},{key:"reset",value:function(){this.baseURL=void 0,this.platformID=void 0}},{key:"login",value:function(e){var t,n;return k(function(i){for(;;)switch(i.n){case 0:if(e){i.n=1;break}throw new co;case 1:return t=`device/${this.deviceID}/login/`,n={external_id:e},i.n=2,a(this.requestBodyAPI(t,n,"PUT"));case 2:return i.a(2,i.v)}},null,this,null,Promise)}},{key:"logout",value:function(){var e;return k(function(t){for(;;)switch(t.n){case 0:return e=`device/${this.deviceID}/logout/`,t.n=1,a(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 k(function(i){for(;;)switch(i.n){case 0:return t=`device/${this.deviceID}/session/`,i.n=1,a(this.requestBodyAPI(t,{start_time:e,app_env:"production"}));case 1:n=i.v,io.setSessionCounter(),n.id&&io.setSessionId(n.id);case 2:return i.a(2)}},null,this,null,Promise)}},{key:"postImpression",value:function(t){var n,i,r,o,s,l;return k(function(u){for(;;)switch(u.n){case 0:return o=`device/${this.deviceID}/impression/`,s=null!==(n=t.id)&&void 0!==n?n:Al(),l=m({},t,{id:s,impression_date:null!==(i=t.impression_date)&&void 0!==i?i:(new Date).toISOString()}),io.setLastImpressionId(s),null===(r=e.impressionListener)||void 0===r||r.call(e,s),u.n=1,a(this.requestBodyAPI(o,l,"POST",!0));case 1:return u.a(2)}},null,this,null,Promise)}},{key:"patchImpressionCompletion",value:function(e,t,n){var i;return k(function(r){for(;;)switch(r.n){case 0:return i=`device/${this.deviceID}/impression/${e}/`,r.n=1,a(this.requestBodyAPI(i,{completion_result:t,completion_result_date:n},"PATCH",!0));case 1:return r.a(2)}},null,this,null,Promise)}},{key:"postConversion",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:return t=`device/${this.deviceID}/transaction/`,n.n=1,a(this.requestBodyAPI(t,e,"POST",!0));case 1:return n.a(2)}},null,this,null,Promise)}},{key:"purchaseValidation",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:return t=`device/${this.deviceID}/purchase_event/`,n.n=1,a(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 k(function(r){for(;;)switch(r.n){case 0:return i=`${this.baseURL}/${this.platformID}/`+e,r.n=1,a(hl(i,void 0,t,n));case 1:return r.a(2,r.v)}},null,this,null,Promise)}},{key:"requestBodyAPI",value:function(e,t,n="POST",i=!1,r,o){var s,l;return k(function(u){for(;;)switch(u.n){case 0:return s=`${this.baseURL}/${this.platformID}/`+e,l={method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:i},u.n=1,a(hl(s,l,r,o));case 1:return u.a(2,u.v)}},null,this,null,Promise)}}],[{key:"configure",value:function(e){this.instance.configure(e)}},{key:"reset",value:function(){this.instance.reset()}}])}();function Nl(e){return null!=(null==e?void 0:e.flow)}$l.instance=new $l,ke([Fl],$l.prototype,"login",null),ke([Fl],$l.prototype,"logout",null),ke([Fl],$l.prototype,"startSession",null),ke([Fl],$l.prototype,"postImpression",null),ke([Fl],$l.prototype,"patchImpressionCompletion",null),ke([Fl],$l.prototype,"postConversion",null),ke([Fl],$l.prototype,"purchaseValidation",null),ke([Rl],$l.prototype,"fetchAPI",null),ke([Rl],$l.prototype,"requestBodyAPI",null),e.NamiCampaignRuleType=void 0,(Ol=e.NamiCampaignRuleType||(e.NamiCampaignRuleType={})).DEFAULT="default",Ol.LABEL="label",Ol.UNKNOWN="unknown",Ol.URL="url";var Wl=()=>{var e;return null!==(e=io.getPaywalls(St))&&void 0!==e?e:[]},jl=()=>{var e;return null!==(e=io.getPaywalls(lt))&&void 0!==e?e:[]},Bl=()=>Kr(Ei([...jl(),...Wl()]),"id"),zl=e=>Bl().find(t=>t.id===e),Ul=e=>{var t=Bl(),n=new Set(t.map(e=>e.id));return e.every(e=>n.has(e))};new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z"));var Hl,Gl=e=>{try{return!isNaN(new Date(e).getTime())}catch(e){return!1}},Vl=(e,t,n=new Date)=>{var i=n.getTime(),a=!e||!Gl(e)||new Date(e).getTime()<i,r=!t||!Gl(t)||new Date(t).getTime()>i;return a&&r},Kl=e=>{try{var t=new URL(e);return("http:"===t.protocol||"https:"===t.protocol)&&!!t.hostname}catch(e){return!1}},Xl=e=>{try{var t=new URL(e),n=t.origin+t.pathname,i=new Set;return t.searchParams.forEach((e,t)=>{i.add(`${t}=${e}`)}),{basePath:n,params:i}}catch(e){return}},Yl=(e,t,n)=>{if(!e)return[];var i=e.filter(e=>!Array.isArray(e.segments)).length;return i>0&&Si.warn(`Skipping ${i} of ${e.length} campaign rules with no segments array`),e.flatMap(e=>{if(!Array.isArray(e.segments))return[];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=h(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,paywall_url:a.paywall_url,page_urls:a.page_urls,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}})},ql=()=>{var e,t,n=null!==(e=io.getCampaignRules(ot))&&void 0!==e?e:[],i=null!==(t=io.getCampaignRules(wt))&&void 0!==t?t:[],a=Ml(),r=Ei([...n,...i]).filter(e=>{var t;return null===(t=e.form_factors)||void 0===t?void 0:t.some(e=>e.form_factor===a)}).filter(e=>Vl(e.not_before,e.expires_at)),o=new Set;return r.filter(e=>{var t,n,i=`${null!==(t=e.type)&&void 0!==t?t:""}::${null!==(n=e.value)&&void 0!==n?n:""}`;return!o.has(i)&&(o.add(i),!0)})},Jl=e=>{var t,n=null!==(t=io.getCampaignRules(e))&&void 0!==t?t:[],i=Ml();return Ei(n).filter(e=>{var t;return null===(t=e.form_factors)||void 0===t?void 0:t.some(e=>e.form_factor===i)}).filter(e=>Vl(e.not_before,e.expires_at))},Ql=()=>Jl(wt),Zl=()=>Jl(ot),eu=(t,n,i,a)=>{var r=(()=>{if(!a)return t().find(t=>t.type==e.NamiCampaignRuleType.DEFAULT);if(a===e.NamiCampaignRuleType.URL){var n=t().filter(t=>t.type==e.NamiCampaignRuleType.URL);return((e,t)=>{var n,i,a,r=Xl(e);if(r){for(var o,s,l,u=h(t);!(l=u()).done;){var d=l.value,c=d.value;if(c){var m=Xl(c);if(m&&m.basePath===r.basePath){var f=m.params.size;if(0!==f){for(var v,p=0,g=h(m.params);!(v=g()).done;){var y=v.value;r.params.has(y)&&p++}p===f?(!o||f>o.totalParams)&&(o={campaign:d,totalParams:f}):o||(!s||p>s.score||p===s.score&&f>s.totalParams)&&(s={campaign:d,score:p,totalParams:f})}else o||s||(s={campaign:d,score:0,totalParams:0})}}}return null!==(n=null===(i=o)||void 0===i?void 0:i.campaign)&&void 0!==n?n:null===(a=s)||void 0===a?void 0:a.campaign}})(i,n)}return t().find(e=>e.type==a&&e.value==i)})();if(!r)return{};var o=n().find(e=>(null==r?void 0:r.paywall)===e.id);return{campaign:r,paywall:o}},tu=(e,t)=>{var n=eu(Zl,jl,e,t);if(n.campaign&&n.paywall)return{campaign:n.campaign,paywall:n.paywall};var i=eu(Ql,Wl,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}},nu="object"==typeof Reflect?Reflect:null,iu=nu&&"function"==typeof nu.apply?nu.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};Hl=nu&&"function"==typeof nu.ownKeys?nu.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var au=Number.isNaN||function(e){return e!=e};function ru(){ru.init.call(this)}ru.EventEmitter=ru,ru.prototype._events=void 0,ru.prototype._eventsCount=0,ru.prototype._maxListeners=void 0;var ou=10;function su(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function lu(e){return void 0===e._maxListeners?ru.defaultMaxListeners:e._maxListeners}function uu(e,t,n,i){var a,r,o,s;if(su(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=lu(e))>0&&o.length>a&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return e}function du(){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 cu(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=du.bind(i);return a.listener=n,i.wrapFn=a,a}function hu(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):fu(a,a.length)}function mu(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 fu(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e[i];return n}Object.defineProperty(ru,"defaultMaxListeners",{enumerable:!0,get:function(){return ou},set:function(e){if("number"!=typeof e||e<0||au(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");ou=e}}),ru.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},ru.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||au(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},ru.prototype.getMaxListeners=function(){return lu(this)},ru.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)iu(s,this,t);else for(var l=s.length,u=fu(s,l),d=0;d<l;++d)iu(u[d],this,t);return!0},ru.prototype.addListener=function(e,t){return uu(this,e,t,!1)},ru.prototype.on=ru.prototype.addListener,ru.prototype.prependListener=function(e,t){return uu(this,e,t,!0)},ru.prototype.once=function(e,t){return su(t),this.on(e,cu(this,e,t)),this},ru.prototype.prependOnceListener=function(e,t){return su(t),this.prependListener(e,cu(this,e,t)),this},ru.prototype.removeListener=function(e,t){var n,i,a,r,o;if(su(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},ru.prototype.off=ru.prototype.removeListener,ru.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},ru.prototype.listeners=function(e){return hu(this,e,!0)},ru.prototype.rawListeners=function(e){return hu(this,e,!1)},ru.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):mu.call(e,t)},ru.prototype.listenerCount=mu,ru.prototype.eventNames=function(){return this._eventsCount>0?Hl(this._events):[]};var vu=function(){function e(){o(this,e),this.emitter=new ru}return c(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}}])}(),pu=function(){return c(function e(){o(this,e),this.disableCampaignUpdates=!1,this.useLegacyPaywallFetch=!1,this.currentFormFactor=Ml()},[{key:"configure",value:function(e,t,n=[]){this.currentFormFactor=e,this.splitPosition=t,this.disableCampaignUpdates=n.includes("disableCampaignUpdates"),this.useLegacyPaywallFetch=n.includes("useLegacyPaywallFetch")}},{key:"reset",value:function(){this.currentFormFactor=Ml(),this.splitPosition=void 0,this.disableCampaignUpdates=!1,this.useLegacyPaywallFetch=!1}},{key:"fetchCampaignRules",value:function(e){var t,n,i,r;return k(function(o){for(;;)switch(o.n){case 0:if(i=io.getDevice(),!this.disableCampaignUpdates){o.n=1;break}return Si.info("Campaign updates disabled by configuration. Skipping fetch."),o.a(2,[]);case 1:if(null!=i&&i.id){o.n=3;break}return o.n=2,a(this.getAnonymousCampaigns());case 2:r=o.v,o.n=5;break;case 3:return o.n=4,a(this.getCampaigns(i.id));case 4:r=o.v;case 5:return r=null===(t=r)||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.form_factors)||void 0===t?void 0:t.some(e=>e.form_factor===this.currentFormFactor))}),r=null===(n=r)||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}),io.setCampaignRules(ot,r),io.setApiCampaignSessionTimestamp(),this.invokeAvailableCampaignsResponseHandler(),o.a(2,r)}},null,this,null,Promise)}},{key:"fetchCampaignRulesRaw",value:function(){var e,t,n,i,r;return k(function(o){for(;;)switch(o.n){case 0:if(!this.disableCampaignUpdates){o.n=1;break}return Si.info("Campaign updates disabled by configuration. Skipping fetch."),o.a(2,{campaigns:[],fromNetwork:!1});case 1:if(null==(t=io.getDevice())||!t.id){o.n=3;break}return o.n=2,a(this.fetchCampaigns(t.id));case 2:r=o.v,o.n=5;break;case 3:return o.n=4,a(this.fetchAnonymousCampaigns());case 4:r=o.v;case 5:return i=null===(e=(n=r).campaigns)||void 0===e?void 0:e.filter(e=>{var t;return e.paywall&&e.form_factors.some(e=>e.form_factor===this.currentFormFactor)||e.flow&&(null===(t=e.form_factors)||void 0===t?void 0:t.some(e=>e.form_factor===this.currentFormFactor))}),o.a(2,{campaigns:i,fromNetwork:n.fromNetwork})}},null,this,null,Promise)}},{key:"finalizeCampaignRules",value:function(e,t){var n=new Set([...t.map(e=>e.id),...Wl().map(e=>e.id)]),i=null==e?void 0:e.filter(e=>{return e.paywall?t.find(t=>t.id==e.paywall):!!e.flow&&(!!e.flow.object&&(null!==(i=e.flow.object.screens)&&void 0!==i?i:[]).every(e=>n.has(e)));var i});return io.setCampaignRules(ot,i),io.setApiCampaignSessionTimestamp(),this.invokeAvailableCampaignsResponseHandler(),i}},{key:"invokeAvailableCampaignsResponseHandler",value:function(){var e=vu.getInstance().listeners(ai),t=ql();e.forEach(e=>e(t))}},{key:"getAnonymousCampaigns",value:function(e=Ae){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.fetchAnonymousCampaigns(e));case 1:return t.a(2,t.v.campaigns)}},null,this,null,Promise)}},{key:"getCampaigns",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.fetchCampaigns(e));case 1:return t.a(2,t.v.campaigns)}},null,this,null,Promise)}},{key:"fetchAnonymousCampaigns",value:function(e=Ae){var t,n,i,r,o;return k(function(s){for(;;)switch(s.p=s.n){case 0:return t=`campaign_rules/?sdk_version=${e}`,s.p=1,s.n=2,a($l.instance.fetchAPI(t));case 2:return i=s.v,s.a(2,{campaigns:Yl(null!==(n=i.results)&&void 0!==n?n:[],this.splitPosition,this.currentFormFactor),fromNetwork:!0});case 3:if(s.p=3,o=s.v,r=this.fallbackData()){s.n=4;break}throw Si.error(So(o.status,t)),o;case 4:return s.a(2,{campaigns:r.results,fromNetwork:!1})}},null,this,[[1,3]],Promise)}},{key:"fetchCampaigns",value:function(e){var t,n,i,r;return k(function(o){for(;;)switch(o.p=o.n){case 0:return t=`device/${e}/campaign_rules/`,o.p=1,o.n=2,a($l.instance.fetchAPI(t));case 2:return n=o.v,o.a(2,{campaigns:(null==n?void 0:n.results)||[],fromNetwork:!0});case 3:if(o.p=3,r=o.v,i=this.fallbackData()){o.n=4;break}throw Si.error(So(r.status,t)),r;case 4:return o.a(2,{campaigns:i.results||[],fromNetwork:!1})}},null,this,[[1,3]],Promise)}},{key:"fallbackData",value:function(){var e=io.getCampaignRules(ot)||io.getCampaignRules(wt);return e?{count:e.length,results:e}:null}}],[{key:"extractPaywallUrls",value:function(e){for(var t,n=[],i=h(e);!(t=i()).done;){var a,r=t.value;r.paywall_url&&n.push(r.paywall_url),r.page_urls&&n.push(...Object.values(r.page_urls)),null!==(a=r.flow)&&void 0!==a&&a.page_urls&&n.push(...Object.values(r.flow.page_urls))}return n}},{key:"hasPaywallUrls",value:function(e){return e.some(e=>{var t;return e.paywall_url||e.page_urls||(null===(t=e.flow)||void 0===t?void 0:t.page_urls)})}}])}();function gu(e,t){return yr(e,t)}pu.instance=new pu;var yu=function(){return c(function e(){o(this,e)},[{key:"createOrUpdateDevice",value:function(e,t,n){var i=io.getDevice();if(null==i||!i.id){var a,r=m({},e,{id:null!==(a=null!=t?t:this.getAnonymousUUID())&&void 0!==a?a:Al()});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 k(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,r.n=1,a(this.requestAPIData("device/",e,void 0,void 0,0));case 1:if(!(n=r.v)){r.n=2;break}io.setDevice(n),r.n=3;break;case 2:return Si.info("Device creation returned null, switching to anon mode for this session"),null==t||t.setInMemoryAnonymousMode(!0),r.a(2,null);case 3:return r.a(2,n);case 4:if(r.p=4,i=r.v,console.error("Error creating device:",i),!(i instanceof ao)){r.n=5;break}return Si.info("Retry limit exceeded, switching to anon mode for this session"),null==t||t.setInMemoryAnonymousMode(!0),r.a(2,null);case 5:throw i;case 6:return r.a(2)}},null,this,[[0,4]],Promise)}},{key:"updateDevice",value:function(e,t){var n;return k(function(i){for(;;)switch(i.n){case 0:return i.n=1,a(this.requestAPIData(`device/${e}/`,t,"PUT"));case 1:return(n=i.v)&&io.setDevice(n),i.a(2,n)}},null,this,null,Promise)}},{key:"updateDeviceField",value:function(e,t){var n,i,r;return k(function(o){for(;;)switch(o.n){case 0:if(n={[e]:t},null!=(i=io.getDevice())&&i.id){o.n=1;break}throw new uo;case 1:return o.n=2,a(this.requestAPIData(`device/${i.id}/`,n,"PATCH"));case 2:return(r=o.v)&&io.setDevice(r),o.a(2,r)}},null,this,null,Promise)}},{key:"requestAPIData",value:function(e,t,n="POST",i=On,r){var o,s;return k(function(l){for(;;)switch(l.p=l.n){case 0:return l.p=0,l.n=1,a($l.instance.requestBodyAPI(e,t,n,!1,i,r));case 1:o=l.v,l.n=5;break;case 2:if(l.p=2,!((s=l.v)instanceof lo)){l.n=3;break}throw s;case 3:if(!("device/"===e&&s instanceof ao)){l.n=4;break}throw s;case 4:if(o=io.getDevice()){l.n=5;break}return Si.error(So(s.status,e)),l.a(2,null);case 5:return l.a(2,o)}},null,null,[[0,2]],Promise)}},{key:"isEqualDevices",value:function(e,t){var n=m({},e,t),i=Object.keys(e).reduce((e,t)=>(e[t]=n[t],e),{});return gu(i,e)}},{key:"getOrCreateAnonymousUUID",value:function(){var e=io.getAnonymousUUID();return e||(e=Al(),io.setAnonymousUUID(e)),e}},{key:"getAnonymousUUID",value:function(){var e=io.getAnonymousUUID();return e?(io.clearAnonymousUUID(),e):null}}])}();yu.instance=new yu;var bu=function(){return c(function e(){o(this,e)},[{key:"fetchProducts",value:function(){var e,t,n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:if(!Js(Pe.THIRD_PARTY_TRANSACTIONS)){r.n=1;break}return r.a(2,[]);case 1:return r.p=1,r.n=2,a($l.instance.fetchAPI("products/"));case 2:n=r.v,r.n=4;break;case 3:if(r.p=3,i=r.v,n=this.fallbackData()){r.n=4;break}throw Si.error(So(i.status,"products/")),i;case 4:return null!==(e=n)&&void 0!==e&&e.results&&io.setProducts(ht,n.results),r.a(2,(null===(t=n)||void 0===t?void 0:t.results)||[])}},null,this,[[1,3]],Promise)}},{key:"fallbackData",value:function(){var e=io.getProducts(ht)||io.getProducts(Pt);return e?{count:e.length,results:e}:null}}])}();bu.instance=new bu;var wu=3,ku=200,Su=2e3,Eu=5e3,Pu=2e4,_u=new Set([408,425,429]),Tu=new Set(["ECONNRESET","ECONNREFUSED","ENOTFOUND","ETIMEDOUT"]),Mu=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t,[`CDN fetch failed with non-retryable status ${e} for ${n}`])).name="NonRetryableHttpError",i.status=e,i.url=n,i}return p(t,e),c(t)}(M(Error)),Au=function(e){function t(e,n,i){var a;return o(this,t),(a=r(this,t,[`CDN fetch exhausted ${n} attempts for ${e}${void 0!==i?` (last status ${i})`:""}`])).name="RetryExhaustedError",a.url=e,a.attempts=n,a.lastStatus=i,a}return p(t,e),c(t)}(M(Error));function Du(e,t){if("number"==typeof t)return _u.has(t)||t>=500;if(e&&"object"==typeof e){var n=e;if("AbortError"===n.name)return!0;if(n.code&&Tu.has(n.code))return!0;if(e instanceof TypeError)return!0}return!1}function xu(e,t){var n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:return n=new AbortController,i=setTimeout(()=>n.abort(),t),r.p=1,r.n=2,a(dl(e,{method:"GET"},"cdn",()=>fetch(e,{signal:n.signal})));case 2:return r.a(2,r.v);case 3:return r.p=3,clearTimeout(i),r.f(3);case 4:return r.a(2)}},null,null,[[1,,3,4]],Promise)}var Cu=e=>new Promise(t=>setTimeout(t,e));function Iu(e,t={}){var n,i,r;return k(function(o){for(;;)switch(o.n){case 0:return o.n=1,a(Lu(e,t));case 1:return n=o.v,i=n.data,r=n.retryCount,o.a(2,{data:JSON.parse(i),retryCount:r})}},null,null,null,Promise)}function Lu(e,t={}){var n,i,r,o,s,l,u,d,c,h,m,f,v,p,g,y,b,w,S,E,P,_,T,M,A,D,x,C,I,L,R;return k(function(k){for(;;)switch(k.p=k.n){case 0:d=null!==(n=t.maxAttempts)&&void 0!==n?n:wu,c=null!==(i=t.baseDelayMs)&&void 0!==i?i:ku,h=null!==(r=t.maxDelayMs)&&void 0!==r?r:Su,m=null!==(o=t.budgetMs)&&void 0!==o?o:Pu,f=null!==(s=t.timeoutMs)&&void 0!==s?s:Eu,v=null!==(l=t.randomFn)&&void 0!==l?l:Math.random,p=null!==(u=t.sleepFn)&&void 0!==u?u:Cu,g=tl(),y=nl(),b=Date.now(),w=0;case 1:if(!(w<d)){k.n=16;break}if(!(w>0)){k.n=4;break}if(!((P=Date.now()-b)>=m)){k.n=2;break}return k.a(3,16);case 2:return _=Math.min(c*Math.pow(2,w-1),h),T=_*(v()-.5),M=Math.max(0,m-P),A=Math.min(Math.max(0,_+T),M),k.n=3,a(p(A));case 3:if(!(Date.now()-b>=m)){k.n=4;break}return k.a(3,16);case 4:return k.p=4,(g||y)&&Si.debug(`[HTTP] GET ${e} (cdn attempt ${w+1}/${d})`),k.n=5,a(xu(e,f));case 5:if((D=k.v).ok){k.n=9;break}if(!y){k.n=7;break}return k.n=6,a(D.clone().text());case 6:x=k.v,Si.debug(`[HTTP] Response ${D.status}: ${x}`);case 7:if(S=D.status,!Du(void 0,D.status)){k.n=8;break}return w++,k.a(3,1);case 8:throw new Mu(D.status,e);case 9:if(!y){k.n=11;break}return k.n=10,a(D.clone().text());case 10:C=k.v,Si.debug(`[HTTP] Response ${D.status}: ${C}`);case 11:return k.n=12,a(D.text());case 12:return I=k.v,L=w,k.a(2,{data:I,retryCount:L});case 13:if(k.p=13,!((R=k.v)instanceof Mu)){k.n=14;break}throw R;case 14:if(!Du(R)){k.n=15;break}return E=R,w++,k.a(3,1);case 15:throw R;case 16:if(void 0!==S||void 0===E){k.n=17;break}throw E;case 17:throw new Au(e,w,S);case 18:return k.a(2)}},null,null,[[4,13]],Promise)}function Ru(e){var t=e.split("#")[0].split("?")[1];if(t)for(var n,i=h(t.split("&"));!(n=i()).done;){var a=n.value,r=a.indexOf("=");if("content_hash"===(-1===r?a:a.slice(0,r)))return(-1===r?"":a.slice(r+1))||void 0}}function Fu(e){var t=e.split(/[?#]/)[0],n=/\/paywall\/([^/]+)/.exec(t);return n?n[1]:void 0}var Ou=function(){return c(function e(t=Zr){o(this,e),this.bodyCache=t},[{key:"fetchPaywalls",value:function(){var e,t,n;return k(function(i){for(;;)switch(i.n){case 0:if(null!=(e=io.getDevice())&&e.id){i.n=2;break}return i.n=1,a(this.getAnonymousPaywalls());case 1:t=i.v,i.n=4;break;case 2:return i.n=3,a(this.getPaywalls(e.id));case 3:t=i.v;case 4:if(!t){i.n=5;break}return(n=this.validatePaywalls(t)).length>0&&io.setPaywalls(lt,n),i.a(2,n);case 5:return i.a(2,t)}},null,this,null,Promise)}},{key:"getAnonymousPaywalls",value:function(e=Ae){var t,n,i,r;return k(function(o){for(;;)switch(o.p=o.n){case 0:return n=`paywalls/?sdk_version=${e}`,i=null,o.p=1,o.n=2,a($l.instance.fetchAPI(n));case 2:i=o.v,o.n=4;break;case 3:if(o.p=3,r=o.v,i=this.fallbackData()){o.n=4;break}throw Si.error(So(r.status,n)),r;case 4:return o.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,r;return k(function(o){for(;;)switch(o.p=o.n){case 0:return n=`device/${e}/paywalls/`,o.p=1,o.n=2,a($l.instance.fetchAPI(n));case 2:i=o.v,o.n=4;break;case 3:if(o.p=3,r=o.v,i=this.fallbackData()){o.n=4;break}throw Si.error(So(r.status,n)),r;case 4:return o.a(2,(null===(t=i)||void 0===t?void 0:t.results)||[])}},null,this,[[1,3]],Promise)}},{key:"resolvePaywallsByUrls",value:function(e){var t,n,i,r,o;return k(function(s){for(;;)switch(s.n){case 0:return t=[...new Set(e)],n=Qs(),this.bodyCache.evaluateTtl(n),s.n=1,a(Promise.all(t.map(e=>this.resolvePaywall(e,n))));case 1:return i=s.v,r={paywalls:[],urls:t.length,hashed:t.filter(e=>void 0!==Ru(e)).length,cacheHits:0,fetched:0,cacheAfterFetchFailure:0,failed:0,retryCount:0},o=new Map,i.forEach((e,n)=>{r.retryCount+=e.retryCount,e.paywall?(o.set(e.paywall,t[n]),"cacheHit"===e.paywall.fetchSource?r.cacheHits+=1:"cacheAfterFetchFailure"===e.paywall.fetchSource?r.cacheAfterFetchFailure+=1:r.fetched+=1):r.failed+=1}),r.paywalls=this.validatePaywalls([...o.keys()]),r.paywalls.length>0&&io.setApiPaywallsFromBodyCache(r.paywalls.map(e=>o.get(e))),s.a(2,r)}},null,this,null,Promise)}},{key:"seedFromInitialConfig",value:function(e,t){var n=new Map(t.map(e=>[e.id,e]));this.bodyCache.evaluateTtl(Qs());for(var i,a=0,r=0,o=h(new Set(function(e){for(var t,n=[],i=h(e);!(t=i()).done;)for(var a,r=h(null!==(o=t.value.segments)&&void 0!==o?o:[]);!(a=r()).done;){var o,s,l=a.value;l.paywall_url&&n.push(l.paywall_url),l.page_urls&&n.push(...Object.values(l.page_urls)),null!==(s=l.flow)&&void 0!==s&&s.page_urls&&n.push(...Object.values(l.flow.page_urls))}return n}(e)));!(i=o()).done;){var s=i.value,l=Ru(s),u=Fu(s),d=u?n.get(u):void 0;l&&d&&(a+=1,this.bodyCache.seedIfAbsent(s,l,JSON.stringify(d))&&(r+=1))}Si.info(`Paywall body cache seeded from initial config: seeded=${r}, candidates=${a}`)}},{key:"resolvePaywall",value:function(e,t){var n,i,r,o,s,l,u;return k(function(d){for(;;)switch(d.p=d.n){case 0:if(!(n=Ru(e))){d.n=1;break}if(!(i=this.decodeCached(e,t))){d.n=1;break}return d.a(2,{paywall:Nu(i,"cacheHit",n),retryCount:0});case 1:return r=0,d.p=2,d.n=3,a(this.fetchPaywallText(e));case 3:if(o=d.v,r=o.retryCount,!(s=$u(o.data))){d.n=4;break}return this.bodyCache.store(e,n,o.data),d.a(2,{paywall:Nu(s,"fetched",n),retryCount:r});case 4:Si.error(`Paywall body from ${e} is not a decodable paywall`),d.n=6;break;case 5:d.p=5,u=d.v,Si.error(`Failed to fetch individual paywall: ${u}`);case 6:if(!(l=this.decodeCached(e,t))){d.n=7;break}return Si.warn(`Serving the cached body for ${e} after fetch failure (within campaign_cache_ttl)`),d.a(2,{paywall:Nu(l,"cacheAfterFetchFailure",n),retryCount:r});case 7:return d.a(2,{retryCount:r})}},null,this,[[2,5]],Promise)}},{key:"decodeCached",value:function(e,t){var n=this.bodyCache.validEntry(e,t);if(n){var i=$u(n.body);return i||(Si.warn(`Deleting an undecodable cached paywall body for ${e}`),this.bodyCache.remove(e)),i}}},{key:"fetchPaywallText",value:function(e){var t;return null!==(t=io.getNamiConfig())&&void 0!==t&&null!==(t=t.namiCommands)&&void 0!==t&&t.includes(Tn)?(Si.warn(`${Tn}: failing the fetch for ${e} before the network`),Promise.reject(new Au(e,0))):Lu(e)}},{key:"validatePaywalls",value:function(e){return e.filter(e=>{var t,n=null===(t=e.template)||void 0===t?void 0:t.pages;return!(!Array.isArray(n)||0===n.length)||(Si.warn(`Dropping paywall "${e.id}" from cache: template.pages is missing or empty`),!1)})}},{key:"fallbackData",value:function(){var e=io.getPaywalls(lt)||io.getPaywalls(St);return e?{count:e.length,results:e}:null}}])}();function $u(e){try{var t=JSON.parse(e);return t&&"object"==typeof t&&!Array.isArray(t)?t:void 0}catch(e){return}}function Nu(e,t,n){return m({},e,{fetchSource:t},n?{contentHash:n}:{})}Ou.instance=new Ou;var Wu=function(){return c(function e(){o(this,e)},[{key:"fetchConfig",value:function(){var e,t,n,i,r;return k(function(o){for(;;)switch(o.n){case 0:if(null===(e=io.getNamiConfig())||void 0===e||null===(e=e.namiCommands)||void 0===e||!e.includes(Pn)){o.n=1;break}throw new ao(qn,Pn);case 1:return i=null===(t=io.getNamiConfig())||void 0===t?void 0:t.appPlatformID,o.n=2,a($l.instance.fetchAPI("config/",jn,0));case 2:return r=o.v,(null===(n=io.getNamiConfig())||void 0===n?void 0:n.appPlatformID)===i?io.setAppConfig(at,r):Si.debug("Discarding an app config response for a platform that is no longer configured"),o.a(2,r)}},null,null,null,Promise)}},{key:"fetchConfigForStartup",value:function(e){var t,n,i,r,o,s;return k(function(l){for(;;)switch(l.p=l.n){case 0:if(!e){l.n=1;break}return l.a(2,this.startupOnInitialConfig());case 1:t=Nn,i=1;case 2:if(!(i<=t)){l.n=7;break}return i>1&&Si.debug(`Retrying app config fetch (attempt ${i} of ${t})`),l.p=3,o=ju,l.n=4,a(this.fetchConfig());case 4:return l.a(2,o(l.v));case 5:l.p=5,s=l.v,n=s;case 6:i++,l.n=2;break;case 7:if(!(r=io.getAppConfig(at))){l.n=9;break}if(Bu(r)){l.n=8;break}return l.a(2,{usable:!1,reason:"the cached app config does not grant the 'sdk' capability"});case 8:return Si.info(`App config fetch failed after ${t} attempts - continuing on the cached config`),l.a(2,{usable:!0});case 9:return l.a(2,{usable:!1,reason:`app config fetch failed after ${t} attempts (${zu(n)}) and no initial or cached config is available`})}},null,this,[[3,5]],Promise)}},{key:"startupOnInitialConfig",value:function(){var e=io.getAppConfig(at);return this.fetchConfig().then(e=>{Bu(e)||Si.warn("App config does not grant the 'sdk' capability - it takes effect from the next launch")},e=>{Si.info(`App config fetch failed (${zu(e)}). Initial config is available. Skipping retry.`)}),e&&!Bu(e)?{usable:!1,reason:"the cached app config does not grant the 'sdk' capability"}:{usable:!0}}}])}();function ju(e){return Bu(e)?{usable:!0}:{usable:!1,reason:"app config does not grant the 'sdk' capability"}}function Bu(e){var t,n;return null!==(t=null===(n=e.capabilities)||void 0===n?void 0:n.includes(Pe.SDK))&&void 0!==t&&t}function zu(e){var t=null==e?void 0:e.status;return"number"==typeof t?`HTTP ${t}`:e instanceof Error?e.message:String(e)}Wu.instance=new Wu;var Uu=null;function Hu(){Uu&&Uu.setInMemoryAnonymousMode(!1)}function Gu(){return!!io.getAnonymousMode()||!!Uu&&Uu.isInMemoryAnonymousMode()}var Vu=function(){return c(function e(){o(this,e)},[{key:"startSession",value:function(){var e;return k(function(t){for(;;)switch(t.p=t.n){case 0:if(!Gu()){t.n=1;break}return Si.debug("Skipping session start call - anonymous mode"),t.a(2);case 1:return t.p=1,t.n=2,a($l.instance.startSession(new Date));case 2:t.n=4;break;case 3:t.p=3,e=t.v,Si.error("error on start session: ",e);case 4:return t.a(2)}},null,null,[[1,3]],Promise)}}])}();Vu.instance=new Vu;var Ku=function(){return c(function e(){o(this,e)},null,[{key:"allPurchases",value:function(){return[]}}])}();Ku.instance=new Ku;var Xu={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"}},Yu="en";function qu(e){var t,n,i=function(e){if(!e)return Yu;var t=e.trim();if(Xu[t])return t;var n=t.toLowerCase(),i=n.split("-")[0];return Xu[i]?i:"zh"===i?n.includes("tw")||n.includes("hk")?"zh-TW":"zh-CN":Yu}(io.getLanguageCode()),a=null!==(t=Xu[i])&&void 0!==t?t:Xu[Yu];return null!==(n=null==a?void 0:a[e])&&void 0!==n?n:e}function Ju(e){if("subscription"===(null==e?void 0:e.product_type)){var t=Zu(e);if(t.length>0)return t[0].billingPeriod}return null}function Qu(e){var t=function(e){if(!e)return[];var t=e.offers.filter(e=>"promo"===e.offer_type);return ed(t,e.subscription_period)}(e).find(e=>0===e.priceAmountMicros);return(null==t?void 0:t.billingPeriod)||null}function Zu(e){return e?ed(e.offers.filter(e=>"default"===e.offer_type),e.subscription_period):[]}function ed(e,t){return e.map(e=>td(e,t))}function td(e,t){var n,i,a,r,o,s,l,u;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,c=null!==(a=null===(r=e.promo_period)||void 0===r?void 0:r.type)&&void 0!==a?a:null==t?void 0:t.type,h=null!==(o=null===(s=e.promo_price)||void 0===s?void 0:s.price)&&void 0!==o?o:e.price,m=null!==(l=null===(u=e.promo_price)||void 0===u?void 0:u.currency)&&void 0!==l?l:e.currency;return{priceAmountMicros:1e6*h,priceCurrencyCode:m,billingPeriod:c?`P${d}${c[0].toUpperCase()}`:"",formattedPrice:ad(m).format(h)}}function nd(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],l=o[1],u=o[2],d=o[3],c=(e,t,n,i,r)=>{var o=(e=>a?`${e}_abbrev`:e)(r),s=(e=>a?`${e}_abbrev_plural`:`${e}_plural`)(r),l=qu(o),u=qu(s);return a||l!==o||(l=qu(`${r}_abbrev`)),a||u!==s||(u=qu(`${r}_abbrev_plural`)),i?e.toString():n?1===e||t?l:u:1===e||t?`${e} ${l}`:`${e} ${u}`};switch(e.at(-1)){case"D":return c(d,t,n,i,"nami_day");case"W":return c(u,t,n,i,"nami_week");case"M":return c(l,t,n,i,"nami_month");case"Y":return c(s,t,n,i,"nami_year")}return null}function id(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 ad(e){var t={maximumFractionDigits:2,minimumFractionDigits:0},n=we().device.getLanguage();try{return new Intl.NumberFormat(n,m({},t,{style:"currency",currency:e}))}catch(e){return new Intl.NumberFormat(n,m({},t,{style:"currency",currency:"USD"}))}}var rd=(e,t,n)=>e&&t&&n?n.format(e-t):null,od=(e,t,n,i)=>{if(e&&t&&n&&i){var a=100*(1-e/(n/i*t));return`${Math.round(a)}%`}return null},sd=(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)}},ld=e=>dd(e.priceAmountMicros)/ud(e.billingPeriod),ud=e=>{var t=parseInt(e[1]);return e.includes("Y")&&(t*=12),t},dd=e=>e/1e6;function cd(e){return parseFloat((Math.round(e)/100).toFixed(2))}var hd=(e,t,n=[])=>({price:()=>fd(e),name:()=>null==e?void 0:e.name,title:()=>null==e?void 0:e.name,description:()=>null==e?void 0:e.description,duration:()=>vd(e),durationSingular:()=>vd(e,!0),period:()=>vd(e,!1,!0),periodNumber:()=>vd(e,!1,!1,!0),freeTrialDuration:()=>pd(e),freeTrialDurationSingular:()=>pd(e,!0),freeTrialPeriod:()=>pd(e,!1,!0),freeTrialPeriodNumber:()=>pd(e,!1,!1,!0),pricePerMonth:()=>gd(e),pricePerMonthRounded:()=>gd(e,!0),periodInMonths:()=>yd(e),durationInMonths:()=>bd(e),durationInMonthsSingular:()=>bd(e,!0),periodNumberInMonths:()=>wd(e),percentagePriceDifferenceFromSku:()=>kd(e,t,n),priceDifferenceFromSku:()=>Sd(e,t,n),promoEligible:()=>null===Ed(e)&&null!==Pd(e,t),freeTrialEligible:()=>null!==Ed(e),promo:()=>{var n;return null===(n=Pd(e,t))||void 0===n?void 0:n.offer_ref_id},promoCode:()=>"XXXXX",promoPrice:()=>{var n;return null===(n=_d(e,t))||void 0===n?void 0:n.formattedPrice},promoPeriod:()=>Td(e,t,!1,!0),promoPeriodNumber:()=>Td(e,t,!1,!1,!0),promoDuration:()=>Td(e,t),promoDurationSingular:()=>Td(e,t,!0),introEligible:()=>!1,pricePerDay:()=>Md(e),pricePerWeek:()=>Ad(e),pricePerWeekRounded:()=>Ad(e,!0),introductoryPrice:()=>Dd(e,t),introductoryPeriod:()=>xd(e,t,!1,!0),introductoryPeriodNumber:()=>xd(e,t,!1,!1,!0),introductoryDuration:()=>xd(e,t),introductoryDurationSingular:()=>xd(e,t,!0),introductoryPricePerMonth:()=>Cd(e,t),introductoryPricePerMonthRounded:()=>Cd(e,t,!0),durationAbbrev:()=>vd(e,!1,!1,!1,!0),freeTrialDurationAbbrev:()=>pd(e,!1,!1,!1,!0),introductoryDurationAbbrev:()=>xd(e,t,!1,!1,!1,!0),promoDurationAbbrev:()=>Td(e,t,!1,!1,!1,!0),promoDurationPhase2Abbrev:()=>Td(e,t,!0,!0,!1,!0),durationInMonthsAbbrev:()=>bd(e,!1,!1,!1,!0),durationSingularAbbrev:()=>vd(e,!0,!1,!1,!0),freeTrialDurationSingularAbbrev:()=>pd(e,!0,!1,!1,!0),introductoryDurationSingularAbbrev:()=>xd(e,t,!0,!1,!1,!0),promoDurationSingularAbbrev:()=>Td(e,t,!0,!1,!1,!0),promoDurationSingularPhase2Abbrev:()=>Td(e,t,!0,!0,!1,!0),durationInMonthsSingularAbbrev:()=>bd(e,!0,!1,!1,!0),periodAbbrev:()=>vd(e,!1,!0,!1,!0),freeTrialPeriodAbbrev:()=>pd(e,!1,!0,!1,!0),introductoryPeriodAbbrev:()=>xd(e,t,!1,!0,!1,!0),promoPeriodAbbrev:()=>Td(e,t,!1,!0,!1,!0),promoPeriodPhase2Abbrev:()=>Td(e,t,!1,!0,!0,!0),periodInMonthsAbbrev:()=>bd(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,l=void 0!==a?parseInt(a,10):0;return(void 0!==r?parseInt(r,10):0)>0?null:l>0?1===l?qu("nami_weekly"):2===l?qu("nami_biweekly"):null:s>0?qu(1===s?"nami_monthly":2===s?"nami_bimonthly":3===s?"nami_quarterly":6===s?"nami_biannually":12===s?"nami_yearly":"nami_monthly"):o>0?qu("nami_yearly"):null}(Ju(e)),iso_subscription_duration:()=>Fd(e),bill_term:()=>Rd(e),invalid:()=>!1,unavailable:()=>!1}),md=(e,t,n,i=[])=>{if(!t)return null;var a=hd(t,n,i);return a[e]?a[e]():null},fd=e=>{var t=Zu(e);return t&&t.length?t[0].formattedPrice:null},vd=(e,t,n,i,a)=>nd(Ju(e),t,n,i,a),pd=(e,t,n,i,a)=>nd(Qu(e),t,n,i,a),gd=(e,t)=>{var n=Zu(e);if(!n||0===n.length)return null;var i=ld(n[0]);return i?ad(n[0].priceCurrencyCode).format(t?Math.round(i):i):null},yd=(e,t)=>{var n=Zu(e);if(!n||0===n.length)return null;var i=n[0].billingPeriod;return id(i)?nd("P1Y"===i?"P12M":i,!1,!1,!1,t):null},bd=(e,t,n,i,a)=>{var r=Zu(e);if(!r||0===r.length)return null;var o=r[0].billingPeriod;return id(o)?nd("P1Y"===o?"P12M":o,t,n,i,a):null},wd=e=>{if(!e)return 0;var t=Zu(e);return t&&t.length?ud(t[0].billingPeriod):0},kd=(e,t,n=[])=>{var i,a=Zu(e);if(!a||0===a.length)return null;var r=null===(i=sd(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return od(cd(a[0].priceAmountMicros),wd(e));var o=Zu(r);return od(cd(a[0].priceAmountMicros),wd(e),(null==o?void 0:o.length)>0?cd(o[0].priceAmountMicros):0,wd(r))},Sd=(e,t,n=[])=>{var i,a=Zu(e);if(!a||0===a.length)return null;var r=null===(i=sd(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return rd(ld(a[0]));var o=Zu(r);return rd(ld(a[0]),ld(o[0]),ad(o[0].priceCurrencyCode))},Ed=e=>Qu(e),Pd=(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},_d=(e,t)=>e?td(Pd(e,t),e.subscription_period):null,Td=(e,t,n,i,a,r)=>{var o=_d(e,t);return nd((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},Md=(e,t)=>{var n=Zu(e);if(!n||0===n.length)return null;var i,a,r=dd(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=ud(i))?30.437*a:1);return r?ad(n[0].priceCurrencyCode).format(r):null},Ad=(e,t)=>{var n=Zu(e);if(!n||0===n.length)return null;var i,a,r=dd(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=ud(i))?52*a/12:1);return r?ad(n[0].priceCurrencyCode).format(t?Math.round(r):r):null},Dd=(e,t)=>{var n=Id(e,t);return(null==n?void 0:n.formattedPrice)||null},xd=(e,t,n,i,a,r)=>{var o=Id(e,t);return nd((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},Cd=(e,t,n)=>{var i=Id(e,t);if(i){var a=dd(i.priceAmountMicros),r=ud(i.billingPeriod),o=n?Math.round(a/r):a/r;return ad(i.priceCurrencyCode).format(o)}},Id=(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],td(n,e.subscription_period)):null;var n},Ld={P1D:"daily",P1W:"weekly",P1M:"monthly",P3M:"quarterly",P6M:"semiannual",P1Y:"annual"},Rd=e=>{var t=Fd(e);return t&&Ld[t]||null},Fd=e=>{var t=Ju(e);return t?"P7D"===t?"P1W":t:null};function Od(e,t,n,i){var a=n.flatMap(e=>e.products).find(e=>e.id===t.selectedProducts[t.currentGroupId]);return Nd(Bd(e,null==a?void 0:a.sku_ref_id),a,i)}function $d(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=Bd(e,t.sku_ref_id||""),t.variables=Nd(t.product_details,t,r)}),r}function Nd(e,t,n){if(!t)return{};var i=function(e){if(!Array.isArray(e))return e;var t=e.filter(e=>e&&"object"==typeof e&&"entitlement_ref_id"in e).map(e=>e.entitlement_ref_id);return t.length?t:e}(t.entitlements),a=t.variables;if(!a)return m({},t,{entitlements:i});Object.keys(a).forEach(t=>{if("string"==typeof(r=a[t])&&r.includes(pi)){var i=Wd(a[t],e,n);a[t]=function(e){if(!e||e.includes("null")||e.includes("undefined"))return"";if(/\$\{\s*(launch\.customAttributes\.|sku\.)\w+\s*}/.test(e))return"";return e}(i)}var r});var r={};return Object.keys(hd({})).forEach(t=>{if(void 0===a[t]){var i=md(t,e,void 0,n);null!==i&&(r[t]=i)}}),m({},t,r,a,{entitlements:i})}var Wd=(e,t,n)=>e.replace(hi,(i,a)=>{var r,o,s,l,u=(null===(r=hi.exec(e))||void 0===r?void 0:r.slice(1))||[];a=null!==(o=u[0])&&void 0!==o?o:a;var d=null!==(s=null===(l=u[1])||void 0===l?void 0:l.replace(":",""))&&void 0!==s?s:"";return md(a,t,d,n)});function jd(e,t){return t.flatMap(e=>e.products).some(t=>1==md("freeTrialEligible",Bd(e,t.sku_ref_id)))}function Bd(e=[],t=""){return e.find(e=>e.product_ref_id===t)||null}var zd=function(){try{var e=Zi(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Ud=Object.prototype.hasOwnProperty;function Hd(e,t,n){var i=e[t];Ud.call(e,t)&&Pi(i,n)&&(void 0!==n||t in e)||function(e,t,n){"__proto__"==t&&zd?zd(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}(e,t,n)}var Gd="object"==typeof e&&e&&!e.nodeType&&e,Vd=Gd&&"object"==typeof module&&module&&!module.nodeType&&module,Kd=Vd&&Vd.exports===Gd?xi.Buffer:void 0;Kd&&Kd.allocUnsafe;var Xd=Va(Object.getPrototypeOf,Object),Yd=Object.prototype.hasOwnProperty;function qd(e){var t=new e.constructor(e.byteLength);return new ha(t).set(new ha(e)),t}var Jd=/\w*$/;var Qd=Ci?Ci.prototype:void 0,Zd=Qd?Qd.valueOf:void 0;function ec(e,t,n){var i,a,r,o=e.constructor;switch(t){case"[object ArrayBuffer]":return qd(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return r=qd((a=e).buffer),new a.constructor(r,a.byteOffset,a.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e){var t=qd(e.buffer);return new e.constructor(t,e.byteOffset,e.length)}(e);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,Jd.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Symbol]":return i=e,Zd?Object(Zd.call(i)):{}}}var tc=Object.create,nc=function(){function e(){}return function(t){if(!Wi(t))return{};if(tc)return tc(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var ic=Wa&&Wa.isMap,ac=ic?Fa(ic):function(e){return ka(e)&&"[object Map]"==hr(e)};var rc=Wa&&Wa.isSet,oc=rc?Fa(rc):function(e){return ka(e)&&"[object Set]"==hr(e)},sc="[object Arguments]",lc="[object Function]",uc="[object Object]",dc={};function cc(e,t,n,i,a,r){var o;if(void 0!==o)return o;if(!Wi(e))return e;var s=ga(e);if(s)o=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Yd.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e);else{var l=hr(e),u=l==lc||"[object GeneratorFunction]"==l;if(xa(e))return e.slice();if(l==uc||l==sc||u&&!a)o=u?{}:function(e){return"function"!=typeof e.constructor||Ga(e)?{}:nc(Xd(e))}(e);else{if(!dc[l])return a?e:{};o=ec(e,l)}}r||(r=new sa);var d=r.get(e);if(d)return d;r.set(e,o),oc(e)?e.forEach(function(i){o.add(cc(i,t,n,i,e,r))}):ac(e)&&e.forEach(function(i,a){o.set(a,cc(i,t,n,a,e,r))});var c=s?void 0:qa(e);return function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););}(c||e,function(i,a){c&&(i=e[a=i]),Hd(o,a,cc(i,t,n,a,e,r))}),o}dc[sc]=dc["[object Array]"]=dc["[object ArrayBuffer]"]=dc["[object DataView]"]=dc["[object Boolean]"]=dc["[object Date]"]=dc["[object Float32Array]"]=dc["[object Float64Array]"]=dc["[object Int8Array]"]=dc["[object Int16Array]"]=dc["[object Int32Array]"]=dc["[object Map]"]=dc["[object Number]"]=dc[uc]=dc["[object RegExp]"]=dc["[object Set]"]=dc["[object String]"]=dc["[object Symbol]"]=dc["[object Uint8Array]"]=dc["[object Uint8ClampedArray]"]=dc["[object Uint16Array]"]=dc["[object Uint32Array]"]=!0,dc["[object Error]"]=dc[lc]=dc["[object WeakMap]"]=!1;var hc=e=>"object"==typeof e&&null!==e&&"handleEvent"in e,mc=(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){}}},fc=function(){return c(function e(){o(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;mc(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()},l=()=>{e.cancelBubble=!0,null==o||o()};e.stopImmediatePropagation=s,e.stopPropagation=l;for(var u,d=h(i.slice());!(u=d()).done;){var c=u.value;if(a)break;mc(e,"currentTarget",this),"function"==typeof c.listener?c.listener.call(this,e):hc(c.listener)&&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=l}return mc(e,"currentTarget",null),!e.defaultPrevented}}])}(),vc=[];var pc={paywallId:"",livePaywalls:[],selectedPaywall:void 0,selectedCampaign:void 0,campaignRules:[],anySkuHasTrialOffer:!1,anySkuHasIntroOffer:!1,anySkuHasPromoOffer:!1,isLoggedIn:!1,darkMode:!1,safeAreaTop:0,safeAreaBottom:0,groups:[],selectedProducts:{},formStates:{},formFieldErrors:{},formFieldValidators:{},timerStates:{},currentPage:"page1",pageHistory:["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},gc=function(t){function n(e,t,i){var a;o(this,n),(a=r(this,n)).subscribers=new Set,a.productDetails=vc,a.filteredSkuMenus=[],a.state=cc(pc,5);var s=io.getNamiProfile();return a.state.isLoggedIn=!(null==s||!s.externalId),a.state.customer=m({},a.state.customer,io.getAllCustomerAttributesMap()),a.setPaywall(e,t,i),a.subscribers=new Set,a}return p(n,t),c(n,[{key:"onStateChanged",value:function(){}},{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(function(e,t){if("function"==typeof Event){var n=new Event(e);return Object.defineProperty(n,"detail",{configurable:!0,enumerable:!1,value:t,writable:!1}),n}return{type:e,detail:t,bubbles:!1,cancelBubble:!1,cancelable:!1,composed:!1,currentTarget:null,defaultPrevented:!1,eventPhase:0,isTrusted:!1,returnValue:!0,srcElement:null,target:null,timeStamp:Date.now(),NONE:0,CAPTURING_PHASE:1,AT_TARGET:2,BUBBLING_PHASE:3,composedPath:()=>[],initEvent:()=>{},preventDefault:()=>{},stopImmediatePropagation:()=>{},stopPropagation:()=>{}}}(e,t))}},{key:"onEvent",value:function(e,t){var n=e=>t(e.detail);return this.addEventListener(e,n),()=>this.removeEventListener(e,n)}},{key:"setState",value:function(e){this.state=e,this.subscribers.forEach(e=>e()),this.onStateChanged()}},{key:"setProductDetails",value:function(e){this.productDetails=e}},{key:"getProductDetails",value:function(){return this.productDetails}},{key:"setCurrentGroupData",value:function(e,t){var n=Od(this.productDetails,this.state,this.filteredSkuMenus,$d(this.productDetails,this.filteredSkuMenus,this.state.currentGroupId));this.setState(m({},this.state,{currentGroupId:e,currentGroupName:t,sku:n}))}},{key:"setFormState",value:function(e,t){this.setState(m({},this.state,{formStates:m({},this.state.formStates,{[e]:t})}))}},{key:"registerFormFieldValidator",value:function(e,t){this.setState(m({},this.state,{formFieldValidators:m({},this.state.formFieldValidators,{[e]:t})}))}},{key:"getFormFieldValidators",value:function(){return this.state.formFieldValidators}},{key:"setFormFieldErrors",value:function(e){this.setState(m({},this.state,{formFieldErrors:m({},e)}))}},{key:"setFormFieldError",value:function(e,t){this.setState(m({},this.state,{formFieldErrors:m({},this.state.formFieldErrors,{[e]:t})}))}},{key:"clearFormFieldError",value:function(e){var t=m({},this.state.formFieldErrors);delete t[e],this.setState(m({},this.state,{formFieldErrors:t}))}},{key:"getFormFieldErrors",value:function(){return this.state.formFieldErrors}},{key:"setTimerState",value:function(e,t,n,i){this.setState(m({},this.state,{timerStates:m({},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=m({},n,{[e]:t||!n[e]});this.setState(m({},this.state,{formStates:i}))}},{key:"getCurrentFormId",value:function(e){return this.state.formStates[e]}},{key:"setSelectedProducts",value:function(e){var t=m({},this.state,{selectedProducts:e}),n=Od(this.productDetails,t,this.filteredSkuMenus,$d(this.productDetails,this.filteredSkuMenus,t.currentGroupId));this.setState(m({},t,{sku:n}))}},{key:"selectedProducts",value:function(){return this.state.selectedProducts}},{key:"clearSelectedProduct",value:function(e){var t=this.state.selectedProducts||{};if(e&&null!=t[e]){var n=m({},t);delete n[e],this.setSelectedProducts(n)}}},{key:"setPaywall",value:function(e,t,n){var i,a,r,o,s,l=m({},this.state,{formFactor:Ml(),selectedPaywall:e,selectedCampaign:n});(l=m({},l,null===(i=e.template)||void 0===i?void 0:i.initialState)).platformId=null!==(a=null===(r=io.getNamiConfig())||void 0===r?void 0:r.appPlatformID)&&void 0!==a?a:"";var u,d,c=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:m({},e.customObject,t.customObject),currentGroup:null!==(a=t.currentGroup)&&void 0!==a?a:""}}(l.launch,t,e.sku_menus);(this.filteredSkuMenus=null!==(o=e.sku_menus)&&void 0!==o?o:[],c.productGroups.length&&(this.filteredSkuMenus=this.filteredSkuMenus.filter(e=>c.productGroups.includes(e.ref))),""!==c.currentGroup&&l.groups.length&&null!==(s=e.template)&&void 0!==s&&s.displaySingleGroup)&&(l.currentGroupId=null!==(u=null===(d=l.groups.find(e=>e.ref==c.currentGroup))||void 0===d?void 0:d.id)&&void 0!==u?u:"");if(""===l.currentGroupId&&1===this.filteredSkuMenus.length){var h,f=l.groups.find(e=>e.ref==this.filteredSkuMenus[0].ref);l.currentGroupId=null!==(h=null==f?void 0:f.id)&&void 0!==h?h:l.currentGroupId}var v=$d(this.productDetails,this.filteredSkuMenus,l.currentGroupId);l.skuItems=v,l.launch=c,l.anySkuHasTrialOffer=jd(this.productDetails,this.filteredSkuMenus),l.anySkuHasPromoOffer=function(e,t){return!jd(e,t)&&t.flatMap(e=>e.products).some(t=>1==md("promoEligible",Bd(e,t.sku_ref_id)))}(this.productDetails,this.filteredSkuMenus),l.paywallId=e.id,l.sku=Od(this.productDetails,l,this.filteredSkuMenus,v),l.pageHistory=[l.currentPage],this.setState(l)}},{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 t,n,i,a,r,o,s,l,u,d=this.state.selectedCampaign,c=this.state.selectedPaywall;return{paywallId:null!==(t=null==c?void 0:c.id)&&void 0!==t?t:"",paywallName:null!==(n=null==c?void 0:c.name)&&void 0!==n?n:"",campaignId:null!==(i=null==d?void 0:d.rule)&&void 0!==i?i:"",campaignName:null!==(a=null==d?void 0:d.name)&&void 0!==a?a:"",campaignType:null!==(r=null==d?void 0:d.type)&&void 0!==r?r:"",campaignLabel:null!==(o=null==d?void 0:d.value)&&void 0!==o?o:"",campaignUrl:(null==d?void 0:d.type)===e.NamiCampaignRuleType.URL&&null!==(s=null==d?void 0:d.value)&&void 0!==s?s:"",segmentId:null!==(l=null==d?void 0:d.segment)&&void 0!==l?l:"",externalSegmentId:null!==(u=null==d?void 0:d.external_segment)&&void 0!==u?u:""}}},{key:"paywallId",value:function(){return this.state.paywallId}},{key:"setCurrentPage",value:function(e){if(e&&e!==this.state.currentPage){var t=this.state.pageHistory&&this.state.pageHistory.length?this.state.pageHistory:[this.state.currentPage];this.setState(m({},this.state,{currentPage:e,pageHistory:[...t,e]}))}}},{key:"canGoBackPage",value:function(){var e,t;return(null!==(e=null===(t=this.state.pageHistory)||void 0===t?void 0:t.length)&&void 0!==e?e:0)>1}},{key:"goBackPage",value:function(){var e=this.state.pageHistory&&this.state.pageHistory.length?[...this.state.pageHistory]:[this.state.currentPage];if(e.length<=1)return!1;e.pop();var t=e[e.length-1];return!!t&&(this.setState(m({},this.state,{currentPage:t,pageHistory:e})),!0)}},{key:"setCustomerAttribute",value:function(e){this.setState(m({},this.state,{customer:m({},this.state.customer,e)}))}},{key:"removeCustomerAttribute",value:function(e){var t=m({},this.state.customer);delete t[e],this.setState(m({},this.state,{customer:t}))}},{key:"setIsLoggedIn",value:function(e){this.setState(m({},this.state,{isLoggedIn:e}))}},{key:"setMediaList",value:function(e){this.setState(m({},this.state,{mediaList:e.reduce((e,t)=>m({},e,{[t.name]:t}))}))}},{key:"setSafeAreaTop",value:function(e){this.setState(m({},this.state,{safeAreaTop:e}))}},{key:"setSafeAreaBottom",value:function(e){this.setState(m({},this.state,{safeAreaBottom:e}))}},{key:"setFullScreenPresentation",value:function(e){this.setState(m({},this.state,{fullScreenPresentation:e}))}},{key:"setFormFactor",value:function(e){this.setState(m({},this.state,{formFactor:e}))}},{key:"getFormFactor",value:function(){return this.state.formFactor}},{key:"setPurchaseInProgress",value:function(e){this.setState(m({},this.state,{purchaseInProgress:e}))}},{key:"setPurchase",value:function(e,t){this.setState(m({},this.state,{purchaseInProgress:e,productBeingPurchased:t}))}},{key:"setTimeSpentOnPaywall",value:function(e){this.setState(m({},this.state,{timeSpentOnPaywall:e}))}},{key:"setAppSuppliedVideoDetails",value:function({url:e,name:t}){this.setState(m({},this.state,{appSuppliedVideoUrl:e,appSuppliedVideoName:t}))}},{key:"resetAppSuppliedVideoDetails",value:function(){var e=m({},this.state);delete e.appSuppliedVideoUrl,delete e.appSuppliedVideoName,this.setState(e)}},{key:"setLaunchDetails",value:function(e,t){this.setState(m({},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(m({},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(m({},this.state,{userInteractionEnabled:e})),this.emitEvent("user-interaction-changed",{enabled:e})}},{key:"setUserTags",value:function(e){this.setState(m({},this.state,{customer:m({},this.state.customer,e)}))}},{key:"setCurrentSlideIndex",value:function(e){this.setState(m({},this.state,{currentSlideIndex:e}))}}],[{key:"create",value:function(e,t,i){var a=new n(e,t,i);return this.providers.push(a),a}},{key:"remove",value:function(e){this.providers=this.providers.filter(t=>t!==e)}},{key:"reset",value:function(){this.providers=[]}},{key:"currentProvider",get:function(){return n.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)}),vc=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}}])}(fc);gc.providers=[];var yc=c(function e(){o(this,e),this.refIdToPurchasedSKUs={},this.refIdToRelatedSKUs={},this.refIdToActivePurchases={}});yc.instance=new yc;var bc=()=>Kr(Ei([...io.getNamiEntitlements(pt),...io.getNamiEntitlements(Tt)]),"referenceId"),wc=()=>{vu.getInstance().emit(li,bc())};function kc(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 Sc=function(){return c(function e(){o(this,e)},[{key:"fetchActiveEntitlements",value:function(){var e,t,n;return k(function(i){for(;;)switch(i.n){case 0:if(e=null,Gu()||Js(Pe.THIRD_PARTY_TRANSACTIONS)||!Js(Pe.ENTITLEMENT_MANAGEMENT)){i.n=3;break}if(null==(t=io.getDevice())||!t.id){i.n=2;break}return i.n=1,a(this.getAPIEntitlements(t.id));case 1:n=i.v,(e=null==n?void 0:n.results)&&(io.setActiveEntitlements(ft,e),this.invokeActiveEntitlementsHandler(e));case 2:i.n=4;break;case 3:Gu()&&Si.debug("Skipping active entitlements update - anonymous mode");case 4:return i.a(2,e)}},null,this,null,Promise)}},{key:"getAPIEntitlements",value:function(e){var t,n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:return t=`device/${e}/active_entitlements/`,n={},r.p=1,r.n=2,a($l.instance.fetchAPI(t));case 2:n=r.v,r.n=4;break;case 3:throw r.p=3,i=r.v,Si.error(So(i.status,t)),i;case 4:return r.a(2,n)}},null,null,[[1,3]],Promise)}},{key:"invokeActiveEntitlementsHandler",value:function(e){el()&&(e=>{io.setNamiEntitlements(pt,e);var t=io.getNamiEntitlements(Tt),n=new Set(e.map(e=>e.referenceId)),i=t.filter(e=>{var t=n.has(e.referenceId);return t&&Si.debug(`Server granted verified entitlement for ${e.referenceId}, so replacing provisional entitlement grant.`),!t});i.length!==t.length&&io.setNamiEntitlements(Tt,i),wc()})(e.map(e=>(e=>{var t=e.entitlement_ref_id;return{name:e.name||"",desc:e.description||"",namiId:"",referenceId:t,relatedSkus:yc.instance.refIdToRelatedSKUs[t]||[],activePurchases:yc.instance.refIdToActivePurchases[t]||[],purchasedSkus:yc.instance.refIdToPurchasedSKUs[t]||[],expires:e.expires?new Date(e.expires).valueOf():0}})(e)))}}])}();Sc.instance=new Sc;var Ec=function(){return c(function e(){o(this,e)},[{key:"fetchCustomerJourneyState",value:function(){var e,t,n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:if(!Gu()){r.n=1;break}return Si.debug("Skipping customer journey state update - anonymous mode"),r.a(2,null);case 1:if(null!=(e=io.getDevice())&&e.id){r.n=2;break}return r.a(2,null);case 2:return t=`device/${e.id}/profile/`,n=null,r.p=3,r.n=4,a($l.instance.fetchAPI(t,void 0,0));case 4:n=r.v,r.n=6;break;case 5:throw r.p=5,i=r.v,Si.error(So(i.status,t)),i;case 6:if(!n){r.n=7;break}return io.setCustomerJourneyState(n.customer_journey_state),r.a(2,n.customer_journey_state);case 7:return r.a(2,null)}},null,null,[[3,5]],Promise)}}])}();Ec.instance=new Ec;var Pc="[NamiStartup]",_c=function(){return c(function e(){o(this,e),this.enabled=!1,this.t0=0,this.lastMark=0,this.decodeDuration=0,this.processDuration=0,this.placements=0,this.firstLaunchLogged=!1},[{key:"start",value:function(e){var t;this.enabled=null!==(t=null==e?void 0:e.includes(Sn))&&void 0!==t&&t,this.enabled&&(this.t0=Date.now(),this.lastMark=this.t0,this.decodeDuration=0,this.processDuration=0,this.placements=0,this.firstLaunchLogged=!1)}},{key:"mark",value:function(e,t){if(this.enabled){var n=Date.now(),i=n-this.lastMark;this.lastMark=n,"initial_config_decoded"===e?this.decodeDuration=i:"initial_processed"===e&&(this.processDuration=i,void 0!==(null==t?void 0:t.count)&&(this.placements=t.count));var a=t?" "+Object.entries(t).map(([e,t])=>`${e}=${t}`).join(" "):"";if("ready"===e){var r=n-this.t0;Si.info(`${Pc} phase=${e} ms=${i} total_to_ready=${r}${a}`),Si.info(`${Pc} SUMMARY total_to_ready=${r} decode=${this.decodeDuration} process=${this.processDuration} placements=${this.placements}`)}else Si.info(`${Pc} phase=${e} ms=${i}${a}`)}}},{key:"firstLaunchLookup",value:function(e,t){if(!this.enabled||this.firstLaunchLogged)return t();this.firstLaunchLogged=!0;var n=Date.now(),i=t(),a=Date.now()-n;return Si.info(`${Pc} phase=first_launch_lookup ms=${a} label=${e}`),i}},{key:"serverFetch",value:function(e){var t,n,i;return k(function(r){for(;;)switch(r.n){case 0:if(this.enabled){r.n=1;break}return r.a(2,e());case 1:return t=Date.now(),r.n=2,a(e());case 2:return n=r.v,i=Date.now()-t,Si.info(`${Pc} phase=server_fetch ms=${i} campaigns=${n.length}`),r.a(2,n)}},null,this,null,Promise)}}])}(),Tc=new _c,Mc=function(){return c(function e(){o(this,e),this.inMemoryAnonymousMode=!1,this.isFirstSession=!1,this.startupDisabled=!1,this.hasInitialConfig=!1,this.lastConfig=null,this.lastStartupRunAt=0,this.startupInFlight=!1,Uu=this},[{key:"setInMemoryAnonymousMode",value:function(e){this.inMemoryAnonymousMode=e,Si.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 io.getAnonymousMode()||this.inMemoryAnonymousMode}},{key:"getIsFirstSession",value:function(){return this.isFirstSession}},{key:"isStartupDisabled",value:function(){return this.startupDisabled}},{key:"init",value:function(e){var t;return k(function(n){for(;;)switch(n.p=n.n){case 0:return this.isFirstSession=null===io.getDevice()&&!io.getAnonymousMode(),this.startupDisabled=!1,this.hasInitialConfig=Object.keys(null!==(t=e.initialConfig)&&void 0!==t?t:{}).length>0,this.setInitialValues(e),this.lastConfig=e,this.lastStartupRunAt=Date.now(),this.startupInFlight=!0,n.p=1,n.n=2,a(this.fetchPlatformConfig());case 2:if(n.v){n.n=3;break}return n.a(2);case 3:return n.n=4,a(this.runStartupAfterConfig(e));case 4:return n.p=4,this.startupInFlight=!1,n.f(4);case 5:return n.a(2)}},null,this,[[1,,4,5]],Promise)}},{key:"resume",value:function(){var e,t,n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:if(this.lastConfig&&!this.startupInFlight){r.n=1;break}return r.a(2);case 1:if(!(Date.now()-this.lastStartupRunAt<zn)){r.n=2;break}return Si.debug("Resuming too quickly to call the service."),r.a(2);case 2:return e=this.lastConfig,t=this.startupDisabled,this.lastStartupRunAt=Date.now(),this.startupInFlight=!0,this.startupDisabled=!1,r.p=3,r.n=4,a(this.fetchPlatformConfig());case 4:if(n=!r.v){r.n=5;break}n=!t;case 5:if(!n){r.n=6;break}return r.a(2);case 6:return Si.info("Usable app config on resume - completing the startup that stopped at launch"),r.n=7,a(this.runStartupAfterConfig(e));case 7:r.n=9;break;case 8:r.p=8,i=r.v,Si.warn(`Resume refresh failed: ${i}`);case 9:return r.p=9,this.startupInFlight=!1,r.f(9);case 10:return r.a(2)}},null,this,[[3,8,9,10]],Promise)}},{key:"runStartupAfterConfig",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.initAndFetchRequiredData(e));case 1:Vu.instance.startSession();case 2:return t.a(2)}},null,this,null,Promise)}},{key:"clearResumeState",value:function(){this.lastConfig=null,this.lastStartupRunAt=0,this.startupDisabled=!1}},{key:"fetchPlatformConfig",value:function(){var e;return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(Wu.instance.fetchConfigForStartup(this.hasInitialConfig));case 1:if((e=t.v).usable){t.n=2;break}return this.startupDisabled=!0,Si.error(`Nami startup stopped: ${e.reason}`),t.a(2,!1);case 2:return t.a(2,!0)}},null,this,null,Promise)}},{key:"setInitialValues",value:function(e){var t=m({},e);delete t.initialConfig,io.clearSessionId(),io.setNamiConfig(t),io.setLanguageCode(e.namiLanguageCode),io.setPurchaseChannel(e.purchaseChannel);var n,i=e.initialConfig;if(i.appConfig||i.platform_config){var a=(null==i?void 0:i.appConfig)||(null==i?void 0:i.platform_config);a&&io.setAppConfig(yt,a)}null!=i&&i.paywalls&&(io.setPaywalls(St,i.paywalls.map(e=>m({},e,{fetchSource:"initialConfig"}))),null!==(n=i.campaign_rules)&&void 0!==n&&n.length&&Ou.instance.seedFromInitialConfig(i.campaign_rules,i.paywalls));null!=i&&i.products&&io.setProducts(Pt,i.products)}},{key:"initAnonymousDevice",value:function(){return{deviceId:yu.instance.getOrCreateAnonymousUUID(),deviceTask:null}}},{key:"initIdentifiedDevice",value:function(e){var t=m({},Tl(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)?Cl(i):void 0}}}(e.namiCommands),i=yu.instance.createOrUpdateDevice(t,n,this);return{deviceId:i.id,deviceTask:i.device}}},{key:"initAndFetchRequiredData",value:function(e,t=0,n=1){var i,r,o,s,l,u,d,c,h,m,f,v;return k(function(p){for(;;)switch(p.n){case 0:if(s=e.initialConfig,l=null!==(i=e.formFactor)&&void 0!==i?i:Ml(),u=this.isAnonymousMode(),d=u?this.initAnonymousDevice():this.initIdentifiedDevice(e),c=d.deviceId,h=d.deviceTask,m=Dl(c),s.campaign_rules&&(f=Yl(s.campaign_rules,m,l),io.setCampaignRules(wt,f),Tc.mark("initial_processed",{count:f.length})),!h){p.n=1;break}return p.n=1,a(h);case 1:if(pu.instance.configure(l,m,e.namiCommands),Zs(),v=Promise.all([bu.instance.fetchProducts(),Ec.instance.fetchCustomerJourneyState(),Sc.instance.fetchActiveEntitlements(),Tc.serverFetch(()=>this.fetchCampaignsAndPaywalls())]).catch(i=>{var r;return k(function(o){for(;;)switch(o.n){case 0:if(!(i instanceof oo)){o.n=3;break}if(io.resetDevice(),!(t<n)){o.n=2;break}return r=100*Math.pow(2,t),o.n=1,a(new Promise(e=>setTimeout(e,r)));case 1:return o.a(2,this.initAndFetchRequiredData(e,t+1,n));case 2:if(u){o.n=3;break}return Si.warn(`Max retries reached for ConflictError. ${i.message}`),this.setInMemoryAnonymousMode(!0),o.a(2,this.initAndFetchRequiredData(e,0,n));case 3:throw i;case 4:return o.a(2)}},null,this,null,Promise)}),null!==(r=s.campaign_rules)&&void 0!==r&&r.length&&null!==(o=s.paywalls)&&void 0!==o&&o.length){p.n=2;break}return p.n=2,a(v);case 2:v.then(()=>this.reRenderPaywall());case 3:return p.a(2)}},null,this,null,Promise)}},{key:"fetchCampaignsAndPaywalls",value:function(){var e,t,n,i,r,o,s,l,u,d,c,h,m,f,v,p;return k(function(g){for(;;)switch(g.n){case 0:return e=pu.instance,t=Ou.instance,n=Date.now(),i=Date.now(),g.n=1,a(e.fetchCampaignRulesRaw());case 1:return r=g.v,o=r.campaigns,s=r.fromNetwork,l=Date.now()-i,g.n=2,a(Promise.all(o.filter(e=>{var t;return(null===(t=e.flow)||void 0===t?void 0:t.url)&&!e.flow.object}).map(e=>{var t,n;return k(function(i){for(;;)switch(i.p=i.n){case 0:return i.p=0,i.n=1,a(Iu(e.flow.url));case 1:t=i.v,e.flow.object=t.data,i.n=3;break;case 2:i.p=2,n=i.v,Si.warn(`Error fetching flow object from ${e.flow.url}: ${n}`);case 3:return i.a(2)}},null,null,[[0,2]],Promise)})));case 2:if(u=!e.useLegacyPaywallFetch&&pu.hasPaywallUrls(o),c=null,h=Date.now(),!u||s){g.n=3;break}Si.info("Paywall resolution skipped: campaign_rules were served from the stored copy"),d=jl(),g.n=7;break;case 3:if(!u){g.n=5;break}return m=pu.extractPaywallUrls(o),g.n=4,a(t.resolvePaywallsByUrls(m));case 4:c=g.v,d=c.paywalls,Zr.reconcile(new Set(m)),g.n=7;break;case 5:return g.n=6,a(t.fetchPaywalls());case 6:d=g.v;case 7:return f=Date.now()-h,v=Date.now()-n,u&&!c||(p=c?`, urls=${c.urls}, hashed=${c.hashed}, cache_hits=${c.cacheHits}, fetched=${c.fetched}, cache_after_fetch_failure=${c.cacheAfterFetchFailure}, failed=${c.failed}`:"",Si.debug(`Paywall fetch telemetry: strategy=${u?"individual":"bulk"}, count=${d.length}${p}, total=${v}ms, campaigns=${l}ms, paywalls=${f}ms`+(c?`, retry_count=${c.retryCount}`:""))),g.a(2,e.finalizeCampaignRules(o,d))}},null,null,null,Promise)}},{key:"reRenderPaywall",value:function(){we().ui.reRenderPaywall()}}])}();function Ac(e){return Array.isArray(e)?e.map(Ac):e&&"object"==typeof e?Object.entries(e).reduce((e,[t,n])=>(void 0!==n&&(e[t]=Ac(n)),e),{}):e}function Dc(e,t){return gu(Ac(e),Ac(t))}Mc.instance=new Mc;var xc=function(){return c(function e(){o(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?io.setNamiProfile({externalId:this.externalId}):io.removeNamiProfile(),this}},{key:"load",value:function(){var e=io.getNamiProfile();e&&(this.externalId=e.externalId),gc.setIsLoggedIn(!!this.externalId)}},{key:"loginLocal",value:function(e){this.setExternalId(e).save(),gc.setIsLoggedIn(!0)}},{key:"loginRemote",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:return n.n=1,a($l.instance.login(e));case 1:(t=n.v).external_id&&t.external_id!==this.externalId&&this.setExternalId(t.external_id).save();case 2:return n.a(2)}},null,this,null,Promise)}},{key:"logoutLocal",value:function(){this.setExternalId(void 0).save(),gc.setIsLoggedIn(!1)}},{key:"logoutRemote",value:function(){return k(function(e){for(;;)switch(e.n){case 0:return e.n=1,a($l.instance.logout());case 1:return e.a(2)}},null,null,null,Promise)}},{key:"login",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return this.loginLocal(e),t.n=1,a(this.loginRemote(e));case 1:return t.a(2)}},null,this,null,Promise)}},{key:"logout",value:function(){return k(function(e){for(;;)switch(e.n){case 0:return this.logoutLocal(),e.n=1,a(this.logoutRemote());case 1:return e.a(2)}},null,this,null,Promise)}}])}();xc.instance=new xc;var Cc,Ic,Lc=function(){function e(){o(this,e)}return c(e,[{key:"previous",get:function(){return this._previous}},{key:"record",value:function(e){this._previous=this._current,this._current=e}},{key:"reset",value:function(){this._current=void 0,this._previous=void 0}}],[{key:"shared",get:function(){return this._shared||(this._shared=new e),this._shared}}])}(),Rc=function(){function e(){o(this,e),Cc.set(this,!1),Ic.set(this,null),this.maxLogging=!1}return c(e,[{key:"isInitialized",get:function(){return Se(this,Cc,"f")||null!=io.getNamiConfig()}},{key:"listenForAppForeground",value:function(){var e,t,n;Se(this,Ic,"f")||Ee(this,Ic,null!==(e=null===(t=(n=we().device).onAppForeground)||void 0===t?void 0:t.call(n,()=>{Mc.instance.resume()}))&&void 0!==e?e:null)}},{key:"initializeSDK",value:function(t){var n,i,r,o,s,l,u,d,c,h;return k(function(f){for(;;)switch(f.n){case 0:if(o=!1,s=!1,l=Se(this,Cc,"f")?io.getNamiConfig():null,Si.setLogger(t.logLevel),e.instance.maxLogging=null!==(n=t.maxLogging)&&void 0!==n&&n,null===l){f.n=3;break}if(delete(u=m({},t)).initialConfig,!Dc(u,l)){f.n=1;break}return Si.warn("Nami SDK is already configured, ignoring this configure call."),f.a(2,{sdkInitialized:!0,configureState:ni});case 1:s=!0;case 2:d=qs(t.namiCommands),c=qs(l.namiCommands),t.appPlatformID==l.appPlatformID&&d==c||(o=!0),t.namiLanguageCode===l.namiLanguageCode&&t.logLevel==l.logLevel||(s=!0);case 3:return o&&(Si.info("SDK full reconfigure called"),io.resetDevice()),Ee(this,Cc,!0),$l.configure(t),this.listenForAppForeground(),f.n=4,a(Mc.instance.init(t));case 4:return Si.info("SDK successfully initialized!"),h=s||o?ei:Qn,null===(i=(r=we().ui).postConfigure)||void 0===i||i.call(r),Tc.mark("ready"),f.a(2,{sdkInitialized:!0,configureState:h})}},null,this,null,Promise)}}],[{key:"sdkVersion",value:function(){return Ae}},{key:"sdkPackageVersion",value:function(){return xe}},{key:"reset",value:function(){var t,n,i,r,o;return k(function(s){for(;;)switch(s.n){case 0:return io.clearAll(),Zr.purgeAll(),Hu(),Ee(e.instance,Cc,!1),null===(t=Se(r=e.instance,Ic,"f"))||void 0===t||t.call(r),Ee(e.instance,Ic,null),Mc.instance.clearResumeState(),xc.instance.setExternalId(void 0),gc.reset(),$l.reset(),pu.instance.reset(),Lc.shared.reset(),s.n=1,a(Promise.resolve().then(function(){return Uh}));case 1:o=s.v,o.NamiFlowManager.reset(),null===(n=(i=we().ui).onReset)||void 0===n||n.call(i);case 2:return s.a(2)}},null,null,null,Promise)}},{key:"configure",value:function(t){return k(function(n){for(;;)switch(n.n){case 0:if(Tc.start(t.namiCommands),t.appPlatformID){n.n=1;break}throw new lo;case 1:return this.setInitialConfig(t),Tc.mark("initial_config_decoded"),n.n=2,a(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){Si.debug("[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 Si.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=il(e.initialConfig.initial_config);n?e.initialConfig=n:(e.initialConfig={},Si.error("Failed to parse NamiConfiguration.initialConfig as base64-gzipped JSON"))}}else e.initialConfig={}}}])}();Cc=new WeakMap,Ic=new WeakMap,Rc.instance=new Rc;var Fc,Oc,$c,Nc=new Set(["fullscreen","sheet","compact_sheet","modal"]);e.NamiPaywallManagerEvents=void 0,(Fc=e.NamiPaywallManagerEvents||(e.NamiPaywallManagerEvents={})).BuySku="RegisterBuySKU",Fc.Close="PaywallCloseRequested",Fc.SignIn="PaywallSignInRequested",Fc.Restore="PaywallRestoreRequested",Fc.DeeplinkAction="PaywallDeeplinkAction",e.NamiPaywallAction=void 0,(Oc=e.NamiPaywallAction||(e.NamiPaywallAction={})).BUY_SKU="BUY_SKU",Oc.SELECT_SKU="SELECT_SKU",Oc.RESTORE_PURCHASES="RESTORE_PURCHASES",Oc.SIGN_IN="SIGN_IN",Oc.CLOSE_PAYWALL="CLOSE_PAYWALL",Oc.SHOW_PAYWALL="SHOW_PAYWALL",Oc.PURCHASE_SELECTED_SKU="PURCHASE_SELECTED_SKU",Oc.PURCHASE_SUCCESS="PURCHASE_SUCCESS",Oc.PURCHASE_FAILED="PURCHASE_FAILED",Oc.PURCHASE_CANCELLED="PURCHASE_CANCELLED",Oc.PURCHASE_PENDING="PURCHASE_PENDING",Oc.PURCHASE_UNKNOWN="PURCHASE_UNKNOWN",Oc.PURCHASE_DEFERRED="PURCHASE_DEFERRED",Oc.DEEPLINK="DEEPLINK",Oc.TOGGLE_CHANGE="TOGGLE_CHANGE",Oc.PAGE_CHANGE="PAGE_CHANGE",Oc.SLIDE_CHANGE="SLIDE_CHANGE",Oc.COLLAPSIBLE_DRAWER_OPEN="COLLAPSIBLE_DRAWER_OPEN",Oc.COLLAPSIBLE_DRAWER_CLOSE="COLLAPSIBLE_DRAWER_CLOSE",Oc.VIDEO_STARTED="VIDEO_STARTED",Oc.VIDEO_PAUSED="VIDEO_PAUSED",Oc.VIDEO_RESUMED="VIDEO_RESUMED",Oc.VIDEO_ENDED="VIDEO_ENDED",Oc.VIDEO_CHANGED="VIDEO_CHANGED",Oc.VIDEO_MUTED="VIDEO_MUTED",Oc.VIDEO_UNMUTED="VIDEO_UNMUTED",Oc.COUNTDOWN_TIMER_COMPLETED="COUNTDOWN_TIMER_COMPLETED",Oc.UNKNOWN="UNKNOWN",e.LaunchCampaignError=void 0,($c=e.LaunchCampaignError||(e.LaunchCampaignError={})).DEFAULT_CAMPAIGN_NOT_FOUND="Default campaign not found",$c.LABELED_CAMPAIGN_NOT_FOUND="Labeled campaign not found",$c.CAMPAIGN_DATA_NOT_FOUND="Campaign data not found",$c.PAYWALL_ALREADY_DISPLAYED="Paywall is already being displayed",$c.SDK_NOT_INITIALIZED="SDK has not been initialized",$c.PAYWALL_COULD_NOT_DISPLAY="Failed to display paywall",$c.URL_CAMPAIGN_NOT_FOUND="URL campaign not found",$c.PRODUCT_DATA_NOT_FOUND="Product data not found",$c.PRODUCT_GROUPS_NOT_FOUND="Product groups not found",$c.FLOW_SCREEN_DATA_UNAVILABLE="Flow unavailable due to missing screen data";var Wc,jc="entry",Bc="screen",zc="branch",Uc="exit",Hc="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.SET_TAGS_FROM_FORM="setTagsFromForm",e.PAUSE="flowPause",e.RESUME="flowResume",e.SET_LAUNCH_CONTEXT="setLaunchContext",e.SET_FLOW_PATH="setFlowPath"}(Wc||(Wc={}));var Gc="__handoff_sequence__",Vc={Push:"push",Location:"location",Tracking:"att",Deeplink:"deeplink",Complete:"complete",SignIn:"signin",Restore:"restore",SignInMvpd:"signin_mvpd",BuySku:"buysku",UserData:"userdata"};var Kc={Push:"push",Location:"location",Tracking:"tracking",Camera:"camera",Microphone:"microphone",Photos:"photos",Contacts:"contacts",Bluetooth:"bluetooth",Calendar:"calendar",Biometrics:"biometrics",Health:"health",Motion:"motion",Speech:"speech",LocalNetwork:"localNetwork"},Xc={[Kc.Push]:"push_authorized",[Kc.Location]:"location_authorized",[Kc.Tracking]:"tracking_authorized"},Yc="__buy_sku__",qc="__default__",Jc="__appear__",Qc="__disappear__",Zc="__login_success__",eh="__login_failure__",th="__logout_success__",nh="__logout_failure__",ih="__purchase_success__",ah="__purchase_failure__",rh="__remoteback__",oh="__tag_update__",sh="__permission_granted__",lh="and",uh="or",dh="i_contains",ch="equals",hh="i_equals",mh="not_equals",fh="not_i_equals",vh="not_contains",ph="contains",gh="set",yh="not_set",bh="greater_than",wh="greater_than_or_equal_to",kh="less_than",Sh="less_than_or_equal_to";function Eh(e){if("boolean"==typeof e)return null;if("number"==typeof e)return Number.isFinite(e)?e:null;if("string"==typeof e){var t=e.trim();if(""===t)return null;var n=Number(t);return Number.isFinite(n)?n:null}return null}var Ph=function(){function e(){o(this,e),this.resolvers=new Map,this.namespaceResolvers=new Map}return c(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 lh:return i.every(e=>e);case uh: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 lh:for(var i,a=h(n);!(i=a()).done;){var r=i.value;if(!this.evaluateFilter(r))return!1}return!0;case uh:for(var o,s=h(n);!(o=s()).done;){var l=o.value;if(this.evaluateFilter(l))return!0}return!1;default:for(var u,d=h(n);!(u=d()).done;){var c=u.value;if(!this.evaluateFilter(c))return!1}return!0}}},{key:"evaluateFilter",value:function(e){var t=this.resolve(e.identifier);if(Rc.instance.maxLogging&&Si.debug(`[NamiConditionEvaluator] resolve(${e.identifier}) → ${JSON.stringify(t)} (type: ${typeof t})`),e.operator===gh)return null!=t;if(e.operator===yh)return null==t;if(null==t)return Rc.instance.maxLogging&&Si.debug(`[NamiConditionEvaluator] ${e.identifier} resolved to null — registeredNamespaces: [${[...this.namespaceResolvers.keys()].join(", ")}]`),!![mh,fh,vh].includes(e.operator);switch(e.operator){case dh:return Array.isArray(t)?e.values.some(e=>"string"==typeof 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 ch:return e.values.some(e=>this.strictEquals(t,e,!1));case hh:return e.values.some(e=>this.strictEquals(t,e,!0));case mh:return e.values.every(e=>!this.strictEquals(t,e,!1));case fh:return e.values.every(e=>!this.strictEquals(t,e,!0));case ph:return!(!Array.isArray(t)&&"string"!=typeof t)&&e.values.some(e=>"string"==typeof e&&t.includes(e));case vh:return Array.isArray(t)?e.values.every(e=>!("string"==typeof e&&t.includes(e))):e.values.every(e=>"string"!=typeof t||"string"!=typeof e||!t.includes(e));case bh:case wh:case kh:case Sh:var n=Eh(t);return null===n?(this.log(`Resolved value is not numerically comparable for ${e.operator}`),!1):e.values.some(t=>{var i=Eh(t);if(null===i)return!1;switch(e.operator){case bh:return n>i;case wh:return n>=i;case kh:return n<i;default:return n<=i}});default:return this.log(`Unsupported operator: ${e.operator}`),!1}}},{key:"strictEquals",value:function(e,t,n){return"string"==typeof e&&"string"==typeof t?n?0===e.localeCompare(t,void 0,{sensitivity:"accent"}):e===t:("boolean"==typeof e&&"boolean"==typeof t||"number"==typeof e&&"number"==typeof t)&&e===t}},{key:"resolve",value:function(e){var t=this.resolveRaw(e);if(void 0!==t)return Rc.instance.maxLogging&&Si.debug(`[NamiConditionEvaluator] resolve(${e}) — exact hit: ${JSON.stringify(t)}`),t;var n=e.lastIndexOf(".");if(-1===n);else{var i=e.slice(0,n),a=e.slice(n+1),r=this.resolveRaw(i);if(void 0!==r){var o=this.extractProperty(a,r);return Rc.instance.maxLogging&&Si.debug(`[NamiConditionEvaluator] resolve(${e}) — fallback: base=${i} → ${typeof r}, extract(.${a}) → ${JSON.stringify(o)}`),o}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=h(n);!(t=i()).done;){var a=t.value;if(e.startsWith(a)){var r=this.namespaceResolvers.get(a);if(r){var o=r(e);return Rc.instance.maxLogging&&Si.debug(`[NamiConditionEvaluator] resolveRaw(${e}) — ns=${a} → ${JSON.stringify(o)}`),o}}}}},{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){Si.debug(`[NamiConditionEvaluator] ${e}`)}}],[{key:"shared",get:function(){return e.instance||(e.instance=new e),e.instance}}])}(),_h=function(){return c(function e(){o(this,e)},[{key:"register",value:function(){Ph.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=h(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}}])}(),Th=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t)).namespace="LaunchContext",i.context=e,i.campaign=n,i.register(),i}return p(t,e),c(t,[{key:"resolveValue",value:function(e){var t,n,i,a;if("placement"===e)return null!==(t=null===(n=this.campaign)||void 0===n?void 0:n.value)&&void 0!==t?t:void 0;if("tags"===e)return null!==(i=null===(a=this.campaign)||void 0===a?void 0:a.placement_tags)&&void 0!==i?i:void 0;if(e.startsWith("customAttributes.")){var r=e.substring(17);return this.resolveKeyPath(r,this.context.customAttributes)}if(e.startsWith("customObject.")){var o=e.substring(13);return this.resolveKeyPath(o,this.context.customObject)}return this.resolveKeyPath(e,{customAttributes:this.context.customAttributes,customObject:this.context.customObject,productGroups:this.context.productGroups})}}])}(_h),Mh=function(e){function t(){var e,n,i,a;o(this,t),(a=r(this,t)).namespace="Device";var s=Intl.DateTimeFormat().resolvedOptions().locale.split("-")[1]||"",l=Intl.DateTimeFormat().resolvedOptions().timeZone,u=Tl(),d=we().device.getScreenInfo();return a.context={osName:u.os_name,osVersion:u.os_version,appVersion:u.extended_platform_version,sdkVersion:u.sdk_version,deviceModel:u.device_model,screenWidth:Math.round(d.width),screenHeight:Math.round(d.height),formFactor:u.form_factor,tvQuality:a.tvQuality(null!==(e=u.form_factor)&&void 0!==e?e:"desktop",d),tvResolution:a.tvResolution(null!==(n=u.form_factor)&&void 0!==n?n:"desktop",d),screenSize:a.screenSizeTier(null!==(i=u.form_factor)&&void 0!==i?i:"desktop",d),language:u.language,country:s,timezone:l},a.register(),a}return p(t,e),c(t,[{key:"screenSizeTier",value:function(e,t){var n=Math.round(t.width*t.scale),i=Math.round(t.height*t.scale),a=Math.max(n,i);switch(e){case"phone":return a<1136?"tiny":a<1334?"small":a<1920?"medium":a<2560?"large":"huge";case"tablet":return a<2048?"medium":a<2732?"large":"huge";case"television":return a<1920?"medium":a<3840?"large":"huge";case"desktop":return a<1440?"small":a<2560?"medium":a<3840?"large":"huge";default:return"medium"}}},{key:"tvQuality",value:function(e,t){if("television"!==e)return"";var n=Math.round(t.width*t.scale),i=Math.round(t.height*t.scale),a=Math.max(n,i),r=Math.min(n,i);return a>=3840||r>=2160?"4K":a>=1920||r>=1080?"1080p":"720p"}},{key:"tvResolution",value:function(e,t){if("television"!==e)return"";var n=Math.round(t.width*t.scale),i=Math.round(t.height*t.scale),a=Math.max(n,i),r=Math.min(n,i);return r<720&&a<1280?"SD":r>=720&&r<1080&&a>=1280&&a<1920?"720p":r>=1080&&r<1440&&a>=1920&&a<2560?"1080p":r>=1440&&r<2160&&a>=2560&&a<3840?"1440p":r>=2160&&r<3e3&&a>=3840&&a<5e3?"4K":r>=3e3&&a>=5e3?"8K":"Unknown"}},{key:"resolveValue",value:function(e){return this.resolveKeyPath(e,this.context)}}])}(_h),Ah=[/(^|_)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],Dh=function(){function e(){o(this,e),this.params={},"undefined"!=typeof window&&this.setSearchParams()}return c(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=>Ah.some(t=>t.test(e)))(a))){var r=this.safeValue(i);r&&(t[a]=r,n.add(a))}},o=h(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()}}])}();Dh._instance=null;var xh=()=>Dh.instance.params;function Ch(e){if(null!=e&&""!==e){if("boolean"==typeof e)return e?"true":"false";if("number"==typeof e){if(!Number.isFinite(e))return;return String(e)}return String(e)}}var Ih,Lh=/\{\{\s*([^}]+?)\s*\}\}/g,Rh=/\$\{[^}]+\}/g,Fh=function(){return c(function e(t){o(this,e),this.flowManager=t,this.urlParams=xh()},[{key:"currentScreenPaywall",value:function(){var e,t,n=null===(e=this.flowManager.currentFlow)||void 0===e||null===(e=e.currentFlowStep)||void 0===e?void 0:e.screen;if(n)return(null===(t=this.screenPaywallLookup)||void 0===t?void 0:t.screenId)!==n&&(this.screenPaywallLookup={screenId:n,paywall:zl(n)}),this.screenPaywallLookup.paywall}},{key:"resolve",value:function(e){var t,n,i,a,r,o,s,l,u,d,c,h,m,f,v,p,g,y,b,w,k=this.flowManager.currentFlow,S=null==k?void 0:k.component;if(e.startsWith("launchContext.")){var E=null==k?void 0:k.context;if(E){var P=e.substring(14),_=new Th(E,null==k?void 0:k.campaign).resolveValue(P);return Array.isArray(_)?_.join(","):null==_?void 0:_.toString()}}else{if(e.startsWith("form.")){var T,M=e.substring(5);return Ch(null===(T=gc.currentProvider)||void 0===T?void 0:T.state.formStates[M])}if(e.startsWith("sku.")){var A=null==k?void 0:k.purchasedSku;if(!A)return;var D=e.substring(4);switch(D){case"sku_ref_id":return A.skuRefId;case"name":return A.name;case"entitlement_ref_id":return null!==(t=null===(n=A.entitlements[0])||void 0===n?void 0:n.entitlement_ref_id)&&void 0!==t?t:"";case"entitlement_name":return null!==(i=null===(a=A.entitlements[0])||void 0===a?void 0:a.name)&&void 0!==i?i:"";default:var x=md(D,A.productDetails);return null!=x?String(x):void 0}}switch(e){case"campaignId":return null==S||null===(r=S.campaign)||void 0===r?void 0:r.rule;case"campaignName":return null==S||null===(o=S.campaign)||void 0===o?void 0:o.name;case"campaignLabel":case"campaignPlacement":return null!==(s=null==S||null===(l=S.campaign)||void 0===l?void 0:l.value)&&void 0!==s?s:void 0;case"campaignSegment":case"campaignSegmentId":return null==S||null===(u=S.campaign)||void 0===u?void 0:u.segment;case"campaignExternalSegment":case"campaignExternalSegmentId":return null!==(d=null==S||null===(c=S.campaign)||void 0===c?void 0:c.external_segment)&&void 0!==d?d:void 0;case"pageName":return null!==(h=null===(m=this.currentScreenPaywall())||void 0===m?void 0:m.name)&&void 0!==h?h:null==S||null===(f=S.paywall)||void 0===f?void 0:f.name;case"pageId":return null!==(v=null==k||null===(p=k.currentFlowStep)||void 0===p?void 0:p.screen)&&void 0!==v?v:null==S||null===(g=S.paywall)||void 0===g?void 0:g.id;case"flowName":return null==k?void 0:k.name;case"flowId":return null==k?void 0:k.id;case"objectId":return null==S||null===(y=S.campaign)||void 0===y||null===(y=y.flow)||void 0===y?void 0:y.object_id;case"stepName":return null==k||null===(b=k.currentFlowStep)||void 0===b?void 0:b.name;case"buttonText":var C=null==k?void 0:k.currentButton;if(!C)return;var I=C.firstTextValue;if("function"!=typeof I)return;return I.call(C);case"slideNumber":var L=null==S?void 0:S.getSelectedSlideIndexForCurrentCarousel();return null!=L?`${L+1}`:void 0;case"productGroupId":return(null===(w=gc.currentProvider)||void 0===w?void 0:w.state.currentGroupId)||void 0;case"productGroupName":var R,F,O,$=null===(R=gc.currentProvider)||void 0===R?void 0:R.state;return null!==(F=null==$||null===(O=$.groups)||void 0===O||null===(O=O.find(e=>e.id===$.currentGroupId))||void 0===O?void 0:O.displayName)&&void 0!==F?F:void 0;case"productGroupRef":var N,W,j,B=null===(N=gc.currentProvider)||void 0===N?void 0:N.state;return null!==(W=null==B||null===(j=B.groups)||void 0===j||null===(j=j.find(e=>e.id===B.currentGroupId))||void 0===j?void 0:j.ref)&&void 0!==W?W:void 0;case"flowPath":return null==k?void 0:k.flowPath;default:return}}}},{key:"interpolateLiquidVariables",value:function(e){return e.replace(Lh,(e,t)=>{var n,i=null!==(n=this.resolve(t))&&void 0!==n?n:this.urlParams[t];return null!=i?i:""}).replace(Rh,"")}},{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])=>m({},e,{[t]:this.interpolateDeep(n)}),{}):e}}])}(),Oh=function(e){function t(){var e;return o(this,t),(e=r(this,t)).namespace="urlParams",e.context=xh(),e.register(),e}return p(t,e),c(t,[{key:"resolveValue",value:function(e){return Si.debug("[URLParamsResolver]","Resolving keyPath",e),this.resolveKeyPath(e,this.context)}}])}(_h),$h=function(e){function t(){var e;return o(this,t),(e=r(this,t)).namespace="state",e.register(),e}return p(t,e),c(t,[{key:"getContextProvider",value:function(){var e=gc.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)}}}])}(_h),Nh=function(e){function t(e){var n;return o(this,t),(n=r(this,t)).namespace="Placement",n.campaign=e,n.register(),n}return p(t,e),c(t,[{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=gc.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()}}}}])}(_h),Wh=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).namespace="LastLaunchContext",e}return p(t,e),c(t,[{key:"register",value:function(){_(t,"register",this)([])}},{key:"resolveValue",value:function(e){var t=Lc.shared.previous;if(t){if("placement"===e)return t.placementLabel;if("tags"===e)return t.tags;if(e.startsWith("customAttributes.")){var n=e.substring(17);return this.resolveKeyPath(n,t.customAttributes)}}}}])}(_h);!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"}(Ih||(Ih={}));var jh=e=>{var t;return k(function(n){for(;;)switch(n.p=n.n){case 0:if(!Gu()){n.n=1;break}return Si.info("Skipping transaction post - anonymous mode"),n.a(2);case 1:return n.p=1,n.n=2,a($l.instance.postConversion(e));case 2:n.n=4;break;case 3:n.p=3,t=n.v,Si.error("Error posting conversion",t);case 4:return n.a(2)}},null,null,[[1,3]],Promise)},Bh=function(){return c(function e(){o(this,e),this.emitter=vu.getInstance()},[{key:"sdkInitialized",get:function(){return Rc.instance.isInitialized}}],[{key:"allPaywalls",value:function(){if(!this.instance.sdkInitialized)throw new so;return Bl()}},{key:"setProductDetails",value:function(e){this.instance.productDetails=e,gc.setProductDetails(e)}},{key:"registerSignInHandler",value:function(t){return this.instance.emitter.addListener(e.NamiPaywallManagerEvents.SignIn,t),()=>{this.instance.emitter.removeListener(e.NamiPaywallManagerEvents.SignIn,t)}}},{key:"registerCloseHandler",value:function(t){return this.instance.emitter.addListener(e.NamiPaywallManagerEvents.Close,t),()=>{this.instance.emitter.removeListener(e.NamiPaywallManagerEvents.Close,t)}}},{key:"registerDeeplinkActionHandler",value:function(t){return this.instance.emitter.addListener(e.NamiPaywallManagerEvents.DeeplinkAction,t),()=>{this.instance.emitter.removeListener(e.NamiPaywallManagerEvents.DeeplinkAction,t)}}},{key:"registerBuySkuHandler",value:function(t){return el()&&Si.debug("This handler will not be invoked because this account's plan includes built-in purchase management. Contact support@namiml.com for details."),this.instance.emitter.addListener(e.NamiPaywallManagerEvents.BuySku,t),()=>{this.instance.emitter.removeListener(e.NamiPaywallManagerEvents.BuySku,t)}}},{key:"registerRestoreHandler",value:function(t){return this.instance.emitter.addListener(e.NamiPaywallManagerEvents.Restore,t),()=>{this.instance.emitter.removeListener(e.NamiPaywallManagerEvents.Restore,t)}}},{key:"buySkuComplete",value:function(e){var t,n,i,r,o,s;return k(function(l){for(;;)switch(l.p=l.n){case 0:if(gc.setPurchaseInProgress(!1),zh.instance.flowOpen&&(t=zh.instance.currentFlow,n=null==t?void 0:t.currentFlowStep,t&&n&&t.executeLifecycle(n,ih)),!Gh.inAnonymousMode()){l.n=1;break}return Si.debug("Skipping purchase validation - anonymous mode"),l.a(2);case 1:if(i=io.getSessionId(),r=io.getPurchaseImpression()){l.n=2;break}return Si.debug("Not sending paywall conversion call complete due to unknown impression"),l.a(2);case 2:return l.p=2,l.n=3,a(jh({purchase_env:"production",app_env:"production",impression:r,session:i,amount:e.amount,currency:e.currency,transaction_id:e.transactionId,sku:e.skuId}));case 3:l.n=5;break;case 4:l.p=4,o=l.v,Si.error("Error posting conversion",o);case 5:if(Js(Pe.THIRD_PARTY_TRANSACTIONS)){l.n=9;break}return l.p=6,l.n=7,a($l.instance.purchaseValidation({app_env:"production",payload:"",sku:e.skuId}));case 7:l.n=9;break;case 8:l.p=8,s=l.v,Si.error("Error validating purchase",s);case 9:return l.a(2)}},null,null,[[6,8],[2,4]],Promise)}},{key:"buySkuCancel",value:function(){Js(Pe.THIRD_PARTY_TRANSACTIONS)?gc.setPurchase(!1):Si.warn("Call this method is not needed for this app because Nami is responsible for purchase management. Contact support@nami.ml for details.")}},{key:"setAppSuppliedVideoDetails",value:function(e,t){Kl(e)?(Si.debug(`NamiPaywallManager: setAppSuppliedVideoDetails received valid url ${e}`),gc.setAppSuppliedVideoDetails({url:e,name:t})):Si.debug(`NamiPaywallManager: setAppSuppliedVideoDetails received invalid url ${e}`)}},{key:"allowUserInteraction",value:function(e){Si.debug(`NamiPaywallManager: allowUserInteraction called with ${e}`),gc.setUserInteractionEnabled(e)}}])}();Bh.instance=new Bh,Bh.emitter=vu.getInstance();var zh=function(){function e(){o(this,e),this.flowOpen=!1,this.lastAnimatedFlowProgress=new Map,this.navGraphCache=new WeakMap}return c(e,[{key:"hasHandoffHandler",get:function(){return!!this.handoffStepHandler}},{key:"deliverHandoff",value:function(t,n){var i=this.handoffStepHandler;if(i){var a={tag:t,completed:!1};this.pendingHandoff=a;i(t,n,n=>{if(a.completed)Si.warn(`[NamiFlowManager] complete() called more than once for handoff '${t}' — ignored`);else{var i=e.instance.pendingHandoff;i&&i!==a?Si.warn(`[NamiFlowManager] stale complete() for handoff '${t}' — a newer handoff ('${i.tag}') is pending; ignored`):(a.completed=!0,this.pendingHandoff===a&&(this.pendingHandoff=void 0),e.routeHandoffOutcome(null!=n?n:{kind:"done"}),e.resume())}})}}},{key:"resume",value:function(){e.resume()}},{key:"presentFlow",value:function(t,n,i){var a=new Zh(t,n,this,i);return this.flowOpen=!0,this.currentFlow=a,$l.impressionListener=t=>{var n;null===(n=e.instance.currentFlow)||void 0===n||n.bindImpression(t)},a}},{key:"finishFlow",value:function(){Rc.instance.maxLogging&&Si.debug("[NamiFlowManager] finishFlow() — closing flow"),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===Bc);if(0===t.length)return 0;var n=this.currentFlow.stepcrumbs.filter(e=>e.type===Bc);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=h(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),l=t.findIndex(e=>e.id===n.id);if(-1===s||n.id===i.id)return(l+1)/(o+2);var u=this.countForwardScreens(n,t,a),d=r+u;return Si.debug(`Branching progress: visited=${r}, remaining=${u}, 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 l=(n.get(e)||[]).filter(e=>{var n=t.findIndex(t=>t.id===e);return n>i});if(0!==l.length)for(var u,d=h(l);!(u=d()).done;){var c=u.value;o(c,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[Jc];if(!i)return null;for(var a,r=h(i);!(a=r()).done;)for(var o,s,l=h(null!==(o=a.value.action)&&void 0!==o?o:[]);!(s=l()).done;){var u,d=s.value;if((d.function===Wc.NAVIGATE||d.function===Wc.NEXT)&&null!=(null===(u=d.parameters)||void 0===u?void 0:u.delay)){var c=d.parameters.delay,m=Number(c);if(!isNaN(m)&&m>0)return m/1e3}}return null}}],[{key:"instance",get:function(){return e._instance||(e._instance=new e),e._instance}},{key:"reset",value:function(){var t=e.instance;t.currentFlow=void 0,t.flowOpen=!1,t.lastAnimatedFlowProgress=new Map,t.navGraphCache=new WeakMap,t.pendingHandoff=void 0}},{key:"registerStepHandoff",value:function(e){this.instance.handoffStepHandler=e;var t=e;return()=>{this.instance.handoffStepHandler===t&&(this.instance.handoffStepHandler=void 0)}}},{key:"routeHandoffOutcome",value:function(t){var n=e.instance.currentFlow,i=null==n?void 0:n.currentFlowStep;switch(t.kind){case"done":return;case"permission":if(!n)return;if(n.handoffState.permissions[t.permission]=t.granted,!t.granted)return;i&&n.executeLifecycle(i,sh);var a=Xc[t.permission];return void(a?n.completionSignal(a):Si.debug(`[NamiFlowManager] permission '${t.permission}' granted — no completion_result mapping yet (state/lifecycle only)`));case"purchase":return void("success"===t.result?Bh.buySkuComplete(t.details):(gc.setPurchase(!1),n&&i&&n.executeLifecycle(i,ah)));case"login":if("success"===t.result){var r,o,s=t.details;if(n)n.handoffState.login=m({},null!==(o=s.attributes)&&void 0!==o?o:{});Gh.loggedInId()===s.loginId?n&&i&&n.executeLifecycle(i,Zc):Promise.resolve(Gh.login(s.loginId)).catch(e=>{Si.error("[NamiFlowManager] login from handoff outcome failed",e)});var l=null===(r=io.getDevice())||void 0===r?void 0:r.customer_data_platform_id;s.cdpId&&s.cdpId!==l&&Promise.resolve(Gh.setCustomerDataPlatformId(s.cdpId)).catch(e=>{Si.error("[NamiFlowManager] CDP id write-through from handoff outcome failed",e)})}else n&&i&&n.executeLifecycle(i,eh);return}}},{key:"registerEventHandler",value:function(e){this.instance.eventHandler=e;var t=e;return()=>{this.instance.eventHandler===t&&(this.instance.eventHandler=void 0)}}},{key:"resume",value:function(){var t,n,i,a=e.instance,r=a.flowOpen,o=a.currentFlow;Rc.instance.maxLogging&&Si.debug(`[NamiFlowManager] resume() — flowOpen=${r}, hasFlow=${!!o}, currentStep=${null!==(t=null==o||null===(n=o.currentFlowStep)||void 0===n?void 0:n.id)&&void 0!==t?t:"none"}, isPaused=${null!==(i=null==o?void 0:o.isPaused)&&void 0!==i?i:"N/A"}`);var s=e.instance.pendingHandoff;if(s&&!s.completed&&(s.completed=!0,e.instance.pendingHandoff=void 0,Si.warn(`[NamiFlowManager] resume() called during handoff '${s.tag}' with a v2 handler registered — treated as complete({kind:'done'}); prefer complete(outcome)`)),r&&o&&o.currentFlowStep){if(o.activeHandoffSequence)return Si.debug(`Resuming flow at handoff sequence ${o.currentFlowStep.id}`),void o.resumeNextHandoff();Si.debug(`Resuming flow at step ${o.currentFlowStep.id}`),o.executeLifecycle(o.currentFlowStep,"__resume__")}else Si.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?(Si.debug(`Finishing flow programmatically at step ${i.currentFlowStep.id}`),i.dismiss()):Si.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():Si.warn("This flow cannot be paused"):Si.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()}}])}(),Uh=Object.freeze({__proto__:null,NamiFlowManager:zh}),Hh=()=>{var e,t;return null!==(e=null===(t=io.getNamiConfig())||void 0===t||null===(t=t.namiCommands)||void 0===t?void 0:t.includes("disableAsyncLoginLogout"))&&void 0!==e&&e},Gh=function(){return c(function e(){o(this,e),this.emitter=vu.getInstance(),Ph.shared.registerNamespaceResolver("UserTags",t=>{var n,i=t.replace("UserTags.","");return null!==(n=e.getCustomerAttribute(i))&&void 0!==n?n:null})},[{key:"isSDKInitialized",get:function(){return Rc.instance.isInitialized}}],[{key:"isLoggedIn",value:function(){return xc.instance.isLoggedIn()}},{key:"loggedInId",value:function(){return this.instance.isSDKInitialized||Si.debug(Ne),xc.instance.getExternalId()}},{key:"login",value:function(e){var t,n,i,r,o,s,l,u,d;return k(function(c){for(;;)switch(c.p=c.n){case 0:if(this.instance.isSDKInitialized){c.n=1;break}throw t=new so,this.invokeStateHandler(Ih.LOGIN,!1,t),t;case 1:if(!this.inAnonymousMode()){c.n=2;break}throw n=new po,this.invokeStateHandler(Ih.LOGIN,!1,n),n;case 2:if(Hh()){c.n=3;break}return xc.instance.loginLocal(e),this.invokeStateHandler(Ih.LOGIN,!0),zh.instance.flowOpen&&(i=zh.instance.currentFlow,(r=null==i?void 0:i.currentFlowStep)&&(Rc.instance.maxLogging&&Si.debug(`[NamiCustomerManager] async login success — triggering __login_success__ on step ${r.id}`),i.executeLifecycle(r,Zc))),xc.instance.loginRemote(e).catch(e=>{Si.error("[NamiCustomerManager] async login API failed",e)}),Sc.instance.fetchActiveEntitlements().catch(e=>{Si.error("[NamiCustomerManager] async login entitlement refresh failed",e)}),c.a(2);case 3:return c.p=3,c.n=4,a(xc.instance.login(e));case 4:return c.n=5,a(Sc.instance.fetchActiveEntitlements());case 5:this.invokeStateHandler(Ih.LOGIN,!0),zh.instance.flowOpen&&(o=zh.instance.currentFlow,(s=null==o?void 0:o.currentFlowStep)&&(Rc.instance.maxLogging&&Si.debug(`[NamiCustomerManager] login success — triggering __login_success__ on step ${s.id}`),o.executeLifecycle(s,Zc))),c.n=7;break;case 6:throw c.p=6,d=c.v,this.invokeStateHandler(Ih.LOGIN,!1,d),zh.instance.flowOpen&&(l=zh.instance.currentFlow,(u=null==l?void 0:l.currentFlowStep)&&(Rc.instance.maxLogging&&Si.debug(`[NamiCustomerManager] login failure — triggering __login_failure__ on step ${u.id}`),l.executeLifecycle(u,eh))),d;case 7:return c.a(2)}},null,this,[[3,6]],Promise)}},{key:"logout",value:function(){var e,t,n,i,r,o,s,l,u;return k(function(d){for(;;)switch(d.p=d.n){case 0:if(this.instance.isSDKInitialized){d.n=1;break}throw e=new so,this.invokeStateHandler(Ih.LOGOUT,!1,e),e;case 1:if(!this.inAnonymousMode()){d.n=2;break}throw t=new po,this.invokeStateHandler(Ih.LOGOUT,!1,t),t;case 2:if(Hh()){d.n=3;break}return xc.instance.logoutLocal(),this.invokeStateHandler(Ih.LOGOUT,!0),zh.instance.flowOpen&&(n=zh.instance.currentFlow,(i=null==n?void 0:n.currentFlowStep)&&(Rc.instance.maxLogging&&Si.debug(`[NamiCustomerManager] async logout success — triggering __logout_success__ on step ${i.id}`),n.executeLifecycle(i,th))),xc.instance.logoutRemote().catch(e=>{Si.error("[NamiCustomerManager] async logout API failed",e)}),Sc.instance.fetchActiveEntitlements().catch(e=>{Si.error("[NamiCustomerManager] async logout entitlement refresh failed",e)}),d.a(2);case 3:return d.p=3,d.n=4,a(xc.instance.logout());case 4:return d.n=5,a(Sc.instance.fetchActiveEntitlements());case 5:this.invokeStateHandler(Ih.LOGOUT,!0),zh.instance.flowOpen&&(r=zh.instance.currentFlow,(o=null==r?void 0:r.currentFlowStep)&&r.executeLifecycle(o,th)),d.n=7;break;case 6:throw d.p=6,u=d.v,this.invokeStateHandler(Ih.LOGOUT,!1,u),zh.instance.flowOpen&&(s=zh.instance.currentFlow,(l=null==s?void 0:s.currentFlowStep)&&s.executeLifecycle(l,nh)),u;case 7:return d.a(2)}},null,this,[[3,6]],Promise)}},{key:"setCustomerDataPlatformId",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.updateCustomerDataPlatformId(e));case 1:return t.a(2)}},null,this,null,Promise)}},{key:"clearCustomerDataPlatformId",value:function(){return k(function(e){for(;;)switch(e.n){case 0:return e.n=1,a(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,r,o;return k(function(s){for(;;)switch(s.n){case 0:if(t=e?Ih.ANONYMOUS_MODE_ON:Ih.ANONYMOUS_MODE_OFF,this.instance.isSDKInitialized){s.n=1;break}throw n=new so,this.invokeStateHandler(t,!1,n),n;case 1:if(this.anonymousModeCapability()){s.n=2;break}return Si.warn("Anonymous mode feature is not enabled for your Nami account. Contact support@nami.ml for details."),s.a(2);case 2:if(this.inAnonymousMode()!==e){s.n=3;break}return i=e?new fo:new vo,this.invokeStateHandler(t,!1,i),s.a(2);case 3:if(!e){s.n=4;break}io.setAnonymousMode(e),io.resetDevice(),this.refetchConfig(),this.invokeStateHandler(Ih.ANONYMOUS_MODE_ON,!0),s.n=6;break;case 4:return io.clearAnonymousMode(),Hu(),o=null===(r=io.getNamiConfig())||void 0===r?void 0:r.namiCommands,s.n=5,a(yu.instance.createOrUpdateDevice(Tl(o)));case 5:io.clearAnonymousUUID(),this.refetchConfig(),this.invokeStateHandler(Ih.ANONYMOUS_MODE_OFF,!0);case 6:return s.a(2)}},null,this,null,Promise)}},{key:"inAnonymousMode",value:function(){return!!this.instance.isSDKInitialized&&Gu()}},{key:"setCustomerAttribute",value:function(e,t){if(!this.instance.isSDKInitialized)throw new so;if(io.setCustomerAttribute(e,t),Js(Pe.PAYWALL_PERSONALIZATION)?(gc.setCustomerAttribute({[e]:t}),Si.debug(`This customer attribute you set is now available for paywall personalization using the smart text variable: ${e}`)):Si.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.`),zh.instance.flowOpen){var n=zh.instance.currentFlow;if(n){var i=n.currentFlowStep;i&&n.executeLifecycle(i,oh)}}}},{key:"getCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new so;var t=io.getCustomerAttribute(e);return null!=t?Js(Pe.PAYWALL_PERSONALIZATION)?Si.debug(`Found customer attribute. ${e} is available for paywall personalization on this device.`):Si.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.`):Si.debug(`No ${e} customer attribute found.`),t}},{key:"getAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new so;return io.getAllCustomerAttributes()}},{key:"clearCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new so;io.clearCustomerAttribute(e)?(gc.removeCustomerAttribute(e),Si.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.`)):Si.warn(`No value to clear for attribute ${e}.`)}},{key:"clearAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new so;io.getAllCustomerAttributesKeys().forEach(e=>{gc.removeCustomerAttribute(e)}),io.clearAllCustomerAttributes(),Si.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 so;return io.getCustomerJourneyState()}},{key:"deviceId",value:function(){var e,t;return this.instance.isSDKInitialized&&null!==(e=null===(t=io.getDevice())||void 0===t?void 0:t.id)&&void 0!==e?e:qe}},{key:"registerJourneyStateHandler",value:function(e){if(el("NamiCustomerManager.registerJourneyStateHandler"))return this.instance.emitter.addListener(di,e),()=>{this.instance.emitter.removeListener(di,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,r;return k(function(o){for(;;)switch(o.p=o.n){case 0:if(this.instance.isSDKInitialized){o.n=1;break}throw t=new so,this.invokeStateHandler(Ih.CUSTOMER_DATA_PLATFORM_ID_SET,!1,t),t;case 1:if(this.inAnonymousMode()){o.n=6;break}return o.p=2,o.n=3,a(yu.instance.updateDeviceField("customer_data_platform_id",e));case 3:this.invokeStateHandler(Ih.CUSTOMER_DATA_PLATFORM_ID_SET,!0),o.n=5;break;case 4:o.p=4,r=o.v,this.invokeStateHandler(Ih.CUSTOMER_DATA_PLATFORM_ID_SET,!1,r);case 5:o.n=7;break;case 6:return Si.info("Unable to set CDP ID in anonymous mode",{deviceId:null===(n=io.getDevice())||void 0===n?void 0:n.id,anonymousMode:!0}),i=new go,this.invokeStateHandler(Ih.CUSTOMER_DATA_PLATFORM_ID_SET,!1,i),o.a(2);case 7:return o.a(2)}},null,this,[[2,4]],Promise)}},{key:"anonymousModeCapability",value:function(){if(!this.instance.isSDKInitialized)return!1;var e=Js(Pe.ANONYMOUS_MODE_CAPABILITY),t=Js(Pe.THIRD_PARTY_TRANSACTIONS);return e&&t}},{key:"refetchConfig",value:function(){return k(function(e){for(;;)switch(e.n){case 0:if(!this.instance.isSDKInitialized){e.n=1;break}return e.n=1,a(Promise.all([bu.instance.fetchProducts(),Ou.instance.fetchPaywalls().then(e=>pu.instance.fetchCampaignRules(e))]));case 1:return e.a(2)}},null,this,null,Promise)}}])}();Gh.instance=new Gh;var Vh="This field is required",Kh="Please enter a valid email address",Xh="Please enter at least 2 characters",Yh=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function qh(e,t,n){var i=("string"==typeof n?n:null==n?"":String(n)).trim();return t&&0===i.length?Vh:0!==i.length?"email"!==e||Yh.test(i)?"name"===e&&i.length<2?Xh:void 0:Kh:void 0}var Jh=/^([^:]+)::(.+)$/;var Qh=function(){return c(function e(t={}){var n,i,a,r,s;o(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!==(s=t.transition)&&void 0!==s?s:"none"},[{key:"allScreensAvailable",get:function(){return this.screens.length>0&&Ul(this.screens)}}])}(),Zh=function(e){function t(e,n,i,a){var s,l;o(this,t),(l=r(this,t,[null!==(s=e.flow.object)&&void 0!==s?s:{}])).stepcrumbs=[],l.branchcrumbs=[],l.activeHandoffSequence=null,l.currentScreenState=null,l.isPaused=!1,l.flowPath="",l.timerStates={},l.handoffState={permissions:{}},l.campaign=e,l.component=n,l.context=a,l.manager=i,l.branchcrumbs=[],l.stepcrumbs=[],l.registerResolvers(a);var u=l.findStepByType(jc);return u&&l.forward(u.id),l}return p(t,e),c(t,[{key:"applyLaunchContextAttributes",value:function(e){var t,n;this.context||(this.context={customAttributes:{}},new Th(this.context,this.campaign)),null!==(n=(t=this.context).customAttributes)&&void 0!==n||(t.customAttributes={}),Object.assign(this.context.customAttributes,e)}},{key:"registerResolvers",value:function(e){e&&new Th(e,this.campaign),new Mh,new Oh,new $h,new Nh(this.campaign),(new Wh).register(),Ph.shared.registerNamespaceResolver("Flow",e=>{switch(e){case"Flow.stepcrumbs":return this.stepcrumbs.map(e=>e.id);case"Flow.branchcrumbs":return this.branchcrumbs;default:return}}),Ph.shared.registerNamespaceResolver("login",e=>{var t,n=e.replace(/^login\./,"");return null===(t=this.handoffState.login)||void 0===t?void 0:t[n]}),Ph.shared.registerNamespaceResolver("permissions",e=>{var t=e.replace(/^permissions\./,"");return this.handoffState.permissions[t]}),Ph.shared.registerNamespaceResolver("__first_session__",()=>Mc.instance.getIsFirstSession())}},{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:"flowLog",value:function(e,...t){Rc.instance.maxLogging&&Si.debug(`[NamiFlow] ${e}`,...t)}},{key:"finished",value:function(){var e;this.flowLog(`finished() — closing flow, isPaused=${this.isPaused}, step=${null===(e=this.currentFlowStep)||void 0===e?void 0:e.id}`),this.manager.finishFlow()}},{key:"dismiss",value:function(){this.signalNonCompletion("dismiss_page"),this.finished()}},{key:"back",value:function(){var e;if(!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to)){if(!this.stepcrumbs.slice(0,-1).some(e=>"screen"===e.type))return this.flowLog("back() — no previous screen step, dismissing flow"),void this.dismiss();this.backToPreviousScreenStep()}else Si.debug(`Not allowed to go back to ${this.previousFlowStep.id}`)}},{key:"bindImpression",value:function(e){var t=this.currentFlowStep;if(t){var n=this.completionContext;n&&n.stepId===t.id&&!n.impressionId?n.impressionId=e:this.completionContext={stepId:t.id,impressionId:e,resultSent:!1,pending:[]};var i=t.completion_step;null!=i&&i.enabled&&"page_view"===i.condition&&this.completionSignal("page_view");var a=this.completionContext.pending;this.completionContext.pending=[],a.forEach(e=>this.completionSignal(e))}}},{key:"completionSignal",value:function(e){var t=this.currentFlowStep,n=null==t?void 0:t.completion_step;if(t&&null!=n&&n.enabled&&n.condition===e){var i=this.completionContext;i&&i.stepId===t.id||(i=this.completionContext={stepId:t.id,resultSent:!1,pending:[]}),i.resultSent||(i.impressionId?(i.resultSent=!0,this.patchCompletion(i.impressionId,e)):i.pending.includes(e)||i.pending.push(e))}}},{key:"signalNonCompletion",value:function(e){var t=this.completionContext;t&&t.impressionId&&!t.resultSent&&(t.resultSent=!0,this.patchCompletion(t.impressionId,e))}},{key:"patchCompletion",value:function(e,t){var n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:return this.flowLog(`patchCompletion(${t}) — impression=${e}, step=${null===(n=this.currentFlowStep)||void 0===n?void 0:n.id}`),r.p=1,r.n=2,a($l.instance.patchImpressionCompletion(e,t,(new Date).toISOString()));case 2:r.n=4;break;case 3:r.p=3,i=r.v,Si.error(`[NamiFlow] completion PATCH failed for '${t}'`,i);case 4:return r.a(2)}},null,this,[[1,3]],Promise)}},{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=zl(n.screen);return r&&we().ui.flowNavigateToScreen(r,{transition:this.transition,direction:"backward"}),void(this.currentScreenState=null!==(i=null===(a=gc.currentProvider)||void 0===a?void 0:a.state)&&void 0!==i?i:null)}}Si.warn("No previous screen step found to return to")}else Si.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(this.flowLog(`forward(${e}) — type=${t.type}, name=${t.name}, isPaused=${this.isPaused}`),t.type){case jc:case Uc:return this.stepcrumbs.push(t),void this.executeLifecycle(t,qc);case zc:return void this.handleBranchStep(t);case Bc:return void this.handleScreenStep(t);case Hc:return}else this.flowLog(`forward(${e}) — step not active (branch_tags=${JSON.stringify(t.branch_tags)}, branchcrumbs=${JSON.stringify(this.branchcrumbs)})`);else Si.error(`No step found with id: ${e}`)}},{key:"pause",value:function(){var e;this.isPaused?Si.info("Flow is already paused"):(this.isPaused=!0,this.pausedStepID=null===(e=this.currentFlowStep)||void 0===e?void 0:e.id,this.flowLog(`pause() — pausedStepID=${this.pausedStepID}`),Si.info("Flow paused"))}},{key:"resumeFromPause",value:function(){if(this.isPaused)if(this.isPaused=!1,this.pausedStepID){var e=this.pausedStepID;this.pausedStepID=void 0,this.flowLog(`resumeFromPause() — resuming from step ${e}`),Si.info(`Flow resumed from step ${e}`),this.forward(e)}else Si.warn("No step to resume from");else Si.info("Flow is not paused")}},{key:"executeLifecycle",value:function(e,t,n){t===ih?this.completionSignal("purchase_success"):t===Zc&&this.completionSignal("login_success");var i=e.actions[t];i?(this.flowLog(`executeLifecycle(${t}) — step=${e.id}, isPaused=${this.isPaused}, ${i.length} lifecycle(s)`),this.executeFullLifecycles(i,n)):this.flowLog(`executeLifecycle(${t}) — no actions on step ${e.id}`)}},{key:"lifecycles",value:function(e){if(this.currentFlowStep){var t=this.currentFlowStep.actions[e];if(t)return t;Si.info(`No actions found for button ${e} on step ${this.currentFlowStep.id}`)}}},{key:"isFormSubmitLifecycle",value:function(e){var t=[Wc.SET_TAGS_FROM_FORM,Wc.NEXT,Wc.NAVIGATE];return e.some(e=>[e.before,e.action,e.after].some(e=>null==e?void 0:e.some(e=>t.includes(e.function))))}},{key:"captureBuySkuData",value:function(e,t){var n,i,a;e===Yc&&null!=t&&t.sku&&(this.purchasedSku="sku_ref_id"in(n=t.sku)?{skuRefId:n.sku_ref_id,name:n.name,entitlements:Array.isArray(n.entitlements)?n.entitlements:[],productDetails:null!==(a=n.product_details)&&void 0!==a?a:null}:{skuRefId:n.skuId,name:n.name,entitlements:Array.isArray(n.entitlements)?n.entitlements:[],productDetails:null!==(i=n.productDetails)&&void 0!==i?i:null})}},{key:"triggerActions",value:function(e,t,n){var i,a,r;this.captureBuySkuData(e,n);var o=this.lifecycles(e);if(o){this.flowLog(`triggerActions(${e}) — step=${null===(i=this.currentFlowStep)||void 0===i?void 0:i.id}, isPaused=${this.isPaused}`),this.currentButton=t;var s=null!==(a=null===(r=gc.currentProvider)||void 0===r?void 0:r.state.formFieldValidators)&&void 0!==a?a:{};if(this.isFormSubmitLifecycle(o)&&Object.keys(s).length){var l,u=function(e,t){for(var n={},i=0,a=Object.entries(e);i<a.length;i++){var r,o=a[i],s=o[0],l=o[1],u=qh(l.type,l.required,t[s]);void 0!==u&&(n[s]=null!==(r=l.message)&&void 0!==r?r:u)}return n}(s,this.getFormData());if(null===(l=gc.currentProvider)||void 0===l||l.setFormFieldErrors(u),Object.keys(u).length)return void this.flowLog(`triggerActions(${e}) — HALTED by form validation: ${JSON.stringify(u)}`)}this.executeFullLifecycles(o,n)}}},{key:"executeFullLifecycles",value:function(e,t){for(var n,i=this,a=function(){var e=n.value,a=["before","action","after"];[e.before,e.action,e.after].forEach((e,n)=>null==e?void 0:e.forEach(e=>{var r=i.shouldRun(e);i.flowLog(` ${a[n]}: ${e.function}${e.id?` (${e.id})`:""} — shouldRun=${r}`),r&&i.performAction(e,t)}))},r=h(e);!(n=r()).done;)a()}},{key:"triggerBeforeActions",value:function(e,t,n){this.captureBuySkuData(e,n);var i=this.lifecycles(e);if(i){this.currentButton=t;for(var a,r=h(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){this.captureBuySkuData(e,n);var i=this.lifecycles(e);if(i){this.currentButton=t;for(var a,r=h(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){if(!e.conditions)return!0;var t=e.conditions.every(e=>{var t=Ph.shared.evaluate(e);if(Rc.instance.maxLogging){var n,i,a,r=null!==(n=null===(i=e.filter)||void 0===i?void 0:i.map(e=>`${e.identifier} ${e.operator} ${JSON.stringify(e.values)}`).join(", "))&&void 0!==n?n:"none";Si.debug(`[NamiFlow] condition: [${r}] op=${null!==(a=e.operator)&&void 0!==a?a:"default"} → ${t}`)}return t});return t}},{key:"performAction",value:function(e,t){var n,i;if(this.currentFlowStep){var a=(null!==(n=e.parameters)&&void 0!==n&&n.delay?+e.parameters.delay:0)||0;this.flowLog(`performAction(${e.function}) — step=${this.currentFlowStep.id}, delay=${a}, params=${JSON.stringify(null!==(i=e.parameters)&&void 0!==i?i:{})}`);var r=n=>{var i,a,r,o,s,l,u,d,c;if((null===(i=this.currentFlowStep)||void 0===i?void 0:i.id)===n)switch(e.function){case Wc.BACK:this.back();break;case Wc.NEXT:null!==(a=e.parameters)&&void 0!==a&&a.customAttributes&&this.applyLaunchContextAttributes(e.parameters.customAttributes),null!==(r=e.parameters)&&void 0!==r&&r.step?this.forward(e.parameters.step):this.next();break;case Wc.NAVIGATE:var h;if(null!==(o=e.parameters)&&void 0!==o&&o.customAttributes&&this.applyLaunchContextAttributes(e.parameters.customAttributes),null!==(s=e.parameters)&&void 0!==s&&s.step)(null===(h=this.previousFlowStep)||void 0===h?void 0:h.id)===e.parameters.step?this.back():this.forward(e.parameters.step);else this.next();break;case Wc.FINISHED:this.finished();break;case Wc.DISMISS:this.dismiss();break;case Wc.EXIT:this.signalNonCompletion("skip_page");var m=this.steps.find(e=>e.type===Uc);m&&this.forward(m.id);break;case Wc.PAUSE:this.pause();break;case Wc.RESUME:this.resumeFromPause();break;case Wc.HANDOFF:var f,v,p,g,y,b,w=null===(f=e.parameters)||void 0===f?void 0:f.handoffTag;if(!w)break;if(null!==(v=e.parameters)&&void 0!==v&&v.handoffFormId&&this.completionSignal("form_submitted"),w.startsWith("__")){var k;w===Gc&&null!==(k=e.parameters)&&void 0!==k&&k.handoffFormId?this.flowHandoffFormSequence():(Si.warn(`Ignoring reserved handoff tag '${w}' — resuming flow`),this.manager.resume());break}if(!this.manager.hasHandoffHandler){Si.debug("No handoffStepHandler found",e);break}if(w===Vc.UserData&&null!==(p=e.parameters)&&void 0!==p&&p.handoffFormId){this.manager.deliverHandoff(w,this.buildUserDataEnvelope(e.parameters.handoffFormId));break}null!==(g=e.parameters)&&void 0!==g&&g.handoffData?b=e.parameters.handoffData:t?b=t:null!==(y=e.parameters)&&void 0!==y&&y.handoffFormId&&(b=this.getFormData()),Si.debug(`Invoking handoff handler with ${w}${b?` ${JSON.stringify(b)}`:" and no data"}`),this.manager.deliverHandoff(w,b);break;case Wc.LOG:var S;if(null!==(l=e.parameters)&&void 0!==l&&l.eventName)Si.info(`logEvent → ${e.parameters.eventName}`);else Si.warn(`Missing 'eventName' in logEvent action ${null!==(S=e.id)&&void 0!==S?S:"unknown"}`);break;case Wc.TRACK:var E;if(null!==(u=e.parameters)&&void 0!==u&&u.eventName)Si.info(`trackEvent → ${e.parameters.eventName}`);else Si.warn(`Missing 'eventName' in logEvent action ${null!==(E=e.id)&&void 0!==E?E:"unknown"}`);break;case Wc.SET_VIDEO:null!==(d=e.parameters)&&void 0!==d&&d.name&&e.parameters.url?gc.setAppSuppliedVideoDetails({name:e.parameters.name,url:e.parameters.url}):Si.warn("Missing name, url for setting video details");break;case Wc.BLOCK_BACK:var P,_=null===(P=e.parameters)||void 0===P?void 0:P.step,T=_?this.getStep(_):void 0;T?T.allow_back_to=!1:this.currentFlowStep?this.currentFlowStep.allow_back_to=!1:Si.warn("Missing step for blocking back");break;case Wc.FLOW_EVENT:var M,A=new Fh(this.manager),D=Object.fromEntries(Object.entries(null!==(M=e.parameters)&&void 0!==M?M:{}).map(([e,t])=>[e,A.interpolateDeep(t)]));this.manager.eventHandler?this.manager.eventHandler(D):Si.warn("Missing event handler",D);break;case Wc.FLOW_ENABLED:gc.setUserInteractionEnabled(!0);break;case Wc.FLOW_DISABLED:gc.setUserInteractionEnabled(!1);break;case Wc.SET_TAGS:e.parameters&&(gc.setUserTags(e.parameters),Object.entries(e.parameters).forEach(([e,t])=>{Gh.setCustomerAttribute(e,t)}));break;case Wc.SET_TAGS_FROM_FORM:var x,C=null===(x=e.parameters)||void 0===x?void 0:x.include,I=Array.isArray(C)?new Set(C):void 0,L=this.getFormData(),R={};Object.entries(L).forEach(([e,t])=>{if(!I||I.has(e)){var n=Ch(t);void 0!==n&&(R[e]=n,Gh.setCustomerAttribute(e,n))}}),Object.keys(R).length&&gc.setUserTags(R);break;case Wc.SET_LAUNCH_CONTEXT:var F=e.parameters;null!=F&&F.customAttributes?this.applyLaunchContextAttributes(F.customAttributes):void 0!==(null==F?void 0:F.key)&&void 0!==(null==F?void 0:F.value)&&this.applyLaunchContextAttributes({[F.key]:F.value});break;case Wc.SET_FLOW_PATH:var O,$=null===(O=e.parameters)||void 0===O?void 0:O.flowPath;"string"==typeof $&&(this.flowPath=$);break;default:Si.warn(`Missing action handler for ${e.function}`,e)}else this.flowLog(`performAction(${e.function}) — SKIPPED stale step ${n}, current=${null===(c=this.currentFlowStep)||void 0===c?void 0:c.id}`)};a?setTimeout(r.bind(this,this.currentFlowStep.id),a):r(this.currentFlowStep.id)}else Si.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=h(this.steps.slice(t+1));!(n=i()).done;){var a=n.value;if(this.isStepActive(a))return a}Si.debug(`No active next step found after ${e.id}`)}else Si.error(`Could not find next step for step ${e.id}`)}else Si.error("Next step not found")}},{key:"handleScreenStep",value:function(e){var t,n=zl(null!==(t=e.screen)&&void 0!==t?t:"");e.screen&&n&&this.campaign?(this.stepcrumbs.push(e),we().ui.flowNavigateToScreen(n,{transition:this.transition,direction:"forward"})):Si.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=h(r);!(o=s()).done;){var l=o.value;if(l.action)for(var u,d=h(l.action);!(u=d()).done;){var c,m,f=u.value;if(this.shouldRun(f))return this.branchcrumbs.push(a),null===(c=l.before)||void 0===c||c.forEach(e=>{this.performAction(e)}),l.action.forEach(e=>{this.shouldRun(e)&&this.performAction(e)}),void(null===(m=l.after)||void 0===m||m.forEach(e=>{this.performAction(e)}))}else Si.warn(`No actions defined for branch tag ${a}`)}}Si.warn(`No matching branch condition matched for step ${e.id}`)}},{key:"getFormData",value:function(){var e,t;return m({},null!==(e=null===(t=gc.currentProvider)||void 0===t||null===(t=t.state)||void 0===t?void 0:t.formStates)&&void 0!==e?e:{})}},{key:"buildUserDataEnvelope",value:function(e){var t,n;return{form_id:e,step_id:null!==(t=null===(n=this.currentFlowStep)||void 0===n?void 0:n.id)&&void 0!==t?t:"",collected_at:(new Date).toISOString(),fields:this.getFormData()}}},{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);if(0!==n.length){if(n.some(e=>Jh.test(e))){var i=this.buildHandoffGroups(t);return 0===i.length?(Si.info("No handoff groups after grouping"),void this.manager.resume()):(this.activeHandoffSequence={groups:i},void this.resumeNextHandoff())}var a=n.sort().filter(e=>!0===t[e]);if(0===a.length)return Si.info("No eligible handoff keys after filtering"),void this.manager.resume();this.activeHandoffSequence={formStates:m({},t),remainingKeys:[...a]},this.resumeNextHandoff()}else Si.warn("formStates is empty, no handoffs to perform")}else Si.warn("No formStates available for handoff sequence")}},{key:"buildHandoffGroups",value:function(e){for(var t=new Map,n=0,i=Object.keys(e);n<i.length;n++){var a=i[n],r=a.match(Jh);if(r){var o=r[1],s=r[2];o.startsWith("__")?Si.warn(`Ignoring reserved handoff group tag '${o}'`):(t.has(o)||t.set(o,{}),t.get(o)[s]=e[a])}}return Array.from(t,([e,t])=>({tag:e,data:t})).filter(e=>Object.values(e.data).some(e=>!0===e)).sort((e,t)=>e.tag.localeCompare(t.tag))}},{key:"resumeNextHandoff",value:function(){var e=this.activeHandoffSequence;if(!e)return Si.warn("No active handoff sequence to resume"),void this.manager.resume();if("groups"in e){if(0===e.groups.length)return Si.info("All handoffs in the sequence are complete"),this.activeHandoffSequence=null,void this.manager.resume();var t=e.groups.shift();return function(e){return Object.values(Vc).includes(e)}(t.tag)||Si.warn(`handoff group tag '${t.tag}' is outside the NamiHandoffTag vocabulary — passing through`),this.activeHandoffSequence=e,Si.debug(`Starting grouped handoff for '${t.tag}' → ${JSON.stringify(t.data)}`),void this.manager.deliverHandoff(t.tag,t.data)}if(0===e.remainingKeys.length)return Si.info("All handoffs in the sequence are complete"),this.activeHandoffSequence=null,void this.manager.resume();var n=e.remainingKeys.shift(),i=e.formStates[n];Si.debug(`Starting handoff for ${n} → ${String(i)}`),this.activeHandoffSequence=e,this.manager.deliverHandoff(`${n}`,void 0)}}])}(Qh),em=function(){return c(function e(){o(this,e),this.emitter=vu.getInstance()},[{key:"sdkInitialized",get:function(){return Rc.instance.isInitialized}},{key:"campaignTypeAndLabel",value:function(t,n){var i,a="";return t&&!n&&Kl(t)?(a=t,i=e.NamiCampaignRuleType.URL):t?(a=t,i=e.NamiCampaignRuleType.LABEL):n&&(a=n,i=e.NamiCampaignRuleType.URL),{type:i,value:a}}}],[{key:"allCampaigns",value:function(){if(!this.instance.sdkInitialized)throw new so;return ql()}},{key:"isCampaignAvailable",value:function(e){if(!this.instance.sdkInitialized)throw new so;var t=this.instance.campaignTypeAndLabel(e),n=t.type,i=t.value,a=tu(i,n),r=a.campaign,o=a.paywall;return null!=r&&r.flow?new Qh(r.flow.object).allScreensAvailable:Boolean(r&&o)}},{key:"isFlow",value:function(e,t){if(!this.instance.sdkInitialized)throw new so;var n=this.instance.campaignTypeAndLabel(e,t),i=n.type,a=n.value;return Nl(tu(a,i).campaign)}},{key:"refresh",value:function(){return k(function(e){for(;;)switch(e.n){case 0:if(this.instance.sdkInitialized){e.n=1;break}throw new so;case 1:return Zs(),e.n=2,a(Mc.instance.fetchCampaignsAndPaywalls());case 2:return e.a(2,ql())}},null,this,null,Promise)}},{key:"registerAvailableCampaignsHandler",value:function(e){return this.instance.emitter.addListener(ai,e),()=>{this.instance.emitter.removeListener(ai,e)}}},{key:"launch",value:function(t,n,i,a,r){var o,s,l,u,d,c,h,f,v,p;a=null!=a?a:()=>{},i=null!=i?i:{customAttributes:{}};var g=this.instance.campaignTypeAndLabel(t,n),b=g.type,w=g.value;if(!this.instance.sdkInitialized)throw a(!1,e.LaunchCampaignError.SDK_NOT_INITIALIZED),new so;var k,S=Tc.firstLaunchLookup(w,()=>tu(w,b)),E=S.paywall,P=S.campaign,_=!P||!E&&!P.flow;_&&(k=t||n?t?e.LaunchCampaignError.LABELED_CAMPAIGN_NOT_FOUND:n?e.LaunchCampaignError.URL_CAMPAIGN_NOT_FOUND:e.LaunchCampaignError.CAMPAIGN_DATA_NOT_FOUND:e.LaunchCampaignError.DEFAULT_CAMPAIGN_NOT_FOUND,a(!1,k),E={});var T={campaignId:null!==(o=null==P?void 0:P.rule)&&void 0!==o?o:"",campaignName:null!==(s=null==P?void 0:P.name)&&void 0!==s?s:"",campaignType:null!==(l=null==P?void 0:P.type)&&void 0!==l?l:"",campaignLabel:t?w:"",campaignUrl:n?w:"",paywallId:null!=P&&P.flow?void 0:(null===(u=E)||void 0===u?void 0:u.id)||"",paywallName:null!=P&&P.flow?void 0:(null===(d=E)||void 0===d?void 0:d.name)||"",segmentId:null==P?void 0:P.segment,externalSegmentId:null!==(c=null==P?void 0:P.external_segment)&&void 0!==c?c:null,action:e.NamiPaywallAction.UNKNOWN},M=io.getPurchaseChannel();M&&(T=m({},T,{purchaseChannel:M}));var A,D,x,C,I,L,R,F,O=null===(h=i)||void 0===h?void 0:h.productGroups,$=null===(f=E)||void 0===f||null===(f=f.sku_menus)||void 0===f?void 0:f.map(e=>e.ref);if((x=null===(A=io.getNamiConfig())||void 0===A?void 0:A.namiCommands,null!==(D=null==x?void 0:x.includes(fn))&&void 0!==D&&D&&null!=O&&O.length&&null!=$)&&0==(null==$?void 0:$.filter(e=>null==O?void 0:O.some(t=>t===e))).length)throw a(!1,e.LaunchCampaignError.PRODUCT_GROUPS_NOT_FOUND),new ho;if(null!=P&&P.flow&&!Ul(null!==(v=null===(p=P.flow.object)||void 0===p?void 0:p.screens)&&void 0!==v?v:[]))throw a(!1,e.LaunchCampaignError.FLOW_SCREEN_DATA_UNAVILABLE),new mo;_||Lc.shared.record({placementLabel:null!==(C=null!==(I=null==P?void 0:P.value)&&void 0!==I?I:w)&&void 0!==C?C:"",tags:null!==(L=null==P?void 0:P.placement_tags)&&void 0!==L?L:[],customAttributes:null!==(R=null===(F=i)||void 0===F?void 0:F.customAttributes)&&void 0!==R?R:{}});var N=we().ui.createPaywall(b,w,i),W=Al();return io.setLaunchId(W),r&&this.instance.emitter.addListener(oi,t=>{var n=t.action,i=y(t,ge);r(m({},T,i,{action:null!=n?n:e.NamiPaywallAction.UNKNOWN}))}),setTimeout(()=>a(!0),0),N}},{key:"getProductGroups",value:function(e,t){var n,i,a=this.instance.campaignTypeAndLabel(e,t),r=a.type,o=a.value;return null!==(n=null===(i=tu(o,r).paywall)||void 0===i||null===(i=i.sku_menus)||void 0===i?void 0:i.map(e=>e.ref))&&void 0!==n?n:[]}},{key:"getAllProducts",value:function(e,t){var n,i,a=this.instance.campaignTypeAndLabel(e,t),r=a.type,o=a.value;return null!==(n=null===(i=tu(o,r).paywall)||void 0===i||null===(i=i.sku_menus)||void 0===i?void 0:i.flatMap(e=>{var t,n;return null!==(t=null===(n=e.products)||void 0===n?void 0:n.map(e=>e.sku_ref_id))&&void 0!==t?t:[]}))&&void 0!==n?n:[]}},{key:"getCurrentProducts",value:function(e,t){var n,i,a=this.instance.campaignTypeAndLabel(e,t),r=a.type,o=a.value,s=tu(o,r),l=gc.currentProvider,u=null==l?void 0:l.getCurrentGroupId();return u&&null!==(n=null===(i=s.paywall)||void 0===i||null===(i=i.sku_menus)||void 0===i?void 0:i.filter(e=>e.id===u).flatMap(e=>{var t,n;return null!==(t=null===(n=e.products)||void 0===n?void 0:n.map(e=>e.sku_ref_id))&&void 0!==t?t:[]}))&&void 0!==n?n:[]}}])}();em.instance=new em;var tm=em,nm=Gh,im=function(){return c(function e(){o(this,e),this.emitter=vu.getInstance()},[{key:"sdkInitialized",get:function(){return Rc.instance.isInitialized}}],[{key:"active",value:function(){return el(),bc()}},{key:"isEntitlementActive",value:function(e){return!!el("NamiEntitlementManager.isEntitlementActive")&&this.active().some(t=>t.referenceId==e)}},{key:"refresh",value:function(){return k(function(e){for(;;)switch(e.n){case 0:if(this.instance.sdkInitialized){e.n=1;break}throw new so;case 1:if(el("NamiEntitlementManager.refresh")){e.n=2;break}return e.a(2,[]);case 2:return e.n=3,a(Sc.instance.fetchActiveEntitlements());case 3:return e.a(2,bc())}},null,this,null,Promise)}},{key:"registerActiveEntitlementsHandler",value:function(e){if(el("NamiEntitlementManager.registerActiveEntitlementsHandler"))return this.instance.emitter.addListener(li,e),()=>{this.instance.emitter.removeListener(li,e)}}},{key:"clearProvisionalEntitlementGrants",value:function(){var e=bc();e=e.filter(e=>e.expires&&e.expires>(new Date).valueOf()),io.setNamiEntitlements(Tt,e),this.instance.emitter.emit(li)}}])}();im.instance=new im;var am,rm,om=im,sm=zh,lm=Bh,um=Ku,dm={upperLeft:"border-top-left-radius",upperRight:"border-top-right-radius",lowerLeft:"border-bottom-left-radius",lowerRight:"border-bottom-right-radius"},cm={left:"border-left-style",right:"border-right-style",top:"border-top-style",bottom:"border-bottom-style"},hm="wave",mm="pulse",fm="none";function vm(e){var t,n=null!==(t=e.match(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/))&&void 0!==t?t:[],i=n[0],a=n[1],r=n[2],o=n[3],s=n[4],l=n[5];return{semver:i,major:Number.parseInt(a)||3,minor:Number.parseInt(r)||0,patch:Number.parseInt(o)||0,prerelease:s,buildmetadata:l}}function pm(e,t){e&&(function(e,t){return e.major!==t.major?e.major>t.major?1:-1:e.minor!==t.minor?e.minor>t.minor?1:-1:e.patch!==t.patch?e.patch>t.patch?1:-1:0}(vm(Ae),e)>=0||Si.warn(`Component ${t} requires SDK version ${e.semver} or higher, but current SDK version is ${Ae}`))}function gm(e){return!e||"object"==typeof e&&0==Object.keys(e).length}!function(e){e.DEFAULT="default",e.LABEL="label",e.URL="url"}(am||(am={})),function(e){e.DEEPLINK="deeplink",e.IN_APP="in_app"}(rm||(rm={}));var ym=tm,bm=nm,wm=lm,km=om,Sm=sm,Em=um,Pm=xc,_m=Object.freeze({__proto__:null,NamiCampaignManager:ym,NamiCustomerManager:bm,NamiEntitlementManager:km,NamiFlowManager:Sm,NamiPaywallManager:wm,NamiProfileManager:Pm,NamiPurchaseManager:Em}),Tm=function(){return c(function e(){o(this,e)},[{key:"getItem",value:function(e){try{return localStorage.getItem(e)}catch(e){return null}}},{key:"setItem",value:function(e,t){try{localStorage.setItem(e,t)}catch(e){}}},{key:"removeItem",value:function(e){try{localStorage.removeItem(e)}catch(e){}}},{key:"clear",value:function(){try{localStorage.clear()}catch(e){}}},{key:"getAllKeys",value:function(){try{return Object.keys(localStorage)}catch(e){return[]}}}])}();function Mm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Am,Dm={exports:{}};var xm=(Am||(Am=1,function(e){e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var a=t[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});t.push(0);var n=t[0],i=t[1];if(10===n)switch(i){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}switch(n){case 11:return"Big Sur";case 12:return"Monterey";case 13:return"Ventura";case 14:return"Sonoma";case 15:return"Sequoia";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,l=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(l[0][o]>l[1][o])return 1;if(l[0][o]===l[1][o]){if(o===s)return 0;o-=1}else if(l[0][o]<l[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={AmazonBot:"amazonbot","Amazon Silk":"amazon_silk","Android Browser":"android",BaiduSpider:"baiduspider",Bada:"bada",BingCrawler:"bingcrawler",Brave:"brave",BlackBerry:"blackberry","ChatGPT-User":"chatgpt_user",Chrome:"chrome",ClaudeBot:"claudebot",Chromium:"chromium",Diffbot:"diffbot",DuckDuckBot:"duckduckbot",DuckDuckGo:"duckduckgo",Electron:"electron",Epiphany:"epiphany",FacebookExternalHit:"facebookexternalhit",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot",GPTBot:"gptbot","Internet Explorer":"ie",InternetArchiveCrawler:"internetarchivecrawler","K-Meleon":"k_meleon",LibreWolf:"librewolf",Linespider:"linespider",Maxthon:"maxthon","Meta-ExternalAds":"meta_externalads","Meta-ExternalAgent":"meta_externalagent","Meta-ExternalFetcher":"meta_externalfetcher","Meta-WebIndexer":"meta_webindexer","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver","OAI-SearchBot":"oai_searchbot",Omgilibot:"omgilibot",Opera:"opera","Opera Coast":"opera_coast","Pale Moon":"pale_moon",PerplexityBot:"perplexitybot","Perplexity-User":"perplexity_user",PhantomJS:"phantomjs",PingdomBot:"pingdombot",Puffin:"puffin",QQ:"qq",QQLite:"qqlite",QupZilla:"qupzilla",Roku:"roku",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SlackBot:"slackbot",SeaMonkey:"seamonkey",Sleipnir:"sleipnir","Sogou Browser":"sogou",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat",YahooSlurp:"yahooslurp","Yandex Browser":"yandex",YandexBot:"yandexbot",YouBot:"youbot"},t.BROWSER_MAP={amazonbot:"AmazonBot",amazon_silk:"Amazon Silk",android:"Android Browser",baiduspider:"BaiduSpider",bada:"Bada",bingcrawler:"BingCrawler",blackberry:"BlackBerry",brave:"Brave",chatgpt_user:"ChatGPT-User",chrome:"Chrome",claudebot:"ClaudeBot",chromium:"Chromium",diffbot:"Diffbot",duckduckbot:"DuckDuckBot",duckduckgo:"DuckDuckGo",edge:"Microsoft Edge",electron:"Electron",epiphany:"Epiphany",facebookexternalhit:"FacebookExternalHit",firefox:"Firefox",focus:"Focus",generic:"Generic",google_search:"Google Search",googlebot:"Googlebot",gptbot:"GPTBot",ie:"Internet Explorer",internetarchivecrawler:"InternetArchiveCrawler",k_meleon:"K-Meleon",librewolf:"LibreWolf",linespider:"Linespider",maxthon:"Maxthon",meta_externalads:"Meta-ExternalAds",meta_externalagent:"Meta-ExternalAgent",meta_externalfetcher:"Meta-ExternalFetcher",meta_webindexer:"Meta-WebIndexer",mz:"MZ Browser",naver:"NAVER Whale Browser",oai_searchbot:"OAI-SearchBot",omgilibot:"Omgilibot",opera:"Opera",opera_coast:"Opera Coast",pale_moon:"Pale Moon",perplexitybot:"PerplexityBot",perplexity_user:"Perplexity-User",phantomjs:"PhantomJS",pingdombot:"PingdomBot",puffin:"Puffin",qq:"QQ Browser",qqlite:"QQ Browser Lite",qupzilla:"QupZilla",roku:"Roku",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",slackbot:"SlackBot",sleipnir:"Sleipnir",sogou:"Sogou Browser",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yahooslurp:"YahooSlurp",yandex:"Yandex Browser",yandexbot:"YandexBot",youbot:"YouBot"},t.PLATFORMS_MAP={bot:"bot",desktop:"desktop",mobile:"mobile",tablet:"tablet",tv:"tv"},t.OS_MAP={Android:"Android",Bada:"Bada",BlackBerry:"BlackBerry",ChromeOS:"Chrome OS",HarmonyOS:"HarmonyOS",iOS:"iOS",Linux:"Linux",MacOS:"macOS",PlayStation4:"PlayStation 4",Roku:"Roku",Tizen:"Tizen",WebOS:"WebOS",Windows:"Windows",WindowsPhone:"Windows Phone"},t.ENGINE_MAP={Blink:"Blink",EdgeHTML:"EdgeHTML",Gecko:"Gecko",Presto:"Presto",Trident:"Trident",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,n){if(void 0===t&&(t=!1),void 0===n&&(n=null),"string"!=typeof e)throw new Error("UserAgent should be a string");return new a.default(e,t,n)},e.parse=function(e,t){return void 0===t&&(t=null),new a.default(e,t).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=l(n(92)),a=l(n(93)),r=l(n(94)),o=l(n(95)),s=l(n(17));function l(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(e,t,n){if(void 0===t&&(t=!1),void 0===n&&(n=null),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e;var i=!1;"boolean"==typeof t?(i=t,this._hints=n):this._hints=null!=t&&"object"==typeof t?t:null,this.parsedResult={},!0!==i&&this.parse()}var t=e.prototype;return t.getHints=function(){return this._hints},t.hasBrand=function(e){if(!this._hints||!Array.isArray(this._hints.brands))return!1;var t=e.toLowerCase();return this._hints.brands.some(function(e){return e.brand&&e.brand.toLowerCase()===t})},t.getBrandVersion=function(e){if(this._hints&&Array.isArray(this._hints.brands)){var t=e.toLowerCase(),n=this._hints.brands.find(function(e){return e.brand&&e.brand.toLowerCase()===t});return n?n.version:void 0}},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(Array.isArray(t.test))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)),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(Array.isArray(t.test))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(Array.isArray(t.test))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(Array.isArray(t.test))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),l=s.default.find(o,function(e){return t.isOS(e)});if(l){var u=this.satisfies(n[l]);if(void 0!==u)return u}var d=s.default.find(o,function(e){return t.isPlatform(e)});if(d){var c=this.satisfies(n[d]);if(void 0!==c)return c}}if(r>0){var h=Object.keys(a),m=s.default.find(h,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=u,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:[/gptbot/i],describe:function(e){var t={name:"GPTBot"},n=a.default.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/chatgpt-user/i],describe:function(e){var t={name:"ChatGPT-User"},n=a.default.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/oai-searchbot/i],describe:function(e){var t={name:"OAI-SearchBot"},n=a.default.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(e){var t={name:"ClaudeBot"},n=a.default.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(e){var t={name:"Omgilibot"},n=a.default.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/diffbot/i],describe:function(e){var t={name:"Diffbot"},n=a.default.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/perplexitybot/i],describe:function(e){var t={name:"PerplexityBot"},n=a.default.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/perplexity-user/i],describe:function(e){var t={name:"Perplexity-User"},n=a.default.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/youbot/i],describe:function(e){var t={name:"YouBot"},n=a.default.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/meta-webindexer/i],describe:function(e){var t={name:"Meta-WebIndexer"},n=a.default.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/meta-externalads/i],describe:function(e){var t={name:"Meta-ExternalAds"},n=a.default.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/meta-externalagent/i],describe:function(e){var t={name:"Meta-ExternalAgent"},n=a.default.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/meta-externalfetcher/i],describe:function(e){var t={name:"Meta-ExternalFetcher"},n=a.default.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{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:[/linespider/i],describe:function(e){var t={name:"Linespider"},n=a.default.getFirstMatch(/(?:linespider)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/amazonbot/i],describe:function(e){var t={name:"AmazonBot"},n=a.default.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/bingbot/i],describe:function(e){var t={name:"BingCrawler"},n=a.default.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/baiduspider/i],describe:function(e){var t={name:"BaiduSpider"},n=a.default.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/duckduckbot/i],describe:function(e){var t={name:"DuckDuckBot"},n=a.default.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/ia_archiver/i],describe:function(e){var t={name:"InternetArchiveCrawler"},n=a.default.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{name:"FacebookExternalHit"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(e){var t={name:"SlackBot"},n=a.default.getFirstMatch(/(?:slackbot|slack-imgproxy)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/yahoo!?[\s/]*slurp/i],describe:function(){return{name:"YahooSlurp"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{name:"YandexBot"}}},{test:[/pingdom/i],describe:function(){return{name:"PingdomBot"}}},{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:[/PaleMoon/i],describe:function(e){var t={name:"Pale Moon"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:PaleMoon)[\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:[/librewolf/i],describe:function(e){var t={name:"LibreWolf"},n=a.default.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,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:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe:function(e){var t={name:"Sogou Browser"},n=a.default.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,e),i=a.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e),r=a.default.getFirstMatch(/se ([\d.]+)x/i,e),o=n||i||r;return o&&(t.version=o),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:function(e){return!!e.hasBrand("DuckDuckGo")||e.test(/\sDdg\/[\d.]+$/i)},describe:function(e,t){var n={name:"DuckDuckGo"};if(t){var i=t.getBrandVersion("DuckDuckGo");if(i)return n.version=i,n}var r=a.default.getFirstMatch(/\sDdg\/([\d.]+)$/i,e);return r&&(n.version=r),n}},{test:function(e){return e.hasBrand("Brave")},describe:function(e,t){var n={name:"Brave"};if(t){var i=t.getBrandVersion("Brave");if(i)return n.version=i,n}return n}},{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:[/OpenHarmony/i],describe:function(e){var t=a.default.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.HarmonyOS,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:r.PLATFORMS_MAP.bot,vendor:"Google"}}},{test:[/linespider/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Line"}}},{test:[/amazonbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Amazon"}}},{test:[/gptbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/chatgpt-user/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/oai-searchbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/baiduspider/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Baidu"}}},{test:[/bingbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Bing"}}},{test:[/duckduckbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"DuckDuckGo"}}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Anthropic"}}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Webz.io"}}},{test:[/diffbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Diffbot"}}},{test:[/perplexitybot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/perplexity-user/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/youbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"You.com"}}},{test:[/ia_archiver/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Internet Archive"}}},{test:[/meta-webindexer/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalads/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalagent/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalfetcher/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Slack"}}},{test:[/yahoo/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Yahoo"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Yandex"}}},{test:[/pingdom/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Pingdom"}}},{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:[/Nokia/i],describe:function(e){var t=a.default.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,e),n={type:r.PLATFORMS_MAP.mobile,vendor:"Nokia"};return t&&(n.model=t),n}},{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:[/smart-?tv|smarttv/i],describe:function(){return{type:r.PLATFORMS_MAP.tv}}},{test:[/netcast/i],describe:function(){return{type:r.PLATFORMS_MAP.tv}}},{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}})}(Dm)),Dm.exports),Cm=Mm(xm),Im={tablet:"tablet",mobile:"phone",tv:"television",desktop:"desktop"},Lm={"1280x720":.67,"1920x1080":1,"3840x2160":2,"7680x4320":4},Rm=function(){return c(function e(){o(this,e)},[{key:"getDeviceData",value:function(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:Ae,language:"en"};var t=Cm.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:Ae,language:window.navigator.language};if(n.type&&(i.form_factor=Im[n.type]),n.model&&(i.device_model=n.model),e&&e.length>0){var a=(e=>{var t=e.find(e=>e.includes(dn)),n={platform:"",version:""};if(t){var i=t.split(hn);n.platform=i[1],n.version=i[2]}return n})(e);i.extended_platform=a.platform,i.extended_platform_version=a.version}return i}},{key:"getDeviceFormFactor",value:function(){if("undefined"==typeof window)return"desktop";var e=Cm.getParser(window.navigator.userAgent).getPlatform();return e.type&&Im[e.type]||"desktop"}},{key:"getDeviceScaleFactor",value:function(e){var t;if(e||(e=this.getDeviceFormFactor()),"television"!==e)return 1;var n=window,i=n.innerWidth,a=n.innerHeight,r=i.toString()+"x"+a.toString();return null!==(t=Lm[r])&&void 0!==t?t:Math.min(i/1920,a/1080)||1}},{key:"getScreenInfo",value:function(){var e,t,n,i;return"undefined"==typeof window?{width:1920,height:1080,scale:1}:{width:null!==(e=null===(t=window.screen)||void 0===t?void 0:t.width)&&void 0!==e?e:window.innerWidth,height:null!==(n=null===(i=window.screen)||void 0===i?void 0:i.height)&&void 0!==n?n:window.innerHeight,scale:window.devicePixelRatio||1}}},{key:"getLanguage",value:function(){return"undefined"==typeof window?"en":window.navigator.language||"en"}},{key:"onAppForeground",value:function(e){if("undefined"==typeof document)return()=>{};var t=()=>{"visible"===document.visibilityState&&e()};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)}},{key:"generateUUID",value:function(){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 Fm(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"==typeof SuppressedError&&SuppressedError;var Om,$m,Nm,Wm=globalThis,jm=Wm.ShadowRoot&&(void 0===Wm.ShadyCSS||Wm.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Bm=Symbol(),zm=new WeakMap,Um=function(){return c(function e(t,n,i){if(o(this,e),this._$cssResult$=!0,i!==Bm)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(jm&&void 0===e){var n=void 0!==t&&1===t.length;n&&(e=zm.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&zm.set(t,e))}return e}},{key:"toString",value:function(){return this.cssText}}])}(),Hm=e=>new Um("string"==typeof e?e:e+"",void 0,Bm),Gm=(e,...t)=>{var n=1===e.length?e[0]:t.reduce((t,n,i)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[i+1],e[0]);return new Um(n,e,Bm)},Vm=jm?e=>e:e=>e instanceof CSSStyleSheet?(e=>{for(var t,n="",i=h(e.cssRules);!(t=i()).done;){n+=t.value.cssText}return Hm(n)})(e):e,Km=Object.is,Xm=Object.defineProperty,Ym=Object.getOwnPropertyDescriptor,qm=Object.getOwnPropertyNames,Jm=Object.getOwnPropertySymbols,Qm=Object.getPrototypeOf,Zm=globalThis,ef=Zm.trustedTypes,tf=ef?ef.emptyScript:"",nf=Zm.reactiveElementPolyfillSupport,af=(e,t)=>e,rf={toAttribute(e,t){switch(t){case Boolean:e=e?tf: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}},of=(e,t)=>!Km(e,t),sf={attribute:!0,type:String,converter:rf,reflect:!1,useDefault:!1,hasChanged:of};null!==(Om=Symbol.metadata)&&void 0!==Om||(Symbol.metadata=Symbol("metadata")),null!==($m=Zm.litPropertyMetadata)&&void 0!==$m||(Zm.litPropertyMetadata=new WeakMap);var lf,uf=function(e){function t(){var e;return o(this,t),(e=r(this,t))._$Ep=void 0,e.isUpdatePending=!1,e.hasUpdated=!1,e._$Em=null,e._$Ev(),e}return p(t,e),c(t,[{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=h(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((e,t)=>{if(jm)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(var n,i=h(t);!(n=i()).done;){var a=n.value,r=document.createElement("style"),o=Wm.litNonce;void 0!==o&&r.setAttribute("nonce",o),r.textContent=a.cssText,e.appendChild(r)}})(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:rf).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),l="function"==typeof s.converter?{fromAttribute:s.converter}:void 0!==(null===(a=s.converter)||void 0===a?void 0:a.fromAttribute)?s.converter:rf;this._$Em=i;var u=l.fromAttribute(t,s.type);this[i]=null!==(r=null!=u?u:null===(o=this._$Ej)||void 0===o?void 0:o.get(i))&&void 0!==r?r:u,this._$Em=null}}},{key:"requestUpdate",value:function(e,t,n,i=!1,a){if(void 0!==e){var r,o,s=this.constructor;if(!1===i&&(a=this[e]),null!=n||(n=s.getPropertyOptions(e)),!((null!==(r=n.hasChanged)&&void 0!==r?r:of)(a,t)||n.useDefault&&n.reflect&&a===(null===(o=this._$Ej)||void 0===o?void 0:o.get(e))&&!this.hasAttribute(s._$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,l;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!==(l=this._$Eq)&&void 0!==l?l:this._$Eq=new Set).add(e))}},{key:"_$EP",value:function(){var e,t;return k(function(n){for(;;)switch(n.p=n.n){case 0:return this.isUpdatePending=!0,n.p=1,n.n=2,a(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,a(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=h(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,l=h(o);!(s=l()).done;){var u=s.value,d=u[0],c=u[1],m=c.wrapped,f=this[d];!0!==m||this._$AL.has(d)||void 0===f||this.C(d,void 0,c,f)}}var v=!1,p=this._$AL;try{var g;(v=this.shouldUpdate(p))?(this.willUpdate(p),null!==(g=this._$EO)&&void 0!==g&&g.forEach(e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)}),this.update(p)):this._$EM()}catch(p){throw v=!1,this._$EM(),p}v&&this._$AE(p)}}},{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=sf){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&&Xm(this.prototype,e,i)}}},{key:"getPropertyDescriptor",value:function(e,t,n){var i,a=null!==(i=Ym(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:sf}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty(af("elementProperties"))){var e=Qm(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty(af("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(af("properties")))for(var e=this.properties,t=0,n=[...qm(e),...Jm(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=h(r);!(o=s()).done;){var l=o.value,u=l[0],d=l[1];this.elementProperties.set(u,d)}}this._$Eh=new Map;for(var c,m=h(this.elementProperties);!(c=m()).done;){var f=c.value,v=f[0],p=f[1],g=this._$Eu(v,p);void 0!==g&&this._$Eh.set(g,v)}this.elementStyles=this.finalizeStyles(this.styles)}}},{key:"finalizeStyles",value:function(e){var t=[];if(Array.isArray(e))for(var n,i=h(new Set(e.flat(1/0).reverse()));!(n=i()).done;){var a=n.value;t.unshift(Vm(a))}else void 0!==e&&t.push(Vm(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}}])}(M(HTMLElement));uf.elementStyles=[],uf.shadowRootOptions={mode:"open"},uf[af("elementProperties")]=new Map,uf[af("finalized")]=new Map,null!=nf&&nf({ReactiveElement:uf}),(null!==(Nm=Zm.reactiveElementVersions)&&void 0!==Nm?Nm:Zm.reactiveElementVersions=[]).push("2.1.2");var df=globalThis,cf=e=>e,hf=df.trustedTypes,mf=hf?hf.createPolicy("lit-html",{createHTML:e=>e}):void 0,ff="$lit$",vf=`lit$${Math.random().toFixed(9).slice(2)}$`,pf="?"+vf,gf=`<${pf}>`,yf=document,bf=()=>yf.createComment(""),wf=e=>null===e||"object"!=typeof e&&"function"!=typeof e,kf=Array.isArray,Sf="[ \t\n\f\r]",Ef=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Pf=/-->/g,_f=/>/g,Tf=RegExp(`>|${Sf}(?:([^\\s"'>=/]+)(${Sf}*=${Sf}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Mf=/'/g,Af=/"/g,Df=/^(?:script|style|textarea|title)$/i,xf=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),Cf=xf(1),If=xf(2),Lf=Symbol.for("lit-noChange"),Rf=Symbol.for("lit-nothing"),Ff=new WeakMap,Of=yf.createTreeWalker(yf,129);function $f(e,t){if(!kf(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==mf?mf.createHTML(t):t}var Nf=function(){return c(function e({strings:t,_$litType$:n},i){var a;o(this,e),this.parts=[];var r=0,s=0,l=t.length-1,u=this.parts,d=((e,t)=>{for(var n,i=e.length-1,a=[],r=2===t?"<svg>":3===t?"<math>":"",o=Ef,s=0;s<i;s++){for(var l=e[s],u=void 0,d=void 0,c=-1,h=0;h<l.length&&(o.lastIndex=h,null!==(d=o.exec(l)));)h=o.lastIndex,o===Ef?"!--"===d[1]?o=Pf:void 0!==d[1]?o=_f:void 0!==d[2]?(Df.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Tf):void 0!==d[3]&&(o=Tf):o===Tf?">"===d[0]?(o=null!=n?n:Ef,c=-1):void 0===d[1]?c=-2:(c=o.lastIndex-d[2].length,u=d[1],o=void 0===d[3]?Tf:'"'===d[3]?Af:Mf):o===Af||o===Mf?o=Tf:o===Pf||o===_f?o=Ef:(o=Tf,n=void 0);var m=o===Tf&&e[s+1].startsWith("/>")?" ":"";r+=o===Ef?l+gf:c>=0?(a.push(u),l.slice(0,c)+ff+l.slice(c)+vf+m):l+vf+(-2===c?s:m)}return[$f(e,r+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),a]})(t,n),c=d[0],m=d[1];if(this.el=e.createElement(c,i),Of.currentNode=this.el.content,2===n||3===n){var f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;null!==(a=Of.nextNode())&&u.length<l;){if(1===a.nodeType){if(a.hasAttributes())for(var v,p=h(a.getAttributeNames());!(v=p()).done;){var g=v.value;if(g.endsWith(ff)){var y=m[s++],b=a.getAttribute(g).split(vf),w=/([.?@])?(.*)/.exec(y);u.push({type:1,index:r,name:w[2],strings:b,ctor:"."===w[1]?Uf:"?"===w[1]?Hf:"@"===w[1]?Gf:zf}),a.removeAttribute(g)}else g.startsWith(vf)&&(u.push({type:6,index:r}),a.removeAttribute(g))}if(Df.test(a.tagName)){var k=a.textContent.split(vf),S=k.length-1;if(S>0){a.textContent=hf?hf.emptyScript:"";for(var E=0;E<S;E++)a.append(k[E],bf()),Of.nextNode(),u.push({type:2,index:++r});a.append(k[S],bf())}}}else if(8===a.nodeType)if(a.data===pf)u.push({type:2,index:r});else for(var P=-1;-1!==(P=a.data.indexOf(vf,P+1));)u.push({type:7,index:r}),P+=vf.length-1;r++}},null,[{key:"createElement",value:function(e,t){var n=yf.createElement("template");return n.innerHTML=e,n}}])}();function Wf(e,t,n=e,i){var a,r,o,s,l;if(t===Lf)return t;var u=void 0!==i?null===(a=n._$Co)||void 0===a?void 0:a[i]:n._$Cl,d=wf(t)?void 0:t._$litDirective$;return(null===(r=u)||void 0===r?void 0:r.constructor)!==d&&(null!==(o=u)&&void 0!==o&&null!==(s=o._$AO)&&void 0!==s&&s.call(o,!1),void 0===d?u=void 0:(u=new d(e))._$AT(e,n,i),void 0!==i?(null!==(l=n._$Co)&&void 0!==l?l:n._$Co=[])[i]=u:n._$Cl=u),void 0!==u&&(t=Wf(e,u._$AS(e,t.values),u,i)),t}var jf=function(){return c(function e(t,n){o(this,e),this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n},[{key:"parentNode",get:function(){return this._$AM.parentNode}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"u",value:function(e){var t,n=this._$AD,i=n.el.content,a=n.parts,r=(null!==(t=null==e?void 0:e.creationScope)&&void 0!==t?t:yf).importNode(i,!0);Of.currentNode=r;for(var o=Of.nextNode(),s=0,l=0,u=a[0];void 0!==u;){var d;if(s===u.index){var c=void 0;2===u.type?c=new Bf(o,o.nextSibling,this,e):1===u.type?c=new u.ctor(o,u.name,u.strings,this,e):6===u.type&&(c=new Vf(o,this,e)),this._$AV.push(c),u=a[++l]}s!==(null===(d=u)||void 0===d?void 0:d.index)&&(o=Of.nextNode(),s++)}return Of.currentNode=yf,r}},{key:"p",value:function(e){for(var t,n=0,i=h(this._$AV);!(t=i()).done;){var a=t.value;void 0!==a&&(void 0!==a.strings?(a._$AI(e,a,n),n+=a.strings.length-2):a._$AI(e[n])),n++}}}])}(),Bf=function(){return c(function e(t,n,i,a){var r;o(this,e),this.type=2,this._$AH=Rf,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=i,this.options=a,this._$Cv=null===(r=null==a?void 0:a.isConnected)||void 0===r||r},[{key:"_$AU",get:function(){var e,t;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cv}},{key:"parentNode",get:function(){var e,t=this._$AA.parentNode,n=this._$AM;return void 0!==n&&11===(null===(e=t)||void 0===e?void 0:e.nodeType)&&(t=n.parentNode),t}},{key:"startNode",get:function(){return this._$AA}},{key:"endNode",get:function(){return this._$AB}},{key:"_$AI",value:function(e,t=this){e=Wf(this,e,t),wf(e)?e===Rf||null==e||""===e?(this._$AH!==Rf&&this._$AR(),this._$AH=Rf):e!==this._$AH&&e!==Lf&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>kf(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]))(e)?this.k(e):this._(e)}},{key:"O",value:function(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}},{key:"T",value:function(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}},{key:"_",value:function(e){this._$AH!==Rf&&wf(this._$AH)?this._$AA.nextSibling.data=e:this.T(yf.createTextNode(e)),this._$AH=e}},{key:"$",value:function(e){var t,n=e.values,i=e._$litType$,a="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=Nf.createElement($f(i.h,i.h[0]),this.options)),i);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===a)this._$AH.p(n);else{var r=new jf(a,this),o=r.u(this.options);r.p(n),this.T(o),this._$AH=r}}},{key:"_$AC",value:function(e){var t=Ff.get(e.strings);return void 0===t&&Ff.set(e.strings,t=new Nf(e)),t}},{key:"k",value:function(e){kf(this._$AH)||(this._$AH=[],this._$AR());for(var t,n,i=this._$AH,a=0,r=h(e);!(n=r()).done;){var o=n.value;a===i.length?i.push(t=new _k(this.O(bf()),this.O(bf()),this,this.options)):t=i[a],t._$AI(o),a++}a<i.length&&(this._$AR(t&&t._$AB.nextSibling,a),i.length=a)}},{key:"_$AR",value:function(e=this._$AA.nextSibling,t){for(null===(n=this._$AP)||void 0===n||n.call(this,!1,!0,t);e!==this._$AB;){var n,i=cf(e).nextSibling;cf(e).remove(),e=i}}},{key:"setConnected",value:function(e){var t;void 0===this._$AM&&(this._$Cv=e,null===(t=this._$AP)||void 0===t||t.call(this,e))}}])}(),zf=function(){return c(function e(t,n,i,a,r){o(this,e),this.type=1,this._$AH=Rf,this._$AN=void 0,this.element=t,this.name=n,this._$AM=a,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Rf},[{key:"tagName",get:function(){return this.element.tagName}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(e,t=this,n,i){var a=this.strings,r=!1;if(void 0===a)e=Wf(this,e,t,0),(r=!wf(e)||e!==this._$AH&&e!==Lf)&&(this._$AH=e);else{var o,s,l=e;for(e=a[0],o=0;o<a.length-1;o++)(s=Wf(this,l[n+o],t,o))===Lf&&(s=this._$AH[o]),r||(r=!wf(s)||s!==this._$AH[o]),s===Rf?e=Rf:e!==Rf&&(e+=(null!=s?s:"")+a[o+1]),this._$AH[o]=s}r&&!i&&this.j(e)}},{key:"j",value:function(e){e===Rf?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=e?e:"")}}])}(),Uf=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).type=3,e}return p(t,e),c(t,[{key:"j",value:function(e){this.element[this.name]=e===Rf?void 0:e}}])}(zf),Hf=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).type=4,e}return p(t,e),c(t,[{key:"j",value:function(e){this.element.toggleAttribute(this.name,!!e&&e!==Rf)}}])}(zf),Gf=function(e){function t(e,n,i,a,s){var l;return o(this,t),(l=r(this,t,[e,n,i,a,s])).type=5,l}return p(t,e),c(t,[{key:"_$AI",value:function(e,t=this){var n;if((e=null!==(n=Wf(this,e,t,0))&&void 0!==n?n:Rf)!==Lf){var i=this._$AH,a=e===Rf&&i!==Rf||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==Rf&&(i===Rf||a);a&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}}},{key:"handleEvent",value:function(e){var t,n;"function"==typeof this._$AH?this._$AH.call(null!==(t=null===(n=this.options)||void 0===n?void 0:n.host)&&void 0!==t?t:this.element,e):this._$AH.handleEvent(e)}}])}(zf),Vf=function(){return c(function e(t,n,i){o(this,e),this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i},[{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(e){Wf(this,e)}}])}(),Kf={I:Bf},Xf=df.litHtmlPolyfillSupport;null!=Xf&&Xf(Nf,Bf),(null!==(lf=df.litHtmlVersions)&&void 0!==lf?lf:df.litHtmlVersions=[]).push("3.3.3");var Yf,qf,Jf=globalThis,Qf=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).renderOptions={host:i(e)},e._$Do=void 0,e}return p(t,e),c(t,[{key:"createRenderRoot",value:function(){var e,n,i=_(t,"createRenderRoot",this)([]);return null!==(n=(e=this.renderOptions).renderBefore)&&void 0!==n||(e.renderBefore=i.firstChild),i}},{key:"update",value:function(e){var n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),_(t,"update",this)([e]),this._$Do=((e,t,n)=>{var i,a=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:t,r=a._$litPart$;if(void 0===r){var o,s=null!==(o=null==n?void 0:n.renderBefore)&&void 0!==o?o:null;a._$litPart$=r=new Bf(t.insertBefore(bf(),s),s,void 0,null!=n?n:{})}return r._$AI(e),r})(n,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function(){var e;_(t,"connectedCallback",this)([]),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}},{key:"disconnectedCallback",value:function(){var e;_(t,"disconnectedCallback",this)([]),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}},{key:"render",value:function(){return Lf}}])}(uf);Qf._$litElement$=!0,Qf.finalized=!0,null===(Yf=Jf.litElementHydrateSupport)||void 0===Yf||Yf.call(Jf,{LitElement:Qf});var Zf=Jf.litElementPolyfillSupport;null==Zf||Zf({LitElement:Qf}),(null!==(qf=Jf.litElementVersions)&&void 0!==qf?qf:Jf.litElementVersions=[]).push("4.2.2");var ev,tv,nv=Gm(ev||(ev=(e=>e)`
2
2
  /* ——— keyframes ——— */
3
3
  @keyframes nami-slide-up {
4
4
  from { transform: translateY(100%); }