!function(){"use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,s=arguments.length;n0&&r[r.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]t)throw new TypeError;for(var s=Math.floor(Math.random()*(t+1-e))+e,r="",i=0;i2&&"string"==typeof e[2]&&e[2].length>0?e[2]:null)+"-disqus"}}catch(e){t=s.location.hostname}return 0===t.indexOf("www.")&&(t=t.replace("www.","")),t}(),E=!1,0!==Object.keys(O).length)return[3,5];(S=new URL("https://"+w+"/websiteconfig")).searchParams.set("bt_env",T.bt_env||"prod"),S.searchParams.set("o",b),S.searchParams.set("w",m),n.label=1;case 1:return n.trys.push([1,4,,5]),[4,fetch(S.toString())];case 2:if(!(C=n.sent()).ok)throw new Error;return[4,C.json()];case 3:return L=n.sent(),t.websiteID=L.tagData.w,t.contentEnabled=L.tagData.ce,t.mobileContentEnabled=L.tagData.me,t.widget=null!==(e=L.tagData.widget)&&void 0!==e&&e,[2,{siteInfo:t,bundleData:L.bundleData,rlSettings:L.messageWall,checksum:L.checksum}];case 4:return n.sent(),[3,5];case 5:return m&&m in O?(D=O[m],t.websiteID=null!==(r=D.w)&&void 0!==r?r:D.website_id,t.contentEnabled=null!==(i=D.ce)&&void 0!==i?i:D.content_enabled,t.mobileContentEnabled=null!==(a=D.me)&&void 0!==a?a:D.mobile_content_enabled,t.widget=null!==(c=D.widget)&&void 0!==c&&c,E=!0):(A=Object.keys(O).reduce((function(e,t){var n=t.toLowerCase(),r=m.indexOf(n)>-1?m.indexOf(n):s.location.hostname.indexOf(n);return r>-1&&(!e||re.site.length)?{site:t,indexInHostname:r}:e}),null))&&(E=!0,D=O[A.site],t.websiteID=null!==(l=D.w)&&void 0!==l?l:D.website_id,t.contentEnabled=null!==(u=D.ce)&&void 0!==u?u:D.content_enabled,t.mobileContentEnabled=null!==(v=D.me)&&void 0!==v?v:D.mobile_content_enabled,t.widget=null!==(g=D.widget)&&void 0!==g&&g),E?(R=function(e){var t;return(null===(t=null==I?void 0:I.websites)||void 0===t?void 0:t[e])||(null==I?void 0:I.org)}(t.websiteID),[2,{siteInfo:t,rlSettings:R}]):(d(1)&&(P={domain:m,orgID:parseInt(b)},function(e,t){new Promise((function(n,s){var r=new window.XMLHttpRequest;r.open("POST",e,!0),r.onerror=function(){s("Error in get request")},r.onload=function(){n(r.responseText)},r.send(t)}))}("https://"+_+"/events/unknown_domains?upapi=true&tid="+encodeURIComponent(V.traceID)+"&cv="+encodeURIComponent(y),h(P))),[2,{siteInfo:t}])}}))}))}();function M(){return F}F.then((function(e){window.__bt_tag_d={orgID:b,domain:w,siteInfo:e.siteInfo,apiDomain:_,version:y,websitesData:O}}));class j extends Error{constructor(e){super(e),this.name="DecodingError"}}class H extends Error{constructor(e){super(e),this.name="EncodingError"}}class G extends Error{constructor(e){super(e),this.name="GVLError"}}class K extends Error{constructor(e,t){super(`invalid value ${t} passed for ${e} ${arguments.length>2&&void 0!==arguments[2]?arguments[2]:""}`),this.name="TCModelError"}}class z{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 H("Invalid bitField");const t=e.length%this.LCM;e+=t?"0".repeat(this.LCM-t):"";let n="";for(let t=0;t{const n=this.deepClone(this[t]);void 0!==n&&(e[t]=n)})),e}deepClone(e){const 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();if(e instanceof Date)return new Date(e.getTime());if(void 0!==e[Symbol.iterator]){const t=[];for(const n of e)t.push(this.deepClone(n));return e instanceof Array?t:new e.constructor(t)}{const t={};for(const n in e)e.hasOwnProperty(n)&&(t[n]=this.deepClone(e[n]));return t}}}}class q extends W{root=null;getRoot(){return this.root}isEmpty(){return!this.root}add(e){const t={value:e,left:null,right:null};let n;if(this.isEmpty())this.root=t;else for(n=this.root;;)if(en.value))break;if(null===n.right){n.right=t;break}n=n.right}}get(){const e=[];let t=this.root;for(;t;)if(t.left){let n=t.left;for(;n.right&&n.right!=t;)n=n.right;n.right==t?(n.right=null,e.push(t.value),t=t.right):(n.right=t,t=t.left)}else e.push(t.value),t=t.right;return e}contains(e){let t=!1,n=this.root;for(;n;){if(n.value===e){t=!0;break}e>n.value?n=n.right:e0&&void 0!==arguments[0]?arguments[0]:this.root;for(;t;)t.left?t=t.left:(e=t.value,t=null);return e}max(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.root;for(;t;)t.right?t=t.right:(e=t.value,t=null);return e}remove(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.root,n=null,s="left";for(;t;)if(et.value)n=t,t=t.right,s="right";else{if(t.left||t.right)if(t.left)if(t.right){const e=this.min(t.right);this.remove(e,t.right),t.value=e}else n?n[s]=t.left:this.root=t.left;else n?n[s]=t.right:this.root=t.right;else n?n[s]=null:this.root=null;t=null}}static build(e){if(e&&0!==e.length){if(1===e.length){const t=new q;return t.add(e[0]),t}{const t=e.length>>1,n=new q;n.add(e[t]);const s=n.getRoot();if(s){if(t+10){const n=q.build(e.slice(0,t-1));s.left=n?n.getRoot():null}}return n}}return null}}class ${static langSet=new Set(["BG","CA","CS","DA","DE","EL","EN","ES","ET","FI","FR","HR","HU","IT","JA","LT","LV","MT","NL","NO","PL","PT","RO","RU","SK","SL","SV","TR","ZH"]);has(e){return $.langSet.has(e)}forEach(e){$.langSet.forEach(e)}get size(){return $.langSet.size}}class J{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 useNonStandardStacks="useNonStandardStacks";static vendorConsents="vendorConsents";static vendorLegitimateInterests="vendorLegitimateInterests";static vendorListVersion="vendorListVersion";static vendorsAllowed="vendorsAllowed";static vendorsDisclosed="vendorsDisclosed";static version="version"}!function(e){e[e.NOT_ALLOWED=0]="NOT_ALLOWED",e[e.REQUIRE_CONSENT=1]="REQUIRE_CONSENT",e[e.REQUIRE_LI=2]="REQUIRE_LI"}(k||(k={}));class X extends W{static hashSeparator="-";purposeId_;restrictionType;constructor(e,t){super(),void 0!==e&&(this.purposeId=e),void 0!==t&&(this.restrictionType=t)}static unHash(e){const t=e.split(this.hashSeparator),n=new X;if(2!==t.length)throw new K("hash",e);return n.purposeId=parseInt(t[0],10),n.restrictionType=parseInt(t[1],10),n}get hash(){if(!this.isValid())throw new Error("cannot hash invalid PurposeRestriction");return`${this.purposeId}${X.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===k.NOT_ALLOWED||this.restrictionType===k.REQUIRE_CONSENT||this.restrictionType===k.REQUIRE_LI)}isSameAs(e){return this.purposeId===e.purposeId&&this.restrictionType===e.restrictionType}}class Q extends W{bitLength=0;map=new Map;gvl_;has(e){return this.map.has(e)}isOkToHave(e,t,n){let s=!0;if(this.gvl?.vendors){const r=this.gvl.vendors[n];if(r)if(e===k.NOT_ALLOWED)s=r.legIntPurposes.includes(t)||r.purposes.includes(t);else if(r.flexiblePurposes.length)switch(e){case k.REQUIRE_CONSENT:s=r.flexiblePurposes.includes(t)&&r.legIntPurposes.includes(t);break;case k.REQUIRE_LI:s=r.flexiblePurposes.includes(t)&&r.purposes.includes(t)}else s=!1;else s=!1}return s}add(e,t){if(this.isOkToHave(t.restrictionType,t.purposeId,e)){const n=t.hash;this.has(n)||(this.map.set(n,new q),this.bitLength=0),this.map.get(n).add(e)}}restrictPurposeToLegalBasis(e){const t=this.gvl.vendorIds,n=e.hash,s=function(){let e;for(e of t);return e}(),r=[...Array(s).keys()].map((e=>e+1));for(let e=1;e<=s;e++)this.has(n)||(this.map.set(n,q.build(r)),this.bitLength=0),this.map.get(n).add(e)}getVendors(e){let t=[];if(e){const n=e.hash;this.has(n)&&(t=this.map.get(n).get())}else{const e=new Set;this.map.forEach((t=>{t.get().forEach((t=>{e.add(t)}))})),t=Array.from(e)}return t}getRestrictionType(e,t){let n;return this.getRestrictions(e).forEach((e=>{e.purposeId===t&&(void 0===n||n>e.restrictionType)&&(n=e.restrictionType)})),n}vendorHasRestriction(e,t){let n=!1;const s=this.getRestrictions(e);for(let e=0;e{e=Math.max(t.max(),e)})),e}getRestrictions(e){const t=[];return this.map.forEach(((n,s)=>{e?n.contains(e)&&t.push(X.unHash(s)):t.push(X.unHash(s))})),t}getPurposes(){const e=new Set;return this.map.forEach(((t,n)=>{e.add(X.unHash(n).purposeId)})),Array.from(e)}remove(e,t){const n=t.hash,s=this.map.get(n);s&&(s.remove(e),s.isEmpty()&&(this.map.delete(n),this.bitLength=0))}set gvl(e){this.gvl_||(this.gvl_=e,this.map.forEach(((e,t)=>{const n=X.unHash(t);e.get().forEach((t=>{this.isOkToHave(n.restrictionType,n.purposeId,t)||e.remove(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"}(x||(x={})),function(e){e.CORE="core",e.VENDORS_DISCLOSED="vendorsDisclosed",e.VENDORS_ALLOWED="vendorsAllowed",e.PUBLISHER_TC="publisherTC"}(N||(N={}));class Y{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 Z extends W{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=t&&Object.keys(e).every((t=>{let n=Number.isInteger(parseInt(t,10));return n=n&&this.isValidNumber(e[t].id),n=n&&void 0!==e[t].name,n})),t}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))throw new K("set()",e,"must be positive integer array, positive integer, Set, or IntMap");this.set_.add(e),this.maxId_=Math.max(this.maxId,e),this.bitLength=0}}empty(){this.set_=new Set}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)}}class ee{static[J.cmpId]=12;static[J.cmpVersion]=12;static[J.consentLanguage]=12;static[J.consentScreen]=6;static[J.created]=36;static[J.isServiceSpecific]=1;static[J.lastUpdated]=36;static[J.policyVersion]=6;static[J.publisherCountryCode]=12;static[J.publisherLegitimateInterests]=24;static[J.publisherConsents]=24;static[J.purposeConsents]=24;static[J.purposeLegitimateInterests]=24;static[J.purposeOneTreatment]=1;static[J.specialFeatureOptins]=12;static[J.useNonStandardStacks]=1;static[J.vendorListVersion]=12;static[J.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 te{static encode(e){return String(Number(e))}static decode(e){return"1"===e}}class ne{static encode(e,t){let n;if("string"==typeof e&&(e=parseInt(e,10)),n=e.toString(2),n.length>t||e<0)throw new H(`${e} too large to encode into ${t}`);return n.length25||s<0||s>25)throw new H(`invalid language code: ${e}`);if(t%2==1)throw new H(`numBits must be even, ${t} is not valid`);t/=2;return ne.encode(n,t)+ne.encode(s,t)}static decode(e,t){let n;if(t!==e.length||e.length%2)throw new j("invalid bit length for language");{const t=65,s=e.length/2,r=ne.decode(e.slice(0,s),s)+t,i=ne.decode(e.slice(s),s)+t;n=String.fromCharCode(r)+String.fromCharCode(i)}return n}}class oe{static encode(e){let t=ne.encode(e.numRestrictions,ee.numRestrictions);return e.isEmpty()||e.getRestrictions().forEach((n=>{t+=ne.encode(n.purposeId,ee.purposeId),t+=ne.encode(n.restrictionType,ee.restrictionType);const s=e.getVendors(n),r=s.length;let i=0,o=0,a="";for(let t=0;t{for(;++e<=c&&!l.has(e););return e};if(t===r-1||s[t+1]>u(n)){const e=!(n===o);a+=te.encode(e),a+=ne.encode(o,ee.vendorId),e&&(a+=ne.encode(n,ee.vendorId)),o=0}}t+=ne.encode(i,ee.numEntries),t+=a})),t}static decode(e){let t=0;const n=new Q,s=ne.decode(e.substr(t,ee.numRestrictions),ee.numRestrictions);t+=ee.numRestrictions;for(let r=0;r{if(i+=te.encode(r),n=e.maxId>c&&l{const t=1===e.length;n+=te.encode(!t),n+=ne.encode(e[0],ee.vendorId),t||(n+=ne.encode(e[1],ee.vendorId))})),n}}function ce(){return{[J.version]:ne,[J.created]:se,[J.lastUpdated]:se,[J.cmpId]:ne,[J.cmpVersion]:ne,[J.consentScreen]:ne,[J.consentLanguage]:ie,[J.vendorListVersion]:ne,[J.policyVersion]:ne,[J.isServiceSpecific]:te,[J.useNonStandardStacks]:te,[J.specialFeatureOptins]:re,[J.purposeConsents]:re,[J.purposeLegitimateInterests]:re,[J.purposeOneTreatment]:te,[J.publisherCountryCode]:ie,[J.vendorConsents]:ae,[J.vendorLegitimateInterests]:ae,[J.publisherRestrictions]:oe,segmentType:ne,[J.vendorsDisclosed]:ae,[J.vendorsAllowed]:ae,[J.publisherConsents]:re,[J.publisherLegitimateInterests]:re,[J.numCustomPurposes]:ne,[J.publisherCustomConsents]:re,[J.publisherCustomLegitimateInterests]:re}}class le{1={[N.CORE]:[J.version,J.created,J.lastUpdated,J.cmpId,J.cmpVersion,J.consentScreen,J.consentLanguage,J.vendorListVersion,J.purposeConsents,J.vendorConsents]};2={[N.CORE]:[J.version,J.created,J.lastUpdated,J.cmpId,J.cmpVersion,J.consentScreen,J.consentLanguage,J.vendorListVersion,J.policyVersion,J.isServiceSpecific,J.useNonStandardStacks,J.specialFeatureOptins,J.purposeConsents,J.purposeLegitimateInterests,J.purposeOneTreatment,J.publisherCountryCode,J.vendorConsents,J.vendorLegitimateInterests,J.publisherRestrictions],[N.PUBLISHER_TC]:[J.publisherConsents,J.publisherLegitimateInterests,J.numCustomPurposes,J.publisherCustomConsents,J.publisherCustomLegitimateInterests],[N.VENDORS_ALLOWED]:[J.vendorsAllowed],[N.VENDORS_DISCLOSED]:[J.vendorsDisclosed]}}class ue{1=[N.CORE];2=[N.CORE];constructor(e,t){if(2===e.version)if(e.isServiceSpecific)this[2].push(N.PUBLISHER_TC);else{const n=!(!t||!t.isForVendors);n&&!0!==e[J.supportOOB]||this[2].push(N.VENDORS_DISCLOSED),n&&(e[J.supportOOB]&&e[J.vendorsAllowed].size>0&&this[2].push(N.VENDORS_ALLOWED),this[2].push(N.PUBLISHER_TC))}}}class de{static fieldSequence=new le;static encode(e,t){let n;try{n=this.fieldSequence[String(e.version)][t]}catch(n){throw new H(`Unable to encode version: ${e.version}, segment: ${t}`)}let s="";t!==N.CORE&&(s=ne.encode(Y.KEY_TO_ID[t],ee.segmentType));const r=ce();return n.forEach((n=>{const i=e[n],o=r[n];let a=ee[n];void 0===a&&this.isPublisherCustom(n)&&(a=Number(e[J.numCustomPurposes]));try{s+=o.encode(i,a)}catch(e){throw new H(`Error encoding ${t}->${n}: ${e.message}`)}})),z.encode(s)}static decode(e,t,n){const s=z.decode(e);let r=0;n===N.CORE&&(t.version=ne.decode(s.substr(r,ee[J.version]),ee[J.version])),n!==N.CORE&&(r+=ee.segmentType);const i=this.fieldSequence[String(t.version)][n],o=ce();return i.forEach((e=>{const n=o[e];let i=ee[e];if(void 0===i&&this.isPublisherCustom(e)&&(i=Number(t[J.numCustomPurposes])),0!==i){const o=s.substr(r,i);if(t[e]=n===ae?n.decode(o,t.version):n.decode(o,i),Number.isInteger(i))r+=i;else{if(!Number.isInteger(t[e].bitLength))throw new j(e);r+=t[e].bitLength}}})),t}static isPublisherCustom(e){return 0===e.indexOf("publisherCustom")}}class pe{static processor=[e=>e,(e,t)=>{e.publisherRestrictions.gvl=t,e.purposeLegitimateInterests.unset(1);const n=new Map;return n.set("legIntPurposes",e.vendorLegitimateInterests),n.set("purposes",e.vendorConsents),n.forEach(((n,s)=>{n.forEach(((r,i)=>{if(r){const r=t.vendors[i];if(!r||r.deletedDate)n.unset(i);else if(0===r[s].length)if("legIntPurposes"===s&&0===r.purposes.length&&0===r.legIntPurposes.length&&r.specialPurposes.length>0);else if(e.isServiceSpecific)if(0===r.flexiblePurposes.length)n.unset(i);else{const t=e.publisherRestrictions.getRestrictions(i);let r=!1;for(let e=0,n=t.length;e0&&t?.version<=this.processor.length?e.version=t.version:e.version=this.processor.length;const s=e.version-1;if(!this.processor[s])throw new H(`Invalid version: ${e.version}`);return this.processor[s](e,n)}}class he{static absCall(e,t,n,s){return new Promise(((r,i)=>{const o=new XMLHttpRequest;o.withCredentials=n,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){}r(e)}else i(new Error(`HTTP Status: ${o.status} response type: ${o.responseType}`))})),o.addEventListener("error",(()=>{i(new Error("error"))})),o.addEventListener("abort",(()=>{i(new Error("aborted"))})),null===t?o.open("GET",e,!0):o.open("POST",e,!0),o.responseType="json",o.timeout=s,o.ontimeout=()=>{i(new Error("Timeout "+s+"ms "+e))},o.send(t)}))}static post(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.absCall(e,JSON.stringify(t),n,s)}static fetch(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.absCall(e,null,t,n)}}class ve extends W{static LANGUAGE_CACHE=new Map;static CACHE=new Map;static LATEST_CACHE_KEY=0;static DEFAULT_LANGUAGE="EN";static consentLanguages=new $;static baseUrl_;static set baseUrl(e){if(/^https?:\/\/vendorlist\.consensu\.org\//.test(e))throw new G("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;byPurposeVendorMap;bySpecialPurposeVendorMap;byFeatureVendorMap;bySpecialFeatureVendorMap;stacks;lang_;isLatest=!1;constructor(e){super();let t=ve.baseUrl;if(this.lang_=ve.DEFAULT_LANGUAGE,this.isVendorList(e))this.populate(e),this.readyPromise=Promise.resolve();else{if(!t)throw new G("must specify GVL.baseUrl before loading GVL json");if(e>0){const n=e;ve.CACHE.has(n)?(this.populate(ve.CACHE.get(n)),this.readyPromise=Promise.resolve()):(t+=ve.versionedFilename.replace("[VERSION]",String(n)),this.readyPromise=this.fetchJson(t))}else ve.CACHE.has(ve.LATEST_CACHE_KEY)?(this.populate(ve.CACHE.get(ve.LATEST_CACHE_KEY)),this.readyPromise=Promise.resolve()):(this.isLatest=!0,this.readyPromise=this.fetchJson(t+ve.latestFilename))}}static emptyLanguageCache(e){let t=!1;return void 0===e&&ve.LANGUAGE_CACHE.size>0?(ve.LANGUAGE_CACHE=new Map,t=!0):"string"==typeof e&&this.consentLanguages.has(e.toUpperCase())&&(ve.LANGUAGE_CACHE.delete(e.toUpperCase()),t=!0),t}static emptyCache(e){let t=!1;return Number.isInteger(e)&&e>=0?(ve.CACHE.delete(e),t=!0):void 0===e&&(ve.CACHE=new Map,t=!0),t}cacheLanguage(){ve.LANGUAGE_CACHE.has(this.lang_)||ve.LANGUAGE_CACHE.set(this.lang_,{purposes:this.purposes,specialPurposes:this.specialPurposes,features:this.features,specialFeatures:this.specialFeatures,stacks:this.stacks})}async fetchJson(e){try{this.populate(await he.fetch(e))}catch(e){throw new G(e.message)}}getJson(){return JSON.parse(JSON.stringify({gvlSpecificationVersion:this.gvlSpecificationVersion,vendorListVersion:this.vendorListVersion,tcfPolicyVersion:this.tcfPolicyVersion,lastUpdated:this.lastUpdated,purposes:this.purposes,specialPurposes:this.specialPurposes,features:this.features,specialFeatures:this.specialFeatures,stacks:this.stacks,vendors:this.fullVendorList}))}async changeLanguage(e){const t=e.toUpperCase();if(!ve.consentLanguages.has(t))throw new G(`unsupported language ${e}`);if(t!==this.lang_)if(this.lang_=t,ve.LANGUAGE_CACHE.has(t)){const e=ve.LANGUAGE_CACHE.get(t);for(const t in e)e.hasOwnProperty(t)&&(this[t]=e[t])}else{const t=ve.baseUrl+ve.languageFilename.replace("[LANG]",e);try{await this.fetchJson(t),this.cacheLanguage()}catch(e){throw new G("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.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.vendors,this.mapVendors(),this.isReady_=!0,this.isLatest&&ve.CACHE.set(ve.LATEST_CACHE_KEY,this.getJson()),ve.CACHE.has(this.vendorListVersion)||ve.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)=>{const n=this.vendors_[String(t)];return n&&void 0===n.deletedDate&&(n.purposes.forEach((e=>{this.byPurposeVendorMap[String(e)].consent.add(t)})),n.specialPurposes.forEach((e=>{this.bySpecialPurposeVendorMap[String(e)].add(t)})),n.legIntPurposes.forEach((e=>{this.byPurposeVendorMap[String(e)].legInt.add(t)})),n.flexiblePurposes&&n.flexiblePurposes.forEach((e=>{this.byPurposeVendorMap[String(e)].flexible.add(t)})),n.features.forEach((e=>{this.byFeatureVendorMap[String(e)].add(t)})),n.specialFeatures.forEach((e=>{this.bySpecialFeatureVendorMap[String(e)].add(t)})),e[t]=n),e}),{})}getFilteredVendors(e,t,n,s){const r=e.charAt(0).toUpperCase()+e.slice(1);let i;const o={};return i="purpose"===e&&n?this["by"+r+"VendorMap"][String(t)][n]:this["by"+(s?"Special":"")+r+"VendorMap"][String(t)],i.forEach((e=>{o[String(e)]=this.vendors[String(e)]})),o}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(){const e=new ve(this.getJson());return this.lang_!==ve.DEFAULT_LANGUAGE&&e.changeLanguage(this.lang_),e}static isInstanceOf(e){return"object"==typeof e&&"function"==typeof e.narrowVendorsTo}}class ge extends W{static consentLanguages=ve.consentLanguages;isServiceSpecific_=!1;supportOOB_=!0;useNonStandardStacks_=!1;purposeOneTreatment_=!1;publisherCountryCode_="AA";version_=2;consentScreen_=0;policyVersion_=2;consentLanguage_="EN";cmpId_=0;cmpVersion_=0;vendorListVersion_=0;numCustomPurposes_=0;gvl_;created;lastUpdated;specialFeatureOptins=new Z;purposeConsents=new Z;purposeLegitimateInterests=new Z;publisherConsents=new Z;publisherLegitimateInterests=new Z;publisherCustomConsents=new Z;publisherCustomLegitimateInterests=new Z;customPurposes;vendorConsents=new Z;vendorLegitimateInterests=new Z;vendorsDisclosed=new Z;vendorsAllowed=new Z;publisherRestrictions=new Q;constructor(e){super(),e&&(this.gvl=e),this.updated()}set gvl(e){ve.isInstanceOf(e)||(e=new ve(e)),this.gvl_=e,this.publisherRestrictions.gvl=e}get gvl(){return this.gvl_}set cmpId(e){if(e=Number(e),!(Number.isInteger(e)&&e>1))throw new K("cmpId",e);this.cmpId_=e}get cmpId(){return this.cmpId_}set cmpVersion(e){if(e=Number(e),!(Number.isInteger(e)&&e>-1))throw new K("cmpVersion",e);this.cmpVersion_=e}get cmpVersion(){return this.cmpVersion_}set consentScreen(e){if(e=Number(e),!(Number.isInteger(e)&&e>-1))throw new K("consentScreen",e);this.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))throw new K("publisherCountryCode",e);this.publisherCountryCode_=e.toUpperCase()}get publisherCountryCode(){return this.publisherCountryCode_}set vendorListVersion(e){if((e=Number(e)>>0)<0)throw new K("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 K("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 useNonStandardStacks(e){this.useNonStandardStacks_=e}get useNonStandardStacks(){return this.useNonStandardStacks_}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_;if("object"==typeof this.customPurposes){const t=Object.keys(this.customPurposes).sort(((e,t)=>Number(e)-Number(t)));e=parseInt(t.pop(),10)}return e}set numCustomPurposes(e){if(this.numCustomPurposes_=parseInt(e,10),this.numCustomPurposes_<0)throw new K("numCustomPurposes",e)}updated(){const e=new Date,t=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()));this.created=t,this.lastUpdated=t}}class fe{static encode(e,t){let n,s="";return e=pe.process(e,t),n=Array.isArray(t?.segments)?t.segments:new ue(e,t)[""+e.version],n.forEach(((t,r)=>{let i="";rt&&(t=s)}return t/100}function it(e,t){if(void 0===t&&(t={}),!e)return null;var n=0,s=1,r=rt(t);return 1===r||(Object.values(t).length&&r<1&&(n=r,s=1-r),Object.keys(e).sort().forEach((function(r){var i=e[r];t[r]={min:Math.trunc(100*n),max:Math.trunc(100*(n+i*s))},n+=i*s}))),t}function ot(e){var t=e.siteInfo,n=e.bundleData,r="latest",i="BT_BUNDLE_VERSION_"+t.websiteID,o="BT_DIGEST_VERSION_"+t.websiteID;!He[t.websiteID]&&(null==n?void 0:n.bundles)&&(He[t.websiteID]=n);var a=function(e,t,n){if(void 0===n&&(n="latest"),!e)return null;if(!t||"object"!=typeof t||Object.keys(t).length<=0)return null;var s={},r=t[e],i=t[0],o=t.global;if((null==r?void 0:r.bundles)&&(s=it(r.bundles)),(null==i?void 0:i.bundles)&&(s=it(i.bundles,s)),(null==o?void 0:o.bundles)&&(s=it(o.bundles,s)),Object.keys(s).length<=0)return null;var a=rt(s);return a<1&&(s[n]={min:Math.trunc(100*a),max:100}),s}(t.websiteID,He,r);if(window.__bt_tag_d&&(window.__bt_tag_d.probabilities=a),a&&!(Object.keys(a).length<=0)){var c=He[t.websiteID]||He[0]||He.global;if(c){var l=c.digest;s.localStorage.getItem(o)!==String(l)&&(s.localStorage.setItem(o,String(l)),s.localStorage.removeItem(i));var d=s.localStorage.getItem(i);if(!d)d=function(e,t){if("number"!=typeof e||e<0||e>100)return null;if(!t||"object"!=typeof t)return null;for(var n=Object.keys(t),s=0;se)return r}return null}(u(100),a)||r,s.localStorage.setItem(i,d);return d===r?void 0:d}}}He={};var at=[];try{at=[[RestrictedCountriesData]]}catch(e){}var ct=5;function lt(e){var t,n;if("ZZ"===D.countryCode){if("function"==typeof window.__bt.customDetectCountry){var r=null===(n=null===(t=window.__bt.customDetectCountry())||void 0===t?void 0:t.toUpperCase)||void 0===n?void 0:n.call(t);if(2===r.length)return void ut(r,at.includes(r))}var i=Me("timing.countryDetection"),o=s.localStorage.getItem("btUserCountryExpiry");!o||parseInt(o)<=Date.now()?fetch("https://api.btloader.com/country?o="+e).then((function(e){return e.json()})).then((function(e){ut(e.country,e.isRestricted),i({cached:!1})})).catch((function(){i({cached:!1,error:!0})})):i({cached:!0})}else ut(D.countryCode,D.isRestricted)}function ut(e,t){s.localStorage.setItem("btUserCountry",e),s.localStorage.setItem("btUserCountryExpiry",String(new Date(Date.now()+6e4*ct).getTime())),s.localStorage.setItem("btUserIsFromRestrictedCountry",String(t))}var dt=function(){function e(e,t,n,s,r){void 0===e&&(e={enabled:!1,script_loading_mode:"inject_from_tag_script",wall_mode:f.soft,allow_render_to_aa_users:!0}),this.rlinkSettings=e,this.scriptSrc=t,this.insertScript=n,this.widget=s,this.isAAEnabled=r}return e.prototype.load=function(){this.shouldLoadRLinkScript()&&(this.cacheRLinkSettings(),this.insertScript(this.scriptSrc,{type:"module"}),window.__bt_rlink_loaded_from_tag=!0)},e.prototype.preventRecovery=function(){var e=!this.rlinkSettings.allow_render_to_aa_users&&this.isAAEnabled,t=this.rlinkSettings.wall_mode===f.hard;return this.rlinkSettings.enabled&&t&&!e},e.prototype.isRecoveryAttributionValid=function(){var e=localStorage.getItem("BT_AM_ATTRIBUTION_EXPIRY");return!!e&&Date.now()g?v.substring(0,g):v)):(c=[10,13,25,28,32,52,69,76,91,755,815],a.cmpVersion=i.cmpVersion,a.gdprApplies=i.gdprApplies,a.tcfPolicyVersion=i.tcfPolicyVersion,a.tcString=i.tcString,i.gdprApplies&&(l={},Object.entries((null===(s=i.vendor)||void 0===s?void 0:s.consents)||{}).forEach((function(e){var t=e[0],n=e[1];c.includes(Number(t))&&(l[t]=n)})),Object.keys(l).length&&(a.vendor={consents:l}),a.purpose=i.purpose)),(p={})[De]=!!r,u=p,d={tcData:a,pageURL:o.href,organizationID:parseInt(b),websiteID:parseInt(t.websiteID),clientVersion:y},[2,fetch(Te("/ce",u),{method:"POST",body:h(d)})]}var v,g}))}))}({siteInfo:L,nlfDetected:P})),x=function(e,t,n,s){var r=new URL("https://"+e);return r.pathname="recovery",r.searchParams.append("w",t),s&&r.searchParams.append("b",s),n&&n.split("&").forEach((function(e){var t=e.split("=");2==t.length&&t[0]&&t[1]&&r.searchParams.append(t[0],t[1])})),r.searchParams.append("upapi","true"),r.toString()}(w,D,"",k),(N=new dt(O,I.script,v,L.widget,R)).load(),U=N.preventRecovery(),!V||U?[3,3]:[4,Se(!1)])):[2];case 2:return(B=H.sent())||null===B?v(x):(((null===(i=o.href)||void 0===i?void 0:i.includes("bt_debug=true"))||"true"===s.localStorage.getItem("bt_debug"))&&window.console&&(F=["%c[Blockthrough - WRN] %c[tag.js] %cConsentless user - do not load %crecovery %cscript","color: #000000; background-color: #FFE0B2","font-weight: bold;","color: #000000; background-color: inherit","font-weight: bold;","color: #000000; background-color: inherit"],window.console.info.apply(window.console,F)),(null===(l=null===(c=null==A?void 0:A.settings)||void 0===c?void 0:c.monetizeConsentlessUsers)||void 0===l?void 0:l._enabled)&&window===window.top&&(j=function(e){var t=p()||s.location.href;return"https://brwsrfrm.com/i/script/"+e+"?ref="+new URL(t).origin}(D),v(j,{crossOrigin:null}))),[3,4];case 3:g({eventName:"AcceptableAdsInit",payload:{detail:!1}}),g({eventName:"uponitInit",payload:{detail:!1}}),H.label=4;case 4:return[2]}}))}))}()}();