{"version":3,"file":"BN8igMFV.js","sources":["../../../../node_modules/js-cookie/dist/js.cookie.mjs","../../../../lib/gdpr-cookies.ts"],"sourcesContent":["/*! js-cookie v3.0.5 | MIT */\n/* eslint-disable no-var */\nfunction assign (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n target[key] = source[key];\n }\n }\n return target\n}\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\nvar defaultConverter = {\n read: function (value) {\n if (value[0] === '\"') {\n value = value.slice(1, -1);\n }\n return value.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent)\n },\n write: function (value) {\n return encodeURIComponent(value).replace(\n /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,\n decodeURIComponent\n )\n }\n};\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\n\nfunction init (converter, defaultAttributes) {\n function set (name, value, attributes) {\n if (typeof document === 'undefined') {\n return\n }\n\n attributes = assign({}, defaultAttributes, attributes);\n\n if (typeof attributes.expires === 'number') {\n attributes.expires = new Date(Date.now() + attributes.expires * 864e5);\n }\n if (attributes.expires) {\n attributes.expires = attributes.expires.toUTCString();\n }\n\n name = encodeURIComponent(name)\n .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)\n .replace(/[()]/g, escape);\n\n var stringifiedAttributes = '';\n for (var attributeName in attributes) {\n if (!attributes[attributeName]) {\n continue\n }\n\n stringifiedAttributes += '; ' + attributeName;\n\n if (attributes[attributeName] === true) {\n continue\n }\n\n // Considers RFC 6265 section 5.2:\n // ...\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n // character:\n // Consume the characters of the unparsed-attributes up to,\n // not including, the first %x3B (\";\") character.\n // ...\n stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n }\n\n return (document.cookie =\n name + '=' + converter.write(value, name) + stringifiedAttributes)\n }\n\n function get (name) {\n if (typeof document === 'undefined' || (arguments.length && !name)) {\n return\n }\n\n // To prevent the for loop in the first place assign an empty array\n // in case there are no cookies at all.\n var cookies = document.cookie ? document.cookie.split('; ') : [];\n var jar = {};\n for (var i = 0; i < cookies.length; i++) {\n var parts = cookies[i].split('=');\n var value = parts.slice(1).join('=');\n\n try {\n var found = decodeURIComponent(parts[0]);\n jar[found] = converter.read(value, found);\n\n if (name === found) {\n break\n }\n } catch (e) {}\n }\n\n return name ? jar[name] : jar\n }\n\n return Object.create(\n {\n set,\n get,\n remove: function (name, attributes) {\n set(\n name,\n '',\n assign({}, attributes, {\n expires: -1\n })\n );\n },\n withAttributes: function (attributes) {\n return init(this.converter, assign({}, this.attributes, attributes))\n },\n withConverter: function (converter) {\n return init(assign({}, this.converter, converter), this.attributes)\n }\n },\n {\n attributes: { value: Object.freeze(defaultAttributes) },\n converter: { value: Object.freeze(converter) }\n }\n )\n}\n\nvar api = init(defaultConverter, { path: '/' });\n/* eslint-enable no-var */\n\nexport { api as default };\n","// @ts-nocheck\r\nimport Cookies from 'js-cookie';\r\n\r\nfunction gtag() {\r\n // eslint-disable-next-line prefer-rest-params\r\n window.dataLayer.push(arguments);\r\n}\r\n\r\nexport const markConsentAndDate = (date: string) => {\r\n Cookies.set('cookies_consent', true.toString(), { expires: 365 });\r\n Cookies.set('cookies_consent_given', date, {\r\n expires: 365,\r\n });\r\n};\r\n\r\nexport type Storages =\r\n | 'analytics_storage'\r\n | 'ad_storage'\r\n | 'personalisation_storage'\r\n | 'ad_user_data'\r\n | 'ad_personalization';\r\n\r\nexport const setDefaultConsents = () => {\r\n /* eslint-disable camelcase */\r\n gtag('consent', 'default', {\r\n ad_storage: 'denied',\r\n analytics_storage: 'denied',\r\n personalisation_storage: 'denied',\r\n ad_user_data: 'denied',\r\n ad_personalization: 'denied',\r\n wait_for_update: 1_000,\r\n });\r\n /* eslint-enable camelcase */\r\n\r\n window.dataLayer.push({\r\n event: 'consent_default_set',\r\n });\r\n};\r\n\r\nexport const agreeToAll = () => {\r\n Cookies.set(`cookies_consent_ad_storage`, true.toString(), {\r\n expires: 365,\r\n });\r\n Cookies.set(`cookies_consent_analytics_storage`, true.toString(), {\r\n expires: 365,\r\n });\r\n\r\n /* eslint-disable camelcase */\r\n updateConsents({\r\n ad_storage: 'granted',\r\n analytics_storage: 'granted',\r\n ad_user_data: 'granted',\r\n ad_personalization: 'granted',\r\n personalisation_storage: 'granted',\r\n });\r\n /* eslint-enable camelcase */\r\n};\r\n\r\nexport const updateConsents = (consents: {\r\n ad_storage: 'granted' | 'denied';\r\n analytics_storage: 'granted' | 'denied';\r\n personalisation_storage: 'granted' | 'denied';\r\n ad_user_data: 'granted' | 'denied';\r\n ad_personalization: 'granted' | 'denied';\r\n}) => {\r\n gtag('consent', 'update', consents);\r\n\r\n window.dataLayer.push({\r\n event: 'consent_updated',\r\n });\r\n};\r\n"],"names":["assign","target","source","key","defaultConverter","value","init","converter","defaultAttributes","set","name","attributes","stringifiedAttributes","attributeName","get","cookies","jar","i","parts","found","api","gtag","markConsentAndDate","date","Cookies","setDefaultConsents","agreeToAll","updateConsents","consents"],"mappings":"AAAA,6BAEA,SAASA,EAAQC,EAAQ,CACvB,QAAS,EAAI,EAAG,EAAI,UAAU,OAAQ,IAAK,CACzC,IAAIC,EAAS,UAAU,CAAC,EACxB,QAASC,KAAOD,EACdD,EAAOE,CAAG,EAAID,EAAOC,CAAG,CAE3B,CACD,OAAOF,CACT,CAIA,IAAIG,EAAmB,CACrB,KAAM,SAAUC,EAAO,CACrB,OAAIA,EAAM,CAAC,IAAM,MACfA,EAAQA,EAAM,MAAM,EAAG,EAAE,GAEpBA,EAAM,QAAQ,mBAAoB,kBAAkB,CAC5D,EACD,MAAO,SAAUA,EAAO,CACtB,OAAO,mBAAmBA,CAAK,EAAE,QAC/B,2CACA,kBACD,CACF,CACH,EAKA,SAASC,EAAMC,EAAWC,EAAmB,CAC3C,SAASC,EAAKC,EAAML,EAAOM,EAAY,CACrC,GAAI,SAAO,SAAa,KAIxB,CAAAA,EAAaX,EAAO,CAAA,EAAIQ,EAAmBG,CA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