1var ye=Object.defineProperty;var ve=(t,e,n)=>e in t?ye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var u=(t,e,n)=>ve(t,typeof e!="symbol"?e+"":e,n);/* @preserve 2 3 Unified cookie script. 4 Generation: v2 5 Version: 2.0.16 6 Release date: 22/09/2026 7 Release time: 12:07:58 8 Maintainers: 9 - kkomitski 10 11*/const be="modulepreload",Ce=function(t,e){return new URL(t,e).href},H={},l=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){let o=function(m){return Promise.all(m.map(d=>Promise.resolve(d).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const s=document.getElementsByTagName("link"),c=document.querySelector("meta[property=csp-nonce]"),h=c?.nonce||c?.getAttribute("nonce");r=o(n.map(m=>{if(m=Ce(m,i),m in H)return;H[m]=!0;const d=m.endsWith(".css"),f=d?'[rel="stylesheet"]':"";if(!!i)for(let p=s.length-1;p>=0;p--){const k=s[p];if(k.href===m&&(!d||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${f}`))return;const g=document.createElement("link");if(g.rel=d?"stylesheet":be,d||(g.as="script"),g.crossOrigin="",g.href=m,h&&g.setAttribute("nonce",h),document.head.appendChild(g),d)return new Promise((p,k)=>{g.addEventListener("load",p),g.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${m}`)))})}))}function a(o){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o}return r.then(o=>{for(const s of o||[])s.status==="rejected"&&a(s.reason);return e().catch(a)})},ie=/^(local|preview|local-preview|local-live|dev|dev-local-preview|dev-local-live|hdev|hdev-local-preview|hdev-local-live|hdev3|hdev3-local-preview|hdev3-local-live|nonprod|uat)[.-]/,Ee=new Set(["co.uk","com.au","com.sg","co.nz","com.cn","co.jp"]),Pe={no_no:"nb-no",zh_ca:"en-ca",zh_au:"en-au",zh_nz:"en-nz",zh_sg:"en-sg"};function z(){const t=document.querySelector('script[id="cookies"]');if(!t)throw new Error("Please add an id of 'cookies' to the cookies script tag.");return t}function re(t=z()){const e=t.dataset.language,n=t.dataset.region;if(!n)throw new Error("No locale code found in the '#cookies' script tag. Add data-region.");if(!e)throw new Error("No language code found in the '#cookies' script tag. Add data-language.");return`${e}_${n}`}function Le(t){const e=document.documentElement;e.getAttribute("lang")||e.setAttribute("lang",Pe[t]??t.replace("_","-"))}function F(t=window.location.hostname){return ie.test(t)||t==="localhost"||t==="127.0.0.1"}function ae(t){return t.replace(ie,"")}function Ie(t){const e=t.toLowerCase().replace(/^\.+|\.+$/g,"");if(!e||e==="localhost"||/^\d{1,3}(?:\.\d{1,3}){3}$/.test(e))return e||null;const n=e.split(".");if(n.length<2)return e;const i=n.slice(-2).join("."),r=Ee.has(i)?3:2;return n.slice(-r).join(".")}function oe(t=window.location.hostname){const e=Ie(t),n=/^\d{1,3}(?:\.\d{1,3}){3}$/.test(t)||t.includes(":");if(!(!e||e==="localhost"||n||!t.includes(".")))return`.${e}`}function W(){const t=navigator.userAgent;return/android/i.test(t)?"os-android":/iPad|iPhone|iPod/.test(t)?"os-ios":!1}function Ae(){const t=new URL(window.location.href);if(t.searchParams.get("inApp")==="1")return!0;const e=t.hash.indexOf("?");return e<0?!1:new URLSearchParams(t.hash.slice(e+1)).get("inApp")==="1"}function j(){if(Ae())return!0;const t=navigator.userAgent||navigator.vendor||String(window.opera??""),e=/iP(hone|od|ad)/.test(t)||/Macintosh/i.test(t)&&navigator.maxTouchPoints>1,n=/Safari/.test(t)&&!/CriOS|FxiOS/.test(t)||/CriOS|FxiOS/.test(t),i=e&&!n,a=/Android/.test(t)&&(!/Chrome/.test(t)||/wv/.test(t)||/Version\/[\d.]+.*Safari/.test(t)),o=typeof window.matchMedia=="function"&&window.matchMedia("(display-mode: standalone)").matches;return i||a||o}function Oe(t=z()){return t.dataset.service||"webpage"}function Se(t){return new Set(["live-onboarding","demo-onboarding","payments-hub","customer-hub","cupcake-onboarding"]).has(t)}function Te(){const t=new URL(window.location.href).searchParams;return["enableLogging","logging"].some(e=>{const n=t.get(e);return n==="true"||n==="1"})}function Re(t=z()){return F()&&(t.dataset.enableLogging==="true"||Te())}const ze=[{id:"cfd-online-trader",match:{hostnameIncludes:["cfdonlinetrader"]}},{id:"cmc-markets-invest",match:{hostnameEquals:["www.cmcmarkets.com"],brandEquals:"invest"}},{id:"cmc-invest-singapore",match:{hostnameEquals:["www.cmcinvest.com"],localeIncludes:"sg"}},{id:"cmc-invest",match:{hostnameEquals:["www.cmcinvest.com"]}},{id:"cmc-invest-consent-only",match:{hostnameEndsWith:"cmcinvest.com"}},{id:"opto-themes",match:{hostnameIncludes:["optothemes"]}},{id:"cmc-markets-invest-au",match:{hostnameIncludes:["cmcmarketsinvest.com"]}},{id:"signup-invest-au",match:{hostnameEquals:["signup.invest.cmcmarkets.com.au"]}},{id:"direct-shares-trading",match:{hostnameEquals:["trading.directshares.com.au"]}},{id:"bendigo-invest-direct-trading",match:{hostnameEquals:["trading.bendigoinvestdirect.com.au"]}},{id:"au-pro",match:{hostnameEquals:["pro.directshares.com.au","pro.bendigoinvestdirect.com.au","www.danmurphys.com.au","www.servicesaustralia.gov.au"]}},{id:"cmc-markets-stockbroking-web",match:{hostnameEquals:["www.cmcmarketsstockbroking.com.au","nfr-www.cmcmarketsstockbroking.com.au","nfr-anz-www.cmcmarketsstockbroking.com.au"]}},{id:"cmc-markets-stockbroking-pro",match:{hostnameEquals:["pro.cmcmarketsstockbroking.com.au","adv-pro.cmcmarketsstockbroking.com.au"]}},{id:"cmc-markets-stockbroking",match:{hostnameIncludes:["cmcmarketsstockbroking.com"]}},{id:"au-web-meta",match:{hostnameEquals:["www.anz.com.au"]}},{id:"cmc-markets-braze-australia",match:{hostnameEquals:["livesignup.cmcmarkets.com","onboarding-gateway.cmcmarkets.com"],localeIncludes:"au"}},{id:"cmc-markets-australia",match:{hostnameIncludes:[".cmcmarkets.com"],localeIncludes:"au"}},{id:"cmc-markets-australia-meta",match:{hostnameIncludes:["cmcmarkets"],localeIncludes:"au"}},{id:"cmc-markets-braze-meta",match:{hostnameEquals:["livesignup.cmcmarkets.com","onboarding-gateway.cmcmarkets.com"]}},{id:"cmc-markets-global",match:{hostnameEquals:["www.cmcmarkets.com","signup.cmcmarkets.com","oaf.cmcmarkets.com","client-portal.cmcmarkets.com","partner-portal.cmcmarkets.com"]}},{id:"cmc-markets-consent-only",match:{hostnameEndsWith:"cmcmarkets.com"}},{id:"cmc-partner",match:{hostnameIncludes:["cmcpartner.com"]}},{id:"fallback",match:{}}],De={"cfd-online-trader":()=>l(()=>import("./config/cfd-online-trader-DZgK3F-4.js"),[],import.meta.url),"cmc-markets-invest":()=>l(()=>import("./config/cmc-markets-invest-DRjjEQQV.js"),[],import.meta.url),"cmc-invest-singapore":()=>l(()=>import("./config/cmc-invest-singapore-DAEa1kvn.js"),[],import.meta.url),"cmc-invest":()=>l(()=>import("./config/cmc-invest-4Qak0miY.js"),[],import.meta.url),"cmc-invest-consent-only":()=>l(()=>import("./config/cmc-invest-consent-only-BsuKJUnh.js"),[],import.meta.url),"opto-themes":()=>l(()=>import("./config/opto-themes-vWoIViY2.js"),[],import.meta.url),"cmc-markets-invest-au":()=>l(()=>import("./config/cmc-markets-invest-au-C8kxar4n.js"),[],import.meta.url),"signup-invest-au":()=>l(()=>import("./config/signup-invest-au-4fuE_zvo.js"),[],import.meta.url),"direct-shares-trading":()=>l(()=>import("./config/direct-shares-trading-DTR2Miyk.js"),[],import.meta.url),"bendigo-invest-direct-trading":()=>l(()=>import("./config/bendigo-invest-direct-trading-Cb0s0g8i.js"),[],import.meta.url),"au-pro":()=>l(()=>import("./config/au-pro-BGPJjBpv.js"),[],import.meta.url),"cmc-markets-stockbroking-web":()=>l(()=>import("./config/cmc-markets-stockbroking-web-DEwcTfJN.js"),[],import.meta.url),"cmc-markets-stockbroking-pro":()=>l(()=>import("./config/cmc-markets-stockbroking-pro-CnGA3sMA.js"),[],import.meta.url),"cmc-markets-stockbroking":()=>l(()=>import("./config/cmc-markets-stockbroking-B9iSpwpp.js"),[],import.meta.url),"au-web-meta":()=>l(()=>import("./config/au-web-meta-D7YCBil2.js"),[],import.meta.url),"cmc-markets-braze-australia":()=>l(()=>import("./config/cmc-markets-braze-australia-CSEk_kJZ.js"),[],import.meta.url),"cmc-markets-australia":()=>l(()=>import("./config/cmc-markets-australia-B29D5cP3.js"),[],import.meta.url),"cmc-markets-australia-meta":()=>l(()=>import("./config/cmc-markets-australia-meta-CnH_DTZK.js"),[],import.meta.url),"cmc-markets-braze-meta":()=>l(()=>
11import("./config/cmc-markets-braze-meta-BC7F6k--.js"),[],import.meta.url),"cmc-markets-global":()=>l(()=>import("./config/cmc-markets-global-BchjgMd2.js"),[],import.meta.url),"cmc-markets-consent-only":()=>l(()=>import("./config/cmc-markets-consent-only-B5_i5fp0.js"),[],import.meta.url),"cmc-partner":()=>l(()=>import("./config/cmc-partner-B91Hc8SC.js"),[],import.meta.url),fallback:()=>l(()=>import("./config/fallback-B9iSpwpp.js"),[],import.meta.url)},Q=new Map;function Ue(t,e){return!(t.hostnameEquals&&!t.hostnameEquals.includes(e.hostname)||t.hostnameIncludes&&!t.hostnameIncludes.some(n=>e.hostname.includes(n))||t.hostnameEndsWith&&!e.hostname.endsWith(t.hostnameEndsWith)||t.brandEquals&&e.brand!==t.brandEquals||t.localeIncludes&&!e.locale.includes(t.localeIncludes))}function Me(t,e,n){return{hostname:ae(t).toLowerCase(),locale:e.toLowerCase(),brand:n?.trim().toLowerCase()??""}}function Ve(t,e,n){const i=Me(t,e,n),r=ze.find(a=>Ue(a.match,i));if(!r)throw new Error("No fallback config found in tracking configuration.");return r.id}async function $e(t){const e=Q.get(t);if(e)return e;const n=De[t];if(!n)throw new Error(`No configuration chunk is available for '${t}'.`);const i=n().then(({default:r})=>r);return Q.set(t,i),i}async function se(t,e,n){const i=Ve(t,e,n);return{config:await $e(i),configId:i}}const ce=(t,e,n="default_instance")=>({key:t,planId:e,instance:n});function le(t){return t.mParticleCredentials.map(e=>ce(e.key,e.planId,e.instance))}function qe(t,e){if(t.oneTrust!=="required-page-meta")return t.oneTrust[e?"development":"production"]}function de(){return Array.from(document.querySelectorAll('meta[name="mparticle-key"]')).map((t,e)=>{const n=t.dataset.key,i=t.dataset.plan_id,r=t.dataset.instance_name;if(!r)throw new Error(`mParticle meta ${e+1} is missing data-instance_name.`);if(!n||n==="insert-key-here")throw new Error(`mParticle meta '${r}' has an invalid data-key.`);if(!i||i==="insert-plan-id-here")throw new Error(`mParticle meta '${r}' has an invalid data-plan_id.`);return ce(n,i,r)})}function ue(t){const e=new Set;for(const n of t){if(e.has(n.instance))throw new Error(`mParticle instance '${n.instance}' is configured more than once.`);e.add(n.instance)}if(t.length&&t[0].instance!=="default_instance")throw new Error("The first mParticle instance must be named 'default_instance'.")}async function xe(t,e,n=document.body?.dataset.brand){const i=Array.from(document.querySelectorAll('meta[name="mparticle-key"]')),r=i.some(h=>h.dataset.strict==="true"),{config:a}=await se(t,e,n),o=le(a),s=i.length&&(r||!o.length)?de():[],c=s.length?s:o;return ue(c),c}async function Ne(t){const e=re(),n=window.location.hostname,i=ae(n),r=document.body?.dataset.brand,a=document.querySelector('meta[name="onetrust-key"]'),o=a?.dataset.key,s=a?.dataset.strict==="true",{config:c}=await se(i,e,r),h=qe(c,F(n)),m=s||!h?o??h:h;if(!m)throw new Error("No OneTrust key found in the selected configuration or a meta[name='onetrust-key'] tag.");const d=Array.from(document.querySelectorAll('meta[name="mparticle-key"]')),f=d.some(v=>v.dataset.strict==="true"),_=le(c),g=d.length&&(f||!_.length)?de():[],p=g.length?g:_;if(ue(p),!p.length&&i==="localhost"&&!i.includes("cfdonlinetrader"))throw new Error("Local development requires at least one mParticle key meta tag.");const k={oneTrustKey:m,mParticleCredentials:p,mParticleKits:c.mParticleKits,GoogleTagManager:c.GoogleTagManager,locale:e,hostname:i,service:Oe()};return t.info("Selected keys:",{oneTrustKey:m,mParticleKey:p.map(v=>({key:v.key,plan_id:v.planId,instance:v.instance}))}),k}const N=new Set;let Z=!1;function V(){queueMicrotask(()=>{for(const t of N)t()})}function Be(){if(!Z){Z=!0;for(const t of["pushState","replaceState"]){const e=history[t];history[t]=((n,i,r)=>{const a=window.location.href,o=e.call(history,n,i,r);return window.location.href!==a&&V(),o})}window.addEventListener("popstate",V),window.addEventListener("hashchange",V)}}function Fe(t){return Be(),N.add(t),()=>N.delete(t)}function A(t=window.location.href){const e=new URL(t,window.location.href),n=new URLSearchParams(e.search),i=e.hash.indexOf("?");if(i>
11=0){const r=new URLSearchParams(e.hash.slice(i+1));for(const[a,o]of r)n.has(a)||n.append(a,o)}return n}function me(t,e){const n=new URL(t,window.location.href),i=A(n.href);return e(i),n.search=i.toString(),n.href}function S(t,e){return me(t,n=>{n.set("groups",e)})}function je(t){const e=new URL(t,window.location.href),n=A(e.href),i=new URLSearchParams;for(const[r,a]of n)i.has(r)||i.append(r,a);return e.search=i.toString(),e.href}function Ge(t){const e=new URL(window.location.href);let n=!1;e.searchParams.has(t)&&(e.searchParams.delete(t),n=!0);const i=e.hash.indexOf("?");if(i>=0){const r=e.hash.slice(0,i),a=new URLSearchParams(e.hash.slice(i+1));a.has(t)&&(a.delete(t),e.hash=a.size?`${r}?${a}`:r,n=!0)}n&&history.replaceState(history.state,"",e.href)}function Ke(t){return t.replace(/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g,"[REDACTED-EMAIL]")}const $=new Map;function fe(t,e){t.id=e.id,t.type="text/javascript",t.src=e.src,t.async=e.async??!1,e.crossOrigin&&(t.crossOrigin=e.crossOrigin),Object.assign(t.dataset,e.dataset)}function R(t){const e=document.getElementById(t.id);if(e)return e;const n=document.createElement("script");return fe(n,t),t.prepend?document.head.prepend(n):document.head.appendChild(n),n}function He(t){const e=document.getElementById(t.id);if(e?.dataset.bigScriptLoaded==="true")return Promise.resolve(e);const n=$.get(t.id);if(n)return n;const i=e??document.createElement("script");e||fe(i,t);const r=new Promise((a,o)=>{const s=()=>{i.dataset.bigScriptLoaded="true",a(i)},c=()=>{$.delete(t.id),o(new Error(`Failed to load ${t.src}`))};i.addEventListener("load",s,{once:!0}),i.addEventListener("error",c,{once:!0}),e||(t.prepend?document.head.prepend(i):document.head.appendChild(i))});return $.set(t.id,r),r}const C={strictlyNecessary:"C0001",performance:"C0002",functional:"C0003",targeting:"C0004"},We={C0001:!0,C0002:!1,C0003:!1,C0004:!1};function B(t){const e={C0001:!1,C0002:!1,C0003:!1,C0004:!1};if(Array.isArray(t)){for(const i of Object.values(C))e[i]=t.includes(i);return e}if(!t)return e;if(t.includes("-")||t.includes(":")){for(const i of t.split(/[_,]/)){const[r,a]=i.split(/[-:]/);r in e&&(e[r]=a==="1")}return e}const n=t.split(",").filter(Boolean);for(const i of Object.values(C))e[i]=n.includes(i);return e}function I(t){return Object.values(C).map(e=>`${e}-${t[e]?1:0}`).join("_")}function Qe(t){return Object.values(C).map(e=>`${e}:${t[e]?1:0}`).join(",")}function ge(t){if(typeof t=="string")try{const e=JSON.parse(t);return e&&typeof e=="object"?e:null}catch{return null}return t&&typeof t=="object"?t:null}function he(t){return{C0001:t.strictlyNecessary??!0,C0002:!!t.performance,C0003:!!t.functional,C0004:!!t.targeting}}function Ze(t){if(!window.Optanon?.UpdateConsent||!window.OptanonActiveGroups)return;const e=B(window.OptanonActiveGroups),n=he(t);for(const i of["C0002","C0003","C0004"])t[i==="C0002"?"performance":i==="C0003"?"functional":"targeting"]!==void 0&&e[i]!==n[i]&&window.Optanon.UpdateConsent("Category",`${i}:${n[i]?1:0}`)}function Ye(t){window.addEventListener("message",e=>{const n=ge(e.data);n?.action==="userConsent"&&(t.info("[WEBVIEW-DEBUGGING] Native consent update received."),Ze(n.data??{}))})}async function Je(t,e,n=250,i=12){return!j()||!Se(t)?null:(e.info("[WEBVIEW-DEBUGGING] Requesting consent from native store."),new Promise(r=>{let a=0,o=0,s=!1;const c=d=>{s||(s=!0,window.clearTimeout(o),window.removeEventListener("message",h),Ye(e),e.info("[WEBVIEW-DEBUGGING] Native consent resolved.",I(d)),r(d))},h=d=>{const f=ge(d.data);f?.action==="userConsent"&&c(he(f.data??{}))},m=()=>{if(a>=i){c(We);return}a+=1,window.parent.postMessage({bigScriptInjected:!0},"*"),o=window.setTimeout(m,n)};window.addEventListener("message",h),m()}))}function Xe(t){return["C0001","C0002","C0003","C0004"].map(e=>`${e}:${t[e]?1:0}`).join(",")}function et(t){return new Date(t*1e3).toUTCString().replace("GMT","+0000")}function tt(){const t=document.querySelector("#onetrust-policy-text")?.querySelector("a");if(!t)return;const e=window.location.hostname,n=window.location.pathname,i={cmcmarkets:{"/connect":"/en-gb/connect/cookies","/capx":"/en-gb/capx/cookie-policy","/group":"/group/cookie-policy","/en-de":"/en-de/cookies"},cmcinvest:{"/en-sg":"/en-sg/cookies","/en-gb":"/en-gb/cookies"}};for(const[r,a]of Object.entries(i))if(e.includes(r))for(const[o,s]of Object.entries(a))n.includes(o)&&(t.href=s)}function nt(t){t&&window.OneTrust?.setDataSubjectId(t),tt();const e=document.querySelector(".ot-pc-footer"),n=document.getElementById("ot-pc-content"),i=e?.firstChild;n&&i&&!n.contains(i)&&n.appendChild(i)}class it{constructor(e,n,i){u(this,"key");u(this,"service");u(this,"logger");u(this,"listeners",new Set);u(this,"consentId",null);u(this,"lastNotifiedConsent",null);this.key=e,this.service=n,this.logger=i}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}async prepareExternalConsent(){const e=A(),n=e.get("groups"),i=e.get("doc");
11this.consentId=e.get("cid");let r=n?B(n):null;return this.logger.info("Search params during OT Banner init:",Object.fromEntries(e)),r||(r=await Je(this.service,this.logger)),!r&&j()&&(r={C0001:!0,C0002:!1,C0003:!1,C0004:!1}),r?(window.OTExternalConsent={USPrivacy:"1---",addtlString:"",consentedDate:et(i?Number.parseInt(i,10):Math.floor(Date.now()/1e3)),groups:Qe(r),tcString:""},this.logger.info("OneTrust enabled via Cross-Domain consent."),Ge("groups"),r):null}start(e=null){window.addEventListener("OneTrustGroupsUpdated",n=>{const i=n.detail,r=B(Array.isArray(i)?i.map(String):typeof i=="string"?i:window.OptanonActiveGroups);this.notify(r)}),this.startAutoBlock(),this.startBanner(),e&&this.notify(e)}async notify(e){const n=Xe(e);if(n!==this.lastNotifiedConsent){this.lastNotifiedConsent=n;for(const i of this.listeners)try{await i(e)}catch(r){this.logger.error("Consent transition failed.",r)}}}startAutoBlock(){if(document.getElementById("autoblock-script"))return;window.browserHasAdBlocker=!0,R({id:"autoblock-script",src:`https://cdn-ukwest.onetrust.com/consent/${this.key}/OtAutoBlock.js`,dataset:{documentLanguage:"true",domainScript:this.key}}).addEventListener("load",()=>{window.browserHasAdBlocker=!1},{once:!0}),this.logger.info("Auto-block loaded...")}startBanner(){const e=new MutationObserver(()=>{document.getElementById("onetrust-consent-sdk")&&(nt(this.consentId),e.disconnect())});e.observe(document.documentElement,{childList:!0,subtree:!0}),R({id:"ot-banner-script",src:"https://cdn-ukwest.onetrust.com/scripttemplates/otSDKStub.js",dataset:{documentLanguage:"true",domainScript:this.key}})}}function G(t){for(const e of document.cookie.split(";")){const[n,...i]=e.trim().split("=");if(n===t)return i.join("=")}return""}function E(t){const e=G(t);return e?e.split("|").reduce((n,i)=>{const r=i.indexOf("=");return r>0&&(n[i.slice(0,r)]=i.slice(r+1)),n},{}):null}function rt(t=30){return new Date(Date.now()+t*6e4)}function Y(t,e,{expires:n,path:i="/",domain:r=oe()}={}){const a=[`${t}=${e}`];n&&a.push(`Expires=${n.toUTCString()}`),i&&a.push(`Path=${i}`),r&&r!=="localhost"&&a.push(`Domain=${r}`),document.cookie=`${a.join(";")};`}function D(t,e=5e3){const n=E(t);return n?Promise.resolve(n):new Promise(i=>{const r=Date.now();let a=0;const o=c=>{window.clearInterval(a),window.removeEventListener("__utmzz cookie generated",s),i(c)},s=()=>{const c=E(t);c?o(c):Date.now()-r>=e&&o(null)};window.addEventListener("__utmzz cookie generated",s),a=window.setInterval(s,25)})}function we(t,e,n){const i=G(t),r=rt(e);Y(t,i,{expires:r}),t==="__utmzz"&&Y("__utmzzses",1,{expires:r}),n?.info(`Extended ${t} cookie duration by ${e}mins`)}async function Mt(t=2100){const e=Date.now();for(;Date.now()-e<=t;){const n=G("_ga");if(n)return n;await new Promise(i=>window.setTimeout(i,100))}}class at{constructor(e){u(this,"consoleEnabled");this.consoleEnabled=e,window.trackingLogs??(window.trackingLogs=[]),e?console.log("Logging mode enabled."):window.trackingLogs.push("Logging mode enabled.")}info(e,...n){if(this.consoleEnabled){console.log(e,...n);return}window.trackingLogs.push(n.length?[e,...n]:e)}warn(e,...n){if(this.consoleEnabled){console.warn(e,...n);return}window.trackingLogs.push(n.length?[e,...n]:e)}error(e,n){console.error(e,n??"")}show(){if(!window.trackingLogs.length){console.warn("No logs found.");return}for(const e of window.trackingLogs)Array.isArray(e)?console.log(...e):console.log(e)}}class ot{constructor(e){u(this,"logger");u(this,"enabled",!1);this.logger=e}initialize(){!document.querySelector('meta[name="convert"]')||document.getElementById("convert-script")||(window._conv_q??(window._conv_q=[]),window._conv_q.push(["consentRequired"]),R({id:"convert-script",src:"https://cdn-4.convertexperiments.com/js/1004432-1004281.js",dataset:{documentLanguage:"true"}}),this.logger.info("Convert loaded..."))}updateConsent(e){!e.C0002||this.enabled||(this.enabled=!0,window._conv_q??(window._conv_q=[]),window._conv_q.push(["consentGiven"]),this.logger.info("Consent given to convert"))}}const pe="www.googletagmanager.com";function st(t){return Array.from(document.scripts).some(e=>{try{const n=new URL(e.src);return n.hostname===pe&&n.pathname==="/gtm.js"&&n.searchParams.get("id")===t}catch{return!1}})}class ct{constructor(e,n){u(this,"configuration");u(this,"logger");u(this,"initialized",!1);this.configuration=e,this.logger=n}updateConsent(e){!this.configuration||this.initialized||!this.configuration.requiresConsent.every(n=>e[n])||this.initialize(this.configuration)}initialize(e){if(this.initialized=!0,st(e.containerId)){this.logger.info("Google Tag Manager already loaded:",e.containerId);return}const n=e.dataLayerName??"dataLayer",i=window,r=i[n];if(r!==void 0&&!Array.isArray(r)){this.logger.error(`Google Tag Manager data layer '${n}' is not an array.`);return}const a=r??[];i[n]=a,a.push({"gtm.start":Date.now(),event:"gtm.js"});const o=new URLSearchParams({id:e.containerId});n!=="dataLayer"&&o.set("l",n),R({id:`google-tag-manager-${e.containerId}`,src:`https://${pe}/gtm.js?${o}`,async:!0,prepend:!0}),this.logger.info("Google Tag Manager loaded:",e.containerId)}}function q(t){if(!t)return;const e=t.replace(/\+/g," ");let n=e;try{n=decodeURIComponent(e)}catch{}return n.trim().replace(/^\((.*)\)$/,"$1")||void 0}async function lt(){return E("__utmzz")??await D("__utmzz")}async function dt(t){const e=await lt();if(!e)return;const n=q(e.utmcsr??e.utm_source),i=q(e.utmcmd??e.utm_medium),r=q(e.utmccn??e.utm_campaign),a={};n&&(a.utm_source=n),i&&(a.utm_medium=i),r&&(a.utm_campaign=r),n&&i&&(a.utm_source_medium=`${n} / ${i}`),Object.keys(a).length&&t.setUserAttributes(a)}function ut(t,e){const n=t.identityCallback;t.identityCallback=i=>
11{n?.(i);const r=i.getUser();r&&dt(r).catch(a=>{e.error("Failed to set mParticle UTM user attributes.",a)})}}function b(t){const e=t,n=e.__require?.(),i=e.default??n?.default;if(!i||typeof i.register!="function")throw new Error("mParticle kit does not expose register().");return i}const mt={twitter:()=>l(()=>import("./utils/twitter-kit-Cvjmcc4U.js"),[],import.meta.url).then(b),bingAds:()=>l(()=>import("./vendors/BingAdsEventForwarder.common-DY247eE2.js"),[],import.meta.url).then(b),googleAds:()=>l(()=>import("./vendors/GoogleAdWordsEventForwarder.common-B9th8Kc5.js"),[],import.meta.url).then(b),facebook:()=>l(()=>import("./vendors/FacebookEventForwarder.esm-BpUY9Osp.js"),[],import.meta.url).then(b),oneTrust:()=>l(()=>import("./vendors/OneTrustKit.common-Cm5A763v.js"),[],import.meta.url).then(b),googleTagManager:()=>l(()=>import("./vendors/GoogleTagManager-Kit.common-CfFVPZtk.js"),[],import.meta.url).then(b),googleAnalytics4:()=>l(()=>import("./vendors/GoogleAnalytics4EventForwarderClientSide-Kit.common-BZr8GtuF.js"),[],import.meta.url).then(b),braze:()=>l(()=>import("./vendors/BrazeKit.esm-BnC8KN8z.js"),[],import.meta.url).then(b)};async function ft(t=1500){const e=Date.now();for(;window.browserHasAdBlocker&&Date.now()-e<t;)await new Promise(n=>window.setTimeout(n,50));return!window.browserHasAdBlocker}function gt(t){return{cookieDomain:oe(),maxCookieSize:3e3,useCookieStorage:!0,dataPlan:{planId:t},onCreateBatch:e=>e.events.length?(e.events=e.events.filter(n=>n.event_type!=="application_state_transition"||n.data.is_first_run),e):null}}function ht(t,e,n,i,r=j()){return t.requiresConsent.every(a=>e[a])&&!(t.excludeWebviews&&r)&&!t.excludeServices?.includes(i)&&!t.excludeLocalesContaining?.some(a=>n.includes(a))}async function wt(t,e,n,i){const r=t.filter(a=>ht(a,e,n,i));return{kits:await Promise.all(r.map(a=>mt[a.id]()))}}function pt(){return window.dataLayer?.[0]?.page??{}}class _t{constructor(e,n,i,r){u(this,"locale");u(this,"service");u(this,"kitPolicies");u(this,"logger");u(this,"initialized",!1);u(this,"initializing",null);u(this,"credentials",[]);u(this,"initializedCredentials",new Map);u(this,"kits",[]);u(this,"sdk",null);this.locale=e,this.service=n,this.kitPolicies=i,this.logger=r}async initialize(e,n){if(this.initializing&&await this.initializing,this.initialized){await this.reconcile(e);return}this.initializing=this.initializeMParticle(e,n);try{await this.initializing}finally{this.initializing=null}}async initializeMParticle(e,n){if(!e.length){this.logger.warn("mParticle not loaded because no credentials apply to this property.");return}if(window.location.hostname.includes("cfdonlinetrader")){this.logger.warn("mParticle not loaded. CFD Online Trader is no longer supported.");return}if(!await ft()){this.logger.warn("Ad blocker detected, mParticle cannot be initialized!");return}const[{default:i},r]=await Promise.all([l(()=>import("./vendors/mparticle.esm-CBnQqxcj.js"),[],import.meta.url),wt(this.kitPolicies,n,this.locale,this.service)]);this.sdk=i,this.kits=r.kits,window.mParticle=i,window.mParticleInstances??(window.mParticleInstances=[]);for(const[a,o]of e.entries())this.initializeCredential(o,a===e.length-1);this.credentials=[...e],window.mParticleInstances=e.map(a=>a.instance),this.initialized=!0,window.dispatchEvent(new Event("mParticleInitialized")),await Promise.all(e.map(a=>this.getDeviceId(a.instance)))}async reconcile(e){if(this.initializing&&await this.initializing,!this.initialized||!this.sdk)return;const n=new Set(e.map(i=>i.instance));for(const i of this.initializedCredentials.values())n.has(i.instance)||this.setInstanceOptOut(i.instance,!0);for(const[i,r]of e.entries())this.initializedCredentials.has(r.instance)?this.setInstanceOptOut(r.instance,!1):this.initializeCredential(r,i===e.length-1);this.credentials=[...e],window.mParticleInstances=e.map(i=>i.instance),await Promise.all(e.map(i=>this.getDeviceId(i.instance))),this.logger.info("Active mParticle instances:",window.mParticleInstances)}initializeCredential(e,n){const r=(e.instance==="default_instance"?window.mParticleConfig:e.instance==="au_instance"?window.mParticleConfig_au:void 0)??gt(e.planId);r.isDevelopmentMode=F(),r.maxCookieSize=3e3,r.useCookieStorage=!0;const a=A().get("mdevid");a&&n&&(r.deviceId=a);for(const o of this.kits)o.register(r);ut(r,this.logger),this.sdk.init(e.key,r,e.instance),this.initializedCredentials.set(e.instance,e),window.dispatchEvent(new Event(`mParticle-${e.instance}-Initialized`)),this.logger.info("mParticle instance initialized:",e.instance,`with key: ${e.key}`)}setInstanceOptOut(e,n){const i=this.sdk?.getInstance(e);(i?.setOptOut??this.sdk?.setOptOut)?.call(i??this.sdk,n)}setOptOut(e){if(!this.initialized||!this.sdk)return;const n=e?Array.from(this.initializedCredentials.values()):this.credentials;for(const i of n)this.setInstanceOptOut(i.instance,e);this.logger.info(e?"mParticle events killed.":"mParticle events revived.")}async fireWhenReady(e){return window.mParticle||await new Promise(n=>{window.addEventListener("mParticleInitialized",()=>n(),{once:!0})}),new Promise(n=>{window.mParticle.ready(()=>n(e()))})}async getDeviceId(e){const n=e==="default_instance"?"mdevid":`mdevid_${e.replace("_instance","")}`,i=window[n];if(typeof i=="string"&&i)return i;const a=E("__utmzz")?.[n];if(a)return window[n]=a,a;if(!this.initialized&&!this.initializing)return;await this.fireWhenReady(()=>{});const o=Date.now();for(;Date.now()-o<=2100;){const s=window.mParticle.getInstance(e)?.getDeviceId?.();if(s)return window[n]=s,s;await new Promise(c=>window.setTimeout(c,100))}}async getMpid(e){const n=Date.now();for(;Date.now()-n<=2100;){const i=window.mParticle?.getInstance(e)?.Identity?.getCurrentUser?.();if(i)return i.getMPID();await new Promise(r=>window.setTimeout(r,100))}}async logPageViews(){if(!this.initialized)return;const e=E("__utmzz")??await D("__utmzz"),n=pt();for(const i of this.credentials)this.updateConvertAttributes(i.instance),window.mParticle.getInstance(i.instance).logPageView("Page",Object.assign({URL:Ke(decodeURIComponent(window.location.href)),"Country Code":n.countryCode||null,"Region Code":this.locale,"Page Category":n.page_category_general||"other","Page Type":n.type||"other",Environment:n.environment||"other","UTM Source":e?.utmcsr||"","UTM Medium":e?.utmcmd||"","UTM Campaign":e?.utmccn||"","UTM Content":e?.utmcct||"","UTM Term":e?.utmctr||"",GCLID:e?.utmgclid||"",DCLID:e?.utmdclid||""},Object.fromEntries(Object.entries(n).filter(([r])=>r.startsWith("mp_attribute_")))));we("__utmzz",30,this.logger)}logConsentUpdate(e){if(this.initialized){for(const n of this.credentials){const i=window.mParticle.getInstance(n.instance);window.mParticle.ready(()=>{i.logEvent("OneTrustGroupsUpdated",window.mParticle.EventType.Other,{[C.strictlyNecessary]:e.C0001,[C.performance]:e.C0002,[C.functional]:e.C0003,[C.targeting]:e.C0004})})}this.logger.info("Optanon Groups updated.")}}updateConvertAttributes(e){const n=window.dataLayer?.find(r=>typeof r.event=="string"&&r.event.startsWith("convert-trigger-experiment"));if(!n?.experiment_id||!n?.variation_name)return;const i=window.mParticle.getInstance(e).Identity.getCurrentUser();i?.setUserAttribute("convert_experiment_id",n.experiment_id),i?.setUserAttribute("convert_variation_name",n.variation_name)}}const kt={msclkid:"msclkid",twclid:"twclid",ttclid:"ttclid",fbclid:"fbclid",utmgclid:"gclid",utmdclid:"dclid",li_fat_id:"li_fat_id",irclickid:"irclickid",rdt_cid:"rdt_cid",utmcsr:"utm_source",utmccn:"utm_campaign",utmcmd:"utm_medium",utmctr:"utm_term",utmcct:"utm_content",subid:"subid",_gl:"_gl"};function yt(t){if(t.id==="analytics-params")return!0;try{const e=new URL(t.href).hostname;return e.includes("cmcmarketsstockbroking.com.au")||e.includes("cmcmarketsinvest.com")||e.includes("invest.cmcmarkets.com.au")||e==="localhost"}catch{return!1}}class vt{constructor(e,n,i){u(this,"credentials");u(this,"mParticle");u(this,"logger");this.credentials=e,this.mParticle=n,this.logger=i}setCredentials(e){this.credentials=e}async apply(e){var s;const n=Array.from(document.querySelectorAll("body a")).filter(yt);
11if(!n.length)return;const i=I(e),r=e.C0002?E("__utmzz")??await D("__utmzz"):null,a=this.credentials[this.credentials.length-1],o=e.C0002&&a?await this.mParticle.getDeviceId(a.instance):void 0;for(const c of n){(s=c.dataset).originalHref??(s.originalHref=c.href);const h=c.dataset.originalHref;if(!h)continue;const m=S(h,i),d=new URL(m);if(r){for(const[f,_]of Object.entries(kt)){const g=r[f];g&&d.searchParams.set(_,g)}o&&d.searchParams.set("mdevid",o)}c.href=d.href}this.logger.info(e.C0002?"Attribution parameters appended to eligible URLs.":"Consent parameters appended to eligible URLs.")}}const T="qr-code",bt="10px",Ct="https://cmcmarkets.onelink.me/3oZk",Et=[/\.onelink\.me$/,/\.page\.link$/,/^app\.adjust\.com$/],Pt={"de-at":"https://www.cmcmarkets.com/de-at/handelsplattform/trading-apps","de-de":"https://www.cmcmarkets.com/de-de/handelsplattform/trading-apps",en:"https://www.cmcmarkets.com/en/trading-platform/mobile-trading","en-ca":"https://www.cmcmarkets.com/en-ca/platform/mobile-trading","en-gb":"https://www.cmcmarkets.com/en-gb/trading-platform/mobile-trading-app","en-ie":"https://www.cmcmarkets.com/en-ie/trading-platform/mobile-trading","en-sg":"https://www.cmcmarkets.com/en-sg/platform/mobile-trading","es-es":"https://www.cmcmarkets.com/es-es/plataforma/trading-plataformas-moviles","fr-fr":"https://www.cmcmarkets.com/fr-fr/plateforme/trading-mobile","it-it":"https://www.cmcmarkets.com/it-it/piattaforma/trading-su-mobile","nb-no":"https://www.cmcmarkets.com/nb-no/tradingplattform/mobil-trading","pl-pl":"https://www.cmcmarkets.com/pl-pl/platforma/aplikacje-mobilne","sv-se":"https://www.cmcmarkets.com/sv-se/handelsplattform/appar",zh:"https://www.cmcmarkets.com/zh/platform/mobile-trading","zh-au":"https://www.cmcmarkets.com/zh-au/platform/mobile-trading","zh-sg":"https://www.cmcmarkets.com/zh-sg/platform/mobile-trading","zh-nz":"https://www.cmcmarkets.com/zh-nz/platform/mobile-trading"};function L(t){return t.id===T||t.dataset.qr==="true"}function Lt(t){t.querySelectorAll("canvas").forEach(e=>{e.style.backgroundColor="#fff",e.style.boxSizing="content-box",e.style.padding=bt})}function J(){const t=A().get("iaid");return t!==null?t:E("__utmzz")?.iaid??null}function It(t,e){return e===null?t:me(t,n=>{n.set("iaid",e)})}function x(){return Array.from(document.querySelectorAll("body a")).filter(t=>{if(t.dataset.onelinkExclude!==void 0)return!1;try{const e=new URL(t.href).hostname;return Et.some(n=>n.test(e))||!!t.dataset.onelinkHref||!!t.dataset.fallbackHref}catch{return!1}})}function X(){const t=document.getElementById(T),e=Array.from(document.querySelectorAll('a[data-qr="true"]'));t&&!e.includes(t)&&e.unshift(t);const n=new Set;let i=1;for(const r of e){if(r.id&&!n.has(r.id)){n.add(r.id);continue}let a=`${T}-${i}`;for(;document.getElementById(a)||n.has(a);)i+=1,a=`${T}-${i}`;r.id=a,n.add(a)}return e}function ee(t){const e=t.dataset.onelinkHref||t.href,n=new URL(e);if(!n.pathname.split("/").filter(Boolean).length)throw new Error("OneLink anchor is missing its OneLink ID in the URL path.");return n.search="",n.hash="",n.pathname=`${n.pathname.replace(/\/+$/,"")}/`,n.href}function At(t){return t.replace(/\/\?/,"?")}function Ot(){return window.dataLayer?.find(t=>typeof t.event=="string"&&t.event.startsWith("convert-trigger-experiment"))}class St{constructor(e,n){u(this,"locale");u(this,"logger");u(this,"sdkPromise",null);u(this,"currentConsent",null);u(this,"performanceEnabled",!1);this.locale=e,this.logger=n}initialize(){window.generateLinks=()=>{this.currentConsent&&this.apply(this.currentConsent,this.performanceEnabled)};const e=x();e.length&&(this.saveOriginals(e),window.QR_CODE_LOADED??(window.QR_CODE_LOADED="untracked"),this.ensureSdk())}async ensureSdk(){if(!window.AF_SMART_SCRIPT)return this.sdkPromise??(this.sdkPromise=He({id:"onelink-script",src:"https://onelinksmartscript.appsflyer.com/onelink-smart-script-latest.js",dataset:{documentLanguage:"true"}}).then(()=>{window.dispatchEvent(new Event("OnelinkInitialized"))}).catch(e=>{this.sdkPromise=null,this.logger.error("Failed to load AppsFlyer OneLink.",e)})),this.sdkPromise}async apply(e,n){this.currentConsent=e,this.performanceEnabled=n;const i=x();i.length&&(this.saveOriginals(i),n?await this.applyTrackedLinks(i,e):await this.applyUntrackedLinks(i,e))}saveOriginals(e=x()){for(const n of e){if(n.dataset.onelinkHref)continue;const i=new URL(n.href);
11/\.page\.link$/.test(i.hostname)||i.hostname==="app.adjust.com"?n.dataset.onelinkHref=Ct:/\.onelink\.me$/.test(i.hostname)&&(i.search="",i.hash="",n.dataset.onelinkHref=i.href.replace(/\/$/,""))}}async applyTrackedLinks(e,n){X();for(const i of e)i.dataset.onelinkHref&&(i.href=i.dataset.onelinkHref);await this.ensureSdk(),window.AF_SMART_SCRIPT&&await Promise.all(e.map(i=>this.generateTrackedLink(i,n)))}async generateTrackedLink(e,n){const i=E("__utmzz")??await D("__utmzz"),r={mediaSource:{keys:["utm_source","utmcsr"],defaultValue:i?.utmcsr||"(direct)"},afCustom:[],googleClickIdKey:"af_sub4"},a={},o=[["utmccn","campaign",["utm_campaign","utmccn"],"any_campaign"],["utmcmd","channel",["utm_medium","utmcmd"],"any_channel"],["utmad","ad",["utm_ad","utmad"],"any_ad"],["utmadset","adSet",["utm_adset","utmadset"],"any_utm_adset"],["utmctr","afSub1",["utm_term","utmctr"],"any_term"],["utmcct","afSub2",["utm_content","utmcct"],"any_content"],["utmgclid","afSub4",["gclid","utmgclid"],"any_gclid"]];for(const[f,_,g,p]of o){const k=i?.[f];k&&(r[_]={keys:[...g],defaultValue:p},a[g[0]]=k)}const s={msclkid:"msclkid",twclid:"twclid",ttclid:"ttclid",fbclid:"fbclid",utmdclid:"dclid",li_fat_id:"li_fat_id",irclickid:"irclickid",rdt_cid:"rdt_cid"};for(const[f,_]of Object.entries(s)){const g=i?.[f];g&&(r.afCustom.push({paramKey:_,keys:[_],defaultValue:g}),a[_]=g)}const c=this.getFallbackUrl(e);r.afCustom.push({paramKey:"af_web_dp",keys:["af_web_dp"],defaultValue:encodeURIComponent(c||"")},{paramKey:"cp1",keys:["cp1"],defaultValue:i?.cp1},{paramKey:"groups",keys:["groups"],defaultValue:I(n)});const h=L(e)?J():null;h!==null&&(r.afCustom.push({paramKey:"iaid",keys:["iaid"],defaultValue:h}),a.iaid=h);const m=Ot();if(m&&r.afCustom.push({paramKey:"convertEvent",keys:["convertEvent"],defaultValue:m.event},{paramKey:"convertId",keys:["convertId"],defaultValue:m.experiment_id},{paramKey:"convertVariationName",keys:["convertVariationName"],defaultValue:String(m.variation_name??"").replace("Var #","")}),Object.keys(a).length){try{const f=JSON.parse(localStorage.getItem("ss_incoming_params")||"[]");a.af_ss_exp_at=f[0]?.af_ss_exp_at}catch{}localStorage.setItem("ss_incoming_params",JSON.stringify([a]))}const d=window.AF_SMART_SCRIPT?.generateOneLinkURL({oneLinkURL:ee(e),afParameters:r});L(e)&&!W()&&this.renderQrCode(e,"tracked"),d?.clickURL&&(e.href=At(je(S(d.clickURL,I(n)))))}async applyUntrackedLinks(e,n){const i=I(n),r=W(),a=J();for(const o of e){const s=o.dataset.onelinkHref;if(!s)continue;if(L(o)||r){const h=S(s,i);o.href=L(o)?It(h,a):h;continue}const c=this.getFallbackUrl(o);c?o.href=S(c,i):this.logger.warn("No fallback href found for link",o)}if(await this.ensureSdk(),!!window.AF_SMART_SCRIPT)for(const o of X()){const s=[{paramKey:"groups",keys:["groups"],defaultValue:i}];a!==null&&s.push({paramKey:"iaid",keys:["iaid"],defaultValue:a}),window.AF_SMART_SCRIPT.generateOneLinkURL({oneLinkURL:ee(o),afParameters:{mediaSource:{keys:["utm_source","utmcsr"],defaultValue:"(direct)"},afCustom:s}}),this.renderQrCode(o,"untracked")}}renderQrCode(e,n){!e.id||!window.AF_SMART_SCRIPT?.displayQrCode||(e.replaceChildren(),window.AF_SMART_SCRIPT.displayQrCode(e.id),Lt(e),window.QR_CODE_LOADED=n)}getFallbackUrl(e){if(e.dataset.fallbackHref)return e.dataset.fallbackHref;if(L(e))return null;if(e.dataset.oflCustom)return e.dataset.oflCustom;if(window.location.pathname.startsWith("/en-gb/opto"))return"https://optothemes.com/en-us";if(window.location.hostname==="www.cmcmarkets.com"){const n=this.locale.replace("_","-");return Pt[n]??`https://www.cmcmarkets.com/${n||"en"}/platform/mobile-trading`}return null}}function Tt(){return document.body?Promise.resolve():new Promise(t=>{document.addEventListener("DOMContentLoaded",()=>t(),{once:!0})})}function te(t){return t.id==="qr-code"||t.dataset.qr==="true"}function Rt(t){let e=!1;const n=()=>{e||(e=!0,queueMicrotask(()=>{e=!1,t()}))},i=new MutationObserver(r=>{r.some(o=>{if(o.type==="childList")return Array.from(o.addedNodes).some(c=>c instanceof HTMLAnchorElement||c instanceof Element&&!!c.querySelector("a"));if(!(o.target instanceof HTMLAnchorElement))return!1;const s=o.target;return o.attributeName==="data-qr"?te(s):o.attributeName==="id"?s.id==="qr-code":o.attributeName==="href"?te(s)&&
11!s.dataset.onelinkHref:!1})&&n()});return i.observe(document.body,{attributeFilter:["data-qr","href","id"],attributes:!0,childList:!0,subtree:!0}),()=>i.disconnect()}function zt(t){let e=document.body.dataset.brand??"";const n=new MutationObserver(()=>{const i=document.body.dataset.brand??"";i!==e&&(e=i,t())});return n.observe(document.body,{attributeFilter:["data-brand"],attributes:!0}),()=>n.disconnect()}function ne(t){return t.map(e=>`${e.instance}:${e.key}:${e.planId}`).join("|")}async function Dt(){if(window.__BIG_SCRIPT_V2__)return;window.__BIG_SCRIPT_V2__={initialized:!1},await Tt();const t=performance.now(),e=z(),n=new at(Re(e)),i=re(e);Le(i);const r=await Ne(n);document.body.dataset.mainLoaded="true",n.info(`Main running... ${(performance.now()-t).toFixed(2)}ms`);const a=new _t(r.locale,r.service,r.mParticleKits,n),o=new vt(r.mParticleCredentials,a,n),s=new St(r.locale,n),c=new ot(n),h=new ct(r.GoogleTagManager,n),m=new it(r.oneTrustKey,r.service,n);let d=null,f=[...r.mParticleCredentials],_=ne(f),g=null,p=null,k=Promise.resolve(),v="";const O=w=>(k=k.then(w).catch(y=>{n.error("Lifecycle transition failed.",y)}),k);window.showTrackingLogs=()=>n.show(),window.showLogs=window.showTrackingLogs,window.extendCookieDuration=(w,y)=>we(w,y,n),window.fireWhenMparticleReady=w=>a.fireWhenReady(w);const P=async()=>{d&&(await o.apply(d),await s.apply(d,d.C0002))},K=async()=>{const w=await xe(r.hostname,r.locale),y=ne(w);return y===_?!1:(f=w,_=y,o.setCredentials(f),d?.C0002&&await a.initialize(f,d),n.info("mParticle credentials updated for page brand:",document.body.dataset.brand??"default"),!0)},U=async()=>{const w=`${window.location.href}|${_}`;!a.initialized||v===w||(await a.logPageViews(),v=w)},_e=async w=>{if(d=w,c.updateConsent(w),h.updateConsent(w),w.C0002){if(await a.initialize(f,w),a.setOptOut(!1),!g){const{AttributionService:y}=await l(async()=>{const{AttributionService:M}=await import("./utils/attribution-DWDJAV0X.js");return{AttributionService:M}},[],import.meta.url);g=new y(f,a,n)}if(await g.generate(),await P(),!p){const{FullStoryIntegration:y}=await l(async()=>{const{FullStoryIntegration:M}=await import("./utils/fullstory-HMEVALc8.js");return{FullStoryIntegration:M}},[],import.meta.url);p=new y(r.locale,n)}p.initialize(),await U()}else a.setOptOut(!0),await P();a.logConsentUpdate(w)};m.subscribe(w=>O(()=>_e(w))),c.initialize(),s.initialize();const ke=await m.prepareExternalConsent();m.start(ke),Fe(()=>{window.setTimeout(()=>{O(async()=>{await K(),await P(),d?.C0002&&await U()})},0)}),zt(()=>{O(async()=>{await K()&&(await P(),d?.C0002&&await U())})}),Rt(()=>{O(P)}),window.__BIG_SCRIPT_V2__.initialized=!0}Dt();export{G as a,Mt as b,rt as c,Ie as d,A as e,E as g,R as i,Y as w};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.