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]="fac3f499-1f32-072f-27b3-82c039dc584b")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,122968,562955,673915,619639,e=>{"use strict";function t(){return{allowedActions:["accept","reject","customize"],layout:[["reject","accept"],"customize"],direction:"row",primaryActions:["customize"],uiProfile:"compact"}}function n(e){if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(e=>n(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)}:${n(t)}`).join(",")}}`}async function o(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 i(e)}function i(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("")}async function r(e){return o(n(e))}async function a(e){return r(e)}async function s(e){return r({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})}let l="default",c=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 d(e){if(!e)return;let t=e.split(",")[0]?.split(";")[0]?.trim().toLowerCase();if(t)return t.split("-")[0]??void 0}function u(e){if(e&&0!==e.length)return[...new Set(e)]}function f(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}function p(e){return e.trim().toUpperCase()}let g=new WeakMap;function y(e){return e.consent?.model??"opt-in"}function m(e){return"iab"===y(e)?["*"]:f(e.consent?.categories)}function h(e){return e.consent?.scopeMode??"permissive"}function b(e){return!!e&&Object.values(e).some(e=>Array.isArray(e)?e.length>0:void 0!==e)}function w(e){return(e.match.countries?.length??0)>0||(e.match.regions?.length??0)>0}function C(e,t){let n=e.id?.trim();return n?`'${n}'`:`at index ${t}`}function v(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 S(e){let t,n;if(!e)return;let o=u(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=u(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 k(e,t){let n,{errors:o}=(n=v(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||b(e.ui.banner)||b(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=C(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 ${C(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||w(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=C(r,i);for(let o of(r.match.isDefault&&w(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 I(e){var t,n,o;let i,r;try{(i=function(e){if(void 0===e)return;let t=v(e);if(!t.ok)throw Error(t.errors[0]);return t.output}(e.policies))&&i.length>0&&k(i,void 0===e.iabEnabled?void 0:{iabEnabled:e.iabEnabled})}catch{return}if(!i||0===i.length)return;let s=(t=e.countryCode)?t.toUpperCase():null,l=(n=e.regionCode)?(n.includes("-")?n.split("-").pop():n)?.toUpperCase().trim()??null:null,c=function(e){let{c
2ompiled:t,countryCode:n,regionCode:o}=e;if(n&&o){var i,r;let e=t.regions.get((i=n,r=o,`${i}:${r}`));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=g.get(e);if(t)return t;let n=function(e){let t={regions:new Map,countries:new Map};for(let r of e){for(let e of r.match.regions??[]){var n,o,i;let a={country:p((n=e).country),region:n.region.trim().toUpperCase()},s=(o=a.country,i=a.region,`${o}:${i}`);t.regions.has(s)||t.regions.set(s,r)}for(let e of r.match.countries??[]){let n=p(e);t.countries.has(n)||t.countries.set(n,r)}t.defaultPolicy||!0!==r.match.isDefault||(t.defaultPolicy=r),t.fallbackPolicy||!0!==r.match.fallback||(t.fallbackPolicy=r)}return t}(e);return g.set(e,n),n}(i),countryCode:s,regionCode:l});if(!c)return;let d=(r=y(o=c.policy),{id:o.id,model:r,i18n:o.i18n,consent:{expiryDays:o.consent?.expiryDays,scopeMode:h(o),categories:m(o),preselectedCategories:function(e){if("iab"===y(e))return;let t=e.consent?.preselectedCategories;if(!t||0===t.length)return;let n=m(e);return"strict"!==h(e)||!n||0===n.length||n.includes("*")?f(t):f(t.filter(e=>n.includes(e)))}(o),gpc:o.consent?.gpc},ui:"iab"===r?void 0:{mode:o.ui?.mode,banner:S(o.ui?.banner),dialog:S(o.ui?.dialog)},proof:{storeIp:o.proof?.storeIp,storeUserAgent:o.proof?.storeUserAgent,storeLanguage:o.proof?.storeLanguage}}),u=await a(d);return{policy:d,matchedBy:c.matchedBy,fingerprint:u}}let A={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 x(e){return!(!e||"object"!=typeof e||Array.isArray(e))}function P(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;x(a)&&x(r)?o[i]=e(a,r):o[i]=r}return o}(i,r))}return n}function L(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 E(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 j(e){return{translations:e.messages,defaultLanguage:e.locale,disableAutoLanguageSwitch:void 0===e.detectBrowserLanguage?void 0:!e.detectBrowserLanguage}}function $(e,t){if(e||t)return j(E({...e??{},...t?{i18n:t}:{}}))}let R=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},D=/^\/+/;function T(e,t=null,n=null,o=null){return{data:t,error:n,ok:e,response:o}}function U(e,t=500,n="HANDLER_ERROR",o){return function(e,t=500,n="ERROR",o){return T(!1,null,{message:e,status:t,code:n,cause:o},null)}(e,t,n,o)}async function O(e,t,n){let o=e[t];if(!o){let e=U(`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=U(t instanceof Error?t.message:String(t),0,"HANDLER_ERROR",t);if(n?.throw)throw t;return e}}async function B(e,t,n,o){let i=n.replace(D,"").split("/")[0],r=t[n];if(r)try{return await r(o)}catch(e){return U(e instanceof Error?e.message:String(e),0,"HANDLER_ERROR",e)}return i&&i in e?await O(e,i,o):U(`No endpoint handler found for '${n}'`,404,"ENDPOINT_NOT_FOUND")}
2async function M(e,t){let n=("init"in e&&e.init,"init");return await O(e,n,t)}async function F(e,t){return await O(e,"setConsent",t)}class N{endpointHandlers;dynamicHandlers={};constructor(e){this.endpointHandlers=e.endpointHandlers}async init(e){return M(this.endpointHandlers,e)}async setConsent(e){return F(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 B(this.endpointHandlers,this.dynamicHandlers,e,t)}}let _=[500,502,503,504],H=[400,401,403,404],q,V=/^(?:[a-z+]+:)?\/\//i,z=()=>{};function G(e){return e?{log:(...e)=>console.log("[c15t]",...e),debug:(...e)=>console.debug("[c15t]",...e)}:{log:z,debug:z}}let J=G(!1),K=e=>new Promise(t=>setTimeout(t,e));function X(e){return e?.subjectId||e?.id}function W(e){let t=e.length;for(;t>0&&"/"===e[t-1];)t--;return e.slice(0,t)}async function Y(e,t,n){let o={...e.retryConfig,...n?.retryConfig||{},retryableStatusCodes:n?.retryConfig?.retryableStatusCodes??e.retryConfig.retryableStatusCodes??_,nonRetryableStatusCodes:n?.retryConfig?.nonRetryableStatusCodes??e.retryConfig.nonRetryableStatusCodes??H},{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(V.test(e)){let n=new URL(e),o=W(n.pathname),i=t.replace(D,"");return n.pathname=`${o}/${i}`,n.toString()}let n=W(e),o=t.replace(D,"");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=T(!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=T(!0,c,null,e);return n?.onSuccess?.(t),t}let y=c,h=T(!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))J.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"}),J.debug(`Custom retry strategy for ${t} with status ${e.status}: ${b}`)}catch{b=s?.includes(e.status)??!1,J.debug(`Custom retry strategy failed, falling back to status code check: ${b}`)}else b=s?.includes(e.status)??!1,J.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 K(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=T(!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 K(u??0),u=(u??0)*(a??2)}}let p=f||T(!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 Q(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 Z(){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 ee={consents:"c",consentInfo:"i",timestamp:"ts",iabCustomVendorConsents:"icv",iabCustomVendorLegitimateInterests:"icvli",time:"t",type:"y",id:"id",subjectId:"sid",externalId:"eid",materialPolicyFingerprint:"mpf",identityProvider:"idp"},et=Object.entries(ee).reduce((e,[t,n])=>(e[n]=t,e),{});function en(e,t,n,o){if("u"<typeof document)return;let i={...Q(o),...n};i.crossSubdomain&&!n?.domain&&(i.domain=Z());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=>ee[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 eo(e,t,n){if("u"<typeof document)return;let o={...Q(n),...t};o.crossSubdomain&&!t?.domain&&(o.domain=Z());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 ei={translations:{en:A},defaultLanguage:"en",disableAutoLanguageSwitch:!1},er=[{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"}],ea=er.map(e=>e.name),es="c15t",el="privacy-consent-storage",ec={debug:!1,config:{pkg:"c15t",version:"2.1.0",mode:"Unknown"},consents:er.reduce((e,t)=>(e[t.name]=t.defaultValue,e),{}),selectedConsents:er.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:ei,user:void 0,networkBlocker:void 0,storageConfig:void 0,includeNonDisplayedConsents:!1,consentTypes:er,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 ed(e){if("string"!=typeof e)return;let t=e.trim();if(""!==t&&"undefined"!==t&&"null"!==t)return t}function eu(e){let t=ed(e.externalId),n=ed(e.identityProvider);return{...t?{externalId:t}:{},...n?{identityProvider:n}:{}}}function ef(e){if(!e)return e;let t={...e},{externalId:n,identityProvider:o}=eu({externalId:t.externalId,identityProvider:t.identityProvider});return n?t.externalId=n:delete t.externalId,o?t.identityProvider=o:delete t.identityProvider,t}function ep(e,t,n){let o=!1,i=!1,r=n?.storageKey||es,a=ey(n),s={...{...a,...e,consentInfo:ef(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{en(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 eg(e){let t=e.consents||{},n={...t};for(let e of ea)n[e]=t[e]??!1;return{...e,consents:n}}function ey(e){!function(e){let t=e?.storageKey||es;if(t!==el)try{if("u">typeof window&&window.localStorage){if(window.localStorage.getItem(t))return void window.localStorage.removeItem(el);let e=window.localStorage.getItem(el);e&&(window.localStorage.setItem(t,e),window.localStorage.removeItem(el),J.log(`Migrated consent data from "${el}" to "${t}"`))}}catch(e){console.warn("[c15t] Failed to migrate legacy storage:",e)}}(e);let t=e?.storageKey||es,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=>et[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=eg(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?eg(t):t}}catch{o=null}let r=JSON.stringify(e),a=JSON.stringify(o);r!==a&&(window.localStorage.setItem(t,r),o?n?J.log("Updated localStorage with consent from cookie (cross-subdomain mode)"):J.log("Updated localStorage with consent from cookie"):J.log("Synced consent from cookie to localStorage"))}}catch(e){console.warn("[c15t] Failed to sync consent to localStorage:",e)}}else try{en(t,i,void 0,e),J.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 J.log("Detected legacy consent format (v1.x). Re-consent required for v2.0."),em(void 0,e),null;if(i&&"object"==typeof i){let e=eg(i);return"object"==typeof e&&null!==e&&"consentInfo"in e&&(e.consentInfo=ef(e.consentInfo)),e}return i}function em(e,t){let n=t?.storageKey||es;try{"u">typeof window&&window.localStorage&&(window.localStorage.removeItem(n),n!==el&&window.localStorage.removeItem(el))}catch(e){console.warn("Failed to remove consent from localStorage:",e)}try{eo(n,e,t),n!==el&&eo(el,e,t)}catch(e){console.warn("Failed to remove consent cookie:",e)}}let eh="/subjects",eb="/subjects";async function ew(e,t,n,o,i){try{let r=await Y(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 eC(e){let t="c15t-pending-identify-submissions",n=X(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=>X(e)===n&&e.externalId===i.externalId)||(o.push(i),window.localStorage.setItem(t,JSON.stringify(o)),J.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=T(!0,null,null,null);return e?.onSuccess&&await e.onSuccess(o),o}async function ev(e,t,n){let{body:o,...i}=n,r=X(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=ey(t);ep({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 ew(e,`${eb}/${r}`,"PATCH",{...i,body:c},async e=>{let t={subjectId:r,...e?.body};return eC({...e,body:t})})}function eS(e){return e.explicitPolicy?e.explicitPolicy:{id:"offline_opt_in_banner",model:"opt-in",consent:{expiryDays:365},ui:{mode:"banner",banner:t(),dialog:t()}}}function ek(e){let t={jurisdiction:e.jurisdiction??"NONE",location:{countryCode:e.countryCode??null,regionCode:e.regionCode??null},translations:{language:e.language??"en",translations:e.translations??A},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 eI(e,t){let n=T(!0,t,null,null);return e?.onSuccess&&await e.onSuccess(n),n}async function eA(e,t){let n=eS({}),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=ek({countryCode:e?.headers?.["x-c15t-country"]??null,regionCode:e?.headers?.["x-c15t-region"]??null,gvl:o,policy:n});return eI(e,i)}async function ex(e,t,n){try{let o=await Y(e,"/init",{method:"GET",...t});if(o.ok)return o;return console.warn("API request failed, falling back to offline mode for consent banner"),eA(t,n)}catch(e){return console.warn("Error fetching consent banner info, falling back to offline mode:",e),eA(t,n)}}let eP="c15t-pending-consent-submissions",eL="c15t-pending-identify-submissions";async function eE(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}=eu({externalId:i.externalSubjectId,identityProvider:i.identityProvider}),a={...i,...n?{externalSubjectId:n}:{},...r?{identityProvider:r}:{}};n||delete a.externalSubjectId,r||delete a.identityProvider,J.log("Retrying consent submission:",i),(await Y(e,eh,{method:"POST",body:a})).ok&&(J.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 K(1e3*(t+1))}try{"u">typeof window&&window.localStorage&&(n.length>0?(window.localStorage.setItem(eP,JSON.stringify(n)),J.log(`${n.length} consent submissions still pending for future retry`)):(window.localStorage.removeItem(eP),J.log("All pending consent submissions processed successfully")))}catch(e){console.warn("Error updating pending submissions storage:",e)}}async function ej(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=X(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{J.log("Retrying identify user submission:",i);let n=`${eb}/${r}`,{subjectId:a,id:s,...l}=i;(await Y(e,n,{method:"PATCH",body:l})).ok&&(J.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 K(1e3*(t+1))}try{"u">typeof window&&window.localStorage&&(n.length>0?(window.localStorage.setItem(eL,JSON.stringify(n)),J.log(`${n.length} identify submissions still pending for future retry`)):(window.localStorage.removeItem(eL),J.log("All pending identify submissions processed successfully")))}catch(e){console.warn("Error updating pending identify submissions storage:",e)}}async function e$(e,t){let n="c15t-pending-consent-submissions",o=t?.body?.subjectId;try{if("u">typeof window&&(ep({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)),J.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=T(!0,null,null,null);return t?.onSuccess&&await t.onSuccess(i),i}async function eR(e,t,n){return ep({consents:n?.body?.preferences||{},consentInfo:{time:Date.now(),subjectId:n?.body?.subjectId,externalId:n?.body?.externalSubjectId,identityProvider:n?.body?.identityProvider}},void 0,t),await ew(e,eh,"POST",n,async e=>e$(t,e))}class eD{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??_,nonRetryableStatusCodes:e.retryConfig?.nonRetryableStatusCodes??H,shouldRetry:e.retryConfig?.shouldRetry??q,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 ex(this.fetcherContext,e,this.iabConfig)}async setConsent(e){return eR(this.fetcherContext,this.storageConfig,e)}async identifyUser(e){return ev(this.fetcherContext,this.storageConfig,e)}async $fetch(e,t){return Y(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(eP);if(!e)return;let n=JSON.parse(e);if(!n.length)return void window.localStorage.removeItem(eP);J.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 eE(this.fetcherContext,e)}checkPendingIdentifySubmissions(){!function(e,t){if(!("u"<typeof window)&&window.localStorage)try{let e=window.localStorage.getItem(eL);if(!e)return;let n=JSON.parse(e);if(!n.length)return void window.localStorage.removeItem(eL);J.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 ej(this.fetcherContext,e)}}function eT(e=null){return T(!0,e)}async function eU(e){let t=eT();return e?.onSuccess&&await e.onSuccess(t),t}function eO(e){if(!e)return;let t=e.split(",")[0]?.split(";")[0]?.trim().toLowerCase();if(t)return t.split("-")[0]??void 0}async function eB(e,t,n,o){var i,r,a,s;let u,f,p=t?.headers?.["x-c15t-country"]??"GB",g=t?.headers?.["x-c15t-region"]??null,y=t?.headers?.["accept-language"]??null,m=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;
2if("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}(p,g),h=o?.policyPacks,b=o?.policyPacks!==void 0,w=function(e){let t,n=(t=e.i18n?.messages)&&Object.keys(t).length>0?t:e.customTranslations&&Object.keys(e.customTranslations).length>0?{[l]:{translations:e.customTranslations}}:{},o=Object.keys(n).sort(),i=e.i18n?.defaultProfile??l,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=d(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],u=!!l&&Object.keys(l.translations??{}).length>0;if(t.i18n.messageProfile&&!u&&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 f=o.length>0?function(e){let t=d(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[f],g=0===o.length&&c.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}}({i18n:o?.i18n,policies:h});for(let e of w.warnings)console.warn(`[c15t] offlinePolicy.i18n: ${e}`);if(w.errors.length>0)throw Error(`Invalid offlinePolicy.i18n configuration: 3${w.errors.map(e=>`- ${e}`).join("\n")}`);h&&h.length>0&&k(h,{iabEnabled:n?.enabled===!0});let C=h&&h.length>0?await I({policies:h,countryCode:p,regionCode:g,jurisdiction:m,iabEnabled:n?.enabled===!0}):void 0,v=!o?.policy&&!C&&!b,S={...o,policy:o?.policy??C?.policy??(b?{id:"offline_no_banner",model:"none",ui:{mode:"none"}}:void 0)??(v?eS({}):void 0),policyDecision:o?.policyDecision??(C?{policyId:C.policy.id,fingerprint:C.fingerprint,matchedBy:C.matchedBy,country:p,region:g,jurisdiction:m}:void 0)};if(o?.i18n?.messages&&Object.keys(o.i18n.messages).length>0){let e,t,n,s,l,c,d,p,g,m,h=(t=(r={profiles:e=(i={acceptLanguage:y,i18n:o.i18n,policyI18n:S.policy?.i18n}).i18n.messages??{},defaultProfile:i.i18n.defaultProfile??"default",policyProfile:i.policyI18n?.messageProfile}).policyProfile??r.defaultProfile,n=r.profiles[t]?t:r.defaultProfile,s=Object.keys(e[n]?.translations??{}).sort(),a={profile:e[n]},l=eO(a.profile?.fallbackLanguage)??"en",d=(c=Object.keys(a.profile?.translations??{}).sort()).includes(l)?l:c.includes("en")?"en":c[0]??l,p=eO(i.policyI18n?.language)??L(s,{header:i.acceptLanguage,fallback:d}),g=e[n]?.translations[p]?p:d,m=e[n]?.translations[g],{language:g,translations:m?P(A,m):A});u=h.language,f=h.translations}else if(e?.translations&&Object.keys(e.translations).length>0){let t,n,o=e.translations;u=L(Object.keys(o),{header:y,fallback:(s=e.defaultLanguage,t=Object.keys(o).sort(),(n=s?.toLowerCase())&&t.includes(n)?n:t.includes("en")?"en":t[0]??"en")}),f=P(A,o[u]??{})}else u=L(Object.keys(ei.translations),{header:y,fallback:ei.defaultLanguage??"en"}),f=ei.translations[u];let x=null;if(n?.enabled&&S.policy?.model==="iab")if(n.gvl)x=n.gvl;else try{let e=n._module?.fetchGVL;e&&(x=await e(n.vendorIds))}catch(e){console.warn("Failed to fetch GVL in offline mode:",e)}let E=eT(ek({jurisdiction:m,countryCode:p,regionCode:g,language:u,translations:f,gvl:x,policy:S.policy,policyDecision:S.policyDecision,policySnapshotToken:S.policySnapshotToken}));return t?.onSuccess&&await t.onSuccess(E),E}async function eM(e,t){let n=t?.body?.subjectId;try{"u">typeof window&&ep({consentInfo:{time:Date.now(),subjectId:n,externalId:t?.body?.externalSubjectId,identityProvi
3der:t?.body?.identityProvider},consents:t?.body?.preferences||{}},void 0,e)}catch(e){console.warn("Failed to write to storage:",e)}return await eU(t)}class eF{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 eB(this.initialTranslationConfig,e,this.iabConfig,this.policyConfig)}async setConsent(e){return eM(this.storageConfig,e)}async identifyUser(e){return console.warn("identifyUser called in offline mode - external ID will not be linked"),eU(e)}async $fetch(e,t){return await eU(t)}}let eN="hosted",e_=!1;function eH(e){if("c15t"===e){let e="u">typeof globalThis&&"process"in globalThis?globalThis.process?.env?.NODE_ENV:void 0;return e_||"production"===e||(e_=!0,console.warn("[c15t] `mode: 'c15t'` is deprecated and will be removed in a future major release. Use `mode: 'hosted'` instead.")),eN}return"offline"===e||"custom"===e?e:eN}function eq(e){return void 0!==e.offlinePolicy?e.offlinePolicy:e.store?.offlinePolicy}let eV=new Map;function ez(e){let t,o=function(e){var t;let o=eH(e.mode),r=eq(e),a=(t=e.storageConfig)?Object.keys(t).sort().map(e=>{let n=t[e];return null==n?`${e}:null`:`${e}:${String(n)}`}).join("|"):"",s=a?`:storage:${a}`:"";if("offline"===o){let t=e.store?.initialTranslationConfig?.translations,o=e.store?.initialTranslationConfig?.defaultLanguage,a="";a=t?`:translations:${Object.keys(t).sort().join(",")}`:"";let l="";l=o?`:default-language:${o}`:"";let c=e.store?.iab,d="";d=c?.enabled?":iab:enabled":"";let u="";return r&&(u=`:policy:${i(n(r))}`),`offline${s}${a}${l}${d}${u}`}if("custom"===o){let t=Object.keys(("endpointHandlers"in e?e.endpointHandlers:void 0)||{}).sort().join(",");return`custom:${t}${s}`}let l="";if("headers"in e&&e.headers){let t=Object.keys(e.headers).sort();l=`:headers:${t.map(t=>`${t}=${e.headers?.[t]}`).join(",")}`}return`hosted:${e.backendURL||""}${l}${s}`}(e);if(eV.has(o)){if("offline"!==e.mode&&"custom"!==e.mode&&"headers"in e&&e.headers){let t=eV.get(o);t instanceof eD&&(t.headers={"Content-Type":"application/json",...e.headers})}let t=eV.get(o);if(t)return new Proxy(t,{get:(e,t)=>e[t]})}let r=eH(e.mode);switch(r){case"custom":t=new N({endpointHandlers:e.endpointHandlers});break;case"offline":{let n=e.store?.iab,o=eq(e);t=new eF(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 eD({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)}`)}(r)}return eV.set(o,t),t}let eG="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";function eJ(){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(eG.charAt(Number(e))),n/=t}for(let t of e)if(0===t)o.unshift(eG.charAt(0));else break;return o.join("")||eG.charAt(0)}(e)}`}function eK(e){return ea.includes(e)}function eX(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 eW(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(eK)]),i=n.filter(e=>o.has(e));return i.includes("necessary")||i.unshift("necessary"),i}function eY(e,t="permissive"){return"strict"===t&&Array.isArray(e)&&e.length>0&&!e.includes("*")}function eQ(e,t){if(0===e.length)throw TypeError(`${t} condition cannot be empty`)}function eZ(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,eQ(i=Array.isArray(o)?o:[o],"AND"),i.every(t=>e(t,n))}if("or"in t){let o;return i=t.or,eQ(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 e0(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]).forEac
3h(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 e1(e,t){let n=e.getAttribute("data-src"),o=function(e){let t=e.getAttribute("data-category");if(t){if(!ea.includes(t))throw Error(`Invalid category attribute "${t}" on iframe. Must be one of: ${ea.join(", ")}`);return t}}(e);!o||(eZ(o,t)?n&&!e.src&&(e.src=n,e.removeAttribute("data-src")):e.src&&e.removeAttribute("src"))}function e5(){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();ea.includes(o)&&t.add(o)}),Array.from(t)):[]}function e8(e){if("u"<typeof document)return;let t=document.querySelectorAll("iframe");t&&t.forEach(t=>{e1(t,e)})}let e2=["reject","accept","customize"];function e6(e){return e&&0!==e.length?[...new Set(e)]:[]}function e3(e){let t=e6(e.allowedActions);return t.length>0?t:[...e2]}function e4(e){let t=e6(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=e6(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 e7(e){var t;return(t=e4({allowedActions:e.allowedActions,layout:e.layout}))&&0!==t.length?t.flatMap(e=>Array.isArray(e)?e:[e]):[]}function e9(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}function te(e){return"column"===e?"column":"row"}function tt(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))}function tn(e){return!!e&&Object.values(e).some(e=>Array.isArray(e)?e.length>0:void 0!==e)}function to(){if("u"<typeof window)return!1;try{let e=window.navigator.globalPrivacyControl;return!0===e||"1"===e}catch{return!1}}let ti=/^https?:\/\//;function tr(e){let t=e.toString();return t.endsWith("/")?t.slice(0,-1):t}function ta(e){let t=function(e){try{let t="/"===e?e:e.endsWith("/")?e.slice(0,-1):e;if(ti.test(t))return tr(new URL(t));if(!t.startsWith("/"))return;return tr(new URL(t,window.location.origin))}catch{return}}(e.backendURL);if(!t)return;let n=to();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 ts(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 tl="__c15tScriptDebugListeners",tc=null;function td(){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 tu(e,t,n){return t?(n[e]||(n[e]=td()),n[e]):`c15t-script-${e}`}let tf=new Map;function tp(e){return tf.has(e)}function tg(e){tf.delete(e)}function ty(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 eZ(e.category,t)}function tm(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 tc||(tc=new Set),tc;let e=window,t=e[tl];
3if(t)return t;let n=new Set;return e[tl]=n,n}())try{e(a)}catch(e){console.error("Failed to handle c15t script debug event listener",e)}}function th(e,t,n,o){if(n){tm(e,"callback_start",`${t} started`,o,{callback:t});try{n(o),tm(e,"callback_complete",`${t} completed`,o,{callback:t})}catch(n){throw tm(e,"callback_error",`${t} failed`,o,{callback:t,error:n instanceof Error?n.message:"string"==typeof n?n:"Unknown error"}),n}}}function tb(e,t,n={},o){let i=[];return e.forEach(e=>{var r,a,s;let l=ty(e,t,o);if(!e.alwaysLoad&&!l)return void tm(e,"skipped","Script skipped due to missing consent",{hasConsent:l},{reason:"missing_consent"});if(tp(e.id)){let o={id:e.id,elementId:tu(e.id,!1!==e.anonymizeId,n),hasConsent:l,consents:t};tm(e,"already_loaded","Script already loaded; running consent sync",o),th(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=tu(e.id,o,n),s={id:e.id,elementId:a,consents:t,hasConsent:l};th(e,"onBeforeLoad",e.onBeforeLoad,s),th(e,"onLoad",e.onLoad,s),r=e.id,tf.set(r,null),i.push(e.id),tm(e,"loaded","Callback-only script marked as loaded",s,{callbackOnly:!0});return}let c=!1!==e.anonymizeId,d=tu(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};tm(e,"already_loaded","Persisted script element already exists; reusing it",o,{reason:"persisted_element"}),th(e,"onConsentChange",e.onConsentChange,o),th(e,"onLoad",e.onLoad,o),a=e.id,tf.set(a,n),i.push(e.id),tm(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(()=>{th(e,"onLoad",e.onLoad,{...f})},0):(tm(e,"load_listener_attached","Attached load listener",f),u.addEventListener("load",()=>{th(e,"onLoad",e.onLoad,{...f})}))),e.onError&&(e.textContent||(tm(e,"error_listener_attached","Attached error listener",f),u.addEventListener("error",()=>{th(e,"onError",e.onError,{...f,error:Error(`Failed to load script: ${e.src}`)})}))),th(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),tm(e,"element_appended",`Script element appended to ${p}`,f,{target:p}),s=e.id,tf.set(s,u),i.push(e.id),tm(e,"loaded","Script marked as loaded",f)}),i}let tw="c15t:pending-consent-sync";function tC(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 tv({manager:e,type:t,get:n,set:o,options:i,emitConsentChanged:r}){let{callbacks:a,selectedConsents:l,consents:c,consentTypes:d,updateScripts:u,updateIframeConsents:f,updateNetworkBlockerConsents:p,consentCategories:g,locationInfo:y,model:m,consentInfo:h,reloadOnConsentRevoked:b,lastBannerFetchData:w}=n(),C={...c},v={...l??c??{}},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,A=eY(I,k?.consent?.scopeMode??null),x=A?eX(v,I):v,P=A?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}(x,I):x,L=d.some(e=>C[e.name]!==x[e.name]),E=tC(x,g,d),j=tC(C,g,d),$=L?{preferences:x,previousPreferences:C,allowedCategories:E.allowedCategories,deniedCategories:E.deniedCategories,previousAllowedCategories:j.allowedCategories,previousDeniedCategories:j.deniedCategories}:null,R=w?.policy?await s(w.policy):void 0,D=h?.subjectId;D||(D=eJ());
3let T=eu({externalId:n().consentInfo?.externalId,identityProvider:n().consentInfo?.identityProvider}),U=eu({externalId:n().user?.id,identityProvider:n().user?.identityProvider}),O=T.externalId??U.externalId,B=T.identityProvider??U.identityProvider,M={time:S,subjectId:D,materialPolicyFingerprint:R,...O?{externalId:O}:{},...B?{identityProvider:B}:{}},F=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,x,h,b,d);if(o({consents:x,selectedConsents:x,activeUI:"none",consentInfo:M}),ep({consents:x,consentInfo:M},void 0,n().storageConfig),F){let e={type:t,subjectId:D,preferences:P,givenAt:S,jurisdiction:y?.jurisdiction??void 0,jurisdictionModel:m,domain:window.location.hostname,uiSource:i?.uiSource??"api",policySnapshotToken:w?.policySnapshotToken,...O?{externalId:O}:{},...B?{identityProvider:B}:{}};try{localStorage.setItem(tw,JSON.stringify(e))}catch{}a.onConsentSet?.({preferences:x}),$&&r?.($),a.onBeforeConsentRevocationReload?.({preferences:x}),window.location.reload();return}await new Promise(e=>setTimeout(e,0)),f(),u(),p(),a.onConsentSet?.({preferences:x}),$&&r?.($);let N=await e.setConsent({body:{type:"cookie_banner",domain:window.location.hostname,preferences:P,subjectId:D,jurisdiction:y?.jurisdiction??void 0,jurisdictionModel:m??void 0,givenAt:S,uiSource:i?.uiSource??"api",consentAction:t,policySnapshotToken:w?.policySnapshotToken,...O?{externalSubjectId:O}:{},...B?{identityProvider:B}:{}}});if(!N.ok){let e=N.error?.message??"Failed to save consents";a.onError?.({error:e}),a.onError||console.error(e)}}function tS(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:to());return{consentModel:a,autoGrantedConsents:(null===a||"opt-out"===a)&&null===n?{necessary:!0,functionality:!0,experience:!0,marketing:!s,measurement:!s}:null}}async function tk(e,t,n,o,i){let{set:r,get:a}=t,l=a(),c=e.policy?await s(e.policy):void 0;if(l.consentInfo&&c){let e=l.consentInfo.materialPolicyFingerprint;if(e&&e!==c){let e=l.consentTypes.reduce((e,t)=>(e[t.name]=t.defaultValue,e),{});em(void 0,l.storageConfig),r({consents:e,selectedConsents:e,consentInfo:null})}else if(!e){let e={...l.consentInfo,materialPolicyFingerprint:c};ep({consents:l.consents,consentInfo:e},void 0,l.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}=tS(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}=tS(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
3: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=eY(p,e.policy?.consent?.scopeMode??null);if(g){let e=eW(ea,p);f.consentCategories=e,f.consents=eX(f.consents??i().consents,e),f.selectedConsents=eX(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?eW(e,p):e,n=new Set(eW(t,y)),o=f.selectedConsents??i().selectedConsents;f.selectedConsents=s.length>0?s.reduce((e,t)=>(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=E(e),o=t?E(t):void 0,i={en:A};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]=P(e,n)}return j({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 tI(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(tw);if(!n)return;localStorage.removeItem(tw);let o=JSON.parse(n),{externalId:i,identityProvider:r}=eu({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 tA(e);return a||tx(e,r,o,i)}async function tA(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=ta({backendURL:e.backendURL,overrides:e.get().overrides,credentials:e.requestCredentials});return!o||ts(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
3:s}:t?{initDataSource:"backend",initDataSourceDetail:s}:{initDataSource:"ssr",initDataSourceDetail:s});return await tk(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"})}async function tx(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 tk(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 tP(e){return e?e.toUpperCase():"GET"}function tL(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=tP(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=tP(e);return t.methods.some(e=>tP(e)===n)}(t,n))}(o,i,e)&&!eZ(e.category,t))return{shouldBlock:!0,rule:e};return{shouldBlock:!1}}let tE=e=>{if("u"<typeof window)return null;try{return ey(e)}catch(e){return console.error("Failed to retrieve stored consent:",e),null}},tj="/api/c15t",t$=new Map,tR=new Map;function tD(e){return"offline"===e||"custom"===e?e:"hosted"}e.s(["clearConsentRuntimeCache",0,function(){t$.clear(),tR.clear(),eV.clear()},"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,...A}=C,{initialI18nConfig:x,initialTranslationConfig:P,ssrData:L,config:j,...D}=s??{},T=$(c??s?.initialTranslationConfig,l??s?.initialI18nConfig),U=T?E(T):void 0,O=U?Object.keys(U.messages).sort():[],B=f??D.iab,M=p??D.offlinePolicy,F=d??D.storageConfig,N=u??D.enabled,_=a||tj,H=k??L,q=(i=!1===(n={mode:r,backendURL:a,endpointHandlers:"endpointHandlers"in e?e.endpointHandlers:void 0,storageConfig:F,defaultLanguage:U?.locale,languageSetKey:O.length>0?O.join(","):void 0,offlinePolicyKey:M?JSON.stringify(M):void 0,enabled:N}).enabled?"disabled":"enabled",[tD(n.mode),n.backendURL??"default",n.endpointHandlers?"custom":"none",n.storageConfig?.storageKey??"default",n.defaultLanguage??"default",n.languageSetKey??"default",n.offlinePolicyKey??"default",i].join(":")),V=t$.get(q);if(!V){let t={...D,initialTranslationConfig:T,iab:B,offlinePolicy:M};V="offline"===r?ez({mode:"offline",store:t,storageConfig:F}):"custom"===r&&"endpointHandlers"in e?ez({mode:"custom",endpointHandlers:e.endpointHandlers,store:t,storageConfig:F}):ez({mode:"c15t"===r?"c15t":"hosted",backendURL:a||tj,store:t,storageConfig:F}),t$.set(q,V)}let z=tR.get(q);if(!z){let n=tD(r),i=j??I,a="hosted"!==n||"u"<typeof window||H?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=ta({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&&ts(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?$(s,l):void 0;J=G(!0===t.debug);let p=tE(t.storageConfig),g=new Set,y=(n=(n,r)=>{let s,l,c,d,y,m,h,b,w,C,v,S;return{...ec,...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();tE()||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 tv({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=er.reduce((e,t)=>(e[t.name]=t.defaultValue,e),{});return em(void 0,t.storageConfig),{consents:e,selectedConsents:e,consentInfo:null}})},setConsentCategories:e=>n(()=>{let{policyCategories:t,policyScopeMode:n}=r();return eY(t,n)?{consentCategories:eW(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:()=>tI({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 eZ(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:eY(o,i)?eW(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??eJ(),s=eu({externalId:i?.externalId,identityProvider:i?.identityProvider}),l=eu({externalId:o.user?.id,identityProvider:o.user?.identityProvider}),c=eu({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}}:{}}),ep({consents:b.consents,consentInfo:w},void 0,b.storageConfig),h},setOverrides:async o=>(n({overrides:{...r().overrides,...o}}),await tI({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=ty(e,t,o);if(tp(e.id)&&!e.alwaysLoad&&!r){var a;let o=(a=e.id,tf.get(a)),s={id:e.id,elementId:tu(e.id,!1!==e.anonymizeId,n),hasConsent:r,consents:t,element:o&&null!==o?o:void 0};!0===e.callbackOnly||null===o?(tg(e.id),i.push(e.id),tm(e,"unloaded","Callback-only script marked as unloaded",s,{callbackOnly:!0})):o&&(e.persistAfterConsentRevoked?(tg(e.id),i.push(e.id),tm(e,"unloaded","Persistent script marked as unloaded without removing element",s,{removedElement:!1,persistAfterConsentRevoked:!0})):(o.remove(),tg(e.id),i.push(e.id),tm(e,"unloaded","Script element removed after consent revocation",s,{removedElement:!0})))}}),i}(e,t,n,o);return{loaded:tb(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]=td())});let i=e.flatMap(e=>e0(e.category));n({scripts:[...t.scripts,...e],scriptIdMap:o}),r().updateConsentCategories(i),s()},removeScript:e=>{let t=r();if(tp(e)){let t=tf.get(e);t&&(t.remove(),tg(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(tp(e)){let t=tf.get(e);!0===r.callbackOnly||null===t?tg(e):t&&(r.persistAfterConsentRevoked||t.remove(),tg(e))}return r.alwaysLoad||ty(r,n,i)?(tb([r],n,o,i),!0):(tm(r,"skipped","Reload skipped due to missing consent",{hasConsent:!1,elementId:tu(r.id,!1!==r.anonymizeId,o)},{reason:"reload_missing_consent"}),!1)}(e,t.scripts,o,t.scriptIdMap,{model:t.model,iabConsent:n})},isScriptLoaded:e=>tp(e),getLoadedScriptIds:()=>Array.from(tf.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=e5();e.length>0&&r().updateConsentCategories(e)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",i):i(),setTimeout(i,100),e8(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()&&(e1(e,n),e.hasAttribute("data-category")&&(o=!0));let t=e.querySelectorAll?.("iframe");t&&t.length>0&&t.forEach(e=>{e1(e,n),e.hasAttribute("data-category")&&(o=!0)})}})}),o&&e){let t=e5();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||e8(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}=tL({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}=tL({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)}})}})?R(n):R;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=>e0(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})(V,{config:{...i??{},pkg:t?.pkg||"c15t",version:t?.version||"2.1.0",mode:n,meta:{...i?.meta??{},..."hosted"===n?{backendURL:_,requestCredentials:"include"}:{}}},...A,...D,iab:B,offlinePolicy:M,storageConfig:F,enabled:N,initialTranslationConfig:T,initialConsentCategories:g,ssrData:H??a,debug:y,__internal:"hosted"===n?{backendURL:_,requestCredentials:"include"}:void 0}),tR.set(q,z)}return{consentManager:V,consentStore:z,cacheKey:q}},"has",0,eZ,"hasPolicyHints",0,tn,"resolvePolicyActionGroups",0,e4,"resolvePolicyAllowedActions",0,e3,"resolvePolicyDirection",0,te,"resolvePolicyOrderedActions",0,e7,"resolvePolicyPrimaryActions",0,e9,"shouldFillPolicyActions",0,tt],562955);var tT=e.i(125643);let tU=(0,tT.createContext)(void 0);function tO(){let e=(0,tT.useContext)(tU);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,tT.useRef)(e.store);s.current=e.store;let l=(0,tT.useCallback)(e=>eZ(e,t,{policyCategories:r,policyScopeMode:a}),[t,r,a]),c=(0,tT.useCallback)(()=>null!=n,[n]),d=(0,tT.useCallback)(()=>i.filter(e=>o.includes(e.name)),[i,o]),u=(0,tT.useCallback)(e=>s.current.getState().subscribeToConsentChanges(e),[]);return{...e.state,has:l,hasConsented:c,getDisplayedConsents:d,subscribeToConsentChanges:u,manager:e.manager}}e.s(["ConsentStateContext",0,tU],673915),e.s(["useConsentManager",0,tO],619639);let tB={banner:"banner",dialog:"dialog"};e.s(["useHeadlessConsentUI",0,function(){let{activeUI:e,policyBanner:{allowedActions:t,primaryActions:n,layout:o,direction:i,uiProfile:r,scrollLock:a},policyDialog:{allowedActions:s,primaryActions:l,layout:c,direction:d,uiProfile:u,scrollLock:f}
3,saveConsents:p,setActiveUI:g}=tO(),y=(0,tT.useMemo)(()=>({allowedActions:t,primaryActions:n,layout:o,direction:i,uiProfile:r,scrollLock:a}),[t,i,o,n,r,a]),m=(0,tT.useMemo)(()=>({allowedActions:s,primaryActions:l,layout:c,direction:d,uiProfile:u,scrollLock:f}),[s,d,c,l,u,f]),h=(0,tT.useMemo)(()=>{let s=e3({allowedActions:t}),l=e4({allowedActions:s,layout:o}),c=e7({allowedActions:s,layout:o}),d=te(i);return{allowedActions:s,orderedActions:c,actionGroups:l,primaryActions:e9({orderedActions:c,primaryActions:n}),layout:o,direction:d,uiProfile:r,scrollLock:a,hasPolicyHints:tn(y),shouldFillActions:tt({uiProfile:r,actionGroups:l,direction:d}),isVisible:"banner"===e}},[e,t,i,o,n,r,a,y]),b=(0,tT.useMemo)(()=>{let t=e3({allowedActions:s}),n=e4({allowedActions:t,layout:c}),o=e7({allowedActions:t,layout:c}),i=te(d);return{allowedActions:t,orderedActions:o,actionGroups:n,primaryActions:e9({orderedActions:o,primaryActions:l}),layout:c,direction:i,uiProfile:u,scrollLock:f,hasPolicyHints:tn(m),shouldFillActions:tt({uiProfile:u,actionGroups:n,direction:i}),isVisible:"dialog"===e}},[e,s,d,c,l,u,f,m]),w=(0,tT.useCallback)(async(e,t)=>{let n=t.uiSource??tB[t.surface];switch(e){case"accept":await p("all",{uiSource:n});return;case"reject":await p("necessary",{uiSource:n});return}},[p]),C=(0,tT.useCallback)((e,t)=>w(e,{surface:"banner",uiSource:t?.uiSource}),[w]),v=(0,tT.useCallback)((e,t)=>w(e,{surface:"dialog",uiSource:t?.uiSource}),[w]),S=(0,tT.useCallback)(async e=>{await p("custom",{uiSource:e?.uiSource??tB.dialog})},[p]);return{activeUI:e,banner:h,dialog:b,openBanner:(0,tT.useCallback)(e=>{g("banner",e)},[g]),openDialog:(0,tT.useCallback)(()=>{g("dialog")},[g]),closeUI:(0,tT.useCallback)(()=>{g("none")},[g]),performAction:w,performBannerAction:C,performDialogAction:v,saveCustomPreferences:S}}],122968)}]); 4 5//# debugId=fac3f499-1f32-072f-27b3-82c039dc584b
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.