@namiml/web-sdk 3.4.4-dev.202606300501 → 3.4.4-dev.202606302327

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
- `)),Tt=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},Pt=globalThis,At=Pt.ShadowRoot&&(void 0===Pt.ShadyCSS||Pt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Dt=Symbol(),xt=new WeakMap,Ct=function(){return ne(function e(t,i,n){if(Q(this,e),this._$cssResult$=!0,n!==Dt)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(At&&void 0===e){var i=void 0!==t&&1===t.length;i&&(e=xt.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&xt.set(t,e))}return e}},{key:"toString",value:function(){return this.cssText}}])}(),It=(e,t)=>{if(At)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(var i,n=ae(t);!(i=n()).done;){var a=i.value,r=document.createElement("style"),o=Pt.litNonce;void 0!==o&&r.setAttribute("nonce",o),r.textContent=a.cssText,e.appendChild(r)}},Lt=At?e=>e:e=>e instanceof CSSStyleSheet?(e=>{for(var t,i="",n=ae(e.cssRules);!(t=n()).done;){i+=t.value.cssText}return(e=>new Ct("string"==typeof e?e:e+"",void 0,Dt))(i)})(e):e,_t=Object.is,Rt=Object.defineProperty,Ft=Object.getOwnPropertyDescriptor,Wt=Object.getOwnPropertyNames,Ot=Object.getOwnPropertySymbols,$t=Object.getPrototypeOf,Nt=globalThis,jt=Nt.trustedTypes,Bt=jt?jt.emptyScript:"",zt=Nt.reactiveElementPolyfillSupport,Ut=(e,t)=>e,Ht={toAttribute(e,t){switch(t){case Boolean:e=e?Bt: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}},Gt=(e,t)=>!_t(e,t),Vt={attribute:!0,type:String,converter:Ht,reflect:!1,useDefault:!1,hasChanged:Gt};null!==(wt=Symbol.metadata)&&void 0!==wt||(Symbol.metadata=Symbol("metadata")),null!==(kt=Nt.litPropertyMetadata)&&void 0!==kt||(Nt.litPropertyMetadata=new WeakMap);var Kt=function(){function e(){var t;return Q(this,e),(t=J(this,e))._$Ep=void 0,t.isUpdatePending=!1,t.hasUpdated=!1,t._$Em=null,t._$Ev(),t}return ue(e,ye(HTMLElement)),ne(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=ae(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 It(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:Ht).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:Ht;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:Gt)(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 ce(function(i){for(;;)switch(i.p=i.n){case 0:return this.isUpdatePending=!0,i.p=1,i.n=2,q(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,q(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=ae(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=ae(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=Vt){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&&Rt(this.prototype,e,n)}}},{key:"getPropertyDescriptor",value:function(e,t,i){var n,a=null!==(n=Ft(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:Vt}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty(Ut("elementProperties"))){var e=$t(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty(Ut("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ut("properties")))for(var e=this.properties,t=0,i=[...Wt(e),...Ot(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=ae(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=ae(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=ae(new Set(e.flat(1/0).reverse()));!(i=n()).done;){var a=i.value;t.unshift(Lt(a))}else void 0!==e&&t.push(Lt(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}}])}();Kt.elementStyles=[],Kt.shadowRootOptions={mode:"open"},Kt[Ut("elementProperties")]=new Map,Kt[Ut("finalized")]=new Map,null!=zt&&zt({ReactiveElement:Kt}),(null!==(St=Nt.reactiveElementVersions)&&void 0!==St?St:Nt.reactiveElementVersions=[]).push("2.1.2");var Xt={attribute:!0,type:String,converter:Ht,reflect:!1,hasChanged:Gt},Yt=(e=Xt,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 qt(e){return(t,i)=>"object"==typeof i?Yt(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 Jt(e){return qt(re({},e,{state:!0,attribute:!1}))}var Qt=function(){function e(t,i,n){var a;return Q(this,e),(a=J(this,e,[t,i,n])).host=null,a.defineDynamicStateProps(),a}return ue(e,i),ne(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 Zt=e=>{var t;return ce(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=ei(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 ei(e){return`${e.family}-${e.style}`.replace(/ /g,"")}function ti(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 ii={},ni=ii.NAMI_CLOSE_PAYWALL,ai=void 0===ni?"namiClosePaywall":ni,ri=ii.NAMI_RESTORE_PURCHASES,oi=void 0===ri?"namiRestorePurchases":ri,si=ii.NAMI_SIGN_IN,ui=void 0===si?"namiSignIn":si,li=ii.NAMI_BUY_SKU,di=void 0===li?"namiBuySKU":li,hi=ii.SET_STATE,ci=void 0===hi?"setState":hi,mi=ii.NAMI_SELECT_SKU,fi=void 0===mi?"namiSelectSKU":mi,vi=ii.NAMI_PURCHASE_SELECTED_SKU,pi=void 0===vi?"namiPurchaseSelectedSKU":vi,gi=ii.NAMI_DEEP_LINK,yi=void 0===gi?"namiDeeplink":gi,bi=ii.NAMI_NAVIGATE_TO_SCREEN,wi=void 0===bi?"namiNavigateToScreen":bi,ki=ii.NAMI_RELOAD_PRODUCTS,Si=void 0===ki?"namiReloadProducts":ki,Ei=ii.NAMI_PLAY_VIDEO,Mi=void 0===Ei?"namiPlayVideo":Ei,Ti=ii.NAMI_PAUSE_VIDEO,Pi=void 0===Ti?"namiPauseVideo":Ti,Ai=ii.NAMI_MUTE_VIDEO,Di=void 0===Ai?"namiMuteVideo":Ai,xi=ii.NAMI_UNMUTE_VIDEO,Ci=void 0===xi?"namiUnmuteVideo":xi,Ii=e=>"subscription"===e;function Li(e){if(Ii(null==e?void 0:e.product_type)){var t=Ri(e);if(t.length>0)return t[0].billingPeriod}return null}function _i(e){var t=function(e){if(!e)return[];var t=e.offers.filter(e=>"promo"===e.offer_type);return Fi(t,e.subscription_period)}(e).find(e=>0===e.priceAmountMicros);return(null==t?void 0:t.billingPeriod)||null}function Ri(e){return e?Fi(e.offers.filter(e=>"default"===e.offer_type),e.subscription_period):[]}function Fi(e,t){return e.map(e=>Wi(e,t))}function Wi(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:Ni(m).format(c)}}function Oi(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 $i(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 Ni(e){var t={maximumFractionDigits:2,minimumFractionDigits:0};try{return new Intl.NumberFormat(navigator.language,re({},t,{style:"currency",currency:e}))}catch(e){return new Intl.NumberFormat(navigator.language,re({},t,{style:"currency",currency:"USD"}))}}var ji=(e,t,i)=>e&&t&&i?i.format(e-t):null,Bi=(e,t,i,n)=>{if(e&&t&&i&&n){var a=100*(1-e/(i/n*t));return`${Math.round(a)}%`}return null},zi=(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)}},Ui=e=>Gi(e.priceAmountMicros)/Hi(e.billingPeriod),Hi=e=>{var t=parseInt(e[1]);return e.includes("Y")&&(t*=12),t},Gi=e=>e/1e6;function Vi(e){return parseFloat((Math.round(e)/100).toFixed(2))}var Ki=(e,t,i=[])=>({price:()=>Yi(e),name:()=>null==e?void 0:e.name,title:()=>null==e?void 0:e.name,description:()=>null==e?void 0:e.description,duration:()=>qi(e),durationSingular:()=>qi(e,!0),period:()=>qi(e,!1,!0),periodNumber:()=>qi(e,!1,!1,!0),freeTrialDuration:()=>Ji(e),freeTrialDurationSingular:()=>Ji(e,!0),freeTrialPeriod:()=>Ji(e,!1,!0),freeTrialPeriodNumber:()=>Ji(e,!1,!1,!0),pricePerMonth:()=>Qi(e),pricePerMonthRounded:()=>Qi(e,!0),periodInMonths:()=>Zi(e),durationInMonths:()=>en(e),durationInMonthsSingular:()=>en(e,!0),periodNumberInMonths:()=>tn(e),percentagePriceDifferenceFromSku:()=>nn(e,t,i),priceDifferenceFromSku:()=>an(e,t,i),promoEligible:()=>null===rn(e)&&null!==on(e,t),freeTrialEligible:()=>null!==rn(e),promo:()=>{var i;return null===(i=on(e,t))||void 0===i?void 0:i.offer_ref_id},promoCode:()=>"XXXXX",promoPrice:()=>{var i;return null===(i=sn(e,t))||void 0===i?void 0:i.formattedPrice},promoPeriod:()=>un(e,t,!1,!0),promoPeriodNumber:()=>un(e,t,!1,!1,!0),promoDuration:()=>un(e,t),promoDurationSingular:()=>un(e,t,!0),introEligible:()=>!1,pricePerDay:()=>mn(e),pricePerWeek:()=>fn(e),pricePerWeekRounded:()=>fn(e,!0),introductoryPrice:()=>hn(e,t),introductoryPeriod:()=>dn(e,t,!1,!0),introductoryPeriodNumber:()=>dn(e,t,!1,!1,!0),introductoryDuration:()=>dn(e,t),introductoryDurationSingular:()=>dn(e,t,!0),introductoryPricePerMonth:()=>cn(e,t),introductoryPricePerMonthRounded:()=>cn(e,t,!0),durationAbbrev:()=>qi(e,!1,!1,!1,!0),freeTrialDurationAbbrev:()=>Ji(e,!1,!1,!1,!0),introductoryDurationAbbrev:()=>dn(e,t,!1,!1,!1,!0),promoDurationAbbrev:()=>un(e,t,!1,!1,!1,!0),promoDurationPhase2Abbrev:()=>un(e,t,!0,!0,!1,!0),durationInMonthsAbbrev:()=>en(e,!1,!1,!1,!0),durationSingularAbbrev:()=>qi(e,!0,!1,!1,!0),freeTrialDurationSingularAbbrev:()=>Ji(e,!0,!1,!1,!0),introductoryDurationSingularAbbrev:()=>dn(e,t,!0,!1,!1,!0),promoDurationSingularAbbrev:()=>un(e,t,!0,!1,!1,!0),promoDurationSingularPhase2Abbrev:()=>un(e,t,!0,!0,!1,!0),durationInMonthsSingularAbbrev:()=>en(e,!0,!1,!1,!0),periodAbbrev:()=>qi(e,!1,!0,!1,!0),freeTrialPeriodAbbrev:()=>Ji(e,!1,!0,!1,!0),introductoryPeriodAbbrev:()=>dn(e,t,!1,!0,!1,!0),promoPeriodAbbrev:()=>un(e,t,!1,!0,!1,!0),promoPeriodPhase2Abbrev:()=>un(e,t,!1,!0,!0,!0),periodInMonthsAbbrev:()=>en(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}(Li(e)),iso_subscription_duration:()=>vn(e),invalid:()=>!1,unavailable:()=>!1}),Xi=(e,t,i,n=[])=>{if(!t)return null;var a=Ki(t,i,n);return a[e]?a[e]():null},Yi=e=>{var t=Ri(e);return t&&t.length?t[0].formattedPrice:null},qi=(e,t,i,n,a)=>Oi(Li(e),t,i,n,a),Ji=(e,t,i,n,a)=>Oi(_i(e),t,i,n,a),Qi=(e,t)=>{var i=Ri(e);if(!i||0===i.length)return null;var n=Ui(i[0]);return n?Ni(i[0].priceCurrencyCode).format(t?Math.round(n):n):null},Zi=(e,t)=>{var i=Ri(e);if(!i||0===i.length)return null;var n=i[0].billingPeriod;return $i(n)?Oi("P1Y"===n?"P12M":n,!1,!1,!1,t):null},en=(e,t,i,n,a)=>{var r=Ri(e);if(!r||0===r.length)return null;var o=r[0].billingPeriod;return $i(o)?Oi("P1Y"===o?"P12M":o,t,i,n,a):null},tn=e=>{if(!e)return 0;var t=Ri(e);return t&&t.length?Hi(t[0].billingPeriod):0},nn=(e,t,i=[])=>{var n,a=Ri(e);if(!a||0===a.length)return null;var r=null===(n=zi(i,null!=t?t:""))||void 0===n?void 0:n.product_details;if(!t||!r)return Bi(Vi(a[0].priceAmountMicros),tn(e));var o=Ri(r);return Bi(Vi(a[0].priceAmountMicros),tn(e),(null==o?void 0:o.length)>0?Vi(o[0].priceAmountMicros):0,tn(r))},an=(e,t,i=[])=>{var n,a=Ri(e);if(!a||0===a.length)return null;var r=null===(n=zi(i,null!=t?t:""))||void 0===n?void 0:n.product_details;if(!t||!r)return ji(Ui(a[0]));var o=Ri(r);return ji(Ui(a[0]),Ui(o[0]),Ni(o[0].priceCurrencyCode))},rn=e=>_i(e),on=(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},sn=(e,t)=>{if(!e)return null;var i=on(e,t);return i?Wi(i,e.subscription_period):null},un=(e,t,i,n,a,r)=>{var o=sn(e,t);return Oi((null==o?void 0:o.billingPeriod)||null,i,n,a,r)},ln=(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?Wi(i,e.subscription_period):null},dn=(e,t,i,n,a,r)=>{var o=ln(e,t);return Oi((null==o?void 0:o.billingPeriod)||null,i,n,a,r)},hn=(e,t)=>{var i=ln(e,t);return i?i.formattedPrice:null},cn=(e,t,i)=>{var n=ln(e,t);if(!n)return null;var a=Ui(n);return a?Ni(n.priceCurrencyCode).format(i?Math.round(a):a):null},mn=e=>{var t=Ri(e);if(!t||0===t.length)return null;var i,n,a=Gi(t[0].priceAmountMicros)/(i=t[0].billingPeriod,(n=Hi(i))?30.437*n:1);return Ni(t[0].priceCurrencyCode).format(a)},fn=(e,t)=>{var i=Ri(e);if(!i||0===i.length)return null;var n,a,r=Gi(i[0].priceAmountMicros)/(n=i[0].billingPeriod,(a=Hi(n))?52*a/12:1);return Ni(i[0].priceCurrencyCode).format(t?Math.round(r):r)},vn=e=>{var t=Ri(e)[0];return t?t.billingPeriod:null},pn="object"==typeof global&&global&&global.Object===Object&&global,gn="object"==typeof self&&self&&self.Object===Object&&self,yn=pn||gn||Function("return this")(),bn=yn.Symbol;var wn=Array.isArray,kn=Object.prototype,Sn=kn.hasOwnProperty,En=kn.toString,Mn=bn?bn.toStringTag:void 0;var Tn=Object.prototype.toString;var Pn=bn?bn.toStringTag:void 0;function An(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Pn&&Pn in Object(e)?function(e){var t=Sn.call(e,Mn),i=e[Mn];try{e[Mn]=void 0;var n=!0}catch(e){}var a=En.call(e);return n&&(t?e[Mn]=i:delete e[Mn]),a}(e):function(e){return Tn.call(e)}(e)}function Dn(e){return null!=e&&"object"==typeof e}var xn=bn?bn.prototype:void 0,Cn=xn?xn.toString:void 0;function In(e){if("string"==typeof e)return e;if(wn(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,In)+"";if(function(e){return"symbol"==typeof e||Dn(e)&&"[object Symbol]"==An(e)}(e))return Cn?Cn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ln(e){return null==e?"":In(e)}function _n(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 Rn=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function Fn(e){return Rn.test(e)}var Wn="\\ud800-\\udfff",On="["+Wn+"]",$n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Nn="\\ud83c[\\udffb-\\udfff]",jn="[^"+Wn+"]",Bn="(?:\\ud83c[\\udde6-\\uddff]){2}",zn="[\\ud800-\\udbff][\\udc00-\\udfff]",Un="(?:"+$n+"|"+Nn+")"+"?",Hn="[\\ufe0e\\ufe0f]?",Gn=Hn+Un+("(?:\\u200d(?:"+[jn,Bn,zn].join("|")+")"+Hn+Un+")*"),Vn="(?:"+[jn+$n+"?",$n,Bn,zn,On].join("|")+")",Kn=RegExp(Nn+"(?="+Nn+")|"+Vn+Gn,"g");function Xn(e){return Fn(e)?function(e){return e.match(Kn)||[]}(e):function(e){return e.split("")}(e)}var Yn,qn=(Yn="toUpperCase",function(e){var t=Fn(e=Ln(e))?Xn(e):void 0,i=t?t[0]:e.charAt(0),n=t?_n(t,1).join(""):e.slice(1);return i[Yn]()+n});var Jn,Qn=(Jn={À:"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==Jn?void 0:Jn[e]}),Zn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ea=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var ta=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var ia=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var na="\\ud800-\\udfff",aa="\\u2700-\\u27bf",ra="a-z\\xdf-\\xf6\\xf8-\\xff",oa="A-Z\\xc0-\\xd6\\xd8-\\xde",sa="\\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",ua="["+sa+"]",la="\\d+",da="["+aa+"]",ha="["+ra+"]",ca="[^"+na+sa+la+aa+ra+oa+"]",ma="(?:\\ud83c[\\udde6-\\uddff]){2}",fa="[\\ud800-\\udbff][\\udc00-\\udfff]",va="["+oa+"]",pa="(?:"+ha+"|"+ca+")",ga="(?:"+va+"|"+ca+")",ya="(?:['’](?:d|ll|m|re|s|t|ve))?",ba="(?:['’](?:D|LL|M|RE|S|T|VE))?",wa="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",ka="[\\ufe0e\\ufe0f]?",Sa=ka+wa+("(?:\\u200d(?:"+["[^"+na+"]",ma,fa].join("|")+")"+ka+wa+")*"),Ea="(?:"+[da,ma,fa].join("|")+")"+Sa,Ma=RegExp([va+"?"+ha+"+"+ya+"(?="+[ua,va,"$"].join("|")+")",ga+"+"+ba+"(?="+[ua,va+pa,"$"].join("|")+")",va+"?"+pa+"+"+ya,va+"+"+ba,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",la,Ea].join("|"),"g");function Ta(e,t,i){return e=Ln(e),void 0===t?function(e){return ia.test(e)}(e)?function(e){return e.match(Ma)||[]}(e):function(e){return e.match(ta)||[]}(e):e.match(t)||[]}var Pa=RegExp("['’]","g");var Aa,Da=(Aa=function(e,t,i){return t=t.toLowerCase(),e+(i?qn(Ln(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}(Ta(function(e){return(e=Ln(e))&&e.replace(Zn,Qn).replace(ea,"")}(e).replace(Pa,"")),Aa,"")});function xa(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=_a(e,t.sku_ref_id||""),t.variables=function(e,t,i){if(!t)return{};var n=t.variables;if(!n)return re({},t);Object.keys(n).forEach(t=>{if(Ca(n[t])){var a=La(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(Ki({})))().forEach(t=>{if(void 0===n[t]){var r=Xi(t,e,void 0,i);null!==r&&(a[t]=r)}}),re({},t,a,n)}(t.product_details,t,r)}),r}function Ca(e){return"string"==typeof e&&e.includes(r)}function Ia(e,t,i){return t?(Object.keys(t).forEach(n=>{Ca(t[n])&&(t[n]=t[Da(n)]=La(t[n],e,i))}),re({},t)):{}}var La=(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 Xi(a,t,h,i)});function _a(e=[],t=""){return e.find(e=>e.product_ref_id===t)||null}var Ra=["conditionAttributes"];function Fa(e,t){return Array.isArray(e)?e.reduce((e,i)=>{var n=Fa(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:Fa(n,t);return re({},e,{[i]:a})},{}):"string"==typeof e?Ua(e,t):e}function Wa(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=_a(e.productDetails,t.sku_ref_id),c={freeTrialEligible:1==Xi("freeTrialEligible",h),introEligible:1==Xi("introEligible",h),promoEligible:1==Xi("promoEligible",h),invalid:Xi("invalid",h),unavailable:Xi("unavailable",h)},m=re({},t,t.variables,c,{id:t.id,entitlements:l});o=t,s=e=>{for(var t,i=ae(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:za(n,{convertToUrl:!0})};return[null!==(i=t.featured)&&void 0!==i&&i,Fa(u,Fa(f,f))]},[])}function Oa(e,t){if(!t.loopSource)return[];var i=h(t.loopSource),n=(null!=i?i:[]).filter(i=>{var n;return!(null!==(n=t.loopSourceConditions)&&void 0!==n&&n.length)||t.loopSourceConditions.every(t=>Ba(e,t,i))}),a=t.groupBy,r=t.groupHeaderTemplate,o=e=>Fa(t.components,Fa({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=ae(n);!(s=d()).done;){var c=s.value,m=Fa(a,Fa({block:c},{block:c})),f=null==m?"":String(m);l.has(f)||(u.push(f),l.set(f,[])),l.get(f).push(c)}return u.map(e=>{var t={key:e};return{key:e,header:[Fa(r,Fa({group:t},{group:t}))],items:l.get(e).map(o)}})}function $a(e,t){return t.assertions?t.assertions.every(Ba.bind(null,e)):!!t.orAssertions&&(!t.orAssertions.length||t.orAssertions.some(Ba.bind(null,e)))}function Na(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,Ra);return i?i.reduce((t,i)=>$a(e,i)?(Object.entries(i.attributes).forEach(([t,n])=>{i.attributes[t]=ja(e,n)}),re({},t,i.attributes)):t,n):n}function ja(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=re({},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=Ua(t,c)),t}function Ba(e,{value:t,expected:i,operator:n},a){if(t=ja(e,t,0,a),i=ja(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 za(e,{convertToUrl:t}={convertToUrl:!1}){return Object.entries(e).reduce((e,[i,{content:n}])=>(t&&"string"!=typeof n&&n&&(n=URL.createObjectURL(n)),re({},e,{[i]:n})),{})}function Ua(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=Ua(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=Ha(t,a);if(void 0===r)return e;if("object"==typeof r&&null!==r&&0===Object.keys(r).length)return"";var o=Ha(t,...n);return void 0===o?"":"string"!=typeof o?o:Ua(o,t)}}function Ha(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 Ga=e=>{var t=e.state.timeSpentOnPaywall;if(t)return Date.now()-t},Va=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}`},Ka=(e,t)=>{if(!e||!t)return!0;var i=null!=e&&e.includes("rgb")?Va(e):e,n=null!=t&&t.includes("rgb")?Va(t):t;return(null==i?void 0:i.toLowerCase())===(null==n?void 0:n.toLowerCase())};function Xa(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 Ya(e,t,i){for(var n,a=Xa(t),r={key:i},o=Fa(t,Fa({group:r},{group:r})),s={dotSize:a.dotSize,dotColor:a.dotColor,dotCornerRadius:a.dotCornerRadius,dotBorderWidth:a.dotBorderWidth,dotBorderColor:a.dotBorderColor},u=ae(null!==(l=o.conditionAttributes)&&void 0!==l?l:[]);!(n=u()).done;){var l,d,h=n.value;if($a(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 qa=!0,Ja=!1,Qa=!1,Za=!1,er=!1,tr=!1,ir=null,nr=null,ar=null,rr=null,or=!1,sr="",ur=!1,lr=null,dr=null,hr=null,cr=null,mr=null,fr=null,vr=null,pr=null,gr=!1,yr=null,br="",wr=0,kr=1,Sr=null,Er=[],Mr=new WeakMap,Tr=new WeakMap,Pr=1;function Ar(e){var t=Tr.get(e);return t||(t=Pr++,Tr.set(e,t)),String(t)}var Dr=null,xr=null,Cr=null,Ir=null;function Lr(e){return!0===e||"true"===e||"1"===e||"yes"===e}function _r(e,t){if(function(){if("undefined"==typeof window)return!1;try{var e,t;return!!Lr(window.NAMI_TTS_DEBUG)||Lr(null===(e=window.localStorage)||void 0===e?void 0:e.getItem("nami:tts:debug"))||Lr(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 Rr(e="TTS is unavailable in this runtime."){Ja||(Ja=!0,_r(e))}function Fr(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 Wr(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 Or(e){return e.toLowerCase().replace(/[^a-z0-9$]+/g," ").replace(/\s+/g," ").trim()}function $r(e){return Wr(String(null!=e?e:"").replace(/<[^>]*>/g," ").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/[*_`#>~]/g," "))}function Nr(e,t){var i=Wr(t);i&&e[e.length-1]!==i&&e.push(i)}function jr(e,t=[]){var i=[];return[...e,...t].forEach(e=>{var t=function(e){var t=Wr(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=Wr(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=Wr(t.slice(n));u&&i.push(u);return i.length?i:[t]}(e);t.length||Nr(i,e),t.forEach(e=>Nr(i,e))}),i.slice(0,60)}function Br(e){return Wr(e.join(". ").replace(/\.\s*([.!?])/g,"$1"))}function zr(e){var t,i=Sr;i&&(e&&i.id===e||(i.status="cancelled",(null===(t=Sr)||void 0===t?void 0:t.id)===i.id&&(Sr=null)))}function Ur(){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 Hr(e){return"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot}function Gr(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=Hr(n)?n.host:n}return t}function Vr(e,t){return!!t&&-1!==Gr(t).indexOf(e)}function Kr(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 Xr(e,t){t&&-1===e.indexOf(t)&&e.push(t)}function Yr(e,t){var i=t.shadowRoot;i&&i.querySelectorAll('button,[role="button"],a,input,select,textarea,[tabindex]:not([tabindex="-1"])').forEach(t=>Xr(e,t))}function qr(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:Gr(e)}function Jr(e,t=[],i={}){var n=[];if(i.focusedElementOnly)return Xr(n,e),n;var a=(t.length?t:Gr(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=Gr(e).find(e=>e.matches("nami-product-container"));if(a)return a;var r=rr&&"querySelectorAll"in rr?rr:"undefined"!=typeof document?document:null;return r&&null!==(i=Array.prototype.slice.call(r.querySelectorAll("nami-product-container")).find(t=>Vr(t,e)))&&void 0!==i?i:null}(e,a);return Xr(n,e),Yr(n,e),a.forEach(t=>{var i=!!r&&(t===r||Vr(r,t)),a=t!==e&&Vr(t,e),o=t.matches('nami-product-container,nami-button,[role="button"],button,[tabindex]:not([tabindex="-1"])');(i||a||t===e)&&o&&(Xr(n,t),Yr(n,t))}),null!=r&&r.isConnected&&(Xr(n,r),Yr(n,r)),n}function Qr(e){return Mr.has(e)}function Zr(e,t,i=[]){var n=Wr(t);if(!n)return!1;no(),eo(void 0,"new-composite",!0);var a=Jr(e,i,bo()||yo()?{focusedElementOnly:!1}:{focusedElementOnly:!0});return a.forEach(e=>function(e,t){var i=Wr(t);return!!i&&(Mr.has(e)||Mr.set(e,{"aria-label":e.getAttribute("aria-label")}),e.setAttribute("aria-label",i),!0)}(e,n)),Er=a,!0}function eo(e,t="manual",i=!1){var n=e&&-1===Er.indexOf(e)?Jr(e):Er;n.length&&(!i&&Sr&&n.some(e=>Mr.has(e))?_r("composite restore skipped: transaction still active",{reason:t}):(no(),n.forEach(e=>{var t=Mr.get(e);t&&(!function(e,t,i){null===i?e.removeAttribute(t):e.setAttribute(t,i)}(e,"aria-label",t["aria-label"]),Mr.delete(e))}),e&&-1===Er.indexOf(e)||(Er=[])))}function to(e,t){Mr.has(e)&&(t instanceof Element&&Kr(e,t)||(no(),hr=setTimeout(()=>{(hr=null,e.isConnected)?Kr(e,Ur())||eo(e,"blur"):eo(e,"blur-disconnected",!0)},50)))}function io(e){Er.length&&eo(void 0,e,!0)}function no(){hr&&(clearTimeout(hr),hr=null)}function ao(){cr&&(clearTimeout(cr),cr=null),Dr=null}function ro(){mr&&(clearTimeout(mr),mr=null)}function oo(){fr&&(clearTimeout(fr),fr=null)}function so(){vr&&(clearTimeout(vr),vr=null)}function uo(){pr&&(clearTimeout(pr),pr=null)}function lo(e){gr=!0,uo(),pr=setTimeout(()=>{pr=null,gr=!1},co(e)+500)}function ho(){uo(),gr=!1}function co(e){var t=Wr(e),i=350*(t?t.split(/\s+/).filter(Boolean).length:0);return Math.min(3e4,Math.max(4e3,i))}function mo(){return"undefined"==typeof window?null:window}function fo(){var e,t=null===(e=mo())||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 vo(){return!!fo()}function po(){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 go(){return"undefined"!=typeof window&&void 0!==window.speechSynthesis&&"function"==typeof window.speechSynthesis.speak&&"function"==typeof window.SpeechSynthesisUtterance}function yo(){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 bo(){var e,t;if("undefined"==typeof window)return!1;if(yo())return!1;var i=(null===(e=window.navigator)||void 0===e||null===(e=e.userAgent)||void 0===e?void 0:e.toLowerCase())||"",n=mo();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 wo(){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 ko(e){return"string"==typeof e&&-1!==e.toLowerCase().indexOf("xbox")}function So(){var e,t,i;if("undefined"==typeof window)return!1;if(!0===Cr)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(ko)}function Eo(){if("undefined"==typeof window)return!1;try{return"television"===c()}catch(e){return!1}}function Mo(){if(er)return!1;var e=po();if(!e)return!1;try{return"function"!=typeof e.isEnabled||e.isEnabled()}catch(e){return!1}}function To(){return{televisionRuntime:Eo(),televisionTtsRuntime:Po(),webos:bo(),tizen:wo(),vizio:yo(),xbox:So(),xboxClientHintsResult:Cr,hasWebOsServiceRequest:vo(),webOsRequestType:typeof fo(),hasWebSpeechApi:go(),webSpeechUnavailableForSession:Qa,webOsLunaUnavailableForSession:Za,vizioChromevoxUnavailableForSession:er}}function Po(){return Eo()||bo()||yo()||wo()}function Ao(){return Po()&&!Qa&&go()}function Do(e){if(tr=e,_r("set media playing",{playing:e,hasDeferredUtterance:!!ir}),!e&&ir){var t,i=ir;if(ir=null,i.options.transactionId&&(null===(t=Sr)||void 0===t?void 0:t.id)!==i.options.transactionId)return void _r("drop stale deferred speech",{transactionId:i.options.transactionId,reason:i.options.reason});Vo(i.text,i.options)}}function xo(e){Qa=!0,Rr(bo()?"Web Speech TTS unavailable in this webOS runtime":"Web Speech TTS unavailable in this runtime"),_r("web speech unavailable",{error:e})}function Co(e){Za=!0,_r("webOS Luna unavailable",{error:e})}function Io(e,t){ir={text:e,options:t}}var Lo={name:"webos-luna-tts",platform:"webos",isAvailable:function(){return Po()&&!yo()&&!Za&&vo()},speak:function(e,t){_r("speakViaWebOsLuna:enter",{textPreview:e.slice(0,160),reason:t.reason,transactionId:t.transactionId,requestType:typeof fo()});var i=fo();if(!i)return _r("speakViaWebOsLuna:no-request"),!1;var n="composite"===t.reason,a=!1,r=()=>{var r,o;if(fr=null,t.transactionId&&(null===(r=Sr)||void 0===r?void 0:r.id)!==t.transactionId)return _r("speakViaWebOsLuna:drop-stale-delayed-speak",{transactionId:t.transactionId,activeTransaction:null===(o=Sr)||void 0===o?void 0:o.id,reason:t.reason}),!1;if(tr)return _r("speakViaWebOsLuna:defer-delayed-speak-media-playing",{transactionId:t.transactionId,reason:t.reason}),Io(e,t),!0;var s=!1;try{_r("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(_r("speakViaWebOsLuna:onSuccess",{response:e,transactionId:t.transactionId}),!t.transactionId||(null===(i=Sr)||void 0===i?void 0:i.id)===t.transactionId){var n,r=function(e){var t,i=Wr(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=Sr)||void 0===n?void 0:n.id)===t.transactionId&&(Sr.status="ended",Sr=null)}},onFailure:e=>{var i;s=!0,_r("speakViaWebOsLuna:onFailure",{error:e,transactionId:t.transactionId});var n=!t.transactionId||(null===(i=Sr)||void 0===i?void 0:i.id)===t.transactionId;t.transactionId&&n&&Sr&&(Sr.status="cancelled",Sr=null),Co(e)}})}catch(e){var u;return t.transactionId&&(null===(u=Sr)||void 0===u?void 0:u.id)===t.transactionId&&(Sr.status="cancelled",Sr=null),Co(e),!1}return!s};if(n)return oo(),_r("speakViaWebOsLuna:delay-composite-until-focus-settles",{delayMs:250,transactionId:t.transactionId}),fr=setTimeout(r,250),!0;return r()},stop:Fo},_o={name:"web-speech",platform:"web",isAvailable:Ao,speak:function(e,t){if(!Ao())return!1;try{var i=new window.SpeechSynthesisUtterance(e);return i.onstart=()=>{var e;t.transactionId&&(null===(e=Sr)||void 0===e?void 0:e.id)===t.transactionId&&(Sr.status="started")},i.onend=()=>{var e=Sr,i=!t.transactionId||(null==e?void 0:e.id)===t.transactionId;t.transactionId&&i&&e&&(e.status="ended",Sr=null)},i.onerror=e=>{var i,n=e.error;t.transactionId&&(null===(i=Sr)||void 0===i?void 0:i.id)===t.transactionId&&(Sr.status="cancelled",Sr=null),"synthesis-failed"===n&&xo(n)},window.speechSynthesis.speak(i),!0}catch(e){return xo("exception"),!1}},stop:()=>{if(go())try{window.speechSynthesis.cancel()}catch(e){}}},Ro={name:"vizio-chromevox",platform:"vizio",isAvailable:Mo,speak:Oo,stop:Wo};function Fo(){var e=fo();if(e)try{e("luna://com.webos.service.tts",{method:"stop",parameters:{},onFailure:e=>_r("webOS Luna stop failed",{error:e})})}catch(e){_r("webOS Luna stop threw",{error:e})}}function Wo(e=!0){var t=!!mr,i=gr;ro();var n=po(),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(""),ho()}catch(e){ho(),_r("VIZIO stop threw",{error:e})}}function Oo(e,t){var i=po();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?(ro(),mr=setTimeout(()=>{var n;if(mr=null,!t.transactionId||!Sr||Sr.id===t.transactionId)if(t.element&&r&&!t.element.isConnected){var a;t.transactionId&&(null===(a=Sr)||void 0===a?void 0:a.id)===t.transactionId&&(Sr.status="cancelled",Sr=null)}else{if(tr)return ao(),xr=null,void Io(e,t);i.play(e),lo(e),t.transactionId&&(null===(n=Sr)||void 0===n?void 0:n.id)===t.transactionId&&(Sr.status="ended",Sr=null)}},o),!0):(i.play(e),lo(e),t.transactionId&&(null===(a=Sr)||void 0===a?void 0:a.id)===t.transactionId&&(Sr.status="ended",Sr=null),!0)}catch(e){return function(e){er=!0,_r("VIZIO Chromevox unavailable",{error:e})}(e),!1}}function $o(e){return"high"===e?3:"normal"===e?2:1}function No(){return Date.now()-wr<1500}function jo(e){return Or(e)}function Bo(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-${Ar(e)}`].filter(Boolean).join("|"):""}(e);return Or(t||Jo(e))}function zo(e){var t=jo(e);return"clickable"===t||"button"===t||"focusable"===t||"selected"===t||"unselected"===t}function Uo(e,t,i){var n;if(xr={textKey:jo(e),reason:t.reason,timestamp:Date.now()},"high"===i){var a=co(e),r=Date.now();Dr={transactionId:t.transactionId,pageKey:sr,element:null!==(n=t.element)&&void 0!==n?n:null,elementKey:Bo(t.element),textKey:jo(e),startedAt:r,suppressUntil:r+a},cr&&clearTimeout(cr),cr=setTimeout(()=>{cr=null,Dr=null},a)}}function Ho(e,t=!0){var i,n,a,r=!(!e||(null===(i=Sr)||void 0===i?void 0:i.id)!==e||"pending"!==Sr.status);if(_r("stopSpeech",{preserveTransactionId:e,allowVizioEmptyFallback:t,activeTransaction:null===(n=Sr)||void 0===n?void 0:n.id,reason:null===(a=Sr)||void 0===a?void 0:a.reason,preservingCurrentTransaction:r}),ir=null,r||(so(),oo()),e||(ao(),no(),io("stop")),zr(e),dr&&(clearTimeout(dr),dr=null),!r){if(go())try{window.speechSynthesis.cancel()}catch(e){}bo()&&Fo(),yo()&&Wo(t)}}function Go(){Ho()}function Vo(e,t={}){var i,n,a;_r("speakText:enter",{textPreview:Wr(e).slice(0,160),reason:t.reason,transactionId:t.transactionId,element:Fr(t.element),runtime:To()});var r=Wr(e);if(!r)return!1;if(!Po())return _r("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":zo(e)?"low":"normal"}(r,o);if(function(e,t,i){var n=jo(e),a=Date.now(),r=Bo(t.element);if(zo(e))return!0;if(xr&&xr.reason===t.reason&&xr.textKey===n&&a-xr.timestamp<600)return _r("suppress:duplicate-request",{reason:t.reason,textPreview:e.slice(0,120)}),!0;if(!Dr)return!1;if($o(i)>=$o("high"))return!1;if("focus"===t.reason){var o=Dr.textKey;if(!No()&&(n===o||n.includes(o)))return _r("suppress:focus-text-is-active-composite",{textPreview:e.slice(0,120),transactionId:Dr.transactionId,element:Fr(t.element)}),!0}var s=function(e,t){return!!e&&!!t&&e===t}(t.element,Dr.element),u=!!r&&Dr.elementKey===r,l=!Dr.pageKey||Dr.pageKey===sr,d=No(),h=l&&!d&&a<Dr.startedAt+2500;return!(!s&&!u&&(l&&"focus"===t.reason&&t.element&&Dr.element!==t.element||"low"!==i&&!h)&&(ao(),1))}(r,o,s))return!1;if(o.interrupt&&Ho(o.transactionId,!1),tr)return Io(r,o),!0;var u=function(e){var t;return"manual"!==(null!==(t=e.reason)&&void 0!==t?t:"manual")&&e.element?bo()||yo()?"programmatic":"accessibility-label":"programmatic"}(o);_r("speakText:owner",{owner:u,reason:o.reason,element:Fr(o.element)});var l,d,h="programmatic"===u?function(){if(!Po())return null;var e=yo(),t=bo();return Ro.isAvailable()?(_r("resolveTtsEngine:selected",{engine:"vizio-chromevox"}),Ro):e?null:Lo.isAvailable()?(_r("resolveTtsEngine:selected",{engine:"webos-luna-tts"}),Lo):_o.isAvailable()?(_r("resolveTtsEngine:selected",{engine:"web-speech"}),_o):(_r("tts engine unavailable",{webos:t,vizio:e}),null)}():null;(_r("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||bo()}(u))&&Zr(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=Sr)||void 0===d?void 0:d.id)===o.transactionId&&(Sr.status="started"),Uo(r,o,s),!0;if(!h)return function(e,t){if(!yo()||er)return!1;var i=Date.now(),n=()=>{var a;vr=null,t.transactionId&&Sr&&Sr.id!==t.transactionId||(Mo()?Oo(e,t):Date.now()-i>=8e3?t.transactionId&&(null===(a=Sr)||void 0===a?void 0:a.id)===t.transactionId&&(Sr.status="cancelled",Sr=null):vr=setTimeout(n,250))};return so(),vr=setTimeout(n,250),!0}(r,o)?(Uo(r,o,s),!0):(Rr(),!1);var c=h.speak(r,o);if(_r("speakText:engine-result",{engine:h.name,accepted:c,reason:o.reason,transactionId:o.transactionId}),c)return Uo(r,o,s),c;if(!o.element)return c;var m=Zr(o.element,r,null!==(a=o.focusPath)&&void 0!==a?a:[]);return _r("speakText:aria-label-fallback",{engine:h.name,accepted:m,reason:o.reason}),m&&Uo(r,o,s),m}function Ko(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 Xo(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 Yo(e){return Wr(e).replace(/(?:,\s*)?\bbutton\b\s*$/i,"").trim()||Wr(e)}function qo(e){return Wr(e.innerText||e.textContent||"")}function Jo(e){if(!e)return"";if(Qr(e)){var t=function(e){var t=Mr.get(e);return t?Wr(t["aria-label"]||e.getAttribute("title")||""):""}(e);if(t)return t;var i=Qo(e.component);if(i)return i}var n=e.getAttribute("data-tts-spoken-label");if(n)return Wr(n);var a=Qo(e.component);if(a)return a;var r=e.getAttribute("aria-label")||e.getAttribute("title");return r?Wr(r):qo(e)}function Qo(e){var t=es(e,ar);if(!t)return"";var i=t,n=Wr(Zo(i.speechLabel)||Zo(i.speech_label)||Zo(i.screenreaderText)||Zo(i.title)||Zo(i.alt)||Zo(i.text)||(Array.isArray(i.texts)?i.texts.map(e=>Zo(e)).join(", "):""));if(n)return n;for(var a,r=ae(is(i));!(a=r()).done;){var o=Qo(a.value);if(o)return o}return""}function Zo(e,t=ar){return t?ja(t,e):e}function es(e,t){if(!e||e.hidden)return null;var i=e;if("condition"===i.component)return t&&$a(t,i)?e:null;if(i.conditionAttributes&&t){var n=Na(t,i);return n.hidden?null:n}return e}function ts(e,t){if(_r("applySpeechAttributes:enter",{element:Fr(e),label:t,activeComposite:Qr(e)}),!Qr(e)){var i=Wr(t),n=function(e,t){var i=Wr(t);return i?Xo(e)?Yo(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 Xo(e)?Yo(t):Wr(t)}(e,n))}}function is(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 ns(e,t,i){var n=es(e,ar);if(n&&!function(e){var t=es(e,ar);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=es(e,ar);if(!t)return"";var i=t;switch(t.component){case"text":case"countdownTimerText":return $r(Zo(i.screenreaderText)||Zo(i.text));case"text-list":return Array.isArray(i.texts)?$r(i.texts.map(e=>Zo(e)).join(", ")):"";case"videoUrl":case"progressBar":return Wr(Zo(i.screenreaderText));default:return""}}(n);Nr(t,a),is(n).forEach(e=>ns(e,t))}}function as(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=>ns(e,i)):ns(e,i)}),i}function rs(e,t){var i=as(e),n=function(e){if(!e)return"";var t=Qo(e.component),i=e.getAttribute("aria-label")||e.getAttribute("title")||qo(e),n=Wr(t||i);return n?Xo(e)&&!/\bbutton\b\s*$/i.test(n)?Wr(`${n} button`):n:""}(t);return Br(jr(i,n?[n]:[]))}function os(e){return e?Or(`${Wr(e.id||e.name||"")}|${Br(jr(as(e),[]))}`):""}function ss(){return ur}function us(e,t=null){!function(){if(null===Cr&&null===Ir){var e=navigator.userAgentData;"function"==typeof(null==e?void 0:e.getHighEntropyValues)?Ir=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();Cr=n.includes("xbox")||a.includes("xbox"),_r("xbox client hints resolved",{platform:n,model:a,result:Cr})}).catch(()=>{Cr=!1}).finally(()=>{Ir=null}):Cr=!1}}(),_r("setActivePage:enter",{nextKey:os(e),previousKey:sr,activePageAnnounced:or,pageName:Wr((null==e?void 0:e.name)||(null==e?void 0:e.id)||"")});var i=sr;nr=e,ar=t,function(e){var t=os(e);if(t!==sr){var i=!sr&&!!yr;or=!1,sr=t,ur=i,yr=null,br=""}}(e),i!==sr&&Ho(void 0,!1)}function ls(e,t){if(_r("prepareInitialComposite:enter",{element:Fr(e),activePageKey:sr,activePageAnnounced:or,blockedByNavigation:ss(),label:Jo(e),isPrimary:Ko(e)}),!nr||or||!Ko(e)||ss())return _r("prepareInitialComposite:skip",{hasActivePage:!!nr,activePageAnnounced:or,isPrimary:Ko(e),blockedByNavigation:ss()}),!1;var i=rs(nr,e);if(!i)return!1;var n=qr(e,t),a=function(e,t,i){var n={id:kr++,reason:e,element:i,text:t,page:nr,status:"pending"};return Sr=n,n}("composite",i,e);or=!0,yr=e,br=Bo(e);var r,o=Vo(i,{reason:"composite",interrupt:!0,transactionId:a.id,element:e,focusPath:n,priority:"high"});o||(or=!1,(null===(r=Sr)||void 0===r?void 0:r.id)===a.id&&(Sr.status="cancelled",Sr=null));return o}function ds(e,t){_r("preparePrimaryCtaCompositeFocus:enter",{element:Fr(e),label:Jo(e),activePageKey:sr,activePageAnnounced:or});var i=ls(e,t);return _r("preparePrimaryCtaCompositeFocus:result",{result:i,activePageKey:sr,activePageAnnounced:or}),i}function hs(e){_r("handleNativeFocusIn:enter",{target:e.target instanceof Element?Fr(e.target):String(e.target),activePageKey:sr,activePageAnnounced:or});var t=function(e){for(var t,i=null,n=ae("function"==typeof e.composedPath?e.composedPath():[]);!(t=n()).done;){var a=t.value;if(a instanceof Element&&Jo(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&&cs(t,e)}function cs(e,t){if(_r("handleFocusedElementForSpeech:enter",{element:Fr(e),label:Jo(e),ttsEnabled:qa,runtime:To(),activePageKey:sr,activePageAnnounced:or,lastFocused:Fr(yr),lastFocusedElementIdentity:br}),!e)return _r("handleFocusedElementForSpeech:skip-basic",{hasElement:!!e,ttsEnabled:qa}),!1;if(!Po())return!1;var i=Bo(e);if(Dr&&Dr.pageKey===sr&&Date.now()<Dr.startedAt+2500){var n=Dr.element===e,a=!!i&&Dr.elementKey===i;if(!No()&&(n||a))return _r("handleFocusedElementForSpeech:skip-during-initial-composite-lock",{element:Fr(e),sameCompositeElement:n,sameCompositeElementKey:a}),!1;var r=Jo(e),o=r?jo(r):"";if(!No()&&o&&Dr.textKey.includes(o))return _r("handleFocusedElementForSpeech:skip-composite-contained-label-during-initial-lock",{element:Fr(e),labelPreview:r.slice(0,120),transactionId:Dr.transactionId}),yr=e,br=i,!1}if(yr===e||i&&i===br&&!or)return _r("handleFocusedElementForSpeech:skip-same-element",{element:Fr(e),activePageAnnounced:or,elementIdentity:i,lastFocusedElementIdentity:br}),!1;if(!or&&nr&&Ko(e)&&!yr&&!ss())return ls(e,t);var s=Jo(e);if(!s)return!1;if(Dr){var u=jo(s),l=Dr.textKey;if(!No()&&(u===l||u.includes(l)))return _r("handleFocusedElementForSpeech:skip-active-composite-label",{element:Fr(e),labelPreview:s.slice(0,120),transactionId:Dr.transactionId}),yr=e,br=i,!1}return yr=e,br=i,dr&&clearTimeout(dr),dr=setTimeout(()=>{dr=null,yr===e&&Vo(s,{reason:"focus",interrupt:!0,element:e,focusPath:qr(e,t),priority:"normal"})},120),!0}function ms(e=document){var t;if(_r("attachFocusSpeechListeners:enter",{root:e instanceof Element?Fr(e):e instanceof DocumentFragment?"document-fragment":"document",runtime:To()}),fs(),!Po())return _r("focus speech listeners not attached: non-CTV runtime"),fs;var i,n=e=>hs(e),a=()=>(_r("handleUserNavigationKey",{activePageKey:sr,activePageAnnounced:or}),wr=Date.now(),void(ur=!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&&cs(i,e)}(e)}}return lr={root:e,focusListener:n,keyListener:a,previousTvjsHandler:i},fs}function fs(){var e;if(_r("detachFocusSpeechListeners:enter",{hasCleanup:!!lr}),lr){var t=lr,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),lr=null}}function vs(){var e;_r("resetScreenreaderState:enter",{activePageKey:sr,activePageAnnounced:or,activeTransaction:null===(e=Sr)||void 0===e?void 0:e.id,lastFocused:Fr(yr)}),fs(),ir=null,tr=!1,nr=null,ar=null,rr=null,or=!1,sr="",ur=!1,yr=null,br="",wr=0,xr=null,ao(),no(),ro(),oo(),so(),ho(),dr&&(clearTimeout(dr),dr=null),io("reset"),zr(),Sr=null}var ps=function(){return ne(function e(t,i,n="",a=""){var r;Q(this,e),this.playing=!1,this.toggling=!1,this.handleVideoEvents=e=>{this.video.onended=()=>{Do(!1),this.handlePlayerAnalytics(e,m.VIDEO_ENDED)},this.video.onpause=()=>{Do(!1),this.toggling||this.handlePlayerAnalytics(e,m.VIDEO_PAUSED)},this.video.onplay=()=>{Do(!this.video.muted),this.toggling||this.handlePlayerAnalytics(e,this.video.currentTime>.05?m.VIDEO_RESUMED:m.VIDEO_STARTED)},this.video.onvolumechange=()=>{this.toggling||(this.muted=this.video.muted,Do(!this.video.paused&&!this.video.ended&&!this.muted),this.handlePlayerAnalytics(e,this.muted?m.VIDEO_MUTED:m.VIDEO_UNMUTED))}},this.removeVideoEvents=()=>{this.video&&(Do(!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,m.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),Do(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?m.VIDEO_MUTED:m.VIDEO_UNMUTED)}},{key:"videoPlayingAction",value:function(){var e,t;return(null===(e=this.video)||void 0===e?void 0:e.currentTime)<=0?m.VIDEO_STARTED:this.video.paused?m.VIDEO_PAUSED:this.video.ended?m.VIDEO_ENDED:(null===(t=this.video)||void 0===t?void 0:t.currentTime)>.05?m.VIDEO_RESUMED:m.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};f.getInstance().emit(v,{action:null!=t?t:this.videoPlayingAction(),videoMetaData:i,timeSpentOnPaywall:Ga(e)})}}}])}();ps.instance=null;var gs=({onTap:e,sku:t,componentChange:i,contextProvider:n}={})=>{var a,r,o,s,u,l,d,h,c,p,g,y=m.UNKNOWN;switch(null==e?void 0:e.function){case ai:y=m.CLOSE_PAYWALL,g=Ga(n),ys(),null===(a=ps.instance)||void 0===a||a.handlePlayerAnalytics(n,m.VIDEO_ENDED);break;case oi:y=m.RESTORE_PURCHASES,bs();break;case ui:y=m.SIGN_IN,ws();break;case yi:ks(null===(r=e.parameters)||void 0===r?void 0:r.url);break;case di:t&&(y=m.BUY_SKU,t=Ss(n,e,t));break;case wi:y=m.PAGE_CHANGE,i={name:null==e||null===(o=e.parameters)||void 0===o?void 0:o.screen},Es(n,null==e||null===(s=e.parameters)||void 0===s?void 0:s.screen);break;case ci:y=m.TOGGLE_CHANGE,i=Ms(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 fi:t&&(y=m.SELECT_SKU,Ts(n,t));break;case pi:t&&(y=m.PURCHASE_SELECTED_SKU,Ps(n,t));break;case Si:break;case Mi:null===(d=ps.instance)||void 0===d||d.togglePlayVideo(n);break;case Pi:null===(h=ps.instance)||void 0===h||h.togglePlayVideo(n);break;case Di:null===(c=ps.instance)||void 0===c||c.toggleMuteVideo(n);break;case Ci:null===(p=ps.instance)||void 0===p||p.toggleMuteVideo(n)}y!==m.UNKNOWN&&f.getInstance().emit(v,re({},n.getPaywallActionEventData(),{action:y,sku:t,timeSpentOnPaywall:g,componentChange:i,purchaseError:void 0,purchases:void 0}))},ys=()=>{Go(),p.clearLaunchId(),As(g.Close)||"undefined"==typeof window||window.history.back()},bs=()=>{var e=y(b.THIRD_PARTY_TRANSACTIONS);As(g.Restore)||e||n.warn("NamiPaywallManager.registerRestoreHandler is not registered, so restore option on the paywall will use default behavior.")},ws=()=>{As(g.SignIn)},ks=e=>{e?As(g.DeeplinkAction,e)||"undefined"!=typeof window&&window.open(e,"_blank"):n.debug("Paywall deep link action invoked, but no url present.")},Ss=(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(Ii(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(y(b.THIRD_PARTY_TRANSACTIONS)){if(p.setPurchaseImpression(),f.getInstance().listenerCount(g.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}`),As(g.BuySku,t)}else{var i=w(t.skuId);if(i&&(n.info(`Purchase flow completed, success=${i.success}, code=${i.billingResponseCode}, message=${i.message}`),i.success)){var a;f.getInstance().emit(v,{action:m.CLOSE_PAYWALL,sku:t,timeSpentOnPaywall:Ga(e)}),null===(a=ps.instance)||void 0===a||a.handlePlayerAnalytics(e,m.VIDEO_ENDED);var r=e.getSelectedCampaign();r&&r.conversion_event_type==k.IN_APP&&r.conversion_event_url?(p.clearLaunchId(),window.location.href=r.conversion_event_url):ys()}}}(e,o),o},Es=(e,t)=>{var i;t&&((null===(i=window.history.state)||void 0===i?void 0:i.prevUrl)==t?window.history.back():e.setCurrentPage(t))},Ms=(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}},Ts=(e,t)=>{var i=e.getCurrentGroupId(),n=e.selectedProducts();i&&t.id!=n[i]&&(n[i]=t.id,e.setSelectedProducts(n))},Ps=(e,t)=>{e.setPurchase(!0,t)};function As(e,...t){var i=f.getInstance();return i.emit(e,...t),i.listenerCount(e)>0}var Ds,xs,Cs,Is,Ls,_s,Rs,Fs,Ws,Os,$s,Ns,js=e=>e,Bs=S.NamiFlowManager,zs=250,Us=(Ds=function(){function e(t,i,n){var a;return Q(this,e),(a=J(this,e)).pages=[],a.currentOffset=0,a.presentationStyle="fullscreen",a._sheetEntranceActive=!0,a.formFactor=c(),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(),de(a,a)}return ue(e,z),ne(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=E(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 M(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;pe(e,"connectedCallback",this)([]),null!==(t=window.TVJS)&&void 0!==t&&t.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=this),this._detachFocusSpeechListeners=ms(this),document.addEventListener("keydown",this._boundHandleKeyDownEvent),this._swipeHandler=ti(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;pe(e,"disconnectedCallback",this)([]),Go(),null===(t=this._detachFocusSpeechListeners)||void 0===t||t.call(this),this._detachFocusSpeechListeners=void 0,vs(),p.clearLaunchId(),null!==(i=window.TVJS)&&void 0!==i&&i.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=document.body),document.removeEventListener("keydown",this._boundHandleKeyDownEvent),f.getInstance().removeAllListeners(v),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){if(10009===e.keyCode||27===e.keyCode||166===e.keyCode||196===e.keyCode||"Backspace"===e.key||"GoBack"===e.key||"BrowserBack"===e.key||"XF86Back"===e.key){if("Backspace"===e.key)if(e.composedPath().some(e=>e instanceof HTMLElement&&("INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable)))return;e.preventDefault(),Go(),this.flow?this.flow.triggerActions(T.REMOTE_BACK):this.isModal&&this.animateSheetDismiss().then(()=>ys())}}},{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.dismiss(),ys()}):this.animateSheetDismiss().then(()=>ys())}},{key:"animateSheetDismiss",value:function(){var e,t,i,n,a;return ce(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,q(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.dismiss()},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=ms(this.renderRoot),P(this.campaign)&&(this.flow=Bs.instance.presentFlow(this.campaign,this,this.context)),this.isOverlay&&this.updateComplete.then(()=>{this.isOverlaySheet&&this.setupHalfSheetDragTracking(),this.setupHalfSheetFocusTrap()})}},{key:"updated",value:function(t){if(pe(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 ce(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,q(this.updateComplete);case 3:requestAnimationFrame(()=>{this.currentOffset=1,setTimeout(()=>{this.pages=[e],this.currentOffset=0,this.paywall=e,i&&(i.style.height="")},zs)});case 4:return a.a(2)}},null,this,null,Promise)}},{key:"animateFullscreenEntry",value:function(){return ce(function(e){for(;;)switch(e.n){case 0:return e.n=1,q(new Promise(e=>requestAnimationFrame(()=>e())));case 1:return this.classList.remove("nami-fullscreen-entering"),this.classList.add("nami-fullscreen-entering-active"),e.n=2,q(new Promise(e=>setTimeout(e,zs)));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 ce(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,q(new Promise(e=>setTimeout(e,t?0:zs)));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 ce(function(m){for(;;)switch(m.n){case 0:if(null!==(i=this.flow)&&void 0!==i&&i.previousFlowStep&&this.flow.executeLifecycle(this.flow.previousFlowStep,T.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,q(this.updateComplete);case 1:return m.n=2,q(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,q(this.updateComplete);case 4:return m.n=5,q(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,q(this.updatePages(e));case 12:null!==(n=this.flow)&&void 0!==n&&n.currentFlowStep&&this.flow.executeLifecycle(this.flow.currentFlowStep,T.APPEAR);case 13:return m.a(2)}},null,this,null,Promise)}},{key:"getSelectedSlideIndexForCurrentCarousel",value:function(){return Qt.getSelectedSlideIndex()}},{key:"renderFlow",value:function(){return"undefined"==typeof document?B(xs||(xs=js``)):this.isOverlaySheet?this.renderHalfSheet():this.isModal?this.renderModal(this.renderFlowContainer()):this.renderFlowContainer()}},{key:"renderFlowContainer",value:function(){return B(Cs||(Cs=js`
254
+ `)),Tt=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},Pt=globalThis,At=Pt.ShadowRoot&&(void 0===Pt.ShadyCSS||Pt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Dt=Symbol(),xt=new WeakMap,Ct=function(){return ne(function e(t,i,n){if(Q(this,e),this._$cssResult$=!0,n!==Dt)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(At&&void 0===e){var i=void 0!==t&&1===t.length;i&&(e=xt.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&xt.set(t,e))}return e}},{key:"toString",value:function(){return this.cssText}}])}(),It=(e,t)=>{if(At)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(var i,n=ae(t);!(i=n()).done;){var a=i.value,r=document.createElement("style"),o=Pt.litNonce;void 0!==o&&r.setAttribute("nonce",o),r.textContent=a.cssText,e.appendChild(r)}},Lt=At?e=>e:e=>e instanceof CSSStyleSheet?(e=>{for(var t,i="",n=ae(e.cssRules);!(t=n()).done;){i+=t.value.cssText}return(e=>new Ct("string"==typeof e?e:e+"",void 0,Dt))(i)})(e):e,_t=Object.is,Rt=Object.defineProperty,Ft=Object.getOwnPropertyDescriptor,Wt=Object.getOwnPropertyNames,Ot=Object.getOwnPropertySymbols,$t=Object.getPrototypeOf,Nt=globalThis,jt=Nt.trustedTypes,Bt=jt?jt.emptyScript:"",zt=Nt.reactiveElementPolyfillSupport,Ut=(e,t)=>e,Ht={toAttribute(e,t){switch(t){case Boolean:e=e?Bt: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}},Gt=(e,t)=>!_t(e,t),Vt={attribute:!0,type:String,converter:Ht,reflect:!1,useDefault:!1,hasChanged:Gt};null!==(wt=Symbol.metadata)&&void 0!==wt||(Symbol.metadata=Symbol("metadata")),null!==(kt=Nt.litPropertyMetadata)&&void 0!==kt||(Nt.litPropertyMetadata=new WeakMap);var Kt=function(){function e(){var t;return Q(this,e),(t=J(this,e))._$Ep=void 0,t.isUpdatePending=!1,t.hasUpdated=!1,t._$Em=null,t._$Ev(),t}return ue(e,ye(HTMLElement)),ne(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=ae(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 It(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:Ht).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:Ht;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:Gt)(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 ce(function(i){for(;;)switch(i.p=i.n){case 0:return this.isUpdatePending=!0,i.p=1,i.n=2,q(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,q(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=ae(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=ae(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=Vt){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&&Rt(this.prototype,e,n)}}},{key:"getPropertyDescriptor",value:function(e,t,i){var n,a=null!==(n=Ft(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:Vt}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty(Ut("elementProperties"))){var e=$t(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty(Ut("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ut("properties")))for(var e=this.properties,t=0,i=[...Wt(e),...Ot(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=ae(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=ae(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=ae(new Set(e.flat(1/0).reverse()));!(i=n()).done;){var a=i.value;t.unshift(Lt(a))}else void 0!==e&&t.push(Lt(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}}])}();Kt.elementStyles=[],Kt.shadowRootOptions={mode:"open"},Kt[Ut("elementProperties")]=new Map,Kt[Ut("finalized")]=new Map,null!=zt&&zt({ReactiveElement:Kt}),(null!==(St=Nt.reactiveElementVersions)&&void 0!==St?St:Nt.reactiveElementVersions=[]).push("2.1.2");var Xt={attribute:!0,type:String,converter:Ht,reflect:!1,hasChanged:Gt},Yt=(e=Xt,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 qt(e){return(t,i)=>"object"==typeof i?Yt(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 Jt(e){return qt(re({},e,{state:!0,attribute:!1}))}var Qt=function(){function e(t,i,n){var a;return Q(this,e),(a=J(this,e,[t,i,n])).host=null,a.defineDynamicStateProps(),a}return ue(e,i),ne(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 Zt=e=>{var t;return ce(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=ei(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 ei(e){return`${e.family}-${e.style}`.replace(/ /g,"")}function ti(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 ii={},ni=ii.NAMI_CLOSE_PAYWALL,ai=void 0===ni?"namiClosePaywall":ni,ri=ii.NAMI_RESTORE_PURCHASES,oi=void 0===ri?"namiRestorePurchases":ri,si=ii.NAMI_SIGN_IN,ui=void 0===si?"namiSignIn":si,li=ii.NAMI_BUY_SKU,di=void 0===li?"namiBuySKU":li,hi=ii.SET_STATE,ci=void 0===hi?"setState":hi,mi=ii.NAMI_SELECT_SKU,fi=void 0===mi?"namiSelectSKU":mi,vi=ii.NAMI_PURCHASE_SELECTED_SKU,pi=void 0===vi?"namiPurchaseSelectedSKU":vi,gi=ii.NAMI_DEEP_LINK,yi=void 0===gi?"namiDeeplink":gi,bi=ii.NAMI_NAVIGATE_TO_SCREEN,wi=void 0===bi?"namiNavigateToScreen":bi,ki=ii.NAMI_RELOAD_PRODUCTS,Si=void 0===ki?"namiReloadProducts":ki,Ei=ii.NAMI_PLAY_VIDEO,Mi=void 0===Ei?"namiPlayVideo":Ei,Ti=ii.NAMI_PAUSE_VIDEO,Pi=void 0===Ti?"namiPauseVideo":Ti,Ai=ii.NAMI_MUTE_VIDEO,Di=void 0===Ai?"namiMuteVideo":Ai,xi=ii.NAMI_UNMUTE_VIDEO,Ci=void 0===xi?"namiUnmuteVideo":xi,Ii=e=>"subscription"===e;function Li(e){if(Ii(null==e?void 0:e.product_type)){var t=Ri(e);if(t.length>0)return t[0].billingPeriod}return null}function _i(e){var t=function(e){if(!e)return[];var t=e.offers.filter(e=>"promo"===e.offer_type);return Fi(t,e.subscription_period)}(e).find(e=>0===e.priceAmountMicros);return(null==t?void 0:t.billingPeriod)||null}function Ri(e){return e?Fi(e.offers.filter(e=>"default"===e.offer_type),e.subscription_period):[]}function Fi(e,t){return e.map(e=>Wi(e,t))}function Wi(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:Ni(m).format(c)}}function Oi(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 $i(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 Ni(e){var t={maximumFractionDigits:2,minimumFractionDigits:0};try{return new Intl.NumberFormat(navigator.language,re({},t,{style:"currency",currency:e}))}catch(e){return new Intl.NumberFormat(navigator.language,re({},t,{style:"currency",currency:"USD"}))}}var ji=(e,t,i)=>e&&t&&i?i.format(e-t):null,Bi=(e,t,i,n)=>{if(e&&t&&i&&n){var a=100*(1-e/(i/n*t));return`${Math.round(a)}%`}return null},zi=(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)}},Ui=e=>Gi(e.priceAmountMicros)/Hi(e.billingPeriod),Hi=e=>{var t=parseInt(e[1]);return e.includes("Y")&&(t*=12),t},Gi=e=>e/1e6;function Vi(e){return parseFloat((Math.round(e)/100).toFixed(2))}var Ki=(e,t,i=[])=>({price:()=>Yi(e),name:()=>null==e?void 0:e.name,title:()=>null==e?void 0:e.name,description:()=>null==e?void 0:e.description,duration:()=>qi(e),durationSingular:()=>qi(e,!0),period:()=>qi(e,!1,!0),periodNumber:()=>qi(e,!1,!1,!0),freeTrialDuration:()=>Ji(e),freeTrialDurationSingular:()=>Ji(e,!0),freeTrialPeriod:()=>Ji(e,!1,!0),freeTrialPeriodNumber:()=>Ji(e,!1,!1,!0),pricePerMonth:()=>Qi(e),pricePerMonthRounded:()=>Qi(e,!0),periodInMonths:()=>Zi(e),durationInMonths:()=>en(e),durationInMonthsSingular:()=>en(e,!0),periodNumberInMonths:()=>tn(e),percentagePriceDifferenceFromSku:()=>nn(e,t,i),priceDifferenceFromSku:()=>an(e,t,i),promoEligible:()=>null===rn(e)&&null!==on(e,t),freeTrialEligible:()=>null!==rn(e),promo:()=>{var i;return null===(i=on(e,t))||void 0===i?void 0:i.offer_ref_id},promoCode:()=>"XXXXX",promoPrice:()=>{var i;return null===(i=sn(e,t))||void 0===i?void 0:i.formattedPrice},promoPeriod:()=>un(e,t,!1,!0),promoPeriodNumber:()=>un(e,t,!1,!1,!0),promoDuration:()=>un(e,t),promoDurationSingular:()=>un(e,t,!0),introEligible:()=>!1,pricePerDay:()=>mn(e),pricePerWeek:()=>fn(e),pricePerWeekRounded:()=>fn(e,!0),introductoryPrice:()=>hn(e,t),introductoryPeriod:()=>dn(e,t,!1,!0),introductoryPeriodNumber:()=>dn(e,t,!1,!1,!0),introductoryDuration:()=>dn(e,t),introductoryDurationSingular:()=>dn(e,t,!0),introductoryPricePerMonth:()=>cn(e,t),introductoryPricePerMonthRounded:()=>cn(e,t,!0),durationAbbrev:()=>qi(e,!1,!1,!1,!0),freeTrialDurationAbbrev:()=>Ji(e,!1,!1,!1,!0),introductoryDurationAbbrev:()=>dn(e,t,!1,!1,!1,!0),promoDurationAbbrev:()=>un(e,t,!1,!1,!1,!0),promoDurationPhase2Abbrev:()=>un(e,t,!0,!0,!1,!0),durationInMonthsAbbrev:()=>en(e,!1,!1,!1,!0),durationSingularAbbrev:()=>qi(e,!0,!1,!1,!0),freeTrialDurationSingularAbbrev:()=>Ji(e,!0,!1,!1,!0),introductoryDurationSingularAbbrev:()=>dn(e,t,!0,!1,!1,!0),promoDurationSingularAbbrev:()=>un(e,t,!0,!1,!1,!0),promoDurationSingularPhase2Abbrev:()=>un(e,t,!0,!0,!1,!0),durationInMonthsSingularAbbrev:()=>en(e,!0,!1,!1,!0),periodAbbrev:()=>qi(e,!1,!0,!1,!0),freeTrialPeriodAbbrev:()=>Ji(e,!1,!0,!1,!0),introductoryPeriodAbbrev:()=>dn(e,t,!1,!0,!1,!0),promoPeriodAbbrev:()=>un(e,t,!1,!0,!1,!0),promoPeriodPhase2Abbrev:()=>un(e,t,!1,!0,!0,!0),periodInMonthsAbbrev:()=>en(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}(Li(e)),iso_subscription_duration:()=>vn(e),invalid:()=>!1,unavailable:()=>!1}),Xi=(e,t,i,n=[])=>{if(!t)return null;var a=Ki(t,i,n);return a[e]?a[e]():null},Yi=e=>{var t=Ri(e);return t&&t.length?t[0].formattedPrice:null},qi=(e,t,i,n,a)=>Oi(Li(e),t,i,n,a),Ji=(e,t,i,n,a)=>Oi(_i(e),t,i,n,a),Qi=(e,t)=>{var i=Ri(e);if(!i||0===i.length)return null;var n=Ui(i[0]);return n?Ni(i[0].priceCurrencyCode).format(t?Math.round(n):n):null},Zi=(e,t)=>{var i=Ri(e);if(!i||0===i.length)return null;var n=i[0].billingPeriod;return $i(n)?Oi("P1Y"===n?"P12M":n,!1,!1,!1,t):null},en=(e,t,i,n,a)=>{var r=Ri(e);if(!r||0===r.length)return null;var o=r[0].billingPeriod;return $i(o)?Oi("P1Y"===o?"P12M":o,t,i,n,a):null},tn=e=>{if(!e)return 0;var t=Ri(e);return t&&t.length?Hi(t[0].billingPeriod):0},nn=(e,t,i=[])=>{var n,a=Ri(e);if(!a||0===a.length)return null;var r=null===(n=zi(i,null!=t?t:""))||void 0===n?void 0:n.product_details;if(!t||!r)return Bi(Vi(a[0].priceAmountMicros),tn(e));var o=Ri(r);return Bi(Vi(a[0].priceAmountMicros),tn(e),(null==o?void 0:o.length)>0?Vi(o[0].priceAmountMicros):0,tn(r))},an=(e,t,i=[])=>{var n,a=Ri(e);if(!a||0===a.length)return null;var r=null===(n=zi(i,null!=t?t:""))||void 0===n?void 0:n.product_details;if(!t||!r)return ji(Ui(a[0]));var o=Ri(r);return ji(Ui(a[0]),Ui(o[0]),Ni(o[0].priceCurrencyCode))},rn=e=>_i(e),on=(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},sn=(e,t)=>{if(!e)return null;var i=on(e,t);return i?Wi(i,e.subscription_period):null},un=(e,t,i,n,a,r)=>{var o=sn(e,t);return Oi((null==o?void 0:o.billingPeriod)||null,i,n,a,r)},ln=(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?Wi(i,e.subscription_period):null},dn=(e,t,i,n,a,r)=>{var o=ln(e,t);return Oi((null==o?void 0:o.billingPeriod)||null,i,n,a,r)},hn=(e,t)=>{var i=ln(e,t);return i?i.formattedPrice:null},cn=(e,t,i)=>{var n=ln(e,t);if(!n)return null;var a=Ui(n);return a?Ni(n.priceCurrencyCode).format(i?Math.round(a):a):null},mn=e=>{var t=Ri(e);if(!t||0===t.length)return null;var i,n,a=Gi(t[0].priceAmountMicros)/(i=t[0].billingPeriod,(n=Hi(i))?30.437*n:1);return Ni(t[0].priceCurrencyCode).format(a)},fn=(e,t)=>{var i=Ri(e);if(!i||0===i.length)return null;var n,a,r=Gi(i[0].priceAmountMicros)/(n=i[0].billingPeriod,(a=Hi(n))?52*a/12:1);return Ni(i[0].priceCurrencyCode).format(t?Math.round(r):r)},vn=e=>{var t=Ri(e)[0];return t?t.billingPeriod:null},pn="object"==typeof global&&global&&global.Object===Object&&global,gn="object"==typeof self&&self&&self.Object===Object&&self,yn=pn||gn||Function("return this")(),bn=yn.Symbol;var wn=Array.isArray,kn=Object.prototype,Sn=kn.hasOwnProperty,En=kn.toString,Mn=bn?bn.toStringTag:void 0;var Tn=Object.prototype.toString;var Pn=bn?bn.toStringTag:void 0;function An(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Pn&&Pn in Object(e)?function(e){var t=Sn.call(e,Mn),i=e[Mn];try{e[Mn]=void 0;var n=!0}catch(e){}var a=En.call(e);return n&&(t?e[Mn]=i:delete e[Mn]),a}(e):function(e){return Tn.call(e)}(e)}function Dn(e){return null!=e&&"object"==typeof e}var xn=bn?bn.prototype:void 0,Cn=xn?xn.toString:void 0;function In(e){if("string"==typeof e)return e;if(wn(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,In)+"";if(function(e){return"symbol"==typeof e||Dn(e)&&"[object Symbol]"==An(e)}(e))return Cn?Cn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ln(e){return null==e?"":In(e)}function _n(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 Rn=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function Fn(e){return Rn.test(e)}var Wn="\\ud800-\\udfff",On="["+Wn+"]",$n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Nn="\\ud83c[\\udffb-\\udfff]",jn="[^"+Wn+"]",Bn="(?:\\ud83c[\\udde6-\\uddff]){2}",zn="[\\ud800-\\udbff][\\udc00-\\udfff]",Un="(?:"+$n+"|"+Nn+")"+"?",Hn="[\\ufe0e\\ufe0f]?",Gn=Hn+Un+("(?:\\u200d(?:"+[jn,Bn,zn].join("|")+")"+Hn+Un+")*"),Vn="(?:"+[jn+$n+"?",$n,Bn,zn,On].join("|")+")",Kn=RegExp(Nn+"(?="+Nn+")|"+Vn+Gn,"g");function Xn(e){return Fn(e)?function(e){return e.match(Kn)||[]}(e):function(e){return e.split("")}(e)}var Yn,qn=(Yn="toUpperCase",function(e){var t=Fn(e=Ln(e))?Xn(e):void 0,i=t?t[0]:e.charAt(0),n=t?_n(t,1).join(""):e.slice(1);return i[Yn]()+n});var Jn,Qn=(Jn={À:"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==Jn?void 0:Jn[e]}),Zn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ea=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var ta=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var ia=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var na="\\ud800-\\udfff",aa="\\u2700-\\u27bf",ra="a-z\\xdf-\\xf6\\xf8-\\xff",oa="A-Z\\xc0-\\xd6\\xd8-\\xde",sa="\\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",ua="["+sa+"]",la="\\d+",da="["+aa+"]",ha="["+ra+"]",ca="[^"+na+sa+la+aa+ra+oa+"]",ma="(?:\\ud83c[\\udde6-\\uddff]){2}",fa="[\\ud800-\\udbff][\\udc00-\\udfff]",va="["+oa+"]",pa="(?:"+ha+"|"+ca+")",ga="(?:"+va+"|"+ca+")",ya="(?:['’](?:d|ll|m|re|s|t|ve))?",ba="(?:['’](?:D|LL|M|RE|S|T|VE))?",wa="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",ka="[\\ufe0e\\ufe0f]?",Sa=ka+wa+("(?:\\u200d(?:"+["[^"+na+"]",ma,fa].join("|")+")"+ka+wa+")*"),Ea="(?:"+[da,ma,fa].join("|")+")"+Sa,Ma=RegExp([va+"?"+ha+"+"+ya+"(?="+[ua,va,"$"].join("|")+")",ga+"+"+ba+"(?="+[ua,va+pa,"$"].join("|")+")",va+"?"+pa+"+"+ya,va+"+"+ba,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",la,Ea].join("|"),"g");function Ta(e,t,i){return e=Ln(e),void 0===t?function(e){return ia.test(e)}(e)?function(e){return e.match(Ma)||[]}(e):function(e){return e.match(ta)||[]}(e):e.match(t)||[]}var Pa=RegExp("['’]","g");var Aa,Da=(Aa=function(e,t,i){return t=t.toLowerCase(),e+(i?qn(Ln(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}(Ta(function(e){return(e=Ln(e))&&e.replace(Zn,Qn).replace(ea,"")}(e).replace(Pa,"")),Aa,"")});function xa(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=_a(e,t.sku_ref_id||""),t.variables=function(e,t,i){if(!t)return{};var n=t.variables;if(!n)return re({},t);Object.keys(n).forEach(t=>{if(Ca(n[t])){var a=La(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(Ki({})))().forEach(t=>{if(void 0===n[t]){var r=Xi(t,e,void 0,i);null!==r&&(a[t]=r)}}),re({},t,a,n)}(t.product_details,t,r)}),r}function Ca(e){return"string"==typeof e&&e.includes(r)}function Ia(e,t,i){return t?(Object.keys(t).forEach(n=>{Ca(t[n])&&(t[n]=t[Da(n)]=La(t[n],e,i))}),re({},t)):{}}var La=(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 Xi(a,t,h,i)});function _a(e=[],t=""){return e.find(e=>e.product_ref_id===t)||null}var Ra=["conditionAttributes"];function Fa(e,t){return Array.isArray(e)?e.reduce((e,i)=>{var n=Fa(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:Fa(n,t);return re({},e,{[i]:a})},{}):"string"==typeof e?Ua(e,t):e}function Wa(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=_a(e.productDetails,t.sku_ref_id),c={freeTrialEligible:1==Xi("freeTrialEligible",h),introEligible:1==Xi("introEligible",h),promoEligible:1==Xi("promoEligible",h),invalid:Xi("invalid",h),unavailable:Xi("unavailable",h)},m=re({},t,t.variables,c,{id:t.id,entitlements:l});o=t,s=e=>{for(var t,i=ae(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:za(n,{convertToUrl:!0})};return[null!==(i=t.featured)&&void 0!==i&&i,Fa(u,Fa(f,f))]},[])}function Oa(e,t){if(!t.loopSource)return[];var i=h(t.loopSource),n=(null!=i?i:[]).filter(i=>{var n;return!(null!==(n=t.loopSourceConditions)&&void 0!==n&&n.length)||t.loopSourceConditions.every(t=>Ba(e,t,i))}),a=t.groupBy,r=t.groupHeaderTemplate,o=e=>Fa(t.components,Fa({block:e},{block:e}));if(!a||!r)return"number"==typeof t.max&&(n=n.slice(0,t.max)),[{key:"",header:null,items:n.map(o).filter(e=>null!=e)}];for(var s,u=[],l=new Map,d=ae(n);!(s=d()).done;){var c=s.value,m=Fa(a,Fa({block:c},{block:c})),f=null==m?"":String(m);l.has(f)||(u.push(f),l.set(f,[])),l.get(f).push(c)}return u.map(e=>{var i={key:e},n=Fa(r,Fa({group:i},{group:i})),a=l.get(e);return"number"==typeof t.groupMax&&(a=a.slice(0,t.groupMax)),{key:e,header:[n],items:a.map(o)}})}function $a(e,t){return t.assertions?t.assertions.every(Ba.bind(null,e)):!!t.orAssertions&&(!t.orAssertions.length||t.orAssertions.some(Ba.bind(null,e)))}function Na(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,Ra);return i?i.reduce((t,i)=>$a(e,i)?(Object.entries(i.attributes).forEach(([t,n])=>{i.attributes[t]=ja(e,n)}),re({},t,i.attributes)):t,n):n}function ja(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=re({},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=Ua(t,c)),t}function Ba(e,{value:t,expected:i,operator:n},a){if(t=ja(e,t,0,a),i=ja(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 za(e,{convertToUrl:t}={convertToUrl:!1}){return Object.entries(e).reduce((e,[i,{content:n}])=>(t&&"string"!=typeof n&&n&&(n=URL.createObjectURL(n)),re({},e,{[i]:n})),{})}function Ua(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=Ua(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=Ha(t,a);if(void 0===r)return e;if("object"==typeof r&&null!==r&&0===Object.keys(r).length)return"";var o=Ha(t,...n);return void 0===o?"":"string"!=typeof o?o:Ua(o,t)}}function Ha(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 Ga=e=>{var t=e.state.timeSpentOnPaywall;if(t)return Date.now()-t},Va=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}`},Ka=(e,t)=>{if(!e||!t)return!0;var i=null!=e&&e.includes("rgb")?Va(e):e,n=null!=t&&t.includes("rgb")?Va(t):t;return(null==i?void 0:i.toLowerCase())===(null==n?void 0:n.toLowerCase())};function Xa(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 Ya(e,t,i){for(var n,a=Xa(t),r={key:i},o=Fa(t,Fa({group:r},{group:r})),s={dotSize:a.dotSize,dotColor:a.dotColor,dotCornerRadius:a.dotCornerRadius,dotBorderWidth:a.dotBorderWidth,dotBorderColor:a.dotBorderColor},u=ae(null!==(l=o.conditionAttributes)&&void 0!==l?l:[]);!(n=u()).done;){var l,d,h=n.value;if($a(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 qa=!0,Ja=!1,Qa=!1,Za=!1,er=!1,tr=!1,ir=null,nr=null,ar=null,rr=null,or=!1,sr="",ur=!1,lr=null,dr=null,hr=null,cr=null,mr=null,fr=null,vr=null,pr=null,gr=!1,yr=null,br="",wr=0,kr=1,Sr=null,Er=[],Mr=new WeakMap,Tr=new WeakMap,Pr=1;function Ar(e){var t=Tr.get(e);return t||(t=Pr++,Tr.set(e,t)),String(t)}var Dr=null,xr=null,Cr=null,Ir=null;function Lr(e){return!0===e||"true"===e||"1"===e||"yes"===e}function _r(e,t){if(function(){if("undefined"==typeof window)return!1;try{var e,t;return!!Lr(window.NAMI_TTS_DEBUG)||Lr(null===(e=window.localStorage)||void 0===e?void 0:e.getItem("nami:tts:debug"))||Lr(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 Rr(e="TTS is unavailable in this runtime."){Ja||(Ja=!0,_r(e))}function Fr(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 Wr(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 Or(e){return e.toLowerCase().replace(/[^a-z0-9$]+/g," ").replace(/\s+/g," ").trim()}function $r(e){return Wr(String(null!=e?e:"").replace(/<[^>]*>/g," ").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/[*_`#>~]/g," "))}function Nr(e,t){var i=Wr(t);i&&e[e.length-1]!==i&&e.push(i)}function jr(e,t=[]){var i=[];return[...e,...t].forEach(e=>{var t=function(e){var t=Wr(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=Wr(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=Wr(t.slice(n));u&&i.push(u);return i.length?i:[t]}(e);t.length||Nr(i,e),t.forEach(e=>Nr(i,e))}),i.slice(0,60)}function Br(e){return Wr(e.join(". ").replace(/\.\s*([.!?])/g,"$1"))}function zr(e){var t,i=Sr;i&&(e&&i.id===e||(i.status="cancelled",(null===(t=Sr)||void 0===t?void 0:t.id)===i.id&&(Sr=null)))}function Ur(){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 Hr(e){return"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot}function Gr(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=Hr(n)?n.host:n}return t}function Vr(e,t){return!!t&&-1!==Gr(t).indexOf(e)}function Kr(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 Xr(e,t){t&&-1===e.indexOf(t)&&e.push(t)}function Yr(e,t){var i=t.shadowRoot;i&&i.querySelectorAll('button,[role="button"],a,input,select,textarea,[tabindex]:not([tabindex="-1"])').forEach(t=>Xr(e,t))}function qr(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:Gr(e)}function Jr(e,t=[],i={}){var n=[];if(i.focusedElementOnly)return Xr(n,e),n;var a=(t.length?t:Gr(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=Gr(e).find(e=>e.matches("nami-product-container"));if(a)return a;var r=rr&&"querySelectorAll"in rr?rr:"undefined"!=typeof document?document:null;return r&&null!==(i=Array.prototype.slice.call(r.querySelectorAll("nami-product-container")).find(t=>Vr(t,e)))&&void 0!==i?i:null}(e,a);return Xr(n,e),Yr(n,e),a.forEach(t=>{var i=!!r&&(t===r||Vr(r,t)),a=t!==e&&Vr(t,e),o=t.matches('nami-product-container,nami-button,[role="button"],button,[tabindex]:not([tabindex="-1"])');(i||a||t===e)&&o&&(Xr(n,t),Yr(n,t))}),null!=r&&r.isConnected&&(Xr(n,r),Yr(n,r)),n}function Qr(e){return Mr.has(e)}function Zr(e,t,i=[]){var n=Wr(t);if(!n)return!1;no(),eo(void 0,"new-composite",!0);var a=Jr(e,i,bo()||yo()?{focusedElementOnly:!1}:{focusedElementOnly:!0});return a.forEach(e=>function(e,t){var i=Wr(t);return!!i&&(Mr.has(e)||Mr.set(e,{"aria-label":e.getAttribute("aria-label")}),e.setAttribute("aria-label",i),!0)}(e,n)),Er=a,!0}function eo(e,t="manual",i=!1){var n=e&&-1===Er.indexOf(e)?Jr(e):Er;n.length&&(!i&&Sr&&n.some(e=>Mr.has(e))?_r("composite restore skipped: transaction still active",{reason:t}):(no(),n.forEach(e=>{var t=Mr.get(e);t&&(!function(e,t,i){null===i?e.removeAttribute(t):e.setAttribute(t,i)}(e,"aria-label",t["aria-label"]),Mr.delete(e))}),e&&-1===Er.indexOf(e)||(Er=[])))}function to(e,t){Mr.has(e)&&(t instanceof Element&&Kr(e,t)||(no(),hr=setTimeout(()=>{(hr=null,e.isConnected)?Kr(e,Ur())||eo(e,"blur"):eo(e,"blur-disconnected",!0)},50)))}function io(e){Er.length&&eo(void 0,e,!0)}function no(){hr&&(clearTimeout(hr),hr=null)}function ao(){cr&&(clearTimeout(cr),cr=null),Dr=null}function ro(){mr&&(clearTimeout(mr),mr=null)}function oo(){fr&&(clearTimeout(fr),fr=null)}function so(){vr&&(clearTimeout(vr),vr=null)}function uo(){pr&&(clearTimeout(pr),pr=null)}function lo(e){gr=!0,uo(),pr=setTimeout(()=>{pr=null,gr=!1},co(e)+500)}function ho(){uo(),gr=!1}function co(e){var t=Wr(e),i=350*(t?t.split(/\s+/).filter(Boolean).length:0);return Math.min(3e4,Math.max(4e3,i))}function mo(){return"undefined"==typeof window?null:window}function fo(){var e,t=null===(e=mo())||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 vo(){return!!fo()}function po(){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 go(){return"undefined"!=typeof window&&void 0!==window.speechSynthesis&&"function"==typeof window.speechSynthesis.speak&&"function"==typeof window.SpeechSynthesisUtterance}function yo(){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 bo(){var e,t;if("undefined"==typeof window)return!1;if(yo())return!1;var i=(null===(e=window.navigator)||void 0===e||null===(e=e.userAgent)||void 0===e?void 0:e.toLowerCase())||"",n=mo();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 wo(){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 ko(e){return"string"==typeof e&&-1!==e.toLowerCase().indexOf("xbox")}function So(){var e,t,i;if("undefined"==typeof window)return!1;if(!0===Cr)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(ko)}function Eo(){if("undefined"==typeof window)return!1;try{return"television"===c()}catch(e){return!1}}function Mo(){if(er)return!1;var e=po();if(!e)return!1;try{return"function"!=typeof e.isEnabled||e.isEnabled()}catch(e){return!1}}function To(){return{televisionRuntime:Eo(),televisionTtsRuntime:Po(),webos:bo(),tizen:wo(),vizio:yo(),xbox:So(),xboxClientHintsResult:Cr,hasWebOsServiceRequest:vo(),webOsRequestType:typeof fo(),hasWebSpeechApi:go(),webSpeechUnavailableForSession:Qa,webOsLunaUnavailableForSession:Za,vizioChromevoxUnavailableForSession:er}}function Po(){return Eo()||bo()||yo()||wo()}function Ao(){return Po()&&!Qa&&go()}function Do(e){if(tr=e,_r("set media playing",{playing:e,hasDeferredUtterance:!!ir}),!e&&ir){var t,i=ir;if(ir=null,i.options.transactionId&&(null===(t=Sr)||void 0===t?void 0:t.id)!==i.options.transactionId)return void _r("drop stale deferred speech",{transactionId:i.options.transactionId,reason:i.options.reason});Vo(i.text,i.options)}}function xo(e){Qa=!0,Rr(bo()?"Web Speech TTS unavailable in this webOS runtime":"Web Speech TTS unavailable in this runtime"),_r("web speech unavailable",{error:e})}function Co(e){Za=!0,_r("webOS Luna unavailable",{error:e})}function Io(e,t){ir={text:e,options:t}}var Lo={name:"webos-luna-tts",platform:"webos",isAvailable:function(){return Po()&&!yo()&&!Za&&vo()},speak:function(e,t){_r("speakViaWebOsLuna:enter",{textPreview:e.slice(0,160),reason:t.reason,transactionId:t.transactionId,requestType:typeof fo()});var i=fo();if(!i)return _r("speakViaWebOsLuna:no-request"),!1;var n="composite"===t.reason,a=!1,r=()=>{var r,o;if(fr=null,t.transactionId&&(null===(r=Sr)||void 0===r?void 0:r.id)!==t.transactionId)return _r("speakViaWebOsLuna:drop-stale-delayed-speak",{transactionId:t.transactionId,activeTransaction:null===(o=Sr)||void 0===o?void 0:o.id,reason:t.reason}),!1;if(tr)return _r("speakViaWebOsLuna:defer-delayed-speak-media-playing",{transactionId:t.transactionId,reason:t.reason}),Io(e,t),!0;var s=!1;try{_r("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(_r("speakViaWebOsLuna:onSuccess",{response:e,transactionId:t.transactionId}),!t.transactionId||(null===(i=Sr)||void 0===i?void 0:i.id)===t.transactionId){var n,r=function(e){var t,i=Wr(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=Sr)||void 0===n?void 0:n.id)===t.transactionId&&(Sr.status="ended",Sr=null)}},onFailure:e=>{var i;s=!0,_r("speakViaWebOsLuna:onFailure",{error:e,transactionId:t.transactionId});var n=!t.transactionId||(null===(i=Sr)||void 0===i?void 0:i.id)===t.transactionId;t.transactionId&&n&&Sr&&(Sr.status="cancelled",Sr=null),Co(e)}})}catch(e){var u;return t.transactionId&&(null===(u=Sr)||void 0===u?void 0:u.id)===t.transactionId&&(Sr.status="cancelled",Sr=null),Co(e),!1}return!s};if(n)return oo(),_r("speakViaWebOsLuna:delay-composite-until-focus-settles",{delayMs:250,transactionId:t.transactionId}),fr=setTimeout(r,250),!0;return r()},stop:Fo},_o={name:"web-speech",platform:"web",isAvailable:Ao,speak:function(e,t){if(!Ao())return!1;try{var i=new window.SpeechSynthesisUtterance(e);return i.onstart=()=>{var e;t.transactionId&&(null===(e=Sr)||void 0===e?void 0:e.id)===t.transactionId&&(Sr.status="started")},i.onend=()=>{var e=Sr,i=!t.transactionId||(null==e?void 0:e.id)===t.transactionId;t.transactionId&&i&&e&&(e.status="ended",Sr=null)},i.onerror=e=>{var i,n=e.error;t.transactionId&&(null===(i=Sr)||void 0===i?void 0:i.id)===t.transactionId&&(Sr.status="cancelled",Sr=null),"synthesis-failed"===n&&xo(n)},window.speechSynthesis.speak(i),!0}catch(e){return xo("exception"),!1}},stop:()=>{if(go())try{window.speechSynthesis.cancel()}catch(e){}}},Ro={name:"vizio-chromevox",platform:"vizio",isAvailable:Mo,speak:Oo,stop:Wo};function Fo(){var e=fo();if(e)try{e("luna://com.webos.service.tts",{method:"stop",parameters:{},onFailure:e=>_r("webOS Luna stop failed",{error:e})})}catch(e){_r("webOS Luna stop threw",{error:e})}}function Wo(e=!0){var t=!!mr,i=gr;ro();var n=po(),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(""),ho()}catch(e){ho(),_r("VIZIO stop threw",{error:e})}}function Oo(e,t){var i=po();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?(ro(),mr=setTimeout(()=>{var n;if(mr=null,!t.transactionId||!Sr||Sr.id===t.transactionId)if(t.element&&r&&!t.element.isConnected){var a;t.transactionId&&(null===(a=Sr)||void 0===a?void 0:a.id)===t.transactionId&&(Sr.status="cancelled",Sr=null)}else{if(tr)return ao(),xr=null,void Io(e,t);i.play(e),lo(e),t.transactionId&&(null===(n=Sr)||void 0===n?void 0:n.id)===t.transactionId&&(Sr.status="ended",Sr=null)}},o),!0):(i.play(e),lo(e),t.transactionId&&(null===(a=Sr)||void 0===a?void 0:a.id)===t.transactionId&&(Sr.status="ended",Sr=null),!0)}catch(e){return function(e){er=!0,_r("VIZIO Chromevox unavailable",{error:e})}(e),!1}}function $o(e){return"high"===e?3:"normal"===e?2:1}function No(){return Date.now()-wr<1500}function jo(e){return Or(e)}function Bo(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-${Ar(e)}`].filter(Boolean).join("|"):""}(e);return Or(t||Jo(e))}function zo(e){var t=jo(e);return"clickable"===t||"button"===t||"focusable"===t||"selected"===t||"unselected"===t}function Uo(e,t,i){var n;if(xr={textKey:jo(e),reason:t.reason,timestamp:Date.now()},"high"===i){var a=co(e),r=Date.now();Dr={transactionId:t.transactionId,pageKey:sr,element:null!==(n=t.element)&&void 0!==n?n:null,elementKey:Bo(t.element),textKey:jo(e),startedAt:r,suppressUntil:r+a},cr&&clearTimeout(cr),cr=setTimeout(()=>{cr=null,Dr=null},a)}}function Ho(e,t=!0){var i,n,a,r=!(!e||(null===(i=Sr)||void 0===i?void 0:i.id)!==e||"pending"!==Sr.status);if(_r("stopSpeech",{preserveTransactionId:e,allowVizioEmptyFallback:t,activeTransaction:null===(n=Sr)||void 0===n?void 0:n.id,reason:null===(a=Sr)||void 0===a?void 0:a.reason,preservingCurrentTransaction:r}),ir=null,r||(so(),oo()),e||(ao(),no(),io("stop")),zr(e),dr&&(clearTimeout(dr),dr=null),!r){if(go())try{window.speechSynthesis.cancel()}catch(e){}bo()&&Fo(),yo()&&Wo(t)}}function Go(){Ho()}function Vo(e,t={}){var i,n,a;_r("speakText:enter",{textPreview:Wr(e).slice(0,160),reason:t.reason,transactionId:t.transactionId,element:Fr(t.element),runtime:To()});var r=Wr(e);if(!r)return!1;if(!Po())return _r("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":zo(e)?"low":"normal"}(r,o);if(function(e,t,i){var n=jo(e),a=Date.now(),r=Bo(t.element);if(zo(e))return!0;if(xr&&xr.reason===t.reason&&xr.textKey===n&&a-xr.timestamp<600)return _r("suppress:duplicate-request",{reason:t.reason,textPreview:e.slice(0,120)}),!0;if(!Dr)return!1;if($o(i)>=$o("high"))return!1;if("focus"===t.reason){var o=Dr.textKey;if(!No()&&(n===o||n.includes(o)))return _r("suppress:focus-text-is-active-composite",{textPreview:e.slice(0,120),transactionId:Dr.transactionId,element:Fr(t.element)}),!0}var s=function(e,t){return!!e&&!!t&&e===t}(t.element,Dr.element),u=!!r&&Dr.elementKey===r,l=!Dr.pageKey||Dr.pageKey===sr,d=No(),h=l&&!d&&a<Dr.startedAt+2500;return!(!s&&!u&&(l&&"focus"===t.reason&&t.element&&Dr.element!==t.element||"low"!==i&&!h)&&(ao(),1))}(r,o,s))return!1;if(o.interrupt&&Ho(o.transactionId,!1),tr)return Io(r,o),!0;var u=function(e){var t;return"manual"!==(null!==(t=e.reason)&&void 0!==t?t:"manual")&&e.element?bo()||yo()?"programmatic":"accessibility-label":"programmatic"}(o);_r("speakText:owner",{owner:u,reason:o.reason,element:Fr(o.element)});var l,d,h="programmatic"===u?function(){if(!Po())return null;var e=yo(),t=bo();return Ro.isAvailable()?(_r("resolveTtsEngine:selected",{engine:"vizio-chromevox"}),Ro):e?null:Lo.isAvailable()?(_r("resolveTtsEngine:selected",{engine:"webos-luna-tts"}),Lo):_o.isAvailable()?(_r("resolveTtsEngine:selected",{engine:"web-speech"}),_o):(_r("tts engine unavailable",{webos:t,vizio:e}),null)}():null;(_r("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||bo()}(u))&&Zr(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=Sr)||void 0===d?void 0:d.id)===o.transactionId&&(Sr.status="started"),Uo(r,o,s),!0;if(!h)return function(e,t){if(!yo()||er)return!1;var i=Date.now(),n=()=>{var a;vr=null,t.transactionId&&Sr&&Sr.id!==t.transactionId||(Mo()?Oo(e,t):Date.now()-i>=8e3?t.transactionId&&(null===(a=Sr)||void 0===a?void 0:a.id)===t.transactionId&&(Sr.status="cancelled",Sr=null):vr=setTimeout(n,250))};return so(),vr=setTimeout(n,250),!0}(r,o)?(Uo(r,o,s),!0):(Rr(),!1);var c=h.speak(r,o);if(_r("speakText:engine-result",{engine:h.name,accepted:c,reason:o.reason,transactionId:o.transactionId}),c)return Uo(r,o,s),c;if(!o.element)return c;var m=Zr(o.element,r,null!==(a=o.focusPath)&&void 0!==a?a:[]);return _r("speakText:aria-label-fallback",{engine:h.name,accepted:m,reason:o.reason}),m&&Uo(r,o,s),m}function Ko(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 Xo(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 Yo(e){return Wr(e).replace(/(?:,\s*)?\bbutton\b\s*$/i,"").trim()||Wr(e)}function qo(e){return Wr(e.innerText||e.textContent||"")}function Jo(e){if(!e)return"";if(Qr(e)){var t=function(e){var t=Mr.get(e);return t?Wr(t["aria-label"]||e.getAttribute("title")||""):""}(e);if(t)return t;var i=Qo(e.component);if(i)return i}var n=e.getAttribute("data-tts-spoken-label");if(n)return Wr(n);var a=Qo(e.component);if(a)return a;var r=e.getAttribute("aria-label")||e.getAttribute("title");return r?Wr(r):qo(e)}function Qo(e){var t=es(e,ar);if(!t)return"";var i=t,n=Wr(Zo(i.speechLabel)||Zo(i.speech_label)||Zo(i.screenreaderText)||Zo(i.title)||Zo(i.alt)||Zo(i.text)||(Array.isArray(i.texts)?i.texts.map(e=>Zo(e)).join(", "):""));if(n)return n;for(var a,r=ae(is(i));!(a=r()).done;){var o=Qo(a.value);if(o)return o}return""}function Zo(e,t=ar){return t?ja(t,e):e}function es(e,t){if(!e||e.hidden)return null;var i=e;if("condition"===i.component)return t&&$a(t,i)?e:null;if(i.conditionAttributes&&t){var n=Na(t,i);return n.hidden?null:n}return e}function ts(e,t){if(_r("applySpeechAttributes:enter",{element:Fr(e),label:t,activeComposite:Qr(e)}),!Qr(e)){var i=Wr(t),n=function(e,t){var i=Wr(t);return i?Xo(e)?Yo(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 Xo(e)?Yo(t):Wr(t)}(e,n))}}function is(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 ns(e,t,i){var n=es(e,ar);if(n&&!function(e){var t=es(e,ar);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=es(e,ar);if(!t)return"";var i=t;switch(t.component){case"text":case"countdownTimerText":return $r(Zo(i.screenreaderText)||Zo(i.text));case"text-list":return Array.isArray(i.texts)?$r(i.texts.map(e=>Zo(e)).join(", ")):"";case"videoUrl":case"progressBar":return Wr(Zo(i.screenreaderText));default:return""}}(n);Nr(t,a),is(n).forEach(e=>ns(e,t))}}function as(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=>ns(e,i)):ns(e,i)}),i}function rs(e,t){var i=as(e),n=function(e){if(!e)return"";var t=Qo(e.component),i=e.getAttribute("aria-label")||e.getAttribute("title")||qo(e),n=Wr(t||i);return n?Xo(e)&&!/\bbutton\b\s*$/i.test(n)?Wr(`${n} button`):n:""}(t);return Br(jr(i,n?[n]:[]))}function os(e){return e?Or(`${Wr(e.id||e.name||"")}|${Br(jr(as(e),[]))}`):""}function ss(){return ur}function us(e,t=null){!function(){if(null===Cr&&null===Ir){var e=navigator.userAgentData;"function"==typeof(null==e?void 0:e.getHighEntropyValues)?Ir=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();Cr=n.includes("xbox")||a.includes("xbox"),_r("xbox client hints resolved",{platform:n,model:a,result:Cr})}).catch(()=>{Cr=!1}).finally(()=>{Ir=null}):Cr=!1}}(),_r("setActivePage:enter",{nextKey:os(e),previousKey:sr,activePageAnnounced:or,pageName:Wr((null==e?void 0:e.name)||(null==e?void 0:e.id)||"")});var i=sr;nr=e,ar=t,function(e){var t=os(e);if(t!==sr){var i=!sr&&!!yr;or=!1,sr=t,ur=i,yr=null,br=""}}(e),i!==sr&&Ho(void 0,!1)}function ls(e,t){if(_r("prepareInitialComposite:enter",{element:Fr(e),activePageKey:sr,activePageAnnounced:or,blockedByNavigation:ss(),label:Jo(e),isPrimary:Ko(e)}),!nr||or||!Ko(e)||ss())return _r("prepareInitialComposite:skip",{hasActivePage:!!nr,activePageAnnounced:or,isPrimary:Ko(e),blockedByNavigation:ss()}),!1;var i=rs(nr,e);if(!i)return!1;var n=qr(e,t),a=function(e,t,i){var n={id:kr++,reason:e,element:i,text:t,page:nr,status:"pending"};return Sr=n,n}("composite",i,e);or=!0,yr=e,br=Bo(e);var r,o=Vo(i,{reason:"composite",interrupt:!0,transactionId:a.id,element:e,focusPath:n,priority:"high"});o||(or=!1,(null===(r=Sr)||void 0===r?void 0:r.id)===a.id&&(Sr.status="cancelled",Sr=null));return o}function ds(e,t){_r("preparePrimaryCtaCompositeFocus:enter",{element:Fr(e),label:Jo(e),activePageKey:sr,activePageAnnounced:or});var i=ls(e,t);return _r("preparePrimaryCtaCompositeFocus:result",{result:i,activePageKey:sr,activePageAnnounced:or}),i}function hs(e){_r("handleNativeFocusIn:enter",{target:e.target instanceof Element?Fr(e.target):String(e.target),activePageKey:sr,activePageAnnounced:or});var t=function(e){for(var t,i=null,n=ae("function"==typeof e.composedPath?e.composedPath():[]);!(t=n()).done;){var a=t.value;if(a instanceof Element&&Jo(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&&cs(t,e)}function cs(e,t){if(_r("handleFocusedElementForSpeech:enter",{element:Fr(e),label:Jo(e),ttsEnabled:qa,runtime:To(),activePageKey:sr,activePageAnnounced:or,lastFocused:Fr(yr),lastFocusedElementIdentity:br}),!e)return _r("handleFocusedElementForSpeech:skip-basic",{hasElement:!!e,ttsEnabled:qa}),!1;if(!Po())return!1;var i=Bo(e);if(Dr&&Dr.pageKey===sr&&Date.now()<Dr.startedAt+2500){var n=Dr.element===e,a=!!i&&Dr.elementKey===i;if(!No()&&(n||a))return _r("handleFocusedElementForSpeech:skip-during-initial-composite-lock",{element:Fr(e),sameCompositeElement:n,sameCompositeElementKey:a}),!1;var r=Jo(e),o=r?jo(r):"";if(!No()&&o&&Dr.textKey.includes(o))return _r("handleFocusedElementForSpeech:skip-composite-contained-label-during-initial-lock",{element:Fr(e),labelPreview:r.slice(0,120),transactionId:Dr.transactionId}),yr=e,br=i,!1}if(yr===e||i&&i===br&&!or)return _r("handleFocusedElementForSpeech:skip-same-element",{element:Fr(e),activePageAnnounced:or,elementIdentity:i,lastFocusedElementIdentity:br}),!1;if(!or&&nr&&Ko(e)&&!yr&&!ss())return ls(e,t);var s=Jo(e);if(!s)return!1;if(Dr){var u=jo(s),l=Dr.textKey;if(!No()&&(u===l||u.includes(l)))return _r("handleFocusedElementForSpeech:skip-active-composite-label",{element:Fr(e),labelPreview:s.slice(0,120),transactionId:Dr.transactionId}),yr=e,br=i,!1}return yr=e,br=i,dr&&clearTimeout(dr),dr=setTimeout(()=>{dr=null,yr===e&&Vo(s,{reason:"focus",interrupt:!0,element:e,focusPath:qr(e,t),priority:"normal"})},120),!0}function ms(e=document){var t;if(_r("attachFocusSpeechListeners:enter",{root:e instanceof Element?Fr(e):e instanceof DocumentFragment?"document-fragment":"document",runtime:To()}),fs(),!Po())return _r("focus speech listeners not attached: non-CTV runtime"),fs;var i,n=e=>hs(e),a=()=>(_r("handleUserNavigationKey",{activePageKey:sr,activePageAnnounced:or}),wr=Date.now(),void(ur=!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&&cs(i,e)}(e)}}return lr={root:e,focusListener:n,keyListener:a,previousTvjsHandler:i},fs}function fs(){var e;if(_r("detachFocusSpeechListeners:enter",{hasCleanup:!!lr}),lr){var t=lr,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),lr=null}}function vs(){var e;_r("resetScreenreaderState:enter",{activePageKey:sr,activePageAnnounced:or,activeTransaction:null===(e=Sr)||void 0===e?void 0:e.id,lastFocused:Fr(yr)}),fs(),ir=null,tr=!1,nr=null,ar=null,rr=null,or=!1,sr="",ur=!1,yr=null,br="",wr=0,xr=null,ao(),no(),ro(),oo(),so(),ho(),dr&&(clearTimeout(dr),dr=null),io("reset"),zr(),Sr=null}var ps=function(){return ne(function e(t,i,n="",a=""){var r;Q(this,e),this.playing=!1,this.toggling=!1,this.handleVideoEvents=e=>{this.video.onended=()=>{Do(!1),this.handlePlayerAnalytics(e,m.VIDEO_ENDED)},this.video.onpause=()=>{Do(!1),this.toggling||this.handlePlayerAnalytics(e,m.VIDEO_PAUSED)},this.video.onplay=()=>{Do(!this.video.muted),this.toggling||this.handlePlayerAnalytics(e,this.video.currentTime>.05?m.VIDEO_RESUMED:m.VIDEO_STARTED)},this.video.onvolumechange=()=>{this.toggling||(this.muted=this.video.muted,Do(!this.video.paused&&!this.video.ended&&!this.muted),this.handlePlayerAnalytics(e,this.muted?m.VIDEO_MUTED:m.VIDEO_UNMUTED))}},this.removeVideoEvents=()=>{this.video&&(Do(!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,m.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),Do(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?m.VIDEO_MUTED:m.VIDEO_UNMUTED)}},{key:"videoPlayingAction",value:function(){var e,t;return(null===(e=this.video)||void 0===e?void 0:e.currentTime)<=0?m.VIDEO_STARTED:this.video.paused?m.VIDEO_PAUSED:this.video.ended?m.VIDEO_ENDED:(null===(t=this.video)||void 0===t?void 0:t.currentTime)>.05?m.VIDEO_RESUMED:m.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};f.getInstance().emit(v,{action:null!=t?t:this.videoPlayingAction(),videoMetaData:i,timeSpentOnPaywall:Ga(e)})}}}])}();ps.instance=null;var gs=({onTap:e,sku:t,componentChange:i,contextProvider:n}={})=>{var a,r,o,s,u,l,d,h,c,p,g,y=m.UNKNOWN;switch(null==e?void 0:e.function){case ai:y=m.CLOSE_PAYWALL,g=Ga(n),ys(),null===(a=ps.instance)||void 0===a||a.handlePlayerAnalytics(n,m.VIDEO_ENDED);break;case oi:y=m.RESTORE_PURCHASES,bs();break;case ui:y=m.SIGN_IN,ws();break;case yi:ks(null===(r=e.parameters)||void 0===r?void 0:r.url);break;case di:t&&(y=m.BUY_SKU,t=Ss(n,e,t));break;case wi:y=m.PAGE_CHANGE,i={name:null==e||null===(o=e.parameters)||void 0===o?void 0:o.screen},Es(n,null==e||null===(s=e.parameters)||void 0===s?void 0:s.screen);break;case ci:y=m.TOGGLE_CHANGE,i=Ms(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 fi:t&&(y=m.SELECT_SKU,Ts(n,t));break;case pi:t&&(y=m.PURCHASE_SELECTED_SKU,Ps(n,t));break;case Si:break;case Mi:null===(d=ps.instance)||void 0===d||d.togglePlayVideo(n);break;case Pi:null===(h=ps.instance)||void 0===h||h.togglePlayVideo(n);break;case Di:null===(c=ps.instance)||void 0===c||c.toggleMuteVideo(n);break;case Ci:null===(p=ps.instance)||void 0===p||p.toggleMuteVideo(n)}y!==m.UNKNOWN&&f.getInstance().emit(v,re({},n.getPaywallActionEventData(),{action:y,sku:t,timeSpentOnPaywall:g,componentChange:i,purchaseError:void 0,purchases:void 0}))},ys=()=>{Go(),p.clearLaunchId(),As(g.Close)||"undefined"==typeof window||window.history.back()},bs=()=>{var e=y(b.THIRD_PARTY_TRANSACTIONS);As(g.Restore)||e||n.warn("NamiPaywallManager.registerRestoreHandler is not registered, so restore option on the paywall will use default behavior.")},ws=()=>{As(g.SignIn)},ks=e=>{e?As(g.DeeplinkAction,e)||"undefined"!=typeof window&&window.open(e,"_blank"):n.debug("Paywall deep link action invoked, but no url present.")},Ss=(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(Ii(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(y(b.THIRD_PARTY_TRANSACTIONS)){if(p.setPurchaseImpression(),f.getInstance().listenerCount(g.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}`),As(g.BuySku,t)}else{var i=w(t.skuId);if(i&&(n.info(`Purchase flow completed, success=${i.success}, code=${i.billingResponseCode}, message=${i.message}`),i.success)){var a;f.getInstance().emit(v,{action:m.CLOSE_PAYWALL,sku:t,timeSpentOnPaywall:Ga(e)}),null===(a=ps.instance)||void 0===a||a.handlePlayerAnalytics(e,m.VIDEO_ENDED);var r=e.getSelectedCampaign();r&&r.conversion_event_type==k.IN_APP&&r.conversion_event_url?(p.clearLaunchId(),window.location.href=r.conversion_event_url):ys()}}}(e,o),o},Es=(e,t)=>{var i;t&&((null===(i=window.history.state)||void 0===i?void 0:i.prevUrl)==t?window.history.back():e.setCurrentPage(t))},Ms=(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}},Ts=(e,t)=>{var i=e.getCurrentGroupId(),n=e.selectedProducts();i&&t.id!=n[i]&&(n[i]=t.id,e.setSelectedProducts(n))},Ps=(e,t)=>{e.setPurchase(!0,t)};function As(e,...t){var i=f.getInstance();return i.emit(e,...t),i.listenerCount(e)>0}var Ds,xs,Cs,Is,Ls,_s,Rs,Fs,Ws,Os,$s,Ns,js=e=>e,Bs=S.NamiFlowManager,zs=250,Us=(Ds=function(){function e(t,i,n){var a;return Q(this,e),(a=J(this,e)).pages=[],a.currentOffset=0,a.presentationStyle="fullscreen",a._sheetEntranceActive=!0,a.formFactor=c(),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(),de(a,a)}return ue(e,z),ne(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=E(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 M(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;pe(e,"connectedCallback",this)([]),null!==(t=window.TVJS)&&void 0!==t&&t.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=this),this._detachFocusSpeechListeners=ms(this),document.addEventListener("keydown",this._boundHandleKeyDownEvent),this._swipeHandler=ti(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;pe(e,"disconnectedCallback",this)([]),Go(),null===(t=this._detachFocusSpeechListeners)||void 0===t||t.call(this),this._detachFocusSpeechListeners=void 0,vs(),p.clearLaunchId(),null!==(i=window.TVJS)&&void 0!==i&&i.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=document.body),document.removeEventListener("keydown",this._boundHandleKeyDownEvent),f.getInstance().removeAllListeners(v),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){if(10009===e.keyCode||27===e.keyCode||166===e.keyCode||196===e.keyCode||"Backspace"===e.key||"GoBack"===e.key||"BrowserBack"===e.key||"XF86Back"===e.key){if("Backspace"===e.key)if(e.composedPath().some(e=>e instanceof HTMLElement&&("INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable)))return;e.preventDefault(),Go(),this.flow?this.flow.triggerActions(T.REMOTE_BACK):this.isModal&&this.animateSheetDismiss().then(()=>ys())}}},{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.dismiss(),ys()}):this.animateSheetDismiss().then(()=>ys())}},{key:"animateSheetDismiss",value:function(){var e,t,i,n,a;return ce(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,q(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.dismiss()},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=ms(this.renderRoot),P(this.campaign)&&(this.flow=Bs.instance.presentFlow(this.campaign,this,this.context)),this.isOverlay&&this.updateComplete.then(()=>{this.isOverlaySheet&&this.setupHalfSheetDragTracking(),this.setupHalfSheetFocusTrap()})}},{key:"updated",value:function(t){if(pe(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 ce(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,q(this.updateComplete);case 3:requestAnimationFrame(()=>{this.currentOffset=1,setTimeout(()=>{this.pages=[e],this.currentOffset=0,this.paywall=e,i&&(i.style.height="")},zs)});case 4:return a.a(2)}},null,this,null,Promise)}},{key:"animateFullscreenEntry",value:function(){return ce(function(e){for(;;)switch(e.n){case 0:return e.n=1,q(new Promise(e=>requestAnimationFrame(()=>e())));case 1:return this.classList.remove("nami-fullscreen-entering"),this.classList.add("nami-fullscreen-entering-active"),e.n=2,q(new Promise(e=>setTimeout(e,zs)));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 ce(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,q(new Promise(e=>setTimeout(e,t?0:zs)));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 ce(function(m){for(;;)switch(m.n){case 0:if(null!==(i=this.flow)&&void 0!==i&&i.previousFlowStep&&this.flow.executeLifecycle(this.flow.previousFlowStep,T.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,q(this.updateComplete);case 1:return m.n=2,q(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,q(this.updateComplete);case 4:return m.n=5,q(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,q(this.updatePages(e));case 12:null!==(n=this.flow)&&void 0!==n&&n.currentFlowStep&&this.flow.executeLifecycle(this.flow.currentFlowStep,T.APPEAR);case 13:return m.a(2)}},null,this,null,Promise)}},{key:"getSelectedSlideIndexForCurrentCarousel",value:function(){return Qt.getSelectedSlideIndex()}},{key:"renderFlow",value:function(){return"undefined"==typeof document?B(xs||(xs=js``)):this.isOverlaySheet?this.renderHalfSheet():this.isModal?this.renderModal(this.renderFlowContainer()):this.renderFlowContainer()}},{key:"renderFlowContainer",value:function(){return B(Cs||(Cs=js`
255
255
  <div class="nami-flow-container">
256
256
  ${0}
257
257
  </div>