PageSourceSearch

https://sts2.untapped.gg/_next/static/chunks/0df2py98_yh6e.js

js untapped.gg collected 2026-10-01 14:08:18 UTC 88,755 bytes, 5 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="e79b7c4f-879f-3791-6a6c-3b2f7ff9ee69")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,897006,729251,649919,354038,e=>{"use strict";function t(){return{allowedActions:["accept","reject","customize"],layout:[["reject","accept"],"customize"],direction:"row",primaryActions:["customize"],uiProfile:"compact"}}let n={offlineOptInBanner:()=>({id:"offline_opt_in_banner",model:"opt-in",consent:{expiryDays:365},ui:{mode:"banner",banner:t(),dialog:t()}}),offlineIab:()=>({id:"offline_iab",model:"iab",consent:{expiryDays:365,scopeMode:"permissive",categories:["*"]}}),offlineNoBanner:()=>({id:"offline_no_banner",model:"none",ui:{mode:"none"}})};function o(e){if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(e=>o(e)).join(",")}]`;let t=Object.entries(e).filter(([,e])=>void 0!==e).sort(([e],[t])=>e.localeCompare(t));return`{${t.map(([e,t])=>`${JSON.stringify(e)}:${o(t)}`).join(",")}}`}async function i(e){let t=globalThis.crypto?.subtle;if(t){let n=new TextEncoder().encode(e);return Array.from(new Uint8Array(await t.digest("SHA-256",n))).map(e=>e.toString(16).padStart(2,"0")).join("")}return r(e)}function r(e){let t=new TextEncoder().encode(e),n=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),o=8*t.length,i=t.length+9+63>>6<<6>>>0,r=new Uint8Array(i);r.set(t),r[t.length]=128;let a=new DataView(r.buffer);a.setUint32(i-8,Math.floor(o/0x100000000),!1),a.setUint32(i-4,o>>>0,!1);
2let s=new Uint32Array([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),l=new Uint32Array(64),c=(e,t)=>e>>>t|e<<32-t;for(let e=0;e<i;e+=64){for(let t=0;t<16;t++)l[t]=a.getUint32(e+4*t,!1);for(let e=16;e<64;e++){let t=c(l[e-15],7)^c(l[e-15],18)^l[e-15]>>>3,n=c(l[e-2],17)^c(l[e-2],19)^l[e-2]>>>10;l[e]=l[e-16]+t+l[e-7]+n>>>0}let[t,o,i,r,d,u,f,p]=s;for(let e=0;e<64;e++){let a=p+(c(d,6)^c(d,11)^c(d,25))+(d&u^~d&f)+n[e]+l[e]>>>0,s=(c(t,2)^c(t,13)^c(t,22))+(t&o^t&i^o&i)>>>0;p=f,f=u,u=d,d=r+a>>>0,r=i,i=o,o=t,t=a+s>>>0}s[0]=s[0]+t>>>0,s[1]=s[1]+o>>>0,s[2]=s[2]+i>>>0,s[3]=s[3]+r>>>0,s[4]=s[4]+d>>>0,s[5]=s[5]+u>>>0,s[6]=s[6]+f>>>0,s[7]=s[7]+p>>>0}return Array.from(s).map(e=>e.toString(16).padStart(8,"0")).join("")}function a(e){return r(o(e))}async function s(e){return i(o(e))}async function l(e){return s(e)}async function c(e){return s({model:e.model,consent:e.consent?{expiryDays:e.consent.expiryDays,scopeMode:e.consent.scopeMode,categories:e.consent.categories,preselectedCategories:e.consent.preselectedCategories,gpc:e.consent.gpc}:void 0,ui:e.ui?{mode:e.ui.mode,banner:e.ui.banner?{allowedActions:e.ui.banner.allowedActions,primaryActions:e.ui.banner.primaryActions,layout:e.ui.banner.layout,direction:e.ui.banner.direction}:void 0,dialog:e.ui.dialog?{allowedActions:e.ui.dialog.allowedActions,primaryActions:e.ui.dialog.primaryActions,layout:e.ui.dialog.layout,direction:e.ui.dialog.direction}:void 0}:void 0,proof:e.proof?{storeIp:e.proof.storeIp,storeUserAgent:e.proof.storeUserAgent,storeLanguage:e.proof.storeLanguage}:void 0})}
2let d="default",u=new Set(["bg","cs","cy","da","de","el","en","es","et","fi","fr","ga","he","hr","hu","id","is","it","lb","lt","lv","mt","nb","nl","nn","pl","pt","rm","ro","sk","sl","sv","zh"]);function f(e){if(!e)return;let t=e.split(",")[0]?.split(";")[0]?.trim().toLowerCase();if(t)return t.split("-")[0]??void 0}function p(e){let t,n=(t=e.i18n?.messages)&&Object.keys(t).length>0?t:e.customTranslations&&Object.keys(e.customTranslations).length>0?{[d]:{translations:e.customTranslations}}:{},o=Object.keys(n).sort(),i=e.i18n?.defaultProfile??d,r=[],a=[];for(let t of(e.customTranslations&&Object.keys(e.customTranslations).length>0&&a.push("`customTranslations` is deprecated. Migrate to `i18n.messages`."),o.length>0&&!n[i]&&a.push(`Default i18n profile '${i}' is not configured. Fallbacks may skip expected default profile behavior.`),e.policies??[])){if(!t.i18n)continue;let e=function(e){let t=e.policyProfile??e.defaultProfile;return e.profiles[t]?t:e.defaultProfile}({profiles:n,defaultProfile:i,policyProfile:t.i18n.messageProfile}),s=f(t.i18n.language);t.i18n.messageProfile&&!n[t.i18n.messageProfile]&&r.push(`Policy '${t.id}' references missing i18n profile '${t.i18n.messageProfile}'.`);let l=n[e],c=!!l&&Object.keys(l.translations??{}).length>0;if(t.i18n.messageProfile&&!c&&r.push(`Policy '${t.id}' references i18n profile '${t.i18n.messageProfile}' with no configured translations.`),t.i18n.messageProfile||t.i18n.language||a.push(`Policy '${t.id}' defines i18n without language or messageProfile. Runtime will use request language + default profile.`),!s)continue;let d=o.length>0?function(e){let t=f(e.profile?.fallbackLanguage)??"en",n=Object.keys(e.profile?.translations??{}).sort();return n.includes(t)?t:n.includes("en")?"en":n[0]??t}({profile:l}):"en",p=!!l?.translations[s]||!!l?.translations[d],g=0===o.length&&u.has(s);p||g||r.push(`Policy '${t.id}' i18n language '${s}' has no configured translation in profile '${e}', and no configured fallback exists.`)}return{profiles:o,errors:r,warnings:a}}function g(e){if(e&&0!==e.length)return[...new Set(e)]}function y(e){if(!e||0===e.length)return;let t=[...new Set(e.map(e=>e.trim()).filter(Boolean))];return t.length>0?t:void 0}let m=["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE"],h=[...m,"IS","LI","NO"],b=["GB"];function w(e){return e.trim().toUpperCase()}function C(e){return{country:w(e.country),region:e.region.trim().toUpperCase()}}let v={default:()=>({isDefault:!0}),fallback:()=>({fallback:!0}),countries:e=>({countries:g(e.map(e=>w(e)))??[]}),regions:e=>({regions:e.map(e=>C(e))}),eu:()=>({countries:[...m]}),eea:()=>({countries:[...h]}),uk:()=>({countries:[...b]}),iab:()=>v.merge(v.eea(),v.uk()),merge(...e){let t={};for(let n of e)!function(e,t){var n;let o,i;t.isDefault&&(e.isDefault=!0),t.fallback&&(e.fallback=!0),t.countries?.length&&(n=e.countries,e.countries=g([...n??[],...t.countries.map(e=>w(e))])??[]),t.regions?.length&&(o=[...e.regions??[],...t.regions.map(e=>C(e))],i=new Set,e.regions=o.filter(e=>{let t=k(e.country,e.region);return!i.has(t)&&(i.add(t),!0)}))}(t,n);return t}},S=new WeakMap;function k(e,t){return`${e}:${t}`}function I(e){return e.consent?.model??"opt-in"}function x(e){return"iab"===I(e)?["*"]:y(e.consent?.categories)}function P(e){return e.consent?.scopeMode??"permissive"}function A(e){return!!e&&Object.values(e).some(e=>Array.isArray(e)?e.length>0:void 0!==e)}function L(e){return(e.match.countries?.length??0)>0||(e.match.regions?.length??0)>0}function E(e,t){let n=e.id?.trim();return n?`'${n}'`:`at index ${t}`}function D(e){if(!Array.isArray(e))return{ok:!1,errors:["Policy config must be an array of policy objects."]};let t=[];for(let n=0;n<e.length;n++){let o=e[n];o&&"object"==typeof o&&"match"in o&&o.match||t.push(`Policy at index ${n}
2 is invalid: missing required 'match' property.`)}return t.length>0?{ok:!1,errors:t}:{ok:!0,output:e}}function R(e){let t,n;if(!e)return;let o=g(e?.allowedActions),i=function(e,t){let n=e?.layout;if(!n||0===n.length)return t&&t.length>0?[t]:void 0;let o=t&&t.length>0?new Set(t):void 0,i=[],r=new Set;for(let e of n){let t=g(Array.isArray(e)?e:[e]);if(!t||0===t.length)continue;let n=t.filter(e=>!r.has(e)&&(!o||!!o.has(e))&&(r.add(e),!0));n.length>0&&i.push(n)}if(0!==i.length)return i}(e,o),r=function(e){if(e&&0!==e.length)return e.flat()}(i)??o,a=Object.entries({allowedActions:o,primaryActions:function(e,t){let n=e?.primaryActions;if(n&&0!==n.length){if(t&&t.length>0){let e=n.filter(e=>t.includes(e));return e.length>0?e:void 0}return n}}(e,r),layout:i,direction:"row"===(t=e?.direction)||"column"===t?t:void 0,uiProfile:"balanced"===(n=e?.uiProfile)||"compact"===n||"strict"===n?n:void 0,scrollLock:"boolean"==typeof e?.scrollLock?e.scrollLock:void 0}).filter(([,e])=>void 0!==e);return 0!==a.length?Object.fromEntries(a):void 0}function j(e,t){let n,{errors:o}=(n=D(e)).ok?{errors:function(e,t){let n=[];e.filter(e=>e.match.isDefault).length>1&&n.push("Only one default policy is allowed"),e.filter(e=>e.match.fallback).length>1&&n.push("Only one fallback policy is allowed"),e.some(e=>e.consent?.model==="iab")&&t&&!0!==t.iabEnabled&&n.push('Policies using consent.model="iab" require top-level iab.enabled=true');let o=e.find(e=>e.consent?.model==="iab"&&!!e.ui&&(void 0!==e.ui.mode||A(e.ui.banner)||A(e.ui.dialog)));o&&n.push(`Policy '${o.id}' uses consent.model="iab" and cannot define ui.* overrides. IAB banner/dialog controls are fixed by TCF mode.`);let i=e.find(e=>e.consent?.model==="iab"&&(e.consent?.preselectedCategories?.length??0)>0);for(let[t,o]of(i&&n.push(`Policy '${i.id}' uses consent.model="iab" and cannot define consent.preselectedCategories.`),e.entries())){let e=E(o,t);for(let t of["banner","dialog"]){let i=o.ui?.[t];if(!i)continue;let r=i.allowedActions;if(r&&r.length>0&&i.primaryActions&&i.primaryActions.length>0)for(let o of i.primaryActions)r.includes(o)||n.push(`Policy ${e} ui.${t}.primaryActions '${o}' is not in allowedActions [${r.join(", ")}].`);let a=i.layout;if(a){let o=new Set,i=r?new Set(r):void 0;for(let s of a){let a=Array.isArray(s)?s:[s];if(0===a.length){n.push(`Policy ${e} ui.${t}.layout contains an empty action group.`);continue}for(let s of a)i&&!i.has(s)&&n.push(`Policy ${e} ui.${t}.layout contains '${s}' which is not in allowedActions [${r?.join(", ")}].`),o.has(s)&&n.push(`Policy ${e} ui.${t}.layout contains duplicate action '${s}'.`),o.add(s)}if(r&&o.size!==r.length){let i=r.filter(e=>!o.has(e));i.length>0&&n.push(`Policy ${e} ui.${t}.layout must include every allowed action. Missing [${i.join(", ")}].`)}}}}let r=new Map;for(let[t,o]of e.entries()){let e=o.id?.trim();if(!e){n.push(`Policy ${E(o,t)} is missing a non-empty id.`);continue}let i=r.get(e);void 0!==i?n.push(`Policy IDs must be unique. Duplicate id '${e}' found at indexes ${i} and ${t}.`):r.set(e,t),o.match.isDefault||o.match.fallback||L(o)||n.push(`Policy '${e}' has no matcher. Add countries or regions, or set match.isDefault=true.`)}return n}(n.output,t),warnings:function(e){if(0===e.length)return[];let t=new Set;0===e.filter(e=>e.match.isDefault).length&&t.add("No default policy configured. Requests that do not match region/country will have no active policy."),0===e.filter(e=>e.match.fallback).length&&t.add("No fallback policy configured. If geo-location fails, no policy will apply. Mark a strict policy with match.fallback=true.");let n=new Map,o=new Map;for(let[i,r]of e.entries()){let e=r.id?.trim()||`policy_index_${i}`,a=E(r,i);for(let o of(r.match.isDefault&&L(r)&&t.add(`Policy ${a} is marked as default and also defines explicit matchers. Explicit matchers are ignored for default resolution.`),r.match.countries??[])){let i=o.toUpperCase(),r=n.get(i);r?t.add(`Country matcher '${i}' appears in multiple policies (${r} and '${e}'). First match wins by array order.`):n.set(i,`'${e}'`)}for(let n of r.match.regions??[]){let i=`${n.country.toUpperCase()}-${n.region.toUpperCase()}`,r=o.get(i);r?t.add(`Region matcher '${i}' appears in multiple policies (${r} and '${e}'). First match wins by array order.`):o.set(i,`'${e}'`)}}return[...t]}(n.output)}:{errors:n.errors,warnings:[]};if(o.length>0)throw Error(o[0])}async function $(e){var t,n,o;let i,r;try{(i=function(e){if(void 0===e)return;let t=D(e);if(!t.ok)throw Error(t.errors[0]);return t.output}(e.policies))&&i.length>0&&j(i,void 0===e.iabEnabled?void 0:{iabEnabled:e.iabEnabled})}catch{return}if(!i||0===i.length)return;
2let a=(t=e.countryCode)?t.toUpperCase():null,s=(n=e.regionCode)?(n.includes("-")?n.split("-").pop():n)?.toUpperCase().trim()??null:null,c=function(e){let{compiled:t,countryCode:n,regionCode:o}=e;if(n&&o){let e=t.regions.get(k(n,o));if(e)return{policy:e,matchedBy:"region"}}if(n){let e=t.countries.get(n);if(e)return{policy:e,matchedBy:"country"}}return!n&&t.fallbackPolicy?{policy:t.fallbackPolicy,matchedBy:"fallback"}:t.defaultPolicy?{policy:t.defaultPolicy,matchedBy:"default"}:void 0}({compiled:function(e){let t=S.get(e);if(t)return t;let n=function(e){let t={regions:new Map,countries:new Map};for(let n of e){for(let e of n.match.regions??[]){let o=C(e),i=k(o.country,o.region);t.regions.has(i)||t.regions.set(i,n)}for(let e of n.match.countries??[]){let o=w(e);t.countries.has(o)||t.countries.set(o,n)}t.defaultPolicy||!0!==n.match.isDefault||(t.defaultPolicy=n),t.fallbackPolicy||!0!==n.match.fallback||(t.fallbackPolicy=n)}return t}(e);return S.set(e,n),n}(i),countryCode:a,regionCode:s});if(!c)return;let d=(r=I(o=c.policy),{id:o.id,model:r,i18n:o.i18n,consent:{expiryDays:o.consent?.expiryDays,scopeMode:P(o),categories:x(o),preselectedCategories:function(e){if("iab"===I(e))return;let t=e.consent?.preselectedCategories;if(!t||0===t.length)return;let n=x(e);return"strict"!==P(e)||!n||0===n.length||n.includes("*")?y(t):y(t.filter(e=>n.includes(e)))}(o),gpc:o.consent?.gpc},ui:"iab"===r?void 0:{mode:o.ui?.mode,banner:R(o.ui?.banner),dialog:R(o.ui?.dialog)},proof:{storeIp:o.proof?.storeIp,storeUserAgent:o.proof?.storeUserAgent,storeLanguage:o.proof?.storeLanguage}}),u=await l(d);return{policy:d,matchedBy:c.matchedBy,fingerprint:u}}function T(){return{allowedActions:["accept","reject","customize"],layout:[["reject","accept"],"customize"],direction:"row",primaryActions:["customize"],uiProfile:"compact"}}function O(e){let t,n="opt-out"===e;return t=n?{mode:"none"}:{mode:"banner",banner:T(),dialog:T()},{id:n?"california_opt_out":"california_opt_in",match:v.regions([{country:"US",region:"CA"}]),consent:{model:e,expiryDays:365,gpc:!0},ui:t,proof:{storeIp:!0,storeUserAgent:!0,storeLanguage:!0}}}function U(e){let t="iab"===e,n={id:t?"europe_iab":"europe_opt_in",match:v.merge(v.iab(),v.fallback()),consent:{model:e,expiryDays:365,...t?{categories:["*"]}:{}},proof:{storeIp:!0,storeUserAgent:!0,storeLanguage:!0}};return t||(n.ui={mode:"banner",banner:T(),dialog:T()}),n}e.s(["createDeterministicFingerprintSync",0,a,"createMaterialPolicyFingerprint",0,c,"policyDefaults",0,n,"policyPackPresets",0,{europeOptIn:()=>U("opt-in"),europeIab:()=>U("iab"),worldNoBanner:()=>({id:"world_no_banner",match:v.default(),consent:{model:"none"},ui:{mode:"none"},proof:{storeIp:!1,storeUserAgent:!0,storeLanguage:!1}}),californiaOptIn:()=>O("opt-in"),californiaOptOut:()=>O("opt-out"),quebecOptIn:()=>({id:"quebec_opt_in",match:v.regions([{country:"CA",region:"QC"}]),consent:{model:"opt-in",expiryDays:365},ui:{mode:"banner",banner:T(),dialog:T()},proof:{storeIp:!0,storeUserAgent:!0,storeLanguage:!0}})},"resolvePolicyDecision",0,$,"validatePolicies",0,j,"validatePolicyI18nConfig",0,p],729251);let B={common:{acceptAll:"Accept All",rejectAll:"Reject All",customize:"Customize",save:"Save Settings",close:"Close",securedBy:"Secured by"},cookieBanner:{title:"We value your privacy",description:"This site uses cookies to improve your browsing experience, analyze site traffic, and show personalized content."},consentManagerDialog:{title:"Privacy Settings",description:"Customize your privacy settings here. You can choose which types of cookies and tracking technologies you allow."},consentTypes:{necessary:{title:"Strictly Necessary",description:"These cookies are essential for the website to function properly and cannot be disabled."},functionality:{title:"Functionality",description:"These cookies enable enhanced functionality and personalization of the website."},marketing:{title:"Marketing",description:"These cookies are used to deliver relevant advertisements and track their effectiveness."},measurement:{title:"Analytics",description:"These cookies help us understand how visitors interact with the website and improve its performance."},experience:{title:"Experience",description:"These cookies help us provide a better user experience and test new features."}},frame:{title:"Accept {category} consent to view this content.",actionButton:"Enable {category} consent",policyBlocked:"This content is unavailable under your region's consent policy."},legalLinks:{privacyPolicy:"Privacy Policy",cookiePolicy:"Cookie Policy",termsOfService:"Terms of Service"},iab:{banner:{title:"Privacy Settings",description:"We and our {partnerCount} partners store and/or access information on your device and process personal data, such as unique identifiers and browsing data, for this website, to:",partnersLink:"{count} partners",andMore:"And {count} more...",legitimateInterestNotice:"Some partners claim a legitimate interest to process your data. You have the right to object to this processing, customize your choices, and withdraw your consent at any time.",scopeServiceSpecific:"Your consent applies only to this website and will not affect other services.",scopeGroup:"Your choice applies across our websites in this group."},preferenceCenter:{title:"Privacy Settings",description:"Customize your privacy settings here. You can choose which types of cookies and tracking technologies you allow.",tabs:{purposes:"Purposes",vendors:"Vendors"},purposeItem:{partners:"{count} partners",vendorsUseLegitimateInterest:"{count} vendors claim legitimate interest",examples:"Examples",partnersUsingPurpose:"Partners Using This Purpose",withYourPermission:"With Your Permission",legitimateInterest:"Legitimate Interest",objectButton:"Object",objected:"Objected",rightToObject:"You have the right to object to processing based on legitimate interest."},specialPurposes:{title:"Essential Functions (Required)",tooltip:"These are required for site functionality and security. Per IAB TCF, you cannot object to these special purposes."},vendorList:{search:"Search vendors...",showingCount:"{filtered} of {total} vendors",iabVendorsHeading:"IAB Registered Vendors",iabVendorsNotice:"These partners are registered with the IAB Transparency & Consent Framework (TCF), an industry standard for managing consent",customVendorsHeading:"Custom Partners",customVendorsNotice:"These are custom partners not registered with IAB Transparency & Consent Framework (TCF). They process data based on your consent and may have different privacy practices than IAB-registered vendors.",purposes:"Purposes",specialPurposes:"Special Purposes",specialFeatures:"Special Features",features:"Features",dataCategories:"Data Categories",usesCookies:"Uses Cookies",nonCookieAccess:"Non-Cookie Access",maxAge:"Max Age: {days}d",retention:"Retention: {days}d",legitimateInterest:"Leg. Interest",privacyPolicy:"Privacy Policy",storageDisclosure:"Storage Disclosure",requiredNotice:"Required for site functionality, cannot be disabled"},footer:{consentStorage:'Consent preferences are stored in a cookie named "euconsent-v2" for 13 months. The storage duration may be refreshed when you update your preferences.'}},common:{acceptAll:"Accept All",rejectAll:"Reject All",customize:"Customize",saveSettings:"Save Settings",loading:"Loading...",showingSelectedVendor:"Showing selected vendor",clearSelection:"Clear",customPartner:"Custom partner not registered with IAB"}}};function _(e){return!(!e||"object"!=typeof e||Array.isArray(e))}function N(e,t){let n={};for(let o of["cookieBanner","consentManagerDialog","common","consentTypes","frame","legalLinks","iab"]){let i=e[o],r=t[o];(i||r)&&(n[o]=function e(t,n){if(!t&&!n)return{};let o={};if(t)for(let e of Object.keys(t))o[e]=t[e];if(!n)return o;for(let i of Object.keys(n)){let r=n[i];if(void 0===r)continue;let a=t?t[i]:void 0;_(a)&&_(r)?o[i]=e(a,r):o[i]=r}return o}(i,r))}return n}function F(e,t){let n=t?.fallback??"en";if(!e.length)return n;for(let n of function(e){if(!e)return[];let t=e.split(",").map((e,t)=>
2{let[n,...o]=e.split(";"),i=n?.trim().toLowerCase();if(!i)return null;let r=1;for(let e of o){let t=e.trim().toLowerCase();if(!t.startsWith("q="))continue;let n=Number.parseFloat(t.slice(2));Number.isFinite(n)&&(r=n);break}return{code:i.split("-")[0]??i,quality:r,index:t}}).filter(e=>!!e).sort((e,t)=>t.quality!==e.quality?t.quality-e.quality:e.index-t.index),n=new Set,o=[];for(let e of t)n.has(e.code)||(n.add(e.code),o.push(e.code));return o}(t?.header))if(e.includes(n))return n;return n}function M(e){let t=e?.disableAutoLanguageSwitch===void 0?void 0:!e.disableAutoLanguageSwitch;return{messages:e?.i18n?.messages??e?.translations??{},locale:e?.i18n?.locale??e?.defaultLanguage,detectBrowserLanguage:e?.i18n?.detectBrowserLanguage??t}}function q(e){return{translations:e.messages,defaultLanguage:e.locale,disableAutoLanguageSwitch:void 0===e.detectBrowserLanguage?void 0:!e.detectBrowserLanguage}}function H(e,t){if(e||t)return q(M({...e??{},...t?{i18n:t}:{}}))}let V=e=>{let t,n=new Set,o=(e,o)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=o?o:"object"!=typeof i||null===i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,r={setState:o,getState:i,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e))},a=t=e(o,i,r);return r},z=/^\/+/;function G(e,t=null,n=null,o=null){return{data:t,error:n,ok:e,response:o}}function J(e,t=500,n="HANDLER_ERROR",o){return function(e,t=500,n="ERROR",o){return G(!1,null,{message:e,status:t,code:n,cause:o},null)}(e,t,n,o)}async function K(e,t,n){let o=e[t];if(!o){let e=J(`No endpoint handler found for '${String(t)}'`,404,"ENDPOINT_NOT_FOUND");if(n?.throw)throw Error(`No endpoint handler found for '${String(t)}'`);return e}try{let e=await o(n);return{data:e.data,error:e.error,ok:e.ok??!e.error,response:e.response}}catch(t){let e=J(t instanceof Error?t.message:String(t),0,"HANDLER_ERROR",t);if(n?.throw)throw t;return e}}async function X(e,t,n,o){let i=n.replace(z,"").split("/")[0],r=t[n];if(r)try{return await r(o)}catch(e){return J(e instanceof Error?e.message:String(e),0,"HANDLER_ERROR",e)}return i&&i in e?await K(e,i,o):J(`No endpoint handler found for '${n}'`,404,"ENDPOINT_NOT_FOUND")}
2async function W(e,t){let n=("init"in e&&e.init,"init");return await K(e,n,t)}async function Y(e,t){return await K(e,"setConsent",t)}class Q{endpointHandlers;dynamicHandlers={};constructor(e){this.endpointHandlers=e.endpointHandlers}async init(e){return W(this.endpointHandlers,e)}async setConsent(e){return Y(this.endpointHandlers,e)}async identifyUser(e){if(this.endpointHandlers.identifyUser)return this.endpointHandlers.identifyUser(e);let t=e.body?.id;return t?this.$fetch(`/subjects/${t}`,{...e,method:"PATCH"}):{ok:!1,data:null,response:null,error:{message:"Subject ID is required to identify user",status:400,code:"MISSING_SUBJECT_ID"}}}registerHandler(e,t){this.dynamicHandlers[e]=t}async $fetch(e,t){return X(this.endpointHandlers,this.dynamicHandlers,e,t)}}let Z=[500,502,503,504],ee=[400,401,403,404],et,en=/^(?:[a-z+]+:)?\/\//i,eo=()=>{};function ei(e){return e?{log:(...e)=>console.log("[c15t]",...e),debug:(...e)=>console.debug("[c15t]",...e)}:{log:eo,debug:eo}}let er=ei(!1),ea=e=>new Promise(t=>setTimeout(t,e));function es(e){return e?.subjectId||e?.id}function el(e){let t=e.length;for(;t>0&&"/"===e[t-1];)t--;return e.slice(0,t)}async function ec(e,t,n){let o={...e.retryConfig,...n?.retryConfig||{},retryableStatusCodes:n?.retryConfig?.retryableStatusCodes??e.retryConfig.retryableStatusCodes??Z,nonRetryableStatusCodes:n?.retryConfig?.nonRetryableStatusCodes??e.retryConfig.nonRetryableStatusCodes??ee},{maxRetries:i,initialDelayMs:r,backoffFactor:a,retryableStatusCodes:s,nonRetryableStatusCodes:l,retryOnNetworkError:c}=o,d=0,u=r,f=null;for(;d<=(i??0);){let r,p="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}),g=e.customFetch||globalThis.fetch,y=function(e,t){if(en.test(e)){let n=new URL(e),o=el(n.pathname),i=t.replace(z,"");return n.pathname=`${o}/${i}`,n.toString()}let n=el(e),o=t.replace(z,"");return`${n}/${o}`}(e.backendURL,t);try{r=new URL(y)}catch{r=new URL(y,window.location.origin)}if(n?.query)for(let[e,t]of Object.entries(n.query))void 0!==t&&r.searchParams.append(e,String(t));
2let m={method:n?.method||"GET",mode:e.corsMode,credentials:"include",headers:{...e.headers,"X-Request-ID":p,...n?.headers},...n?.fetchOptions};n?.body&&"GET"!==m.method&&(m.body=JSON.stringify(n.body));try{let e=await g(r.toString(),m),c=null,p=null;try{let t=e.headers.get("content-type");t?.includes("application/json")&&204!==e.status&&"0"!==e.headers.get("content-length")?c=await e.json():204===e.status&&(c=null)}catch(e){p=e}if(p){let o=G(!1,null,{message:"Failed to parse response",status:e.status,code:"PARSE_ERROR",cause:p},e);if(n?.onError?.(o,t),n?.throw)throw Error("Failed to parse response");return o}if(e.status>=200&&e.status<300){let t=G(!0,c,null,e);return n?.onSuccess?.(t),t}let y=c,h=G(!1,null,{message:y?.message||`Request failed with status ${e.status}`,status:e.status,code:y?.code||"API_ERROR",details:y?.details||null},e);f=h;let b=!1;if(l?.includes(e.status))er.debug(`Not retrying request to ${t} with status ${e.status} (nonRetryableStatusCodes)`),b=!1;else if("function"==typeof o.shouldRetry)try{b=o.shouldRetry(e,{attemptsMade:d,url:r.toString(),method:m.method||"GET"}),er.debug(`Custom retry strategy for ${t} with status ${e.status}: ${b}`)}catch{b=s?.includes(e.status)??!1,er.debug(`Custom retry strategy failed, falling back to status code check: ${b}`)}else b=s?.includes(e.status)??!1,er.debug(`Standard retry check for ${t} with status ${e.status}: ${b}`);if(!b||d>=(i??0)){if(n?.onError?.(h,t),n?.throw)throw Error(h.error?.message||"Request failed");return h}d++,await ea(u??0),u=(u??0)*(a??2)}catch(r){if(r&&"Failed to parse response"===r.message)throw r;let e=!(r instanceof Response),o=G(!1,null,{message:r instanceof Error?r.message:String(r),status:0,code:"NETWORK_ERROR",cause:r},null);if(f=o,!(e&&c)||d>=(i??0)){if(n?.onError?.(o,t),n?.throw)throw r;return o}d++,await ea(u??0),u=(u??0)*(a??2)}}let p=f||G(!1,null,{message:`Request failed after ${i} retries`,status:0,code:"MAX_RETRIES_EXCEEDED"},null);if(n?.onError?.(p,t),n?.throw)throw Error(`Request failed after ${i} retries`);return p}function ed(e){return{expiryDays:e?.defaultExpiryDays??365,crossSubdomain:e?.crossSubdomain??!1,domain:e?.defaultDomain??"",path:"/",secure:"u">typeof window&&"https:"===window.location.protocol,sameSite:"Lax"}}function eu(){if("u"<typeof window)return"";let e=window.location.hostname;if("localhost"===e||/^\d+\.\d+\.\d+\.\d+$/.test(e))return e;let t=e.split(".");return t.length>=2?`.${t.slice(-2).join(".")}`:e}let ef={consents:"c",consentInfo:"i",timestamp:"ts",iabCustomVendorConsents:"icv",iabCustomVendorLegitimateInterests:"icvli",time:"t",type:"y",id:"id",subjectId:"sid",externalId:"eid",materialPolicyFingerprint:"mpf",identityProvider:"idp"},ep=Object.entries(ef).reduce((e,[t,n])=>(e[n]=t,e),{});function eg(e,t,n,o){if("u"<typeof document)return;let i={...ed(o),...n};i.crossSubdomain&&!n?.domain&&(i.domain=eu());try{let n;if("string"==typeof t)n=t;else{var r;let e=function e(t,n=""){let o={};for(let[i,r]of Object.entries(t)){let t=n?`${n}.${i}`:i;null==r?o[t]="":"boolean"==typeof r?r&&(o[t]="1"):"object"!=typeof r||Array.isArray(r)?o[t]=String(r):Object.assign(o,e(r,t))}return o}(t);r=function(e){let t={};for(let[n,o]of Object.entries(e))t[n.split(".").map(e=>ef[e]||e).join(".")]=o;return t}(e),n=Object.entries(r).map(([e,t])=>`${e}:${t}`).join(",")}let o=new Date;o.setTime(o.getTime()+24*i.expiryDays*36e5);let a=`expires=${o.toUTCString()}`,s=[`${e}=${n}`,a,`path=${i.path}`];i.domain&&s.push(`domain=${i.domain}`),i.secure&&s.push("secure"),i.sameSite&&s.push(`SameSite=${i.sameSite}`),document.cookie=s.join("; ")}catch(t){console.warn(`Failed to set cookie "${e}":`,t)}}function ey(e,t,n){if("u"<typeof document)return;let o={...ed(n),...t};o.crossSubdomain&&!t?.domain&&(o.domain=eu());try{let t=[`${e}=`,"expires=Thu, 01 Jan 1970 00:00:00 GMT",`path=${o.path}`];o.domain&&t.push(`domain=${o.domain}`),document.cookie=t.join("; ")}catch(t){console.warn(`Failed to delete cookie "${e}":`,t)}}let em={translations:{en:B},defaultLanguage:"en",disableAutoLanguageSwitch:!1},eh=[{defaultValue:!0,description:"These trackers are used for activities that are strictly necessary to operate or deliver the service you requested from us and, therefore, do not require you to consent.",disabled:!0,display:!0,gdprType:1,name:"necessary"},{defaultValue:!1,description:"These trackers enable basic interactions and functionalities that allow you to access selected features of our service and facilitate your communication with us.",display:!1,gdprType:2,name:"functionality"},{defaultValue:!1,description:"These trackers help us to measure traffic and analyze your behavior to improve our service.",display:!1,gdprType:4,name:"measurement"},{defaultValue:!1,description:"These trackers help us to improve the quality of your user experience and enable interactions with external 
2content, networks, and platforms.",display:!1,gdprType:3,name:"experience"},{defaultValue:!1,description:"These trackers help us to deliver personalized ads or marketing content to you, and to measure their performance.",display:!1,gdprType:5,name:"marketing"}],eb=eh.map(e=>e.name),ew="c15t",eC="privacy-consent-storage",ev={debug:!1,config:{pkg:"c15t",version:"2.1.0",mode:"Unknown"},consents:eh.reduce((e,t)=>(e[t.name]=t.defaultValue,e),{}),selectedConsents:eh.reduce((e,t)=>(e[t.name]=t.defaultValue,e),{}),consentInfo:null,branding:"c15t",activeUI:"none",isLoadingConsentInfo:!1,hasFetchedBanner:!1,lastBannerFetchData:null,consentCategories:["necessary"],callbacks:{},locationInfo:null,overrides:void 0,legalLinks:{},translationConfig:em,user:void 0,networkBlocker:void 0,storageConfig:void 0,includeNonDisplayedConsents:!1,consentTypes:eh,iframeBlockerConfig:{disableAutomaticBlocking:!1},scripts:[],loadedScripts:{},scriptIdMap:{},model:"opt-in",policyBanner:{},policyDialog:{},policyCategories:null,policyScopeMode:null,initDataSource:null,initDataSourceDetail:null,iab:null,reloadOnConsentRevoked:!0,ssrDataUsed:!1,ssrSkippedReason:null};function eS(e){if("string"!=typeof e)return;let t=e.trim();if(""!==t&&"undefined"!==t&&"null"!==t)return t}function ek(e){let t=eS(e.externalId),n=eS(e.identityProvider);return{...t?{externalId:t}:{},...n?{identityProvider:n}:{}}}function eI(e){if(!e)return e;let t={...e},{externalId:n,identityProvider:o}=ek({externalId:t.externalId,identityProvider:t.identityProvider});return n?t.externalId=n:delete t.externalId,o?t.identityProvider=o:delete t.identityProvider,t}function ex(e,t,n){let o=!1,i=!1,r=n?.storageKey||ew,a=eA(n),s={...{...a,...e,consentInfo:eI(e.consentInfo||a?.consentInfo?{...a?.consentInfo??{},...e.consentInfo??{}}:void 0),iabCustomVendorConsents:e.iabCustomVendorConsents??a?.iabCustomVendorConsents,iabCustomVendorLegitimateInterests:e.iabCustomVendorLegitimateInterests??a?.iabCustomVendorLegitimateInterests}};s.iabCustomVendorConsents&&0!==Object.keys(s.iabCustomVendorConsents).length||delete s.iabCustomVendorConsents,s.iabCustomVendorLegitimateInterests&&0!==Object.keys(s.iabCustomVendorLegitimateInterests).length||delete s.iabCustomVendorLegitimateInterests;try{"u">typeof window&&window.localStorage&&(window.localStorage.setItem(r,JSON.stringify(s)),o=!0)}catch(e){console.warn("Failed to save consent to localStorage:",e)}try{eg(r,s,t,n),i=!0}catch(e){console.warn("Failed to save consent to cookie:",e)}if(!o&&!i)throw Error("Failed to save consent to any storage method")}function eP(e){let t=e.consents||{},n={...t};for(let e of eb)n[e]=t[e]??!1;return{...e,consents:n}}function eA(e){!function(e){let t=e?.storageKey||ew;if(t!==eC)try{if("u">typeof window&&window.localStorage){if(window.localStorage.getItem(t))return void window.localStorage.removeItem(eC);let e=window.localStorage.getItem(eC);e&&(window.localStorage.setItem(t,e),window.localStorage.removeItem(eC),er.log(`Migrated consent data from "${eC}" to "${t}"`))}}catch(e){console.warn("[c15t] Failed to migrate legacy storage:",e)}}(e);let t=e?.storageKey||ew,n=null,o=null;try{if("u">typeof window&&window.localStorage){let e=window.localStorage.getItem(t);e&&(n=JSON.parse(e))}}catch(e){console.warn("Failed to read consent from localStorage:",e)}try{o=function(e){if("u"<typeof document)return null;try{let t=`${e}=`;for(let e of document.cookie.split(";")){let n=e;for(;" "===n.charAt(0);)n=n.substring(1);if(0===n.indexOf(t)){let e=n.substring(t.length);if(e.includes(":")){let t=function(e){if(!e)return{};let t={};for(let n of e.split(",")){let e=n.indexOf(":");if(-1===e)continue;let o=n.substring(0,e),i=n.substring(e+1);t[o]=i}return t}(e),n=function(e){let t={};for(let[n,o]of Object.entries(e))t[n.split(".").map(e=>ep[e]||e).join(".")]=o;return t}(t);return function(e){let t={};for(let[n,o]of Object.entries(e)){let e=n.split(".");if(0===e.length)continue;let i=t;for(let t=0;t<e.length-1;t++){let n=e[t];void 0!==n&&(i[n]||(i[n]={}),i=i[n])}let r=e[e.length-1];void 0!==r&&("1"===o?i[r]=!0:"0"===o?i[r]=!1:""===o?i[r]=null:Number.isNaN(Number(o))||""===o?i[r]=o:i[r]=Number(o))}return t}(n)}return e}}return null}catch(t){return console.warn(`Failed to get cookie "${e}":`,t),null}}(t)}
2catch(e){console.warn("Failed to read consent from cookie:",e)}let i=null,r=null;if(o?(i=o,r="cookie"):n&&(i=n,r="localStorage"),i&&r){let n=e?.crossSubdomain===!0||!!e?.defaultDomain;if("localStorage"!==r||o){if("cookie"===r)try{if("u">typeof window&&window.localStorage){let e=i;"object"==typeof e&&null!==e&&"consents"in e&&(e=eP(e));let o=null;try{let e=window.localStorage.getItem(t);if(e){let t=JSON.parse(e);o="object"==typeof t&&null!==t&&"consents"in t?eP(t):t}}catch{o=null}let r=JSON.stringify(e),a=JSON.stringify(o);r!==a&&(window.localStorage.setItem(t,r),o?n?er.log("Updated localStorage with consent from cookie (cross-subdomain mode)"):er.log("Updated localStorage with consent from cookie"):er.log("Synced consent from cookie to localStorage"))}}catch(e){console.warn("[c15t] Failed to sync consent to localStorage:",e)}}else try{eg(t,i,void 0,e),er.log("Synced consent from localStorage to cookie")}catch(e){console.warn("[c15t] Failed to sync consent to cookie:",e)}}if(i&&function(e){if("object"!=typeof e||null===e)return!1;let t=e.consentInfo;if(!t||"object"!=typeof t)return!1;let n="string"==typeof t.id,o="string"==typeof t.subjectId;return n&&!o}(i))return er.log("Detected legacy consent format (v1.x). Re-consent required for v2.0."),eL(void 0,e),null;if(i&&"object"==typeof i){let e=eP(i);return"object"==typeof e&&null!==e&&"consentInfo"in e&&(e.consentInfo=eI(e.consentInfo)),e}return i}function eL(e,t){let n=t?.storageKey||ew;try{"u">typeof window&&window.localStorage&&(window.localStorage.removeItem(n),n!==eC&&window.localStorage.removeItem(eC))}catch(e){console.warn("Failed to remove consent from localStorage:",e)}try{ey(n,e,t),n!==eC&&ey(eC,e,t)}catch(e){console.warn("Failed to remove consent cookie:",e)}}let eE="/subjects",eD="/subjects";async function eR(e,t,n,o,i){try{let r=await ec(e,t,{method:n,...o});if(r.ok)return r;return console.warn(`API request failed, falling back to offline mode for ${t}`),i(o)}catch(e){return console.warn(`Error calling ${t}, falling back to offline mode:`,e),i(o)}}async function ej(e){let t="c15t-pending-identify-submissions",n=es(e?.body);try{if("u">typeof window&&e?.body&&window.localStorage){let o=[];try{let e=window.localStorage.getItem(t);e&&(o=JSON.parse(e))}catch(e){console.warn("Error parsing pending identify submissions:",e),o=[]}let i=e.body;o.some(e=>es(e)===n&&e.externalId===i.externalId)||(o.push(i),window.localStorage.setItem(t,JSON.stringify(o)),er.log("Queued identify user submission for retry on next page load"))}}catch(e){console.warn("Failed to write to localStorage in identify offline fallback:",e)}let o=G(!0,null,null,null);return e?.onSuccess&&await e.onSuccess(o),o}async function e$(e,t,n){let{body:o,...i}=n,r=es(o);if(!o||!r)return{ok:!1,data:null,response:null,error:{message:"Subject ID is required to identify user",status:400,code:"MISSING_SUBJECT_ID"}};let a=eA(t);ex({consents:a?.consents||{},consentInfo:{...a?.consentInfo,time:a?.consentInfo?.time||Date.now(),subjectId:r,externalId:o.externalId,identityProvider:o.identityProvider}},void 0,t);let{subjectId:s,id:l,...c}=o;return eR(e,`${eD}/${r}`,"PATCH",{...i,body:c},async e=>{let t={subjectId:r,...e?.body};return ej({...e,body:t})})}function eT(e){return e.explicitPolicy?e.explicitPolicy:n.offlineOptInBanner()}function eO(e){let t={jurisdiction:e.jurisdiction??"NONE",location:{countryCode:e.countryCode??null,regionCode:e.regionCode??null},translations:{language:e.language??"en",translations:e.translations??B},branding:"c15t",gvl:e.gvl??null};return e.policy&&(t.policy=e.policy),e.policyDecision&&(t.policyDecision=e.policyDecision),e.policySnapshotToken&&(t.policySnapshotToken=e.policySnapshotToken),t}async function eU(e,t){let n=G(!0,t,null,null);return e?.onSuccess&&await e.onSuccess(n),n}async function eB(e,t){let n=eT({}),o=null;if(t?.enabled&&"iab"===n.model)try{let e=t._module?.fetchGVL;e&&(o=await e(t.vendorIds))}catch(e){console.warn("Failed to fetch GVL in offline fallback:",e)}let i=eO({countryCode:e?.headers?.["x-c15t-country"]??null,regionCode:e?.headers?.["x-c15t-region"]??null,gvl:o,policy:n});return eU(e,i)}async function e_(e,t,n){try{let o=await ec(e,"/init",{method:"GET",...t});if(o.ok)return o;return console.warn("API request failed, falling back to offline mode for consent banner"),eB(t,n)}catch(e){return console.warn("Error fetching consent banner info, falling back to offline mode:",e),eB(t,n)}}let eN="c15t-pending-consent-submissions",eF="c15t-pending-identify-submissions";async function eM(e,t){let n=[...t];for(let t=0;t<3&&n.length>0;t++){let o=[];for(let t=0;t<n.length;t++){let i=n[t];
2if(i)try{let{externalId:n,identityProvider:r}=ek({externalId:i.externalSubjectId,identityProvider:i.identityProvider}),a={...i,...n?{externalSubjectId:n}:{},...r?{identityProvider:r}:{}};n||delete a.externalSubjectId,r||delete a.identityProvider,er.log("Retrying consent submission:",i),(await ec(e,eE,{method:"POST",body:a})).ok&&(er.log("Successfully resubmitted consent"),o.push(t))}catch(e){console.warn("Failed to resend consent submission:",e)}}for(let e=o.length-1;e>=0;e--){let t=o[e];void 0!==t&&n.splice(t,1)}if(0===n.length)break;t<2&&await ea(1e3*(t+1))}try{"u">typeof window&&window.localStorage&&(n.length>0?(window.localStorage.setItem(eN,JSON.stringify(n)),er.log(`${n.length} consent submissions still pending for future retry`)):(window.localStorage.removeItem(eN),er.log("All pending consent submissions processed successfully")))}catch(e){console.warn("Error updating pending submissions storage:",e)}}async function eq(e,t){let n=[...t];for(let t=0;t<3&&n.length>0;t++){let o=[];for(let t=0;t<n.length;t++){let i=n[t];if(!i)continue;let r=es(i);if(!r){console.warn("Dropping pending identify submission without a subject ID"),o.push(t);continue}if(!i.externalId){console.warn("Dropping pending identify submission without an externalId"),o.push(t);continue}try{er.log("Retrying identify user submission:",i);let n=`${eD}/${r}`,{subjectId:a,id:s,...l}=i;(await ec(e,n,{method:"PATCH",body:l})).ok&&(er.log("Successfully resubmitted identify user"),o.push(t))}catch(e){console.warn("Failed to resend identify user submission:",e)}}for(let e=o.length-1;e>=0;e--){let t=o[e];void 0!==t&&n.splice(t,1)}if(0===n.length)break;t<2&&await ea(1e3*(t+1))}try{"u">typeof window&&window.localStorage&&(n.length>0?(window.localStorage.setItem(eF,JSON.stringify(n)),er.log(`${n.length} identify submissions still pending for future retry`)):(window.localStorage.removeItem(eF),er.log("All pending identify submissions processed successfully")))}catch(e){console.warn("Error updating pending identify submissions storage:",e)}}async function eH(e,t){let n="c15t-pending-consent-submissions",o=t?.body?.subjectId;try{if("u">typeof window&&(ex({consents:t?.body?.preferences||{},consentInfo:{time:Date.now(),subjectId:o,externalId:t?.body?.externalSubjectId,identityProvider:t?.body?.identityProvider}},void 0,e),t?.body&&window.localStorage)){let e=[];try{let t=window.localStorage.getItem(n);t&&(e=JSON.parse(t))}catch(t){console.warn("Error parsing pending submissions:",t),e=[]}let o=t.body;e.some(e=>JSON.stringify(e)===JSON.stringify(o))||(e.push(o),window.localStorage.setItem(n,JSON.stringify(e)),er.log("Queued consent submission for retry on next page load"))}}catch(e){console.warn("Failed to write to localStorage in offline fallback:",e)}let i=G(!0,null,null,null);return t?.onSuccess&&await t.onSuccess(i),i}async function eV(e,t,n){return ex({consents:n?.body?.preferences||{},consentInfo:{time:Date.now(),subjectId:n?.body?.subjectId,externalId:n?.body?.externalSubjectId,identityProvider:n?.body?.identityProvider}},void 0,t),await eR(e,eE,"POST",n,async e=>eH(t,e))}class ez{backendURL;storageConfig;iabConfig;headers;customFetch;corsMode;retryConfig;fetcherContext;constructor(e){this.backendURL=e.backendURL.endsWith("/")?e.backendURL.slice(0,-1):e.backendURL,this.headers={"Content-Type":"application/json",...e.headers},this.customFetch=e.customFetch,this.corsMode=e.corsMode||"cors",this.storageConfig=e.storageConfig,this.iabConfig=e.iabConfig,this.retryConfig={maxRetries:e.retryConfig?.maxRetries??3??3,initialDelayMs:e.retryConfig?.initialDelayMs??100??100,backoffFactor:e.retryConfig?.backoffFactor??2??2,retryableStatusCodes:e.retryConfig?.retryableStatusCodes??Z,nonRetryableStatusCodes:e.retryConfig?.nonRetryableStatusCodes??ee,shouldRetry:e.retryConfig?.shouldRetry??et,retryOnNetworkError:e.retryConfig?.retryOnNetworkError??!0},this.fetcherContext={backendURL:this.backendURL,headers:this.headers,customFetch:this.customFetch,corsMode:this.corsMode,retryConfig:this.retryConfig},this.checkPendingConsentSubmissions(),this.checkPendingIdentifySubmissions()}async init(e){return e_(this.fetcherContext,e,this.iabConfig)}async setConsent(e){return eV(this.fetcherContext,this.storageConfig,e)}async identifyUser(e){return e$(this.fetcherContext,this.storageConfig,e)}async $fetch(e,t){return ec(this.fetcherContext,e,t)}checkPendingConsentSubmissions(){!function(e,t){if(!("u"<typeof window)&&window.localStorage)try{window.localStorage.setItem("c15t-storage-test-key","test"),window.localStorage.removeItem("c15t-storage-test-key");let e=window.localStorage.getItem(eN);if(!e)return;let n=JSON.parse(e);if(!n.length)return void window.localStorage.removeItem(eN);er.log(`Found ${n.length} pending consent submission(s) to retry`),setTimeout(()=>{t(n)},2e3)}catch(e){console.warn("Failed to check for pending consent submissions:",e)}}(this.fetcherContext,e=>this.processPendingConsentSubmissions(e))}async processPendingConsentSubmissions(e){return eM(this.fetcherContext,e)}checkPendingIdentifySubmissions(){!function(e,t){if(!("u"<typeof window)&&window.localStorage)try{let e=window.localStorage.getItem(eF);if(!e)return;let n=JSON.parse(e);if(!n.length)return void window.localStorage.removeItem(eF);er.log(`Found ${n.length} pending identify user submission(s) to retry`),setTimeout(()=>{t(n)},2500)}catch(e){console.warn("Failed to check for pending identify submissions:",e)}}(this.fetcherContext,e=>this.processPendingIdentifySubmissions(e))}async processPendingIdentifySubmissions(e){return eq(this.fetcherContext,e)}}function eG(e=null){return G(!0,e)}async function eJ(e){let t=eG();return e?.onSuccess&&await e.onSuccess(t),t}function eK(e){if(!e)return;let t=e.split(",")[0]?.split(";")[0]?.trim().toLowerCase();if(t)return t.split("-")[0]??void 0}async function eX(e,t,o,i){var r,a,s,l;
2let c,d,u=t?.headers?.["x-c15t-country"]??"GB",f=t?.headers?.["x-c15t-region"]??null,g=t?.headers?.["accept-language"]??null,y=function(e,t){let n={EU:new Set(["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE"]),EEA:new Set(["IS","NO","LI"]),UK:new Set(["GB"]),CH:new Set(["CH"]),BR:new Set(["BR"]),CA:new Set(["CA"]),AU:new Set(["AU"]),JP:new Set(["JP"]),KR:new Set(["KR"]),CA_QC_REGIONS:new Set(["QC"])},o="NONE";if(e){let i=e.toUpperCase(),r=t&&"string"==typeof t?(t.includes("-")?t.split("-").pop():t).toUpperCase():null;if("CA"===i&&r&&n.CA_QC_REGIONS.has(r))return"QC_LAW25";for(let{sets:e,code:t}of[{sets:[n.EU,n.EEA,n.UK],code:"GDPR"},{sets:[n.CH],code:"CH"},{sets:[n.BR],code:"BR"},{sets:[n.CA],code:"PIPEDA"},{sets:[n.AU],code:"AU"},{sets:[n.JP],code:"APPI"},{sets:[n.KR],code:"PIPA"}])if(e.some(e=>e.has(i))){o=t;break}}return o}(u,f),m=i?.policyPacks,h=i?.policyPacks!==void 0,b=p({i18n:i?.i18n,policies:m});for(let e of b.warnings)console.warn(`[c15t] offlinePolicy.i18n: ${e}`);if(b.errors.length>0)throw Error(`Invalid offlinePolicy.i18n configuration:
3${b.errors.map(e=>`- ${e}`).join("\n")}`);m&&m.length>0&&j(m,{iabEnabled:o?.enabled===!0});let w=m&&m.length>0?await $({policies:m,countryCode:u,regionCode:f,jurisdiction:y,iabEnabled:o?.enabled===!0}):void 0,C=!i?.policy&&!w&&!h,v={...i,policy:i?.policy??w?.policy??(h?n.offlineNoBanner():void 0)??(C?eT({}):void 0),policyDecision:i?.policyDecision??(w?{policyId:w.policy.id,fingerprint:w.fingerprint,matchedBy:w.matchedBy,country:u,region:f,jurisdiction:y}:void 0)};if(i?.i18n?.messages&&Object.keys(i.i18n.messages).length>0){let e,t,n,o,l,u,f,p,y,m,h=(t=(a={profiles:e=(r={acceptLanguage:g,i18n:i.i18n,policyI18n:v.policy?.i18n}).i18n.messages??{},defaultProfile:r.i18n.defaultProfile??"default",policyProfile:r.policyI18n?.messageProfile}).policyProfile??a.defaultProfile,n=a.profiles[t]?t:a.defaultProfile,o=Object.keys(e[n]?.translations??{}).sort(),s={profile:e[n]},l=eK(s.profile?.fallbackLanguage)??"en",f=(u=Object.keys(s.profile?.translations??{}).sort()).includes(l)?l:u.includes("en")?"en":u[0]??l,p=eK(r.policyI18n?.language)??F(o,{header:r.acceptLanguage,fallback:f}),y=e[n]?.translations[p]?p:f,m=e[n]?.translations[y],{language:y,translations:m?N(B,m):B});c=h.language,d=h.translations}else if(e?.translations&&Object.keys(e.translations).length>0){let t,n,o=e.translations;c=F(Object.keys(o),{header:g,fallback:(l=e.defaultLanguage,t=Object.keys(o).sort(),(n=l?.toLowerCase())&&t.includes(n)?n:t.includes("en")?"en":t[0]??"en")}),d=N(B,o[c]??{})}else c=F(Object.keys(em.translations),{header:g,fallback:em.defaultLanguage??"en"}),d=em.translations[c];let S=null;if(o?.enabled&&v.policy?.model==="iab")if(o.gvl)S=o.gvl;else try{let e=o._module?.fetchGVL;e&&(S=await e(o.vendorIds))}catch(e){console.warn("Failed to fetch GVL in offline mode:",e)}let k=eG(eO({jurisdiction:y,countryCode:u,regionCode:f,language:c,translations:d,gvl:S,policy:v.policy,policyDecision:v.policyDecision,policySnapshotToken:v.policySnapshotToken}));return t?.onSuccess&&await t.onSuccess(k),k}async function eW(e,t){let n=t?.body?.subjectId;try{"u">typeof window&&ex({consentInfo:{time:Date.now(),subjectId:n,externalId:t?.body?.externalSubjectId,identityProvider:t?.body?.identityProvider},consents:t?.body?.preferences||{}},void 0,e)}catch(e){console.warn("Failed to write to storage:",e)}return await eJ(t)}class eY{storageConfig;initialTranslationConfig;iabConfig;policyConfig;constructor(e,t,n,o){this.storageConfig=e,this.initialTranslationConfig=t,this.iabConfig=n,this.policyConfig=o}async init(e){return eX(this.initialTranslationConfig,e,this.iabConfig,this.policyConfig)}async setConsent(e){return eW(this.storageConfig,e)}async identifyUser(e){return console.warn("identifyUser called in offline mode - external ID will not be linked"),eJ(e)}async $fetch(e,t){return await eJ(t)}}let eQ="hosted",eZ=!1;function e0(e){if("c15t"===e){let e="u">typeof globalThis&&"process"in globalThis?globalThis.process?.env?.NODE_ENV:void 0;return eZ||"production"===e||(eZ=!0,console.warn("[c15t] `mode: 'c15t'` is deprecated and will be removed in a future major release. Use `mode: 'hosted'` instead.")),eQ}return"offline"===e||"custom"===e?e:eQ}function e1(e){return void 0!==e.offlinePolicy?e.offlinePolicy:e.store?.offlinePolicy}let e5=new Map;function e8(e){let t,n=function(e){var t;let n=e0(e.mode),o=e1(e),i=(t=e.storageConfig)?Object.keys(t).sort().map(e=>{let n=t[e];return null==n?`${e}:null`:`${e}:${String(n)}`}).join("|"):"",r=i?`:storage:${i}`:"";if("offline"===n){let t=e.store?.initialTranslationConfig?.translations,n=e.store?.initialTranslationConfig?.defaultLanguage,i="";i=t?`:translations:${Object.keys(t).sort().join(",")}`:"";let s="";s=n?`:default-language:${n}`:"";let l=e.store?.iab,c="";c=l?.enabled?":iab:enabled":"";let d="";return o&&(d=`:policy:${a(o)}`),`offline${r}${i}${s}${c}${d}`}if("custom"===n){let t=Object.keys(("endpointHandlers"in e?e.endpointHandlers:void 0)||{}).sort().join(",");return`custom:${t}${r}`}let s="";if("headers"in e&&e.headers){let t=Object.keys(e.headers).sort();s=`:headers:${t.map(t=>`${t}=${e.headers?.[t]}`).join(",")}`}return`hosted:${e.backendURL||""}${s}${r}`}(e);if(e5.has(n)){if("offline"!==e.mode&&"custom"!==e.mode&&"headers"in e&&e.headers){let t=e5.get(n);t instanceof ez&&(t.headers={"Content-Type":"application/json",...e.headers})}let t=e5.get(n);if(t)return new Proxy(t,{get:(e,t)=>e[t]})}let o=e0(e.mode);
3switch(o){case"custom":t=new Q({endpointHandlers:e.endpointHandlers});break;case"offline":{let n=e.store?.iab,o=e1(e);t=new eY(e.storageConfig,e.store?.initialTranslationConfig,n?{enabled:n.enabled,vendorIds:n.vendors,gvl:n.gvl,_module:n._module}:void 0,o);break}case"hosted":{let n=e.store?.iab;t=new ez({backendURL:e.backendURL||"/api/c15t",headers:e.headers,customFetch:e.customFetch,retryConfig:e.retryConfig,storageConfig:e.storageConfig,iabConfig:n?{enabled:n.enabled,vendorIds:n.vendors,gvl:n.gvl,_module:n._module}:void 0});break}default:t=function(e){throw Error(`Unsupported client mode: ${String(e)}`)}(o)}return e5.set(n,t),t}let e2="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";function e6(){let e=crypto.getRandomValues(new Uint8Array(20)),t=Date.now()-17e11,n=Math.floor(t/0x100000000),o=t>>>0;return e[0]=n>>>24&255,e[1]=n>>>16&255,e[2]=n>>>8&255,e[3]=255&n,e[4]=o>>>24&255,e[5]=o>>>16&255,e[6]=o>>>8&255,e[7]=255&o,`sub_${function(e){let t=BigInt(58),n=BigInt(0);for(let t of e)n=n*BigInt(256)+BigInt(t);let o=[];for(;n>0;){let e=n%t;o.unshift(e2.charAt(Number(e))),n/=t}for(let t of e)if(0===t)o.unshift(e2.charAt(0));else break;return o.join("")||e2.charAt(0)}(e)}`}function e3(e){return eb.includes(e)}function e4(e,t){if(!t||0===t.length||t.includes("*"))return e;let n=new Set(["necessary",...t]),o={};for(let[t,i]of Object.entries(e))o[t]=!!n.has(t)&&i;return o}function e7(e,t){let n=Array.from(new Set(e));if(!t||0===t.length||t.includes("*"))return n;let o=new Set(["necessary",...t.filter(e3)]),i=n.filter(e=>o.has(e));return i.includes("necessary")||i.unshift("necessary"),i}function e9(e,t="permissive"){return"strict"===t&&Array.isArray(e)&&e.length>0&&!e.includes("*")}function te(e,t){if(0===e.length)throw TypeError(`${t} condition cannot be empty`)}function tt(e,t,n){return function e(t,n){if("string"==typeof t){var o,i;if(!(t in n))throw Error(`Consent category "${t}" not found in consent state`);return n[t]||!1}if("object"==typeof t&&null!==t){if("and"in t){let i;return o=t.and,te(i=Array.isArray(o)?o:[o],"AND"),i.every(t=>e(t,n))}if("or"in t){let o;return i=t.or,te(o=Array.isArray(i)?i:[i],"OR"),o.some(t=>e(t,n))}if("not"in t)return!e(t.not,n)}throw TypeError(`Invalid condition structure: ${JSON.stringify(t)}`)}(e,n?function(e,t,n="permissive"){return e}(t,n.policyCategories,n.policyScopeMode):t)}function tn(e){let t=new Set;return!function e(n){"string"==typeof n?t.add(n):"object"==typeof n&&null!==n&&("and"in n?(Array.isArray(n.and)?n.and:[n.and]).forEach(e):"or"in n?(Array.isArray(n.or)?n.or:[n.or]).forEach(e):"not"in n&&e(n.not))}(e),Array.from(t)}function to(e,t){let n=e.getAttribute("data-src"),o=function(e){let t=e.getAttribute("data-category");if(t){if(!eb.includes(t))throw Error(`Invalid category attribute "${t}" on iframe. Must be one of: ${eb.join(", ")}`);return t}}(e);!o||(tt(o,t)?n&&!e.src&&(e.src=n,e.removeAttribute("data-src")):e.src&&e.removeAttribute("src"))}function ti(){if("u"<typeof document)return[];let e=document.querySelectorAll("iframe[data-category]"),t=new Set;return e?(e.forEach(e=>{let n=e.getAttribute("data-category");if(!n)return;let o=n.trim();eb.includes(o)&&t.add(o)}),Array.from(t)):[]}function tr(e){if("u"<typeof document)return;let t=document.querySelectorAll("iframe");t&&t.forEach(t=>{to(t,e)})}let ta=["reject","accept","customize"];function ts(e){return e&&0!==e.length?[...new Set(e)]:[]}function tl(e){let t=ts(e.allowedActions);if(0===t.length)return[];if(!e.layout||0===e.layout.length)return[[...t]];let n=new Set(t),o=[],i=new Set;for(let t of e.layout){let e=ts(Array.isArray(t)?t:[t]).filter(e=>!(!n.has(e)||i.has(e))&&(i.add(e),!0));e.length>0&&o.push(e)}return o.length>0?o:[[...t]]}function tc(){if("u"<typeof window)return!1;try{let e=window.navigator.globalPrivacyControl;return!0===e||"1"===e}catch{return!1}}let td=/^https?:\/\//;function tu(e){let t=e.toString();return t.endsWith("/")?t.slice(0,-1):t}function tf(e){let t=function(e){try{let t="/"===e?e:e.endsWith("/")?e.slice(0,-1):e;if(td.test(t))return tu(new URL(t));if(!t.startsWith("/"))return;return tu(new URL(t,window.location.origin))}catch{return}}(e.backendURL);if(!t)return;let n=tc();return{backendURL:t,country:e.overrides?.country,region:e.overrides?.region,language:e.overrides?.language,gpc:e.overrides?.gpc??("boolean"==typeof n&&n),credentials:e.credentials??"include"}}function tp(e,t){return e.backendURL===t.backendURL&&e.gpc===t.gpc&&(void 0===t.country||e.country===t.country)&&(void 0===t.region||e.region===t.region)&&(void 0===t.language||e.language===t.language)&&(void 0===e.credentials||e.credentials===t.credentials)}let tg="__c15tScriptDebugListeners",ty=null;function tm(){if("u">typeof crypto&&crypto.randomUUID)return crypto.randomUUID().replace(/-/g,"").substring(0,8);if("u">typeof crypto&&crypto.getRandomValues){let e=new Uint8Array(4);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(36)).join("").padEnd(8,"0").substring(0,8)}return Math.random().toString(36).substring(2).padEnd(8,"0").substring(0,8)}function th(e,t,n){return t?(n[e]||(n[e]=tm()),n[e]):`c15t-script-${e}`}let tb=new Map;function tw(e){return tb.has(e)}function tC(e){tb.delete(e)}function tv(e,t,n){if(n?.model==="iab"&&n.iabConsent&&(void 0!==e.vendorId||e.iabPurposes||e.iabLegIntPurposes||e.iabSpecialFeatures)){var o=n.iabConsent;if(void 0!==e.vendorId){let t=String(e.vendorId);if(!o.vendorConsents[t])return!1}return(!e.iabPurposes||!(e.iabPurposes.length>0)||!!e.iabPurposes.every(e=>!0===o.purposeConsents[e]))&&(!e.iabLegIntPurposes||!(e.iabLegIntPurposes.length>0)||!!e.iabLegIntPurposes.every(e=>!0===o.purposeLegitimateInterests[e]))&&(!e.iabSpecialFeatures||!(e.iabSpecialFeatures.length>0)||!!e.iabSpecialFeatures.every(e=>!0===o.specialFeatureOptIns[e]))&&!0}return tt(e.category,t)}function tS(e,t,n,o,i){var r={source:"script-loader",scope:"lifecycle",action:t,message:n,scriptId:e.id,elementId:o?.elementId,hasConsent:o?.hasConsent,callback:function(e,t){if("callback_start"===e||"callback_complete"===e||"callback_error"===e)return t?.callback}(t,i),data:i};let a={...r,timestamp:Date.now()};for(let e of function(){if("u"<typeof window)return ty||(ty=new Set),ty;let e=window,t=e[tg];if(t)return t;let n=new Set;return e[tg]=n,n}())try{e(a)}catch(e){console.error("Failed to handle c15t script debug event listener",e)}}function tk(e,t,n,o){if(n){tS(e,"callback_start",`${t} started`,o,{callback:t});try{n(o),tS(e,"callback_complete",`${t} completed`,o,{callback:t})}catch(n){throw tS(e,"callback_error",`${t} failed`,o,{callback:t,error:n instanceof Error?n.message:"string"==typeof n?n:"Unknown error"}),n}}}function tI(e,t,n={},o){let i=[];
3return e.forEach(e=>{var r,a,s;let l=tv(e,t,o);if(!e.alwaysLoad&&!l)return void tS(e,"skipped","Script skipped due to missing consent",{hasConsent:l},{reason:"missing_consent"});if(tw(e.id)){let o={id:e.id,elementId:th(e.id,!1!==e.anonymizeId,n),hasConsent:l,consents:t};tS(e,"already_loaded","Script already loaded; running consent sync",o),tk(e,"onConsentChange",e.onConsentChange,o);return}if(e.src&&e.textContent)throw Error(`Script '${e.id}' cannot have both 'src' and 'textContent'. Choose one.`);if(!e.src&&!e.textContent&&!e.callbackOnly)throw Error(`Script '${e.id}' must have either 'src', 'textContent', or 'callbackOnly' set to true.`);if(!0===e.callbackOnly){let o=!1!==e.anonymizeId,a=th(e.id,o,n),s={id:e.id,elementId:a,consents:t,hasConsent:l};tk(e,"onBeforeLoad",e.onBeforeLoad,s),tk(e,"onLoad",e.onLoad,s),r=e.id,tb.set(r,null),i.push(e.id),tS(e,"loaded","Callback-only script marked as loaded",s,{callbackOnly:!0});return}let c=!1!==e.anonymizeId,d=th(e.id,c,n);if(!0===e.persistAfterConsentRevoked){let n=document.getElementById(d);if(n){let o={id:e.id,hasConsent:l,elementId:d,consents:t,element:n};tS(e,"already_loaded","Persisted script element already exists; reusing it",o,{reason:"persisted_element"}),tk(e,"onConsentChange",e.onConsentChange,o),tk(e,"onLoad",e.onLoad,o),a=e.id,tb.set(a,n),i.push(e.id),tS(e,"loaded","Existing script element marked as loaded",o,{reusedElement:!0});return}}let u=document.createElement("script");u.id=d,e.src?u.src=e.src:e.textContent&&(u.textContent=e.textContent),e.fetchPriority&&(u.fetchPriority=e.fetchPriority),e.async&&(u.async=!0),e.defer&&(u.defer=!0),e.nonce&&(u.nonce=e.nonce),e.attributes&&Object.entries(e.attributes).forEach(([e,t])=>{u.setAttribute(e,t)});let f={id:e.id,hasConsent:l,elementId:d,consents:t,element:u};e.onLoad&&(e.textContent?setTimeout(()=>{tk(e,"onLoad",e.onLoad,{...f})},0):(tS(e,"load_listener_attached","Attached load listener",f),u.addEventListener("load",()=>{tk(e,"onLoad",e.onLoad,{...f})}))),e.onError&&(e.textContent||(tS(e,"error_listener_attached","Attached error listener",f),u.addEventListener("error",()=>{tk(e,"onError",e.onError,{...f,error:Error(`Failed to load script: ${e.src}`)})}))),tk(e,"onBeforeLoad",e.onBeforeLoad,f);let p=e.target??"head",g="body"===p?document.body:document.head;if(!g)throw Error(`Document ${p} is not available for script injection`);g.appendChild(u),tS(e,"element_appended",`Script element appended to ${p}`,f,{target:p}),s=e.id,tb.set(s,u),i.push(e.id),tS(e,"loaded","Script marked as loaded",f)}),i}let tx="c15t:pending-consent-sync";function tP(e,t,n){let o=new Set(t),i=[],r=[];for(let t of n)o.has(t.name)&&(e[t.name]?i.push(t.name):r.push(t.name));return{allowedCategories:i,deniedCategories:r}}async function tA({manager:e,type:t,get:n,set:o,options:i,emitConsentChanged:r}){let{callbacks:a,selectedConsents:s,consents:l,consentTypes:d,updateScripts:u,updateIframeConsents:f,updateNetworkBlockerConsents:p,consentCategories:g,locationInfo:y,model:m,consentInfo:h,reloadOnConsentRevoked:b,lastBannerFetchData:w}=n(),C={...l},v={...s??l??{}},S=Date.now();if("all"===t)for(let e of d)g.includes(e.name)&&(v[e.name]=!0);else if("necessary"===t)for(let e of d)v[e.name]=!0===e.disabled&&e.defaultValue;let k=w?.policy,I=k?.consent?.categories,x=e9(I,k?.consent?.scopeMode??null),P=x?e4(v,I):v,A=x?function(e,t){if(!t||0===t.length||t.includes("*"))return e;let n=new Set(["necessary",...t]),o={};for(let[t,i]of Object.entries(e))n.has(t)&&(o[t]=i);return o}(P,I):P,L=d.some(e=>C[e.name]!==P[e.name]),E=tP(P,g,d),D=tP(C,g,d),R=L?{preferences:P,previousPreferences:C,allowedCategories:E.allowedCategories,deniedCategories:E.deniedCategories,previousAllowedCategories:D.allowedCategories,previousDeniedCategories:D.deniedCategories}:null,j=w?.policy?await c(w.policy):void 0,$=h?.subjectId;$||($=e6());let T=ek({externalId:n().consentInfo?.externalId,identityProvider:n().consentInfo?.identityProvider}),O=ek({externalId:n().user?.id,identityProvider:n().user?.identityProvider}),U=T.externalId??O.externalId,B=T.identityProvider??O.identityProvider,_={time:S,subjectId:$,materialPolicyFingerprint:j,...U?{externalId:U}:{}
3,...B?{identityProvider:B}:{}},N=function(e,t,n,o,i){if(!o||null===n)return!1;let r=new Set(i.filter(e=>e.disabled).map(e=>e.name));return Object.entries(t).some(([t,n])=>!r.has(t)&&!0===e[t]&&!1===n)}(C,P,h,b,d);if(o({consents:P,selectedConsents:P,activeUI:"none",consentInfo:_}),ex({consents:P,consentInfo:_},void 0,n().storageConfig),N){let e={type:t,subjectId:$,preferences:A,givenAt:S,jurisdiction:y?.jurisdiction??void 0,jurisdictionModel:m,domain:window.location.hostname,uiSource:i?.uiSource??"api",policySnapshotToken:w?.policySnapshotToken,...U?{externalId:U}:{},...B?{identityProvider:B}:{}};try{localStorage.setItem(tx,JSON.stringify(e))}catch{}a.onConsentSet?.({preferences:P}),R&&r?.(R),a.onBeforeConsentRevocationReload?.({preferences:P}),window.location.reload();return}await new Promise(e=>setTimeout(e,0)),f(),u(),p(),a.onConsentSet?.({preferences:P}),R&&r?.(R);let F=await e.setConsent({body:{type:"cookie_banner",domain:window.location.hostname,preferences:A,subjectId:$,jurisdiction:y?.jurisdiction??void 0,jurisdictionModel:m??void 0,givenAt:S,uiSource:i?.uiSource??"api",consentAction:t,policySnapshotToken:w?.policySnapshotToken,...U?{externalSubjectId:U}:{},...B?{identityProvider:B}:{}}});if(!F.ok){let e=F.error?.message??"Failed to save consents";a.onError?.({error:e}),a.onError||console.error(e)}}function tL(e,t,n,o,i,r){let a="none"===o?null:o??(null==e||"NONE"===e?null:t&&["UK_GDPR","GDPR"].includes(e)?"iab":["UK_GDPR","GDPR","CH","BR","APPI","PIPA","QC_LAW25"].includes(e)?"opt-in":["CCPA","AU","PIPEDA"].includes(e)?"opt-out":"opt-in"),s=!!(void 0===r||r)&&(void 0!==i?i:tc());return{consentModel:a,autoGrantedConsents:(null===a||"opt-out"===a)&&null===n?{necessary:!0,functionality:!0,experience:!0,marketing:!s,measurement:!s}:null}}async function tE(e,t,n,o,i){let{set:r,get:a}=t,s=a(),l=e.policy?await c(e.policy):void 0;if(s.consentInfo&&l){let e=s.consentInfo.materialPolicyFingerprint;if(e&&e!==l){let e=s.consentTypes.reduce((e,t)=>(e[t.name]=t.defaultValue,e),{});eL(void 0,s.storageConfig),r({consents:e,selectedConsents:e,consentInfo:null})}else if(!e){let e={...s.consentInfo,materialPolicyFingerprint:l};ex({consents:s.consents,consentInfo:e},void 0,s.storageConfig),r({consentInfo:e})}}let{consentInfo:d}=a(),u=a().iab;if(t.iabConfig&&!u){let e=t.iabConfig._module;e?(u=e.createIABManager(t.iabConfig,a,r,t.manager),r({iab:u})):console.error('[c15t] IAB config provided without IAB module. Install @c15t/iab and use the iab() wrapper: `import { iab } from "@c15t/iab"; iab({ cmpId: ... })`')}let f=u?.config.enabled&&!o,p=u?.config.enabled&&!f;f&&console.warn("IAB mode disabled: Server returned 200 without GVL. Client IAB settings overridden.");let{consentModel:g,autoGrantedConsents:y}=tL(e.jurisdiction??null,p,d,e.policy?.model,a().overrides?.gpc,e.policy?.consent?.gpc),m=function(e,t,n,o){let{get:i,initialTranslationConfig:r}=t,{consentInfo:a,consentTypes:s}=i(),{translations:l,location:c}=e,{consentModel:d,autoGrantedConsents:u}=tL(e.jurisdiction??null,n,a,e.policy?.model,t.get().overrides?.gpc,e.policy?.consent?.gpc),f={model:d,isLoadingConsentInfo:!1,branding:e.branding??"c15t",hasFetchedBanner:!0,lastBannerFetchData:e,locationInfo:{countryCode:c?.countryCode??null,regionCode:c?.regionCode??null,jurisdiction:e.jurisdiction??null},policyBanner:{allowedActions:e.policy?.ui?.banner?.allowedActions,primaryActions:e.policy?.ui?.banner?.primaryActions,layout:e.policy?.ui?.banner?.layout,direction:e.policy?.ui?.banner?.direction,uiProfile:e.policy?.ui?.banner?.uiProfile,scrollLock:e.policy?.ui?.banner?.scrollLock},policyDialog:{allowedActions:e.policy?.ui?.dialog?.allowedActions,primaryActions:e.policy?.ui?.dialog?.primaryActions,layout:e.policy?.ui?.dialog?.layout,direction:e.policy?.ui?.dialog?.direction,uiProfile:e.policy?.ui?.dialog?.uiProfile,scrollLock:e.policy?.ui?.dialog?.scrollLock},policyCategories:e.policy?.consent?.categories??null,policyScopeMode:e.policy?.consent?.scopeMode??null,initDataSource:o?.initDataSource??null,initDataSourceDetail:o?.initDataSourceDetail??null};null===a&&(e.policy?.ui?.mode?f.activeUI=e.policy.ui.mode:f.activeUI=d?"banner":"none"),u&&(f.consents=u,f.selectedConsents=u);let p=e.policy?.consent?.categories,g=e9(p,e.policy?.consent?.scopeMode??null);if(g){let e=e7(eb,p);f.consentCategories=e,f.consents=e4(f.consents??i().consents,e),f.selectedConsents=e4(f.selectedConsents??i().selectedConsents,e)}let y=e.policy?.consent?.preselectedCategories;if(null===a&&!u&&Array.isArray(y)&&y.length>0){let e=f.consentCategories??i().consentCategories,t=g?e7(e,p):e,n=new Set(e7(t,y)),o=f.selectedConsents??i().selectedConsents;f.selectedConsents=s.length>0?s.reduce((e,t)=>
3(e[t.name]=!0===t.disabled?t.defaultValue:n.has(t.name),e),{}):Object.fromEntries(Object.keys(o).map(e=>[e,"necessary"===e||n.has(e)]))}if(l?.language&&l?.translations){let e,t,n,o;e=r?.translations?{translations:r.translations}:void 0,n=!(t=function(e,t){let n=M(e),o=t?M(t):void 0,i={en:B};for(let e of[n.messages,o?.messages])if(e)for(let[t,n]of Object.entries(e)){if(!n)continue;let e=i[t]||i.en;i[t]=N(e,n)}return q({messages:i,locale:o?.locale??n.locale,detectBrowserLanguage:o?.detectBrowserLanguage??n.detectBrowserLanguage})}({translations:{[l.language]:l.translations},disableAutoLanguageSwitch:!0,defaultLanguage:l.language},e)).disableAutoLanguageSwitch,o=function(e,t,n=!1){if(n||"u"<typeof window)return t||"en";let o=window.navigator.language?.split("-")[0]||"";return o&&o in e?o:t||"en"}(t.translations,t.defaultLanguage,!n),f.translationConfig={...t,defaultLanguage:o}}return f}(e,t,p,i);if(f&&u?m.iab={...u,config:{...u.config,enabled:!1}}:u&&null!=e.cmpId&&(m.iab={...u,config:{...u.config,cmpId:e.cmpId}}),r(m),!function(e,t,n){let{get:o}=t,{callbacks:i}=o(),{translations:r}=e;n&&i?.onConsentSet?.({preferences:n}),r?.language&&r?.translations&&i?.onBannerFetched?.({jurisdiction:e.jurisdiction,location:e.location,translations:{language:r.language,translations:r.translations}})}(e,t,y),a().updateScripts(),p&&"iab"===g&&u){let n=e.customVendors??[],i=u.config.customVendors??[],s=new Set(n.map(e=>e.id)),l=[...n,...i.filter(e=>!s.has(e.id))],c={...u.config,customVendors:l,...null!=e.cmpId&&{cmpId:e.cmpId}},d=t.iabConfig?._module;d&&d.initializeIABMode(c,{set:r,get:a},o).catch(e=>{console.error("Failed to initialize IAB mode in updateStore:",e)})}}async function tD(e){let{get:t,set:n,manager:o}=e,{callbacks:i}=t();if("u"<typeof window)return;let r=function(e){try{if(window.localStorage)return window.localStorage.setItem("c15t-storage-test-key","test"),window.localStorage.removeItem("c15t-storage-test-key"),!0}catch(t){console.warn("localStorage not available, skipping consent banner:",t),e({isLoadingConsentInfo:!1,activeUI:"none"})}return!1}(n);if(!r)return;n({isLoadingConsentInfo:!0}),function(e,t){try{let n=localStorage.getItem(tx);if(!n)return;localStorage.removeItem(tx);let o=JSON.parse(n),{externalId:i,identityProvider:r}=ek({externalId:o.externalId,identityProvider:o.identityProvider});e.setConsent({body:{type:"cookie_banner",domain:o.domain,preferences:o.preferences,subjectId:o.subjectId,jurisdiction:o.jurisdiction,jurisdictionModel:o.jurisdictionModel??void 0,givenAt:o.givenAt,uiSource:o.uiSource??"api",policySnapshotToken:o.policySnapshotToken,...i?{externalSubjectId:i}:{},...r?{identityProvider:r}:{}}}).then(e=>{if(!e.ok){let n=e.error?.message??"Failed to sync consent after reload";t.onError?.({error:n}),t.onError||console.error("Failed to sync consent after reload:",n)}}).catch(e=>{let n=e instanceof Error?e.message:"Failed to sync consent after reload";t.onError?.({error:n}),t.onError||console.error("Failed to sync consent after reload:",e)})}catch{}}(o,i);let a=await tR(e);return a||tj(e,r,o,i)}async function tR(e){let{ssrData:t,set:n}=e;if(!t)return void n({ssrDataUsed:!1,ssrSkippedReason:"no_data"});let o=await t;if(o?.init&&!function(e,t){let n=t.metadata?.requestContext;if(!n||!e.backendURL)return!0;let o=tf({backendURL:e.backendURL,overrides:e.get().overrides,credentials:e.requestCredentials});return!o||tp(n,o)}(e,o))return void n({ssrDataUsed:!1,ssrSkippedReason:"context_mismatch"});if(o?.init){var i;let t,r,a,s,l=(i=o,t=i.metadata?.cache,r=i.metadata?.requestDurationMs,a=["via=ssr"],t?.detail&&a.push(t.detail),"number"==typeof r&&Number.isFinite(r)&&a.push(`duration=${Math.max(0,Math.round(r))}ms`),s=a.length>0?a.join(", "):null,t?.isHit===!0?{initDataSource:"backend-cache-hit",initDataSourceDetail:s}:t?{initDataSource:"backend",initDataSourceDetail:s}:{initDataSource:"ssr",initDataSourceDetail:s});return await tE(o.init,e,!0,o.gvl,{initDataSource:l.initDataSource,initDataSourceDetail:l.initDataSourceDetail}),n({ssrDataUsed:!0,ssrSkippedReason:null}),o.init}n({ssrDataUsed:!1,ssrSkippedReason:"fetch_failed"})}
3async function tj(e,t,n,o){let{set:i,get:r}=e;try{let{language:i,country:a,region:s}=e.get().overrides??{},l=await n.init({headers:{...i&&{"accept-language":i},...a&&{"x-c15t-country":a},...s&&{"x-c15t-region":s}},onError:o.onError?e=>{o.onError?.({error:e.error?.message||"Unknown error"})}:void 0}),{data:c,error:d}=l;if(d||!c)throw Error(`Failed to fetch consent banner info: ${d?.message}`);let u=function(e,t){let n=e?.response??null;if(n){let e=function(e){let t=null,n=!1;for(let o of["x-vercel-cache","cf-cache-status","x-cache","cache-status"]){let i=e.get(o);if(i){t=`${o}=${i}`,n=/\b(hit|stale|revalidated|updating)\b/i.test(i);break}}let o=e.get("age"),i=o?Number.parseInt(o,10):NaN,r=Number.isFinite(i)&&i>0,a=r?`age=${i}`:null;return{isCacheHit:n||r,detail:t&&a?`${t}, ${a}`:t??a}}(n.headers);return e.isCacheHit?{initDataSource:"backend-cache-hit",initDataSourceDetail:e.detail}:{initDataSource:"backend",initDataSourceDetail:e.detail}}return"offline"===t?{initDataSource:"offline-mode",initDataSourceDetail:null}:"custom"===t?{initDataSource:"custom",initDataSourceDetail:null}:"hosted"===t||"c15t"===t?{initDataSource:"offline-fallback",initDataSourceDetail:null}:{initDataSource:"backend",initDataSourceDetail:null}}(l,r().config.mode);return await tE(c,e,t,c.gvl??void 0,u),c}catch(t){console.error("Error fetching consent banner information:",t),i({isLoadingConsentInfo:!1,activeUI:"none"});let e=t instanceof Error?t.message:"Unknown error fetching consent banner information";o.onError?.({error:e});return}}function t$(e){return e?e.toUpperCase():"GET"}function tT(e,t,n){if(!n||!1===n.enabled||!n.rules||0===n.rules.length)return{shouldBlock:!1};let o=function(e){if(!e)return null;try{if("u"<typeof window)return null;return new URL(e,window.location.href)}catch{return null}}(e.url);if(!o)return{shouldBlock:!1};let i=t$(e.method);for(let e of n.rules)if(function(e,t,n){var o;return!!function(e,t){if(!e)return!1;let n=t.domain.trim().toLowerCase(),o=e.trim().toLowerCase();if(!n||!o)return!1;if(o===n)return!0;let i=`.${n}`;return o.endsWith(i)}(e.hostname,n)&&(o=e.pathname,!!("string"!=typeof n.pathIncludes||o&&o.includes(n.pathIncludes))&&!!function(e,t){if(!t.methods||0===t.methods.length)return!0;if(!e)return!1;let n=t$(e);return t.methods.some(e=>t$(e)===n)}(t,n))}(o,i,e)&&!tt(e.category,t))return{shouldBlock:!0,rule:e};return{shouldBlock:!1}}let tO=e=>{if("u"<typeof window)return null;try{return eA(e)}catch(e){return console.error("Failed to retrieve stored consent:",e),null}},tU="/api/c15t",tB=new Map,t_=new Map;function tN(e){return"offline"===e||"custom"===e?e:"hosted"}e.s(["clearConsentRuntimeCache",0,function(){tB.clear(),t_.clear(),e5.clear()},"defaultTranslationConfig",0,em,"getOrCreateConsentRuntime",0,function(e,t){var n,o;let i,{mode:r,backendURL:a,store:s,i18n:l,translations:c,storageConfig:d,enabled:u,iab:f,offlinePolicy:p,consentCategories:g,debug:y,headers:m,customFetch:h,retryConfig:b,endpointHandlers:w,...C}=e,{initialI18nConfig:v,initialTranslationConfig:S,ssrData:k,config:I,...x}=C,{initialI18nConfig:P,initialTranslationConfig:A,ssrData:L,config:E,...D}=s??{},R=H(c??s?.initialTranslationConfig,l??s?.initialI18nConfig),j=R?M(R):void 0,$=j?Object.keys(j.messages).sort():[],T=f??D.iab,O=p??D.offlinePolicy,U=d??D.storageConfig,B=u??D.enabled,_=a||tU,N=k??L,F=(i=!1===(n={mode:r,backendURL:a,endpointHandlers:"endpointHandlers"in e?e.endpointHandlers:void 0,storageConfig:U,defaultLanguage:j?.locale,languageSetKey:$.length>0?$.join(","):void 0,offlinePolicyKey:O?JSON.stringify(O):void 0,enabled:B}).enabled?"disabled":"enabled",[tN(n.mode),n.backendURL??"default",n.endpointHandlers?"custom":"none",n.storageConfig?.storageKey??"default",n.defaultLanguage??"default",n.languageSetKey??"default",n.offlinePolicyKey??"default",i].join(":")),q=tB.get(F);if(!q){let t={...D,initialTranslationConfig:R,iab:T,offlinePolicy:O};q="offline"===r?e8({mode:"offline",store:t,storageConfig:U}):"custom"===r&&"endpointHandlers"in e?e8({mode:"custom",endpointHandlers:e.endpointHandlers,store:t,storageConfig:U}):e8({mode:"c15t"===r?"c15t":"hosted",backendURL:a||tU,store:t,storageConfig:U}),tB.set(F,q)}let z=t_.get(F);if(!z){let n=tN(r),i=E??I,a="hosted"!==n||"u"<typeof window||N?void 0:(o={backendURL:_,overrides:e.overrides,credentials:"include"},function(e){let t=function(){if(!("u"<typeof window))return window}
3();if(!t)return;let n=tf({backendURL:e.backendURL,overrides:e.overrides,credentials:e.credentials});if(!n)return;let o=Object.values(t.__c15tInitialDataPromises??{}).filter(e=>{let t=e.requestContext;return!!t&&tp(t,n)});return 1===o.length?o[0]:void 0}(o)?.promise);z=((e,t={})=>{let n,{namespace:o="c15tStore",iab:i,ssrData:r,initialConsentCategories:a,initialTranslationConfig:s,initialI18nConfig:l,enabled:c,debug:d,...u}=t,f=s||l?H(s,l):void 0;er=ei(!0===t.debug);let p=tO(t.storageConfig),g=new Set,y=(n=(n,r)=>{let s,l,c,d,y,m,h,b,w,C,v,S;return{...ev,...u,namespace:o,iab:null,...a&&{consentCategories:a},...p?{consents:p.consents,selectedConsents:p.consents,consentInfo:p.consentInfo,user:p.consentInfo?.externalId?{id:p.consentInfo.externalId,identityProvider:p.consentInfo.identityProvider}:void 0,activeUI:"none",isLoadingConsentInfo:!1}:{activeUI:"none",isLoadingConsentInfo:!0},setActiveUI:(e,t={})=>{if("none"===e||"dialog"===e)return void n({activeUI:e});if(t.force)return void n({activeUI:"banner"});let o=r();tO()||o.consentInfo||o.isLoadingConsentInfo||n({activeUI:"banner"})},setSelectedConsent:(e,t)=>{n(n=>{let o=n.consentTypes.find(t=>t.name===e);return o?.disabled?n:{selectedConsents:{...n.selectedConsents,[e]:t}}})},saveConsents:async(t,o)=>await tA({manager:e,type:t,get:r,set:n,options:o,emitConsentChanged:e=>{for(let t of(r().callbacks.onConsentChanged?.(e),g))t(e)}}),setConsent:(e,t)=>{n(n=>{let o=n.consentTypes.find(t=>t.name===e);return o?.disabled?n:{selectedConsents:{...n.consents,[e]:t}}}),r().saveConsents("custom")},resetConsents:()=>{n(()=>{let e=eh.reduce((e,t)=>(e[t.name]=t.defaultValue,e),{});return eL(void 0,t.storageConfig),{consents:e,selectedConsents:e,consentInfo:null}})},setConsentCategories:e=>n(()=>{let{policyCategories:t,policyScopeMode:n}=r();return e9(t,n)?{consentCategories:e7(e,t)}:{consentCategories:Array.from(new Set(e))}}),setCallback:(e,t)=>{let o=r();if(n(n=>({callbacks:{...n.callbacks,[e]:t}})),"onConsentSet"===e&&t&&"function"==typeof t&&t?.({preferences:o.consents}),"onBannerFetched"===e&&o.hasFetchedBanner&&o.lastBannerFetchData&&t&&"function"==typeof t){let{lastBannerFetchData:e}=o,n=e.jurisdiction??"NONE";t?.({jurisdiction:{code:n,message:""},location:{countryCode:e.location.countryCode??null,regionCode:e.location.regionCode??null},translations:{language:e.translations.language,translations:e.translations.translations}})}},subscribeToConsentChanges:e=>(g.add(e),()=>{g.delete(e)}),setLocationInfo:e=>n({locationInfo:e}),initConsentManager:()=>tD({manager:e,ssrData:t.ssrData,backendURL:t.__internal?.backendURL,requestCredentials:t.__internal?.requestCredentials,initialTranslationConfig:f,iabConfig:i,get:r,set:n}),getDisplayedConsents:()=>{let{consentCategories:e,consentTypes:t}=r();return t.filter(t=>e.includes(t.name))},hasConsented:()=>{let{consentInfo:e}=r();return null!=e},has:e=>{let{consents:t,policyCategories:n,policyScopeMode:o}=r();return tt(e,t,{policyCategories:n,policyScopeMode:o})},setTranslationConfig:e=>{n({translationConfig:e})},updateConsentCategories:e=>{let{consentCategories:t,policyCategories:o,policyScopeMode:i}=r(),a=new Set([...t,...e]);n({consentCategories:e9(o,i)?e7(Array.from(a),o):Array.from(a)})},identifyUser:async t=>{let o=r().consentInfo,i=o?.subjectId;n({user:t}),i&&(String(o?.externalId)!==String(t.id)||o?.identityProvider!==t.identityProvider)&&(await e.identifyUser({body:{subjectId:i,externalId:t.id,identityProvider:t.identityProvider}}),n({consentInfo:{...o,time:o?.time||Date.now(),subjectId:i,externalId:t.id,identityProvider:t.identityProvider}}))},unstable_acceptPolicyConsent:async t=>{let o=r(),i=o.consentInfo,a=i?.subjectId??e6(),s=ek({externalId:i?.externalId,identityProvider:i?.identityProvider}),l=ek({externalId:o.user?.id,identityProvider:o.user?.identityProvider}),c=ek({externalId:t.externalId,identityProvider:t.identityProvider}),d=c.externalId??s.externalId??l.externalId,u=c.identityProvider??s.identityProvider??l.identityProvider,f=t.givenAt??Date.now(),p=t.domain??("u">typeof window?window.location.hostname:"localhost"),g="privacy_policy"===t.type||"terms_and_conditions"===t.type||"dpa"===t.type,y={};if(g)if(t.documentSnapshotToken)y={documentSnapshotToken:t.documentSnapshotToken};else if(t.policyHash)y={policyHash:t.policyHash};else if(t.policyId)y={policyId:t.policyId};else throw Error("Legal document consent requires documentSnapshotToken, policyHash, or policyId.");let m=await e.setConsent({body:{type:t.type,subjectId:a,domain:p,givenAt:f,uiSource:t.uiSource??"api",...y,...t.metadata?{metadata:t.metadata}:{},...t.preferences?{preferences:t.preferences}:{},...d?{externalSubjectId:d}:{}
3,...u?{identityProvider:u}:{}}});if(!m.ok||!m.data){let e=m.error?.message??"Failed to accept policy consent";r().callbacks.onError?.({error:e});let t=Error(e);throw t.code=m.error?.code,t.details=m.error?.details??null,t.status=m.error?.status,t}let h={...m.data,givenAt:m.data.givenAt instanceof Date?m.data.givenAt:new Date(m.data.givenAt)},b=r(),w={...b.consentInfo,time:f,subjectId:a,...d?{externalId:d}:{},...u?{identityProvider:u}:{}};return n({consentInfo:w,...d?{user:{id:d,identityProvider:u}}:{}}),ex({consents:b.consents,consentInfo:w},void 0,b.storageConfig),h},setOverrides:async o=>(n({overrides:{...r().overrides,...o}}),await tD({manager:e,backendURL:t.__internal?.backendURL,requestCredentials:t.__internal?.requestCredentials,initialTranslationConfig:f,get:r,set:n})),setLanguage:async e=>await r().setOverrides({...r().overrides??{},language:e}),...(s=()=>{let{scripts:e,consents:t,scriptIdMap:o,model:i,iab:a,policyCategories:s,policyScopeMode:l}=r(),c=a?.config.enabled?{vendorConsents:a.vendorConsents,vendorLegitimateInterests:a.vendorLegitimateInterests,purposeConsents:a.purposeConsents,purposeLegitimateInterests:a.purposeLegitimateInterests,specialFeatureOptIns:a.specialFeatureOptIns}:void 0,d=function(e,t,n={},o){let i=function(e,t,n={},o){let i=[];return e.forEach(e=>{let r=tv(e,t,o);if(tw(e.id)&&!e.alwaysLoad&&!r){var a;let o=(a=e.id,tb.get(a)),s={id:e.id,elementId:th(e.id,!1!==e.anonymizeId,n),hasConsent:r,consents:t,element:o&&null!==o?o:void 0};!0===e.callbackOnly||null===o?(tC(e.id),i.push(e.id),tS(e,"unloaded","Callback-only script marked as unloaded",s,{callbackOnly:!0})):o&&(e.persistAfterConsentRevoked?(tC(e.id),i.push(e.id),tS(e,"unloaded","Persistent script marked as unloaded without removing element",s,{removedElement:!1,persistAfterConsentRevoked:!0})):(o.remove(),tC(e.id),i.push(e.id),tS(e,"unloaded","Script element removed after consent revocation",s,{removedElement:!0})))}}),i}(e,t,n,o);return{loaded:tI(e,t,n,o),unloaded:i}}(e,function(e,t="permissive"){return e}(t,l),o,{model:i,iabConsent:c}),u={...r().loadedScripts};return d.loaded.forEach(e=>{u[e]=!0}),d.unloaded.forEach(e=>{u[e]=!1}),n({loadedScripts:u}),d},{updateScripts:()=>s(),setScripts:e=>{let t=r(),o={...t.scriptIdMap};e.forEach(e=>{!1!==e.anonymizeId&&(o[e.id]=tm())});let i=e.flatMap(e=>tn(e.category));n({scripts:[...t.scripts,...e],scriptIdMap:o}),r().updateConsentCategories(i),s()},removeScript:e=>{let t=r();if(tw(e)){let t=tb.get(e);t&&(t.remove(),tC(e))}let o={...t.scriptIdMap};delete o[e],n({scripts:t.scripts.filter(t=>t.id!==e),loadedScripts:{...t.loadedScripts,[e]:!1},scriptIdMap:o})},reloadScript:e=>{let t=r(),n=t.iab?.config.enabled?{vendorConsents:t.iab.vendorConsents,vendorLegitimateInterests:t.iab.vendorLegitimateInterests,purposeConsents:t.iab.purposeConsents,purposeLegitimateInterests:t.iab.purposeLegitimateInterests,specialFeatureOptIns:t.iab.specialFeatureOptIns}:void 0,o=function(e,t,n="permissive"){return e}(t.consents,t.policyCategories,t.policyScopeMode);return function(e,t,n,o={},i){let r=t.find(t=>t.id===e);if(!r)return!1;if(tw(e)){let t=tb.get(e);!0===r.callbackOnly||null===t?tC(e):t&&(r.persistAfterConsentRevoked||t.remove(),tC(e))}return r.alwaysLoad||tv(r,n,i)?(tI([r],n,o,i),!0):(tS(r,"skipped","Reload skipped due to missing consent",{hasConsent:!1,elementId:th(r.id,!1!==r.anonymizeId,o)},{reason:"reload_missing_consent"}),!1)}(e,t.scripts,o,t.scriptIdMap,{model:t.model,iabConsent:n})},isScriptLoaded:e=>tw(e),getLoadedScriptIds:()=>Array.from(tb.keys())}),...(l=null,c=!1,{initializeIframeBlocker:()=>{var e;let t;if(c||"u"<typeof document)return;let n=r(),o=function(e,t,n="permissive"){return e}(n.consents,n.policyCategories,n.policyScopeMode);if(n.iframeBlockerConfig?.disableAutomaticBlocking)return;let i=()=>{let e=ti();e.length>0&&r().updateConsentCategories(e)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",i):i(),setTimeout(i,100),tr(o),e=e=>r().updateConsentCategories(e),(t=new MutationObserver(t=>{let n=(()=>{let e=r();return function(e,t,n="permissive"){return e}(e.consents,e.policyCategories,e.policyScopeMode)})(),o=!1;
3if(t.forEach(e=>{e.addedNodes.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){e.tagName&&"IFRAME"===e.tagName.toUpperCase()&&(to(e,n),e.hasAttribute("data-category")&&(o=!0));let t=e.querySelectorAll?.("iframe");t&&t.length>0&&t.forEach(e=>{to(e,n),e.hasAttribute("data-category")&&(o=!0)})}})}),o&&e){let t=ti();t.length>0&&e(t)}})).observe(document.body,{childList:!0,subtree:!0}),l=t,c=!0},updateIframeConsents:()=>{if(!c||"u"<typeof document)return;let e=r(),{consents:t,iframeBlockerConfig:n}=e;n?.disableAutomaticBlocking||tr(function(e,t,n="permissive"){return e}(t,e.policyCategories,e.policyScopeMode))},destroyIframeBlocker:()=>{if(!c||"u"<typeof document)return;let{iframeBlockerConfig:e}=r();e?.disableAutomaticBlocking||(l&&(l.disconnect(),l=null),c=!1)}}),...(d=null,y=null,m=null,h=!1,b=null,w=(e,t)=>{if(e){if(!1!==e.logBlockedRequests){let e=t.rule?.id??"unknown";console.warn("[c15t] Network request blocked by consent manager",{method:t.method,url:t.url,ruleId:e})}e.onRequestBlocked&&e.onRequestBlocked(t)}},C=()=>b||r().consents,v=()=>{"u"<typeof window||"function"!=typeof window.fetch||d||(d=window.fetch,window.fetch=(e,t)=>{let n,o=r().networkBlocker;if(!d)throw Error("Network blocker fetch wrapper not initialized.");if(!(o?.enabled&&o?.rules&&o?.rules.length>0))return d.call(window,e,t);let i="GET";t?.method?i=t.method:e instanceof Request&&(i=e.method);let{shouldBlock:a,rule:s}=tT({url:n="string"==typeof e||e instanceof URL?e.toString():e.url,method:i},C(),o);return a?(w(o,{method:i,url:n,rule:s}),Promise.resolve(new Response(null,{status:451,statusText:"Request blocked by consent manager"}))):d.call(window,e,t)})},S=()=>{"u"<typeof window||void 0===window.XMLHttpRequest||"function"!=typeof window.XMLHttpRequest.prototype.open||"function"!=typeof window.XMLHttpRequest.prototype.send||y||m||(y=window.XMLHttpRequest.prototype.open,m=window.XMLHttpRequest.prototype.send,window.XMLHttpRequest.prototype.open=function(e,t,n,o,i){if(this.__c15tMethod=e,this.__c15tUrl=t,!y)throw Error("Network blocker XHR open wrapper not initialized.");return y.call(this,e,t,n??!0,o,i)},window.XMLHttpRequest.prototype.send=function(e){let t=r().networkBlocker;if(t?.enabled!==!1&&t?.rules&&t?.rules.length>0){let e=this.__c15tMethod||"GET",n=this.__c15tUrl||"",{shouldBlock:o,rule:i}=tT({url:n,method:e},C(),t);if(o){w(t,{method:e,url:n,rule:i});try{this.abort()}catch{}let o=new ProgressEvent("error");"function"==typeof this.onerror&&this.onerror(o),this.dispatchEvent(o);return}}if(!m)throw Error("Network blocker XHR send wrapper not initialized.");return m.call(this,e)})},{initializeNetworkBlocker:()=>{if(h||"u"<typeof window)return;let e=r(),t=e.networkBlocker;t?.enabled&&t?.rules&&t?.rules.length>0&&(b=e.consents,v(),S(),h=!0)},updateNetworkBlockerConsents:()=>{h&&(b=r().consents)},setNetworkBlocker:e=>{let t=e?.enabled!==!1&&e?.rules&&e?.rules.length>0;if(n({networkBlocker:e}),!t){if(!h||"u"<typeof window)return;d&&(window.fetch=d,d=null),y&&m&&(window.XMLHttpRequest.prototype.open=y,window.XMLHttpRequest.prototype.send=m,y=null,m=null),b=null,h=!1;return}h||(b=r().consents,v(),S(),h=!0)},destroyNetworkBlocker:()=>{!h||"u"<typeof window||(d&&(window.fetch=d,d=null),y&&m&&(window.XMLHttpRequest.prototype.open=y,window.XMLHttpRequest.prototype.send=m,y=null,m=null),b=null,h=!1)}})}})?V(n):V;return y.getState().initializeIframeBlocker(),t.networkBlocker&&(y.setState({networkBlocker:t.networkBlocker}),y.getState().initializeNetworkBlocker()),t.scripts&&t.scripts.length>0&&y.getState().updateConsentCategories(t.scripts.flatMap(e=>tn(e.category))),"u">typeof window&&(window[o]=y,y.getState().callbacks.onConsentSet?.({preferences:y.getState().consents}),t.user&&y.getState().identifyUser(t.user),y.getState().initConsentManager()),y})(q,{config:{...i??{},pkg:t?.pkg||"c15t",version:t?.version||"2.1.0",mode:n,meta:{...i?.meta??{},..."hosted"===n?{backendURL:_,requestCredentials:"include"}:{}}},...x,...D,iab:T,offlinePolicy:O,storageConfig:U,enabled:B,initialTranslationConfig:R,initialConsentCategories:g,ssrData:N??a,debug:y,__internal:"hosted"===n?{backendURL:_,requestCredentials:"include"}:void 0}),t_.set(F,z)}
3return{consentManager:q,consentStore:z,cacheKey:F}},"has",0,tt,"hasPolicyHints",0,function(e){return!!e&&Object.values(e).some(e=>Array.isArray(e)?e.length>0:void 0!==e)},"resolvePolicyActionGroups",0,tl,"resolvePolicyAllowedActions",0,function(e){let t=ts(e.allowedActions);return t.length>0?t:[...ta]},"resolvePolicyDirection",0,function(e){return"column"===e?"column":"row"},"resolvePolicyOrderedActions",0,function(e){var t;return(t=tl({allowedActions:e.allowedActions,layout:e.layout}))&&0!==t.length?t.flatMap(e=>Array.isArray(e)?e:[e]):[]},"resolvePolicyPrimaryActions",0,function(e){let t=e.orderedActions.includes("customize")?["customize"]:[];if(!e.primaryActions||0===e.primaryActions.length)return t;let n=e.primaryActions.filter(t=>e.orderedActions.includes(t));return n.length>0?n:t},"shouldFillPolicyActions",0,function(e){var t;let n="balanced"===(t=e.uiProfile)||"compact"===t||"strict"===t?t:"compact",o=new Set(e.actionGroups.flat()).size,i=e.actionGroups.length>1,r="column"===e.direction;return"strict"===n||"balanced"===n&&(o<=2||3===o&&(i||r))}],649919);var tF=e.i(745558);let tM=(0,tF.createContext)(void 0);e.s(["ConsentStateContext",0,tM],354038),e.s(["useConsentManager",0,function(){let e=(0,tF.useContext)(tM);if(void 0===e)throw Error("useConsentManager must be used within a ConsentManagerProvider");let{consents:t,consentInfo:n,consentCategories:o,consentTypes:i,policyCategories:r,policyScopeMode:a}=e.state,s=(0,tF.useRef)(e.store);s.current=e.store;let l=(0,tF.useCallback)(e=>tt(e,t,{policyCategories:r,policyScopeMode:a}),[t,r,a]),c=(0,tF.useCallback)(()=>null!=n,[n]),d=(0,tF.useCallback)(()=>i.filter(e=>o.includes(e.name)),[i,o]),u=(0,tF.useCallback)(e=>s.current.getState().subscribeToConsentChanges(e),[]);return{...e.state,has:l,hasConsented:c,getDisplayedConsents:d,subscribeToConsentChanges:u,manager:e.manager}}],897006)}]);
4
5//# debugId=e79b7c4f-879f-3791-6a6c-3b2f7ff9ee69

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.