1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1030],{51030:(e,t,s)=>{var r,i,n,o;s.d(t,{GVL:()=>N,TCModel:()=>U,TCString:()=>D});class a extends Error{constructor(e){super(e),this.name="DecodingError"}}class l extends Error{constructor(e){super(e),this.name="EncodingError"}}class c extends Error{constructor(e){super(e),this.name="GVLError"}}class u extends Error{constructor(e,t,s=""){super(`invalid value ${t} passed for ${e} ${s}`),this.name="TCModelError"}}class p{static DICT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";static REVERSE_DICT=new Map([["A",0],["B",1],["C",2],["D",3],["E",4],["F",5],["G",6],["H",7],["I",8],["J",9],["K",10],["L",11],["M",12],["N",13],["O",14],["P",15],["Q",16],["R",17],["S",18],["T",19],["U",20],["V",21],["W",22],["X",23],["Y",24],["Z",25],["a",26],["b",27],["c",28],["d",29],["e",30],["f",31],["g",32],["h",33],["i",34],["j",35],["k",36],["l",37],["m",38],["n",39],["o",40],["p",41],["q",42],["r",43],["s",44],["t",45],["u",46],["v",47],["w",48],["x",49],["y",50],["z",51],["0",52],["1",53],["2",54],["3",55],["4",56],["5",57],["6",58],["7",59],["8",60],["9",61],["-",62],["_",63]]);static BASIS=6;static LCM=24;static encode(e){if(!/^[0-1]+$/.test(e))throw new l("Invalid bitField");let t=e.length%this.LCM;e+=t?"0".repeat(this.LCM-t):"";let s="";for(let t=0;t<e.length;t+=this.BASIS)s+=this.DICT[parseInt(e.substr(t,this.BASIS),2)];return s}static decode(e){if(!/^[A-Za-z0-9\-_]+$/.test(e))throw new a("Invalidly encoded Base64URL string");let t="";for(let s=0;s<e.length;s++){let r=this.REVERSE_DICT.get(e[s]).toString(2);t+="0".repeat(this.BASIS-r.length)+r}return t}}class d{static langSet=new Set(["AR","BG","BS","CA","CS","CY","DA","DE","EL","EN","ES","ET","EU","FI","FR","GL","HE","HI","HR","HU","ID","IS","IT","JA","KA","KO","LT","LV","MK","MS","MT","NL","NO","PL","PT-BR","PT-PT","RO","RU","SK","SL","SQ","SR-LATN","SR-CYRL","SV","SW","TH","TL","TR","UK","VI","ZH","ZH-HANT"]);has(e){return d.langSet.has(e)}parseLanguage(e){let t=(e=e.toUpperCase()).split("-")[0];if(e.length>=2&&2==t.length){if(d.langSet.has(e))return e;if(d.langSet.has(t))return t;let s=t+"-"+t;if(d.langSet.has(s))return s;for(let s of d.langSet)if(-1!==s.indexOf(e)||-1!==s.indexOf(t))return s}throw Error(`unsupported language ${e}`)}forEach(e){d.langSet.forEach(e)}get size(){return d.langSet.size}}class h{static cmpId="cmpId";static cmpVersion="cmpVersion";static consentLanguage="consentLanguage";static consentScreen="consentScreen";static created="created";static supportOOB="supportOOB";static isServiceSpecific="isServiceSpecific";static lastUpdated="lastUpdated";static numCustomPurposes="numCustomPurposes";static policyVersion="policyVersion";static publisherCountryCode="publisherCountryCode";static publisherCustomConsents="publisherCustomConsents";static publisherCustomLegitimateInterests="publisherCustomLegitimateInterests";static publisherLegitimateInterests="publisherLegitimateInterests";static publisherConsents="publisherConsents";static publisherRestrictions="publisherRestrictions";static purposeConsents="purposeConsents";static purposeLegitimateInterests="purposeLegitimateInterests";static purposeOneTreatment="purposeOneTreatment";static specialFeatureOptins="specialFeatureOptins";static useNonStandardTexts="useNonStandardTexts";static vendorConsents="vendorConsents";static vendorLegitimateInterests="vendorLegitimateInterests";static vendorListVersion="vendorListVersion";static vendorsAllowed="vendorsAllowed";static vendorsDisclosed="vendorsDisclosed";static version="version"}class g{clone(){let e=new this.constructor;return Object.keys(this).forEach(t=>{let s=this.deepClone(this[t]);void 0!==s&&(e[t]=s)}),e}deepClone(e){let t=typeof e;if("number"===t||"string"===t||"boolean"===t)return e;if(null!==e&&"object"===t)if("function"==typeof e.clone)return e.clone();else if(e instanceof Date)return new Date(e.getTime());else if(void 0!==e[Symbol.iterator]){let t=[];for(let s of e)t.push(this.deepClone(s));return e instanceof Array?t:new e.constructor(t)}else{let t={};for(let s in e)e.hasOwnProperty(s)&&(t[s]=this.deepClone(e[s]));return t}}}!function(e){e[e.NOT_ALLOWED=0]="NOT_ALLOWED",e[e.REQUIRE_CONSENT=1]="REQUIRE_CONSENT",e[e.REQUIRE_LI=2]="REQUIRE_LI"}(r||(r={}));class m extends g{static hashSeparator="-";purposeId_;restrictionType;constructor(e,t){super(),void 0!==e&&(this.purposeId=e),void 0!==t&&(this.restrictionType=t)}static unHash(e){let t=e.split(this.hashSeparator),s=new m;if(2!==t.length)throw new u("hash",e);return s.purposeId=parseInt(t[0],10),s.restrictionType=parseInt(t[1],10),s}get hash(){if(!this.isValid())throw Error("cannot hash invalid PurposeRestriction");return`${this.purposeId}${m.hashSeparator}${this.restrictionType}`}get purposeId(){return this.purposeId_}set purposeId(e){this.purposeId_=e}isValid(){return Number.isInteger(this.purposeId)&&this.purposeId>0&&(this.restrictionType===r.NOT_ALLOWED||this.restrictionType===r.REQUIRE_CONSENT||this.restrictionType===r.REQUIRE_LI)}isSameAs(e){return this.purposeId===e.purposeId&&this.restrictionType===e.restrictionType}}class f extends g{bitLength=0;map=new Map;gvl_;has(e){return this.map.has(e)}isOkToHave(e,t,s){let i=!0;if(this.gvl?.vendors){let n=this.gvl.vendors[s];if(n)if(e===r.NOT_ALLOWED)i=n.legIntPurposes.includes(t)||n.purposes.includes(t);else if(n.flexiblePurposes.length)switch(e){case r.REQUIRE_CONSENT:i=n.flexiblePurposes.includes(t)&&n.legIntPurposes.includes(t);break;case r.REQUIRE_LI:i=n.flexiblePurposes.includes(t)&&n.purposes.includes(t)}else i=!1;else i=!1}return i}add(e,t){if(this.isOkToHave(t.restrictionType,t.purposeId,e)){let s=t.hash;this.has(s)||(this.map.set(s,new Set),this.bitLength=0),this.map.get(s).add(e)}}
1restrictPurposeToLegalBasis(e){let t=Array.from(this.gvl.vendorIds),s=e.hash,r=t[t.length-1],i=[...Array(r).keys()].map(e=>e+1);if(this.has(s))for(let e=1;e<=r;e++)this.map.get(s).add(e);else this.map.set(s,new Set(i)),this.bitLength=0}getVendors(e){let t=[];if(e){let s=e.hash;this.has(s)&&(t=Array.from(this.map.get(s)))}else{let e=new Set;this.map.forEach(t=>{t.forEach(t=>{e.add(t)})}),t=Array.from(e)}return t.sort((e,t)=>e-t)}getRestrictionType(e,t){let s;return this.getRestrictions(e).forEach(e=>{e.purposeId===t&&(void 0===s||s>e.restrictionType)&&(s=e.restrictionType)}),s}vendorHasRestriction(e,t){let s=!1,r=this.getRestrictions(e);for(let e=0;e<r.length&&!s;e++)s=t.isSameAs(r[e]);return s}getMaxVendorId(){let e=0;return this.map.forEach(t=>{e=Math.max(Array.from(t)[t.size-1],e)}),e}getRestrictions(e){let t=[];return this.map.forEach((s,r)=>{e?s.has(e)&&t.push(m.unHash(r)):t.push(m.unHash(r))}),t}getPurposes(){let e=new Set;return this.map.forEach((t,s)=>{e.add(m.unHash(s).purposeId)}),Array.from(e)}remove(e,t){let s=t.hash,r=this.map.get(s);r&&(r.delete(e),0==r.size&&(this.map.delete(s),this.bitLength=0))}set gvl(e){this.gvl_||(this.gvl_=e,this.map.forEach((e,t)=>{let s=m.unHash(t);Array.from(e).forEach(t=>{this.isOkToHave(s.restrictionType,s.purposeId,t)||e.delete(t)})}))}get gvl(){return this.gvl_}isEmpty(){return 0===this.map.size}get numRestrictions(){return this.map.size}}!function(e){e.COOKIE="cookie",e.WEB="web",e.APP="app"}(i||(i={})),function(e){e.CORE="core",e.VENDORS_DISCLOSED="vendorsDisclosed",e.VENDORS_ALLOWED="vendorsAllowed",e.PUBLISHER_TC="publisherTC"}(n||(n={}));class v{static ID_TO_KEY=[n.CORE,n.VENDORS_DISCLOSED,n.VENDORS_ALLOWED,n.PUBLISHER_TC];static KEY_TO_ID={[n.CORE]:0,[n.VENDORS_DISCLOSED]:1,[n.VENDORS_ALLOWED]:2,[n.PUBLISHER_TC]:3}}class C extends g{bitLength=0;maxId_=0;set_=new Set;*[Symbol.iterator](){for(let e=1;e<=this.maxId;e++)yield[e,this.has(e)]}values(){return this.set_.values()}get maxId(){return this.maxId_}has(e){return this.set_.has(e)}unset(e){Array.isArray(e)?e.forEach(e=>this.unset(e)):"object"==typeof e?this.unset(Object.keys(e).map(e=>Number(e))):(this.set_.delete(Number(e)),this.bitLength=0,e===this.maxId&&(this.maxId_=0,this.set_.forEach(e=>{this.maxId_=Math.max(this.maxId,e)})))}isIntMap(e){let t="object"==typeof e;return t&&Object.keys(e).every(t=>{let s=Number.isInteger(parseInt(t,10));return(s=s&&this.isValidNumber(e[t].id))&&void 0!==e[t].name})}isValidNumber(e){return parseInt(e,10)>0}isSet(e){let t=!1;return e instanceof Set&&(t=Array.from(e).every(this.isValidNumber)),t}set(e){if(Array.isArray(e))e.forEach(e=>this.set(e));else if(this.isSet(e))this.set(Array.from(e));else if(this.isIntMap(e))this.set(Object.keys(e).map(e=>Number(e)));else if(this.isValidNumber(e))this.set_.add(e),this.maxId_=Math.max(this.maxId,e),this.bitLength=0;else throw new u("set()",e,"must be positive integer array, positive integer, Set<number>, or IntMap")}empty(){this.set_=new Set,this.maxId_=0}forEach(e){for(let t=1;t<=this.maxId;t++)e(this.has(t),t)}get size(){return this.set_.size}setAll(e){this.set(e)}unsetAll(e){this.unset(e)}}class E{static [h.cmpId]=12;static [h.cmpVersion]=12;static [h.consentLanguage]=12;static [h.consentScreen]=6;static [h.created]=36;static [h.isServiceSpecific]=1;static [h.lastUpdated]=36;static [h.policyVersion]=6;static [h.publisherCountryCode]=12;static [h.publisherLegitimateInterests]=24;static [h.publisherConsents]=24;static [h.purposeConsents]=24;static [h.purposeLegitimateInterests]=24;static [h.purposeOneTreatment]=1;static [h.specialFeatureOptins]=12;static [h.useNonStandardTexts]=1;static [h.vendorListVersion]=12;static [h.version]=6;static anyBoolean=1;static encodingType=1;static maxId=16;static numCustomPurposes=6;static numEntries=12;static numRestrictions=12;static purposeId=6;static restrictionType=2;static segmentType=3;static singleOrRange=1;static vendorId=16}class I{static encode(e,t){let s;if("string"==typeof e&&(e=parseInt(e,10)),(s=e.toString(2)).length>t||e<0)throw new l(`${e} too large to encode into ${t}`);return s.length<t&&(s="0".repeat(t-s.length)+s),s}static decode(e,t){if(t!==e.length)throw new a("invalid bit length");return parseInt(e,2)}}class L{static encode(e,t){return I.encode(Math.round(e.getTime()/100),t)}static decode(e,t){if(t!==e.length)throw new a("invalid bit length");let s=new Date;return s.setTime(100*I.decode(e,t)),s}}class S{static encode(e){return String(Number(e))}static decode(e){return"1"===e}}class y{static encode(e,t){let s="";for(let r=1;r<=t;r++)s+=S.encode(e.has(r));return s}static decode(e,t){if(e.length!==t)throw new a("bitfield encoding length mismatch");let s=new C;for(let r=1;r<=t;r++)S.decode(e[r-1])&&s.set(r);return s.bitLength=e.length,s}}
1class b{static encode(e,t){let s=(e=e.toUpperCase()).charCodeAt(0)-65,r=e.charCodeAt(1)-65;if(s<0||s>25||r<0||r>25)throw new l(`invalid language code: ${e}`);if(t%2==1)throw new l(`numBits must be even, ${t} is not valid`);return t/=2,I.encode(s,t)+I.encode(r,t)}static decode(e,t){let s;if(t!==e.length||e.length%2)throw new a("invalid bit length for language");{let t=e.length/2,r=I.decode(e.slice(0,t),t)+65,i=I.decode(e.slice(t),t)+65;s=String.fromCharCode(r)+String.fromCharCode(i)}return s}}class A{static encode(e){let t=I.encode(e.numRestrictions,E.numRestrictions);if(!e.isEmpty()){let s=(t,s)=>{for(let r=t+1;r<=s;r++)if(e.gvl.vendorIds.has(r))return r;return t};e.getRestrictions().forEach(r=>{t+=I.encode(r.purposeId,E.purposeId),t+=I.encode(r.restrictionType,E.restrictionType);let i=e.getVendors(r),n=i.length,o=0,a=0,l="";for(let e=0;e<n;e++){let t=i[e];if(0===a&&(o++,a=t),e===n-1||i[e+1]>s(t,i[n-1])){let e=t!==a;l+=S.encode(e),l+=I.encode(a,E.vendorId),e&&(l+=I.encode(t,E.vendorId)),a=0}}t+=I.encode(o,E.numEntries),t+=l})}return t}static decode(e){let t=0,s=new f,r=I.decode(e.substr(t,E.numRestrictions),E.numRestrictions);t+=E.numRestrictions;for(let i=0;i<r;i++){let r=I.decode(e.substr(t,E.purposeId),E.purposeId);t+=E.purposeId;let i=I.decode(e.substr(t,E.restrictionType),E.restrictionType);t+=E.restrictionType;let n=new m(r,i),o=I.decode(e.substr(t,E.numEntries),E.numEntries);t+=E.numEntries;for(let r=0;r<o;r++){let r=S.decode(e.substr(t,E.anyBoolean));t+=E.anyBoolean;let i=I.decode(e.substr(t,E.vendorId),E.vendorId);if(t+=E.vendorId,r){let r=I.decode(e.substr(t,E.vendorId),E.vendorId);if(t+=E.vendorId,r<i)throw new a(`Invalid RangeEntry: endVendorId ${r} is less than ${i}`);for(let e=i;e<=r;e++)s.add(e,n)}else s.add(i,n)}}return s.bitLength=t,s}}!function(e){e[e.FIELD=0]="FIELD",e[e.RANGE=1]="RANGE"}(o||(o={}));class _{static encode(e){let t,s=[],r=[],i=I.encode(e.maxId,E.maxId),n="",a=E.maxId+E.encodingType,l=a+e.maxId,c=2*E.vendorId+E.singleOrRange+E.numEntries,u=a+E.numEntries;return e.forEach((i,o)=>{n+=S.encode(i),(t=e.maxId>c&&u<l)&&i&&(e.has(o+1)?0===r.length&&(r.push(o),u+=E.singleOrRange,u+=E.vendorId):(r.push(o),u+=E.vendorId,s.push(r),r=[]))}),t?(i+=String(o.RANGE),i+=this.buildRangeEncoding(s)):(i+=String(o.FIELD),i+=n),i}static decode(e,t){let s,r=0,i=I.decode(e.substr(r,E.maxId),E.maxId);r+=E.maxId;let n=I.decode(e.charAt(r),E.encodingType);if(r+=E.encodingType,n===o.RANGE){if(s=new C,1===t){if("1"===e.substr(r,1))throw new a("Unable to decode default consent=1");r++}let i=I.decode(e.substr(r,E.numEntries),E.numEntries);r+=E.numEntries;for(let t=0;t<i;t++){let t=S.decode(e.charAt(r));r+=E.singleOrRange;let i=I.decode(e.substr(r,E.vendorId),E.vendorId);if(r+=E.vendorId,t){let t=I.decode(e.substr(r,E.vendorId),E.vendorId);r+=E.vendorId;for(let e=i;e<=t;e++)s.set(e)}else s.set(i)}}else{let t=e.substr(r,i);r+=i,s=y.decode(t,i)}return s.bitLength=r,s}static buildRangeEncoding(e){let t=e.length,s=I.encode(t,E.numEntries);return e.forEach(e=>{let t=1===e.length;s+=S.encode(!t),s+=I.encode(e[0],E.vendorId),t||(s+=I.encode(e[1],E.vendorId))}),s}}function V(){return{[h.version]:I,[h.created]:L,[h.lastUpdated]:L,[h.cmpId]:I,[h.cmpVersion]:I,[h.consentScreen]:I,[h.consentLanguage]:b,[h.vendorListVersion]:I,[h.policyVersion]:I,[h.isServiceSpecific]:S,[h.useNonStandardTexts]:S,[h.specialFeatureOptins]:y,[h.purposeConsents]:y,[h.purposeLegitimateInterests]:y,[h.purposeOneTreatment]:S,[h.publisherCountryCode]:b,[h.vendorConsents]:_,[h.vendorLegitimateInterests]:_,[h.publisherRestrictions]:A,segmentType:I,[h.vendorsDisclosed]:_,[h.vendorsAllowed]:_,[h.publisherConsents]:y,[h.publisherLegitimateInterests]:y,[h.numCustomPurposes]:I,[h.publisherCustomConsents]:y,[h.publisherCustomLegitimateInterests]:y}}class w{1={[n.CORE]:[h.version,h.created,h.lastUpdated,h.cmpId,h.cmpVersion,h.consentScreen,h.consentLanguage,h.vendorListVersion,h.purposeConsents,h.vendorConsents]};2={[n.CORE]:[h.version,h.created,h.lastUpdated,h.cmpId,h.cmpVersion,h.consentScreen,h.consentLanguage,h.vendorListVersion,h.policyVersion,h.isServiceSpecific,h.useNonStandardTexts,h.specialFeatureOptins,h.purposeConsents,h.purposeLegitimateInterests,h.purposeOneTreatment,h.publisherCountryCode,h.vendorConsents,h.vendorLegitimateInterests,h.publisherRestrictions],[n.VENDORS_DISCLOSED]:[h.vendorsDisclosed],[n.PUBLISHER_TC]:[h.publisherConsents,h.publisherLegitimateInterests,h.numCustomPurposes,h.publisherCustomConsents,h.publisherCustomLegitimateInterests],[n.VENDORS_ALLOWED]:[h.vendorsAllowed]}}
1class O{1=[n.CORE];2=[n.CORE];constructor(e,t){if(2===e.version)if(e.isServiceSpecific)this["2"].push(n.VENDORS_DISCLOSED),this["2"].push(n.PUBLISHER_TC);else{let s=!!(t&&t.isForVendors);s&&!0!==e[h.supportOOB]||this["2"].push(n.VENDORS_DISCLOSED),s&&(e[h.supportOOB]&&e[h.vendorsAllowed].size>0&&this["2"].push(n.VENDORS_ALLOWED),this["2"].push(n.PUBLISHER_TC))}}}class T{static fieldSequence=new w;static encode(e,t){let s;try{s=this.fieldSequence[String(e.version)][t]}catch(s){throw new l(`Unable to encode version: ${e.version}, segment: ${t}`)}let r="";t!==n.CORE&&(r=I.encode(v.KEY_TO_ID[t],E.segmentType));let i=V();return s.forEach(s=>{let n=e[s],o=i[s],a=E[s];void 0===a&&this.isPublisherCustom(s)&&(a=Number(e[h.numCustomPurposes]));try{r+=o.encode(n,a)}catch(e){throw new l(`Error encoding ${t}->${s}: ${e.message}`)}}),p.encode(r)}static decode(e,t,s){let r=p.decode(e),i=0;s===n.CORE&&(t.version=I.decode(r.substr(i,E[h.version]),E[h.version])),s!==n.CORE&&(i+=E.segmentType);let o=this.fieldSequence[String(t.version)][s],l=V();return o.forEach(e=>{let s=l[e],n=E[e];if(void 0===n&&this.isPublisherCustom(e)&&(n=Number(t[h.numCustomPurposes])),0!==n){let o=r.substr(i,n);if(s===_?t[e]=s.decode(o,t.version):t[e]=s.decode(o,n),Number.isInteger(n))i+=n;else if(Number.isInteger(t[e].bitLength))i+=t[e].bitLength;else throw new a(e)}}),t}static isPublisherCustom(e){return 0===e.indexOf("publisherCustom")}}class P{static processor=[e=>e,(e,t)=>{e.publisherRestrictions.gvl=t,e.purposeLegitimateInterests.unset([1,3,4,5,6]);let s=new Map;return s.set("legIntPurposes",e.vendorLegitimateInterests),s.set("purposes",e.vendorConsents),s.forEach((s,i)=>{s.forEach((n,o)=>{if(n){let n=t.vendors[o];if(!n||n.deletedDate)s.unset(o);else if(0===n[i].length)if("legIntPurposes"===i&&0===n.purposes.length&&0===n.legIntPurposes.length&&n.specialPurposes.length>0)s.set(o);else if("legIntPurposes"===i&&n.purposes.length>0&&0===n.legIntPurposes.length&&n.specialPurposes.length>0)s.set(o);else if(e.isServiceSpecific)if(0===n.flexiblePurposes.length)s.unset(o);else{let t=e.publisherRestrictions.getRestrictions(o),n=!1;for(let e=0,s=t.length;e<s&&!n;e++)n=t[e].restrictionType===r.REQUIRE_CONSENT&&"purposes"===i||t[e].restrictionType===r.REQUIRE_LI&&"legIntPurposes"===i;n||s.unset(o)}else s.unset(o)}})}),e}];static process(e,t){let s=e.gvl;if(!s)throw new l("Unable to encode TCModel without a GVL");if(!s.isReady)throw new l("Unable to encode TCModel tcModel.gvl.readyPromise is not resolved");(e=e.clone()).consentLanguage=s.language.slice(0,2).toUpperCase(),t?.version>0&&t?.version<=this.processor.length?e.version=t.version:e.version=this.processor.length;let r=e.version-1;if(!this.processor[r])throw new l(`Invalid version: ${e.version}`);return this.processor[r](e,s)}}class R{static absCall(e,t,s,r){return new Promise((i,n)=>{let o=new XMLHttpRequest;o.withCredentials=s,o.addEventListener("load",()=>{if(o.readyState==XMLHttpRequest.DONE)if(o.status>=200&&o.status<300){let e=o.response;if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}i(e)}else n(Error(`HTTP Status: ${o.status} response type: ${o.responseType}`))}),o.addEventListener("error",()=>{n(Error("error"))}),o.addEventListener("abort",()=>{n(Error("aborted"))}),null===t?o.open("GET",e,!0):o.open("POST",e,!0),o.responseType="json",o.timeout=r,o.ontimeout=()=>{n(Error("Timeout "+r+"ms "+e))},o.send(t)})}static post(e,t,s=!1,r=0){return this.absCall(e,JSON.stringify(t),s,r)}static fetch(e,t=!1,s=0){return this.absCall(e,null,t,s)}}class N extends g{static LANGUAGE_CACHE=new Map;static CACHE=new Map;static LATEST_CACHE_KEY=0;static DEFAULT_LANGUAGE="EN";static consentLanguages=new d;static baseUrl_;static set baseUrl(e){if(/^https?:\/\/vendorlist\.consensu\.org\//.test(e))throw new c("Invalid baseUrl! You may not pull directly from vendorlist.consensu.org and must provide your own cache");e.length>0&&"/"!==e[e.length-1]&&(e+="/"),this.baseUrl_=e}static get baseUrl(){return this.baseUrl_}static latestFilename="vendor-list.json";static versionedFilename="archives/vendor-list-v[VERSION].json";static languageFilename="purposes-[LANG].json";readyPromise;gvlSpecificationVersion;vendorListVersion;tcfPolicyVersion;lastUpdated;purposes;specialPurposes;features;specialFeatures;isReady_=!1;vendors_;vendorIds;fullVendorList;
1byPurposeVendorMap;bySpecialPurposeVendorMap;byFeatureVendorMap;bySpecialFeatureVendorMap;stacks;dataCategories;lang_;cacheLang_;isLatest=!1;constructor(e,t){super();let s=N.baseUrl,r=t?.language;if(r)try{r=N.consentLanguages.parseLanguage(r)}catch(e){throw new c("Error during parsing the language: "+e.message)}if(this.lang_=r||N.DEFAULT_LANGUAGE,this.cacheLang_=r||N.DEFAULT_LANGUAGE,this.isVendorList(e))this.populate(e),this.readyPromise=Promise.resolve();else{if(!s)throw new c("must specify GVL.baseUrl before loading GVL json");e>0?N.CACHE.has(e)?(this.populate(N.CACHE.get(e)),this.readyPromise=Promise.resolve()):(s+=N.versionedFilename.replace("[VERSION]",String(e)),this.readyPromise=this.fetchJson(s)):N.CACHE.has(N.LATEST_CACHE_KEY)?(this.populate(N.CACHE.get(N.LATEST_CACHE_KEY)),this.readyPromise=Promise.resolve()):(this.isLatest=!0,this.readyPromise=this.fetchJson(s+N.latestFilename))}}static emptyLanguageCache(e){let t=!1;return null==e&&N.LANGUAGE_CACHE.size>0?(N.LANGUAGE_CACHE=new Map,t=!0):"string"==typeof e&&this.consentLanguages.has(e.toUpperCase())&&(N.LANGUAGE_CACHE.delete(e.toUpperCase()),t=!0),t}static emptyCache(e){let t=!1;return Number.isInteger(e)&&e>=0?(N.CACHE.delete(e),t=!0):void 0===e&&(N.CACHE=new Map,t=!0),t}cacheLanguage(){N.LANGUAGE_CACHE.has(this.cacheLang_)||N.LANGUAGE_CACHE.set(this.cacheLang_,{purposes:this.purposes,specialPurposes:this.specialPurposes,features:this.features,specialFeatures:this.specialFeatures,stacks:this.stacks,dataCategories:this.dataCategories})}async fetchJson(e){try{this.populate(await R.fetch(e))}catch(e){throw new c(e.message)}}getJson(){return{gvlSpecificationVersion:this.gvlSpecificationVersion,vendorListVersion:this.vendorListVersion,tcfPolicyVersion:this.tcfPolicyVersion,lastUpdated:this.lastUpdated,purposes:this.clonePurposes(),specialPurposes:this.cloneSpecialPurposes(),features:this.cloneFeatures(),specialFeatures:this.cloneSpecialFeatures(),stacks:this.cloneStacks(),...this.dataCategories?{dataCategories:this.cloneDataCategories()}:{},vendors:this.cloneVendors()}}cloneSpecialFeatures(){let e={};for(let t of Object.keys(this.specialFeatures))e[t]=N.cloneFeature(this.specialFeatures[t]);return e}cloneFeatures(){let e={};for(let t of Object.keys(this.features))e[t]=N.cloneFeature(this.features[t]);return e}cloneStacks(){let e={};for(let t of Object.keys(this.stacks))e[t]=N.cloneStack(this.stacks[t]);return e}cloneDataCategories(){let e={};for(let t of Object.keys(this.dataCategories))e[t]=N.cloneDataCategory(this.dataCategories[t]);return e}cloneSpecialPurposes(){let e={};for(let t of Object.keys(this.specialPurposes))e[t]=N.clonePurpose(this.specialPurposes[t]);return e}clonePurposes(){let e={};for(let t of Object.keys(this.purposes))e[t]=N.clonePurpose(this.purposes[t]);return e}static clonePurpose(e){return{id:e.id,name:e.name,description:e.description,...e.descriptionLegal?{descriptionLegal:e.descriptionLegal}:{},...e.illustrations?{illustrations:Array.from(e.illustrations)}:{}}}static cloneFeature(e){return{id:e.id,name:e.name,description:e.description,...e.descriptionLegal?{descriptionLegal:e.descriptionLegal}:{},...e.illustrations?{illustrations:Array.from(e.illustrations)}:{}}}static cloneDataCategory(e){return{id:e.id,name:e.name,description:e.description}}static cloneStack(e){return{id:e.id,name:e.name,description:e.description,purposes:Array.from(e.purposes),specialFeatures:Array.from(e.specialFeatures)}}static cloneDataRetention(e){return{..."number"==typeof e.stdRetention?{stdRetention:e.stdRetention}:{},purposes:{...e.purposes},specialPurposes:{...e.specialPurposes}}}static cloneVendorUrls(e){return e.map(e=>({langId:e.langId,privacy:e.privacy,...e.legIntClaim?{legIntClaim:e.legIntClaim}:{}}))}static cloneVendor(e){return{id:e.id,name:e.name,purposes:Array.from(e.purposes),legIntPurposes:Array.from(e.legIntPurposes),flexiblePurposes:Array.from(e.flexiblePurposes),specialPurposes:Array.from(e.specialPurposes),features:Array.from(e.features),specialFeatures:Array.from(e.specialFeatures),...e.overflow?{overflow:{httpGetLimit:e.overflow.httpGetLimit}}:{},..."number"==typeof e.cookieMaxAgeSeconds||null===e.cookieMaxAgeSeconds?{cookieMaxAgeSeconds:e.cookieMaxAgeSeconds}:{},...void 0!==e.usesCookies?{usesCookies:e.usesCookies}:{},...e.policyUrl?{policyUrl:e.policyUrl}:{},...void 0!==e.cookieRefresh?{cookieRefresh:e.cookieRefresh}:{},...void 0!==e.usesNonCookieAccess?{usesNonCookieAccess:e.usesNonCookieAccess}:{},...e.dataRetention?{dataRetention:this.cloneDataRetention(e.dataRetention)}:{},...e.urls?{urls:this.cloneVendorUrls(e.urls)}:{},...e.dataDeclaration?{dataDeclaration:Array.from(e.dataDeclaration)}:{},...e.deviceStorageDisclosureUrl?{deviceStorageDisclosureUrl:e.deviceStorageDisclosureUrl}:{},...e.deletedDate?{deletedDate:e.deletedDate}:{}}}cloneVendors(){let e={};for(let t of Object.keys(this.fullVendorList))e[t]=N.cloneVendor(this.fullVendorList[t]);return e}async changeLanguage(e){let t=e;try{t=N.consentLanguages.parseLanguage(e)}catch(e){throw new c("Error during parsing the language: "+e.message)}let s=e.toUpperCase();if((t.toLowerCase()!==N.DEFAULT_LANGUAGE.toLowerCase()||N.LANGUAGE_CACHE.has(s))&&t!==this.lang_)if(this.lang_=t,N.LANGUAGE_CACHE.has(s)){let e=N.LANGUAGE_CACHE.get(s);for(let t in e)e.hasOwnProperty(t)&&(this[t]=e[t])}else{let e=N.baseUrl+N.languageFilename.replace("[LANG]",this.lang_.toLowerCase());try{await this.fetchJson(e),this.cacheLang_=s,this.cacheLanguage()}catch(e){throw new c("unable to load language: "+e.message)}}}get language(){return this.lang_}isVendorList(e){return void 0!==e&&void 0!==e.vendors}populate(e){this.purposes=e.purposes,this.specialPurposes=e.specialPurposes,this.features=e.features,this.specialFeatures=e.specialFeatures,this.stacks=e.stacks,this.dataCategories=e.dataCategories,this.isVendorList(e)&&(this.gvlSpecificationVersion=e.gvlSpecificationVersion,this.tcfPolicyVersion=e.tcfPolicyVersion,this.vendorListVersion=e.vendorListVersion,this.lastUpdated=e.lastUpdated,"string"==typeof this.lastUpdated&&(this.lastUpdated=new Date(this.lastUpdated)),this.vendors_=e.vendors,this.fullVendorList=e.vend
1ors,this.mapVendors(),this.isReady_=!0,this.isLatest&&N.CACHE.set(N.LATEST_CACHE_KEY,this.getJson()),N.CACHE.has(this.vendorListVersion)||N.CACHE.set(this.vendorListVersion,this.getJson())),this.cacheLanguage()}mapVendors(e){this.byPurposeVendorMap={},this.bySpecialPurposeVendorMap={},this.byFeatureVendorMap={},this.bySpecialFeatureVendorMap={},Object.keys(this.purposes).forEach(e=>{this.byPurposeVendorMap[e]={legInt:new Set,consent:new Set,flexible:new Set}}),Object.keys(this.specialPurposes).forEach(e=>{this.bySpecialPurposeVendorMap[e]=new Set}),Object.keys(this.features).forEach(e=>{this.byFeatureVendorMap[e]=new Set}),Object.keys(this.specialFeatures).forEach(e=>{this.bySpecialFeatureVendorMap[e]=new Set}),Array.isArray(e)||(e=Object.keys(this.fullVendorList).map(e=>+e)),this.vendorIds=new Set(e),this.vendors_=e.reduce((e,t)=>{let s=this.vendors_[String(t)];return s&&void 0===s.deletedDate&&(s.purposes.forEach(e=>{this.byPurposeVendorMap[String(e)].consent.add(t)}),s.specialPurposes.forEach(e=>{this.bySpecialPurposeVendorMap[String(e)].add(t)}),s.legIntPurposes.forEach(e=>{this.byPurposeVendorMap[String(e)].legInt.add(t)}),s.flexiblePurposes&&s.flexiblePurposes.forEach(e=>{this.byPurposeVendorMap[String(e)].flexible.add(t)}),s.features.forEach(e=>{this.byFeatureVendorMap[String(e)].add(t)}),s.specialFeatures.forEach(e=>{this.bySpecialFeatureVendorMap[String(e)].add(t)}),e[t]=s),e},{})}getFilteredVendors(e,t,s,r){let i=e.charAt(0).toUpperCase()+e.slice(1),n={};return("purpose"===e&&s?this["by"+i+"VendorMap"][String(t)][s]:this["by"+(r?"Special":"")+i+"VendorMap"][String(t)]).forEach(e=>{n[String(e)]=this.vendors[String(e)]}),n}getVendorsWithConsentPurpose(e){return this.getFilteredVendors("purpose",e,"consent")}getVendorsWithLegIntPurpose(e){return this.getFilteredVendors("purpose",e,"legInt")}getVendorsWithFlexiblePurpose(e){return this.getFilteredVendors("purpose",e,"flexible")}getVendorsWithSpecialPurpose(e){return this.getFilteredVendors("purpose",e,void 0,!0)}getVendorsWithFeature(e){return this.getFilteredVendors("feature",e)}getVendorsWithSpecialFeature(e){return this.getFilteredVendors("feature",e,void 0,!0)}get vendors(){return this.vendors_}narrowVendorsTo(e){this.mapVendors(e)}get isReady(){return this.isReady_}clone(){let e=new N(this.getJson());return this.lang_!==N.DEFAULT_LANGUAGE&&e.changeLanguage(this.lang_),e}static isInstanceOf(e){return"object"==typeof e&&"function"==typeof e.narrowVendorsTo}}class U extends g{static consentLanguages=N.consentLanguages;isServiceSpecific_=!0;supportOOB_=!1;useNonStandardTexts_=!1;purposeOneTreatment_=!1;publisherCountryCode_="AA";version_=2;consentScreen_=0;policyVersion_=5;consentLanguage_="EN";cmpId_=0;cmpVersion_=0;vendorListVersion_=0;numCustomPurposes_=0;gvl_;created;lastUpdated;specialFeatureOptins=new C;purposeConsents=new C;purposeLegitimateInterests=new C;publisherConsents=new C;publisherLegitimateInterests=new C;publisherCustomConsents=new C;publisherCustomLegitimateInterests=new C;customPurposes;vendorConsents=new C;vendorLegitimateInterests=new C;vendorsDisclosed=new C;vendorsAllowed=new C;publisherRestrictions=new f;constructor(e){super(),e&&(this.gvl=e),this.updated()}set gvl(e){N.isInstanceOf(e)||(e=new N(e)),this.gvl_=e,this.publisherRestrictions.gvl=e}get gvl(){return this.gvl_}set cmpId(e){if(Number.isInteger(e=Number(e))&&e>1)this.cmpId_=e;else throw new u("cmpId",e)}get cmpId(){return this.cmpId_}set cmpVersion(e){if(Number.isInteger(e=Number(e))&&e>-1)this.cmpVersion_=e;else throw new u("cmpVersion",e)}get cmpVersion(){return this.cmpVersion_}set consentScreen(e){if(Number.isInteger(e=Number(e))&&e>-1)this.consentScreen_=e;else throw new u("consentScreen",e)}get consentScreen(){return this.consentScreen_}set consentLanguage(e){this.consentLanguage_=e}get consentLanguage(){return this.consentLanguage_}set publisherCountryCode(e){if(/^([A-z]){2}$/.test(e))this.publisherCountryCode_=e.toUpperCase();else throw new u("publisherCountryCode",e)}get publisherCountryCode(){return this.publisherCountryCode_}set vendorListVersion(e){if((e=0|Number(e))<0)throw new u("vendorListVersion",e);this.vendorListVersion_=e}get vendorListVersion(){return this.gvl?this.gvl.vendorListVersion:this.vendorListVersion_}set policyVersion(e){if(this.policyVersion_=parseInt(e,10),this.policyVersion_<0)throw new u("policyVersion",e)}get policyVersion(){return this.gvl?this.gvl.tcfPolicyVersion:this.policyVersion_}set version(e){this.version_=parseInt(e,10)}get version(){return this.version_}set isServiceSpecific(e){this.isServiceSpecific_=e}get isServiceSpecific(){return this.isServiceSpecific_}set useNonStandardTexts(e){this.useNonStandardTexts_=e}get useNonStandardTexts(){return this.useNonStandardTexts_}set supportOOB(e){this.supportOOB_=e}get supportOOB(){return this.supportOOB_}set purposeOneTreatment(e){this.purposeOneTreatment_=e}get purposeOneTreatment(){return this.purposeOneTreatment_}setAllVendorConsents(){this.vendorConsents.set(this.gvl.vendors)}unsetAllVendorConsents(){this.vendorConsents.empty()}setAllVendorsDisclosed(){this.vendorsDisclosed.set(this.gvl.vendors)}unsetAllVendorsDisclosed(){this.vendorsDisclosed.empty()}setAllVendorsAllowed(){this.vendorsAllowed.set(this.gvl.vendors)}unsetAllVendorsAllowed(){this.vendorsAllowed.empty()}setAllVendorLegitimateInterests(){this.vendorLegitimateInterests.set(this.gvl.vendors)}unsetAllVendorLegitimateInterests(){this.vendorLegitimateInterests.empty()}setAllPurposeConsents(){this.purposeConsents.set(this.gvl.purposes)}unsetAllPurposeConsents(){this.purposeConsents.empty()}setAllPurposeLegitimateInterests(){this.purposeLegitimateInterests.set(this.gvl.purposes)}unsetAllPurposeLegitimateInterests(){this.purposeLegitimateInterests.empty()}setAllSpecialFeatureOptins(){this.specialFeatureOptins.set(this.gvl.specialFeatures)}unsetAllSpecialFeatureOptins(){this.specialFeatureOptins.empty()}setAll(){this.setAllVendorConsents(),this.setAllPurposeLegitimateInterests(),this.setAllSpecialFeatureOptins(),this.setAllPurposeConsents(),this.setAllVendorLegitimateInterests()}unsetAll(){this.unsetAllVendorConsents(),this.unsetAllPurposeLegitimateInterests(),this.unsetAllSpecialFeatureOptins(),this.unsetAllPurposeConsents(),this.unsetAllVendorLegitimateInterests()}get numCustomPurposes(){let e=this.numCustomPurposes_;
1return"object"==typeof this.customPurposes&&(e=parseInt(Object.keys(this.customPurposes).sort((e,t)=>Number(e)-Number(t)).pop(),10)),e}set numCustomPurposes(e){if(this.numCustomPurposes_=parseInt(e,10),this.numCustomPurposes_<0)throw new u("numCustomPurposes",e)}updated(){let e=new Date,t=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()));this.created=t,this.lastUpdated=t}}class D{static encode(e,t){let s,r="";return e=P.process(e,t),(s=Array.isArray(t?.segments)?t.segments:new O(e,t)[""+e.version]).forEach((t,i)=>{let n="";i<s.length-1&&(n="."),r+=T.encode(e,t)+n}),r}static decode(e,t){let s=e.split("."),r=s.length;t||(t=new U);for(let e=0;e<r;e++){let r=s[e],i=p.decode(r.charAt(0)).substr(0,E.segmentType),n=v.ID_TO_KEY[I.decode(i,E.segmentType).toString()];T.decode(r,t,n)}return t}}}}]);
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.