From 49b5f8ec0881daeb9c8bc62822a7e59e4e63e58d Mon Sep 17 00:00:00 2001 From: lpw <812862340@qq.com> Date: Tue, 01 Jul 2025 15:29:24 +0800 Subject: [PATCH] 提交版本 4.5.0 --- frameworks/Didomi.xcframework/ios-arm64/Didomi.framework/dcs-encoder.js | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frameworks/Didomi.xcframework/ios-arm64/Didomi.framework/dcs-encoder.js b/frameworks/Didomi.xcframework/ios-arm64/Didomi.framework/dcs-encoder.js index 9c796be..8f84380 100644 --- a/frameworks/Didomi.xcframework/ios-arm64/Didomi.framework/dcs-encoder.js +++ b/frameworks/Didomi.xcframework/ios-arm64/Didomi.framework/dcs-encoder.js @@ -1,2 +1,2 @@ -/*! Library version: 1.2.1. Commit hash: 80fe8cd */ -var DcsEncoderModule;(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t){var e=function(t,e){if("object"!==r(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===r(e)?e:String(e)}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,i(r.key),r)}}function u(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}t.r(e),t.d(e,{CedEncoder:()=>Qe});var c=[1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368,75025],a=c.length,f=new Map([["A",0],["B",1],["C",2],["D",3],["E",4],["F",5],["G",6],["H",7],["I",8],["J",9],["K",10],["L",11],["M",12],["N",13],["O",14],["P",15],["Q",16],["R",17],["S",18],["T",19],["U",20],["V",21],["W",22],["X",23],["Y",24],["Z",25],["a",26],["b",27],["c",28],["d",29],["e",30],["f",31],["g",32],["h",33],["i",34],["j",35],["k",36],["l",37],["m",38],["n",39],["o",40],["p",41],["q",42],["r",43],["s",44],["t",45],["u",46],["v",47],["w",48],["x",49],["y",50],["z",51],["0",52],["1",53],["2",54],["3",55],["4",56],["5",57],["6",58],["7",59],["8",60],["9",61],["-",62],["_",63]]),s=new Map([["000000",0],["000001",1],["000010",2],["000011",3],["000100",4],["000101",5],["000110",6],["000111",7],["001000",8],["001001",9],["001010",10],["001011",11],["001100",12],["001101",13],["001110",14],["001111",15],["010000",16],["010001",17],["010010",18],["010011",19],["010100",20],["010101",21],["010110",22],["010111",23],["011000",24],["011001",25],["011010",26],["011011",27],["011100",28],["011101",29],["011110",30],["011111",31],["100000",32],["100001",33],["100010",34],["100011",35],["100100",36],["100101",37],["100110",38],["100111",39],["101000",40],["101001",41],["101010",42],["101011",43],["101100",44],["101101",45],["101110",46],["101111",47],["110000",48],["110001",49],["110010",50],["110011",51],["110100",52],["110101",53],["110110",54],["110111",55],["111000",56],["111001",57],["111010",58],["111011",59],["111100",60],["111101",61],["111110",62],["111111",63]]),l=new Map([[0,"000000"],[1,"000001"],[2,"000010"],[3,"000011"],[4,"000100"],[5,"000101"],[6,"000110"],[7,"000111"],[8,"001000"],[9,"001001"],[10,"001010"],[11,"001011"],[12,"001100"],[13,"001101"],[14,"001110"],[15,"001111"],[16,"010000"],[17,"010001"],[18,"010010"],[19,"010011"],[20,"010100"],[21,"010101"],[22,"010110"],[23,"010111"],[24,"011000"],[25,"011001"],[26,"011010"],[27,"011011"],[28,"011100"],[29,"011101"],[30,"011110"],[31,"011111"],[32,"100000"],[33,"100001"],[34,"100010"],[35,"100011"],[36,"100100"],[37,"100101"],[38,"100110"],[39,"100111"],[40,"101000"],[41,"101001"],[42,"101010"],[43,"101011"],[44,"101100"],[45,"101101"],[46,"101110"],[47,"101111"],[48,"110000"],[49,"110001"],[50,"110010"],[51,"110011"],[52,"110100"],[53,"110101"],[54,"110110"],[55,"110111"],[56,"111000"],[57,"111001"],[58,"111010"],[59,"111011"],[60,"111100"],[61,"111101"],[62,"111110"],[63,"111111"]]),h=new Map([["0",0],["1",1],["2",2],["3",3],["4",4],["5",5],["6",6],["7",7],["8",8],["9",9],["a",10],["b",11],["c",12],["d",13],["e",14],["f",15]]),d=new Map([[0,"0000"],[1,"0001"],[2,"0010"],[3,"0011"],[4,"0100"],[5,"0101"],[6,"0110"],[7,"0111"],[8,"1000"],[9,"1001"],[10,"1010"],[11,"1011"],[12,"1100"],[13,"1101"],[14,"1110"],[15,"1111"]]),y=new Map([["0000",0],["0001",1],["0010",2],["0011",3],["0100",4],["0101",5],["0110",6],["0111",7],["1000",8],["1001",9],["1010",10],["1011",11],["1100",12],["1101",13],["1110",14],["1111",15]]),v=new Map([["BitFieldSubSection","00"],["RangeSubSection","01"],["FibonacciSubSection","10"],["None","11"]]),p=(new Map([["00","BitFieldSubSection"],["01","RangeSubSection"],["10","FibonacciSubSection"],["11","None"]]),function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;n(this,t),this.bitString="0".repeat(e)}return u(t,[{key:"size",get:function(){return this.bitString.length}},{key:"isEmpty",get:function(){return 0===this.size}},{key:"clone",value:function(t){return this.bitString=t.toString(),this}},{key:"get",value:function(t){return"1"===this.bitString[t]}},{key:"toString",value:function(){return this.bitString}},{key:"add",value:function(t){return this.bitString+=t,this}},{key:"insert",value:function(t){return this.bitString=t+this.bitString,this}},{key:"shiftRight",value:function(t){return this.bitString="0".repeat(t)+this.bitString,this}},{key:"shiftLeft",value:function(t){return this.bitString=this.bitString.substring(t),this}},{key:"trim",value:function(t){return this.bitString=this.bitString.substring(0,this.size-t),this}},{key:"subSet",value:function(e,n){return(new t).fromBinaryString(this.bitString.substring(e,e+n))}},{key:"set",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?"1":"0";t>=this.bitString.length?this.bitString+="0".repeat(t-this.size)+e:this.bitString=this.bitString.substring(0,t)+e+this.bitString.substring(t+1)}},{key:"toBase64",value:function(){var t=this.bitString,e=this.size%24;t+=e?"0".repeat(24-e):"";for(var n="",r=0;r<t.length;r+=6){var i=t.substring(r,r+6);n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"[s.get(i)]}return n}},{key:"fromBase64",value:function(t){if(!/^[A-Za-z0-9\-_]+$/.test(t))return null;this.bitString="";for(var e=0;e<t.length;e++){var n=f.get(t[e]),r=l.get(n);this.bitString+=r}return this}},{key:"fromBinaryString",value:function(t){this.bitString="";for(var e=0;e<t.length;e++)"1"!==t[e]&&"0"!==t[e]||(this.bitString+=t[e]);return this}},{key:"fromUUID",value:function(t){this.bitString="";for(var e=0;e<t.length;e++){var n=h.get(t[e]);if(void 0!==n){var r=d.get(n);this.bitString+=r}}return this}},{key:"toUUID",value:function(){for(var t="",e=0;e<this.size;e+=4){var n=this.bitString.substring(e,e+4);t+="0123456789abcdef"[y.get(n)]}return"".concat(t.substring(0,8),"-").concat(t.substring(8,12),"-").concat(t.substring(12,16),"-").concat(t.substring(16,20),"-").concat(t.substring(20))}}]),t}());function m(t,e,n){return(e=i(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var b=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(n(this,t),m(this,"bitSet",new p),m(this,"value",0),!(e<=0||e>=65536)){for(var r=e,i=this.largestFibonacciIndexLessOrEqual(r),o=i;r>0;)for(this.bitSet.set(o),r-=c[o],o-=1;o>=0&&c[o]>r;)o-=1;this.bitSet.set(i+1),this.value=e}}return u(t,[{key:"largestFibonacciIndexLessOrEqual",value:function(t){for(var e=2;c[e-1]<=t;)e++;return e-2}},{key:"fromBitSet",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.value=0;for(var n=0,r=e;r<t.size&&!(n>=a);){var i=t.get(r),o=r+1===t.size||n+1===a?i:t.get(r+1);if(i&&(this.value+=c[n],o)){r++;break}n++,r++}return this.bitSet=t.subSet(e,r-e+1),this}},{key:"size",get:function(){return this.bitSet.size}},{key:"number",get:function(){return this.value}},{key:"codeword",get:function(){return this.bitSet}},{key:"toString",value:function(){return this.bitSet.toString()}},{key:"toNumber",value:function(){return this.value}}]),t}(),g=function(){function t(e,r){n(this,t),this.startId=e,this.numberOfIds=r}return u(t,[{key:"endId",get:function(){return new b(this.startId.number+this.numberOfIds.number-1)}},{key:"toIdsRange",value:function(){return new R(this.startId.number,this.endId.number)}}]),t}(),R=function(){function t(e,r){n(this,t),this.startId=e,this.endId=r}return u(t,[{key:"numberOfIds",get:function(){return this.endId-this.startId+1}},{key:"isSingleIdRange",get:function(){return this.endId===this.startId}},{key:"toFibonacciNumberIdsRange",value:function(){return new g(new b(this.startId),new b(this.numberOfIds))}}]),t}();function S(t,e){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},S(t,e)}function w(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&S(t,e)}function I(t,e){if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function O(t){return O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},O(t)}function D(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return x(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){c=!0,o=t},f:function(){try{u||null==n.return||n.return()}finally{if(c)throw o}}}}function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function N(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var B=function(t){w(r,t);var e=N(r);function r(t){return n(this,r),e.call(this,t)}return u(r,[{key:"createRange",value:function(t,e){return new R(t,e)}}]),r}(function(){function t(e){n(this,t),m(this,"ranges",new Array),this.status=e}return u(t,[{key:"numberOfRanges",get:function(){return this.ranges.length}},{key:"add",value:function(t){this.ranges.push(t)}},{key:"get",value:function(t){return this.ranges[t]}},{key:"fromIds",value:function(t){var e,n=0,r=0,i=D(t);try{for(i.s();!(e=i.n()).done;){var o=e.value;0!==n?(o===r+1||(this.ranges.push(this.createRange(n,r)),n=o),r=o):(n=o,r=o)}}catch(t){i.e(t)}finally{i.f()}return 0!=r&&this.ranges.push(this.createRange(n,r)),this}}]),t}());function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function F(t){return function(t){if(Array.isArray(t))return k(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return k(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return A(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return A(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){c=!0,o=t},f:function(){try{u||null==n.return||n.return()}finally{if(c)throw o}}}}function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var E=function(t){return t[t.Undefined=0]="Undefined",t[t.Disabled=1]="Disabled",t[t.Enabled=2]="Enabled",t}({}),j=(new Map([["00",E.Undefined],["01",E.Disabled],["10",E.Enabled]]),new Map([[E.Undefined,"00"],[E.Disabled,"01"],[E.Enabled,"10"]])),U=(new Map([["0000",[E.Enabled]],["0001",[E.Enabled,E.Disabled]],["0011",[E.Enabled,E.Undefined]],["0100",[E.Disabled,E.Enabled]],["0101",[E.Disabled]],["0111",[E.Disabled,E.Undefined]],["1100",[E.Undefined,E.Enabled]],["1101",[E.Undefined,E.Disabled]],["1111",[E.Undefined]]]),new Map([["10","0000"],["1001","0001"],["1000","0011"],["0110","0100"],["01","0101"],["0100","0111"],["0010","1100"],["0001","1101"],["00","1111"]]));var M=function(){function t(e,r){if(n(this,t),this.enabled=e,this.disabled=r,this.maximumID=0,this.minimumID=65536,this.undefinedIds=new Array,this.isEmpty)this.maximumID=0,this.minimumID=0;else{for(var i=0,o=[].concat(F(this.enabled),F(this.disabled));i<o.length;i++){var u=o[i];this.minimumID=u<this.minimumID?u:this.minimumID,this.maximumID=u>this.maximumID?u:this.maximumID}this.setUndefined(),this.maximumStatus=this.getIdStatus(this.maximumID),this.minimumStatus=this.getIdStatus(this.minimumID)}}return u(t,[{key:"setUndefined",value:function(){for(var t=this.minimumID;t<=this.maximumID;t++)-1==this.enabled.indexOf(t)&&-1==this.disabled.indexOf(t)&&this.undefinedIds.push(t)}},{key:"getIdStatus",value:function(t){return-1!==this.disabled.indexOf(t)?E.Disabled:-1!==this.enabled.indexOf(t)?E.Enabled:E.Undefined}},{key:"isEmpty",get:function(){return 0===this.enabled.length&&0===this.disabled.length}},{key:"isStatusSameForMaxMinIds",get:function(){return this.maximumStatus===this.minimumStatus}},{key:"numberOfEnabled",get:function(){return this.enabled.length}},{key:"numberOfDisabled",get:function(){return this.disabled.length}},{key:"numberOfUndefined",get:function(){return this.undefinedIds.length}},{key:"applyShift",value:function(t){if(!this.isEmpty&&0!==t){for(var e in this.enabled)this.enabled[e]+=t;for(var n in this.disabled)this.disabled[n]+=t;for(var r in this.undefinedIds)this.undefinedIds[r]+=t}}},{key:"toRanges",value:function(){if(this.isEmpty)return[new B(E.Enabled)];var t=function(t,e){return t-e},e=new B(E.Enabled).fromIds(this.enabled.sort(t)),n=new B(E.Disabled).fromIds(this.disabled.sort(t)),r=[e,n];if(this.isStatusSameForMaxMinIds){var i=new B(E.Undefined).fromIds(this.undefinedIds.sort(t));r=this.minimumStatus===E.Enabled?n.numberOfRanges<i.numberOfRanges?[e,n]:[e,i]:e.numberOfRanges<i.numberOfRanges?[n,e]:[n,i]}return r.filter((function(t){return t.numberOfRanges>0}))}},{key:"toPurposesVendors",value:function(){return{enabled:this.enabled,disabled:this.disabled}}}],[{key:"fromRanges",value:function(e){var n;if(e.length>2||0==e.length)return new t([],[]);var r,i=(m(n={},E.Enabled,new Array),m(n,E.Disabled,new Array),m(n,E.Undefined,new Array),n),o=P(e);try{for(o.s();!(r=o.n()).done;){var u,c=r.value,a=P(c.ranges);try{for(a.s();!(u=a.n()).done;)for(var f=u.value,s=f.startId;s<=f.endId;)i[c.status].push(s++)}catch(t){a.e(t)}finally{a.f()}}}catch(t){o.e(t)}finally{o.f()}var l=function(t,e){for(var n=i[t].length,r=i[t][0],o=i[t][n-1],u=r;u<=o;u++)-1===i[t].indexOf(u)&&-1===i[E.Undefined].indexOf(u)&&i[e].push(u)};return i[E.Undefined].length>0&&(i[E.Enabled].length>0?l(E.Enabled,E.Disabled):l(E.Disabled,E.Enabled)),new t(i[E.Enabled],i[E.Disabled])}}]),t}();function K(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var z=function(t){w(r,t);var e=K(r);function r(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return n(this,r),e.call(this,i,t)}return u(r)}(u((function t(e,r){n(this,t),this.version=e,this.sections=r}))),C=u((function t(){n(this,t)}));function T(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var L=function(t){w(r,t);var e=T(r);function r(t){var i;return n(this,r),(i=e.call(this)).name="Header",i.size=t.size,i.variants=t,i}return u(r)}(C);function _(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var H=function(t){w(r,t);var e=_(r);function r(t,i){var o;return n(this,r),(o=e.call(this)).name="PurposesConsent",o.key="purposes",o.size=0,o.variants=i,o.fields=t,o}return u(r)}(C);function V(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var $=function(t){w(r,t);var e=V(r);function r(t,i){var o;return n(this,r),(o=e.call(this)).name="PurposesLegitimateInterest",o.key="purposes_li",o.size=0,o.variants=i,o.fields=t,o}return u(r)}(C);function q(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var Z=function(t){w(r,t);var e=q(r);function r(t,i){var o;return n(this,r),(o=e.call(this)).name="VendorsConsent",o.key="vendors",o.size=0,o.variants=i,o.fields=t,o}return u(r)}(C);function G(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var J=function(t){w(r,t);var e=G(r);function r(t,i){var o;return n(this,r),(o=e.call(this)).name="VendorsLegitimateInterest",o.key="vendors_li",o.size=0,o.variants=i,o.fields=t,o}return u(r)}(C),Q=function(){function t(e,r,i){n(this,t),this.name=e,this.description=r,this.size=i}return u(t,[{key:"adjustEncoded",value:function(t,e){if(0!=this.size&&t.size!==this.size){var n=this.size-t.size;if("number"==typeof e||e instanceof Date)if(n>0)t.insert(new p(n));else{var r=-n;t.shiftLeft(r)}else if(n>0)t.add(new p(n));else{var i=-n;t.trim(i)}}}}]),t}();function W(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var X=function(t){w(r,t);var e=W(r);function r(t,i,o,u){var c;return n(this,r),(c=e.call(this,t,o,u)).key=i,c}return u(r)}(Q);function Y(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var tt=function(t){w(r,t);var e=Y(r);function r(t,i,o,u){var c;return n(this,r),(c=e.call(this,t,o,u)).value=i,c}return u(r)}(Q),et=6,nt=128,rt=36,it=16,ot=1,ut=16,ct=16,at=0,ft=4,st=16,lt=1,ht=16,dt=16,yt=0,vt=0,pt=2,mt=1;function bt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var gt=function(t){w(r,t);var e=bt(r);function r(t,i,o){var u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:rt;return n(this,r),e.call(this,t,i,o,u)}return u(r)}(X);function Rt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var St=function(t){w(r,t);var e=Rt(r);function r(){return n(this,r),e.call(this,r.FieldName,r.KeyName,r.Description)}return u(r)}(gt);function wt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}m(St,"FieldName","Created"),m(St,"KeyName","created"),m(St,"Description","UTC epoch time format with decisecond precision when the Consent String was initially created");var It=function(t){w(r,t);var e=wt(r);function r(){return n(this,r),e.call(this,r.FieldName,r.KeyName,r.Description)}return u(r)}(gt);function Ot(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}m(It,"FieldName","LastUpdated"),m(It,"KeyName","updated"),m(It,"Description","UTC epoch time format with decisecond precision when the Consent String was last time updated");var Dt=function(t){w(r,t);var e=Ot(r);function r(t,i,o){var u,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:it;return n(this,r),(u=e.call(this,t,i,o,c)).value=i,u}return u(r)}(tt);function xt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var Nt=function(t){w(r,t);var e=xt(r);function r(){return n(this,r),e.call(this,r.FieldName,r.KeyName,r.Description,nt)}return u(r)}(X);function Bt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}m(Nt,"FieldName","UserId"),m(Nt,"KeyName","user_id"),m(Nt,"Description","User ID (UUID)");var kt=function(t){w(r,t);var e=Bt(r);function r(t){return n(this,r),e.call(this,r.FieldName,t,r.Description,et)}return u(r)}(Dt);function Ft(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}m(kt,"FieldName","Version"),m(kt,"Description","Version number of the encoding format");var Pt=function(t){w(r,t);var e=Ft(r);function r(){return n(this,r),e.call(this,r.FieldName,r.KeyName,r.Description,pt)}return u(r)}(X);function At(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}m(Pt,"FieldName","EncodingAlgorithm"),m(Pt,"KeyName","encodingAlgorithm"),m(Pt,"Description","Defines encoding algorithm that was used to encode purposes or vendors IDs statuses.");var Et=function(t){w(r,t);var e=At(r);function r(){return n(this,r),e.call(this,r.FieldName,r.KeyName,r.Description)}return u(r)}(gt);function jt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}m(Et,"FieldName","LastSync"),m(Et,"KeyName","sync"),m(Et,"Description","Last sync date");var Ut=function(t){w(r,t);var e=jt(r);function r(){return n(this,r),e.call(this,r.FieldName,r.KeyName,r.Description,mt)}return u(r)}(X);function Mt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}m(Ut,"FieldName","HasSynced"),m(Ut,"KeyName","hasSynced"),m(Ut,"Description","If set to 1 then last sync date is present, if not last sync date is absent in the header");var Kt=function(t){w(r,t);var e=Mt(r);function r(){return n(this,r),e.call(this,r.FieldName,r.KeyName,r.Description,at)}return u(r)}(X);function zt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}m(Kt,"FieldName","BitField"),m(Kt,"KeyName","bitField"),m(Kt,"Description","BitField encoded vendors or purposes IDs statuses: Enabled, Disabled or Undefined");var Ct=function(t){w(r,t);var e=zt(r);function r(){return n(this,r),e.call(this,r.FieldName,r.KeyName,r.Description,ct)}return u(r)}(X);function Tt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}m(Ct,"FieldName","NumberOfIDs"),m(Ct,"KeyName","numberOfIds"),m(Ct,"Description","Number of vendor or purposes IDs encoded ");var Lt=function(t){w(r,t);var e=Tt(r);function r(){return n(this,r),e.call(this,r.FieldName,r.KeyName,r.Description,ot)}return u(r)}(X);function _t(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}m(Lt,"FieldName","StartFromOne"),m(Lt,"KeyName","startFromOne"),m(Lt,"Description","If set to 1 then encoding started form ID 1, if not encoding started form StartID");var Ht=function(t){w(r,t);var e=_t(r);function r(){return n(this,r),e.call(this,r.FieldName,r.KeyName,r.Description,ut)}return u(r)}(X);function Vt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}m(Ht,"FieldName","StartID"),m(Ht,"KeyName","startId"),m(Ht,"Description","Start (minimum) vendor or purposes ID that was encoded (Optional)");var $t=function(t){w(r,t);var e=Vt(r);function r(){return n(this,r),e.call(this,r.FieldName,r.KeyName,r.Description,ft)}return u(r)}(X);function qt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}m($t,"FieldName","EncodedStatuses"),m($t,"KeyName","encodedStatuses"),m($t,"Description","Define what statuses and in what order have been encoded");var Zt=function(t){w(r,t);var e=qt(r);function r(){return n(this,r),e.call(this,r.FieldName,r.KeyName,r.Description,st)}return u(r)}(X);function Gt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}m(Zt,"FieldName","NumberOfRanges"),m(Zt,"KeyName","numberOfRanges"),m(Zt,"Description","Number of ranges encoded");var Jt=function(t){w(r,t);var e=Gt(r);function r(){return n(this,r),e.call(this,r.FieldName,r.KeyName,r.Description,dt)}return u(r)}(X);function Qt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}m(Jt,"FieldName","RangeEnd"),m(Jt,"KeyName","rangeEnd"),m(Jt,"Description","Last ID in the encoded range");var Wt=function(t){w(r,t);var e=Qt(r);function r(){return n(this,r),e.call(this,r.FieldName,r.KeyName,r.Description,ht)}return u(r)}(X);function Xt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}m(Wt,"FieldName","RangeStart"),m(Wt,"KeyName","rangeStart"),m(Wt,"Description","First ID in the encoded range");var Yt=function(t){w(r,t);var e=Xt(r);function r(){return n(this,r),e.call(this,r.FieldName,r.KeyName,r.Description,lt)}return u(r)}(X);function te(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}m(Yt,"FieldName","SingleIdRange"),m(Yt,"KeyName","singleIdRange"),m(Yt,"Description","Set to 1 if range contains only RangeStart ID");var ee=function(t){w(r,t);var e=te(r);function r(){return n(this,r),e.call(this,r.FieldName,r.KeyName,r.Description,vt)}return u(r)}(X);function ne(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}m(ee,"FieldName","FibonacciNumberIdsInRange"),m(ee,"KeyName","fibonacciNumberIdsInRange"),m(ee,"Description","Number of IDs encoded in the range for Fibonacci encoding");var re=function(t){w(r,t);var e=ne(r);function r(){return n(this,r),e.call(this,r.FieldName,r.KeyName,r.Description,yt)}return u(r)}(X);m(re,"FieldName","FibonacciRangeStart"),m(re,"KeyName","fibonacciRangeStart"),m(re,"Description","First ID in the encoded range for Fibonacci encoding");var ie=u((function t(){n(this,t)}));function oe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var ue=new(function(t){w(r,t);var e=oe(r);function r(t){var i;return n(this,r),(i=e.call(this)).name="BitFieldSubSection",i.size=0,i.fields=t,i}return u(r)}(ie))([new Lt,new Ht,new Ct,new Kt]);function ce(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var ae=new(function(t){w(r,t);var e=ce(r);function r(t){var i;return n(this,r),(i=e.call(this)).name="FibonacciSubSection",i.size=0,i.fields=t,i}return u(r)}(ie))([new $t,new Zt,new re,new ee]);function fe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var se=function(t){w(r,t);var e=fe(r);function r(t){var i;return n(this,r),(i=e.call(this)).name="HeaderSubSection",i.size=t.map((function(t){return t.size})).reduce((function(t,e){return e+t}),0),i.fields=t,i}return u(r)}(ie),le=function(t){return new se([new kt(t),new Nt,new St,new It,new Ut,new Et])},he=le(2);function de(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var ye,ve=new(function(t){w(r,t);var e=de(r);function r(t){var i;return n(this,r),(i=e.call(this)).name="RangeSubSection",i.size=0,i.fields=t,i}return u(r)}(ie))([new $t,new Zt,new Yt,new Wt,new Jt]),pe=(m(ye={},1,new z([new L(le(1)),new H([new Pt],[ue]),new $([new Pt],[ue,ve,ae]),new Z([new Pt],[ue,ve,ae]),new J([new Pt],[ue,ve,ae])],1)),m(ye,2,new z([new L(le(2)),new H([new Pt],[ue,ve,ae]),new $([new Pt],[ue,ve,ae]),new Z([new Pt],[ue,ve,ae]),new J([new Pt],[ue,ve,ae])])),ye),me=function(){function t(){n(this,t)}return u(t,[{key:"encode",value:function(t){var e=Math.round(t.getTime()/100);return(new p).fromBinaryString(e.toString(2))}}]),t}(),be=function(){function t(){n(this,t)}return u(t,[{key:"encode",value:function(t){return(new p).fromBinaryString(t.toString(2))}}]),t}(),ge=function(){function t(){n(this,t)}return u(t,[{key:"encode",value:function(t){return(new p).fromUUID(t)}}]),t}(),Re=function(){function t(){n(this,t)}return u(t,[{key:"encode",value:function(t){return(new p).fromBinaryString(v.get(t)||"")}}]),t}(),Se=function(){function t(){n(this,t)}return u(t,[{key:"encode",value:function(t){var e=new p;if(t.isEmpty)return e;for(var n=t.minimumID;n<=t.maximumID;n++){var r=t.getIdStatus(n),i=j.get(r);i&&e.add((new p).fromBinaryString(i))}return e}}]),t}(),we=function(){function t(){n(this,t)}return u(t,[{key:"encode",value:function(t){return(new p).fromBinaryString(U.get(t.reduce((function(t,e){return t+j.get(e)}),""))||"")}}]),t}(),Ie=function(){function t(){n(this,t)}return u(t,[{key:"encode",value:function(t){return t.codeword}}]),t}(),Oe={Version:new be,UserId:new ge,Created:new me,LastUpdated:new me,StartFromOne:new be,StartID:new be,NumberOfIDs:new be,BitField:new Se,EncodedStatuses:new we,NumberOfRanges:new be,SingleIdRange:new be,RangeStart:new be,RangeEnd:new be,FibonacciRangeStart:new Ie,FibonacciNumberIdsInRange:new Ie,EncodingAlgorithm:new Re,LastSync:new me,HasSynced:new be},De=function(){function t(){n(this,t),m(this,"fieldIndex",0),m(this,"mapping",Oe)}return u(t,[{key:"encodeNext",value:function(t){var e=this.schema.fields[this.fieldIndex],n=this.mapping[e.name].encode(t);return e.adjustEncoded(n,t),this.fieldIndex++,n}},{key:"setSchema",value:function(t){this.schema=t}},{key:"getSchema",value:function(){return this.schema}}]),t}();function xe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var Ne=function(t){w(r,t);var e=xe(r);function r(){var t;return n(this,r),(t=e.call(this)).schema=ue,t}return u(r,[{key:"encode",value:function(t){this.fieldIndex=0;var e=new p,n=t.isEmpty?0:t.maximumID-t.minimumID+1,r=0,i=1,o=1;if(1<=t.minimumID&&t.minimumID<8){var u=t.minimumID-1;r=2*u,n+=u}else o=t.minimumID,i=0;return e.add(this.encodeNext(i)),0===i?e.add(this.encodeNext(o)):this.fieldIndex++,e.add(this.encodeNext(n)),e.add(this.encodeNext(t).shiftRight(r)),e}}]),r}(De);function Be(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return ke(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ke(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){c=!0,o=t},f:function(){try{u||null==n.return||n.return()}finally{if(c)throw o}}}}function ke(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Fe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var Pe=function(t){w(r,t);var e=Fe(r);function r(){var t;return n(this,r),(t=e.call(this)).schema=ve,t}return u(r,[{key:"encode",value:function(t){this.fieldIndex=0;var e=new p,n=t.toRanges(),r=n.map((function(t){return t.status}));e.add(this.encodeNext(r));for(var i=this.fieldIndex,o=0;o<r.length;o++){var u=n[o];e.add(this.encodeNext(u.numberOfRanges));var c,a=this.fieldIndex,f=Be(u.ranges);try{for(f.s();!(c=f.n()).done;){var s=c.value;e.add(this.encodeNext(s.isSingleIdRange?1:0)),e.add(this.encodeNext(s.startId)),s.isSingleIdRange?this.fieldIndex++:e.add(this.encodeNext(s.endId)),this.fieldIndex=a}}catch(t){f.e(t)}finally{f.f()}this.fieldIndex=i}return e}}]),r}(De);function Ae(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Ee(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ee(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){c=!0,o=t},f:function(){try{u||null==n.return||n.return()}finally{if(c)throw o}}}}function Ee(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function je(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var Ue=function(t){w(r,t);var e=je(r);function r(){var t;return n(this,r),(t=e.call(this)).schema=ae,t}return u(r,[{key:"encode",value:function(t){this.fieldIndex=0;var e=new p,n=t.toRanges(),r=n.map((function(t){return t.status}));e.add(this.encodeNext(r));for(var i=this.fieldIndex,o=0;o<r.length;o++){var u=n[o];e.add(this.encodeNext(u.numberOfRanges));var c,a=this.fieldIndex,f=Ae(u.ranges);try{for(f.s();!(c=f.n()).done;){var s=c.value.toFibonacciNumberIdsRange();e.add(this.encodeNext(s.startId)),e.add(this.encodeNext(s.numberOfIds)),this.fieldIndex=a}}catch(t){f.e(t)}finally{f.f()}this.fieldIndex=i}return e}}]),r}(De);function Me(t){return"string"==typeof t||t instanceof String}function Ke(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var ze=function(t){w(r,t);var e=Ke(r);function r(){var t;return n(this,r),(t=e.call(this)).schema=he,t}return u(r,[{key:"addHasSyncedIndicatorIfRequired",value:function(t){var e=void 0!==t.sync;t.hasSynced=e?1:0}},{key:"convertISODateStringsToDates",value:function(t){var e=t.created,n=t.updated,r=t.sync;Me(e)&&(t.created=new Date(e)),Me(n)&&(t.updated=new Date(n)),r&&Me(r)&&(t.sync=new Date(r))}},{key:"encode",value:function(t){this.fieldIndex=0;var e=new p;for(this.addHasSyncedIndicatorIfRequired(t),this.convertISODateStringsToDates(t);this.fieldIndex<this.schema.fields.length;){var n=this.schema.fields[this.fieldIndex];if(n instanceof X){var r=t[n.key];void 0!==r?e.add(this.encodeNext(r)):this.fieldIndex++}else if(n instanceof tt){var i=n.value;e.add(this.encodeNext(i))}}return e}}]),r}(De),Ce={BitFieldSubSection:new Ne,FibonacciSubSection:new Ue,RangeSubSection:new Pe,HeaderSubSection:new ze};function Te(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Le(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Le(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){c=!0,o=t},f:function(){try{u||null==n.return||n.return()}finally{if(c)throw o}}}}function Le(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var _e=function(){function t(){n(this,t),m(this,"fieldMapping",Oe),m(this,"subSectionMapping",Ce)}return u(t,[{key:"setupSubSectionSchema",value:function(){if(Array.isArray(this.schema.variants)){var t,e=Te(this.schema.variants);try{for(e.s();!(t=e.n()).done;){var n=t.value;this.subSectionMapping[n.name].setSchema(n)}}catch(t){e.e(t)}finally{e.f()}}else{var r=this.schema.variants;this.subSectionMapping[r.name].setSchema(r)}}},{key:"encode",value:function(t){var e=new p,n=new p,r="",i=-1;if(this.setupSubSectionSchema(),Array.isArray(this.schema.variants)){var o,u=Te(this.schema.variants);try{for(u.s();!(o=u.n()).done;){var c=o.value.name,a=this.subSectionMapping[c].encode(t);(-1===i||i>a.size)&&(e=a,r=c,i=a.size)}}catch(t){u.e(t)}finally{u.f()}}else{r=this.schema.variants.name,i=(e=this.subSectionMapping[r].encode(t)).size}if(this.schema.fields&&this.schema.fields.length>0){var f=this.schema.fields[0];n=this.fieldMapping[f.name].encode(r)}return n.add(e)}},{key:"setSchema",value:function(t){this.schema=t}},{key:"getSchema",value:function(){return this.schema}}]),t}();function He(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var Ve=function(t){w(r,t);var e=He(r);function r(){var t;return n(this,r),(t=e.call(this)).schema=new L(he),t}return u(r)}(_e);function $e(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I(this,n)}}var qe=function(t){w(r,t);var e=$e(r);function r(){var t;return n(this,r),(t=e.call(this)).schema=new H([new Pt],[ue]),t}return u(r)}(_e),Ze={Header:new Ve,PurposesConsent:new qe,PurposesLegitimateInterest:new qe,VendorsConsent:new qe,VendorsLegitimateInterest:new qe};function Ge(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Je(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Je(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){c=!0,o=t},f:function(){try{u||null==n.return||n.return()}finally{if(c)throw o}}}}function Je(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Qe=function(){function t(e,r,i){n(this,t),this.userStatus=e,this.version=r,this.options=i,this.schema=pe[r]}return u(t,[{key:"encode",value:function(){var t=new p;if(!this.userStatus)return t.toBase64();var e,n=Ge(this.schema.sections);try{for(n.s();!(e=n.n()).done;){var r=e.value,i=Ze[r.name];i.setSchema(r);var o=r.key;if(o){var u=this.userStatus[o],c=new M(u.enabled,u.disabled),a=i;t.add(a.encode(c))}else{var f=this.userStatus,s=i;t.add(s.encode(f))}}}catch(t){n.e(t)}finally{n.f()}return t.toBase64()}}]),t}();DcsEncoderModule=e})(); \ No newline at end of file +var DcsEncoder=function(e){"use strict";const t=new Map([["A",0],["B",1],["C",2],["D",3],["E",4],["F",5],["G",6],["H",7],["I",8],["J",9],["K",10],["L",11],["M",12],["N",13],["O",14],["P",15],["Q",16],["R",17],["S",18],["T",19],["U",20],["V",21],["W",22],["X",23],["Y",24],["Z",25],["a",26],["b",27],["c",28],["d",29],["e",30],["f",31],["g",32],["h",33],["i",34],["j",35],["k",36],["l",37],["m",38],["n",39],["o",40],["p",41],["q",42],["r",43],["s",44],["t",45],["u",46],["v",47],["w",48],["x",49],["y",50],["z",51],["0",52],["1",53],["2",54],["3",55],["4",56],["5",57],["6",58],["7",59],["8",60],["9",61],["-",62],["_",63]]),s=new Map([["000000",0],["000001",1],["000010",2],["000011",3],["000100",4],["000101",5],["000110",6],["000111",7],["001000",8],["001001",9],["001010",10],["001011",11],["001100",12],["001101",13],["001110",14],["001111",15],["010000",16],["010001",17],["010010",18],["010011",19],["010100",20],["010101",21],["010110",22],["010111",23],["011000",24],["011001",25],["011010",26],["011011",27],["011100",28],["011101",29],["011110",30],["011111",31],["100000",32],["100001",33],["100010",34],["100011",35],["100100",36],["100101",37],["100110",38],["100111",39],["101000",40],["101001",41],["101010",42],["101011",43],["101100",44],["101101",45],["101110",46],["101111",47],["110000",48],["110001",49],["110010",50],["110011",51],["110100",52],["110101",53],["110110",54],["110111",55],["111000",56],["111001",57],["111010",58],["111011",59],["111100",60],["111101",61],["111110",62],["111111",63]]),n=new Map([[0,"000000"],[1,"000001"],[2,"000010"],[3,"000011"],[4,"000100"],[5,"000101"],[6,"000110"],[7,"000111"],[8,"001000"],[9,"001001"],[10,"001010"],[11,"001011"],[12,"001100"],[13,"001101"],[14,"001110"],[15,"001111"],[16,"010000"],[17,"010001"],[18,"010010"],[19,"010011"],[20,"010100"],[21,"010101"],[22,"010110"],[23,"010111"],[24,"011000"],[25,"011001"],[26,"011010"],[27,"011011"],[28,"011100"],[29,"011101"],[30,"011110"],[31,"011111"],[32,"100000"],[33,"100001"],[34,"100010"],[35,"100011"],[36,"100100"],[37,"100101"],[38,"100110"],[39,"100111"],[40,"101000"],[41,"101001"],[42,"101010"],[43,"101011"],[44,"101100"],[45,"101101"],[46,"101110"],[47,"101111"],[48,"110000"],[49,"110001"],[50,"110010"],[51,"110011"],[52,"110100"],[53,"110101"],[54,"110110"],[55,"110111"],[56,"111000"],[57,"111001"],[58,"111010"],[59,"111011"],[60,"111100"],[61,"111101"],[62,"111110"],[63,"111111"]]),r=new Map([["0",0],["1",1],["2",2],["3",3],["4",4],["5",5],["6",6],["7",7],["8",8],["9",9],["a",10],["b",11],["c",12],["d",13],["e",14],["f",15]]),i=new Map([[0,"0000"],[1,"0001"],[2,"0010"],[3,"0011"],[4,"0100"],[5,"0101"],[6,"0110"],[7,"0111"],[8,"1000"],[9,"1001"],[10,"1010"],[11,"1011"],[12,"1100"],[13,"1101"],[14,"1110"],[15,"1111"]]),o=new Map([["0000",0],["0001",1],["0010",2],["0011",3],["0100",4],["0101",5],["0110",6],["0111",7],["1000",8],["1001",9],["1010",10],["1011",11],["1100",12],["1101",13],["1110",14],["1111",15]]);class a{constructor(e=0){this.bitString="0".repeat(e)}get size(){return this.bitString.length}get isEmpty(){return 0===this.size}clone(e){return this.bitString=e.toString(),this}get(e){return"1"===this.bitString[e]}toString(){return this.bitString}add(e){return this.bitString+=e,this}insert(e){return this.bitString=e+this.bitString,this}shiftRight(e){return this.bitString="0".repeat(e)+this.bitString,this}shiftLeft(e){return this.bitString=this.bitString.substring(e),this}padLeft(e,t="0"){return this.bitString=this.bitString.padStart(e,t),this}trim(e){return this.bitString=this.bitString.substring(0,this.size-e),this}subSet(e,t){return(new a).fromBinaryString(this.bitString.substring(e,e+t))}set(e,t=!0){const s=t?"1":"0";e>=this.bitString.length?this.bitString+="0".repeat(e-this.size)+s:this.bitString=this.bitString.substring(0,e)+s+this.bitString.substring(e+1)}addBoolean(e){const t=e?"1":"0";this.bitString+=t}addBinaryString(e){this.bitString+=e}toBase64(){let e=this.bitString;const t=this.size%24;e+=t?"0".repeat(24-t):"";let n="";for(let t=0;t<e.length;t+=6){const r=e.substring(t,t+6);n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"[s.get(r)]}return n}fromBase64(e){if(!/^[A-Za-z0-9\-_]+$/.test(e))return null;this.bitString="";for(let s=0;s<e.length;s++){const r=t.get(e[s]),i=n.get(r);this.bitString+=i}return this}fromBinaryString(e){this.bitString="";for(let t=0;t<e.length;t++)"1"!==e[t]&&"0"!==e[t]||(this.bitString+=e[t]);return this}fromUUID(e){this.bitString="";for(let t=0;t<e.length;t++){const s=r.get(e[t]);if(void 0!==s){const e=i.get(s);this.bitString+=e}}return this}toUUID(){let e="";for(let t=0;t<this.size;t+=4){const s=this.bitString.substring(t,t+4);e+="0123456789abcdef"[o.get(s)]}return`${e.substring(0,8)}-${e.substring(8,12)}-${e.substring(12,16)}-${e.substring(16,20)}-${e.substring(20)}`}}class d{constructor(e){this.status=e,this.ranges=new Array}get numberOfRanges(){return this.ranges.length}add(e){this.ranges.push(e)}get(e){return this.ranges[e]}fromIds(e){let t=0,s=0;for(const n of e)0!==t?(n===s+1||(this.ranges.push(this.createRange(t,s)),t=n),s=n):(t=n,s=n);return 0!=s&&this.ranges.push(this.createRange(t,s)),this}}class c{constructor(e,t){this.startId=e,this.endId=t}get numberOfIds(){return this.endId-this.startId+1}get isSingleIdRange(){return this.endId===this.startId}}class u extends d{constructor(e){super(e)}createRange(e,t){return new c(e,t)}}var l;!function(e){e[e.Undefined=0]="Undefined",e[e.Disabled=1]="Disabled",e[e.Enabled=2]="Enabled"}(l||(l={}));const p=new Map([["00",l.Undefined],["01",l.Disabled],["10",l.Enabled]]),h=new Map([[l.Undefined,"00"],[l.Disabled,"01"],[l.Enabled,"10"]]),g=new Map([["0000",[l.Enabled]],["0001",[l.Enabled,l.Disabled]],["0011",[l.Enabled,l.Undefined]],["0100",[l.Disabled,l.Enabled]],["0101",[l.Disabled]],["0111",[l.Disabled,l.Undefined]],["1100",[l.Undefined,l.Enabled]],["1101",[l.Undefined,l.Disabled]],["1111",[l.Undefined]]]),f=new Map([["10","0000"],["1001","0001"],["1000","0011"],["0110","0100"],["01","0101"],["0100","0111"],["0010","1100"],["0001","1101"],["00","1111"]]);class m{constructor(e,t){if(this.enabled=e,this.disabled=t,this.maximumID=0,this.minimumID=65536,this.undefinedIds=new Array,this.isEmpty)this.maximumID=0,this.minimumID=0;else{for(const e of[...this.enabled,...this.disabled])this.minimumID=e<this.minimumID?e:this.minimumID,this.maximumID=e>this.maximumID?e:this.maximumID;this.setUndefined(),this.maximumStatus=this.getIdStatus(this.maximumID),this.minimumStatus=this.getIdStatus(this.minimumID)}}setUndefined(){for(let e=this.minimumID;e<=this.maximumID;e++)-1==this.enabled.indexOf(e)&&-1==this.disabled.indexOf(e)&&this.undefinedIds.push(e)}getIdStatus(e){return-1!==this.disabled.indexOf(e)?l.Disabled:-1!==this.enabled.indexOf(e)?l.Enabled:l.Undefined}get isEmpty(){return 0===this.enabled.length&&0===this.disabled.length}get isStatusSameForMaxMinIds(){return this.maximumStatus===this.minimumStatus}get numberOfEnabled(){return this.enabled.length}get numberOfDisabled(){return this.disabled.length}get numberOfUndefined(){return this.undefinedIds.length}applyShift(e){if(!this.isEmpty&&0!==e){for(const t in this.enabled)this.enabled[t]+=e;for(const t in this.disabled)this.disabled[t]+=e;for(const t in this.undefinedIds)this.undefinedIds[t]+=e;this.ranges=void 0}}getRanges(){return this.ranges||(this.ranges=this.toRanges()),this.ranges}toRanges(){if(this.isEmpty)return[new u(l.Enabled)];const e=(e,t)=>e-t,t=new u(l.Enabled).fromIds(this.enabled.sort(e)),s=new u(l.Disabled).fromIds(this.disabled.sort(e));let n=[t,s];if(this.isStatusSameForMaxMinIds){const r=new u(l.Undefined).fromIds(this.undefinedIds.sort(e));this.minimumStatus===l.Enabled?s.numberOfRanges>=r.numberOfRanges&&(n=[t,r]):t.numberOfRanges>=r.numberOfRanges&&(n=[s,r])}return n.filter((e=>e.numberOfRanges>0))}static fromRanges(e){if(e.length>2||0==e.length)return new m([],[]);const t={[l.Enabled]:new Array,[l.Disabled]:new Array,[l.Undefined]:new Array};for(const s of e)for(const e of s.ranges){let n=e.startId;for(;n<=e.endId;)t[s.status].push(n++)}const s=(e,s)=>{const n=t[e].length,r=t[e][0],i=t[e][n-1];for(let n=r;n<=i;n++)-1===t[e].indexOf(n)&&-1===t[l.Undefined].indexOf(n)&&t[s].push(n)};return t[l.Undefined].length>0&&(t[l.Enabled].length>0?s(l.Enabled,l.Disabled):s(l.Disabled,l.Enabled)),new m(t[l.Enabled],t[l.Disabled])}toPurposesVendors(){return{enabled:this.enabled,disabled:this.disabled}}}var b,I;e.EncodingAlgorithm=void 0,(b=e.EncodingAlgorithm||(e.EncodingAlgorithm={})).BIT_FIELD_2_BITS="bit_field_2_bits",b.RANGES_FIBONACCI="ranges_fibonacci",b.RANGES_U16="ranges_u16",e.EncodingAlgorithmCodeword=void 0,(I=e.EncodingAlgorithmCodeword||(e.EncodingAlgorithmCodeword={})).BIT_FIELD_2_BITS="00",I.RANGES_FIBONACCI="10",I.RANGES_U16="01";const S={[e.EncodingAlgorithm.BIT_FIELD_2_BITS]:e.EncodingAlgorithmCodeword.BIT_FIELD_2_BITS,[e.EncodingAlgorithm.RANGES_FIBONACCI]:e.EncodingAlgorithmCodeword.RANGES_FIBONACCI,[e.EncodingAlgorithm.RANGES_U16]:e.EncodingAlgorithmCodeword.RANGES_U16},E={[e.EncodingAlgorithmCodeword.BIT_FIELD_2_BITS]:e.EncodingAlgorithm.BIT_FIELD_2_BITS,[e.EncodingAlgorithmCodeword.RANGES_FIBONACCI]:e.EncodingAlgorithm.RANGES_FIBONACCI,[e.EncodingAlgorithmCodeword.RANGES_U16]:e.EncodingAlgorithm.RANGES_U16};function v(e,t,s){if(e<0||e>s)throw new Error(`Value must be between 0 and ${s}`);return(new a).fromBinaryString(e.toString(2).padStart(t,"0"))}function _(e){return v(e,6,63)}function y(e){return v(e,16,65535)}function C(e){const t=e.map((e=>h.get(e.status))).join(""),s=f.get(t);if(!s)throw new Error("Invalid statuses");return s}const A=[1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368,75025],L=A.length;class w{largestFibonacciIndexLessOrEqual(e){let t=2;for(;A[t-1]<=e;)t++;return t-2}constructor(e=0){if(this.bitSet=new a,this.value=0,e<=0||e>=65536)return;let t=e;const s=this.largestFibonacciIndexLessOrEqual(t);let n=s;for(;t>0;)for(this.bitSet.set(n),t-=A[n],n-=1;n>=0&&A[n]>t;)n-=1;this.bitSet.set(s+1),this.value=e}fromBitSet(e,t=0){this.value=0;let s=0,n=t;for(;n<e.size&&!(s>=L);){const t=e.get(n),r=n+1===e.size||s+1===L?t:e.get(n+1);if(t&&(this.value+=A[s],r)){n++;break}s++,n++}return this.bitSet=e.subSet(t,n-t+1),this}get size(){return this.bitSet.size}get number(){return this.value}get codeword(){return this.bitSet}toString(){return this.bitSet.toString()}toNumber(){return this.value}}class T{constructor(e,t){this.startId=e,this.numberOfIds=t}get endId(){return new w(this.startId.number+this.numberOfIds.number-1)}}class D{static toFibonacciNumberIdsRange(e){return new T(new w(e.startId),new w(e.numberOfIds))}static toIdsRange(e){return new c(e.startId.number,e.endId.number)}}const R={[e.EncodingAlgorithm.RANGES_U16]:e=>{const t=new a,s=e.getRanges();t.addBinaryString(S.ranges_u16),t.addBinaryString(C(s));for(const e of s){t.add(y(e.numberOfRanges));for(const s of e.ranges)t.add((n=s.isSingleIdRange,(new a).fromBinaryString(n?"1":"0"))),t.add(y(s.startId)),s.isSingleIdRange||t.add(y(s.endId))}var n;return t},[e.EncodingAlgorithm.RANGES_FIBONACCI]:function(e){const t=new a,s=e.getRanges();t.addBinaryString(S.ranges_fibonacci),t.addBinaryString(C(s));for(const e of s){t.add(y(e.numberOfRanges));for(const s of e.ranges){const e=D.toFibonacciNumberIdsRange(s);t.add(e.startId.codeword),t.add(e.numberOfIds.codeword)}}return t},[e.EncodingAlgorithm.BIT_FIELD_2_BITS]:function(e){const t=new a;let s,n;t.addBinaryString(S.bit_field_2_bits),e.minimumID<8?(n=1,s=e.maximumID,t.addBoolean(!0)):(n=e.minimumID,s=e.maximumID-e.minimumID+1,t.addBoolean(!1),t.add(y(n))),t.add(y(s));for(let s=n;s<=e.maximumID;s++){const n=e.getIdStatus(s),r=h.get(n);if(!r)throw new Error(`Unknown status: ${n}`);t.addBinaryString(r)}return t}};var O;!function(e){e.VERSION="version",e.U6="u6",e.U16="u16",e.UUID="uuid",e.DATE="date",e.ENABLED_DISABLED_IDS="enabled_disabled_ids"}(O||(O={}));const U={[O.VERSION]:function(e){return _(e)},[O.U6]:_,[O.U16]:y,[O.UUID]:function(e){if(36!==e.length)throw new Error("Invalid UUID length");return(new a).fromUUID(e).padLeft(128)},[O.DATE]:function(e){const t="string"==typeof e?/^\d+$/.test(e)?new Date(parseInt(e,10)):new Date(e):e;if(isNaN(t.getTime()))throw new Error(`Invalid date: ${e}. Please provide a valid Date object or date string.`);const s=Math.round(t.getTime()/100);return(new a).fromBinaryString(s.toString(2).padStart(36,"0"))},[O.ENABLED_DISABLED_IDS]:function(e,t){if(!Array.isArray(t.variants)||0===t.variants.length)throw new Error(`Field "${t.key}" must have at least one variant`);const s=new m(e.enabled,e.disabled);return t.variants.map((e=>{if(e in R)return R[e](s);throw new Error(`Unsupported field variant "${e}" for field ${t.key}`)})).reduce(((e,t)=>t.size<e.size?t:e))}};function V(e,t){const s=new a;if(!0===e.optional){if(null==t)return s.addBoolean(!1),s;s.addBoolean(!0)}else if(void 0===t)throw new Error(`Missing required field: ${e.key}`);const n=(r=e.type,U[r]);var r;if(!n)throw new Error(`Unsupported field type: ${e.type}`);return s.add(n(t,e)),s}var P={consent_string_type:"didomi_consent_string",specification_version:1,tests:[{description:"Didomi Consent String V1",encoded:"BGHWv4UYba5-dZnABdKu__D6iWHsD6iWHsJ9iee2BAAilKiABFKVQAACIscAAAiLGAAA",decoded:{user_id:"1875afe1-461b-6b9f-9d66-700174abbffc",created:"2023-04-12T18:10:00.000Z",updated:"2023-04-12T18:10:00.000Z",sync:"2023-05-24T18:10:00.000Z",vendors_optin:{enabled:[128,129,130,131,132],disabled:[]},purposes_optin:{enabled:[1,2,6,7,8],disabled:[3,4]},vendors_optout:{enabled:[128,129,130,131,132],disabled:[]},purposes_optout:{enabled:[1,2,6,7,8],disabled:[3,4]}}}],types:["version","uuid","date","enabled_disabled_ids","bit_field_2_bits","ranges_u16","ranges_fibonacci"],fields:[{type:"version",description:"Didomi Consent String Specification Version, 6 bits number - 000010 or 'C' in Base64 for v2",key:"version",value:2},{type:"uuid",description:"User ID (UUID)",key:"user_id"},{type:"date",description:"UTC epoch time format when the Consent String was initially created",key:"created"},{type:"date",description:"UTC epoch time format when the Consent String was last time updated",key:"updated"},{type:"date",description:"Last sync date",key:"sync",optional:!0},{type:"enabled_disabled_ids",description:"User Status for purposes opt-in",key:"purposes_optin",variants:["bit_field_2_bits"]},{type:"enabled_disabled_ids",description:"User Status for purposes opt-out",key:"purposes_optout",variants:["bit_field_2_bits","ranges_u16","ranges_fibonacci"]},{type:"enabled_disabled_ids",description:"User Status for vendors opt-in",key:"vendors_optin",variants:["bit_field_2_bits","ranges_u16","ranges_fibonacci"]},{type:"enabled_disabled_ids",description:"User Status for vendors opt-out",key:"vendors_optout",variants:["bit_field_2_bits","ranges_u16","ranges_fibonacci"]}]},N={consent_string_type:"didomi_consent_string",specification_version:2,tests:[{description:"Didomi Consent String V2",encoded:"CGHWv4UYba5-dZnABdKu__D6iWHsD6iWHsAAKn2J57YEACKUqIAEUpVAAAIixwAACIsY",decoded:{user_id:"1875afe1-461b-6b9f-9d66-700174abbffc",created:"2023-04-12T18:10:00.000Z",updated:"2023-04-12T18:10:00.000Z",regulation_id:10,sync:"2023-05-24T18:10:00.000Z",vendors_optin:{enabled:[128,129,130,131,132],disabled:[]},purposes_optin:{enabled:[1,2,6,7,8],disabled:[3,4]},vendors_optout:{enabled:[128,129,130,131,132],disabled:[]},purposes_optout:{enabled:[1,2,6,7,8],disabled:[3,4]}}}],types:["version","uuid","date","u16","enabled_disabled_ids","bit_field_2_bits","ranges_u16","ranges_fibonacci"],fields:[{type:"version",description:"Didomi Consent String Specification Version, 6 bits number - 000010 or 'C' in Base64 for v2",key:"version",value:2},{type:"uuid",description:"User ID (UUID)",key:"user_id"},{type:"date",description:"UTC epoch time format when the Consent String was initially created",key:"created"},{type:"date",description:"UTC epoch time format when the Consent String was last time updated",key:"updated"},{type:"u16",description:"Regulation ID that was used to encode user status",key:"regulation_id"},{type:"date",description:"Last sync date",key:"sync",optional:!0},{type:"enabled_disabled_ids",description:"User Status for purposes opt-in",key:"purposes_optin",variants:["bit_field_2_bits","ranges_u16","ranges_fibonacci"]},{type:"enabled_disabled_ids",description:"User Status for purposes opt-out",key:"purposes_optout",variants:["bit_field_2_bits","ranges_u16","ranges_fibonacci"]},{type:"enabled_disabled_ids",description:"User Status for vendors opt-in",key:"vendors_optin",variants:["bit_field_2_bits","ranges_u16","ranges_fibonacci"]},{type:"enabled_disabled_ids",description:"User Status for vendors opt-out",key:"vendors_optout",variants:["bit_field_2_bits","ranges_u16","ranges_fibonacci"]}]};const F={1:P,2:N};class B extends Error{constructor(e){super(e),this.name="DecodingError"}}class x extends Error{constructor(e){super(e),this.name="EncodingError"}}class k extends Error{constructor(e){super(e),this.name="GVLError"}}class M extends Error{constructor(e,t,s=""){super(`invalid value ${t} passed for ${e} ${s}`),this.name="TCModelError"}}class G{static DICT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";static REVERSE_DICT=new Map([["A",0],["B",1],["C",2],["D",3],["E",4],["F",5],["G",6],["H",7],["I",8],["J",9],["K",10],["L",11],["M",12],["N",13],["O",14],["P",15],["Q",16],["R",17],["S",18],["T",19],["U",20],["V",21],["W",22],["X",23],["Y",24],["Z",25],["a",26],["b",27],["c",28],["d",29],["e",30],["f",31],["g",32],["h",33],["i",34],["j",35],["k",36],["l",37],["m",38],["n",39],["o",40],["p",41],["q",42],["r",43],["s",44],["t",45],["u",46],["v",47],["w",48],["x",49],["y",50],["z",51],["0",52],["1",53],["2",54],["3",55],["4",56],["5",57],["6",58],["7",59],["8",60],["9",61],["-",62],["_",63]]);static BASIS=6;static LCM=24;static encode(e){if(!/^[0-1]+$/.test(e))throw new x("Invalid bitField");const t=e.length%this.LCM;e+=t?"0".repeat(this.LCM-t):"";let s="";for(let t=0;t<e.length;t+=this.BASIS)s+=this.DICT[parseInt(e.substr(t,this.BASIS),2)];return s}static decode(e){if(!/^[A-Za-z0-9\-_]+$/.test(e))throw new B("Invalidly encoded Base64URL string");let t="";for(let s=0;s<e.length;s++){const n=this.REVERSE_DICT.get(e[s]).toString(2);t+="0".repeat(this.BASIS-n.length)+n}return t}}class H{static langSet=new Set(["AR","BG","BS","CA","CS","CY","DA","DE","EL","EN","ES","ET","EU","FI","FR","GL","HE","HR","HU","ID","IT","JA","KO","LT","LV","MK","MS","MT","NL","NO","PL","PT-BR","PT-PT","RO","RU","SK","SL","SR-LATN","SR-CYRL","SV","TL","TR","UK","ZH"]);has(e){return H.langSet.has(e)}parseLanguage(e){const t=(e=e.toUpperCase()).split("-")[0];if(e.length>=2&&2==t.length){if(H.langSet.has(e))return e;if(H.langSet.has(t))return t;const s=t+"-"+t;if(H.langSet.has(s))return s;for(const s of H.langSet)if(-1!==s.indexOf(e)||-1!==s.indexOf(t))return s}throw new Error(`unsupported language ${e}`)}forEach(e){H.langSet.forEach(e)}get size(){return H.langSet.size}}class ${static cmpId="cmpId";static cmpVersion="cmpVersion";static consentLanguage="consentLanguage";static consentScreen="consentScreen";static created="created";static supportOOB="supportOOB";static isServiceSpecific="isServiceSpecific";static lastUpdated="lastUpdated";static numCustomPurposes="numCustomPurposes";static policyVersion="policyVersion";static publisherCountryCode="publisherCountryCode";static publisherCustomConsents="publisherCustomConsents";static publisherCustomLegitimateInterests="publisherCustomLegitimateInterests";static publisherLegitimateInterests="publisherLegitimateInterests";static publisherConsents="publisherConsents";static publisherRestrictions="publisherRestrictions";static purposeConsents="purposeConsents";static purposeLegitimateInterests="purposeLegitimateInterests";static purposeOneTreatment="purposeOneTreatment";static specialFeatureOptins="specialFeatureOptins";static useNonStandardTexts="useNonStandardTexts";static vendorConsents="vendorConsents";static vendorLegitimateInterests="vendorLegitimateInterests";static vendorListVersion="vendorListVersion";static vendorsAllowed="vendorsAllowed";static vendorsDisclosed="vendorsDisclosed";static version="version"}class j{clone(){const e=new this.constructor;return Object.keys(this).forEach((t=>{const s=this.deepClone(this[t]);void 0!==s&&(e[t]=s)})),e}deepClone(e){const t=typeof e;if("number"===t||"string"===t||"boolean"===t)return e;if(null!==e&&"object"===t){if("function"==typeof e.clone)return e.clone();if(e instanceof Date)return new Date(e.getTime());if(void 0!==e[Symbol.iterator]){const t=[];for(const s of e)t.push(this.deepClone(s));return e instanceof Array?t:new e.constructor(t)}{const t={};for(const s in e)e.hasOwnProperty(s)&&(t[s]=this.deepClone(e[s]));return t}}}}var W,z,K,Q,Y,J;!function(e){e[e.NOT_ALLOWED=0]="NOT_ALLOWED",e[e.REQUIRE_CONSENT=1]="REQUIRE_CONSENT",e[e.REQUIRE_LI=2]="REQUIRE_LI"}(W||(W={}));class q extends j{static hashSeparator="-";purposeId_;restrictionType;constructor(e,t){super(),void 0!==e&&(this.purposeId=e),void 0!==t&&(this.restrictionType=t)}static unHash(e){const t=e.split(this.hashSeparator),s=new q;if(2!==t.length)throw new M("hash",e);return s.purposeId=parseInt(t[0],10),s.restrictionType=parseInt(t[1],10),s}get hash(){if(!this.isValid())throw new Error("cannot hash invalid PurposeRestriction");return`${this.purposeId}${q.hashSeparator}${this.restrictionType}`}get purposeId(){return this.purposeId_}set purposeId(e){this.purposeId_=e}isValid(){return Number.isInteger(this.purposeId)&&this.purposeId>0&&(this.restrictionType===W.NOT_ALLOWED||this.restrictionType===W.REQUIRE_CONSENT||this.restrictionType===W.REQUIRE_LI)}isSameAs(e){return this.purposeId===e.purposeId&&this.restrictionType===e.restrictionType}}class Z extends j{bitLength=0;map=new Map;gvl_;has(e){return this.map.has(e)}isOkToHave(e,t,s){let n=!0;if(this.gvl?.vendors){const r=this.gvl.vendors[s];if(r)if(e===W.NOT_ALLOWED)n=r.legIntPurposes.includes(t)||r.purposes.includes(t);else if(r.flexiblePurposes.length)switch(e){case W.REQUIRE_CONSENT:n=r.flexiblePurposes.includes(t)&&r.legIntPurposes.includes(t);break;case W.REQUIRE_LI:n=r.flexiblePurposes.includes(t)&&r.purposes.includes(t)}else n=!1;else n=!1}return n}add(e,t){if(this.isOkToHave(t.restrictionType,t.purposeId,e)){const s=t.hash;this.has(s)||(this.map.set(s,new Set),this.bitLength=0),this.map.get(s).add(e)}}restrictPurposeToLegalBasis(e){const t=Array.from(this.gvl.vendorIds),s=e.hash,n=t[t.length-1],r=[...Array(n).keys()].map((e=>e+1));if(this.has(s))for(let e=1;e<=n;e++)this.map.get(s).add(e);else this.map.set(s,new Set(r)),this.bitLength=0}getVendors(e){let t=[];if(e){const s=e.hash;this.has(s)&&(t=Array.from(this.map.get(s)))}else{const e=new Set;this.map.forEach((t=>{t.forEach((t=>{e.add(t)}))})),t=Array.from(e)}return t.sort(((e,t)=>e-t))}getRestrictionType(e,t){let s;return this.getRestrictions(e).forEach((e=>{e.purposeId===t&&(void 0===s||s>e.restrictionType)&&(s=e.restrictionType)})),s}vendorHasRestriction(e,t){let s=!1;const n=this.getRestrictions(e);for(let e=0;e<n.length&&!s;e++)s=t.isSameAs(n[e]);return s}getMaxVendorId(){let e=0;return this.map.forEach((t=>{e=Math.max(Array.from(t)[t.size-1],e)})),e}getRestrictions(e){const t=[];return this.map.forEach(((s,n)=>{e?s.has(e)&&t.push(q.unHash(n)):t.push(q.unHash(n))})),t}getPurposes(){const e=new Set;return this.map.forEach(((t,s)=>{e.add(q.unHash(s).purposeId)})),Array.from(e)}remove(e,t){const s=t.hash,n=this.map.get(s);n&&(n.delete(e),0==n.size&&(this.map.delete(s),this.bitLength=0))}set gvl(e){this.gvl_||(this.gvl_=e,this.map.forEach(((e,t)=>{const s=q.unHash(t);Array.from(e).forEach((t=>{this.isOkToHave(s.restrictionType,s.purposeId,t)||e.delete(t)}))})))}get gvl(){return this.gvl_}isEmpty(){return 0===this.map.size}get numRestrictions(){return this.map.size}}!function(e){e.COOKIE="cookie",e.WEB="web",e.APP="app"}(z||(z={})),function(e){e.CORE="core",e.VENDORS_DISCLOSED="vendorsDisclosed",e.VENDORS_ALLOWED="vendorsAllowed",e.PUBLISHER_TC="publisherTC"}(K||(K={}));class X{static ID_TO_KEY=[K.CORE,K.VENDORS_DISCLOSED,K.VENDORS_ALLOWED,K.PUBLISHER_TC];static KEY_TO_ID={[K.CORE]:0,[K.VENDORS_DISCLOSED]:1,[K.VENDORS_ALLOWED]:2,[K.PUBLISHER_TC]:3}}class ee extends j{bitLength=0;maxId_=0;set_=new Set;*[Symbol.iterator](){for(let e=1;e<=this.maxId;e++)yield[e,this.has(e)]}values(){return this.set_.values()}get maxId(){return this.maxId_}has(e){return this.set_.has(e)}unset(e){Array.isArray(e)?e.forEach((e=>this.unset(e))):"object"==typeof e?this.unset(Object.keys(e).map((e=>Number(e)))):(this.set_.delete(Number(e)),this.bitLength=0,e===this.maxId&&(this.maxId_=0,this.set_.forEach((e=>{this.maxId_=Math.max(this.maxId,e)}))))}isIntMap(e){let t="object"==typeof e;return t=t&&Object.keys(e).every((t=>{let s=Number.isInteger(parseInt(t,10));return s=s&&this.isValidNumber(e[t].id),s=s&&void 0!==e[t].name,s})),t}isValidNumber(e){return parseInt(e,10)>0}isSet(e){let t=!1;return e instanceof Set&&(t=Array.from(e).every(this.isValidNumber)),t}set(e){if(Array.isArray(e))e.forEach((e=>this.set(e)));else if(this.isSet(e))this.set(Array.from(e));else if(this.isIntMap(e))this.set(Object.keys(e).map((e=>Number(e))));else{if(!this.isValidNumber(e))throw new M("set()",e,"must be positive integer array, positive integer, Set<number>, or IntMap");this.set_.add(e),this.maxId_=Math.max(this.maxId,e),this.bitLength=0}}empty(){this.set_=new Set}forEach(e){for(let t=1;t<=this.maxId;t++)e(this.has(t),t)}get size(){return this.set_.size}setAll(e){this.set(e)}}class te{static[$.cmpId]=12;static[$.cmpVersion]=12;static[$.consentLanguage]=12;static[$.consentScreen]=6;static[$.created]=36;static[$.isServiceSpecific]=1;static[$.lastUpdated]=36;static[$.policyVersion]=6;static[$.publisherCountryCode]=12;static[$.publisherLegitimateInterests]=24;static[$.publisherConsents]=24;static[$.purposeConsents]=24;static[$.purposeLegitimateInterests]=24;static[$.purposeOneTreatment]=1;static[$.specialFeatureOptins]=12;static[$.useNonStandardTexts]=1;static[$.vendorListVersion]=12;static[$.version]=6;static anyBoolean=1;static encodingType=1;static maxId=16;static numCustomPurposes=6;static numEntries=12;static numRestrictions=12;static purposeId=6;static restrictionType=2;static segmentType=3;static singleOrRange=1;static vendorId=16}class se{static encode(e){return String(Number(e))}static decode(e){return"1"===e}}class ne{static encode(e,t){let s;if("string"==typeof e&&(e=parseInt(e,10)),s=e.toString(2),s.length>t||e<0)throw new x(`${e} too large to encode into ${t}`);return s.length<t&&(s="0".repeat(t-s.length)+s),s}static decode(e,t){if(t!==e.length)throw new B("invalid bit length");return parseInt(e,2)}}class re{static encode(e,t){return ne.encode(Math.round(e.getTime()/100),t)}static decode(e,t){if(t!==e.length)throw new B("invalid bit length");const s=new Date;return s.setTime(100*ne.decode(e,t)),s}}class ie{static encode(e,t){let s="";for(let n=1;n<=t;n++)s+=se.encode(e.has(n));return s}static decode(e,t){if(e.length!==t)throw new B("bitfield encoding length mismatch");const s=new ee;for(let n=1;n<=t;n++)se.decode(e[n-1])&&s.set(n);return s.bitLength=e.length,s}}class oe{static encode(e,t){const s=(e=e.toUpperCase()).charCodeAt(0)-65,n=e.charCodeAt(1)-65;if(s<0||s>25||n<0||n>25)throw new x(`invalid language code: ${e}`);if(t%2==1)throw new x(`numBits must be even, ${t} is not valid`);return t/=2,ne.encode(s,t)+ne.encode(n,t)}static decode(e,t){let s;if(t!==e.length||e.length%2)throw new B("invalid bit length for language");{const t=65,n=e.length/2,r=ne.decode(e.slice(0,n),n)+t,i=ne.decode(e.slice(n),n)+t;s=String.fromCharCode(r)+String.fromCharCode(i)}return s}}class ae{static encode(e){let t=ne.encode(e.numRestrictions,te.numRestrictions);if(!e.isEmpty()){const s=(t,s)=>{for(let n=t+1;n<=s;n++)if(e.gvl.vendorIds.has(n))return n;return t};e.getRestrictions().forEach((n=>{t+=ne.encode(n.purposeId,te.purposeId),t+=ne.encode(n.restrictionType,te.restrictionType);const r=e.getVendors(n),i=r.length;let o=0,a=0,d="";for(let e=0;e<i;e++){const t=r[e];if(0===a&&(o++,a=t),e===i-1||r[e+1]>s(t,r[i-1])){const e=!(t===a);d+=se.encode(e),d+=ne.encode(a,te.vendorId),e&&(d+=ne.encode(t,te.vendorId)),a=0}}t+=ne.encode(o,te.numEntries),t+=d}))}return t}static decode(e){let t=0;const s=new Z,n=ne.decode(e.substr(t,te.numRestrictions),te.numRestrictions);t+=te.numRestrictions;for(let r=0;r<n;r++){const n=ne.decode(e.substr(t,te.purposeId),te.purposeId);t+=te.purposeId;const r=ne.decode(e.substr(t,te.restrictionType),te.restrictionType);t+=te.restrictionType;const i=new q(n,r),o=ne.decode(e.substr(t,te.numEntries),te.numEntries);t+=te.numEntries;for(let n=0;n<o;n++){const n=se.decode(e.substr(t,te.anyBoolean));t+=te.anyBoolean;const r=ne.decode(e.substr(t,te.vendorId),te.vendorId);if(t+=te.vendorId,n){const n=ne.decode(e.substr(t,te.vendorId),te.vendorId);if(t+=te.vendorId,n<r)throw new B(`Invalid RangeEntry: endVendorId ${n} is less than ${r}`);for(let e=r;e<=n;e++)s.add(e,i)}else s.add(r,i)}}return s.bitLength=t,s}}!function(e){e[e.FIELD=0]="FIELD",e[e.RANGE=1]="RANGE"}(Q||(Q={}));class de{static encode(e){const t=[];let s,n=[],r=ne.encode(e.maxId,te.maxId),i="";const o=te.maxId+te.encodingType,a=o+e.maxId,d=2*te.vendorId+te.singleOrRange+te.numEntries;let c=o+te.numEntries;return e.forEach(((r,o)=>{i+=se.encode(r),s=e.maxId>d&&c<a,s&&r&&(e.has(o+1)?0===n.length&&(n.push(o),c+=te.singleOrRange,c+=te.vendorId):(n.push(o),c+=te.vendorId,t.push(n),n=[]))})),s?(r+=String(Q.RANGE),r+=this.buildRangeEncoding(t)):(r+=String(Q.FIELD),r+=i),r}static decode(e,t){let s,n=0;const r=ne.decode(e.substr(n,te.maxId),te.maxId);n+=te.maxId;const i=ne.decode(e.charAt(n),te.encodingType);if(n+=te.encodingType,i===Q.RANGE){if(s=new ee,1===t){if("1"===e.substr(n,1))throw new B("Unable to decode default consent=1");n++}const r=ne.decode(e.substr(n,te.numEntries),te.numEntries);n+=te.numEntries;for(let t=0;t<r;t++){const t=se.decode(e.charAt(n));n+=te.singleOrRange;const r=ne.decode(e.substr(n,te.vendorId),te.vendorId);if(n+=te.vendorId,t){const t=ne.decode(e.substr(n,te.vendorId),te.vendorId);n+=te.vendorId;for(let e=r;e<=t;e++)s.set(e)}else s.set(r)}}else{const t=e.substr(n,r);n+=r,s=ie.decode(t,r)}return s.bitLength=n,s}static buildRangeEncoding(e){const t=e.length;let s=ne.encode(t,te.numEntries);return e.forEach((e=>{const t=1===e.length;s+=se.encode(!t),s+=ne.encode(e[0],te.vendorId),t||(s+=ne.encode(e[1],te.vendorId))})),s}}function ce(){return{[$.version]:ne,[$.created]:re,[$.lastUpdated]:re,[$.cmpId]:ne,[$.cmpVersion]:ne,[$.consentScreen]:ne,[$.consentLanguage]:oe,[$.vendorListVersion]:ne,[$.policyVersion]:ne,[$.isServiceSpecific]:se,[$.useNonStandardTexts]:se,[$.specialFeatureOptins]:ie,[$.purposeConsents]:ie,[$.purposeLegitimateInterests]:ie,[$.purposeOneTreatment]:se,[$.publisherCountryCode]:oe,[$.vendorConsents]:de,[$.vendorLegitimateInterests]:de,[$.publisherRestrictions]:ae,segmentType:ne,[$.vendorsDisclosed]:de,[$.vendorsAllowed]:de,[$.publisherConsents]:ie,[$.publisherLegitimateInterests]:ie,[$.numCustomPurposes]:ne,[$.publisherCustomConsents]:ie,[$.publisherCustomLegitimateInterests]:ie}}class ue{1={[K.CORE]:[$.version,$.created,$.lastUpdated,$.cmpId,$.cmpVersion,$.consentScreen,$.consentLanguage,$.vendorListVersion,$.purposeConsents,$.vendorConsents]};2={[K.CORE]:[$.version,$.created,$.lastUpdated,$.cmpId,$.cmpVersion,$.consentScreen,$.consentLanguage,$.vendorListVersion,$.policyVersion,$.isServiceSpecific,$.useNonStandardTexts,$.specialFeatureOptins,$.purposeConsents,$.purposeLegitimateInterests,$.purposeOneTreatment,$.publisherCountryCode,$.vendorConsents,$.vendorLegitimateInterests,$.publisherRestrictions],[K.PUBLISHER_TC]:[$.publisherConsents,$.publisherLegitimateInterests,$.numCustomPurposes,$.publisherCustomConsents,$.publisherCustomLegitimateInterests],[K.VENDORS_ALLOWED]:[$.vendorsAllowed],[K.VENDORS_DISCLOSED]:[$.vendorsDisclosed]}}class le{1=[K.CORE];2=[K.CORE];constructor(e,t){if(2===e.version)if(e.isServiceSpecific)this[2].push(K.PUBLISHER_TC);else{const s=!(!t||!t.isForVendors);s&&!0!==e[$.supportOOB]||this[2].push(K.VENDORS_DISCLOSED),s&&(e[$.supportOOB]&&e[$.vendorsAllowed].size>0&&this[2].push(K.VENDORS_ALLOWED),this[2].push(K.PUBLISHER_TC))}}}class pe{static fieldSequence=new ue;static encode(e,t){let s;try{s=this.fieldSequence[String(e.version)][t]}catch(s){throw new x(`Unable to encode version: ${e.version}, segment: ${t}`)}let n="";t!==K.CORE&&(n=ne.encode(X.KEY_TO_ID[t],te.segmentType));const r=ce();return s.forEach((s=>{const i=e[s],o=r[s];let a=te[s];void 0===a&&this.isPublisherCustom(s)&&(a=Number(e[$.numCustomPurposes]));try{n+=o.encode(i,a)}catch(e){throw new x(`Error encoding ${t}->${s}: ${e.message}`)}})),G.encode(n)}static decode(e,t,s){const n=G.decode(e);let r=0;s===K.CORE&&(t.version=ne.decode(n.substr(r,te[$.version]),te[$.version])),s!==K.CORE&&(r+=te.segmentType);const i=this.fieldSequence[String(t.version)][s],o=ce();return i.forEach((e=>{const s=o[e];let i=te[e];if(void 0===i&&this.isPublisherCustom(e)&&(i=Number(t[$.numCustomPurposes])),0!==i){const o=n.substr(r,i);if(t[e]=s===de?s.decode(o,t.version):s.decode(o,i),Number.isInteger(i))r+=i;else{if(!Number.isInteger(t[e].bitLength))throw new B(e);r+=t[e].bitLength}}})),t}static isPublisherCustom(e){return 0===e.indexOf("publisherCustom")}}class he{static processor=[e=>e,(e,t)=>{e.publisherRestrictions.gvl=t,e.purposeLegitimateInterests.unset([1,3,4,5,6]);const s=new Map;return s.set("legIntPurposes",e.vendorLegitimateInterests),s.set("purposes",e.vendorConsents),s.forEach(((s,n)=>{s.forEach(((r,i)=>{if(r){const r=t.vendors[i];if(!r||r.deletedDate)s.unset(i);else if(0===r[n].length)if("legIntPurposes"===n&&0===r.purposes.length&&0===r.legIntPurposes.length&&r.specialPurposes.length>0);else if(e.isServiceSpecific)if(0===r.flexiblePurposes.length)s.unset(i);else{const t=e.publisherRestrictions.getRestrictions(i);let r=!1;for(let e=0,s=t.length;e<s&&!r;e++)r=t[e].restrictionType===W.REQUIRE_CONSENT&&"purposes"===n||t[e].restrictionType===W.REQUIRE_LI&&"legIntPurposes"===n;r||s.unset(i)}else s.unset(i)}}))})),e.vendorsDisclosed.set(t.vendors),e}];static process(e,t){const s=e.gvl;if(!s)throw new x("Unable to encode TCModel without a GVL");if(!s.isReady)throw new x("Unable to encode TCModel tcModel.gvl.readyPromise is not resolved");(e=e.clone()).consentLanguage=s.language.slice(0,2).toUpperCase(),t?.version>0&&t?.version<=this.processor.length?e.version=t.version:e.version=this.processor.length;const n=e.version-1;if(!this.processor[n])throw new x(`Invalid version: ${e.version}`);return this.processor[n](e,s)}}class ge{static absCall(e,t,s,n){return new Promise(((r,i)=>{const o=new XMLHttpRequest;o.withCredentials=s,o.addEventListener("load",(()=>{if(o.readyState==XMLHttpRequest.DONE)if(o.status>=200&&o.status<300){let e=o.response;if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}r(e)}else i(new Error(`HTTP Status: ${o.status} response type: ${o.responseType}`))})),o.addEventListener("error",(()=>{i(new Error("error"))})),o.addEventListener("abort",(()=>{i(new Error("aborted"))})),null===t?o.open("GET",e,!0):o.open("POST",e,!0),o.responseType="json",o.timeout=n,o.ontimeout=()=>{i(new Error("Timeout "+n+"ms "+e))},o.send(t)}))}static post(e,t,s=!1,n=0){return this.absCall(e,JSON.stringify(t),s,n)}static fetch(e,t=!1,s=0){return this.absCall(e,null,t,s)}}class fe extends j{static LANGUAGE_CACHE=new Map;static CACHE=new Map;static LATEST_CACHE_KEY=0;static DEFAULT_LANGUAGE="EN";static consentLanguages=new H;static baseUrl_;static set baseUrl(e){if(/^https?:\/\/vendorlist\.consensu\.org\//.test(e))throw new k("Invalid baseUrl! You may not pull directly from vendorlist.consensu.org and must provide your own cache");e.length>0&&"/"!==e[e.length-1]&&(e+="/"),this.baseUrl_=e}static get baseUrl(){return this.baseUrl_}static latestFilename="vendor-list.json";static versionedFilename="archives/vendor-list-v[VERSION].json";static languageFilename="purposes-[LANG].json";readyPromise;gvlSpecificationVersion;vendorListVersion;tcfPolicyVersion;lastUpdated;purposes;specialPurposes;features;specialFeatures;isReady_=!1;vendors_;vendorIds;fullVendorList;byPurposeVendorMap;bySpecialPurposeVendorMap;byFeatureVendorMap;bySpecialFeatureVendorMap;stacks;dataCategories;lang_;cacheLang_;isLatest=!1;constructor(e,t){super();let s=fe.baseUrl,n=t?.language;if(n)try{n=fe.consentLanguages.parseLanguage(n)}catch(e){throw new k("Error during parsing the language: "+e.message)}if(this.lang_=n||fe.DEFAULT_LANGUAGE,this.cacheLang_=n||fe.DEFAULT_LANGUAGE,this.isVendorList(e))this.populate(e),this.readyPromise=Promise.resolve();else{if(!s)throw new k("must specify GVL.baseUrl before loading GVL json");if(e>0){const t=e;fe.CACHE.has(t)?(this.populate(fe.CACHE.get(t)),this.readyPromise=Promise.resolve()):(s+=fe.versionedFilename.replace("[VERSION]",String(t)),this.readyPromise=this.fetchJson(s))}else fe.CACHE.has(fe.LATEST_CACHE_KEY)?(this.populate(fe.CACHE.get(fe.LATEST_CACHE_KEY)),this.readyPromise=Promise.resolve()):(this.isLatest=!0,this.readyPromise=this.fetchJson(s+fe.latestFilename))}}static emptyLanguageCache(e){let t=!1;return null==e&&fe.LANGUAGE_CACHE.size>0?(fe.LANGUAGE_CACHE=new Map,t=!0):"string"==typeof e&&this.consentLanguages.has(e.toUpperCase())&&(fe.LANGUAGE_CACHE.delete(e.toUpperCase()),t=!0),t}static emptyCache(e){let t=!1;return Number.isInteger(e)&&e>=0?(fe.CACHE.delete(e),t=!0):void 0===e&&(fe.CACHE=new Map,t=!0),t}cacheLanguage(){fe.LANGUAGE_CACHE.has(this.cacheLang_)||fe.LANGUAGE_CACHE.set(this.cacheLang_,{purposes:this.purposes,specialPurposes:this.specialPurposes,features:this.features,specialFeatures:this.specialFeatures,stacks:this.stacks,dataCategories:this.dataCategories})}async fetchJson(e){try{this.populate(await ge.fetch(e))}catch(e){throw new k(e.message)}}getJson(){return{gvlSpecificationVersion:this.gvlSpecificationVersion,vendorListVersion:this.vendorListVersion,tcfPolicyVersion:this.tcfPolicyVersion,lastUpdated:this.lastUpdated,purposes:this.clonePurposes(),specialPurposes:this.cloneSpecialPurposes(),features:this.cloneFeatures(),specialFeatures:this.cloneSpecialFeatures(),stacks:this.cloneStacks(),...this.dataCategories?{dataCategories:this.cloneDataCategories()}:{},vendors:this.cloneVendors()}}cloneSpecialFeatures(){const e={};for(const t of Object.keys(this.specialFeatures))e[t]=fe.cloneFeature(this.specialFeatures[t]);return e}cloneFeatures(){const e={};for(const t of Object.keys(this.features))e[t]=fe.cloneFeature(this.features[t]);return e}cloneStacks(){const e={};for(const t of Object.keys(this.stacks))e[t]=fe.cloneStack(this.stacks[t]);return e}cloneDataCategories(){const e={};for(const t of Object.keys(this.dataCategories))e[t]=fe.cloneDataCategory(this.dataCategories[t]);return e}cloneSpecialPurposes(){const e={};for(const t of Object.keys(this.specialPurposes))e[t]=fe.clonePurpose(this.specialPurposes[t]);return e}clonePurposes(){const e={};for(const t of Object.keys(this.purposes))e[t]=fe.clonePurpose(this.purposes[t]);return e}static clonePurpose(e){return{id:e.id,name:e.name,description:e.description,...e.descriptionLegal?{descriptionLegal:e.descriptionLegal}:{},...e.illustrations?{illustrations:Array.from(e.illustrations)}:{}}}static cloneFeature(e){return{id:e.id,name:e.name,description:e.description,...e.descriptionLegal?{descriptionLegal:e.descriptionLegal}:{},...e.illustrations?{illustrations:Array.from(e.illustrations)}:{}}}static cloneDataCategory(e){return{id:e.id,name:e.name,description:e.description}}static cloneStack(e){return{id:e.id,name:e.name,description:e.description,purposes:Array.from(e.purposes),specialFeatures:Array.from(e.specialFeatures)}}static cloneDataRetention(e){return{..."number"==typeof e.stdRetention?{stdRetention:e.stdRetention}:{},purposes:{...e.purposes},specialPurposes:{...e.specialPurposes}}}static cloneVendorUrls(e){return e.map((e=>({langId:e.langId,privacy:e.privacy,...e.legIntClaim?{legIntClaim:e.legIntClaim}:{}})))}static cloneVendor(e){return{id:e.id,name:e.name,purposes:Array.from(e.purposes),legIntPurposes:Array.from(e.legIntPurposes),flexiblePurposes:Array.from(e.flexiblePurposes),specialPurposes:Array.from(e.specialPurposes),features:Array.from(e.features),specialFeatures:Array.from(e.specialFeatures),...e.overflow?{overflow:{httpGetLimit:e.overflow.httpGetLimit}}:{},..."number"==typeof e.cookieMaxAgeSeconds||null===e.cookieMaxAgeSeconds?{cookieMaxAgeSeconds:e.cookieMaxAgeSeconds}:{},...void 0!==e.usesCookies?{usesCookies:e.usesCookies}:{},...e.policyUrl?{policyUrl:e.policyUrl}:{},...void 0!==e.cookieRefresh?{cookieRefresh:e.cookieRefresh}:{},...void 0!==e.usesNonCookieAccess?{usesNonCookieAccess:e.usesNonCookieAccess}:{},...e.dataRetention?{dataRetention:this.cloneDataRetention(e.dataRetention)}:{},...e.urls?{urls:this.cloneVendorUrls(e.urls)}:{},...e.dataDeclaration?{dataDeclaration:Array.from(e.dataDeclaration)}:{},...e.deviceStorageDisclosureUrl?{deviceStorageDisclosureUrl:e.deviceStorageDisclosureUrl}:{},...e.deletedDate?{deletedDate:e.deletedDate}:{}}}cloneVendors(){const e={};for(const t of Object.keys(this.fullVendorList))e[t]=fe.cloneVendor(this.fullVendorList[t]);return e}async changeLanguage(e){let t=e;try{t=fe.consentLanguages.parseLanguage(e)}catch(e){throw new k("Error during parsing the language: "+e.message)}const s=e.toUpperCase();if((t.toLowerCase()!==fe.DEFAULT_LANGUAGE.toLowerCase()||fe.LANGUAGE_CACHE.has(s))&&t!==this.lang_)if(this.lang_=t,fe.LANGUAGE_CACHE.has(s)){const e=fe.LANGUAGE_CACHE.get(s);for(const t in e)e.hasOwnProperty(t)&&(this[t]=e[t])}else{const e=fe.baseUrl+fe.languageFilename.replace("[LANG]",this.lang_.toLowerCase());try{await this.fetchJson(e),this.cacheLang_=s,this.cacheLanguage()}catch(e){throw new k("unable to load language: "+e.message)}}}get language(){return this.lang_}isVendorList(e){return void 0!==e&&void 0!==e.vendors}populate(e){this.purposes=e.purposes,this.specialPurposes=e.specialPurposes,this.features=e.features,this.specialFeatures=e.specialFeatures,this.stacks=e.stacks,this.dataCategories=e.dataCategories,this.isVendorList(e)&&(this.gvlSpecificationVersion=e.gvlSpecificationVersion,this.tcfPolicyVersion=e.tcfPolicyVersion,this.vendorListVersion=e.vendorListVersion,this.lastUpdated=e.lastUpdated,"string"==typeof this.lastUpdated&&(this.lastUpdated=new Date(this.lastUpdated)),this.vendors_=e.vendors,this.fullVendorList=e.vendors,this.mapVendors(),this.isReady_=!0,this.isLatest&&fe.CACHE.set(fe.LATEST_CACHE_KEY,this.getJson()),fe.CACHE.has(this.vendorListVersion)||fe.CACHE.set(this.vendorListVersion,this.getJson())),this.cacheLanguage()}mapVendors(e){this.byPurposeVendorMap={},this.bySpecialPurposeVendorMap={},this.byFeatureVendorMap={},this.bySpecialFeatureVendorMap={},Object.keys(this.purposes).forEach((e=>{this.byPurposeVendorMap[e]={legInt:new Set,consent:new Set,flexible:new Set}})),Object.keys(this.specialPurposes).forEach((e=>{this.bySpecialPurposeVendorMap[e]=new Set})),Object.keys(this.features).forEach((e=>{this.byFeatureVendorMap[e]=new Set})),Object.keys(this.specialFeatures).forEach((e=>{this.bySpecialFeatureVendorMap[e]=new Set})),Array.isArray(e)||(e=Object.keys(this.fullVendorList).map((e=>+e))),this.vendorIds=new Set(e),this.vendors_=e.reduce(((e,t)=>{const s=this.vendors_[String(t)];return s&&void 0===s.deletedDate&&(s.purposes.forEach((e=>{this.byPurposeVendorMap[String(e)].consent.add(t)})),s.specialPurposes.forEach((e=>{this.bySpecialPurposeVendorMap[String(e)].add(t)})),s.legIntPurposes.forEach((e=>{this.byPurposeVendorMap[String(e)].legInt.add(t)})),s.flexiblePurposes&&s.flexiblePurposes.forEach((e=>{this.byPurposeVendorMap[String(e)].flexible.add(t)})),s.features.forEach((e=>{this.byFeatureVendorMap[String(e)].add(t)})),s.specialFeatures.forEach((e=>{this.bySpecialFeatureVendorMap[String(e)].add(t)})),e[t]=s),e}),{})}getFilteredVendors(e,t,s,n){const r=e.charAt(0).toUpperCase()+e.slice(1);let i;const o={};return i="purpose"===e&&s?this["by"+r+"VendorMap"][String(t)][s]:this["by"+(n?"Special":"")+r+"VendorMap"][String(t)],i.forEach((e=>{o[String(e)]=this.vendors[String(e)]})),o}getVendorsWithConsentPurpose(e){return this.getFilteredVendors("purpose",e,"consent")}getVendorsWithLegIntPurpose(e){return this.getFilteredVendors("purpose",e,"legInt")}getVendorsWithFlexiblePurpose(e){return this.getFilteredVendors("purpose",e,"flexible")}getVendorsWithSpecialPurpose(e){return this.getFilteredVendors("purpose",e,void 0,!0)}getVendorsWithFeature(e){return this.getFilteredVendors("feature",e)}getVendorsWithSpecialFeature(e){return this.getFilteredVendors("feature",e,void 0,!0)}get vendors(){return this.vendors_}narrowVendorsTo(e){this.mapVendors(e)}get isReady(){return this.isReady_}clone(){const e=new fe(this.getJson());return this.lang_!==fe.DEFAULT_LANGUAGE&&e.changeLanguage(this.lang_),e}static isInstanceOf(e){return"object"==typeof e&&"function"==typeof e.narrowVendorsTo}}class me extends j{static consentLanguages=fe.consentLanguages;isServiceSpecific_=!1;supportOOB_=!0;useNonStandardTexts_=!1;purposeOneTreatment_=!1;publisherCountryCode_="AA";version_=2;consentScreen_=0;policyVersion_=4;consentLanguage_="EN";cmpId_=0;cmpVersion_=0;vendorListVersion_=0;numCustomPurposes_=0;gvl_;created;lastUpdated;specialFeatureOptins=new ee;purposeConsents=new ee;purposeLegitimateInterests=new ee;publisherConsents=new ee;publisherLegitimateInterests=new ee;publisherCustomConsents=new ee;publisherCustomLegitimateInterests=new ee;customPurposes;vendorConsents=new ee;vendorLegitimateInterests=new ee;vendorsDisclosed=new ee;vendorsAllowed=new ee;publisherRestrictions=new Z;constructor(e){super(),e&&(this.gvl=e),this.updated()}set gvl(e){fe.isInstanceOf(e)||(e=new fe(e)),this.gvl_=e,this.publisherRestrictions.gvl=e}get gvl(){return this.gvl_}set cmpId(e){if(e=Number(e),!(Number.isInteger(e)&&e>1))throw new M("cmpId",e);this.cmpId_=e}get cmpId(){return this.cmpId_}set cmpVersion(e){if(e=Number(e),!(Number.isInteger(e)&&e>-1))throw new M("cmpVersion",e);this.cmpVersion_=e}get cmpVersion(){return this.cmpVersion_}set consentScreen(e){if(e=Number(e),!(Number.isInteger(e)&&e>-1))throw new M("consentScreen",e);this.consentScreen_=e}get consentScreen(){return this.consentScreen_}set consentLanguage(e){this.consentLanguage_=e}get consentLanguage(){return this.consentLanguage_}set publisherCountryCode(e){if(!/^([A-z]){2}$/.test(e))throw new M("publisherCountryCode",e);this.publisherCountryCode_=e.toUpperCase()}get publisherCountryCode(){return this.publisherCountryCode_}set vendorListVersion(e){if((e=0|Number(e))<0)throw new M("vendorListVersion",e);this.vendorListVersion_=e}get vendorListVersion(){return this.gvl?this.gvl.vendorListVersion:this.vendorListVersion_}set policyVersion(e){if(this.policyVersion_=parseInt(e,10),this.policyVersion_<0)throw new M("policyVersion",e)}get policyVersion(){return this.gvl?this.gvl.tcfPolicyVersion:this.policyVersion_}set version(e){this.version_=parseInt(e,10)}get version(){return this.version_}set isServiceSpecific(e){this.isServiceSpecific_=e}get isServiceSpecific(){return this.isServiceSpecific_}set useNonStandardTexts(e){this.useNonStandardTexts_=e}get useNonStandardTexts(){return this.useNonStandardTexts_}set supportOOB(e){this.supportOOB_=e}get supportOOB(){return this.supportOOB_}set purposeOneTreatment(e){this.purposeOneTreatment_=e}get purposeOneTreatment(){return this.purposeOneTreatment_}setAllVendorConsents(){this.vendorConsents.set(this.gvl.vendors)}unsetAllVendorConsents(){this.vendorConsents.empty()}setAllVendorsDisclosed(){this.vendorsDisclosed.set(this.gvl.vendors)}unsetAllVendorsDisclosed(){this.vendorsDisclosed.empty()}setAllVendorsAllowed(){this.vendorsAllowed.set(this.gvl.vendors)}unsetAllVendorsAllowed(){this.vendorsAllowed.empty()}setAllVendorLegitimateInterests(){this.vendorLegitimateInterests.set(this.gvl.vendors)}unsetAllVendorLegitimateInterests(){this.vendorLegitimateInterests.empty()}setAllPurposeConsents(){this.purposeConsents.set(this.gvl.purposes)}unsetAllPurposeConsents(){this.purposeConsents.empty()}setAllPurposeLegitimateInterests(){this.purposeLegitimateInterests.set(this.gvl.purposes)}unsetAllPurposeLegitimateInterests(){this.purposeLegitimateInterests.empty()}setAllSpecialFeatureOptins(){this.specialFeatureOptins.set(this.gvl.specialFeatures)}unsetAllSpecialFeatureOptins(){this.specialFeatureOptins.empty()}setAll(){this.setAllVendorConsents(),this.setAllPurposeLegitimateInterests(),this.setAllSpecialFeatureOptins(),this.setAllPurposeConsents(),this.setAllVendorLegitimateInterests()}unsetAll(){this.unsetAllVendorConsents(),this.unsetAllPurposeLegitimateInterests(),this.unsetAllSpecialFeatureOptins(),this.unsetAllPurposeConsents(),this.unsetAllVendorLegitimateInterests()}get numCustomPurposes(){let e=this.numCustomPurposes_;if("object"==typeof this.customPurposes){const t=Object.keys(this.customPurposes).sort(((e,t)=>Number(e)-Number(t)));e=parseInt(t.pop(),10)}return e}set numCustomPurposes(e){if(this.numCustomPurposes_=parseInt(e,10),this.numCustomPurposes_<0)throw new M("numCustomPurposes",e)}updated(){const e=new Date,t=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()));this.created=t,this.lastUpdated=t}}class be{static encode(e,t){let s,n="";return e=he.process(e,t),s=Array.isArray(t?.segments)?t.segments:new le(e,t)[""+e.version],s.forEach(((t,r)=>{let i="";r<s.length-1&&(i="."),n+=pe.encode(e,t)+i})),n}static decode(e,t){const s=e.split("."),n=s.length;t||(t=new me);for(let e=0;e<n;e++){const n=s[e],r=G.decode(n.charAt(0)).substr(0,te.segmentType),i=X.ID_TO_KEY[ne.decode(r,te.segmentType).toString()];pe.decode(n,t,i)}return t}}function Ie(t,s){const n=new me(t),r=[K.CORE];return n.vendorListVersion=t.vendorListVersion,n.created=new Date(s.created),n.lastUpdated=new Date(s.updated),n.cmpId=s.cmpId,n.cmpVersion=s.cmpVersion,n.consentScreen=s.consentScreen,n.useNonStandardTexts=s.useNonStandardTexts??!1,n.purposeOneTreatment=s.purposeOneTreatment,n.isServiceSpecific=!0,s.specialFeatureOptins.forEach((e=>n.specialFeatureOptins.set(e))),s.purposes.optin.forEach((e=>n.purposeConsents.set(e))),s.purposes.optout.forEach((e=>n.purposeLegitimateInterests.set(e))),s.vendors.optin.forEach((e=>n.vendorConsents.set(e))),s.vendors.optout.forEach((e=>n.vendorLegitimateInterests.set(e))),n.publisherCountryCode=s.publisher.countryCode,s.publisher.restrictions?.forEach((s=>{const r=new q;if(r.purposeId=s.purposeId,s.restrictionType===e.IABTCFPublisherRestrictionType.ALLOW)r.restrictionType=W.NOT_ALLOWED,s.vendors.type===e.IABTCFPublisherRestrictionVendorsType.LIST&&Object.keys(t.vendors).forEach((e=>{s.vendors.ids?.includes(parseInt(e))||n.publisherRestrictions.add(parseInt(e),r)}));else{switch(s.restrictionType){case e.IABTCFPublisherRestrictionType.DISALLOW:r.restrictionType=W.NOT_ALLOWED;break;case e.IABTCFPublisherRestrictionType.REQ_CONSENT:r.restrictionType=W.REQUIRE_CONSENT;break;case e.IABTCFPublisherRestrictionType.REQ_LI:r.restrictionType=W.REQUIRE_LI}s.vendors.type===e.IABTCFPublisherRestrictionVendorsType.LIST?s.vendors.ids?.forEach((e=>n.publisherRestrictions.add(e,r))):s.vendors.type===e.IABTCFPublisherRestrictionVendorsType.ALL&&n.publisherRestrictions.restrictPurposeToLegalBasis(r)}})),(s.publisher.tcfPurposes?.optin?.length||s.publisher.tcfPurposes?.optout?.length||s.publisher.customPurposes?.optin?.length||s.publisher.customPurposes?.optout?.length)&&(r.push(K.PUBLISHER_TC),s.publisher.tcfPurposes?.optin.forEach((e=>n.publisherConsents.set(e))),s.publisher.tcfPurposes?.optout.forEach((e=>n.publisherLegitimateInterests.set(e))),(s.publisher.customPurposes?.optin?.length||s.publisher.customPurposes?.optout?.length)&&(s.publisher.customPurposes?.optin.forEach((e=>n.publisherCustomConsents.set(e))),s.publisher.customPurposes?.optout.forEach((e=>n.publisherCustomLegitimateInterests.set(e))),n.customPurposes=Array.from(new Set([...s.publisher.customPurposes?.optin??[],...s.publisher.customPurposes?.optout??[]])).reduce(((e,t)=>(e[t]={},e)),{}))),be.encode(n,{version:2,segments:r})}function Se(e,t){return e&&Array.isArray(e)&&0!==e.length?e.reduce(((e,s)=>{if(s)if("string"==typeof s){const n=t[s];n&&e.push(n)}else"number"==typeof s&&e.push(s);return e}),[]):[]}e.IABTCFPublisherRestrictionType=void 0,(Y=e.IABTCFPublisherRestrictionType||(e.IABTCFPublisherRestrictionType={})).ALLOW="allow",Y.DISALLOW="disallow",Y.REQ_CONSENT="req-consent",Y.REQ_LI="req-li",e.IABTCFPublisherRestrictionVendorsType=void 0,(J=e.IABTCFPublisherRestrictionVendorsType||(e.IABTCFPublisherRestrictionVendorsType={})).ALL="all",J.LIST="list";const Ee=(e,t)=>({value:parseInt(e.subSet(t,6).toString(),2),decodedLength:6,usedEncoder:"u6"}),ve=(e,t)=>({value:parseInt(e.subSet(t,16).toString(),2),decodedLength:16,usedEncoder:"u16"}),_e={[e.EncodingAlgorithm.RANGES_U16]:(e,t)=>{let s=t;const n=[],r=e.subSet(s,4).toString();s+=4;const i=g.get(r);if(!i)return{error:`Failed to decode U16 ranges: wrong value for encoded statuses: ${r}`,decodedLength:2};for(const r of i){const i=new u(r),{value:o}=ve(e,s);if(s+=16,void 0===o)return{error:"Failed to decode U16 ranges: wrong value for number of ranges",decodedLength:s-t};for(let n=0;n<o;n++){const n=e.get(s++),{value:r}=ve(e,s);if(s+=16,void 0===r)return{error:"Failed to decode U16 ranges: wrong value for range start",decodedLength:s-t};let o=r;if(!n){const n=ve(e,s);if(s+=16,void 0===n.value)return{error:"Failed to decode U16 ranges: wrong value for range end",decodedLength:s-t};o=n.value}i.add(new c(r,o))}n.push(i)}return{value:m.fromRanges(n),decodedLength:s-t,usedEncoder:"rangesU16"}},[e.EncodingAlgorithm.RANGES_FIBONACCI]:(e,t)=>{let s=t;const n=[],r=e.subSet(s,4).toString();s+=4;const i=g.get(r);if(!i)return{error:`Failed to decode Fibonacci ranges: wrong value for encoded statuses: ${r}`,decodedLength:2};for(const t of i){const r=new u(t),i=parseInt(e.subSet(s,16).toString(),2);s+=16;for(let t=0;t<i;t++){const t=(new w).fromBitSet(e,s);s+=t.size;const n=(new w).fromBitSet(e,s);s+=n.size;const i=new T(t,n);r.add(D.toIdsRange(i))}n.push(r)}return{value:m.fromRanges(n),decodedLength:s-t,usedEncoder:"rangesFibonacci"}},[e.EncodingAlgorithm.BIT_FIELD_2_BITS]:(e,t)=>{let s=t,n=1;const r=new Array,i=new Array;e.get(s++)||(n=parseInt(e.subSet(s,16).toString(),2),s+=16);const o=parseInt(e.subSet(s,16).toString(),2);s+=16;let a=0;for(;a<o;){const t=e.subSet(s,2).toString(),o=p.get(t);o===l.Disabled?i.push(n):o==l.Enabled&&r.push(n),n++,s+=2,a++}return{value:new m(r,i),decodedLength:s-t,usedEncoder:"bitField2Bits"}}},ye={[O.VERSION]:(e,t)=>Ee(e,t),[O.U6]:Ee,[O.U16]:ve,[O.UUID]:(e,t)=>({value:e.subSet(t,128).toUUID(),decodedLength:128,usedEncoder:"UUID"}),[O.DATE]:(e,t)=>{const s=new Date,n=parseInt(e.subSet(t,36).toString(),2);return s.setTime(100*n),{value:s.toISOString(),decodedLength:36,usedEncoder:"date"}},[O.ENABLED_DISABLED_IDS]:(e,t)=>{let s=t;const n=e.subSet(s,2).toString();s+=2;const r=_e[E[n]];if(!r)return{error:`Failed to decode Enabled Disabled Ids with error: Invalid encoded Algorithm: ${n}`,decodedLength:2};const i=r(e,s),o=i.usedEncoder??"unknown",a=i.value,d=(i.decodedLength??0)+2;return i.error||!a?{error:i.error,decodedLength:d,usedEncoder:o}:{value:{enabled:a.enabled,disabled:a.disabled},decodedLength:d,usedEncoder:o}}},Ce=(e,t,s)=>{let n=s;if(!0===e.optional&&!t.get(n++))return{decodedLength:1,value:null};const r=(e=>ye[e])(e.type);if(!r)return{decodedLength:n-s,error:`Failed to decode field: unknown field type: ${e.type}`};const i=r(t,n),o=n-s+(i.decodedLength??0);return{...i,decodedLength:o}},Ae={B:P,C:N};return e.ENABLED_DISABLED_IDS_ENCODING_ALGORITHMS=S,e.REVERSE_ENABLED_DISABLED_IDS_ENCODING_ALGORITHMS=E,e.buildIABTCFPurposesIDMapping=function(e){const t={purposes:{},specialFeatures:{},customPurposes:{}};for(const s of e)s.namespaces?.iab2?t.purposes[s.id]=s.namespaces.iab2:s.namespaces?.iab2_special_feature?t.specialFeatures[s.id]=s.namespaces.iab2_special_feature:s.namespaces?.pub&&(t.customPurposes[s.id]=s.namespaces.pub);return t},e.buildIABTCFVendorsIDMapping=function(e){const t={};for(const s of e)s.namespaces?.iab2&&(t[s.id]=s.namespaces.iab2);return t},e.decodeDCS=function(e,t=void 0){const s=e[0],n=Ae[s];if(!n)throw new Error(`Unsupported DCS version: ${s}`);return function({schema:e,consentString:t,logs:s}){let n=0;const r=(new a).fromBase64(t);if(!r)throw new Error("Invalid consent string");const i={};s?.enabled&&!s.entries&&(s.entries=[]);for(const t of e.fields){const e=Ce(t,r,n);if(e.error)throw new Error(`[${n}]:[${t.key}]:${e.error}`);s?.enabled&&s.entries.push({key:t.key,offset:n,usedEncoder:e.usedEncoder}),n+=e.decodedLength??0,void 0!==e.value&&null!==e.value&&void 0===t.value&&(i[t.key]=e.value)}return i}({schema:n,consentString:e,logs:t?.logs})},e.encodeDCS=function(e,t,s){if(!(e in F))throw new Error(`Unsupported DCS version: ${e}`);return function({schema:e,userStatus:t,schemaOverrides:s}){if(!e||!t)throw new Error("Missing required options");const n=new a;for(const r of e.fields){const e=t[r.key];s?.fields?.[r.key]?.variants&&(r.variants=s.fields[r.key].variants),n.add(V(r,e))}return n.toBase64()}({schema:F[e],userStatus:{version:e,user_id:t.userId,created:t.created,updated:t.updated,vendors_optin:t.vendors.optin,vendors_optout:t.vendors.optout,purposes_optin:t.purposes.optin,purposes_optout:t.purposes.optout,sync:t.sync,...2===e?{regulation_id:t.regulationId}:{}},schemaOverrides:s?.schemaOverrides})},e.encodeIABTCF=Ie,e.encodeIABTCFFromDidomiIDs=function(e,t,s,n){return Ie(e,{...t,purposes:{optin:Se(t.purposes.optin,s.purposes),optout:Se(t.purposes.optout,s.purposes)},vendors:{optin:Se(t.vendors.optin,n),optout:Se(t.vendors.optout,n)},specialFeatureOptins:Se(t.purposes.optin,s.specialFeatures),publisher:{...t.publisher,tcfPurposes:{optin:Se(t.purposes.optin,s.purposes),optout:Se(t.purposes.optout,s.purposes)},customPurposes:{optin:Se(t.purposes.optin,s.customPurposes),optout:Se(t.purposes.optout,s.customPurposes)},restrictions:t.publisher.restrictions?.map((e=>({...e,purposeId:s.purposes[e.purposeId],vendors:{...e.vendors,ids:Se(e.vendors?.ids,n)}})))}})},e.mapIds=Se,e}({}); +//# sourceMappingURL=dcs-encoder.js.map -- Gitblit v1.8.0