New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@usercentrics/cmp-browser-sdk

Package Overview
Dependencies
Maintainers
4
Versions
212
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@usercentrics/cmp-browser-sdk - npm Package Compare versions

Comparing version 0.3.11 to 0.4.0

12

CHANGELOG.md

@@ -10,6 +10,16 @@ # Changelog

- Better documentation
- Better documentation in general
- Document `Cross-Device Consent Sharing`
- Implement `setControllerId` for `Cross-Device Consent Sharing` after `init()`
- Fill out `CHANGELOG` for versions 0.1.0 and 0.2.0
- Remove `lodash` as a dependency
## [0.4.0] - 2020-04-27
### Added
- New optional constructor parameter: `controllerId`
- Providing this value enables the `Cross-Device Consent Sharing` feature
- Implement `getControllerId()`
## [0.3.11] - 2020-04-22

@@ -16,0 +26,0 @@

4

dist/index.js

@@ -1,2 +0,2 @@

"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e,n,r=require("uuid"),i=t(require("lodash/sortBy")),s=t(require("lodash/uniqWith")),o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function a(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}c((r=r.apply(t,e||[])).next())}))}function c(t,e){var n,r,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function u(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)r[i]=s[o];return r}!function(t){t.AVAILABLE_LANGUAGES_NOT_FOUND="Unable to find available languages using given settingsId and version.",t.FETCH_AVAILABLE_LANGUAGES="Something went wrong while fetching the available languages.",t.FETCH_DATA_PROCESSING_SERVICES="Something went wrong while fetching the data processing services.",t.FETCH_SETTINGS="Something went wrong while fetching the settings.",t.FETCH_USER_COUNTRY="Something went wrong while fetching the user's country.",t.GENERATE_DATA_PROCESSING_SERVICES="Something went wrong while generating the data processing services.",t.SAVE_CONSENTS="Something went wrong while saving user consents.",t.SETTINGS_NOT_FOUND="Unable to find settings using given settingsId and version."}(e||(e={})),function(t){t.AGGREGATOR="https://consent-templates-batch-generation.usercentrics.eu",t.CDN="https://api.usercentrics.eu",t.GRAPHQL="https://graphql.usercentrics.eu/graphql"}(n||(n={}));"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function l(t,e){return t(e={exports:{}},e.exports),e.exports}l((function(t){var e=function(t){var e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",s=r.asyncIterator||"@@asyncIterator",o=r.toStringTag||"@@toStringTag";function a(t,e,n,r){var i=e&&e.prototype instanceof l?e:l,s=Object.create(i.prototype),o=new E(r||[]);return s._invoke=function(t,e,n){var r="suspendedStart";return function(i,s){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw s;return A()}for(n.method=i,n.arg=s;;){var o=n.delegate;if(o){var a=b(o,n);if(a){if(a===u)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=c(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,o),s}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=a;var u={};function l(){}function f(){}function h(){}var p={};p[i]=function(){return this};var g=Object.getPrototypeOf,d=g&&g(g(w([])));d&&d!==e&&n.call(d,i)&&(p=d);var v=h.prototype=l.prototype=Object.create(p);function y(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function S(t,e){var r;this._invoke=function(i,s){function o(){return new e((function(r,o){!function r(i,s,o,a){var u=c(t[i],t,s);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,o,a)}),(function(t){r("throw",t,o,a)})):e.resolve(f).then((function(t){l.value=t,o(l)}),(function(t){return r("throw",t,o,a)}))}a(u.arg)}(i,s,r,o)}))}return r=r?r.then(o,o):o()}}function b(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return u;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=c(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,u;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function m(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(m,this),this.reset(!0)}function w(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,s=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return s.next=s}}return{next:A}}function A(){return{value:void 0,done:!0}}return f.prototype=v.constructor=h,h.constructor=f,h[o]=f.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,o in t||(t[o]="GeneratorFunction")),t.prototype=Object.create(v),t},t.awrap=function(t){return{__await:t}},y(S.prototype),S.prototype[s]=function(){return this},t.AsyncIterator=S,t.async=function(e,n,r,i,s){void 0===s&&(s=Promise);var o=new S(a(e,n,r,i),s);return t.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},y(v),v[o]="Generator",v[i]=function(){return this},v.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=w,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(I),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return o.type="throw",o.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var a=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(a&&c){if(this.prev<s.catchLoc)return r(s.catchLoc,!0);if(this.prev<s.finallyLoc)return r(s.finallyLoc)}else if(a){if(this.prev<s.catchLoc)return r(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return r(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===t||"continue"===t)&&s.tryLoc<=e&&e<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=t,o.arg=e,s?(this.method="next",this.next=s.finallyLoc,u):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;I(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:w(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}));var f={limit:3,statusCodes:[408,413,429,500,502,503,504]};function h(t){return(h="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})(t)}function p(t,e,n,r,i,s,o){try{var a=t[s](o),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,i)}function g(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var s=t.apply(e,n);function o(t){p(s,r,i,o,a,"next",t)}function a(t){p(s,r,i,o,a,"throw",t)}o(void 0)}))}}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(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,r.key,r)}}function y(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function S(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function b(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?S(Object(n),!0).forEach((function(e){y(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function m(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}}),e&&E(t,e)}function I(t){return(I=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function E(t,e){return(E=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function w(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function A(t,e,n){return(A=w()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&E(i,n.prototype),i}).apply(null,arguments)}function _(t){var e="function"==typeof Map?new Map:void 0;return(_=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return A(t,arguments,I(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),E(r,t)})(t)}function C(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function T(t){return function(){var e,n=I(t);if(w()){var r=I(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return C(this,e)}}function L(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,s=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done)&&(n.push(o.value),!e||n.length!==e);r=!0);}catch(t){i=!0,s=t}finally{try{r||null==a.return||a.return()}finally{if(i)throw s}}return n}(t,e)||O(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(t){return function(t){if(Array.isArray(t))return N(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||O(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 O(t,e){if(t){if("string"==typeof t)return N(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(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?N(t,e):void 0}}function N(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 x(t){if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=O(t))){var e=0,n=function(){};return{s:n,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n}}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 r,i,s=!0,o=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return s=t.done,t},e:function(t){o=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw i}}}}
/*! MIT License © Sindre Sorhus */for(var P={},U=function(){var t=F[D];Object.defineProperty(P,t,{get:function(){var e=function(t){return"undefined"!=typeof self&&self&&t in self?self:"undefined"!=typeof window&&window&&t in window?window:"undefined"!=typeof global&&global&&t in global?global:"undefined"!=typeof globalThis&&globalThis?globalThis:void 0}(t),n=e&&e[t];return"function"==typeof n?n.bind(e):n}})},D=0,F=["Headers","Request","Response","ReadableStream","fetch","AbortController","FormData"];D<F.length;D++)U();var j,k,B,V,G,H,q,M,W,J,Y=function(t){return null!==t&&"object"===h(t)},z="function"==typeof P.AbortController,X="function"==typeof P.ReadableStream,K="function"==typeof P.FormData,$=function t(){for(var e={},n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var s=0,o=r;s<o.length;s++){var a=o[s];if(Array.isArray(a))Array.isArray(e)||(e=[]),e=[].concat(R(e),R(a));else if(Y(a))for(var c=0,u=Object.entries(a);c<u.length;c++){var l=L(u[c],2),f=l[0],h=l[1];Y(h)&&Reflect.has(e,f)&&(h=t(e[f],h)),e=b({},e,y({},f,h))}}return e},Q=["get","post","put","patch","head","delete"],Z={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},tt=[413,429,503],et=Symbol("stop"),nt=function(t){m(n,_(Error));var e=T(n);function n(t){var r;return d(this,n),(r=e.call(this,t.statusText||String(0===t.status||t.status?t.status:"Unknown response error"))).name="HTTPError",r.response=t,r}return n}(),rt=function(t){m(n,_(Error));var e=T(n);function n(){var t;return d(this,n),(t=e.call(this,"Request timed out")).name="TimeoutError",t}return n}(),it=function(t){return new Promise((function(e){return setTimeout(e,t)}))},st=function(t,e,n){return new Promise((function(r,i){var s=setTimeout((function(){n&&n.abort(),i(new rt)}),e);t.then(r).catch(i).then((function(){clearTimeout(s)}))}))},ot=function(t){return Q.includes(t)?t.toUpperCase():t},at={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:tt},ct=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("number"==typeof t)return b({},at,{limit:t});if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return b({},at,{},t,{afterStatusCodes:tt})},ut=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(d(this,t),this._retryCount=0,this._input=e,this._options=b({credentials:this._input.credentials||"same-origin"},r,{hooks:$({beforeRequest:[],beforeRetry:[],afterResponse:[]},r.hooks),method:ot(r.method||this._input.method),prefixUrl:String(r.prefixUrl||""),retry:ct(r.retry),throwHttpErrors:!1!==r.throwHttpErrors,timeout:void 0===r.timeout?1e4:r.timeout}),"string"!=typeof this._input&&!(this._input instanceof URL||this._input instanceof P.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&"string"==typeof this._input){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(z&&(this.abortController=new P.AbortController,this._options.signal&&this._options.signal.addEventListener("abort",(function(){n.abortController.abort()})),this._options.signal=this.abortController.signal),this.request=new P.Request(this._input,this._options),this._options.searchParams){var i=new URL(this.request.url);i.search=new URLSearchParams(this._options.searchParams),!(K&&this._options.body instanceof P.FormData||this._options.body instanceof URLSearchParams)||this._options.headers&&this._options.headers["content-type"]||this.request.headers.delete("content-type"),this.request=new P.Request(new P.Request(i,this.request),this._options)}void 0!==this._options.json&&(this._options.body=JSON.stringify(this._options.json),this.request.headers.set("content-type","application/json"),this.request=new P.Request(this.request,{body:this._options.body}));for(var s=function(){var t=g(regeneratorRuntime.mark((function t(){var e,r,i,s,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n._options.timeout>2147483647)){t.next=2;break}throw new RangeError("The `timeout` option cannot be greater than ".concat(2147483647));case 2:return t.next=4,it(1);case 4:return t.next=6,n._fetch();case 6:e=t.sent,r=x(n._options.hooks.afterResponse),t.prev=8,r.s();case 10:if((i=r.n()).done){t.next=18;break}return s=i.value,t.next=14,s(n.request,n._options,e.clone());case 14:(o=t.sent)instanceof P.Response&&(e=o);case 16:t.next=10;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(8),r.e(t.t0);case 23:return t.prev=23,r.f(),t.finish(23);case 26:if(e.ok||!n._options.throwHttpErrors){t.next=28;break}throw new nt(e);case 28:if(!n._options.onDownloadProgress){t.next=34;break}if("function"==typeof n._options.onDownloadProgress){t.next=31;break}throw new TypeError("The `onDownloadProgress` option must be a function");case 31:if(X){t.next=33;break}throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");case 33:return t.abrupt("return",n._stream(e.clone(),n._options.onDownloadProgress));case 34:return t.abrupt("return",e);case 35:case"end":return t.stop()}}),t,null,[[8,20,23,26]])})));return function(){return t.apply(this,arguments)}}(),o=this._options.retry.methods.includes(this.request.method.toLowerCase()),a=o?this._retry(s):s(),c=function(){var t=L(l[u],2),e=t[0],r=t[1];a[e]=g(regeneratorRuntime.mark((function t(){var i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.request.headers.set("accept",n.request.headers.get("accept")||r),t.next=3,a;case 3:return i=t.sent.clone(),t.abrupt("return","json"===e&&204===i.status?"":i[e]());case 5:case"end":return t.stop()}}),t)})))},u=0,l=Object.entries(Z);u<l.length;u++)c();return a}var e,n,r,i,s;return e=t,(n=[{key:"_calculateRetryDelay",value:function(t){if(this._retryCount++,this._retryCount<this._options.retry.limit&&!(t instanceof rt)){if(t instanceof nt){if(!this._options.retry.statusCodes.includes(t.response.status))return 0;var e=t.response.headers.get("Retry-After");if(e&&this._options.retry.afterStatusCodes.includes(t.response.status)){var n=Number(e);return Number.isNaN(n)?n=Date.parse(e)-Date.now():n*=1e3,void 0!==this._options.retry.maxRetryAfter&&n>this._options.retry.maxRetryAfter?0:n}if(413===t.response.status)return 0}return.3*Math.pow(2,this._retryCount-1)*1e3}return 0}},{key:"_retry",value:(s=g(regeneratorRuntime.mark((function t(e){var n,r,i,s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e();case 3:return t.abrupt("return",t.sent);case 6:if(t.prev=6,t.t0=t.catch(0),!(0!==(n=Math.min(this._calculateRetryDelay(t.t0),2147483647))&&this._retryCount>0)){t.next=33;break}return t.next=12,it(n);case 12:r=x(this._options.hooks.beforeRetry),t.prev=13,r.s();case 15:if((i=r.n()).done){t.next=24;break}return s=i.value,t.next=19,s({request:this.request,options:this._options,error:t.t0,response:t.t0.response.clone(),retryCount:this._retryCount});case 19:if(t.sent!==et){t.next=22;break}return t.abrupt("return");case 22:t.next=15;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(13),r.e(t.t1);case 29:return t.prev=29,r.f(),t.finish(29);case 32:return t.abrupt("return",this._retry(e));case 33:if(!this._options.throwHttpErrors){t.next=35;break}throw t.t0;case 35:case"end":return t.stop()}}),t,this,[[0,6],[13,26,29,32]])}))),function(t){return s.apply(this,arguments)})},{key:"_fetch",value:(i=g(regeneratorRuntime.mark((function t(){var e,n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=x(this._options.hooks.beforeRequest),t.prev=1,e.s();case 3:if((n=e.n()).done){t.next=15;break}return r=n.value,t.next=7,r(this.request,this._options);case 7:if(!((i=t.sent)instanceof Request)){t.next=11;break}return this.request=i,t.abrupt("break",15);case 11:if(!(i instanceof Response)){t.next=13;break}return t.abrupt("return",i);case 13:t.next=3;break;case 15:t.next=20;break;case 17:t.prev=17,t.t0=t.catch(1),e.e(t.t0);case 20:return t.prev=20,e.f(),t.finish(20);case 23:if(!1!==this._options.timeout){t.next=25;break}return t.abrupt("return",P.fetch(this.request.clone()));case 25:return t.abrupt("return",st(P.fetch(this.request.clone()),this._options.timeout,this.abortController));case 26:case"end":return t.stop()}}),t,this,[[1,17,20,23]])}))),function(){return i.apply(this,arguments)})},{key:"_stream",value:function(t,e){var n=Number(t.headers.get("content-length"))||0,r=0;return new P.Response(new P.ReadableStream({start:function(i){var s=t.body.getReader();function o(){return a.apply(this,arguments)}function a(){return(a=g(regeneratorRuntime.mark((function t(){var a,c,u;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.read();case 2:if(a=t.sent,c=a.done,u=a.value,!c){t.next=8;break}return i.close(),t.abrupt("return");case 8:e&&(r+=u.byteLength,e({percent:0===n?0:r/n,transferredBytes:r,totalBytes:n},u)),i.enqueue(u),o();case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}e&&e({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array),o()}}))}}])&&v(e.prototype,n),r&&v(e,r),t}(),lt=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++){var s=i[r];if((!Y(s)||Array.isArray(s))&&void 0!==s)throw new TypeError("The `options` argument must be an object")}return $.apply(void 0,[{}].concat(e))},ft=function t(e){var n,r=function(t,n){return new ut(t,lt(e,n))},i=x(Q);try{var s=function(){var t=n.value;r[t]=function(n,r){return new ut(n,lt(e,r,{method:t}))}};for(i.s();!(n=i.n()).done;)s()}catch(t){i.e(t)}finally{i.f()}return r.HTTPError=nt,r.TimeoutError=rt,r.create=function(e){return t(lt(e))},r.extend=function(n){return t(lt(e,n))},r.stop=et,r}(),ht=function(t,e){return a(void 0,void 0,void 0,(function(){var n,r,i;return c(this,(function(s){switch(s.label){case 0:n={retry:f},s.label=1;case 1:return s.trys.push([1,4,,5]),[4,ft.get(t,n)];case 2:return r=s.sent(),[4,gt(r)];case 3:return[2,s.sent()];case 4:throw i=s.sent(),dt(i,e);case 5:return[2]}}))}))},pt=function(t,e,n,r){return a(void 0,void 0,void 0,(function(){var i,s,a;return c(this,(function(c){switch(c.label){case 0:i=o({json:e,retry:f},r),c.label=1;case 1:return c.trys.push([1,4,,5]),[4,ft.post(t,i)];case 2:return s=c.sent(),[4,gt(s)];case 3:return[2,c.sent()];case 4:throw a=c.sent(),dt(a,n);case 5:return[2]}}))}))},gt=function(t){return a(void 0,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return[4,vt(t)];case 1:return[2,{data:e.sent(),statusCode:t.status}]}}))}))},dt=function(t,e){return{errorMessage:e,statusCode:t.response.status}},vt=function(t){return a(void 0,void 0,void 0,(function(){var e,n;return c(this,(function(r){switch(r.label){case 0:return[4,t.json()];case 1:return e=r.sent(),[2,null!==(n=e.data)&&void 0!==n?n:e]}}))}))},yt=function(t,e){return-1!==t.indexOf(e)},St=function(t){return Array.isArray(t)&&t.length>0},bt=function(t){return"object"===h(t)&&null!==t&&Object.keys(t).length>0},mt=function(){function t(){this.jsonFileLanguage="",this.jsonFileVersion="latest",this.settingsId=""}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.resetInstance=function(){t.instance.jsonFileLanguage="",t.instance.jsonFileVersion="latest",t.instance.settingsId=""},t.prototype.getJsonFileLanguage=function(){return this.jsonFileLanguage},t.prototype.getJsonFileVersion=function(){return this.jsonFileVersion},t.prototype.getSettingsId=function(){return this.settingsId},t.prototype.setJsonFileLanguage=function(t){this.jsonFileLanguage=t},t.prototype.setJsonFileVersion=function(t){this.jsonFileVersion=t},t.prototype.setSettingsId=function(t){this.settingsId=t},t.prototype.fetchAvailableLanguages=function(){return a(this,void 0,void 0,(function(){var t,n;return c(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=this.createLanguagesJsonUrl(),[4,ht(t,e.FETCH_AVAILABLE_LANGUAGES)];case 1:return[2,r.sent().data.languagesAvailable];case 2:throw 403===(n=r.sent()).statusCode&&(n.errorMessage=e.AVAILABLE_LANGUAGES_NOT_FOUND),n;case 3:return[2]}}))}))},t.prototype.fetchServicesJson=function(t){return a(this,void 0,void 0,(function(){var n;return c(this,(function(r){switch(r.label){case 0:return n=this.createServicesJsonUrl(t),[4,ht(n,e.FETCH_DATA_PROCESSING_SERVICES)];case 1:return[2,r.sent().data]}}))}))},t.prototype.fetchSettingsJson=function(){return a(this,void 0,void 0,(function(){var t,n;return c(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=this.createSettingsJsonUrl(),[4,ht(t,e.FETCH_SETTINGS)];case 1:return[2,r.sent().data];case 2:throw 403===(n=r.sent()).statusCode&&(n.errorMessage=e.SETTINGS_NOT_FOUND),n;case 3:return[2]}}))}))},t.prototype.fetchUserCountry=function(){return a(this,void 0,void 0,(function(){var t,r;return c(this,(function(i){switch(i.label){case 0:return t=It(),r=Et(),[4,pt(n.GRAPHQL,t,e.FETCH_USER_COUNTRY,r)];case 1:return[2,i.sent().data.clientLocation]}}))}))},t.prototype.generateServicesJson=function(t){return a(this,void 0,void 0,(function(){var r;return c(this,(function(i){switch(i.label){case 0:return r={request:t},[4,pt(n.AGGREGATOR,r,e.GENERATE_DATA_PROCESSING_SERVICES)];case 1:return[2,i.sent().data.fileName]}}))}))},t.prototype.saveConsents=function(t){return a(this,void 0,void 0,(function(){var r,i;return c(this,(function(s){switch(s.label){case 0:return r=wt(t),i=Et(),[4,pt(n.GRAPHQL,r,e.SAVE_CONSENTS,i)];case 1:return[2,s.sent().data.saveConsents.data]}}))}))},t.prototype.createLanguagesJsonUrl=function(){return n.CDN+"/settings/"+this.settingsId+"/"+this.jsonFileVersion+"/languages.json"},t.prototype.createServicesJsonUrl=function(t){return n.CDN+"/consent-templates/"+t+".json"},t.prototype.createSettingsJsonUrl=function(){return n.CDN+"/settings/"+this.settingsId+"/"+this.jsonFileVersion+"/"+this.jsonFileLanguage+".json"},t}(),It=function(){return{operationName:"clientLocation",query:"query clientLocation { clientLocation { countryCode countryName } }"}},Et=function(){return{credentials:"omit",headers:{Accept:"application/json","Access-Control-Allow-Origin":"*","X-Request-ID":r.v4()},mode:"cors"}},wt=function(t){return{operationName:"saveConsents",query:"mutation saveConsents($consents: [NewCreateConsentInput]) { saveConsents(consents: $consents) { data { consentId } } }",variables:{consents:At(t)}}},At=function(t){return t.services.map((function(e){return{action:t.consent.action,appVersion:"SDK-0.3.11",consentStatus:e.status?"1":"0",consentTemplateId:e.id,consentTemplateVersion:e.version,controllerId:t.settings.controllerId,language:t.settings.language,processorId:e.processorId,settingsId:t.settings.id,settingsVersion:t.settings.version,updatedBy:t.consent.type}}))};!function(t){t[t.FALSE=0]="FALSE",t[t.TRUE=1]="TRUE"}(j||(j={})),function(t){t[t.DATA_LAYER=0]="DATA_LAYER",t[t.WINDOW_EVENT=1]="WINDOW_EVENT"}(k||(k={})),function(t){t[t.MAJOR=0]="MAJOR",t[t.MINOR=1]="MINOR",t[t.PATCH=2]="PATCH"}(B||(B={})),function(t){t[t.FIRST_LAYER=1]="FIRST_LAYER",t[t.SECOND_LAYER=3]="SECOND_LAYER"}(V||(V={})),function(t){t[t.DATA_LAYER=1]="DATA_LAYER",t[t.WINDOW_EVENT=4]="WINDOW_EVENT"}(G||(G={})),function(t){t.DATA_COLLECTED_LIST="dataCollectedList",t.DATA_PURPOSES_LIST="dataPurposesList",t.DATA_RECIPIENTS_LIST="dataRecipientsList",t.TECHNOLOGY_USED="technologyUsed"}(H||(H={})),function(t){t.MAJOR="major",t.MINOR="minor",t.PATCH="patch"}(q||(q={})),(M=exports.FIRST_LAYER_VARIANT||(exports.FIRST_LAYER_VARIANT={}))[M.BANNER=0]="BANNER",M[M.WALL=1]="WALL",(W=exports.SECOND_LAYER_VARIANT||(exports.SECOND_LAYER_VARIANT={}))[W.CENTER=0]="CENTER",W[W.SIDE=1]="SIDE",(J=exports.THEME||(exports.THEME={}))[J.DARK=0]="DARK",J[J.LIGHT=1]="LIGHT";var _t,Ct=function(){function t(){this.dataLayerNames=[],this.windowEventNames=[]}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.resetInstance=function(){t.instance.dataLayerNames=[],t.instance.windowEventNames=[]},t.prototype.init=function(t){var e=this;t.forEach((function(t){var n,r;t.type===k.DATA_LAYER?e.dataLayerNames=null!==(n=t.names)&&void 0!==n?n:[]:t.type===k.WINDOW_EVENT&&(e.windowEventNames=null!==(r=t.names)&&void 0!==r?r:[])}))},t.prototype.dispatch=function(t){this.pushEventsToDataLayer(t),this.dispatchWindowEvents(t)},t.prototype.pushEventsToDataLayer=function(t){if(St(this.dataLayerNames)){var e=Tt(t),n="explicit"===t.consent.type;this.dataLayerNames.forEach((function(r){var i;window[r]=null!==(i=window[r])&&void 0!==i?i:[],window[r].push(e),n&&t.services.forEach((function(t){t.status||window[r].push({event:t.name+" EXPLICIT_DENY"})}))}))}},t.prototype.dispatchWindowEvents=function(t){if(St(this.windowEventNames)){var e=Tt(t);this.windowEventNames.forEach((function(t){var n=new window.CustomEvent(t,{detail:e});window.dispatchEvent(n)}))}},t}(),Tt=function(t){var e={event:"consent_status",type:t.consent.type};return t.services.forEach((function(t){var n;e=o(o({},e),((n={})[t.name]=t.status,n))})),e};!function(t){t.TEXT_JAVASCRIPT="text/javascript",t.TEXT_PLAIN="text/plain"}(_t||(_t={}));var Lt,Rt=function(){function t(){}return t.enableScriptsForServicesWithConsent=function(e){var n=t.getDisabledScripts();Array.prototype.forEach.call(n,(function(n){t.disabledScriptHasConsent(e,n)&&t.enableScript(n)}))},t.getDisabledScripts=function(){return document.querySelectorAll('script[data-usercentrics][type="'+_t.TEXT_PLAIN+'"]')},t.disabledScriptHasConsent=function(t,e){return t.some((function(t){return t.name===e.getAttribute("data-usercentrics")}))},t.enableScript=function(e){var n,r,i,s=e.src?t.createSrcScriptTag(e):t.createInlineScriptTag(e);r=s,(i=(n=e).parentNode)&&i.replaceChild(r,n)},t.createSrcScriptTag=function(t){return o(o({},t),{type:_t.TEXT_JAVASCRIPT})},t.createInlineScriptTag=function(t){var e=document.createElement("script"),n=document.createTextNode(t.text);return e.appendChild(n),e.type=_t.TEXT_JAVASCRIPT,e},t}(),Ot=l((function(t,e){var n;t.exports=(n=n||function(t,e){var n=Object.create||function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}}(),r={},i=r.lib={},s=i.Base={extend:function(t){var e=n(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},o=i.WordArray=s.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||c).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,i=t.sigBytes;if(this.clamp(),r%4)for(var s=0;s<i;s++){var o=n[s>>>2]>>>24-s%4*8&255;e[r+s>>>2]|=o<<24-(r+s)%4*8}else for(s=0;s<i;s+=4)e[r+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=s.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var n,r=[],i=function(e){e=e;var n=987654321,r=4294967295;return function(){var i=((n=36969*(65535&n)+(n>>16)&r)<<16)+(e=18e3*(65535&e)+(e>>16)&r)&r;return i/=4294967296,(i+=.5)*(t.random()>.5?1:-1)}},s=0;s<e;s+=4){var a=i(4294967296*(n||t.random()));n=987654071*a(),r.push(4294967296*a()|0)}return new o.init(r,e)}}),a=r.enc={},c=a.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i++){var s=e[i>>>2]>>>24-i%4*8&255;r.push((s>>>4).toString(16)),r.push((15&s).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new o.init(n,e/2)}},u=a.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i++){var s=e[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(s))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r++)n[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new o.init(n,e)}},l=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(u.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return u.parse(unescape(encodeURIComponent(t)))}},f=i.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=l.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n=this._data,r=n.words,i=n.sigBytes,s=this.blockSize,a=i/(4*s),c=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*s,u=t.min(4*c,i);if(c){for(var l=0;l<c;l+=s)this._doProcessBlock(r,l);var f=r.splice(0,c);n.sigBytes-=u}return new o.init(f,u)},clone:function(){var t=s.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),h=(i.Hasher=f.extend({cfg:s.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new h.HMAC.init(t,n).finalize(e)}}}),r.algo={});return r}(Math),n)})),Nt=l((function(t,e){var n;t.exports=(n=Ot,function(t){var e=n,r=e.lib,i=r.WordArray,s=r.Hasher,o=e.algo,a=[],c=[];!function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(t){return 4294967296*(t-(0|t))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(a[i]=n(t.pow(r,.5))),c[i]=n(t.pow(r,1/3)),i++),r++}();var u=[],l=o.SHA256=s.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],s=n[2],o=n[3],a=n[4],l=n[5],f=n[6],h=n[7],p=0;p<64;p++){if(p<16)u[p]=0|t[e+p];else{var g=u[p-15],d=(g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3,v=u[p-2],y=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;u[p]=d+u[p-7]+y+u[p-16]}var S=r&i^r&s^i&s,b=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),m=h+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&f)+c[p]+u[p];h=f,f=l,l=a,a=o+m|0,o=s,s=i,i=r,r=m+(b+S)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+s|0,n[3]=n[3]+o|0,n[4]=n[4]+a|0,n[5]=n[5]+l|0,n[6]=n[6]+f|0,n[7]=n[7]+h|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=s.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=s._createHelper(l),e.HmacSHA256=s._createHmacHelper(l)}(Math),n.SHA256)})),xt=function(t,e){return{id:t.templateId,version:t.version,language:e.language}},Pt=function(){return""+Nt(r.v4())},Ut=function(t,e){var n={categorySlug:"none",description:"",isEssential:!1,isHidden:!0,label:""};return Array.prototype.concat(t.categories.map((function(n){return{description:n.description,isEssential:n.isEssential,isHidden:n.isHidden,label:n.label,services:Dt(t,e,n),slug:n.categorySlug}})),[o(o({},n),{services:Dt(t,e,n),slug:"none"})])},Dt=function(t,e,n){return t.consentTemplates.reduce((function(t,r){return r.categorySlug===n.categorySlug&&t.push(Ft(r,e,n)),t}),[])},Ft=function(t,e,n){return o(o({},Vt(t,e)),{categorySlug:t.categorySlug,consent:{history:[],status:jt(t,n)},isEssential:n.isEssential,isHidden:kt(t,n),processorId:Pt(),subServices:Bt(t.subConsents,e)})},jt=function(t,e){return!!e.isEssential||t.defaultConsentStatus},kt=function(t,e){return!!e.isHidden||t.isHidden},Bt=function(t,e){return t.reduce((function(t,n){return t.push(Vt(n,e)),t}),[])},Vt=function(t,e){var n=Gt(t,e);return{dataCollected:Ht(n,H.DATA_COLLECTED_LIST),dataDistribution:{processingLocation:n.locationOfProcessing,thirdPartyCountries:n.thirdCountryTransfer},dataPurposes:qt(n),dataRecipients:Ht(n,H.DATA_RECIPIENTS_LIST),description:Mt(t,n),id:t.templateId,language:{available:n.languagesAvailable,selected:n.language},legalBasis:Wt(n),name:Jt(n),processingCompany:{address:n.addressOfProcessingCompany,dataProtectionOfficer:n.dataProtectionOfficer,name:Yt(n)},retentionPeriodDescription:zt(n),technologiesUsed:Ht(n,H.TECHNOLOGY_USED),urls:{cookiePolicy:n.cookiePolicyURL,dataProcessingAgreement:n.linkToDpa,optOut:n.optOutUrl,privacyPolicy:Xt(n)},version:t.version}},Gt=function(t,e){return e.find((function(e){return t.templateId===e.templateId&&t.version===e.version}))},Ht=function(t,e){var n;return St(t[e])?t[e]:(null===(n=t[e])||void 0===n?void 0:n.length)>0?[t[e]]:[]},qt=function(t){var e=Ht(t,H.DATA_PURPOSES_LIST);return St(e)?e:t.dataPurposes},Mt=function(t,e){return t.description||e.descriptionOfService||e.description},Wt=function(t){return St(t.legalBasisList)?t.legalBasisList:[t.legalGround]},Jt=function(t){return t.dataProcessor||t.dataProcessors[0]},Yt=function(t){return t.nameOfProcessingCompany||t.processingCompany},zt=function(t){return t.retentionPeriodDescription||t.retentionPeriodList[0]},Xt=function(t){return t.privacyPolicyURL||t.policyOfProcessorUrl},Kt=function(t){return t.reduce((function(t,e){return e.type===G.DATA_LAYER?t.push({names:e.names,type:k.DATA_LAYER}):e.type===G.WINDOW_EVENT&&t.push({names:e.names,type:k.WINDOW_EVENT}),t}),[])},$t=function(t){return t.map((function(t){switch(t){case q.MAJOR:return B.MAJOR;case q.MINOR:return B.MINOR;case q.PATCH:return B.PATCH}}))},Qt=function(t){var e=t.backgroundOverlay.find((function(t){return t.target[0]===V.FIRST_LAYER})),n=t.backgroundOverlay.find((function(t){return t.target[0]===V.SECOND_LAYER}));return{buttons:{acceptAll:{label:t.labels.btnAccept},denyAll:{isEnabled:t.btnDenyIsVisible,label:t.labels.btnDeny},save:{label:t.labels.btnSave},showSecondLayer:{isEnabled:t.btnMoreInfoIsVisible,label:t.labels.btnMoreInfo,url:t.moreInfoButtonUrl||null}},customization:{color:{primary:"#0045A5"},font:{family:"",size:14},theme:1},firstLayer:{description:{default:t.bannerMessage,short:t.bannerMobileDescriptionIsActive?t.bannerMobileDescription:null},isCategoryTogglesEnabled:!1,isOverlayEnabled:!!e&&(null==e?void 0:e.darken)>0,title:t.labels.titleCenterSecondary,variant:0},labels:{general:{consentGiven:"Consent given",consentNotGiven:"Consent not given",consentType:"Consent type",controllerId:"Controller ID",copy:t.labels.copy,date:t.labels.date,decision:"Decision",explicit:"Explicit",implicit:"Implicit",processorId:"Processor ID",showMore:"Show more"},service:{dataCollected:{description:t.labels.dataCollectedInfo,title:t.labels.dataCollectedList},dataDistribution:{processingLocationTitle:t.labels.locationOfProcessing,thirdPartyCountriesTitle:t.labels.transferToThirdCountries},dataPurposes:{description:t.labels.dataPurposesInfo,title:t.labels.dataPurposes},dataRecipientsTitle:t.labels.dataRecipientsList,descriptionTitle:t.labels.descriptionOfService,history:{description:null,title:t.labels.history},legalBasis:{description:t.labels.legalBasisInfo,title:t.labels.legalBasisList},processingCompanyTitle:t.labels.processingCompanyTitle,retentionPeriodTitle:t.labels.retentionPeriod,technologiesUsed:{description:t.labels.technologiesUsedInfo,title:t.labels.technologiesUsed},urls:{cookiePolicyTitle:t.labels.cookiePolicyInfo,dataProcessingAgreementTitle:t.labels.linkToDpaInfo,optOutTitle:t.labels.furtherInformationOptOut,privacyPolicyTitle:t.labels.policyOf}}},language:{available:t.languagesAvailable,isSelectorEnabled:t.showLanguageDropdown,selected:t.language},links:{cookiePolicy:{label:"",url:null},imprint:{label:t.labels.imprintLinkText||null,url:t.imprintUrl||null},privacyPolicy:{label:t.labels.privacyPolicyLinkText,url:t.privacyPolicyUrl||null}},poweredBy:{isEnabled:t.enablePoweredBy,label:"Powered by",partnerUrl:t.partnerPoweredByUrl||null,partnerUrlLabel:t.labels.partnerPoweredByLinkText||null,url:"https://www.usercentrics.com/",urlLabel:"Usercentrics Consent Management"},privacyButton:{isEnabled:t.privacyButtonIsVisible},secondLayer:{description:t.labels.headerCenterSecondary,isOverlayEnabled:!!n&&(null==n?void 0:n.darken)>0,tabs:{categories:{isEnabled:!0,label:t.labels.categories},services:{isEnabled:!0,label:"Services"}},title:t.labels.titleCenterSecondary,variant:0}}},Zt=["AT","BE","BG","CY","CZ","DE","DK","EE","ES","FI","FR","GR","HR","HU","IE","IT","LT","LU","LV","MT","NL","PL","PT","RO","SE","SI","SK"],te=function(){function t(){this.apiInstance=mt.getInstance(),this.userCountry={}}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.resetInstance=function(){t.instance.userCountry={}},t.prototype.getUserCountry=function(){return a(this,void 0,void 0,(function(){var t;return c(this,(function(e){switch(e.label){case 0:return bt(this.userCountry)?[3,2]:[4,this.apiInstance.fetchUserCountry()];case 1:t=e.sent(),this.userCountry=ee(t),e.label=2;case 2:return[2,this.userCountry]}}))}))},t.prototype.getIsUserInEU=function(){return a(this,void 0,void 0,(function(){var t;return c(this,(function(e){switch(e.label){case 0:return[4,this.getUserCountry()];case 1:return t=e.sent(),[2,yt(Zt,t.code.toUpperCase())]}}))}))},t}(),ee=function(t){return{code:t.countryCode,name:t.countryName}},ne=function(){function t(){this.apiInstance=mt.getInstance(),this.locationInstance=te.getInstance(),this.settings={}}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.resetInstance=function(){t.instance.settings={}},t.prototype.getBaseSettings=function(){return{controllerId:this.settings.controllerId,id:this.settings.id,ui:this.settings.ui,version:this.settings.version}},t.prototype.getCategories=function(){return this.settings.categories},t.prototype.getCategoryBySlug=function(t){return this.getCategories().find((function(e){return e.slug===t}))},t.prototype.getDataExchangeSettings=function(){return this.settings.dataExchangeSettings},t.prototype.getEssentialCategories=function(){return this.getCategories().reduce((function(t,e){return e.isEssential&&t.push(e),t}),[])},t.prototype.getNonEssentialCategories=function(){return this.getCategories().reduce((function(t,e){return e.isEssential||t.push(e),t}),[])},t.prototype.getServices=function(){return this.getServicesFromCategories(this.getCategories())},t.prototype.getServicesByIds=function(t){return this.getServicesFromCategories(this.removeNoneCategory(this.getCategories())).reduce((function(e,n){return t.some((function(t){return t===n.id}))&&e.push(n),e}),[])},t.prototype.getServicesFromCategories=function(t){return t.reduce((function(t,e){return t.concat(e.services)}),[])},t.prototype.getServicesWithConsent=function(){return this.getServices().reduce((function(t,e){return e.consent.status&&t.push(e),t}),[])},t.prototype.getSettings=function(){return this.settings},t.prototype.setCategories=function(t){this.settings.categories=t},t.prototype.setSettings=function(t){this.settings=t},t.prototype.initSettings=function(){return a(this,void 0,void 0,(function(){var t,e;return c(this,(function(n){switch(n.label){case 0:return[4,this.apiInstance.fetchSettingsJson()];case 1:return t=n.sent(),t=o(o({},r=t),{consentTemplates:r.consentTemplates.reduce((function(t,e){return e.isDeactivated||t.push(e),t}),[])}),[4,this.fetchServices(t)];case 2:return e=n.sent(),this.setSettings(re(function(t,e){return{acceptAllImplicitlyOutsideEU:t.displayOnlyForEU,categories:Ut(t,e),controllerId:Pt(),dataExchangeSettings:Kt(t.dataExchangeOnPage),id:t.settingsId,showFirstLayerOnVersionChange:$t(t.showInitialViewForVersionChange),ui:Qt(t),version:t.version}}(t,e))),[2]}var r}))}))},t.prototype.mergeServicesIntoExistingCategories=function(t){return this.getCategories().map((function(e){return o(o({},e),{services:e.services.map((function(e){var n=t.find((function(t){return t.id===e.id}));return null!=n?n:e}))})}))},t.prototype.removeNoneCategory=function(t){return t.reduce((function(t,e){return"none"!==e.slug&&t.push(e),t}),[])},t.prototype.shouldAcceptAllImplicitlyOnInit=function(){return a(this,void 0,void 0,(function(){return c(this,(function(t){return this.settings.acceptAllImplicitlyOutsideEU?[2,!this.locationInstance.getIsUserInEU()]:[2,!1]}))}))},t.prototype.shouldShowFirstLayerOnVersionChange=function(t){if(St(this.settings.showFirstLayerOnVersionChange)){var e=this.settings.version.split("."),n=t.split(".");return yt(this.settings.showFirstLayerOnVersionChange,B.MAJOR)&&e[0]!==n[0]||yt(this.settings.showFirstLayerOnVersionChange,B.MINOR)&&e[1]!==n[1]||yt(this.settings.showFirstLayerOnVersionChange,B.PATCH)&&e[2]!==n[2]}return!1},t.prototype.updateServicesWithConsent=function(t,e){return t.map((function(t){return t.isEssential?t:o(o({},t),{consent:o(o({},t.consent),{status:e===j.TRUE})})}))},t.prototype.updateServicesWithConsents=function(t,e){return t.reduce((function(t,n){var r;if(!n.isEssential){var i=e.find((function(t){return t.serviceId===n.id}));r=o(o({},n),{consent:o(o({},n.consent),{status:i.status})})}return t.push(null!=r?r:n),t}),[])},t.prototype.fetchServices=function(t){return a(this,void 0,void 0,(function(){var e,n,r;return c(this,(function(o){switch(o.label){case 0:c=[],(a=t).consentTemplates.forEach((function(t){c.push(xt(t,a)),t.subConsents.forEach((function(t){c.push(xt(t,a))}))})),e=i(s(c,(function(t,e){return t.id===e.id&&t.version===e.version})),"id"),n=function(t){return""+Nt(JSON.stringify(t))}(e),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.apiInstance.fetchServicesJson(n)];case 2:return[2,o.sent()];case 3:return o.sent(),[3,4];case 4:return[4,this.apiInstance.generateServicesJson(e)];case 5:return r=o.sent(),[2,this.apiInstance.fetchServicesJson(r)]}var a,c}))}))},t}(),re=function(t){return o(o({},t),{categories:t.categories.reduce((function(t,e){return St(e.services)&&t.push(e),t}),[])})};!function(t){t.SETTINGS="uc_settings",t.USER_INTERACTION="uc_user_interaction"}(Lt||(Lt={}));var ie,se=function(){function t(){}return t.clearOnNewSettingsId=function(e){e!==t.fetchSettingsId()&&t.clear()},t.fetchLanguage=function(){return t.fetchSettings().language},t.fetchSettings=function(){var t=localStorage.getItem(Lt.SETTINGS);return JSON.parse(null!=t?t:"{}")},t.fetchSettingsId=function(){return t.fetchSettings().id},t.fetchSettingsVersion=function(){return t.fetchSettings().version},t.fetchUserActionPerformed=function(){return null!==localStorage.getItem(Lt.USER_INTERACTION)},t.saveSettings=function(t,e){localStorage.setItem(Lt.SETTINGS,JSON.stringify(oe(t,e)))},t.settingsExist=function(){return bt(t.fetchSettings())},t.setUserActionPerformed=function(){localStorage.setItem(Lt.USER_INTERACTION,JSON.stringify(!0))},t.clear=function(){localStorage.removeItem(Lt.SETTINGS),localStorage.removeItem(Lt.USER_INTERACTION)},t}(),oe=function(t,e){return{controllerId:t.controllerId,id:t.id,language:t.ui.language.selected,services:ae(e),version:t.version}},ae=function(t){return t.map((function(t){return{history:t.consent.history,id:t.id,processorId:t.processorId,status:t.consent.status}}))},ce=function(){function t(){this.apiInstance=mt.getInstance(),this.eventDispatcherInstance=Ct.getInstance(),this.settingsInstance=ne.getInstance()}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.prototype.execute=function(t,e,n){return a(this,void 0,void 0,(function(){var r,i;return c(this,(function(s){switch(s.label){case 0:return r=this.mapDataTransferObject(t,e,n),i=ue(t,r),[4,this.apiInstance.saveConsents(r)];case 1:return s.sent(),this.settingsInstance.setCategories(this.settingsInstance.mergeServicesIntoExistingCategories(i)),se.saveSettings(this.settingsInstance.getSettings(),this.settingsInstance.getServices()),Rt.enableScriptsForServicesWithConsent(this.settingsInstance.getServicesWithConsent()),this.eventDispatcherInstance.dispatch(r),[2]}}))}))},t.prototype.getMergedServicesAndSettingsFromStorage=function(){var t=se.fetchSettings(),e=this.getMergedAndUpdatedEssentialServices(t),n=e.mergedEssentialServices,r=e.updatedEssentialServices,i=this.getMergedNonEssentialServices(t);return{mergedServices:n.concat(i),mergedSettings:o(o({},this.settingsInstance.getSettings()),{controllerId:t.controllerId}),updatedEssentialServices:r}},t.prototype.mergeSettingsFromStorage=function(){return a(this,void 0,void 0,(function(){var t,e,n,r,i,s,a;return c(this,(function(c){switch(c.label){case 0:return t=this.getMergedServicesAndSettingsFromStorage(),e=t.mergedServices,n=t.mergedSettings,r=t.updatedEssentialServices,St(r)?(i=this.mapDataTransferObject(r,"onEssentialChange","implicit",n),s=ue(e,i),[4,this.apiInstance.saveConsents(i)]):[3,2];case 1:return c.sent(),this.settingsInstance.setSettings(o(o({},n),{categories:this.settingsInstance.mergeServicesIntoExistingCategories(s)})),[3,3];case 2:this.settingsInstance.setSettings(o(o({},n),{categories:this.settingsInstance.mergeServicesIntoExistingCategories(e)})),c.label=3;case 3:return a=this.mapDataTransferObject(e,"onInitialPageLoad","implicit"),se.saveSettings(n,e),Rt.enableScriptsForServicesWithConsent(this.settingsInstance.getServicesWithConsent()),this.eventDispatcherInstance.dispatch(a),[2]}}))}))},t.prototype.mapDataTransferObject=function(t,e,n,r){var i,s,o,a;return{consent:{action:e,type:n},services:t.map((function(t){return{id:t.id,name:t.name,processorId:t.processorId,status:t.consent.status,version:t.version}})),settings:{controllerId:null!==(i=null==r?void 0:r.controllerId)&&void 0!==i?i:this.settingsInstance.getSettings().controllerId,id:null!==(s=null==r?void 0:r.id)&&void 0!==s?s:this.settingsInstance.getSettings().id,language:null!==(o=null==r?void 0:r.ui.language.selected)&&void 0!==o?o:this.settingsInstance.getSettings().ui.language.selected,version:null!==(a=null==r?void 0:r.version)&&void 0!==a?a:this.settingsInstance.getSettings().version}}},t.prototype.getMergedAndUpdatedEssentialServices=function(t){var e=this.settingsInstance.getServicesFromCategories(this.settingsInstance.getEssentialCategories()),n=[];return{mergedEssentialServices:e.map((function(e){var r=t.services.find((function(t){return t.id===e.id}));if(r){var i=o(o({},e),{consent:o(o({},e.consent),{history:r.history,status:!0}),processorId:r.processorId});return r.status||n.push(i),i}return e})),updatedEssentialServices:n}},t.prototype.getMergedNonEssentialServices=function(t){return this.settingsInstance.getServicesFromCategories(this.settingsInstance.getNonEssentialCategories()).map((function(e){var n=t.services.find((function(t){return t.id===e.id}));return n?o(o({},e),{consent:o(o({},e.consent),{history:n.history,status:n.status}),processorId:n.processorId}):e}))},t}(),ue=function(t,e){var n=(new Date).valueOf();return t.map((function(t){var r=e.services.findIndex((function(e){return e.id===t.id}));return r>-1?o(o({},t),{consent:o(o({},t.consent),{history:u(t.consent.history,[le(e,r,"SDK-0.3.11",n)])})}):t}))},le=function(t,e,n,r){return{action:t.consent.action,language:t.settings.language,status:t.services[e].status,timestamp:r,type:t.consent.type,versions:{application:n,service:t.services[e].version,settings:t.settings.version}}};!function(t){t.DEFAULT_BROWSER_LANGUAGE="Usercentrics: The language has been defaulted to the browser language.",t.DEFAULT_FIRST_AVAILABLE_LANGUAGE="Usercentrics: The language has been defaulted to the first available language."}(ie||(ie={}));var fe,he,pe,ge=function(){function t(){this.apiInstance=mt.getInstance()}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.prototype.resolveLanguage=function(){return a(this,void 0,void 0,(function(){var t,e,n;return c(this,(function(r){switch(r.label){case 0:return[4,this.apiInstance.fetchAvailableLanguages()];case 1:return t=r.sent(),e=se.fetchLanguage(),yt(t,e)&&this.apiInstance.setJsonFileLanguage(e),yt(t,this.apiInstance.getJsonFileLanguage())?[2]:((n=de(t))?(console.warn(ie.DEFAULT_BROWSER_LANGUAGE),this.apiInstance.setJsonFileLanguage(n)):(console.warn(ie.DEFAULT_FIRST_AVAILABLE_LANGUAGE),this.apiInstance.setJsonFileLanguage(t[0])),[2])}}))}))},t}(),de=function(t){var e,n=window.navigator;if(St(n.languages))for(var r=0;r<n.languages.length;r+=1){var i=n.languages[r].slice(0,2);if(yt(t,i))return i}var s=(null!==(e=n.language)&&void 0!==e?e:n.userLanguage).slice(0,2);return yt(t,s)?s:null};(fe=exports.CONSENT_ACTION||(exports.CONSENT_ACTION={})).ACCEPT_ALL_SERVICES="onAcceptAllServices",fe.DENY_ALL_SERVICES="onDenyAllServices",fe.ESSENTIAL_CHANGE="onEssentialChange",fe.INITIAL_PAGE_LOAD="onInitialPageLoad",fe.NON_EU_REGION="onNonEURegion",fe.UPDATE_SERVICES="onUpdateServices",(he=exports.CONSENT_TYPE||(exports.CONSENT_TYPE={})).EXPLICIT="explicit",he.IMPLICIT="implicit",(pe=exports.INITIAL_VIEW||(exports.INITIAL_VIEW={}))[pe.FIRST_LAYER=0]="FIRST_LAYER",pe[pe.NONE=1]="NONE",pe[pe.PRIVACY_BUTTON=2]="PRIVACY_BUTTON";var ve=function(){function t(t,e){this.apiInstance=mt.getInstance(),this.dataFacadeInstance=ce.getInstance(),this.eventDispatcherInstance=Ct.getInstance(),this.languageInstance=ge.getInstance(),this.locationInstance=te.getInstance(),this.settingsInstance=ne.getInstance(),this.apiInstance.setSettingsId(t),(null==e?void 0:e.language)&&this.apiInstance.setJsonFileLanguage(e.language),(null==e?void 0:e.version)&&this.apiInstance.setJsonFileVersion(e.version)}return t.prototype.init=function(){return a(this,void 0,void 0,(function(){var t,e;return c(this,(function(n){switch(n.label){case 0:return se.clearOnNewSettingsId(this.apiInstance.getSettingsId()),[4,this.languageInstance.resolveLanguage()];case 1:return n.sent(),[4,this.settingsInstance.initSettings()];case 2:return n.sent(),this.eventDispatcherInstance.init(this.settingsInstance.getDataExchangeSettings()),t=!se.settingsExist(),[4,this.settingsInstance.shouldAcceptAllImplicitlyOnInit()];case 3:return e=n.sent(),t?e?[4,this.dataFacadeInstance.execute(this.settingsInstance.updateServicesWithConsent(this.settingsInstance.getServices(),j.TRUE),"onNonEURegion","implicit")]:[3,5]:[3,8];case 4:return n.sent(),[3,7];case 5:return[4,this.dataFacadeInstance.execute(this.settingsInstance.getServices(),"onInitialPageLoad","implicit")];case 6:n.sent(),n.label=7;case 7:return[3,10];case 8:return[4,this.dataFacadeInstance.mergeSettingsFromStorage()];case 9:n.sent(),n.label=10;case 10:return[2,this.resolveInitialView(e,t)]}}))}))},t.prototype.acceptAllServices=function(t){return void 0===t&&(t="explicit"),a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return[4,this.dataFacadeInstance.execute(this.settingsInstance.updateServicesWithConsent(this.settingsInstance.getServices(),j.TRUE),"onAcceptAllServices",t)];case 1:return e.sent(),se.setUserActionPerformed(),[2]}}))}))},t.prototype.acceptAllServicesInCategory=function(t,e){return void 0===e&&(e="explicit"),a(this,void 0,void 0,(function(){var n;return c(this,(function(r){switch(r.label){case 0:return(n=this.settingsInstance.getCategoryBySlug(t))?[4,this.dataFacadeInstance.execute(this.settingsInstance.updateServicesWithConsent(n.services,j.TRUE),"onUpdateServices",e)]:[3,2];case 1:r.sent(),se.setUserActionPerformed(),r.label=2;case 2:return[2]}}))}))},t.prototype.changeLanguage=function(t){return a(this,void 0,void 0,(function(){var e,n,r;return c(this,(function(i){switch(i.label){case 0:return this.shouldChangeLanguage(t)?(this.apiInstance.setJsonFileLanguage(t),[4,this.settingsInstance.initSettings()]):[3,2];case 1:i.sent(),e=this.dataFacadeInstance.getMergedServicesAndSettingsFromStorage(),n=e.mergedServices,r=e.mergedSettings,this.settingsInstance.setSettings(o(o({},r),{categories:this.settingsInstance.mergeServicesIntoExistingCategories(n)})),se.saveSettings(r,n),i.label=2;case 2:return[2]}}))}))},t.prototype.denyAllServices=function(t){return void 0===t&&(t="explicit"),a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return[4,this.dataFacadeInstance.execute(this.settingsInstance.updateServicesWithConsent(this.settingsInstance.getServices(),j.FALSE),"onDenyAllServices",t)];case 1:return e.sent(),se.setUserActionPerformed(),[2]}}))}))},t.prototype.denyAllServicesInCategory=function(t,e){return void 0===e&&(e="explicit"),a(this,void 0,void 0,(function(){var n;return c(this,(function(r){switch(r.label){case 0:return(n=this.settingsInstance.getCategoryBySlug(t))?[4,this.dataFacadeInstance.execute(this.settingsInstance.updateServicesWithConsent(n.services,j.FALSE),"onUpdateServices",e)]:[3,2];case 1:r.sent(),se.setUserActionPerformed(),r.label=2;case 2:return[2]}}))}))},t.prototype.fetchIsUserInEU=function(){return a(this,void 0,void 0,(function(){return c(this,(function(t){return[2,this.locationInstance.getIsUserInEU()]}))}))},t.prototype.fetchUserCountry=function(){return a(this,void 0,void 0,(function(){return c(this,(function(t){return[2,this.locationInstance.getUserCountry()]}))}))},t.prototype.getCategories=function(){return this.settingsInstance.removeNoneCategory(this.settingsInstance.getCategories())},t.prototype.getEssentialCategories=function(){return this.settingsInstance.removeNoneCategory(this.settingsInstance.getEssentialCategories())},t.prototype.getEssentialServices=function(){return this.settingsInstance.getServicesFromCategories(this.getEssentialCategories())},t.prototype.getNonEssentialCategories=function(){return this.settingsInstance.removeNoneCategory(this.settingsInstance.getNonEssentialCategories())},t.prototype.getNonEssentialServices=function(){return this.settingsInstance.getServicesFromCategories(this.getNonEssentialCategories())},t.prototype.getServices=function(){return this.settingsInstance.getServicesFromCategories(this.getCategories())},t.prototype.getSettings=function(){return this.settingsInstance.getBaseSettings()},t.prototype.updateServices=function(t,e){return void 0===e&&(e="explicit"),a(this,void 0,void 0,(function(){var n,r;return c(this,(function(i){switch(i.label){case 0:return n=this.settingsInstance.getServicesByIds(t.map((function(t){return t.serviceId}))),r=this.settingsInstance.updateServicesWithConsents(n,t),St(r)?[4,this.dataFacadeInstance.execute(r,"onUpdateServices",e)]:[3,2];case 1:i.sent(),se.setUserActionPerformed(),i.label=2;case 2:return[2]}}))}))},t.prototype.resolveInitialView=function(t,e){return t?1:e||!se.fetchUserActionPerformed()||this.settingsInstance.shouldShowFirstLayerOnVersionChange(se.fetchSettingsVersion())?0:this.settingsInstance.getBaseSettings().ui.privacyButton.isEnabled?2:1},t.prototype.shouldChangeLanguage=function(t){return t!==this.apiInstance.getJsonFileLanguage()&&this.settingsInstance.getBaseSettings().ui.language.available.some((function(e){return t===e}))},t}();exports.Usercentrics=ve,exports.default=ve;
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e,n,r=require("uuid"),i=t(require("lodash/sortBy")),s=t(require("lodash/uniqWith")),o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function a(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}c((r=r.apply(t,e||[])).next())}))}function c(t,e){var n,r,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function u(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)r[i]=s[o];return r}!function(t){t.AVAILABLE_LANGUAGES_NOT_FOUND="Unable to find available languages using given settingsId and version.",t.FETCH_AVAILABLE_LANGUAGES="Something went wrong while fetching the available languages.",t.FETCH_DATA_PROCESSING_SERVICES="Something went wrong while fetching the data processing services.",t.FETCH_SETTINGS="Something went wrong while fetching the settings.",t.FETCH_USER_CONSENTS="Something went wrong while fetching the user's consents.",t.FETCH_USER_COUNTRY="Something went wrong while fetching the user's country.",t.GENERATE_DATA_PROCESSING_SERVICES="Something went wrong while generating the data processing services.",t.SAVE_CONSENTS="Something went wrong while saving user consents.",t.SETTINGS_NOT_FOUND="Unable to find settings using given settingsId and version."}(e||(e={})),function(t){t.AGGREGATOR="https://consent-templates-batch-generation.usercentrics.eu",t.CDN="https://api.usercentrics.eu",t.FETCH_CONSENTS_GRAPHQL="https://api-v2-prod-internal-dot-staticfilesserver.appspot.com/graphql",t.PUBLIC_GRAPHQL="https://graphql.usercentrics.eu/graphql"}(n||(n={}));"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function l(t,e){return t(e={exports:{}},e.exports),e.exports}l((function(t){var e=function(t){var e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",s=r.asyncIterator||"@@asyncIterator",o=r.toStringTag||"@@toStringTag";function a(t,e,n,r){var i=e&&e.prototype instanceof l?e:l,s=Object.create(i.prototype),o=new E(r||[]);return s._invoke=function(t,e,n){var r="suspendedStart";return function(i,s){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw s;return C()}for(n.method=i,n.arg=s;;){var o=n.delegate;if(o){var a=I(o,n);if(a){if(a===u)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=c(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,o),s}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=a;var u={};function l(){}function f(){}function h(){}var p={};p[i]=function(){return this};var g=Object.getPrototypeOf,d=g&&g(g(w([])));d&&d!==e&&n.call(d,i)&&(p=d);var v=h.prototype=l.prototype=Object.create(p);function y(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function S(t,e){var r;this._invoke=function(i,s){function o(){return new e((function(r,o){!function r(i,s,o,a){var u=c(t[i],t,s);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,o,a)}),(function(t){r("throw",t,o,a)})):e.resolve(f).then((function(t){l.value=t,o(l)}),(function(t){return r("throw",t,o,a)}))}a(u.arg)}(i,s,r,o)}))}return r=r?r.then(o,o):o()}}function I(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,I(t,e),"throw"===e.method))return u;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=c(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,u;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function m(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(m,this),this.reset(!0)}function w(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,s=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return s.next=s}}return{next:C}}function C(){return{value:void 0,done:!0}}return f.prototype=v.constructor=h,h.constructor=f,h[o]=f.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,o in t||(t[o]="GeneratorFunction")),t.prototype=Object.create(v),t},t.awrap=function(t){return{__await:t}},y(S.prototype),S.prototype[s]=function(){return this},t.AsyncIterator=S,t.async=function(e,n,r,i,s){void 0===s&&(s=Promise);var o=new S(a(e,n,r,i),s);return t.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},y(v),v[o]="Generator",v[i]=function(){return this},v.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=w,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return o.type="throw",o.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var a=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(a&&c){if(this.prev<s.catchLoc)return r(s.catchLoc,!0);if(this.prev<s.finallyLoc)return r(s.finallyLoc)}else if(a){if(this.prev<s.catchLoc)return r(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return r(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===t||"continue"===t)&&s.tryLoc<=e&&e<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=t,o.arg=e,s?(this.method="next",this.next=s.finallyLoc,u):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),b(n),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;b(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:w(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}));var f={limit:3,statusCodes:[408,413,429,500,502,503,504]};function h(t){return(h="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})(t)}function p(t,e,n,r,i,s,o){try{var a=t[s](o),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,i)}function g(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var s=t.apply(e,n);function o(t){p(s,r,i,o,a,"next",t)}function a(t){p(s,r,i,o,a,"throw",t)}o(void 0)}))}}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(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,r.key,r)}}function y(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function S(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function I(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?S(Object(n),!0).forEach((function(e){y(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function m(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}}),e&&E(t,e)}function b(t){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function E(t,e){return(E=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function w(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function C(t,e,n){return(C=w()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&E(i,n.prototype),i}).apply(null,arguments)}function A(t){var e="function"==typeof Map?new Map:void 0;return(A=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return C(t,arguments,b(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),E(r,t)})(t)}function _(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function T(t){return function(){var e,n=b(t);if(w()){var r=b(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return _(this,e)}}function L(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,s=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done)&&(n.push(o.value),!e||n.length!==e);r=!0);}catch(t){i=!0,s=t}finally{try{r||null==a.return||a.return()}finally{if(i)throw s}}return n}(t,e)||N(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(t){return function(t){if(Array.isArray(t))return O(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||N(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 N(t,e){if(t){if("string"==typeof t)return O(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(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?O(t,e):void 0}}function O(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 x(t){if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=N(t))){var e=0,n=function(){};return{s:n,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n}}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 r,i,s=!0,o=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return s=t.done,t},e:function(t){o=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw i}}}}
/*! MIT License © Sindre Sorhus */for(var P={},U=function(){var t=D[F];Object.defineProperty(P,t,{get:function(){var e=function(t){return"undefined"!=typeof self&&self&&t in self?self:"undefined"!=typeof window&&window&&t in window?window:"undefined"!=typeof global&&global&&t in global?global:"undefined"!=typeof globalThis&&globalThis?globalThis:void 0}(t),n=e&&e[t];return"function"==typeof n?n.bind(e):n}})},F=0,D=["Headers","Request","Response","ReadableStream","fetch","AbortController","FormData"];F<D.length;F++)U();var j,k,B,V,G,H,q,M,W,J,Y=function(t){return null!==t&&"object"===h(t)},z="function"==typeof P.AbortController,$="function"==typeof P.ReadableStream,X="function"==typeof P.FormData,Q=function t(){for(var e={},n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var s=0,o=r;s<o.length;s++){var a=o[s];if(Array.isArray(a))Array.isArray(e)||(e=[]),e=[].concat(R(e),R(a));else if(Y(a))for(var c=0,u=Object.entries(a);c<u.length;c++){var l=L(u[c],2),f=l[0],h=l[1];Y(h)&&Reflect.has(e,f)&&(h=t(e[f],h)),e=I({},e,y({},f,h))}}return e},K=["get","post","put","patch","head","delete"],Z={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},tt=[413,429,503],et=Symbol("stop"),nt=function(t){m(n,A(Error));var e=T(n);function n(t){var r;return d(this,n),(r=e.call(this,t.statusText||String(0===t.status||t.status?t.status:"Unknown response error"))).name="HTTPError",r.response=t,r}return n}(),rt=function(t){m(n,A(Error));var e=T(n);function n(){var t;return d(this,n),(t=e.call(this,"Request timed out")).name="TimeoutError",t}return n}(),it=function(t){return new Promise((function(e){return setTimeout(e,t)}))},st=function(t,e,n){return new Promise((function(r,i){var s=setTimeout((function(){n&&n.abort(),i(new rt)}),e);t.then(r).catch(i).then((function(){clearTimeout(s)}))}))},ot=function(t){return K.includes(t)?t.toUpperCase():t},at={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:tt},ct=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("number"==typeof t)return I({},at,{limit:t});if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return I({},at,{},t,{afterStatusCodes:tt})},ut=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(d(this,t),this._retryCount=0,this._input=e,this._options=I({credentials:this._input.credentials||"same-origin"},r,{hooks:Q({beforeRequest:[],beforeRetry:[],afterResponse:[]},r.hooks),method:ot(r.method||this._input.method),prefixUrl:String(r.prefixUrl||""),retry:ct(r.retry),throwHttpErrors:!1!==r.throwHttpErrors,timeout:void 0===r.timeout?1e4:r.timeout}),"string"!=typeof this._input&&!(this._input instanceof URL||this._input instanceof P.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&"string"==typeof this._input){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(z&&(this.abortController=new P.AbortController,this._options.signal&&this._options.signal.addEventListener("abort",(function(){n.abortController.abort()})),this._options.signal=this.abortController.signal),this.request=new P.Request(this._input,this._options),this._options.searchParams){var i=new URL(this.request.url);i.search=new URLSearchParams(this._options.searchParams),!(X&&this._options.body instanceof P.FormData||this._options.body instanceof URLSearchParams)||this._options.headers&&this._options.headers["content-type"]||this.request.headers.delete("content-type"),this.request=new P.Request(new P.Request(i,this.request),this._options)}void 0!==this._options.json&&(this._options.body=JSON.stringify(this._options.json),this.request.headers.set("content-type","application/json"),this.request=new P.Request(this.request,{body:this._options.body}));for(var s=function(){var t=g(regeneratorRuntime.mark((function t(){var e,r,i,s,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n._options.timeout>2147483647)){t.next=2;break}throw new RangeError("The `timeout` option cannot be greater than ".concat(2147483647));case 2:return t.next=4,it(1);case 4:return t.next=6,n._fetch();case 6:e=t.sent,r=x(n._options.hooks.afterResponse),t.prev=8,r.s();case 10:if((i=r.n()).done){t.next=18;break}return s=i.value,t.next=14,s(n.request,n._options,e.clone());case 14:(o=t.sent)instanceof P.Response&&(e=o);case 16:t.next=10;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(8),r.e(t.t0);case 23:return t.prev=23,r.f(),t.finish(23);case 26:if(e.ok||!n._options.throwHttpErrors){t.next=28;break}throw new nt(e);case 28:if(!n._options.onDownloadProgress){t.next=34;break}if("function"==typeof n._options.onDownloadProgress){t.next=31;break}throw new TypeError("The `onDownloadProgress` option must be a function");case 31:if($){t.next=33;break}throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");case 33:return t.abrupt("return",n._stream(e.clone(),n._options.onDownloadProgress));case 34:return t.abrupt("return",e);case 35:case"end":return t.stop()}}),t,null,[[8,20,23,26]])})));return function(){return t.apply(this,arguments)}}(),o=this._options.retry.methods.includes(this.request.method.toLowerCase()),a=o?this._retry(s):s(),c=function(){var t=L(l[u],2),e=t[0],r=t[1];a[e]=g(regeneratorRuntime.mark((function t(){var i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.request.headers.set("accept",n.request.headers.get("accept")||r),t.next=3,a;case 3:return i=t.sent.clone(),t.abrupt("return","json"===e&&204===i.status?"":i[e]());case 5:case"end":return t.stop()}}),t)})))},u=0,l=Object.entries(Z);u<l.length;u++)c();return a}var e,n,r,i,s;return e=t,(n=[{key:"_calculateRetryDelay",value:function(t){if(this._retryCount++,this._retryCount<this._options.retry.limit&&!(t instanceof rt)){if(t instanceof nt){if(!this._options.retry.statusCodes.includes(t.response.status))return 0;var e=t.response.headers.get("Retry-After");if(e&&this._options.retry.afterStatusCodes.includes(t.response.status)){var n=Number(e);return Number.isNaN(n)?n=Date.parse(e)-Date.now():n*=1e3,void 0!==this._options.retry.maxRetryAfter&&n>this._options.retry.maxRetryAfter?0:n}if(413===t.response.status)return 0}return.3*Math.pow(2,this._retryCount-1)*1e3}return 0}},{key:"_retry",value:(s=g(regeneratorRuntime.mark((function t(e){var n,r,i,s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e();case 3:return t.abrupt("return",t.sent);case 6:if(t.prev=6,t.t0=t.catch(0),!(0!==(n=Math.min(this._calculateRetryDelay(t.t0),2147483647))&&this._retryCount>0)){t.next=33;break}return t.next=12,it(n);case 12:r=x(this._options.hooks.beforeRetry),t.prev=13,r.s();case 15:if((i=r.n()).done){t.next=24;break}return s=i.value,t.next=19,s({request:this.request,options:this._options,error:t.t0,response:t.t0.response.clone(),retryCount:this._retryCount});case 19:if(t.sent!==et){t.next=22;break}return t.abrupt("return");case 22:t.next=15;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(13),r.e(t.t1);case 29:return t.prev=29,r.f(),t.finish(29);case 32:return t.abrupt("return",this._retry(e));case 33:if(!this._options.throwHttpErrors){t.next=35;break}throw t.t0;case 35:case"end":return t.stop()}}),t,this,[[0,6],[13,26,29,32]])}))),function(t){return s.apply(this,arguments)})},{key:"_fetch",value:(i=g(regeneratorRuntime.mark((function t(){var e,n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=x(this._options.hooks.beforeRequest),t.prev=1,e.s();case 3:if((n=e.n()).done){t.next=15;break}return r=n.value,t.next=7,r(this.request,this._options);case 7:if(!((i=t.sent)instanceof Request)){t.next=11;break}return this.request=i,t.abrupt("break",15);case 11:if(!(i instanceof Response)){t.next=13;break}return t.abrupt("return",i);case 13:t.next=3;break;case 15:t.next=20;break;case 17:t.prev=17,t.t0=t.catch(1),e.e(t.t0);case 20:return t.prev=20,e.f(),t.finish(20);case 23:if(!1!==this._options.timeout){t.next=25;break}return t.abrupt("return",P.fetch(this.request.clone()));case 25:return t.abrupt("return",st(P.fetch(this.request.clone()),this._options.timeout,this.abortController));case 26:case"end":return t.stop()}}),t,this,[[1,17,20,23]])}))),function(){return i.apply(this,arguments)})},{key:"_stream",value:function(t,e){var n=Number(t.headers.get("content-length"))||0,r=0;return new P.Response(new P.ReadableStream({start:function(i){var s=t.body.getReader();function o(){return a.apply(this,arguments)}function a(){return(a=g(regeneratorRuntime.mark((function t(){var a,c,u;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.read();case 2:if(a=t.sent,c=a.done,u=a.value,!c){t.next=8;break}return i.close(),t.abrupt("return");case 8:e&&(r+=u.byteLength,e({percent:0===n?0:r/n,transferredBytes:r,totalBytes:n},u)),i.enqueue(u),o();case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}e&&e({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array),o()}}))}}])&&v(e.prototype,n),r&&v(e,r),t}(),lt=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++){var s=i[r];if((!Y(s)||Array.isArray(s))&&void 0!==s)throw new TypeError("The `options` argument must be an object")}return Q.apply(void 0,[{}].concat(e))},ft=function t(e){var n,r=function(t,n){return new ut(t,lt(e,n))},i=x(K);try{var s=function(){var t=n.value;r[t]=function(n,r){return new ut(n,lt(e,r,{method:t}))}};for(i.s();!(n=i.n()).done;)s()}catch(t){i.e(t)}finally{i.f()}return r.HTTPError=nt,r.TimeoutError=rt,r.create=function(e){return t(lt(e))},r.extend=function(n){return t(lt(e,n))},r.stop=et,r}(),ht=function(t,e){return a(void 0,void 0,void 0,(function(){var n,r,i;return c(this,(function(s){switch(s.label){case 0:n={retry:f},s.label=1;case 1:return s.trys.push([1,4,,5]),[4,ft.get(t,n)];case 2:return r=s.sent(),[4,gt(r)];case 3:return[2,s.sent()];case 4:throw i=s.sent(),dt(i,e);case 5:return[2]}}))}))},pt=function(t,e,n,r){return a(void 0,void 0,void 0,(function(){var i,s,a;return c(this,(function(c){switch(c.label){case 0:i=o({json:e,retry:f},r),c.label=1;case 1:return c.trys.push([1,4,,5]),[4,ft.post(t,i)];case 2:return s=c.sent(),[4,gt(s)];case 3:return[2,c.sent()];case 4:throw a=c.sent(),dt(a,n);case 5:return[2]}}))}))},gt=function(t){return a(void 0,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return[4,vt(t)];case 1:return[2,{data:e.sent(),statusCode:t.status}]}}))}))},dt=function(t,e){return{errorMessage:e,statusCode:t.response.status}},vt=function(t){return a(void 0,void 0,void 0,(function(){var e,n;return c(this,(function(r){switch(r.label){case 0:return[4,t.json()];case 1:return e=r.sent(),[2,null!==(n=e.data)&&void 0!==n?n:e]}}))}))},yt=function(){function t(){this.controllerId="",this.jsonFileLanguage="",this.jsonFileVersion="latest",this.settingsId=""}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.resetInstance=function(){t.instance.controllerId="",t.instance.jsonFileLanguage="",t.instance.jsonFileVersion="latest",t.instance.settingsId=""},t.prototype.getControllerId=function(){return this.controllerId},t.prototype.getJsonFileLanguage=function(){return this.jsonFileLanguage},t.prototype.getJsonFileVersion=function(){return this.jsonFileVersion},t.prototype.getSettingsId=function(){return this.settingsId},t.prototype.setControllerId=function(t){this.controllerId=t},t.prototype.setJsonFileLanguage=function(t){this.jsonFileLanguage=t},t.prototype.setJsonFileVersion=function(t){this.jsonFileVersion=t},t.prototype.setSettingsId=function(t){this.settingsId=t},t.prototype.fetchAvailableLanguages=function(){return a(this,void 0,void 0,(function(){var t,n;return c(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=this.createLanguagesJsonUrl(),[4,ht(t,e.FETCH_AVAILABLE_LANGUAGES)];case 1:return[2,r.sent().data.languagesAvailable];case 2:throw 403===(n=r.sent()).statusCode&&(n.errorMessage=e.AVAILABLE_LANGUAGES_NOT_FOUND),n;case 3:return[2]}}))}))},t.prototype.fetchServicesJson=function(t){return a(this,void 0,void 0,(function(){var n;return c(this,(function(r){switch(r.label){case 0:return n=this.createServicesJsonUrl(t),[4,ht(n,e.FETCH_DATA_PROCESSING_SERVICES)];case 1:return[2,r.sent().data]}}))}))},t.prototype.fetchSettingsJson=function(){return a(this,void 0,void 0,(function(){var t,n;return c(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=this.createSettingsJsonUrl(),[4,ht(t,e.FETCH_SETTINGS)];case 1:return[2,r.sent().data];case 2:throw 403===(n=r.sent()).statusCode&&(n.errorMessage=e.SETTINGS_NOT_FOUND),n;case 3:return[2]}}))}))},t.prototype.fetchUserConsents=function(){return a(this,void 0,void 0,(function(){var t,r;return c(this,(function(i){switch(i.label){case 0:return t=this.createFetchUserConsentsQuery(),r=It(),[4,pt(n.FETCH_CONSENTS_GRAPHQL,t,e.FETCH_USER_CONSENTS,r)];case 1:return[2,i.sent().data.consents.reverse()]}}))}))},t.prototype.fetchUserCountry=function(){return a(this,void 0,void 0,(function(){var t,r;return c(this,(function(i){switch(i.label){case 0:return t=St(),r=It(),[4,pt(n.PUBLIC_GRAPHQL,t,e.FETCH_USER_COUNTRY,r)];case 1:return[2,i.sent().data.clientLocation]}}))}))},t.prototype.generateServicesJson=function(t){return a(this,void 0,void 0,(function(){var r;return c(this,(function(i){switch(i.label){case 0:return r={request:t},[4,pt(n.AGGREGATOR,r,e.GENERATE_DATA_PROCESSING_SERVICES)];case 1:return[2,i.sent().data.fileName]}}))}))},t.prototype.saveConsents=function(t){return a(this,void 0,void 0,(function(){var r,i;return c(this,(function(s){switch(s.label){case 0:return r=mt(t),i=It(),[4,pt(n.PUBLIC_GRAPHQL,r,e.SAVE_CONSENTS,i)];case 1:return[2,s.sent().data.saveConsents.data]}}))}))},t.prototype.createLanguagesJsonUrl=function(){return n.CDN+"/settings/"+this.settingsId+"/"+this.jsonFileVersion+"/languages.json"},t.prototype.createServicesJsonUrl=function(t){return n.CDN+"/consent-templates/"+t+".json"},t.prototype.createSettingsJsonUrl=function(){return n.CDN+"/settings/"+this.settingsId+"/"+this.jsonFileVersion+"/"+this.jsonFileLanguage+".json"},t.prototype.createFetchUserConsentsQuery=function(){return{query:"query consents($controllerId: String, $history: Boolean) { consents(controllerId: $controllerId, history: $history) { action settingsVersion status templateId timestamp updatedBy } }",variables:{controllerId:this.controllerId,history:!0}}},t}(),St=function(){return{query:"{ clientLocation { countryCode countryName } }"}},It=function(){return{credentials:"omit",headers:{Accept:"application/json","Access-Control-Allow-Origin":"*","X-Request-ID":r.v4()},mode:"cors"}},mt=function(t){return{query:"mutation saveConsents($consents: [NewCreateConsentInput]) { saveConsents(consents: $consents) { data { consentId } } }",variables:{consents:bt(t)}}},bt=function(t){return t.map((function(t){return{action:t.consent.action,appVersion:t.applicationVersion,consentStatus:t.consent.status?"1":"0",consentTemplateId:t.service.id,consentTemplateVersion:t.service.version,controllerId:t.settings.controllerId,language:t.settings.language,processorId:t.service.processorId,settingsId:t.settings.id,settingsVersion:t.settings.version,updatedBy:t.consent.type}}))};!function(t){t[t.FALSE=0]="FALSE",t[t.TRUE=1]="TRUE"}(j||(j={})),function(t){t[t.DATA_LAYER=0]="DATA_LAYER",t[t.WINDOW_EVENT=1]="WINDOW_EVENT"}(k||(k={})),function(t){t[t.MAJOR=0]="MAJOR",t[t.MINOR=1]="MINOR",t[t.PATCH=2]="PATCH"}(B||(B={})),function(t){t[t.FIRST_LAYER=1]="FIRST_LAYER",t[t.SECOND_LAYER=3]="SECOND_LAYER"}(V||(V={})),function(t){t[t.DATA_LAYER=1]="DATA_LAYER",t[t.WINDOW_EVENT=4]="WINDOW_EVENT"}(G||(G={})),function(t){t.DATA_COLLECTED_LIST="dataCollectedList",t.DATA_PURPOSES_LIST="dataPurposesList",t.DATA_RECIPIENTS_LIST="dataRecipientsList",t.TECHNOLOGY_USED="technologyUsed"}(H||(H={})),function(t){t.MAJOR="major",t.MINOR="minor",t.PATCH="patch"}(q||(q={})),(M=exports.FIRST_LAYER_VARIANT||(exports.FIRST_LAYER_VARIANT={}))[M.BANNER=0]="BANNER",M[M.WALL=1]="WALL",(W=exports.SECOND_LAYER_VARIANT||(exports.SECOND_LAYER_VARIANT={}))[W.CENTER=0]="CENTER",W[W.SIDE=1]="SIDE",(J=exports.THEME||(exports.THEME={}))[J.DARK=0]="DARK",J[J.LIGHT=1]="LIGHT";var Et,wt=function(t,e){return-1!==t.indexOf(e)},Ct=function(t){return Array.isArray(t)&&t.length>0},At=function(t){return"object"===h(t)&&null!==t&&Object.keys(t).length>0},_t=function(){function t(){this.dataLayerNames=[],this.windowEventNames=[]}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.resetInstance=function(){t.instance.dataLayerNames=[],t.instance.windowEventNames=[]},t.prototype.init=function(t){var e=this;t.forEach((function(t){var n,r;t.type===k.DATA_LAYER?e.dataLayerNames=null!==(n=t.names)&&void 0!==n?n:[]:t.type===k.WINDOW_EVENT&&(e.windowEventNames=null!==(r=t.names)&&void 0!==r?r:[])}))},t.prototype.dispatch=function(t){Ct(t)&&(this.pushEventsToDataLayer(t),this.dispatchWindowEvents(t))},t.prototype.pushEventsToDataLayer=function(t){if(Ct(this.dataLayerNames)){var e=Tt(t),n="explicit"===t[0].consent.type;this.dataLayerNames.forEach((function(r){var i;window[r]=null!==(i=window[r])&&void 0!==i?i:[],window[r].push(e),n&&t.forEach((function(t){t.consent.status||window[r].push({event:t.service.name+" EXPLICIT_DENY"})}))}))}},t.prototype.dispatchWindowEvents=function(t){if(Ct(this.windowEventNames)){var e=Tt(t);this.windowEventNames.forEach((function(t){var n=new window.CustomEvent(t,{detail:e});window.dispatchEvent(n)}))}},t}(),Tt=function(t){var e={event:"consent_status",type:t[0].consent.type};return t.forEach((function(t){var n;e=o(o({},e),((n={})[t.service.name]=t.consent.status,n))})),e};!function(t){t.TEXT_JAVASCRIPT="text/javascript",t.TEXT_PLAIN="text/plain"}(Et||(Et={}));var Lt,Rt=function(){function t(){}return t.enableScriptsForServicesWithConsent=function(e){var n=t.getDisabledScripts();Array.prototype.forEach.call(n,(function(n){t.disabledScriptHasConsent(e,n)&&t.enableScript(n)}))},t.getDisabledScripts=function(){return document.querySelectorAll('script[data-usercentrics][type="'+Et.TEXT_PLAIN+'"]')},t.disabledScriptHasConsent=function(t,e){return t.some((function(t){return t.name===e.getAttribute("data-usercentrics")}))},t.enableScript=function(e){var n,r,i,s=e.src?t.createSrcScriptTag(e):t.createInlineScriptTag(e);r=s,(i=(n=e).parentNode)&&i.replaceChild(r,n)},t.createSrcScriptTag=function(t){return o(o({},t),{type:Et.TEXT_JAVASCRIPT})},t.createInlineScriptTag=function(t){var e=document.createElement("script"),n=document.createTextNode(t.text);return e.appendChild(n),e.type=Et.TEXT_JAVASCRIPT,e},t}(),Nt=l((function(t,e){var n;t.exports=(n=n||function(t,e){var n=Object.create||function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}}(),r={},i=r.lib={},s=i.Base={extend:function(t){var e=n(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},o=i.WordArray=s.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||c).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,i=t.sigBytes;if(this.clamp(),r%4)for(var s=0;s<i;s++){var o=n[s>>>2]>>>24-s%4*8&255;e[r+s>>>2]|=o<<24-(r+s)%4*8}else for(s=0;s<i;s+=4)e[r+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=s.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var n,r=[],i=function(e){e=e;var n=987654321,r=4294967295;return function(){var i=((n=36969*(65535&n)+(n>>16)&r)<<16)+(e=18e3*(65535&e)+(e>>16)&r)&r;return i/=4294967296,(i+=.5)*(t.random()>.5?1:-1)}},s=0;s<e;s+=4){var a=i(4294967296*(n||t.random()));n=987654071*a(),r.push(4294967296*a()|0)}return new o.init(r,e)}}),a=r.enc={},c=a.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i++){var s=e[i>>>2]>>>24-i%4*8&255;r.push((s>>>4).toString(16)),r.push((15&s).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new o.init(n,e/2)}},u=a.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i++){var s=e[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(s))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r++)n[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new o.init(n,e)}},l=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(u.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return u.parse(unescape(encodeURIComponent(t)))}},f=i.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=l.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n=this._data,r=n.words,i=n.sigBytes,s=this.blockSize,a=i/(4*s),c=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*s,u=t.min(4*c,i);if(c){for(var l=0;l<c;l+=s)this._doProcessBlock(r,l);var f=r.splice(0,c);n.sigBytes-=u}return new o.init(f,u)},clone:function(){var t=s.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),h=(i.Hasher=f.extend({cfg:s.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new h.HMAC.init(t,n).finalize(e)}}}),r.algo={});return r}(Math),n)})),Ot=l((function(t,e){var n;t.exports=(n=Nt,function(t){var e=n,r=e.lib,i=r.WordArray,s=r.Hasher,o=e.algo,a=[],c=[];!function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(t){return 4294967296*(t-(0|t))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(a[i]=n(t.pow(r,.5))),c[i]=n(t.pow(r,1/3)),i++),r++}();var u=[],l=o.SHA256=s.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],s=n[2],o=n[3],a=n[4],l=n[5],f=n[6],h=n[7],p=0;p<64;p++){if(p<16)u[p]=0|t[e+p];else{var g=u[p-15],d=(g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3,v=u[p-2],y=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;u[p]=d+u[p-7]+y+u[p-16]}var S=r&i^r&s^i&s,I=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),m=h+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&f)+c[p]+u[p];h=f,f=l,l=a,a=o+m|0,o=s,s=i,i=r,r=m+(I+S)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+s|0,n[3]=n[3]+o|0,n[4]=n[4]+a|0,n[5]=n[5]+l|0,n[6]=n[6]+f|0,n[7]=n[7]+h|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=s.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=s._createHelper(l),e.HmacSHA256=s._createHmacHelper(l)}(Math),n.SHA256)})),xt=function(t,e){return{id:t.templateId,version:t.version,language:e.language}},Pt=function(){return""+Ot(r.v4())},Ut=function(t,e){var n={categorySlug:"none",description:"",isEssential:!1,isHidden:!0,label:""};return Array.prototype.concat(t.categories.map((function(n){return{description:n.description,isEssential:n.isEssential,isHidden:n.isHidden,label:n.label,services:Ft(t,e,n),slug:n.categorySlug}})),[o(o({},n),{services:Ft(t,e,n),slug:"none"})])},Ft=function(t,e,n){return t.consentTemplates.reduce((function(t,r){return r.categorySlug===n.categorySlug&&t.push(Dt(r,e,n)),t}),[])},Dt=function(t,e,n){return o(o({},Vt(t,e)),{categorySlug:t.categorySlug,consent:{history:[],status:jt(t,n)},isEssential:n.isEssential,isHidden:kt(t,n),processorId:Pt(),subServices:Bt(t.subConsents,e)})},jt=function(t,e){return!!e.isEssential||t.defaultConsentStatus},kt=function(t,e){return!!e.isHidden||t.isHidden},Bt=function(t,e){return t.reduce((function(t,n){return t.push(Vt(n,e)),t}),[])},Vt=function(t,e){var n=Gt(t,e);return{dataCollected:Ht(n,H.DATA_COLLECTED_LIST),dataDistribution:{processingLocation:n.locationOfProcessing,thirdPartyCountries:n.thirdCountryTransfer},dataPurposes:qt(n),dataRecipients:Ht(n,H.DATA_RECIPIENTS_LIST),description:Mt(t,n),id:t.templateId,language:{available:n.languagesAvailable,selected:n.language},legalBasis:Wt(n),name:Jt(n),processingCompany:{address:n.addressOfProcessingCompany,dataProtectionOfficer:n.dataProtectionOfficer,name:Yt(n)},retentionPeriodDescription:zt(n),technologiesUsed:Ht(n,H.TECHNOLOGY_USED),urls:{cookiePolicy:n.cookiePolicyURL,dataProcessingAgreement:n.linkToDpa,optOut:n.optOutUrl,privacyPolicy:$t(n)},version:t.version}},Gt=function(t,e){return e.find((function(e){return t.templateId===e.templateId&&t.version===e.version}))},Ht=function(t,e){var n;return Ct(t[e])?t[e]:(null===(n=t[e])||void 0===n?void 0:n.length)>0?[t[e]]:[]},qt=function(t){var e=Ht(t,H.DATA_PURPOSES_LIST);return Ct(e)?e:t.dataPurposes},Mt=function(t,e){return t.description||e.descriptionOfService||e.description},Wt=function(t){return Ct(t.legalBasisList)?t.legalBasisList:[t.legalGround]},Jt=function(t){return t.dataProcessor||t.dataProcessors[0]},Yt=function(t){return t.nameOfProcessingCompany||t.processingCompany},zt=function(t){return t.retentionPeriodDescription||t.retentionPeriodList[0]},$t=function(t){return t.privacyPolicyURL||t.policyOfProcessorUrl},Xt=function(t){return t.reduce((function(t,e){return e.type===G.DATA_LAYER?t.push({names:e.names,type:k.DATA_LAYER}):e.type===G.WINDOW_EVENT&&t.push({names:e.names,type:k.WINDOW_EVENT}),t}),[])},Qt=function(t){return t.map((function(t){switch(t){case q.MAJOR:return B.MAJOR;case q.MINOR:return B.MINOR;case q.PATCH:return B.PATCH}}))},Kt=function(t){var e=t.backgroundOverlay.find((function(t){return t.target[0]===V.FIRST_LAYER})),n=t.backgroundOverlay.find((function(t){return t.target[0]===V.SECOND_LAYER}));return{buttons:{acceptAll:{label:t.labels.btnAccept},denyAll:{isEnabled:t.btnDenyIsVisible,label:t.labels.btnDeny},save:{label:t.labels.btnSave},showSecondLayer:{isEnabled:t.btnMoreInfoIsVisible,label:t.labels.btnMoreInfo,url:t.moreInfoButtonUrl||null}},customization:{color:{primary:"#0045A5"},font:{family:"",size:14},theme:1},firstLayer:{description:{default:t.bannerMessage,short:t.bannerMobileDescriptionIsActive?t.bannerMobileDescription:null},isCategoryTogglesEnabled:!1,isOverlayEnabled:!!e&&(null==e?void 0:e.darken)>0,title:t.labels.titleCenterSecondary,variant:0},labels:{general:{consentGiven:"Consent given",consentNotGiven:"Consent not given",consentType:"Consent type",controllerId:"Controller ID",copy:t.labels.copy,date:t.labels.date,decision:"Decision",explicit:"Explicit",implicit:"Implicit",processorId:"Processor ID",showMore:"Show more"},service:{dataCollected:{description:t.labels.dataCollectedInfo,title:t.labels.dataCollectedList},dataDistribution:{processingLocationTitle:t.labels.locationOfProcessing,thirdPartyCountriesTitle:t.labels.transferToThirdCountries},dataPurposes:{description:t.labels.dataPurposesInfo,title:t.labels.dataPurposes},dataRecipientsTitle:t.labels.dataRecipientsList,descriptionTitle:t.labels.descriptionOfService,history:{description:null,title:t.labels.history},legalBasis:{description:t.labels.legalBasisInfo,title:t.labels.legalBasisList},processingCompanyTitle:t.labels.processingCompanyTitle,retentionPeriodTitle:t.labels.retentionPeriod,technologiesUsed:{description:t.labels.technologiesUsedInfo,title:t.labels.technologiesUsed},urls:{cookiePolicyTitle:t.labels.cookiePolicyInfo,dataProcessingAgreementTitle:t.labels.linkToDpaInfo,optOutTitle:t.labels.furtherInformationOptOut,privacyPolicyTitle:t.labels.policyOf}}},language:{available:t.languagesAvailable,isSelectorEnabled:t.showLanguageDropdown,selected:t.language},links:{cookiePolicy:{label:"",url:null},imprint:{label:t.labels.imprintLinkText||null,url:t.imprintUrl||null},privacyPolicy:{label:t.labels.privacyPolicyLinkText,url:t.privacyPolicyUrl||null}},poweredBy:{isEnabled:t.enablePoweredBy,label:"Powered by",partnerUrl:t.partnerPoweredByUrl||null,partnerUrlLabel:t.labels.partnerPoweredByLinkText||null,url:"https://www.usercentrics.com/",urlLabel:"Usercentrics Consent Management"},privacyButton:{isEnabled:t.privacyButtonIsVisible},secondLayer:{description:t.labels.headerCenterSecondary,isOverlayEnabled:!!n&&(null==n?void 0:n.darken)>0,tabs:{categories:{isEnabled:!0,label:t.labels.categories},services:{isEnabled:!0,label:"Services"}},title:t.labels.titleCenterSecondary,variant:0}}},Zt=["AT","BE","BG","CY","CZ","DE","DK","EE","ES","FI","FR","GR","HR","HU","IE","IT","LT","LU","LV","MT","NL","PL","PT","RO","SE","SI","SK"],te=function(){function t(){this.apiInstance=yt.getInstance(),this.userCountry={}}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.resetInstance=function(){t.instance.userCountry={}},t.prototype.getUserCountry=function(){return a(this,void 0,void 0,(function(){var t;return c(this,(function(e){switch(e.label){case 0:return At(this.userCountry)?[3,2]:[4,this.apiInstance.fetchUserCountry()];case 1:t=e.sent(),this.userCountry=ee(t),e.label=2;case 2:return[2,this.userCountry]}}))}))},t.prototype.getIsUserInEU=function(){return a(this,void 0,void 0,(function(){var t;return c(this,(function(e){switch(e.label){case 0:return[4,this.getUserCountry()];case 1:return t=e.sent(),[2,wt(Zt,t.code.toUpperCase())]}}))}))},t}(),ee=function(t){return{code:t.countryCode,name:t.countryName}},ne=function(){function t(){this.apiInstance=yt.getInstance(),this.locationInstance=te.getInstance(),this.settings={}}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.resetInstance=function(){t.instance.settings={}},t.prototype.getBaseSettings=function(){return{controllerId:this.settings.controllerId,id:this.settings.id,ui:this.settings.ui,version:this.settings.version}},t.prototype.getCategories=function(){return this.settings.categories},t.prototype.getCategoryBySlug=function(t){return this.getCategories().find((function(e){return e.slug===t}))},t.prototype.getDataExchangeSettings=function(){return this.settings.dataExchangeSettings},t.prototype.getEssentialCategories=function(){return this.getCategories().reduce((function(t,e){return e.isEssential&&t.push(e),t}),[])},t.prototype.getNonEssentialCategories=function(){return this.getCategories().reduce((function(t,e){return e.isEssential||t.push(e),t}),[])},t.prototype.getServices=function(){return this.getServicesFromCategories(this.getCategories())},t.prototype.getServicesByIds=function(t){return this.getServicesFromCategories(this.removeNoneCategory(this.getCategories())).reduce((function(e,n){return t.some((function(t){return t===n.id}))&&e.push(n),e}),[])},t.prototype.getServicesFromCategories=function(t){return t.reduce((function(t,e){return t.concat(e.services)}),[])},t.prototype.getServicesWithConsent=function(){return this.getServices().reduce((function(t,e){return e.consent.status&&t.push(e),t}),[])},t.prototype.getSettings=function(){return this.settings},t.prototype.setCategories=function(t){this.settings.categories=t},t.prototype.setSettings=function(t){this.settings=t},t.prototype.initSettings=function(){return a(this,void 0,void 0,(function(){var t,e;return c(this,(function(n){switch(n.label){case 0:return[4,this.apiInstance.fetchSettingsJson()];case 1:return t=n.sent(),t=o(o({},r=t),{consentTemplates:r.consentTemplates.reduce((function(t,e){return e.isDeactivated||t.push(e),t}),[])}),[4,this.fetchServices(t)];case 2:return e=n.sent(),this.setSettings(re(function(t,e){return{acceptAllImplicitlyOutsideEU:t.displayOnlyForEU,categories:Ut(t,e),controllerId:Pt(),dataExchangeSettings:Xt(t.dataExchangeOnPage),id:t.settingsId,showFirstLayerOnVersionChange:Qt(t.showInitialViewForVersionChange),ui:Kt(t),version:t.version}}(t,e))),[2]}var r}))}))},t.prototype.mergeServicesIntoExistingCategories=function(t){return this.getCategories().map((function(e){return o(o({},e),{services:e.services.map((function(e){var n=t.find((function(t){return t.id===e.id}));return null!=n?n:e}))})}))},t.prototype.removeNoneCategory=function(t){return t.reduce((function(t,e){return"none"!==e.slug&&t.push(e),t}),[])},t.prototype.shouldAcceptAllImplicitlyOnInit=function(){return a(this,void 0,void 0,(function(){return c(this,(function(t){return this.settings.acceptAllImplicitlyOutsideEU?[2,!this.locationInstance.getIsUserInEU()]:[2,!1]}))}))},t.prototype.shouldShowFirstLayerOnVersionChange=function(t){if(Ct(this.settings.showFirstLayerOnVersionChange)){var e=this.settings.version.split("."),n=t.split(".");return wt(this.settings.showFirstLayerOnVersionChange,B.MAJOR)&&e[0]!==n[0]||wt(this.settings.showFirstLayerOnVersionChange,B.MINOR)&&e[1]!==n[1]||wt(this.settings.showFirstLayerOnVersionChange,B.PATCH)&&e[2]!==n[2]}return!1},t.prototype.updateServicesWithConsent=function(t,e){return t.map((function(t){return t.isEssential?t:o(o({},t),{consent:o(o({},t.consent),{status:e===j.TRUE})})}))},t.prototype.updateServicesWithConsents=function(t,e){return t.reduce((function(t,n){var r;if(!n.isEssential){var i=e.find((function(t){return t.serviceId===n.id}));r=o(o({},n),{consent:o(o({},n.consent),{status:i.status})})}return t.push(null!=r?r:n),t}),[])},t.prototype.fetchServices=function(t){return a(this,void 0,void 0,(function(){var e,n,r;return c(this,(function(o){switch(o.label){case 0:c=[],(a=t).consentTemplates.forEach((function(t){c.push(xt(t,a)),t.subConsents.forEach((function(t){c.push(xt(t,a))}))})),e=i(s(c,(function(t,e){return t.id===e.id&&t.version===e.version})),"id"),n=function(t){return""+Ot(JSON.stringify(t))}(e),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.apiInstance.fetchServicesJson(n)];case 2:return[2,o.sent()];case 3:return o.sent(),[3,4];case 4:return[4,this.apiInstance.generateServicesJson(e)];case 5:return r=o.sent(),[2,this.apiInstance.fetchServicesJson(r)]}var a,c}))}))},t}(),re=function(t){return o(o({},t),{categories:t.categories.reduce((function(t,e){return Ct(e.services)&&t.push(e),t}),[])})};!function(t){t.SETTINGS="uc_settings",t.USER_INTERACTION="uc_user_interaction"}(Lt||(Lt={}));var ie,se=function(){function t(){}return t.clearOnNewSettingsId=function(e){e!==t.fetchSettingsId()&&t.clear()},t.fetchControllerId=function(){return t.fetchSettings().controllerId},t.fetchLanguage=function(){return t.fetchSettings().language},t.fetchSettings=function(){var t=localStorage.getItem(Lt.SETTINGS);return JSON.parse(null!=t?t:"{}")},t.fetchSettingsId=function(){return t.fetchSettings().id},t.fetchSettingsVersion=function(){return t.fetchSettings().version},t.fetchUserActionPerformed=function(){return null!==localStorage.getItem(Lt.USER_INTERACTION)},t.mapStorageSettings=function(t,e){return{controllerId:t.controllerId,id:t.id,language:t.ui.language.selected,services:oe(e),version:t.version}},t.saveSettings=function(t){localStorage.setItem(Lt.SETTINGS,JSON.stringify(t))},t.settingsExist=function(){return At(t.fetchSettings())},t.setUserActionPerformed=function(){localStorage.setItem(Lt.USER_INTERACTION,JSON.stringify(!0))},t.clear=function(){localStorage.removeItem(Lt.SETTINGS),localStorage.removeItem(Lt.USER_INTERACTION)},t}(),oe=function(t){return t.map((function(t){return{history:t.consent.history,id:t.id,processorId:t.processorId,status:t.consent.status}}))},ae=function(){function t(){this.apiInstance=yt.getInstance(),this.eventDispatcherInstance=_t.getInstance(),this.settingsInstance=ne.getInstance()}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.prototype.execute=function(t,e,n){return a(this,void 0,void 0,(function(){var r,i,s=this;return c(this,(function(o){switch(o.label){case 0:return r=t.map((function(t){return ce(s.settingsInstance.getSettings(),t,e,n)})),i=ue(t,r),[4,this.apiInstance.saveConsents(r)];case 1:return o.sent(),this.settingsInstance.setCategories(this.settingsInstance.mergeServicesIntoExistingCategories(i)),se.saveSettings(se.mapStorageSettings(this.settingsInstance.getSettings(),this.settingsInstance.getServices())),Rt.enableScriptsForServicesWithConsent(this.settingsInstance.getServicesWithConsent()),this.eventDispatcherInstance.dispatch(r),[2]}}))}))},t.prototype.getMergedServicesAndSettingsFromStorage=function(){var t=se.fetchSettings(),e=this.getMergedAndUpdatedEssentialServices(t),n=e.mergedEssentialServices,r=e.updatedEssentialServices,i=this.getMergedNonEssentialServices(t);return{mergedServices:n.concat(i),mergedSettings:o(o({},this.settingsInstance.getSettings()),{controllerId:t.controllerId}),updatedEssentialServices:r}},t.prototype.mergeSettingsFromStorage=function(){return a(this,void 0,void 0,(function(){var t,e,n,r,i,s,a,u=this;return c(this,(function(c){switch(c.label){case 0:return t=this.getMergedServicesAndSettingsFromStorage(),e=t.mergedServices,n=t.mergedSettings,r=t.updatedEssentialServices,Ct(r)?(i=r.map((function(t){return ce(n,t,"onEssentialChange","implicit")})),s=ue(e,i),[4,this.apiInstance.saveConsents(i)]):[3,2];case 1:return c.sent(),this.settingsInstance.setSettings(o(o({},n),{categories:this.settingsInstance.mergeServicesIntoExistingCategories(s)})),[3,3];case 2:this.settingsInstance.setSettings(o(o({},n),{categories:this.settingsInstance.mergeServicesIntoExistingCategories(e)})),c.label=3;case 3:return a=e.map((function(t){return ce(u.settingsInstance.getSettings(),t,"onInitialPageLoad","implicit")})),se.saveSettings(se.mapStorageSettings(n,e)),Rt.enableScriptsForServicesWithConsent(this.settingsInstance.getServicesWithConsent()),this.eventDispatcherInstance.dispatch(a),[2]}}))}))},t.prototype.getMergedAndUpdatedEssentialServices=function(t){var e=this.settingsInstance.getServicesFromCategories(this.settingsInstance.getEssentialCategories()),n=[];return{mergedEssentialServices:e.map((function(e){var r=t.services.find((function(t){return t.id===e.id}));if(r){var i=o(o({},e),{consent:o(o({},e.consent),{history:r.history,status:!0}),processorId:r.processorId});return r.status||n.push(i),i}return e})),updatedEssentialServices:n}},t.prototype.getMergedNonEssentialServices=function(t){return this.settingsInstance.getServicesFromCategories(this.settingsInstance.getNonEssentialCategories()).map((function(e){var n=t.services.find((function(t){return t.id===e.id}));return n?o(o({},e),{consent:o(o({},e.consent),{history:n.history,status:n.status}),processorId:n.processorId}):e}))},t.prototype.restoreUserSession=function(){return a(this,void 0,void 0,(function(){var t,e,n,r,i,s,a,u;return c(this,(function(c){switch(c.label){case 0:return this.apiInstance.getControllerId()?[4,this.apiInstance.fetchUserConsents()]:[3,3];case 1:return t=c.sent(),e=fe(t),Ct(e)?(n=[],r=this.settingsInstance.getServices(),i=o(o({},this.settingsInstance.getSettings()),{controllerId:this.apiInstance.getControllerId()}),s=[],e.forEach((function(t){var e=r.findIndex((function(e){return e.id===t.templateId}));if(e>-1){var a=r[e],c=o(o({},a),{consent:o(o({},a.consent),{status:t.status})}),u=s.findIndex((function(t){return t.id===a.id}));-1===u?s.push(c):s[u]=c,r[e]=c,n.push(ce(i,c,t.action,t.updatedBy,1e3*parseInt(t.timestamp,10)))}})),a=ue(r,n),u=s.map((function(t){return ce(i,t,"onSessionRestored","implicit")})),[4,this.apiInstance.saveConsents(u)]):[3,3];case 2:return c.sent(),se.saveSettings(se.mapStorageSettings(i,a)),se.setUserActionPerformed(),[3,3];case 3:return[2]}}))}))},t}(),ce=function(t,e,n,r,i){return{applicationVersion:"SDK-0.4.0",consent:{action:n,status:e.consent.status,type:r},service:{id:e.id,name:e.name,processorId:e.processorId,version:e.version},settings:{controllerId:t.controllerId,id:t.id,language:t.ui.language.selected,version:t.version},timestamp:null!=i?i:(new Date).valueOf()}},ue=function(t,e){return t.map((function(t){var n=e.filter((function(e){return e.service.id===t.id}));return Ct(n)?o(o({},t),{consent:o(o({},t.consent),{history:u(t.consent.history,n.map((function(t){return le(t)})))})}):t}))},le=function(t){return{action:t.consent.action,language:t.settings.language,status:t.consent.status,timestamp:t.timestamp,type:t.consent.type,versions:{application:t.applicationVersion,service:t.service.version,settings:t.settings.version}}},fe=function(t){return t.reduce((function(t,e){return"onSessionRestored"!==e.action&&t.push(e),t}),[])};!function(t){t.DEFAULT_BROWSER_LANGUAGE="Usercentrics: The language has been defaulted to the browser language.",t.DEFAULT_FIRST_AVAILABLE_LANGUAGE="Usercentrics: The language has been defaulted to the first available language."}(ie||(ie={}));var he,pe,ge,de=function(){function t(){this.apiInstance=yt.getInstance()}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.prototype.resolveLanguage=function(){return a(this,void 0,void 0,(function(){var t,e,n;return c(this,(function(r){switch(r.label){case 0:return[4,this.apiInstance.fetchAvailableLanguages()];case 1:return t=r.sent(),e=se.fetchLanguage(),wt(t,e)&&this.apiInstance.setJsonFileLanguage(e),wt(t,this.apiInstance.getJsonFileLanguage())?[2]:((n=ve(t))?(console.warn(ie.DEFAULT_BROWSER_LANGUAGE),this.apiInstance.setJsonFileLanguage(n)):(console.warn(ie.DEFAULT_FIRST_AVAILABLE_LANGUAGE),this.apiInstance.setJsonFileLanguage(t[0])),[2])}}))}))},t}(),ve=function(t){var e,n=window.navigator;if(Ct(n.languages))for(var r=0;r<n.languages.length;r+=1){var i=n.languages[r].slice(0,2);if(wt(t,i))return i}var s=(null!==(e=n.language)&&void 0!==e?e:n.userLanguage).slice(0,2);return wt(t,s)?s:null};(he=exports.CONSENT_ACTION||(exports.CONSENT_ACTION={})).ACCEPT_ALL_SERVICES="onAcceptAllServices",he.DENY_ALL_SERVICES="onDenyAllServices",he.ESSENTIAL_CHANGE="onEssentialChange",he.INITIAL_PAGE_LOAD="onInitialPageLoad",he.NON_EU_REGION="onNonEURegion",he.SESSION_RESTORED="onSessionRestored",he.UPDATE_SERVICES="onUpdateServices",(pe=exports.CONSENT_TYPE||(exports.CONSENT_TYPE={})).EXPLICIT="explicit",pe.IMPLICIT="implicit",(ge=exports.INITIAL_VIEW||(exports.INITIAL_VIEW={}))[ge.FIRST_LAYER=0]="FIRST_LAYER",ge[ge.NONE=1]="NONE",ge[ge.PRIVACY_BUTTON=2]="PRIVACY_BUTTON";var ye=function(){function t(t,e){this.apiInstance=yt.getInstance(),this.dataFacadeInstance=ae.getInstance(),this.eventDispatcherInstance=_t.getInstance(),this.languageInstance=de.getInstance(),this.locationInstance=te.getInstance(),this.settingsInstance=ne.getInstance(),this.apiInstance.setSettingsId(t),(null==e?void 0:e.controllerId)&&this.apiInstance.setControllerId(e.controllerId),(null==e?void 0:e.language)&&this.apiInstance.setJsonFileLanguage(e.language),(null==e?void 0:e.version)&&this.apiInstance.setJsonFileVersion(e.version)}return t.prototype.init=function(){return a(this,void 0,void 0,(function(){var t,e;return c(this,(function(n){switch(n.label){case 0:return se.clearOnNewSettingsId(this.apiInstance.getSettingsId()),[4,this.languageInstance.resolveLanguage()];case 1:return n.sent(),[4,this.settingsInstance.initSettings()];case 2:return n.sent(),this.eventDispatcherInstance.init(this.settingsInstance.getDataExchangeSettings()),[4,this.dataFacadeInstance.restoreUserSession()];case 3:return n.sent(),t=!se.settingsExist(),[4,this.settingsInstance.shouldAcceptAllImplicitlyOnInit()];case 4:return e=n.sent(),t?e?[4,this.dataFacadeInstance.execute(this.settingsInstance.updateServicesWithConsent(this.settingsInstance.getServices(),j.TRUE),"onNonEURegion","implicit")]:[3,6]:[3,9];case 5:return n.sent(),[3,8];case 6:return[4,this.dataFacadeInstance.execute(this.settingsInstance.getServices(),"onInitialPageLoad","implicit")];case 7:n.sent(),n.label=8;case 8:return[3,11];case 9:return[4,this.dataFacadeInstance.mergeSettingsFromStorage()];case 10:n.sent(),n.label=11;case 11:return[2,this.resolveInitialView(e,t)]}}))}))},t.prototype.acceptAllServices=function(t){return void 0===t&&(t="explicit"),a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return[4,this.dataFacadeInstance.execute(this.settingsInstance.updateServicesWithConsent(this.settingsInstance.getServices(),j.TRUE),"onAcceptAllServices",t)];case 1:return e.sent(),se.setUserActionPerformed(),[2]}}))}))},t.prototype.acceptAllServicesInCategory=function(t,e){return void 0===e&&(e="explicit"),a(this,void 0,void 0,(function(){var n;return c(this,(function(r){switch(r.label){case 0:return(n=this.settingsInstance.getCategoryBySlug(t))?[4,this.dataFacadeInstance.execute(this.settingsInstance.updateServicesWithConsent(n.services,j.TRUE),"onUpdateServices",e)]:[3,2];case 1:r.sent(),se.setUserActionPerformed(),r.label=2;case 2:return[2]}}))}))},t.prototype.changeLanguage=function(t){return a(this,void 0,void 0,(function(){var e,n,r;return c(this,(function(i){switch(i.label){case 0:return this.shouldChangeLanguage(t)?(this.apiInstance.setJsonFileLanguage(t),[4,this.settingsInstance.initSettings()]):[3,2];case 1:i.sent(),e=this.dataFacadeInstance.getMergedServicesAndSettingsFromStorage(),n=e.mergedServices,r=e.mergedSettings,this.settingsInstance.setSettings(o(o({},r),{categories:this.settingsInstance.mergeServicesIntoExistingCategories(n)})),se.saveSettings(se.mapStorageSettings(r,n)),i.label=2;case 2:return[2]}}))}))},t.prototype.denyAllServices=function(t){return void 0===t&&(t="explicit"),a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return[4,this.dataFacadeInstance.execute(this.settingsInstance.updateServicesWithConsent(this.settingsInstance.getServices(),j.FALSE),"onDenyAllServices",t)];case 1:return e.sent(),se.setUserActionPerformed(),[2]}}))}))},t.prototype.denyAllServicesInCategory=function(t,e){return void 0===e&&(e="explicit"),a(this,void 0,void 0,(function(){var n;return c(this,(function(r){switch(r.label){case 0:return(n=this.settingsInstance.getCategoryBySlug(t))?[4,this.dataFacadeInstance.execute(this.settingsInstance.updateServicesWithConsent(n.services,j.FALSE),"onUpdateServices",e)]:[3,2];case 1:r.sent(),se.setUserActionPerformed(),r.label=2;case 2:return[2]}}))}))},t.prototype.fetchIsUserInEU=function(){return a(this,void 0,void 0,(function(){return c(this,(function(t){return[2,this.locationInstance.getIsUserInEU()]}))}))},t.prototype.fetchUserCountry=function(){return a(this,void 0,void 0,(function(){return c(this,(function(t){return[2,this.locationInstance.getUserCountry()]}))}))},t.prototype.getCategories=function(){return this.settingsInstance.removeNoneCategory(this.settingsInstance.getCategories())},t.prototype.getControllerId=function(){return this.settingsInstance.getBaseSettings().controllerId},t.prototype.getEssentialCategories=function(){return this.settingsInstance.removeNoneCategory(this.settingsInstance.getEssentialCategories())},t.prototype.getEssentialServices=function(){return this.settingsInstance.getServicesFromCategories(this.getEssentialCategories())},t.prototype.getNonEssentialCategories=function(){return this.settingsInstance.removeNoneCategory(this.settingsInstance.getNonEssentialCategories())},t.prototype.getNonEssentialServices=function(){return this.settingsInstance.getServicesFromCategories(this.getNonEssentialCategories())},t.prototype.getServices=function(){return this.settingsInstance.getServicesFromCategories(this.getCategories())},t.prototype.getSettings=function(){return this.settingsInstance.getBaseSettings()},t.prototype.updateServices=function(t,e){return void 0===e&&(e="explicit"),a(this,void 0,void 0,(function(){var n,r;return c(this,(function(i){switch(i.label){case 0:return n=this.settingsInstance.getServicesByIds(t.map((function(t){return t.serviceId}))),r=this.settingsInstance.updateServicesWithConsents(n,t),Ct(r)?[4,this.dataFacadeInstance.execute(r,"onUpdateServices",e)]:[3,2];case 1:i.sent(),se.setUserActionPerformed(),i.label=2;case 2:return[2]}}))}))},t.prototype.resolveInitialView=function(t,e){return t?1:e||!se.fetchUserActionPerformed()||this.settingsInstance.shouldShowFirstLayerOnVersionChange(se.fetchSettingsVersion())?0:this.settingsInstance.getBaseSettings().ui.privacyButton.isEnabled?2:1},t.prototype.shouldChangeLanguage=function(t){return t!==this.apiInstance.getJsonFileLanguage()&&this.settingsInstance.getBaseSettings().ui.language.available.some((function(e){return t===e}))},t}();exports.Usercentrics=ye,exports.default=ye;

@@ -17,2 +17,3 @@ import { CONSENT_TYPE } from './services/DataFacade/enums';

export interface Options {
controllerId?: string;
/** Enforce a certain initial language for the user (default: user's browser language) */

@@ -94,2 +95,6 @@ language?: string;

/**
* Retrieve the controllerId, that's generated for the user.
*/
getControllerId(): string;
/**
* Retrieve the categories that are marked as essential and their services.

@@ -96,0 +101,0 @@ */

@@ -8,2 +8,3 @@ /** Used internally inside the SDK to define the action of a Consent */

NON_EU_REGION = "onNonEURegion",
SESSION_RESTORED = "onSessionRestored",
UPDATE_SERVICES = "onUpdateServices"

@@ -10,0 +11,0 @@ }

@@ -1,8 +0,11 @@

import { CONSENT_ACTION, CONSENT_TYPE } from '../enums';
import { Consent } from './interfaces.public';
export interface DataTransferObject {
consent: {
action: CONSENT_ACTION;
type: CONSENT_TYPE;
applicationVersion: string;
consent: Consent;
service: {
id: string;
name: string;
processorId: string;
version: string;
};
services: DataTransferObjectService[];
settings: {

@@ -14,9 +17,3 @@ controllerId: string;

};
timestamp: number;
}
export interface DataTransferObjectService {
id: string;
name: string;
processorId: string;
status: boolean;
version: string;
}
{
"name": "@usercentrics/cmp-browser-sdk",
"version": "0.3.11",
"version": "0.4.0",
"author": "Usercentrics GmbH",

@@ -35,3 +35,3 @@ "description": "Usercentrics CMP Browser SDK",

"@types/lodash": "^4.14.150",
"@types/uuid": "^7.0.2",
"@types/uuid": "^7.0.3",
"crypto-js": "3.3.0",

@@ -72,3 +72,3 @@ "ky": "^0.19.1",

"rimraf": "^3.0.2",
"rollup": "^2.7.1",
"rollup": "^2.7.2",
"rollup-plugin-babel": "^4.4.0",

@@ -79,3 +79,3 @@ "rollup-plugin-filesize": "^7.0.0",

"ts-jest": "^25.4.0",
"typedoc": "^0.17.4",
"typedoc": "^0.17.6",
"typedoc-neo-theme": "^1.0.8",

@@ -82,0 +82,0 @@ "typescript": "^3.8.3",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc