@optable/web-sdk 0.21.4 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -7
- package/browser/dist/sdk.js +1 -1
- package/lib/dist/addons/paapi.d.ts +0 -1
- package/lib/dist/addons/paapi.js +1 -1
- package/lib/dist/build.json +1 -1
- package/lib/dist/config.d.ts +16 -5
- package/lib/dist/config.js +18 -3
- package/lib/dist/core/network.d.ts +3 -3
- package/lib/dist/core/network.js +14 -3
- package/lib/dist/core/regs/consent.d.ts +13 -0
- package/lib/dist/core/regs/consent.js +96 -0
- package/lib/dist/core/regs/gpp/cmpapi.d.ts +46 -0
- package/lib/dist/core/regs/gpp/cmpapi.js +1 -0
- package/lib/dist/core/regs/gpp/index.d.ts +2 -0
- package/lib/dist/core/regs/gpp/index.js +2 -0
- package/lib/dist/core/regs/gpp/primitives.d.ts +6 -0
- package/lib/dist/core/regs/gpp/primitives.js +1 -0
- package/lib/dist/core/regs/gpp/sections.d.ts +18 -0
- package/lib/dist/core/regs/gpp/sections.js +18 -0
- package/lib/dist/core/regs/gpp/tcfcav1.d.ts +36 -0
- package/lib/dist/core/regs/gpp/tcfcav1.js +3 -0
- package/lib/dist/core/regs/gpp/tcfeuv2.d.ts +39 -0
- package/lib/dist/core/regs/gpp/tcfeuv2.js +3 -0
- package/lib/dist/core/regs/gpp/usca.d.ts +19 -0
- package/lib/dist/core/regs/gpp/usca.js +3 -0
- package/lib/dist/core/regs/gpp/usco.d.ts +18 -0
- package/lib/dist/core/regs/gpp/usco.js +3 -0
- package/lib/dist/core/regs/gpp/usct.d.ts +18 -0
- package/lib/dist/core/regs/gpp/usct.js +3 -0
- package/lib/dist/core/regs/gpp/usde.d.ts +19 -0
- package/lib/dist/core/regs/gpp/usde.js +3 -0
- package/lib/dist/core/regs/gpp/usfl.d.ts +19 -0
- package/lib/dist/core/regs/gpp/usfl.js +3 -0
- package/lib/dist/core/regs/gpp/usia.d.ts +19 -0
- package/lib/dist/core/regs/gpp/usia.js +3 -0
- package/lib/dist/core/regs/gpp/usmt.d.ts +19 -0
- package/lib/dist/core/regs/gpp/usmt.js +3 -0
- package/lib/dist/core/regs/gpp/usnat.d.ts +23 -0
- package/lib/dist/core/regs/gpp/usnat.js +3 -0
- package/lib/dist/core/regs/gpp/usne.d.ts +19 -0
- package/lib/dist/core/regs/gpp/usne.js +3 -0
- package/lib/dist/core/regs/gpp/usnh.d.ts +19 -0
- package/lib/dist/core/regs/gpp/usnh.js +3 -0
- package/lib/dist/core/regs/gpp/usnj.d.ts +19 -0
- package/lib/dist/core/regs/gpp/usnj.js +3 -0
- package/lib/dist/core/regs/gpp/usor.d.ts +19 -0
- package/lib/dist/core/regs/gpp/usor.js +3 -0
- package/lib/dist/core/regs/gpp/ustn.d.ts +19 -0
- package/lib/dist/core/regs/gpp/ustn.js +3 -0
- package/lib/dist/core/regs/gpp/ustx.d.ts +19 -0
- package/lib/dist/core/regs/gpp/ustx.js +3 -0
- package/lib/dist/core/regs/gpp/usut.d.ts +18 -0
- package/lib/dist/core/regs/gpp/usut.js +3 -0
- package/lib/dist/core/regs/gpp/usva.d.ts +18 -0
- package/lib/dist/core/regs/gpp/usva.js +3 -0
- package/lib/dist/core/regs/regulations.d.ts +4 -0
- package/lib/dist/core/regs/regulations.js +67 -0
- package/lib/dist/core/regs/storage.d.ts +9 -0
- package/lib/dist/core/regs/storage.js +24 -0
- package/lib/dist/core/regs/tcf/cmpapi.d.ts +61 -0
- package/lib/dist/core/regs/tcf/cmpapi.js +1 -0
- package/lib/dist/core/regs/tcf/index.d.ts +1 -0
- package/lib/dist/core/regs/tcf/index.js +1 -0
- package/lib/dist/core/storage.d.ts +4 -3
- package/lib/dist/core/storage.js +15 -13
- package/lib/dist/edge/identify.d.ts +2 -2
- package/lib/dist/edge/profile.d.ts +2 -2
- package/lib/dist/edge/site.d.ts +3 -3
- package/lib/dist/edge/targeting.d.ts +4 -4
- package/lib/dist/edge/tokenize.d.ts +2 -2
- package/lib/dist/edge/uid2_token.d.ts +2 -2
- package/lib/dist/edge/witness.d.ts +2 -2
- package/lib/dist/sdk.d.ts +4 -4
- package/lib/dist/sdk.js +4 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -103,13 +103,7 @@ const sdk = new OptableSDK({ host: "dcn.customer.com", site: "my-site" });
|
|
|
103
103
|
|
|
104
104
|
You can then call various SDK APIs on the instance as shown in the examples below. It's also possible to configure multiple instances of `OptableSDK` in order to connect to other (e.g., partner) DCNs and/or reference other configured web site slug IDs.
|
|
105
105
|
|
|
106
|
-
Note that all SDK communication with Optable DCNs is done over TLS.
|
|
107
|
-
|
|
108
|
-
```js
|
|
109
|
-
const sdk = new OptableSDK({ host: "dcn.customer.com", site: "my-site", insecure: true });
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
Note that production DCNs only listen to TLS traffic. The `insecure: true` option is meant to be used by Optable developers running the DCN locally for testing. See [developer docs](https://github.com/Optable/optable-web-sdk/tree/master/docs) for other developer notes.
|
|
106
|
+
Note that all SDK communication with Optable DCNs is done over TLS.
|
|
113
107
|
|
|
114
108
|
### Identify API
|
|
115
109
|
|
package/browser/dist/sdk.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see sdk.js.LICENSE.txt */
|
|
2
|
-
(()=>{var t={396:t=>{t.exports=function(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}},312:(t,e,i)=>{var r;!function(){"use strict";var e="input is invalid type",n="object"==typeof window,s=n?window:{};s.JS_SHA256_NO_WINDOW&&(n=!1);var o=!n&&"object"==typeof self,a=!s.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;a?s=i.g:o&&(s=self);var h=!s.JS_SHA256_NO_COMMON_JS&&t.exports,c=i.amdO,u=!s.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),p=[-2147483648,8388608,32768,128],l=[24,16,8,0],f=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],g=["hex","array","digest","arrayBuffer"],y=[];!s.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!u||!s.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var w=function(t,e){return function(i){return new A(e,!0).update(i)[t]()}},m=function(t){var e=w("hex",t);a&&(e=v(e,t)),e.create=function(){return new A(t)},e.update=function(t){return e.create().update(t)};for(var i=0;i<g.length;++i){var r=g[i];e[r]=w(r,t)}return e},v=function(t,r){var n,o=i(394),a=i(903).Buffer,h=r?"sha224":"sha256";return n=a.from&&!s.JS_SHA256_NO_BUFFER_FROM?a.from:function(t){return new a(t)},function(i){if("string"==typeof i)return o.createHash(h).update(i,"utf8").digest("hex");if(null==i)throw new Error(e);return i.constructor===ArrayBuffer&&(i=new Uint8Array(i)),Array.isArray(i)||ArrayBuffer.isView(i)||i.constructor===a?o.createHash(h).update(n(i)).digest("hex"):t(i)}},S=function(t,e){return function(i,r){return new T(i,e,!0).update(r)[t]()}},b=function(t){var e=S("hex",t);e.create=function(e){return new T(e,t)},e.update=function(t,i){return e.create(t).update(i)};for(var i=0;i<g.length;++i){var r=g[i];e[r]=S(r,t)}return e};function A(t,e){e?(y[0]=y[16]=y[1]=y[2]=y[3]=y[4]=y[5]=y[6]=y[7]=y[8]=y[9]=y[10]=y[11]=y[12]=y[13]=y[14]=y[15]=0,this.blocks=y):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}function T(t,i,r){var n,s=typeof t;if("string"===s){var o,a=[],h=t.length,c=0;for(n=0;n<h;++n)(o=t.charCodeAt(n))<128?a[c++]=o:o<2048?(a[c++]=192|o>>>6,a[c++]=128|63&o):o<55296||o>=57344?(a[c++]=224|o>>>12,a[c++]=128|o>>>6&63,a[c++]=128|63&o):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++n)),a[c++]=240|o>>>18,a[c++]=128|o>>>12&63,a[c++]=128|o>>>6&63,a[c++]=128|63&o);t=a}else{if("object"!==s)throw new Error(e);if(null===t)throw new Error(e);if(u&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||u&&ArrayBuffer.isView(t)))throw new Error(e)}t.length>64&&(t=new A(i,!0).update(t).array());var d=[],p=[];for(n=0;n<64;++n){var l=t[n]||0;d[n]=92^l,p[n]=54^l}A.call(this,i,r),this.update(p),this.oKeyPad=d,this.inner=!0,this.sharedMemory=r}A.prototype.update=function(t){if(!this.finalized){var i,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(u&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||u&&ArrayBuffer.isView(t)))throw new Error(e);i=!0}for(var n,s,o=0,a=t.length,h=this.blocks;o<a;){if(this.hashed&&(this.hashed=!1,h[0]=this.block,this.block=h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0),i)for(s=this.start;o<a&&s<64;++o)h[s>>>2]|=t[o]<<l[3&s++];else for(s=this.start;o<a&&s<64;++o)(n=t.charCodeAt(o))<128?h[s>>>2]|=n<<l[3&s++]:n<2048?(h[s>>>2]|=(192|n>>>6)<<l[3&s++],h[s>>>2]|=(128|63&n)<<l[3&s++]):n<55296||n>=57344?(h[s>>>2]|=(224|n>>>12)<<l[3&s++],h[s>>>2]|=(128|n>>>6&63)<<l[3&s++],h[s>>>2]|=(128|63&n)<<l[3&s++]):(n=65536+((1023&n)<<10|1023&t.charCodeAt(++o)),h[s>>>2]|=(240|n>>>18)<<l[3&s++],h[s>>>2]|=(128|n>>>12&63)<<l[3&s++],h[s>>>2]|=(128|n>>>6&63)<<l[3&s++],h[s>>>2]|=(128|63&n)<<l[3&s++]);this.lastByteIndex=s,this.bytes+=s-this.start,s>=64?(this.block=h[16],this.start=s-64,this.hash(),this.hashed=!0):this.start=s}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},A.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>>2]|=p[3&e],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},A.prototype.hash=function(){var t,e,i,r,n,s,o,a,h,c=this.h0,u=this.h1,d=this.h2,p=this.h3,l=this.h4,g=this.h5,y=this.h6,w=this.h7,m=this.blocks;for(t=16;t<64;++t)e=((n=m[t-15])>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,i=((n=m[t-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,m[t]=m[t-16]+e+m[t-7]+i|0;for(h=u&d,t=0;t<64;t+=4)this.first?(this.is224?(s=300032,w=(n=m[0]-1413257819)-150054599|0,p=n+24177077|0):(s=704751109,w=(n=m[0]-210244248)-1521486534|0,p=n+143694565|0),this.first=!1):(e=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),r=(s=c&u)^c&d^h,w=p+(n=w+(i=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+(l&g^~l&y)+f[t]+m[t])|0,p=n+(e+r)|0),e=(p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10),r=(o=p&c)^p&u^s,y=d+(n=y+(i=(w>>>6|w<<26)^(w>>>11|w<<21)^(w>>>25|w<<7))+(w&l^~w&g)+f[t+1]+m[t+1])|0,e=((d=n+(e+r)|0)>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),r=(a=d&p)^d&c^o,g=u+(n=g+(i=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&w^~y&l)+f[t+2]+m[t+2])|0,e=((u=n+(e+r)|0)>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),r=(h=u&d)^u&p^a,l=c+(n=l+(i=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&y^~g&w)+f[t+3]+m[t+3])|0,c=n+(e+r)|0,this.chromeBugWorkAround=!0;this.h0=this.h0+c|0,this.h1=this.h1+u|0,this.h2=this.h2+d|0,this.h3=this.h3+p|0,this.h4=this.h4+l|0,this.h5=this.h5+g|0,this.h6=this.h6+y|0,this.h7=this.h7+w|0},A.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,i=this.h2,r=this.h3,n=this.h4,s=this.h5,o=this.h6,a=this.h7,h=d[t>>>28&15]+d[t>>>24&15]+d[t>>>20&15]+d[t>>>16&15]+d[t>>>12&15]+d[t>>>8&15]+d[t>>>4&15]+d[15&t]+d[e>>>28&15]+d[e>>>24&15]+d[e>>>20&15]+d[e>>>16&15]+d[e>>>12&15]+d[e>>>8&15]+d[e>>>4&15]+d[15&e]+d[i>>>28&15]+d[i>>>24&15]+d[i>>>20&15]+d[i>>>16&15]+d[i>>>12&15]+d[i>>>8&15]+d[i>>>4&15]+d[15&i]+d[r>>>28&15]+d[r>>>24&15]+d[r>>>20&15]+d[r>>>16&15]+d[r>>>12&15]+d[r>>>8&15]+d[r>>>4&15]+d[15&r]+d[n>>>28&15]+d[n>>>24&15]+d[n>>>20&15]+d[n>>>16&15]+d[n>>>12&15]+d[n>>>8&15]+d[n>>>4&15]+d[15&n]+d[s>>>28&15]+d[s>>>24&15]+d[s>>>20&15]+d[s>>>16&15]+d[s>>>12&15]+d[s>>>8&15]+d[s>>>4&15]+d[15&s]+d[o>>>28&15]+d[o>>>24&15]+d[o>>>20&15]+d[o>>>16&15]+d[o>>>12&15]+d[o>>>8&15]+d[o>>>4&15]+d[15&o];return this.is224||(h+=d[a>>>28&15]+d[a>>>24&15]+d[a>>>20&15]+d[a>>>16&15]+d[a>>>12&15]+d[a>>>8&15]+d[a>>>4&15]+d[15&a]),h},A.prototype.toString=A.prototype.hex,A.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,i=this.h2,r=this.h3,n=this.h4,s=this.h5,o=this.h6,a=this.h7,h=[t>>>24&255,t>>>16&255,t>>>8&255,255&t,e>>>24&255,e>>>16&255,e>>>8&255,255&e,i>>>24&255,i>>>16&255,i>>>8&255,255&i,r>>>24&255,r>>>16&255,r>>>8&255,255&r,n>>>24&255,n>>>16&255,n>>>8&255,255&n,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o];return this.is224||h.push(a>>>24&255,a>>>16&255,a>>>8&255,255&a),h},A.prototype.array=A.prototype.digest,A.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),t},T.prototype=new A,T.prototype.finalize=function(){if(A.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();A.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),A.prototype.finalize.call(this)}};var C=m();C.sha256=C,C.sha224=m(!0),C.sha256.hmac=b(),C.sha224.hmac=b(!0),h?t.exports=C:(s.sha256=C.sha256,s.sha224=C.sha224,c&&(void 0===(r=function(){return C}.call(C,i,C,t))||(t.exports=r)))}()},903:()=>{},394:()=>{}},e={};function i(r){var n=e[r];if(void 0!==n)return n.exports;var s=e[r]={exports:{}};return t[r](s,s.exports,i),s.exports}i.amdO={},i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=i(396),e=i.n(t);const r=JSON.parse('{"r":"0.0.0-experimental"}'),n={insecure:!1,cookies:!0,initPassport:!0};async function s(t){const e=await a("/config",t,{method:"GET",headers:{Accept:"application/json"}});return new o(t).setSite(e),e}class o{constructor(t){this.Config=t,e()(this,"passportKey",void 0),e()(this,"targetingV1Key",void 0),e()(this,"targetingKey",void 0),e()(this,"siteKey",void 0);const i=btoa(function(t){const e=new Uint16Array(t.length);for(let i=0;i<e.length;i++)e[i]=t.charCodeAt(i);return String.fromCharCode(...new Uint8Array(e.buffer))}(`${this.Config.host}/${this.Config.site}`));this.targetingV1Key="OPTABLE_TGT_"+i,this.passportKey="OPTABLE_PASS_"+i,this.targetingKey="OPTABLE_V2_TGT_"+i,this.siteKey="OPTABLE_SITE_"+i}getPassport(){return window.localStorage.getItem(this.passportKey)}getV1Targeting(){const t=window.localStorage.getItem(this.targetingV1Key),e=t?JSON.parse(t):null;return e?{user:[],audience:Object.entries(e).map((t=>{let[e,i]=t;return{provider:"optable.co",keyspace:e,rtb_segtax:5001,ids:[].concat(i).map((t=>({id:String(t)})))}}))}:null}getTargeting(){const t=window.localStorage.getItem(this.targetingKey);return(t?JSON.parse(t):null)||this.getV1Targeting()}setPassport(t){t&&t.length>0&&window.localStorage.setItem(this.passportKey,t)}setTargeting(t){t&&window.localStorage.setItem(this.targetingKey,JSON.stringify(t))}setSite(t){t&&window.localStorage.setItem(this.siteKey,JSON.stringify(t))}getSite(){const t=window.localStorage.getItem(this.siteKey);return t?JSON.parse(t):null}clearPassport(){window.localStorage.removeItem(this.passportKey)}clearTargeting(){window.localStorage.removeItem(this.targetingKey)}clearSite(){window.localStorage.removeItem(this.siteKey)}}async function a(t,e,i){const n=await globalThis.fetch(function(t,e,i){const{site:n,host:s,insecure:a,cookies:h}=e,c=new URL(`${n}${t}`,`${a?"http":"https"}://${s}`);if(c.searchParams.set("osdk",`web-${r.r}`),h)c.searchParams.set("cookies","yes");else{const t=new o(e).getPassport();c.searchParams.set("cookies","no"),c.searchParams.set("passport",t||"")}const u={...i};return u.credentials="include",new Request(c.toString(),u)}(t,e,i)),s=n.headers.get("Content-Type"),a=s?.startsWith("application/json")?await n.json():await n.text();if(!n.ok)throw new Error(a.error);return a.passport&&(new o(e).setPassport(a.passport),delete a.passport),a}var h;function c(t){return{user:{data:(t?.audience??[]).map((t=>({name:t.provider,segment:t.ids,ext:{segtax:t.rtb_segtax}}))),ext:{eids:(t?.user??[]).map((t=>({source:t.provider,uids:t.ids.map((t=>{let{id:e}=t;return{id:e,atype:h.PersonID}}))})))}}}}function u(t){const e={};if(!t)return e;for(const i of t.audience??[])i.keyspace&&(i.keyspace in e||(e[i.keyspace]=[]),e[i.keyspace].push(...i.ids.map((t=>t.id))));return e}!function(t){t[t.DeviceID=1]="DeviceID",t[t.InAppImpression=2]="InAppImpression",t[t.PersonID=3]="PersonID"}(h||(h={}));var d=i(312);class p{constructor(t){var i;e()(this,"dcn",void 0),e()(this,"init",void 0),this.dcn=(i=t,{...n,...i});const r=()=>{};this.init=this.dcn.initPassport?s(this.dcn).then(r).catch(r):Promise.resolve()}async identify(){await this.init;for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t,e){return a("/identify",t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}(this.dcn,e.filter((t=>t)))}async uid2Token(t){return await this.init,function(t,e){return a("/uid2/token",t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}(this.dcn,t)}async targeting(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"__passport__";return await this.init,async function(t,e){const i="/v2/targeting?"+new URLSearchParams({id:e}).toString(),r=await a(i,t,{method:"GET",headers:{Accept:"application/json"}});return r&&new o(t).setTargeting(r),r}(this.dcn,t)}targetingFromCache(){return t=this.dcn,new o(t).getTargeting();var t}async site(){return s(this.dcn)}siteFromCache(){return t=this.dcn,new o(t).getSite();var t}targetingClearCache(){var t;t=this.dcn,new o(t).clearTargeting()}async prebidORTB2(){return c(await this.targeting())}prebidORTB2FromCache(){return c(this.targetingFromCache())}async targetingKeyValues(){return u(await this.targeting())}targetingKeyValuesFromCache(){return u(this.targetingFromCache())}async witness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return await this.init,function(t,e,i){const r={event:e,properties:i};return a("/witness",t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})}(this.dcn,t,e)}async profile(t){return await this.init,function(t,e){const i={traits:e};return a("/profile",t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})}(this.dcn,t)}async tokenize(t){return await this.init,function(t,e){let i={id:e};return a("/v1/tokenize",t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})}(this.dcn,t)}static eid(t){return t?"e:"+d.sha256.hex(t.toLowerCase().trim()):""}static sha256(t){return t?d.sha256.hex(t):""}static cid(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i="c:";if("string"!=typeof t)throw new Error("Invalid ppid");if("number"!=typeof e||isNaN(e)||e<0||e>9)throw new Error("Invalid variant");return e>0&&(i=`c${e}:`),t?i+t.trim():""}static TargetingKeyValues(t){return u(t)}static PrebidORTB2(t){return c(t)}}e()(p,"version",r.r);const l=p;function f(t){return{advertiserId:t.advertiserId?.toString(),campaignId:t.campaignId?.toString(),creativeId:t.creativeId?.toString(),isEmpty:t.isEmpty?.toString(),lineItemId:t.lineItemId?.toString(),serviceName:t.serviceName?.toString(),size:t.size?.toString(),slotElementId:t.slot?.getSlotElementId(),sourceAgnosticCreativeId:t.sourceAgnosticCreativeId?.toString(),sourceAgnosticLineItemId:t.sourceAgnosticLineItemId?.toString()}}l.prototype.installGPTEventListeners=function(){const t=this;t.installGPTEventListeners=function(){},window.googletag=window.googletag||{cmd:[]};const e=window.googletag;e.cmd.push((function(){e.pubads().addEventListener("slotRenderEnded",(function(e){t.witness("googletag.events.slotRenderEnded",f(e))})),e.pubads().addEventListener("impressionViewable",(function(e){t.witness("googletag.events.impressionViewable",f(e))}))}))},l.prototype.installGPTSecureSignals=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];window.googletag=window.googletag||{cmd:[]};const r=window.googletag;e&&e.length>0&&r.cmd.push((()=>{e.forEach((t=>{let{provider:e,id:i}=t;r.secureSignalProviders.push({id:e,collectorFunction:()=>Promise.resolve(i)})}))}))};const g=/^[a-f0-9]{64}$/i;l.prototype.tryIdentifyFromParams=function(t,e){const i=new RegExp(`^${t||"oeid"}$`,"i"),r=new URLSearchParams(window.location.search);let n="";for(const[t,e]of r)if(i.test(t)){n=e;break}""!=n&&(e||function(t){return g.test(t)}(n))&&this.identify((e||"e")+":"+n.toLowerCase())},l.prototype.auctionConfigFromCache=function(){const t=this.siteFromCache();return t?t.auctionConfig??null:null},l.prototype.installGPTAuctionConfigs=function(t){const e=this;e.installGPTAuctionConfigs=function(){},window.googletag=window.googletag||{cmd:[]};const i=window.googletag;i.cmd.push((function(){let r=i.pubads().getSlots();t&&(r=r.filter(t));const n=e.auctionConfigFromCache();if(n)for(const t of r){const e=t.getSizes(),i=[];for(const t of e)"fluid"!==t&&i.push({configKey:n.seller+"-"+t.getWidth()+"x"+t.getHeight(),auctionConfig:{...n,requestedSize:{width:t.getWidth()+"px",height:t.getHeight()+"px"}}});t.setConfig({componentAuction:i})}}))},l.prototype.runAdAuction=async function(t,e){if(!("runAdAuction"in navigator))throw"run-ad-auction not supported";const i=document.getElementById(t);if(!i)throw"spot not found";const r=function(t){const e=window.getComputedStyle(t,null);return{width:e.getPropertyValue("width"),height:e.getPropertyValue("height")}}(i),n=this.auctionConfigFromCache();if(!n)return!1;const s={...n,requestedSize:r,resolveToConfig:!0},o=e?.iframe??!1;o&&(s.resolveToConfig=!1);const a=await navigator.runAdAuction(s);if(!a)return i.replaceChildren(),!1;if(o){const t=document.createElement("iframe");t.src=a,t.style.border="none",t.style.width=r.width,t.style.height=r.height,i.replaceChildren(t)}else{const t=document.createElement("fencedframe");t.config=a,t.style.border="none",i.replaceChildren(t)}return!0},l.prototype.joinAdInterestGroups=async function(){if(!("joinAdInterestGroup"in navigator))throw"join-ad-interest-group not supported";const t=await this.site();if(!t.interestGroupPixel)throw"origin not enabled for protected audience apis";const e=new URL(t.interestGroupPixel),i=document.createElement("iframe");i.src=e.toString(),i.allow="join-ad-interest-group "+e.origin,i.style.display="none";const r=new Promise(((t,e)=>{window.addEventListener("message",(r=>{r.source===i.contentWindow&&("success"!==r.data.result?e():t())}))}));return document.body.appendChild(i),r},l.prototype.getTopics=async function(){if(!("browsingTopics"in document))throw"browsing-topics not supported";const t=await this.site();if(!t.getTopicsURL)throw"origin not enabled for topics api";const e=new URL(t.getTopicsURL),i=document.createElement("iframe");i.src=e.toString(),i.allow="browsing-topics "+e.origin,i.style.display="none";const r=new Promise(((t,e)=>{window.addEventListener("message",(r=>{r.source===i.contentWindow&&(r.data.error?e(new Error(r.data.error.toString())):t(r.data.result))}))}));return document.body.appendChild(i),r},l.prototype.ingestTopics=function(){this.getTopics().then((t=>{if(!t.length)return;const e=t.reduce(((t,e)=>{const i=`topics_v${e.taxonomyVersion}`;return t[i]?t[i]+=",":t[i]="",t[i]+=String(e.topic),t}),{});this.profile(e)})).catch((()=>{}))},window.optable=window.optable||{},window.optable.SDK=l,window.optable.cmd=new class{constructor(t){if(this.cmds=t,Array.isArray(this.cmds))for(const t of this.cmds)"function"==typeof t&&t()}push(t){t()}}(window.optable.cmd||[])})()})();
|
|
2
|
+
(()=>{var t={396:t=>{t.exports=function(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}},312:(t,e,i)=>{var n;!function(){"use strict";var e="input is invalid type",r="object"==typeof window,s=r?window:{};s.JS_SHA256_NO_WINDOW&&(r=!1);var o=!r&&"object"==typeof self,a=!s.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;a?s=i.g:o&&(s=self);var c=!s.JS_SHA256_NO_COMMON_JS&&t.exports,h=i.amdO,u=!s.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,p="0123456789abcdef".split(""),d=[-2147483648,8388608,32768,128],g=[24,16,8,0],l=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],f=["hex","array","digest","arrayBuffer"],y=[];!s.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!u||!s.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var m=function(t,e){return function(i){return new b(e,!0).update(i)[t]()}},w=function(t){var e=m("hex",t);a&&(e=v(e,t)),e.create=function(){return new b(t)},e.update=function(t){return e.create().update(t)};for(var i=0;i<f.length;++i){var n=f[i];e[n]=m(n,t)}return e},v=function(t,n){var r,o=i(394),a=i(903).Buffer,c=n?"sha224":"sha256";return r=a.from&&!s.JS_SHA256_NO_BUFFER_FROM?a.from:function(t){return new a(t)},function(i){if("string"==typeof i)return o.createHash(c).update(i,"utf8").digest("hex");if(null==i)throw new Error(e);return i.constructor===ArrayBuffer&&(i=new Uint8Array(i)),Array.isArray(i)||ArrayBuffer.isView(i)||i.constructor===a?o.createHash(c).update(r(i)).digest("hex"):t(i)}},A=function(t,e){return function(i,n){return new I(i,e,!0).update(n)[t]()}},S=function(t){var e=A("hex",t);e.create=function(e){return new I(e,t)},e.update=function(t,i){return e.create(t).update(i)};for(var i=0;i<f.length;++i){var n=f[i];e[n]=A(n,t)}return e};function b(t,e){e?(y[0]=y[16]=y[1]=y[2]=y[3]=y[4]=y[5]=y[6]=y[7]=y[8]=y[9]=y[10]=y[11]=y[12]=y[13]=y[14]=y[15]=0,this.blocks=y):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}function I(t,i,n){var r,s=typeof t;if("string"===s){var o,a=[],c=t.length,h=0;for(r=0;r<c;++r)(o=t.charCodeAt(r))<128?a[h++]=o:o<2048?(a[h++]=192|o>>>6,a[h++]=128|63&o):o<55296||o>=57344?(a[h++]=224|o>>>12,a[h++]=128|o>>>6&63,a[h++]=128|63&o):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++r)),a[h++]=240|o>>>18,a[h++]=128|o>>>12&63,a[h++]=128|o>>>6&63,a[h++]=128|63&o);t=a}else{if("object"!==s)throw new Error(e);if(null===t)throw new Error(e);if(u&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||u&&ArrayBuffer.isView(t)))throw new Error(e)}t.length>64&&(t=new b(i,!0).update(t).array());var p=[],d=[];for(r=0;r<64;++r){var g=t[r]||0;p[r]=92^g,d[r]=54^g}b.call(this,i,n),this.update(d),this.oKeyPad=p,this.inner=!0,this.sharedMemory=n}b.prototype.update=function(t){if(!this.finalized){var i,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(e);if(null===t)throw new Error(e);if(u&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||u&&ArrayBuffer.isView(t)))throw new Error(e);i=!0}for(var r,s,o=0,a=t.length,c=this.blocks;o<a;){if(this.hashed&&(this.hashed=!1,c[0]=this.block,this.block=c[16]=c[1]=c[2]=c[3]=c[4]=c[5]=c[6]=c[7]=c[8]=c[9]=c[10]=c[11]=c[12]=c[13]=c[14]=c[15]=0),i)for(s=this.start;o<a&&s<64;++o)c[s>>>2]|=t[o]<<g[3&s++];else for(s=this.start;o<a&&s<64;++o)(r=t.charCodeAt(o))<128?c[s>>>2]|=r<<g[3&s++]:r<2048?(c[s>>>2]|=(192|r>>>6)<<g[3&s++],c[s>>>2]|=(128|63&r)<<g[3&s++]):r<55296||r>=57344?(c[s>>>2]|=(224|r>>>12)<<g[3&s++],c[s>>>2]|=(128|r>>>6&63)<<g[3&s++],c[s>>>2]|=(128|63&r)<<g[3&s++]):(r=65536+((1023&r)<<10|1023&t.charCodeAt(++o)),c[s>>>2]|=(240|r>>>18)<<g[3&s++],c[s>>>2]|=(128|r>>>12&63)<<g[3&s++],c[s>>>2]|=(128|r>>>6&63)<<g[3&s++],c[s>>>2]|=(128|63&r)<<g[3&s++]);this.lastByteIndex=s,this.bytes+=s-this.start,s>=64?(this.block=c[16],this.start=s-64,this.hash(),this.hashed=!0):this.start=s}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},b.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>>2]|=d[3&e],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},b.prototype.hash=function(){var t,e,i,n,r,s,o,a,c,h=this.h0,u=this.h1,p=this.h2,d=this.h3,g=this.h4,f=this.h5,y=this.h6,m=this.h7,w=this.blocks;for(t=16;t<64;++t)e=((r=w[t-15])>>>7|r<<25)^(r>>>18|r<<14)^r>>>3,i=((r=w[t-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10,w[t]=w[t-16]+e+w[t-7]+i|0;for(c=u&p,t=0;t<64;t+=4)this.first?(this.is224?(s=300032,m=(r=w[0]-1413257819)-150054599|0,d=r+24177077|0):(s=704751109,m=(r=w[0]-210244248)-1521486534|0,d=r+143694565|0),this.first=!1):(e=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),n=(s=h&u)^h&p^c,m=d+(r=m+(i=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&f^~g&y)+l[t]+w[t])|0,d=r+(e+n)|0),e=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),n=(o=d&h)^d&u^s,y=p+(r=y+(i=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&g^~m&f)+l[t+1]+w[t+1])|0,e=((p=r+(e+n)|0)>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10),n=(a=p&d)^p&h^o,f=u+(r=f+(i=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&m^~y&g)+l[t+2]+w[t+2])|0,e=((u=r+(e+n)|0)>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),n=(c=u&p)^u&d^a,g=h+(r=g+(i=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&y^~f&m)+l[t+3]+w[t+3])|0,h=r+(e+n)|0,this.chromeBugWorkAround=!0;this.h0=this.h0+h|0,this.h1=this.h1+u|0,this.h2=this.h2+p|0,this.h3=this.h3+d|0,this.h4=this.h4+g|0,this.h5=this.h5+f|0,this.h6=this.h6+y|0,this.h7=this.h7+m|0},b.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,i=this.h2,n=this.h3,r=this.h4,s=this.h5,o=this.h6,a=this.h7,c=p[t>>>28&15]+p[t>>>24&15]+p[t>>>20&15]+p[t>>>16&15]+p[t>>>12&15]+p[t>>>8&15]+p[t>>>4&15]+p[15&t]+p[e>>>28&15]+p[e>>>24&15]+p[e>>>20&15]+p[e>>>16&15]+p[e>>>12&15]+p[e>>>8&15]+p[e>>>4&15]+p[15&e]+p[i>>>28&15]+p[i>>>24&15]+p[i>>>20&15]+p[i>>>16&15]+p[i>>>12&15]+p[i>>>8&15]+p[i>>>4&15]+p[15&i]+p[n>>>28&15]+p[n>>>24&15]+p[n>>>20&15]+p[n>>>16&15]+p[n>>>12&15]+p[n>>>8&15]+p[n>>>4&15]+p[15&n]+p[r>>>28&15]+p[r>>>24&15]+p[r>>>20&15]+p[r>>>16&15]+p[r>>>12&15]+p[r>>>8&15]+p[r>>>4&15]+p[15&r]+p[s>>>28&15]+p[s>>>24&15]+p[s>>>20&15]+p[s>>>16&15]+p[s>>>12&15]+p[s>>>8&15]+p[s>>>4&15]+p[15&s]+p[o>>>28&15]+p[o>>>24&15]+p[o>>>20&15]+p[o>>>16&15]+p[o>>>12&15]+p[o>>>8&15]+p[o>>>4&15]+p[15&o];return this.is224||(c+=p[a>>>28&15]+p[a>>>24&15]+p[a>>>20&15]+p[a>>>16&15]+p[a>>>12&15]+p[a>>>8&15]+p[a>>>4&15]+p[15&a]),c},b.prototype.toString=b.prototype.hex,b.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,i=this.h2,n=this.h3,r=this.h4,s=this.h5,o=this.h6,a=this.h7,c=[t>>>24&255,t>>>16&255,t>>>8&255,255&t,e>>>24&255,e>>>16&255,e>>>8&255,255&e,i>>>24&255,i>>>16&255,i>>>8&255,255&i,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r>>>24&255,r>>>16&255,r>>>8&255,255&r,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o];return this.is224||c.push(a>>>24&255,a>>>16&255,a>>>8&255,255&a),c},b.prototype.array=b.prototype.digest,b.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),t},I.prototype=new b,I.prototype.finalize=function(){if(b.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();b.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),b.prototype.finalize.call(this)}};var E=w();E.sha256=E,E.sha224=w(!0),E.sha256.hmac=S(),E.sha224.hmac=S(!0),c?t.exports=E:(s.sha256=E.sha256,s.sha224=E.sha224,h&&(void 0===(n=function(){return E}.call(E,i,E,t))||(t.exports=n)))}()},903:()=>{},394:()=>{}},e={};function i(n){var r=e[n];if(void 0!==r)return r.exports;var s=e[n]={exports:{}};return t[n](s,s.exports,i),s.exports}i.amdO={},i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=i(396),e=i.n(t);const n=JSON.parse('{"r":"0.0.0-experimental"}'),r={"Europe/Amsterdam":"gdpr","Europe/Athens":"gdpr","Europe/Berlin":"gdpr","Europe/Brussels":"gdpr","Europe/Bucharest":"gdpr","Europe/Budapest":"gdpr","Europe/Copenhagen":"gdpr","Europe/Dublin":"gdpr","Europe/Helsinki":"gdpr","Europe/Lisbon":"gdpr","Europe/London":"gdpr","Europe/Madrid":"gdpr","Europe/Oslo":"gdpr","Europe/Paris":"gdpr","Europe/Prague":"gdpr","Europe/Rome":"gdpr","Europe/Sofia":"gdpr","Europe/Stockholm":"gdpr","Europe/Vienna":"gdpr","Europe/Warsaw":"gdpr","Europe/Zurich":"gdpr","America/Toronto":"can","America/New_York":"us","America/Detroit":"us","America/Kentucky/Louisville":"us","America/Kentucky/Monticello":"us","America/Indiana/Indianapolis":"us","America/Indiana/Vincennes":"us","America/Indiana/Winamac":"us","America/Indiana/Marengo":"us","America/Indiana/Petersburg":"us","America/Indiana/Vevay":"us","America/Chicago":"us","America/Indiana/Tell_City":"us","America/Indiana/Knox":"us","America/Menominee":"us","America/North_Dakota/Center":"us","America/North_Dakota/New_Salem":"us","America/North_Dakota/Beulah":"us","America/Denver":"us","America/Boise":"us","America/Phoenix":"us","America/Los_Angeles":"us","America/Anchorage":"us","America/Juneau":"us","America/Sitka":"us","America/Metlakatla":"us","America/Yakutat":"us","America/Nome":"us","America/Adak":"us","Pacific/Honolulu":"us"},s=2,o="tcfeuv2";function a(t){h()&&window.__gpp?.("addEventListener",((e,i)=>{i&&"signalStatus"===e.eventName&&"ready"===e.data&&t(e.pingData)}))}function c(t){u()&&window.__tcfapi?.("addEventListener",2,((e,i)=>{i&&("tcloaded"===e.eventStatus||"useractioncomplete"===e.eventStatus)&&t(e)}))}function h(){return"function"==typeof window.__gpp}function u(){return"function"==typeof window.__tcfapi}const p={cookies:!0,initPassport:!0,consent:{deviceAccess:!0,reg:null}};function d(t){const e={host:t.host,site:t.site,cookies:t.cookies??p.cookies,initPassport:t.initPassport??p.initPassport,consent:p.consent};return t.consent?.static?e.consent=t.consent.static:t.consent?.cmpapi&&(e.consent=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i={deviceAccess:!0,reg:t};return a((t=>{i.gpp=t.gppString,i.gppSectionIDs=t.applicableSections})),c((t=>{i.tcf=t.gdprApplies?t.tcString:void 0})),"gdpr"===t&&(i.deviceAccess=!1,u()?c((t=>{i.deviceAccess=function(t,e){return!t.gdprApplies||(e?t.purpose.consents[1]&&t.vendor.consents[e]:!!t.publisher.consents[1])}(t,e.tcfeuVendorID)})):h()&&a((t=>{i.deviceAccess=function(t,e){if(!t.applicableSections.includes(s))return!0;const i=t.parsedSections[o]||[];if("number"==typeof e){const t=i.find((t=>"Version"in t));return!!t&&t.PurposeConsent.includes(1)&&t.VendorConsent.includes(e)}const n=i.find((t=>"SegmentType"in t&&3===t.SegmentType));return!!n&&n.PubPurposesConsent.includes(1)}(t,e.tcfeuVendorID)}))),i}(function(){const t=Intl.DateTimeFormat().resolvedOptions().timeZone,e=r[t];return"can"===e?["fr","fr-CA"].some((t=>navigator.languages.includes(t)))?"can":null:e??null}(),t.consent.cmpapi)),e}async function g(t){const e=await y("/config",t,{method:"GET",headers:{Accept:"application/json"}});return new f(t).setSite(e),e}class l{constructor(t){e()(this,"consent",void 0),this.consent=t}getItem(t){return this.consent.deviceAccess?window.localStorage.getItem(t):null}setItem(t,e){this.consent.deviceAccess&&window.localStorage.setItem(t,e)}removeItem(t){this.consent.deviceAccess&&window.localStorage.removeItem(t)}}class f{constructor(t){this.config=t,e()(this,"passportKey",void 0),e()(this,"targetingV1Key",void 0),e()(this,"targetingKey",void 0),e()(this,"siteKey",void 0),e()(this,"storage",void 0);const i=btoa(function(t){const e=new Uint16Array(t.length);for(let i=0;i<e.length;i++)e[i]=t.charCodeAt(i);return String.fromCharCode(...new Uint8Array(e.buffer))}(`${this.config.host}/${this.config.site}`));this.targetingV1Key="OPTABLE_TGT_"+i,this.passportKey="OPTABLE_PASS_"+i,this.targetingKey="OPTABLE_V2_TGT_"+i,this.siteKey="OPTABLE_SITE_"+i,this.storage=new l(this.config.consent)}getPassport(){return this.storage.getItem(this.passportKey)}getV1Targeting(){const t=this.storage.getItem(this.targetingV1Key),e=t?JSON.parse(t):null;return e?{user:[],audience:Object.entries(e).map((t=>{let[e,i]=t;return{provider:"optable.co",keyspace:e,rtb_segtax:5001,ids:[].concat(i).map((t=>({id:String(t)})))}}))}:null}getTargeting(){const t=this.storage.getItem(this.targetingKey);return(t?JSON.parse(t):null)||this.getV1Targeting()}setPassport(t){t&&t.length>0&&this.storage.setItem(this.passportKey,t)}setTargeting(t){t&&this.storage.setItem(this.targetingKey,JSON.stringify(t))}setSite(t){t&&this.storage.setItem(this.siteKey,JSON.stringify(t))}getSite(){const t=this.storage.getItem(this.siteKey);return t?JSON.parse(t):null}clearPassport(){this.storage.removeItem(this.passportKey)}clearTargeting(){this.storage.removeItem(this.targetingKey)}clearSite(){this.storage.removeItem(this.siteKey)}}async function y(t,e,i){const r=await globalThis.fetch(function(t,e,i){const{site:r,host:s,cookies:o}=e,a=new URL(`${r}${t}`,`https://${s}`);if(a.searchParams.set("osdk",`web-${n.r}`),e.consent.reg&&a.searchParams.set("reg",e.consent.reg),e.consent.gpp&&a.searchParams.set("gpp",e.consent.gpp),e.consent.gppSectionIDs&&a.searchParams.set("gpp_sid",e.consent.gppSectionIDs.join(",")),e.consent.tcf&&a.searchParams.set("tcf",e.consent.tcf),o)a.searchParams.set("cookies","yes");else{const t=new f(e).getPassport();a.searchParams.set("cookies","no"),a.searchParams.set("passport",t||"")}const c={...i};return c.credentials="include",new Request(a.toString(),c)}(t,e,i)),s=r.headers.get("Content-Type"),o=s?.startsWith("application/json")?await r.json():await r.text();if(!r.ok)throw new Error(o.error);return o.passport&&(new f(e).setPassport(o.passport),delete o.passport),o}var m;function w(t){return{user:{data:(t?.audience??[]).map((t=>({name:t.provider,segment:t.ids,ext:{segtax:t.rtb_segtax}}))),ext:{eids:(t?.user??[]).map((t=>({source:t.provider,uids:t.ids.map((t=>{let{id:e}=t;return{id:e,atype:m.PersonID}}))})))}}}}function v(t){const e={};if(!t)return e;for(const i of t.audience??[])i.keyspace&&(i.keyspace in e||(e[i.keyspace]=[]),e[i.keyspace].push(...i.ids.map((t=>t.id))));return e}!function(t){t[t.DeviceID=1]="DeviceID",t[t.InAppImpression=2]="InAppImpression",t[t.PersonID=3]="PersonID"}(m||(m={}));var A=i(312);class S{constructor(t){e()(this,"dcn",void 0),e()(this,"init",void 0),this.dcn=d(t);const i=()=>{};this.init=this.dcn.initPassport?g(this.dcn).then(i).catch(i):Promise.resolve()}async identify(){await this.init;for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t,e){return y("/identify",t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}(this.dcn,e.filter((t=>t)))}async uid2Token(t){return await this.init,function(t,e){return y("/uid2/token",t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}(this.dcn,t)}async targeting(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"__passport__";return await this.init,async function(t,e){const i="/v2/targeting?"+new URLSearchParams({id:e}).toString(),n=await y(i,t,{method:"GET",headers:{Accept:"application/json"}});return n&&new f(t).setTargeting(n),n}(this.dcn,t)}targetingFromCache(){return t=this.dcn,new f(t).getTargeting();var t}async site(){return g(this.dcn)}siteFromCache(){return t=this.dcn,new f(t).getSite();var t}targetingClearCache(){var t;t=this.dcn,new f(t).clearTargeting()}async prebidORTB2(){return w(await this.targeting())}prebidORTB2FromCache(){return w(this.targetingFromCache())}async targetingKeyValues(){return v(await this.targeting())}targetingKeyValuesFromCache(){return v(this.targetingFromCache())}async witness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return await this.init,function(t,e,i){const n={event:e,properties:i};return y("/witness",t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}(this.dcn,t,e)}async profile(t){return await this.init,function(t,e){const i={traits:e};return y("/profile",t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})}(this.dcn,t)}async tokenize(t){return await this.init,function(t,e){let i={id:e};return y("/v1/tokenize",t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})}(this.dcn,t)}static eid(t){return t?"e:"+A.sha256.hex(t.toLowerCase().trim()):""}static sha256(t){return t?A.sha256.hex(t):""}static cid(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i="c:";if("string"!=typeof t)throw new Error("Invalid ppid");if("number"!=typeof e||isNaN(e)||e<0||e>9)throw new Error("Invalid variant");return e>0&&(i=`c${e}:`),t?i+t.trim():""}static TargetingKeyValues(t){return v(t)}static PrebidORTB2(t){return w(t)}}e()(S,"version",n.r);const b=S;function I(t){return{advertiserId:t.advertiserId?.toString(),campaignId:t.campaignId?.toString(),creativeId:t.creativeId?.toString(),isEmpty:t.isEmpty?.toString(),lineItemId:t.lineItemId?.toString(),serviceName:t.serviceName?.toString(),size:t.size?.toString(),slotElementId:t.slot?.getSlotElementId(),sourceAgnosticCreativeId:t.sourceAgnosticCreativeId?.toString(),sourceAgnosticLineItemId:t.sourceAgnosticLineItemId?.toString()}}b.prototype.installGPTEventListeners=function(){const t=this;t.installGPTEventListeners=function(){},window.googletag=window.googletag||{cmd:[]};const e=window.googletag;e.cmd.push((function(){e.pubads().addEventListener("slotRenderEnded",(function(e){t.witness("googletag.events.slotRenderEnded",I(e))})),e.pubads().addEventListener("impressionViewable",(function(e){t.witness("googletag.events.impressionViewable",I(e))}))}))},b.prototype.installGPTSecureSignals=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];window.googletag=window.googletag||{cmd:[]};const n=window.googletag;e&&e.length>0&&n.cmd.push((()=>{e.forEach((t=>{let{provider:e,id:i}=t;n.secureSignalProviders.push({id:e,collectorFunction:()=>Promise.resolve(i)})}))}))};const E=/^[a-f0-9]{64}$/i;b.prototype.tryIdentifyFromParams=function(t,e){const i=new RegExp(`^${t||"oeid"}$`,"i"),n=new URLSearchParams(window.location.search);let r="";for(const[t,e]of n)if(i.test(t)){r=e;break}""!=r&&(e||function(t){return E.test(t)}(r))&&this.identify((e||"e")+":"+r.toLowerCase())},b.prototype.auctionConfigFromCache=function(){const t=this.siteFromCache();return t?t.auctionConfig??null:null},b.prototype.installGPTAuctionConfigs=function(t){const e=this;e.installGPTAuctionConfigs=function(){},window.googletag=window.googletag||{cmd:[]};const i=window.googletag;i.cmd.push((function(){let n=i.pubads().getSlots();t&&(n=n.filter(t));const r=e.auctionConfigFromCache();if(r)for(const t of n){const e=t.getSizes(),i=[];for(const t of e)"fluid"!==t&&i.push({configKey:r.seller+"-"+t.getWidth()+"x"+t.getHeight(),auctionConfig:{...r,requestedSize:{width:t.getWidth()+"px",height:t.getHeight()+"px"}}});t.setConfig({componentAuction:i})}}))},b.prototype.runAdAuction=async function(t,e){if(!("runAdAuction"in navigator))throw"run-ad-auction not supported";const i=document.getElementById(t);if(!i)throw"spot not found";const n=function(t){const e=window.getComputedStyle(t,null);return{width:e.getPropertyValue("width"),height:e.getPropertyValue("height")}}(i),r=this.auctionConfigFromCache();if(!r)return!1;const s={...r,requestedSize:n,resolveToConfig:!0},o=e?.iframe??!1;o&&(s.resolveToConfig=!1);const a=await navigator.runAdAuction(s);if(!a)return i.replaceChildren(),!1;if(o){const t=document.createElement("iframe");t.src=a,t.style.border="none",t.style.width=n.width,t.style.height=n.height,i.replaceChildren(t)}else{const t=document.createElement("fencedframe");t.config=a,t.style.border="none",i.replaceChildren(t)}return!0},b.prototype.joinAdInterestGroups=async function(){if(!("joinAdInterestGroup"in navigator))throw"join-ad-interest-group not supported";const t=await this.site();if(!t.interestGroupPixel)throw"origin not enabled for protected audience apis";const e=new URL(t.interestGroupPixel),i=document.createElement("iframe");i.src=e.toString(),i.allow="join-ad-interest-group "+e.origin,i.style.display="none";const n=new Promise(((t,e)=>{window.addEventListener("message",(n=>{n.source===i.contentWindow&&("success"!==n.data.result?e():t())}))}));return document.body.appendChild(i),n},b.prototype.getTopics=async function(){if(!("browsingTopics"in document))throw"browsing-topics not supported";const t=await this.site();if(!t.getTopicsURL)throw"origin not enabled for topics api";const e=new URL(t.getTopicsURL),i=document.createElement("iframe");i.src=e.toString(),i.allow="browsing-topics "+e.origin,i.style.display="none";const n=new Promise(((t,e)=>{window.addEventListener("message",(n=>{n.source===i.contentWindow&&(n.data.error?e(new Error(n.data.error.toString())):t(n.data.result))}))}));return document.body.appendChild(i),n},b.prototype.ingestTopics=function(){this.getTopics().then((t=>{if(!t.length)return;const e=t.reduce(((t,e)=>{const i=`topics_v${e.taxonomyVersion}`;return t[i]?t[i]+=",":t[i]="",t[i]+=String(e.topic),t}),{});this.profile(e)})).catch((()=>{}))},window.optable=window.optable||{},window.optable.SDK=b,window.optable.cmd=new class{constructor(t){if(this.cmds=t,Array.isArray(this.cmds))for(const t of this.cmds)"function"==typeof t&&t()}push(t){t()}}(window.optable.cmd||[])})()})();
|
package/lib/dist/addons/paapi.js
CHANGED
|
@@ -65,8 +65,8 @@ OptableSDK.prototype.installGPTAuctionConfigs = function (filter) {
|
|
|
65
65
|
* runAdAuction runs an ad auction locally for a given spot dom ID.
|
|
66
66
|
*/
|
|
67
67
|
OptableSDK.prototype.runAdAuction = function (domID, options) {
|
|
68
|
-
var _a;
|
|
69
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
var _a;
|
|
70
70
|
const supported = "runAdAuction" in navigator;
|
|
71
71
|
if (!supported) {
|
|
72
72
|
throw "run-ad-auction not supported";
|
package/lib/dist/build.json
CHANGED
package/lib/dist/config.d.ts
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import { Consent } from "./core/regs/consent";
|
|
2
|
+
type CMPApiConfig = {
|
|
3
|
+
tcfeuVendorID?: number;
|
|
4
|
+
};
|
|
5
|
+
type InitConsent = {
|
|
6
|
+
cmpapi?: CMPApiConfig;
|
|
7
|
+
static?: Consent;
|
|
8
|
+
};
|
|
9
|
+
type InitConfig = {
|
|
2
10
|
host: string;
|
|
3
11
|
site: string;
|
|
4
|
-
insecure?: boolean;
|
|
5
12
|
cookies?: boolean;
|
|
6
13
|
initPassport?: boolean;
|
|
14
|
+
consent?: InitConsent;
|
|
15
|
+
};
|
|
16
|
+
type ResolvedConfig = Required<Omit<InitConfig, "consent">> & {
|
|
17
|
+
consent: Consent;
|
|
7
18
|
};
|
|
8
|
-
declare function getConfig(
|
|
9
|
-
export {
|
|
10
|
-
export
|
|
19
|
+
declare function getConfig(init: InitConfig): ResolvedConfig;
|
|
20
|
+
export type { InitConsent, CMPApiConfig, InitConfig, ResolvedConfig };
|
|
21
|
+
export { getConfig };
|
package/lib/dist/config.js
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
|
+
import { getConsent, inferRegulation } from "./core/regs/consent";
|
|
1
2
|
const DCN_DEFAULTS = {
|
|
2
|
-
insecure: false,
|
|
3
3
|
cookies: true,
|
|
4
4
|
initPassport: true,
|
|
5
|
+
consent: { deviceAccess: true, reg: null },
|
|
5
6
|
};
|
|
6
|
-
function getConfig(
|
|
7
|
-
|
|
7
|
+
function getConfig(init) {
|
|
8
|
+
var _a, _b, _c, _d;
|
|
9
|
+
const config = {
|
|
10
|
+
host: init.host,
|
|
11
|
+
site: init.site,
|
|
12
|
+
cookies: (_a = init.cookies) !== null && _a !== void 0 ? _a : DCN_DEFAULTS.cookies,
|
|
13
|
+
initPassport: (_b = init.initPassport) !== null && _b !== void 0 ? _b : DCN_DEFAULTS.initPassport,
|
|
14
|
+
consent: DCN_DEFAULTS.consent,
|
|
15
|
+
};
|
|
16
|
+
if ((_c = init.consent) === null || _c === void 0 ? void 0 : _c.static) {
|
|
17
|
+
config.consent = init.consent.static;
|
|
18
|
+
}
|
|
19
|
+
else if ((_d = init.consent) === null || _d === void 0 ? void 0 : _d.cmpapi) {
|
|
20
|
+
config.consent = getConsent(inferRegulation(), init.consent.cmpapi);
|
|
21
|
+
}
|
|
22
|
+
return config;
|
|
8
23
|
}
|
|
9
24
|
export { getConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare function buildRequest(path: string, config:
|
|
3
|
-
declare function fetch<T>(path: string, config:
|
|
1
|
+
import type { ResolvedConfig } from "../config";
|
|
2
|
+
declare function buildRequest(path: string, config: ResolvedConfig, init?: RequestInit): Request;
|
|
3
|
+
declare function fetch<T>(path: string, config: ResolvedConfig, init?: RequestInit): Promise<T>;
|
|
4
4
|
export { fetch, buildRequest };
|
|
5
5
|
export default fetch;
|
package/lib/dist/core/network.js
CHANGED
|
@@ -10,10 +10,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { default as buildInfo } from "../build.json";
|
|
11
11
|
import { LocalStorage } from "./storage";
|
|
12
12
|
function buildRequest(path, config, init) {
|
|
13
|
-
const { site, host,
|
|
14
|
-
const
|
|
15
|
-
const url = new URL(`${site}${path}`, `${proto}://${host}`);
|
|
13
|
+
const { site, host, cookies } = config;
|
|
14
|
+
const url = new URL(`${site}${path}`, `https://${host}`);
|
|
16
15
|
url.searchParams.set("osdk", `web-${buildInfo.version}`);
|
|
16
|
+
if (config.consent.reg) {
|
|
17
|
+
url.searchParams.set("reg", config.consent.reg);
|
|
18
|
+
}
|
|
19
|
+
if (config.consent.gpp) {
|
|
20
|
+
url.searchParams.set("gpp", config.consent.gpp);
|
|
21
|
+
}
|
|
22
|
+
if (config.consent.gppSectionIDs) {
|
|
23
|
+
url.searchParams.set("gpp_sid", config.consent.gppSectionIDs.join(","));
|
|
24
|
+
}
|
|
25
|
+
if (config.consent.tcf) {
|
|
26
|
+
url.searchParams.set("tcf", config.consent.tcf);
|
|
27
|
+
}
|
|
17
28
|
if (cookies) {
|
|
18
29
|
url.searchParams.set("cookies", "yes");
|
|
19
30
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CMPApiConfig } from "config";
|
|
2
|
+
import type { Regulation } from "./regulations";
|
|
3
|
+
import { inferRegulation } from "./regulations";
|
|
4
|
+
type Consent = {
|
|
5
|
+
deviceAccess: boolean;
|
|
6
|
+
reg: Regulation | null;
|
|
7
|
+
tcf?: string;
|
|
8
|
+
gpp?: string;
|
|
9
|
+
gppSectionIDs?: number[];
|
|
10
|
+
};
|
|
11
|
+
declare function getConsent(reg: Regulation | null, conf?: CMPApiConfig): Consent;
|
|
12
|
+
export { getConsent, inferRegulation };
|
|
13
|
+
export type { Consent };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { inferRegulation } from "./regulations";
|
|
2
|
+
import * as gpp from "./gpp";
|
|
3
|
+
function getConsent(reg, conf = {}) {
|
|
4
|
+
const consent = { deviceAccess: true, reg };
|
|
5
|
+
onGPPChange((data) => {
|
|
6
|
+
consent.gpp = data.gppString;
|
|
7
|
+
consent.gppSectionIDs = data.applicableSections;
|
|
8
|
+
});
|
|
9
|
+
onTCFChange((data) => {
|
|
10
|
+
consent.tcf = data.gdprApplies ? data.tcString : undefined;
|
|
11
|
+
});
|
|
12
|
+
if (reg === "gdpr") {
|
|
13
|
+
consent.deviceAccess = false;
|
|
14
|
+
if (hasTCF()) {
|
|
15
|
+
onTCFChange((data) => {
|
|
16
|
+
consent.deviceAccess = tcfDeviceAccess(data, conf.tcfeuVendorID);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
else if (hasGPP()) {
|
|
20
|
+
onGPPChange((data) => {
|
|
21
|
+
consent.deviceAccess = gppEUDeviceAccess(data, conf.tcfeuVendorID);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return consent;
|
|
26
|
+
}
|
|
27
|
+
function gppEUDeviceAccess(data, vendorID) {
|
|
28
|
+
if (!data.applicableSections.includes(gpp.tcfeuv2.SectionID)) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
const section = data.parsedSections[gpp.tcfeuv2.APIPrefix] || [];
|
|
32
|
+
if (typeof vendorID === "number") {
|
|
33
|
+
const coreSegment = section.find((s) => {
|
|
34
|
+
return "Version" in s;
|
|
35
|
+
});
|
|
36
|
+
if (!coreSegment) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
return coreSegment.PurposeConsent.includes(1) && coreSegment.VendorConsent.includes(vendorID);
|
|
40
|
+
}
|
|
41
|
+
const publisherSubsection = section.find((s) => {
|
|
42
|
+
return "SegmentType" in s && s.SegmentType === 3;
|
|
43
|
+
});
|
|
44
|
+
if (!publisherSubsection) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
return publisherSubsection.PubPurposesConsent.includes(1);
|
|
48
|
+
}
|
|
49
|
+
function tcfDeviceAccess(data, vendorID) {
|
|
50
|
+
if (!data.gdprApplies) {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
if (vendorID) {
|
|
54
|
+
return data.purpose.consents["1"] && data.vendor.consents[vendorID];
|
|
55
|
+
}
|
|
56
|
+
return !!data.publisher.consents["1"];
|
|
57
|
+
}
|
|
58
|
+
function onGPPChange(cb) {
|
|
59
|
+
var _a;
|
|
60
|
+
if (!hasGPP()) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
(_a = window.__gpp) === null || _a === void 0 ? void 0 : _a.call(window, "addEventListener", (data, success) => {
|
|
64
|
+
if (!success) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const ready = data.eventName === "signalStatus" && data.data === "ready";
|
|
68
|
+
if (!ready) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
cb(data.pingData);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function onTCFChange(cb) {
|
|
75
|
+
var _a;
|
|
76
|
+
if (!hasTCF()) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
(_a = window.__tcfapi) === null || _a === void 0 ? void 0 : _a.call(window, "addEventListener", 2, (data, success) => {
|
|
80
|
+
if (!success) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const ready = data.eventStatus === "tcloaded" || data.eventStatus === "useractioncomplete";
|
|
84
|
+
if (!ready) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
cb(data);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function hasGPP() {
|
|
91
|
+
return typeof window.__gpp === "function";
|
|
92
|
+
}
|
|
93
|
+
function hasTCF() {
|
|
94
|
+
return typeof window.__tcfapi === "function";
|
|
95
|
+
}
|
|
96
|
+
export { getConsent, inferRegulation };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as sections from "./sections";
|
|
2
|
+
declare global {
|
|
3
|
+
interface Window {
|
|
4
|
+
__gpp?(command: "addEventListener", cb: AddEventListenerCallback): void;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
type ParsedSections = {
|
|
8
|
+
[sections.tcfcav1.APIPrefix]?: sections.tcfcav1.Section;
|
|
9
|
+
[sections.tcfeuv2.APIPrefix]?: sections.tcfeuv2.Section;
|
|
10
|
+
[sections.usnat.APIPrefix]?: sections.usnat.Section;
|
|
11
|
+
[sections.usca.APIPrefix]?: sections.usca.Section;
|
|
12
|
+
[sections.usco.APIPrefix]?: sections.usco.Section;
|
|
13
|
+
[sections.usct.APIPrefix]?: sections.usct.Section;
|
|
14
|
+
[sections.usde.APIPrefix]?: sections.usde.Section;
|
|
15
|
+
[sections.usfl.APIPrefix]?: sections.usfl.Section;
|
|
16
|
+
[sections.usia.APIPrefix]?: sections.usia.Section;
|
|
17
|
+
[sections.usmt.APIPrefix]?: sections.usmt.Section;
|
|
18
|
+
[sections.usne.APIPrefix]?: sections.usne.Section;
|
|
19
|
+
[sections.usnh.APIPrefix]?: sections.usnh.Section;
|
|
20
|
+
[sections.usnj.APIPrefix]?: sections.usnj.Section;
|
|
21
|
+
[sections.usor.APIPrefix]?: sections.usor.Section;
|
|
22
|
+
[sections.ustn.APIPrefix]?: sections.ustn.Section;
|
|
23
|
+
[sections.ustx.APIPrefix]?: sections.ustx.Section;
|
|
24
|
+
[sections.usut.APIPrefix]?: sections.usut.Section;
|
|
25
|
+
[sections.usva.APIPrefix]?: sections.usva.Section;
|
|
26
|
+
};
|
|
27
|
+
type PingReturn = {
|
|
28
|
+
gppVersion: string;
|
|
29
|
+
cmpStatus: "stub" | "loading" | "loaded" | "error";
|
|
30
|
+
cmpDisplayStatus: "hidden" | "visible" | "disabled";
|
|
31
|
+
signalStatus: "not ready" | "ready";
|
|
32
|
+
supportedAPIs: string[];
|
|
33
|
+
cmpId: number;
|
|
34
|
+
sectionList: number[];
|
|
35
|
+
applicableSections: number[];
|
|
36
|
+
gppString: string;
|
|
37
|
+
parsedSections: ParsedSections;
|
|
38
|
+
};
|
|
39
|
+
type AddEventListener = {
|
|
40
|
+
eventName: string;
|
|
41
|
+
listenerId: number;
|
|
42
|
+
data: any;
|
|
43
|
+
pingData: PingReturn;
|
|
44
|
+
};
|
|
45
|
+
type AddEventListenerCallback = (data: AddEventListener, success: boolean) => void;
|
|
46
|
+
export { PingReturn };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import * as sections from "./sections";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * as tcfcav1 from "./tcfcav1";
|
|
2
|
+
export * as tcfeuv2 from "./tcfeuv2";
|
|
3
|
+
export * as usnat from "./usnat";
|
|
4
|
+
export * as usca from "./usca";
|
|
5
|
+
export * as usco from "./usco";
|
|
6
|
+
export * as usct from "./usct";
|
|
7
|
+
export * as usde from "./usde";
|
|
8
|
+
export * as usfl from "./usfl";
|
|
9
|
+
export * as usia from "./usia";
|
|
10
|
+
export * as usmt from "./usmt";
|
|
11
|
+
export * as usne from "./usne";
|
|
12
|
+
export * as usnh from "./usnh";
|
|
13
|
+
export * as usnj from "./usnj";
|
|
14
|
+
export * as usor from "./usor";
|
|
15
|
+
export * as ustn from "./ustn";
|
|
16
|
+
export * as ustx from "./ustx";
|
|
17
|
+
export * as usut from "./usut";
|
|
18
|
+
export * as usva from "./usva";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * as tcfcav1 from "./tcfcav1";
|
|
2
|
+
export * as tcfeuv2 from "./tcfeuv2";
|
|
3
|
+
export * as usnat from "./usnat";
|
|
4
|
+
export * as usca from "./usca";
|
|
5
|
+
export * as usco from "./usco";
|
|
6
|
+
export * as usct from "./usct";
|
|
7
|
+
export * as usde from "./usde";
|
|
8
|
+
export * as usfl from "./usfl";
|
|
9
|
+
export * as usia from "./usia";
|
|
10
|
+
export * as usmt from "./usmt";
|
|
11
|
+
export * as usne from "./usne";
|
|
12
|
+
export * as usnh from "./usnh";
|
|
13
|
+
export * as usnj from "./usnj";
|
|
14
|
+
export * as usor from "./usor";
|
|
15
|
+
export * as ustn from "./ustn";
|
|
16
|
+
export * as ustx from "./ustx";
|
|
17
|
+
export * as usut from "./usut";
|
|
18
|
+
export * as usva from "./usva";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ArrayOfRanges } from "./primitives";
|
|
2
|
+
type CoreSubsection = {
|
|
3
|
+
Version: number;
|
|
4
|
+
Created: Date;
|
|
5
|
+
LastUpdated: Date;
|
|
6
|
+
CmpId: number;
|
|
7
|
+
CmpVersion: number;
|
|
8
|
+
ConsentScreen: number;
|
|
9
|
+
ConsentLanguage: string;
|
|
10
|
+
VendorListVersion: number;
|
|
11
|
+
TcfPolicyVersion: number;
|
|
12
|
+
UseNonStandardStacks: boolean;
|
|
13
|
+
SpecialFeatureExpressConsent: number[];
|
|
14
|
+
PurposesExpressConsent: number[];
|
|
15
|
+
PurposesImpliedConsent: number[];
|
|
16
|
+
VendorExpressConsent: number[];
|
|
17
|
+
VendorImpliedConsent: number[];
|
|
18
|
+
PubRestrictions: ArrayOfRanges;
|
|
19
|
+
};
|
|
20
|
+
type DisclosedVendorsSubsection = {
|
|
21
|
+
SubsectionType: 1;
|
|
22
|
+
DisclosedVendors: number[];
|
|
23
|
+
};
|
|
24
|
+
type PublisherPurposesSubsection = {
|
|
25
|
+
SubsectionType: 3;
|
|
26
|
+
PubPurposesExpressConsent: number[];
|
|
27
|
+
PubPurposesImpliedConsent: number[];
|
|
28
|
+
NumCustomPurposes: number;
|
|
29
|
+
CustomPurposesExpressConsent: number[];
|
|
30
|
+
CustomPurposesImpliedConsent: number[];
|
|
31
|
+
};
|
|
32
|
+
declare const SectionID = 5;
|
|
33
|
+
declare const APIPrefix = "tcfcav1";
|
|
34
|
+
type Section = Array<CoreSubsection | DisclosedVendorsSubsection | PublisherPurposesSubsection>;
|
|
35
|
+
export type { Section };
|
|
36
|
+
export { APIPrefix, SectionID };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ArrayOfRanges } from "./primitives";
|
|
2
|
+
type CoreSegment = {
|
|
3
|
+
Version: number;
|
|
4
|
+
Created: Date;
|
|
5
|
+
LastUpdated: Date;
|
|
6
|
+
CmpId: number;
|
|
7
|
+
CmpVersion: number;
|
|
8
|
+
ConsentScreen: number;
|
|
9
|
+
ConsentLanguage: string;
|
|
10
|
+
VendorListVersion: number;
|
|
11
|
+
TcfPolicyVersion: number;
|
|
12
|
+
IsServiceSpecific: boolean;
|
|
13
|
+
UseNonStandardTexts: boolean;
|
|
14
|
+
SpecialFeatureOptIns: number[];
|
|
15
|
+
PurposeConsent: number[];
|
|
16
|
+
PurposesLITransparency: number[];
|
|
17
|
+
PurposeOneTreatment: boolean;
|
|
18
|
+
PublisherCC: string;
|
|
19
|
+
VendorConsent: number[];
|
|
20
|
+
VendorLegitimateInterest: number[];
|
|
21
|
+
PubRestrictions: ArrayOfRanges;
|
|
22
|
+
};
|
|
23
|
+
type DisclosedVendorsSegment = {
|
|
24
|
+
SegmentType: 1;
|
|
25
|
+
DisclosedVendors: number[];
|
|
26
|
+
};
|
|
27
|
+
type PublisherPurposesSegment = {
|
|
28
|
+
SegmentType: 3;
|
|
29
|
+
PubPurposesConsent: number[];
|
|
30
|
+
PubPurposesLITransparency: number[];
|
|
31
|
+
NumCustomPurposes: number;
|
|
32
|
+
CustomPurposesConsent: number[];
|
|
33
|
+
CustomPurposesLITransparency: number[];
|
|
34
|
+
};
|
|
35
|
+
declare const SectionID = 2;
|
|
36
|
+
declare const APIPrefix = "tcfeuv2";
|
|
37
|
+
type Section = Array<CoreSegment | DisclosedVendorsSegment | PublisherPurposesSegment>;
|
|
38
|
+
export type { Section };
|
|
39
|
+
export { APIPrefix, SectionID };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type CoreSubsection = {
|
|
2
|
+
Version: number;
|
|
3
|
+
SaleOptOutNotice: number;
|
|
4
|
+
SharingOptOutNotice: number;
|
|
5
|
+
SensitiveDataLimitUseNotice: number;
|
|
6
|
+
SaleOptOut: number;
|
|
7
|
+
SharingOptOut: number;
|
|
8
|
+
SensitiveDataProcessing: number[];
|
|
9
|
+
KnownChildSensitiveDataConsents: number[];
|
|
10
|
+
PersonalDataConsents: number;
|
|
11
|
+
MspaCoveredTransaction: number;
|
|
12
|
+
MspaOptOutOptionMode: number;
|
|
13
|
+
MspaServiceProviderMode: number;
|
|
14
|
+
};
|
|
15
|
+
type Section = Array<CoreSubsection>;
|
|
16
|
+
declare const SectionID = 8;
|
|
17
|
+
declare const APIPrefix = "usca";
|
|
18
|
+
export type { Section };
|
|
19
|
+
export { SectionID, APIPrefix };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type CoreSubsection = {
|
|
2
|
+
Version: number;
|
|
3
|
+
SharingNotice: number;
|
|
4
|
+
SaleOptOutNotice: number;
|
|
5
|
+
TargetedAdvertisingOptOutNotice: number;
|
|
6
|
+
SaleOptOut: number;
|
|
7
|
+
TargetedAdvertisingOptOut: number;
|
|
8
|
+
SensitiveDataProcessing: number[];
|
|
9
|
+
KnownChildSensitiveDataConsents: number;
|
|
10
|
+
MspaCoveredTransaction: number;
|
|
11
|
+
MspaOptOutOptionMode: number;
|
|
12
|
+
MspaServiceProviderMode: number;
|
|
13
|
+
};
|
|
14
|
+
type Section = Array<CoreSubsection>;
|
|
15
|
+
declare const SectionID = 10;
|
|
16
|
+
declare const APIPrefix = "usco";
|
|
17
|
+
export type { Section };
|
|
18
|
+
export { SectionID, APIPrefix };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type CoreSubsection = {
|
|
2
|
+
Version: number;
|
|
3
|
+
SharingNotice: number;
|
|
4
|
+
SaleOptOutNotice: number;
|
|
5
|
+
TargetedAdvertisingOptOutNotice: number;
|
|
6
|
+
SaleOptOut: number;
|
|
7
|
+
TargetedAdvertisingOptOut: number;
|
|
8
|
+
SensitiveDataProcessing: number[];
|
|
9
|
+
KnownChildSensitiveDataConsents: number;
|
|
10
|
+
MspaCoveredTransaction: number;
|
|
11
|
+
MspaOptOutOptionMode: number;
|
|
12
|
+
MspaServiceProviderMode: number;
|
|
13
|
+
};
|
|
14
|
+
type Section = Array<CoreSubsection>;
|
|
15
|
+
declare const SectionID = 12;
|
|
16
|
+
declare const APIPrefix = "usct";
|
|
17
|
+
export type { Section };
|
|
18
|
+
export { SectionID, APIPrefix };
|