(()=>{"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:()=>_,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]},_=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:()=>od,run:()=>op});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={paywall:44,registration_wall:43,meter:41},b=e=>v[e]??44,I=({action:e,userState:t,stableUserId:r,increaseRA:n,wId_2:o=[],actionValue:a})=>{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 s={brandId:window.ZITFunctions.brandId,action:e,wId_2:o,dtId:window.ZITFunctions.retrieveOrigSession(),refer:document.referrer,requestUrl:window.location.href,content:{increaseRA:n},user:{userState:t,...r?{userId:r}:{}},...void 0!==a?{actionValue:a}:{}};i.debug("Sending AI Paywall data",{action:e});try{window.ZITFunctions.sendData(s)}catch(e){i.warn("ZITFunctions.sendData threw an error",e)}},S=function(e){window.performance.getEntriesByName(e,"mark").some(function(t){return t.name===e})||window.performance.mark(e)};function L(e){return(L="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 _(){_=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 k(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(T([])));I&&I!==r&&n.call(I,a)&&(v=I);var S=w.prototype=y.prototype=Object.create(v);function z(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function O(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"==L(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 P(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function T(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),C(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;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),h}},t}function z(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 O,P,C=(O=_().mark(function e(){return _().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"));S("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),S("onConsentReady-end"),window.performance.measure("onConsentReady-total-time","onConsentReady-init","onConsentReady-end"),e(r)}))})}));case 1:case"end":return e.stop()}},e)}),P=function(){var e=this,t=arguments;return new Promise(function(r,n){var o=O.apply(e,t);function i(e){z(o,r,n,i,a,"next",e)}function a(e){z(o,r,n,i,a,"throw",e)}i(void 0)})},function(){return P.apply(this,arguments)}),k={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 T=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=k[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)},E={segment:{vendorId:w.LK,purposes:w.do},zephr:{vendorId:w.vr,purposes:w.BQ},permutive:{vendorId:w.Tn,purposes:w.JB}},A=async e=>{let t=E[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 C();i.info(`${r}Consent ready received, checking requisite consent`);let o=void 0!==t.vendorId?[t.vendorId]:[],a=T({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}},x=new Set([10000008,10000012]),Z=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}))},D=async()=>{if(!await A("permutive"))return i.info("Permutive: user has not consented, skipping segment update."),void Z({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."),Z({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)&&x.has(e));if(!a.length)return i.info("Permutive: no mapped segments for user, skipping update."),Z({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}),Z({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}),Z({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."),Z({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."),Z({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."),Z({consentGranted:!0,sent:!1,reason:"sdk_missing",rawSegmentCount:0,mappedSegments:[]}),e())};r()})},j=/(paywall|metering|lock|registration)/i,R=new Map,M=(e,t)=>({...e?{stable_user_id:e}:{},session_id:t}),F=(e,t)=>e?t.length?"subscribed":"registered":"anonymous",U=(e,t,r=null)=>"registration_wall"===r||"registered"===e?"registration_wall":Object.values(t.meters||{}).some(e=>e.decrementedInDecision||e.usedInDecision)?"meter":"paywall",N=(e,t={})=>!!Object.values(e.meters||{}).some(e=>e.usedInDecision||e.decrementedInDecision)||Object.keys(t).length>0,$=()=>{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}))}},V=new Set(["tcloaded","useractioncomplete"]),q=e=>{e&&"function"==typeof window.__tcfapi&&window.__tcfapi("removeEventListener",2,t=>{t||i.warn("Failed to remove TCF listener",{listenerId:e})},e)},G=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&&V.has(n)&&(i.info(`CMP resolved (${n}) - Zephr may continue.`),q(o),e({reason:n,tcdata:t})):i.info("CMP UI shown - waiting for user consent resolution before Zephr starts.")})}),H=null,W=!1,B=()=>{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}},K=async()=>{if(!B())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 C();i.info("Zephr: Consent framework ready, building granular consent");let t=Object.entries(w.vD).reduce((t,[r,n])=>{try{let o=T({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}},J=()=>{if(H)return H;i.info("Zephr: Setting up consolidated consent synchronization");let e=null,t=null;return H=(()=>{let r;return"function"!=typeof window.__tcfapi?()=>{}:(window.__tcfapi("addEventListener",2,(n,o)=>{o&&n&&(r=n.listenerId||r,n.eventStatus&&V.has(n.eventStatus)&&(async r=>{let n=r?.tcString||null,o=B(),a=!0===t&&!o;if(a||!n||n!==e){if(o&&!W)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 K();i.info("Zephr: Consent change detected - syncing unknown-user custom segment"),await (async({force:e=!1}={})=>{if(B())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 A("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))}),()=>q(r))})()};var X="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{};function Y(e){var t={exports:{}};return e(t,t.exports),t.exports}var Q=function(e){return e&&e.Math===Math&&e},ee=Q("object"==typeof globalThis&&globalThis)||Q("object"==typeof window&&window)||Q("object"==typeof self&&self)||Q("object"==typeof X&&X)||Q("object"==typeof X&&X)||function(){return this}()||Function("return this")(),et=function(e){try{return!!e()}catch(e){return!0}},er=!et(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}),en=!et(function(){var e=(function(){}).bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}),eo=Function.prototype,ei=eo.call,ea=en&&eo.bind.bind(ei,ei),es=en?ea:function(e){return function(){return ei.apply(e,arguments)}},ec="object"==typeof document&&document.all,eu=void 0===ec&&void 0!==ec?function(e){return"function"==typeof e||e===ec}:function(e){return"function"==typeof e},el=function(e){return null==e},ed=TypeError,ep=function(e){if(el(e))throw new ed("Can't call method on "+e);return e},ef=Object,em=function(e){return ef(ep(e))},eh=es({}.hasOwnProperty),ey=Object.hasOwn||function(e,t){return eh(em(e),t)},eg=Function.prototype,ew=er&&Object.getOwnPropertyDescriptor,ev=ey(eg,"name"),eb={EXISTS:ev,PROPER:ev&&"something"===(function(){}).name,CONFIGURABLE:ev&&(!er||er&&ew(eg,"name").configurable)},eI=Object.defineProperty,eS=function(e,t){try{eI(ee,e,{value:t,configurable:!0,writable:!0})}catch(r){ee[e]=t}return t},eL=Y(function(e){var t="__core-js_shared__",r=e.exports=ee[t]||eS(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"})}),e_=es(Function.toString);eu(eL.inspectSource)||(eL.inspectSource=function(e){return e_(e)});var ez,eO,eP=eL.inspectSource,eC=ee.WeakMap,ek=eu(eC)&&/native code/.test(String(eC)),eT=function(e){return"object"==typeof e?null!==e:eu(e)},eE=ee.document,eA=eT(eE)&&eT(eE.createElement),ex=function(e){return eA?eE.createElement(e):{}},eZ=!er&&!et(function(){return 7!==Object.defineProperty(ex("div"),"a",{get:function(){return 7}}).a}),eD=er&&et(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),ej=String,eR=TypeError,eM=function(e){if(eT(e))return e;throw new eR(ej(e)+" is not an object")},eF=Function.prototype.call,eU=en?eF.bind(eF):function(){return eF.apply(eF,arguments)},eN=function(e,t){var r;return arguments.length<2?eu(r=ee[e])?r:void 0:ee[e]&&ee[e][t]},e$=es({}.isPrototypeOf),eV="undefined"!=typeof navigator&&String(navigator.userAgent)||"",eq=ee.process,eG=ee.Deno,eH=eq&&eq.versions||eG&&eG.version,eW=eH&&eH.v8;eW&&(eO=(ez=eW.split("."))[0]>0&&ez[0]<4?1:+(ez[0]+ez[1])),!eO&&eV&&(!(ez=eV.match(/Edge\/(\d+)/))||ez[1]>=74)&&(ez=eV.match(/Chrome\/(\d+)/))&&(eO=+ez[1]);var eB,eK,eJ,eX=eO,eY=ee.String,eQ=!!Object.getOwnPropertySymbols&&!et(function(){var e=Symbol("symbol detection");return!eY(e)||!(Object(e) instanceof Symbol)||!Symbol.sham&&eX&&eX<41}),e0=eQ&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,e1=Object,e2=e0?function(e){return"symbol"==typeof e}:function(e){var t=eN("Symbol");return eu(t)&&e$(t.prototype,e1(e))},e5=String,e6=TypeError,e7=function(e){if(eu(e))return e;throw new e6(function(e){try{return e5(e)}catch(e){return"Object"}}(e)+" is not a function")},e3=function(e,t){var r=e[t];return el(r)?void 0:e7(r)},e4=TypeError,e9=function(e,t){return eL[e]||(eL[e]=t||{})},e8=0,te=Math.random(),tt=es(1..toString),tr=function(e){return"Symbol("+(void 0===e?"":e)+")_"+tt(++e8+te,36)},tn=ee.Symbol,to=e9("wks"),ti=e0?tn.for||tn:tn&&tn.withoutSetter||tr,ta=function(e){return ey(to,e)||(to[e]=eQ&&ey(tn,e)?tn[e]:ti("Symbol."+e)),to[e]},ts=TypeError,tc=ta("toPrimitive"),tu=function(e){var t=function(e,t){if(!eT(e)||e2(e))return e;var r,n=e3(e,tc);if(n){if(void 0===t&&(t="default"),!eT(r=eU(n,e,t))||e2(r))return r;throw new ts("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var r,n;if("string"===t&&eu(r=e.toString)&&!eT(n=eU(r,e))||eu(r=e.valueOf)&&!eT(n=eU(r,e))||"string"!==t&&eu(r=e.toString)&&!eT(n=eU(r,e)))return n;throw new e4("Can't convert object to primitive value")}(e,t)}(e,"string");return e2(t)?t:t+""},tl=TypeError,td=Object.defineProperty,tp=Object.getOwnPropertyDescriptor,tf={f:er?eD?function(e,t,r){if(eM(e),t=tu(t),eM(r),"function"==typeof e&&"prototype"===t&&"value"in r&&"writable"in r&&!r.writable){var n=tp(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 td(e,t,r)}:td:function(e,t,r){if(eM(e),t=tu(t),eM(r),eZ)try{return td(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new tl("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},tm=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},th=er?function(e,t,r){return tf.f(e,t,tm(1,r))}:function(e,t,r){return e[t]=r,e},ty=e9("keys"),tg=function(e){return ty[e]||(ty[e]=tr(e))},tw={},tv=ee.TypeError;if(ek||eL.state){var tb=eL.state||(eL.state=new ee.WeakMap);tb.get=tb.get,tb.has=tb.has,tb.set=tb.set,eB=function(e,t){if(tb.has(e))throw new tv("Object already initialized");return t.facade=e,tb.set(e,t),t},eK=function(e){return tb.get(e)||{}},eJ=function(e){return tb.has(e)}}else{var tI=tg("state");tw[tI]=!0,eB=function(e,t){if(ey(e,tI))throw new tv("Object already initialized");return t.facade=e,th(e,tI,t),t},eK=function(e){return ey(e,tI)?e[tI]:{}},eJ=function(e){return ey(e,tI)}}var tS,tL={set:eB,get:eK,enforce:function(e){return eJ(e)?eK(e):eB(e,{})},getterFor:function(e){return function(t){var r;if(!eT(t)||(r=eK(t)).type!==e)throw new tv("Incompatible receiver, "+e+" required");return r}}},t_=Y(function(e){var t=eb.CONFIGURABLE,r=tL.enforce,n=tL.get,o=String,i=Object.defineProperty,a=es("".slice),s=es("".replace),c=es([].join),u=er&&!et(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),(!ey(e,"name")||t&&e.name!==n)&&(er?i(e,"name",{value:n,configurable:!0}):e.name=n),u&&d&&ey(d,"arity")&&e.length!==d.arity&&i(e,"length",{value:d.arity});try{d&&ey(d,"constructor")&&d.constructor?er&&i(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var p=r(e);return ey(p,"source")||(p.source=c(l,"string"==typeof n?n:"")),e};Function.prototype.toString=d(function(){return eu(this)&&n(this).source||eP(this)},"toString")}),tz=function(){var e=eM(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},tO=ee.RegExp,tP=tO.prototype;er&&et(function(){var e=!0;try{tO(".","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(tP,"flags").get.call(t)!==n||r!==n})&&((tS={configurable:!0,get:tz}).get&&t_(tS.get,"flags",{getter:!0}),tS.set&&t_(tS.set,"flags",{setter:!0}),tf.f(tP,"flags",tS));var tC,tk={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},tT=ex("span").classList,tE=tT&&tT.constructor&&tT.constructor.prototype,tA=tE===Object.prototype?void 0:tE,tx=es({}.toString),tZ=es("".slice),tD=function(e){return tZ(tx(e),8,-1)},tj=Object,tR=es("".split),tM=et(function(){return!tj("z").propertyIsEnumerable(0)})?function(e){return"String"===tD(e)?tR(e,""):tj(e)}:tj,tF=function(e){return tM(ep(e))},tU=Math.ceil,tN=Math.floor,t$=Math.trunc||function(e){var t=+e;return(t>0?tN:tU)(t)},tV=function(e){var t=+e;return t!=t||0===t?0:t$(t)},tq=Math.max,tG=Math.min,tH=Math.min,tW=function(e){var t=tV(e);return t>0?tH(t,9007199254740991):0},tB=function(e){return function(t,r,n){var o=tF(t),i=tW(o.length);if(0===i)return!e&&-1;var a,s,c=(a=tV(n))<0?tq(a+i,0):tG(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}},tK=(tB(!0),tB(!1)),tJ=es([].push),tX=function(e,t){var r,n=tF(e),o=0,i=[];for(r in n)!ey(tw,r)&&ey(n,r)&&tJ(i,r);for(;t.length>o;)ey(n,r=t[o++])&&(~tK(i,r)||tJ(i,r));return i},tY=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],tQ=Object.keys||function(e){return tX(e,tY)},t0={f:er&&!eD?Object.defineProperties:function(e,t){eM(e);for(var r,n=tF(t),o=tQ(t),i=o.length,a=0;i>a;)tf.f(e,r=o[a++],n[r]);return e}},t1=eN("document","documentElement"),t2=tg("IE_PROTO"),t5=function(){},t6=function(e){return""},t7=function(e){e.write(t6("")),e.close();var t=e.parentWindow.Object;return e=null,t},t3=function(){try{tC=new ActiveXObject("htmlfile")}catch(e){}t3="undefined"!=typeof document?document.domain&&tC?t7(tC):((t=ex("iframe")).style.display="none",t1.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(t6("document.F=Object")),e.close(),e.F):t7(tC);for(var e,t,r=tY.length;r--;)delete t3.prototype[tY[r]];return t3()};tw[t2]=!0;var t4=Object.create||function(e,t){var r;return null!==e?(t5.prototype=eM(e),r=new t5,t5.prototype=null,r[t2]=e):r=t3(),void 0===t?r:t0.f(r,t)},t9=tf.f,t8=ta("unscopables"),re=Array.prototype;void 0===re[t8]&&t9(re,t8,{configurable:!0,value:t4(null)});var rt,rr,rn,ro=function(e){re[t8][e]=!0},ri={},ra={}.propertyIsEnumerable,rs=Object.getOwnPropertyDescriptor,rc={f:rs&&!ra.call({1:2},1)?function(e){var t=rs(this,e);return!!t&&t.enumerable}:ra},ru=Object.getOwnPropertyDescriptor,rl={f:er?ru:function(e,t){if(e=tF(e),t=tu(t),eZ)try{return ru(e,t)}catch(e){}if(ey(e,t))return tm(!eU(rc.f,e,t),e[t])}},rd=function(e,t,r,n){n||(n={});var o=n.enumerable,i=void 0!==n.name?n.name:t;if(eu(r)&&t_(r,i,n),n.global)o?e[t]=r:eS(t,r);else{try{n.unsafe?e[t]&&(o=!0):delete e[t]}catch(e){}o?e[t]=r:tf.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},rp=tY.concat("length","prototype"),rf={f:Object.getOwnPropertyNames||function(e){return tX(e,rp)}},rm={f:Object.getOwnPropertySymbols},rh=es([].concat),ry=eN("Reflect","ownKeys")||function(e){var t=rf.f(eM(e)),r=rm.f;return r?rh(t,r(e)):t},rg=function(e,t,r){for(var n=ry(t),o=tf.f,i=rl.f,a=0;a=t.length)return e.target=void 0,rB(void 0,!0);switch(e.kind){case"keys":return rB(r,!1);case"values":return rB(t[r],!1)}return rB([r,t[r]],!1)})}),rj(r,i,!1),ri[i]=rM;var i,a,s,c=function(e){if(e===o&&p)return p;if(!rG&&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[rH]||l["@@iterator"]||l.values,p=!rG&&d||c(o),f=l.entries||d;return f&&(a=rT(f.call(new e)))!==Object.prototype&&a.next&&(rT(a)!==rq&&(rN?rN(a,rq):eu(a[rH])||rd(a,rH,rW)),rj(a,"Array Iterator",!0)),r$&&d&&"values"!==d.name&&(rV?th(l,"name","values"):(u=!0,p=function(){return eU(d,this)})),rz({target:"Array",proto:!0,forced:rG||u},s={values:c("values"),keys:c("keys"),entries:c("entries")}),l[rH]!==p&&rd(l,rH,p,{name:o}),ri.Array=p,s}(Array,0,function(e,t){rJ(this,{type:"Array Iterator",target:tF(e),index:0,kind:t})},0,"values"),rQ=ri.Arguments=ri.Array;if(ro("keys"),ro("values"),ro("entries"),er&&"values"!==rQ.name)try{rK(rQ,"name",{value:"values"})}catch(e){}var r0=ta("iterator"),r1=rY.values,r2=function(e,t){if(e){if(e[r0]!==r1)try{th(e,r0,r1)}catch(t){e[r0]=r1}if(rj(e,t,!0),tk[t]){for(var r in rY)if(e[r]!==rY[r])try{th(e,r,rY[r])}catch(t){e[r]=rY[r]}}}};for(var r5 in tk)r2(ee[r5]&&ee[r5].prototype,r5);r2(tA,"DOMTokenList"),ro("flat");let r6={transform:{concat:e=>e.map(e=>r3(e)),zoned:e=>({type:"Zone",id:e.zoneId,contents:e.transformations.map(e=>r3(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"})}},r7={type:"LeavePristine"},r3=e=>Function("blaize,leave_pristine",'"use strict";return ('+(e.trim().length?e:"blaize.transform.remove()")+");")(r6,r7);function r4(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 r9=Function.prototype,r8=r9.apply,ne=r9.call,nt="object"==typeof Reflect&&Reflect.apply||(en?ne.bind(r8):function(){return ne.apply(r8,arguments)}),nr={};nr[ta("toStringTag")]="z";var nn,no,ni="[object z]"===String(nr),na=ta("toStringTag"),ns=Object,nc="Arguments"===tD(function(){return arguments}()),nu=ni?tD: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=ns(e),na))?r:nc?tD(t):"Object"===(n=tD(t))&&eu(t.callee)?"Arguments":n},nl=String,nd=function(e){if("Symbol"===nu(e))throw TypeError("Cannot convert a Symbol value to a string");return nl(e)},np=ee.RegExp,nf=et(function(){var e=np("a","y");return e.lastIndex=2,null!==e.exec("abcd")}),nm=nf||et(function(){return!np("a","y").sticky}),nh={BROKEN_CARET:nf||et(function(){var e=np("^r","gy");return e.lastIndex=2,null!==e.exec("str")}),MISSED_STICKY:nm,UNSUPPORTED_Y:nf},ny=ee.RegExp,ng=et(function(){var e=ny(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}),nw=ee.RegExp,nv=et(function(){var e=nw("(?b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")}),nb=tL.get,nI=e9("native-string-replace",String.prototype.replace),nS=RegExp.prototype.exec,nL=nS,n_=es("".charAt),nz=es("".indexOf),nO=es("".replace),nP=es("".slice),nC=(no=/b*/g,eU(nS,nn=/a/,"a"),eU(nS,no,"a"),0!==nn.lastIndex||0!==no.lastIndex),nk=nh.BROKEN_CARET,nT=void 0!==/()??/.exec("")[1];(nC||nT||nk||ng||nv)&&(nL=function(e){var t,r,n,o,i,a,s,c=nb(this),u=nd(e),l=c.raw;if(l)return l.lastIndex=this.lastIndex,t=eU(nL,l,u),this.lastIndex=l.lastIndex,t;var d=c.groups,p=nk&&this.sticky,f=eU(tz,this),m=this.source,h=0,y=u;if(p&&(-1===nz(f=nO(f,"y",""),"g")&&(f+="g"),y=nP(u,this.lastIndex),this.lastIndex>0&&(!this.multiline||this.multiline&&"\n"!==n_(u,this.lastIndex-1))&&(m="(?: "+m+")",y=" "+y,h++),r=RegExp("^(?:"+m+")",f)),nT&&(r=RegExp("^"+m+"$(?!\\s)",f)),nC&&(n=this.lastIndex),o=eU(nS,p?r:this,y),p?o?(o.input=nP(o.input,h),o[0]=nP(o[0],h),o.index=this.lastIndex,this.lastIndex+=o[0].length):this.lastIndex=0:nC&&o&&(this.lastIndex=this.global?o.index+o[0].length:n),nT&&o&&o.length>1&&eU(nI,o[0],r,function(){for(i=1;i=s?e?"":void 0:(n=nZ(i,a))<55296||n>56319||a+1===s||(o=nZ(i,a+1))<56320||o>57343?e?nx(i,a):n:e?nD(i,a,a+2):o-56320+(n-55296<<10)+65536}},nR=(nj(!1),nj(!0)),nM=Math.floor,nF=es("".charAt),nU=es("".replace),nN=es("".slice),n$=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,nV=/\$([$&'`]|\d{1,2})/g,nq=function(e,t,r,n,o,i){var a=r+e.length,s=n.length,c=nV;return void 0!==o&&(o=em(o),c=n$),nU(i,c,function(i,c){var u;switch(nF(c,0)){case"$":return"$";case"&":return e;case"`":return nN(t,0,r);case"'":return nN(t,a);case"<":u=o[nN(c,1,-1)];break;default:var l=+c;if(0===l)return i;if(l>s){var d=nM(l/10);return 0===d?i:d<=s?void 0===n[d-1]?nF(c,1):n[d-1]+nF(c,1):i}u=n[l-1]}return void 0===u?"":u})},nG=TypeError,nH=function(e,t){var r=e.exec;if(eu(r)){var n=eU(r,e,t);return null!==n&&eM(n),n}if("RegExp"===tD(e))return eU(nE,e,t);throw new nG("RegExp#exec called on incompatible receiver")},nW=ta("replace"),nB=Math.max,nK=Math.min,nJ=es([].concat),nX=es([].push),nY=es("".indexOf),nQ=es("".slice),n0="$0"==="a".replace(/./,"$0"),n1=!!/./[nW]&&""===/./[nW]("a","$0");!function(e,t,r){var n=ta(e),o=!et(function(){var t={};return t[n]=function(){return 7},7!==""[e](t)}),i=o&&!et(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=n1?"$":"$0",[function(e,t){var r=ep(this),n=el(e)?void 0:e3(e,nW);return n?eU(n,e,r,t):eU(a,nd(r),e,t)},function(e,t){var r,n,i=eM(this),u=nd(e);if("string"==typeof t&&-1===nY(t,s)&&-1===nY(t,"$<")){var l=(r=t,(n=i.exec)===nE||n===nA.exec?o?{done:!0,value:eU(c,i,u,r)}:{done:!0,value:eU(a,u,i,r)}:{done:!1});if(l.done)return l.value}var d=eu(t);d||(t=nd(t));var p,f=i.global;f&&(p=i.unicode,i.lastIndex=0);for(var m,h=[];null!==(m=nH(i,u))&&(nX(h,m),f);)""===nd(m[0])&&(i.lastIndex=(y=tW(i.lastIndex))+(p?nR(u,y).length:1));for(var y,g,w="",v=0,b=0;b=v&&(w+=nQ(u,v,L)+I,v=L+S.length)}return w+nQ(u,v)}]);rd(String.prototype,e,u[0]),rd(nA,n,u[1])}}("replace",0,!!et(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")})||!n0||n1);let n2=/<[^>]*>|[^<>]+/g,n5=/^[\p{Alpha}|\p{N}]$/u;class n6{constructor(e,t,r){this.text=e,this.type=t,this.isSentenceEnd=r}}let n7=Object.freeze({WORD:0,PUNCTUATION:1,WHITESPACE:2}),n3=Object.freeze(["script","style","noscript","template","iframe","svg","canvas"]);function n4(e){return n3.some(t=>{let r=e.indexOf("<"+t)>=0,n=e.indexOf("=0;return r?!n:n})}let n9=Object.freeze({LOCALE_AWARE_TRUNCATION:!1}),n8=()=>Intl&&"Segmenter"in Intl,oe=e=>{let t;return"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},ot=function(e){e&&console.log(...[].slice.call(arguments,1))},or=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)),on(n),n},on=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)})},oo=(e,t,r,n)=>{switch(t.type){case"LeavePristine":return e;case"Truncate":return n.LOCALE_AWARE_TRUNCATION&&n8()?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(n2).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 n6(e,e.trim().length>0?n7.WORD:n7.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 n6(n,0===n.trim().length?n7.WHITESPACE:1!==n.length||n5.test(n)?n7.WORD:n7.PUNCTUATION,t.length>1&&e===c.length-1))}if(o>0){let e=n.substring(l,l+o);a.push(new n6(e,e.trim().length>0?n7.WORD:n7.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===n7.WHITESPACE&&!e.isSentenceEnd)continue;let r=e.text.trim();if(c&&r.indexOf("=0&&n4(r)?c=!1:r.indexOf("<")>=0&&n4(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===n7.WORD)break;(e.type===n7.WORD||e.isSentenceEnd)&&(e.type===n7.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+="..."),r4((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"),r4((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 or(t.forms[e.formId]);console.error("Form not found.")})(t,r);case"PaymentForm":return((e,t)=>{if(t.paymentForms&&t.paymentForms[e.formId])return or(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 or(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 or(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 or(t.componentTemplates[e.componentId]);console.error("Component template not found.")})(t,r);case"Remove":break;case"Zone":let o=t.contents.map(t=>oo(e,t,r,n));return((e,t,r)=>{if(!r.uiComponents||!r.uiComponents[e])return void console.error("Zone not found.");let n=or(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 oi(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}let oa="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function os(e,t,r){if(!e.s){if(r instanceof oc){if(!r.s)return void(r.o=os.bind(null,e,t));1&t&&(t=r.s),r=r.v}if(r&&r.then)return void r.then(os.bind(null,e,t),os.bind(null,e,2));e.s=t,e.v=r;let n=e.o;n&&n(e)}}let oc=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{os(n,1,e(this.v))}catch(e){os(n,2,e)}return n}return this}return this.o=function(e){try{let o=e.v;1&e.s?os(n,1,t?t(o):o):r?os(n,1,r(o)):os(n,2,o)}catch(e){os(n,2,e)}},n},e}();function ou(e){return e instanceof oc&&1&e.s}class ol{constructor(e,t){this.cdnApi=e||"",this.fetcher=t||null}fetchLiveFeatures(){try{let e=this;return Promise.resolve(oi(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(oi(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(oe("zephr.dataLayerReady")))})(r)}let a=function(e,t){if("function"==typeof e[oa]){var r,n,o,i,a,s,c,u=e[oa]();if(function e(r){try{for(;!(a=u.next()).done;)if((r=t(a.value))&&r.then){if(!ou(r))return void r.then(e,c||(c=os.bind(null,s=new oc,2)));r=r.v}s?os(s,1,r):s=r}catch(e){os(s||(s=new oc),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=>oo(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&&!n8())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={}),{...n9,...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 od=(e,t)=>new ol(e,t),op=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=od(r,null==e?void 0:e.fetcher);return Promise.resolve(o.fetchLiveFeatures()).then(function(e){let r,i;function a(){return document.dispatchEvent(oe("zephr.browserDecisionsFinished")),o}Array.isArray(e)?r=e:(r=e.features,i=e.datalayerOutcomesConfig),ot(t,"Live Features:",r);let s=o.findFeatures(r),c=function(){if(s.length)return ot(t,"Features on page:",s),Promise.resolve(o.fetchDecisions(s,n)).then(function(e){ot(t,"Decisions:",e);let r=performance.now();return Promise.resolve(o.executeDecisions(s,e,i,n)).then(function(){ot(t,"Decision execution finished: took "+(performance.now()-r)+" ms")})});ot(t,"No features found on page.")}();return c&&c.then?c.then(a):a()})}catch(e){return Promise.reject(e)}},of=e=>{let t={};e?.stableUserId&&(t.stable_user_id=e.stableUserId),e&&(t.session_id=e.sessionId);let r="undefined"!=typeof document&&"string"==typeof document.referrer&&document.referrer?document.referrer:null;return r&&(t.referrer=r),t},om=(()=>{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=of(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=of(t);return op(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)}})(),oh=["#zephr-body-link","#zephr-footer-body-button",".banner-cta"],oy="zephrDatalayerAttached",og=()=>{let e=!1;return oh.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[oy]&&(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[oy]="true",e=!0)}),e},ow=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),ov=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(!ow(e))return null;if("dataLayer"in e){let t=e.dataLayer;return ow(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 ob=r(293);let oI="zephr-target-ready",oS=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)}},oL=async()=>{if((0,ob.qV)())return i.debug("Checkout DOM detected during initial scan. Starting timeout now."),void await oS();i.debug("Checkout DOM not found on initial scan. Waiting in background for late render."),((e=15e3)=>new Promise(t=>{if((0,ob.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(oI,s),s=()=>{},i.debug("Checkout readiness wait finished.",{isReady:e}),t(e))},u=()=>{(0,ob.qV)()&&c(!0)};"undefined"!=typeof MutationObserver&&(a=new MutationObserver(u)).observe(document.body,{childList:!0,subtree:!0,attributes:!0}),s=()=>{u()},document.addEventListener(oI,s),n=setInterval(u,100),o=setTimeout(()=>c((0,ob.qV)()),e),u()}))().then(e=>{if(e)return i.info("Checkout DOM became ready after background wait. Starting timeout."),oS();i.debug("Checkout DOM did not appear before readiness timeout.")}).catch(e=>{i.warn("Failed to initialize checkout inactivity timeout.",e)})},o_="zephr:session-id",oz=["blaize_session"],oO=()=>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},{}),oP=e=>"object"==typeof e&&null!==e,oC=e=>{try{return JSON.parse(e)}catch{return null}},ok=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}},oT=async()=>{if("function"!=typeof fetch||"1"!==oO().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}},oE=()=>{let e=(e=>{let t=oO(),r=e.find(e=>!!t[e]);return r?t[r]:null})(oz);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:[oC(r),ok(r)].filter(oP).map(e=>t.reduce((t,r)=>t||((e,t)=>{let r=t.reduce((e,t)=>oP(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},oA=()=>{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,o_);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,o_,r),r},ox=async()=>({stableUserId:(()=>{let e=window.IM?.user;return e?.fabric_user_id?e.fabric_user_id:e?.guid?e.guid:null})()||await oT(),sessionId:oE()||oA()}),oZ=["zephr-paywall-","zephr-datawall-"],oD="zephr:inline_dismissed:any",oj=e=>oZ.some(t=>e.startsWith(t)),oR=()=>oZ.map(e=>`[id^="${e}"]`).join(", "),oM=()=>document.querySelector(oR()),oF=e=>`zephr:inline_dismissed:${e}`,oU=e=>{try{return window.sessionStorage.getItem(e)}catch{return null}},oN=(e,t)=>{try{return window.sessionStorage.setItem(e,t),!0}catch{return!1}},o$=({logger:e}={})=>{try{let e="true"===oU(oD);Array.from(document.querySelectorAll(oR())).forEach(t=>{t?.id&&oj(t.id)&&(e||"true"===oU(oF(t.id)))&&(t.removeAttribute("id"),t.setAttribute("data-zephr-inline-dismissed","true"))})}catch(t){e?.warn?.("[Zephr Inline] applyInlineDismissalBeforeZephr failed",t)}},oV=null,oq=null,oG=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))}},oH="[data-zephr-template-type]",oW="ZephrNewRegistration",oB=e=>{let t=e?.closest(oH)||e?.querySelector(oH)||document.querySelector(oH);return t?.getAttribute("data-zephr-template-type")||null},oK=({initialized:e,running:t})=>{"undefined"!=typeof window&&(void 0!==e&&(window.zephrInitialized=e),void 0!==t&&(window.zephrRunning=t))},oJ=async({stableUserId:e,sessionId:t})=>{let{activeState:r=[]}=$?.()||{};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=>oB(e)||new Promise(t=>{let r=!1,n=()=>{r||(r=!0,o.disconnect(),window.clearTimeout(i),t(oB(e)))},o=new MutationObserver(()=>{oB(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=F(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:U(h,p,a),increaseRA:N(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,...M(l,d)}),I({action:b(f),userState:p,stableUserId:l,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,...M(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=R.get(v);b&&document.body.removeEventListener("click",b);let S=t=>{let v=t.target;if(!v)return;let b=v.closest("button");if(!b||!b.closest('[id^="zephr-"]'))return;let S="zephr-footer-body-button"===b.id||"zephr-body-button"===b.id,L=!!document.querySelector('[id^="zephr-paywall-"], [id^="zephr-datawall-"]'),_=j.test(`${n||""} ${o||""}`);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,...M(l,d),authenticated:p,activeProducts:f}),I({action:"registration_wall"===y?70:28,userState:m,stableUserId:l,increaseRA:h,wId_2:r?[r]:[]}))};R.set(v,S),document.body.addEventListener("click",S)})({formRoot:n,...d}),d});oq?.(),oq=(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,...M(u,l)},aiPaywallParams:{userState:d,stableUserId:u,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),I({action:28,...t}));break;case"zephr_form_register":i.debug("Zephr registration, pushing zephr_form_register"),(0,g.Z)(w.T2,e),I({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;I({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 K();return W=!0,i.info("Zephr: Zephr consent sync result:",{success:e}),e})()},oX=async()=>{var e,t;let r={},n=(e,t)=>{r[`zephr-step-${e}-ms`]=t};oK({initialized:!1,running:!1}),f("time-to-zephr-started"),i.info("Zephr onDOMReady about to fired."),await oG("dom-ready",l,e=>{n("dom-ready",e)}),og();let{enabled:a=!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(!a)return void i.info("Zephr not enabled.");J(),(({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(oR())??oM();if(!t?.id||!oj(t.id))return;oN(oF(t.id),"true"),oN(oD,"true"),t.setAttribute("hidden","hidden"),o$({logger:e})}catch(t){e?.warn?.("[Zephr Inline] attachInlineDismissClickListener failed",t)}window.location.reload()}}))})({logger:i});let s=await oG("identity-resolution",ox,e=>{n("identity-resolution",e)}),c=(()=>{if("true"===oU(oD))return!0;let e=oM();return!(!e?.id||!oj(e.id))&&"true"===oU(oF(e.id))})();c&&(o$({logger:i}),i.info("Zephr: Inline paywall dismissed.")),await oG("cmp-settle",G,e=>{n("cmp-settle",e)}),oK({initialized:!0}),f("time-to-zephr-initialised"),m("time-to-zephr-initialised","navigationStart","time-to-zephr-initialised"),o$({logger:i}),c||await oG("wait-for-targets",p,e=>{n("wait-for-targets",e)}),o$({logger:i}),await oG("permutive-sync",D,e=>{n("permutive-sync",e)}),await oG("runtime-run-once",()=>om.runOnce(s),e=>{n("runtime-run-once",e)}),oK({running:!0}),f("time-to-zephr-loaded"),m("time-to-zephr-loaded","navigationStart","time-to-zephr-loaded"),i.info("Zephr enabled."),await oG("wait-for-decisions-finished",om.waitForDecisionsFinished,e=>{n("wait-for-decisions-finished",e)}),await oG("sync-split-test-data-layer",ov,e=>{n("sync-split-test-data-layer",e)});let u=oE(),d=u&&u!==s.sessionId?{...s,sessionId:u}:s;(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)}})(d.sessionId);let{accessDetails:y={}}=window?.Zephr||{},{activeState:v=[]}=$()||{},b=Object.fromEntries(v.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,...M(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}:{}}:{}}),I({action:21,userState:r,stableUserId:e,increaseRA:n,wId_2:[""]})})({stableUserId:d.stableUserId,sessionId:d.sessionId,userState:F(y.authenticated??!1,y.activeProducts||[]),increaseRA:N(y,b)}),await oG("process-active-state",()=>oJ(d),e=>{n("process-active-state",e)}),(({stableUserId:e,sessionId:t,authenticated:r})=>{r&&(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}})(oW)&&(document.cookie=`${oW}=; Max-Age=0; path=/; samesite=lax`,i.debug("Zephr: firing registration conversion event (71) from new-registration cookie"),I({action:71,userState:"registered",stableUserId:e,increaseRA:!1,wId_2:[]}))})({stableUserId:d.stableUserId,sessionId:d.sessionId,authenticated:y.authenticated??!1}),await oL(),og(),h(r)};(async()=>{oV||(oV=oX().catch(e=>{throw oV=null,oK({running:!1}),i.error("Zephr init failed",e),e}))})()})();