(()=>{"use strict";var e={293:(e,t,r)=>{r.d(t,{qV:()=>i,wu:()=>o});let n=["#zephr-payment-form-root",".zephr-payment-form","#im-subscription-form",".zephr-form-container"],o=e=>{let t=e||("undefined"!=typeof document?document:null);return t&&"function"==typeof t.querySelector?n.reduce((e,r)=>e||t.querySelector(r),null):null},i=()=>{if("undefined"==typeof window||"undefined"==typeof document)return!1;let e=o();return!!e&&!!e?.querySelector('input:not([type="hidden"]), select, textarea, iframe')}},536:(e,t,r)=>{r.d(t,{initCheckoutInactivityTimeout:()=>c});var n=r(958),o=r(787),i=r(293);let a=["matchofthedaymagazine","easycookmagazine","topgearmagazine"],s=e=>()=>{let t=((e=window.location.host||"")=>a.some(t=>e.includes(t))?"/":"/subscribe/")(),r=((e=window.location.host||"")=>{let t=((e=window.location.host||"")=>{let t=e.toLowerCase();return t.includes("bbcgoodfood")?"bbcgoodfood":t.includes("goodfood")?"goodfood":t.includes("historyextra")?"historyextra":t.includes("radiotimes")?"radiotimes":t.includes("gardenersworld")?"gardenersworld":t.includes("madeformums")?"madeformums":t.includes("olivemagazine")||t.includes("olive")?"olive":t.includes("easycookmagazine")||t.includes("easycook")?"easycook":t.includes("topgearmagazine")||t.includes("topgear")?"topgear":t.includes("matchofthedaymagazine")||t.includes("matchoftheday")?"matchoftheday":null})(e);return t?n.r2.has(t)?"print_plus_digital":n.$K.has(t)?((e=document)=>{let t=Array.from(e.querySelectorAll('[role="tab"][aria-selected="true"], [aria-pressed="true"], input[type="radio"]:checked, .is-active, .active, .selected')).map(e=>"INPUT"===e.tagName&&"radio"===e.type&&e.id?document.querySelector(`label[for="${e.id}"]`)?.textContent||"":e.textContent||"").join(" ").replace(/\s+/g," ").toLowerCase(),r=(e.textContent||"").replace(/\s+/g," ").toLowerCase(),n=t||r;return/print\s*\+\s*digital|magazine\s*\+\s*digital|print\s*&\s*digital/.test(n)?"print_plus_digital":/\bdigital\b/.test(n)?"digital":""})((0,i.wu)()||document):"":""})();e.fixedTimerId&&clearTimeout(e.fixedTimerId),e.fixedTimerId=null,document.querySelectorAll("input, select, textarea").forEach(e=>{if("INPUT"===e.tagName&&"hidden"===e.type)return;let{type:t}=e;"checkbox"===t||"radio"===t?e.checked=!1:e.value="",e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))}),(0,o.Z)(n.Nx,{redirect_url:t,timeout_ms:6e5,product_type:r});try{window.location.replace(t)}catch{window.location.href=t}},c=()=>{if(!(0,i.qV)())return null;let e={fixedTimerId:null},t=s(e);return e.fixedTimerId=setTimeout(t,6e5),e}},787:(e,t,r)=>{r.d(t,{Z:()=>n});let n=(e,t={})=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:e,...t})}},958:(e,t,r)=>{r.d(t,{$K:()=>o,BQ:()=>m,DL:()=>h,JB:()=>b,JQ:()=>y,LK:()=>v,Nx:()=>p,RQ:()=>g,T2:()=>l,Tn:()=>I,b3:()=>d,c:()=>c,dW:()=>i,do:()=>w,j0:()=>s,r2:()=>n,s6:()=>C,uL:()=>a,vD:()=>L,vr:()=>f,wS:()=>u,zP:()=>S});let n=new Set(["olive","easycook","topgear","matchoftheday"]),o=new Set(["historyextra","radiotimes","gardenersworld","goodfood","bbcgoodfood"]),i="zephr_page_load",a="zephr_form_button_press",s="zephr_form_view",c="zephr_form_render",u="zephr_form_plan_select",l="zephr_form_register",d="zephr_form_purchase",p="zephr_checkout_inactivity_timeout_redirect",f="5f8580a91d467d132d0ac62d",m=[1,5,6,8,9,10,11],h="/plugins/public/custom-segments/update-custom-segments",y="zephrTrackingConsent",g="zephr:unknown-user-tracking-consent",w=[1,3,4,5,6,8,9,10,11],v="602140eba228631361059572",b=[1,3,5,7,8,9,10],I=361,S=["Zephr","StoreOnDevice","BasicAd","CreatePersonalizedAds","SelectPersonalizedAds","CreatePersonalizedContentProfile","SelectPersonalizedContent","AdPerformance","ContentPerformance","MarketResearch","DevelopProducts","LimitedDataSelectContent"],L={Zephr:[1,5,6,8,9,10,11],StoreOnDevice:[1],BasicAd:[2],CreatePersonalizedAds:[3],SelectPersonalizedAds:[4],CreatePersonalizedContentProfile:[5],SelectPersonalizedContent:[6],AdPerformance:[7],ContentPerformance:[8],MarketResearch:[9],DevelopProducts:[10],LimitedDataSelectContent:[11]},C=Object.freeze({bbcgoodfood:"gf",gardenersworld:"gw",historyextra:"hex",madeformums:"mfm",olivemagazine:"ol",radiotimes:"rt",matchofthedaymagazine:"motd",topgearmagazine:"tg",easycookmagazine:"ezc"});Object.freeze({track:"track",page:"page",identity:"identity"})}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{createInstance:()=>oL,run:()=>oC});var o=function(e){try{return JSON.parse(e)}catch(e){}return null};let i="undefined"==typeof Proxy?console:new Proxy({},{get:(e,t)=>(...r)=>{window.IM=window.IM||{},window.IM.logger=window.IM.logger||{queue:[]},e[t]&&e[t](...r),window.IM.logger.queue.push(()=>{let n=window.IM,o=n.logger?.withName;if(!o)return;let i=o("zephr");Object.assign(e,i),i[t]?.(...r)})}}),a=["/subscriptions","/account-settings"],s="zephr-target-ready",c=()=>new Promise(e=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>e())})}),u=async()=>{let e=await new Promise(e=>{let t,r,n=!1,o=o=>{n||(n=!0,window.clearInterval(t),window.clearTimeout(r),e(o))},a=()=>{if(window.waitHydration&&"function"==typeof window.waitHydration.then)return window.clearInterval(t),window.clearTimeout(r),void window.waitHydration.then(()=>o("waitHydration")).catch(e=>{i.warn("waitHydration promise rejected:",e),o("waitHydration-rejected")});!0===window.waitHydrationReady&&o("waitHydrationReady")};t=window.setInterval(a,25),r=window.setTimeout(()=>o(null),2e3),a()});if(i.debug(`Hydration hook check completed with source: ${e}`),"waitHydration"===e||"waitHydrationReady"===e)return i.debug(`React hydration complete via ${e}`),void await c();"waitHydration-rejected"===e&&i.warn("FES hydration hook failed, falling back to load-based gating.");let t=await new Promise(e=>{let t,r=!1,n=()=>{},o=o=>{r||(r=!0,window.clearTimeout(t),window.removeEventListener("hydration-complete",n),e(o))};n=()=>{o("hydration-complete-event")},window.addEventListener("hydration-complete",n,{once:!0}),new Promise(e=>{"complete"!==document.readyState?window.addEventListener("load",()=>e(),{once:!0}):e()}).then(c).then(()=>{o("window-load")}),t=window.setTimeout(()=>{o("timeout")},5e3)});i.debug(`React hydration complete via ${t}`),"timeout"!==t?await c():await new Promise(e=>{window.setTimeout(e,250)})},l=()=>new Promise(e=>{let t=async()=>{i.debug("DOM ready triggered, waiting for React hydration..."),await u(),i.debug("React hydration confirmed, resolving onDOMReady"),e()};"interactive"!==document.readyState&&"complete"!==document.readyState?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}),d=()=>(()=>{let{pathname:e=""}=window.location||{};return a.some(t=>e.startsWith(t))})()?Array.from(document.querySelectorAll('[id^="zephr-my-account-"]')):Array.from(new Set([...Array.from(document.querySelectorAll(".zephr-form-container > .zephr-form")),...Array.from(document.querySelectorAll('[id^="zephr-"]'))])),p=()=>{let e=d();return e.length>0?Promise.resolve(e):new Promise(e=>{let t=[],r=()=>{let r=d();r.length&&(t.forEach(e=>e()),e(r))},n=new MutationObserver(()=>{r()});t.push(()=>n.disconnect()),document.body&&n.observe(document.body,{childList:!0,subtree:!0});let o=()=>{i.info("Received zephr-target-ready event."),r()};window.addEventListener(s,o),t.push(()=>window.removeEventListener(s,o)),r()})},f=e=>{"undefined"!=typeof performance&&"function"==typeof performance.mark&&performance.mark(e)},m=(e,t,r)=>{if("undefined"!=typeof performance&&"function"==typeof performance.measure)try{performance.measure(e,t,r)}catch(t){i.warn(`Unable to measure ${e}`,t)}},h=e=>{"undefined"!=typeof window&&window.LUX?Object.entries(e).forEach(([e,t])=>{window.LUX.addData(e,t)}):i.warn("[Zephr GTM] SpeedCurve not available (window.LUX missing)")},y=(e,t)=>{if("undefined"!=typeof performance)try{performance.mark(e),"undefined"!=typeof window&&window.LUX&&void 0!==t&&window.LUX.addData(e,t)}catch(t){i.warn(`[Zephr GTM] Failed to create performance marker: ${e}`,t)}};var g=r(787),w=r(958);let v="zephr:session-id",b=["blaize_session"],I=()=>document.cookie.split(";").reduce((e,t)=>{let r=t.trim(),n=r.indexOf("="),o=n>=0?r.slice(0,n):r,i=n>=0?r.slice(n+1):"";if(o)try{e[o]=decodeURIComponent(i)}catch{e[o]=i}return e},{}),S=e=>"object"==typeof e&&null!==e,L=e=>{try{return JSON.parse(e)}catch{return null}},C=e=>{try{let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=t.padEnd(4*Math.ceil(t.length/4),"=");return JSON.parse(window.atob(r))}catch{return null}},A=e=>{let t=I(),r=e.find(e=>!!t[e]);return r?t[r]:null},T=async()=>{if("function"!=typeof fetch||"1"!==I().IMOLOGIN)return null;try{let e=await (async e=>{let t;let r=new Promise((e,r)=>{t=window.setTimeout(()=>{r(Error("timeout after 800ms"))},800)});try{return await Promise.race([e,r])}finally{window.clearTimeout(t)}})((async()=>{let e=await fetch("/api/auth/me",{credentials:"include"});return e.ok?e.json():(i.warn("Zephr identity: /api/auth/me returned non-OK response",{status:e.status}),null)})()),t=e?.user||e;return[t?.fabric_user_id,t?.guid,t?.id].find(e=>"string"==typeof e&&e.length>0)||null}catch(e){return i.warn("Zephr identity: failed to resolve authenticated user id via /api/auth/me",{error:e}),null}},P=()=>{let e=A(b);return e?((e,t)=>{let r=e;try{r=decodeURIComponent(e)}catch{r=e}return t.filter(e=>1===e.length).map(([e])=>e).find(e=>e===r)?r:[L(r),C(r)].filter(S).map(e=>t.reduce((t,r)=>t||((e,t)=>{let r=t.reduce((e,t)=>S(e)&&void 0!==e[t]?e[t]:null,e);return"string"==typeof r&&r.length>0?r:null})(e,r),null)).find(e=>!!e)||null})(e,[["tracking_id"],["session_id"],["anonymous_id"],["id"],["tracking","id"],["session","id"]])||e:null},O=()=>{let e=(e=>{try{return window[e]}catch(t){return void i.warn("Zephr identity: failed to access storage scope",{scope:e,error:t})}})("sessionStorage"),t=((e,t)=>{if(!e)return null;try{return e.getItem(t)}catch(e){return i.warn("Zephr identity: failed to read storage value",{key:t,error:e}),null}})(e,v);if(t)return t;let r="undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():`zid-${Date.now()}-${Math.random().toString(36).slice(2,12)}`;return((e,t,r)=>{if(e)try{e.setItem(t,r)}catch(e){i.warn("Zephr identity: failed to persist storage value",{key:t,error:e})}})(e,v,r),r},E=async()=>({stableUserId:(()=>{let e=window.IM?.user;return e?.fabric_user_id?e.fabric_user_id:e?.guid?e.guid:null})()||await T(),sessionId:P()||O()}),_=null,z={paywall:44,registration_wall:43,meter:41},M=e=>z[e]??44,R=({action:e,userState:t,increaseRA:r,wId_2:n=[],actionValue:o})=>{if(!window.ZITFunctions)return void i.debug("ZITFunctions not available, skipping AI Paywall sendData");if("function"!=typeof window.ZITFunctions.sendData)return void i.warn("ZITFunctions.sendData is not a function");let a=(()=>{let e=A(["blaize_jwt"]);if(!e)return null;let t=e.split(".")[1];if(!t)return null;let r=C(t);if(!S(r))return null;let n=r.IM;return"string"==typeof n&&n.length>0?n:null})()||A(b),s={brandId:window.ZITFunctions.brandId,action:e,wId_2:n,dtId:window.ZITFunctions.retrieveOrigSession(),refer:document.referrer,requestUrl:window.location.href,content:{increaseRA:r},user:{userState:t,...a?{userId:a}:{}},..._?{context:{countryCode:_}}:{},...void 0!==o?{actionValue:o}:{}};i.debug("Sending AI Paywall data",{action:e});try{window.ZITFunctions.sendData(s)}catch(e){i.warn("ZITFunctions.sendData threw an error",e)}},k=function(e){window.performance.getEntriesByName(e,"mark").some(function(t){return t.name===e})||window.performance.mark(e)};function D(e){return(D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Z(){Z=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(t,r,n,i){var a,s,c=Object.create((r&&r.prototype instanceof y?r:y).prototype);return o(c,"_invoke",{value:(a=new P(i||[]),s=p,function(r,o){if(s===f)throw Error("Generator is already running");if(s===m){if("throw"===r)throw o;return{value:e,done:!0}}for(a.method=r,a.arg=o;;){var i=a.delegate;if(i){var c=function t(r,n){var o=n.method,i=r.iterator[o];if(i===e)return n.delegate=null,"throw"===o&&r.iterator.return&&(n.method="return",n.arg=e,t(r,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=TypeError("The iterator does not provide a '"+o+"' method")),h;var a=d(i,r.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,h;var s=a.arg;return s?s.done?(n[r.resultName]=s.value,n.next=r.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):s:(n.method="throw",n.arg=TypeError("iterator result is not an object"),n.delegate=null,h)}(i,a);if(c){if(c===h)continue;return c}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(s===p)throw s=m,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s=f;var u=d(t,n,a);if("normal"===u.type){if(s=a.done?m:"suspendedYield",u.arg===h)continue;return{value:u.arg,done:a.done}}"throw"===u.type&&(s=m,a.method="throw",a.arg=u.arg)}})}),c}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",f="executing",m="completed",h={};function y(){}function g(){}function w(){}var v={};u(v,a,function(){return this});var b=Object.getPrototypeOf,I=b&&b(b(O([])));I&&I!==r&&n.call(I,a)&&(v=I);var S=w.prototype=y.prototype=Object.create(v);function L(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function C(e,t){var r;o(this,"_invoke",{value:function(o,i){function a(){return new t(function(r,a){!function r(o,i,a,s){var c=d(e[o],e,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==D(l)&&n.call(l,"__await")?t.resolve(l.__await).then(function(e){r("next",e,a,s)},function(e){r("throw",e,a,s)}):t.resolve(l).then(function(e){u.value=e,a(u)},function(e){return r("throw",e,a,s)})}s(c.arg)}(o,i,r,a)})}return r=r?r.then(a,a):a()}})}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function O(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:O(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),h}},t}function N(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}var x,j,F=(x=Z().mark(function e(){return Z().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,t){window.__tcfapi("addEventListener",2,function(r,n){if(!n)return t(Error("Consent Management | Error retrieving data from TCFAPI"));k("onConsentReady-init"),["useractioncomplete","tcloaded"].includes(r.eventStatus)&&(r.cmpCustomData={},window.__tcfapi("getCustomVendorConsents",2,function(t){r.cmpCustomData=t,window.__tcfapi("removeEventListener",2,function(e){e||console.error("Consent Management | Failed to remove event listener",{listenerId:r.listenerId})},r.listenerId),k("onConsentReady-end"),window.performance.measure("onConsentReady-total-time","onConsentReady-init","onConsentReady-end"),e(r)}))})}));case 1:case"end":return e.stop()}},e)}),j=function(){var e=this,t=arguments;return new Promise(function(r,n){var o=x.apply(e,t);function i(e){N(o,r,n,i,a,"next",e)}function a(e){N(o,r,n,i,a,"throw",e)}i(void 0)})},function(){return j.apply(this,arguments)}),U={1:{sourcepointPurposeId:"611e5f6b945e2b06ba7e7f21"},2:{sourcepointPurposeId:"611e5f6b945e2b06ba7e7f4b"},3:{sourcepointPurposeId:"611e5f6b945e2b06ba7e7f76"},4:{sourcepointPurposeId:"611e5f6b945e2b06ba7e7f9e"},5:{sourcepointPurposeId:"611e5f6b945e2b06ba7e7fc5"},6:{sourcepointPurposeId:"611e5f6b945e2b06ba7e7fd3"},7:{sourcepointPurposeId:"611e5f6b945e2b06ba7e7fe0"},8:{sourcepointPurposeId:"611e5f6b945e2b06ba7e800e"},9:{sourcepointPurposeId:"611e5f6b945e2b06ba7e801f"},10:{sourcepointPurposeId:"611e5f6b945e2b06ba7e803a"},11:{sourcepointPurposeId:"654baa0ad1b2a504bc8df776"},12:{sourcepointPurposeId:"657192cd4c17e706f156c006"}};let G=function(e){var t,r,n,o=e.tcdata,i=e.purposes,a=void 0===i?[]:i,s=e.vendorIds,c=void 0===s?[]:s;if(!o)return!1;var u=o.purpose,l=o.vendor,d=o.cmpCustomData,p=null!==(t=null==u?void 0:u.consents)&&void 0!==t?t:{},f={iabVendors:null!==(r=null==l?void 0:l.consents)&&void 0!==r?r:{},sourcePointVendors:null!==(n=null==d?void 0:d.consentedVendors)&&void 0!==n?n:[]},m=Array.isArray(a)?a.reduce(function(e,t){var r,n=null===(r=U[t])||void 0===r?void 0:r.sourcepointPurposeId;return void 0!==n&&(e[t]=n),e},{}):{};return m[12]=m[12]||"657192cd4c17e706f156c006",[0===a.length||a.every(function(e){var t;return!0===p[e]||(null==d||null===(t=d.consentedPurposes)||void 0===t?void 0:t.some(function(t){return t._id===m[e]}))}),0===c.length||c.every(function(e){return void 0!==f.iabVendors[e]?!0===f.iabVendors[e]:f.sourcePointVendors.some(function(t){return t._id===e})})].every(Boolean)},B={segment:{vendorId:w.LK,purposes:w.do},zephr:{vendorId:w.vr,purposes:w.BQ},permutive:{vendorId:w.Tn,purposes:w.JB}},V=async e=>{let t=B[e],r="zephr"===e?"Zephr: ":"";if(!t)return i.warn(`${r}Consent check: Unknown vendor "${e}"`),!1;try{i.info(`${r}Waiting for consent ready (onConsentReady)...`);let n=await F();i.info(`${r}Consent ready received, checking requisite consent`);let o=void 0!==t.vendorId?[t.vendorId]:[],a=G({tcdata:n,purposes:t.purposes,vendorIds:o});return i.info(`${r}Consent check for ${e}`,{consent:a}),a}catch(t){return i.error(`${r}Error checking consent for ${e}`,t),!1}},H=new Set([10000008,10000012]),K=e=>{(()=>{let e="1"===new URLSearchParams(window.location.search).get("zephrDebug"),t="1"===window.localStorage.getItem("zephrDebug");return e||t})()&&(window.__zephrPermutiveDebug=e,window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"permutive_debug",...e}))},$=async()=>{if(!await V("permutive"))return i.info("Permutive: user has not consented, skipping segment update."),void K({consentGranted:!1,sent:!1,reason:"consent_denied",rawSegmentCount:0,mappedSegments:[]});await new Promise(e=>{let t=0,r=()=>{let n=window.permutive;if(n&&"function"==typeof n.segments){let t=!1,r=setTimeout(()=>{t||(t=!0,i.warn("Permutive: segments() callback timed out, skipping segment update."),K({consentGranted:!0,sent:!1,reason:"callback_timeout",rawSegmentCount:0,mappedSegments:[]}),e())},5e3);return void n.segments(n=>{if(t)return;t=!0,clearTimeout(r);let o=n?.length||0,a=Array.from(new Set(n||[])).map(e=>Number(e)).filter(e=>Number.isFinite(e)&&H.has(e));if(!a.length)return i.info("Permutive: no mapped segments for user, skipping update."),K({consentGranted:!0,sent:!1,reason:"no_mapped_segments",rawSegmentCount:o,mappedSegments:a}),void e();let s=new XMLHttpRequest;s.open("POST","/plugins/public/permutive/update-segments",!0),s.setRequestHeader("Content-Type","application/json"),s.withCredentials=!0,s.timeout=2500,s.onload=()=>{s.status>=200&&s.status<300?(i.info("Permutive: segments sent to Zephr.",{count:a.length}),K({consentGranted:!0,sent:!0,reason:"sent",rawSegmentCount:o,mappedSegments:a,status:s.status})):(i.warn("Permutive: failed to send segments to Zephr.",{status:s.status}),K({consentGranted:!0,sent:!1,reason:"request_failed",rawSegmentCount:o,mappedSegments:a,status:s.status})),e()},s.onerror=()=>{i.warn("Permutive: failed to send segments to Zephr."),K({consentGranted:!0,sent:!1,reason:"request_error",rawSegmentCount:o,mappedSegments:a}),e()},s.ontimeout=()=>{i.warn("Permutive: request to Zephr timed out, skipping segment update."),K({consentGranted:!0,sent:!1,reason:"request_timeout",rawSegmentCount:o,mappedSegments:a}),e()},s.send(JSON.stringify(a))})}(t+=1)<10?setTimeout(r,500):(i.warn("Permutive: SDK not found after 5s, skipping segment update."),K({consentGranted:!0,sent:!1,reason:"sdk_missing",rawSegmentCount:0,mappedSegments:[]}),e())};r()})},W=/(paywall|metering|lock|registration)/i,q=new Map,Y=(e,t)=>({...e?{stable_user_id:e}:{},session_id:t}),J=(e,t)=>e?t.length?"subscribed":"registered":"anonymous",Q=(e,t,r=null)=>"registration_wall"===r||"registered"===e?"registration_wall":Object.values(t.meters||{}).some(e=>e.decrementedInDecision||e.usedInDecision)?"meter":"paywall",X=(e,t={})=>!!Object.values(e.meters||{}).some(e=>e.usedInDecision||e.decrementedInDecision)||Object.keys(t).length>0,ee=()=>{let e=window?.Zephr||{},t=e?.outcomes||{},r=e?.accessDetails||{};return{activeState:Object.entries(t).filter(([e,t])=>{if(!t?.outcomeLabel)return i.warn("[Zephr GTM] No outcomeLabel found for rule:",e),!1;let r=t.outcomeLabel.toLowerCase();return!r.startsWith("show ")&&"leave-pristine"!==r}).map(([e,t])=>({ruleId:e,zephrMeta:t,accessDetails:r}))}},et=new Set(["tcloaded","useractioncomplete"]),er=e=>{e&&"function"==typeof window.__tcfapi&&window.__tcfapi("removeEventListener",2,t=>{t||i.warn("Failed to remove TCF listener",{listenerId:e})},e)},en=async()=>"function"!=typeof window.__tcfapi?(i.info("CMP not available - continuing without TCF gate."),{reason:"tcfapi-unavailable",tcdata:null}):new Promise(e=>{window.__tcfapi("addEventListener",2,(t,r)=>{if(!r||!t)return;let{eventStatus:n,listenerId:o}=t;"cmpuishown"!==n?n&&et.has(n)&&(i.info(`CMP resolved (${n}) - Zephr may continue.`),er(o),e({reason:n,tcdata:t})):i.info("CMP UI shown - waiting for user consent resolution before Zephr starts.")})}),eo=null,ei=!1,ea=()=>{try{let e=document.cookie.split(";").reduce((e,t)=>{let[r,n]=t.trim().split("=");return r&&(e[r]=n??""),e},{}).IMOLOGIN,t="1"===e;return i.info("Zephr: Checking user authentication",{imoLoginValue:e,isAuthenticated:t,hasCookie:void 0!==e}),t}catch(e){return i.error("Zephr: Error checking user authentication:",e),!1}},es=async()=>{if(!ea())return i.info("Zephr: User is not authenticated; skipping Zephr consent sync"),!1;try{let e=await (async()=>{try{i.info("Zephr: Waiting for consent framework to be ready...");let e=await F();i.info("Zephr: Consent framework ready, building granular consent");let t=Object.entries(w.vD).reduce((t,[r,n])=>{try{let o=G({tcdata:e,purposes:n,vendorIds:[w.vr]});i.debug(`Zephr: Consent for ${r} (IAB ${n}):`,o),t[r.toLowerCase()]=o}catch(e){i.error(`Zephr: Error checking consent for ${r}:`,e),t[r.toLowerCase()]=!1}return t},{});return i.info("Zephr: Granular Zephr consent data built:",t),t}catch(t){i.error("Zephr: Error building granular consent data:",t);let e=w.zP.reduce((e,t)=>(e[t.toLowerCase()]=!1,e),{});return i.info("Zephr: Using fallback consent (all false)"),e}})();i.info("Zephr: Syncing consent to Zephr via /blaize/profile",{consentData:e});let{hostname:t}=(()=>{let{hostname:e}=window.location,t=Object.keys(w.s6).find(t=>e.includes(t)),r=t&&w.s6[t]||"unknown",n="production";"localhost"===e||e.startsWith("local.")||e.endsWith(".local")?n="local":e.includes("staging")||e.includes("develop")?n="staging":(e.includes("release")||e.includes("test"))&&(n="preproduction");let o="javascript";return{hostname:e,brandCode:r,environment:n,connectionType:o,sourceName:`${r}_${n}_${o}`}})()||{};if(!t)return i.error("Zephr: Unable to resolve Zephr sync hostname from source config"),!1;let r=await fetch(`https://${t}/blaize/profile`,{method:"PATCH",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)});if(i.debug("Zephr: Zephr consent API response status:",r.status),!r.ok)return!1;let n=await r.json();return i.info("Zephr: Successfully synced consent to Zephr:",n),!0}catch(e){return i.error("Zephr: Network error while calling Zephr API:",e),!1}},ec=()=>{if(eo)return eo;i.info("Zephr: Setting up consolidated consent synchronization");let e=null,t=null;return eo=(()=>{let r;return"function"!=typeof window.__tcfapi?()=>{}:(window.__tcfapi("addEventListener",2,(n,o)=>{o&&n&&(r=n.listenerId||r,n.eventStatus&&et.has(n.eventStatus)&&(async r=>{let n=r?.tcString||null,o=ea(),a=!0===t&&!o;if(a||!n||n!==e){if(o&&!ei)return i.info("Zephr: Ignoring consent event until initial sync has completed"),e=n,void(t=o);if(e=n,t=o,o)return i.info("Zephr: Consent change detected - syncing Zephr profile"),void await es();i.info("Zephr: Consent change detected - syncing unknown-user custom segment"),await (async({force:e=!1}={})=>{if(ea())return i.info("Zephr: User is authenticated; skipping unknown-user custom segment sync"),!1;try{let t=`${await (async()=>{try{i.info("Zephr: Calling hasConsentForVendor");let e=await V("zephr");return i.info("Zephr: hasConsentForVendor returned",{result:e}),e}catch(e){return i.error("Zephr: Error checking Zephr requisite consent",e),!1}})()}`,r=(()=>{try{return window.sessionStorage.getItem(w.RQ)}catch(e){return i.info("Zephr: Unable to read unknown-user consent cache",e),null}})();if(!e&&r===t)return i.info("Zephr: Unknown-user consent value unchanged; skipping custom segment sync"),!1;i.info("Zephr: Syncing unknown-user custom segment consent",{segmentValue:t,force:e});let n=await fetch(w.DL,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({customSegments:{[w.JQ]:[t]}})});return n.ok?((e=>{try{window.sessionStorage.setItem(w.RQ,e)}catch(e){i.info("Zephr: Unable to persist unknown-user consent cache",e)}})(t),i.info("Zephr: Unknown-user custom segment synced successfully",{segmentValue:t}),!0):(i.info("Zephr: Unknown-user custom segment sync failed",{status:n.status}),!1)}catch(e){return i.error("Zephr: Network error while syncing unknown-user custom segment",e),!1}})({force:a})}else i.info("Zephr: Ignoring duplicate consent change event")})(n))}),()=>er(r))})()};var eu="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{};function el(e){var t={exports:{}};return e(t,t.exports),t.exports}var ed=function(e){return e&&e.Math===Math&&e},ep=ed("object"==typeof globalThis&&globalThis)||ed("object"==typeof window&&window)||ed("object"==typeof self&&self)||ed("object"==typeof eu&&eu)||ed("object"==typeof eu&&eu)||function(){return this}()||Function("return this")(),ef=function(e){try{return!!e()}catch(e){return!0}},em=!ef(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}),eh=!ef(function(){var e=(function(){}).bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}),ey=Function.prototype,eg=ey.call,ew=eh&&ey.bind.bind(eg,eg),ev=eh?ew:function(e){return function(){return eg.apply(e,arguments)}},eb="object"==typeof document&&document.all,eI=void 0===eb&&void 0!==eb?function(e){return"function"==typeof e||e===eb}:function(e){return"function"==typeof e},eS=function(e){return null==e},eL=TypeError,eC=function(e){if(eS(e))throw new eL("Can't call method on "+e);return e},eA=Object,eT=function(e){return eA(eC(e))},eP=ev({}.hasOwnProperty),eO=Object.hasOwn||function(e,t){return eP(eT(e),t)},eE=Function.prototype,e_=em&&Object.getOwnPropertyDescriptor,ez=eO(eE,"name"),eM={EXISTS:ez,PROPER:ez&&"something"===(function(){}).name,CONFIGURABLE:ez&&(!em||em&&e_(eE,"name").configurable)},eR=Object.defineProperty,ek=function(e,t){try{eR(ep,e,{value:t,configurable:!0,writable:!0})}catch(r){ep[e]=t}return t},eD=el(function(e){var t="__core-js_shared__",r=e.exports=ep[t]||ek(t,{});(r.versions||(r.versions=[])).push({version:"3.36.1",mode:"global",copyright:"\xa9 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE",source:"https://github.com/zloirock/core-js"})}),eZ=ev(Function.toString);eI(eD.inspectSource)||(eD.inspectSource=function(e){return eZ(e)});var eN,ex,ej=eD.inspectSource,eF=ep.WeakMap,eU=eI(eF)&&/native code/.test(String(eF)),eG=function(e){return"object"==typeof e?null!==e:eI(e)},eB=ep.document,eV=eG(eB)&&eG(eB.createElement),eH=function(e){return eV?eB.createElement(e):{}},eK=!em&&!ef(function(){return 7!==Object.defineProperty(eH("div"),"a",{get:function(){return 7}}).a}),e$=em&&ef(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),eW=String,eq=TypeError,eY=function(e){if(eG(e))return e;throw new eq(eW(e)+" is not an object")},eJ=Function.prototype.call,eQ=eh?eJ.bind(eJ):function(){return eJ.apply(eJ,arguments)},eX=function(e,t){var r;return arguments.length<2?eI(r=ep[e])?r:void 0:ep[e]&&ep[e][t]},e0=ev({}.isPrototypeOf),e1="undefined"!=typeof navigator&&String(navigator.userAgent)||"",e2=ep.process,e5=ep.Deno,e6=e2&&e2.versions||e5&&e5.version,e7=e6&&e6.v8;e7&&(ex=(eN=e7.split("."))[0]>0&&eN[0]<4?1:+(eN[0]+eN[1])),!ex&&e1&&(!(eN=e1.match(/Edge\/(\d+)/))||eN[1]>=74)&&(eN=e1.match(/Chrome\/(\d+)/))&&(ex=+eN[1]);var e3,e4,e9,e8=ex,te=ep.String,tt=!!Object.getOwnPropertySymbols&&!ef(function(){var e=Symbol("symbol detection");return!te(e)||!(Object(e) instanceof Symbol)||!Symbol.sham&&e8&&e8<41}),tr=tt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,tn=Object,to=tr?function(e){return"symbol"==typeof e}:function(e){var t=eX("Symbol");return eI(t)&&e0(t.prototype,tn(e))},ti=String,ta=TypeError,ts=function(e){if(eI(e))return e;throw new ta(function(e){try{return ti(e)}catch(e){return"Object"}}(e)+" is not a function")},tc=function(e,t){var r=e[t];return eS(r)?void 0:ts(r)},tu=TypeError,tl=function(e,t){return eD[e]||(eD[e]=t||{})},td=0,tp=Math.random(),tf=ev(1..toString),tm=function(e){return"Symbol("+(void 0===e?"":e)+")_"+tf(++td+tp,36)},th=ep.Symbol,ty=tl("wks"),tg=tr?th.for||th:th&&th.withoutSetter||tm,tw=function(e){return eO(ty,e)||(ty[e]=tt&&eO(th,e)?th[e]:tg("Symbol."+e)),ty[e]},tv=TypeError,tb=tw("toPrimitive"),tI=function(e){var t=function(e,t){if(!eG(e)||to(e))return e;var r,n=tc(e,tb);if(n){if(void 0===t&&(t="default"),!eG(r=eQ(n,e,t))||to(r))return r;throw new tv("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var r,n;if("string"===t&&eI(r=e.toString)&&!eG(n=eQ(r,e))||eI(r=e.valueOf)&&!eG(n=eQ(r,e))||"string"!==t&&eI(r=e.toString)&&!eG(n=eQ(r,e)))return n;throw new tu("Can't convert object to primitive value")}(e,t)}(e,"string");return to(t)?t:t+""},tS=TypeError,tL=Object.defineProperty,tC=Object.getOwnPropertyDescriptor,tA={f:em?e$?function(e,t,r){if(eY(e),t=tI(t),eY(r),"function"==typeof e&&"prototype"===t&&"value"in r&&"writable"in r&&!r.writable){var n=tC(e,t);n&&n.writable&&(e[t]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return tL(e,t,r)}:tL:function(e,t,r){if(eY(e),t=tI(t),eY(r),eK)try{return tL(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new tS("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},tT=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},tP=em?function(e,t,r){return tA.f(e,t,tT(1,r))}:function(e,t,r){return e[t]=r,e},tO=tl("keys"),tE=function(e){return tO[e]||(tO[e]=tm(e))},t_={},tz=ep.TypeError;if(eU||eD.state){var tM=eD.state||(eD.state=new ep.WeakMap);tM.get=tM.get,tM.has=tM.has,tM.set=tM.set,e3=function(e,t){if(tM.has(e))throw new tz("Object already initialized");return t.facade=e,tM.set(e,t),t},e4=function(e){return tM.get(e)||{}},e9=function(e){return tM.has(e)}}else{var tR=tE("state");t_[tR]=!0,e3=function(e,t){if(eO(e,tR))throw new tz("Object already initialized");return t.facade=e,tP(e,tR,t),t},e4=function(e){return eO(e,tR)?e[tR]:{}},e9=function(e){return eO(e,tR)}}var tk,tD={set:e3,get:e4,enforce:function(e){return e9(e)?e4(e):e3(e,{})},getterFor:function(e){return function(t){var r;if(!eG(t)||(r=e4(t)).type!==e)throw new tz("Incompatible receiver, "+e+" required");return r}}},tZ=el(function(e){var t=eM.CONFIGURABLE,r=tD.enforce,n=tD.get,o=String,i=Object.defineProperty,a=ev("".slice),s=ev("".replace),c=ev([].join),u=em&&!ef(function(){return 8!==i(function(){},"length",{value:8}).length}),l=String(String).split("String"),d=e.exports=function(e,n,d){"Symbol("===a(o(n),0,7)&&(n="["+s(o(n),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),d&&d.getter&&(n="get "+n),d&&d.setter&&(n="set "+n),(!eO(e,"name")||t&&e.name!==n)&&(em?i(e,"name",{value:n,configurable:!0}):e.name=n),u&&d&&eO(d,"arity")&&e.length!==d.arity&&i(e,"length",{value:d.arity});try{d&&eO(d,"constructor")&&d.constructor?em&&i(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var p=r(e);return eO(p,"source")||(p.source=c(l,"string"==typeof n?n:"")),e};Function.prototype.toString=d(function(){return eI(this)&&n(this).source||ej(this)},"toString")}),tN=function(){var e=eY(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},tx=ep.RegExp,tj=tx.prototype;em&&ef(function(){var e=!0;try{tx(".","d")}catch(t){e=!1}var t={},r="",n=e?"dgimsy":"gimsy",o=function(e,n){Object.defineProperty(t,e,{get:function(){return r+=n,!0}})},i={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var a in e&&(i.hasIndices="d"),i)o(a,i[a]);return Object.getOwnPropertyDescriptor(tj,"flags").get.call(t)!==n||r!==n})&&((tk={configurable:!0,get:tN}).get&&tZ(tk.get,"flags",{getter:!0}),tk.set&&tZ(tk.set,"flags",{setter:!0}),tA.f(tj,"flags",tk));var tF,tU={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},tG=eH("span").classList,tB=tG&&tG.constructor&&tG.constructor.prototype,tV=tB===Object.prototype?void 0:tB,tH=ev({}.toString),tK=ev("".slice),t$=function(e){return tK(tH(e),8,-1)},tW=Object,tq=ev("".split),tY=ef(function(){return!tW("z").propertyIsEnumerable(0)})?function(e){return"String"===t$(e)?tq(e,""):tW(e)}:tW,tJ=function(e){return tY(eC(e))},tQ=Math.ceil,tX=Math.floor,t0=Math.trunc||function(e){var t=+e;return(t>0?tX:tQ)(t)},t1=function(e){var t=+e;return t!=t||0===t?0:t0(t)},t2=Math.max,t5=Math.min,t6=Math.min,t7=function(e){var t=t1(e);return t>0?t6(t,9007199254740991):0},t3=function(e){return function(t,r,n){var o=tJ(t),i=t7(o.length);if(0===i)return!e&&-1;var a,s,c=(a=t1(n))<0?t2(a+i,0):t5(a,i);if(e&&r!=r){for(;i>c;)if((s=o[c++])!=s)return!0}else for(;i>c;c++)if((e||c in o)&&o[c]===r)return e||c||0;return!e&&-1}},t4=(t3(!0),t3(!1)),t9=ev([].push),t8=function(e,t){var r,n=tJ(e),o=0,i=[];for(r in n)!eO(t_,r)&&eO(n,r)&&t9(i,r);for(;t.length>o;)eO(n,r=t[o++])&&(~t4(i,r)||t9(i,r));return i},re=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rt=Object.keys||function(e){return t8(e,re)},rr={f:em&&!e$?Object.defineProperties:function(e,t){eY(e);for(var r,n=tJ(t),o=rt(t),i=o.length,a=0;i>a;)tA.f(e,r=o[a++],n[r]);return e}},rn=eX("document","documentElement"),ro=tE("IE_PROTO"),ri=function(){},ra=function(e){return""},rs=function(e){e.write(ra("")),e.close();var t=e.parentWindow.Object;return e=null,t},rc=function(){try{tF=new ActiveXObject("htmlfile")}catch(e){}rc="undefined"!=typeof document?document.domain&&tF?rs(tF):((t=eH("iframe")).style.display="none",rn.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(ra("document.F=Object")),e.close(),e.F):rs(tF);for(var e,t,r=re.length;r--;)delete rc.prototype[re[r]];return rc()};t_[ro]=!0;var ru=Object.create||function(e,t){var r;return null!==e?(ri.prototype=eY(e),r=new ri,ri.prototype=null,r[ro]=e):r=rc(),void 0===t?r:rr.f(r,t)},rl=tA.f,rd=tw("unscopables"),rp=Array.prototype;void 0===rp[rd]&&rl(rp,rd,{configurable:!0,value:ru(null)});var rf,rm,rh,ry=function(e){rp[rd][e]=!0},rg={},rw={}.propertyIsEnumerable,rv=Object.getOwnPropertyDescriptor,rb={f:rv&&!rw.call({1:2},1)?function(e){var t=rv(this,e);return!!t&&t.enumerable}:rw},rI=Object.getOwnPropertyDescriptor,rS={f:em?rI:function(e,t){if(e=tJ(e),t=tI(t),eK)try{return rI(e,t)}catch(e){}if(eO(e,t))return tT(!eQ(rb.f,e,t),e[t])}},rL=function(e,t,r,n){n||(n={});var o=n.enumerable,i=void 0!==n.name?n.name:t;if(eI(r)&&tZ(r,i,n),n.global)o?e[t]=r:ek(t,r);else{try{n.unsafe?e[t]&&(o=!0):delete e[t]}catch(e){}o?e[t]=r:tA.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},rC=re.concat("length","prototype"),rA={f:Object.getOwnPropertyNames||function(e){return t8(e,rC)}},rT={f:Object.getOwnPropertySymbols},rP=ev([].concat),rO=eX("Reflect","ownKeys")||function(e){var t=rA.f(eY(e)),r=rT.f;return r?rP(t,r(e)):t},rE=function(e,t,r){for(var n=rO(t),o=tA.f,i=rS.f,a=0;a=t.length)return e.target=void 0,r3(void 0,!0);switch(e.kind){case"keys":return r3(r,!1);case"values":return r3(t[r],!1)}return r3([r,t[r]],!1)})}),rW(r,i,!1),rg[i]=rY;var i,a,s,c=function(e){if(e===o&&p)return p;if(!r5&&e&&e in l)return l[e];switch(e){case"keys":case"values":case"entries":return function(){return new r(this,e)}}return function(){return new r(this)}},u=!1,l=e.prototype,d=l[r6]||l["@@iterator"]||l.values,p=!r5&&d||c(o),f=l.entries||d;return f&&(a=rG(f.call(new e)))!==Object.prototype&&a.next&&(rG(a)!==r2&&(rX?rX(a,r2):eI(a[r6])||rL(a,r6,r7)),rW(a,"Array Iterator",!0)),r0&&d&&"values"!==d.name&&(r1?tP(l,"name","values"):(u=!0,p=function(){return eQ(d,this)})),rN({target:"Array",proto:!0,forced:r5||u},s={values:c("values"),keys:c("keys"),entries:c("entries")}),l[r6]!==p&&rL(l,r6,p,{name:o}),rg.Array=p,s}(Array,0,function(e,t){r9(this,{type:"Array Iterator",target:tJ(e),index:0,kind:t})},0,"values"),nt=rg.Arguments=rg.Array;if(ry("keys"),ry("values"),ry("entries"),em&&"values"!==nt.name)try{r4(nt,"name",{value:"values"})}catch(e){}var nr=tw("iterator"),nn=ne.values,no=function(e,t){if(e){if(e[nr]!==nn)try{tP(e,nr,nn)}catch(t){e[nr]=nn}if(rW(e,t,!0),tU[t]){for(var r in ne)if(e[r]!==ne[r])try{tP(e,r,ne[r])}catch(t){e[r]=ne[r]}}}};for(var ni in tU)no(ep[ni]&&ep[ni].prototype,ni);no(tV,"DOMTokenList"),ry("flat");let na={transform:{concat:e=>e.map(e=>nc(e)),zoned:e=>({type:"Zone",id:e.zoneId,contents:e.transformations.map(e=>nc(e))}),form:e=>({type:"Form",formId:e}),paymentForm:e=>({type:"PaymentForm",formId:e}),resource:e=>({type:"UIComponent",componentId:e}),parameterisedResource:e=>({type:"UIComponent",componentId:e}),url:e=>({type:"HostedUIComponent",url:e}),componentTemplate:e=>({type:"ComponentTemplate",componentId:e}),parameterisedComponentTemplate:e=>({type:"ComponentTemplate",componentId:e}),truncate:e=>({type:"Truncate",truncateLength:Number(e),style:"nostyle"}),truncateWithStyle:(e,t)=>({type:"Truncate",truncateLength:Number(e),style:t}),outcomeTracker:(e,t,r,n)=>({type:"OutcomeTracker",featureId:e,featureLabel:t,outcomeId:r,outcomeLabel:n}),remove:()=>({type:"Remove"})}},ns={type:"LeavePristine"},nc=e=>Function("blaize,leave_pristine",'"use strict";return ('+(e.trim().length?e:"blaize.transform.remove()")+");")(na,ns);function nu(e,t){let r;switch(t){case"fadeout":let n=document.createElement("div");n.style.position="absolute",n.style.height="100%",n.style.width="100%",n.style.bottom="0",n.style.backgroundImage="linear-gradient(0deg, #fff 0%, rgba(255, 255, 255, 0) 100%)",e.appendChild(n),(r=document.createElement("div")).style.position="relative",r.appendChild(e);break;case"linebreak":let o=document.createElement("hr");o.style.border="1px solid #ebebeb",e.appendChild(o),r=e;break;default:r=e}return r}var nl=Function.prototype,nd=nl.apply,np=nl.call,nf="object"==typeof Reflect&&Reflect.apply||(eh?np.bind(nd):function(){return np.apply(nd,arguments)}),nm={};nm[tw("toStringTag")]="z";var nh,ny,ng="[object z]"===String(nm),nw=tw("toStringTag"),nv=Object,nb="Arguments"===t$(function(){return arguments}()),nI=ng?t$:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=nv(e),nw))?r:nb?t$(t):"Object"===(n=t$(t))&&eI(t.callee)?"Arguments":n},nS=String,nL=function(e){if("Symbol"===nI(e))throw TypeError("Cannot convert a Symbol value to a string");return nS(e)},nC=ep.RegExp,nA=ef(function(){var e=nC("a","y");return e.lastIndex=2,null!==e.exec("abcd")}),nT=nA||ef(function(){return!nC("a","y").sticky}),nP={BROKEN_CARET:nA||ef(function(){var e=nC("^r","gy");return e.lastIndex=2,null!==e.exec("str")}),MISSED_STICKY:nT,UNSUPPORTED_Y:nA},nO=ep.RegExp,nE=ef(function(){var e=nO(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}),n_=ep.RegExp,nz=ef(function(){var e=n_("(?b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")}),nM=tD.get,nR=tl("native-string-replace",String.prototype.replace),nk=RegExp.prototype.exec,nD=nk,nZ=ev("".charAt),nN=ev("".indexOf),nx=ev("".replace),nj=ev("".slice),nF=(ny=/b*/g,eQ(nk,nh=/a/,"a"),eQ(nk,ny,"a"),0!==nh.lastIndex||0!==ny.lastIndex),nU=nP.BROKEN_CARET,nG=void 0!==/()??/.exec("")[1];(nF||nG||nU||nE||nz)&&(nD=function(e){var t,r,n,o,i,a,s,c=nM(this),u=nL(e),l=c.raw;if(l)return l.lastIndex=this.lastIndex,t=eQ(nD,l,u),this.lastIndex=l.lastIndex,t;var d=c.groups,p=nU&&this.sticky,f=eQ(tN,this),m=this.source,h=0,y=u;if(p&&(-1===nN(f=nx(f,"y",""),"g")&&(f+="g"),y=nj(u,this.lastIndex),this.lastIndex>0&&(!this.multiline||this.multiline&&"\n"!==nZ(u,this.lastIndex-1))&&(m="(?: "+m+")",y=" "+y,h++),r=RegExp("^(?:"+m+")",f)),nG&&(r=RegExp("^"+m+"$(?!\\s)",f)),nF&&(n=this.lastIndex),o=eQ(nk,p?r:this,y),p?o?(o.input=nj(o.input,h),o[0]=nj(o[0],h),o.index=this.lastIndex,this.lastIndex+=o[0].length):this.lastIndex=0:nF&&o&&(this.lastIndex=this.global?o.index+o[0].length:n),nG&&o&&o.length>1&&eQ(nR,o[0],r,function(){for(i=1;i=s?e?"":void 0:(n=nK(i,a))<55296||n>56319||a+1===s||(o=nK(i,a+1))<56320||o>57343?e?nH(i,a):n:e?n$(i,a,a+2):o-56320+(n-55296<<10)+65536}},nq=(nW(!1),nW(!0)),nY=Math.floor,nJ=ev("".charAt),nQ=ev("".replace),nX=ev("".slice),n0=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,n1=/\$([$&'`]|\d{1,2})/g,n2=function(e,t,r,n,o,i){var a=r+e.length,s=n.length,c=n1;return void 0!==o&&(o=eT(o),c=n0),nQ(i,c,function(i,c){var u;switch(nJ(c,0)){case"$":return"$";case"&":return e;case"`":return nX(t,0,r);case"'":return nX(t,a);case"<":u=o[nX(c,1,-1)];break;default:var l=+c;if(0===l)return i;if(l>s){var d=nY(l/10);return 0===d?i:d<=s?void 0===n[d-1]?nJ(c,1):n[d-1]+nJ(c,1):i}u=n[l-1]}return void 0===u?"":u})},n5=TypeError,n6=function(e,t){var r=e.exec;if(eI(r)){var n=eQ(r,e,t);return null!==n&&eY(n),n}if("RegExp"===t$(e))return eQ(nB,e,t);throw new n5("RegExp#exec called on incompatible receiver")},n7=tw("replace"),n3=Math.max,n4=Math.min,n9=ev([].concat),n8=ev([].push),oe=ev("".indexOf),ot=ev("".slice),or="$0"==="a".replace(/./,"$0"),on=!!/./[n7]&&""===/./[n7]("a","$0");!function(e,t,r){var n=tw(e),o=!ef(function(){var t={};return t[n]=function(){return 7},7!==""[e](t)}),i=o&&!ef(function(){var e=!1,t=/a/;return t.exec=function(){return e=!0,null},t[n](""),!e});if(!o||!i||r){var a,s,c=/./[n],u=(a=""[e],s=on?"$":"$0",[function(e,t){var r=eC(this),n=eS(e)?void 0:tc(e,n7);return n?eQ(n,e,r,t):eQ(a,nL(r),e,t)},function(e,t){var r,n,i=eY(this),u=nL(e);if("string"==typeof t&&-1===oe(t,s)&&-1===oe(t,"$<")){var l=(r=t,(n=i.exec)===nB||n===nV.exec?o?{done:!0,value:eQ(c,i,u,r)}:{done:!0,value:eQ(a,u,i,r)}:{done:!1});if(l.done)return l.value}var d=eI(t);d||(t=nL(t));var p,f=i.global;f&&(p=i.unicode,i.lastIndex=0);for(var m,h=[];null!==(m=n6(i,u))&&(n8(h,m),f);)""===nL(m[0])&&(i.lastIndex=(y=t7(i.lastIndex))+(p?nq(u,y).length:1));for(var y,g,w="",v=0,b=0;b=v&&(w+=ot(u,v,L)+I,v=L+S.length)}return w+ot(u,v)}]);rL(String.prototype,e,u[0]),rL(nV,n,u[1])}}("replace",0,!!ef(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")})||!or||on);let oo=/<[^>]*>|[^<>]+/g,oi=/^[\p{Alpha}|\p{N}]$/u;class oa{constructor(e,t,r){this.text=e,this.type=t,this.isSentenceEnd=r}}let os=Object.freeze({WORD:0,PUNCTUATION:1,WHITESPACE:2}),oc=Object.freeze(["script","style","noscript","template","iframe","svg","canvas"]);function ou(e){return oc.some(t=>{let r=e.indexOf("<"+t)>=0,n=e.indexOf("=0;return r?!n:n})}let ol=Object.freeze({LOCALE_AWARE_TRUNCATION:!1}),od=()=>Intl&&"Segmenter"in Intl,op=e=>{let t;return"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},of=function(e){e&&console.log(...[].slice.call(arguments,1))},om=e=>{let t=(new DOMParser).parseFromString(e,"text/html"),r=[...Array.from(t.head.childNodes),...Array.from(t.body.childNodes)];if(!r.length)return document.createTextNode(e);let n=document.createDocumentFragment();return r.forEach(e=>n.appendChild(e)),oh(n),n},oh=e=>{let t=e.querySelectorAll("script");t.length&&Array.from(t).map(e=>{let t=document.createElement("script");Array.from(e.attributes).forEach(e=>{t.setAttribute(e.name,e.value)}),t.innerHTML=e.innerHTML,e.parentNode.appendChild(t),e.parentNode.removeChild(e)})},oy=(e,t,r,n)=>{switch(t.type){case"LeavePristine":return e;case"Truncate":return n.LOCALE_AWARE_TRUNCATION&&od()?function(e,t){var r;let n=(null==(r=document.documentElement)?void 0:r.lang)||"en",o=2*t.truncateLength,i=function(e,t){var r;void 0===t&&(t="en");let n=(null!=(r=null==e?void 0:e.outerHTML)?r:e.nodeValue).trim(),o=new Intl.Segmenter(t,{granularity:"sentence"}),i=new Intl.Segmenter(t,{granularity:"word"}),a=[],s=n.match(oo).map(e=>e.startsWith("<")?"".padStart(e.length):e).join("").replace(/\n/g,""),c=Array.from(o.segment(s)),u=0,l=0;for(let e of c){let t=e.segment.trimStart(),r=e.segment.length-t.length;t=t.trimEnd();let o=e.segment.length-(r+t.length);if(r>0){let e=n.substring(u,u+r);a.push(new oa(e,e.trim().length>0?os.WORD:os.WHITESPACE,!1))}l=(u=l+r)+t.length;let s=n.substring(u,l),c=Array.from(i.segment(t)),d=0,p=0;for(let[e,r]of c.entries()){p=(d=p)+r.segment.length;let n=s.substring(d,p);a.push(new oa(n,0===n.trim().length?os.WHITESPACE:1!==n.length||oi.test(n)?os.WORD:os.PUNCTUATION,t.length>1&&e===c.length-1))}if(o>0){let e=n.substring(l,l+o);a.push(new oa(e,e.trim().length>0?os.WORD:os.WHITESPACE,!1)),l+=o}}return a}(e,n);if(t.truncateLength>=i.length)return e;let a=0,s=!1,c=!1,u=0,l=0;for(let e of i){if(l++,e.type===os.WHITESPACE&&!e.isSentenceEnd)continue;let r=e.text.trim();if(c&&r.indexOf("=0&&ou(r)?c=!1:r.indexOf("<")>=0&&ou(r)&&(c=!0),c)continue;let n=s,i=r.lastIndexOf("<"),d=r.lastIndexOf(">");if(i>=0&&(s=!0),d>=0&&(s=!1),-1!==i&&-1!==d&&i>d&&(s=!0),n&&d===r.length-1||0===i&&d===r.length-1)s=!1;else if(!s){if(a>0&&e.type===os.WORD)break;(e.type===os.WORD||e.isSentenceEnd)&&(e.type===os.WORD&&u++,(u===o||u>=t.truncateLength&&e.isSentenceEnd)&&(a=l))}}if(l===i.length)return e;l=a>0?a:l;let d=i.slice(0,l).map(e=>e.text).join("");return u===o&&(d+="..."),nu((new DOMParser).parseFromString(d,"text/html").body.children[0],t.style)}(e,t):function(e,t){let r=2*t.truncateLength,n=e.outerHTML.trim().split(/\s+/);if(t.truncateLength>=n.length)return e;let o=0,i=!1,a=0,s=0;for(let e of n){s++;let n=i,c=e.lastIndexOf("<"),u=e.lastIndexOf(">");if(c>=0&&(i=!0),u>=0&&(i=!1),-1!==c&&-1!==u&&c>u&&(i=!0),n&&u===e.length-1&&!(-1!==e.search(">[^<>]+<"))||0===c&&u===e.length-1)i=!1;else if(!i){if(o>0)break;(++a>=t.truncateLength&&e.includes(".")||a===r)&&(o=s)}}if(s===n.length)return e;s=o>0?o:s;let c=n.slice(0,s).join(" ");return a===r&&(c+="...\n"),nu((new DOMParser).parseFromString(c,"text/html").body.children[0],t.style)}(e,t);case"OutcomeTracker":(e=>{window.Zephr||(window.Zephr={}),window.Zephr.outcomes||(window.Zephr.outcomes={}),window.Zephr.outcomes[e.featureId]={featureLabel:e.featureLabel,outcomeId:e.outcomeId,outcomeLabel:e.outcomeLabel}})(t);break;case"Form":return((e,t)=>{if(t.forms&&t.forms[e.formId])return om(t.forms[e.formId]);console.error("Form not found.")})(t,r);case"PaymentForm":return((e,t)=>{if(t.paymentForms&&t.paymentForms[e.formId])return om(t.paymentForms[e.formId]);console.error("Payment form not found.")})(t,r);case"UIComponent":return((e,t)=>{if(t.uiComponents&&t.uiComponents[e.componentId])return om(t.uiComponents[e.componentId]);console.error("UI component not found.")})(t,r);case"HostedUIComponent":return((e,t)=>{if(t.hostedUiComponents&&t.hostedUiComponents[e.url])return om(t.hostedUiComponents[e.url]);console.error("Hosted UI component not found.")})(t,r);case"ComponentTemplate":return((e,t)=>{if(t.componentTemplates&&t.componentTemplates[e.componentId])return om(t.componentTemplates[e.componentId]);console.error("Component template not found.")})(t,r);case"Remove":break;case"Zone":let o=t.contents.map(t=>oy(e,t,r,n));return((e,t,r)=>{if(!r.uiComponents||!r.uiComponents[e])return void console.error("Zone not found.");let n=om(r.uiComponents[e]),o=n.getElementById("zephr-zone-"+e.toLowerCase());return t.forEach(e=>o.appendChild(e)),n})(t.id,o,r);default:console.error("No matching outcome type "+t.type)}};function og(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}let ow="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function ov(e,t,r){if(!e.s){if(r instanceof ob){if(!r.s)return void(r.o=ov.bind(null,e,t));1&t&&(t=r.s),r=r.v}if(r&&r.then)return void r.then(ov.bind(null,e,t),ov.bind(null,e,2));e.s=t,e.v=r;let n=e.o;n&&n(e)}}let ob=function(){function e(){}return e.prototype.then=function(t,r){let n=new e,o=this.s;if(o){let e=1&o?t:r;if(e){try{ov(n,1,e(this.v))}catch(e){ov(n,2,e)}return n}return this}return this.o=function(e){try{let o=e.v;1&e.s?ov(n,1,t?t(o):o):r?ov(n,1,r(o)):ov(n,2,o)}catch(e){ov(n,2,e)}},n},e}();function oI(e){return e instanceof ob&&1&e.s}class oS{constructor(e,t){this.cdnApi=e||"",this.fetcher=t||null}fetchLiveFeatures(){try{let e=this;return Promise.resolve(og(function(){return Promise.resolve(e._fetcher(e.cdnApi+"/zephr/features",{method:"GET",headers:{Accept:"application/json"}}).then(e=>e.json()))},function(){return Promise.reject(Error("Live features endpoint failed."))}))}catch(e){return Promise.reject(e)}}fetchDecisions(e,t){let{jwt:r,customData:n={}}=void 0===t?{customData:{}}:t;try{let t=this,o=e.map(e=>e.id);return Promise.resolve(og(function(){return Promise.resolve(t._fetcher(t.cdnApi+"/zephr/feature-decisions",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Accept:"application/json",...r&&{Authorization:"Bearer "+r}},body:JSON.stringify({path:document.location.pathname+document.location.search+document.location.hash,referer:document.referrer,featureIds:o,customData:n})}).then(e=>e.json()))},function(){return Promise.reject(Error("Feature decisions endpoint failed."))}))}catch(e){return Promise.reject(e)}}executeDecisions(e,t,r,n){try{let i=this;function o(){t.accessDetails&&(window.Zephr||(window.Zephr={}),window.Zephr.accessDetails?window.Zephr.accessDetails=i._mergeAccessDetails(window.Zephr.accessDetails,t.accessDetails):window.Zephr.accessDetails=t.accessDetails),r&&(e=>{let t=e.datalayerName;t in window||(window[t]=[]);let r={},n=[];e.includeOutcomes&&window.Zephr.outcomes&&(r.zephrOutcomes=window.Zephr.outcomes,e.outcomesAsEvents&&Object.keys(window.Zephr.outcomes||[]).forEach(function(e){let t={event:"zephr-outcome-"+e,featureId:e,featureLabel:window.Zephr.outcomes[e].featureLabel,outcomeId:window.Zephr.outcomes[e].outcomeId,outcomeLabel:window.Zephr.outcomes[e].outcomeLabel};n.push(t)})),window.Zephr&&window.Zephr.accessDetails&&(Object.keys(window.Zephr.accessDetails.trials||{}).forEach(function(t){let n=window.Zephr.accessDetails.trials[t];if(n.reportInDataLayer){let t=n.totalCredits-n.remainingCredits;e.groupFields&&!r.zephrTrials&&(r.zephrTrials={});let o=e.groupFields?r.zephrTrials:r;n.dataLayerCreditsUsedKey&&(o[n.dataLayerCreditsUsedKey]=t),n.dataLayerCreditsRemainingKey&&(o[n.dataLayerCreditsRemainingKey]=n.remainingCredits)}}),(window.Zephr.accessDetails.trialTrackingDetails||[]).forEach(function(t){let n=(window.Zephr.accessDetails["credits"===t.entitlementType?"credits":"meters"]||{})[t.entitlementId];n&&(e.groupFields&&!r.zephrTrials&&(r.zephrTrials={}),t.creditsRemainingKey&&(e.groupFields?r.zephrTrials[t.creditsRemainingKey]=n.remainingCredits:r[t.creditsRemainingKey]=n.remainingCredits),t.creditsUsedKey&&(e.groupFields?r.zephrTrials[t.creditsUsedKey]=n.totalCredits-n.remainingCredits:r[t.creditsUsedKey]=n.totalCredits-n.remainingCredits))})),Object.keys(r).length&&(r.event="zephr-pageview",n.unshift(r)),n.length&&(n.forEach(function(e){window[t].push(e)}),document.dispatchEvent(op("zephr.dataLayerReady")))})(r)}let a=function(e,t){if("function"==typeof e[ow]){var r,n,o,i,a,s,c,u=e[ow]();if(function e(r){try{for(;!(a=u.next()).done;)if((r=t(a.value))&&r.then){if(!oI(r))return void r.then(e,c||(c=ov.bind(null,s=new ob,2)));r=r.v}s?ov(s,1,r):s=r}catch(e){ov(s||(s=new ob),2,e)}}(),u.return){var l=function(e){try{a.done||u.return()}catch(e){}return e};if(s&&s.then)return s.then(l,function(e){throw l(e)});l()}return s}if(!("length"in e))throw TypeError("Object is not iterable");for(var d=[],p=0;p{let n=t.parentNode,o=Array.from(n.children).indexOf(t),i=n.removeChild(t),s=a.map(t=>oy(i,t,e,r)).filter(Boolean),c=document.createDocumentFragment();s.forEach(e=>c.appendChild(e)),o"Truncate"===e.type),u=function(){if(n.automaticPolyfills&&c&&!od())return Promise.resolve(function(e){try{let t=function(t,r){try{var n=Promise.resolve(fetch(e).then(e=>e.text()).then(e=>Function(e)())).then(function(){})}catch(e){return r(e)}return n&&n.then?n.then(void 0,r):n}(0,function(t){console.error("Error fetching and executing script from "+e+":",t)});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}("https://assets.zephr.com/zephr-browser/1.9.1/polyfill-intl-segmenter.umd.js")).then(function(){})}();return u&&u.then?u.then(r):r()});return Promise.resolve(a&&a.then?a.then(o):o())}catch(e){return Promise.reject(e)}}_fetcher(e,t){return this.fetcher?this.fetcher(e,t):window.fetch(e,t)}_mergeAccessDetails(e,t){var r,n;return{...e,...t,authenticated:t.authenticated,accessDecisions:{...e.accessDecisions,...t.accessDecisions},entitlements:this._mergeCreditData(e.entitlements,t.entitlements),credits:this._mergeCreditData(e.credits,t.credits),meters:this._mergeCreditData(e.meters,t.meters),trials:this._mergeCreditData(null!=(r=e.trials)?r:{},null!=(n=t.trials)?n:{})}}_mergeCreditData(e,t){var r={...e,...t};for(let[n,o]of Object.entries(e)){let e=t[n];if(e){let t=r[n];this._eitherHasProperty(o,e,"decrementedInDecision")&&(t.decrementedInDecision=!(!o.decrementedInDecision&&!e.decrementedInDecision)),this._eitherHasProperty(o,e,"usedInDecision")&&(t.usedInDecision=!(!o.usedInDecision&&!e.usedInDecision)),this._eitherHasProperty(o,e,"remainingCredits")&&(t.remainingCredits=this._minOrNumber(o.remainingCredits,e.remainingCredits)),this._eitherHasProperty(o,e,"totalCredits")&&(t.totalCredits=this._minOrNumber(o.totalCredits,e.totalCredits))}}return r}_eitherHasProperty(e,t,r){return e&&e.hasOwnProperty(r)||t&&t.hasOwnProperty(r)}_minOrNumber(e,t){let r="number"==typeof e,n="number"==typeof t;return r&&n?Math.min(e,t):r?e:n?t:void 0}_mergeDefaultFlags(e){return void 0===e&&(e={}),{...ol,...e}}findFeatures(e){return Array.isArray(e)&&e.length?e.filter(e=>"COMMENT_TAG"!==e.targetType&&null!==document.querySelector(e.cssSelector)):[]}selectFeatureNodes(e){return document.querySelectorAll(e.cssSelector)}}let oL=(e,t)=>new oS(e,t),oC=function(e){try{let t=e&&e.debug||localStorage&&localStorage.getItem("zephrBrowserDebug"),r="",n={automaticPolyfills:!0};"string"==typeof e?r=e:"object"==typeof e&&(n={...n,...e},r=e.cdnApi||"");let o=oL(r,null==e?void 0:e.fetcher);return Promise.resolve(o.fetchLiveFeatures()).then(function(e){let r,i;function a(){return document.dispatchEvent(op("zephr.browserDecisionsFinished")),o}Array.isArray(e)?r=e:(r=e.features,i=e.datalayerOutcomesConfig),of(t,"Live Features:",r);let s=o.findFeatures(r),c=function(){if(s.length)return of(t,"Features on page:",s),Promise.resolve(o.fetchDecisions(s,n)).then(function(e){of(t,"Decisions:",e);let r=performance.now();return Promise.resolve(o.executeDecisions(s,e,i,n)).then(function(){of(t,"Decision execution finished: took "+(performance.now()-r)+" ms")})});of(t,"No features found on page.")}();return c&&c.then?c.then(a):a()})}catch(e){return Promise.reject(e)}},oA=e=>{let t={};e?.stableUserId&&(t.stable_user_id=e.stableUserId),e&&(t.session_id=e.sessionId),e?.countryCode&&(t.country=e.countryCode);let r="undefined"!=typeof document&&"string"==typeof document.referrer&&document.referrer?document.referrer:null;return r&&(t.referrer=r),t},oT=(()=>{let e=!1,t=null;return{runOnce:async t=>{if(e)return i.info("Zephr.run() skipped because runtime has already started."),!1;e=!0,t&&(e=>{let t=oA(e);[...e.stableUserId?[["identify",[e.stableUserId]]]:[],["setIdentity",[t]],["setAttributes",[t]],["setCustomData",[t]]].forEach(([e,t])=>{let r=n[e];if("function"==typeof r)try{r(...t)}catch(t){i.warn(`Zephr ${e} call failed while attaching identity context.`,t)}})})(t),f("zephr-decision-start");let r=oA(t);return oC(Object.keys(r).length?{customData:r}:void 0),!0},waitForDecisionsFinished:()=>(t||(t=new Promise(e=>{document.addEventListener("zephr.browserDecisionsFinished",()=>{i.info("Zephr decisions finished event fired."),f("zephr-decision-end"),m("zephr-decision-duration","zephr-decision-start","zephr-decision-end"),m("zephr-decision","zephr-decision-start","zephr-decision-end"),e()},{once:!0})})),t)}})(),oP=["#zephr-body-link","#zephr-footer-body-button",".banner-cta"],oO="zephrDatalayerAttached",oE=()=>{let e=!1;return oP.forEach(t=>{var r;let n=(e=>{let t=document.querySelector(e);return t?"A"===t.tagName?t:t.closest("a")??t:null})(t);n&&!n.dataset[oO]&&(n.addEventListener("click",(r="dataLayer",e=>{let t=e.currentTarget,n=t.getAttribute("href"),o=n||"",i=!!o&&"_blank"!==t.target,a={event:"zephr_cta_click",destination:o};if(i){e.preventDefault();let t=!1,r=()=>{t||(t=!0,window.location.href=o)};a.eventCallback=r,a.eventTimeout=2e3,setTimeout(r,2e3)}else""===n&&e.preventDefault();((e,t)=>{let r=window;r[e]=r[e]||[],r[e].push(t)})(r,a)})),n.dataset[oO]="true",e=!0)}),e},o_=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),oz=async()=>{if("undefined"==typeof window||"function"!=typeof fetch)return!1;try{let e=await fetch("/blaize/datalayer");if(!e?.ok)return i.warn("Unable to read Zephr split-test data layer.",{status:e?.status}),!1;let t=(e=>{if(!o_(e))return null;if("dataLayer"in e){let t=e.dataLayer;return o_(t)?t:null}return e})(await e.json());return t&&Object.keys(t).length?(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"zephr_split_test",...t}),i.info("Zephr split-test metadata synced to window.dataLayer."),!0):(i.info("No Zephr split-test metadata available for dataLayer sync."),!1)}catch(e){return i.warn("Failed to sync Zephr split-test metadata to window.dataLayer.",e),!1}};var oM=r(293);let oR="zephr-target-ready",ok=async()=>{try{i.info("Initializing checkout inactivity timeout.");let{initCheckoutInactivityTimeout:e}=await Promise.resolve().then(r.bind(r,536));e(),i.debug("Checkout inactivity timeout initialized.")}catch(e){i.warn("Failed to initialize checkout inactivity timeout.",e)}},oD=async()=>{if((0,oM.qV)())return i.debug("Checkout DOM detected during initial scan. Starting timeout now."),void await ok();i.debug("Checkout DOM not found on initial scan. Waiting in background for late render."),((e=15e3)=>new Promise(t=>{if((0,oM.qV)())return i.debug("Checkout DOM already ready; skipping readiness wait."),void t(!0);if("undefined"==typeof window||"undefined"==typeof document||!document.body)return i.debug("Checkout readiness wait skipped: window/document/body unavailable."),void t(!1);i.debug("Waiting for late-rendered checkout DOM.",{timeoutMs:e,pollMs:100});let r=!1,n=null,o=null,a=null,s=()=>{},c=e=>{r||(r=!0,n&&(clearInterval(n),n=null),o&&(clearTimeout(o),o=null),a?.disconnect(),a=null,document.removeEventListener(oR,s),s=()=>{},i.debug("Checkout readiness wait finished.",{isReady:e}),t(e))},u=()=>{(0,oM.qV)()&&c(!0)};"undefined"!=typeof MutationObserver&&(a=new MutationObserver(u)).observe(document.body,{childList:!0,subtree:!0,attributes:!0}),s=()=>{u()},document.addEventListener(oR,s),n=setInterval(u,100),o=setTimeout(()=>c((0,oM.qV)()),e),u()}))().then(e=>{if(e)return i.info("Checkout DOM became ready after background wait. Starting timeout."),ok();i.debug("Checkout DOM did not appear before readiness timeout.")}).catch(e=>{i.warn("Failed to initialize checkout inactivity timeout.",e)})},oZ=async()=>{if("function"!=typeof fetch)return null;try{let{countryCode:e}=await (async e=>{let t;let r=new Promise((e,r)=>{t=window.setTimeout(()=>{r(Error("timeout after 800ms"))},800)});try{return await Promise.race([e,r])}finally{window.clearTimeout(t)}})((async()=>{let e=await fetch("https://geoip.immediatemedia.co.uk/country-code");return e.ok?e.json():(i.warn("Zephr countryCode: geoip endpoint returned non-OK response",{status:e.status}),null)})())||{};return"string"==typeof e&&/^[A-Z]{2}$/.test(e)?e:null}catch(e){return i.warn("Zephr countryCode: failed to resolve country code via geoip endpoint",{error:e}),null}},oN={AD:"AND",AE:"ARE",AF:"AFG",AG:"ATG",AI:"AIA",AL:"ALB",AM:"ARM",AO:"AGO",AQ:"ATA",AR:"ARG",AS:"ASM",AT:"AUT",AU:"AUS",AW:"ABW",AX:"ALA",AZ:"AZE",BA:"BIH",BB:"BRB",BD:"BGD",BE:"BEL",BF:"BFA",BG:"BGR",BH:"BHR",BI:"BDI",BJ:"BEN",BL:"BLM",BM:"BMU",BN:"BRN",BO:"BOL",BQ:"BES",BR:"BRA",BS:"BHS",BT:"BTN",BV:"BVT",BW:"BWA",BY:"BLR",BZ:"BLZ",CA:"CAN",CC:"CCK",CD:"COD",CF:"CAF",CG:"COG",CH:"CHE",CI:"CIV",CK:"COK",CL:"CHL",CM:"CMR",CN:"CHN",CO:"COL",CR:"CRI",CU:"CUB",CV:"CPV",CW:"CUW",CX:"CXR",CY:"CYP",CZ:"CZE",DE:"DEU",DJ:"DJI",DK:"DNK",DM:"DMA",DO:"DOM",DZ:"DZA",EC:"ECU",EE:"EST",EG:"EGY",EH:"ESH",ER:"ERI",ES:"ESP",ET:"ETH",FI:"FIN",FJ:"FJI",FK:"FLK",FM:"FSM",FO:"FRO",FR:"FRA",GA:"GAB",GB:"GBR",GD:"GRD",GE:"GEO",GF:"GUF",GG:"GGY",GH:"GHA",GI:"GIB",GL:"GRL",GM:"GMB",GN:"GIN",GP:"GLP",GQ:"GNQ",GR:"GRC",GS:"SGS",GT:"GTM",GU:"GUM",GW:"GNB",GY:"GUY",HK:"HKG",HM:"HMD",HN:"HND",HR:"HRV",HT:"HTI",HU:"HUN",ID:"IDN",IE:"IRL",IL:"ISR",IM:"IMN",IN:"IND",IO:"IOT",IQ:"IRQ",IR:"IRN",IS:"ISL",IT:"ITA",JE:"JEY",JM:"JAM",JO:"JOR",JP:"JPN",KE:"KEN",KG:"KGZ",KH:"KHM",KI:"KIR",KM:"COM",KN:"KNA",KP:"PRK",KR:"KOR",KW:"KWT",KY:"CYM",KZ:"KAZ",LA:"LAO",LB:"LBN",LC:"LCA",LI:"LIE",LK:"LKA",LR:"LBR",LS:"LSO",LT:"LTU",LU:"LUX",LV:"LVA",LY:"LBY",MA:"MAR",MC:"MCO",MD:"MDA",ME:"MNE",MF:"MAF",MG:"MDG",MH:"MHL",MK:"MKD",ML:"MLI",MM:"MMR",MN:"MNG",MO:"MAC",MP:"MNP",MQ:"MTQ",MR:"MRT",MS:"MSR",MT:"MLT",MU:"MUS",MV:"MDV",MW:"MWI",MX:"MEX",MY:"MYS",MZ:"MOZ",NA:"NAM",NC:"NCL",NE:"NER",NF:"NFK",NG:"NGA",NI:"NIC",NL:"NLD",NO:"NOR",NP:"NPL",NR:"NRU",NU:"NIU",NZ:"NZL",OM:"OMN",PA:"PAN",PE:"PER",PF:"PYF",PG:"PNG",PH:"PHL",PK:"PAK",PL:"POL",PM:"SPM",PN:"PCN",PR:"PRI",PS:"PSE",PT:"PRT",PW:"PLW",PY:"PRY",QA:"QAT",RE:"REU",RO:"ROU",RS:"SRB",RU:"RUS",RW:"RWA",SA:"SAU",SB:"SLB",SC:"SYC",SD:"SDN",SE:"SWE",SG:"SGP",SH:"SHN",SI:"SVN",SJ:"SJM",SK:"SVK",SL:"SLE",SM:"SMR",SN:"SEN",SO:"SOM",SR:"SUR",SS:"SSD",ST:"STP",SV:"SLV",SX:"SXM",SY:"SYR",SZ:"SWZ",TC:"TCA",TD:"TCD",TF:"ATF",TG:"TGO",TH:"THA",TJ:"TJK",TK:"TKL",TL:"TLS",TM:"TKM",TN:"TUN",TO:"TON",TR:"TUR",TT:"TTO",TV:"TUV",TW:"TWN",TZ:"TZA",UA:"UKR",UG:"UGA",UM:"UMI",US:"USA",UY:"URY",UZ:"UZB",VA:"VAT",VC:"VCT",VE:"VEN",VG:"VGB",VI:"VIR",VN:"VNM",VU:"VUT",WF:"WLF",WS:"WSM",YE:"YEM",YT:"MYT",ZA:"ZAF",ZM:"ZMB",ZW:"ZWE"},ox=["zephr-paywall-","zephr-datawall-"],oj="zephr:inline_dismissed:any",oF=e=>ox.some(t=>e.startsWith(t)),oU=()=>ox.map(e=>`[id^="${e}"]`).join(", "),oG=()=>document.querySelector(oU()),oB=e=>`zephr:inline_dismissed:${e}`,oV=e=>{try{return window.sessionStorage.getItem(e)}catch{return null}},oH=(e,t)=>{try{return window.sessionStorage.setItem(e,t),!0}catch{return!1}},oK=({logger:e}={})=>{try{let e="true"===oV(oj);Array.from(document.querySelectorAll(oU())).forEach(t=>{t?.id&&oF(t.id)&&(e||"true"===oV(oB(t.id)))&&(t.removeAttribute("id"),t.setAttribute("data-zephr-inline-dismissed","true"))})}catch(t){e?.warn?.("[Zephr Inline] applyInlineDismissalBeforeZephr failed",t)}},o$=null,oW=null,oq=async(e,t,r)=>{let n=`zephr-step-${e}-start`,o=`zephr-step-${e}-end`,i=`zephr-step-${e}`,a="undefined"!=typeof performance&&"function"==typeof performance.now?performance.now():null;f(n);try{return await t()}finally{f(o),m(i,n,o),null!==a&&"undefined"!=typeof performance&&"function"==typeof performance.now&&r?.(Math.round(performance.now()-a))}},oY="[data-zephr-template-type]",oJ="ZephrNewRegistration",oQ=e=>{let t=e?.closest(oY)||e?.querySelector(oY)||document.querySelector(oY);return t?.getAttribute("data-zephr-template-type")||null},oX=({initialized:e,running:t})=>{"undefined"!=typeof window&&(void 0!==e&&(window.zephrInitialized=e),void 0!==t&&(window.zephrRunning=t))},o0=async({stableUserId:e,sessionId:t})=>{let{activeState:r=[]}=ee?.()||{};if(!r.length)return void i.warn("No active Zephr state found.");let n=document.querySelector(".zephr-form-container > .zephr-form")||document.querySelector('[id^="zephr-"]')||null;if(!n)return void i.warn("Neither Zephr form root nor placeholder element found in DOM.");f("time-to-zephr-outcome"),m("time-to-zephr-outcome","navigationStart","time-to-zephr-outcome");let o=n.id||null,{placement:a,placementVariant:s}=(e=>{let t="inline-form",r="inline";if(!e)return i.warn("[Zephr GTM] inferPlacementAndVariant: formRoot is null or undefined."),{placement:t,placementVariant:r};let n=e.closest('[id*="zephr"], [class*="zephr"]'),o=n?.closest('[class*="modal"], [class*="popup"]');if(o){let e=Array.from(o.classList),n=e.find(e=>/modal/i.test(e));n?(r="modal",t=n):(r="popup",t=e.find(e=>/popup/i.test(e)))}else t=Array.from(e.classList).find(e=>/zephr|form|block|container/i.test(e))||"inline-form",r="inline";return{placement:t,placementVariant:r}})(n),c=await (async e=>oQ(e)||new Promise(t=>{let r=!1,n=()=>{r||(r=!0,o.disconnect(),window.clearTimeout(i),t(oQ(e)))},o=new MutationObserver(()=>{oQ(e)&&n()});o.observe(document.documentElement,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["data-zephr-template-type"]});let i=window.setTimeout(n,1e3)}))(n);i.debug("Zephr template lookup",{targetRootId:n.id||null,targetRootClassName:n.className||null,templateType:c});let u=r.map(({ruleId:r,zephrMeta:u,accessDetails:l})=>{(e=>{let{featureLabel:t,outcomeId:r,outcomeLabel:n}=e||{},o=performance.getEntriesByName("zephr-decision-duration")[0],a=o?Math.round(o.duration):0;t&&r&&n?(({featureLabel:e,outcomeId:t,outcomeLabel:r,duration:n})=>{if(h({"zephr-active":"Yes","zephr-decision":e,"zephr-template":t,"zephr-variant":r,"zephr-decision-duration":n}),y("zephr-decision",e),y("zephr-template",t),y("zephr-variant",r),"undefined"!=typeof performance&&n>0)try{performance.measure("zephr-decision-duration",{start:performance.now()-n,end:performance.now()})}catch(t){let e=t instanceof Error?t.message:String(t);i.warn(`[Zephr GTM] Failed to create duration measure: ${e}`),performance.mark("zephr-decision-duration")}})({featureLabel:t,outcomeId:r,outcomeLabel:n,duration:a}):i.warn("[Zephr GTM] Incomplete Zephr metadata for SpeedCurve tracking")})(u);let d=(({ruleId:e,zephrMeta:t,outcomeId:r,outcomeLabel:n,featureLabel:o,feature:i,templateType:a=null,formId:s,placement:c,placementVariant:u,stableUserId:l,sessionId:d,accessDetails:p={}})=>{let f=p.authenticated??!1,m=p.activeProducts||[],h=J(f,m);return{ruleId:e,zephrMeta:t,outcomeId:r,outcomeLabel:n,featureLabel:o,feature:i,formId:s,placement:c,placementVariant:u,stableUserId:l,sessionId:d,authenticated:f,activeProducts:m,userState:h,impressionType:Q(h,p,a),increaseRA:X(p,{[e]:t})}})({ruleId:r,zephrMeta:u,outcomeId:u.outcomeId,outcomeLabel:u.outcomeLabel,featureLabel:u.featureLabel,feature:"zephr",templateType:c,formId:o,placement:a,placementVariant:s,stableUserId:e,sessionId:t,accessDetails:l});return((e,{formId:t,ruleId:r,outcomeId:n,featureLabel:o,outcomeLabel:i,placement:a,placementVariant:s,stableUserId:c,sessionId:u})=>{e&&(e.setAttribute("data-feature","zephr"),e.setAttribute("data-form-id",String(t)),e.setAttribute("data-rule-id",r),e.setAttribute("data-outcome-id",n),e.setAttribute("data-feature-label",o),e.setAttribute("data-outcome-label",i),e.setAttribute("data-placement",a),e.setAttribute("data-placement-variant",s),c?e.setAttribute("data-stable-user-id",c):e.removeAttribute("data-stable-user-id"),e.setAttribute("data-session-id",u))})(n,d),(({formId:e,ruleId:t,zephrMeta:r,outcomeId:n,outcomeLabel:o,featureLabel:a,feature:s,placement:c,placementVariant:u,stableUserId:l,sessionId:d,userState:p,impressionType:f})=>{r&&e&&t?(d||i.warn("trackZephrFormRender: missing sessionId — origId will not be populated"),i.debug("Firing zephr_form_render event to dataLayer"),(0,g.Z)(w.c,{feature:s,formId:e,ruleId:t,outcomeId:n,outcomeLabel:o,featureLabel:a,placement:c,placementVariant:u,userState:p,impressionType:f,...Y(l,d)}),R({action:M(f),userState:p,increaseRA:!0,wId_2:n?[n]:[]})):i.warn("trackZephrFormRender: missing required metadata")})(d),(({formRoot:e,ruleId:t,zephrMeta:r,outcomeId:n,outcomeLabel:o,featureLabel:a,feature:s,placement:c,placementVariant:u,formId:l,stableUserId:d,sessionId:p,userState:f,impressionType:m})=>{e&&r?new IntersectionObserver((e,r)=>{e.forEach(e=>{e.isIntersecting&&(i.debug("Zephr form became visible, pushing zephr_form_view"),(0,g.Z)(w.j0,{feature:s,formId:l,ruleId:t,outcomeId:n,outcomeLabel:o,featureLabel:a,placement:c,placementVariant:u,userState:f,impressionType:m,...Y(d,p)}),r.disconnect())})},{threshold:.5}).observe(e):i.warn("Missing formRoot or zephrMeta.")})({formRoot:n,...d}),(({ruleId:e,zephrMeta:t,outcomeId:r,outcomeLabel:n,featureLabel:o,feature:a,formId:s,placement:c,placementVariant:u,stableUserId:l,sessionId:d,authenticated:p,activeProducts:f,userState:m,increaseRA:h,impressionType:y})=>{if(!t)return;let v=`${e}:${r}`,b=q.get(v);b&&document.body.removeEventListener("click",b);let I=t=>{let v=t.target;if(!v)return;let b=v.closest("button");if(!b||!b.closest('[id^="zephr-"]'))return;let I="zephr-footer-body-button"===b.id||"zephr-body-button"===b.id,S=!!document.querySelector('[id^="zephr-paywall-"], [id^="zephr-datawall-"]'),L=W.test(`${n||""} ${o||""}`);I&&(S||L)&&(i.debug("Zephr form button clicked, pushing to dataLayer"),(0,g.Z)(w.uL,{feature:a,formId:s,ruleId:e,outcomeId:r,outcomeLabel:n,featureLabel:o,placement:c,placementVariant:u,userState:m,...Y(l,d),authenticated:p,activeProducts:f}),R({action:"registration_wall"===y?70:28,userState:m,increaseRA:h,wId_2:r?[r]:[]}))};q.set(v,I),document.body.addEventListener("click",I)})({formRoot:n,...d}),d});oW?.(),oW=(e=>{let t=e.map(e=>{let{feature:t,formId:r,ruleId:n,outcomeId:o,outcomeLabel:i,featureLabel:a,placement:s,placementVariant:c,stableUserId:u,sessionId:l,userState:d,increaseRA:p}=e;return{ruleId:n,payload:{feature:t,formId:r,ruleId:n,outcomeId:o,outcomeLabel:i,featureLabel:a,placement:s,placementVariant:c,userState:d,...Y(u,l)},aiPaywallParams:{userState:d,increaseRA:p,wId_2:o?[o]:[]}}}),r=e=>{if(e.origin!==window.location.origin)return void i.debug("Zephr message event ignored: origin mismatch",e.origin);let r=e.data?.["zephr-form-datalayer-event"];if(!r?.event)return;let n=r.event.toLowerCase();t.forEach(({payload:e,aiPaywallParams:t})=>{switch(n){case"zephr_form_section_change":"plan-select"===r.previousPartId&&(i.debug("Zephr plan selected, pushing zephr_form_plan_select"),(0,g.Z)(w.wS,e),R({action:28,...t}));break;case"zephr_form_register":i.debug("Zephr registration, pushing zephr_form_register"),(0,g.Z)(w.T2,e),R({action:71,...t});break;case"zephr_form_purchase":{i.debug("Zephr purchase, pushing zephr_form_purchase"),(0,g.Z)(w.b3,e);let n="number"==typeof r.ecommerce?.value?r.ecommerce.value:parseFloat(r.price),o=Number.isFinite(n)?Math.round(100*n):0;R({action:151,...t,actionValue:o})}}})};return window.addEventListener("message",r),()=>window.removeEventListener("message",r)})(u),r.some(({accessDetails:e})=>e?.authenticated)&&await (async()=>{i.info("Zephr: Initializing Zephr consent for authenticated user");let e=await es();return ei=!0,i.info("Zephr: Zephr consent sync result:",{success:e}),e})()},o1=async()=>{var e,t,r;let n={},a=(e,t)=>{n[`zephr-step-${e}-ms`]=t};oX({initialized:!1,running:!1}),f("time-to-zephr-started"),i.info("Zephr onDOMReady about to fired."),await oq("dom-ready",l,e=>{a("dom-ready",e)}),oE();let{enabled:s=!1}=(e="zephrSettings",(document.body&&e?((Array.isArray(e)?e:[e]).some(function(e){return!!(t=function(e){var t=document.body.dataset[e];if(t)return o(t);var r="__".concat(e.trim().replace(/([a-z])([A-Z])/g,"$1_$2").toUpperCase(),"__"),n=document.getElementById(r);return n?o(n.innerHTML):null}(e))}),t):null)||{});if(!s)return void i.info("Zephr not enabled.");ec(),(({logger:e}={})=>{window.__zephrInlineDismissListenerAttached||(window.__zephrInlineDismissListenerAttached=!0,document.addEventListener("click",t=>{let r=t.target;if((e=>{if(!e?.closest)return!1;if(e.closest('[data-zephr-inline-dismiss="true"], #zephr-footer-close'))return!0;let t=e.closest("a");return!!t?.querySelector('[data-zephr-inline-dismiss="true"]')})(r)){t.preventDefault();try{let t=r.closest(oU())??oG();if(!t?.id||!oF(t.id))return;oH(oB(t.id),"true"),oH(oj,"true"),t.setAttribute("hidden","hidden"),oK({logger:e})}catch(t){e?.warn?.("[Zephr Inline] attachInlineDismissClickListener failed",t)}window.location.reload()}}))})({logger:i});let c=oq("country-code-resolution",oZ,e=>{a("country-code-resolution",e)}),u=await oq("identity-resolution",E,e=>{a("identity-resolution",e)}),d=(()=>{if("true"===oV(oj))return!0;let e=oG();return!(!e?.id||!oF(e.id))&&"true"===oV(oB(e.id))})();d&&(oK({logger:i}),i.info("Zephr: Inline paywall dismissed.")),await oq("cmp-settle",en,e=>{a("cmp-settle",e)}),oX({initialized:!0}),f("time-to-zephr-initialised"),m("time-to-zephr-initialised","navigationStart","time-to-zephr-initialised"),oK({logger:i}),d||await oq("wait-for-targets",p,e=>{a("wait-for-targets",e)}),oK({logger:i}),await oq("permutive-sync",$,e=>{a("permutive-sync",e)});let y=(r=await c)?oN[r.toUpperCase()]??null:null;_=y,await oq("runtime-run-once",()=>oT.runOnce({...u,countryCode:y}),e=>{a("runtime-run-once",e)}),oX({running:!0}),f("time-to-zephr-loaded"),m("time-to-zephr-loaded","navigationStart","time-to-zephr-loaded"),i.info("Zephr enabled."),await oq("wait-for-decisions-finished",oT.waitForDecisionsFinished,e=>{a("wait-for-decisions-finished",e)}),await oq("sync-split-test-data-layer",oz,e=>{a("sync-split-test-data-layer",e)});let v=P(),b=v&&v!==u.sessionId?{...u,sessionId:v}:u;(e=>{if("undefined"!=typeof document&&e)try{let{hostname:t}=window.location,r=t.startsWith("www.")?`; domain=${t.replace("www.","")}`:"";document.cookie=`blaize_tracking_id=${encodeURIComponent(e)}; path=/${r}; samesite=lax`,i.info("Zephr identity: blaize_tracking_id cookie set for AI Paywall tracking.")}catch(e){i.warn("Zephr identity: failed to write blaize_tracking_id cookie.",e)}})(b.sessionId);let{accessDetails:I={}}=window?.Zephr||{},{activeState:S=[]}=ee()||{},L=Object.fromEntries(S.map(({ruleId:e,zephrMeta:t})=>[e,t]));(({stableUserId:e,sessionId:t,userState:r,increaseRA:n})=>{i.debug("Firing zephr_page_load event to dataLayer");let o=window.__zephrPermutiveDebug||null;(0,g.Z)(w.dW,{userState:r,...Y(e,t),...o?{permutive_reason:o.reason,permutive_sent:o.sent,permutive_consent_granted:o.consentGranted,permutive_raw_segment_count:o.rawSegmentCount,permutive_mapped_segments:o.mappedSegments,...o.status?{permutive_status:o.status}:{}}:{}}),R({action:21,userState:r,increaseRA:n,wId_2:[""]})})({stableUserId:b.stableUserId,sessionId:b.sessionId,userState:J(I.authenticated??!1,I.activeProducts||[]),increaseRA:X(I,L)}),await oq("process-active-state",()=>o0(b),e=>{a("process-active-state",e)}),(({authenticated:e})=>{e&&(e=>{let t=document.cookie.split(";").reduce((t,r)=>{if(null!==t)return t;let n=r.trim(),o=n.indexOf("=");return(o>=0?n.slice(0,o):n)!==e?null:o>=0?n.slice(o+1):""},null);if(null===t)return null;try{return decodeURIComponent(t)}catch{return t}})(oJ)&&(document.cookie=`${oJ}=; Max-Age=0; path=/; samesite=lax`,i.debug("Zephr: firing registration conversion event (71) from new-registration cookie"),R({action:71,userState:"registered",increaseRA:!1,wId_2:[]}))})({authenticated:I.authenticated??!1}),await oD(),oE(),h(n)};(async()=>{o$||(o$=o1().catch(e=>{throw o$=null,oX({running:!1}),i.error("Zephr init failed",e),e}))})()})();