Skip to content

Commit

Permalink
Build pour v0.19.0
Browse files Browse the repository at this point in the history
Release-As: 0.19.0
  • Loading branch information
remillc committed Aug 27, 2024
1 parent 442f8b4 commit cf78785
Show file tree
Hide file tree
Showing 93 changed files with 202 additions and 201 deletions.
4 changes: 2 additions & 2 deletions dist/ConsentStorage.cjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Librairie du system desing des Bibliothèques de l'Université de Montréal
* @module @bibudem/ui
* @version 0.18.1
* @version 0.19.0
* @author Christian Rémillard <[email protected]>
* @license ISC
* @see https://github.com/bibudem/ui
*/
var e,t,r=e=>{throw TypeError(e)},n=(e,t,n)=>(((e,t,n)=>{t.has(e)||r("Cannot "+n)})(e,t,"access private method"),n);const o=require("./index-9izUO_DB.cjs"),a=require("./constants-PQ5SQuv-.cjs"),s=require("./ConsentTokens.cjs"),c=require("./_Uint8Array-CtB9L6tP.cjs"),i=require("./isObject-D1wTAyjh.cjs");var u=c.getNative(i.root,"WeakMap"),f=c.overArg(Object.keys,Object),l=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,h=Object.getOwnPropertySymbols,v=h?function(e){return null==e?[]:(e=Object(e),function(t,r){for(var n=-1,o=null==t?0:t.length,a=0,s=[];++n<o;){var c=t[n];i=c,b.call(e,i)&&(s[a++]=c)}var i;return s}(h(e)))}:function(){return[]};function p(e){return r=v,n=t=e,o=c.isArrayLike(n)?c.arrayLikeKeys(n):function(e){if(!c.isPrototype(e))return f(e);var t=[];for(var r in Object(e))l.call(e,r)&&"constructor"!=r&&t.push(r);return t}(n),c.isArray(t)?o:function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}(o,r(t));var t,r,n,o}var y=c.getNative(i.root,"DataView"),d=c.getNative(i.root,"Promise"),w=c.getNative(i.root,"Set"),g="[object Map]",j="[object Promise]",_="[object Set]",E="[object WeakMap]",k="[object DataView]",S=c.toSource(y),O=c.toSource(c.Map),m=c.toSource(d),A=c.toSource(w),T=c.toSource(u),N=i.baseGetTag;function D(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new c.MapCache;++t<r;)this.add(e[t])}function M(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}(y&&N(new y(new ArrayBuffer(1)))!=k||c.Map&&N(new c.Map)!=g||d&&N(d.resolve())!=j||w&&N(new w)!=_||u&&N(new u)!=E)&&(N=function(e){var t=i.baseGetTag(e),r="[object Object]"==t?e.constructor:void 0,n=r?c.toSource(r):"";if(n)switch(n){case S:return k;case O:return g;case m:return j;case A:return _;case T:return E}return t}),D.prototype.add=D.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},D.prototype.has=function(e){return this.__data__.has(e)};var B=1,C=2;function L(e,t,r,n,o,a){var s=r&B,c=e.length,i=t.length;if(c!=i&&!(s&&i>c))return!1;var u=a.get(e),f=a.get(t);if(u&&f)return u==t&&f==e;var l=-1,b=!0,h=r&C?new D:void 0;for(a.set(e,t),a.set(t,e);++l<c;){var v=e[l],p=t[l];if(n)var y=s?n(p,v,l,t,e,a):n(v,p,l,e,t,a);if(void 0!==y){if(y)continue;b=!1;break}if(h){if(!M(t,(function(e,t){if(s=t,!h.has(s)&&(v===e||o(v,e,r,n,a)))return h.push(t);var s}))){b=!1;break}}else if(v!==p&&!o(v,p,r,n,a)){b=!1;break}}return a.delete(e),a.delete(t),b}function P(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function q(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var x=i.Symbol?i.Symbol.prototype:void 0,R=x?x.valueOf:void 0,V=Object.prototype.hasOwnProperty,U="[object Arguments]",z="[object Array]",W="[object Object]",G=Object.prototype.hasOwnProperty;function I(e,t,r,n,o){return e===t||(null==e||null==t||!i.isObjectLike(e)&&!i.isObjectLike(t)?e!=e&&t!=t:function(e,t,r,n,o,a){var s=c.isArray(e),i=c.isArray(t),u=s?z:N(e),f=i?z:N(t),l=(u=u==U?W:u)==W,b=(f=f==U?W:f)==W,h=u==f;if(h&&c.isBuffer(e)){if(!c.isBuffer(t))return!1;s=!0,l=!1}if(h&&!l)return a||(a=new c.Stack),s||c.isTypedArray(e)?L(e,t,r,n,o,a):function(e,t,r,n,o,a,s){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new c.Uint8Array(e),new c.Uint8Array(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return c.eq(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var i=P;case"[object Set]":var u=1&n;if(i||(i=q),e.size!=t.size&&!u)return!1;var f=s.get(e);if(f)return f==t;n|=2,s.set(e,t);var l=L(i(e),i(t),n,o,a,s);return s.delete(e),l;case"[object Symbol]":if(R)return R.call(e)==R.call(t)}return!1}(e,t,u,r,n,o,a);if(!(1&r)){var v=l&&G.call(e,"__wrapped__"),y=b&&G.call(t,"__wrapped__");if(v||y){var d=v?e.value():e,w=y?t.value():t;return a||(a=new c.Stack),o(d,w,r,n,a)}}return!!h&&(a||(a=new c.Stack),function(e,t,r,n,o,a){var s=1&r,c=p(e),i=c.length;if(i!=p(t).length&&!s)return!1;for(var u=i;u--;){var f=c[u];if(!(s?f in t:V.call(t,f)))return!1}var l=a.get(e),b=a.get(t);if(l&&b)return l==t&&b==e;var h=!0;a.set(e,t),a.set(t,e);for(var v=s;++u<i;){var y=e[f=c[u]],d=t[f];if(n)var w=s?n(d,y,f,t,e,a):n(y,d,f,e,t,a);if(!(void 0===w?y===d||o(y,d,r,n,a):w)){h=!1;break}v||(v="constructor"==f)}if(h&&!v){var g=e.constructor,j=t.constructor;g==j||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof j&&j instanceof j||(h=!1)}return a.delete(e),a.delete(t),h}(e,t,r,n,o,a))}(e,t,r,n,I,o))}class K extends EventTarget{constructor(){var t,n,o;super(),t=this,(n=e).has(t)?r("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,o),this.db=null}listen(e){super.addEventListener(a.EVENT_NAMES.UPDATE,e)}dispatchEvent({detail:e}){super.dispatchEvent(new CustomEvent(a.EVENT_NAMES.UPDATE,{detail:e}))}async init(){try{this.db=await o.openDB(a.DB_NAME,a.DB_VERSION,{upgrade(e){e.objectStoreNames.contains(a.DB_STORE_NAME)||e.createObjectStore(a.DB_STORE_NAME)}})}catch(e){throw new Error("Something went wrong with indexedDB:",e)}}async getConsentTokens(){const e=await this.db.get(a.DB_STORE_NAME,"tokens");return s.ConsentTokens.from(e)}async setConsentTokens(r){const o=s.ConsentTokens.from(r);return await n(this,e,t).call(this,o)}async resetTokens(){return await n(this,e,t).call(this)}}let F;e=new WeakSet,t=async function(e){try{const t=await this.getConsentTokens(),r=new s.ConsentTokens(e);return I(t,r)?(console.log("[setConsentTokens] No change in tokens. oldConsentTokens: ",t,"newConsentTokens: ",r),!1):(await this.db.put(a.DB_STORE_NAME,r,"tokens"),r)}catch(t){throw new Error("Something went wrong with indexedDB:",t)}},module.exports=async function(){return F||(F=new K,await F.init()),F};
var e,t,r=e=>{throw TypeError(e)},n=(e,t,n)=>(((e,t,n)=>{t.has(e)||r("Cannot "+n)})(e,t,"access private method"),n);const o=require("./index-9izUO_DB.cjs"),a=require("./constants-BvP9XHhn.cjs"),s=require("./ConsentTokens.cjs"),c=require("./_Uint8Array-CtB9L6tP.cjs"),i=require("./isObject-D1wTAyjh.cjs");var u=c.getNative(i.root,"WeakMap"),f=c.overArg(Object.keys,Object),l=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,h=Object.getOwnPropertySymbols,v=h?function(e){return null==e?[]:(e=Object(e),function(t,r){for(var n=-1,o=null==t?0:t.length,a=0,s=[];++n<o;){var c=t[n];i=c,b.call(e,i)&&(s[a++]=c)}var i;return s}(h(e)))}:function(){return[]};function p(e){return r=v,n=t=e,o=c.isArrayLike(n)?c.arrayLikeKeys(n):function(e){if(!c.isPrototype(e))return f(e);var t=[];for(var r in Object(e))l.call(e,r)&&"constructor"!=r&&t.push(r);return t}(n),c.isArray(t)?o:function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}(o,r(t));var t,r,n,o}var y=c.getNative(i.root,"DataView"),d=c.getNative(i.root,"Promise"),w=c.getNative(i.root,"Set"),g="[object Map]",j="[object Promise]",_="[object Set]",E="[object WeakMap]",k="[object DataView]",S=c.toSource(y),O=c.toSource(c.Map),m=c.toSource(d),A=c.toSource(w),T=c.toSource(u),N=i.baseGetTag;function D(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new c.MapCache;++t<r;)this.add(e[t])}function M(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}(y&&N(new y(new ArrayBuffer(1)))!=k||c.Map&&N(new c.Map)!=g||d&&N(d.resolve())!=j||w&&N(new w)!=_||u&&N(new u)!=E)&&(N=function(e){var t=i.baseGetTag(e),r="[object Object]"==t?e.constructor:void 0,n=r?c.toSource(r):"";if(n)switch(n){case S:return k;case O:return g;case m:return j;case A:return _;case T:return E}return t}),D.prototype.add=D.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},D.prototype.has=function(e){return this.__data__.has(e)};var B=1,C=2;function L(e,t,r,n,o,a){var s=r&B,c=e.length,i=t.length;if(c!=i&&!(s&&i>c))return!1;var u=a.get(e),f=a.get(t);if(u&&f)return u==t&&f==e;var l=-1,b=!0,h=r&C?new D:void 0;for(a.set(e,t),a.set(t,e);++l<c;){var v=e[l],p=t[l];if(n)var y=s?n(p,v,l,t,e,a):n(v,p,l,e,t,a);if(void 0!==y){if(y)continue;b=!1;break}if(h){if(!M(t,(function(e,t){if(s=t,!h.has(s)&&(v===e||o(v,e,r,n,a)))return h.push(t);var s}))){b=!1;break}}else if(v!==p&&!o(v,p,r,n,a)){b=!1;break}}return a.delete(e),a.delete(t),b}function P(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function q(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var x=i.Symbol?i.Symbol.prototype:void 0,R=x?x.valueOf:void 0,V=Object.prototype.hasOwnProperty,U="[object Arguments]",z="[object Array]",W="[object Object]",G=Object.prototype.hasOwnProperty;function I(e,t,r,n,o){return e===t||(null==e||null==t||!i.isObjectLike(e)&&!i.isObjectLike(t)?e!=e&&t!=t:function(e,t,r,n,o,a){var s=c.isArray(e),i=c.isArray(t),u=s?z:N(e),f=i?z:N(t),l=(u=u==U?W:u)==W,b=(f=f==U?W:f)==W,h=u==f;if(h&&c.isBuffer(e)){if(!c.isBuffer(t))return!1;s=!0,l=!1}if(h&&!l)return a||(a=new c.Stack),s||c.isTypedArray(e)?L(e,t,r,n,o,a):function(e,t,r,n,o,a,s){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new c.Uint8Array(e),new c.Uint8Array(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return c.eq(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var i=P;case"[object Set]":var u=1&n;if(i||(i=q),e.size!=t.size&&!u)return!1;var f=s.get(e);if(f)return f==t;n|=2,s.set(e,t);var l=L(i(e),i(t),n,o,a,s);return s.delete(e),l;case"[object Symbol]":if(R)return R.call(e)==R.call(t)}return!1}(e,t,u,r,n,o,a);if(!(1&r)){var v=l&&G.call(e,"__wrapped__"),y=b&&G.call(t,"__wrapped__");if(v||y){var d=v?e.value():e,w=y?t.value():t;return a||(a=new c.Stack),o(d,w,r,n,a)}}return!!h&&(a||(a=new c.Stack),function(e,t,r,n,o,a){var s=1&r,c=p(e),i=c.length;if(i!=p(t).length&&!s)return!1;for(var u=i;u--;){var f=c[u];if(!(s?f in t:V.call(t,f)))return!1}var l=a.get(e),b=a.get(t);if(l&&b)return l==t&&b==e;var h=!0;a.set(e,t),a.set(t,e);for(var v=s;++u<i;){var y=e[f=c[u]],d=t[f];if(n)var w=s?n(d,y,f,t,e,a):n(y,d,f,e,t,a);if(!(void 0===w?y===d||o(y,d,r,n,a):w)){h=!1;break}v||(v="constructor"==f)}if(h&&!v){var g=e.constructor,j=t.constructor;g==j||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof j&&j instanceof j||(h=!1)}return a.delete(e),a.delete(t),h}(e,t,r,n,o,a))}(e,t,r,n,I,o))}class K extends EventTarget{constructor(){var t,n,o;super(),t=this,(n=e).has(t)?r("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,o),this.db=null}listen(e){super.addEventListener(a.EVENT_NAMES.UPDATE,e)}dispatchEvent({detail:e}){super.dispatchEvent(new CustomEvent(a.EVENT_NAMES.UPDATE,{detail:e}))}async init(){try{this.db=await o.openDB(a.DB_NAME,a.DB_VERSION,{upgrade(e){e.objectStoreNames.contains(a.DB_STORE_NAME)||e.createObjectStore(a.DB_STORE_NAME)}})}catch(e){throw new Error("Something went wrong with indexedDB:",e)}}async getConsentTokens(){const e=await this.db.get(a.DB_STORE_NAME,"tokens");return s.ConsentTokens.from(e)}async setConsentTokens(r){const o=s.ConsentTokens.from(r);return await n(this,e,t).call(this,o)}async resetTokens(){return await n(this,e,t).call(this)}}let F;e=new WeakSet,t=async function(e){try{const t=await this.getConsentTokens(),r=new s.ConsentTokens(e);return I(t,r)?(console.log("[setConsentTokens] No change in tokens. oldConsentTokens: ",t,"newConsentTokens: ",r),!1):(await this.db.put(a.DB_STORE_NAME,r,"tokens"),r)}catch(t){throw new Error("Something went wrong with indexedDB:",t)}},module.exports=async function(){return F||(F=new K,await F.init()),F};
//# sourceMappingURL=ConsentStorage.cjs.map
2 changes: 1 addition & 1 deletion dist/ConsentStorage.cjs.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/ConsentStorage.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/ConsentStorage.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/ConsentTokens.cjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Librairie du system desing des Bibliothèques de l'Université de Montréal
* @module @bibudem/ui
* @version 0.18.1
* @version 0.19.0
* @author Christian Rémillard <[email protected]>
* @license ISC
* @see https://github.com/bibudem/ui
*/
var e,t,n,s,a=e=>{throw TypeError(e)},i=(e,t,n)=>t.has(e)||a("Cannot "+n),c=(e,t,n)=>(i(e,t,"read from private field"),n?n.call(e):t.get(e)),o=(e,t,n)=>t.has(e)?a("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),r=(e,t,n)=>(i(e,t,"access private method"),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./constants-PQ5SQuv-.cjs"),h=require("./isObject-D1wTAyjh.cjs");var E="[object Boolean]";function d(e){return!0===e||!1===e||h.isObjectLike(e)&&h.baseGetTag(e)==E}const u=Object.keys(l.DEFAULT_PREFERENCES);function T(e,{key:t,acceptNull:n=!1}={}){if(!d(e)&&!["granted","denied"].includes(e)&&!n&&null===e)throw new TypeError(`Invalid value${t?` for field \`${t}\``:""}: ${e}. Must be either boolean or one of 'granted' or 'denied'.`)}function f(e){if(!u.includes(e)){const t=`Invalid key: ${e}. Must be one of ${u.reduce(((e,t,n)=>n===u.length?`${e} or ${t}`:`${e}, ${t}`))}.`;throw new TypeError(t)}}e=new WeakMap,t=new WeakSet,n=function(t,n,s=!1){f(t),T(n,{key:t,acceptNull:s}),c(this,e)[t]=d(n)?n?"granted":"denied":n},s=function(t,n=!1){T(t,{acceptNull:n}),"string"!=typeof t&&(t=t?"granted":"denied"),Object.keys(c(this,e)).forEach((n=>c(this,e)[n]=t))};let b=class a{constructor(a){o(this,t),o(this,e,{...l.DEFAULT_PREFERENCES}),Object.defineProperties(this,{analytics_consent:{enumerable:!0,get:()=>c(this,e).analytics_consent,set:e=>r(this,t,n).call(this,"analytics_consent",e)},functionality_consent:{enumerable:!0,get:()=>c(this,e).functionality_consent,set:e=>r(this,t,n).call(this,"functionality_consent",e)},ad_consent:{enumerable:!0,get:()=>c(this,e).ad_consent,set:e=>r(this,t,n).call(this,"ad_consent",e)}}),void 0!==a&&(h.isObject(a)?Object.keys(l.DEFAULT_PREFERENCES).forEach((e=>{Reflect.has(a,e)&&r(this,t,n).call(this,e,a[e])})):r(this,t,s).call(this,a))}static from(e){var i;const c=new a;return e&&(h.isObject(e)?Object.keys(e).forEach((s=>{var a;r(a=c,t,n).call(a,s,e[s],!0)})):r(i=c,t,s).call(i,e,!0)),c}isGranted(t){return f(t),c(this,e)[t]===l.CONSENT_STATES.GRANTED}isDenied(t){return f(t),c(this,e)[t]===l.CONSENT_STATES.DENIED}state(){return Object.values(c(this,e)).every((e=>null!==e))?l.CONSENT_STATES.DETERMINATE:l.CONSENT_STATES.INDETERMINATE}setAll(e){h.isObject(e)?Object.entries(e).forEach((([e,s])=>r(this,t,n).call(this,e,s))):r(this,t,s).call(this,e)}resetConsent(){Object.keys(c(this,e)).forEach((t=>c(this,e)[t]=null))}toGTM(t=500){if(this.state()===l.CONSENT_STATES.INDETERMINATE){const t=Object.entries(c(this,e)).filter((e=>null===e[1]));throw new Error(`All tokens must have an explicit value. Undefined token${t.length>1?"s":""}: ${t.map((e=>e[0])).join(", ")}`)}const{analytics_consent:n,ad_consent:s}=c(this,e);return{ad_user_data:s,ad_personalization:s,ad_consent:s,analytics_consent:n,wait_for_update:t}}};exports.ConsentTokens=b;
var e,t,n,s,a=e=>{throw TypeError(e)},i=(e,t,n)=>t.has(e)||a("Cannot "+n),c=(e,t,n)=>(i(e,t,"read from private field"),n?n.call(e):t.get(e)),o=(e,t,n)=>t.has(e)?a("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),r=(e,t,n)=>(i(e,t,"access private method"),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./constants-BvP9XHhn.cjs"),h=require("./isObject-D1wTAyjh.cjs");var E="[object Boolean]";function d(e){return!0===e||!1===e||h.isObjectLike(e)&&h.baseGetTag(e)==E}const u=Object.keys(l.DEFAULT_PREFERENCES);function T(e,{key:t,acceptNull:n=!1}={}){if(!d(e)&&!["granted","denied"].includes(e)&&!n&&null===e)throw new TypeError(`Invalid value${t?` for field \`${t}\``:""}: ${e}. Must be either boolean or one of 'granted' or 'denied'.`)}function f(e){if(!u.includes(e)){const t=`Invalid key: ${e}. Must be one of ${u.reduce(((e,t,n)=>n===u.length?`${e} or ${t}`:`${e}, ${t}`))}.`;throw new TypeError(t)}}e=new WeakMap,t=new WeakSet,n=function(t,n,s=!1){f(t),T(n,{key:t,acceptNull:s}),c(this,e)[t]=d(n)?n?"granted":"denied":n},s=function(t,n=!1){T(t,{acceptNull:n}),"string"!=typeof t&&(t=t?"granted":"denied"),Object.keys(c(this,e)).forEach((n=>c(this,e)[n]=t))};let b=class a{constructor(a){o(this,t),o(this,e,{...l.DEFAULT_PREFERENCES}),Object.defineProperties(this,{analytics_consent:{enumerable:!0,get:()=>c(this,e).analytics_consent,set:e=>r(this,t,n).call(this,"analytics_consent",e)},functionality_consent:{enumerable:!0,get:()=>c(this,e).functionality_consent,set:e=>r(this,t,n).call(this,"functionality_consent",e)},ad_consent:{enumerable:!0,get:()=>c(this,e).ad_consent,set:e=>r(this,t,n).call(this,"ad_consent",e)}}),void 0!==a&&(h.isObject(a)?Object.keys(l.DEFAULT_PREFERENCES).forEach((e=>{Reflect.has(a,e)&&r(this,t,n).call(this,e,a[e])})):r(this,t,s).call(this,a))}static from(e){var i;const c=new a;return e&&(h.isObject(e)?Object.keys(e).forEach((s=>{var a;r(a=c,t,n).call(a,s,e[s],!0)})):r(i=c,t,s).call(i,e,!0)),c}isGranted(t){return f(t),c(this,e)[t]===l.CONSENT_STATES.GRANTED}isDenied(t){return f(t),c(this,e)[t]===l.CONSENT_STATES.DENIED}state(){return Object.values(c(this,e)).every((e=>null!==e))?l.CONSENT_STATES.DETERMINATE:l.CONSENT_STATES.INDETERMINATE}setAll(e){h.isObject(e)?Object.entries(e).forEach((([e,s])=>r(this,t,n).call(this,e,s))):r(this,t,s).call(this,e)}resetConsent(){Object.keys(c(this,e)).forEach((t=>c(this,e)[t]=null))}toGTM(t=500){if(this.state()===l.CONSENT_STATES.INDETERMINATE){const t=Object.entries(c(this,e)).filter((e=>null===e[1]));throw new Error(`All tokens must have an explicit value. Undefined token${t.length>1?"s":""}: ${t.map((e=>e[0])).join(", ")}`)}const{analytics_consent:n,ad_consent:s}=c(this,e);return{ad_user_data:s,ad_personalization:s,ad_consent:s,analytics_consent:n,wait_for_update:t}}};exports.ConsentTokens=b;
//# sourceMappingURL=ConsentTokens.cjs.map
4 changes: 2 additions & 2 deletions dist/ConsentTokens.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cf78785

Please sign in to comment.