@namiml/web-sdk 3.4.3-dev.202606120301 → 3.4.3-dev.202606121440

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/nami-web.mjs CHANGED
@@ -251,7 +251,7 @@ import{NAMI_SDK_VERSION as e,getExtendedClientInfo as t,PaywallState as i,logger
251
251
  .nami-modal-content nami-content-container {
252
252
  overflow: visible;
253
253
  }
254
- `)),St=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},Et=globalThis,Mt=Et.ShadowRoot&&(void 0===Et.ShadyCSS||Et.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Tt=Symbol(),Pt=new WeakMap,At=function(){return ee(function e(t,i,n){if(Y(this,e),this._$cssResult$=!0,n!==Tt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=i},[{key:"styleSheet",get:function(){var e=this.o,t=this.t;if(Mt&&void 0===e){var i=void 0!==t&&1===t.length;i&&(e=Pt.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Pt.set(t,e))}return e}},{key:"toString",value:function(){return this.cssText}}])}(),Dt=(e,t)=>{if(Mt)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(var i,n=te(t);!(i=n()).done;){var a=i.value,r=document.createElement("style"),o=Et.litNonce;void 0!==o&&r.setAttribute("nonce",o),r.textContent=a.cssText,e.appendChild(r)}},xt=Mt?e=>e:e=>e instanceof CSSStyleSheet?(e=>{for(var t,i="",n=te(e.cssRules);!(t=n()).done;){i+=t.value.cssText}return(e=>new At("string"==typeof e?e:e+"",void 0,Tt))(i)})(e):e,Ct=Object.is,It=Object.defineProperty,Lt=Object.getOwnPropertyDescriptor,_t=Object.getOwnPropertyNames,Rt=Object.getOwnPropertySymbols,Ft=Object.getPrototypeOf,Wt=globalThis,Ot=Wt.trustedTypes,$t=Ot?Ot.emptyScript:"",Nt=Wt.reactiveElementPolyfillSupport,jt=(e,t)=>e,Bt={toAttribute(e,t){switch(t){case Boolean:e=e?$t:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){var i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},zt=(e,t)=>!Ct(e,t),Ut={attribute:!0,type:String,converter:Bt,reflect:!1,useDefault:!1,hasChanged:zt};null!==(gt=Symbol.metadata)&&void 0!==gt||(Symbol.metadata=Symbol("metadata")),null!==(yt=Wt.litPropertyMetadata)&&void 0!==yt||(Wt.litPropertyMetadata=new WeakMap);var Ht=function(){function e(){var t;return Y(this,e),(t=X(this,e))._$Ep=void 0,t.isUpdatePending=!1,t.hasUpdated=!1,t._$Em=null,t._$Ev(),t}return re(e,ve(HTMLElement)),ee(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,i;(null!==(t=this._$EO)&&void 0!==t?t:this._$EO=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&(null===(i=e.hostConnected)||void 0===i||i.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,i=te(this.constructor.elementProperties.keys());!(e=i()).done;){var n=e.value;this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n])}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 Dt(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,i){this._$AK(e,i)}},{key:"_$ET",value:function(e,t){var i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(void 0!==n&&!0===i.reflect){var a,r=(void 0!==(null===(a=i.converter)||void 0===a?void 0:a.toAttribute)?i.converter:Bt).toAttribute(t,i.type);this._$Em=e,null==r?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}},{key:"_$AK",value:function(e,t){var i=this.constructor,n=i._$Eh.get(e);if(void 0!==n&&this._$Em!==n){var a,r,o,s=i.getPropertyOptions(n),u="function"==typeof s.converter?{fromAttribute:s.converter}:void 0!==(null===(a=s.converter)||void 0===a?void 0:a.fromAttribute)?s.converter:Bt;this._$Em=n;var l=u.fromAttribute(t,s.type);this[n]=null!==(r=null!=l?l:null===(o=this._$Ej)||void 0===o?void 0:o.get(n))&&void 0!==r?r:l,this._$Em=null}}},{key:"requestUpdate",value:function(e,t,i,n=!1,a){if(void 0!==e){var r,o,s=this.constructor;if(!1===n&&(a=this[e]),null!=i||(i=s.getPropertyOptions(e)),!((null!==(r=i.hasChanged)&&void 0!==r?r:zt)(a,t)||i.useDefault&&i.reflect&&a===(null===(o=this._$Ej)||void 0===o?void 0:o.get(e))&&!this.hasAttribute(s._$Eu(e,i))))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}},{key:"C",value:function(e,t,{useDefault:i,reflect:n,wrapped:a},r){var o,s,u;i&&!(null!==(o=this._$Ej)&&void 0!==o?o:this._$Ej=new Map).has(e)&&(this._$Ej.set(e,null!==(s=null!=r?r:t)&&void 0!==s?s:this[e]),!0!==a||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),!0===n&&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 le(function(i){for(;;)switch(i.p=i.n){case 0:return this.isUpdatePending=!0,i.p=1,i.n=2,K(this._$ES);case 2:i.n=4;break;case 3:i.p=3,t=i.v,Promise.reject(t);case 4:if(e=this.scheduleUpdate(),!(null!=e)){i.n=5;break}return i.n=5,K(e);case 5:return i.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,i=te(this._$Ep);!(t=i()).done;){var n=t.value,a=n[0],r=n[1];this[a]=r}this._$Ep=void 0}var o=this.constructor.elementProperties;if(o.size>0)for(var s,u=te(o);!(s=u()).done;){var l=s.value,d=l[0],h=l[1],c=h.wrapped,m=this[d];!0!==c||this._$AL.has(d)||void 0===m||this.C(d,void 0,h,m)}}var f=!1,v=this._$AL;try{var p;(f=this.shouldUpdate(v))?(this.willUpdate(v),null!==(p=this._$EO)&&void 0!==p&&p.forEach(e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)}),this.update(v)):this._$EM()}catch(v){throw f=!1,this._$EM(),v}f&&this._$AE(v)}}},{key:"willUpdate",value:function(e){}},{key:"_$AE",value:function(e){var t;null!==(t=this._$EO)&&void 0!==t&&t.forEach(e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}},{key:"_$EM",value:function(){this._$AL=new Map,this.isUpdatePending=!1}},{key:"updateComplete",get:function(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function(){return this._$ES}},{key:"shouldUpdate",value:function(e){return!0}},{key:"update",value:function(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(e=>this._$ET(e,this[e]))),this._$EM()}},{key:"updated",value:function(e){}},{key:"firstUpdated",value:function(e){}}],[{key:"addInitializer",value:function(e){var t;this._$Ei(),(null!==(t=this.l)&&void 0!==t?t:this.l=[]).push(e)}},{key:"observedAttributes",get:function(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}},{key:"createProperty",value:function(e,t=Ut){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 i=Symbol(),n=this.getPropertyDescriptor(e,i,t);void 0!==n&&It(this.prototype,e,n)}}},{key:"getPropertyDescriptor",value:function(e,t,i){var n,a=null!==(n=Lt(this.prototype,e))&&void 0!==n?n:{get(){return this[t]},set(e){this[t]=e}},r=a.get,o=a.set;return{get:r,set(t){var n=null==r?void 0:r.call(this);null!=o&&o.call(this,t),this.requestUpdate(e,n,i)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(e){var t;return null!==(t=this.elementProperties.get(e))&&void 0!==t?t:Ut}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty(jt("elementProperties"))){var e=Ft(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty(jt("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(jt("properties")))for(var e=this.properties,t=0,i=[..._t(e),...Rt(e)];t<i.length;t++){var n=i[t];this.createProperty(n,e[n])}var a=this[Symbol.metadata];if(null!==a){var r=litPropertyMetadata.get(a);if(void 0!==r)for(var o,s=te(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=te(this.elementProperties);!(h=c()).done;){var m=h.value,f=m[0],v=m[1],p=this._$Eu(f,v);void 0!==p&&this._$Eh.set(p,f)}this.elementStyles=this.finalizeStyles(this.styles)}}},{key:"finalizeStyles",value:function(e){var t=[];if(Array.isArray(e))for(var i,n=te(new Set(e.flat(1/0).reverse()));!(i=n()).done;){var a=i.value;t.unshift(xt(a))}else void 0!==e&&t.push(xt(e));return t}},{key:"_$Eu",value:function(e,t){var i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}}])}();Ht.elementStyles=[],Ht.shadowRootOptions={mode:"open"},Ht[jt("elementProperties")]=new Map,Ht[jt("finalized")]=new Map,null!=Nt&&Nt({ReactiveElement:Ht}),(null!==(bt=Wt.reactiveElementVersions)&&void 0!==bt?bt:Wt.reactiveElementVersions=[]).push("2.1.2");var Gt={attribute:!0,type:String,converter:Bt,reflect:!1,hasChanged:zt},Vt=(e=Gt,t,i)=>{var n=i.kind,a=i.metadata,r=globalThis.litPropertyMetadata.get(a);if(void 0===r&&globalThis.litPropertyMetadata.set(a,r=new Map),"setter"===n&&((e=Object.create(e)).wrapped=!0),r.set(i.name,e),"accessor"===n){var o=i.name;return{set(i){var n=t.get.call(this);t.set.call(this,i),this.requestUpdate(o,n,e,!0,i)},init(t){return void 0!==t&&this.C(o,void 0,e,t),t}}}if("setter"===n){var s=i.name;return function(i){var n=this[s];t.call(this,i),this.requestUpdate(s,n,e,!0,i)}}throw Error("Unsupported decorator location: "+n)};function Kt(e){return(t,i)=>"object"==typeof i?Vt(e,t,i):((e,t,i)=>{var n=t.hasOwnProperty(i);return t.constructor.createProperty(i,e),n?Object.getOwnPropertyDescriptor(t,i):void 0})(e,t,i)}function Xt(e){return Kt(ie({},e,{state:!0,attribute:!1}))}var Yt=function(){function e(t,i,n){var a;return Y(this,e),(a=X(this,e,[t,i,n])).host=null,a.defineDynamicStateProps(),a}return re(e,i),ee(e,[{key:"hostConnected",value:function(){}},{key:"hostDisconnected",value:function(){this.subscribers.clear()}},{key:"onStateChanged",value:function(){this.defineDynamicStateProps(),this.host&&this.host.requestUpdate()}},{key:"defineDynamicStateProps",value:function(){Object.defineProperty(this.state,"tvQuality",{get:this.getTVQuality.bind(this),enumerable:!1,configurable:!0}),Object.defineProperty(this.state,"viewportWidth",{get:this.getViewportWidth.bind(this),enumerable:!1,configurable:!0}),Object.defineProperty(this.state,"viewportHeight",{get:this.getViewportHeight.bind(this),enumerable:!1,configurable:!0})}},{key:"getTVQuality",value:function(){var e,t;if("television"!==this.getFormFactor())return"";var i=window.devicePixelRatio||1,n=window.innerWidth||(null===(e=window.screen)||void 0===e?void 0:e.availWidth),a=window.innerHeight||(null===(t=window.screen)||void 0===t?void 0:t.availHeight);if(!n||!a)return"720p";var r=Math.max(n,a)*i,o=Math.min(n,a)*i;return r>=3840||o>=2160?"4K":r>=1920||o>=1080?"1080p":"720p"}},{key:"getViewportWidth",value:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}},{key:"getViewportHeight",value:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}}],[{key:"create",value:function(t,i,n){var a=new e(t,i,n);return this.providers.push(a),a}},{key:"remove",value:function(e){this.providers=this.providers.filter(t=>t!==e)}},{key:"currentProvider",get:function(){return this.providers[0]}}])}();var qt=e=>{var t;return le(function(i){for(;;)if(0===i.n)return t=new Set(Array.from(document.fonts.values()).map(e=>e.family)),e.forEach(e=>{var i=Jt(e);if(!t.has(i)){var n=new FontFace(i,`url(${e.file})`);document.fonts.add(n)}}),i.a(2,document.fonts.ready.then())},null,null,null,Promise)};function Jt(e){return`${e.family}-${e.style}`.replace(/ /g,"")}function Qt(e,t,i){var a,r,o,s,u,l,d,h;if("undefined"==typeof window||!e||!t)return n.debug("Swipe detection is not supported in this environment."),{destroy(){},updateOptions(){}};var c={minDistance:null!==(a=null==i?void 0:i.minDistance)&&void 0!==a?a:30,maxDuration:null!==(r=null==i?void 0:i.maxDuration)&&void 0!==r?r:600,lockAxis:null===(o=null==i?void 0:i.lockAxis)||void 0===o||o,preventScrollOnSwipe:null!==(s=null==i?void 0:i.preventScrollOnSwipe)&&void 0!==s&&s,pointerTypes:null!==(u=null==i?void 0:i.pointerTypes)&&void 0!==u?u:["touch"],passiveListeners:null===(l=null==i?void 0:i.passiveListeners)||void 0===l||l,axisHint:null!==(d=null==i?void 0:i.axisHint)&&void 0!==d?d:"y",edgeLeakThreshold:null!==(h=null==i?void 0:i.edgeLeakThreshold)&&void 0!==h?h:24},m=e.style.touchAction;c.preventScrollOnSwipe&&(e.style.touchAction="none");var f=null,v=0,p=0,g=0,y=0,b=0,w=null,k=null,S=!1,E=!1,M=!1,T=e=>{try{var t=window.getComputedStyle(e);if(!t)return!1;var i=t.overflowY;if("auto"!==i&&"scroll"!==i)return!1;var n=e;return n.scrollHeight>n.clientHeight}catch(e){return!1}},P=e=>c.pointerTypes.includes(e.pointerType),A=t=>{var i=t.composedPath?t.composedPath()[0]:t.target;if(P(t)&&null===f){f=t.pointerId,v=g=t.clientX,p=y=t.clientY,b=performance.now(),w=null,M=!1,S=!1,E=!1,(k="y"===c.axisHint?((e,t)=>{for(var i=e;i&&i!==t&&i instanceof HTMLElement;){var n,a;if(T(i))return i;i=i.parentElement||(null!==(n=null===(a=i.parentNode)||void 0===a?void 0:a.host)&&void 0!==n?n:null)}return null})(i,e):null)||(E=!0);try{var n;null==e||null===(n=e.setPointerCapture)||void 0===n||n.call(e,t.pointerId)}catch(e){try{var a;null==i||null===(a=i.setPointerCapture)||void 0===a||a.call(i,t.pointerId)}catch(e){}}}},D=e=>{if(e.pointerId===f&&P(e)){if(g=e.clientX,y=e.clientY,c.lockAxis&&!w){var i=Math.abs(g-v),n=Math.abs(y-p);(i>2||n>2)&&(w=n>=i?"y":"x")}if("y"===c.axisHint&&("y"===w||!c.lockAxis)){var a=y-p,r=a<0?"up":"down",o=Math.abs(a),s=performance.now()-b,u=o/Math.max(s,1),l=o>=c.minDistance||u>.5;if(k)if(l)E=!0;else if(((e,t)=>!!e&&("down"===t?e.scrollTop>0:e.scrollTop+e.clientHeight<e.scrollHeight-1))(k,r)){if(!(("down"===r&&k.scrollTop<=50||"up"===r&&k.scrollTop+k.clientHeight>=k.scrollHeight-50)&&u>.3))return void(S=!0);E=!0}else E=!0;var d=!k||o>=c.edgeLeakThreshold;if(!M&&!S&&E&&d&&o>=c.minDistance){M=!0;var h=performance.now(),m={direction:"up"===r?"up":"down",distanceX:g-v,distanceY:a,absX:Math.abs(g-v),absY:o,duration:h-b,velocity:o/Math.max(h-b,1),startX:v,startY:p,endX:g,endY:y,startedAt:b,endedAt:h,originalEvent:e};t(m)}}}},x=e=>{if(e.pointerId===f)if(P(e))if(k)C();else if(M||S)C();else{var i,n=performance.now(),a=n-b,r=g-v,o=y-p,s=Math.abs(r),u=Math.abs(o),l="x"===(i=c.lockAxis&&w?w:"x"===c.axisHint?"x":"y"===c.axisHint?"y":s>=u?"x":"y")?s:u,d=a<=c.maxDuration,h=c.minDistance;if(k&&"y"===i&&E&&(h+=c.edgeLeakThreshold),d&&l>=h){var m;m="x"===i?r>0?"right":"left":o>0?"down":"up";var T=l/Math.max(a,1);t({direction:m,distanceX:r,distanceY:o,absX:s,absY:u,duration:a,velocity:T,startX:v,startY:p,endX:g,endY:y,startedAt:b,endedAt:n,originalEvent:e})}C()}else C()},C=()=>{f=null,w=null,b=0,k=null,E=!1,S=!1,M=!1},I=!!c.passiveListeners&&{passive:!0},L=c.passiveListeners?{passive:!0,capture:!0}:{capture:!0};e.addEventListener("pointerdown",A,L),e.addEventListener("pointermove",D,I),e.addEventListener("pointerup",x,I),e.addEventListener("pointercancel",x,I),e.addEventListener("lostpointercapture",x,I);return{destroy:()=>{e.removeEventListener("pointerdown",A,L),e.removeEventListener("pointermove",D,I),e.removeEventListener("pointerup",x,I),e.removeEventListener("pointercancel",x,I),e.removeEventListener("lostpointercapture",x,I),c.preventScrollOnSwipe&&(e.style.touchAction=m),C()},updateOptions:t=>{Object.assign(c,t),"boolean"==typeof t.preventScrollOnSwipe&&(t.preventScrollOnSwipe?e.style.touchAction="none":e.style.touchAction=m)}}}var Zt={},ei=Zt.NAMI_CLOSE_PAYWALL,ti=void 0===ei?"namiClosePaywall":ei,ii=Zt.NAMI_RESTORE_PURCHASES,ni=void 0===ii?"namiRestorePurchases":ii,ai=Zt.NAMI_SIGN_IN,ri=void 0===ai?"namiSignIn":ai,oi=Zt.NAMI_BUY_SKU,si=void 0===oi?"namiBuySKU":oi,ui=Zt.SET_STATE,li=void 0===ui?"setState":ui,di=Zt.NAMI_SELECT_SKU,hi=void 0===di?"namiSelectSKU":di,ci=Zt.NAMI_PURCHASE_SELECTED_SKU,mi=void 0===ci?"namiPurchaseSelectedSKU":ci,fi=Zt.NAMI_DEEP_LINK,vi=void 0===fi?"namiDeeplink":fi,pi=Zt.NAMI_NAVIGATE_TO_SCREEN,gi=void 0===pi?"namiNavigateToScreen":pi,yi=Zt.NAMI_RELOAD_PRODUCTS,bi=void 0===yi?"namiReloadProducts":yi,wi=Zt.NAMI_PLAY_VIDEO,ki=void 0===wi?"namiPlayVideo":wi,Si=Zt.NAMI_PAUSE_VIDEO,Ei=void 0===Si?"namiPauseVideo":Si,Mi=Zt.NAMI_MUTE_VIDEO,Ti=void 0===Mi?"namiMuteVideo":Mi,Pi=Zt.NAMI_UNMUTE_VIDEO,Ai=void 0===Pi?"namiUnmuteVideo":Pi,Di=e=>"subscription"===e;function xi(e){if(Di(null==e?void 0:e.product_type)){var t=Ii(e);if(t.length>0)return t[0].billingPeriod}return null}function Ci(e){var t=function(e){if(!e)return[];var t=e.offers.filter(e=>"promo"===e.offer_type);return Li(t,e.subscription_period)}(e).find(e=>0===e.priceAmountMicros);return(null==t?void 0:t.billingPeriod)||null}function Ii(e){return e?Li(e.offers.filter(e=>"default"===e.offer_type),e.subscription_period):[]}function Li(e,t){return e.map(e=>_i(e,t))}function _i(e,t){var i,n,a,r,o,s,u,l;if(!e)return{};var d=null!==(i=null===(n=e.promo_period)||void 0===n?void 0:n.count)&&void 0!==i?i:null==t?void 0:t.count,h=null!==(a=null===(r=e.promo_period)||void 0===r?void 0:r.type)&&void 0!==a?a:null==t?void 0:t.type,c=null!==(o=null===(s=e.promo_price)||void 0===s?void 0:s.price)&&void 0!==o?o:e.price,m=null!==(u=null===(l=e.promo_price)||void 0===l?void 0:l.currency)&&void 0!==u?u:e.currency;return{priceAmountMicros:1e6*c,priceCurrencyCode:m,billingPeriod:h?`P${d}${h[0].toUpperCase()}`:"",formattedPrice:Wi(m).format(c)}}function Ri(e,t=!1,i=!1,n=!1,r=!1){if(!e)return null;var o=e.match(/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/);if(!o)return null;var s=o.slice(1).map(e=>parseInt(e)),u=s[0],l=s[1],d=s[2],h=s[3],c=(e,t,i,n,o)=>{var s=(e=>r?`${e}_abbrev`:e)(o),u=(e=>r?`${e}_abbrev_plural`:`${e}_plural`)(o),l=a(s),d=a(u);return r||l!==s||(l=a(`${o}_abbrev`)),r||d!==u||(d=a(`${o}_abbrev_plural`)),n?e.toString():i?1===e||t?l:d:1===e||t?`${e} ${l}`:`${e} ${d}`};switch(e.at(-1)){case"D":return c(h,t,i,n,"nami_day");case"W":return c(d,t,i,n,"nami_week");case"M":return c(l,t,i,n,"nami_month");case"Y":return c(u,t,i,n,"nami_year")}return null}function Fi(e){var t;if(!e||e.length<2)return!1;var i=null===(t=e.at(-1))||void 0===t?void 0:t.toUpperCase();return"M"===i||"Y"===i}function Wi(e){var t={maximumFractionDigits:2,minimumFractionDigits:0};try{return new Intl.NumberFormat(navigator.language,ie({},t,{style:"currency",currency:e}))}catch(e){return new Intl.NumberFormat(navigator.language,ie({},t,{style:"currency",currency:"USD"}))}}var Oi=(e,t,i)=>e&&t&&i?i.format(e-t):null,$i=(e,t,i,n)=>{if(e&&t&&i&&n){var a=100*(1-e/(i/n*t));return`${Math.round(a)}%`}return null},Ni=(e,t)=>{if(""!=t){var i=parseInt(t)-1;return i>=0&&i<(null==e?void 0:e.length)?e[i]:null==e?void 0:e.find(e=>e.sku_ref_id===t)}},ji=e=>zi(e.priceAmountMicros)/Bi(e.billingPeriod),Bi=e=>{var t=parseInt(e[1]);return e.includes("Y")&&(t*=12),t},zi=e=>e/1e6;function Ui(e){return parseFloat((Math.round(e)/100).toFixed(2))}var Hi=(e,t,i=[])=>({price:()=>Vi(e),name:()=>null==e?void 0:e.name,title:()=>null==e?void 0:e.name,description:()=>null==e?void 0:e.description,duration:()=>Ki(e),durationSingular:()=>Ki(e,!0),period:()=>Ki(e,!1,!0),periodNumber:()=>Ki(e,!1,!1,!0),freeTrialDuration:()=>Xi(e),freeTrialDurationSingular:()=>Xi(e,!0),freeTrialPeriod:()=>Xi(e,!1,!0),freeTrialPeriodNumber:()=>Xi(e,!1,!1,!0),pricePerMonth:()=>Yi(e),pricePerMonthRounded:()=>Yi(e,!0),periodInMonths:()=>qi(e),durationInMonths:()=>Ji(e),durationInMonthsSingular:()=>Ji(e,!0),periodNumberInMonths:()=>Qi(e),percentagePriceDifferenceFromSku:()=>Zi(e,t,i),priceDifferenceFromSku:()=>en(e,t,i),promoEligible:()=>null===tn(e)&&null!==nn(e,t),freeTrialEligible:()=>null!==tn(e),promo:()=>{var i;return null===(i=nn(e,t))||void 0===i?void 0:i.offer_ref_id},promoCode:()=>"XXXXX",promoPrice:()=>{var i;return null===(i=an(e,t))||void 0===i?void 0:i.formattedPrice},promoPeriod:()=>rn(e,t,!1,!0),promoPeriodNumber:()=>rn(e,t,!1,!1,!0),promoDuration:()=>rn(e,t),promoDurationSingular:()=>rn(e,t,!0),introEligible:()=>!1,pricePerDay:()=>dn(e),pricePerWeek:()=>hn(e),pricePerWeekRounded:()=>hn(e,!0),introductoryPrice:()=>un(e,t),introductoryPeriod:()=>sn(e,t,!1,!0),introductoryPeriodNumber:()=>sn(e,t,!1,!1,!0),introductoryDuration:()=>sn(e,t),introductoryDurationSingular:()=>sn(e,t,!0),introductoryPricePerMonth:()=>ln(e,t),introductoryPricePerMonthRounded:()=>ln(e,t,!0),durationAbbrev:()=>Ki(e,!1,!1,!1,!0),freeTrialDurationAbbrev:()=>Xi(e,!1,!1,!1,!0),introductoryDurationAbbrev:()=>sn(e,t,!1,!1,!1,!0),promoDurationAbbrev:()=>rn(e,t,!1,!1,!1,!0),promoDurationPhase2Abbrev:()=>rn(e,t,!0,!0,!1,!0),durationInMonthsAbbrev:()=>Ji(e,!1,!1,!1,!0),durationSingularAbbrev:()=>Ki(e,!0,!1,!1,!0),freeTrialDurationSingularAbbrev:()=>Xi(e,!0,!1,!1,!0),introductoryDurationSingularAbbrev:()=>sn(e,t,!0,!1,!1,!0),promoDurationSingularAbbrev:()=>rn(e,t,!0,!1,!1,!0),promoDurationSingularPhase2Abbrev:()=>rn(e,t,!0,!0,!1,!0),durationInMonthsSingularAbbrev:()=>Ji(e,!0,!1,!1,!0),periodAbbrev:()=>Ki(e,!1,!0,!1,!0),freeTrialPeriodAbbrev:()=>Xi(e,!1,!0,!1,!0),introductoryPeriodAbbrev:()=>sn(e,t,!1,!0,!1,!0),promoPeriodAbbrev:()=>rn(e,t,!1,!0,!1,!0),promoPeriodPhase2Abbrev:()=>rn(e,t,!1,!0,!0,!0),periodInMonthsAbbrev:()=>Ji(e,!1,!0,!1,!0),periodly:()=>function(e){if(!e)return null;var t=e.match(/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/);if(!t)return null;var i=t[1],n=t[2],r=t[3],o=t[4],s=void 0!==i?parseInt(i,10):0,u=void 0!==n?parseInt(n,10):0,l=void 0!==r?parseInt(r,10):0;return(void 0!==o?parseInt(o,10):0)>0?null:l>0?1===l?a("nami_weekly"):2===l?a("nami_biweekly"):null:u>0?a(1===u?"nami_monthly":2===u?"nami_bimonthly":3===u?"nami_quarterly":6===u?"nami_biannually":12===u?"nami_yearly":"nami_monthly"):s>0?a("nami_yearly"):null}(xi(e)),iso_subscription_duration:()=>cn(e),invalid:()=>!1,unavailable:()=>!1}),Gi=(e,t,i,n=[])=>{if(!t)return null;var a=Hi(t,i,n);return a[e]?a[e]():null},Vi=e=>{var t=Ii(e);return t&&t.length?t[0].formattedPrice:null},Ki=(e,t,i,n,a)=>Ri(xi(e),t,i,n,a),Xi=(e,t,i,n,a)=>Ri(Ci(e),t,i,n,a),Yi=(e,t)=>{var i=Ii(e);if(!i||0===i.length)return null;var n=ji(i[0]);return n?Wi(i[0].priceCurrencyCode).format(t?Math.round(n):n):null},qi=(e,t)=>{var i=Ii(e);if(!i||0===i.length)return null;var n=i[0].billingPeriod;return Fi(n)?Ri("P1Y"===n?"P12M":n,!1,!1,!1,t):null},Ji=(e,t,i,n,a)=>{var r=Ii(e);if(!r||0===r.length)return null;var o=r[0].billingPeriod;return Fi(o)?Ri("P1Y"===o?"P12M":o,t,i,n,a):null},Qi=e=>{if(!e)return 0;var t=Ii(e);return t&&t.length?Bi(t[0].billingPeriod):0},Zi=(e,t,i=[])=>{var n,a=Ii(e);if(!a||0===a.length)return null;var r=null===(n=Ni(i,null!=t?t:""))||void 0===n?void 0:n.product_details;if(!t||!r)return $i(Ui(a[0].priceAmountMicros),Qi(e));var o=Ii(r);return $i(Ui(a[0].priceAmountMicros),Qi(e),(null==o?void 0:o.length)>0?Ui(o[0].priceAmountMicros):0,Qi(r))},en=(e,t,i=[])=>{var n,a=Ii(e);if(!a||0===a.length)return null;var r=null===(n=Ni(i,null!=t?t:""))||void 0===n?void 0:n.product_details;if(!t||!r)return Oi(ji(a[0]));var o=Ii(r);return Oi(ji(a[0]),ji(o[0]),Wi(o[0].priceCurrencyCode))},tn=e=>Ci(e),nn=(e,t)=>{if(!e)return null;var i=e.offers.filter(e=>"promo"===e.offer_type);if(!t)return i[0]||null;var n=i[parseInt(t)];return n?n||null:i.find(e=>e.offer_ref_id===t)||null},an=(e,t)=>{if(!e)return null;var i=nn(e,t);return i?_i(i,e.subscription_period):null},rn=(e,t,i,n,a,r)=>{var o=an(e,t);return Ri((null==o?void 0:o.billingPeriod)||null,i,n,a,r)},on=(e,t)=>{if(!e)return null;var i=((e,t)=>{if(!e)return null;var i=e.offers.filter(e=>"intro"===e.offer_type);if(!t)return i[0]||null;var n=i[parseInt(t)];return n?n||null:i.find(e=>e.offer_ref_id===t)||null})(e,t);return i?_i(i,e.subscription_period):null},sn=(e,t,i,n,a,r)=>{var o=on(e,t);return Ri((null==o?void 0:o.billingPeriod)||null,i,n,a,r)},un=(e,t)=>{var i=on(e,t);return i?i.formattedPrice:null},ln=(e,t,i)=>{var n=on(e,t);if(!n)return null;var a=ji(n);return a?Wi(n.priceCurrencyCode).format(i?Math.round(a):a):null},dn=e=>{var t=Ii(e);if(!t||0===t.length)return null;var i,n,a=zi(t[0].priceAmountMicros)/(i=t[0].billingPeriod,(n=Bi(i))?30.437*n:1);return Wi(t[0].priceCurrencyCode).format(a)},hn=(e,t)=>{var i=Ii(e);if(!i||0===i.length)return null;var n,a,r=zi(i[0].priceAmountMicros)/(n=i[0].billingPeriod,(a=Bi(n))?52*a/12:1);return Wi(i[0].priceCurrencyCode).format(t?Math.round(r):r)},cn=e=>{var t=Ii(e)[0];return t?t.billingPeriod:null},mn="object"==typeof global&&global&&global.Object===Object&&global,fn="object"==typeof self&&self&&self.Object===Object&&self,vn=mn||fn||Function("return this")(),pn=vn.Symbol;var gn=Array.isArray,yn=Object.prototype,bn=yn.hasOwnProperty,wn=yn.toString,kn=pn?pn.toStringTag:void 0;var Sn=Object.prototype.toString;var En=pn?pn.toStringTag:void 0;function Mn(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":En&&En in Object(e)?function(e){var t=bn.call(e,kn),i=e[kn];try{e[kn]=void 0;var n=!0}catch(e){}var a=wn.call(e);return n&&(t?e[kn]=i:delete e[kn]),a}(e):function(e){return Sn.call(e)}(e)}function Tn(e){return null!=e&&"object"==typeof e}var Pn=pn?pn.prototype:void 0,An=Pn?Pn.toString:void 0;function Dn(e){if("string"==typeof e)return e;if(gn(e))return function(e,t){for(var i=-1,n=null==e?0:e.length,a=Array(n);++i<n;)a[i]=t(e[i],i,e);return a}(e,Dn)+"";if(function(e){return"symbol"==typeof e||Tn(e)&&"[object Symbol]"==Mn(e)}(e))return An?An.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function xn(e){return null==e?"":Dn(e)}function Cn(e,t,i){var n=e.length;return i=void 0===i?n:i,!t&&i>=n?e:function(e,t,i){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(i=i>a?a:i)<0&&(i+=a),a=t>i?0:i-t>>>0,t>>>=0;for(var r=Array(a);++n<a;)r[n]=e[n+t];return r}(e,t,i)}var In=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function Ln(e){return In.test(e)}var _n="\\ud800-\\udfff",Rn="["+_n+"]",Fn="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Wn="\\ud83c[\\udffb-\\udfff]",On="[^"+_n+"]",$n="(?:\\ud83c[\\udde6-\\uddff]){2}",Nn="[\\ud800-\\udbff][\\udc00-\\udfff]",jn="(?:"+Fn+"|"+Wn+")"+"?",Bn="[\\ufe0e\\ufe0f]?",zn=Bn+jn+("(?:\\u200d(?:"+[On,$n,Nn].join("|")+")"+Bn+jn+")*"),Un="(?:"+[On+Fn+"?",Fn,$n,Nn,Rn].join("|")+")",Hn=RegExp(Wn+"(?="+Wn+")|"+Un+zn,"g");function Gn(e){return Ln(e)?function(e){return e.match(Hn)||[]}(e):function(e){return e.split("")}(e)}var Vn,Kn=(Vn="toUpperCase",function(e){var t=Ln(e=xn(e))?Gn(e):void 0,i=t?t[0]:e.charAt(0),n=t?Cn(t,1).join(""):e.slice(1);return i[Vn]()+n});var Xn,Yn=(Xn={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},function(e){return null==Xn?void 0:Xn[e]}),qn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Jn=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var Qn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var Zn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var ea="\\ud800-\\udfff",ta="\\u2700-\\u27bf",ia="a-z\\xdf-\\xf6\\xf8-\\xff",na="A-Z\\xc0-\\xd6\\xd8-\\xde",aa="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ra="["+aa+"]",oa="\\d+",sa="["+ta+"]",ua="["+ia+"]",la="[^"+ea+aa+oa+ta+ia+na+"]",da="(?:\\ud83c[\\udde6-\\uddff]){2}",ha="[\\ud800-\\udbff][\\udc00-\\udfff]",ca="["+na+"]",ma="(?:"+ua+"|"+la+")",fa="(?:"+ca+"|"+la+")",va="(?:['’](?:d|ll|m|re|s|t|ve))?",pa="(?:['’](?:D|LL|M|RE|S|T|VE))?",ga="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",ya="[\\ufe0e\\ufe0f]?",ba=ya+ga+("(?:\\u200d(?:"+["[^"+ea+"]",da,ha].join("|")+")"+ya+ga+")*"),wa="(?:"+[sa,da,ha].join("|")+")"+ba,ka=RegExp([ca+"?"+ua+"+"+va+"(?="+[ra,ca,"$"].join("|")+")",fa+"+"+pa+"(?="+[ra,ca+ma,"$"].join("|")+")",ca+"?"+ma+"+"+va,ca+"+"+pa,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",oa,wa].join("|"),"g");function Sa(e,t,i){return e=xn(e),void 0===t?function(e){return Zn.test(e)}(e)?function(e){return e.match(ka)||[]}(e):function(e){return e.match(Qn)||[]}(e):e.match(t)||[]}var Ea=RegExp("['’]","g");var Ma,Ta=(Ma=function(e,t,i){return t=t.toLowerCase(),e+(i?Kn(xn(t).toLowerCase()):t)},function(e){return function(e,t,i){for(var n=-1,a=null==e?0:e.length;++n<a;)i=t(i,e[n],n,e);return i}(Sa(function(e){return(e=xn(e))&&e.replace(qn,Yn).replace(Jn,"")}(e).replace(Ea,"")),Ma,"")});function Pa(e,t,i){var n,a,r=null!==(n=null===(a=t.find(e=>e.id===i))||void 0===a?void 0:a.products)&&void 0!==n?n:[];return r.forEach(t=>{t.product_details=Ca(e,t.sku_ref_id||""),t.variables=function(e,t,i){if(!t)return{};var n=t.variables;if(!n)return ie({},t);Object.keys(n).forEach(t=>{if(Aa(n[t])){var a=xa(n[t],e,i);n[t]=function(e){if(!e||e.includes("null")||e.includes("undefined"))return"";if(/\$\{\s*(launch\.customAttributes\.|sku\.)\w+\s*}/.test(e))return"";return e}(a)}});var a={};return(()=>Object.keys(Hi({})))().forEach(t=>{if(void 0===n[t]){var r=Gi(t,e,void 0,i);null!==r&&(a[t]=r)}}),ie({},t,a,n)}(t.product_details,t,r)}),r}function Aa(e){return"string"==typeof e&&e.includes(r)}function Da(e,t,i){return t?(Object.keys(t).forEach(n=>{Aa(t[n])&&(t[n]=t[Ta(n)]=xa(t[n],e,i))}),ie({},t)):{}}var xa=(e,t,i)=>e.replace(o,(n,a)=>{var r,s,u,l,d=(null===(r=o.exec(e))||void 0===r?void 0:r.slice(1))||[];a=null!==(s=d[0])&&void 0!==s?s:a;var h=null!==(u=null===(l=d[1])||void 0===l?void 0:l.replace(":",""))&&void 0!==u?u:"";return Gi(a,t,h,i)});function Ca(e=[],t=""){return e.find(e=>e.product_ref_id===t)||null}var Ia=["conditionAttributes"];function La(e,t){return Array.isArray(e)?e.reduce((e,i)=>{var n=La(i,t);return Array.isArray(n)?[...e,...n]:[...e,n]},[]):null==e?e:"object"==typeof e?Object.entries(e).reduce((e,[i,n])=>{var a="newRow"===i?n:La(n,t);return ie({},e,{[i]:a})},{}):"string"==typeof e?ja(e,t):e}function _a(e,t,i,n={}){var a=i.productBaseComponents||i.components||[],r=i.productFeaturedComponents||a;return t.map(t=>{var i,o,s,u=t.featured?r:a,l=t.entitlements.map(e=>e.entitlement_ref_id),h=Ca(e.productDetails,t.sku_ref_id),c={freeTrialEligible:1==Gi("freeTrialEligible",h),introEligible:1==Gi("introEligible",h),promoEligible:1==Gi("promoEligible",h),invalid:Gi("invalid",h),unavailable:Gi("unavailable",h)},m=ie({},t,t.variables,c,{id:t.id,entitlements:l});o=t,s=e=>{for(var t,i=te(e);!(t=i()).done;){var n=t.value;n.sku=d(o),n.components&&s(n.components),n.collapseHeader&&n.collapseHeader.components&&s(n.collapseHeader.components)}},s(u);var f={sku:m,media:Na(n,{convertToUrl:!0})};return[null!==(i=t.featured)&&void 0!==i&&i,La(u,La(f,f))]},[])}function Ra(e,t){if(!t.loopSource)return[];var i="string"==typeof t.loopSource?JSON.parse(t.loopSource):t.loopSource,n=(null!=i?i:[]).filter(i=>{var n;return!(null!==(n=t.loopSourceConditions)&&void 0!==n&&n.length)||t.loopSourceConditions.every(t=>$a(e,t,i))}),a=t.groupBy,r=t.groupHeaderTemplate,o=e=>La(t.components,La({block:e},{block:e}));if(!a||!r)return[{key:"",header:null,items:n.map(o).filter(e=>null!=e)}];for(var s,u=[],l=new Map,d=te(n);!(s=d()).done;){var h=s.value,c=La(a,La({block:h},{block:h})),m=null==c?"":String(c);l.has(m)||(u.push(m),l.set(m,[])),l.get(m).push(h)}return u.map(e=>{var t={key:e};return{key:e,header:[La(r,La({group:t},{group:t}))],items:l.get(e).map(o)}})}function Fa(e,t){return t.assertions?t.assertions.every($a.bind(null,e)):!!t.orAssertions&&(!t.orAssertions.length||t.orAssertions.some($a.bind(null,e)))}function Wa(e,t){var i=t.conditionAttributes,n=function(e,t){if(null==e)return{};var i={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;i[n]=e[n]}return i}(t,Ia);return i?i.reduce((t,i)=>Fa(e,i)?(Object.entries(i.attributes).forEach(([t,n])=>{i.attributes[t]=Oa(e,n)}),ie({},t,i.attributes)):t,n):n}function Oa(e,t,i,n=null){var a,o=null!==(a=null==e?void 0:e.flow)&&void 0!==a?a:{},u=o.manager,l=o.previousStepAvailable,d=o.nextStepAvailable,h=e.state,c={};return n&&(c={block:n}),c=ie({},c,{state:h,urlParams:s(),flow:{isLaunched:!(null==u||!u.flowOpen),previousStepAvailable:!!l,nextStepAvailable:!!d},launch:h.launch,sku:h.sku,customer:h.customer}),"string"==typeof t&&t.includes(r)&&(t=ja(t,c)),t}function $a(e,{value:t,expected:i,operator:n},a){if(t=Oa(e,t,0,a),i=Oa(e,i,0,a),"equals"===n)return t===i;if("notEquals"===n)return t!==i;if("contains"===n){var r;if(Array.isArray(t)||"string"==typeof t||t instanceof String||(t=t.toString()),"collapse"==i)i+="_"+(null===(r=e.getCurrentCollapsibleSku())||void 0===r?void 0:r.skuId);return t.includes(i)}return"notContains"===n?(Array.isArray(t)||"string"==typeof t||t instanceof String||(t=t.toString()),!t.includes(i)):"set"===n?"boolean"==typeof i?!!t&&!t.toString().match(u)===i:!!t&&!t.toString().match(u):"notSet"===n?!t||t.toString().match(u):"gt"===n?t>i:"gte"===n?t>=i:"lt"===n?t<i:"lte"===n&&t<=i}function Na(e,{convertToUrl:t}={convertToUrl:!1}){return Object.entries(e).reduce((e,[i,{content:n}])=>(t&&"string"!=typeof n&&n&&(n=URL.createObjectURL(n)),ie({},e,{[i]:n})),{})}function ja(e,t){var i=e;if("string"!=typeof e)return i;for(var n,a=new RegExp(l.source,l.flags),r=[];null!==(n=a.exec(e))&&(r.push(n),a.global);)n.index===a.lastIndex&&a.lastIndex++;for(var o=0,s=r;o<s.length;o++){var u=s[o],d=u[0],h=u[1],c=ja(h,t);if(d===e)return m(d,c);c!==h&&(i=i.replace(h,c)),i=i.replace(l,m)}return i;function m(e,i){var n=String(i).split("."),a=n[0];if(!a)return e;var r=Ba(t,a);if(void 0===r)return e;if("object"==typeof r&&null!==r&&0===Object.keys(r).length)return"";var o=Ba(t,...n);return void 0===o?"":"string"!=typeof o?o:ja(o,t)}}function Ba(e,...t){for(var i=e,n=0,a=t;n<a.length;n++){var r=a[n];if(null==i)return;i=Array.isArray(i)?i[+r]:i[r]}return i}var za=e=>{var t=e.state.timeSpentOnPaywall;if(t)return Date.now()-t},Ua=e=>{if(!e)return null;if(e.includes("#"))return e;var t=e.match(/[\d.]+/g);if(!t||t.length<3)return null;var i=t.map(Number),n=i[0],a=i[1],r=i[2],o=i[3],s=e=>Math.round(e).toString(16).padStart(2,"0"),u=void 0!==o&&o<1?s(255*o):"";return`#${s(n)}${s(a)}${s(r)}${u}`},Ha=(e,t)=>{if(!e||!t)return!0;var i=null!=e&&e.includes("rgb")?Ua(e):e,n=null!=t&&t.includes("rgb")?Ua(t):t;return(null==i?void 0:i.toLowerCase())===(null==n?void 0:n.toLowerCase())};function Ga(e){var t,i,n,a,r,o,s,u,l,d,h,c,m;return{width:null!==(t=e.width)&&void 0!==t?t:20,railSpacing:null!==(i=e.railSpacing)&&void 0!==i?i:12,dotLineSpacing:null!==(n=e.dotLineSpacing)&&void 0!==n?n:10,lineTopOffset:null!==(a=e.lineTopOffset)&&void 0!==a?a:0,lineBottomOffset:null!==(r=e.lineBottomOffset)&&void 0!==r?r:0,lineWidth:null!==(o=e.lineWidth)&&void 0!==o?o:1,lineColor:null!==(s=e.lineColor)&&void 0!==s?s:"#C6CBD7",lineCornerRadius:null!==(u=e.lineCornerRadius)&&void 0!==u?u:0,dotSize:null!==(l=e.dotSize)&&void 0!==l?l:6,dotColor:null!==(d=e.dotColor)&&void 0!==d?d:"#C6CBD7",dotCornerRadius:null!==(h=e.dotCornerRadius)&&void 0!==h?h:3,dotBorderWidth:null!==(c=e.dotBorderWidth)&&void 0!==c?c:0,dotBorderColor:null!==(m=e.dotBorderColor)&&void 0!==m?m:"transparent",conditionAttributes:e.conditionAttributes}}function Va(e,t,i){for(var n,a=Ga(t),r={key:i},o=La(t,La({group:r},{group:r})),s={dotSize:a.dotSize,dotColor:a.dotColor,dotCornerRadius:a.dotCornerRadius,dotBorderWidth:a.dotBorderWidth,dotBorderColor:a.dotBorderColor},u=te(null!==(l=o.conditionAttributes)&&void 0!==l?l:[]);!(n=u()).done;){var l,d,h=n.value;if(Fa(e,h)){var c=null!==(d=h.attributes)&&void 0!==d?d:{};s={dotSize:"number"==typeof c.dotSize?c.dotSize:s.dotSize,dotColor:"string"==typeof c.dotColor?c.dotColor:s.dotColor,dotCornerRadius:"number"==typeof c.dotCornerRadius?c.dotCornerRadius:s.dotCornerRadius,dotBorderWidth:"number"==typeof c.dotBorderWidth?c.dotBorderWidth:s.dotBorderWidth,dotBorderColor:"string"==typeof c.dotBorderColor?c.dotBorderColor:s.dotBorderColor}}}return s.dotCornerRadius=Math.min(s.dotCornerRadius,s.dotSize/2),s}var Ka=!0,Xa=!1,Ya=!1,qa=!1,Ja=!1,Qa=!1,Za=null,er=null,tr=null,ir=null,nr=!1,ar="",rr=!1,or=null,sr=null,ur=null,lr=null,dr=null,hr=null,cr=null,mr=null,fr=!1,vr=null,pr="",gr=0,yr=1,br=null,wr=[],kr=new WeakMap,Sr=new WeakMap,Er=1;function Mr(e){var t=Sr.get(e);return t||(t=Er++,Sr.set(e,t)),String(t)}var Tr=null,Pr=null,Ar=null,Dr=null;function xr(e){return!0===e||"true"===e||"1"===e||"yes"===e}function Cr(e,t){if(function(){if("undefined"==typeof window)return!1;try{var e,t;return!!xr(window.NAMI_TTS_DEBUG)||xr(null===(e=window.localStorage)||void 0===e?void 0:e.getItem("nami:tts:debug"))||xr(null===(t=window.localStorage)||void 0===t?void 0:t.getItem("NAMI_TTS_DEBUG"))}catch(e){return!1}}())try{t?console.debug(`[Nami TTS] ${e}`,t):console.debug(`[Nami TTS] ${e}`)}catch(e){}}function Ir(e="TTS is unavailable in this runtime."){Xa||(Xa=!0,Cr(e))}function Lr(e){if(!e)return"none";var t=e.id?`#${e.id}`:"",i=e.getAttribute("data-testid"),n=i?`[data-testid="${i}"]`:"";return`${e.tagName.toLowerCase()}${t}${n}`}function _r(e){return function(e){return null==e?"":String(e).replace(/[^.!?\n]*\$\{[^}]*subscribeUrl[^}]*\}[^.!?\n]*[.!?]?/gi,"To subscribe, follow the on-screen instructions.").replace(/\$\{[^}]+\}/g," ").replace(/\s+([.,!?;:])/g,"$1").replace(/\s+/g," ").trim()}(e)}function Rr(e){return e.toLowerCase().replace(/[^a-z0-9$]+/g," ").replace(/\s+/g," ").trim()}function Fr(e){return _r(String(null!=e?e:"").replace(/<[^>]*>/g," ").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/[*_`#>~]/g," "))}function Wr(e,t){var i=_r(t);i&&e[e.length-1]!==i&&e.push(i)}function Or(e,t=[]){var i=[];return[...e,...t].forEach(e=>{var t=function(e){var t=_r(e);if(!t)return[];for(var i=[],n=0,a=0;a<t.length;a+=1){var r=t.charAt(a),o=t.charAt(a+1);if(("."===r||"!"===r||"?"===r)&&(!o||/\s/.test(o))){var s=_r(t.slice(n,a+1));for(s&&i.push(s);a+1<t.length&&/\s/.test(t.charAt(a+1));)a+=1;n=a+1}}var u=_r(t.slice(n));u&&i.push(u);return i.length?i:[t]}(e);t.length||Wr(i,e),t.forEach(e=>Wr(i,e))}),i.slice(0,60)}function $r(e){return _r(e.join(". ").replace(/\.\s*([.!?])/g,"$1"))}function Nr(e){var t,i=br;i&&(e&&i.id===e||(i.status="cancelled",(null===(t=br)||void 0===t?void 0:t.id)===i.id&&(br=null)))}function jr(){if("undefined"==typeof document)return null;for(var e=document.activeElement;e&&null!==(t=e.shadowRoot)&&void 0!==t&&t.activeElement;){var t,i,n;e=null!==(i=null===(n=e.shadowRoot)||void 0===n?void 0:n.activeElement)&&void 0!==i?i:e}return e}function Br(e){return"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot}function zr(e){for(var t=[],i=null!=e?e:null;i;){i instanceof Element&&-1===t.indexOf(i)&&t.push(i);var n=i.parentNode;i=Br(n)?n.host:n}return t}function Ur(e,t){return!!t&&-1!==zr(t).indexOf(e)}function Hr(e,t){if(!t)return!1;if(t===e)return!0;if(e.contains(t))return!0;var i=e.shadowRoot;return!!i&&(i.activeElement===t||i.contains(t))}function Gr(e,t){t&&-1===e.indexOf(t)&&e.push(t)}function Vr(e,t){var i=t.shadowRoot;i&&i.querySelectorAll('button,[role="button"],a,input,select,textarea,[tabindex]:not([tabindex="-1"])').forEach(t=>Gr(e,t))}function Kr(e,t){var i,n=("function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():null!==(i=null==t?void 0:t.composedPath)&&void 0!==i?i:[]).filter(e=>e instanceof Element);return n.length?n:zr(e)}function Xr(e,t=[],i={}){var n=[];if(i.focusedElementOnly)return Gr(n,e),n;var a=(t.length?t:zr(e)).filter(e=>e.isConnected),r=function(e,t){var i,n=t.find(e=>e.matches("nami-product-container"));if(n)return n;var a=zr(e).find(e=>e.matches("nami-product-container"));if(a)return a;var r=ir&&"querySelectorAll"in ir?ir:"undefined"!=typeof document?document:null;return r&&null!==(i=Array.prototype.slice.call(r.querySelectorAll("nami-product-container")).find(t=>Ur(t,e)))&&void 0!==i?i:null}(e,a);return Gr(n,e),Vr(n,e),a.forEach(t=>{var i=!!r&&(t===r||Ur(r,t)),a=t!==e&&Ur(t,e),o=t.matches('nami-product-container,nami-button,[role="button"],button,[tabindex]:not([tabindex="-1"])');(i||a||t===e)&&o&&(Gr(n,t),Vr(n,t))}),null!=r&&r.isConnected&&(Gr(n,r),Vr(n,r)),n}function Yr(e){return kr.has(e)}function qr(e,t,i=[]){var n=_r(t);if(!n)return!1;eo(),Jr(void 0,"new-composite",!0);var a=Xr(e,i,po()||vo()?{focusedElementOnly:!1}:{focusedElementOnly:!0});return a.forEach(e=>function(e,t){var i=_r(t);return!!i&&(kr.has(e)||kr.set(e,{"aria-label":e.getAttribute("aria-label")}),e.setAttribute("aria-label",i),!0)}(e,n)),wr=a,!0}function Jr(e,t="manual",i=!1){var n=e&&-1===wr.indexOf(e)?Xr(e):wr;n.length&&(!i&&br&&n.some(e=>kr.has(e))?Cr("composite restore skipped: transaction still active",{reason:t}):(eo(),n.forEach(e=>{var t=kr.get(e);t&&(!function(e,t,i){null===i?e.removeAttribute(t):e.setAttribute(t,i)}(e,"aria-label",t["aria-label"]),kr.delete(e))}),e&&-1===wr.indexOf(e)||(wr=[])))}function Qr(e,t){kr.has(e)&&(t instanceof Element&&Hr(e,t)||(eo(),ur=setTimeout(()=>{(ur=null,e.isConnected)?Hr(e,jr())||Jr(e,"blur"):Jr(e,"blur-disconnected",!0)},50)))}function Zr(e){wr.length&&Jr(void 0,e,!0)}function eo(){ur&&(clearTimeout(ur),ur=null)}function to(){lr&&(clearTimeout(lr),lr=null),Tr=null}function io(){dr&&(clearTimeout(dr),dr=null)}function no(){hr&&(clearTimeout(hr),hr=null)}function ao(){cr&&(clearTimeout(cr),cr=null)}function ro(){mr&&(clearTimeout(mr),mr=null)}function oo(e){fr=!0,ro(),mr=setTimeout(()=>{mr=null,fr=!1},uo(e)+500)}function so(){ro(),fr=!1}function uo(e){var t=_r(e),i=350*(t?t.split(/\s+/).filter(Boolean).length:0);return Math.min(3e4,Math.max(4e3,i))}function lo(){return"undefined"==typeof window?null:window}function ho(){var e,t=null===(e=lo())||void 0===e||null===(e=e.webOS)||void 0===e||null===(e=e.service)||void 0===e?void 0:e.request;return"function"==typeof t?t:null}function co(){return!!ho()}function mo(){var e;if("undefined"==typeof window)return null;var t=null===(e=window.VIZIO)||void 0===e?void 0:e.Chromevox;return t&&"function"==typeof t.play?t:null}function fo(){return"undefined"!=typeof window&&void 0!==window.speechSynthesis&&"function"==typeof window.speechSynthesis.speak&&"function"==typeof window.SpeechSynthesisUtterance}function vo(){var e;if("undefined"==typeof window)return!1;var t=window,i=(null===(e=window.navigator)||void 0===e||null===(e=e.userAgent)||void 0===e?void 0:e.toLowerCase())||"";return!(!t.VIZIO&&-1===i.indexOf("vizio"))}function po(){var e,t;if("undefined"==typeof window)return!1;if(vo())return!1;var i=(null===(e=window.navigator)||void 0===e||null===(e=e.userAgent)||void 0===e?void 0:e.toLowerCase())||"",n=lo();return!!(null!=n&&n.webOS||null!=n&&n.webOSDev||null!=n&&n.PalmSystem||null!=n&&null!==(t=n.webOS)&&void 0!==t&&null!==(t=t.platform)&&void 0!==t&&t.tv||-1!==i.indexOf("webos")||-1!==i.indexOf("netcast"))}function go(){var e;if("undefined"==typeof window)return!1;var t=window,i=(null===(e=window.navigator)||void 0===e||null===(e=e.userAgent)||void 0===e?void 0:e.toLowerCase())||"";return!!(t.tizen||-1!==i.indexOf("tizen")||-1!==i.indexOf("samsung")&&(-1!==i.indexOf("smart-tv")||-1!==i.indexOf("smarttv"))||-1!==i.indexOf("samsungbrowser")&&-1!==i.indexOf("tv"))}function yo(e){return"string"==typeof e&&-1!==e.toLowerCase().indexOf("xbox")}function bo(){var e,t,i;if("undefined"==typeof window)return!1;if(!0===Ar)return!0;var n=window.navigator;return[n.userAgent,n.platform,n.vendor,null===(e=n.userAgentData)||void 0===e?void 0:e.platform,...(null!==(t=null===(i=n.userAgentData)||void 0===i?void 0:i.brands)&&void 0!==t?t:[]).map(e=>e.brand)].some(yo)}function wo(){if("undefined"==typeof window)return!1;try{return"television"===h()}catch(e){return!1}}function ko(){if(Ja)return!1;var e=mo();if(!e)return!1;try{return"function"!=typeof e.isEnabled||e.isEnabled()}catch(e){return!1}}function So(){return{televisionRuntime:wo(),televisionTtsRuntime:Eo(),webos:po(),tizen:go(),vizio:vo(),xbox:bo(),xboxClientHintsResult:Ar,hasWebOsServiceRequest:co(),webOsRequestType:typeof ho(),hasWebSpeechApi:fo(),webSpeechUnavailableForSession:Ya,webOsLunaUnavailableForSession:qa,vizioChromevoxUnavailableForSession:Ja}}function Eo(){return wo()||po()||vo()||go()}function Mo(){return Eo()&&!Ya&&fo()}function To(e){if(Qa=e,Cr("set media playing",{playing:e,hasDeferredUtterance:!!Za}),!e&&Za){var t,i=Za;if(Za=null,i.options.transactionId&&(null===(t=br)||void 0===t?void 0:t.id)!==i.options.transactionId)return void Cr("drop stale deferred speech",{transactionId:i.options.transactionId,reason:i.options.reason});Uo(i.text,i.options)}}function Po(e){Ya=!0,Ir(po()?"Web Speech TTS unavailable in this webOS runtime":"Web Speech TTS unavailable in this runtime"),Cr("web speech unavailable",{error:e})}function Ao(e){qa=!0,Cr("webOS Luna unavailable",{error:e})}function Do(e,t){Za={text:e,options:t}}var xo={name:"webos-luna-tts",platform:"webos",isAvailable:function(){return Eo()&&!vo()&&!qa&&co()},speak:function(e,t){Cr("speakViaWebOsLuna:enter",{textPreview:e.slice(0,160),reason:t.reason,transactionId:t.transactionId,requestType:typeof ho()});var i=ho();if(!i)return Cr("speakViaWebOsLuna:no-request"),!1;var n="composite"===t.reason,a=!1,r=()=>{var r,o;if(hr=null,t.transactionId&&(null===(r=br)||void 0===r?void 0:r.id)!==t.transactionId)return Cr("speakViaWebOsLuna:drop-stale-delayed-speak",{transactionId:t.transactionId,activeTransaction:null===(o=br)||void 0===o?void 0:o.id,reason:t.reason}),!1;if(Qa)return Cr("speakViaWebOsLuna:defer-delayed-speak-media-playing",{transactionId:t.transactionId,reason:t.reason}),Do(e,t),!0;var s=!1;try{Cr("speakViaWebOsLuna:request",{uri:"luna://com.webos.service.tts",method:"speak",delayedComposite:n,textPreview:e.slice(0,160)}),i("luna://com.webos.service.tts",{method:"speak",parameters:{text:e,clear:!0,feedback:!0},onSuccess:e=>{var i;if(Cr("speakViaWebOsLuna:onSuccess",{response:e,transactionId:t.transactionId}),!t.transactionId||(null===(i=br)||void 0===i?void 0:i.id)===t.transactionId){var n,r=function(e){var t,i=_r(null!==(t=null==e?void 0:e.msgStatus)&&void 0!==t?t:null==e?void 0:e.status).toLowerCase();return"done"===i||"stopped"===i||"canceled"===i||"cancelled"===i||"error"===i}(e),o=!(null==e||!e.returnValue||"msgStatus"in Object(null!=e?e:{}));if(!a&&(r||o))a=!0,t.transactionId&&(null===(n=br)||void 0===n?void 0:n.id)===t.transactionId&&(br.status="ended",br=null)}},onFailure:e=>{var i;s=!0,Cr("speakViaWebOsLuna:onFailure",{error:e,transactionId:t.transactionId});var n=!t.transactionId||(null===(i=br)||void 0===i?void 0:i.id)===t.transactionId;t.transactionId&&n&&br&&(br.status="cancelled",br=null),Ao(e)}})}catch(e){var u;return t.transactionId&&(null===(u=br)||void 0===u?void 0:u.id)===t.transactionId&&(br.status="cancelled",br=null),Ao(e),!1}return!s};if(n)return no(),Cr("speakViaWebOsLuna:delay-composite-until-focus-settles",{delayMs:250,transactionId:t.transactionId}),hr=setTimeout(r,250),!0;return r()},stop:Lo},Co={name:"web-speech",platform:"web",isAvailable:Mo,speak:function(e,t){if(!Mo())return!1;try{var i=new window.SpeechSynthesisUtterance(e);return i.onstart=()=>{var e;t.transactionId&&(null===(e=br)||void 0===e?void 0:e.id)===t.transactionId&&(br.status="started")},i.onend=()=>{var e=br,i=!t.transactionId||(null==e?void 0:e.id)===t.transactionId;t.transactionId&&i&&e&&(e.status="ended",br=null)},i.onerror=e=>{var i,n=e.error;t.transactionId&&(null===(i=br)||void 0===i?void 0:i.id)===t.transactionId&&(br.status="cancelled",br=null),"synthesis-failed"===n&&Po(n)},window.speechSynthesis.speak(i),!0}catch(e){return Po("exception"),!1}},stop:()=>{if(fo())try{window.speechSynthesis.cancel()}catch(e){}}},Io={name:"vizio-chromevox",platform:"vizio",isAvailable:ko,speak:Ro,stop:_o};function Lo(){var e=ho();if(e)try{e("luna://com.webos.service.tts",{method:"stop",parameters:{},onFailure:e=>Cr("webOS Luna stop failed",{error:e})})}catch(e){Cr("webOS Luna stop threw",{error:e})}}function _o(e=!0){var t=!!dr,i=fr;io();var n=mo(),a=function(){var e;if("undefined"==typeof window)return null;var t=null===(e=window.chrome)||void 0===e||null===(e=e.tts)||void 0===e?void 0:e.stop;return"function"==typeof t?t:null}();if((n||a)&&(i||t||a)&&(i||!t||a))try{var r=!1;n&&"function"==typeof n.stop&&(n.stop(),r=!0),n&&"function"==typeof n.cancel&&n.cancel(),n&&"function"==typeof n.pause&&n.pause(),a&&(a(),r=!0),n&&e&&!r&&i&&n.play(""),so()}catch(e){so(),Cr("VIZIO stop threw",{error:e})}}function Ro(e,t){var i=mo();if(!i)return!1;try{var n,a,r=!0===(null===(n=t.element)||void 0===n?void 0:n.isConnected),o="composite"===t.reason?1400:"focus"===t.reason?700:0;return o>0?(io(),dr=setTimeout(()=>{var n;if(dr=null,!t.transactionId||!br||br.id===t.transactionId)if(t.element&&r&&!t.element.isConnected){var a;t.transactionId&&(null===(a=br)||void 0===a?void 0:a.id)===t.transactionId&&(br.status="cancelled",br=null)}else{if(Qa)return to(),Pr=null,void Do(e,t);i.play(e),oo(e),t.transactionId&&(null===(n=br)||void 0===n?void 0:n.id)===t.transactionId&&(br.status="ended",br=null)}},o),!0):(i.play(e),oo(e),t.transactionId&&(null===(a=br)||void 0===a?void 0:a.id)===t.transactionId&&(br.status="ended",br=null),!0)}catch(e){return function(e){Ja=!0,Cr("VIZIO Chromevox unavailable",{error:e})}(e),!1}}function Fo(e){return"high"===e?3:"normal"===e?2:1}function Wo(){return Date.now()-gr<1500}function Oo(e){return Rr(e)}function $o(e){if(!e)return"";var t=function(e){return e?[e.tagName.toLowerCase(),e.id||"",e.getAttribute("data-component-id")||"",e.getAttribute("data-nami-id")||"",e.getAttribute("data-testid")||"",`el-${Mr(e)}`].filter(Boolean).join("|"):""}(e);return Rr(t||Xo(e))}function No(e){var t=Oo(e);return"clickable"===t||"button"===t||"focusable"===t||"selected"===t||"unselected"===t}function jo(e,t,i){var n;if(Pr={textKey:Oo(e),reason:t.reason,timestamp:Date.now()},"high"===i){var a=uo(e),r=Date.now();Tr={transactionId:t.transactionId,pageKey:ar,element:null!==(n=t.element)&&void 0!==n?n:null,elementKey:$o(t.element),textKey:Oo(e),startedAt:r,suppressUntil:r+a},lr&&clearTimeout(lr),lr=setTimeout(()=>{lr=null,Tr=null},a)}}function Bo(e,t=!0){var i,n,a,r=!(!e||(null===(i=br)||void 0===i?void 0:i.id)!==e||"pending"!==br.status);if(Cr("stopSpeech",{preserveTransactionId:e,allowVizioEmptyFallback:t,activeTransaction:null===(n=br)||void 0===n?void 0:n.id,reason:null===(a=br)||void 0===a?void 0:a.reason,preservingCurrentTransaction:r}),Za=null,r||(ao(),no()),e||(to(),eo(),Zr("stop")),Nr(e),sr&&(clearTimeout(sr),sr=null),!r){if(fo())try{window.speechSynthesis.cancel()}catch(e){}po()&&Lo(),vo()&&_o(t)}}function zo(){Bo()}function Uo(e,t={}){var i,n,a;Cr("speakText:enter",{textPreview:_r(e).slice(0,160),reason:t.reason,transactionId:t.transactionId,element:Lr(t.element),runtime:So()});var r=_r(e);if(!r)return!1;if(!Eo())return Cr("skip speech: non-CTV runtime"),!1;var o={interrupt:!1!==t.interrupt,reason:null!==(i=t.reason)&&void 0!==i?i:"manual",transactionId:t.transactionId,element:t.element,focusPath:t.focusPath,priority:t.priority},s=function(e,t){return t.priority?t.priority:"composite"===t.reason?"high":No(e)?"low":"normal"}(r,o);if(function(e,t,i){var n=Oo(e),a=Date.now(),r=$o(t.element);if(No(e))return!0;if(Pr&&Pr.reason===t.reason&&Pr.textKey===n&&a-Pr.timestamp<600)return Cr("suppress:duplicate-request",{reason:t.reason,textPreview:e.slice(0,120)}),!0;if(!Tr)return!1;if(Fo(i)>=Fo("high"))return!1;if("focus"===t.reason){var o=Tr.textKey;if(!Wo()&&(n===o||n.includes(o)))return Cr("suppress:focus-text-is-active-composite",{textPreview:e.slice(0,120),transactionId:Tr.transactionId,element:Lr(t.element)}),!0}var s=function(e,t){return!!e&&!!t&&e===t}(t.element,Tr.element),u=!!r&&Tr.elementKey===r,l=!Tr.pageKey||Tr.pageKey===ar,d=Wo(),h=l&&!d&&a<Tr.startedAt+2500;return!(!s&&!u&&(l&&"focus"===t.reason&&t.element&&Tr.element!==t.element||"low"!==i&&!h)&&(to(),1))}(r,o,s))return!1;if(o.interrupt&&Bo(o.transactionId,!1),Qa)return Do(r,o),!0;var u=function(e){var t;return"manual"!==(null!==(t=e.reason)&&void 0!==t?t:"manual")&&e.element?po()||vo()?"programmatic":"accessibility-label":"programmatic"}(o);Cr("speakText:owner",{owner:u,reason:o.reason,element:Lr(o.element)});var l,d,h="programmatic"===u?function(){if(!Eo())return null;var e=vo(),t=po();return Io.isAvailable()?(Cr("resolveTtsEngine:selected",{engine:"vizio-chromevox"}),Io):e?null:xo.isAvailable()?(Cr("resolveTtsEngine:selected",{engine:"webos-luna-tts"}),xo):Co.isAvailable()?(Cr("resolveTtsEngine:selected",{engine:"web-speech"}),Co):(Cr("tts engine unavailable",{webos:t,vizio:e}),null)}():null;(Cr("speakText:engine",{engine:null!==(n=null==h?void 0:h.name)&&void 0!==n?n:null,owner:u}),"composite"===o.reason&&o.transactionId&&o.element&&function(e){return"accessibility-label"===e||po()}(u))&&qr(o.element,r,null!==(l=o.focusPath)&&void 0!==l?l:[]);if("accessibility-label"===u)return"focus"===o.reason&&o.element&&o.element.setAttribute("aria-label",r),o.transactionId&&(null===(d=br)||void 0===d?void 0:d.id)===o.transactionId&&(br.status="started"),jo(r,o,s),!0;if(!h)return function(e,t){if(!vo()||Ja)return!1;var i=Date.now(),n=()=>{var a;cr=null,t.transactionId&&br&&br.id!==t.transactionId||(ko()?Ro(e,t):Date.now()-i>=8e3?t.transactionId&&(null===(a=br)||void 0===a?void 0:a.id)===t.transactionId&&(br.status="cancelled",br=null):cr=setTimeout(n,250))};return ao(),cr=setTimeout(n,250),!0}(r,o)?(jo(r,o,s),!0):(Ir(),!1);var c=h.speak(r,o);if(Cr("speakText:engine-result",{engine:h.name,accepted:c,reason:o.reason,transactionId:o.transactionId}),c)return jo(r,o,s),c;if(!o.element)return c;var m=qr(o.element,r,null!==(a=o.focusPath)&&void 0!==a?a:[]);return Cr("speakText:aria-label-fallback",{engine:h.name,accepted:m,reason:o.reason}),m&&jo(r,o,s),m}function Ho(e){var t=e.component;return e.hasAttribute("data-nami-primary-cta")||!0===(null==t?void 0:t.focused)||"productButton"===(null==t?void 0:t.namiComponentType)}function Go(e){var t,i=null===(t=e.getAttribute("role"))||void 0===t?void 0:t.toLowerCase();return"button"===e.tagName.toLowerCase()||"button"===i||e.matches("nami-button,nami-play-pause-button,nami-volume-button,nami-toggle-button")}function Vo(e){return _r(e).replace(/(?:,\s*)?\bbutton\b\s*$/i,"").trim()||_r(e)}function Ko(e){return _r(e.innerText||e.textContent||"")}function Xo(e){if(!e)return"";if(Yr(e)){var t=function(e){var t=kr.get(e);return t?_r(t["aria-label"]||e.getAttribute("title")||""):""}(e);if(t)return t;var i=Yo(e.component);if(i)return i}var n=e.getAttribute("data-tts-spoken-label");if(n)return _r(n);var a=Yo(e.component);if(a)return a;var r=e.getAttribute("aria-label")||e.getAttribute("title");return r?_r(r):Ko(e)}function Yo(e){var t=Jo(e,tr);if(!t)return"";var i=t,n=_r(qo(i.speechLabel)||qo(i.speech_label)||qo(i.screenreaderText)||qo(i.title)||qo(i.alt)||qo(i.text)||(Array.isArray(i.texts)?i.texts.map(e=>qo(e)).join(", "):""));if(n)return n;for(var a,r=te(Zo(i));!(a=r()).done;){var o=Yo(a.value);if(o)return o}return""}function qo(e,t=tr){return t?Oa(t,e):e}function Jo(e,t){if(!e||e.hidden)return null;var i=e;if("condition"===i.component)return t&&Fa(t,i)?e:null;if(i.conditionAttributes&&t){var n=Wa(t,i);return n.hidden?null:n}return e}function Qo(e,t){if(Cr("applySpeechAttributes:enter",{element:Lr(e),label:t,activeComposite:Yr(e)}),!Yr(e)){var i=_r(t),n=function(e,t){var i=_r(t);return i?Go(e)?Vo(i):i:""}(e,t);if(!n)return e.removeAttribute("data-tts-spoken-label"),void e.removeAttribute("aria-label");i?e.setAttribute("data-tts-spoken-label",i):e.removeAttribute("data-tts-spoken-label"),e.setAttribute("aria-label",function(e,t){return Go(e)?Vo(t):_r(t)}(e,n))}}function Zo(e){for(var t=[],i=0,n=["components","playingComponents","pausedComponents","mutedComponents","volumeComponents","productBaseComponents","productFeaturedComponents"];i<n.length;i++){var a=null==e?void 0:e[n[i]];Array.isArray(a)&&t.push(...a)}return null!=e&&e.collapseHeader&&(Array.isArray(e.collapseHeader)?t.push(...e.collapseHeader):t.push(e.collapseHeader)),t}function es(e,t,i){var n=Jo(e,tr);if(n&&!function(e){var t=Jo(e,tr);if(!t)return!1;var i=t,n=String(i.component||i.namiComponentType||"").toLowerCase();return-1!==n.indexOf("button")||-1!==n.indexOf("toggle")||-1!==n.indexOf("checkbox")||-1!==n.indexOf("radio")||-1!==n.indexOf("select")||-1!==n.indexOf("input")||!!i.onTap||!!i.sku||!0===i.focused}(n)){var a=function(e){var t=Jo(e,tr);if(!t)return"";var i=t;switch(t.component){case"text":case"countdownTimerText":return Fr(qo(i.screenreaderText)||qo(i.text));case"text-list":return Array.isArray(i.texts)?Fr(i.texts.map(e=>qo(e)).join(", ")):"";case"videoUrl":case"progressBar":return _r(qo(i.screenreaderText));default:return""}}(n);Wr(t,a),Zo(n).forEach(e=>es(e,t))}}function ts(e,t){var i=[];if(!e)return i;var n=e;return[n.header,n.contentContainer,n.footer,n.backgroundContainer,n.components].forEach(e=>{Array.isArray(e)?e.forEach(e=>es(e,i)):es(e,i)}),i}function is(e,t){var i=ts(e),n=function(e){if(!e)return"";var t=Yo(e.component),i=e.getAttribute("aria-label")||e.getAttribute("title")||Ko(e),n=_r(t||i);return n?Go(e)&&!/\bbutton\b\s*$/i.test(n)?_r(`${n} button`):n:""}(t);return $r(Or(i,n?[n]:[]))}function ns(e){return e?Rr(`${_r(e.id||e.name||"")}|${$r(Or(ts(e),[]))}`):""}function as(){return rr}function rs(e,t=null){!function(){if(null===Ar&&null===Dr){var e=navigator.userAgentData;"function"==typeof(null==e?void 0:e.getHighEntropyValues)?Dr=e.getHighEntropyValues(["platform","model"]).then(e=>{var t,i,n=(null!==(t=e.platform)&&void 0!==t?t:"").toLowerCase(),a=(null!==(i=e.model)&&void 0!==i?i:"").toLowerCase();Ar=n.includes("xbox")||a.includes("xbox"),Cr("xbox client hints resolved",{platform:n,model:a,result:Ar})}).catch(()=>{Ar=!1}).finally(()=>{Dr=null}):Ar=!1}}(),Cr("setActivePage:enter",{nextKey:ns(e),previousKey:ar,activePageAnnounced:nr,pageName:_r((null==e?void 0:e.name)||(null==e?void 0:e.id)||"")});var i=ar;er=e,tr=t,function(e){var t=ns(e);if(t!==ar){var i=!ar&&!!vr;nr=!1,ar=t,rr=i,vr=null,pr=""}}(e),i!==ar&&Bo(void 0,!1)}function os(e,t){if(Cr("prepareInitialComposite:enter",{element:Lr(e),activePageKey:ar,activePageAnnounced:nr,blockedByNavigation:as(),label:Xo(e),isPrimary:Ho(e)}),!er||nr||!Ho(e)||as())return Cr("prepareInitialComposite:skip",{hasActivePage:!!er,activePageAnnounced:nr,isPrimary:Ho(e),blockedByNavigation:as()}),!1;var i=is(er,e);if(!i)return!1;var n=Kr(e,t),a=function(e,t,i){var n={id:yr++,reason:e,element:i,text:t,page:er,status:"pending"};return br=n,n}("composite",i,e);nr=!0,vr=e,pr=$o(e);var r,o=Uo(i,{reason:"composite",interrupt:!0,transactionId:a.id,element:e,focusPath:n,priority:"high"});o||(nr=!1,(null===(r=br)||void 0===r?void 0:r.id)===a.id&&(br.status="cancelled",br=null));return o}function ss(e,t){Cr("preparePrimaryCtaCompositeFocus:enter",{element:Lr(e),label:Xo(e),activePageKey:ar,activePageAnnounced:nr});var i=os(e,t);return Cr("preparePrimaryCtaCompositeFocus:result",{result:i,activePageKey:ar,activePageAnnounced:nr}),i}function us(e){Cr("handleNativeFocusIn:enter",{target:e.target instanceof Element?Lr(e.target):String(e.target),activePageKey:ar,activePageAnnounced:nr});var t=function(e){for(var t,i=null,n=te("function"==typeof e.composedPath?e.composedPath():[]);!(t=n()).done;){var a=t.value;if(a instanceof Element&&Xo(a)){if(a.tagName.toLowerCase().startsWith("nami-"))return a;i||(i=a)}}return null!=i?i:e.target instanceof Element?e.target:null}(e);t&&ls(t,e)}function ls(e,t){if(Cr("handleFocusedElementForSpeech:enter",{element:Lr(e),label:Xo(e),ttsEnabled:Ka,runtime:So(),activePageKey:ar,activePageAnnounced:nr,lastFocused:Lr(vr),lastFocusedElementIdentity:pr}),!e)return Cr("handleFocusedElementForSpeech:skip-basic",{hasElement:!!e,ttsEnabled:Ka}),!1;if(!Eo())return!1;var i=$o(e);if(Tr&&Tr.pageKey===ar&&Date.now()<Tr.startedAt+2500){var n=Tr.element===e,a=!!i&&Tr.elementKey===i;if(!Wo()&&(n||a))return Cr("handleFocusedElementForSpeech:skip-during-initial-composite-lock",{element:Lr(e),sameCompositeElement:n,sameCompositeElementKey:a}),!1;var r=Xo(e),o=r?Oo(r):"";if(!Wo()&&o&&Tr.textKey.includes(o))return Cr("handleFocusedElementForSpeech:skip-composite-contained-label-during-initial-lock",{element:Lr(e),labelPreview:r.slice(0,120),transactionId:Tr.transactionId}),vr=e,pr=i,!1}if(vr===e||i&&i===pr&&!nr)return Cr("handleFocusedElementForSpeech:skip-same-element",{element:Lr(e),activePageAnnounced:nr,elementIdentity:i,lastFocusedElementIdentity:pr}),!1;if(!nr&&er&&Ho(e)&&!vr&&!as())return os(e,t);var s=Xo(e);if(!s)return!1;if(Tr){var u=Oo(s),l=Tr.textKey;if(!Wo()&&(u===l||u.includes(l)))return Cr("handleFocusedElementForSpeech:skip-active-composite-label",{element:Lr(e),labelPreview:s.slice(0,120),transactionId:Tr.transactionId}),vr=e,pr=i,!1}return vr=e,pr=i,sr&&clearTimeout(sr),sr=setTimeout(()=>{sr=null,vr===e&&Uo(s,{reason:"focus",interrupt:!0,element:e,focusPath:Kr(e,t),priority:"normal"})},120),!0}function ds(e=document){var t;if(Cr("attachFocusSpeechListeners:enter",{root:e instanceof Element?Lr(e):e instanceof DocumentFragment?"document-fragment":"document",runtime:So()}),hs(),!Eo())return Cr("focus speech listeners not attached: non-CTV runtime"),hs;var i,n=e=>us(e),a=()=>(Cr("handleUserNavigationKey",{activePageKey:ar,activePageAnnounced:nr}),gr=Date.now(),void(rr=!0));e.addEventListener("focusin",n,!0),e.addEventListener("keydown",a,!0);var r=window;if("undefined"!=typeof window&&null!==(t=r.TVJS)&&void 0!==t&&t.DirectionalNavigation){var o=r.TVJS.DirectionalNavigation;i=o.onfocuschanged,o.onfocuschanged=e=>{var t;null===(t=i)||void 0===t||t.call(o,e),function(e){var t,i=null===(t=e.detail)||void 0===t?void 0:t.nextFocusElement;i&&ls(i,e)}(e)}}return or={root:e,focusListener:n,keyListener:a,previousTvjsHandler:i},hs}function hs(){var e;if(Cr("detachFocusSpeechListeners:enter",{hasCleanup:!!or}),or){var t=or,i=t.root,n=t.focusListener,a=t.keyListener,r=t.previousTvjsHandler;i.removeEventListener("focusin",n,!0),a&&i.removeEventListener("keydown",a,!0);var o=window;null!==(e=o.TVJS)&&void 0!==e&&e.DirectionalNavigation&&r&&(o.TVJS.DirectionalNavigation.onfocuschanged=r),or=null}}function cs(){var e;Cr("resetScreenreaderState:enter",{activePageKey:ar,activePageAnnounced:nr,activeTransaction:null===(e=br)||void 0===e?void 0:e.id,lastFocused:Lr(vr)}),hs(),Za=null,Qa=!1,er=null,tr=null,ir=null,nr=!1,ar="",rr=!1,vr=null,pr="",gr=0,Pr=null,to(),eo(),io(),no(),ao(),so(),sr&&(clearTimeout(sr),sr=null),Zr("reset"),Nr(),br=null}var ms=function(){return ee(function e(t,i,n="",a=""){var r;Y(this,e),this.playing=!1,this.toggling=!1,this.handleVideoEvents=e=>{this.video.onended=()=>{To(!1),this.handlePlayerAnalytics(e,c.VIDEO_ENDED)},this.video.onpause=()=>{To(!1),this.toggling||this.handlePlayerAnalytics(e,c.VIDEO_PAUSED)},this.video.onplay=()=>{To(!this.video.muted),this.toggling||this.handlePlayerAnalytics(e,this.video.currentTime>.05?c.VIDEO_RESUMED:c.VIDEO_STARTED)},this.video.onvolumechange=()=>{this.toggling||(this.muted=this.video.muted,To(!this.video.paused&&!this.video.ended&&!this.muted),this.handlePlayerAnalytics(e,this.muted?c.VIDEO_MUTED:c.VIDEO_UNMUTED))}},this.removeVideoEvents=()=>{this.video&&(To(!1),this.video.onended=null,this.video.onpause=null,this.video.onplay=null,this.video.onvolumechange=null,this.toggling=!1)},this.video=null!=i?i:this.video,null!==(r=e.instance)&&void 0!==r&&r.videoSrc&&i.src!=e.instance.videoSrc&&this.handlePlayerAnalytics(t,c.VIDEO_CHANGED),this.videoSrc=i.src,this.video&&(this.muteByDefault=i.muted,this.loopVideo=i.loop,this.autoplayVideo=i.autoplay,this.muted=this.video.muted,this.videoComponentName=n,this.videoComponentId=a,this.playing=!(!(this.video.currentTime>0)||this.video.paused||this.video.ended),To(this.playing&&!this.video.muted),this.handleVideoEvents(t))},[{key:"togglePlayVideo",value:function(e){this.toggling=!0,this.playing?this.video.pause():this.video.play(),this.playing=!this.playing,this.handlePlayerAnalytics(e)}},{key:"toggleMuteVideo",value:function(e){this.toggling=!0,this.video.muted=!this.video.muted,this.muted=this.video.muted,this.handlePlayerAnalytics(e,this.muted?c.VIDEO_MUTED:c.VIDEO_UNMUTED)}},{key:"videoPlayingAction",value:function(){var e,t;return(null===(e=this.video)||void 0===e?void 0:e.currentTime)<=0?c.VIDEO_STARTED:this.video.paused?c.VIDEO_PAUSED:this.video.ended?c.VIDEO_ENDED:(null===(t=this.video)||void 0===t?void 0:t.currentTime)>.05?c.VIDEO_RESUMED:c.UNKNOWN}},{key:"handlePlayerAnalytics",value:function(e,t){if(this.video){var i={id:this.videoComponentId,name:this.videoComponentName,url:this.video.src,loopVideo:this.loopVideo,muteByDefault:this.muteByDefault,autoplayVideo:this.autoplayVideo,contentDuration:this.video.duration/1e3,contentTimecode:this.video.currentTime/1e3};m.getInstance().emit(f,{action:null!=t?t:this.videoPlayingAction(),videoMetaData:i,timeSpentOnPaywall:za(e)})}}}])}();ms.instance=null;var fs=({onTap:e,sku:t,componentChange:i,contextProvider:n}={})=>{var a,r,o,s,u,l,d,h,v,p,g,y=c.UNKNOWN;switch(null==e?void 0:e.function){case ti:y=c.CLOSE_PAYWALL,g=za(n),vs(),null===(a=ms.instance)||void 0===a||a.handlePlayerAnalytics(n,c.VIDEO_ENDED);break;case ni:y=c.RESTORE_PURCHASES,ps();break;case ri:y=c.SIGN_IN,gs();break;case vi:ys(null===(r=e.parameters)||void 0===r?void 0:r.url);break;case si:t&&(y=c.BUY_SKU,t=bs(n,e,t));break;case gi:y=c.PAGE_CHANGE,i={name:null==e||null===(o=e.parameters)||void 0===o?void 0:o.screen},ws(n,null==e||null===(s=e.parameters)||void 0===s?void 0:s.screen);break;case li:y=c.TOGGLE_CHANGE,i=ks(n,null==e||null===(u=e.parameters)||void 0===u?void 0:u.formId,null==e||null===(l=e.parameters)||void 0===l?void 0:l.value);break;case hi:t&&(y=c.SELECT_SKU,Ss(n,t));break;case mi:t&&(y=c.PURCHASE_SELECTED_SKU,Es(n,t));break;case bi:break;case ki:null===(d=ms.instance)||void 0===d||d.togglePlayVideo(n);break;case Ei:null===(h=ms.instance)||void 0===h||h.togglePlayVideo(n);break;case Ti:null===(v=ms.instance)||void 0===v||v.toggleMuteVideo(n);break;case Ai:null===(p=ms.instance)||void 0===p||p.toggleMuteVideo(n)}y!==c.UNKNOWN&&m.getInstance().emit(f,ie({},n.getPaywallActionEventData(),{action:y,sku:t,timeSpentOnPaywall:g,componentChange:i,purchaseError:void 0,purchases:void 0}))},vs=()=>{zo(),v.clearLaunchId(),Ms(p.Close)||"undefined"==typeof window||window.history.back()},ps=()=>{var e=g(y.THIRD_PARTY_TRANSACTIONS);Ms(p.Restore)||e||n.warn("NamiPaywallManager.registerRestoreHandler is not registered, so restore option on the paywall will use default behavior.")},gs=()=>{Ms(p.SignIn)},ys=e=>{e?Ms(p.DeeplinkAction,e)||"undefined"!=typeof window&&window.open(e,"_blank"):n.debug("Paywall deep link action invoked, but no url present.")},bs=(e,t,i)=>{var a,r=null===(a=t.parameters)||void 0===a?void 0:a.promo,o=i;if(r)n.debug(`promo id is not null ${null==i?void 0:i.id}`),o.promoId=r.toString();else{n.debug(`promo id is null for ${i.id}, product details: ${JSON.stringify(i.productDetails)}`);var s=i.productDetails;if(Di(null==s?void 0:s.product_type)){var u=function(e){return e.offers.find(e=>"promo"===e.offer_type&&0===e.price)}(s);if(u&&u.offer_ref_id)n.debug(`Found a free trial offer ${u.offer_ref_id}`),o.promoId=u.offer_ref_id.toString();else{var l,d=s.offers[0];if(d)n.debug(`Found an offer ${d.offer_ref_id}`),o.promoId=null===(l=d.offer_ref_id)||void 0===l?void 0:l.toString()}}}return function(e,t){if(g(y.THIRD_PARTY_TRANSACTIONS)){if(v.setPurchaseImpression(),m.getInstance().listenerCount(p.BuySku)<=0)return void n.warn("In order for Nami to hand off the purchase so the transaction can be handled by, you must register a NamiBuySkuHandler callbackwith NamiPaywallManager.registerBuySkuHandler.");n.info(`Handing off purchase for processing by developer skuId=${t.skuId} promoId=${t.promoId}`),Ms(p.BuySku,t)}else{var i=b(t.skuId);if(i&&(n.info(`Purchase flow completed, success=${i.success}, code=${i.billingResponseCode}, message=${i.message}`),i.success)){var a;m.getInstance().emit(f,{action:c.CLOSE_PAYWALL,sku:t,timeSpentOnPaywall:za(e)}),null===(a=ms.instance)||void 0===a||a.handlePlayerAnalytics(e,c.VIDEO_ENDED);var r=e.getSelectedCampaign();r&&r.conversion_event_type==w.IN_APP&&r.conversion_event_url?(v.clearLaunchId(),window.location.href=r.conversion_event_url):vs()}}}(e,o),o},ws=(e,t)=>{var i;t&&((null===(i=window.history.state)||void 0===i?void 0:i.prevUrl)==t?window.history.back():e.setCurrentPage(t))},ks=(e,t,i)=>{if(t)return e.setCurrentFormId(t,i),{formId:t,value:i};var n=e.getCurrentGroupId(),a=e.getCurrentGroupName();return e.setCurrentGroupData(n,a),{id:n,name:a}},Ss=(e,t)=>{var i=e.getCurrentGroupId(),n=e.selectedProducts();i&&t.id!=n[i]&&(n[i]=t.id,e.setSelectedProducts(n))},Es=(e,t)=>{e.setPurchase(!0,t)};function Ms(e,...t){var i=m.getInstance();return i.emit(e,...t),i.listenerCount(e)>0}var Ts,Ps,As,Ds,xs,Cs,Is,Ls,_s,Rs,Fs,Ws=e=>e,Os=k.NamiFlowManager,$s=250,Ns=function(){function e(t,i,n){var a;return Y(this,e),(a=X(this,e)).pages=[],a.currentOffset=0,a.presentationStyle="fullscreen",a._sheetEntranceActive=!0,a.formFactor=h(),a.timeSpentOnPaywall=0,a.animation={transition:"none",direction:"forward"},a._originalBodyStyles={},a._originalDocumentStyles={},a._savedScrollY=0,a._sheetDragStartY=0,a._sheetIsDragging=!1,a._dismissThreshold=100,a._boundHandleKeyDownEvent=e=>a.handleKeyDownEvent(e),a._stylesAlreadySaved=!1,a.type=t,a.value=i,a.context=n,a.setPaywallData(),a.presentationStyle=a.getPresentationStyle(a.paywall),a.applyPresentationHostClasses(),se(a,a)}return re(e,j),ee(e,[{key:"applyPresentationHostClasses",value:function(){this.classList.toggle("nami-half-sheet-mode",this.isOverlaySheet),this.classList.toggle("nami-modal-mode",this.isModal),this.classList.toggle("nami-modal-phone",this.isModal&&"phone"===this.formFactor),this.classList.toggle("nami-modal-wide",this.isModal&&"phone"!==this.formFactor)}},{key:"setPaywallData",value:function(){var e=S(this.value,this.type);this.paywall=e.paywall,this.campaign=e.campaign}},{key:"getPresentationStyle",value:function(e){var t,i,n,a=null!==(t=null==e||null===(i=e.template)||void 0===i||null===(i=i.initialState)||void 0===i?void 0:i.presentationStyle)&&void 0!==t?t:null==e||null===(n=e.template)||void 0===n||null===(n=n.initialState)||void 0===n?void 0:n.presentation_style;return E(a)}},{key:"isHalfSheet",get:function(){return"compact_sheet"===this.presentationStyle}},{key:"isSheet",get:function(){return"sheet"===this.presentationStyle}},{key:"isOverlaySheet",get:function(){return this.isHalfSheet||this.isSheet}},{key:"isModal",get:function(){return"modal"===this.presentationStyle}},{key:"isOverlay",get:function(){return this.isOverlaySheet||this.isModal}},{key:"connectedCallback",value:function(){var t;me(e,"connectedCallback",this)([]),null!==(t=window.TVJS)&&void 0!==t&&t.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=this),this._detachFocusSpeechListeners=ds(this),document.addEventListener("keydown",this._boundHandleKeyDownEvent),this._swipeHandler=Qt(this,this.handleSwipeEvent.bind(this),{axisHint:"y",lockAxis:!0,minDistance:25,edgeLeakThreshold:15,preventScrollOnSwipe:!1,pointerTypes:["touch"]}),this.setOriginalStyles()}},{key:"disconnectedCallback",value:function(){var t,i,n;me(e,"disconnectedCallback",this)([]),zo(),null===(t=this._detachFocusSpeechListeners)||void 0===t||t.call(this),this._detachFocusSpeechListeners=void 0,cs(),v.clearLaunchId(),null!==(i=window.TVJS)&&void 0!==i&&i.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=document.body),document.removeEventListener("keydown",this._boundHandleKeyDownEvent),m.getInstance().removeAllListeners(f),this.restoreStyles(),null===(n=this._halfSheetAbortController)||void 0===n||n.abort(),this._swipeHandler.destroy()}},{key:"setOriginalStyles",value:function(){this._stylesAlreadySaved||(this._stylesAlreadySaved=!0,this._originalBodyStyles.background=document.body.style.background,this._originalBodyStyles.overflow=document.body.style.overflow||null,this._originalBodyStyles.position=document.body.style.position||null,this._originalBodyStyles.top=document.body.style.top||null,this._originalBodyStyles.width=document.body.style.width||null,"phone"===this.formFactor&&(this._originalBodyStyles["overscroll-behavior"]=document.body.style.overscrollBehavior||null,this._originalDocumentStyles["overscroll-behavior"]=document.documentElement.style.overscrollBehavior||null)),"television"===this.formFactor&&(document.body.style.overflow="hidden"),"phone"===this.formFactor&&(document.body.style.overscrollBehavior="none",document.documentElement.style.overscrollBehavior="none",this.isOverlay||(document.body.style.overflow="hidden")),this.isOverlay&&(this._savedScrollY=window.scrollY,document.body.style.position="fixed",document.body.style.top=`-${this._savedScrollY}px`,document.body.style.width="100%",document.body.style.overflow="hidden")}},{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){(10009===e.keyCode||27===e.keyCode||166===e.keyCode||196===e.keyCode||"Backspace"===e.key||"GoBack"===e.key||"BrowserBack"===e.key||"XF86Back"===e.key)&&(e.preventDefault(),zo(),this.flow?this.flow.triggerActions(M.REMOTE_BACK):this.isModal&&this.animateSheetDismiss().then(()=>vs()))}},{key:"handleBackdropClick",value:function(e){var t;(e.stopPropagation(),this.flow)?null!==(t=this.flow.currentStepHasHoistedPrimaryActions("__swipe_down__"))&&void 0!==t&&t?this.flow.triggerActions("__swipe_down__"):this.animateSheetDismiss().then(()=>{var e;null===(e=this.flow)||void 0===e||e.finished(),vs()}):this.animateSheetDismiss().then(()=>vs())}},{key:"animateSheetDismiss",value:function(){var e,t,i,n,a;return le(function(r){for(;;)switch(r.n){case 0:return i=this.shadowRoot,n=null!==(e=null==i?void 0:i.querySelector(".nami-half-sheet-container"))&&void 0!==e?e:null==i?void 0:i.querySelector(".nami-modal-container"),a=null!==(t=null==i?void 0:i.querySelector(".nami-half-sheet-backdrop"))&&void 0!==t?t:null==i?void 0:i.querySelector(".nami-modal-backdrop"),n&&n.classList.add("nami-dismissing"),a&&a.classList.add("nami-dismissing"),r.n=1,K(new Promise(e=>setTimeout(e,200)));case 1:return r.a(2)}},null,this,null,Promise)}},{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 i;null===(i=this.flow)||void 0===i||i.triggerActions("__swipe_up__")}}},{key:"setupHalfSheetDragTracking",value:function(){var e,t,i;null===(e=this._halfSheetAbortController)||void 0===e||e.abort(),this._halfSheetAbortController=new AbortController;var n=this._halfSheetAbortController.signal,a=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".nami-half-sheet-container"),r=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector(".nami-half-sheet-content");if(a&&r){a.addEventListener("touchstart",e=>{r.scrollTop>0||(this._sheetDragStartY=e.touches[0].clientY,this._sheetIsDragging=!0)},{passive:!0,signal:n}),a.addEventListener("touchmove",e=>{if(this._sheetIsDragging){var t=e.touches[0].clientY-this._sheetDragStartY;t>0&&(a.style.transform=`translateY(${t}px)`,a.style.transition="none",e.preventDefault())}},{passive:!1,signal:n}),a.addEventListener("touchend",()=>{if(this._sheetIsDragging){this._sheetIsDragging=!1;var e,t,i=a.style.transform.match(/translateY\((\d+(?:\.\d+)?)px\)/);if((i?parseFloat(i[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 n;a.style.transform="translateY(0)",a.style.transition="transform 0.2s ease-out",null===(n=this.flow)||void 0===n||n.triggerActions("__swipe_down__")}else{var r;a.style.transform="translateY(100%)",a.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 a.style.transform="translateY(0)",a.style.transition="transform 0.2s ease-out"}},{signal:n})}}},{key:"setupHalfSheetFocusTrap",value:function(){var e,t,i,n,a=null!==(e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".nami-half-sheet-container"))&&void 0!==e?e:null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector(".nami-modal-container");if(a){a.focus();var r=null===(n=this._halfSheetAbortController)||void 0===n?void 0:n.signal;a.addEventListener("keydown",e=>{if("Tab"===e.key){var t=a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(0!==t.length){var i,n,r=t[0],o=t[t.length-1];if(e.shiftKey)document.activeElement!==r&&(null===(i=this.shadowRoot)||void 0===i?void 0:i.activeElement)!==r||(e.preventDefault(),o.focus());else document.activeElement!==o&&(null===(n=this.shadowRoot)||void 0===n?void 0:n.activeElement)!==o||(e.preventDefault(),r.focus())}}},r?{signal:r}:void 0)}}},{key:"firstUpdated",value:function(){var e;this.timeSpentOnPaywall=Date.now(),null===(e=this._detachFocusSpeechListeners)||void 0===e||e.call(this),this._detachFocusSpeechListeners=ds(this.renderRoot),T(this.campaign)&&(this.flow=Os.instance.presentFlow(this.campaign,this,this.context)),this.isOverlay&&this.updateComplete.then(()=>{this.isOverlaySheet&&this.setupHalfSheetDragTracking(),this.setupHalfSheetFocusTrap()})}},{key:"updated",value:function(t){if(me(e,"updated",this)([t]),t.has("presentationStyle")){var i=t.get("presentationStyle");("compact_sheet"===i||"sheet"===i||"modal"===i)!==this.isOverlay&&(this.restoreStyles(),this._stylesAlreadySaved=!1,this.setOriginalStyles()),this.isOverlay&&(this.isOverlaySheet&&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,i,n;return le(function(a){for(;;)switch(a.n){case 0:if(0!==this.pages.length&&"none"!==this.animation.transition){a.n=1;break}return this.pages=[e],a.a(2);case 1:if((null==(t=this.pages[this.pages.length-1])?void 0:t.id)!==e.id){a.n=2;break}return a.a(2);case 2:return i=null,this.isOverlaySheet&&(i=null===(n=this.shadowRoot)||void 0===n?void 0:n.querySelector(".nami-half-sheet-content"))&&(i.style.height=`${i.clientHeight}px`),this.pages=[t,e],this.currentOffset=0,a.n=3,K(this.updateComplete);case 3:requestAnimationFrame(()=>{this.currentOffset=1,setTimeout(()=>{this.pages=[e],this.currentOffset=0,this.paywall=e,i&&(i.style.height="")},$s)});case 4:return a.a(2)}},null,this,null,Promise)}},{key:"animateFullscreenEntry",value:function(){return le(function(e){for(;;)switch(e.n){case 0:return e.n=1,K(new Promise(e=>requestAnimationFrame(()=>e())));case 1:return this.classList.remove("nami-fullscreen-entering"),this.classList.add("nami-fullscreen-entering-active"),e.n=2,K(new Promise(e=>setTimeout(e,$s)));case 2:this.classList.remove("nami-fullscreen-entering-active");case 3:return e.a(2)}},null,this,null,Promise)}},{key:"_captureExitOverlay",value:function(e){var t=this.shadowRoot;if(!t)return null;var i=t.querySelector(".nami-flow-container"),n=document.createElement("div");if(n.className="nami-fullscreen-exit-overlay",n.style.cssText=`\n position: fixed; inset: 0; z-index: 10000;\n pointer-events: none;\n background: ${e};\n overflow: hidden;\n `,i){var a=i.cloneNode(!0);a.style.transform="none",a.style.transition="none",n.appendChild(a)}return t.appendChild(n),n.offsetHeight,n}},{key:"_slideExitOverlayAway",value:function(e){var t;return le(function(i){for(;;)switch(i.n){case 0:if(e){i.n=1;break}return i.a(2);case 1:return t="undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,e.style.transition=t?"none":"transform 250ms ease-in",e.style.transform="translateY(100%)",i.n=2,K(new Promise(e=>setTimeout(e,t?0:$s)));case 2:e.remove();case 3:return i.a(2)}},null,null,null,Promise)}},{key:"flowNavigateToScreen",value:function(e,t){var i,n,a,r,o,s,u,l,d,h,c;return le(function(m){for(;;)switch(m.n){case 0:if(null!==(i=this.flow)&&void 0!==i&&i.previousFlowStep&&this.flow.executeLifecycle(this.flow.previousFlowStep,M.DISAPPEAR),a=this.presentationStyle,r=this.getPresentationStyle(e),o=0===this.pages.length,s="backward"===t.direction,"compact_sheet"!==a&&"sheet"!==a||"fullscreen"!==r){m.n=3;break}return this.classList.add("nami-fullscreen-entering"),this.presentationStyle="fullscreen",this.applyPresentationHostClasses(),m.n=1,K(this.updateComplete);case 1:return m.n=2,K(this.animateFullscreenEntry());case 2:m.n=11;break;case 3:if("fullscreen"!==a||"compact_sheet"!==r&&"sheet"!==r){m.n=10;break}if(!o&&!s){m.n=8;break}if(!s){m.n=6;break}return u=document.body.style.background||getComputedStyle(this).backgroundColor||"#000",this._sheetEntranceActive=!1,l=this._captureExitOverlay(u),this.presentationStyle=r,this.applyPresentationHostClasses(),this.pages=[e],this.paywall=e,m.n=4,K(this.updateComplete);case 4:return m.n=5,K(this._slideExitOverlayAway(l));case 5:m.n=7;break;case 6:this.presentationStyle=r,this.applyPresentationHostClasses();case 7:m.n=9;break;case 8:console.warn(`Unsupported forward transition: fullscreen → ${r}. Presenting as fullscreen.`);case 9:m.n=11;break;case 10:this.presentationStyle=r,this.applyPresentationHostClasses();case 11:return d=("compact_sheet"===a||"sheet"===a)&&"fullscreen"===r,h="fullscreen"===a&&("compact_sheet"===r||"sheet"===r),c=!("compact_sheet"!==a&&"sheet"!==a||"compact_sheet"!==r&&"sheet"!==r||a===r)||d||h,this.animation=c?{transition:"fade",direction:t.direction}:t,m.n=12,K(this.updatePages(e));case 12:null!==(n=this.flow)&&void 0!==n&&n.currentFlowStep&&this.flow.executeLifecycle(this.flow.currentFlowStep,M.APPEAR);case 13:return m.a(2)}},null,this,null,Promise)}},{key:"getSelectedSlideIndexForCurrentCarousel",value:function(){return Yt.getSelectedSlideIndex()}},{key:"renderFlow",value:function(){return"undefined"==typeof document?N(Ts||(Ts=Ws``)):this.isOverlaySheet?this.renderHalfSheet():this.isModal?this.renderModal(this.renderFlowContainer()):this.renderFlowContainer()}},{key:"renderFlowContainer",value:function(){return N(Ps||(Ps=Ws`
254
+ `)),St=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},Et=globalThis,Mt=Et.ShadowRoot&&(void 0===Et.ShadyCSS||Et.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Tt=Symbol(),Pt=new WeakMap,At=function(){return ee(function e(t,i,n){if(Y(this,e),this._$cssResult$=!0,n!==Tt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=i},[{key:"styleSheet",get:function(){var e=this.o,t=this.t;if(Mt&&void 0===e){var i=void 0!==t&&1===t.length;i&&(e=Pt.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Pt.set(t,e))}return e}},{key:"toString",value:function(){return this.cssText}}])}(),Dt=(e,t)=>{if(Mt)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(var i,n=te(t);!(i=n()).done;){var a=i.value,r=document.createElement("style"),o=Et.litNonce;void 0!==o&&r.setAttribute("nonce",o),r.textContent=a.cssText,e.appendChild(r)}},xt=Mt?e=>e:e=>e instanceof CSSStyleSheet?(e=>{for(var t,i="",n=te(e.cssRules);!(t=n()).done;){i+=t.value.cssText}return(e=>new At("string"==typeof e?e:e+"",void 0,Tt))(i)})(e):e,Ct=Object.is,It=Object.defineProperty,Lt=Object.getOwnPropertyDescriptor,_t=Object.getOwnPropertyNames,Rt=Object.getOwnPropertySymbols,Ft=Object.getPrototypeOf,Wt=globalThis,Ot=Wt.trustedTypes,$t=Ot?Ot.emptyScript:"",Nt=Wt.reactiveElementPolyfillSupport,jt=(e,t)=>e,Bt={toAttribute(e,t){switch(t){case Boolean:e=e?$t:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){var i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},zt=(e,t)=>!Ct(e,t),Ut={attribute:!0,type:String,converter:Bt,reflect:!1,useDefault:!1,hasChanged:zt};null!==(gt=Symbol.metadata)&&void 0!==gt||(Symbol.metadata=Symbol("metadata")),null!==(yt=Wt.litPropertyMetadata)&&void 0!==yt||(Wt.litPropertyMetadata=new WeakMap);var Ht=function(){function e(){var t;return Y(this,e),(t=X(this,e))._$Ep=void 0,t.isUpdatePending=!1,t.hasUpdated=!1,t._$Em=null,t._$Ev(),t}return re(e,ve(HTMLElement)),ee(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,i;(null!==(t=this._$EO)&&void 0!==t?t:this._$EO=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&(null===(i=e.hostConnected)||void 0===i||i.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,i=te(this.constructor.elementProperties.keys());!(e=i()).done;){var n=e.value;this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n])}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 Dt(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,i){this._$AK(e,i)}},{key:"_$ET",value:function(e,t){var i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(void 0!==n&&!0===i.reflect){var a,r=(void 0!==(null===(a=i.converter)||void 0===a?void 0:a.toAttribute)?i.converter:Bt).toAttribute(t,i.type);this._$Em=e,null==r?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}},{key:"_$AK",value:function(e,t){var i=this.constructor,n=i._$Eh.get(e);if(void 0!==n&&this._$Em!==n){var a,r,o,s=i.getPropertyOptions(n),u="function"==typeof s.converter?{fromAttribute:s.converter}:void 0!==(null===(a=s.converter)||void 0===a?void 0:a.fromAttribute)?s.converter:Bt;this._$Em=n;var l=u.fromAttribute(t,s.type);this[n]=null!==(r=null!=l?l:null===(o=this._$Ej)||void 0===o?void 0:o.get(n))&&void 0!==r?r:l,this._$Em=null}}},{key:"requestUpdate",value:function(e,t,i,n=!1,a){if(void 0!==e){var r,o,s=this.constructor;if(!1===n&&(a=this[e]),null!=i||(i=s.getPropertyOptions(e)),!((null!==(r=i.hasChanged)&&void 0!==r?r:zt)(a,t)||i.useDefault&&i.reflect&&a===(null===(o=this._$Ej)||void 0===o?void 0:o.get(e))&&!this.hasAttribute(s._$Eu(e,i))))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}},{key:"C",value:function(e,t,{useDefault:i,reflect:n,wrapped:a},r){var o,s,u;i&&!(null!==(o=this._$Ej)&&void 0!==o?o:this._$Ej=new Map).has(e)&&(this._$Ej.set(e,null!==(s=null!=r?r:t)&&void 0!==s?s:this[e]),!0!==a||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),!0===n&&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 le(function(i){for(;;)switch(i.p=i.n){case 0:return this.isUpdatePending=!0,i.p=1,i.n=2,K(this._$ES);case 2:i.n=4;break;case 3:i.p=3,t=i.v,Promise.reject(t);case 4:if(e=this.scheduleUpdate(),!(null!=e)){i.n=5;break}return i.n=5,K(e);case 5:return i.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,i=te(this._$Ep);!(t=i()).done;){var n=t.value,a=n[0],r=n[1];this[a]=r}this._$Ep=void 0}var o=this.constructor.elementProperties;if(o.size>0)for(var s,u=te(o);!(s=u()).done;){var l=s.value,d=l[0],h=l[1],c=h.wrapped,m=this[d];!0!==c||this._$AL.has(d)||void 0===m||this.C(d,void 0,h,m)}}var f=!1,v=this._$AL;try{var p;(f=this.shouldUpdate(v))?(this.willUpdate(v),null!==(p=this._$EO)&&void 0!==p&&p.forEach(e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)}),this.update(v)):this._$EM()}catch(v){throw f=!1,this._$EM(),v}f&&this._$AE(v)}}},{key:"willUpdate",value:function(e){}},{key:"_$AE",value:function(e){var t;null!==(t=this._$EO)&&void 0!==t&&t.forEach(e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}},{key:"_$EM",value:function(){this._$AL=new Map,this.isUpdatePending=!1}},{key:"updateComplete",get:function(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function(){return this._$ES}},{key:"shouldUpdate",value:function(e){return!0}},{key:"update",value:function(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(e=>this._$ET(e,this[e]))),this._$EM()}},{key:"updated",value:function(e){}},{key:"firstUpdated",value:function(e){}}],[{key:"addInitializer",value:function(e){var t;this._$Ei(),(null!==(t=this.l)&&void 0!==t?t:this.l=[]).push(e)}},{key:"observedAttributes",get:function(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}},{key:"createProperty",value:function(e,t=Ut){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 i=Symbol(),n=this.getPropertyDescriptor(e,i,t);void 0!==n&&It(this.prototype,e,n)}}},{key:"getPropertyDescriptor",value:function(e,t,i){var n,a=null!==(n=Lt(this.prototype,e))&&void 0!==n?n:{get(){return this[t]},set(e){this[t]=e}},r=a.get,o=a.set;return{get:r,set(t){var n=null==r?void 0:r.call(this);null!=o&&o.call(this,t),this.requestUpdate(e,n,i)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(e){var t;return null!==(t=this.elementProperties.get(e))&&void 0!==t?t:Ut}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty(jt("elementProperties"))){var e=Ft(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty(jt("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(jt("properties")))for(var e=this.properties,t=0,i=[..._t(e),...Rt(e)];t<i.length;t++){var n=i[t];this.createProperty(n,e[n])}var a=this[Symbol.metadata];if(null!==a){var r=litPropertyMetadata.get(a);if(void 0!==r)for(var o,s=te(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=te(this.elementProperties);!(h=c()).done;){var m=h.value,f=m[0],v=m[1],p=this._$Eu(f,v);void 0!==p&&this._$Eh.set(p,f)}this.elementStyles=this.finalizeStyles(this.styles)}}},{key:"finalizeStyles",value:function(e){var t=[];if(Array.isArray(e))for(var i,n=te(new Set(e.flat(1/0).reverse()));!(i=n()).done;){var a=i.value;t.unshift(xt(a))}else void 0!==e&&t.push(xt(e));return t}},{key:"_$Eu",value:function(e,t){var i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}}])}();Ht.elementStyles=[],Ht.shadowRootOptions={mode:"open"},Ht[jt("elementProperties")]=new Map,Ht[jt("finalized")]=new Map,null!=Nt&&Nt({ReactiveElement:Ht}),(null!==(bt=Wt.reactiveElementVersions)&&void 0!==bt?bt:Wt.reactiveElementVersions=[]).push("2.1.2");var Gt={attribute:!0,type:String,converter:Bt,reflect:!1,hasChanged:zt},Vt=(e=Gt,t,i)=>{var n=i.kind,a=i.metadata,r=globalThis.litPropertyMetadata.get(a);if(void 0===r&&globalThis.litPropertyMetadata.set(a,r=new Map),"setter"===n&&((e=Object.create(e)).wrapped=!0),r.set(i.name,e),"accessor"===n){var o=i.name;return{set(i){var n=t.get.call(this);t.set.call(this,i),this.requestUpdate(o,n,e,!0,i)},init(t){return void 0!==t&&this.C(o,void 0,e,t),t}}}if("setter"===n){var s=i.name;return function(i){var n=this[s];t.call(this,i),this.requestUpdate(s,n,e,!0,i)}}throw Error("Unsupported decorator location: "+n)};function Kt(e){return(t,i)=>"object"==typeof i?Vt(e,t,i):((e,t,i)=>{var n=t.hasOwnProperty(i);return t.constructor.createProperty(i,e),n?Object.getOwnPropertyDescriptor(t,i):void 0})(e,t,i)}function Xt(e){return Kt(ie({},e,{state:!0,attribute:!1}))}var Yt=function(){function e(t,i,n){var a;return Y(this,e),(a=X(this,e,[t,i,n])).host=null,a.defineDynamicStateProps(),a}return re(e,i),ee(e,[{key:"hostConnected",value:function(){}},{key:"hostDisconnected",value:function(){this.subscribers.clear()}},{key:"onStateChanged",value:function(){this.defineDynamicStateProps(),this.host&&this.host.requestUpdate()}},{key:"defineDynamicStateProps",value:function(){Object.defineProperty(this.state,"tvQuality",{get:this.getTVQuality.bind(this),enumerable:!1,configurable:!0}),Object.defineProperty(this.state,"viewportWidth",{get:this.getViewportWidth.bind(this),enumerable:!1,configurable:!0}),Object.defineProperty(this.state,"viewportHeight",{get:this.getViewportHeight.bind(this),enumerable:!1,configurable:!0})}},{key:"getTVQuality",value:function(){var e,t;if("television"!==this.getFormFactor())return"";var i=window.devicePixelRatio||1,n=window.innerWidth||(null===(e=window.screen)||void 0===e?void 0:e.availWidth),a=window.innerHeight||(null===(t=window.screen)||void 0===t?void 0:t.availHeight);if(!n||!a)return"720p";var r=Math.max(n,a)*i,o=Math.min(n,a)*i;return r>=3840||o>=2160?"4K":r>=1920||o>=1080?"1080p":"720p"}},{key:"getViewportWidth",value:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}},{key:"getViewportHeight",value:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}}],[{key:"create",value:function(t,i,n){var a=new e(t,i,n);return this.providers.push(a),a}},{key:"remove",value:function(e){this.providers=this.providers.filter(t=>t!==e)}},{key:"currentProvider",get:function(){return this.providers[0]}}])}();var qt=e=>{var t;return le(function(i){for(;;)if(0===i.n)return t=new Set(Array.from(document.fonts.values()).map(e=>e.family)),e.forEach(e=>{var i=Jt(e);if(!t.has(i)){var n=new FontFace(i,`url(${e.file})`);document.fonts.add(n)}}),i.a(2,document.fonts.ready.then())},null,null,null,Promise)};function Jt(e){return`${e.family}-${e.style}`.replace(/ /g,"")}function Qt(e,t,i){var a,r,o,s,u,l,d,h;if("undefined"==typeof window||!e||!t)return n.debug("Swipe detection is not supported in this environment."),{destroy(){},updateOptions(){}};var c={minDistance:null!==(a=null==i?void 0:i.minDistance)&&void 0!==a?a:30,maxDuration:null!==(r=null==i?void 0:i.maxDuration)&&void 0!==r?r:600,lockAxis:null===(o=null==i?void 0:i.lockAxis)||void 0===o||o,preventScrollOnSwipe:null!==(s=null==i?void 0:i.preventScrollOnSwipe)&&void 0!==s&&s,pointerTypes:null!==(u=null==i?void 0:i.pointerTypes)&&void 0!==u?u:["touch"],passiveListeners:null===(l=null==i?void 0:i.passiveListeners)||void 0===l||l,axisHint:null!==(d=null==i?void 0:i.axisHint)&&void 0!==d?d:"y",edgeLeakThreshold:null!==(h=null==i?void 0:i.edgeLeakThreshold)&&void 0!==h?h:24},m=e.style.touchAction;c.preventScrollOnSwipe&&(e.style.touchAction="none");var f=null,v=0,p=0,g=0,y=0,b=0,w=null,k=null,S=!1,E=!1,M=!1,T=e=>{try{var t=window.getComputedStyle(e);if(!t)return!1;var i=t.overflowY;if("auto"!==i&&"scroll"!==i)return!1;var n=e;return n.scrollHeight>n.clientHeight}catch(e){return!1}},P=e=>c.pointerTypes.includes(e.pointerType),A=t=>{var i=t.composedPath?t.composedPath()[0]:t.target;if(P(t)&&null===f){f=t.pointerId,v=g=t.clientX,p=y=t.clientY,b=performance.now(),w=null,M=!1,S=!1,E=!1,(k="y"===c.axisHint?((e,t)=>{for(var i=e;i&&i!==t&&i instanceof HTMLElement;){var n,a;if(T(i))return i;i=i.parentElement||(null!==(n=null===(a=i.parentNode)||void 0===a?void 0:a.host)&&void 0!==n?n:null)}return null})(i,e):null)||(E=!0);try{var n;null==e||null===(n=e.setPointerCapture)||void 0===n||n.call(e,t.pointerId)}catch(e){try{var a;null==i||null===(a=i.setPointerCapture)||void 0===a||a.call(i,t.pointerId)}catch(e){}}}},D=e=>{if(e.pointerId===f&&P(e)){if(g=e.clientX,y=e.clientY,c.lockAxis&&!w){var i=Math.abs(g-v),n=Math.abs(y-p);(i>2||n>2)&&(w=n>=i?"y":"x")}if("y"===c.axisHint&&("y"===w||!c.lockAxis)){var a=y-p,r=a<0?"up":"down",o=Math.abs(a),s=performance.now()-b,u=o/Math.max(s,1),l=o>=c.minDistance||u>.5;if(k)if(l)E=!0;else if(((e,t)=>!!e&&("down"===t?e.scrollTop>0:e.scrollTop+e.clientHeight<e.scrollHeight-1))(k,r)){if(!(("down"===r&&k.scrollTop<=50||"up"===r&&k.scrollTop+k.clientHeight>=k.scrollHeight-50)&&u>.3))return void(S=!0);E=!0}else E=!0;var d=!k||o>=c.edgeLeakThreshold;if(!M&&!S&&E&&d&&o>=c.minDistance){M=!0;var h=performance.now(),m={direction:"up"===r?"up":"down",distanceX:g-v,distanceY:a,absX:Math.abs(g-v),absY:o,duration:h-b,velocity:o/Math.max(h-b,1),startX:v,startY:p,endX:g,endY:y,startedAt:b,endedAt:h,originalEvent:e};t(m)}}}},x=e=>{if(e.pointerId===f)if(P(e))if(k)C();else if(M||S)C();else{var i,n=performance.now(),a=n-b,r=g-v,o=y-p,s=Math.abs(r),u=Math.abs(o),l="x"===(i=c.lockAxis&&w?w:"x"===c.axisHint?"x":"y"===c.axisHint?"y":s>=u?"x":"y")?s:u,d=a<=c.maxDuration,h=c.minDistance;if(k&&"y"===i&&E&&(h+=c.edgeLeakThreshold),d&&l>=h){var m;m="x"===i?r>0?"right":"left":o>0?"down":"up";var T=l/Math.max(a,1);t({direction:m,distanceX:r,distanceY:o,absX:s,absY:u,duration:a,velocity:T,startX:v,startY:p,endX:g,endY:y,startedAt:b,endedAt:n,originalEvent:e})}C()}else C()},C=()=>{f=null,w=null,b=0,k=null,E=!1,S=!1,M=!1},I=!!c.passiveListeners&&{passive:!0},L=c.passiveListeners?{passive:!0,capture:!0}:{capture:!0};e.addEventListener("pointerdown",A,L),e.addEventListener("pointermove",D,I),e.addEventListener("pointerup",x,I),e.addEventListener("pointercancel",x,I),e.addEventListener("lostpointercapture",x,I);return{destroy:()=>{e.removeEventListener("pointerdown",A,L),e.removeEventListener("pointermove",D,I),e.removeEventListener("pointerup",x,I),e.removeEventListener("pointercancel",x,I),e.removeEventListener("lostpointercapture",x,I),c.preventScrollOnSwipe&&(e.style.touchAction=m),C()},updateOptions:t=>{Object.assign(c,t),"boolean"==typeof t.preventScrollOnSwipe&&(t.preventScrollOnSwipe?e.style.touchAction="none":e.style.touchAction=m)}}}var Zt={},ei=Zt.NAMI_CLOSE_PAYWALL,ti=void 0===ei?"namiClosePaywall":ei,ii=Zt.NAMI_RESTORE_PURCHASES,ni=void 0===ii?"namiRestorePurchases":ii,ai=Zt.NAMI_SIGN_IN,ri=void 0===ai?"namiSignIn":ai,oi=Zt.NAMI_BUY_SKU,si=void 0===oi?"namiBuySKU":oi,ui=Zt.SET_STATE,li=void 0===ui?"setState":ui,di=Zt.NAMI_SELECT_SKU,hi=void 0===di?"namiSelectSKU":di,ci=Zt.NAMI_PURCHASE_SELECTED_SKU,mi=void 0===ci?"namiPurchaseSelectedSKU":ci,fi=Zt.NAMI_DEEP_LINK,vi=void 0===fi?"namiDeeplink":fi,pi=Zt.NAMI_NAVIGATE_TO_SCREEN,gi=void 0===pi?"namiNavigateToScreen":pi,yi=Zt.NAMI_RELOAD_PRODUCTS,bi=void 0===yi?"namiReloadProducts":yi,wi=Zt.NAMI_PLAY_VIDEO,ki=void 0===wi?"namiPlayVideo":wi,Si=Zt.NAMI_PAUSE_VIDEO,Ei=void 0===Si?"namiPauseVideo":Si,Mi=Zt.NAMI_MUTE_VIDEO,Ti=void 0===Mi?"namiMuteVideo":Mi,Pi=Zt.NAMI_UNMUTE_VIDEO,Ai=void 0===Pi?"namiUnmuteVideo":Pi,Di=e=>"subscription"===e;function xi(e){if(Di(null==e?void 0:e.product_type)){var t=Ii(e);if(t.length>0)return t[0].billingPeriod}return null}function Ci(e){var t=function(e){if(!e)return[];var t=e.offers.filter(e=>"promo"===e.offer_type);return Li(t,e.subscription_period)}(e).find(e=>0===e.priceAmountMicros);return(null==t?void 0:t.billingPeriod)||null}function Ii(e){return e?Li(e.offers.filter(e=>"default"===e.offer_type),e.subscription_period):[]}function Li(e,t){return e.map(e=>_i(e,t))}function _i(e,t){var i,n,a,r,o,s,u,l;if(!e)return{};var d=null!==(i=null===(n=e.promo_period)||void 0===n?void 0:n.count)&&void 0!==i?i:null==t?void 0:t.count,h=null!==(a=null===(r=e.promo_period)||void 0===r?void 0:r.type)&&void 0!==a?a:null==t?void 0:t.type,c=null!==(o=null===(s=e.promo_price)||void 0===s?void 0:s.price)&&void 0!==o?o:e.price,m=null!==(u=null===(l=e.promo_price)||void 0===l?void 0:l.currency)&&void 0!==u?u:e.currency;return{priceAmountMicros:1e6*c,priceCurrencyCode:m,billingPeriod:h?`P${d}${h[0].toUpperCase()}`:"",formattedPrice:Wi(m).format(c)}}function Ri(e,t=!1,i=!1,n=!1,r=!1){if(!e)return null;var o=e.match(/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/);if(!o)return null;var s=o.slice(1).map(e=>parseInt(e)),u=s[0],l=s[1],d=s[2],h=s[3],c=(e,t,i,n,o)=>{var s=(e=>r?`${e}_abbrev`:e)(o),u=(e=>r?`${e}_abbrev_plural`:`${e}_plural`)(o),l=a(s),d=a(u);return r||l!==s||(l=a(`${o}_abbrev`)),r||d!==u||(d=a(`${o}_abbrev_plural`)),n?e.toString():i?1===e||t?l:d:1===e||t?`${e} ${l}`:`${e} ${d}`};switch(e.at(-1)){case"D":return c(h,t,i,n,"nami_day");case"W":return c(d,t,i,n,"nami_week");case"M":return c(l,t,i,n,"nami_month");case"Y":return c(u,t,i,n,"nami_year")}return null}function Fi(e){var t;if(!e||e.length<2)return!1;var i=null===(t=e.at(-1))||void 0===t?void 0:t.toUpperCase();return"M"===i||"Y"===i}function Wi(e){var t={maximumFractionDigits:2,minimumFractionDigits:0};try{return new Intl.NumberFormat(navigator.language,ie({},t,{style:"currency",currency:e}))}catch(e){return new Intl.NumberFormat(navigator.language,ie({},t,{style:"currency",currency:"USD"}))}}var Oi=(e,t,i)=>e&&t&&i?i.format(e-t):null,$i=(e,t,i,n)=>{if(e&&t&&i&&n){var a=100*(1-e/(i/n*t));return`${Math.round(a)}%`}return null},Ni=(e,t)=>{if(""!=t){var i=parseInt(t)-1;return i>=0&&i<(null==e?void 0:e.length)?e[i]:null==e?void 0:e.find(e=>e.sku_ref_id===t)}},ji=e=>zi(e.priceAmountMicros)/Bi(e.billingPeriod),Bi=e=>{var t=parseInt(e[1]);return e.includes("Y")&&(t*=12),t},zi=e=>e/1e6;function Ui(e){return parseFloat((Math.round(e)/100).toFixed(2))}var Hi=(e,t,i=[])=>({price:()=>Vi(e),name:()=>null==e?void 0:e.name,title:()=>null==e?void 0:e.name,description:()=>null==e?void 0:e.description,duration:()=>Ki(e),durationSingular:()=>Ki(e,!0),period:()=>Ki(e,!1,!0),periodNumber:()=>Ki(e,!1,!1,!0),freeTrialDuration:()=>Xi(e),freeTrialDurationSingular:()=>Xi(e,!0),freeTrialPeriod:()=>Xi(e,!1,!0),freeTrialPeriodNumber:()=>Xi(e,!1,!1,!0),pricePerMonth:()=>Yi(e),pricePerMonthRounded:()=>Yi(e,!0),periodInMonths:()=>qi(e),durationInMonths:()=>Ji(e),durationInMonthsSingular:()=>Ji(e,!0),periodNumberInMonths:()=>Qi(e),percentagePriceDifferenceFromSku:()=>Zi(e,t,i),priceDifferenceFromSku:()=>en(e,t,i),promoEligible:()=>null===tn(e)&&null!==nn(e,t),freeTrialEligible:()=>null!==tn(e),promo:()=>{var i;return null===(i=nn(e,t))||void 0===i?void 0:i.offer_ref_id},promoCode:()=>"XXXXX",promoPrice:()=>{var i;return null===(i=an(e,t))||void 0===i?void 0:i.formattedPrice},promoPeriod:()=>rn(e,t,!1,!0),promoPeriodNumber:()=>rn(e,t,!1,!1,!0),promoDuration:()=>rn(e,t),promoDurationSingular:()=>rn(e,t,!0),introEligible:()=>!1,pricePerDay:()=>dn(e),pricePerWeek:()=>hn(e),pricePerWeekRounded:()=>hn(e,!0),introductoryPrice:()=>un(e,t),introductoryPeriod:()=>sn(e,t,!1,!0),introductoryPeriodNumber:()=>sn(e,t,!1,!1,!0),introductoryDuration:()=>sn(e,t),introductoryDurationSingular:()=>sn(e,t,!0),introductoryPricePerMonth:()=>ln(e,t),introductoryPricePerMonthRounded:()=>ln(e,t,!0),durationAbbrev:()=>Ki(e,!1,!1,!1,!0),freeTrialDurationAbbrev:()=>Xi(e,!1,!1,!1,!0),introductoryDurationAbbrev:()=>sn(e,t,!1,!1,!1,!0),promoDurationAbbrev:()=>rn(e,t,!1,!1,!1,!0),promoDurationPhase2Abbrev:()=>rn(e,t,!0,!0,!1,!0),durationInMonthsAbbrev:()=>Ji(e,!1,!1,!1,!0),durationSingularAbbrev:()=>Ki(e,!0,!1,!1,!0),freeTrialDurationSingularAbbrev:()=>Xi(e,!0,!1,!1,!0),introductoryDurationSingularAbbrev:()=>sn(e,t,!0,!1,!1,!0),promoDurationSingularAbbrev:()=>rn(e,t,!0,!1,!1,!0),promoDurationSingularPhase2Abbrev:()=>rn(e,t,!0,!0,!1,!0),durationInMonthsSingularAbbrev:()=>Ji(e,!0,!1,!1,!0),periodAbbrev:()=>Ki(e,!1,!0,!1,!0),freeTrialPeriodAbbrev:()=>Xi(e,!1,!0,!1,!0),introductoryPeriodAbbrev:()=>sn(e,t,!1,!0,!1,!0),promoPeriodAbbrev:()=>rn(e,t,!1,!0,!1,!0),promoPeriodPhase2Abbrev:()=>rn(e,t,!1,!0,!0,!0),periodInMonthsAbbrev:()=>Ji(e,!1,!0,!1,!0),periodly:()=>function(e){if(!e)return null;var t=e.match(/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/);if(!t)return null;var i=t[1],n=t[2],r=t[3],o=t[4],s=void 0!==i?parseInt(i,10):0,u=void 0!==n?parseInt(n,10):0,l=void 0!==r?parseInt(r,10):0;return(void 0!==o?parseInt(o,10):0)>0?null:l>0?1===l?a("nami_weekly"):2===l?a("nami_biweekly"):null:u>0?a(1===u?"nami_monthly":2===u?"nami_bimonthly":3===u?"nami_quarterly":6===u?"nami_biannually":12===u?"nami_yearly":"nami_monthly"):s>0?a("nami_yearly"):null}(xi(e)),iso_subscription_duration:()=>cn(e),invalid:()=>!1,unavailable:()=>!1}),Gi=(e,t,i,n=[])=>{if(!t)return null;var a=Hi(t,i,n);return a[e]?a[e]():null},Vi=e=>{var t=Ii(e);return t&&t.length?t[0].formattedPrice:null},Ki=(e,t,i,n,a)=>Ri(xi(e),t,i,n,a),Xi=(e,t,i,n,a)=>Ri(Ci(e),t,i,n,a),Yi=(e,t)=>{var i=Ii(e);if(!i||0===i.length)return null;var n=ji(i[0]);return n?Wi(i[0].priceCurrencyCode).format(t?Math.round(n):n):null},qi=(e,t)=>{var i=Ii(e);if(!i||0===i.length)return null;var n=i[0].billingPeriod;return Fi(n)?Ri("P1Y"===n?"P12M":n,!1,!1,!1,t):null},Ji=(e,t,i,n,a)=>{var r=Ii(e);if(!r||0===r.length)return null;var o=r[0].billingPeriod;return Fi(o)?Ri("P1Y"===o?"P12M":o,t,i,n,a):null},Qi=e=>{if(!e)return 0;var t=Ii(e);return t&&t.length?Bi(t[0].billingPeriod):0},Zi=(e,t,i=[])=>{var n,a=Ii(e);if(!a||0===a.length)return null;var r=null===(n=Ni(i,null!=t?t:""))||void 0===n?void 0:n.product_details;if(!t||!r)return $i(Ui(a[0].priceAmountMicros),Qi(e));var o=Ii(r);return $i(Ui(a[0].priceAmountMicros),Qi(e),(null==o?void 0:o.length)>0?Ui(o[0].priceAmountMicros):0,Qi(r))},en=(e,t,i=[])=>{var n,a=Ii(e);if(!a||0===a.length)return null;var r=null===(n=Ni(i,null!=t?t:""))||void 0===n?void 0:n.product_details;if(!t||!r)return Oi(ji(a[0]));var o=Ii(r);return Oi(ji(a[0]),ji(o[0]),Wi(o[0].priceCurrencyCode))},tn=e=>Ci(e),nn=(e,t)=>{if(!e)return null;var i=e.offers.filter(e=>"promo"===e.offer_type);if(!t)return i[0]||null;var n=i[parseInt(t)];return n?n||null:i.find(e=>e.offer_ref_id===t)||null},an=(e,t)=>{if(!e)return null;var i=nn(e,t);return i?_i(i,e.subscription_period):null},rn=(e,t,i,n,a,r)=>{var o=an(e,t);return Ri((null==o?void 0:o.billingPeriod)||null,i,n,a,r)},on=(e,t)=>{if(!e)return null;var i=((e,t)=>{if(!e)return null;var i=e.offers.filter(e=>"intro"===e.offer_type);if(!t)return i[0]||null;var n=i[parseInt(t)];return n?n||null:i.find(e=>e.offer_ref_id===t)||null})(e,t);return i?_i(i,e.subscription_period):null},sn=(e,t,i,n,a,r)=>{var o=on(e,t);return Ri((null==o?void 0:o.billingPeriod)||null,i,n,a,r)},un=(e,t)=>{var i=on(e,t);return i?i.formattedPrice:null},ln=(e,t,i)=>{var n=on(e,t);if(!n)return null;var a=ji(n);return a?Wi(n.priceCurrencyCode).format(i?Math.round(a):a):null},dn=e=>{var t=Ii(e);if(!t||0===t.length)return null;var i,n,a=zi(t[0].priceAmountMicros)/(i=t[0].billingPeriod,(n=Bi(i))?30.437*n:1);return Wi(t[0].priceCurrencyCode).format(a)},hn=(e,t)=>{var i=Ii(e);if(!i||0===i.length)return null;var n,a,r=zi(i[0].priceAmountMicros)/(n=i[0].billingPeriod,(a=Bi(n))?52*a/12:1);return Wi(i[0].priceCurrencyCode).format(t?Math.round(r):r)},cn=e=>{var t=Ii(e)[0];return t?t.billingPeriod:null},mn="object"==typeof global&&global&&global.Object===Object&&global,fn="object"==typeof self&&self&&self.Object===Object&&self,vn=mn||fn||Function("return this")(),pn=vn.Symbol;var gn=Array.isArray,yn=Object.prototype,bn=yn.hasOwnProperty,wn=yn.toString,kn=pn?pn.toStringTag:void 0;var Sn=Object.prototype.toString;var En=pn?pn.toStringTag:void 0;function Mn(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":En&&En in Object(e)?function(e){var t=bn.call(e,kn),i=e[kn];try{e[kn]=void 0;var n=!0}catch(e){}var a=wn.call(e);return n&&(t?e[kn]=i:delete e[kn]),a}(e):function(e){return Sn.call(e)}(e)}function Tn(e){return null!=e&&"object"==typeof e}var Pn=pn?pn.prototype:void 0,An=Pn?Pn.toString:void 0;function Dn(e){if("string"==typeof e)return e;if(gn(e))return function(e,t){for(var i=-1,n=null==e?0:e.length,a=Array(n);++i<n;)a[i]=t(e[i],i,e);return a}(e,Dn)+"";if(function(e){return"symbol"==typeof e||Tn(e)&&"[object Symbol]"==Mn(e)}(e))return An?An.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function xn(e){return null==e?"":Dn(e)}function Cn(e,t,i){var n=e.length;return i=void 0===i?n:i,!t&&i>=n?e:function(e,t,i){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(i=i>a?a:i)<0&&(i+=a),a=t>i?0:i-t>>>0,t>>>=0;for(var r=Array(a);++n<a;)r[n]=e[n+t];return r}(e,t,i)}var In=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function Ln(e){return In.test(e)}var _n="\\ud800-\\udfff",Rn="["+_n+"]",Fn="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Wn="\\ud83c[\\udffb-\\udfff]",On="[^"+_n+"]",$n="(?:\\ud83c[\\udde6-\\uddff]){2}",Nn="[\\ud800-\\udbff][\\udc00-\\udfff]",jn="(?:"+Fn+"|"+Wn+")"+"?",Bn="[\\ufe0e\\ufe0f]?",zn=Bn+jn+("(?:\\u200d(?:"+[On,$n,Nn].join("|")+")"+Bn+jn+")*"),Un="(?:"+[On+Fn+"?",Fn,$n,Nn,Rn].join("|")+")",Hn=RegExp(Wn+"(?="+Wn+")|"+Un+zn,"g");function Gn(e){return Ln(e)?function(e){return e.match(Hn)||[]}(e):function(e){return e.split("")}(e)}var Vn,Kn=(Vn="toUpperCase",function(e){var t=Ln(e=xn(e))?Gn(e):void 0,i=t?t[0]:e.charAt(0),n=t?Cn(t,1).join(""):e.slice(1);return i[Vn]()+n});var Xn,Yn=(Xn={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},function(e){return null==Xn?void 0:Xn[e]}),qn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Jn=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var Qn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var Zn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var ea="\\ud800-\\udfff",ta="\\u2700-\\u27bf",ia="a-z\\xdf-\\xf6\\xf8-\\xff",na="A-Z\\xc0-\\xd6\\xd8-\\xde",aa="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ra="["+aa+"]",oa="\\d+",sa="["+ta+"]",ua="["+ia+"]",la="[^"+ea+aa+oa+ta+ia+na+"]",da="(?:\\ud83c[\\udde6-\\uddff]){2}",ha="[\\ud800-\\udbff][\\udc00-\\udfff]",ca="["+na+"]",ma="(?:"+ua+"|"+la+")",fa="(?:"+ca+"|"+la+")",va="(?:['’](?:d|ll|m|re|s|t|ve))?",pa="(?:['’](?:D|LL|M|RE|S|T|VE))?",ga="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",ya="[\\ufe0e\\ufe0f]?",ba=ya+ga+("(?:\\u200d(?:"+["[^"+ea+"]",da,ha].join("|")+")"+ya+ga+")*"),wa="(?:"+[sa,da,ha].join("|")+")"+ba,ka=RegExp([ca+"?"+ua+"+"+va+"(?="+[ra,ca,"$"].join("|")+")",fa+"+"+pa+"(?="+[ra,ca+ma,"$"].join("|")+")",ca+"?"+ma+"+"+va,ca+"+"+pa,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",oa,wa].join("|"),"g");function Sa(e,t,i){return e=xn(e),void 0===t?function(e){return Zn.test(e)}(e)?function(e){return e.match(ka)||[]}(e):function(e){return e.match(Qn)||[]}(e):e.match(t)||[]}var Ea=RegExp("['’]","g");var Ma,Ta=(Ma=function(e,t,i){return t=t.toLowerCase(),e+(i?Kn(xn(t).toLowerCase()):t)},function(e){return function(e,t,i){for(var n=-1,a=null==e?0:e.length;++n<a;)i=t(i,e[n],n,e);return i}(Sa(function(e){return(e=xn(e))&&e.replace(qn,Yn).replace(Jn,"")}(e).replace(Ea,"")),Ma,"")});function Pa(e,t,i){var n,a,r=null!==(n=null===(a=t.find(e=>e.id===i))||void 0===a?void 0:a.products)&&void 0!==n?n:[];return r.forEach(t=>{t.product_details=Ca(e,t.sku_ref_id||""),t.variables=function(e,t,i){if(!t)return{};var n=t.variables;if(!n)return ie({},t);Object.keys(n).forEach(t=>{if(Aa(n[t])){var a=xa(n[t],e,i);n[t]=function(e){if(!e||e.includes("null")||e.includes("undefined"))return"";if(/\$\{\s*(launch\.customAttributes\.|sku\.)\w+\s*}/.test(e))return"";return e}(a)}});var a={};return(()=>Object.keys(Hi({})))().forEach(t=>{if(void 0===n[t]){var r=Gi(t,e,void 0,i);null!==r&&(a[t]=r)}}),ie({},t,a,n)}(t.product_details,t,r)}),r}function Aa(e){return"string"==typeof e&&e.includes(r)}function Da(e,t,i){return t?(Object.keys(t).forEach(n=>{Aa(t[n])&&(t[n]=t[Ta(n)]=xa(t[n],e,i))}),ie({},t)):{}}var xa=(e,t,i)=>e.replace(o,(n,a)=>{var r,s,u,l,d=(null===(r=o.exec(e))||void 0===r?void 0:r.slice(1))||[];a=null!==(s=d[0])&&void 0!==s?s:a;var h=null!==(u=null===(l=d[1])||void 0===l?void 0:l.replace(":",""))&&void 0!==u?u:"";return Gi(a,t,h,i)});function Ca(e=[],t=""){return e.find(e=>e.product_ref_id===t)||null}var Ia=["conditionAttributes"];function La(e,t){return Array.isArray(e)?e.reduce((e,i)=>{var n=La(i,t);return Array.isArray(n)?[...e,...n]:[...e,n]},[]):null==e?e:"object"==typeof e?Object.entries(e).reduce((e,[i,n])=>{var a="newRow"===i?n:La(n,t);return ie({},e,{[i]:a})},{}):"string"==typeof e?ja(e,t):e}function _a(e,t,i,n={}){var a=i.productBaseComponents||i.components||[],r=i.productFeaturedComponents||a;return t.map(t=>{var i,o,s,u=t.featured?r:a,l=t.entitlements.map(e=>e.entitlement_ref_id),h=Ca(e.productDetails,t.sku_ref_id),c={freeTrialEligible:1==Gi("freeTrialEligible",h),introEligible:1==Gi("introEligible",h),promoEligible:1==Gi("promoEligible",h),invalid:Gi("invalid",h),unavailable:Gi("unavailable",h)},m=ie({},t,t.variables,c,{id:t.id,entitlements:l});o=t,s=e=>{for(var t,i=te(e);!(t=i()).done;){var n=t.value;n.sku=d(o),n.components&&s(n.components),n.collapseHeader&&n.collapseHeader.components&&s(n.collapseHeader.components)}},s(u);var f={sku:m,media:Na(n,{convertToUrl:!0})};return[null!==(i=t.featured)&&void 0!==i&&i,La(u,La(f,f))]},[])}function Ra(e,t){if(!t.loopSource)return[];var i="string"==typeof t.loopSource?JSON.parse(t.loopSource):t.loopSource,n=(null!=i?i:[]).filter(i=>{var n;return!(null!==(n=t.loopSourceConditions)&&void 0!==n&&n.length)||t.loopSourceConditions.every(t=>$a(e,t,i))}),a=t.groupBy,r=t.groupHeaderTemplate,o=e=>La(t.components,La({block:e},{block:e}));if(!a||!r)return[{key:"",header:null,items:n.map(o).filter(e=>null!=e)}];for(var s,u=[],l=new Map,d=te(n);!(s=d()).done;){var h=s.value,c=La(a,La({block:h},{block:h})),m=null==c?"":String(c);l.has(m)||(u.push(m),l.set(m,[])),l.get(m).push(h)}return u.map(e=>{var t={key:e};return{key:e,header:[La(r,La({group:t},{group:t}))],items:l.get(e).map(o)}})}function Fa(e,t){return t.assertions?t.assertions.every($a.bind(null,e)):!!t.orAssertions&&(!t.orAssertions.length||t.orAssertions.some($a.bind(null,e)))}function Wa(e,t){var i=t.conditionAttributes,n=function(e,t){if(null==e)return{};var i={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;i[n]=e[n]}return i}(t,Ia);return i?i.reduce((t,i)=>Fa(e,i)?(Object.entries(i.attributes).forEach(([t,n])=>{i.attributes[t]=Oa(e,n)}),ie({},t,i.attributes)):t,n):n}function Oa(e,t,i,n=null){var a,o=null!==(a=null==e?void 0:e.flow)&&void 0!==a?a:{},u=o.manager,l=o.previousStepAvailable,d=o.nextStepAvailable,h=e.state,c={};return n&&(c={block:n}),c=ie({},c,{state:h,urlParams:s(),flow:{isLaunched:!(null==u||!u.flowOpen),previousStepAvailable:!!l,nextStepAvailable:!!d},launch:h.launch,sku:h.sku,customer:h.customer}),"string"==typeof t&&t.includes(r)&&(t=ja(t,c)),t}function $a(e,{value:t,expected:i,operator:n},a){if(t=Oa(e,t,0,a),i=Oa(e,i,0,a),"equals"===n)return t===i;if("notEquals"===n)return t!==i;if("contains"===n){var r;if(Array.isArray(t)||"string"==typeof t||t instanceof String||(t=t.toString()),"collapse"==i)i+="_"+(null===(r=e.getCurrentCollapsibleSku())||void 0===r?void 0:r.skuId);return t.includes(i)}if("notContains"===n)return Array.isArray(t)||"string"==typeof t||t instanceof String||(t=t.toString()),!t.includes(i);if("set"===n){var o=null!=t&&""!==t&&!t.toString().match(u);return"boolean"==typeof i?o===i:o}return"notSet"===n?null==t||""===t||!!t.toString().match(u):"gt"===n?t>i:"gte"===n?t>=i:"lt"===n?t<i:"lte"===n&&t<=i}function Na(e,{convertToUrl:t}={convertToUrl:!1}){return Object.entries(e).reduce((e,[i,{content:n}])=>(t&&"string"!=typeof n&&n&&(n=URL.createObjectURL(n)),ie({},e,{[i]:n})),{})}function ja(e,t){var i=e;if("string"!=typeof e)return i;for(var n,a=new RegExp(l.source,l.flags),r=[];null!==(n=a.exec(e))&&(r.push(n),a.global);)n.index===a.lastIndex&&a.lastIndex++;for(var o=0,s=r;o<s.length;o++){var u=s[o],d=u[0],h=u[1],c=ja(h,t);if(d===e)return m(d,c);c!==h&&(i=i.replace(h,c)),i=i.replace(l,m)}return i;function m(e,i){var n=String(i).split("."),a=n[0];if(!a)return e;var r=Ba(t,a);if(void 0===r)return e;if("object"==typeof r&&null!==r&&0===Object.keys(r).length)return"";var o=Ba(t,...n);return void 0===o?"":"string"!=typeof o?o:ja(o,t)}}function Ba(e,...t){for(var i=e,n=0,a=t;n<a.length;n++){var r=a[n];if(null==i)return;i=Array.isArray(i)?i[+r]:i[r]}return i}var za=e=>{var t=e.state.timeSpentOnPaywall;if(t)return Date.now()-t},Ua=e=>{if(!e)return null;if(e.includes("#"))return e;var t=e.match(/[\d.]+/g);if(!t||t.length<3)return null;var i=t.map(Number),n=i[0],a=i[1],r=i[2],o=i[3],s=e=>Math.round(e).toString(16).padStart(2,"0"),u=void 0!==o&&o<1?s(255*o):"";return`#${s(n)}${s(a)}${s(r)}${u}`},Ha=(e,t)=>{if(!e||!t)return!0;var i=null!=e&&e.includes("rgb")?Ua(e):e,n=null!=t&&t.includes("rgb")?Ua(t):t;return(null==i?void 0:i.toLowerCase())===(null==n?void 0:n.toLowerCase())};function Ga(e){var t,i,n,a,r,o,s,u,l,d,h,c,m;return{width:null!==(t=e.width)&&void 0!==t?t:20,railSpacing:null!==(i=e.railSpacing)&&void 0!==i?i:12,dotLineSpacing:null!==(n=e.dotLineSpacing)&&void 0!==n?n:10,lineTopOffset:null!==(a=e.lineTopOffset)&&void 0!==a?a:0,lineBottomOffset:null!==(r=e.lineBottomOffset)&&void 0!==r?r:0,lineWidth:null!==(o=e.lineWidth)&&void 0!==o?o:1,lineColor:null!==(s=e.lineColor)&&void 0!==s?s:"#C6CBD7",lineCornerRadius:null!==(u=e.lineCornerRadius)&&void 0!==u?u:0,dotSize:null!==(l=e.dotSize)&&void 0!==l?l:6,dotColor:null!==(d=e.dotColor)&&void 0!==d?d:"#C6CBD7",dotCornerRadius:null!==(h=e.dotCornerRadius)&&void 0!==h?h:3,dotBorderWidth:null!==(c=e.dotBorderWidth)&&void 0!==c?c:0,dotBorderColor:null!==(m=e.dotBorderColor)&&void 0!==m?m:"transparent",conditionAttributes:e.conditionAttributes}}function Va(e,t,i){for(var n,a=Ga(t),r={key:i},o=La(t,La({group:r},{group:r})),s={dotSize:a.dotSize,dotColor:a.dotColor,dotCornerRadius:a.dotCornerRadius,dotBorderWidth:a.dotBorderWidth,dotBorderColor:a.dotBorderColor},u=te(null!==(l=o.conditionAttributes)&&void 0!==l?l:[]);!(n=u()).done;){var l,d,h=n.value;if(Fa(e,h)){var c=null!==(d=h.attributes)&&void 0!==d?d:{};s={dotSize:"number"==typeof c.dotSize?c.dotSize:s.dotSize,dotColor:"string"==typeof c.dotColor?c.dotColor:s.dotColor,dotCornerRadius:"number"==typeof c.dotCornerRadius?c.dotCornerRadius:s.dotCornerRadius,dotBorderWidth:"number"==typeof c.dotBorderWidth?c.dotBorderWidth:s.dotBorderWidth,dotBorderColor:"string"==typeof c.dotBorderColor?c.dotBorderColor:s.dotBorderColor}}}return s.dotCornerRadius=Math.min(s.dotCornerRadius,s.dotSize/2),s}var Ka=!0,Xa=!1,Ya=!1,qa=!1,Ja=!1,Qa=!1,Za=null,er=null,tr=null,ir=null,nr=!1,ar="",rr=!1,or=null,sr=null,ur=null,lr=null,dr=null,hr=null,cr=null,mr=null,fr=!1,vr=null,pr="",gr=0,yr=1,br=null,wr=[],kr=new WeakMap,Sr=new WeakMap,Er=1;function Mr(e){var t=Sr.get(e);return t||(t=Er++,Sr.set(e,t)),String(t)}var Tr=null,Pr=null,Ar=null,Dr=null;function xr(e){return!0===e||"true"===e||"1"===e||"yes"===e}function Cr(e,t){if(function(){if("undefined"==typeof window)return!1;try{var e,t;return!!xr(window.NAMI_TTS_DEBUG)||xr(null===(e=window.localStorage)||void 0===e?void 0:e.getItem("nami:tts:debug"))||xr(null===(t=window.localStorage)||void 0===t?void 0:t.getItem("NAMI_TTS_DEBUG"))}catch(e){return!1}}())try{t?console.debug(`[Nami TTS] ${e}`,t):console.debug(`[Nami TTS] ${e}`)}catch(e){}}function Ir(e="TTS is unavailable in this runtime."){Xa||(Xa=!0,Cr(e))}function Lr(e){if(!e)return"none";var t=e.id?`#${e.id}`:"",i=e.getAttribute("data-testid"),n=i?`[data-testid="${i}"]`:"";return`${e.tagName.toLowerCase()}${t}${n}`}function _r(e){return function(e){return null==e?"":String(e).replace(/[^.!?\n]*\$\{[^}]*subscribeUrl[^}]*\}[^.!?\n]*[.!?]?/gi,"To subscribe, follow the on-screen instructions.").replace(/\$\{[^}]+\}/g," ").replace(/\s+([.,!?;:])/g,"$1").replace(/\s+/g," ").trim()}(e)}function Rr(e){return e.toLowerCase().replace(/[^a-z0-9$]+/g," ").replace(/\s+/g," ").trim()}function Fr(e){return _r(String(null!=e?e:"").replace(/<[^>]*>/g," ").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/[*_`#>~]/g," "))}function Wr(e,t){var i=_r(t);i&&e[e.length-1]!==i&&e.push(i)}function Or(e,t=[]){var i=[];return[...e,...t].forEach(e=>{var t=function(e){var t=_r(e);if(!t)return[];for(var i=[],n=0,a=0;a<t.length;a+=1){var r=t.charAt(a),o=t.charAt(a+1);if(("."===r||"!"===r||"?"===r)&&(!o||/\s/.test(o))){var s=_r(t.slice(n,a+1));for(s&&i.push(s);a+1<t.length&&/\s/.test(t.charAt(a+1));)a+=1;n=a+1}}var u=_r(t.slice(n));u&&i.push(u);return i.length?i:[t]}(e);t.length||Wr(i,e),t.forEach(e=>Wr(i,e))}),i.slice(0,60)}function $r(e){return _r(e.join(". ").replace(/\.\s*([.!?])/g,"$1"))}function Nr(e){var t,i=br;i&&(e&&i.id===e||(i.status="cancelled",(null===(t=br)||void 0===t?void 0:t.id)===i.id&&(br=null)))}function jr(){if("undefined"==typeof document)return null;for(var e=document.activeElement;e&&null!==(t=e.shadowRoot)&&void 0!==t&&t.activeElement;){var t,i,n;e=null!==(i=null===(n=e.shadowRoot)||void 0===n?void 0:n.activeElement)&&void 0!==i?i:e}return e}function Br(e){return"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot}function zr(e){for(var t=[],i=null!=e?e:null;i;){i instanceof Element&&-1===t.indexOf(i)&&t.push(i);var n=i.parentNode;i=Br(n)?n.host:n}return t}function Ur(e,t){return!!t&&-1!==zr(t).indexOf(e)}function Hr(e,t){if(!t)return!1;if(t===e)return!0;if(e.contains(t))return!0;var i=e.shadowRoot;return!!i&&(i.activeElement===t||i.contains(t))}function Gr(e,t){t&&-1===e.indexOf(t)&&e.push(t)}function Vr(e,t){var i=t.shadowRoot;i&&i.querySelectorAll('button,[role="button"],a,input,select,textarea,[tabindex]:not([tabindex="-1"])').forEach(t=>Gr(e,t))}function Kr(e,t){var i,n=("function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():null!==(i=null==t?void 0:t.composedPath)&&void 0!==i?i:[]).filter(e=>e instanceof Element);return n.length?n:zr(e)}function Xr(e,t=[],i={}){var n=[];if(i.focusedElementOnly)return Gr(n,e),n;var a=(t.length?t:zr(e)).filter(e=>e.isConnected),r=function(e,t){var i,n=t.find(e=>e.matches("nami-product-container"));if(n)return n;var a=zr(e).find(e=>e.matches("nami-product-container"));if(a)return a;var r=ir&&"querySelectorAll"in ir?ir:"undefined"!=typeof document?document:null;return r&&null!==(i=Array.prototype.slice.call(r.querySelectorAll("nami-product-container")).find(t=>Ur(t,e)))&&void 0!==i?i:null}(e,a);return Gr(n,e),Vr(n,e),a.forEach(t=>{var i=!!r&&(t===r||Ur(r,t)),a=t!==e&&Ur(t,e),o=t.matches('nami-product-container,nami-button,[role="button"],button,[tabindex]:not([tabindex="-1"])');(i||a||t===e)&&o&&(Gr(n,t),Vr(n,t))}),null!=r&&r.isConnected&&(Gr(n,r),Vr(n,r)),n}function Yr(e){return kr.has(e)}function qr(e,t,i=[]){var n=_r(t);if(!n)return!1;eo(),Jr(void 0,"new-composite",!0);var a=Xr(e,i,po()||vo()?{focusedElementOnly:!1}:{focusedElementOnly:!0});return a.forEach(e=>function(e,t){var i=_r(t);return!!i&&(kr.has(e)||kr.set(e,{"aria-label":e.getAttribute("aria-label")}),e.setAttribute("aria-label",i),!0)}(e,n)),wr=a,!0}function Jr(e,t="manual",i=!1){var n=e&&-1===wr.indexOf(e)?Xr(e):wr;n.length&&(!i&&br&&n.some(e=>kr.has(e))?Cr("composite restore skipped: transaction still active",{reason:t}):(eo(),n.forEach(e=>{var t=kr.get(e);t&&(!function(e,t,i){null===i?e.removeAttribute(t):e.setAttribute(t,i)}(e,"aria-label",t["aria-label"]),kr.delete(e))}),e&&-1===wr.indexOf(e)||(wr=[])))}function Qr(e,t){kr.has(e)&&(t instanceof Element&&Hr(e,t)||(eo(),ur=setTimeout(()=>{(ur=null,e.isConnected)?Hr(e,jr())||Jr(e,"blur"):Jr(e,"blur-disconnected",!0)},50)))}function Zr(e){wr.length&&Jr(void 0,e,!0)}function eo(){ur&&(clearTimeout(ur),ur=null)}function to(){lr&&(clearTimeout(lr),lr=null),Tr=null}function io(){dr&&(clearTimeout(dr),dr=null)}function no(){hr&&(clearTimeout(hr),hr=null)}function ao(){cr&&(clearTimeout(cr),cr=null)}function ro(){mr&&(clearTimeout(mr),mr=null)}function oo(e){fr=!0,ro(),mr=setTimeout(()=>{mr=null,fr=!1},uo(e)+500)}function so(){ro(),fr=!1}function uo(e){var t=_r(e),i=350*(t?t.split(/\s+/).filter(Boolean).length:0);return Math.min(3e4,Math.max(4e3,i))}function lo(){return"undefined"==typeof window?null:window}function ho(){var e,t=null===(e=lo())||void 0===e||null===(e=e.webOS)||void 0===e||null===(e=e.service)||void 0===e?void 0:e.request;return"function"==typeof t?t:null}function co(){return!!ho()}function mo(){var e;if("undefined"==typeof window)return null;var t=null===(e=window.VIZIO)||void 0===e?void 0:e.Chromevox;return t&&"function"==typeof t.play?t:null}function fo(){return"undefined"!=typeof window&&void 0!==window.speechSynthesis&&"function"==typeof window.speechSynthesis.speak&&"function"==typeof window.SpeechSynthesisUtterance}function vo(){var e;if("undefined"==typeof window)return!1;var t=window,i=(null===(e=window.navigator)||void 0===e||null===(e=e.userAgent)||void 0===e?void 0:e.toLowerCase())||"";return!(!t.VIZIO&&-1===i.indexOf("vizio"))}function po(){var e,t;if("undefined"==typeof window)return!1;if(vo())return!1;var i=(null===(e=window.navigator)||void 0===e||null===(e=e.userAgent)||void 0===e?void 0:e.toLowerCase())||"",n=lo();return!!(null!=n&&n.webOS||null!=n&&n.webOSDev||null!=n&&n.PalmSystem||null!=n&&null!==(t=n.webOS)&&void 0!==t&&null!==(t=t.platform)&&void 0!==t&&t.tv||-1!==i.indexOf("webos")||-1!==i.indexOf("netcast"))}function go(){var e;if("undefined"==typeof window)return!1;var t=window,i=(null===(e=window.navigator)||void 0===e||null===(e=e.userAgent)||void 0===e?void 0:e.toLowerCase())||"";return!!(t.tizen||-1!==i.indexOf("tizen")||-1!==i.indexOf("samsung")&&(-1!==i.indexOf("smart-tv")||-1!==i.indexOf("smarttv"))||-1!==i.indexOf("samsungbrowser")&&-1!==i.indexOf("tv"))}function yo(e){return"string"==typeof e&&-1!==e.toLowerCase().indexOf("xbox")}function bo(){var e,t,i;if("undefined"==typeof window)return!1;if(!0===Ar)return!0;var n=window.navigator;return[n.userAgent,n.platform,n.vendor,null===(e=n.userAgentData)||void 0===e?void 0:e.platform,...(null!==(t=null===(i=n.userAgentData)||void 0===i?void 0:i.brands)&&void 0!==t?t:[]).map(e=>e.brand)].some(yo)}function wo(){if("undefined"==typeof window)return!1;try{return"television"===h()}catch(e){return!1}}function ko(){if(Ja)return!1;var e=mo();if(!e)return!1;try{return"function"!=typeof e.isEnabled||e.isEnabled()}catch(e){return!1}}function So(){return{televisionRuntime:wo(),televisionTtsRuntime:Eo(),webos:po(),tizen:go(),vizio:vo(),xbox:bo(),xboxClientHintsResult:Ar,hasWebOsServiceRequest:co(),webOsRequestType:typeof ho(),hasWebSpeechApi:fo(),webSpeechUnavailableForSession:Ya,webOsLunaUnavailableForSession:qa,vizioChromevoxUnavailableForSession:Ja}}function Eo(){return wo()||po()||vo()||go()}function Mo(){return Eo()&&!Ya&&fo()}function To(e){if(Qa=e,Cr("set media playing",{playing:e,hasDeferredUtterance:!!Za}),!e&&Za){var t,i=Za;if(Za=null,i.options.transactionId&&(null===(t=br)||void 0===t?void 0:t.id)!==i.options.transactionId)return void Cr("drop stale deferred speech",{transactionId:i.options.transactionId,reason:i.options.reason});Uo(i.text,i.options)}}function Po(e){Ya=!0,Ir(po()?"Web Speech TTS unavailable in this webOS runtime":"Web Speech TTS unavailable in this runtime"),Cr("web speech unavailable",{error:e})}function Ao(e){qa=!0,Cr("webOS Luna unavailable",{error:e})}function Do(e,t){Za={text:e,options:t}}var xo={name:"webos-luna-tts",platform:"webos",isAvailable:function(){return Eo()&&!vo()&&!qa&&co()},speak:function(e,t){Cr("speakViaWebOsLuna:enter",{textPreview:e.slice(0,160),reason:t.reason,transactionId:t.transactionId,requestType:typeof ho()});var i=ho();if(!i)return Cr("speakViaWebOsLuna:no-request"),!1;var n="composite"===t.reason,a=!1,r=()=>{var r,o;if(hr=null,t.transactionId&&(null===(r=br)||void 0===r?void 0:r.id)!==t.transactionId)return Cr("speakViaWebOsLuna:drop-stale-delayed-speak",{transactionId:t.transactionId,activeTransaction:null===(o=br)||void 0===o?void 0:o.id,reason:t.reason}),!1;if(Qa)return Cr("speakViaWebOsLuna:defer-delayed-speak-media-playing",{transactionId:t.transactionId,reason:t.reason}),Do(e,t),!0;var s=!1;try{Cr("speakViaWebOsLuna:request",{uri:"luna://com.webos.service.tts",method:"speak",delayedComposite:n,textPreview:e.slice(0,160)}),i("luna://com.webos.service.tts",{method:"speak",parameters:{text:e,clear:!0,feedback:!0},onSuccess:e=>{var i;if(Cr("speakViaWebOsLuna:onSuccess",{response:e,transactionId:t.transactionId}),!t.transactionId||(null===(i=br)||void 0===i?void 0:i.id)===t.transactionId){var n,r=function(e){var t,i=_r(null!==(t=null==e?void 0:e.msgStatus)&&void 0!==t?t:null==e?void 0:e.status).toLowerCase();return"done"===i||"stopped"===i||"canceled"===i||"cancelled"===i||"error"===i}(e),o=!(null==e||!e.returnValue||"msgStatus"in Object(null!=e?e:{}));if(!a&&(r||o))a=!0,t.transactionId&&(null===(n=br)||void 0===n?void 0:n.id)===t.transactionId&&(br.status="ended",br=null)}},onFailure:e=>{var i;s=!0,Cr("speakViaWebOsLuna:onFailure",{error:e,transactionId:t.transactionId});var n=!t.transactionId||(null===(i=br)||void 0===i?void 0:i.id)===t.transactionId;t.transactionId&&n&&br&&(br.status="cancelled",br=null),Ao(e)}})}catch(e){var u;return t.transactionId&&(null===(u=br)||void 0===u?void 0:u.id)===t.transactionId&&(br.status="cancelled",br=null),Ao(e),!1}return!s};if(n)return no(),Cr("speakViaWebOsLuna:delay-composite-until-focus-settles",{delayMs:250,transactionId:t.transactionId}),hr=setTimeout(r,250),!0;return r()},stop:Lo},Co={name:"web-speech",platform:"web",isAvailable:Mo,speak:function(e,t){if(!Mo())return!1;try{var i=new window.SpeechSynthesisUtterance(e);return i.onstart=()=>{var e;t.transactionId&&(null===(e=br)||void 0===e?void 0:e.id)===t.transactionId&&(br.status="started")},i.onend=()=>{var e=br,i=!t.transactionId||(null==e?void 0:e.id)===t.transactionId;t.transactionId&&i&&e&&(e.status="ended",br=null)},i.onerror=e=>{var i,n=e.error;t.transactionId&&(null===(i=br)||void 0===i?void 0:i.id)===t.transactionId&&(br.status="cancelled",br=null),"synthesis-failed"===n&&Po(n)},window.speechSynthesis.speak(i),!0}catch(e){return Po("exception"),!1}},stop:()=>{if(fo())try{window.speechSynthesis.cancel()}catch(e){}}},Io={name:"vizio-chromevox",platform:"vizio",isAvailable:ko,speak:Ro,stop:_o};function Lo(){var e=ho();if(e)try{e("luna://com.webos.service.tts",{method:"stop",parameters:{},onFailure:e=>Cr("webOS Luna stop failed",{error:e})})}catch(e){Cr("webOS Luna stop threw",{error:e})}}function _o(e=!0){var t=!!dr,i=fr;io();var n=mo(),a=function(){var e;if("undefined"==typeof window)return null;var t=null===(e=window.chrome)||void 0===e||null===(e=e.tts)||void 0===e?void 0:e.stop;return"function"==typeof t?t:null}();if((n||a)&&(i||t||a)&&(i||!t||a))try{var r=!1;n&&"function"==typeof n.stop&&(n.stop(),r=!0),n&&"function"==typeof n.cancel&&n.cancel(),n&&"function"==typeof n.pause&&n.pause(),a&&(a(),r=!0),n&&e&&!r&&i&&n.play(""),so()}catch(e){so(),Cr("VIZIO stop threw",{error:e})}}function Ro(e,t){var i=mo();if(!i)return!1;try{var n,a,r=!0===(null===(n=t.element)||void 0===n?void 0:n.isConnected),o="composite"===t.reason?1400:"focus"===t.reason?700:0;return o>0?(io(),dr=setTimeout(()=>{var n;if(dr=null,!t.transactionId||!br||br.id===t.transactionId)if(t.element&&r&&!t.element.isConnected){var a;t.transactionId&&(null===(a=br)||void 0===a?void 0:a.id)===t.transactionId&&(br.status="cancelled",br=null)}else{if(Qa)return to(),Pr=null,void Do(e,t);i.play(e),oo(e),t.transactionId&&(null===(n=br)||void 0===n?void 0:n.id)===t.transactionId&&(br.status="ended",br=null)}},o),!0):(i.play(e),oo(e),t.transactionId&&(null===(a=br)||void 0===a?void 0:a.id)===t.transactionId&&(br.status="ended",br=null),!0)}catch(e){return function(e){Ja=!0,Cr("VIZIO Chromevox unavailable",{error:e})}(e),!1}}function Fo(e){return"high"===e?3:"normal"===e?2:1}function Wo(){return Date.now()-gr<1500}function Oo(e){return Rr(e)}function $o(e){if(!e)return"";var t=function(e){return e?[e.tagName.toLowerCase(),e.id||"",e.getAttribute("data-component-id")||"",e.getAttribute("data-nami-id")||"",e.getAttribute("data-testid")||"",`el-${Mr(e)}`].filter(Boolean).join("|"):""}(e);return Rr(t||Xo(e))}function No(e){var t=Oo(e);return"clickable"===t||"button"===t||"focusable"===t||"selected"===t||"unselected"===t}function jo(e,t,i){var n;if(Pr={textKey:Oo(e),reason:t.reason,timestamp:Date.now()},"high"===i){var a=uo(e),r=Date.now();Tr={transactionId:t.transactionId,pageKey:ar,element:null!==(n=t.element)&&void 0!==n?n:null,elementKey:$o(t.element),textKey:Oo(e),startedAt:r,suppressUntil:r+a},lr&&clearTimeout(lr),lr=setTimeout(()=>{lr=null,Tr=null},a)}}function Bo(e,t=!0){var i,n,a,r=!(!e||(null===(i=br)||void 0===i?void 0:i.id)!==e||"pending"!==br.status);if(Cr("stopSpeech",{preserveTransactionId:e,allowVizioEmptyFallback:t,activeTransaction:null===(n=br)||void 0===n?void 0:n.id,reason:null===(a=br)||void 0===a?void 0:a.reason,preservingCurrentTransaction:r}),Za=null,r||(ao(),no()),e||(to(),eo(),Zr("stop")),Nr(e),sr&&(clearTimeout(sr),sr=null),!r){if(fo())try{window.speechSynthesis.cancel()}catch(e){}po()&&Lo(),vo()&&_o(t)}}function zo(){Bo()}function Uo(e,t={}){var i,n,a;Cr("speakText:enter",{textPreview:_r(e).slice(0,160),reason:t.reason,transactionId:t.transactionId,element:Lr(t.element),runtime:So()});var r=_r(e);if(!r)return!1;if(!Eo())return Cr("skip speech: non-CTV runtime"),!1;var o={interrupt:!1!==t.interrupt,reason:null!==(i=t.reason)&&void 0!==i?i:"manual",transactionId:t.transactionId,element:t.element,focusPath:t.focusPath,priority:t.priority},s=function(e,t){return t.priority?t.priority:"composite"===t.reason?"high":No(e)?"low":"normal"}(r,o);if(function(e,t,i){var n=Oo(e),a=Date.now(),r=$o(t.element);if(No(e))return!0;if(Pr&&Pr.reason===t.reason&&Pr.textKey===n&&a-Pr.timestamp<600)return Cr("suppress:duplicate-request",{reason:t.reason,textPreview:e.slice(0,120)}),!0;if(!Tr)return!1;if(Fo(i)>=Fo("high"))return!1;if("focus"===t.reason){var o=Tr.textKey;if(!Wo()&&(n===o||n.includes(o)))return Cr("suppress:focus-text-is-active-composite",{textPreview:e.slice(0,120),transactionId:Tr.transactionId,element:Lr(t.element)}),!0}var s=function(e,t){return!!e&&!!t&&e===t}(t.element,Tr.element),u=!!r&&Tr.elementKey===r,l=!Tr.pageKey||Tr.pageKey===ar,d=Wo(),h=l&&!d&&a<Tr.startedAt+2500;return!(!s&&!u&&(l&&"focus"===t.reason&&t.element&&Tr.element!==t.element||"low"!==i&&!h)&&(to(),1))}(r,o,s))return!1;if(o.interrupt&&Bo(o.transactionId,!1),Qa)return Do(r,o),!0;var u=function(e){var t;return"manual"!==(null!==(t=e.reason)&&void 0!==t?t:"manual")&&e.element?po()||vo()?"programmatic":"accessibility-label":"programmatic"}(o);Cr("speakText:owner",{owner:u,reason:o.reason,element:Lr(o.element)});var l,d,h="programmatic"===u?function(){if(!Eo())return null;var e=vo(),t=po();return Io.isAvailable()?(Cr("resolveTtsEngine:selected",{engine:"vizio-chromevox"}),Io):e?null:xo.isAvailable()?(Cr("resolveTtsEngine:selected",{engine:"webos-luna-tts"}),xo):Co.isAvailable()?(Cr("resolveTtsEngine:selected",{engine:"web-speech"}),Co):(Cr("tts engine unavailable",{webos:t,vizio:e}),null)}():null;(Cr("speakText:engine",{engine:null!==(n=null==h?void 0:h.name)&&void 0!==n?n:null,owner:u}),"composite"===o.reason&&o.transactionId&&o.element&&function(e){return"accessibility-label"===e||po()}(u))&&qr(o.element,r,null!==(l=o.focusPath)&&void 0!==l?l:[]);if("accessibility-label"===u)return"focus"===o.reason&&o.element&&o.element.setAttribute("aria-label",r),o.transactionId&&(null===(d=br)||void 0===d?void 0:d.id)===o.transactionId&&(br.status="started"),jo(r,o,s),!0;if(!h)return function(e,t){if(!vo()||Ja)return!1;var i=Date.now(),n=()=>{var a;cr=null,t.transactionId&&br&&br.id!==t.transactionId||(ko()?Ro(e,t):Date.now()-i>=8e3?t.transactionId&&(null===(a=br)||void 0===a?void 0:a.id)===t.transactionId&&(br.status="cancelled",br=null):cr=setTimeout(n,250))};return ao(),cr=setTimeout(n,250),!0}(r,o)?(jo(r,o,s),!0):(Ir(),!1);var c=h.speak(r,o);if(Cr("speakText:engine-result",{engine:h.name,accepted:c,reason:o.reason,transactionId:o.transactionId}),c)return jo(r,o,s),c;if(!o.element)return c;var m=qr(o.element,r,null!==(a=o.focusPath)&&void 0!==a?a:[]);return Cr("speakText:aria-label-fallback",{engine:h.name,accepted:m,reason:o.reason}),m&&jo(r,o,s),m}function Ho(e){var t=e.component;return e.hasAttribute("data-nami-primary-cta")||!0===(null==t?void 0:t.focused)||"productButton"===(null==t?void 0:t.namiComponentType)}function Go(e){var t,i=null===(t=e.getAttribute("role"))||void 0===t?void 0:t.toLowerCase();return"button"===e.tagName.toLowerCase()||"button"===i||e.matches("nami-button,nami-play-pause-button,nami-volume-button,nami-toggle-button")}function Vo(e){return _r(e).replace(/(?:,\s*)?\bbutton\b\s*$/i,"").trim()||_r(e)}function Ko(e){return _r(e.innerText||e.textContent||"")}function Xo(e){if(!e)return"";if(Yr(e)){var t=function(e){var t=kr.get(e);return t?_r(t["aria-label"]||e.getAttribute("title")||""):""}(e);if(t)return t;var i=Yo(e.component);if(i)return i}var n=e.getAttribute("data-tts-spoken-label");if(n)return _r(n);var a=Yo(e.component);if(a)return a;var r=e.getAttribute("aria-label")||e.getAttribute("title");return r?_r(r):Ko(e)}function Yo(e){var t=Jo(e,tr);if(!t)return"";var i=t,n=_r(qo(i.speechLabel)||qo(i.speech_label)||qo(i.screenreaderText)||qo(i.title)||qo(i.alt)||qo(i.text)||(Array.isArray(i.texts)?i.texts.map(e=>qo(e)).join(", "):""));if(n)return n;for(var a,r=te(Zo(i));!(a=r()).done;){var o=Yo(a.value);if(o)return o}return""}function qo(e,t=tr){return t?Oa(t,e):e}function Jo(e,t){if(!e||e.hidden)return null;var i=e;if("condition"===i.component)return t&&Fa(t,i)?e:null;if(i.conditionAttributes&&t){var n=Wa(t,i);return n.hidden?null:n}return e}function Qo(e,t){if(Cr("applySpeechAttributes:enter",{element:Lr(e),label:t,activeComposite:Yr(e)}),!Yr(e)){var i=_r(t),n=function(e,t){var i=_r(t);return i?Go(e)?Vo(i):i:""}(e,t);if(!n)return e.removeAttribute("data-tts-spoken-label"),void e.removeAttribute("aria-label");i?e.setAttribute("data-tts-spoken-label",i):e.removeAttribute("data-tts-spoken-label"),e.setAttribute("aria-label",function(e,t){return Go(e)?Vo(t):_r(t)}(e,n))}}function Zo(e){for(var t=[],i=0,n=["components","playingComponents","pausedComponents","mutedComponents","volumeComponents","productBaseComponents","productFeaturedComponents"];i<n.length;i++){var a=null==e?void 0:e[n[i]];Array.isArray(a)&&t.push(...a)}return null!=e&&e.collapseHeader&&(Array.isArray(e.collapseHeader)?t.push(...e.collapseHeader):t.push(e.collapseHeader)),t}function es(e,t,i){var n=Jo(e,tr);if(n&&!function(e){var t=Jo(e,tr);if(!t)return!1;var i=t,n=String(i.component||i.namiComponentType||"").toLowerCase();return-1!==n.indexOf("button")||-1!==n.indexOf("toggle")||-1!==n.indexOf("checkbox")||-1!==n.indexOf("radio")||-1!==n.indexOf("select")||-1!==n.indexOf("input")||!!i.onTap||!!i.sku||!0===i.focused}(n)){var a=function(e){var t=Jo(e,tr);if(!t)return"";var i=t;switch(t.component){case"text":case"countdownTimerText":return Fr(qo(i.screenreaderText)||qo(i.text));case"text-list":return Array.isArray(i.texts)?Fr(i.texts.map(e=>qo(e)).join(", ")):"";case"videoUrl":case"progressBar":return _r(qo(i.screenreaderText));default:return""}}(n);Wr(t,a),Zo(n).forEach(e=>es(e,t))}}function ts(e,t){var i=[];if(!e)return i;var n=e;return[n.header,n.contentContainer,n.footer,n.backgroundContainer,n.components].forEach(e=>{Array.isArray(e)?e.forEach(e=>es(e,i)):es(e,i)}),i}function is(e,t){var i=ts(e),n=function(e){if(!e)return"";var t=Yo(e.component),i=e.getAttribute("aria-label")||e.getAttribute("title")||Ko(e),n=_r(t||i);return n?Go(e)&&!/\bbutton\b\s*$/i.test(n)?_r(`${n} button`):n:""}(t);return $r(Or(i,n?[n]:[]))}function ns(e){return e?Rr(`${_r(e.id||e.name||"")}|${$r(Or(ts(e),[]))}`):""}function as(){return rr}function rs(e,t=null){!function(){if(null===Ar&&null===Dr){var e=navigator.userAgentData;"function"==typeof(null==e?void 0:e.getHighEntropyValues)?Dr=e.getHighEntropyValues(["platform","model"]).then(e=>{var t,i,n=(null!==(t=e.platform)&&void 0!==t?t:"").toLowerCase(),a=(null!==(i=e.model)&&void 0!==i?i:"").toLowerCase();Ar=n.includes("xbox")||a.includes("xbox"),Cr("xbox client hints resolved",{platform:n,model:a,result:Ar})}).catch(()=>{Ar=!1}).finally(()=>{Dr=null}):Ar=!1}}(),Cr("setActivePage:enter",{nextKey:ns(e),previousKey:ar,activePageAnnounced:nr,pageName:_r((null==e?void 0:e.name)||(null==e?void 0:e.id)||"")});var i=ar;er=e,tr=t,function(e){var t=ns(e);if(t!==ar){var i=!ar&&!!vr;nr=!1,ar=t,rr=i,vr=null,pr=""}}(e),i!==ar&&Bo(void 0,!1)}function os(e,t){if(Cr("prepareInitialComposite:enter",{element:Lr(e),activePageKey:ar,activePageAnnounced:nr,blockedByNavigation:as(),label:Xo(e),isPrimary:Ho(e)}),!er||nr||!Ho(e)||as())return Cr("prepareInitialComposite:skip",{hasActivePage:!!er,activePageAnnounced:nr,isPrimary:Ho(e),blockedByNavigation:as()}),!1;var i=is(er,e);if(!i)return!1;var n=Kr(e,t),a=function(e,t,i){var n={id:yr++,reason:e,element:i,text:t,page:er,status:"pending"};return br=n,n}("composite",i,e);nr=!0,vr=e,pr=$o(e);var r,o=Uo(i,{reason:"composite",interrupt:!0,transactionId:a.id,element:e,focusPath:n,priority:"high"});o||(nr=!1,(null===(r=br)||void 0===r?void 0:r.id)===a.id&&(br.status="cancelled",br=null));return o}function ss(e,t){Cr("preparePrimaryCtaCompositeFocus:enter",{element:Lr(e),label:Xo(e),activePageKey:ar,activePageAnnounced:nr});var i=os(e,t);return Cr("preparePrimaryCtaCompositeFocus:result",{result:i,activePageKey:ar,activePageAnnounced:nr}),i}function us(e){Cr("handleNativeFocusIn:enter",{target:e.target instanceof Element?Lr(e.target):String(e.target),activePageKey:ar,activePageAnnounced:nr});var t=function(e){for(var t,i=null,n=te("function"==typeof e.composedPath?e.composedPath():[]);!(t=n()).done;){var a=t.value;if(a instanceof Element&&Xo(a)){if(a.tagName.toLowerCase().startsWith("nami-"))return a;i||(i=a)}}return null!=i?i:e.target instanceof Element?e.target:null}(e);t&&ls(t,e)}function ls(e,t){if(Cr("handleFocusedElementForSpeech:enter",{element:Lr(e),label:Xo(e),ttsEnabled:Ka,runtime:So(),activePageKey:ar,activePageAnnounced:nr,lastFocused:Lr(vr),lastFocusedElementIdentity:pr}),!e)return Cr("handleFocusedElementForSpeech:skip-basic",{hasElement:!!e,ttsEnabled:Ka}),!1;if(!Eo())return!1;var i=$o(e);if(Tr&&Tr.pageKey===ar&&Date.now()<Tr.startedAt+2500){var n=Tr.element===e,a=!!i&&Tr.elementKey===i;if(!Wo()&&(n||a))return Cr("handleFocusedElementForSpeech:skip-during-initial-composite-lock",{element:Lr(e),sameCompositeElement:n,sameCompositeElementKey:a}),!1;var r=Xo(e),o=r?Oo(r):"";if(!Wo()&&o&&Tr.textKey.includes(o))return Cr("handleFocusedElementForSpeech:skip-composite-contained-label-during-initial-lock",{element:Lr(e),labelPreview:r.slice(0,120),transactionId:Tr.transactionId}),vr=e,pr=i,!1}if(vr===e||i&&i===pr&&!nr)return Cr("handleFocusedElementForSpeech:skip-same-element",{element:Lr(e),activePageAnnounced:nr,elementIdentity:i,lastFocusedElementIdentity:pr}),!1;if(!nr&&er&&Ho(e)&&!vr&&!as())return os(e,t);var s=Xo(e);if(!s)return!1;if(Tr){var u=Oo(s),l=Tr.textKey;if(!Wo()&&(u===l||u.includes(l)))return Cr("handleFocusedElementForSpeech:skip-active-composite-label",{element:Lr(e),labelPreview:s.slice(0,120),transactionId:Tr.transactionId}),vr=e,pr=i,!1}return vr=e,pr=i,sr&&clearTimeout(sr),sr=setTimeout(()=>{sr=null,vr===e&&Uo(s,{reason:"focus",interrupt:!0,element:e,focusPath:Kr(e,t),priority:"normal"})},120),!0}function ds(e=document){var t;if(Cr("attachFocusSpeechListeners:enter",{root:e instanceof Element?Lr(e):e instanceof DocumentFragment?"document-fragment":"document",runtime:So()}),hs(),!Eo())return Cr("focus speech listeners not attached: non-CTV runtime"),hs;var i,n=e=>us(e),a=()=>(Cr("handleUserNavigationKey",{activePageKey:ar,activePageAnnounced:nr}),gr=Date.now(),void(rr=!0));e.addEventListener("focusin",n,!0),e.addEventListener("keydown",a,!0);var r=window;if("undefined"!=typeof window&&null!==(t=r.TVJS)&&void 0!==t&&t.DirectionalNavigation){var o=r.TVJS.DirectionalNavigation;i=o.onfocuschanged,o.onfocuschanged=e=>{var t;null===(t=i)||void 0===t||t.call(o,e),function(e){var t,i=null===(t=e.detail)||void 0===t?void 0:t.nextFocusElement;i&&ls(i,e)}(e)}}return or={root:e,focusListener:n,keyListener:a,previousTvjsHandler:i},hs}function hs(){var e;if(Cr("detachFocusSpeechListeners:enter",{hasCleanup:!!or}),or){var t=or,i=t.root,n=t.focusListener,a=t.keyListener,r=t.previousTvjsHandler;i.removeEventListener("focusin",n,!0),a&&i.removeEventListener("keydown",a,!0);var o=window;null!==(e=o.TVJS)&&void 0!==e&&e.DirectionalNavigation&&r&&(o.TVJS.DirectionalNavigation.onfocuschanged=r),or=null}}function cs(){var e;Cr("resetScreenreaderState:enter",{activePageKey:ar,activePageAnnounced:nr,activeTransaction:null===(e=br)||void 0===e?void 0:e.id,lastFocused:Lr(vr)}),hs(),Za=null,Qa=!1,er=null,tr=null,ir=null,nr=!1,ar="",rr=!1,vr=null,pr="",gr=0,Pr=null,to(),eo(),io(),no(),ao(),so(),sr&&(clearTimeout(sr),sr=null),Zr("reset"),Nr(),br=null}var ms=function(){return ee(function e(t,i,n="",a=""){var r;Y(this,e),this.playing=!1,this.toggling=!1,this.handleVideoEvents=e=>{this.video.onended=()=>{To(!1),this.handlePlayerAnalytics(e,c.VIDEO_ENDED)},this.video.onpause=()=>{To(!1),this.toggling||this.handlePlayerAnalytics(e,c.VIDEO_PAUSED)},this.video.onplay=()=>{To(!this.video.muted),this.toggling||this.handlePlayerAnalytics(e,this.video.currentTime>.05?c.VIDEO_RESUMED:c.VIDEO_STARTED)},this.video.onvolumechange=()=>{this.toggling||(this.muted=this.video.muted,To(!this.video.paused&&!this.video.ended&&!this.muted),this.handlePlayerAnalytics(e,this.muted?c.VIDEO_MUTED:c.VIDEO_UNMUTED))}},this.removeVideoEvents=()=>{this.video&&(To(!1),this.video.onended=null,this.video.onpause=null,this.video.onplay=null,this.video.onvolumechange=null,this.toggling=!1)},this.video=null!=i?i:this.video,null!==(r=e.instance)&&void 0!==r&&r.videoSrc&&i.src!=e.instance.videoSrc&&this.handlePlayerAnalytics(t,c.VIDEO_CHANGED),this.videoSrc=i.src,this.video&&(this.muteByDefault=i.muted,this.loopVideo=i.loop,this.autoplayVideo=i.autoplay,this.muted=this.video.muted,this.videoComponentName=n,this.videoComponentId=a,this.playing=!(!(this.video.currentTime>0)||this.video.paused||this.video.ended),To(this.playing&&!this.video.muted),this.handleVideoEvents(t))},[{key:"togglePlayVideo",value:function(e){this.toggling=!0,this.playing?this.video.pause():this.video.play(),this.playing=!this.playing,this.handlePlayerAnalytics(e)}},{key:"toggleMuteVideo",value:function(e){this.toggling=!0,this.video.muted=!this.video.muted,this.muted=this.video.muted,this.handlePlayerAnalytics(e,this.muted?c.VIDEO_MUTED:c.VIDEO_UNMUTED)}},{key:"videoPlayingAction",value:function(){var e,t;return(null===(e=this.video)||void 0===e?void 0:e.currentTime)<=0?c.VIDEO_STARTED:this.video.paused?c.VIDEO_PAUSED:this.video.ended?c.VIDEO_ENDED:(null===(t=this.video)||void 0===t?void 0:t.currentTime)>.05?c.VIDEO_RESUMED:c.UNKNOWN}},{key:"handlePlayerAnalytics",value:function(e,t){if(this.video){var i={id:this.videoComponentId,name:this.videoComponentName,url:this.video.src,loopVideo:this.loopVideo,muteByDefault:this.muteByDefault,autoplayVideo:this.autoplayVideo,contentDuration:this.video.duration/1e3,contentTimecode:this.video.currentTime/1e3};m.getInstance().emit(f,{action:null!=t?t:this.videoPlayingAction(),videoMetaData:i,timeSpentOnPaywall:za(e)})}}}])}();ms.instance=null;var fs=({onTap:e,sku:t,componentChange:i,contextProvider:n}={})=>{var a,r,o,s,u,l,d,h,v,p,g,y=c.UNKNOWN;switch(null==e?void 0:e.function){case ti:y=c.CLOSE_PAYWALL,g=za(n),vs(),null===(a=ms.instance)||void 0===a||a.handlePlayerAnalytics(n,c.VIDEO_ENDED);break;case ni:y=c.RESTORE_PURCHASES,ps();break;case ri:y=c.SIGN_IN,gs();break;case vi:ys(null===(r=e.parameters)||void 0===r?void 0:r.url);break;case si:t&&(y=c.BUY_SKU,t=bs(n,e,t));break;case gi:y=c.PAGE_CHANGE,i={name:null==e||null===(o=e.parameters)||void 0===o?void 0:o.screen},ws(n,null==e||null===(s=e.parameters)||void 0===s?void 0:s.screen);break;case li:y=c.TOGGLE_CHANGE,i=ks(n,null==e||null===(u=e.parameters)||void 0===u?void 0:u.formId,null==e||null===(l=e.parameters)||void 0===l?void 0:l.value);break;case hi:t&&(y=c.SELECT_SKU,Ss(n,t));break;case mi:t&&(y=c.PURCHASE_SELECTED_SKU,Es(n,t));break;case bi:break;case ki:null===(d=ms.instance)||void 0===d||d.togglePlayVideo(n);break;case Ei:null===(h=ms.instance)||void 0===h||h.togglePlayVideo(n);break;case Ti:null===(v=ms.instance)||void 0===v||v.toggleMuteVideo(n);break;case Ai:null===(p=ms.instance)||void 0===p||p.toggleMuteVideo(n)}y!==c.UNKNOWN&&m.getInstance().emit(f,ie({},n.getPaywallActionEventData(),{action:y,sku:t,timeSpentOnPaywall:g,componentChange:i,purchaseError:void 0,purchases:void 0}))},vs=()=>{zo(),v.clearLaunchId(),Ms(p.Close)||"undefined"==typeof window||window.history.back()},ps=()=>{var e=g(y.THIRD_PARTY_TRANSACTIONS);Ms(p.Restore)||e||n.warn("NamiPaywallManager.registerRestoreHandler is not registered, so restore option on the paywall will use default behavior.")},gs=()=>{Ms(p.SignIn)},ys=e=>{e?Ms(p.DeeplinkAction,e)||"undefined"!=typeof window&&window.open(e,"_blank"):n.debug("Paywall deep link action invoked, but no url present.")},bs=(e,t,i)=>{var a,r=null===(a=t.parameters)||void 0===a?void 0:a.promo,o=i;if(r)n.debug(`promo id is not null ${null==i?void 0:i.id}`),o.promoId=r.toString();else{n.debug(`promo id is null for ${i.id}, product details: ${JSON.stringify(i.productDetails)}`);var s=i.productDetails;if(Di(null==s?void 0:s.product_type)){var u=function(e){return e.offers.find(e=>"promo"===e.offer_type&&0===e.price)}(s);if(u&&u.offer_ref_id)n.debug(`Found a free trial offer ${u.offer_ref_id}`),o.promoId=u.offer_ref_id.toString();else{var l,d=s.offers[0];if(d)n.debug(`Found an offer ${d.offer_ref_id}`),o.promoId=null===(l=d.offer_ref_id)||void 0===l?void 0:l.toString()}}}return function(e,t){if(g(y.THIRD_PARTY_TRANSACTIONS)){if(v.setPurchaseImpression(),m.getInstance().listenerCount(p.BuySku)<=0)return void n.warn("In order for Nami to hand off the purchase so the transaction can be handled by, you must register a NamiBuySkuHandler callbackwith NamiPaywallManager.registerBuySkuHandler.");n.info(`Handing off purchase for processing by developer skuId=${t.skuId} promoId=${t.promoId}`),Ms(p.BuySku,t)}else{var i=b(t.skuId);if(i&&(n.info(`Purchase flow completed, success=${i.success}, code=${i.billingResponseCode}, message=${i.message}`),i.success)){var a;m.getInstance().emit(f,{action:c.CLOSE_PAYWALL,sku:t,timeSpentOnPaywall:za(e)}),null===(a=ms.instance)||void 0===a||a.handlePlayerAnalytics(e,c.VIDEO_ENDED);var r=e.getSelectedCampaign();r&&r.conversion_event_type==w.IN_APP&&r.conversion_event_url?(v.clearLaunchId(),window.location.href=r.conversion_event_url):vs()}}}(e,o),o},ws=(e,t)=>{var i;t&&((null===(i=window.history.state)||void 0===i?void 0:i.prevUrl)==t?window.history.back():e.setCurrentPage(t))},ks=(e,t,i)=>{if(t)return e.setCurrentFormId(t,i),{formId:t,value:i};var n=e.getCurrentGroupId(),a=e.getCurrentGroupName();return e.setCurrentGroupData(n,a),{id:n,name:a}},Ss=(e,t)=>{var i=e.getCurrentGroupId(),n=e.selectedProducts();i&&t.id!=n[i]&&(n[i]=t.id,e.setSelectedProducts(n))},Es=(e,t)=>{e.setPurchase(!0,t)};function Ms(e,...t){var i=m.getInstance();return i.emit(e,...t),i.listenerCount(e)>0}var Ts,Ps,As,Ds,xs,Cs,Is,Ls,_s,Rs,Fs,Ws=e=>e,Os=k.NamiFlowManager,$s=250,Ns=function(){function e(t,i,n){var a;return Y(this,e),(a=X(this,e)).pages=[],a.currentOffset=0,a.presentationStyle="fullscreen",a._sheetEntranceActive=!0,a.formFactor=h(),a.timeSpentOnPaywall=0,a.animation={transition:"none",direction:"forward"},a._originalBodyStyles={},a._originalDocumentStyles={},a._savedScrollY=0,a._sheetDragStartY=0,a._sheetIsDragging=!1,a._dismissThreshold=100,a._boundHandleKeyDownEvent=e=>a.handleKeyDownEvent(e),a._stylesAlreadySaved=!1,a.type=t,a.value=i,a.context=n,a.setPaywallData(),a.presentationStyle=a.getPresentationStyle(a.paywall),a.applyPresentationHostClasses(),se(a,a)}return re(e,j),ee(e,[{key:"applyPresentationHostClasses",value:function(){this.classList.toggle("nami-half-sheet-mode",this.isOverlaySheet),this.classList.toggle("nami-modal-mode",this.isModal),this.classList.toggle("nami-modal-phone",this.isModal&&"phone"===this.formFactor),this.classList.toggle("nami-modal-wide",this.isModal&&"phone"!==this.formFactor)}},{key:"setPaywallData",value:function(){var e=S(this.value,this.type);this.paywall=e.paywall,this.campaign=e.campaign}},{key:"getPresentationStyle",value:function(e){var t,i,n,a=null!==(t=null==e||null===(i=e.template)||void 0===i||null===(i=i.initialState)||void 0===i?void 0:i.presentationStyle)&&void 0!==t?t:null==e||null===(n=e.template)||void 0===n||null===(n=n.initialState)||void 0===n?void 0:n.presentation_style;return E(a)}},{key:"isHalfSheet",get:function(){return"compact_sheet"===this.presentationStyle}},{key:"isSheet",get:function(){return"sheet"===this.presentationStyle}},{key:"isOverlaySheet",get:function(){return this.isHalfSheet||this.isSheet}},{key:"isModal",get:function(){return"modal"===this.presentationStyle}},{key:"isOverlay",get:function(){return this.isOverlaySheet||this.isModal}},{key:"connectedCallback",value:function(){var t;me(e,"connectedCallback",this)([]),null!==(t=window.TVJS)&&void 0!==t&&t.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=this),this._detachFocusSpeechListeners=ds(this),document.addEventListener("keydown",this._boundHandleKeyDownEvent),this._swipeHandler=Qt(this,this.handleSwipeEvent.bind(this),{axisHint:"y",lockAxis:!0,minDistance:25,edgeLeakThreshold:15,preventScrollOnSwipe:!1,pointerTypes:["touch"]}),this.setOriginalStyles()}},{key:"disconnectedCallback",value:function(){var t,i,n;me(e,"disconnectedCallback",this)([]),zo(),null===(t=this._detachFocusSpeechListeners)||void 0===t||t.call(this),this._detachFocusSpeechListeners=void 0,cs(),v.clearLaunchId(),null!==(i=window.TVJS)&&void 0!==i&&i.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=document.body),document.removeEventListener("keydown",this._boundHandleKeyDownEvent),m.getInstance().removeAllListeners(f),this.restoreStyles(),null===(n=this._halfSheetAbortController)||void 0===n||n.abort(),this._swipeHandler.destroy()}},{key:"setOriginalStyles",value:function(){this._stylesAlreadySaved||(this._stylesAlreadySaved=!0,this._originalBodyStyles.background=document.body.style.background,this._originalBodyStyles.overflow=document.body.style.overflow||null,this._originalBodyStyles.position=document.body.style.position||null,this._originalBodyStyles.top=document.body.style.top||null,this._originalBodyStyles.width=document.body.style.width||null,"phone"===this.formFactor&&(this._originalBodyStyles["overscroll-behavior"]=document.body.style.overscrollBehavior||null,this._originalDocumentStyles["overscroll-behavior"]=document.documentElement.style.overscrollBehavior||null)),"television"===this.formFactor&&(document.body.style.overflow="hidden"),"phone"===this.formFactor&&(document.body.style.overscrollBehavior="none",document.documentElement.style.overscrollBehavior="none",this.isOverlay||(document.body.style.overflow="hidden")),this.isOverlay&&(this._savedScrollY=window.scrollY,document.body.style.position="fixed",document.body.style.top=`-${this._savedScrollY}px`,document.body.style.width="100%",document.body.style.overflow="hidden")}},{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){(10009===e.keyCode||27===e.keyCode||166===e.keyCode||196===e.keyCode||"Backspace"===e.key||"GoBack"===e.key||"BrowserBack"===e.key||"XF86Back"===e.key)&&(e.preventDefault(),zo(),this.flow?this.flow.triggerActions(M.REMOTE_BACK):this.isModal&&this.animateSheetDismiss().then(()=>vs()))}},{key:"handleBackdropClick",value:function(e){var t;(e.stopPropagation(),this.flow)?null!==(t=this.flow.currentStepHasHoistedPrimaryActions("__swipe_down__"))&&void 0!==t&&t?this.flow.triggerActions("__swipe_down__"):this.animateSheetDismiss().then(()=>{var e;null===(e=this.flow)||void 0===e||e.finished(),vs()}):this.animateSheetDismiss().then(()=>vs())}},{key:"animateSheetDismiss",value:function(){var e,t,i,n,a;return le(function(r){for(;;)switch(r.n){case 0:return i=this.shadowRoot,n=null!==(e=null==i?void 0:i.querySelector(".nami-half-sheet-container"))&&void 0!==e?e:null==i?void 0:i.querySelector(".nami-modal-container"),a=null!==(t=null==i?void 0:i.querySelector(".nami-half-sheet-backdrop"))&&void 0!==t?t:null==i?void 0:i.querySelector(".nami-modal-backdrop"),n&&n.classList.add("nami-dismissing"),a&&a.classList.add("nami-dismissing"),r.n=1,K(new Promise(e=>setTimeout(e,200)));case 1:return r.a(2)}},null,this,null,Promise)}},{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 i;null===(i=this.flow)||void 0===i||i.triggerActions("__swipe_up__")}}},{key:"setupHalfSheetDragTracking",value:function(){var e,t,i;null===(e=this._halfSheetAbortController)||void 0===e||e.abort(),this._halfSheetAbortController=new AbortController;var n=this._halfSheetAbortController.signal,a=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".nami-half-sheet-container"),r=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector(".nami-half-sheet-content");if(a&&r){a.addEventListener("touchstart",e=>{r.scrollTop>0||(this._sheetDragStartY=e.touches[0].clientY,this._sheetIsDragging=!0)},{passive:!0,signal:n}),a.addEventListener("touchmove",e=>{if(this._sheetIsDragging){var t=e.touches[0].clientY-this._sheetDragStartY;t>0&&(a.style.transform=`translateY(${t}px)`,a.style.transition="none",e.preventDefault())}},{passive:!1,signal:n}),a.addEventListener("touchend",()=>{if(this._sheetIsDragging){this._sheetIsDragging=!1;var e,t,i=a.style.transform.match(/translateY\((\d+(?:\.\d+)?)px\)/);if((i?parseFloat(i[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 n;a.style.transform="translateY(0)",a.style.transition="transform 0.2s ease-out",null===(n=this.flow)||void 0===n||n.triggerActions("__swipe_down__")}else{var r;a.style.transform="translateY(100%)",a.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 a.style.transform="translateY(0)",a.style.transition="transform 0.2s ease-out"}},{signal:n})}}},{key:"setupHalfSheetFocusTrap",value:function(){var e,t,i,n,a=null!==(e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".nami-half-sheet-container"))&&void 0!==e?e:null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector(".nami-modal-container");if(a){a.focus();var r=null===(n=this._halfSheetAbortController)||void 0===n?void 0:n.signal;a.addEventListener("keydown",e=>{if("Tab"===e.key){var t=a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(0!==t.length){var i,n,r=t[0],o=t[t.length-1];if(e.shiftKey)document.activeElement!==r&&(null===(i=this.shadowRoot)||void 0===i?void 0:i.activeElement)!==r||(e.preventDefault(),o.focus());else document.activeElement!==o&&(null===(n=this.shadowRoot)||void 0===n?void 0:n.activeElement)!==o||(e.preventDefault(),r.focus())}}},r?{signal:r}:void 0)}}},{key:"firstUpdated",value:function(){var e;this.timeSpentOnPaywall=Date.now(),null===(e=this._detachFocusSpeechListeners)||void 0===e||e.call(this),this._detachFocusSpeechListeners=ds(this.renderRoot),T(this.campaign)&&(this.flow=Os.instance.presentFlow(this.campaign,this,this.context)),this.isOverlay&&this.updateComplete.then(()=>{this.isOverlaySheet&&this.setupHalfSheetDragTracking(),this.setupHalfSheetFocusTrap()})}},{key:"updated",value:function(t){if(me(e,"updated",this)([t]),t.has("presentationStyle")){var i=t.get("presentationStyle");("compact_sheet"===i||"sheet"===i||"modal"===i)!==this.isOverlay&&(this.restoreStyles(),this._stylesAlreadySaved=!1,this.setOriginalStyles()),this.isOverlay&&(this.isOverlaySheet&&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,i,n;return le(function(a){for(;;)switch(a.n){case 0:if(0!==this.pages.length&&"none"!==this.animation.transition){a.n=1;break}return this.pages=[e],a.a(2);case 1:if((null==(t=this.pages[this.pages.length-1])?void 0:t.id)!==e.id){a.n=2;break}return a.a(2);case 2:return i=null,this.isOverlaySheet&&(i=null===(n=this.shadowRoot)||void 0===n?void 0:n.querySelector(".nami-half-sheet-content"))&&(i.style.height=`${i.clientHeight}px`),this.pages=[t,e],this.currentOffset=0,a.n=3,K(this.updateComplete);case 3:requestAnimationFrame(()=>{this.currentOffset=1,setTimeout(()=>{this.pages=[e],this.currentOffset=0,this.paywall=e,i&&(i.style.height="")},$s)});case 4:return a.a(2)}},null,this,null,Promise)}},{key:"animateFullscreenEntry",value:function(){return le(function(e){for(;;)switch(e.n){case 0:return e.n=1,K(new Promise(e=>requestAnimationFrame(()=>e())));case 1:return this.classList.remove("nami-fullscreen-entering"),this.classList.add("nami-fullscreen-entering-active"),e.n=2,K(new Promise(e=>setTimeout(e,$s)));case 2:this.classList.remove("nami-fullscreen-entering-active");case 3:return e.a(2)}},null,this,null,Promise)}},{key:"_captureExitOverlay",value:function(e){var t=this.shadowRoot;if(!t)return null;var i=t.querySelector(".nami-flow-container"),n=document.createElement("div");if(n.className="nami-fullscreen-exit-overlay",n.style.cssText=`\n position: fixed; inset: 0; z-index: 10000;\n pointer-events: none;\n background: ${e};\n overflow: hidden;\n `,i){var a=i.cloneNode(!0);a.style.transform="none",a.style.transition="none",n.appendChild(a)}return t.appendChild(n),n.offsetHeight,n}},{key:"_slideExitOverlayAway",value:function(e){var t;return le(function(i){for(;;)switch(i.n){case 0:if(e){i.n=1;break}return i.a(2);case 1:return t="undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,e.style.transition=t?"none":"transform 250ms ease-in",e.style.transform="translateY(100%)",i.n=2,K(new Promise(e=>setTimeout(e,t?0:$s)));case 2:e.remove();case 3:return i.a(2)}},null,null,null,Promise)}},{key:"flowNavigateToScreen",value:function(e,t){var i,n,a,r,o,s,u,l,d,h,c;return le(function(m){for(;;)switch(m.n){case 0:if(null!==(i=this.flow)&&void 0!==i&&i.previousFlowStep&&this.flow.executeLifecycle(this.flow.previousFlowStep,M.DISAPPEAR),a=this.presentationStyle,r=this.getPresentationStyle(e),o=0===this.pages.length,s="backward"===t.direction,"compact_sheet"!==a&&"sheet"!==a||"fullscreen"!==r){m.n=3;break}return this.classList.add("nami-fullscreen-entering"),this.presentationStyle="fullscreen",this.applyPresentationHostClasses(),m.n=1,K(this.updateComplete);case 1:return m.n=2,K(this.animateFullscreenEntry());case 2:m.n=11;break;case 3:if("fullscreen"!==a||"compact_sheet"!==r&&"sheet"!==r){m.n=10;break}if(!o&&!s){m.n=8;break}if(!s){m.n=6;break}return u=document.body.style.background||getComputedStyle(this).backgroundColor||"#000",this._sheetEntranceActive=!1,l=this._captureExitOverlay(u),this.presentationStyle=r,this.applyPresentationHostClasses(),this.pages=[e],this.paywall=e,m.n=4,K(this.updateComplete);case 4:return m.n=5,K(this._slideExitOverlayAway(l));case 5:m.n=7;break;case 6:this.presentationStyle=r,this.applyPresentationHostClasses();case 7:m.n=9;break;case 8:console.warn(`Unsupported forward transition: fullscreen → ${r}. Presenting as fullscreen.`);case 9:m.n=11;break;case 10:this.presentationStyle=r,this.applyPresentationHostClasses();case 11:return d=("compact_sheet"===a||"sheet"===a)&&"fullscreen"===r,h="fullscreen"===a&&("compact_sheet"===r||"sheet"===r),c=!("compact_sheet"!==a&&"sheet"!==a||"compact_sheet"!==r&&"sheet"!==r||a===r)||d||h,this.animation=c?{transition:"fade",direction:t.direction}:t,m.n=12,K(this.updatePages(e));case 12:null!==(n=this.flow)&&void 0!==n&&n.currentFlowStep&&this.flow.executeLifecycle(this.flow.currentFlowStep,M.APPEAR);case 13:return m.a(2)}},null,this,null,Promise)}},{key:"getSelectedSlideIndexForCurrentCarousel",value:function(){return Yt.getSelectedSlideIndex()}},{key:"renderFlow",value:function(){return"undefined"==typeof document?N(Ts||(Ts=Ws``)):this.isOverlaySheet?this.renderHalfSheet():this.isModal?this.renderModal(this.renderFlowContainer()):this.renderFlowContainer()}},{key:"renderFlowContainer",value:function(){return N(Ps||(Ps=Ws`
255
255
  <div class="nami-flow-container">
256
256
  ${0}
257
257
  </div>