forked from microsoft/azurelinux
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathotSDKStub.js.download
1 lines (1 loc) · 22.2 KB
/
otSDKStub.js.download
1
var OneTrust,isDisableOneTrust=!1,data=JSON.parse(document.head.getAttribute("data-client-settings")),language=data.locale.language,market=data.locale.market,geo_country=data.geo_country,subDivision=data.geo_subdivision;"ca"!==market||"fr"!==language&&"en"!==language||"CA"==geo_country&&("Quebec"===subDivision?subDivision="QC":isDisableOneTrust=!(subDivision=""),OneTrust={geolocationResponse:{stateCode:subDivision,countryCode:geo_country}});var OneTrustStub=function(t){"use strict";if(!isDisableOneTrust){if(document.cookie){var e=function(t){return parseInt(t,2)||0};try{let n={};document.cookie.split(";").forEach(function(t){let[e,i]=t.split("=");n[e.trim()]=i});var i=n["eupubconsent-v2"];if(i){i=function(t){for(var e="",i=0,n=t.length;i<n;i+=1){var o=t.charCodeAt(i).toString(2);e+="00000000".slice(0,8-o.length)+o}return e}(function(t){if("function"==typeof atob){var e=t.replace(/_/g,"/").replace(/-/g,"+");try{return atob(e)}catch(t){throw new Error("Unable to decode transparency and consent string")}}if("function"==typeof Buffer)return Buffer.from(t,"base64").toString("binary");throw new Error("Unable to detect base64 decoder")}(i.split(".")[0]));var o=e(i.slice(0,6));if(2!==o)throw new Error("Unsupported transparency and consent string version "+o);var a=i.slice(6,42),i=100*e(a),i=new Date(i);!i||31536e6<=(new Date).getTime()-i.getTime()&&(document.cookie="eupubconsent-v2=;Domain=.msn.com;Path=/;Expires="+new Date(0).toUTCString(),document.cookie="OptanonAlertBoxClosed=;Domain=.msn.com;Path=/;Expires="+new Date(0).toUTCString(),document.cookie="OptanonConsent=;Domain=.msn.com;Path=/;Expires="+new Date(0).toUTCString())}}catch(g){console.log("Encountered Exception"),console.log(g)}}var r,u,l=new function(){this.optanonCookieName="OptanonConsent",this.optanonHtmlGroupData=[],this.optanonHostData=[],this.genVendorsData=[],this.vendorsServiceData=[],this.IABCookieValue="",this.oneTrustIABCookieName="eupubconsent",this.oneTrustIsIABCrossConsentEnableParam="isIABGlobal",this.isStubReady=!0,this.geolocationCookiesParam="geolocation",this.EUCOUNTRIES=["BE","BG","CZ","DK","DE","EE","IE","GR","ES","FR","IT","CY","LV","LT","LU","HU","MT","NL","AT","PL","PT","RO","SI","SK","FI","SE","GB","HR","LI","NO","IS"],this.stubFileName="otSDKStub",this.DATAFILEATTRIBUTE="data-domain-script",this.bannerScriptName="otBannerSdk.js",this.mobileOnlineURL=[],this.isMigratedURL=!1,this.migratedCCTID="[[OldCCTID]]",this.migratedDomainId="[[NewDomainId]]",this.userLocation={country:"",state:""}};(m=h={})[m.Days=1]="Days",m[m.Weeks=7]="Weeks",m[m.Months=30]="Months",m[m.Years=365]="Years",(m=n=n||{}).Name="OTGPPConsent",m[m.ChunkSize=4e3]="ChunkSize",m.ChunkCountParam="GPPCookiesCount",(m=r={}).CPRA="uscav1",m.CCPA="uscav1",m.CDPA="usvav1",m.USNATIONAL="usnatv1",m.COLORADO="uscov1",m.CTDPA="usctv1",m.UCPA="usutv1",m.IAB2V2="tcfeuv2",(m=u={})[m.CPRA=8]="CPRA",m[m.CCPA=8]="CCPA",m[m.CDPA=9]="CDPA",m[m.USNATIONAL=7]="USNATIONAL",m[m.COLORADO=10]="COLORADO",m[m.UCPA=11]="UCPA",m[m.CTDPA=12]="CTDPA",m[m.IAB2V2=2]="IAB2V2";var c,n,s="otpreview",p=(n.Name,(m={})[h.Days]="PCenterVendorListLifespanDay",m[h.Weeks]="LfSpnWk",m[h.Months]="PCenterVendorListLifespanMonth",m[h.Years]="LfSpnYr",g.prototype.camelize=function(t){return t.split("-").map(function(t,e){return 0===e?t:t[0].toUpperCase()+t.slice(1)}).join("")},g.prototype.strToObj=function(t){for(var e={},i=t.split(";").map(function(t){return t.trim()}),n=0,o=void 0;n<i.length;++n)if(/:/.test(i[n])){if(!(o=i[n].split(/:(.+)/))[1])return null;e[this.camelize(o[0])]=o[1].trim()}return e},g);(n=c={}).ping="ping",n.addEventListener="addEventListener",n.removeEventListener="removeEventListener",n.hasSection="hasSection",n.getSection="getSection",n.getField="getField",n.getGPPData="getGPPData";var d=new function(){var s=this;this.LOCATOR_NAME="__gppLocator",this.win=window,this.customInit="CUSTOMINIT",this.init=function(){s.win.__gpp&&"function"==typeof s.win.__gpp||(s.win.__gpp=s.executeGppApi,window.addEventListener("message",s.messageHandler,!1),s.addFrame(s.LOCATOR_NAME))},this.removeGppApi=function(){delete s.win.__gpp;var t=document.querySelectorAll("iframe[name="+s.LOCATOR_NAME+"]")[0];t&&t.parentElement.removeChild(t)},this.executeGppApi=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=null==(i=s.win)?void 0:i.__gpp;if(i.queue=i.queue||[],i.events=i.events||[],!t.length||1===t.length&&"queue"===t[0])return i.queue;if(1===t.length&&"events"===t[0])return i.events;var n=t[0],o=1<t.length?t[1]:null,a=2<t.length?t[2]:null;switch(n){case c.ping:return s.getPingRequest(o);case c.addEventListener:return s.addEventListener(o,a);case c.removeEventListener:return s.removeEventListener(a);default:return void s.addToQueue(n,o,a)}},this.getPingRequest=function(t){var i,n,e={gppVersion:1.1,cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:(i=[],n={},Object.keys(u).forEach(function(t){var e={},t=(e[t]=u[t],Object.assign(e,n));n=t}),Object.keys(r).map(function(t){return{name:t,value:r[t]}}).forEach(function(t){t=n[t.name]+":"+t.value,i.push(t)}),i.filter(function(t,e){return i.indexOf(t)===e})),currentAPI:"",cmpId:Number.parseInt("28"),sectionList:[],applicableSections:[0],gppString:"",parsedSections:{}};return t&&t(e,!0),e},this.addFrame=function(t){var e,i=s.win.document,n=Boolean(s.win.frames[t]);return n||(i.body?((e=i.createElement("iframe")).style.cssText="display:none",e.name=t,e.setAttribute("title","GPP Locator"),i.body.appendChild(e)):setTimeout(function(){s.addFrame(t)},5)),!n},this.addEventListener=function(t,e){var i=s.win.__gpp;return i.events=i.events||[],null!=i&&i.lastId||(i.lastId=0),i.lastId++,i.events.push({id:i.lastId,callback:t,parameter:e}),{eventName:"listenerRegistered",listenerId:i.lastId,data:!0,pingData:s.getPingRequest()}},this.removeEventListener=function(e){var i=!1,t=s.win.__gpp;return t.events=t.events||[],t.events=t.events.filter(function(t){return t.id.toString()!==e.toString()||!(i=!0)}),{eventName:"listenerRemoved",listenerId:e,data:i,pingData:s.getPingRequest()}},this.addToQueue=function(t,e,i){var n=s.win.__gpp;n.queue=n.queue||[],n.queue.push([t,e,i])},this.messageHandler=function(i){var e,n,o="string"==typeof i.data;try{e=o?JSON.parse(i.data):i.data}catch(t){e=null}e&&e.__gppCall&&(n=e.__gppCall,(0,s.win.__gpp)(n.command,function(t,e){t={__gppReturn:{returnValue:t,success:e,callId:n.callId}},i&&i.source&&i.source.postMessage&&i.source.postMessage(o?JSON.stringify(t):t,i.origin||"*")},n.parameter))},this.customInit||this.init()},m=(f.prototype.initConsentSDK=function(){this.initCustomEventPolyfill(),this.ensureHtmlGroupDataInitialised(),this.setStubScriptElement(),this.setOTDataLayer(),this.getParam(),this.fetchBannerSDKDependency(),this.captureNonce()},f.prototype.captureNonce=function(){this.nonce=l.stubScriptElement.nonce||l.stubScriptElement.getAttribute("nonce")||null},f.prototype.fetchBannerSDKDependency=function(){this.setDomainDataFileURL(),this.crossOrigin=l.stubScriptElement.getAttribute("crossorigin")||null,this.previewMode="true"===l.stubScriptElement.getAttribute("data-preview-mode"),this.otFetch(l.bannerDataParentURL,this.getLocation.bind(this))},f.prototype.setDomainIfBulkDomainEnabled=function(t){var e=t&&t.TenantFeatures,i=window.location.hostname,n=t.Domain,o=t.BulkDomainCheckUrl;e&&e.CookieV2BulkDomainManagement&&i!==n&&"PRODUCTION"===t.ScriptType&&((e=window.sessionStorage)&&e.getItem("bulkDomainMgmtEnabled")?this.handleBulkDomainMgmt({isValid:"true"===window.sessionStorage.getItem("bulkDomainMgmtEnabled")},t):(n={location:l.storageBaseURL.replace(/^https?:\/\//,""),domainId:this.domainId,url:i},this.otFetch(o,this.handleBulkDomainMgmt,!1,n,t)))},f.prototype.getLocation=function(t){if(this.setDomainIfBulkDomainEnabled(t),this.updateVersion(t),(t.TenantFeatures&&t.TenantFeatures.CookieV2CSP||t.CookieV2CSPEnabled)&&this.nonce&&(this.setAttributePolyfillIsActive=!0,(new p).implementThePolyfill()),!t.RuleSet[0].Type)return this.iabTypeAdded=!1,window.__tcfapi=this.executeTcfApi,this.intializeIabStub(),this.addBannerSDKScript(t);var e,i=window;i.OneTrust&&i.OneTrust.geolocationResponse?(i=i.OneTrust.geolocationResponse,this.setGeoLocation(i.countryCode,i.stateCode),this.addBannerSDKScript(t)):(i=this.readCookieParam(l.optanonCookieName,l.geolocationCookiesParam))||t.SkipGeolocation?(e=i.split(";")[0],i=i.split(";")[1],this.setGeoLocation(e,i),this.addBannerSDKScript(t)):this.getGeoLocation(t)},f.prototype.handleBulkDomainMgmt=function(t,e){window.sessionStorage&&window.sessionStorage.setItem("bulkDomainMgmtEnabled",JSON.stringify(t.isValid)),t.isValid&&(e.Domain=window.location.hostname)},f.prototype.getGeolocationURL=function(t){t.TenantFeatures;var e=""+l.stubScriptElement.getAttribute("src").split(l.stubFileName)[0]+t.Version;return new RegExp("^file://","i").test(e)&&t.MobileSDK?(e="/"+t.GeolocationUrl.replace(/^(http|https):\/\//,"").split("/").slice(1).join("/")+".js",l.storageBaseURL+e):t.GeolocationUrl},f.prototype.geoLocationJsonCallback=function(t,e){e&&this.setGeoLocation(e.country,e.state),this.addBannerSDKScript(t)},f.prototype.getGeoLocation=function(t){var e=this.getGeolocationURL(t);this.otFetch(e,this.geoLocationJsonCallback.bind(this,t),!0)},f.prototype.setOTDataLayer=function(){var t=l.stubScriptElement.hasAttribute("data-dLayer-ignore"),e=l.stubScriptElement.getAttribute("data-dLayer-ignore");this.otDataLayer={ignore:t&&"true"===e||t&&""===e,name:l.stubScriptElement.getAttribute("data-dLayer-name")||"dataLayer"}},f.prototype.setGeoLocation=function(t,e){l.userLocation={country:t,state:e=void 0===e?"":e}},f.prototype.otFetch=function(t,i,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=null);var a=window.sessionStorage&&window.sessionStorage.getItem("otPreviewData");if(new RegExp("^file://","i").test(t))this.otFetchOfflineFile(t,i);else if(0<=t.indexOf("/consent/")&&this.previewMode&&a)a=JSON.parse(a).domainJson,i(a);else{l.mobileOnlineURL.push(t);var s=new XMLHttpRequest;if(s.onload=function(t){var e;this&&this.responseText?e=this.responseText:t&&t.target&&(e=t.target.responseText),o?i(JSON.parse(e),o):i(JSON.parse(e))},s.onerror=function(){i()},s.open("GET",t),s.withCredentials=!1,e&&s.setRequestHeader("accept","application/json"),n)for(var r in n)s.setRequestHeader(r,n[r]);s.send()}},f.prototype.otFetchOfflineFile=function(t,e){var i=(t=t.replace(".json",".js")).split("/"),n=i[i.length-1].split(".js")[0];this.jsonp(t,function(){e(window[n])})},f.prototype.jsonp=function(t,e){var i=document.createElement("script");i.setAttribute("src",t),this.nonce&&i.setAttribute("nonce",this.nonce),i.async=!0,i.type="text/javascript",this.crossOrigin&&i.setAttribute("crossorigin",this.crossOrigin),document.getElementsByTagName("head")[0].appendChild(i),new RegExp("^file://","i").test(t)||l.mobileOnlineURL.push(t),e&&(i.onload=i.onerror=function(){e()})},f.prototype.getRegionSet=function(t){var e,i,n,o=l.userLocation,a=t.RuleSet.filter(function(t){return!0===t.Default});if(!o.country&&!o.state)return a&&0<a.length?a[0]:null;for(var s=o.state.toLowerCase(),r=o.country.toLowerCase(),u=0;u<t.RuleSet.length;u++)if(!0===t.RuleSet[u].Global)n=t.RuleSet[u];else{var c=t.RuleSet[u].States;if(c[r]&&0<=c[r].indexOf(s)){i=t.RuleSet[u];break}0<=t.RuleSet[u].Countries.indexOf(r)&&(e=t.RuleSet[u])}return i||e||n},f.prototype.ensureHtmlGroupDataInitialised=function(){this.initializeIABData(),this.initializeGroupData(),this.initializeHostData(),this.initializeGenVenData()},f.prototype.initializeGroupData=function(){var t=this.readCookieParam(l.optanonCookieName,"groups");t&&(l.optanonHtmlGroupData=this.deserialiseStringToArray(t))},f.prototype.initializeHostData=function(){var t=this.readCookieParam(l.optanonCookieName,"hosts");t&&(l.optanonHostData=this.deserialiseStringToArray(t))},f.prototype.initializeGenVenData=function(){var t=this.readCookieParam(l.optanonCookieName,"genVendors");t&&(l.genVendorsData=this.deserialiseStringToArray(t))},f.prototype.initializeIABData=function(){this.validateIABGDPRApplied(),this.validateIABGlobalScope()},f.prototype.validateIABGlobalScope=function(){var t=this.readCookieParam(l.optanonCookieName,l.oneTrustIsIABCrossConsentEnableParam);t?"true"===t?(l.hasIABGlobalScope=!0,l.isStubReady=!1):(l.hasIABGlobalScope=!1,l.IABCookieValue=this.getCookie(l.oneTrustIABCookieName)):l.isStubReady=!1},f.prototype.validateIABGDPRApplied=function(){var t=this.readCookieParam(l.optanonCookieName,l.geolocationCookiesParam).split(";")[0];t?this.isBoolean(t)?l.oneTrustIABgdprAppliesGlobally="true"===t:l.oneTrustIABgdprAppliesGlobally=0<=l.EUCOUNTRIES.indexOf(t):l.isStubReady=!1},f.prototype.isBoolean=function(t){return"true"===t||"false"===t},f.prototype.readCookieParam=function(t,e){var i,n,o,a;if(t=this.getCookie(t)){for(n={},o=t.split("&"),i=0;i<o.length;i+=1)a=o[i].split("="),n[decodeURIComponent(a[0])]=decodeURIComponent(a[1]).replace(/\+/g," ");return e&&n[e]?n[e]:e&&!n[e]?"":n}return""},f.prototype.getCookie=function(t){if(this.isAmp){var e=JSON.parse(window.localStorage.getItem(this.domainId))||{};if(e)return e[t]||null}for(var i,n=t+"=",o=document.cookie.split(";"),a=0;a<o.length;a+=1){for(i=o[a];" "==i.charAt(0);)i=i.substring(1,i.length);if(0==i.indexOf(n))return i.substring(n.length,i.length)}return null},f.prototype.updateGtmMacros=function(){for(var t=[],e=l.optanonHtmlGroupData.length,i=0;i<e;i++)this.endsWith(l.optanonHtmlGroupData[i],":1")&&t.push(l.optanonHtmlGroupData[i].replace(":1",""));for(e=l.optanonHostData.length,i=0;i<e;i++)this.endsWith(l.optanonHostData[i],":1")&&t.push(l.optanonHostData[i].replace(":1",""));for(e=l.genVendorsData.length,i=0;i<e;i++)this.endsWith(l.genVendorsData[i],":1")&&t.push(l.genVendorsData[i].replace(":1",""));for(e=l.vendorsServiceData.length,i=0;i<e;i++)this.endsWith(l.vendorsServiceData[i],":1")&&t.push(l.vendorsServiceData[i].replace(":1",""));var n,o=","+this.serialiseArrayToString(t)+",",a=(window.OnetrustActiveGroups=o,window.OptanonActiveGroups=o,window),s=(this.otDataLayer.ignore||void 0===a[this.otDataLayer.name]?this.otDataLayer.ignore||(a[this.otDataLayer.name]=[{event:"OneTrustLoaded",OnetrustActiveGroups:o},{event:"OptanonLoaded",OptanonActiveGroups:o}]):a[this.otDataLayer.name].constructor===Array&&(a[this.otDataLayer.name].push({OnetrustActiveGroups:o}),a[this.otDataLayer.name].push({OptanonActiveGroups:o})),new CustomEvent("consent.onetrust",{detail:t}));!this.otDataLayer.ignore&&t.length&&(a[this.otDataLayer.name].constructor===Array&&a[this.otDataLayer.name].push({event:"OneTrustGroupsUpdated",OnetrustActiveGroups:o}),n=new CustomEvent("OneTrustGroupsUpdated",{detail:t})),setTimeout(function(){t.length&&window.dispatchEvent(s),n&&window.dispatchEvent(n)})},f.prototype.deserialiseStringToArray=function(t){return t?t.split(","):[]},f.prototype.endsWith=function(t,e){return-1!==t.indexOf(e,t.length-e.length)},f.prototype.serialiseArrayToString=function(t){return t.toString()},f.prototype.setStubScriptElement=function(){l.stubScriptElement=document.querySelector("script[src*='"+l.stubFileName+"']");var t=l.stubScriptElement&&0<=l.stubScriptElement.getAttribute("src").indexOf("did=");l.stubScriptElement&&l.stubScriptElement.hasAttribute(l.DATAFILEATTRIBUTE)?this.domainId=l.stubScriptElement.getAttribute(l.DATAFILEATTRIBUTE).trim():t?this.domainId=l.stubScriptElement.getAttribute("src").split("did=")[1]:l.stubScriptElement||(l.stubScriptElement=document.querySelector("script[src*='"+l.migratedCCTID+"']"),l.stubScriptElement&&(l.isMigratedURL=!0,this.domainId=l.migratedDomainId.trim()))},f.prototype.setDomainDataFileURL=function(){var t=l.stubScriptElement.getAttribute("src"),e=-1<t.indexOf("/consent");t&&(l.isMigratedURL?l.storageBaseURL=t.split("/consent/"+l.migratedCCTID)[0]:l.storageBaseURL=(e?t.split("/consent"):t.split("/scripttemplates/"+l.stubFileName))[0]),this.storageBaseURL=l.storageBaseURL,this.isPreview&&-1===this.domainId.indexOf("test")?this.domainId=this.domainId+"-test":this.isPreview=!1,l.bannerBaseDataURL=l.storageBaseURL&&l.storageBaseURL+"/consent/"+this.domainId,l.bannerDataParentURL=l.bannerBaseDataURL+"/"+this.domainId+".json"},f.prototype.initCustomEventPolyfill=function(){if("function"==typeof window.CustomEvent)return!1;function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),i}t.prototype=window.Event.prototype,window.CustomEvent=t},f.prototype.removeTcf=function(){delete window.__tcfapi;var t=document.querySelectorAll("iframe[name='__tcfapiLocator']")[0];t&&t.parentElement.removeChild(t)},f.prototype.getParamForIE=function(){return{get:function(t){return null===(t=new RegExp("[?&]"+t+"=([^&#]*)").exec(window.location.search))?null:decodeURI(t[1])||""}}},f.prototype.getParam=function(){window.document.documentMode||!window.URLSearchParams?this.urlParams=this.getParamForIE():this.urlParams=new URLSearchParams(window.location.search);var t="true"===this.urlParams.get("otreset"),e="true"===this.urlParams.get("otpreview"),i=(this.geoFromUrl=(this.urlParams.get("otgeo")||"").toLowerCase(),this.readCookieParam(s,"expiry")),n=this.readCookieParam(s,"geo");this.isReset=t||i&&new Date(i)<new Date,this.isPreview=!this.isReset&&(e||i&&new Date(i)>new Date),this.setGeoParam(this.geoFromUrl||n)},f.prototype.setGeoParam=function(t){var e;t&&((e=window).OneTrust||(e.OneTrust={}),t=t.split(","),e.OneTrust.geolocationResponse={countryCode:t[0],stateCode:t[1]})},f.prototype.updateVersion=function(t){"debug"!==this.buildType&&"cybuild"!==this.buildType||(t.Version="202310.2.0")},f),h=new m;return t.OtSDKStub=m,t.otSdkStub=h,t}function g(){var t=this;this.implementThePolyfill=function(){var o=t,a=Element.prototype.setAttribute;return Element.prototype.setAttribute=function(t,e){if("style"!==t.toLowerCase()&&a.apply(this,[t,e]),"style"!==t.toLowerCase()||e||this.removeAttribute("style"),"style"===t.toLowerCase()&&e){this.removeAttribute("style");var i,n=o.strToObj(e);for(i in n)this.style[i]=n[i]}},!0}}function f(){var s=this;this.iabType=null,this.iabTypeAdded=!0,this.crossOrigin=null,this.isAmp=!1,this.domainId="",this.isReset=!1,this.isPreview=!1,this.geoFromUrl="",this.nonce="",this.setAttributePolyfillIsActive=!1,this.storageBaseURL="",this.charset=null,this.buildType="undefined",this.addBannerSDKScript=function(t){var e=s.getRegionSet(t),i=(e.GCEnable||(s.updateGtmMacros(),s.gtmUpdated=!0),s.iabTypeAdded&&("IAB2"!==e.Type&&"IAB2V2"!==e.Type||(s.iabType=e.Type,s.intializeIabStub()),"IAB2"!==e.Type)&&"IAB2V2"!==e.Type&&s.removeTcf(),e.IsGPPEnabled?d.init():d.removeGppApi(),l.stubScriptElement.cloneNode(!0)),n=t.UseSDKRefactor?(l.isMigratedURL&&(i.src=l.storageBaseURL+"/scripttemplates/new/scripttemplates/"+l.stubFileName+".js"),l.storageBaseURL+"/scripttemplates/new/scripttemplates/"+t.Version+"/"+l.bannerScriptName):"5.11.0"===t.Version?(l.isMigratedURL&&(i.src=l.storageBaseURL+"/scripttemplates/old/scripttemplates/"+l.stubFileName+".js"),l.storageBaseURL+"/scripttemplates/old/scripttemplates/5.11.0/"+l.bannerScriptName):(l.isMigratedURL&&(i.src=l.storageBaseURL+"/scripttemplates/"+l.stubFileName+".js"),l.storageBaseURL+"/scripttemplates/"+t.Version+"/"+l.bannerScriptName);["charset","data-language","data-document-language","data-domain-script","crossorigin","data-ignore-ga"].forEach(function(t){l.stubScriptElement.getAttribute(t)&&i.setAttribute(t,l.stubScriptElement.getAttribute(t))}),s.charset=l.stubScriptElement.getAttribute("charset"),s.isAmp=!!l.stubScriptElement.getAttribute("amp"),window.otStubData={bannerBaseDataURL:l.bannerBaseDataURL,crossOrigin:s.crossOrigin,domainData:t,domainId:s.domainId,geoFromUrl:s.geoFromUrl,isAmp:s.isAmp,isPreview:s.isPreview,isReset:s.isReset,mobileOnlineURL:l.mobileOnlineURL,nonce:s.nonce,otDataLayer:s.otDataLayer,regionRule:e,setAttributePolyfillIsActive:s.setAttributePolyfillIsActive,storageBaseURL:s.storageBaseURL,stubElement:i,urlParams:s.urlParams,userLocation:l.userLocation,gtmUpdated:s.gtmUpdated,previewMode:s.previewMode,charset:s.charset},s.jsonp(n,null)},this.intializeIabStub=function(){var t=window;s.iabTypeAdded?(void 0===t.__tcfapi&&(window.__tcfapi=s.executeTcfApi),s.addIabFrame()):s.addBackwardIabFrame(),t.receiveOTMessage=s.receiveIabMessage,(t.attachEvent||window.addEventListener)("message",t.receiveOTMessage,!1)},this.addIabFrame=function(){var t=window,e="__tcfapiLocator";t.frames[e]||(t.document.body?s.addLocator(e,"CMP"):setTimeout(s.addIabFrame,5))},this.addBackwardIabFrame=function(){var t=window,e="__tcfapiLocator";t.frames[e]||(t.document.body?s.addLocator(e,"TCF"):setTimeout(s.addIabFrame,5))},this.addLocator=function(t,e){var i=window,n=i.document.createElement("iframe");(function(t,e,i){function n(t){return t?(";"!==(t=t.trim()).charAt(t.length-1)&&(t+=";"),t.trim()):null}void 0===i&&(i=!1);var a=n(t.getAttribute("style")),s=n(e),e="",e=i&&a?function(){for(var t=a.split(";").concat(s.split(";")).filter(function(t){return 0!==t.length}),e="",i="",n=t.length-1;0<=n;n--){var o=t[n].substring(0,t[n].indexOf(":")+1).trim();e.indexOf(o)<0&&(e+=o,i+=t[n]+";")}return i}():s;t.setAttribute("style",e)})(n,"display: none;",!0),n.name=t,n.setAttribute("title",e+" Locator"),i.document.body.appendChild(n)},this.receiveIabMessage=function(i){var n,o,t,a="string"==typeof i.data,e={};try{e=a?JSON.parse(i.data):i.data}catch(t){}e.__cmpCall&&"IAB2"===s.iabType&&console.log("Expecting IAB TCF v2.0 vendor iFrame call; Received IAB TCF v1.1"),e.__tcfapiCall&&"IAB2"===s.iabType&&(n=e.__tcfapiCall.callId,o=e.__tcfapiCall.command,t=e.__tcfapiCall.parameter,e=e.__tcfapiCall.version,s.executeTcfApi(o,t,function(t,e){t={__tcfapiReturn:{returnValue:t,success:e,callId:n,command:o}},i&&i.source&&i.source.postMessage&&i.source.postMessage(a?JSON.stringify(t):t,"*")},e))},this.executeTcfApi=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(s.iabType="IAB2",!t.length)return window.__tcfapi.a||[];var i=t[0],n=t[1],o=t[2],a=t[3];"function"==typeof o&&i&&("ping"===i?s.getPingRequest(o):s.addToQueue(i,n,o,a))},this.addToQueue=function(t,e,i,n){var o=window,a="__tcfapi";o[a].a=o[a].a||[],o[a].a.push([t,e,i,n])},this.getPingRequest=function(t,e){var i;void 0===e&&(e=!1),t&&(i=!(e={}),"IAB2"!==s.iabType&&"IAB2V2"!==s.iabType||(e={gdprApplies:l.oneTrustIABgdprAppliesGlobally,cmpLoaded:!1,cmpStatus:"stub",displayStatus:"stub",apiVersion:"2.0",cmpVersion:void 0,cmpId:void 0,gvlVersion:void 0,tcfPolicyVersion:void 0},i=!0),t(e,i))},this.getConsentDataRequest=function(t){t&&l.IABCookieValue&&t({gdprApplies:l.oneTrustIABgdprAppliesGlobally,hasGlobalScope:l.hasIABGlobalScope,consentData:l.IABCookieValue},!0)},this.initConsentSDK()}}({});