@namiml/web-sdk 3.3.9-dev.202603132233 → 3.3.9-dev.202603141600

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/nami-web.cjs CHANGED
@@ -88,7 +88,7 @@
88
88
  padding-top: 0;
89
89
  padding-bottom: 0;
90
90
  }
91
- `)),yc=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)},bc=globalThis,wc=bc.ShadowRoot&&(void 0===bc.ShadyCSS||bc.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,kc=Symbol(),Sc=new WeakMap,Ec=function(){return c((function e(t,n,a){if(s(this,e),this._$cssResult$=!0,a!==kc)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}),[{key:"styleSheet",get:function(){var e=this.o,t=this.t;if(wc&&void 0===e){var n=void 0!==t&&1===t.length;n&&(e=Sc.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Sc.set(t,e))}return e}},{key:"toString",value:function(){return this.cssText}}])}(),Mc=(e,t)=>{if(wc)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(var n,a=m(t);!(n=a()).done;){var i=n.value,r=document.createElement("style"),o=bc.litNonce;void 0!==o&&r.setAttribute("nonce",o),r.textContent=i.cssText,e.appendChild(r)}},Pc=wc?e=>e:e=>e instanceof CSSStyleSheet?(e=>{for(var t,n="",a=m(e.cssRules);!(t=a()).done;){n+=t.value.cssText}return(e=>new Ec("string"==typeof e?e:e+"",void 0,kc))(n)})(e):e,Tc=Object.is,_c=Object.defineProperty,Dc=Object.getOwnPropertyDescriptor,Ac=Object.getOwnPropertyNames,xc=Object.getOwnPropertySymbols,Cc=Object.getPrototypeOf,Ic=globalThis,Lc=Ic.trustedTypes,Fc=Lc?Lc.emptyScript:"",Rc=Ic.reactiveElementPolyfillSupport,Wc=(e,t)=>e,Nc={toAttribute(e,t){switch(t){case Boolean:e=e?Fc:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){var n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},Oc=(e,t)=>!Tc(e,t),jc={attribute:!0,type:String,converter:Nc,reflect:!1,useDefault:!1,hasChanged:Oc};null!==(fc=Symbol.metadata)&&void 0!==fc||(Symbol.metadata=Symbol("metadata")),null!==(vc=Ic.litPropertyMetadata)&&void 0!==vc||(Ic.litPropertyMetadata=new WeakMap);var $c=function(){function e(){var t;return s(this,e),(t=o(this,e))._$Ep=void 0,t.isUpdatePending=!1,t.hasUpdated=!1,t._$Em=null,t._$Ev(),t}return g(e,D(HTMLElement)),c(e,[{key:"_$Ev",value:function(){var e;this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),null===(e=this.constructor.l)||void 0===e||e.forEach((e=>e(this)))}},{key:"addController",value:function(e){var t,n;(null!==(t=this._$EO)&&void 0!==t?t:this._$EO=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&(null===(n=e.hostConnected)||void 0===n||n.call(e))}},{key:"removeController",value:function(e){var t;null===(t=this._$EO)||void 0===t||t.delete(e)}},{key:"_$E_",value:function(){for(var e,t=new Map,n=m(this.constructor.elementProperties.keys());!(e=n()).done;){var a=e.value;this.hasOwnProperty(a)&&(t.set(a,this[a]),delete this[a])}t.size>0&&(this._$Ep=t)}},{key:"createRenderRoot",value:function(){var e,t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return Mc(t,this.constructor.elementStyles),t}},{key:"connectedCallback",value:function(){var e,t;null!==(e=this.renderRoot)&&void 0!==e||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$EO)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}},{key:"enableUpdating",value:function(e){}},{key:"disconnectedCallback",value:function(){var e;null===(e=this._$EO)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}},{key:"attributeChangedCallback",value:function(e,t,n){this._$AK(e,n)}},{key:"_$ET",value:function(e,t){var n=this.constructor.elementProperties.get(e),a=this.constructor._$Eu(e,n);if(void 0!==a&&!0===n.reflect){var i,r=(void 0!==(null===(i=n.converter)||void 0===i?void 0:i.toAttribute)?n.converter:Nc).toAttribute(t,n.type);this._$Em=e,null==r?this.removeAttribute(a):this.setAttribute(a,r),this._$Em=null}}},{key:"_$AK",value:function(e,t){var n=this.constructor,a=n._$Eh.get(e);if(void 0!==a&&this._$Em!==a){var i,r,o,s=n.getPropertyOptions(a),u="function"==typeof s.converter?{fromAttribute:s.converter}:void 0!==(null===(i=s.converter)||void 0===i?void 0:i.fromAttribute)?s.converter:Nc;this._$Em=a;var l=u.fromAttribute(t,s.type);this[a]=null!==(r=null!=l?l:null===(o=this._$Ej)||void 0===o?void 0:o.get(a))&&void 0!==r?r:l,this._$Em=null}}},{key:"requestUpdate",value:function(e,t,n){if(void 0!==e){var a,i,r=this.constructor,o=this[e];if(null!=n||(n=r.getPropertyOptions(e)),!((null!==(a=n.hasChanged)&&void 0!==a?a:Oc)(o,t)||n.useDefault&&n.reflect&&o===(null===(i=this._$Ej)||void 0===i?void 0:i.get(e))&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}},{key:"C",value:function(e,t,{useDefault:n,reflect:a,wrapped:i},r){var o,s,u;n&&!(null!==(o=this._$Ej)&&void 0!==o?o:this._$Ej=new Map).has(e)&&(this._$Ej.set(e,null!==(s=null!=r?r:t)&&void 0!==s?s:this[e]),!0!==i||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===a&&this._$Em!==e&&(null!==(u=this._$Eq)&&void 0!==u?u:this._$Eq=new Set).add(e))}},{key:"_$EP",value:function(){var e,t;return S((function(n){for(;;)switch(n.p=n.n){case 0:return this.isUpdatePending=!0,n.p=1,n.n=2,r(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,r(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=m(this._$Ep);!(t=n()).done;){var a=t.value,i=a[0],r=a[1];this[i]=r}this._$Ep=void 0}var o=this.constructor.elementProperties;if(o.size>0)for(var s,u=m(o);!(s=u()).done;){var l=s.value,d=l[0],h=l[1],c=h.wrapped,f=this[d];!0!==c||this._$AL.has(d)||void 0===f||this.C(d,void 0,h,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=jc){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){var n=Symbol(),a=this.getPropertyDescriptor(e,n,t);void 0!==a&&_c(this.prototype,e,a)}}},{key:"getPropertyDescriptor",value:function(e,t,n){var a,i=null!==(a=Dc(this.prototype,e))&&void 0!==a?a:{get(){return this[t]},set(e){this[t]=e}},r=i.get,o=i.set;return{get:r,set(t){var a=null==r?void 0:r.call(this);null!=o&&o.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(e){var t;return null!==(t=this.elementProperties.get(e))&&void 0!==t?t:jc}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty(Wc("elementProperties"))){var e=Cc(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty(Wc("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Wc("properties")))for(var e=this.properties,t=0,n=[...Ac(e),...xc(e)];t<n.length;t++){var a=n[t];this.createProperty(a,e[a])}var i=this[Symbol.metadata];if(null!==i){var r=litPropertyMetadata.get(i);if(void 0!==r)for(var o,s=m(r);!(o=s()).done;){var u=o.value,l=u[0],d=u[1];this.elementProperties.set(l,d)}}this._$Eh=new Map;for(var h,c=m(this.elementProperties);!(h=c()).done;){var f=h.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,a=m(new Set(e.flat(1/0).reverse()));!(n=a()).done;){var i=n.value;t.unshift(Pc(i))}else void 0!==e&&t.push(Pc(e));return t}},{key:"_$Eu",value:function(e,t){var n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}}])}();$c.elementStyles=[],$c.shadowRootOptions={mode:"open"},$c[Wc("elementProperties")]=new Map,$c[Wc("finalized")]=new Map,null!=Rc&&Rc({ReactiveElement:$c}),(null!==(pc=Ic.reactiveElementVersions)&&void 0!==pc?pc:Ic.reactiveElementVersions=[]).push("2.1.1");var zc={attribute:!0,type:String,converter:Nc,reflect:!1,hasChanged:Oc},Bc=(e=zc,t,n)=>{var a=n.kind,i=n.metadata,r=globalThis.litPropertyMetadata.get(i);if(void 0===r&&globalThis.litPropertyMetadata.set(i,r=new Map),"setter"===a&&((e=Object.create(e)).wrapped=!0),r.set(n.name,e),"accessor"===a){var o=n.name;return{set(n){var a=t.get.call(this);t.set.call(this,n),this.requestUpdate(o,a,e)},init(t){return void 0!==t&&this.C(o,void 0,e,t),t}}}if("setter"===a){var s=n.name;return function(n){var a=this[s];t.call(this,n),this.requestUpdate(s,a,e)}}throw Error("Unsupported decorator location: "+a)};function Hc(e){return(t,n)=>"object"==typeof n?Bc(e,t,n):((e,t,n)=>{var a=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),a?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function Uc(e){return Hc(f({},e,{state:!0,attribute:!1}))}function Gc(e){return!e||"object"==typeof e&&0==Object.keys(e).length}var Vc,Xc="entry",Kc="screen",Yc="branch",qc="exit",Jc="unknown";!function(e){e.NAVIGATE="flowNav",e.BACK="flowPrev",e.NEXT="flowNext",e.FINISHED="flowDone",e.DISMISS="flowDismiss",e.EXIT="flowExit",e.HANDOFF="flowHandoff",e.TRACK="trackEvent",e.LOG="logEvent",e.SET_VIDEO="setVideo",e.FLOW_EVENT="flowEvent",e.BLOCK_BACK="blockBackToStep",e.FLOW_ENABLED="flowInteractionEnabled",e.FLOW_DISABLED="flowInteractionDisabled",e.SET_TAGS="setTags",e.PAUSE="flowPause",e.RESUME="flowResume"}(Vc||(Vc={}));var Qc="__handoff_sequence__",Zc="__buy_sku__",em="__default__",tm="__appear__",nm="__disappear__",am="__login_success__",im="__login_failure__",rm="__logout_success__",om="__logout_failure__",sm="__purchase_success__",um="__remoteback__",lm="__tag_update__",dm="and",hm="or",cm="i_contains",mm="equals",fm="i_equals",vm="not_equals",pm="not_i_equals",gm="not_contains",ym="set",bm="notSet",wm=function(){function e(){s(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 a=n.map((e=>this.evaluateFilter(e)));switch(e.operator){case dm:return a.every((e=>e));case hm:return a.some((e=>e));default:return a.every((e=>e))}}},{key:"evaluateOrdered",value:function(e){var t;if(!e)return!0;var n=null!==(t=e.filter)&&void 0!==t?t:[];if(0===n.length)return!0;switch(e.operator){case dm:for(var a,i=m(n);!(a=i()).done;){var r=a.value;if(!this.evaluateFilter(r))return!1}return!0;case hm:for(var o,s=m(n);!(o=s()).done;){var u=o.value;if(this.evaluateFilter(u))return!0}return!1;default:for(var l,d=m(n);!(l=d()).done;){var h=l.value;if(!this.evaluateFilter(h))return!1}return!0}}},{key:"evaluateFilter",value:function(e){var t=this.resolve(e.identifier);if(e.operator===ym)return null!=t;if(e.operator===bm)return null==t;if(null==t)return!![vm,pm,gm].includes(e.operator);switch(e.operator){case cm:return Array.isArray(t)?e.values.some((e=>t.some((t=>0===t.localeCompare(e,void 0,{sensitivity:"accent"}))))):(this.log("Resolved value is not an array of strings for i_contains."),!1);case mm:return e.values.some((e=>{if("string"==typeof t)return t===e;if("boolean"==typeof t){var n="true"===e.toLowerCase();return t===n}return this.log("Unsupported type for equals comparison: "+typeof t),!1}));case fm:return e.values.some((e=>{if("string"==typeof t)return 0===t.localeCompare(e,void 0,{sensitivity:"accent"});if("boolean"==typeof t){var n="true"===e.toLowerCase();return t===n}return this.log("Unsupported type for i_equals comparison: "+typeof t),!1}));case vm:return e.values.every((e=>"string"!=typeof t||t!==e));case pm:return e.values.every((e=>"string"!=typeof t||0!==t.localeCompare(e,void 0,{sensitivity:"accent"})));case gm:return e.values.every((e=>"string"!=typeof t||!t.includes(e)));default:return this.log(`Unsupported operator: ${e.operator}`),!1}}},{key:"resolve",value:function(e){var t=this.resolveRaw(e);if(void 0!==t)return t;var n=e.lastIndexOf(".");if(-1!==n){var a=e.slice(0,n),i=e.slice(n+1),r=this.resolveRaw(a);return void 0!==r?this.extractProperty(i,r):void this.log(`Could not resolve base identifier: ${a}`)}}},{key:"resolveRaw",value:function(e){for(var t,n=[...this.namespaceResolvers.keys()].sort(((e,t)=>t.length-e.length)),a=m(n);!(t=a()).done;){var i=t.value;if(e.startsWith(i)){var r=this.namespaceResolvers.get(i);if(r)return r(e)}}}},{key:"extractProperty",value:function(e,t){switch(e){case"last":if(Array.isArray(t))return t[t.length-1];break;case"first":if(Array.isArray(t))return t[0];break;case"count":if(Array.isArray(t))return t.length;if(t&&"object"==typeof t)return Object.keys(t).length;break;default:return}this.log(`Could not extract .${e} from type ${typeof t}`)}},{key:"log",value:function(e){Wn.debug(`[NamiConditionEvaluator] ${e}`)}}],[{key:"shared",get:function(){return e.instance||(e.instance=new e),e.instance}}])}(),km=function(){return c((function e(){s(this,e)}),[{key:"register",value:function(){wm.shared.registerNamespaceResolver(this.namespace,(e=>{var t=e.replace(new RegExp(`^${this.namespace}\\.`),"");return this.resolveValue(t)}))}},{key:"resolveKeyPath",value:function(e,t){for(var n,a=t,i=m(e.replace(/\[(\w+)\]/g,".$1").split(".").filter(Boolean));!(n=i()).done;){var r=n.value;if(null==a||"object"!=typeof a)return;a=a[r]}return a}}])}(),Sm=function(){function e(t){var n;return s(this,e),(n=o(this,e)).namespace="LaunchContext",n.context=t,n.register(),n}return g(e,km),c(e,[{key:"resolveValue",value:function(e){if(e.startsWith("customAttributes.")){var t=e.substring(17);return this.resolveKeyPath(t,this.context.customAttributes)}if(e.startsWith("customObject.")){var n=e.substring(13);return this.resolveKeyPath(n,this.context.customObject)}return this.resolveKeyPath(e,{customAttributes:this.context.customAttributes,customObject:this.context.customObject,productGroups:this.context.productGroups})}}])}(),Em=function(){function e(){var t,n,a,i;s(this,e),(i=o(this,e)).namespace="Device";var r=Intl.DateTimeFormat().resolvedOptions().locale.split("-")[1]||"",u=Intl.DateTimeFormat().resolvedOptions().timeZone,l=su();return i.context={osName:l.os_name,osVersion:l.os_version,appVersion:l.extended_platform_version,sdkVersion:l.sdk_version,deviceModel:l.device_model,screenWidth:window.innerWidth,screenHeight:window.innerHeight,formFactor:l.form_factor,tvQuality:i.tvQuality(null!==(t=l.form_factor)&&void 0!==t?t:"desktop"),tvResolution:i.tvResolution(null!==(n=l.form_factor)&&void 0!==n?n:"desktop"),screenSize:i.screenSizeTier(null!==(a=l.form_factor)&&void 0!==a?a:"desktop"),language:l.language,country:r,timezone:u},i.register(),i}return g(e,km),c(e,[{key:"screenSizeTier",value:function(e){var t=window.screen.width,n=window.screen.height,a=window.devicePixelRatio||1,i=Math.round(t*a),r=Math.round(n*a),o=Math.max(i,r);switch(e){case"phone":return o<1136?"tiny":o<1334?"small":o<1920?"medium":o<2560?"large":"huge";case"tablet":return o<2048?"medium":o<2732?"large":"huge";case"television":return o<1920?"medium":o<3840?"large":"huge";case"desktop":return o<1440?"small":o<2560?"medium":o<3840?"large":"huge";default:return"medium"}}},{key:"tvQuality",value:function(e){if("television"!==e)return"";var t=window.screen.width,n=window.screen.height,a=window.devicePixelRatio||1,i=Math.round(t*a),r=Math.round(n*a),o=Math.max(i,r),s=Math.min(i,r);return o>=3840||s>=2160?"4K":o>=1920||s>=1080?"1080p":"720p"}},{key:"tvResolution",value:function(e){if("television"!==e)return"";var t=window.screen.width,n=window.screen.height,a=window.devicePixelRatio||1,i=Math.round(t*a),r=Math.round(n*a),o=Math.max(i,r),s=Math.min(i,r);return s<720&&o<1280?"SD":s>=720&&s<1080&&o>=1280&&o<1920?"720p":s>=1080&&s<1440&&o>=1920&&o<2560?"1080p":s>=1440&&s<2160&&o>=2560&&o<3840?"1440p":s>=2160&&s<3e3&&o>=3840&&o<5e3?"4K":s>=3e3&&o>=5e3?"8K":"Unknown"}},{key:"resolveValue",value:function(e){return this.resolveKeyPath(e,this.context)}}])}(),Mm=[/(^|_)api(_|$)?key/i,/^key$/i,/^token$/i,/id[_-]?token/i,/access[_-]?token/i,/^auth/i,/password/i,/secret/i,/signature/i,/hmac/i,/^jwt$/i,/^code$/i,/redirect[_-]?uri/i,/return[_-]?url/i,/^state$/i,/^session$/i,/^sid$/i,/^sso$/i,/assertion/i],Pm=function(){function e(){s(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 a,i=new URLSearchParams(e.search),r=(e,a)=>{var i=(e=>e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[-\s]/g,"_").toLowerCase())(e);if(!(n.size>=10||(e=>Mm.some((t=>t.test(e))))(i))){var r=this.safeValue(a);r&&(t[i]=r,n.add(i))}},o=m(i.entries());!(a=o()).done;){var s=a.value;r(s[0],s[1])}}catch(e){}return t}}],[{key:"instance",get:function(){return e._instance||(e._instance=new e),e._instance}},{key:"refresh",value:function(){"undefined"!=typeof window&&this.instance.setSearchParams()}}])}();Pm._instance=null;var Tm,_m=()=>Pm.instance.params,Dm=/\{\{\s*([^}]+?)\s*\}\}/g,Am=function(){return c((function e(t){s(this,e),this.flowManager=t,this.urlParams=_m()}),[{key:"resolve",value:function(e){var t,n,a,i,r,o,s,u,l,d,h,c,m=this.flowManager.currentFlow,f=null==m?void 0:m.component;if(e.startsWith("launchContext.")){var v,p=null===(v=this.flowManager.currentFlow)||void 0===v?void 0:v.context;if(p){var g=e.substring(14),y=new Sm(p).resolveValue(g);return null==y?void 0:y.toString()}}else switch(e){case"campaignId":return null==f||null===(t=f.campaign)||void 0===t?void 0:t.rule;case"campaignName":return null==f||null===(n=f.campaign)||void 0===n?void 0:n.name;case"campaignLabel":case"campaignPlacement":return null!==(a=null==f||null===(i=f.campaign)||void 0===i?void 0:i.value)&&void 0!==a?a:void 0;case"campaignSegment":case"campaignSegmentId":return null==f||null===(r=f.campaign)||void 0===r?void 0:r.segment;case"campaignExternalSegment":case"campaignExternalSegmentId":return null!==(o=null==f||null===(s=f.campaign)||void 0===s?void 0:s.external_segment)&&void 0!==o?o:void 0;case"pageName":return null==f||null===(u=f.paywall)||void 0===u?void 0:u.name;case"pageId":return null==f||null===(l=f.paywall)||void 0===l?void 0:l.id;case"flowName":return null==m?void 0:m.name;case"flowId":return null==m?void 0:m.id;case"objectId":return null==f||null===(d=f.campaign)||void 0===d||null===(d=d.flow)||void 0===d?void 0:d.object_id;case"stepName":return null==m||null===(h=m.currentFlowStep)||void 0===h?void 0:h.name;case"buttonText":return null==m||null===(c=m.currentButton)||void 0===c?void 0:c.firstTextValue();case"slideNumber":var b=null==f?void 0:f.getSelectedSlideIndexForCurrentCarousel();return null!=b?`${b+1}`:void 0;default:return}}},{key:"interpolateLiquidVariables",value:function(e){return e.replace(Dm,((e,t)=>{var n,a=null!==(n=this.resolve(t))&&void 0!==n?n:this.urlParams[t];return null!=a?a:""}))}},{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])=>f({},e,{[t]:this.interpolateDeep(n)})),{}):e}}])}(),xm=function(){function e(){var t;return s(this,e),(t=o(this,e)).namespace="urlParams",t.context=_m(),t.register(),t}return g(e,km),c(e,[{key:"resolveValue",value:function(e){return Wn.debug("[URLParamsResolver]","Resolving keyPath",e),this.resolveKeyPath(e,this.context)}}])}(),Cm=function(){function e(){var t;return s(this,e),(t=o(this,e)).namespace="state",t.register(),t}return g(e,km),c(e,[{key:"getContextProvider",value:function(){var e=Xh.providers;if(0!==e.length){var t=e.find((e=>e.flow));return t||e[e.length-1]}}},{key:"resolveValue",value:function(e){var t=this.getContextProvider();if(t){if(e.startsWith("formStates.")){var n=e.substring(11);return t.getCurrentFormId(n)}return this.resolveKeyPath(e,t.state)}}}])}(),Im=function(){function e(t){var n;return s(this,e),(n=o(this,e)).namespace="Placement",n.campaign=t,n.register(),n}return g(e,km),c(e,[{key:"resolveValue",value:function(e){var t;if("label"===e){if(this.campaign&&void 0!==this.campaign.value&&null!==this.campaign.value)return this.campaign.value;var n=Xh.providers;if(0!==n.length){var a=n.find((e=>e.flow));return a?a.getCurrentPlacementLabel():null===(t=n[n.length-1])||void 0===t?void 0:t.getCurrentPlacementLabel()}}}}])}(),Lm=function(){return c((function e(){s(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?Kr.setNamiProfile({externalId:this.externalId}):Kr.removeNamiProfile(),this}},{key:"load",value:function(){var e=Kr.getNamiProfile();e&&(this.externalId=e.externalId),Xh.setIsLoggedIn(!!this.externalId)}},{key:"login",value:function(e){var t;return S((function(n){for(;;)switch(n.n){case 0:return n.n=1,r(Ns.instance.login(e));case 1:(t=n.v).external_id&&Xh.setIsLoggedIn(!0),this.setExternalId(t.external_id).save();case 2:return n.a(2)}}),null,this,null,Promise)}},{key:"logout",value:function(){return S((function(e){for(;;)switch(e.n){case 0:return e.n=1,r(Ns.instance.logout());case 1:Xh.setIsLoggedIn(!1),this.setExternalId(void 0).save();case 2:return e.a(2)}}),null,this,null,Promise)}}])}();Lm.instance=new Lm,function(e){e.LOGIN="login",e.LOGOUT="logout",e.ADVERTISING_ID_SET="advertising_id_set",e.ADVERTISING_ID_CLEARED="advertising_id_cleared",e.VENDOR_ID_SET="vendor_id_set",e.VENDOR_ID_CLEARED="vendor_id_cleared",e.CUSTOMER_DATA_PLATFORM_ID_SET="customer_data_platform_id_set",e.CUSTOMER_DATA_PLATFORM_ID_CLEARED="customer_data_platform_id_cleared",e.ANONYMOUS_MODE_ON="anonymous_mode_on",e.ANONYMOUS_MODE_OFF="anonymous_mode_off",e.NAMI_DEVICE_ID_SET="nami_device_id_set",e.NAMI_DEVICE_ID_CLEARED="nami_device_id_cleared"}(Tm||(Tm={}));var Fm=function(){return c((function e(){s(this,e),this.emitter=ju.getInstance(),wm.shared.registerNamespaceResolver("UserTags",(t=>{var n=t.replace("UserTags.",""),a=e.getCustomerAttribute(n);if(null!=a){var i=a.toLowerCase();return"true"===i||"false"===i?"true"===i:isNaN(Number(a))?a:parseInt(a,10)}return null}))}),[{key:"isSDKInitialized",get:function(){return dc.instance.isInitialized}}],[{key:"isLoggedIn",value:function(){return Lm.instance.isLoggedIn()}},{key:"loggedInId",value:function(){return this.instance.isSDKInitialized||Wn.debug(ke),Lm.instance.getExternalId()}},{key:"login",value:function(e){var t,n,a,i,o,s,u;return S((function(l){for(;;)switch(l.p=l.n){case 0:if(this.instance.isSDKInitialized){l.n=1;break}throw t=new Qr,this.invokeStateHandler(Tm.LOGIN,!1,t),t;case 1:if(!this.inAnonymousMode()){l.n=2;break}throw n=new oo,this.invokeStateHandler(Tm.LOGIN,!1,n),n;case 2:return l.p=2,l.n=3,r(Lm.instance.login(e));case 3:return l.n=4,r(Qh.instance.fetchActiveEntitlements());case 4:this.invokeStateHandler(Tm.LOGIN,!0),Nm.instance.flowOpen&&(a=Nm.instance.currentFlow,(i=null==a?void 0:a.currentFlowStep)&&a.executeLifecycle(i,am)),l.n=6;break;case 5:throw l.p=5,u=l.v,this.invokeStateHandler(Tm.LOGIN,!1,u),Nm.instance.flowOpen&&(o=Nm.instance.currentFlow,(s=null==o?void 0:o.currentFlowStep)&&o.executeLifecycle(s,im)),u;case 6:return l.a(2)}}),null,this,[[2,5]],Promise)}},{key:"logout",value:function(){var e,t,n,a,i,o,s;return S((function(u){for(;;)switch(u.p=u.n){case 0:if(this.instance.isSDKInitialized){u.n=1;break}throw e=new Qr,this.invokeStateHandler(Tm.LOGOUT,!1,e),e;case 1:if(!this.inAnonymousMode()){u.n=2;break}throw t=new oo,this.invokeStateHandler(Tm.LOGOUT,!1,t),t;case 2:return u.p=2,u.n=3,r(Lm.instance.logout());case 3:return u.n=4,r(Qh.instance.fetchActiveEntitlements());case 4:this.invokeStateHandler(Tm.LOGOUT,!0),Nm.instance.flowOpen&&(n=Nm.instance.currentFlow,(a=null==n?void 0:n.currentFlowStep)&&n.executeLifecycle(a,rm)),u.n=6;break;case 5:throw u.p=5,s=u.v,this.invokeStateHandler(Tm.LOGOUT,!1,s),Nm.instance.flowOpen&&(i=Nm.instance.currentFlow,(o=null==i?void 0:i.currentFlowStep)&&i.executeLifecycle(o,om)),s;case 6:return u.a(2)}}),null,this,[[2,5]],Promise)}},{key:"setCustomerDataPlatformId",value:function(e){return S((function(t){for(;;)switch(t.n){case 0:return t.n=1,r(this.updateCustomerDataPlatformId(e));case 1:return t.a(2)}}),null,this,null,Promise)}},{key:"clearCustomerDataPlatformId",value:function(){return S((function(e){for(;;)switch(e.n){case 0:return e.n=1,r(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,a,i,o;return S((function(s){for(;;)switch(s.n){case 0:if(t=e?Tm.ANONYMOUS_MODE_ON:Tm.ANONYMOUS_MODE_OFF,this.instance.isSDKInitialized){s.n=1;break}throw n=new Qr,this.invokeStateHandler(t,!1,n),n;case 1:if(this.anonymousModeCapability()){s.n=2;break}return Wn.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 a=e?new io:new ro,this.invokeStateHandler(t,!1,a),s.a(2);case 3:if(!e){s.n=4;break}Kr.setAnonymousMode(e),Kr.resetDevice(),this.refetchConfig(),this.invokeStateHandler(Tm.ANONYMOUS_MODE_ON,!0),s.n=6;break;case 4:return Kr.clearAnonymousMode(),o=null===(i=Kr.getNamiConfig())||void 0===i?void 0:i.namiCommands,s.n=5,r(Bu.instance.createOrUpdateDevice(su(o)));case 5:Kr.clearAnonymousUUID(),this.refetchConfig(),this.invokeStateHandler(Tm.ANONYMOUS_MODE_OFF,!0);case 6:return s.a(2)}}),null,this,null,Promise)}},{key:"inAnonymousMode",value:function(){return!!this.instance.isSDKInitialized&&Xu()}},{key:"setCustomerAttribute",value:function(e,t){if(!this.instance.isSDKInitialized)throw new Qr;if(Kr.setCustomerAttribute(e,t),Cs(le.PAYWALL_PERSONALIZATION)?(Xh.setCustomerAttribute({[e]:t}),Wn.debug(`This customer attribute you set is now available for paywall personalization using the smart text variable: ${e}`)):Wn.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.`),Nm.instance.flowOpen){var n=Nm.instance.currentFlow;if(n){var a=n.currentFlowStep;a&&n.executeLifecycle(a,lm)}}}},{key:"getCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new Qr;var t=Kr.getCustomerAttribute(e);return null!=t?Cs(le.PAYWALL_PERSONALIZATION)?Wn.debug(`Found customer attribute. ${e} is available for paywall personalization on this device.`):Wn.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.`):Wn.warn(`No ${e} customer attribute found.`),t}},{key:"getAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new Qr;return Kr.getAllCustomerAttributes()}},{key:"clearCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new Qr;Kr.clearCustomerAttribute(e)?(Xh.removeCustomerAttribute(e),Wn.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.`)):Wn.warn(`No value to clear for attribute ${e}.`)}},{key:"clearAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new Qr;Kr.getAllCustomerAttributesKeys().forEach((e=>{Xh.removeCustomerAttribute(e)})),Kr.clearAllCustomerAttributes(),Wn.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 Qr;return Kr.getCustomerJourneyState()}},{key:"deviceId",value:function(){var e,t;return this.instance.isSDKInitialized&&null!==(e=null===(t=Kr.getDevice())||void 0===t?void 0:t.id)&&void 0!==e?e:Le}},{key:"registerJourneyStateHandler",value:function(e){if(Is("NamiCustomerManager.registerJourneyStateHandler"))return this.instance.emitter.addListener(Pn,e),()=>{this.instance.emitter.removeListener(Pn,e)}}},{key:"invokeStateHandler",value:function(e,t,n){this.instance.emitter.emit("accountStateChange",e,t,n)}},{key:"updateCustomerDataPlatformId",value:function(e){var t,n,a,i;return S((function(o){for(;;)switch(o.p=o.n){case 0:if(this.instance.isSDKInitialized){o.n=1;break}throw t=new Qr,this.invokeStateHandler(Tm.CUSTOMER_DATA_PLATFORM_ID_SET,!1,t),t;case 1:if(this.inAnonymousMode()){o.n=6;break}return o.p=2,o.n=3,r(Bu.instance.updateDeviceField("customer_data_platform_id",e));case 3:this.invokeStateHandler(Tm.CUSTOMER_DATA_PLATFORM_ID_SET,!0),o.n=5;break;case 4:o.p=4,i=o.v,this.invokeStateHandler(Tm.CUSTOMER_DATA_PLATFORM_ID_SET,!1,i);case 5:o.n=7;break;case 6:return Wn.info("Unable to set CDP ID in anonymous mode",{deviceId:null===(n=Kr.getDevice())||void 0===n?void 0:n.id,anonymousMode:!0}),a=new so,this.invokeStateHandler(Tm.CUSTOMER_DATA_PLATFORM_ID_SET,!1,a),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=Cs(le.ANONYMOUS_MODE_CAPABILITY),t=Cs(le.THIRD_PARTY_TRANSACTIONS);return e&&t}},{key:"refetchConfig",value:function(){return S((function(e){for(;;)switch(e.n){case 0:if(!this.instance.isSDKInitialized){e.n=1;break}return e.n=1,r(Promise.all([Hu.instance.fetchProducts(),Uu.instance.fetchPaywalls().then((e=>$u.instance.fetchCampaignRules(e)))]));case 1:return e.a(2)}}),null,this,null,Promise)}}])}();Fm.instance=new Fm;var Rm=function(){return c((function e(t={}){var n,a,i,r,o;s(this,e),this.id=null!==(n=t.id)&&void 0!==n?n:"",this.name=null!==(a=t.name)&&void 0!==a?a:"",this.steps=null!==(i=t.steps)&&void 0!==i?i:[],this.screens=null!==(r=t.screens)&&void 0!==r?r:[],this.resumeFromBookmark=Boolean(t.resume_from_bookmark),this.transition=null!==(o=t.transition)&&void 0!==o?o:"none"}),[{key:"allScreensAvailable",get:function(){return this.screens.length>0&&Hs(this.screens)}}])}(),Wm=function(){function e(t,n,a,i){var r,u;s(this,e),(u=o(this,e,[null!==(r=t.flow.object)&&void 0!==r?r:{}])).stepcrumbs=[],u.branchcrumbs=[],u.activeHandoffSequence=null,u.currentScreenState=null,u.isPaused=!1,u.timerStates={},u.campaign=t,u.component=n,u.context=i,u.manager=a,u.branchcrumbs=[],u.stepcrumbs=[],u.registerResolvers(i);var l=u.findStepByType(Xc);return l&&u.forward(l.id),u}return g(e,Rm),c(e,[{key:"registerResolvers",value:function(e){e&&new Sm(e),new Em,new xm,new Cm,new Im(this.campaign),wm.shared.registerNamespaceResolver("Flow",(e=>{switch(e){case"Flow.stepcrumbs":return this.stepcrumbs.map((e=>e.id));case"Flow.branchcrumbs":return this.branchcrumbs;default:return}}))}},{key:"currentFlowStep",get:function(){return this.stepcrumbs.at(-1)}},{key:"nextStepAvailable",get:function(){return void 0!==this.nextFlowStep}},{key:"previousStepAvailable",get:function(){var e,t=!!this.previousFlowStep,n=!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to),a=this.stepcrumbs.slice(0,-1).some((e=>"screen"===e.type));return t&&n&&a}},{key:"previousFlowStep",get:function(){var e=this.stepcrumbs.length-2;return e>=0?this.stepcrumbs[e]:void 0}},{key:"nextFlowStep",get:function(){return this.nextStep(this.currentFlowStep)}},{key:"getStep",value:function(e){return this.steps.find((t=>t.id===e))}},{key:"findStepByType",value:function(e){return this.steps.find((t=>t.type===e))}},{key:"isStepActive",value:function(e){return!e.branch_tags||!e.branch_tags.length||e.branch_tags.some((e=>this.branchcrumbs.includes(e)))}},{key:"finished",value:function(){this.manager.finishFlow()}},{key:"back",value:function(){this.previousStepAvailable?this.backToPreviousScreenStep():Wn.debug("No previous step available")}},{key:"next",value:function(){var e=this.nextFlowStep;e&&this.forward(e.id)}},{key:"backToPreviousScreenStep",value:function(){var e;if(!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to)){for(var t=this.stepcrumbs.length-2;t>=0;t--){var n=this.stepcrumbs[t];if(this.stepcrumbs.pop(),"branch"===n.type&&this.branchcrumbs.length>0&&this.branchcrumbs.pop(),"screen"===n.type&&n.screen){var a,i,r=Bs(n.screen);return r&&this.component.flowNavigateToScreen(r,{transition:this.transition,direction:"backward"}),void(this.currentScreenState=null!==(a=null===(i=Xh.currentProvider)||void 0===i?void 0:i.state)&&void 0!==a?a:null)}}Wn.warn("No previous screen step found to return to")}else Wn.warn(`Not allowed to go back to ${this.previousFlowStep.id}`)}},{key:"forward",value:function(e){var t=this.getStep(e);if(t){if(this.isStepActive(t))switch(t.type){case Xc:case qc:return this.stepcrumbs.push(t),void this.executeLifecycle(t,em);case Yc:return void this.handleBranchStep(t);case Kc:return void this.handleScreenStep(t);case Jc:return}}else Wn.error(`No step found with id: ${e}`)}},{key:"pause",value:function(){var e;this.isPaused?Wn.info("Flow is already paused"):(this.isPaused=!0,this.pausedStepID=null===(e=this.currentFlowStep)||void 0===e?void 0:e.id,Wn.info("Flow paused"))}},{key:"resumeFromPause",value:function(){if(this.isPaused)if(this.isPaused=!1,this.pausedStepID){var e=this.pausedStepID;this.pausedStepID=void 0,Wn.info(`Flow resumed from step ${e}`),this.forward(e)}else Wn.warn("No step to resume from");else Wn.info("Flow is not paused")}},{key:"executeLifecycle",value:function(e,t,n){var a=e.actions[t];a&&this.executeFullLifecycles(a,n)}},{key:"lifecycles",value:function(e){if(this.currentFlowStep){var t=this.currentFlowStep.actions[e];if(t)return t;Wn.info(`No actions found for button ${e} on step ${this.currentFlowStep.id}`)}}},{key:"triggerActions",value:function(e,t,n){var a=this.lifecycles(e);a&&(this.currentButton=t,this.executeFullLifecycles(a,n))}},{key:"executeFullLifecycles",value:function(e,t){for(var n,a=m(e);!(n=a()).done;){var i=n.value;[i.before,i.action,i.after].forEach((e=>null==e?void 0:e.forEach((e=>this.shouldRun(e)&&this.performAction(e,t)))))}}},{key:"triggerBeforeActions",value:function(e,t,n){var a=this.lifecycles(e);if(a){this.currentButton=t;for(var i,r=m(a);!(i=r()).done;){var o;null===(o=i.value.before)||void 0===o||o.forEach((e=>this.shouldRun(e)&&this.performAction(e,n)))}}}},{key:"triggerAfterActions",value:function(e,t,n){var a=this.lifecycles(e);if(a){this.currentButton=t;for(var i,r=m(a);!(i=r()).done;){var o;null===(o=i.value.after)||void 0===o||o.forEach((e=>this.shouldRun(e)&&this.performAction(e,n)))}}}},{key:"currentStepHasHoistedPrimaryActions",value:function(e){var t=this.lifecycles(e);return!!t&&t.some((e=>{var t;return null===(t=e.action)||void 0===t?void 0:t.length}))}},{key:"shouldRun",value:function(e){return!e.conditions||e.conditions.every((e=>wm.shared.evaluate(e)))}},{key:"performAction",value:function(e,t){var n;if(this.currentFlowStep){var a=(null!==(n=e.parameters)&&void 0!==n&&n.delay?+e.parameters.delay:0)||0,i=n=>{var a,i,r,o,s,u,l;if((null===(a=this.currentFlowStep)||void 0===a?void 0:a.id)===n)switch(e.function){case Vc.BACK:this.back();break;case Vc.NEXT:null!==(i=e.parameters)&&void 0!==i&&i.step?this.forward(e.parameters.step):this.next();break;case Vc.NAVIGATE:var d;if(null!==(r=e.parameters)&&void 0!==r&&r.step)(null===(d=this.previousFlowStep)||void 0===d?void 0:d.id)===e.parameters.step?this.back():this.forward(e.parameters.step);else this.next();break;case Vc.FINISHED:case Vc.DISMISS:this.finished();break;case Vc.EXIT:var h=this.steps.find((e=>e.type===qc));h&&this.forward(h.id);break;case Vc.PAUSE:this.pause();break;case Vc.RESUME:this.resumeFromPause();break;case Vc.HANDOFF:if(null!==(o=e.parameters)&&void 0!==o&&o.handoffTag)if(this.manager.handoffStepHandler)if(e.parameters.handoffData)Wn.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} ${JSON.stringify(e.parameters.handoffData)}`),this.manager.handoffStepHandler(e.parameters.handoffTag,e.parameters.handoffData);else if(t)Wn.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} ${JSON.stringify(t)}`),this.manager.handoffStepHandler(e.parameters.handoffTag,t);else if(e.parameters.handoffFormId){var c=this.getFormData();e.parameters.handoffTag===Qc?this.flowHandoffFormSequence():this.manager.handoffStepHandler(e.parameters.handoffTag,c)}else Wn.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} and no data`),this.manager.handoffStepHandler(e.parameters.handoffTag);else Wn.debug("No handoffStepHandler found",e);break;case Vc.LOG:var m;if(null!==(s=e.parameters)&&void 0!==s&&s.eventName)Wn.info(`logEvent → ${e.parameters.eventName}`);else Wn.warn(`Missing 'eventName' in logEvent action ${null!==(m=e.id)&&void 0!==m?m:"unknown"}`);break;case Vc.TRACK:var f;if(null!==(u=e.parameters)&&void 0!==u&&u.eventName)Wn.info(`trackEvent → ${e.parameters.eventName}`);else Wn.warn(`Missing 'eventName' in logEvent action ${null!==(f=e.id)&&void 0!==f?f:"unknown"}`);break;case Vc.SET_VIDEO:null!==(l=e.parameters)&&void 0!==l&&l.name&&e.parameters.url?Xh.setAppSuppliedVideoDetails({name:e.parameters.name,url:e.parameters.url}):Wn.warn("Missing name, url for setting video details");break;case Vc.BLOCK_BACK:var v,p=null===(v=e.parameters)||void 0===v?void 0:v.step,g=p?this.getStep(p):void 0;g?g.allow_back_to=!1:this.currentFlowStep?this.currentFlowStep.allow_back_to=!1:Wn.warn("Missing step for blocking back");break;case Vc.FLOW_EVENT:var y,b=new Am(this.manager),w=Object.fromEntries(Object.entries(null!==(y=e.parameters)&&void 0!==y?y:{}).map((([e,t])=>[e,b.interpolateDeep(t)])));this.manager.eventHandler?this.manager.eventHandler(w):Wn.warn("Missing event handler",w);break;case Vc.FLOW_ENABLED:Xh.setUserInteractionEnabled(!0);break;case Vc.FLOW_DISABLED:Xh.setUserInteractionEnabled(!1);break;case Vc.SET_TAGS:e.parameters&&(Xh.setUserTags(e.parameters),Object.entries(e.parameters).forEach((([e,t])=>{Fm.setCustomerAttribute(e,t)})));break;default:Wn.warn(`Missing action handler for ${e.function}`,e)}else Wn.debug(`Skipped action for stale flow step ${n}`)};a?setTimeout(i.bind(this,this.currentFlowStep.id),a):i(this.currentFlowStep.id)}else Wn.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,a=m(this.steps.slice(t+1));!(n=a()).done;){var i=n.value;if(this.isStepActive(i))return i}Wn.debug(`No active next step found after ${e.id}`)}else Wn.error(`Could not find next step for step ${e.id}`)}else Wn.error("Next step not found")}},{key:"handleScreenStep",value:function(e){var t,n=Bs(null!==(t=e.screen)&&void 0!==t?t:"");e.screen&&n&&this.campaign?(this.stepcrumbs.push(e),this.component.flowNavigateToScreen(n,{transition:this.transition,direction:"forward"})):Wn.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 a=n[t],i=a[0],r=a[1];if(r)for(var o,s=m(r);!(o=s()).done;){var u=o.value;if(u.action)for(var l,d=m(u.action);!(l=d()).done;){var h,c,f=l.value;if(this.shouldRun(f))return this.branchcrumbs.push(i),null===(h=u.before)||void 0===h||h.forEach((e=>{this.performAction(e)})),u.action.forEach((e=>{this.shouldRun(e)&&this.performAction(e)})),void(null===(c=u.after)||void 0===c||c.forEach((e=>{this.performAction(e)})))}else Wn.warn(`No actions defined for branch tag ${i}`)}}Wn.warn(`No matching branch condition matched for step ${e.id}`)}},{key:"getFormData",value:function(){var e,t;return f({},null!==(e=null===(t=Xh.currentProvider)||void 0===t||null===(t=t.state)||void 0===t?void 0:t.formStates)&&void 0!==e?e:{})}},{key:"flowHandoffFormSequence",value:function(){var e,t=null===(e=this.currentScreenState)||void 0===e?void 0:e.formStates;if(t){var n=Object.keys(t).sort();if(0!==n.length){var a=n.filter((e=>!0===t[e]));if(0===a.length)return Wn.info("No eligible handoff keys after filtering"),void this.manager.resume();this.activeHandoffSequence={formStates:f({},t),remainingKeys:[...a]},this.resumeNextHandoff()}else Wn.warn("formStates is empty, no handoffs to perform")}else Wn.warn("No formStates available for handoff sequence")}},{key:"resumeNextHandoff",value:function(){var e,t,n=this.activeHandoffSequence;if(!n)return Wn.warn("No active handoff sequence to resume"),void this.manager.resume();if(0===n.remainingKeys.length)return Wn.info("All handoffs in the sequence are complete"),this.activeHandoffSequence=null,void this.manager.resume();var a=n.remainingKeys.shift(),i=n.formStates[a];Wn.debug(`Starting handoff for ${a} → ${String(i)}`),this.activeHandoffSequence=n;var r=`${a}`;null===(e=(t=this.manager).handoffStepHandler)||void 0===e||e.call(t,r,void 0)}}])}(),Nm=function(){function e(){s(this,e),this.flowOpen=!1,this.lastAnimatedFlowProgress=new Map,this.navGraphCache=new WeakMap}return c(e,[{key:"resume",value:function(){e.resume()}},{key:"presentFlow",value:function(e,t,n){var a=new Wm(e,t,this,n);return this.flowOpen=!0,this.currentFlow=a,a}},{key:"finishFlow",value:function(){this.flowOpen=!1,this.currentFlow=void 0,this.lastAnimatedFlowProgress.clear()}},{key:"getLastAnimatedFlowProgress",value:function(e){var t;return null!==(t=this.lastAnimatedFlowProgress.get(e))&&void 0!==t?t:0}},{key:"setLastAnimatedFlowProgress",value:function(e,t){this.currentFlow&&this.lastAnimatedFlowProgress.set(e,t)}},{key:"getCurrentFlowProgress",value:function(e){if(!this.currentFlow)return 1;if(!this.currentFlow.currentFlowStep)return 0;var t=this.currentFlow.steps.filter((e=>e.type===Kc));if(0===t.length)return 0;var n=this.currentFlow.stepcrumbs.filter((e=>e.type===Kc));if(0===n.length)return 0;var a=this.buildNavGraph(this.currentFlow),i=this.currentFlow.currentFlowStep,r=this.findBranchPoint(t,a),o=0;if(r)o=this.calculateBranchingProgress(n,t,i,r,a);else{var s=t.findIndex((e=>e.id===i.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,a=m(e);!(n=a()).done;){var i=n.value;if(this.hasBranching(i,e,t))return i}return null}},{key:"calculateBranchingProgress",value:function(e,t,n,a,i){var r=e.length,o=t.findIndex((e=>e.id===a.id)),s=e.findIndex((e=>e.id===a.id)),u=t.findIndex((e=>e.id===n.id));if(-1===s||n.id===a.id)return(u+1)/(o+2);var l=this.countForwardScreens(n,t,i),d=r+l;return Wn.debug(`Branching progress: visited=${r}, remaining=${l}, total=${d}, step=${n.id}`),r/d}},{key:"countForwardScreens",value:function(e,t,n){var a=t.findIndex((t=>t.id===e.id));if(-1===a)return 0;var i=new Set,r=0,o=(e,s)=>{if(!i.has(e)){i.add(e);var u=(n.get(e)||[]).filter((e=>{var n=t.findIndex((t=>t.id===e));return n>a}));if(0!==u.length)for(var l,d=m(u);!(l=d()).done;){var h=l.value;o(h,s+1)}else r=Math.max(r,s)}};return o(e.id,0),r}},{key:"hasBranching",value:function(e,t,n){var a=t.findIndex((t=>t.id===e.id));if(-1===a)return!1;var i=(n.get(e.id)||[]).filter((e=>{var n=t.findIndex((t=>t.id===e));return n>a}));return i.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 a,i=null===(a=t.parameters)||void 0===a?void 0:a.step;i&&(n.has(e.id)||n.set(e.id,new Set),n.get(e.id).add(i))}}))}))}))}));var a=new Map;return n.forEach(((e,t)=>{a.set(t,Array.from(e))})),this.navGraphCache.set(e,a),a}},{key:"getCurrentFlowStepAutoAdvanceDelay",value:function(){var e,t,n=null===(e=this.currentFlow)||void 0===e?void 0:e.currentFlowStep;if(!n)return null;var a=null===(t=n.actions)||void 0===t?void 0:t[tm];if(!a)return null;for(var i,r=m(a);!(i=r()).done;)for(var o,s,u=m(null!==(o=i.value.action)&&void 0!==o?o:[]);!(s=u()).done;){var l,d=s.value;if((d.function===Vc.NAVIGATE||d.function===Vc.NEXT)&&null!=(null===(l=d.parameters)||void 0===l?void 0:l.delay)){var h=d.parameters.delay,c=Number(h);if(!isNaN(c)&&c>0)return c/1e3}}return null}}],[{key:"instance",get:function(){return e._instance||(e._instance=new e),e._instance}},{key:"registerStepHandoff",value:function(e){this.instance.handoffStepHandler=e}},{key:"registerEventHandler",value:function(e){this.instance.eventHandler=e}},{key:"resume",value:function(){var t=e.instance,n=t.flowOpen,a=t.currentFlow;if(n&&a&&a.currentFlowStep){if(a.activeHandoffSequence)return Wn.debug(`Resuming flow at handoff sequence ${a.currentFlowStep.id}`),void a.resumeNextHandoff();Wn.debug(`Resuming flow at step ${a.currentFlowStep.id}`),a.executeLifecycle(a.currentFlowStep,"__resume__")}else Wn.warn("Cannot resume: no active flow or current step")}},{key:"finish",value:function(){var t=e.instance,n=t.flowOpen,a=t.currentFlow;n&&a&&a.currentFlowStep?(Wn.debug(`Finishing flow programmatically at step ${a.currentFlowStep.id}`),a.finished()):Wn.debug("Cannot finish: no active flow or current step")}},{key:"pause",value:function(){var t=e.instance,n=t.flowOpen,a=t.currentFlow;n&&a&&a.currentFlowStep?!0===a.resumeFromBookmark?a.pause():Wn.warn("This flow cannot be paused"):Wn.warn("Cannot pause: no active flow or current step")}},{key:"isFlowOpen",value:function(){return e.instance.flowOpen}},{key:"getLastAnimatedFlowProgress",value:function(e){return this.instance.getLastAnimatedFlowProgress(e)}},{key:"setLastAnimatedFlowProgress",value:function(e,t){this.instance.setLastAnimatedFlowProgress(e,t)}},{key:"getCurrentFlowProgress",value:function(e){return this.instance.getCurrentFlowProgress(e)}},{key:"getCurrentFlowStepAutoAdvanceDelay",value:function(){return this.instance.getCurrentFlowStepAutoAdvanceDelay()}}])}();var Om=e=>{var t;return S((function(n){for(;;)if(0===n.n)return t=new Set(Array.from(document.fonts.values()).map((e=>e.family))),e.forEach((e=>{var n=jm(e);if(!t.has(n)){var a=new FontFace(n,`url(${e.file})`);document.fonts.add(a)}})),n.a(2,document.fonts.ready.then())}),null,null,null,Promise)};function jm(e){return`${e.family}-${e.style}`.replace(/ /g,"")}function $m(e,t,n){var a,i,r,o,s,u,l,d;if("undefined"==typeof window||!e||!t)return Wn.debug("Swipe detection is not supported in this environment."),{destroy(){},updateOptions(){}};var h={minDistance:null!==(a=null==n?void 0:n.minDistance)&&void 0!==a?a:30,maxDuration:null!==(i=null==n?void 0:n.maxDuration)&&void 0!==i?i:600,lockAxis:null===(r=null==n?void 0:n.lockAxis)||void 0===r||r,preventScrollOnSwipe:null!==(o=null==n?void 0:n.preventScrollOnSwipe)&&void 0!==o&&o,pointerTypes:null!==(s=null==n?void 0:n.pointerTypes)&&void 0!==s?s:["touch"],passiveListeners:null===(u=null==n?void 0:n.passiveListeners)||void 0===u||u,axisHint:null!==(l=null==n?void 0:n.axisHint)&&void 0!==l?l:"y",edgeLeakThreshold:null!==(d=null==n?void 0:n.edgeLeakThreshold)&&void 0!==d?d:24},c=e.style.touchAction;h.preventScrollOnSwipe&&(e.style.touchAction="none");var m=null,f=0,v=0,p=0,g=0,y=0,b=null,w=null,k=!1,S=!1,E=!1,M=e=>{try{var t=window.getComputedStyle(e);if(!t)return!1;var n=t.overflowY;if("auto"!==n&&"scroll"!==n)return!1;var a=e;return a.scrollHeight>a.clientHeight}catch(e){return!1}},P=e=>h.pointerTypes.includes(e.pointerType),T=t=>{var n=t.composedPath?t.composedPath()[0]:t.target;if(P(t)&&null===m){m=t.pointerId,f=p=t.clientX,v=g=t.clientY,y=performance.now(),b=null,E=!1,k=!1,S=!1,(w="y"===h.axisHint?((e,t)=>{for(var n=e;n&&n!==t&&n instanceof HTMLElement;){var a,i;if(M(n))return n;n=n.parentElement||(null!==(a=null===(i=n.parentNode)||void 0===i?void 0:i.host)&&void 0!==a?a:null)}return null})(n,e):null)||(S=!0);try{var a;null==e||null===(a=e.setPointerCapture)||void 0===a||a.call(e,t.pointerId)}catch(e){try{var i;null==n||null===(i=n.setPointerCapture)||void 0===i||i.call(n,t.pointerId)}catch(e){}}}},_=e=>{if(e.pointerId===m&&P(e)){if(p=e.clientX,g=e.clientY,h.lockAxis&&!b){var n=Math.abs(p-f),a=Math.abs(g-v);(n>2||a>2)&&(b=a>=n?"y":"x")}if("y"===h.axisHint&&("y"===b||!h.lockAxis)){var i=g-v,r=i<0?"up":"down",o=Math.abs(i),s=performance.now()-y,u=o/Math.max(s,1),l=o>=h.minDistance||u>.5;if(w)if(l)S=!0;else if(((e,t)=>!!e&&("down"===t?e.scrollTop>0:e.scrollTop+e.clientHeight<e.scrollHeight-1))(w,r)){if(!(("down"===r&&w.scrollTop<=50||"up"===r&&w.scrollTop+w.clientHeight>=w.scrollHeight-50)&&u>.3))return void(k=!0);S=!0}else S=!0;var d=!w||o>=h.edgeLeakThreshold;if(!E&&!k&&S&&d&&o>=h.minDistance){E=!0;var c=performance.now(),M={direction:"up"===r?"up":"down",distanceX:p-f,distanceY:i,absX:Math.abs(p-f),absY:o,duration:c-y,velocity:o/Math.max(c-y,1),startX:f,startY:v,endX:p,endY:g,startedAt:y,endedAt:c,originalEvent:e};t(M)}}}},D=e=>{if(e.pointerId===m)if(P(e))if(w)A();else if(E||k)A();else{var n,a=performance.now(),i=a-y,r=p-f,o=g-v,s=Math.abs(r),u=Math.abs(o),l="x"===(n=h.lockAxis&&b?b:"x"===h.axisHint?"x":"y"===h.axisHint?"y":s>=u?"x":"y")?s:u,d=i<=h.maxDuration,c=h.minDistance;if(w&&"y"===n&&S&&(c+=h.edgeLeakThreshold),d&&l>=c){var M;M="x"===n?r>0?"right":"left":o>0?"down":"up";var T=l/Math.max(i,1);t({direction:M,distanceX:r,distanceY:o,absX:s,absY:u,duration:i,velocity:T,startX:f,startY:v,endX:p,endY:g,startedAt:y,endedAt:a,originalEvent:e})}A()}else A()},A=()=>{m=null,b=null,y=0,w=null,S=!1,k=!1,E=!1},x=!!h.passiveListeners&&{passive:!0},C=h.passiveListeners?{passive:!0,capture:!0}:{capture:!0};e.addEventListener("pointerdown",T,C),e.addEventListener("pointermove",_,x),e.addEventListener("pointerup",D,x),e.addEventListener("pointercancel",D,x),e.addEventListener("lostpointercapture",D,x);return{destroy:()=>{e.removeEventListener("pointerdown",T,C),e.removeEventListener("pointermove",_,x),e.removeEventListener("pointerup",D,x),e.removeEventListener("pointercancel",D,x),e.removeEventListener("lostpointercapture",D,x),h.preventScrollOnSwipe&&(e.style.touchAction=c),A()},updateOptions:t=>{Object.assign(h,t),"boolean"==typeof t.preventScrollOnSwipe&&(t.preventScrollOnSwipe?e.style.touchAction="none":e.style.touchAction=c)}}}var zm,Bm,Hm,Um,Gm,Vm,Xm,Km,Ym,qm,Jm,Qm=e=>e,Zm=function(){function n(e,t,a){var i;return s(this,n),(i=o(this,n)).pages=[],i.currentOffset=0,i.presentationStyle="fullscreen",i.formFactor=uu(),i.timeSpentOnPaywall=0,i.animation={transition:"none",direction:"forward"},i._originalBodyStyles={},i._originalDocumentStyles={},i._savedScrollY=0,i._sheetDragStartY=0,i._sheetIsDragging=!1,i._dismissThreshold=100,i.type=e,i.value=t,i.context=a,i.setPaywallData(),w(i,i)}return g(n,e.LitElement),c(n,[{key:"setPaywallData",value:function(){var e=Pu(this.value,this.type);this.paywall=e.paywall,this.campaign=e.campaign}},{key:"getPresentationStyle",value:function(e){var t,n,a=null==e||null===(t=e.template)||void 0===t||null===(t=t.initialState)||void 0===t?void 0:t.presentation_style;return(n=a)&&cc.has(n)?"sheet"===n?"fullscreen":n:"fullscreen"}},{key:"isHalfSheet",get:function(){return"compact_sheet"===this.presentationStyle}},{key:"connectedCallback",value:function(){var e;T(n,"connectedCallback",this)([]),null!==(e=window.TVJS)&&void 0!==e&&e.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=this),document.addEventListener("keydown",this.handleKeyDownEvent.bind(this)),this._swipeHandler=$m(this,this.handleSwipeEvent.bind(this),{axisHint:"y",lockAxis:!0,minDistance:25,edgeLeakThreshold:15,preventScrollOnSwipe:!1,pointerTypes:["touch"]}),this.presentationStyle=this.getPresentationStyle(this.paywall),this.setOriginalStyles()}},{key:"disconnectedCallback",value:function(){var e,t;T(n,"disconnectedCallback",this)([]),Kr.clearLaunchId(),null!==(e=window.TVJS)&&void 0!==e&&e.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=document.body),document.removeEventListener("keydown",this.handleKeyDownEvent.bind(this)),ju.getInstance().removeAllListeners(kn),this.restoreStyles(),null===(t=this._halfSheetAbortController)||void 0===t||t.abort(),this._swipeHandler.destroy()}},{key:"setOriginalStyles",value:function(){"television"===this.formFactor&&(this._originalBodyStyles.overflow=document.body.style.overflow,document.body.style.overflow="hidden"),this._originalBodyStyles.background=document.body.style.background,"phone"===this.formFactor&&(this._originalBodyStyles["overscroll-behavior"]=document.body.style.overscrollBehavior?document.body.style.overscrollBehavior:null,this._originalDocumentStyles["overscroll-behavior"]=document.documentElement.style.overscrollBehavior?document.documentElement.style.overscrollBehavior:null,document.body.style.overscrollBehavior="none",document.documentElement.style.overscrollBehavior="none"),this.isHalfSheet&&(this._savedScrollY=window.scrollY,this._originalBodyStyles.position=document.body.style.position||null,this._originalBodyStyles.top=document.body.style.top||null,this._originalBodyStyles.width=document.body.style.width||null,document.body.style.position="fixed",document.body.style.top=`-${this._savedScrollY}px`,document.body.style.width="100%")}},{key:"restoreStyles",value:function(){Object.entries(this._originalBodyStyles).forEach((([e,t])=>{null!==t?document.body.style.setProperty(e,t):document.body.style.removeProperty(e)})),Object.entries(this._originalDocumentStyles).forEach((([e,t])=>{null!==t?document.documentElement.style.setProperty(e,t):document.documentElement.style.removeProperty(e)})),this._savedScrollY>0&&(window.scrollTo(0,this._savedScrollY),this._savedScrollY=0)}},{key:"handleKeyDownEvent",value:function(e){!this.flow||10009!==e.keyCode&&"Backspace"!==e.key&&"GoBack"!==e.key||this.flow.triggerActions(um)}},{key:"handleSwipeEvent",value:function({direction:e}){var t;if("down"===e)null===(t=this.flow)||void 0===t||t.triggerActions("__swipe_down__");else if("up"===e){var n;null===(n=this.flow)||void 0===n||n.triggerActions("__swipe_up__")}}},{key:"setupHalfSheetDragTracking",value:function(){var e,t,n;null===(e=this._halfSheetAbortController)||void 0===e||e.abort(),this._halfSheetAbortController=new AbortController;var a=this._halfSheetAbortController.signal,i=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".nami-half-sheet-container"),r=null===(n=this.shadowRoot)||void 0===n?void 0:n.querySelector(".nami-half-sheet-content");if(i&&r){i.addEventListener("touchstart",(e=>{r.scrollTop>0||(this._sheetDragStartY=e.touches[0].clientY,this._sheetIsDragging=!0)}),{passive:!0,signal:a}),i.addEventListener("touchmove",(e=>{if(this._sheetIsDragging){var t=e.touches[0].clientY-this._sheetDragStartY;t>0&&(i.style.transform=`translateY(${t}px)`,i.style.transition="none",e.preventDefault())}}),{passive:!1,signal:a}),i.addEventListener("touchend",(()=>{if(this._sheetIsDragging){this._sheetIsDragging=!1;var e,t,n=i.style.transform.match(/translateY\((\d+(?:\.\d+)?)px\)/);if((n?parseFloat(n[1]):0)>this._dismissThreshold)if(null!==(e=null===(t=this.flow)||void 0===t?void 0:t.currentStepHasHoistedPrimaryActions("__swipe_down__"))&&void 0!==e&&e){var a;i.style.transform="translateY(0)",i.style.transition="transform 0.2s ease-out",null===(a=this.flow)||void 0===a||a.triggerActions("__swipe_down__")}else{var r;i.style.transform="translateY(100%)",i.style.transition="transform 0.2s ease-in";var o=null===(r=this.shadowRoot)||void 0===r?void 0:r.querySelector(".nami-half-sheet-backdrop");o&&o.classList.add("nami-dismissing"),setTimeout((()=>{var e;null===(e=this.flow)||void 0===e||e.finished()}),200)}else i.style.transform="translateY(0)",i.style.transition="transform 0.2s ease-out"}}),{signal:a})}}},{key:"setupHalfSheetFocusTrap",value:function(){var e,t,n=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(".nami-half-sheet-container");if(n){n.focus();var a=null===(t=this._halfSheetAbortController)||void 0===t?void 0:t.signal;n.addEventListener("keydown",(e=>{if("Tab"===e.key){var t=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(0!==t.length){var a,i,r=t[0],o=t[t.length-1];if(e.shiftKey)document.activeElement!==r&&(null===(a=this.shadowRoot)||void 0===a?void 0:a.activeElement)!==r||(e.preventDefault(),o.focus());else document.activeElement!==o&&(null===(i=this.shadowRoot)||void 0===i?void 0:i.activeElement)!==o||(e.preventDefault(),r.focus())}}}),a?{signal:a}:void 0)}}},{key:"firstUpdated",value:function(){this.timeSpentOnPaywall=Date.now(),Os(this.campaign)&&(this.flow=Nm.instance.presentFlow(this.campaign,this,this.context)),this.isHalfSheet&&this.updateComplete.then((()=>{this.setupHalfSheetDragTracking(),this.setupHalfSheetFocusTrap()}))}},{key:"updated",value:function(e){T(n,"updated",this)([e]),this.isHalfSheet&&e.has("presentationStyle")&&(this.setupHalfSheetDragTracking(),this.setupHalfSheetFocusTrap())}},{key:"getAnimationStyles",value:function(e){var t="backward"===this.animation.direction?-1:1;switch(this.animation.transition){case"verticalSlide":return`transform: translateY(${100*(e-this.currentOffset)*t}vh);`;case"slide":return`transform: translateX(${100*(e-this.currentOffset)*t}vw);`;case"fade":return`opacity: ${e===this.currentOffset?1:0};`;default:return""}}},{key:"updatePages",value:function(e){var t;return S((function(n){for(;;)switch(n.n){case 0:if(0!==this.pages.length&&"none"!==this.animation.transition){n.n=1;break}return this.pages=[e],n.a(2);case 1:if((null==(t=this.pages[this.pages.length-1])?void 0:t.id)!==e.id){n.n=2;break}return n.a(2);case 2:return this.pages=[t,e],this.currentOffset=0,n.n=3,r(this.updateComplete);case 3:requestAnimationFrame((()=>{this.currentOffset=1,setTimeout((()=>{this.pages=[e],this.currentOffset=0,this.paywall=e}),250)}));case 4:return n.a(2)}}),null,this,null,Promise)}},{key:"flowNavigateToScreen",value:function(e,t){var n,a,i,o;return S((function(s){for(;;)switch(s.n){case 0:if(null!==(n=this.flow)&&void 0!==n&&n.previousFlowStep&&this.flow.executeLifecycle(this.flow.previousFlowStep,nm),i=this.presentationStyle,o=this.getPresentationStyle(e),"fullscreen"!==i||"compact_sheet"!==o){s.n=1;break}console.warn("Unsupported transition: fullscreen → compact_sheet. Presenting as fullscreen."),s.n=4;break;case 1:if("compact_sheet"!==i||"fullscreen"!==o&&"sheet"!==o){s.n=3;break}return s.n=2,r(this.animateHalfSheetExpand());case 2:this.presentationStyle="fullscreen",s.n=4;break;case 3:this.presentationStyle=o;case 4:return this.animation=t,s.n=5,r(this.updatePages(e));case 5:null!==(a=this.flow)&&void 0!==a&&a.currentFlowStep&&this.flow.executeLifecycle(this.flow.currentFlowStep,tm);case 6:return s.a(2)}}),null,this,null,Promise)}},{key:"animateHalfSheetExpand",value:function(){var e,t;return S((function(n){for(;;)switch(n.n){case 0:if(t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(".nami-half-sheet-container")){n.n=1;break}return n.a(2);case 1:return t.classList.add("nami-expanding"),n.n=2,r(new Promise((e=>setTimeout(e,300))));case 2:return n.a(2)}}),null,this,null,Promise)}},{key:"getSelectedSlideIndexForCurrentCarousel",value:function(){return Xh.getSelectedSlideIndex()}},{key:"renderFlow",value:function(){return"undefined"==typeof document?e.html(zm||(zm=Qm``)):this.isHalfSheet?this.renderHalfSheet():e.html(Bm||(Bm=Qm`
91
+ `)),yc=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)},bc=globalThis,wc=bc.ShadowRoot&&(void 0===bc.ShadyCSS||bc.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,kc=Symbol(),Sc=new WeakMap,Ec=function(){return c((function e(t,n,a){if(s(this,e),this._$cssResult$=!0,a!==kc)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}),[{key:"styleSheet",get:function(){var e=this.o,t=this.t;if(wc&&void 0===e){var n=void 0!==t&&1===t.length;n&&(e=Sc.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Sc.set(t,e))}return e}},{key:"toString",value:function(){return this.cssText}}])}(),Mc=(e,t)=>{if(wc)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(var n,a=m(t);!(n=a()).done;){var i=n.value,r=document.createElement("style"),o=bc.litNonce;void 0!==o&&r.setAttribute("nonce",o),r.textContent=i.cssText,e.appendChild(r)}},Pc=wc?e=>e:e=>e instanceof CSSStyleSheet?(e=>{for(var t,n="",a=m(e.cssRules);!(t=a()).done;){n+=t.value.cssText}return(e=>new Ec("string"==typeof e?e:e+"",void 0,kc))(n)})(e):e,Tc=Object.is,_c=Object.defineProperty,Dc=Object.getOwnPropertyDescriptor,Ac=Object.getOwnPropertyNames,xc=Object.getOwnPropertySymbols,Cc=Object.getPrototypeOf,Ic=globalThis,Lc=Ic.trustedTypes,Fc=Lc?Lc.emptyScript:"",Rc=Ic.reactiveElementPolyfillSupport,Wc=(e,t)=>e,Nc={toAttribute(e,t){switch(t){case Boolean:e=e?Fc:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){var n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},Oc=(e,t)=>!Tc(e,t),jc={attribute:!0,type:String,converter:Nc,reflect:!1,useDefault:!1,hasChanged:Oc};null!==(fc=Symbol.metadata)&&void 0!==fc||(Symbol.metadata=Symbol("metadata")),null!==(vc=Ic.litPropertyMetadata)&&void 0!==vc||(Ic.litPropertyMetadata=new WeakMap);var $c=function(){function e(){var t;return s(this,e),(t=o(this,e))._$Ep=void 0,t.isUpdatePending=!1,t.hasUpdated=!1,t._$Em=null,t._$Ev(),t}return g(e,D(HTMLElement)),c(e,[{key:"_$Ev",value:function(){var e;this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),null===(e=this.constructor.l)||void 0===e||e.forEach((e=>e(this)))}},{key:"addController",value:function(e){var t,n;(null!==(t=this._$EO)&&void 0!==t?t:this._$EO=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&(null===(n=e.hostConnected)||void 0===n||n.call(e))}},{key:"removeController",value:function(e){var t;null===(t=this._$EO)||void 0===t||t.delete(e)}},{key:"_$E_",value:function(){for(var e,t=new Map,n=m(this.constructor.elementProperties.keys());!(e=n()).done;){var a=e.value;this.hasOwnProperty(a)&&(t.set(a,this[a]),delete this[a])}t.size>0&&(this._$Ep=t)}},{key:"createRenderRoot",value:function(){var e,t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return Mc(t,this.constructor.elementStyles),t}},{key:"connectedCallback",value:function(){var e,t;null!==(e=this.renderRoot)&&void 0!==e||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$EO)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}},{key:"enableUpdating",value:function(e){}},{key:"disconnectedCallback",value:function(){var e;null===(e=this._$EO)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}},{key:"attributeChangedCallback",value:function(e,t,n){this._$AK(e,n)}},{key:"_$ET",value:function(e,t){var n=this.constructor.elementProperties.get(e),a=this.constructor._$Eu(e,n);if(void 0!==a&&!0===n.reflect){var i,r=(void 0!==(null===(i=n.converter)||void 0===i?void 0:i.toAttribute)?n.converter:Nc).toAttribute(t,n.type);this._$Em=e,null==r?this.removeAttribute(a):this.setAttribute(a,r),this._$Em=null}}},{key:"_$AK",value:function(e,t){var n=this.constructor,a=n._$Eh.get(e);if(void 0!==a&&this._$Em!==a){var i,r,o,s=n.getPropertyOptions(a),u="function"==typeof s.converter?{fromAttribute:s.converter}:void 0!==(null===(i=s.converter)||void 0===i?void 0:i.fromAttribute)?s.converter:Nc;this._$Em=a;var l=u.fromAttribute(t,s.type);this[a]=null!==(r=null!=l?l:null===(o=this._$Ej)||void 0===o?void 0:o.get(a))&&void 0!==r?r:l,this._$Em=null}}},{key:"requestUpdate",value:function(e,t,n){if(void 0!==e){var a,i,r=this.constructor,o=this[e];if(null!=n||(n=r.getPropertyOptions(e)),!((null!==(a=n.hasChanged)&&void 0!==a?a:Oc)(o,t)||n.useDefault&&n.reflect&&o===(null===(i=this._$Ej)||void 0===i?void 0:i.get(e))&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}},{key:"C",value:function(e,t,{useDefault:n,reflect:a,wrapped:i},r){var o,s,u;n&&!(null!==(o=this._$Ej)&&void 0!==o?o:this._$Ej=new Map).has(e)&&(this._$Ej.set(e,null!==(s=null!=r?r:t)&&void 0!==s?s:this[e]),!0!==i||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===a&&this._$Em!==e&&(null!==(u=this._$Eq)&&void 0!==u?u:this._$Eq=new Set).add(e))}},{key:"_$EP",value:function(){var e,t;return S((function(n){for(;;)switch(n.p=n.n){case 0:return this.isUpdatePending=!0,n.p=1,n.n=2,r(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,r(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=m(this._$Ep);!(t=n()).done;){var a=t.value,i=a[0],r=a[1];this[i]=r}this._$Ep=void 0}var o=this.constructor.elementProperties;if(o.size>0)for(var s,u=m(o);!(s=u()).done;){var l=s.value,d=l[0],h=l[1],c=h.wrapped,f=this[d];!0!==c||this._$AL.has(d)||void 0===f||this.C(d,void 0,h,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=jc){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){var n=Symbol(),a=this.getPropertyDescriptor(e,n,t);void 0!==a&&_c(this.prototype,e,a)}}},{key:"getPropertyDescriptor",value:function(e,t,n){var a,i=null!==(a=Dc(this.prototype,e))&&void 0!==a?a:{get(){return this[t]},set(e){this[t]=e}},r=i.get,o=i.set;return{get:r,set(t){var a=null==r?void 0:r.call(this);null!=o&&o.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(e){var t;return null!==(t=this.elementProperties.get(e))&&void 0!==t?t:jc}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty(Wc("elementProperties"))){var e=Cc(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty(Wc("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Wc("properties")))for(var e=this.properties,t=0,n=[...Ac(e),...xc(e)];t<n.length;t++){var a=n[t];this.createProperty(a,e[a])}var i=this[Symbol.metadata];if(null!==i){var r=litPropertyMetadata.get(i);if(void 0!==r)for(var o,s=m(r);!(o=s()).done;){var u=o.value,l=u[0],d=u[1];this.elementProperties.set(l,d)}}this._$Eh=new Map;for(var h,c=m(this.elementProperties);!(h=c()).done;){var f=h.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,a=m(new Set(e.flat(1/0).reverse()));!(n=a()).done;){var i=n.value;t.unshift(Pc(i))}else void 0!==e&&t.push(Pc(e));return t}},{key:"_$Eu",value:function(e,t){var n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}}])}();$c.elementStyles=[],$c.shadowRootOptions={mode:"open"},$c[Wc("elementProperties")]=new Map,$c[Wc("finalized")]=new Map,null!=Rc&&Rc({ReactiveElement:$c}),(null!==(pc=Ic.reactiveElementVersions)&&void 0!==pc?pc:Ic.reactiveElementVersions=[]).push("2.1.1");var zc={attribute:!0,type:String,converter:Nc,reflect:!1,hasChanged:Oc},Bc=(e=zc,t,n)=>{var a=n.kind,i=n.metadata,r=globalThis.litPropertyMetadata.get(i);if(void 0===r&&globalThis.litPropertyMetadata.set(i,r=new Map),"setter"===a&&((e=Object.create(e)).wrapped=!0),r.set(n.name,e),"accessor"===a){var o=n.name;return{set(n){var a=t.get.call(this);t.set.call(this,n),this.requestUpdate(o,a,e)},init(t){return void 0!==t&&this.C(o,void 0,e,t),t}}}if("setter"===a){var s=n.name;return function(n){var a=this[s];t.call(this,n),this.requestUpdate(s,a,e)}}throw Error("Unsupported decorator location: "+a)};function Hc(e){return(t,n)=>"object"==typeof n?Bc(e,t,n):((e,t,n)=>{var a=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),a?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function Uc(e){return Hc(f({},e,{state:!0,attribute:!1}))}function Gc(e){return!e||"object"==typeof e&&0==Object.keys(e).length}var Vc,Xc="entry",Kc="screen",Yc="branch",qc="exit",Jc="unknown";!function(e){e.NAVIGATE="flowNav",e.BACK="flowPrev",e.NEXT="flowNext",e.FINISHED="flowDone",e.DISMISS="flowDismiss",e.EXIT="flowExit",e.HANDOFF="flowHandoff",e.TRACK="trackEvent",e.LOG="logEvent",e.SET_VIDEO="setVideo",e.FLOW_EVENT="flowEvent",e.BLOCK_BACK="blockBackToStep",e.FLOW_ENABLED="flowInteractionEnabled",e.FLOW_DISABLED="flowInteractionDisabled",e.SET_TAGS="setTags",e.PAUSE="flowPause",e.RESUME="flowResume"}(Vc||(Vc={}));var Qc="__handoff_sequence__",Zc="__buy_sku__",em="__default__",tm="__appear__",nm="__disappear__",am="__login_success__",im="__login_failure__",rm="__logout_success__",om="__logout_failure__",sm="__purchase_success__",um="__remoteback__",lm="__tag_update__",dm="and",hm="or",cm="i_contains",mm="equals",fm="i_equals",vm="not_equals",pm="not_i_equals",gm="not_contains",ym="set",bm="notSet",wm=function(){function e(){s(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 a=n.map((e=>this.evaluateFilter(e)));switch(e.operator){case dm:return a.every((e=>e));case hm:return a.some((e=>e));default:return a.every((e=>e))}}},{key:"evaluateOrdered",value:function(e){var t;if(!e)return!0;var n=null!==(t=e.filter)&&void 0!==t?t:[];if(0===n.length)return!0;switch(e.operator){case dm:for(var a,i=m(n);!(a=i()).done;){var r=a.value;if(!this.evaluateFilter(r))return!1}return!0;case hm:for(var o,s=m(n);!(o=s()).done;){var u=o.value;if(this.evaluateFilter(u))return!0}return!1;default:for(var l,d=m(n);!(l=d()).done;){var h=l.value;if(!this.evaluateFilter(h))return!1}return!0}}},{key:"evaluateFilter",value:function(e){var t=this.resolve(e.identifier);if(e.operator===ym)return null!=t;if(e.operator===bm)return null==t;if(null==t)return!![vm,pm,gm].includes(e.operator);switch(e.operator){case cm:return Array.isArray(t)?e.values.some((e=>t.some((t=>0===t.localeCompare(e,void 0,{sensitivity:"accent"}))))):(this.log("Resolved value is not an array of strings for i_contains."),!1);case mm:return e.values.some((e=>{if("string"==typeof t)return t===e;if("boolean"==typeof t){var n="true"===e.toLowerCase();return t===n}return this.log("Unsupported type for equals comparison: "+typeof t),!1}));case fm:return e.values.some((e=>{if("string"==typeof t)return 0===t.localeCompare(e,void 0,{sensitivity:"accent"});if("boolean"==typeof t){var n="true"===e.toLowerCase();return t===n}return this.log("Unsupported type for i_equals comparison: "+typeof t),!1}));case vm:return e.values.every((e=>"string"!=typeof t||t!==e));case pm:return e.values.every((e=>"string"!=typeof t||0!==t.localeCompare(e,void 0,{sensitivity:"accent"})));case gm:return e.values.every((e=>"string"!=typeof t||!t.includes(e)));default:return this.log(`Unsupported operator: ${e.operator}`),!1}}},{key:"resolve",value:function(e){var t=this.resolveRaw(e);if(void 0!==t)return t;var n=e.lastIndexOf(".");if(-1!==n){var a=e.slice(0,n),i=e.slice(n+1),r=this.resolveRaw(a);return void 0!==r?this.extractProperty(i,r):void this.log(`Could not resolve base identifier: ${a}`)}}},{key:"resolveRaw",value:function(e){for(var t,n=[...this.namespaceResolvers.keys()].sort(((e,t)=>t.length-e.length)),a=m(n);!(t=a()).done;){var i=t.value;if(e.startsWith(i)){var r=this.namespaceResolvers.get(i);if(r)return r(e)}}}},{key:"extractProperty",value:function(e,t){switch(e){case"last":if(Array.isArray(t))return t[t.length-1];break;case"first":if(Array.isArray(t))return t[0];break;case"count":if(Array.isArray(t))return t.length;if(t&&"object"==typeof t)return Object.keys(t).length;break;default:return}this.log(`Could not extract .${e} from type ${typeof t}`)}},{key:"log",value:function(e){Wn.debug(`[NamiConditionEvaluator] ${e}`)}}],[{key:"shared",get:function(){return e.instance||(e.instance=new e),e.instance}}])}(),km=function(){return c((function e(){s(this,e)}),[{key:"register",value:function(){wm.shared.registerNamespaceResolver(this.namespace,(e=>{var t=e.replace(new RegExp(`^${this.namespace}\\.`),"");return this.resolveValue(t)}))}},{key:"resolveKeyPath",value:function(e,t){for(var n,a=t,i=m(e.replace(/\[(\w+)\]/g,".$1").split(".").filter(Boolean));!(n=i()).done;){var r=n.value;if(null==a||"object"!=typeof a)return;a=a[r]}return a}}])}(),Sm=function(){function e(t){var n;return s(this,e),(n=o(this,e)).namespace="LaunchContext",n.context=t,n.register(),n}return g(e,km),c(e,[{key:"resolveValue",value:function(e){if(e.startsWith("customAttributes.")){var t=e.substring(17);return this.resolveKeyPath(t,this.context.customAttributes)}if(e.startsWith("customObject.")){var n=e.substring(13);return this.resolveKeyPath(n,this.context.customObject)}return this.resolveKeyPath(e,{customAttributes:this.context.customAttributes,customObject:this.context.customObject,productGroups:this.context.productGroups})}}])}(),Em=function(){function e(){var t,n,a,i;s(this,e),(i=o(this,e)).namespace="Device";var r=Intl.DateTimeFormat().resolvedOptions().locale.split("-")[1]||"",u=Intl.DateTimeFormat().resolvedOptions().timeZone,l=su();return i.context={osName:l.os_name,osVersion:l.os_version,appVersion:l.extended_platform_version,sdkVersion:l.sdk_version,deviceModel:l.device_model,screenWidth:window.innerWidth,screenHeight:window.innerHeight,formFactor:l.form_factor,tvQuality:i.tvQuality(null!==(t=l.form_factor)&&void 0!==t?t:"desktop"),tvResolution:i.tvResolution(null!==(n=l.form_factor)&&void 0!==n?n:"desktop"),screenSize:i.screenSizeTier(null!==(a=l.form_factor)&&void 0!==a?a:"desktop"),language:l.language,country:r,timezone:u},i.register(),i}return g(e,km),c(e,[{key:"screenSizeTier",value:function(e){var t=window.screen.width,n=window.screen.height,a=window.devicePixelRatio||1,i=Math.round(t*a),r=Math.round(n*a),o=Math.max(i,r);switch(e){case"phone":return o<1136?"tiny":o<1334?"small":o<1920?"medium":o<2560?"large":"huge";case"tablet":return o<2048?"medium":o<2732?"large":"huge";case"television":return o<1920?"medium":o<3840?"large":"huge";case"desktop":return o<1440?"small":o<2560?"medium":o<3840?"large":"huge";default:return"medium"}}},{key:"tvQuality",value:function(e){if("television"!==e)return"";var t=window.screen.width,n=window.screen.height,a=window.devicePixelRatio||1,i=Math.round(t*a),r=Math.round(n*a),o=Math.max(i,r),s=Math.min(i,r);return o>=3840||s>=2160?"4K":o>=1920||s>=1080?"1080p":"720p"}},{key:"tvResolution",value:function(e){if("television"!==e)return"";var t=window.screen.width,n=window.screen.height,a=window.devicePixelRatio||1,i=Math.round(t*a),r=Math.round(n*a),o=Math.max(i,r),s=Math.min(i,r);return s<720&&o<1280?"SD":s>=720&&s<1080&&o>=1280&&o<1920?"720p":s>=1080&&s<1440&&o>=1920&&o<2560?"1080p":s>=1440&&s<2160&&o>=2560&&o<3840?"1440p":s>=2160&&s<3e3&&o>=3840&&o<5e3?"4K":s>=3e3&&o>=5e3?"8K":"Unknown"}},{key:"resolveValue",value:function(e){return this.resolveKeyPath(e,this.context)}}])}(),Mm=[/(^|_)api(_|$)?key/i,/^key$/i,/^token$/i,/id[_-]?token/i,/access[_-]?token/i,/^auth/i,/password/i,/secret/i,/signature/i,/hmac/i,/^jwt$/i,/^code$/i,/redirect[_-]?uri/i,/return[_-]?url/i,/^state$/i,/^session$/i,/^sid$/i,/^sso$/i,/assertion/i],Pm=function(){function e(){s(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 a,i=new URLSearchParams(e.search),r=(e,a)=>{var i=(e=>e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[-\s]/g,"_").toLowerCase())(e);if(!(n.size>=10||(e=>Mm.some((t=>t.test(e))))(i))){var r=this.safeValue(a);r&&(t[i]=r,n.add(i))}},o=m(i.entries());!(a=o()).done;){var s=a.value;r(s[0],s[1])}}catch(e){}return t}}],[{key:"instance",get:function(){return e._instance||(e._instance=new e),e._instance}},{key:"refresh",value:function(){"undefined"!=typeof window&&this.instance.setSearchParams()}}])}();Pm._instance=null;var Tm,_m=()=>Pm.instance.params,Dm=/\{\{\s*([^}]+?)\s*\}\}/g,Am=function(){return c((function e(t){s(this,e),this.flowManager=t,this.urlParams=_m()}),[{key:"resolve",value:function(e){var t,n,a,i,r,o,s,u,l,d,h,c,m=this.flowManager.currentFlow,f=null==m?void 0:m.component;if(e.startsWith("launchContext.")){var v,p=null===(v=this.flowManager.currentFlow)||void 0===v?void 0:v.context;if(p){var g=e.substring(14),y=new Sm(p).resolveValue(g);return null==y?void 0:y.toString()}}else switch(e){case"campaignId":return null==f||null===(t=f.campaign)||void 0===t?void 0:t.rule;case"campaignName":return null==f||null===(n=f.campaign)||void 0===n?void 0:n.name;case"campaignLabel":case"campaignPlacement":return null!==(a=null==f||null===(i=f.campaign)||void 0===i?void 0:i.value)&&void 0!==a?a:void 0;case"campaignSegment":case"campaignSegmentId":return null==f||null===(r=f.campaign)||void 0===r?void 0:r.segment;case"campaignExternalSegment":case"campaignExternalSegmentId":return null!==(o=null==f||null===(s=f.campaign)||void 0===s?void 0:s.external_segment)&&void 0!==o?o:void 0;case"pageName":return null==f||null===(u=f.paywall)||void 0===u?void 0:u.name;case"pageId":return null==f||null===(l=f.paywall)||void 0===l?void 0:l.id;case"flowName":return null==m?void 0:m.name;case"flowId":return null==m?void 0:m.id;case"objectId":return null==f||null===(d=f.campaign)||void 0===d||null===(d=d.flow)||void 0===d?void 0:d.object_id;case"stepName":return null==m||null===(h=m.currentFlowStep)||void 0===h?void 0:h.name;case"buttonText":return null==m||null===(c=m.currentButton)||void 0===c?void 0:c.firstTextValue();case"slideNumber":var b=null==f?void 0:f.getSelectedSlideIndexForCurrentCarousel();return null!=b?`${b+1}`:void 0;default:return}}},{key:"interpolateLiquidVariables",value:function(e){return e.replace(Dm,((e,t)=>{var n,a=null!==(n=this.resolve(t))&&void 0!==n?n:this.urlParams[t];return null!=a?a:""}))}},{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])=>f({},e,{[t]:this.interpolateDeep(n)})),{}):e}}])}(),xm=function(){function e(){var t;return s(this,e),(t=o(this,e)).namespace="urlParams",t.context=_m(),t.register(),t}return g(e,km),c(e,[{key:"resolveValue",value:function(e){return Wn.debug("[URLParamsResolver]","Resolving keyPath",e),this.resolveKeyPath(e,this.context)}}])}(),Cm=function(){function e(){var t;return s(this,e),(t=o(this,e)).namespace="state",t.register(),t}return g(e,km),c(e,[{key:"getContextProvider",value:function(){var e=Xh.providers;if(0!==e.length){var t=e.find((e=>e.flow));return t||e[e.length-1]}}},{key:"resolveValue",value:function(e){var t=this.getContextProvider();if(t){if(e.startsWith("formStates.")){var n=e.substring(11);return t.getCurrentFormId(n)}return this.resolveKeyPath(e,t.state)}}}])}(),Im=function(){function e(t){var n;return s(this,e),(n=o(this,e)).namespace="Placement",n.campaign=t,n.register(),n}return g(e,km),c(e,[{key:"resolveValue",value:function(e){var t;if("label"===e){if(this.campaign&&void 0!==this.campaign.value&&null!==this.campaign.value)return this.campaign.value;var n=Xh.providers;if(0!==n.length){var a=n.find((e=>e.flow));return a?a.getCurrentPlacementLabel():null===(t=n[n.length-1])||void 0===t?void 0:t.getCurrentPlacementLabel()}}}}])}(),Lm=function(){return c((function e(){s(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?Kr.setNamiProfile({externalId:this.externalId}):Kr.removeNamiProfile(),this}},{key:"load",value:function(){var e=Kr.getNamiProfile();e&&(this.externalId=e.externalId),Xh.setIsLoggedIn(!!this.externalId)}},{key:"login",value:function(e){var t;return S((function(n){for(;;)switch(n.n){case 0:return n.n=1,r(Ns.instance.login(e));case 1:(t=n.v).external_id&&Xh.setIsLoggedIn(!0),this.setExternalId(t.external_id).save();case 2:return n.a(2)}}),null,this,null,Promise)}},{key:"logout",value:function(){return S((function(e){for(;;)switch(e.n){case 0:return e.n=1,r(Ns.instance.logout());case 1:Xh.setIsLoggedIn(!1),this.setExternalId(void 0).save();case 2:return e.a(2)}}),null,this,null,Promise)}}])}();Lm.instance=new Lm,function(e){e.LOGIN="login",e.LOGOUT="logout",e.ADVERTISING_ID_SET="advertising_id_set",e.ADVERTISING_ID_CLEARED="advertising_id_cleared",e.VENDOR_ID_SET="vendor_id_set",e.VENDOR_ID_CLEARED="vendor_id_cleared",e.CUSTOMER_DATA_PLATFORM_ID_SET="customer_data_platform_id_set",e.CUSTOMER_DATA_PLATFORM_ID_CLEARED="customer_data_platform_id_cleared",e.ANONYMOUS_MODE_ON="anonymous_mode_on",e.ANONYMOUS_MODE_OFF="anonymous_mode_off",e.NAMI_DEVICE_ID_SET="nami_device_id_set",e.NAMI_DEVICE_ID_CLEARED="nami_device_id_cleared"}(Tm||(Tm={}));var Fm=function(){return c((function e(){s(this,e),this.emitter=ju.getInstance(),wm.shared.registerNamespaceResolver("UserTags",(t=>{var n=t.replace("UserTags.",""),a=e.getCustomerAttribute(n);if(null!=a){var i=a.toLowerCase();return"true"===i||"false"===i?"true"===i:isNaN(Number(a))?a:parseInt(a,10)}return null}))}),[{key:"isSDKInitialized",get:function(){return dc.instance.isInitialized}}],[{key:"isLoggedIn",value:function(){return Lm.instance.isLoggedIn()}},{key:"loggedInId",value:function(){return this.instance.isSDKInitialized||Wn.debug(ke),Lm.instance.getExternalId()}},{key:"login",value:function(e){var t,n,a,i,o,s,u;return S((function(l){for(;;)switch(l.p=l.n){case 0:if(this.instance.isSDKInitialized){l.n=1;break}throw t=new Qr,this.invokeStateHandler(Tm.LOGIN,!1,t),t;case 1:if(!this.inAnonymousMode()){l.n=2;break}throw n=new oo,this.invokeStateHandler(Tm.LOGIN,!1,n),n;case 2:return l.p=2,l.n=3,r(Lm.instance.login(e));case 3:return l.n=4,r(Qh.instance.fetchActiveEntitlements());case 4:this.invokeStateHandler(Tm.LOGIN,!0),Nm.instance.flowOpen&&(a=Nm.instance.currentFlow,(i=null==a?void 0:a.currentFlowStep)&&a.executeLifecycle(i,am)),l.n=6;break;case 5:throw l.p=5,u=l.v,this.invokeStateHandler(Tm.LOGIN,!1,u),Nm.instance.flowOpen&&(o=Nm.instance.currentFlow,(s=null==o?void 0:o.currentFlowStep)&&o.executeLifecycle(s,im)),u;case 6:return l.a(2)}}),null,this,[[2,5]],Promise)}},{key:"logout",value:function(){var e,t,n,a,i,o,s;return S((function(u){for(;;)switch(u.p=u.n){case 0:if(this.instance.isSDKInitialized){u.n=1;break}throw e=new Qr,this.invokeStateHandler(Tm.LOGOUT,!1,e),e;case 1:if(!this.inAnonymousMode()){u.n=2;break}throw t=new oo,this.invokeStateHandler(Tm.LOGOUT,!1,t),t;case 2:return u.p=2,u.n=3,r(Lm.instance.logout());case 3:return u.n=4,r(Qh.instance.fetchActiveEntitlements());case 4:this.invokeStateHandler(Tm.LOGOUT,!0),Nm.instance.flowOpen&&(n=Nm.instance.currentFlow,(a=null==n?void 0:n.currentFlowStep)&&n.executeLifecycle(a,rm)),u.n=6;break;case 5:throw u.p=5,s=u.v,this.invokeStateHandler(Tm.LOGOUT,!1,s),Nm.instance.flowOpen&&(i=Nm.instance.currentFlow,(o=null==i?void 0:i.currentFlowStep)&&i.executeLifecycle(o,om)),s;case 6:return u.a(2)}}),null,this,[[2,5]],Promise)}},{key:"setCustomerDataPlatformId",value:function(e){return S((function(t){for(;;)switch(t.n){case 0:return t.n=1,r(this.updateCustomerDataPlatformId(e));case 1:return t.a(2)}}),null,this,null,Promise)}},{key:"clearCustomerDataPlatformId",value:function(){return S((function(e){for(;;)switch(e.n){case 0:return e.n=1,r(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,a,i,o;return S((function(s){for(;;)switch(s.n){case 0:if(t=e?Tm.ANONYMOUS_MODE_ON:Tm.ANONYMOUS_MODE_OFF,this.instance.isSDKInitialized){s.n=1;break}throw n=new Qr,this.invokeStateHandler(t,!1,n),n;case 1:if(this.anonymousModeCapability()){s.n=2;break}return Wn.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 a=e?new io:new ro,this.invokeStateHandler(t,!1,a),s.a(2);case 3:if(!e){s.n=4;break}Kr.setAnonymousMode(e),Kr.resetDevice(),this.refetchConfig(),this.invokeStateHandler(Tm.ANONYMOUS_MODE_ON,!0),s.n=6;break;case 4:return Kr.clearAnonymousMode(),o=null===(i=Kr.getNamiConfig())||void 0===i?void 0:i.namiCommands,s.n=5,r(Bu.instance.createOrUpdateDevice(su(o)));case 5:Kr.clearAnonymousUUID(),this.refetchConfig(),this.invokeStateHandler(Tm.ANONYMOUS_MODE_OFF,!0);case 6:return s.a(2)}}),null,this,null,Promise)}},{key:"inAnonymousMode",value:function(){return!!this.instance.isSDKInitialized&&Xu()}},{key:"setCustomerAttribute",value:function(e,t){if(!this.instance.isSDKInitialized)throw new Qr;if(Kr.setCustomerAttribute(e,t),Cs(le.PAYWALL_PERSONALIZATION)?(Xh.setCustomerAttribute({[e]:t}),Wn.debug(`This customer attribute you set is now available for paywall personalization using the smart text variable: ${e}`)):Wn.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.`),Nm.instance.flowOpen){var n=Nm.instance.currentFlow;if(n){var a=n.currentFlowStep;a&&n.executeLifecycle(a,lm)}}}},{key:"getCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new Qr;var t=Kr.getCustomerAttribute(e);return null!=t?Cs(le.PAYWALL_PERSONALIZATION)?Wn.debug(`Found customer attribute. ${e} is available for paywall personalization on this device.`):Wn.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.`):Wn.warn(`No ${e} customer attribute found.`),t}},{key:"getAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new Qr;return Kr.getAllCustomerAttributes()}},{key:"clearCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new Qr;Kr.clearCustomerAttribute(e)?(Xh.removeCustomerAttribute(e),Wn.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.`)):Wn.warn(`No value to clear for attribute ${e}.`)}},{key:"clearAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new Qr;Kr.getAllCustomerAttributesKeys().forEach((e=>{Xh.removeCustomerAttribute(e)})),Kr.clearAllCustomerAttributes(),Wn.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 Qr;return Kr.getCustomerJourneyState()}},{key:"deviceId",value:function(){var e,t;return this.instance.isSDKInitialized&&null!==(e=null===(t=Kr.getDevice())||void 0===t?void 0:t.id)&&void 0!==e?e:Le}},{key:"registerJourneyStateHandler",value:function(e){if(Is("NamiCustomerManager.registerJourneyStateHandler"))return this.instance.emitter.addListener(Pn,e),()=>{this.instance.emitter.removeListener(Pn,e)}}},{key:"invokeStateHandler",value:function(e,t,n){this.instance.emitter.emit("accountStateChange",e,t,n)}},{key:"updateCustomerDataPlatformId",value:function(e){var t,n,a,i;return S((function(o){for(;;)switch(o.p=o.n){case 0:if(this.instance.isSDKInitialized){o.n=1;break}throw t=new Qr,this.invokeStateHandler(Tm.CUSTOMER_DATA_PLATFORM_ID_SET,!1,t),t;case 1:if(this.inAnonymousMode()){o.n=6;break}return o.p=2,o.n=3,r(Bu.instance.updateDeviceField("customer_data_platform_id",e));case 3:this.invokeStateHandler(Tm.CUSTOMER_DATA_PLATFORM_ID_SET,!0),o.n=5;break;case 4:o.p=4,i=o.v,this.invokeStateHandler(Tm.CUSTOMER_DATA_PLATFORM_ID_SET,!1,i);case 5:o.n=7;break;case 6:return Wn.info("Unable to set CDP ID in anonymous mode",{deviceId:null===(n=Kr.getDevice())||void 0===n?void 0:n.id,anonymousMode:!0}),a=new so,this.invokeStateHandler(Tm.CUSTOMER_DATA_PLATFORM_ID_SET,!1,a),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=Cs(le.ANONYMOUS_MODE_CAPABILITY),t=Cs(le.THIRD_PARTY_TRANSACTIONS);return e&&t}},{key:"refetchConfig",value:function(){return S((function(e){for(;;)switch(e.n){case 0:if(!this.instance.isSDKInitialized){e.n=1;break}return e.n=1,r(Promise.all([Hu.instance.fetchProducts(),Uu.instance.fetchPaywalls().then((e=>$u.instance.fetchCampaignRules(e)))]));case 1:return e.a(2)}}),null,this,null,Promise)}}])}();Fm.instance=new Fm;var Rm=function(){return c((function e(t={}){var n,a,i,r,o;s(this,e),this.id=null!==(n=t.id)&&void 0!==n?n:"",this.name=null!==(a=t.name)&&void 0!==a?a:"",this.steps=null!==(i=t.steps)&&void 0!==i?i:[],this.screens=null!==(r=t.screens)&&void 0!==r?r:[],this.resumeFromBookmark=Boolean(t.resume_from_bookmark),this.transition=null!==(o=t.transition)&&void 0!==o?o:"none"}),[{key:"allScreensAvailable",get:function(){return this.screens.length>0&&Hs(this.screens)}}])}(),Wm=function(){function e(t,n,a,i){var r,u;s(this,e),(u=o(this,e,[null!==(r=t.flow.object)&&void 0!==r?r:{}])).stepcrumbs=[],u.branchcrumbs=[],u.activeHandoffSequence=null,u.currentScreenState=null,u.isPaused=!1,u.timerStates={},u.campaign=t,u.component=n,u.context=i,u.manager=a,u.branchcrumbs=[],u.stepcrumbs=[],u.registerResolvers(i);var l=u.findStepByType(Xc);return l&&u.forward(l.id),u}return g(e,Rm),c(e,[{key:"registerResolvers",value:function(e){e&&new Sm(e),new Em,new xm,new Cm,new Im(this.campaign),wm.shared.registerNamespaceResolver("Flow",(e=>{switch(e){case"Flow.stepcrumbs":return this.stepcrumbs.map((e=>e.id));case"Flow.branchcrumbs":return this.branchcrumbs;default:return}}))}},{key:"currentFlowStep",get:function(){return this.stepcrumbs.at(-1)}},{key:"nextStepAvailable",get:function(){return void 0!==this.nextFlowStep}},{key:"previousStepAvailable",get:function(){var e,t=!!this.previousFlowStep,n=!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to),a=this.stepcrumbs.slice(0,-1).some((e=>"screen"===e.type));return t&&n&&a}},{key:"previousFlowStep",get:function(){var e=this.stepcrumbs.length-2;return e>=0?this.stepcrumbs[e]:void 0}},{key:"nextFlowStep",get:function(){return this.nextStep(this.currentFlowStep)}},{key:"getStep",value:function(e){return this.steps.find((t=>t.id===e))}},{key:"findStepByType",value:function(e){return this.steps.find((t=>t.type===e))}},{key:"isStepActive",value:function(e){return!e.branch_tags||!e.branch_tags.length||e.branch_tags.some((e=>this.branchcrumbs.includes(e)))}},{key:"finished",value:function(){this.manager.finishFlow()}},{key:"back",value:function(){this.previousStepAvailable?this.backToPreviousScreenStep():Wn.debug("No previous step available")}},{key:"next",value:function(){var e=this.nextFlowStep;e&&this.forward(e.id)}},{key:"backToPreviousScreenStep",value:function(){var e;if(!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to)){for(var t=this.stepcrumbs.length-2;t>=0;t--){var n=this.stepcrumbs[t];if(this.stepcrumbs.pop(),"branch"===n.type&&this.branchcrumbs.length>0&&this.branchcrumbs.pop(),"screen"===n.type&&n.screen){var a,i,r=Bs(n.screen);return r&&this.component.flowNavigateToScreen(r,{transition:this.transition,direction:"backward"}),void(this.currentScreenState=null!==(a=null===(i=Xh.currentProvider)||void 0===i?void 0:i.state)&&void 0!==a?a:null)}}Wn.warn("No previous screen step found to return to")}else Wn.warn(`Not allowed to go back to ${this.previousFlowStep.id}`)}},{key:"forward",value:function(e){var t=this.getStep(e);if(t){if(this.isStepActive(t))switch(t.type){case Xc:case qc:return this.stepcrumbs.push(t),void this.executeLifecycle(t,em);case Yc:return void this.handleBranchStep(t);case Kc:return void this.handleScreenStep(t);case Jc:return}}else Wn.error(`No step found with id: ${e}`)}},{key:"pause",value:function(){var e;this.isPaused?Wn.info("Flow is already paused"):(this.isPaused=!0,this.pausedStepID=null===(e=this.currentFlowStep)||void 0===e?void 0:e.id,Wn.info("Flow paused"))}},{key:"resumeFromPause",value:function(){if(this.isPaused)if(this.isPaused=!1,this.pausedStepID){var e=this.pausedStepID;this.pausedStepID=void 0,Wn.info(`Flow resumed from step ${e}`),this.forward(e)}else Wn.warn("No step to resume from");else Wn.info("Flow is not paused")}},{key:"executeLifecycle",value:function(e,t,n){var a=e.actions[t];a&&this.executeFullLifecycles(a,n)}},{key:"lifecycles",value:function(e){if(this.currentFlowStep){var t=this.currentFlowStep.actions[e];if(t)return t;Wn.info(`No actions found for button ${e} on step ${this.currentFlowStep.id}`)}}},{key:"triggerActions",value:function(e,t,n){var a=this.lifecycles(e);a&&(this.currentButton=t,this.executeFullLifecycles(a,n))}},{key:"executeFullLifecycles",value:function(e,t){for(var n,a=m(e);!(n=a()).done;){var i=n.value;[i.before,i.action,i.after].forEach((e=>null==e?void 0:e.forEach((e=>this.shouldRun(e)&&this.performAction(e,t)))))}}},{key:"triggerBeforeActions",value:function(e,t,n){var a=this.lifecycles(e);if(a){this.currentButton=t;for(var i,r=m(a);!(i=r()).done;){var o;null===(o=i.value.before)||void 0===o||o.forEach((e=>this.shouldRun(e)&&this.performAction(e,n)))}}}},{key:"triggerAfterActions",value:function(e,t,n){var a=this.lifecycles(e);if(a){this.currentButton=t;for(var i,r=m(a);!(i=r()).done;){var o;null===(o=i.value.after)||void 0===o||o.forEach((e=>this.shouldRun(e)&&this.performAction(e,n)))}}}},{key:"currentStepHasHoistedPrimaryActions",value:function(e){var t=this.lifecycles(e);return!!t&&t.some((e=>{var t;return null===(t=e.action)||void 0===t?void 0:t.length}))}},{key:"shouldRun",value:function(e){return!e.conditions||e.conditions.every((e=>wm.shared.evaluate(e)))}},{key:"performAction",value:function(e,t){var n;if(this.currentFlowStep){var a=(null!==(n=e.parameters)&&void 0!==n&&n.delay?+e.parameters.delay:0)||0,i=n=>{var a,i,r,o,s,u,l;if((null===(a=this.currentFlowStep)||void 0===a?void 0:a.id)===n)switch(e.function){case Vc.BACK:this.back();break;case Vc.NEXT:null!==(i=e.parameters)&&void 0!==i&&i.step?this.forward(e.parameters.step):this.next();break;case Vc.NAVIGATE:var d;if(null!==(r=e.parameters)&&void 0!==r&&r.step)(null===(d=this.previousFlowStep)||void 0===d?void 0:d.id)===e.parameters.step?this.back():this.forward(e.parameters.step);else this.next();break;case Vc.FINISHED:case Vc.DISMISS:this.finished();break;case Vc.EXIT:var h=this.steps.find((e=>e.type===qc));h&&this.forward(h.id);break;case Vc.PAUSE:this.pause();break;case Vc.RESUME:this.resumeFromPause();break;case Vc.HANDOFF:if(null!==(o=e.parameters)&&void 0!==o&&o.handoffTag)if(this.manager.handoffStepHandler)if(e.parameters.handoffData)Wn.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} ${JSON.stringify(e.parameters.handoffData)}`),this.manager.handoffStepHandler(e.parameters.handoffTag,e.parameters.handoffData);else if(t)Wn.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} ${JSON.stringify(t)}`),this.manager.handoffStepHandler(e.parameters.handoffTag,t);else if(e.parameters.handoffFormId){var c=this.getFormData();e.parameters.handoffTag===Qc?this.flowHandoffFormSequence():this.manager.handoffStepHandler(e.parameters.handoffTag,c)}else Wn.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} and no data`),this.manager.handoffStepHandler(e.parameters.handoffTag);else Wn.debug("No handoffStepHandler found",e);break;case Vc.LOG:var m;if(null!==(s=e.parameters)&&void 0!==s&&s.eventName)Wn.info(`logEvent → ${e.parameters.eventName}`);else Wn.warn(`Missing 'eventName' in logEvent action ${null!==(m=e.id)&&void 0!==m?m:"unknown"}`);break;case Vc.TRACK:var f;if(null!==(u=e.parameters)&&void 0!==u&&u.eventName)Wn.info(`trackEvent → ${e.parameters.eventName}`);else Wn.warn(`Missing 'eventName' in logEvent action ${null!==(f=e.id)&&void 0!==f?f:"unknown"}`);break;case Vc.SET_VIDEO:null!==(l=e.parameters)&&void 0!==l&&l.name&&e.parameters.url?Xh.setAppSuppliedVideoDetails({name:e.parameters.name,url:e.parameters.url}):Wn.warn("Missing name, url for setting video details");break;case Vc.BLOCK_BACK:var v,p=null===(v=e.parameters)||void 0===v?void 0:v.step,g=p?this.getStep(p):void 0;g?g.allow_back_to=!1:this.currentFlowStep?this.currentFlowStep.allow_back_to=!1:Wn.warn("Missing step for blocking back");break;case Vc.FLOW_EVENT:var y,b=new Am(this.manager),w=Object.fromEntries(Object.entries(null!==(y=e.parameters)&&void 0!==y?y:{}).map((([e,t])=>[e,b.interpolateDeep(t)])));this.manager.eventHandler?this.manager.eventHandler(w):Wn.warn("Missing event handler",w);break;case Vc.FLOW_ENABLED:Xh.setUserInteractionEnabled(!0);break;case Vc.FLOW_DISABLED:Xh.setUserInteractionEnabled(!1);break;case Vc.SET_TAGS:e.parameters&&(Xh.setUserTags(e.parameters),Object.entries(e.parameters).forEach((([e,t])=>{Fm.setCustomerAttribute(e,t)})));break;default:Wn.warn(`Missing action handler for ${e.function}`,e)}else Wn.debug(`Skipped action for stale flow step ${n}`)};a?setTimeout(i.bind(this,this.currentFlowStep.id),a):i(this.currentFlowStep.id)}else Wn.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,a=m(this.steps.slice(t+1));!(n=a()).done;){var i=n.value;if(this.isStepActive(i))return i}Wn.debug(`No active next step found after ${e.id}`)}else Wn.error(`Could not find next step for step ${e.id}`)}else Wn.error("Next step not found")}},{key:"handleScreenStep",value:function(e){var t,n=Bs(null!==(t=e.screen)&&void 0!==t?t:"");e.screen&&n&&this.campaign?(this.stepcrumbs.push(e),this.component.flowNavigateToScreen(n,{transition:this.transition,direction:"forward"})):Wn.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 a=n[t],i=a[0],r=a[1];if(r)for(var o,s=m(r);!(o=s()).done;){var u=o.value;if(u.action)for(var l,d=m(u.action);!(l=d()).done;){var h,c,f=l.value;if(this.shouldRun(f))return this.branchcrumbs.push(i),null===(h=u.before)||void 0===h||h.forEach((e=>{this.performAction(e)})),u.action.forEach((e=>{this.shouldRun(e)&&this.performAction(e)})),void(null===(c=u.after)||void 0===c||c.forEach((e=>{this.performAction(e)})))}else Wn.warn(`No actions defined for branch tag ${i}`)}}Wn.warn(`No matching branch condition matched for step ${e.id}`)}},{key:"getFormData",value:function(){var e,t;return f({},null!==(e=null===(t=Xh.currentProvider)||void 0===t||null===(t=t.state)||void 0===t?void 0:t.formStates)&&void 0!==e?e:{})}},{key:"flowHandoffFormSequence",value:function(){var e,t=null===(e=this.currentScreenState)||void 0===e?void 0:e.formStates;if(t){var n=Object.keys(t).sort();if(0!==n.length){var a=n.filter((e=>!0===t[e]));if(0===a.length)return Wn.info("No eligible handoff keys after filtering"),void this.manager.resume();this.activeHandoffSequence={formStates:f({},t),remainingKeys:[...a]},this.resumeNextHandoff()}else Wn.warn("formStates is empty, no handoffs to perform")}else Wn.warn("No formStates available for handoff sequence")}},{key:"resumeNextHandoff",value:function(){var e,t,n=this.activeHandoffSequence;if(!n)return Wn.warn("No active handoff sequence to resume"),void this.manager.resume();if(0===n.remainingKeys.length)return Wn.info("All handoffs in the sequence are complete"),this.activeHandoffSequence=null,void this.manager.resume();var a=n.remainingKeys.shift(),i=n.formStates[a];Wn.debug(`Starting handoff for ${a} → ${String(i)}`),this.activeHandoffSequence=n;var r=`${a}`;null===(e=(t=this.manager).handoffStepHandler)||void 0===e||e.call(t,r,void 0)}}])}(),Nm=function(){function e(){s(this,e),this.flowOpen=!1,this.lastAnimatedFlowProgress=new Map,this.navGraphCache=new WeakMap}return c(e,[{key:"resume",value:function(){e.resume()}},{key:"presentFlow",value:function(e,t,n){var a=new Wm(e,t,this,n);return this.flowOpen=!0,this.currentFlow=a,a}},{key:"finishFlow",value:function(){this.flowOpen=!1,this.currentFlow=void 0,this.lastAnimatedFlowProgress.clear()}},{key:"getLastAnimatedFlowProgress",value:function(e){var t;return null!==(t=this.lastAnimatedFlowProgress.get(e))&&void 0!==t?t:0}},{key:"setLastAnimatedFlowProgress",value:function(e,t){this.currentFlow&&this.lastAnimatedFlowProgress.set(e,t)}},{key:"getCurrentFlowProgress",value:function(e){if(!this.currentFlow)return 1;if(!this.currentFlow.currentFlowStep)return 0;var t=this.currentFlow.steps.filter((e=>e.type===Kc));if(0===t.length)return 0;var n=this.currentFlow.stepcrumbs.filter((e=>e.type===Kc));if(0===n.length)return 0;var a=this.buildNavGraph(this.currentFlow),i=this.currentFlow.currentFlowStep,r=this.findBranchPoint(t,a),o=0;if(r)o=this.calculateBranchingProgress(n,t,i,r,a);else{var s=t.findIndex((e=>e.id===i.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,a=m(e);!(n=a()).done;){var i=n.value;if(this.hasBranching(i,e,t))return i}return null}},{key:"calculateBranchingProgress",value:function(e,t,n,a,i){var r=e.length,o=t.findIndex((e=>e.id===a.id)),s=e.findIndex((e=>e.id===a.id)),u=t.findIndex((e=>e.id===n.id));if(-1===s||n.id===a.id)return(u+1)/(o+2);var l=this.countForwardScreens(n,t,i),d=r+l;return Wn.debug(`Branching progress: visited=${r}, remaining=${l}, total=${d}, step=${n.id}`),r/d}},{key:"countForwardScreens",value:function(e,t,n){var a=t.findIndex((t=>t.id===e.id));if(-1===a)return 0;var i=new Set,r=0,o=(e,s)=>{if(!i.has(e)){i.add(e);var u=(n.get(e)||[]).filter((e=>{var n=t.findIndex((t=>t.id===e));return n>a}));if(0!==u.length)for(var l,d=m(u);!(l=d()).done;){var h=l.value;o(h,s+1)}else r=Math.max(r,s)}};return o(e.id,0),r}},{key:"hasBranching",value:function(e,t,n){var a=t.findIndex((t=>t.id===e.id));if(-1===a)return!1;var i=(n.get(e.id)||[]).filter((e=>{var n=t.findIndex((t=>t.id===e));return n>a}));return i.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 a,i=null===(a=t.parameters)||void 0===a?void 0:a.step;i&&(n.has(e.id)||n.set(e.id,new Set),n.get(e.id).add(i))}}))}))}))}));var a=new Map;return n.forEach(((e,t)=>{a.set(t,Array.from(e))})),this.navGraphCache.set(e,a),a}},{key:"getCurrentFlowStepAutoAdvanceDelay",value:function(){var e,t,n=null===(e=this.currentFlow)||void 0===e?void 0:e.currentFlowStep;if(!n)return null;var a=null===(t=n.actions)||void 0===t?void 0:t[tm];if(!a)return null;for(var i,r=m(a);!(i=r()).done;)for(var o,s,u=m(null!==(o=i.value.action)&&void 0!==o?o:[]);!(s=u()).done;){var l,d=s.value;if((d.function===Vc.NAVIGATE||d.function===Vc.NEXT)&&null!=(null===(l=d.parameters)||void 0===l?void 0:l.delay)){var h=d.parameters.delay,c=Number(h);if(!isNaN(c)&&c>0)return c/1e3}}return null}}],[{key:"instance",get:function(){return e._instance||(e._instance=new e),e._instance}},{key:"registerStepHandoff",value:function(e){this.instance.handoffStepHandler=e}},{key:"registerEventHandler",value:function(e){this.instance.eventHandler=e}},{key:"resume",value:function(){var t=e.instance,n=t.flowOpen,a=t.currentFlow;if(n&&a&&a.currentFlowStep){if(a.activeHandoffSequence)return Wn.debug(`Resuming flow at handoff sequence ${a.currentFlowStep.id}`),void a.resumeNextHandoff();Wn.debug(`Resuming flow at step ${a.currentFlowStep.id}`),a.executeLifecycle(a.currentFlowStep,"__resume__")}else Wn.warn("Cannot resume: no active flow or current step")}},{key:"finish",value:function(){var t=e.instance,n=t.flowOpen,a=t.currentFlow;n&&a&&a.currentFlowStep?(Wn.debug(`Finishing flow programmatically at step ${a.currentFlowStep.id}`),a.finished()):Wn.debug("Cannot finish: no active flow or current step")}},{key:"pause",value:function(){var t=e.instance,n=t.flowOpen,a=t.currentFlow;n&&a&&a.currentFlowStep?!0===a.resumeFromBookmark?a.pause():Wn.warn("This flow cannot be paused"):Wn.warn("Cannot pause: no active flow or current step")}},{key:"isFlowOpen",value:function(){return e.instance.flowOpen}},{key:"getLastAnimatedFlowProgress",value:function(e){return this.instance.getLastAnimatedFlowProgress(e)}},{key:"setLastAnimatedFlowProgress",value:function(e,t){this.instance.setLastAnimatedFlowProgress(e,t)}},{key:"getCurrentFlowProgress",value:function(e){return this.instance.getCurrentFlowProgress(e)}},{key:"getCurrentFlowStepAutoAdvanceDelay",value:function(){return this.instance.getCurrentFlowStepAutoAdvanceDelay()}}])}();var Om=e=>{var t;return S((function(n){for(;;)if(0===n.n)return t=new Set(Array.from(document.fonts.values()).map((e=>e.family))),e.forEach((e=>{var n=jm(e);if(!t.has(n)){var a=new FontFace(n,`url(${e.file})`);document.fonts.add(a)}})),n.a(2,document.fonts.ready.then())}),null,null,null,Promise)};function jm(e){return`${e.family}-${e.style}`.replace(/ /g,"")}function $m(e,t,n){var a,i,r,o,s,u,l,d;if("undefined"==typeof window||!e||!t)return Wn.debug("Swipe detection is not supported in this environment."),{destroy(){},updateOptions(){}};var h={minDistance:null!==(a=null==n?void 0:n.minDistance)&&void 0!==a?a:30,maxDuration:null!==(i=null==n?void 0:n.maxDuration)&&void 0!==i?i:600,lockAxis:null===(r=null==n?void 0:n.lockAxis)||void 0===r||r,preventScrollOnSwipe:null!==(o=null==n?void 0:n.preventScrollOnSwipe)&&void 0!==o&&o,pointerTypes:null!==(s=null==n?void 0:n.pointerTypes)&&void 0!==s?s:["touch"],passiveListeners:null===(u=null==n?void 0:n.passiveListeners)||void 0===u||u,axisHint:null!==(l=null==n?void 0:n.axisHint)&&void 0!==l?l:"y",edgeLeakThreshold:null!==(d=null==n?void 0:n.edgeLeakThreshold)&&void 0!==d?d:24},c=e.style.touchAction;h.preventScrollOnSwipe&&(e.style.touchAction="none");var m=null,f=0,v=0,p=0,g=0,y=0,b=null,w=null,k=!1,S=!1,E=!1,M=e=>{try{var t=window.getComputedStyle(e);if(!t)return!1;var n=t.overflowY;if("auto"!==n&&"scroll"!==n)return!1;var a=e;return a.scrollHeight>a.clientHeight}catch(e){return!1}},P=e=>h.pointerTypes.includes(e.pointerType),T=t=>{var n=t.composedPath?t.composedPath()[0]:t.target;if(P(t)&&null===m){m=t.pointerId,f=p=t.clientX,v=g=t.clientY,y=performance.now(),b=null,E=!1,k=!1,S=!1,(w="y"===h.axisHint?((e,t)=>{for(var n=e;n&&n!==t&&n instanceof HTMLElement;){var a,i;if(M(n))return n;n=n.parentElement||(null!==(a=null===(i=n.parentNode)||void 0===i?void 0:i.host)&&void 0!==a?a:null)}return null})(n,e):null)||(S=!0);try{var a;null==e||null===(a=e.setPointerCapture)||void 0===a||a.call(e,t.pointerId)}catch(e){try{var i;null==n||null===(i=n.setPointerCapture)||void 0===i||i.call(n,t.pointerId)}catch(e){}}}},_=e=>{if(e.pointerId===m&&P(e)){if(p=e.clientX,g=e.clientY,h.lockAxis&&!b){var n=Math.abs(p-f),a=Math.abs(g-v);(n>2||a>2)&&(b=a>=n?"y":"x")}if("y"===h.axisHint&&("y"===b||!h.lockAxis)){var i=g-v,r=i<0?"up":"down",o=Math.abs(i),s=performance.now()-y,u=o/Math.max(s,1),l=o>=h.minDistance||u>.5;if(w)if(l)S=!0;else if(((e,t)=>!!e&&("down"===t?e.scrollTop>0:e.scrollTop+e.clientHeight<e.scrollHeight-1))(w,r)){if(!(("down"===r&&w.scrollTop<=50||"up"===r&&w.scrollTop+w.clientHeight>=w.scrollHeight-50)&&u>.3))return void(k=!0);S=!0}else S=!0;var d=!w||o>=h.edgeLeakThreshold;if(!E&&!k&&S&&d&&o>=h.minDistance){E=!0;var c=performance.now(),M={direction:"up"===r?"up":"down",distanceX:p-f,distanceY:i,absX:Math.abs(p-f),absY:o,duration:c-y,velocity:o/Math.max(c-y,1),startX:f,startY:v,endX:p,endY:g,startedAt:y,endedAt:c,originalEvent:e};t(M)}}}},D=e=>{if(e.pointerId===m)if(P(e))if(w)A();else if(E||k)A();else{var n,a=performance.now(),i=a-y,r=p-f,o=g-v,s=Math.abs(r),u=Math.abs(o),l="x"===(n=h.lockAxis&&b?b:"x"===h.axisHint?"x":"y"===h.axisHint?"y":s>=u?"x":"y")?s:u,d=i<=h.maxDuration,c=h.minDistance;if(w&&"y"===n&&S&&(c+=h.edgeLeakThreshold),d&&l>=c){var M;M="x"===n?r>0?"right":"left":o>0?"down":"up";var T=l/Math.max(i,1);t({direction:M,distanceX:r,distanceY:o,absX:s,absY:u,duration:i,velocity:T,startX:f,startY:v,endX:p,endY:g,startedAt:y,endedAt:a,originalEvent:e})}A()}else A()},A=()=>{m=null,b=null,y=0,w=null,S=!1,k=!1,E=!1},x=!!h.passiveListeners&&{passive:!0},C=h.passiveListeners?{passive:!0,capture:!0}:{capture:!0};e.addEventListener("pointerdown",T,C),e.addEventListener("pointermove",_,x),e.addEventListener("pointerup",D,x),e.addEventListener("pointercancel",D,x),e.addEventListener("lostpointercapture",D,x);return{destroy:()=>{e.removeEventListener("pointerdown",T,C),e.removeEventListener("pointermove",_,x),e.removeEventListener("pointerup",D,x),e.removeEventListener("pointercancel",D,x),e.removeEventListener("lostpointercapture",D,x),h.preventScrollOnSwipe&&(e.style.touchAction=c),A()},updateOptions:t=>{Object.assign(h,t),"boolean"==typeof t.preventScrollOnSwipe&&(t.preventScrollOnSwipe?e.style.touchAction="none":e.style.touchAction=c)}}}var zm,Bm,Hm,Um,Gm,Vm,Xm,Km,Ym,qm,Jm,Qm=e=>e,Zm=function(){function n(e,t,a){var i;return s(this,n),(i=o(this,n)).pages=[],i.currentOffset=0,i.presentationStyle="fullscreen",i.formFactor=uu(),i.timeSpentOnPaywall=0,i.animation={transition:"none",direction:"forward"},i._originalBodyStyles={},i._originalDocumentStyles={},i._savedScrollY=0,i._sheetDragStartY=0,i._sheetIsDragging=!1,i._dismissThreshold=100,i.type=e,i.value=t,i.context=a,i.setPaywallData(),w(i,i)}return g(n,e.LitElement),c(n,[{key:"setPaywallData",value:function(){var e=Pu(this.value,this.type);this.paywall=e.paywall,this.campaign=e.campaign}},{key:"getPresentationStyle",value:function(e){var t,n,a=null==e||null===(t=e.template)||void 0===t||null===(t=t.initialState)||void 0===t?void 0:t.presentation_style;return(n=a)&&cc.has(n)?"sheet"===n?"fullscreen":n:"fullscreen"}},{key:"isHalfSheet",get:function(){return"compact_sheet"===this.presentationStyle}},{key:"connectedCallback",value:function(){var e;T(n,"connectedCallback",this)([]),null!==(e=window.TVJS)&&void 0!==e&&e.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=this),document.addEventListener("keydown",this.handleKeyDownEvent.bind(this)),this._swipeHandler=$m(this,this.handleSwipeEvent.bind(this),{axisHint:"y",lockAxis:!0,minDistance:25,edgeLeakThreshold:15,preventScrollOnSwipe:!1,pointerTypes:["touch"]}),this.presentationStyle=this.getPresentationStyle(this.paywall),this.setOriginalStyles()}},{key:"disconnectedCallback",value:function(){var e,t;T(n,"disconnectedCallback",this)([]),Kr.clearLaunchId(),null!==(e=window.TVJS)&&void 0!==e&&e.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=document.body),document.removeEventListener("keydown",this.handleKeyDownEvent.bind(this)),ju.getInstance().removeAllListeners(kn),this.restoreStyles(),null===(t=this._halfSheetAbortController)||void 0===t||t.abort(),this._swipeHandler.destroy()}},{key:"setOriginalStyles",value:function(){"television"===this.formFactor&&(this._originalBodyStyles.overflow=document.body.style.overflow,document.body.style.overflow="hidden"),this._originalBodyStyles.background=document.body.style.background,"phone"===this.formFactor&&(this._originalBodyStyles["overscroll-behavior"]=document.body.style.overscrollBehavior?document.body.style.overscrollBehavior:null,this._originalDocumentStyles["overscroll-behavior"]=document.documentElement.style.overscrollBehavior?document.documentElement.style.overscrollBehavior:null,document.body.style.overscrollBehavior="none",document.documentElement.style.overscrollBehavior="none",this.isHalfSheet||(this._originalBodyStyles.overflow=document.body.style.overflow,document.body.style.overflow="hidden")),this.isHalfSheet&&(this._savedScrollY=window.scrollY,this._originalBodyStyles.position=document.body.style.position||null,this._originalBodyStyles.top=document.body.style.top||null,this._originalBodyStyles.width=document.body.style.width||null,document.body.style.position="fixed",document.body.style.top=`-${this._savedScrollY}px`,document.body.style.width="100%")}},{key:"restoreStyles",value:function(){Object.entries(this._originalBodyStyles).forEach((([e,t])=>{null!==t?document.body.style.setProperty(e,t):document.body.style.removeProperty(e)})),Object.entries(this._originalDocumentStyles).forEach((([e,t])=>{null!==t?document.documentElement.style.setProperty(e,t):document.documentElement.style.removeProperty(e)})),this._savedScrollY>0&&(window.scrollTo(0,this._savedScrollY),this._savedScrollY=0)}},{key:"handleKeyDownEvent",value:function(e){!this.flow||10009!==e.keyCode&&"Backspace"!==e.key&&"GoBack"!==e.key||this.flow.triggerActions(um)}},{key:"handleSwipeEvent",value:function({direction:e}){var t;if("down"===e)null===(t=this.flow)||void 0===t||t.triggerActions("__swipe_down__");else if("up"===e){var n;null===(n=this.flow)||void 0===n||n.triggerActions("__swipe_up__")}}},{key:"setupHalfSheetDragTracking",value:function(){var e,t,n;null===(e=this._halfSheetAbortController)||void 0===e||e.abort(),this._halfSheetAbortController=new AbortController;var a=this._halfSheetAbortController.signal,i=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".nami-half-sheet-container"),r=null===(n=this.shadowRoot)||void 0===n?void 0:n.querySelector(".nami-half-sheet-content");if(i&&r){i.addEventListener("touchstart",(e=>{r.scrollTop>0||(this._sheetDragStartY=e.touches[0].clientY,this._sheetIsDragging=!0)}),{passive:!0,signal:a}),i.addEventListener("touchmove",(e=>{if(this._sheetIsDragging){var t=e.touches[0].clientY-this._sheetDragStartY;t>0&&(i.style.transform=`translateY(${t}px)`,i.style.transition="none",e.preventDefault())}}),{passive:!1,signal:a}),i.addEventListener("touchend",(()=>{if(this._sheetIsDragging){this._sheetIsDragging=!1;var e,t,n=i.style.transform.match(/translateY\((\d+(?:\.\d+)?)px\)/);if((n?parseFloat(n[1]):0)>this._dismissThreshold)if(null!==(e=null===(t=this.flow)||void 0===t?void 0:t.currentStepHasHoistedPrimaryActions("__swipe_down__"))&&void 0!==e&&e){var a;i.style.transform="translateY(0)",i.style.transition="transform 0.2s ease-out",null===(a=this.flow)||void 0===a||a.triggerActions("__swipe_down__")}else{var r;i.style.transform="translateY(100%)",i.style.transition="transform 0.2s ease-in";var o=null===(r=this.shadowRoot)||void 0===r?void 0:r.querySelector(".nami-half-sheet-backdrop");o&&o.classList.add("nami-dismissing"),setTimeout((()=>{var e;null===(e=this.flow)||void 0===e||e.finished()}),200)}else i.style.transform="translateY(0)",i.style.transition="transform 0.2s ease-out"}}),{signal:a})}}},{key:"setupHalfSheetFocusTrap",value:function(){var e,t,n=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(".nami-half-sheet-container");if(n){n.focus();var a=null===(t=this._halfSheetAbortController)||void 0===t?void 0:t.signal;n.addEventListener("keydown",(e=>{if("Tab"===e.key){var t=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(0!==t.length){var a,i,r=t[0],o=t[t.length-1];if(e.shiftKey)document.activeElement!==r&&(null===(a=this.shadowRoot)||void 0===a?void 0:a.activeElement)!==r||(e.preventDefault(),o.focus());else document.activeElement!==o&&(null===(i=this.shadowRoot)||void 0===i?void 0:i.activeElement)!==o||(e.preventDefault(),r.focus())}}}),a?{signal:a}:void 0)}}},{key:"firstUpdated",value:function(){this.timeSpentOnPaywall=Date.now(),Os(this.campaign)&&(this.flow=Nm.instance.presentFlow(this.campaign,this,this.context)),this.isHalfSheet&&this.updateComplete.then((()=>{this.setupHalfSheetDragTracking(),this.setupHalfSheetFocusTrap()}))}},{key:"updated",value:function(e){T(n,"updated",this)([e]),this.isHalfSheet&&e.has("presentationStyle")&&(this.setupHalfSheetDragTracking(),this.setupHalfSheetFocusTrap())}},{key:"getAnimationStyles",value:function(e){var t="backward"===this.animation.direction?-1:1;switch(this.animation.transition){case"verticalSlide":return`transform: translateY(${100*(e-this.currentOffset)*t}vh);`;case"slide":return`transform: translateX(${100*(e-this.currentOffset)*t}vw);`;case"fade":return`opacity: ${e===this.currentOffset?1:0};`;default:return""}}},{key:"updatePages",value:function(e){var t;return S((function(n){for(;;)switch(n.n){case 0:if(0!==this.pages.length&&"none"!==this.animation.transition){n.n=1;break}return this.pages=[e],n.a(2);case 1:if((null==(t=this.pages[this.pages.length-1])?void 0:t.id)!==e.id){n.n=2;break}return n.a(2);case 2:return this.pages=[t,e],this.currentOffset=0,n.n=3,r(this.updateComplete);case 3:requestAnimationFrame((()=>{this.currentOffset=1,setTimeout((()=>{this.pages=[e],this.currentOffset=0,this.paywall=e}),250)}));case 4:return n.a(2)}}),null,this,null,Promise)}},{key:"flowNavigateToScreen",value:function(e,t){var n,a,i,o;return S((function(s){for(;;)switch(s.n){case 0:if(null!==(n=this.flow)&&void 0!==n&&n.previousFlowStep&&this.flow.executeLifecycle(this.flow.previousFlowStep,nm),i=this.presentationStyle,o=this.getPresentationStyle(e),"fullscreen"!==i||"compact_sheet"!==o){s.n=1;break}console.warn("Unsupported transition: fullscreen → compact_sheet. Presenting as fullscreen."),s.n=4;break;case 1:if("compact_sheet"!==i||"fullscreen"!==o&&"sheet"!==o){s.n=3;break}return s.n=2,r(this.animateHalfSheetExpand());case 2:this.presentationStyle="fullscreen",s.n=4;break;case 3:this.presentationStyle=o;case 4:return this.animation=t,s.n=5,r(this.updatePages(e));case 5:null!==(a=this.flow)&&void 0!==a&&a.currentFlowStep&&this.flow.executeLifecycle(this.flow.currentFlowStep,tm);case 6:return s.a(2)}}),null,this,null,Promise)}},{key:"animateHalfSheetExpand",value:function(){var e,t;return S((function(n){for(;;)switch(n.n){case 0:if(t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(".nami-half-sheet-container")){n.n=1;break}return n.a(2);case 1:return t.classList.add("nami-expanding"),n.n=2,r(new Promise((e=>setTimeout(e,300))));case 2:return n.a(2)}}),null,this,null,Promise)}},{key:"getSelectedSlideIndexForCurrentCarousel",value:function(){return Xh.getSelectedSlideIndex()}},{key:"renderFlow",value:function(){return"undefined"==typeof document?e.html(zm||(zm=Qm``)):this.isHalfSheet?this.renderHalfSheet():e.html(Bm||(Bm=Qm`
92
92
  <div class="nami-flow-container">
93
93
  ${0}
94
94
  </div>
@@ -123,6 +123,8 @@
123
123
  :host {
124
124
  box-sizing: border-box;
125
125
  width: 100%;
126
+ height: 100vh;
127
+ height: 100dvh;
126
128
  display: block;
127
129
  }
128
130
  :host(.nami-disabled) {
@@ -130,8 +132,8 @@
130
132
  }
131
133
  .nami-flow-container {
132
134
  position: relative;
133
- min-height: 100vh;
134
- min-height: 100dvh;
135
+ height: 100vh;
136
+ height: 100dvh;
135
137
  overflow: hidden;
136
138
 
137
139
  /* Safe area support for iOS */
@@ -262,7 +264,7 @@
262
264
  `),t,t,t,function(e){return db[e]||db.CheckCircleOutlined}(t))}},{key:"render",value:function(){return this.renderSvgIcon(this.shouldRenderCurrentIcon()?this.component.name:this.previousSymbolName)}}])}();oe([Hc({type:Object})],ex.prototype,"component",void 0),oe([Hc({type:Boolean})],ex.prototype,"inFocusedState",void 0),oe([Hc({type:Number})],ex.prototype,"scaleFactor",void 0),ex=oe([yc("nami-symbol")],ex);var tx=function(){function t(){var e;return s(this,t),(e=o(this,t,arguments)).inFocusedState=!1,e.scaleFactor=1,e}return g(t,Df),c(t,[{key:"styles",value:function(){var t=this.component,n=this.scaleFactor,a=this.inFocusedState,i=t.hidden,r=t.fontSize,o=t.alignment,s=t.strikethrough,u=t.spacing;return e.unsafeCSS(`\n :host {\n line-height: ${qA(r,n)}px;\n display: ${i?"none":"grid"};\n overflow-wrap: anywhere;\n width: fit-content;\n ${Gf(t,a)}\n ${JA(t,a)}\n font-size: ${(null!=r?r:YA)*n}px;\n text-align: ${o||"center"};\n ${nv("string"!=typeof s&&s)}\n ${av(t.fontName)}\n ${iv(t,n,a)}\n ${KA(t)}\n ${Vf(t)}\n ${function({alignment:e,horizontalAlignment:t}){return Lf("justify-content",t&&Cf[t]?Cf[t]:e&&Cf[e]?Cf[e]:"center")}(t)}\n }\n :host > :not(:first-child) {\n margin-top: ${u||0}px;\n }\n .anticon {\n text-rendering: optimizelegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n color: inherit;\n display: inline-block;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -.125em;\n }\n .anticon svg {\n display: inline-block;\n line-height: 1;\n }\n\n :host .bullet-text-wrapper {\n line-height: ${qA(r,n)}px;\n display: inline;\n overflow-wrap: anywhere;\n width: fit-content;\n ${Gf(t,a)}\n ${JA(t,a)}\n font-size: ${(null!=r?r:YA)*n}px;\n text-align: ${o||"center"};\n ${nv("string"!=typeof s&&s)}\n ${av(t.fontName)}\n }\n ${KA(t,":host .bullet-text-wrapper")}\n :host .bullet-text-wrapper p {\n margin: 0;\n line-height: ${qA(r,n)}px;\n }\n `)}},{key:"render",value:function(){var t=this.component,n=t.fontColor,a=t.fontSize,i=t.activeFontColor,r=t.bulletComponent,o=t.texts,s=t.spacing,u=r?f({fontColor:n,fontSize:a,activeFontColor:i,spacing:s},r):null;if(!Array.isArray(o))return e.html(BA||(BA=XA``));var l=o.map((t=>t?e.html(HA||(HA=XA`<nami-text-list-item-wrapper .component=${0} .scaleFactor=${0}>
263
265
  ${0}
264
266
  <div class="bullet-text-wrapper" .innerHTML="${0}"></div>
265
- </nami-text-list-item-wrapper>`),this.component,this.scaleFactor,u&&e.html(UA||(UA=XA`<nami-symbol .component=${0} .scaleFactor=${0}></nami-symbol>`),u,this.scaleFactor),uy(t)):null));return e.html(GA||(GA=XA`${0}`),l)}}])}();oe([Hc({type:Object})],tx.prototype,"component",void 0),oe([Hc({type:Boolean})],tx.prototype,"inFocusedState",void 0),oe([Hc({type:Number})],tx.prototype,"scaleFactor",void 0),tx=oe([yc("nami-text-list")],tx);(()=>{var e,t=!0;try{new RegExp("􏿿","u"),new RegExp("😀","u"),new RegExp("\\p{P}","u")}catch(e){t=!1}if(!t){var n=null===(e=uy.Lexer)||void 0===e?void 0:e.rules,a=null==n?void 0:n.inline;a&&Object.values(a).forEach((e=>{e&&Object.keys(e).forEach((t=>{e[t]=(e=>{if(!(e instanceof RegExp))return e;if(!/\\p\{/.test(e.source))return e;var t="!\"#$%&'()*+,\\-./:;<=>?@[\\\\]^_`{|}~",n=e.source.replace(/\\p\{P\}\\p\{S\}/g,t).replace(/\\p\{P\}/g,t).replace(/\\p\{S\}/g,t),a=e.flags.replace(/u/g,"");return new RegExp(n,a)})(e[t])}))}))}})();var nx=function(){function t(){var e;return s(this,t),(e=o(this,t)).inFocusedState=!1,e.scaleFactor=1,e.handleFocusIn=()=>e.setFocusState(!0),e.handleFocusOut=t=>{var n,a,i=null!==(n=t.relatedTarget)&&void 0!==n?n:null;if(!i)return e.setFocusState(!1);i===e||null!==(a=e.shadowRoot)&&void 0!==a&&a.contains(i)||e.setFocusState(!1)},e.handleFocusChanged=t=>{var n=t.detail;e.setFocusState(!0===(null==n?void 0:n.inFocusedState))},e.addEventListener("focusin",e.handleFocusIn),e.addEventListener("focusout",e.handleFocusOut),e.addEventListener("focus-changed",e.handleFocusChanged),e}return g(t,Df),c(t,[{key:"disconnectedCallback",value:function(){T(t,"disconnectedCallback",this)([]),this.removeEventListener("focusin",this.handleFocusIn),this.removeEventListener("focusout",this.handleFocusOut),this.removeEventListener("focus-changed",this.handleFocusChanged)}},{key:"styles",value:function(){var t=this.component,n=this.scaleFactor,a=this.minSDKVersion,i=t.backgroundBlur,r="vertical"===t.direction,o=r?"width":"height",s=r?"margin-top":"margin-left",u=t.fillImage?e.unsafeCSS(`\n line-height: 1.5715;\n background-image: url(${t.fillImage});\n background-position: center;\n background-repeat: no-repeat;\n background-size: cover;\n height: 100%;\n width: 100%;\n `):e.unsafeCSS(Gf(t,!1));return e.unsafeCSS(`\n :host {\n box-sizing: border-box;\n display: ${t.hidden?"none":"flex"};\n ${i?`backdrop-filter: blur(${i}px);`:""}\n ${u};\n ${ov(t.position)}\n ${Vf(t)}\n ${iv(t,n,!1)}\n }\n :host(:focus),\n :host(.nami-focus-within){\n ${Gf(t,!0)}\n ${iv(t,n,!0)}\n }\n :host(:focus-visible){\n ${dv(t)}\n }\n :host > * {\n ${Kf(a,o)}\n }\n :host > *:not(:first-child) {\n ${s}: ${t.spacing?t.spacing*n:0}px;\n }\n `)}},{key:"render",value:function(){var e;return(null!==(e=this.component.components)&&void 0!==e?e:[]).map((e=>Qv(this.contextProvider,e,this.scaleFactor,void 0,this.minSDKVersion)))}},{key:"setFocusState",value:function(e){this.inFocusedState!==e&&(this.inFocusedState=e,this.classList.toggle("nami-focus-within",e),this.toggleAttribute("data-nami-focused",e))}}])}();oe([Hc({type:Object})],nx.prototype,"component",void 0),oe([Hc({type:Boolean})],nx.prototype,"inFocusedState",void 0),oe([Hc({type:Number})],nx.prototype,"scaleFactor",void 0),oe([Hc({type:Object})],nx.prototype,"minSDKVersion",void 0),nx=oe([yc("nami-container")],nx);var ax=function(){function t(){var e;return s(this,t),(e=o(this,t,arguments)).inFocusedState=!1,e.scaleFactor=1,e}return g(t,Df),c(t,[{key:"styles",value:function(){var t=this.component.backgroundBlur,n="vertical"===this.component.direction,a=n?"width":"height",i=n?"margin-top":"margin-left",r=this.component.fillImage?e.unsafeCSS(`\n line-height: 1.5715;\n background-image: url(${this.component.fillImage});\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n height: 100%;\n width: 100%;\n `):e.unsafeCSS(Gf(this.component,!1));return e.unsafeCSS(`\n :host {\n opacity: 0;\n display: ${this.component.hidden?"none":"flex"};\n ${r};\n ${t?`backdrop-filter: blur(${t}px);`:""}\n ${ov(this.component.position)}\n ${Vf(this.component)}\n ${iv(this.component,this.scaleFactor,!1)}\n transition: transform .5s ease-in;\n }\n :host > *:not(:first-child) {\n ${i}: ${this.component.spacing?this.component.spacing*this.scaleFactor:0}px;\n }\n :host(:focus){\n ${Gf(this.component,!0)}\n ${iv(this.component,this.scaleFactor,!0)}\n }\n :host(:focus-visible){\n ${dv(this.component)}\n }\n :host > * {\n ${a}: 100%;\n }\n :host(.fade-in){\n opacity: 1;\n animation: fadeIn 0.5s ease-in\n }\n @keyframes fadeIn {\n 0% { opacity: 0; }\n 100% { opacity: 1; }\n }\n `)}},{key:"updated",value:function(){var e=this.contextProvider.state.currentGroupId;zu(e,this.currentGroupId)||(this.classList.remove("fade-in"),setTimeout((()=>this.classList.add("fade-in")),100),this.currentGroupId=e)}},{key:"render",value:function(){var e,t,n=this.contextProvider.state,a=n.mediaList,i=n.currentGroupId,r=n.selectedPaywall,o=n.formFactor,s=Rd(this.contextProvider.productDetails,null!==(e=null==r?void 0:r.sku_menus)&&void 0!==e?e:[],(null===(t=this.component)||void 0===t?void 0:t.subsetGroup)||i);return pv(this.contextProvider,s,this.component,a).map((([e,t])=>(this.inFocusedState="television"==o?e:this.inFocusedState,t.map((e=>Qv(this.contextProvider,e,this.scaleFactor,this.inFocusedState,this.minSDKVersion))))))}}])}();oe([Hc({type:Object})],ax.prototype,"component",void 0),oe([Hc({type:Boolean})],ax.prototype,"inFocusedState",void 0),oe([Hc({type:Number})],ax.prototype,"scaleFactor",void 0),oe([Hc({type:Object})],ax.prototype,"minSDKVersion",void 0),ax=oe([yc("nami-product-container")],ax);var ix,rx,ox=e=>e,sx=function(){function t(){var e;return s(this,t),(e=o(this,t,arguments)).inFocusedState=!1,e.scaleFactor=1,e}return g(t,Df),c(t,[{key:"styles",value:function(){var t,n,a=this.component,i=a.imageCropping,r=a.alignment,o=a.height,s=a.width,u=a.rightMargin,l=a.spacing,d=a.hidden,h=a.blur,c="fit"===i,m=this.contextConsumer.state.formFactor;return e.unsafeCSS(`\n :host {\n display: ${"television"===m?"flex":"inline-block"};\n ${d?"display:none;":""}\n position: relative;\n height: ${zf(null!=o?o:"100%",this.scaleFactor)};\n width: ${zf(null!==(t="fitContent"==s?o:s)&&void 0!==t?t:"100%",this.scaleFactor)};\n }\n :host img {\n transition: all 0.3s;\n object-fit: ${c?"contain":"cover"};\n object-position: ${r} center;\n height: ${zf(null!=o?o:"100%",this.scaleFactor)};\n width: ${zf(null!==(n="fitContent"==s?o:s)&&void 0!==n?n:"100%",this.scaleFactor)};\n margin-right: ${u||l||0}px;\n ${h?`filter: blur(${h}px);`:""}\n flex-shrink: ${"number"==typeof s?0:1};\n }\n `)}},{key:"render",value:function(){var t,n=this.component,a=n.url,i=n.alt,r=n.title,o=n.focusedBorderColor,s=n.focusedFillColor,u=n.fillColor;return a?(!o&&qv(u,s)||(this.tabIndex=0),this.ariaLabel=null!==(t=null!=i?i:r)&&void 0!==t?t:"",e.html(ix||(ix=ox`<img src="${0}" alt="${0}" />`),a,this.ariaLabel)):(this.tabIndex=-1,this.ariaLabel=null,e.html(rx||(rx=ox``)))}}])}();oe([Hc({type:Object})],sx.prototype,"component",void 0),oe([Hc({type:Boolean})],sx.prototype,"inFocusedState",void 0),oe([Hc({type:Number})],sx.prototype,"scaleFactor",void 0),sx=oe([yc("nami-image")],sx);var ux=function(){function t(){var e;return s(this,t),(e=o(this,t,arguments)).fullscreen=!1,e.inFocusedState=!1,e.scaleFactor=1,e}return g(t,Df),c(t,[{key:"connectedCallback",value:function(){T(t,"connectedCallback",this)([]),document.body.style.background=this.component.fillColor||"transparent"}},{key:"styles",value:function(){var t;if(!this.contextConsumer||!this.component)return e.unsafeCSS("");var n=this.component,a=this.scaleFactor,i=this.contextConsumer.state.formFactor,r=n.backgroundBlur,o="vertical"===n.direction?"margin-top":"margin-left";return e.unsafeCSS(`\n :host {\n max-height: ${"television"===i?"100vh":""};\n display: ${n.hidden?"none":"flex"};\n flex-direction: column;\n overflow: hidden;\n ${Xf(n)}\n position: fixed;\n width: 100%;\n bottom: 0px;\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n z-index: ${null!==(t=n.zIndex)&&void 0!==t?t:1};\n top: 0px;\n ${r?`backdrop-filter: blur(${r}px);`:""}\n ${Gf(n,!1)}\n transition: all 0.3s;\n ${qf(n,a)}\n }\n :host(:focus){\n ${Gf(n,!0)}\n }\n :host > *:not(:first-child) {\n ${o}: ${n.spacing?n.spacing*a:0}px;\n }\n `)}},{key:"updated",value:function(){var e,t,n=Array.from(document.getElementsByTagName("nami-paywall")),a=null===(e=this.component.fillColor)||void 0===e?void 0:e.includes("gradient"),i=null===(t=this.shadowRoot)||void 0===t?void 0:t.innerHTML.includes("nami-image");n[0]&&(n[0].style.position=!i||a?"relative":"","undefined"!=typeof window&&"undefined"!=typeof CSS&&CSS.supports("height: 100dvh")?n[0].style.minHeight=!i||a?"100dvh":"100%":n[0].style.minHeight=!i||a?"100vh":"100%")}},{key:"render",value:function(){var e;return(null!==(e=this.component.components)&&void 0!==e?e:[]).map((e=>Qv(this.contextProvider,e,this.scaleFactor,void 0,this.minSDKVersion)))}}])}();oe([Hc({type:Object})],ux.prototype,"component",void 0),oe([Hc({type:Boolean})],ux.prototype,"fullscreen",void 0),oe([Hc({type:Boolean})],ux.prototype,"inFocusedState",void 0),oe([Hc({type:Number})],ux.prototype,"scaleFactor",void 0),oe([Hc({type:Object})],ux.prototype,"minSDKVersion",void 0),ux=oe([yc("nami-background-container")],ux);var lx,dx=e=>e,hx=function(){function t(){var e;return s(this,t),(e=o(this,t,arguments)).zIndex=2,e.inFocusedState=!1,e.scaleFactor=1,e}return g(t,Df),c(t,[{key:"styles",value:function(){var t=this.contextConsumer,n=this.component,a=this.zIndex,i=this.scaleFactor;if(!t)return e.css(lx||(lx=dx``));var r=t.state.formFactor,o=n.backgroundBlur,s="phone"!==r?"width: 100%;":"",u="vertical"===n.direction?"margin-top":"margin-left";return e.unsafeCSS(`\n :host {\n box-sizing: border-box;\n display: ${n.hidden?"none":"flex"};\n position: relative;\n flex: 1;\n min-height: 0;\n ${Vf(n)}\n ${Zf(n,i)}\n ${s}\n align-items: center;\n justify-content: flex-start;\n justify-content: start;\n ${o?`backdrop-filter: blur(${o}px);`:""}\n z-index: ${a};\n transition: all 0.3s;\n overflow-y: ${"television"===r?"hidden":"scroll"};\n overflow-x: hidden;\n scrollbar-width: none;\n ::-webkit-scrollbar {\n display: none;\n }\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n ${qf(n,i)}\n ${Gf(n,!1)}\n }\n :host::-webkit-scrollbar {\n display: none;\n }\n :host(:focus){\n ${Gf(n,!0)}\n }\n :host > * {\n width: 100%;\n }\n :host > *:not(:first-child) {\n ${u}: ${n.spacing?n.spacing*i:0}px;\n }\n `)}},{key:"firstUpdated",value:function(){var e=new CustomEvent("child-spacing",{detail:{spacing:this.component.spacing},bubbles:!0,composed:!0});this.dispatchEvent(e)}},{key:"render",value:function(){var e;return(null===(e=this.component.components)||void 0===e?void 0:e.map((e=>Qv(this.contextProvider,e,this.scaleFactor,this.inFocusedState,this.minSDKVersion))))||[]}}])}();oe([Hc({type:Object})],hx.prototype,"component",void 0),oe([Hc({type:Number})],hx.prototype,"zIndex",void 0),oe([Hc({type:Boolean})],hx.prototype,"inFocusedState",void 0),oe([Hc({type:Number})],hx.prototype,"scaleFactor",void 0),oe([Hc({type:Object})],hx.prototype,"minSDKVersion",void 0),hx=oe([yc("nami-content-container")],hx);var cx,mx=e=>e,fx=function(){function t(){var e;return s(this,t),(e=o(this,t)).inFocusedState=!1,e.scaleFactor=1,e._handleClick=t=>{t.preventDefault(),Cp({contextProvider:e.contextProvider,onTap:e.component.onTap})},e.addEventListener("click",e._handleClick),e}return g(t,Df),c(t,[{key:"styles",value:function(){var t,n,a=sv("active",this.component.components[0]),i=sv("inactive",this.component.components[0]);return e.unsafeCSS(`\n :host {\n box-sizing: border-box;\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n display: flex;\n flex: 0 0 auto;\n position: relative;\n ${Vf(this.component)}\n ${Gf(this.component,!1)}\n ${iv(this.component,this.scaleFactor,!1)}\n ${this.component.hidden?"display:none;":""}\n }\n :host(:focus){\n ${Gf(this.component,!0)}\n ${iv(this.component,this.scaleFactor,!0)}\n }\n :host(:focus-visible){\n ${dv(this.component)}\n }\n .toggle{\n ${t=this.component,n=this.scaleFactor,`\n position: absolute;\n top: ${$f(n,t.topPadding)}px;\n bottom: ${$f(n,t.bottomPadding)}px;\n width: calc(50% - ${$f(n,t.leftPadding)/2}px) !important;\n `}\n transition: transform .5s cubic-bezier(.77, 0, .175, 1);\n ${uv(i,this.scaleFactor,!1)}\n }\n\n :host(:focus) .toggle{\n ${uv(a,this.scaleFactor,!0)}\n }\n \n nami-segment-picker-item:nth-of-type(1).active~.toggle {\n transform: translateX(0%);\n left: ${this.component.leftPadding?Number(this.component.leftPadding)*this.scaleFactor:0}px;\n ${Gf(a,!0)}\n ${lv(a,this.scaleFactor)}\n }\n\n nami-segment-picker-item:nth-of-type(2).active~.toggle {\n transform: translateX(100%);\n right: ${this.component.rightPadding?Number(this.component.rightPadding)*this.scaleFactor:0}px;\n ${Gf(a,!0)}\n ${lv(a,this.scaleFactor)}\n `)}},{key:"render",value:function(){this.role="tablist";var t=this.component.components.map((e=>Qv(this.contextProvider,e,this.scaleFactor,this.inFocusedState,this.minSDKVersion)));return e.html(cx||(cx=mx`${0}<div class="toggle"></div>`),t)}}])}();oe([Hc({type:Object})],fx.prototype,"component",void 0),oe([Hc({type:Boolean})],fx.prototype,"inFocusedState",void 0),oe([Hc({type:Number})],fx.prototype,"scaleFactor",void 0),oe([Hc({type:Object})],fx.prototype,"minSDKVersion",void 0),fx=oe([yc("nami-segment-picker")],fx);var vx,px=e=>e,gx=function(){function t(){var e;return s(this,t),(e=o(this,t,arguments)).inFocusedState=!1,e.scaleFactor=1,e._handleFocus=()=>{e.inFocusedState=!0,e._announceButtonLabel()},e._handleKeyDown=t=>{"Enter"!==t.key&&" "!==t.key||e._handleClick()},e._handleClick=()=>{e._updateFormState(),e.requestUpdate("component")},e._handleHover=()=>{e.inFocusedState=!0},e}return g(t,Df),c(t,[{key:"connectedCallback",value:function(){T(t,"connectedCallback",this)([]),this._isActive=!!this.component.checked,this.classList.toggle("active",this._isActive),this.component.formId&&this._updateFormState(),this.addEventListener("click",this._handleClick),this.addEventListener("mouseover",this._handleHover),this.addEventListener("keydown",this._handleKeyDown),this.addEventListener("focus",this._handleFocus)}},{key:"disconnectedCallback",value:function(){T(t,"disconnectedCallback",this)([]),this.removeEventListener("click",this._handleClick),this.removeEventListener("mouseover",this._handleHover),this.removeEventListener("keydown",this._handleKeyDown),this.removeEventListener("focus",this._handleFocus)}},{key:"_announceButtonLabel",value:function(){var e=this.component.text||"";e&&lc(e)}},{key:"_getParentPicker",value:function(){var e=this.getRootNode();return e instanceof ShadowRoot?e.host:null}},{key:"_getParentFormId",value:function(){var e;return null===(e=this._getParentPicker())||void 0===e?void 0:e.component.formId}},{key:"_updateFormState",value:function(){if(this.contextProvider)if(this.component.formId){var e=this._getParentFormId();e&&this.contextProvider.setFormState(e,this.component.formId)}else this.component.id&&this.contextProvider.setCurrentGroupData(this.component.id,this.component.text||"")}},{key:"updated",value:function(e){var t;if(e.has("component")&&this.contextProvider){var n=null!==(t=e.get("component"))&&void 0!==t?t:this.component;if(n.formId){var a=this._getParentFormId();a&&this.contextProvider.state.formStates[a]&&(this._isActive=this.contextProvider.state.formStates[a]===n.formId)}else this._isActive=zu(n.id,this.contextProvider.state.currentGroupId);if(this.classList.toggle("active",this._isActive),this._isActive){var i=this.getRootNode();if(i instanceof ShadowRoot)i.querySelectorAll("nami-segment-picker-item").forEach((e=>{e!==this&&e.requestUpdate("component",e)}))}}}},{key:"styles",value:function(){var t,n,a=sv("active",this.component),i=sv("inactive",this.component);return e.unsafeCSS(`\n :host {\n box-sizing: border-box;\n display: ${this.component.hidden?"none":"inline-flex"};\n position: relative;\n ${uv(f({},i,this.component),this.scaleFactor,this.inFocusedState)}\n ${tv(null!==(t=this.component.inactiveDropShadow)&&void 0!==t?t:this.component.dropShadow)}\n }\n\n :host > * {\n cursor: pointer;\n }\n\n :host(.active) {\n z-index: 1 !important;\n ${lv(f({},a,this.component),this.scaleFactor)}\n ${tv(null!==(n=this.component.activeDropShadow)&&void 0!==n?n:this.component.dropShadow)}\n }\n\n input {\n visibility: hidden;\n position: absolute;\n top: 0;\n }\n `)}},{key:"render",value:function(){return this.tabIndex=0,this.role="tab",this.ariaSelected=`${this._isActive}`,this.ariaLabel=this.component.text||"",e.html(vx||(vx=px`<input type="radio"
267
+ </nami-text-list-item-wrapper>`),this.component,this.scaleFactor,u&&e.html(UA||(UA=XA`<nami-symbol .component=${0} .scaleFactor=${0}></nami-symbol>`),u,this.scaleFactor),uy(t)):null));return e.html(GA||(GA=XA`${0}`),l)}}])}();oe([Hc({type:Object})],tx.prototype,"component",void 0),oe([Hc({type:Boolean})],tx.prototype,"inFocusedState",void 0),oe([Hc({type:Number})],tx.prototype,"scaleFactor",void 0),tx=oe([yc("nami-text-list")],tx);(()=>{var e,t=!0;try{new RegExp("􏿿","u"),new RegExp("😀","u"),new RegExp("\\p{P}","u")}catch(e){t=!1}if(!t){var n=null===(e=uy.Lexer)||void 0===e?void 0:e.rules,a=null==n?void 0:n.inline;a&&Object.values(a).forEach((e=>{e&&Object.keys(e).forEach((t=>{e[t]=(e=>{if(!(e instanceof RegExp))return e;if(!/\\p\{/.test(e.source))return e;var t="!\"#$%&'()*+,\\-./:;<=>?@[\\\\]^_`{|}~",n=e.source.replace(/\\p\{P\}\\p\{S\}/g,t).replace(/\\p\{P\}/g,t).replace(/\\p\{S\}/g,t),a=e.flags.replace(/u/g,"");return new RegExp(n,a)})(e[t])}))}))}})();var nx=function(){function t(){var e;return s(this,t),(e=o(this,t)).inFocusedState=!1,e.scaleFactor=1,e.handleFocusIn=()=>e.setFocusState(!0),e.handleFocusOut=t=>{var n,a,i=null!==(n=t.relatedTarget)&&void 0!==n?n:null;if(!i)return e.setFocusState(!1);i===e||null!==(a=e.shadowRoot)&&void 0!==a&&a.contains(i)||e.setFocusState(!1)},e.handleFocusChanged=t=>{var n=t.detail;e.setFocusState(!0===(null==n?void 0:n.inFocusedState))},e.addEventListener("focusin",e.handleFocusIn),e.addEventListener("focusout",e.handleFocusOut),e.addEventListener("focus-changed",e.handleFocusChanged),e}return g(t,Df),c(t,[{key:"disconnectedCallback",value:function(){T(t,"disconnectedCallback",this)([]),this.removeEventListener("focusin",this.handleFocusIn),this.removeEventListener("focusout",this.handleFocusOut),this.removeEventListener("focus-changed",this.handleFocusChanged)}},{key:"styles",value:function(){var t=this.component,n=this.scaleFactor,a=this.minSDKVersion,i=t.backgroundBlur,r="vertical"===t.direction,o=r?"width":"height",s=r?"margin-top":"margin-left",u=t.fillImage?e.unsafeCSS(`\n line-height: 1.5715;\n background-image: url(${t.fillImage});\n background-position: center;\n background-repeat: no-repeat;\n background-size: cover;\n height: 100%;\n width: 100%;\n `):e.unsafeCSS(Gf(t,!1));return e.unsafeCSS(`\n :host {\n box-sizing: border-box;\n display: ${t.hidden?"none":"flex"};\n ${i?`backdrop-filter: blur(${i}px);`:""}\n ${u};\n ${ov(t.position)}\n ${Vf(t)}\n ${iv(t,n,!1)}\n }\n :host(:focus),\n :host(.nami-focus-within){\n ${Gf(t,!0)}\n ${iv(t,n,!0)}\n }\n :host(:focus-visible){\n ${dv(t)}\n }\n :host > * {\n ${Kf(a,o)}\n }\n :host > *:not(:first-child) {\n ${s}: ${t.spacing?t.spacing*n:0}px;\n }\n `)}},{key:"render",value:function(){var e;return(null!==(e=this.component.components)&&void 0!==e?e:[]).map((e=>Qv(this.contextProvider,e,this.scaleFactor,void 0,this.minSDKVersion)))}},{key:"setFocusState",value:function(e){this.inFocusedState!==e&&(this.inFocusedState=e,this.classList.toggle("nami-focus-within",e),this.toggleAttribute("data-nami-focused",e))}}])}();oe([Hc({type:Object})],nx.prototype,"component",void 0),oe([Hc({type:Boolean})],nx.prototype,"inFocusedState",void 0),oe([Hc({type:Number})],nx.prototype,"scaleFactor",void 0),oe([Hc({type:Object})],nx.prototype,"minSDKVersion",void 0),nx=oe([yc("nami-container")],nx);var ax=function(){function t(){var e;return s(this,t),(e=o(this,t,arguments)).inFocusedState=!1,e.scaleFactor=1,e}return g(t,Df),c(t,[{key:"styles",value:function(){var t=this.component.backgroundBlur,n="vertical"===this.component.direction,a=n?"width":"height",i=n?"margin-top":"margin-left",r=this.component.fillImage?e.unsafeCSS(`\n line-height: 1.5715;\n background-image: url(${this.component.fillImage});\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n height: 100%;\n width: 100%;\n `):e.unsafeCSS(Gf(this.component,!1));return e.unsafeCSS(`\n :host {\n opacity: 0;\n display: ${this.component.hidden?"none":"flex"};\n ${r};\n ${t?`backdrop-filter: blur(${t}px);`:""}\n ${ov(this.component.position)}\n ${Vf(this.component)}\n ${iv(this.component,this.scaleFactor,!1)}\n transition: transform .5s ease-in;\n }\n :host > *:not(:first-child) {\n ${i}: ${this.component.spacing?this.component.spacing*this.scaleFactor:0}px;\n }\n :host(:focus){\n ${Gf(this.component,!0)}\n ${iv(this.component,this.scaleFactor,!0)}\n }\n :host(:focus-visible){\n ${dv(this.component)}\n }\n :host > * {\n ${a}: 100%;\n }\n :host(.fade-in){\n opacity: 1;\n animation: fadeIn 0.5s ease-in\n }\n @keyframes fadeIn {\n 0% { opacity: 0; }\n 100% { opacity: 1; }\n }\n `)}},{key:"updated",value:function(){var e=this.contextProvider.state.currentGroupId;zu(e,this.currentGroupId)||(this.classList.remove("fade-in"),setTimeout((()=>this.classList.add("fade-in")),100),this.currentGroupId=e)}},{key:"render",value:function(){var e,t,n=this.contextProvider.state,a=n.mediaList,i=n.currentGroupId,r=n.selectedPaywall,o=n.formFactor,s=Rd(this.contextProvider.productDetails,null!==(e=null==r?void 0:r.sku_menus)&&void 0!==e?e:[],(null===(t=this.component)||void 0===t?void 0:t.subsetGroup)||i);return pv(this.contextProvider,s,this.component,a).map((([e,t])=>(this.inFocusedState="television"==o?e:this.inFocusedState,t.map((e=>Qv(this.contextProvider,e,this.scaleFactor,this.inFocusedState,this.minSDKVersion))))))}}])}();oe([Hc({type:Object})],ax.prototype,"component",void 0),oe([Hc({type:Boolean})],ax.prototype,"inFocusedState",void 0),oe([Hc({type:Number})],ax.prototype,"scaleFactor",void 0),oe([Hc({type:Object})],ax.prototype,"minSDKVersion",void 0),ax=oe([yc("nami-product-container")],ax);var ix,rx,ox=e=>e,sx=function(){function t(){var e;return s(this,t),(e=o(this,t,arguments)).inFocusedState=!1,e.scaleFactor=1,e}return g(t,Df),c(t,[{key:"styles",value:function(){var t,n,a=this.component,i=a.imageCropping,r=a.alignment,o=a.height,s=a.width,u=a.rightMargin,l=a.spacing,d=a.hidden,h=a.blur,c="fit"===i,m=this.contextConsumer.state.formFactor;return e.unsafeCSS(`\n :host {\n display: ${"television"===m?"flex":"inline-block"};\n ${d?"display:none;":""}\n position: relative;\n height: ${zf(null!=o?o:"100%",this.scaleFactor)};\n width: ${zf(null!==(t="fitContent"==s?o:s)&&void 0!==t?t:"100%",this.scaleFactor)};\n }\n :host img {\n transition: all 0.3s;\n object-fit: ${c?"contain":"cover"};\n object-position: ${r} center;\n height: ${zf(null!=o?o:"100%",this.scaleFactor)};\n width: ${zf(null!==(n="fitContent"==s?o:s)&&void 0!==n?n:"100%",this.scaleFactor)};\n margin-right: ${u||l||0}px;\n ${h?`filter: blur(${h}px);`:""}\n flex-shrink: ${"number"==typeof s?0:1};\n }\n `)}},{key:"render",value:function(){var t,n=this.component,a=n.url,i=n.alt,r=n.title,o=n.focusedBorderColor,s=n.focusedFillColor,u=n.fillColor;return a?(!o&&qv(u,s)||(this.tabIndex=0),this.ariaLabel=null!==(t=null!=i?i:r)&&void 0!==t?t:"",e.html(ix||(ix=ox`<img src="${0}" alt="${0}" />`),a,this.ariaLabel)):(this.tabIndex=-1,this.ariaLabel=null,e.html(rx||(rx=ox``)))}}])}();oe([Hc({type:Object})],sx.prototype,"component",void 0),oe([Hc({type:Boolean})],sx.prototype,"inFocusedState",void 0),oe([Hc({type:Number})],sx.prototype,"scaleFactor",void 0),sx=oe([yc("nami-image")],sx);var ux=function(){function t(){var e;return s(this,t),(e=o(this,t,arguments)).fullscreen=!1,e.inFocusedState=!1,e.scaleFactor=1,e}return g(t,Df),c(t,[{key:"connectedCallback",value:function(){T(t,"connectedCallback",this)([]),document.body.style.background=this.component.fillColor||"transparent"}},{key:"styles",value:function(){var t;if(!this.contextConsumer||!this.component)return e.unsafeCSS("");var n=this.component,a=this.scaleFactor,i=this.contextConsumer.state.formFactor,r=n.backgroundBlur,o="vertical"===n.direction?"margin-top":"margin-left";return e.unsafeCSS(`\n :host {\n max-height: ${"television"===i?"100vh":""};\n display: ${n.hidden?"none":"flex"};\n flex-direction: column;\n overflow: hidden;\n ${Xf(n)}\n position: fixed;\n width: 100%;\n bottom: 0px;\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n z-index: ${null!==(t=n.zIndex)&&void 0!==t?t:1};\n top: 0px;\n ${r?`backdrop-filter: blur(${r}px);`:""}\n ${Gf(n,!1)}\n transition: all 0.3s;\n ${qf(n,a)}\n }\n :host(:focus){\n ${Gf(n,!0)}\n }\n :host > *:not(:first-child) {\n ${o}: ${n.spacing?n.spacing*a:0}px;\n }\n `)}},{key:"updated",value:function(){var e,t,n=Array.from(document.getElementsByTagName("nami-paywall")),a=null===(e=this.component.fillColor)||void 0===e?void 0:e.includes("gradient"),i=null===(t=this.shadowRoot)||void 0===t?void 0:t.innerHTML.includes("nami-image");n[0]&&(n[0].style.position=!i||a?"relative":"","undefined"!=typeof window&&"undefined"!=typeof CSS&&CSS.supports("height: 100dvh")?n[0].style.minHeight=!i||a?"100dvh":"100%":n[0].style.minHeight=!i||a?"100vh":"100%")}},{key:"render",value:function(){var e;return(null!==(e=this.component.components)&&void 0!==e?e:[]).map((e=>Qv(this.contextProvider,e,this.scaleFactor,void 0,this.minSDKVersion)))}}])}();oe([Hc({type:Object})],ux.prototype,"component",void 0),oe([Hc({type:Boolean})],ux.prototype,"fullscreen",void 0),oe([Hc({type:Boolean})],ux.prototype,"inFocusedState",void 0),oe([Hc({type:Number})],ux.prototype,"scaleFactor",void 0),oe([Hc({type:Object})],ux.prototype,"minSDKVersion",void 0),ux=oe([yc("nami-background-container")],ux);var lx,dx=e=>e,hx=function(){function t(){var e;return s(this,t),(e=o(this,t,arguments)).zIndex=2,e.inFocusedState=!1,e.scaleFactor=1,e}return g(t,Df),c(t,[{key:"styles",value:function(){var t,n=this.contextConsumer,a=this.component,i=this.zIndex,r=this.scaleFactor;if(!n)return e.css(lx||(lx=dx``));var o=n.state.formFactor,s=a.backgroundBlur,u="phone"!==o?"width: 100%;":"",l=null!==(t=a.width)&&void 0!==t?t:a.fixedWidth,d="phone"===o?"max-width:100%; "+(void 0!==l?`width: ${zf(l,r)};`:""):Zf(a,r),h="vertical"===a.direction?"margin-top":"margin-left";return e.unsafeCSS(`\n :host {\n box-sizing: border-box;\n display: ${a.hidden?"none":"flex"};\n position: relative;\n flex: 1;\n min-height: 0;\n ${Vf(a)}\n ${d}\n ${u}\n align-items: center;\n justify-content: flex-start;\n justify-content: start;\n ${s?`backdrop-filter: blur(${s}px);`:""}\n z-index: ${i};\n transition: all 0.3s;\n overflow-y: ${"television"===o?"hidden":"scroll"};\n overflow-x: hidden;\n scrollbar-width: none;\n ::-webkit-scrollbar {\n display: none;\n }\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n ${qf(a,r)}\n ${Gf(a,!1)}\n }\n :host::-webkit-scrollbar {\n display: none;\n }\n :host(:focus){\n ${Gf(a,!0)}\n }\n :host > * {\n width: 100%;\n }\n :host > *:not(:first-child) {\n ${h}: ${a.spacing?a.spacing*r:0}px;\n }\n `)}},{key:"firstUpdated",value:function(){var e=new CustomEvent("child-spacing",{detail:{spacing:this.component.spacing},bubbles:!0,composed:!0});this.dispatchEvent(e)}},{key:"render",value:function(){var e;return(null===(e=this.component.components)||void 0===e?void 0:e.map((e=>Qv(this.contextProvider,e,this.scaleFactor,this.inFocusedState,this.minSDKVersion))))||[]}}])}();oe([Hc({type:Object})],hx.prototype,"component",void 0),oe([Hc({type:Number})],hx.prototype,"zIndex",void 0),oe([Hc({type:Boolean})],hx.prototype,"inFocusedState",void 0),oe([Hc({type:Number})],hx.prototype,"scaleFactor",void 0),oe([Hc({type:Object})],hx.prototype,"minSDKVersion",void 0),hx=oe([yc("nami-content-container")],hx);var cx,mx=e=>e,fx=function(){function t(){var e;return s(this,t),(e=o(this,t)).inFocusedState=!1,e.scaleFactor=1,e._handleClick=t=>{t.preventDefault(),Cp({contextProvider:e.contextProvider,onTap:e.component.onTap})},e.addEventListener("click",e._handleClick),e}return g(t,Df),c(t,[{key:"styles",value:function(){var t,n,a=sv("active",this.component.components[0]),i=sv("inactive",this.component.components[0]);return e.unsafeCSS(`\n :host {\n box-sizing: border-box;\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n display: flex;\n flex: 0 0 auto;\n position: relative;\n ${Vf(this.component)}\n ${Gf(this.component,!1)}\n ${iv(this.component,this.scaleFactor,!1)}\n ${this.component.hidden?"display:none;":""}\n }\n :host(:focus){\n ${Gf(this.component,!0)}\n ${iv(this.component,this.scaleFactor,!0)}\n }\n :host(:focus-visible){\n ${dv(this.component)}\n }\n .toggle{\n ${t=this.component,n=this.scaleFactor,`\n position: absolute;\n top: ${$f(n,t.topPadding)}px;\n bottom: ${$f(n,t.bottomPadding)}px;\n width: calc(50% - ${$f(n,t.leftPadding)/2}px) !important;\n `}\n transition: transform .5s cubic-bezier(.77, 0, .175, 1);\n ${uv(i,this.scaleFactor,!1)}\n }\n\n :host(:focus) .toggle{\n ${uv(a,this.scaleFactor,!0)}\n }\n \n nami-segment-picker-item:nth-of-type(1).active~.toggle {\n transform: translateX(0%);\n left: ${this.component.leftPadding?Number(this.component.leftPadding)*this.scaleFactor:0}px;\n ${Gf(a,!0)}\n ${lv(a,this.scaleFactor)}\n }\n\n nami-segment-picker-item:nth-of-type(2).active~.toggle {\n transform: translateX(100%);\n right: ${this.component.rightPadding?Number(this.component.rightPadding)*this.scaleFactor:0}px;\n ${Gf(a,!0)}\n ${lv(a,this.scaleFactor)}\n `)}},{key:"render",value:function(){this.role="tablist";var t=this.component.components.map((e=>Qv(this.contextProvider,e,this.scaleFactor,this.inFocusedState,this.minSDKVersion)));return e.html(cx||(cx=mx`${0}<div class="toggle"></div>`),t)}}])}();oe([Hc({type:Object})],fx.prototype,"component",void 0),oe([Hc({type:Boolean})],fx.prototype,"inFocusedState",void 0),oe([Hc({type:Number})],fx.prototype,"scaleFactor",void 0),oe([Hc({type:Object})],fx.prototype,"minSDKVersion",void 0),fx=oe([yc("nami-segment-picker")],fx);var vx,px=e=>e,gx=function(){function t(){var e;return s(this,t),(e=o(this,t,arguments)).inFocusedState=!1,e.scaleFactor=1,e._handleFocus=()=>{e.inFocusedState=!0,e._announceButtonLabel()},e._handleKeyDown=t=>{"Enter"!==t.key&&" "!==t.key||e._handleClick()},e._handleClick=()=>{e._updateFormState(),e.requestUpdate("component")},e._handleHover=()=>{e.inFocusedState=!0},e}return g(t,Df),c(t,[{key:"connectedCallback",value:function(){T(t,"connectedCallback",this)([]),this._isActive=!!this.component.checked,this.classList.toggle("active",this._isActive),this.component.formId&&this._updateFormState(),this.addEventListener("click",this._handleClick),this.addEventListener("mouseover",this._handleHover),this.addEventListener("keydown",this._handleKeyDown),this.addEventListener("focus",this._handleFocus)}},{key:"disconnectedCallback",value:function(){T(t,"disconnectedCallback",this)([]),this.removeEventListener("click",this._handleClick),this.removeEventListener("mouseover",this._handleHover),this.removeEventListener("keydown",this._handleKeyDown),this.removeEventListener("focus",this._handleFocus)}},{key:"_announceButtonLabel",value:function(){var e=this.component.text||"";e&&lc(e)}},{key:"_getParentPicker",value:function(){var e=this.getRootNode();return e instanceof ShadowRoot?e.host:null}},{key:"_getParentFormId",value:function(){var e;return null===(e=this._getParentPicker())||void 0===e?void 0:e.component.formId}},{key:"_updateFormState",value:function(){if(this.contextProvider)if(this.component.formId){var e=this._getParentFormId();e&&this.contextProvider.setFormState(e,this.component.formId)}else this.component.id&&this.contextProvider.setCurrentGroupData(this.component.id,this.component.text||"")}},{key:"updated",value:function(e){var t;if(e.has("component")&&this.contextProvider){var n=null!==(t=e.get("component"))&&void 0!==t?t:this.component;if(n.formId){var a=this._getParentFormId();a&&this.contextProvider.state.formStates[a]&&(this._isActive=this.contextProvider.state.formStates[a]===n.formId)}else this._isActive=zu(n.id,this.contextProvider.state.currentGroupId);if(this.classList.toggle("active",this._isActive),this._isActive){var i=this.getRootNode();if(i instanceof ShadowRoot)i.querySelectorAll("nami-segment-picker-item").forEach((e=>{e!==this&&e.requestUpdate("component",e)}))}}}},{key:"styles",value:function(){var t,n,a=sv("active",this.component),i=sv("inactive",this.component);return e.unsafeCSS(`\n :host {\n box-sizing: border-box;\n display: ${this.component.hidden?"none":"inline-flex"};\n position: relative;\n ${uv(f({},i,this.component),this.scaleFactor,this.inFocusedState)}\n ${tv(null!==(t=this.component.inactiveDropShadow)&&void 0!==t?t:this.component.dropShadow)}\n }\n\n :host > * {\n cursor: pointer;\n }\n\n :host(.active) {\n z-index: 1 !important;\n ${lv(f({},a,this.component),this.scaleFactor)}\n ${tv(null!==(n=this.component.activeDropShadow)&&void 0!==n?n:this.component.dropShadow)}\n }\n\n input {\n visibility: hidden;\n position: absolute;\n top: 0;\n }\n `)}},{key:"render",value:function(){return this.tabIndex=0,this.role="tab",this.ariaSelected=`${this._isActive}`,this.ariaLabel=this.component.text||"",e.html(vx||(vx=px`<input type="radio"
266
268
  autocomplete="off"
267
269
  id="${0}"
268
270
  name="${0}"