/*! web-client-bundle - v26.519.2009 - 2026-05-19 20:09:41 */ !function(){"use strict";const t=new Uint8Array([42,94,79,102,182,87,18,39,206,243,126,191,4,63,77,59,162,241,193,101,74,1,189,21,73,186,68,154,111,81,242,165,135,180,163,105,50,210,243,84,28,112,180,154,121,30,77,205,244,40,170,162,232,228,11,227,246,206,15,66,249,209,155,230,40,163,9,155,225,186,136,158,220,243,29,125,108,215,138,132,162,138,154,50,162,121,25,242,186,30,94,86,163,178,51,115,114,236,70,144,3,28,80,147,126,214,189,247,91,89,174,197,197,183,170,91,8,14,57,223,112,162,142,158,85,114,94,54,177,225,193,215,183,203,176,135,119,151,106,124,147,64,185,186,154,65,115,229,149,248,103,83,0,185,239,180,180,9,121,175,91,167,210,228,224,59,152,103,84,54,29,154,26,192,30,30,230,189,46,31,44,247,213,82,224,87,119,243,198,63,123,158,78,91,6,158,34,159,215,185,65,197,90,186,113,79,40,200,209,165,199,128,110,19,63,125,229,20,205,93,22,177,73,126,222,207,218,164,126,105,197,65,146,175,93,49,99,244,146,186,117,50,116,237,57,73,29,194,250,216,125,160,101,201,143,48,173,154,169,182,163,159,150,123,175,26,29,21,75,254,6,218,88,64,9,238,70,40,48,251,227,255,14,252,121,116,203,193,211,50,29,13,120,107,88,124,129,92,214,187,203,14,234,59,113,251,68,2,197,99,211,134,234,215,62,106,160,163,205,103,10,244,47,67,229,124,164,209,86,98,250,150,19,2,48,7,217,47,108,179,137,29,118,253,240,198,209,169,123,234,193,55,151,183,196,133,243,111,68,60,109,15,222,215,190,84,32,161,155,6,221,9,91,244,252,231,34,70,249,254,126,47,145,125,203,199,164,76,200,255,242,96,213,54,245,80,152,219,38,38,88,107,171,167,140,205,250,85,42,240,247,239,122,49,163,88,77,71,185,215,102,84,142,194,238,193,69,189,200,85,4,24,127,232,164,61,27,31,192,160,81,62,75,2,248,252,158,31,229,142,61,109,149,222,245,236,130,102,181,88,110,177,25,177,190,237,122,51,60,100,33,47,94,199,39,135,90,14,29,181,6,103,45,93,144,135,188,184,179,103,222,216,182,143,162,221,15,201,102,140,100,227,179,120,252,193,19,93,250,0,27,52,240,252,40,142,218,208,81,211,133,190,65,240,215,64,205,85,247,205,210,255,193,106,149,155,120,62,145,81,139,227,62,75,159,37,244,102,106,117,36,171,31,184,50,171,235,246,36,249,88,10,214,139,224,160,86,8,144,218,183,238,141,252,130,111,200,38,91,55,119,105,134,219,12,149,106,45,35,72,102,65,91,187,244,8,73,110,250,22,186,33,176,44,135,12,192,62,60,255,35,253,44,113,58,242,222,60,145,228,207,59,23,255,173,47,234,254,254,30,171,11,60,87,79,218,109,175,23,255,197,111,134,83,200,250,202,117,111,156,243,38,157,77,88,94,63,66,101,42,51,254,208,205,13,144,240,191,7,88,9,41,57,85,18,75,218,18,4,51,179,93,145,234,147,82,72,229,77,72,78,154,75,122,93,231,240,183,141,143,122,82,255,217,76,184,75,190,91,255,116,77,254,146,211,148,177,170,158,59,112,202,57,184,41,6,139,39,65,254,166,3,217,93,41,1,215,16,112,238,62,246,183,159,46,115,207,175,144,241,71,60,233,47,94,133,51,12,63,242,171,123,235,89,106,213,255,216,235,111,31,143,216,217,236,13,80,251,192,159,47,174,114,161,77,165,139,192,238,112,134,180,106,154,56,179,162,98,57,28,59,92,133,227,113,249,102,176,3,19,245,141,159,48,231,90,228,244,229,173,100,230,33,205,22,231,123,90,139,75,252,134,220,243,170,7,32,136,69,9,234,125,27,204,31,251,163,218,1,198,246,122,98,251,1,130,98,114,236,231,115,6,233,147,232,73,29,207,229,243,63,60,165,178,226,159,13,124,200,114,54,198,102,213,255,38,213,225,4,23,105,69,166,215,113,134,2,14,129,76,64,74,48,98,159,219,73,75,62,237,120,114,144,81,242,206,66,111,175,177,86,55,129,34,198,84,63,87,242,115,43,209,149,49,107,213,179,233,105,242,134,53,61,248,11,73,195,244,184,248,93,54,242,111,65,75,63,14,180,177,71,5,55,111,129,179,168,80,72,214,13,25,75,0,191,190,72,172,141,70,104,241,169,158,104,131,130,14,249,12,42,179,87,98,173,42,195,111,205,218,226,240,165,81,158,27,103,161,128,85,250,152,147,145,116,29,119,128,252,240,95,162,6,79,188,140,183,26,150,91,184,180,8,27,7,3,74,93,70,57,169,210,36,82,24,116,234,217,241,64,24,250,172,230,109,194,235,58,37,52,127,79,77,220,86,231,178,202,42,176,114,135,215,196,161,72,101,252,107,45,222,73,102,37,205,56,177,142,100,77,183,27,245,90,2,100,38,127,199,201,115,183,142,121,56,185,179,90,168,120,45,167,207,107,182,17,85,161,78,113,92,205,213,22,210,28,189,204,118,121,163,88,52,27,19,242,41,82,180,81,186,185,166,161,253,230,93,42,154,204,123,153,128,120,17,132,49,204,55,221,213,34,121,118,143,207,100,55,24,42,12,158,55,40,177,238,135,243,29,166,26,75,99,108,190,214,17,198,250,4,14,184,180,250,160,90,190,27,76,93,81,245,104,185,104,237,35,141,66,214,86,238,166,161,207,138,195,93,9,185,67,206,174,232,109,50,107,71,114,64,208,88,81,162,242,139,120,24,41,124,172,154,159,83,112,56,54,247,211,57,20,214,42,23,19,145,84,43,126,8,212,27,49,225,85,23,9,17,82,21,251,63,148,247,25,103,122,13,92,185,231,86,161,74,83,79,88,192,168,80,110,92,183,152,96,154,128,46,223,53,127,186,254,57,189,102,111,208,211,84,164,113,114,237,75,120,78,78,198,114,208,93,125,210,183,30,18,211,237,6,191,143,86,209,162,47,231,19,70,162,23,120,237,205,49,103,117,112,64,125,12,52,112,210,225,34,14,225,72,248,198,122,239,103,22,112,159,187,116,52,35,249,228,152,96,143,210,143,75,0]);function e(t){const e=(new TextEncoder).encode(t);let n=2166136261;for(let t=0;t>>0}const n=(t,e)=>`${t}_${e}_salt`,s=(t,e=200)=>t.length<=e?t:`${t.substring(0,e)}...`;let o=!1;try{((t,e)=>{const n=new Set,o=[];try{const e=t.top?.location.hostname;e&&n.add(e)}catch(t){const e=t;o.push(s(e.message))}try{n.add(t.location.hostname)}catch(t){const e=t;o.push(s(e.message))}try{const e=t.location.href;n.add(new URL(e).hostname)}catch(t){const e=t;o.push(s(e.message))}try{const t=e.URL;n.add(new URL(t).hostname)}catch(t){const e=t;o.push(s(e.message))}if(0===n.size)throw new Error(`Unable to determine hostname: ${JSON.stringify(o)}`);return n})(window,document).forEach((s=>{o||(o=((t,s)=>{for(let o=0;o<14;o++){const a=e(n(t,o))%11033,r=a%8;if(!(s[Math.floor(a/8)]&1<{const e=this.globalContext.document.cookie.split("; ").reduce(((e,n)=>{const o=n.split("=");return o[0]===t?decodeURIComponent(o.slice(1).join("=")):e}),"");return e.length>0?e:null},this.removeItem=(t,e="/")=>{this.setItem(t,"",0,e)},this.setItem=(t,e,n,o="/")=>{const a=new Date(n);if(!this.isValidDate(a))throw new Error("Invalid expiration date");this.globalContext.document.cookie=`${t}=${e}; expires=${a.toUTCString()}; path=${o};`},this.globalContext=t}isValidDate(t){return t instanceof Date&&!isNaN(t)}}const u=["scope/objectName",t,e],p=":";function m(t){return null===t||"object"!=typeof t?t:t instanceof Date?new Date(t.getTime()):t instanceof Array?t.reduce(((t,e)=>(t.push(m(e)),t)),[]):t instanceof Set?Array.from(t.values()).reduce(((t,e)=>(t.add(m(e)),t)),new Set):t instanceof Map?Array.from(t.entries()).reduce(((t,e)=>(t.set(e[0],m(e[1])),t)),new Map):t instanceof Object?Object.keys(t).reduce(((e,n)=>(e[n]=m(t[n]),e)),{}):t}class f{constructor(t,e){const n=e.rootName;this.globalContext=e.globalContext,this.rootName=n;const o=this.globalContext[n].get(t);if(null==o)throw new Error(`Missing "${t}" account in userspace object`);this.id=t,this.store=o.store,this.queue=o.queue,this.store.has("listeners")||this.store.set("listeners",new Map)}async record(t,e){return await new Promise(((n,o)=>{this.queue.push(new CustomEvent(t,{detail:{resolve:n,reject:o,source:i.internal,...e}}))}))}async recordListener(t,e){return await new Promise(((n,o)=>{this.queue.push(new CustomEvent(t.name,{detail:{resolve:n,reject:o,source:i.internal,...e}}))}))}recordListenerNonBlocking(t,e){this.recordListener(t,e).catch((t=>{}))}read(t,e){const n=this.store.get(t);if(void 0!==n)return n;if(void 0!==e?.persist&&e.persist){const n=this.readLocalStorage(t,{usePrefix:!0,throwOnDisallowed:e.throwOnDisallowed});if(void 0!==n)return n}const o=e?.default?.generators?.get(t);return void 0!==o?o(...e?.default?.args??[]):void 0}write(t,e,n){this.store.set(t,e),void 0!==n?.persist&&n.persist&&this.writeLocalStorage(t,e,{usePrefix:!0,throwOnDisallowed:n.throwOnDisallowed})}use(t,e){let n;const o=this.store.get(t.key);if(void 0!==o)n=o;else if(void 0!==e?.persist&&e.persist){const o=this.readLocalStorage(t.key,{usePrefix:!0,throwOnDisallowed:e.throwOnDisallowed});null!=o&&(n=o)}const a=n??t.default;if("function"==typeof a||!1===e?.structuredClone)return a;try{return structuredClone(a)}catch(t){try{return m(a)}catch(t){return vt.logCoreError({id:"Core.library.Account.use",account:null,error:t}),a}}}useParent(t,e){try{const n=this.globalContext.parent,o=n[this.rootName];if(!o||"function"!=typeof o.get)return t.default;const a=o.get(e?.accountId??this.id);if(!a||!a.store)return t.default;let i;const s=a.store.get(t.key);if(void 0!==s)i=s;else if(e?.persist){const o=e?.accountId??this.id,a=`aps${p}${o}${p}${t.key}`;try{const t=n.localStorage.getItem(a);null!=t&&(i=t)}catch{}}const r=i??t.default;if("function"==typeof r||!1===e?.structuredClone)return r;try{return structuredClone(r)}catch{try{return m(r)}catch{return r}}}catch{return t.default}}update(t,e,n){let o=e(this.use(t,{...n,throwOnDisallowed:n?.throwOnDisallowed}));if(void 0!==t.postProcessor&&(o=t.postProcessor(o)),this.store.set(t.key,o),void 0!==n?.persist&&n.persist){if("string"!=typeof o)throw new Error(`${JSON.stringify(o)} must be a string to be writtable to browser storage`);this.writeLocalStorage(t.key,o,{usePrefix:!0,throwOnDisallowed:n.throwOnDisallowed})}}delete(t,e){this.store.delete(t),void 0!==e?.persist&&e.persist&&this.deleteLocalStorage(t,{usePrefix:!0,throwOnDisallowed:e.throwOnDisallowed})}remove(t,e){this.store.delete(t.key),void 0!==e?.persist&&e.persist&&this.deleteLocalStorage(t.key,{usePrefix:!0,throwOnDisallowed:e.throwOnDisallowed})}executeFuncWithConsent(t,e){if(!this.isAllowedToAccessInfoOnDevice())throw new Error("Invalid consent. API requires consent before execution.");return e.apply(t)}recordErrorEvent(t){vt.logError({...t,account:this})}recordStatusChangeEvent(t){vt.logFeature({id:t.id,account:this,feature:t.status,analyticsSampleRateAdjustFactor:t.analyticsSampleRateAdjustFactor,props:{...t.props}})}recordGenericEvent(t){vt.logFeature({id:t.id,account:this,feature:t.id,analyticsSampleRateAdjustFactor:t.analyticsSampleRateAdjustFactor,props:{...t.props}})}isAllowedToAccessInfoOnDevice(){return this.updateUserConsent(),this.use(d)}isAPStagAllowedToAccessInfoOnDevice(){return!0===this.globalContext.apstag._atsaaiod()}updateUserConsent(){try{const t=this.isAPStagAllowedToAccessInfoOnDevice();this.update(d,(()=>t))}catch(t){}}getPersistedItemName(t){return`aps${p}${this.id}${p}${t}`}isBrowserStorageAllowed(t){let e=!1;try{e=this.isAllowedToAccessInfoOnDevice()}catch{}return e||u.includes(t)}setCookieStorage(t,e,n,o){const a=o?.throwOnDisallowed??!0;if(!this.isBrowserStorageAllowed(t)){if(a)throw new Error(`${t} is not allowed to be set on cookie storage`);return}const i=o?.usePrefix?this.getPersistedItemName(t):t;return new l(this.globalContext).setItem(i,e,n,o?.path??"/")}readCookieStorage(t,e){const n=e?.throwOnDisallowed??!0;if(!this.isBrowserStorageAllowed(t)){if(n)throw new Error(`${t} is not allowed to be read from cookie storage`);return}const o=e?.usePrefix?this.getPersistedItemName(t):t;return new l(this.globalContext).getItem(o)}readLocalStorage(t,e){const n=e?.throwOnDisallowed??!0;if(!this.isBrowserStorageAllowed(t)){if(n)throw new Error(`${t} is not allowed to be read from browser storage`);return}const o=e?.usePrefix?this.getPersistedItemName(t):t;return this.globalContext.localStorage.getItem(o)??void 0}writeLocalStorage(t,e,n){const o=n?.throwOnDisallowed??!0;if(!this.isBrowserStorageAllowed(t)){if(o)throw new Error(`${t} is not allowed to be written to browser storage`);return}if("string"!=typeof e)throw new Error(`${JSON.stringify(e)} must be a string to be writtable to browser storage`);const a=n?.usePrefix?this.getPersistedItemName(t):t;this.globalContext.localStorage.setItem(a,e)}deleteLocalStorage(t,e){const n=e?.throwOnDisallowed??!0;if(!this.isBrowserStorageAllowed(t)){if(n)throw new Error(`${t} is not allowed to be touched/deleted in browser storage`);return}const o=e?.usePrefix?this.getPersistedItemName(t):t;this.globalContext.localStorage.removeItem(o)}readSessionStorage(t,e){const n=e?.throwOnDisallowed??!0;if(!this.isBrowserStorageAllowed(t)){if(n)throw new Error(`${t} is not allowed to be read from browser storage`);return}const o=e?.usePrefix?this.getPersistedItemName(t):t;if(o in this.globalContext.sessionStorage)return this.globalContext.sessionStorage.getItem(o)}writeSessionStorage(t,e,n){const o=n?.throwOnDisallowed??!0;if(!this.isBrowserStorageAllowed(t)){if(o)throw new Error(`${t} is not allowed to be written to browser storage`);return}if("string"!=typeof e)throw new Error(`${JSON.stringify(e)} must be a string to be writable to browser storage`);const a=n?.usePrefix?this.getPersistedItemName(t):t;this.globalContext.sessionStorage.setItem(a,e)}deleteSessionStorage(t,e){const n=e?.throwOnDisallowed??!0;if(!this.isBrowserStorageAllowed(t)){if(n)throw new Error(`${t} is not allowed to be touched/deleted in browser storage`);return}const o=e?.usePrefix?this.getPersistedItemName(t):t;this.globalContext.sessionStorage.removeItem(o)}}const h="_system";class v extends f{constructor(t,e){super(h,{globalContext:t,rootName:e})}}const y="listeners",g="_internal/history",w="_internal/pageLoadID",b="_internal/externalEventCount";class E{constructor(t,e,n){this.globalContext=t,this.rootName=e,this.dispatcher=n}getAccounts(){return this.globalContext[this.rootName]}createUserspaceRoot(){null==this.getAccounts()&&(this.globalContext[this.rootName]=new Map)}createSystemAccount(){!1===this.getAccounts().has(h)&&(this.getAccounts().set(h,{queue:[],store:new Map}),new v(this.globalContext,this.rootName).store.set(w,Math.random()))}observeRootSet(){const t=this;this.getAccounts().set=function(e,n){Map.prototype.set.apply(this,[e,n]),t.equip()}}observeAccountQueuesPush(){const t=this;this.getAccounts().forEach((e=>{e.queue.push=function(...e){Array.prototype.push.apply(this,e),t.dispatcher.t({reason:{method:a.push,events:e}})}}))}overwriteAccountStoresGet(){this.getAccounts().forEach((t=>{t.store.get=function(...t){return Map.prototype.get.apply(this,t)}}))}defineConvenienceFunctions(){const t=(t,e,n)=>{const o=this.getAccounts().get(t);void 0!==o&&o.queue.push(new CustomEvent(e,{detail:n??{}}))},e=this.globalContext[this.rootName];e.triggerFor=t,e.trigger=(e,n)=>{t(h,e,n)},void 0===e._private&&(e._private={}),e._private.CookieStorage=l}equip(){try{this.createUserspaceRoot(),this.createSystemAccount(),this.observeRootSet(),this.observeAccountQueuesPush(),this.overwriteAccountStoresGet(),this.defineConvenienceFunctions()}catch(t){throw new v(this.globalContext,this.rootName).recordErrorEvent({id:"Core.library.Equiper.equip",error:t}),t}}}var S;!function(t){t.info="info",t.warn="warn",t.error="error"}(S||(S={}));class x{static Instance(){return this.o}static SessionId(){return this.i}info(...t){const e=new Date(Date.now()),n=S.info;return console.log(this.getPrefix(e,n),...t),{timestamp:e,logLevel:n}}warn(...t){const e=new Date(Date.now()),n=S.warn;return console.warn(this.getPrefix(e,n),...t),{timestamp:e,logLevel:n}}error(...t){const e=new Date(Date.now()),n=S.error;return console.error(this.getPrefix(e,n),...t),{timestamp:e,logLevel:n}}getPrefix(t,e){return`${t.toISOString()} | ${x.SessionId()} | [${e.toUpperCase()}]`}}x.o=new x,x.i=`${Date.now()}`;const _=x.Instance(),R="26.519.2009",I=t=>void 0===t||!Array.isArray(t)||(()=>{let e,n=window;do{try{const e=n?.location?.hostname;if(e&&(o=e,t.includes(o)))return!0}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name||t instanceof Error&&t.message.includes("cross-origin frame")))throw t;if(Math.random()<.001)throw t}if(n===window.top)break;e=n,n=n.parent}while(e!==n&&e!==window.top);var o;return!1})();function A(t){return!(t>=1||Number.isNaN(t))&&(t<=0||Math.random()>=t)}function k(){try{return!!new URLSearchParams(window.top?.location.search??window.location.search).has("apscoredebug")||(window._aps?.get("_system").store.get("_internal/coreDebugMode")??!1)}catch{return!1}}const j={key:"_internal/eventSources",default:new Map},$={key:"_internal/processedEventSources",default:new Set},C={key:"analytics/sampleRateFactors",default:void 0},O=[c.completed,c.error,c.cancelled,c.analytics];class P{constructor(t,e){this.globalContext=t,this.rootName=e}l(t){return t.store.get("_config/events/deactivations")??new Set}p(t,e){return!0===this.l(t).has(e.type)||((t,e)=>{try{const e=t.detail?.restrictions?.allow?.hostnames;if(void 0!==e&&!I(e))return!0;const n=t.detail?.restrictions?.block?.hostnames;if(void 0!==n&&I(n))return!0}catch(t){return e.recordErrorEvent({id:"hostnames",error:new Error(t)}),!1}return!1})(e,t)||(t=>{const e=t?.detail?.restrictions?.allow?.libraryVersions,n=t?.detail?.restrictions?.block?.libraryVersions;return!(!Array.isArray(n)||!n.includes(R))||!(!Array.isArray(e)||e.includes(R))})(e)||((t,e)=>{const n=t?.detail?.restrictions?.allow?.accounts,o=t?.detail?.restrictions?.block?.accounts;return!(!Array.isArray(o)||!o.includes(e.id))||!(!Array.isArray(n)||n.includes(e.id))})(e,t)||((t,e)=>{const n=(t=>{if(!t)return null;const e=Number(t);return!Number.isNaN(e)&&Number.isInteger(e)&&e>=0?o.ManagedWeb:o.SelfServeWeb})(e.id);if(null===n)return!1;const a=t?.detail?.restrictions?.allow?.accountTypes,i=t?.detail?.restrictions?.block?.accountTypes;return!(!Array.isArray(i)||!i.includes(n))||!(!Array.isArray(a)||a.includes(n))})(e,t)||(t=>{const e=t?.detail?.restrictions?.allow?.rate??1;return!(!A(t?.detail?.restrictions?.block?.rate??1)&&!A(e))})(e)}m(){return new v(this.globalContext,this.rootName).store.get(y)??new Map}v(t){return t.store.get("listeners")??new Map}S(t,e){return this.m().get(e.type)||this.v(t).get(e.type)}_(t){const e=this.R(b);return(void 0===t.externalEventCount||t.externalEventCount{setTimeout((()=>n(new Error(`Event "${e.type}" timed out`))),e.detail.timeout)})))}j(t,e){const n=new v(this.globalContext,this.rootName),o=n.read(t)??0;n.write(t,o+e)}$(t){new v(this.globalContext,this.rootName).write(t,0)}R(t){return new v(this.globalContext,this.rootName).read(t)??0}C(t,e,n,o,i){if(!(e in c))throw new Error(`Listener returned invalid status: ${t.type} returned ${e}`);if(this.O(t,e,o,i),e!==c.waiting&&void 0!==t.detail?.resolve)try{t.detail.resolve(n)}catch(t){_.error(t)}e!==c.waiting&&this.P(t,o),this.t({reason:{method:a.listenerSuccess,events:[t]}})}P(t,e){const n=this.S(e,t);!0===n?.shouldFlushAnalytics&&vt.flush()}D(t,e,n){void 0!==e&&"string"!=typeof e||(e=new Error(e)),this.O(t,c.error,n),this.T(t,e),e.context=t.type,n.recordErrorEvent({id:t.type,analyticsSampleRateAdjustFactor:this.N(t),error:e}),this.P(t,n)}L(t,e,n,o){const a=this.S(n,e);if(void 0===a)throw new Error(`No listener found for event: ${e.type}`);t.push(a({customEvent:e,account:n,systemAccount:o,detail:e.detail,context:n.globalContext}))}M(t,e,n){Promise.race(t).then((t=>{let o,a,i;void 0===t?o=s.completed:"string"==typeof t?o=t:"object"==typeof t&&(o=t.status,a=t.value,i=t.analytics,!0===e.detail?.surfaceAnalytics&&(void 0===a&&(a={}),a.analytics=i)),this.C(e,o,a,n,i)})).catch((t=>{this.D(e,t,n)}))}U(t,e,n){const o=[];this.L(o,t,e,n),this.A(o,t),this.M(o,t,e)}q(t,e){if(void 0!==t.status)return;const n=t.detail?.error;if(void 0!==n){t.status=c.error;const o=this.V(n),a={id:t.type,analyticsSampleRateAdjustFactor:this.N(t),error:o,props:{...t.detail.analytics,eventDetailSource:t.detail.source}};"string"==typeof t.detail.libraryVersion&&(a.libraryVersion=t.detail.libraryVersion),e.recordErrorEvent(a)}}V(t){let e;if(t instanceof Error)e=t;else if("string"==typeof t)e=new Error(t);else if("object"==typeof t&&null!==t){let n="Error object";if("message"in t&&"string"==typeof t.message)n=t.message;else if("error"in t&&"string"==typeof t.error)n=t.error;else try{n=JSON.stringify(t),n.length>500&&(n=n.substring(0,497)+"...")}catch{n=`Complex error object of type ${t.constructor?.name||"unknown"}`}e=new Error(n),e.originalError=t}else e=new Error(`Error value: ${String(t)}`);return e}F(t,e){if(void 0!==t.status)return;const n=t.detail?.analytics;void 0!==n&&(t.status=c.analytics,e.recordStatusChangeEvent({id:t.type,status:t.status,analyticsSampleRateAdjustFactor:this.N(t),props:{...n}}))}B(t,e){this.p(e,t)&&this.O(t,c.deactivated,e)}J(t,e){void 0===t.status&&void 0===this.S(e,t)&&this.O(t,c.unknown,e)}T(t,e){if(k()&&_.error(e),void 0!==t.detail?.reject)try{t.detail.reject(e)}catch(t){_.error(t)}}H(t,e){const n=new Error(`Invalid account ID: "${e.id}"`);this.D(t,n,e)}static G(t){return"string"==typeof t&&!["","undefined","true","false"].includes(t.trim())}K(t,e,n){P.G(e.id)?(this.q(t,e),this.F(t,e),this.J(t,e),this.B(t,e),this.I(t)&&(this.O(t,c.started,e),k()&&_.info(`## Execute event: ${t.type} with initial status ${t.status??"undefined"}`),this.U(t,e,n))):this.H(t,e)}W(t){const e=new v(this.globalContext,this.rootName).use(j),n=t.use($);e.forEach(((e,o)=>{if(n.has(o))return;const a=e.map((([t,e])=>new CustomEvent(t,{detail:e})));t.queue.unshift(...a),t.update($,(t=>t.add(o)))}))}Y(t,e,n){this.W(t),t.queue.forEach((n=>this.K(n,t,e)))}Z(t,e){t.status=e,t.statusEvents=null!=t.statusEvents?t.statusEvents:[],t.statusEvents.push(new CustomEvent(e))}N(t){if(t.detail?.analyticsSampleRateAdjustFactor)return t.detail.analyticsSampleRateAdjustFactor;const e=new v(this.globalContext,this.rootName).use(C);return e?.get(t.type)}X(t,e,n,o){const a=new CustomEvent("now").timeStamp,i=t.statusEvents?.find((t=>t.type===c.started)),s=null!=i?a-i.timeStamp:void 0;n.recordStatusChangeEvent({id:t.type,status:e,analyticsSampleRateAdjustFactor:this.N(t),props:{...o,source:t.detail?.source,timers:{sinceCreated:a-t.timeStamp,sinceStarted:s}}})}O(t,e,n,o){t.status!==e&&(k()&&_.info(`### Update ${t.type} from ${t.status??"undefined"} to ${e}`),this.Z(t,e),this.X(t,e,n,o))}tt(){const t=new Map;return this.globalContext[this.rootName].forEach(((e,n)=>t.set(n,new f(n,{globalContext:this.globalContext,rootName:this.rootName})))),t}et(t){if(k())return;const e=t.store.get(g)??[];if(e.length>150){const n=e.slice(-100);t.store.set(g,n)}}nt(t){const e=t.store.get(g)??[];e.push(...t.queue.filter((t=>void 0!==t.status&&O.includes(t.status)))),t.store.set(g,e)}ot(t){t.queue.splice(0,t.queue.length,...t.queue.filter((t=>void 0===t.status||!O.includes(t.status))))}it(){this.tt().forEach((t=>{this.nt(t),this.et(t),this.ot(t)}))}st(t){return t?.filter((t=>t.detail?.source!==i.internal&&t.detail?.source!==i.apstag&&t.status!==c.waiting))}rt(t){const e=this.st(t);return e?.length??0}ct(t){const e=this.rt(t);this.j(b,e)}lt(){const t="_internal/recentDispatches";this.j(t,1);const e=this.R(t);if(e>1e4)throw new Error("Too many dispatches. Aborting");e%100==0&&new v(this.globalContext,this.rootName).recordGenericEvent({id:"C.l.D.thr",props:{recentDispatchesCount:e}}),setTimeout((()=>{this.$(t)}),100)}t({reason:t}){try{this.lt(),k()&&_.info(`# Dispatch from method "${t.method}" on event "${t.events?.[0].type??"undefined"}" with source "${t.events?.[0].detail?.source??"undefined"}"\n_________________________________________`),this.ct(t.events);const e=new v(this.globalContext,this.rootName);this.tt().forEach((n=>this.Y(n,e,t))),this.it()}catch(t){throw new v(this.globalContext,this.rootName).recordErrorEvent({id:"C.l.D.dis",error:t}),t}}}class D{constructor(t,e){this.globalContext=t,this.rootName=e}subscribe(t){try{const e=new v(this.globalContext,this.rootName),n=null!=e.store.get(y)?e.store.get(y):new Map;e.store.set(y,new Map([...n,...t]))}catch(t){throw new v(this.globalContext,this.rootName).recordErrorEvent({id:"Core.library.Subscriber.subscribe",error:t}),t}}}class T{constructor(t,e){this.globalContext=t,this.rootName=e}populate(){try{const t=new v(this.globalContext,this.rootName);let e=!1;try{e=JSON.parse(t.read(n))}catch{}if(e)return;t.write(n,JSON.stringify(!0)),this.populateFromPrependStore(),this.populateFromQueryParams()}catch(t){new v(this.globalContext,this.rootName).recordErrorEvent({id:"Core.library.Populator.populate",error:t})}}populateFromPrependStore(){this.globalContext[this.rootName].forEach(((t,n)=>{const o=new f(n,{globalContext:this.globalContext,rootName:this.rootName}),a=o.read(e,{persist:!0})??"[]";o.write(e,JSON.stringify([]));try{const t=JSON.parse(a);if(0===t.length)return;o.queue.push(...t.map(L))}catch(t){console.error("Error processing prepended events",t)}}))}populateFromQueryParams(){const t=this.globalContext?.location?.search,e=new URLSearchParams(t),n=this.globalContext[this.rootName],o=n.get(h);N(e,"aps.trigger").forEach((t=>{o.queue.push(L(t))})),N(e,"aps.triggerFor",!0).forEach((t=>{void 0!==t.accountId&&n.has(t.accountId)&&n.get(t.accountId).queue.push(L(t))}));const a=N(e,"aps_event");n.forEach((t=>{a.forEach((e=>{t.queue.push(L(e))}))}))}}const N=(t,e,n=!1)=>{const o=t.getAll(e),a=[];return o.forEach((t=>{const e=t.split(",");let o;n&&(o=e.shift());const i=e.shift();if(void 0!==i&&i.length>0){const t=decodeURIComponent(e.join(","));let n;if(t.length>0)try{n=JSON.parse(t)}catch{console.error("Error processing query param event",i,n)}a.push({eventName:i.replace(/_/g,"/"),eventDetail:n,accountId:o})}})),a},L=t=>new CustomEvent(t.eventName,{detail:{...t.eventDetail??{}}}),M=window;class U{constructor(t,e,n){this.ID=t,this.rootName=n,this.globalContext=e,this.clear()}clear(){new v(this.globalContext,this.rootName).update(j,(t=>(t.delete(this.ID),t)))}recordListener(t,e){new v(this.globalContext,this.rootName).update(j,(n=>{const o=n.get(this.ID);return void 0!==o?o.push([t.name,e]):n.set(this.ID,[[t.name,e]]),n}))}}class q{constructor(t=M,e="_aps"){this.dispatcher=new P(t,e),this.equiper=new E(t,e,this.dispatcher),this.subscriber=new D(t,e),this.populator=new T(t,e),this.globalContext=t,this.rootName=e}createAccount(t){if(void 0===t)throw new Error("accountID must be provided");this.globalContext[this.rootName]=this.globalContext[this.rootName]??new Map;const e=this.globalContext[this.rootName],n={store:new Map,queue:[]};return!1===e.has(t)&&e.set(t,n),new f(t,{globalContext:this.globalContext,rootName:this.rootName})}subscribe(t){this.subscriber.subscribe(t)}equip(){this.equiper.equip()}dispatch({reason:t}){this.dispatcher.t({reason:t})}populate(){this.populator.populate()}load({listeners:t}){this.equip(),this.subscribe(t),this.dispatch({reason:{method:a.direct}}),this.populate()}registerEventSource(t){return this.equip(),new U(t,this.globalContext,this.rootName)}}var V;!function(t){t.postulate="postulate",t.genericError="error"}(V||(V={}));const F="26.519.2009";function B(t,e,n){const o=new URL("https://prod.tahoe-analytics.publishers.advertising.a2z.com/logevent/putRecord");let a=t;try{"web-client-scenarios.aps.amazon.dev"===n?.hostname?a=t+"-debug-only":window.Cypress&&(a=t+"-integration-test")}catch(t){}const i={...n,eventSource:"aps_web_client_library",eventCategory:a,eventName:e,libraryVersion:F};Object.entries(i).forEach((([t,e])=>{o.searchParams.append(t,e)})),fetch(o.toString(),{method:"GET",keepalive:!0,headers:{"x-api-key":"79db72eb0b5c7255afa54a253df24fb4a5ac916bf40b51c730df8850aa5665ca"}}).catch((()=>{}))}const z={ut:setInterval,ft:function(){return window[J]?.[H]},ht:function(t=window){try{return t.top?.location||{href:"unknown",hostname:"unknown"}}catch(t){return{href:"unknown",hostname:"unknown"}}},vt:B,yt:function(t,e){return{eventTime:G((()=>`${Date.now()}`)),accountID:G((()=>t?.accountID)),libraryVersion:F,url:G((()=>e().href)),hostname:G((()=>e().hostname)),message:G((()=>t?.message)),condition:G((()=>t?.condition))}},gt:function(t,e){try{(e??B)(V.genericError,"telemetry_core_failure",{errorName:t?.name??"unknown",errorMessage:t?.message??"unknown"})}catch{(e??B)(V.genericError,"telemetry_core_failure")}}},J="_aps_telemetry",H="alarms";function G(t){try{return t()??"undefined"}catch(t){return function(t){try{return t instanceof Error?`Access Error: ${t.name} - ${t.message}`:"Access Error: Unknown error type"}catch{return"Access Error: Unable to provide more information"}}(t)}}function K(t,e,n){const o=()=>!1;throw n||function(t,e,n){const o=window;void 0===o[J]&&(o[J]={}),void 0===o[J][H]&&(o[J][H]=[]);const a=o[J][H],i=e.toString();a.push({hash:t,context:{...n,condition:i}})}(t,o,e),new Error(e?.message??`Postulate violation: ${t}, ${o}`)}const W=new WeakMap;function Q({debugKey:t,obj:e,validators:n,root:o,separator:a}){o=o??"root",a=a??".";const i={nonModifiable:{set(t,e){throw new Error(`Cannot set property "${String(e)}": "${o}" is not marked as modifiable.`)},deleteProperty(t,e){throw new Error(`Cannot delete property "${String(e)}": "${o}" is not marked as modifiable.`)},defineProperty(t,e){throw new Error(`Cannot define property "${String(e)}": "${o}" is not marked as modifiable.`)},setPrototypeOf(t){throw new Error(`Cannot set prototype: "${o}" is not marked as modifiable.`)}},modifiable:{set(t,e,n,o){try{return Reflect.set(t,e,n,o)}catch(o){if("TypeError"===o.name)return t[e]=n,!0;throw o}}},validating:{get(e,i,s){if("raw"===i)return W.get(s)||e;if("symbol"==typeof i)return Reflect.get(e,i,s);if((t=>{if(["asymmetricMatch","nodeType"].includes(t))return!0})(i))return Reflect.get(e,i,s);let r;try{r=Reflect.get(e,i,s)}catch(t){if("TypeError"!==t.name)throw t;r=e[i]}return Q({obj:r,validators:n,root:`${o}${a}${String(i)}`,debugKey:t})},ownKeys:t=>Reflect.ownKeys(t).filter((t=>{const e=`${o}${a}${String(t)}`;return void 0!==n[e]}))},function:{apply:(e,a,i)=>{const s=W.has(a)?W.get(a):a;return Q({obj:e.apply(s,i),validators:n,root:`${o}()`,debugKey:t})},get:(t,e,n)=>"raw"===e?W.get(n)||t:Reflect.get(t,e,n)}},s=function(a){if(!1===a.verifiable)return e;if(e instanceof Set)return e.forEach((e=>{Q({obj:e,validators:n,root:`${o}.value`,debugKey:t})})),e;if(e instanceof Map)return e.forEach(((e,a)=>{Q({obj:a,validators:n,root:`${o}.key`,debugKey:t}),Q({obj:e,validators:n,root:`${o}.value`,debugKey:t})})),e;if(Array.isArray(e))return e.map((e=>Q({obj:e,validators:n,root:`${o}[]`,debugKey:t})));if("function"==typeof e){const t=new Proxy(e,i.function);return W.set(t,e),t}const s={...i.validating,...a?.modifiable?i.modifiable:i.nonModifiable};try{const t=new Proxy(e,s);return W.set(t,e),t}catch(t){if("TypeError"===t.name)return e;throw t}}(function(){const a=(t??"").length>0?`Location: ${t} - `:"",i=n[o??""];if(void 0===i){const t=".constructor"===(o??"").slice(-12)||".toString"===(o??"").slice(-9);K("ea3914",{message:`${a}Unauthorized usage for "${o}": No validator has been defined`},t)}if(null===i)return{verifiable:!1};let s;try{s=i(e,o)}catch(t){let n="Error, could not convert to string";try{n="string"==typeof e?'"'+e+'"':null!=e&&"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e)}catch(t){}throw new Error(`${a}Validation failed for "${o}": ${t.message} - Received: ${n}`)}return s??{}}());return s}const Y=t=>{if("number"!=typeof t)throw new Error("must be a number")},Z=t=>{if("string"!=typeof t)throw new Error("must be a string")},X=t=>{if("boolean"!=typeof t)throw new Error("must be a boolean")},tt=t=>{if("object"!=typeof t||null===t||Array.isArray(t))throw new Error("must be a standard object")};function et(t){if(void 0!==t?.min&&(t.min<0||t.min>1))throw new Error("min option must be between 0 and 1");if(void 0!==t?.max&&(t.max<0||t.max>1))throw new Error("max option must be between 0 and 1");const e=t?.min??0,n=t?.max??1;if(e>n)throw new Error("min option cannot be greater than max option");return t=>{if("number"!=typeof t)throw new Error("must be a number");if(tn)throw new Error(`must be a percentage between ${e} and ${n} (where 1 = 100%)`)}}const nt=t=>e=>{let n=!1;for(const o of t)try{o(e),n=!0}catch(t){}if(!n)throw new Error("None of the validators passed")},ot=t=>{if(!Array.isArray(t))throw new Error("must be an array")};function at(t){return e=>{if(!1===t.includes(e))throw new Error(`must be one of the following values: ${JSON.stringify(t)}`)}}function it(t){return(e,n)=>({modifiable:!0,...t(e,n)})}function st(t){return(e,n)=>{if(t===ct)throw new Error("isAny cannot be used within isOptional");if(null!=e)return t(e,n)}}const rt=t=>{if("function"!=typeof t)throw new Error("must be a function")},ct=()=>{},dt=()=>({verifiable:!1}),lt=t=>{if(void 0!==t)throw new Error("must be undefined")};class ut{constructor(t){const{scope:e,object:n,action:o,validators:a,handler:i,shouldFlushAnalytics:s}=t,r=`${e}/${n}/${o}`;this.throwIfInvalid(e,n,o),this.name=`${e}/${n}/${o}`,this.handler=this.wrapHandler({handler:i,validators:a,debugKey:r}),!0===s&&(this.handler.shouldFlushAnalytics=!0)}wrapHandler({debugKey:t,handler:e,validators:n}){return async o=>{let a=o;return a={...a,detail:Q({obj:a.customEvent.detail,validators:this.getDetailValidators(n),root:"detail",debugKey:t}),context:Q({obj:a.account.globalContext,validators:this.getContextValidators(n),root:"context",debugKey:t})},await e(a)}}getDetailValidators(t){return t?.detail&&0!==Object.keys(t.detail).length?t.detail:{detail:ct}}getContextValidators(t){return t?.context&&0!==Object.keys(t.context).length?t.context:{context:ct}}throwIfInvalid(t,e,n){if(["consent/gppapi/attemptSync","consent/gppapi/didChange","consent/gppapi/syncData","consent/tcfapi/attemptSync","consent/tcfapi/didChange","log/analytics/setInterval","analytics/sampling/set"].includes(`${t}/${e}/${n}`))return;const o=/^[a-z0-9][a-zA-Z0-9]*$/;if(!o.test(t)||!o.test(e)||!o.test(n))throw new Error(`scope, object, and action must be alphanumeric and start with a lowercase. Received: ${t}, ${e}, ${n}`);if(/[A-Z]/.test(n)&&!/^(will|did)/i.test(n))throw new Error(`action must be a single verb (or a single verb prefixed by 'will' or 'did'). Received: ${n}`)}}function pt(t){if(new Set(t.map((t=>t.name))).size!==t.length)throw new Error("Duplicates found");return new Map(t.map((t=>[t.name,t.handler])))}class mt{constructor(){this.wt=300,this.bt="https://prod.tahoe-analytics.publishers.advertising.a2z.com/logevent/putRecords",this.Et="79db72eb0b5c7255afa54a253df24fb4a5ac916bf40b51c730df8850aa5665ca",this.St=5e3,this.xt=[],this.clearAndUpdateEventProcessingInterval(5e3)}logEvent(t){try{const n=`${Date.now()}`,o=null==(e=t.eventSampleRate)||isNaN(e)||e<0?0:e>=0&&e<=1?e:1,a={Data:{eventSource:"aps_web_client_library",eventTime:n,eventCategory:t.eventCategory,eventName:t.eventName,eventSampleRate:o,eventProperties:{...t.eventProperties,eventSampleRate:`${o}`}},PartitionKey:n};this.xt.push(a)}catch(t){K("4daf34",{message:t.message})}var e;this.xt.length>this.St&&this.safelyProcessRecordQueue()}flush(){this.safelyProcessRecordQueue()}clearAndUpdateEventProcessingInterval(t){"number"!=typeof t||t<=0||t!==this._t&&(clearInterval(this.Rt),this.Rt=setInterval((()=>this.safelyProcessRecordQueue()),t),this._t=t)}safelyProcessRecordQueue(){if(void 0===this.xt||this.xt.length<=0)return;const t=this.xt.filter((t=>void 0!==t&&t.Data.eventSampleRate>=Math.random()));this.xt.length=0,t.length<=0||this.batchSendRecords(t).catch((t=>{this.logEvent({eventCategory:"error",eventName:"tahoe/putRecords/didFail",eventSampleRate:1,eventProperties:{error:{message:t?.message}}})}))}batchSendRecords(t){const e=[];for(let n=0;nt.map((t=>({...t,Data:window.btoa(JSON.stringify(t.Data))}))))(t)})})}}const ft={key:"_config/requestViewer/countryCode",default:"unknown"},ht={key:"video/analytics",default:void 0},vt=new class{constructor(){this.STACK_MAX_LENGTH=500,this.It=.001,this.At=1e-4,this.kt=new mt}getVideoPlayerMetadata(t){const e=t.account?.use(ht,{structuredClone:!1}),n="object"==typeof t.props?.legacyPlayerEventProps;return e?.getMetadata&&!n?{legacyPlayerEventProps:e.getMetadata()}:{}}fireReferencePixel(t,e){this.logCoreError({id:`REFERENCE-${t}`,error:new Error(`REFERENCE-${t}`),analyticsSampleRateAdjustFactor:e??{status:.01,error:.01},account:null})}logCoreError(t){this.logError({...t,isCore:!0})}logCoreFeature(t){this.logFeature({...t,isCore:!0})}logError(t){if(void 0===t)return;const e=this.getEventSampleRate({eventCategory:"error",rateFactor:{error:t.analyticsSampleRateAdjustFactor?.error,status:t.analyticsSampleRateAdjustFactor?.status}});this.kt.logEvent({eventCategory:"error",eventName:t.id??"unknown",eventSampleRate:e,eventProperties:{...t.props,...this.getSharedEventProperties(t),error:{name:this.getErrorName(t.error),message:this.getErrorMessage(t.error),stack:this.getStackTraceMessage(t.error),context:this.getErrorContext(t.error)}}})}logFeature(t){if(void 0===t)return;const e=this.getEventSampleRate({eventCategory:"feat",rateFactor:{error:t.analyticsSampleRateAdjustFactor?.error,status:t.analyticsSampleRateAdjustFactor?.status}});this.kt.logEvent({eventCategory:"feat",eventName:t.id??"unknown",eventSampleRate:e,eventProperties:{...t.props,...this.getSharedEventProperties(t),status:t.feature}})}flush(){this.kt.flush()}setEventProcessingInterval(t){if("number"!=typeof t)throw new Error("Event processing interval must be a number.");this.kt.clearAndUpdateEventProcessingInterval(t)}setEventSamplingRates(t){const e=t=>t<0?0:t>=0&&t<=1?t:1;"number"==typeof t?.error&&(this.It=e(t.error)),"number"==typeof t?.feature&&(this.At=e(t.feature))}getEventSampleRate(t){let e=0;return e="error"===t.eventCategory?this.It*(t.rateFactor?.error??1):this.At*(t.rateFactor?.status??1),Number.isNaN(e)||e<0?0:e>=0&&e<=1?e:1}getSharedEventProperties(t){return{isCore:t.isCore??!1,accountID:this.safelyGetAccountID(t.account),libraryVersion:t.libraryVersion??R,url:this.getLocationHref(),hostname:this.getLocationHostname(),viewerCountryCode:this.getViewerCountryCode(t.account),...this.getVideoPlayerMetadata(t)}}safelyGetAccountID(t){let e="unknown";try{void 0!==t?.id&&(e=t.id)}catch(t){try{e=`Client Error: ${t.name.toString()} - ${t.message}`}catch{e="Client Error: Unable to provide more information"}}return e}getLocationHref(){let t="";try{t=window.top?.location?.href??""}catch(e){try{t=`Client Error: ${e.name.toString()} - ${e.message}`}catch{t="Client Error: Unable to provide more information"}}return t}getLocationHostname(){let t="";try{t=window.top?.location?.hostname??""}catch(e){try{t=`Client Error: ${e.name.toString()} - ${e.message}`}catch{t="Client Error: Unable to provide more information"}}return t}getViewerCountryCode(t){let e="unknown";try{null!==t&&(e=t.use(ft))}catch(t){try{e=`Client Error: ${t.name.toString()} - ${t.message}`}catch{e="Client Error: Unable to provide more information"}}return e}getStackTraceMessage(t){try{if("string"==typeof t)return"NO STACK: ERROR PASSED AS STRING";if(void 0===t.stack)return"NO STACK: error.stack IS UNDEFINED";if(t.stack.length>this.STACK_MAX_LENGTH){const e="[...]";return t.stack.substring(0,this.STACK_MAX_LENGTH-e.length)+e}return t.stack}catch(t){return"NO STACK: ERROR ON RETRIEVAL"}}getErrorName(t){let e="unknown";try{"string"==typeof t?e=t:void 0!==t.name&&(e=t.name)}catch(t){try{e=`Client Error: ${t.name.toString()} - ${t.message}`}catch{e="Client Error: Unable to provide more information"}}return e}getErrorMessage(t){let e="unknown";try{"string"==typeof t?e=t:void 0!==t.message&&(e=t.message)}catch(t){try{e=`Client Error: ${t.name.toString()} - ${t.message}`}catch{e="Client Error: Unable to provide more information"}}return e}getErrorContext(t){let e="unknown";try{"string"!=typeof t&&"context"in t&&(e=t.context??"")}catch(t){try{e=`Client Error: ${t.name.toString()} - ${t.message}`}catch{e="Client Error: Unable to provide more information"}}return e}},yt=new Map([["_config/config/didLoad",async({account:t,customEvent:e})=>(t.write("config/loaded",!0),s.completed)],["_config/requestViewerCountry/define",async({account:t,customEvent:e})=>{if(void 0===e.detail?.code)throw new Error("Missing country code");const{code:n}=e.detail;if("string"!=typeof n||0===n.trim().length)throw new Error(`Invalid country code: "${n}"`);return t.update(ft,(()=>n)),s.completed}]]),gt="apstag/configuration/fetch",wt=new Map([[gt,async({account:t,customEvent:e})=>{const n=t.globalContext.document.createElement("script");return n.setAttribute("src",`https://config.aps.amazon-adsystem.com/configs/${t.id}`),n.setAttribute("type","text/javascript"),n.setAttribute("async","async"),t.globalContext.document.head.appendChild(n),await new Promise(((t,e)=>{n.addEventListener("load",(()=>{t()})),n.addEventListener("error",(t=>{e(t)}))})),s.completed}]]),bt="consent/GPPData",Et="consent/isGPPListenerRegistered";var St=new ut({scope:"consent",object:"gppapi",action:"syncData",validators:{detail:{detail:tt,"detail.fromAddEvent":st(X),"detail.eventListener":st(tt),"detail.eventListener.pingData":st(tt),"detail.eventListener.pingData.gppString":st(Z),"detail.eventListener.pingData.gppVersion":st(nt([Z,Y])),"detail.eventListener.pingData.cmpId":st(nt([Z,Y])),"detail.eventListener.pingData.applicableSections":ot,"detail.eventListener.pingData.applicableSections[]":nt([Z,Y])}},handler:async({account:t,detail:e})=>{let n,o,a,i;(e?.eventListener?.pingData?.gppString??"").length>0?(n=e?.eventListener?.pingData,i="addEventListener"):([n,a]=(t=>{let e,n;try{const n=t.globalContext.__gpp("ping",((t,n)=>{n&&"object"==typeof t&&(e=t)}));void 0===e&&(n?.gppString??"").length>0&&(e=n)}catch(t){n=`E:ping: ${t}`}return[e,n]})(t),i="ping","object"!=typeof n&&([n,o]=(t=>{let e,n;try{const n=t.globalContext.__gpp("getGPPData");e={...n,...n.pingData}}catch(t){n=`E:getGPPData: ${t}`}return[e,n]})(t),i="getGPPData"));const r={gpp:{gppLength:"string"==typeof n?.gppString?n.gppString.length:void 0,isGPPTilde:(n?.gppString??"").includes("~"),error10:o,error:a,gppVersion:n?.gppVersion,cmpId:n?.cmpId,method:i,fromAddEvent:e?.fromAddEvent}};return t.write(bt,n),{status:s.completed,analytics:r}}}),xt=new ut({scope:"consent",object:"gppapi",action:"didChange",validators:{detail:{detail:tt,"detail.fromAddEvent":st(X),"detail.eventListener":st(tt),"detail.eventListener.pingData":st(tt),"detail.eventListener.pingData.gppString":st(Z),"detail.eventListener.pingData.gppVersion":st(nt([Z,Y])),"detail.eventListener.pingData.cmpId":st(nt([Z,Y])),"detail.eventListener.pingData.applicableSections":ot,"detail.eventListener.pingData.applicableSections[]":nt([Z,Y])}},handler:async({account:t,detail:{eventListener:e,fromAddEvent:n}})=>(await t.recordListener(St,{eventListener:e,fromAddEvent:n}),{status:s.completed})}),_t=new ut({scope:"consent",object:"gppapi",action:"attemptSync",handler:async({account:t})=>{if(void 0===t.globalContext.__gpp||!0===t.read(Et))return{status:s.cancelled};await t.recordListener(St);const e=t.globalContext.__gpp("addEventListener",(e=>{"error"!==e?.eventName&&t.recordListenerNonBlocking(xt,{eventListener:e,fromAddEvent:!0})}));return t.write(Et,"listenerRegistered"===e?.eventName&&!0===e?.data),{status:s.completed}}});const Rt={key:"consent/isTCFAPIListenerRegistered",default:!1},It={key:"consent/TCData",default:void 0};function At(t,e){return"string"==typeof e?.tcString&&e?.tcString.length>0||!0===t?.globalContext?.apstag?.isGDPRRegion||!0===e?.gdprApplies}function kt(t,e){return!0===t.vendor?.consents?.[793]&&(n=e,o=t.purpose?.consents,(n??[]).reduce(((t,e)=>t&&!0===o?.[e]),!0));var n,o}var jt=new ut({scope:"consent",object:"tcfapi",action:"didChange",validators:{detail:{detail:tt,"detail.success":st(X),"detail.tcData":st(dt)}},handler:async({account:t,detail:{success:e,tcData:n}})=>(t.update(Rt,(t=>t||!0===e)),t.update(It,(t=>void 0!==n||!0===e?n:t)),"object"!=typeof n?{status:s.completed}:{status:s.completed,analytics:$t(t,n)})});const $t=(t,e)=>{const n={tcData:e,consents:[1]},o=t=>{try{return t()}catch{return"error"}};return{tcT:o((()=>t.isAPStagAllowedToAccessInfoOnDevice())),tcCC:o((()=>function({account:t,tcData:e,consents:n}){if(!At(t,e))return!0;if("object"!=typeof e)return!1;if((e.tcfPolicyVersion??0)<2)return!1;if(e.useNonStandardStacks)return!1;if(!e.isServiceSpecific)return!1;let o=!1;return n.forEach((t=>{const a=e.publisher?.restrictions?.[t]?.[793];switch(a){case 0:case 2:o=!0;break;default:kt(e,n)||(o=!0)}})),!o}({...n,account:t}))),tcCF:o((()=>0===function({tcData:t,consents:e}){if(0===(e??[]).length)return["No consents param passed"];const n=[];try{if("object"!=typeof t){let e="";try{e=JSON.stringify(t)}catch{}n.push(`Invalid tcData: ${e}`)}return!1===t.gdprApplies?[]:((t.tcfPolicyVersion??0)<2&&n.push(`tcData version not supported: ${t.tcfPolicyVersion}`),t.useNonStandardStacks&&n.push("tcData's useNonStandardStacks should not be true"),t.isServiceSpecific||n.push("tcData needs to be service specific"),e.forEach((o=>{const a=t.publisher?.restrictions?.[o]?.[793];switch(a){case 0:n.push(`Invalid publisher restrictions 0, consent ${o}`);break;case 2:n.push(`Invalid publisher restrictions 2, consent ${o}`);break;default:kt(t,e)||n.push(`Invalid publisher restrictions default, consent ${o}`)}})),n)}catch(t){if(n.length>0)return n;throw t}}(n).length)),PRA:o((()=>At(t,e)))}};var Ct=new ut({scope:"consent",object:"tcfapi",action:"attemptSync",handler:async({account:t})=>{const e=t.use(Rt);return void 0===t.globalContext.__tcfapi||e?{status:s.cancelled}:(t.globalContext.__tcfapi("addEventListener",2,((e,n)=>{t.recordListenerNonBlocking(jt,{tcData:e,success:n})})),{status:s.completed})}});const Ot=pt([_t,xt,St,Ct,jt]),Pt="vnd_prx_segments",Dt="aps_targeting_comscore";var Tt=new ut({scope:"cxm",object:"comscore",action:"set",handler:async({account:t,customEvent:e})=>({status:Nt(t)})});const Nt=t=>{const e=t.readSessionStorage(Dt);if(t.deleteSessionStorage(Dt),null==e)return s.cancelled;try{const n=JSON.parse(e)[Pt];if(null==n)throw new Error;const{googletag:o}=t.globalContext;return o.pubads().getSlots().forEach((t=>{t.setTargeting(Pt,n)})),s.completed}catch(t){throw new Error(`Malformed targeting object at ${Dt}`)}},Lt="aps_targeting_ias";var Mt=new ut({scope:"cxm",object:"ias",action:"set",handler:async({account:t,customEvent:e})=>({status:Ut(t)})});const Ut=t=>{const e=(t=>{const{iasApsArtifact:e}=t.globalContext;if(e)return e;const n=t.readSessionStorage(Lt);return n?(t.deleteSessionStorage(Lt),JSON.parse(n)):void 0})(t);if(null==e)return s.cancelled;try{const{googletag:n}=t.globalContext;n.pubads().getSlots().forEach((t=>{const n=e.targeting.slots[t.getSlotElementId()];null!=n&&Object.keys(n).forEach((e=>{t.setTargeting(e,n[e])}))}));const{brandSafety:o,fr:a,custom:i}=e.targeting;return null!=o&&Object.keys(o).forEach((t=>{n.pubads().setTargeting(t,o[t])})),null!=i&&Object.keys(i).forEach((t=>{const e=i[t];n.cmd.push((()=>n.pubads().setTargeting(t,e)))})),null!=a&&n.pubads().setTargeting("fr",a),s.completed}catch(t){throw new Error(`Malformed targeting object at ${Lt}`)}},qt="aps_targeting_illuma";var Vt=new ut({scope:"cxm",object:"illuma",action:"set",handler:async({account:t,customEvent:e})=>({status:Ft(t)})});const Ft=t=>{const e=t.readSessionStorage(qt);if(t.deleteSessionStorage(qt),null==e)return s.cancelled;const n=JSON.parse(e).results;if(null==n)throw new Error(`Malformed targeting object at ${qt}`);const{googletag:o}=t.globalContext;return Object.keys(n).forEach((t=>{const e=n[t];o.pubads().setTargeting(`illuma_${t}`,JSON.stringify(e))})),s.completed};var Bt=new ut({scope:"cxm",object:"contextual",action:"set",handler:async({account:t,customEvent:e})=>(await Promise.all([t.recordListener(Tt),t.recordListener(Mt),t.recordListener(Vt)]),{status:s.completed})});const zt=pt([Tt,Bt,Mt,Vt]),Jt={key:"customPlacement/hints",default:{}},Ht={key:"customPlacement/bidResponses",default:{}};class Gt{constructor(t,e,n){this.CLICK_PREFIX_MACRO="%%CLICK_URL_PREFIX%%",this.PROGRAM_CUSTOM_PLACEMENTS="customPlacements",this.getPageStyles=(t=["p","h1","h2"])=>t.map(this.getTagStyle).filter((t=>Object.keys(t).length>0)).reduce(((t,e)=>({...t,...e})),{}),this.getContainerStyles=t=>{try{if(!t)return{};const e=window.getComputedStyle(t),n="--aps-custom-container-",o=new Map;return o.set(`${n}width`,e.width),o.set(`${n}margin`,e.margin),o.set(`${n}padding`,e.padding),Object.fromEntries(o.entries())}catch(t){return{}}},this.slotProps=t,this.rawResponse=e,this.jt=n}getTagStyle(t){const e=this.jt.getElementsByTagName(t);if(e&&e[0]){const e=window.getComputedStyle(this.jt.getElementsByTagName(t)[0]),n=new Map,o="--aps-custom-page-";return n.set(`${o}${t}-color`,e.color),n.set(`${o}${t}-fontFamily`,e.fontFamily),n.set(`${o}${t}-fontSize`,e.fontSize),n.set(`${o}${t}-fontWeight`,e.fontWeight),n.set(`${o}${t}-lineHeight`,e.lineHeight),Object.fromEntries(n)}return{}}getDynamicFrameBodyHeight(t,e,n){if(e){const n=e?.contentDocument||e?.contentWindow?.document,o=n?.body.scrollHeight;e.style.height=`${o}px`;try{const e={...this.getPageStyles(),...this.getContainerStyles(t)};Object.keys(e).forEach((t=>{n?.documentElement.style.setProperty(t,e[t])}))}catch(t){}}}render(t){return this.$t(t)}$t(t){if(!this.rawResponse||!this.slotProps)return!1;try{const e=this.rawResponse.size.split("x"),n=this.rawResponse.targeting?.amzniid||this.rawResponse.amzniid,o=this.rawResponse.targeting?.amznadm||this.rawResponse.amznadm;if(!n)return!1;let a=this.slotProps.Ct;if(this.slotProps.location&&this.slotProps.id){const t=this.jt.createElement("div");this.jt.getElementById(this.slotProps.id)?.insertAdjacentElement(this.slotProps.location,t),a=t}if(!a)return!1;const i=this.jt.createElement("iframe");return i.style.marginLeft="0",i.style.marginTop="0",i.style.height=`${e[1]}px`,i.style.width="100%",i.setAttribute("data-testid","amzn-asr-ad"),i.setAttribute("scrolling","no"),i.setAttribute("frameborder","0"),i.onload=()=>this.getDynamicFrameBodyHeight(a,i,o?"amznadm":"admi"),i.srcdoc=o||"",t&&t.clickPrefix&&(i.srcdoc=i.srcdoc.replace(this.CLICK_PREFIX_MACRO,t.clickPrefix)),a.appendChild(i),this.updateSlotAttribute("status","rendered"),!0}catch(t){throw new Error("CustomPlacements: Error while rendering")}}updateSlotAttribute(t,e){this.slotProps.Ct?.setAttribute(`data-aps-custom-${t}`,e)}}const Kt={key:"customPlacement/timings",default:[]},Wt=(t,e,n=0,o=0)=>{try{const a={effectiveType:e?.effectiveType,rtt:e?.rtt,downlink:e?.downlink},i=function(t,e,n){try{return`${isNaN(e)||0===e?t.body.clientWidth:e}x${isNaN(n)||0===n?t.body.clientHeight:n}`}catch(t){}return"x"}(t,n,o);return{connection:a,screen:i}}catch(t){return{}}},Qt=(t,e,n)=>{t.update(Kt,(t=>(t.push({time:performance.now(),key:`${e}/${n}`}),t)))},Yt="customPlacements";var Zt=new ut({scope:"customPlacement",object:"hint",action:"process",validators:{},handler:async({account:t,detail:e,customEvent:n})=>{const o=e=>{Qt(t,Yt,`hint/process/${e}`);const n=t.use(Jt),o=t.use(Ht);n[e].isRendered||(Object.values(o).forEach((o=>{if(o.isRendered)return;const a=t.globalContext.document.getElementById(e);if(null==a)return;const i=new Gt({id:e,Ct:a},o,t.globalContext.document);Qt(t,Yt,`widget/render/${e}`),i.render(n[e].hintMetadata)&&(o.isRendered=!0,n[e].isRendered=!0)})),t.update(Jt,(()=>n)),t.update(Ht,(()=>o)))},a=t.use(Jt);return Object.keys(a).filter((t=>a[t].default)).forEach(o),Object.keys(a).filter((t=>!a[t].default)).forEach(o),{status:s.completed,analytics:{browserInfo:Wt(t.globalContext.document,t.globalContext.navigator?.connection,t.globalContext.innerWidth,t.globalContext.innerHeight)}}}}),Xt=new ut({scope:"customPlacement",object:"hint",action:"define",validators:{},handler:async({account:t,detail:e,customEvent:n})=>{if(void 0===n.detail?.id)throw new Error("Hint `id` must be defined");const{id:o,isDefault:a,hintMetadata:i}=n.detail;Qt(t,Yt,`hint/define/${o}`);const r=t.use(Jt);return r[o]={default:"default"===a,isRendered:!1,hintMetadata:i??{}},t.update(Jt,(()=>r)),t.recordListenerNonBlocking(Zt),{status:s.completed,analytics:{browserInfo:Wt(t.globalContext.document,t.globalContext.navigator?.connection,t.globalContext.innerWidth,t.globalContext.innerHeight)}}}});const te={key:"customPlacement/placementResponseDispatched",default:!1},ee={key:"customPlacement/placementResponse",default:void 0},ne={key:"customPlacement/contextURL",default:void 0},oe={key:"customPlacement/placementEndpoint",default:"https://c.aps.amazon-adsystem.com/e/placements"},ae={key:"ad/context",default:void 0};var ie=new ut({scope:"customPlacement",object:"placement",action:"fetch",validators:{},handler:async({account:t,detail:e,customEvent:n})=>{Qt(t,Yt,"placementFetch/start");const o=await async function(t){const e={ortb2:se(t)},n=t.use(ne),o=t.use(oe),a=function(t,e){try{const n=e??function(t){try{if(void 0!==t.globalContext.top?.location.href)return t.globalContext.top?.location.href}catch(t){}try{if(t.globalContext.top!==t.globalContext.self)return t.globalContext.document.referrer}catch(t){}}(t);if(void 0!==n)return encodeURIComponent(n)}catch(t){}return""}(t,n),i=encodeURIComponent(JSON.stringify(e)),s=await fetch(`${o}?account=${t.id}&u=${a}&sg=${i}`);return await s.json()}(t);return Qt(t,Yt,"placementFetch/end"),{status:s.completed,value:{placementResponse:o},analytics:{browserInfo:Wt(t.globalContext.document,t.globalContext.navigator?.connection,t.globalContext.innerWidth,t.globalContext.innerHeight)}}}});function se(t){const e=t.use(ae);if(void 0!==e&&"user"in e){const{user:t,...n}=e;return n}return e}const re={key:"customPlacement/bidEndpoint",default:"c.aps.amazon-adsystem.com"},ce={key:"customPlacement/bidIsKey",default:"86355855cc6ed9e335d0382c8563aa10"};var de=new ut({scope:"customPlacement",object:"bids",action:"fetch",validators:{},handler:async({account:t,detail:e,customEvent:n})=>{const o=Wt(t.globalContext.document,t.globalContext.navigator?.connection,t.globalContext.innerWidth,t.globalContext.innerHeight);if(void 0===t.globalContext.apstag?.clientFetchBids)return{status:s.waiting,analytics:{browserInfo:o}};Qt(t,Yt,"fetchBids/start");const a=await async function(t){const e={slots:[{slotID:"93b7dd52-a8ce-11ed-afa1-0242ac120002:1",sizes:[[999,999]]}],timeout:6e4,_endpointDomain:t.use(re),params:{program:"apscustom",is:t.use(ce)}},n={pubID:t.id,isSelfServePub:36===t.id.length,deals:!0},o=t.use(ne);return await new Promise((a=>{t.globalContext.apstag?.clientFetchBids(e,(t=>{a(t)}),{initConfig:n,contextURL:o})}))}(t);return Qt(t,Yt,"fetchBids/end"),{status:s.completed,value:{bidResponses:a},analytics:{browserInfo:o}}}}),le=new ut({scope:"customPlacement",object:"service",action:"enable",validators:{},handler:async({account:t,detail:e,customEvent:n})=>(Qt(t,Yt,"service/enable"),t.update(te,(()=>!1)),await Promise.all([t.recordListener(ie).then((({placementResponse:e})=>{ue(t,!0,e),t.update(ee,(()=>e))})),t.recordListener(de).then((({bidResponses:e})=>{e.forEach((e=>{const n=e.targeting?.amzniid??e.amzniid;let o=!1;if(""!==n){const a=t.use(Ht);a[n]=e,t.update(Ht,(()=>a)),o=!0}ue(t,!1,{aps:[{active:o,dispatchEventOnValidBid:!0}]})}))})).then((()=>{t.recordListenerNonBlocking(Zt)}))]),{status:s.completed,analytics:{browserInfo:Wt(t.globalContext.document,t.globalContext.navigator?.connection,t.globalContext.innerWidth,t.globalContext.innerHeight)}})});function ue(t,e,n){if(t.use(te))return;const o=n?.aps?.find((t=>t.dispatchEventOnValidBid));e&&void 0!==o||(Qt(t,Yt,"placementResponseEvent/dispatch"),t.record("customPlacement/placement/didRespond",n).catch((t=>{})),t.update(te,(()=>!0)))}const pe=new Map([...pt([Xt,de,Zt,le,ie])]),me={key:"ortbVendors/vm",default:{}},fe="anonymised";var he=new ut({scope:"ortbVendors",object:"anonymised",action:"set",handler:async({account:t})=>{const e=function(t){const e=t.readLocalStorage("cohort_ids");if("string"==typeof e){const t=JSON.parse(e);let n="";for(let e=0;e({...t,[fe]:e}))),{status:s.completed})}}),ve=new ut({scope:"ortbVendors",object:"arcspan",action:"set",handler:async({account:t})=>{const e=function(t){const e=t.globalContext[ye],n=t.globalContext[ge];let o=[],a=[],i=[];if(void 0!==e){if(void 0!==e.page_iab_codes.text&&(o=o.concat(e.page_iab_codes.text)),void 0!==e.page_iab_codes.images&&(o=o.concat(e.page_iab_codes.images)),void 0!==e.page_keywords){const t="string"==typeof e.page_keywords?e.page_keywords.split(","):e.page_keywords;i=i.concat(t),void 0!==n?.compcohorts&&(i=i.concat(n.compcohorts))}void 0!==e.page_iab_newcodes.text&&(a=[...new Set([...a,...e.page_iab_newcodes.text])]),void 0!==e.page_iab_newcodes.images&&(a=[...new Set([...a,...e.page_iab_newcodes.images])]);const s={name:"arcspan",segment:[],ext:{segtax:6}};a.forEach((function(t){s.segment=s.segment.concat({id:t})}));const r={data:[]};return r.data=r.data.concat(s),{data:{default:{site:{name:"arcspan",cat:o,sectioncat:o,pagecat:o,keywords:i.toString(),content:r,domain:new URL(t.globalContext.location.href).hostname,page:t.globalContext.location.href,ref:t.globalContext.document.referrer}}}}}}(t);return void 0===e?{status:s.cancelled}:(t.update(me,(t=>({...t,arcspan:e}))),{status:s.completed})}});const ye="arcobj1",ge="arcobj2",we={key:"idVendors/ids",default:void 0},be={key:"idVendors/metadata",default:void 0};function Ee(t,e){const n=t(e);return null!=n?(e.update(we,(t=>({...t,...n}))),{status:s.completed}):{status:s.cancelled}}class Se{constructor(t){return this.parser=null,this.keys=null,this.account=null,this.read=t=>null,this.anyAttributesMissing=()=>[this.parser,this.keys,this.account,this.egressNodeKey,this.read].some((t=>null==t)),this.egressNodeKey=t,this}using(t){return this.parser=t,this}fromCookieKeys(t){return this.keys=t,this.read=t=>this.account?.readCookieStorage(t),this}fromLocalStorageKeys(t){return this.keys=t,this.read=t=>this.account?.readLocalStorage(t),this}fromCookieOrLocalStorageKeys(t){return this.keys=t,this.read=t=>this.account?.readCookieStorage(t)??this.account?.readLocalStorage(t),this}fromLocalStorageOrCookieKeys(t){return this.keys=t,this.read=t=>this.account?.readLocalStorage(t)??this.account?.readCookieStorage(t),this}forAccount(t){return this.account=t,this}getRunner(){if(this.anyAttributesMissing())throw new Error("Missing attribute(s) - unable to return a runner.");return()=>{if(this.anyAttributesMissing())throw new Error("Missing attribute(s) - runner execution failed.");for(const t of this.keys){const e=this.parser(this.read(t));if(null!=e)return{[this.egressNodeKey]:e}}return null}}}const xe=function(t){return"string"==typeof t?t:null},_e=function(t){return"string"==typeof t?atob(t):null};function Re(t){return function(e){return"string"==typeof e?t(JSON.parse(e)):null}}function Ie(t){return function(e){if("string"!=typeof e)return null;let n=e,o=null;for(let e=0;++e<=5;)try{n=decodeURIComponent(n),o=Re(t)(n);break}catch(t){if(e>=5)throw t}return o}}const Ae="growthcode",ke="temp",je=["gceb"];var $e=new ut({scope:"ortbVendors",object:"growthcode",action:"set",handler:async({account:t})=>{const e=new Se(ke).using(xe).fromLocalStorageKeys(je).forAccount(t).getRunner()();if(!e)return{status:s.cancelled};const n=JSON.parse(e[ke]);if(!(n instanceof Array))return{status:s.cancelled};const o=n.filter((t=>Ce(t)));if(0===o.length)return{status:s.cancelled};const a={data:{default:{user:{ext:{eids:o}}}}};return t.update(me,(t=>({...t,[Ae]:a}))),{status:s.completed}}});const Ce=t=>!!t&&!!t.source&&t.uids instanceof Array&&0!==t.uids.length&&t.uids.every((t=>void 0!==t?.id)),Oe="liveintent",Pe={nonId:{noExtraDefaults:!0,source:"liveintent.com",atype:3},bidswitch:{source:"bidswitch.net",atype:3},openx:{source:"openx.net",atype:3},magnite:{source:"rubiconproject.com",atype:3},medianet:{source:"media.net",atype:3},pubmatic:{source:"pubmatic.com",atype:3},index:{source:"liveintent.indexexchange.com",atype:3},uid2:{source:"uidapi.com",atype:3},sovrn:{source:"liveintent.sovrn.com",atype:3},thetradedesk:{source:"adserver.org",atype:1},vidazoo:{source:"liveintent.vidazoo.com",atype:3},triplelift:{source:"liveintent.triplelift.com",atype:3},sharethrough:{source:"sharethrough.com",atype:3},sonobi:{source:"liveintent.sonobi.com",atype:3},nexxen:{source:"liveintent.unrulymedia.com",atype:3},zetassp:{source:"zeta-ssp.liveintent.com",atype:3}};var De=new ut({scope:"ortbVendors",object:"liveintent",action:"set",handler:async({account:t})=>{const e=function(t){const e=t.readLocalStorage("__tamLIResolveResult");if(null!=e&&(void 0===t.globalContext.liModuleEnabled&&(t.globalContext.liModuleEnabled=Math.random()<.95,t.globalContext?.googletag?.cmd.push((()=>{t.globalContext.googletag.pubads().setTargeting("li-module-enabled",t.globalContext.liModuleEnabled?["on"]:["off"])}))),t.globalContext.liModuleEnabled)){let t;try{t=Te(JSON.parse(e))}catch(n){t=Te(JSON.parse(decodeURIComponent(e)))}if(void 0!==t)return{data:{default:t}}}}(t);return void 0===e?{status:s.cancelled}:(t.update(me,(t=>({...t,[Oe]:e}))),{status:s.completed})}});function Te(t){const e=[],n={user:{ext:{eids:e}}};return Object.entries(Pe).forEach((n=>{const o=n[0],a=n[1];if(void 0===t[o])return;const i={source:a.source,uids:[{id:t[o],atype:a.atype}]};!0!==a.noExtraDefaults&&(i.uids[0].ext={provider:"liveintent.com"}),e.push(i)})),n}const Ne="optable",Le="temp";var Me=new ut({scope:"ortbVendors",object:"optable",action:"set",handler:async({account:t})=>{const e=new Se(Le).using(xe).fromLocalStorageKeys(["OPTABLE_RESOLVED"]).forAccount(t).getRunner()();if(!e)return{status:s.cancelled};const n=function(t){return t&&t.ortb2?t.ortb2:t}(JSON.parse(e[Le])),o={data:{default:n}};return t.update(me,(t=>({...t,[Ne]:o}))),{status:s.completed}}});const Ue="permutive",qe="permutive_temp",Ve=["_pamzn_ids"];var Fe=new ut({scope:"ortbVendors",object:"permutive",action:"set",handler:async({account:t})=>{const e=new Se(qe).using(xe).fromLocalStorageKeys(Ve).forAccount(t).getRunner()();if(!e)return{status:s.cancelled};const n=JSON.parse(e[qe]);if(!Array.isArray(n))return{status:s.cancelled};const o=n.filter((t=>Be(t)));if(0===o.length)return{status:s.cancelled};const a={data:{default:{user:{ext:{eids:o}}}}};return t.update(me,(t=>({...t,[Ue]:a}))),{status:s.completed}}});const Be=t=>!!t&&!!t.source&&!!Array.isArray(t.uids)&&0!==t.uids.length&&t.uids.every((t=>void 0!==t?.id)),ze="utiq",Je="utiqtemp";var He=new ut({scope:"ortbVendors",object:"utiq",action:"set",handler:async({account:t})=>{const e=new Se(Je).using(xe).fromLocalStorageKeys(["utiq_openrtb_eids"]).forAccount(t).getRunner()();if(!e)return{status:s.cancelled};const n=JSON.parse(e[Je]);if(!Array.isArray(n))return{status:s.cancelled};const o=n.filter((t=>Ge(t)));if(0===o.length)return{status:s.cancelled};const a={data:{default:{user:{ext:{eids:o}}}}};return t.update(me,(t=>({...t,[ze]:a}))),{status:s.completed}}});const Ge=t=>!!t&&!!t.source&&!!Array.isArray(t.uids)&&0!==t.uids.length&&t.uids.every((t=>void 0!==t?.id));var Ke=new ut({scope:"ortbVendors",object:"all",action:"process",handler:async({account:t})=>(await Promise.all([t.recordListener(he),t.recordListener(ve),t.recordListener($e),t.recordListener(De),t.recordListener(Me),t.recordListener(Fe),t.recordListener(He)]),{status:s.completed})});const We=pt([he,ve,$e,De,Me,Fe,He,Ke]),Qe="33across",Ye="33acrossId";var Ze=new ut({scope:"idVendors",object:"33across",action:"get",handler:async({account:t,customEvent:e})=>{const n=Ee(Xe,t),o=t.readLocalStorage(Ye);if(o&&o.length>1500){const t={idLength:100*Math.ceil(o.length/100)};return{...n,analytics:t}}return n}});const Xe=t=>{const e=t.readLocalStorage(Ye);return null!=e?{[Qe]:decodeURIComponent(e)}:null},tn=["amxId"];var en=new ut({scope:"idVendors",object:"amx",action:"get",handler:async({account:t,customEvent:e})=>Ee(new Se("amx").using(xe).fromLocalStorageKeys(tn).forAccount(t).getRunner(),t)});const nn="audigent";var on=new ut({scope:"idVendors",object:"audigent",action:"get",handler:async({account:t,customEvent:e})=>Ee(an,t)});const an=t=>{const e=t.readLocalStorage("hadronId")??t.readLocalStorage("auHadronId");return null!=e?{[nn]:e}:null},sn=["cto_bidid"];var rn=new ut({scope:"idVendors",object:"criteo",action:"get",handler:async({account:t,customEvent:e})=>Ee(new Se("criteo").using(xe).fromLocalStorageKeys(sn).forAccount(t).getRunner(),t)});const cn="firstid",dn=["firstid"];var ln=new ut({scope:"idVendors",object:"firstid",action:"get",handler:async({account:t,customEvent:e})=>Ee(new Se(cn).using(xe).fromCookieKeys(dn).forAccount(t).getRunner(),t)});const un={key:"idVendors/enabled",default:void 0},pn={"context.apstag":tt,"context.apstag.bids":rt,"context.apstag.bids()":lt,"context.apstag._atsaaiod":nt([lt,rt]),"context.apstag.setDisplayBids":rt,"context.apstag.setDisplayBids()":null,"context._apstag":st(tt),"context._apstag.bids":st(rt),"context._apstag.bids()":st(lt),"context._apstag._atsaaiod":st(nt([lt,rt])),"context._apstag.setDisplayBids":st(rt),"context._apstag.setDisplayBids()":null};var mn=new ut({scope:"idVendors",object:"enabled",action:"set",handler:async({account:t,detail:e,context:n})=>fn(n)?(t.update(un,(()=>JSON.stringify(e.bidParameterKeys)),{persist:!0}),{status:s.completed}):{status:s.waiting},validators:{detail:{detail:tt,"detail.bidParameterKeys":ot,"detail.bidParameterKeys[]":Z},context:{context:tt,...pn,"context.apstag":nt([lt,tt]),"context._apstag":st(nt([lt,tt]))}}});const fn=t=>void 0!==t.apstag?._atsaaiod,hn={key:"idVendors/newConfigFlowEnabled",default:!1};var vn=new ut({scope:"idVendors",object:"newConfigFlowEnabled",action:"set",validators:{detail:{detail:tt,"detail.value":X},context:{context:tt}},handler:async({account:t,detail:e})=>(t.update(hn,(()=>e.value)),{status:s.completed,analytics:{enabled:e.value}})});const yn=["1ad7261b-91ea-4b6f-b9e9-b83522205b75","3161","0ab198dd-b265-462a-ae36-74e163ad6159"];var gn=new ut({scope:"idVendors",object:"newConfigFlow",action:"initialize",validators:{detail:{detail:tt},context:{context:tt}},handler:async({account:t})=>(t.recordListenerNonBlocking(vn,{value:!1}),t.recordListenerNonBlocking(vn,{value:!0,restrictions:{block:{accounts:yn}}}),{status:s.completed})});const wn="fabrick";var bn=new ut({scope:"idVendors",object:"fabrick",action:"get",handler:async({account:t,customEvent:e})=>Ee(En,t)});const En=t=>{let e=null;const n=t.readCookieStorage("pbjs_fabrickId");if(null!=n){const t=decodeURIComponent(n);e=JSON.parse(t).fabrickId}return null!=e?{[wn]:e}:null},Sn=["FTrackId"],xn=t=>t?.DeviceID?.pop?t?.DeviceID?.pop()??null:null;var _n=new ut({scope:"idVendors",object:"fTrack",action:"get",handler:async({account:t,customEvent:e})=>Ee(new Se("fTrack").using(Ie(xn)).fromLocalStorageKeys(Sn).forAccount(t).getRunner(),t)});const Rn="id5",In="id5id";var An=new ut({scope:"idVendors",object:"id5",action:"get",handler:async({account:t,customEvent:e})=>Ee(kn,t)});const kn=t=>{const e=t.readLocalStorage(In);return null!=e?{[Rn]:JSON.parse(decodeURIComponent(e)).universal_uid}:null},jn=["IDP"];var $n=new ut({scope:"idVendors",object:"idPlus",action:"get",handler:async({account:t,customEvent:e})=>Ee(new Se("idPlus").using(_e).fromCookieOrLocalStorageKeys(jn).forAccount(t).getRunner(),t)});const Cn=["__im_uid","__im_ppid"];var On=new ut({scope:"idVendors",object:"intimateMerger",action:"get",handler:async({account:t,customEvent:e})=>Ee(new Se("intimateMerger").using(xe).fromLocalStorageKeys(Cn).forAccount(t).getRunner(),t)});const Pn="liveRamp",Dn="_lr_env",Tn="idl_env",Nn="apstagLiveRampTimestamp";var Ln;!function(t){t[t.oldTimestamp=0]="oldTimestamp",t[t.newTimestamp=1]="newTimestamp",t[t.noTimestamp=2]="noTimestamp"}(Ln||(Ln={}));var Mn=new ut({scope:"idVendors",object:"liveramp",action:"get",handler:async({account:t,customEvent:e})=>{const n=qn(Un(t),t),o=Ee((()=>null!=n?{[Pn]:n.id}:null),t);return o.status===s.completed?function(t,e){const o=null!=n?{[Pn]:n.newGen}:null;return null!=o?(e.update(be,(t=>({...t,...o}))),{status:s.completed}):{status:s.cancelled}}(0,t):o}});const Un=t=>{const e=t.readLocalStorage(Dn);if(null!=e)return e;const n=t.readCookieStorage(Dn);if(null!=n)return n;const o=t.readLocalStorage(Tn);if(null!=o)return o;const a=t.readCookieStorage(Tn);return null!=a?a:null},qn=(t,e)=>{if(null!=t&&""!==t)try{const n=JSON.parse(atob(decodeURIComponent(t))),o=Array.isArray(n.envelope)?n.envelope[0]:n.envelope;if("string"!=typeof o)return null;const a={id:o,newGen:Ln.noTimestamp};if(null!=n.timestamp){const t=e.readLocalStorage(Nn);null==t||tEe(Jn,t)});const Jn=t=>{const e=t.readLocalStorage("lockr_identity_providers");if(e){const n={};return e.split(",").filter((t=>!Fn.has(t))).forEach((e=>{const o=Hn(t,e);null!==o&&(n[Vn[e]||e]=decodeURIComponent(o))})),n}return null},Hn=(t,e)=>{let n=t.readLocalStorage(e);if(!n)return null;if(Bn[e])try{n=JSON.parse(decodeURIComponent(n)),Bn[e].split(".").forEach((t=>{n=n?.[t]}))}catch(t){throw new Error(`Malformed json at ${e}: ${t}`)}return n||null},Gn="lotame";var Kn=new ut({scope:"idVendors",object:"lotame",action:"get",handler:async({account:t,customEvent:e})=>Ee(Wn,t)});const Wn=t=>{const e=t.readLocalStorage("panoramaId");return null!=e?{[Gn]:e}:null},Qn=["pbjs-merkleId"],Yn=t=>t?.merkleId?.pop?t?.merkleId?.pop()?.id??null:null;var Zn=new ut({scope:"idVendors",object:"merkle",action:"get",handler:async({account:t,customEvent:e})=>Ee(new Se("merkle").using(Ie(Yn)).fromLocalStorageKeys(Qn).forAccount(t).getRunner(),t)});const Xn="pair",to=["pairId"],eo=["_lr_pairId"],no=t=>t?.envelope?.pop?t?.envelope?.pop()??null:null;var oo=new ut({scope:"idVendors",object:"pair",action:"get",handler:async({account:t,customEvent:e})=>Ee((t=>new Se(Xn).using(_e).fromCookieOrLocalStorageKeys(to).forAccount(t).getRunner()()??new Se(Xn).using(function(t){return function(e){return"string"==typeof e?Re(t)(atob(decodeURIComponent(e))):null}}(no)).fromCookieOrLocalStorageKeys(eo).forAccount(t).getRunner()()),t)});const ao="pubcommon",io=["_pubcid","_sharedID"];var so=new ut({scope:"idVendors",object:"pubcommon",action:"get",handler:async({account:t,customEvent:e})=>Ee(new Se(ao).using(xe).fromLocalStorageOrCookieKeys(io).forAccount(t).getRunner(),t)});const ro="publink",co=["_publink_srv","_publink","pbjs_publink"];var lo=new ut({scope:"idVendors",object:"publink",action:"get",handler:async({account:t,customEvent:e})=>Ee(uo,t)});const uo=t=>{for(const e of co){const n=t.readCookieStorage(e);if(null!=n){let t;try{t=JSON.parse(n).publink}catch{t=n}if(null!=t)return{[ro]:t}}}return null},po=["__qca"];var mo=new ut({scope:"idVendors",object:"quantcast",action:"get",handler:async({account:t,customEvent:e})=>Ee(new Se("quantcast").using(xe).fromCookieKeys(po).forAccount(t).getRunner(),t)});const fo=["__uid2_advertising_token"],ho=t=>t?.latestToken?.advertising_token??null;var vo=new ut({scope:"idVendors",object:"uid",action:"get",handler:async({account:t,customEvent:e})=>Ee(new Se("uid").using(Re(ho)).fromLocalStorageKeys(fo).forAccount(t).getRunner(),t)});const yo=["pbjs_unifiedID","pbjs-unifiedid"],go=t=>t?.TDID??null;var wo=new ut({scope:"idVendors",object:"unifiedid",action:"get",handler:async({account:t,customEvent:e})=>Ee(new Se("unifiedid").using(Ie(go)).fromLocalStorageOrCookieKeys(yo).forAccount(t).getRunner(),t)});const bo="yahoo",Eo=["connectId"],So=t=>t?.connectid??t?.connectId??null;var xo=new ut({scope:"idVendors",object:"yahoo",action:"get",handler:async({account:t})=>Ee(new Se(bo).using(Ie(So)).fromLocalStorageKeys(Eo).forAccount(t).getRunner(),t)});const _o="liveRamp/envelope",Ro={key:"liveRamp/envelope",default:void 0},Io={key:"liveRamp/envelopeHost",default:"https://api.rlcdn.com"};var Ao=new ut({scope:"liveRamp",object:"envelope",action:"fetch",handler:async({account:t})=>{if(void 0===t.globalContext.apstag?._atsaaiod)return{status:s.waiting};const e=t.use(Io),n=new URL(`${e}/api/identity/envelope`);n.searchParams.append("pid","13310");const o=t.use(It),a=t.read(bt);!0===o?.gdprApplies&&o.tcString&&(n.searchParams.append("gdpr","1"),n.searchParams.append("gdpr_consent",o.tcString)),a?.gppString&&a.applicableSections?.length>0&&(n.searchParams.append("gpp",a.gppString),n.searchParams.append("gpp_sid",a.applicableSections.join(",")));const i=await t.globalContext.fetch(n.toString(),{method:"GET",credentials:"include"}),r={statusCode:i.status,responseOk:i.ok};if(200!==i.status)return{status:s.cancelled,analytics:{...r,...204===i.status&&{reason:"No Content"}}};const c=await i.json();if(!c.envelope)return{status:s.cancelled,analytics:{...r,reason:"missing_envelope"}};const d=JSON.stringify({value:c.envelope,createdAt:Date.now()});return t.update(Ro,(()=>c.envelope)),t.writeLocalStorage(_o,d,{usePrefix:!0}),{status:s.completed,analytics:r}}}),ko=new ut({scope:"liveRamp",object:"envelope",action:"sync",handler:async({account:t})=>{if(void 0===t.globalContext.apstag?._atsaaiod)return{status:s.waiting};const e=t.readLocalStorage(_o,{usePrefix:!0});if(e){const{createdAt:n,value:o}=JSON.parse(e);if(o&&jo(n,Date.now())<15)return t.update(Ro,(()=>o)),{status:s.completed}}return await t.recordListener(Ao),{status:s.completed}}});const jo=(t,e)=>{const n=new Date(t),o=new Date(e);return(n.getTime()-o.getTime())/864e5};var $o=new ut({scope:"idVendors",object:"rtisLiveRamp",action:"get",handler:async({account:t})=>(t.recordListenerNonBlocking(ko),{status:s.completed})});const Co={"33across":Ze,amx:en,audigent:on,criteo:rn,ddb_key_638:zn,firstid:ln,fabrick:bn,fTrack:_n,id5:An,idPlus:$n,intimateMerger:On,liveRamp:Mn,lotame:Kn,merkle:Zn,pair:oo,pubcommon:so,publink:lo,quantcast:mo,uid:vo,unifiedid:wo,yahoo:xo,rtisLiveRamp:$o},Oo=Object.keys(Co);var Po=new ut({scope:"idVendors",object:"ids",action:"get",handler:async({account:t})=>{let e=Object.values(Co);const n=t.use(un,{persist:!0,throwOnDisallowed:!1});if(n){const t=JSON.parse(n);if(o=t,!Array.isArray(o)||!o.every((t=>"string"==typeof t)))throw new Error("Received invalid 3P bid param key");const a=new Set(t);e=Oo.filter((t=>a.has(t))).map((t=>Co[t]))}else if(!t.use(d))return{status:s.cancelled,analytics:{reason:"consent_pending",enabledIdVendors:`${n}`}};var o;const a=n?e:e.filter((t=>t!==$o));return await Promise.all(a.map((e=>t.recordListener(e)))),{status:s.completed,analytics:{enabledIdVendors:`${n}`}}}});const Do={key:"idVendors/recordVendorsLoadedEndpoint",default:"https://prod.us-east-1.cxm-bcn.publisher-services.amazon.dev/v1/recordVendorsLoaded"};var To=new ut({scope:"idVendors",object:"vendorsLoaded",action:"record",validators:{detail:{detail:tt,"detail.accountId":Z,"detail.sourceId":Z,"detail.vendorId":st(Z),"detail.propertyId":st(Z),"detail.failure":st(Z),"detail.errorName":st(Z),"detail.errorMessage":st(Z)},context:{context:tt,"context.fetch":rt,"context.fetch()":null}},handler:async({detail:t,account:e,context:n})=>{const o=[{publisherId:t.accountId,sourceId:t.sourceId,clientName:"aps-listener",vendorId:t.vendorId,propertyId:t.propertyId,...t.failure&&{failure:t.failure,errorName:t.errorName,errorMessage:t.errorMessage}}],a=e.use(Do),i=await n.fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o),keepalive:!0});if(!i.ok)throw new Error(`HTTP ${i.status}`);return{status:s.completed,analytics:{vendorId:t.vendorId}}}}),No=new ut({scope:"idVendors",object:"integration",action:"execute",validators:{detail:{detail:tt,"detail.accountId":Z,"detail.sourceId":Z,"detail.vendorId":Z,"detail.countryCode":Z,"detail.vendorLoadedSampleRate":st(Y),"detail.allowedRegions":st(ot),"detail.allowedRegions[]":Z,"detail.blockedRegions":st(ot),"detail.blockedRegions[]":Z,"detail.domainPrecedence":ot,"detail.domainPrecedence[]":tt,"detail.domainPrecedence[].hostnames":ot,"detail.domainPrecedence[].hostnames[]":Z,"detail.domainPrecedence[].script":st(rt),"detail.domainPrecedence[].script()":ct,"detail.domainPrecedence[].propertyId":st(Z),"detail.defaultScript":st(rt),"detail.defaultScript()":ct,"detail.defaultPropertyId":st(Z)},context:{context:dt}},handler:async({detail:t,account:e,context:n})=>{const o=e.use(hn),a=(t=>t?t.toLowerCase().trim().replace(/^www\./,""):"")(n.location.hostname);if(!o)return k()&&_.info(`[idVendors/integration/execute] cancelled: vendorId=${t.vendorId} hostname=${a} reason=sdk-flow-disabled`),{status:s.cancelled,analytics:{vendorId:t.vendorId,hostname:a,cancellationReason:"sdk-flow-disabled"}};let i,r,c,d;for(const e of t.domainPrecedence){if(e.hostnames.includes(a)){if(d=a,void 0===e.script)return k()&&_.info(`[idVendors/integration/execute] cancelled: vendorId=${t.vendorId} hostname=${a} reason=script-undefined-exact-match matchedRoute=${a}`),{status:s.cancelled,analytics:{vendorId:t.vendorId,matchType:"blocked",matchedRoute:a,hostname:a,cancellationReason:"script-undefined-exact-match"}};i=e.script,r=e.propertyId,c="exact";break}const n=e.hostnames.find((t=>a.endsWith("."+t)));if(n){if(d=n,void 0===e.script)return k()&&_.info(`[idVendors/integration/execute] cancelled: vendorId=${t.vendorId} hostname=${a} reason=script-undefined-configDomain-match matchedRoute=${n}`),{status:s.cancelled,analytics:{vendorId:t.vendorId,matchType:"blocked",matchedRoute:n,hostname:a,cancellationReason:"script-undefined-configDomain-match"}};i=e.script,r=e.propertyId,c="configDomain";break}}if(!i){if(!t.defaultScript)return k()&&_.info(`[idVendors/integration/execute] cancelled: vendorId=${t.vendorId} hostname=${a} reason=no-route-no-default`),{status:s.cancelled,analytics:{vendorId:t.vendorId,matchType:"none",hostname:a,cancellationReason:"no-route-no-default"}};i=t.defaultScript,r=t.defaultPropertyId,c="default",d="default"}const l=t.countryCode;if(t.allowedRegions?.length&&!t.allowedRegions.includes(l))return{status:s.cancelled,analytics:{vendorId:t.vendorId,reason:"region_blocked"}};if(t.blockedRegions?.length&&t.blockedRegions.includes(l))return{status:s.cancelled,analytics:{vendorId:t.vendorId,reason:"region_blocked"}};let u,p,m;try{i()}catch(t){u="vendor-script-execution-error",p=t instanceof Error?t.name:"Error",m=t instanceof Error?t.message:String(t)}if(e.recordListenerNonBlocking(To,{accountId:t.accountId,sourceId:t.sourceId,vendorId:t.vendorId,propertyId:r,...u&&{failure:u,errorName:p,errorMessage:m},restrictions:{allow:{rate:(t.vendorLoadedSampleRate??5)/100}}}),u)throw k()&&_.error(`[idVendors/integration/execute] vendorId=${t.vendorId} hostname=${a} matchType=${c} matchedRoute=${d} propertyId=${r} failure=${u} errorName=${p} errorMessage=${m}`),new Error(m);return k()&&_.info(`[idVendors/integration/execute] vendorId=${t.vendorId} hostname=${a} matchType=${c} matchedRoute=${d} propertyId=${r}`),{status:s.completed,analytics:{vendorId:t.vendorId,propertyId:r,matchType:c,matchedRoute:d,hostname:a}}}});const Lo=pt([Ze,en,on,rn,ln,mn,vn,gn,bn,_n,An,$n,Po,No,On,Mn,zn,Kn,Zn,oo,so,lo,mo,vo,wo,To,xo,$o]);var Mo=new ut({scope:"analytics",object:"sampleRateFactors",action:"set",validators:{detail:{detail:ct,"detail.sampleRateFactors":dt}},handler:async({account:t,detail:{sampleRateFactors:e}})=>(t.update(C,(()=>e)),{status:s.completed})});const Uo=pt([new ut({scope:"analytics",object:"sampling",action:"set",validators:{detail:{detail:ct,"detail.rates":ct,"detail.rates.error":ct,"detail.rates.status":ct}},handler:async({detail:t})=>void 0===t?.rates?{status:s.cancelled}:(void 0!==t?.rates?.error&&vt.setEventSamplingRates({error:t?.rates?.error}),void 0!==t?.rates?.status&&vt.setEventSamplingRates({feature:t?.rates?.status}),{status:s.completed})}),new ut({scope:"log",object:"analytics",action:"setInterval",validators:{detail:{detail:tt,"detail.interval":Y}},handler:async({detail:t})=>(vt.setEventProcessingInterval(t.interval),{status:s.completed})}),Mo]);var qo=new ut({scope:"debug",object:"version",action:"show",handler:async({account:t,customEvent:e})=>({status:s.completed,value:{LIBRARY_VERSION:R}})});const Vo="debug/events/show",Fo="debug/prepend/add",Bo="debug/prepend/remove",zo="debug/store/show",Jo="ad/debugSession/start",Ho=new Map([[Vo,async({account:t})=>{const e=[...(null!=t.store.get(g)?t.store.get(g):[]).map((t=>({type:t.type,status:"created",detail:t.detail,timestamp:t.timeStamp}))),...t.queue.map((t=>({type:t.type,status:"created",detail:t.detail,timestamp:t.timeStamp}))),...(null!=t.store.get(g)?t.store.get(g):[]).map((t=>null!=t.statusEvents?t.statusEvents.map((e=>({type:t.type,status:e.type,detail:t.detail,timestamp:e.timeStamp}))):[])).flat(),...t.queue.map((t=>null!=t.statusEvents?t.statusEvents.map((e=>({type:t.type,status:e.type,detail:t.detail,timestamp:e.timeStamp}))):[])).flat()].filter((t=>!t.type.startsWith("debug/")));return e.sort(((t,e)=>t.timestamp-e.timestamp)),console.groupCollapsed(`⌂ Account ID: ${t.id}`),console.table(e),console.groupEnd(),s.completed}],[Fo,async({account:t,customEvent:n})=>{if(void 0===n.detail?.eventName)throw new Error("Missing event information");const o=t.read(e,{persist:!0})??"[]",a=JSON.parse(o),{eventName:i,eventDetail:r}=n.detail;return a.unshift({eventName:i,eventDetail:r}),t.write(e,JSON.stringify(a),{persist:!0}),s.completed}],["debug/prepend/clear",async({account:t})=>(t.delete(e,{persist:!0}),s.completed)],[Bo,async({account:t,customEvent:n})=>{if(void 0===n.detail?.eventName)throw new Error("Missing event information");const o=t.read(e,{persist:!0})??"[]",a=JSON.parse(o),{eventName:i}=n.detail,r=a.filter((t=>t.eventName!==i));return t.write(e,JSON.stringify(r),{persist:!0}),s.completed}],[zo,async({account:t})=>{const e=[...t.store.entries()];return console.groupCollapsed(`⌂ Account ID: ${t.id}`),console.table(e),console.groupEnd(),s.completed}],[Jo,async({account:e,customEvent:n})=>function(t){return t.status!==s.waiting}(n)&&(function(e,n){void 0!==e.detail?.minutes&&function(e,n){const o=new Date;e.write(t,o.setMinutes(Number(o.getMinutes())+Number(n.detail?.minutes)).toString(),{persist:!0})}(n,e),function(t){t.globalContext.apstagDEBUG=t.globalContext.apstagDEBUG??{},t.globalContext.apstagDEBUG.url=function(t){const e=new URL(t?.top?.location?.href??t?.document?.referrer);return e.searchParams.set("amzn_debug_mode","1"),e.toString()}(t.globalContext)}(n)}(n,e),function(t){return t.queue.filter((t=>t.type===Jo)).length>1}(e))?s.completed:function(e){const n=e.read(t,{persist:!0});return void 0!==n&&new Date>=new Date(Number(n))}(e)?(function(e){e.delete(t,{persist:!0}),function(t){delete t.globalContext.apstagDEBUG?.url}(e)}(e),s.completed):(function(t){t.record(Vo).catch((t=>{})),t.record(zo).catch((t=>{}))}(e),s.waiting)],["debug/listeners/show",async({systemAccount:t})=>{const e=[...t.store.get(y).entries()];return console.groupCollapsed("⌂ Listeners"),console.table(e),console.groupEnd(),s.completed}]]),Go=new Map([...Ho,...pt([qo])]);var Ko;!function(t){t[t.unspecifiedUnknown=0]="unspecifiedUnknown",t[t.lowEntropy=1]="lowEntropy",t[t.highEntropy=2]="highEntropy"}(Ko||(Ko={}));const Wo=["brands","mobile","platform"],Qo=["architecture","bitness","fullVersionList","model","platformVersion"];var Yo=new ut({scope:"deviceSignal",object:"sua",action:"set",validators:{context:{context:tt,...pn,"context.navigator":tt,"context.navigator.userAgentData":tt,"context.navigator.userAgentData.getHighEntropyValues":rt,"context.navigator.userAgentData.architecture":st(Z),"context.navigator.userAgentData.bitness":st(Z),"context.navigator.userAgentData.mobile":st(X),"context.navigator.userAgentData.model":st(Z),"context.navigator.userAgentData.platform":st(Z),"context.navigator.userAgentData.platformVersion":st(Z),"context.navigator.userAgentData.fullVersionList":st(ot),"context.navigator.userAgentData.fullVersionList[]":tt,"context.navigator.userAgentData.fullVersionList[].brand":Z,"context.navigator.userAgentData.fullVersionList[].version":Z,"context.navigator.userAgentData.brands":st(ot),"context.navigator.userAgentData.brands[]":tt,"context.navigator.userAgentData.brands[].brand":Z,"context.navigator.userAgentData.brands[].version":Z}},handler:async({account:t})=>{if(void 0===t.globalContext.apstag?.isGDPRRegion)return{status:s.waiting};const e="deviceSignal/sua",n=t.globalContext.navigator?.userAgentData,o=t.read(e,{persist:!0,throwOnDisallowed:!1});return"string"==typeof o?t.write(e,o):n instanceof Object&&function(t,e,n){t.write(e,JSON.stringify(Zo(n)))}(t,e,n),!1!==t.globalContext.apstag?.isGDPRRegion||"function"==typeof n?.getHighEntropyValues&&await async function(t,e,n){const o=await n.getHighEntropyValues([...Wo,...Qo]);return t.write(e,JSON.stringify(Zo(o)),{persist:!0,throwOnDisallowed:!1}),s.completed}(t,e,n),{status:s.completed}}});function Zo(t){const e={};let n;return e.architecture=t.architecture,e.bitness=t.bitness,e.mobile=t.mobile?1:0,e.model=t.model,e.source=(o=t,Qo.some((t=>o[t]))?Ko.highEntropy:Wo.some((t=>o[t]))?Ko.lowEntropy:Ko.unspecifiedUnknown),"string"==typeof t.platform&&(e.platform={brand:t.platform,version:t.platformVersion?.split(".")}),Array.isArray(t.fullVersionList)?n=t.fullVersionList:Array.isArray(t.brands)&&(n=t.brands),n instanceof Array&&(e.browsers=n.map((t=>({brand:t.brand,version:t.version?.split(".")})))),e;var o}const Xo=pt([Yo]),ta={key:"deviceSignal/cookieDeprecationLabel",default:void 0};var ea=new ut({scope:"deviceSignal",object:"cookieDeprecationLabel",action:"set",handler:async({account:t,customEvent:e})=>{const{cookieDeprecationLabel:n}=t.globalContext.navigator;if(void 0===n?.getValue||"function"!=typeof n.getValue)return{status:s.cancelled};const o=await t.executeFuncWithConsent(n,n.getValue);return void 0===o||""===o?{status:s.cancelled}:(t.update(ta,(()=>o)),{status:s.completed,analytics:{gcdl:o}})}});const na=pt([ea]),oa={key:"_monitoring/statusesByEventIdentifier",default:new Map};var aa=async({account:t,customEvent:e})=>{const n=e.detail?.eventIdentifier;if(void 0===n)throw new Error("Missing eventIdentifier parameter");const o=t.use(oa),a=`${e.type}:${n}`,i=o.get(a);return void 0!==i?i:s.waiting},ia=async({account:t,customEvent:e})=>{const n=e.detail?.eventIdentifier;if(void 0===n)throw new Error("Missing eventIdentifier parameter");const o=e.detail?.statusUpdate;if(void 0===o)throw new Error("Missing statusUpdate parameter");if(!(o in s))throw new Error(`Invalid statusUpdate parameter. Expected one of ${Object.values(s).join(", ")}`);const a=e.detail?.pairedEvents;if(void 0===a||a.length<1||a.some((t=>"string"!=typeof t)))throw new Error("Parameter pairedEvents must be a non-empty array of string");return a.forEach((e=>{const a=`${e}:${n}`;t.update(oa,(t=>t.set(a,o)))})),s.completed};const sa=new Map([["_monitor/testing/only",aa],["_update/testing/only",ia],["_legacy/bidRequest/monitor",aa],["_legacy/bidRequest/didComplete",ia]]);var ra=new ut({scope:"prebid",object:"analyticsEvent",action:"track",handler:async({account:t,customEvent:e})=>{if(void 0===e.detail?.eventType||void 0===e.detail?.eventArgs||void 0===e.detail?.config?.options?.accountID)return{status:s.cancelled};const n={eventType:e.detail.eventType,metadata:e.detail.metadata,config:e.detail.config},o=await t.globalContext.fetch("https://prod.us-east-1.cxm-bcn.publisher-services.amazon.dev/v1/events/prebid",ca(e.detail));return o.ok?{status:s.completed,analytics:n}:{status:s.cancelled,analytics:{...n,message:`Request failed: ${o.status}`}}}});const ca=t=>{const e={accountId:t.config.options.accountID,events:[{eventArgs:t.eventArgs,eventType:t.eventType}]};return{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}},da={key:"prebid/config",default:void 0};var la;!function(t){t.NotStarted="NOT STARTED",t.Loading="LOADING",t.Complete="COMPLETE"}(la||(la={}));const ua={key:"prebid/configRequestState",default:la.NotStarted};var pa=new ut({scope:"prebid",object:"config",action:"fetch",handler:async({account:t,customEvent:e})=>{const n=t.use(ua);if(n===la.Loading)return{status:s.waiting};const o={metadata:e?.detail?.metadata};if(n===la.Complete){const e=t.use(da);if(void 0!==e)return{status:s.completed,value:JSON.parse(e),analytics:o}}try{t.update(ua,(()=>la.Loading));const e=`https://c.amazon-adsystem.com/cdn/prod/config?src=${t.id}`,n=await t.globalContext.fetch(e);if(t.update(ua,(()=>la.Complete)),!n.ok)return{status:s.cancelled,analytics:{...o,message:"Config request failed"}};const a=await n.json(),i=ma(t,a);return t.update(da,(()=>JSON.stringify(i)),{persist:!0}),{status:s.completed,value:i,analytics:o}}catch(t){return{status:s.cancelled,analytics:{...o,message:t.message}}}}});const ma=(t,e)=>({analyticsConfig:{options:{accountID:t.id,sampling:e.pbjs?.sampleRate},includeEvents:e.pbjs?.allowedEvents},idConfig:{params:{accountID:t.id,enabled:e.pbjs?.enabled,treatments:e.pbjs?.treatments}}}),fa={key:"prebid/eidsConfig",default:"{}"};var ha;!function(t){t.APSSignalIQ="_apsIdTreatment",t.Audigent="hadronId",t.FirstID="firstId",t.ID5="id5id",t.Liveramp="idl_env",t.Lotame="lotamePanoramaId",t.Pubcommon="pubcid",t.Publink="publinkId",t.ThirtyThree="33acrossId",t.Yahoo="connectId"}(ha||(ha={}));const va=new Map([[nn,ha.Audigent],[cn,ha.FirstID],["id5",ha.ID5],[Pn,ha.Liveramp],[Gn,ha.Lotame],[ao,ha.Pubcommon],[ro,ha.Publink],[Qe,ha.ThirtyThree],[bo,ha.Yahoo]]),ya={[ha.Audigent]:{source:"audigent.com",atype:1},[ha.FirstID]:{source:"first-id.fr",atype:1},[ha.ID5]:{source:"id5-sync.com",atype:1},[ha.Liveramp]:{source:"liveramp.com",atype:3},[ha.Lotame]:{source:"crwdcntrl.net",atype:1},[ha.Pubcommon]:{source:"pubcid.org",atype:1},[ha.Publink]:{source:"epsilon.com",atype:3},[ha.ThirtyThree]:{source:"33across.com",atype:1},[ha.Yahoo]:{source:"yahoo.com",atype:3}};var ga=new ut({scope:"prebid",object:"eidsConfig",action:"get",handler:async({account:t,customEvent:e})=>{if(void 0===t.globalContext.apstag?._atsaaiod)return{status:s.waiting};t.update(fa,(()=>JSON.stringify({...ya})),{persist:!0});const n={metadata:e?.detail?.metadata,config:e?.detail?.config};return{status:s.completed,analytics:n}}});const wa=new Set(["CONTROL_HOLD_OUT","CLEAN",...va.keys()]);const ba={key:"prebid/ids",default:void 0};var Ea=new ut({scope:"prebid",object:"ids",action:"get",handler:async({account:t,customEvent:e})=>{if(void 0===t.globalContext.apstag?._atsaaiod)return{status:s.waiting};t.recordListenerNonBlocking(Po);const n=t.use(we);let o;void 0!==n&&(o=Object.fromEntries(Object.entries(n).map((([t,e])=>[va.get(t),e]))));const a=await t.recordListener(pa,{metadata:e?.detail?.metadata}),i={metadata:e?.detail?.metadata};return a.idConfig.params.enabled?(null!=a.idConfig.params.treatments&&(o=function(t,e){if(!function(t){const e=100===t.reduce(((t,{percent:e})=>t+e),0),n=t.reduce(((t,{treatment:e})=>t&&wa.has(e)),!0);return e&&n}(e))return t;const n=function(t){const e=100*Math.random();let n=0;for(const o of t)if(n+=o.percent,e<=n)return o.treatment;throw new Error("Invalid treatment percentages")}(e);return function(t,e){const n={[ha.APSSignalIQ]:e},o=va.get(e);switch(e){case"CONTROL_HOLD_OUT":return{...t,...n};case"CLEAN":return n;default:return void 0!==o&&void 0!==t?.[o]&&(n[o]=t[o]),n}}(t,n)}(o,a.idConfig.params.treatments)),t.update(ba,(()=>o)),{status:s.completed,value:o,analytics:i}):{status:s.cancelled,analytics:i}}});const Sa=pt([ra,pa,ga,Ea]),xa=t=>t===_a.noConsent?"AMZN-NoCookieConsent":"AMZN-Token";var _a;!function(t){t[t.noConsent=0]="noConsent",t[t.token=1]="token"}(_a||(_a={}));const Ra=t=>{t.setCookieStorage(xa(_a.token),"",0),t.setCookieStorage(xa(_a.noConsent),"",0)},Ia=({account:t,hashedRecords:e,ttl:n,isGDPRRegion:o,tcString:a,setToken:i})=>(Ra(t),"boolean"!=typeof i&&(i=!0),Aa({account:t,hashedRecords:e,ttl:n,isGDPRRegion:o,tcString:a}).then((({AIPToken:e,cookieExpiry:n})=>ka({AIPToken:e,cookieExpiry:n,account:t,setToken:i})))),Aa=({account:t,hashedRecords:e,ttl:n,isGDPRRegion:o,tcString:a})=>fetch("https://tk.amazon-adsystem.com/envelope",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ja({account:t,hashedRecords:e,ttl:n,isGDPRRegion:o,tcString:a}))}).then((t=>{if(!t.ok)throw new Error(`Token http status error: ${t.status}`);return t.json()})),ka=({AIPToken:t,cookieExpiry:e,account:n,setToken:o})=>{if("string"!=typeof t||"number"!=typeof e)throw new Error("Invalid AIPES response");if(""===t)throw n.setCookieStorage(xa(_a.noConsent),"1",e),new Error("Empty token");(o||"boolean"!=typeof o)&&n.setCookieStorage(xa(_a.token),t,e)},ja=({account:t,hashedRecords:e,ttl:n,isGDPRRegion:o,tcString:a})=>{const i={publisherId:t.id,hashedRecords:e};return void 0!==n&&(i.ttl=n),o?(i.gdpr=1,a&&(i.gdprConsent=a)):i.gdpr=0,i};var $a=new ut({scope:"ad",object:"record",action:"delete",handler:async({account:t})=>{if(!t.globalContext.apstag?._atsaaiod)return{status:s.waiting};if(!t.isAllowedToAccessInfoOnDevice())throw new Error("Not allowed to access storage on device");return Ra(t),{status:s.completed}}});const Ca={detail:tt,"detail.setCookie":st(X),"detail.config":tt,"detail.config.optOut":st(X),"detail.config.ttl":st(Y),"detail.config.gdpr":st(tt),"detail.config.gdpr.cmpTimeout":st(Y),"detail.config.gdpr.enabled":st(dt),"detail.config.gdpr.consent":st(Z),"detail.config.gdpr.cmpGlobal":st(Z),"detail.config.gdpr.cmpGlobalv2":st(Z),"detail.config.hashedRecords":ot,"detail.config.hashedRecords[]":tt,"detail.config.hashedRecords[].type":Z,"detail.config.hashedRecords[].record":Z,"detail.config.hashedRecords[].encrypted":st(Y),"detail.config.hashedRecords[].toJSON":ct,"detail.config.hashedRecords[].$$typeof":ct,"detail.config.hashedRecords[].constructor":ct,"detail.config.hashedRecords[].tagName":ct,"detail.config.hashedRecords[].@@__IMMUTABLE_ITERABLE__@@":ct,"detail.config.hashedRecords[].@@__IMMUTABLE_RECORD__@@":ct};var Oa,Pa,Da=new ut({scope:"ad",object:"record",action:"renew",validators:{detail:Ca,context:{context:tt}},handler:async({account:t,detail:e})=>{if(!t.globalContext.apstag?._atsaaiod)return{status:s.waiting};if(void 0===e?.config)throw new Error("Missing tokenConfig object");if(!t.isAllowedToAccessInfoOnDevice())throw new Error("Not allowed to access storage on device");if((t.readCookieStorage(xa(_a.token))??"").length>0)return{status:s.cancelled};const n=t.globalContext.apstag.isGDPRRegion,o=t.use(It);var a;return await(a={account:t,hashedRecords:e.config.hashedRecords,ttl:e.config.ttl,isGDPRRegion:n,tcString:o?.tcString},Ia(a)),{status:s.completed}}});!function(t){t.email="email"}(Oa||(Oa={})),function(t){t.Display="display",t.Video="video",t.MultiFormat="multi-format"}(Pa||(Pa={}));const Ta=/^[0-9a-fA-F]{64}$/,Na=t=>Ta.test(t||""),La=t=>t.then((t=>Array.from(new Uint8Array(t)).map((t=>t.toString(16).padStart(2,"0"))).join(""))).then((t=>"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"!==t?t:"")),Ma=(t,e)=>"string"==typeof t&&(e===Oa.email?/\S+@\S+\.\S+/.test(t)||Na(t):t.trim().length>0),Ua=(t,e,n)=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?Ma(e.value,n)?La(t.globalContext.crypto.subtle.digest("SHA-256",(new t.globalContext.TextEncoder).encode(e.value||""))):Promise.resolve(""):Ma(e.innerText,n)?La(t.globalContext.crypto.subtle.digest("SHA-256",(new t.globalContext.TextEncoder).encode(e.innerText||""))):Promise.resolve(""),qa=(t,e,n)=>{const o=t.readLocalStorage(e);return o&&Ma(o,n)?o:""},Va=(t,e,n)=>{n=n??t.globalContext.location.href,e=e.replace(/[[\]]/g,"\\$&");const o=new RegExp("[?&#]"+e+"(=([^&#?]*)|&|#|$)").exec(n);return Array.isArray(o)&&"string"==typeof o[2]&&0!==decodeURIComponent(o[2].replace(/\+/g," ")).trim().length&&Na(decodeURIComponent(o[2].replace(/\+/g," ")))?Promise.resolve(decodeURIComponent(o[2].replace(/\+/g," "))):new Promise((t=>t("")))};var Fa;!function(t){t.LOCAL_STORAGE="LOCAL",t.CSS_SELECTOR="CSS",t.URL="URL"}(Fa||(Fa={}));const Ba=(t,e={},n)=>{(t=>{const e={[Fa.LOCAL_STORAGE]:5,[Fa.URL]:4,[Fa.CSS_SELECTOR]:3},n={};t.forEach((t=>{n[t.method]=(n[t.method]||0)+1,t.priority=n[t.method]})),t.sort(((t,n)=>t.method===n.method?(t.priority||0)>(n.priority||0)?1:-1:e[t.method]>e[n.method]?-1:1))})(e.methods||[]);const o=[];let a;for(const i of e.methods||[]){const{method:e,target:s,type:r}=i;let c="";switch(e){case Fa.LOCAL_STORAGE:c=qa(t,s,r);break;case Fa.URL:o.push(Va(t,s).then((t=>({type:r,value:t}))));break;case Fa.CSS_SELECTOR:a=i}if(c.length>0)return void n({value:c,type:r})}const i=()=>{if(!a||!0!==a.isGlobalSubmit&&("string"!=typeof a.eventTarget||"string"!=typeof a.event))return void n(!1);const{eventTarget:e,target:o,type:i,isGlobalSubmit:s}=a,r=s?"submit":a.event;if("string"!=typeof r||0===r.length)return void n(!1);const c=a=>(({account:t,e:e,eventTarget:n,event:o,isGlobalSubmit:a,target:i,type:s,onDone:r,listener:c})=>{if(!(a||"window"===n||e.target&&"function"==typeof e.target.matches&&"string"==typeof n&&e.target.matches(n)))return void r(!1);let d;a&&e instanceof Event&&e.target&&(d=e.target.querySelectorAll('input[type="email"]')),((t,e,n,o)=>{const a=o||t.globalContext.document.querySelectorAll(e);if(0===a.length)return new Promise((t=>t("")));if(1===a.length)return Ua(t,a[0],n);const i=[];for(const e of a)i.push(Ua(t,e,n));return Promise.all(i).then((t=>{let e=null;for(const n of t)if(""!==n){if(null!==e&&("string"!=typeof e||e!==n))return"";e=n}return e??""}))})(t,i,s,d).then((e=>{"function"==typeof c&&t.globalContext.removeEventListener(o,c),r(!(e.length<1)&&{value:e,type:s})}))})({account:t,e:a,event:r,eventTarget:e,isGlobalSubmit:s,target:o,type:i,onDone:n,listener:c});t.globalContext.addEventListener(r,c)};if(0!==o.length)return Promise.all(o).then((t=>{for(const e of t)if(e.value.length>0)return void n(e);i()}));i()},za={called:!1};const Ja=pt([$a,Da,new ut({scope:"ad",object:"record",action:"rr",validators:{detail:{detail:tt,"detail.config":tt,"detail.config.$$typeof":ct,"detail.config.tagName":ct,"detail.config.@@__IMMUTABLE_ITERABLE__@@":ct,"detail.config.@@__IMMUTABLE_RECORD__@@":ct,"detail.config.accountID":st(Z),"detail.config.overrideLimit":st(X),"detail.config.methods":ot,"detail.config.methods[].tagName":ct,"detail.config.methods[]":it(tt),"detail.config.methods[].$$typeof":ct,"detail.config.methods[].@@__IMMUTABLE_ITERABLE__@@":ct,"detail.config.methods[].@@__IMMUTABLE_RECORD__@@":ct,"detail.config.methods[].type":at(Object.values(Oa)),"detail.config.methods[].method":at(Object.values(Fa)),"detail.config.methods[].target":st(Z),"detail.config.methods[].event":st(Z),"detail.config.methods[].eventTarget":st(Z),"detail.config.methods[].isGlobalSubmit":st(X),"detail.config.methods[].priority":st(Y)},context:{context:tt,"context.Promise":rt,"context.crypto":tt,"context.crypto.subtle":rt}},handler:async({account:t,detail:e})=>{if(!t.globalContext.apstag?._atsaaiod)return{status:s.waiting};if(!t.isAllowedToAccessInfoOnDevice())throw new Error("Not allowed to access storage on device");const n=await function(t,e){return new Promise(((n,o)=>{if(za.called&&!e.overrideLimit)throw new Error("rr should only be called once per page load");za.called=!0;let a=0;const i=()=>{const s=(()=>{const a=t.use(It);return(!t.globalContext.apstag?.isGDPRRegion||void 0!==a)&&(void 0===a||t.isAllowedToAccessInfoOnDevice()?(Ba(t,e,(e=>{if(!1===e)return n("no retrieval");Ia({account:t,hashedRecords:[{type:e.type,record:e.value}],source:"rr",tcString:a?.tcString}).then((()=>{n("token generated")})).catch(o)}))?.catch(o),!0):"canceled")})(),r=a>6400;if(s||r)return"canceled"===s&&o(new Error("tcf timeout")),void(r&&o(new Error("interval over")));setTimeout(i,a),a=0===a?200:2*a};i()}))}(t,e.config);return{status:s.completed,analytics:{rr:n}}}}),new ut({scope:"ad",object:"record",action:"update",validators:{detail:Ca,context:{context:tt}},handler:async({account:t,detail:e})=>{if(!t.globalContext.apstag?._atsaaiod)return{status:s.waiting};if(!t.isAllowedToAccessInfoOnDevice())throw new Error("Not allowed to access storage on device");const n=t.globalContext.apstag.isGDPRRegion,o=t.use(It);return e.config.optOut?Ra(t):await Ia({account:t,hashedRecords:e.config.hashedRecords,ttl:e.config.ttl,isGDPRRegion:n,tcString:o?.tcString,setToken:e?.setCookie}),{status:s.completed}}})]),Ha=new Map([["ad/ASRSlot/render",async({account:t,customEvent:e})=>{if(void 0===e.detail?.id||void 0===e.detail?.targeting)throw new Error("Missing event detail");return((t,e,n,o)=>{const a=n.globalContext.document.createElement("iframe"),i=e.get("amznsz")?.split("x"),s=e.get("amzniid"),r=t;if(void 0===s||void 0===r||void 0===i||i.length<2)return;a.style.marginLeft="0",a.style.marginTop="0",a.style.height=`${i[1]}px`,a.style.width="100%",a.setAttribute("scrolling","no"),a.setAttribute("frameborder","0");const c=n.globalContext.document.createElement("div"),d=o?.location??"afterend",l=n.globalContext.document.getElementById(r);if(null==l)return;l.insertAdjacentElement(d,c),c.appendChild(a);const u=a?.contentWindow?.document;void 0!==u&&(u.open(),u.write('