From 9a31bd7c2cb902828c2d56d3bcaca8a0a2dff76c Mon Sep 17 00:00:00 2001 From: Anna Lonka Date: Thu, 28 Nov 2024 13:17:08 +0200 Subject: [PATCH 1/2] UHF-11039: Updated hds cookie consent to use 4.0.0 version --- modules/hdbt_cookie_banner/README.md | 3 + .../assets/js/hdbt-cookie-banner.js | 12 +-- .../assets/js/hds-cookie-consent.min.js | 5 +- .../assets/json/siteSettings.schema.json | 64 +++++++------- .../assets/json/siteSettingsTemplate.json | 86 +++++++++---------- 5 files changed, 87 insertions(+), 83 deletions(-) diff --git a/modules/hdbt_cookie_banner/README.md b/modules/hdbt_cookie_banner/README.md index 2c174b039..e184d5fcb 100644 --- a/modules/hdbt_cookie_banner/README.md +++ b/modules/hdbt_cookie_banner/README.md @@ -14,3 +14,6 @@ Settings can be overridden by selecting the `Use instance specific cookie settin #### The cookie banner doesn’t appear, and the "Content cannot be displayed" message is shown on each YouTube, Map, or Chart paragraph. Check the browser console for a message such as `The hds-cookie-consent.min.js script is not loaded. Check the HDBT cookie banner configurations.`. If this message appears, it means the HDS cookie consent JavaScript file is not loaded. Verify that the Hel.fi Etusivu instance is up and running. If your site uses custom cookie settings, check the configurations at `/admin/structure/hdbt-cookie-banner`. + +## hds-cookie-consent.min.js changes +In the 4.0.0 version change the theme--dark stopped working. The style string in the current min.js file has been replaced by the older version string in order to keep the theme styles working. Style string can be found from this variable in the file `const o=document.createElement("style");o.textContent="..."`. diff --git a/modules/hdbt_cookie_banner/assets/js/hdbt-cookie-banner.js b/modules/hdbt_cookie_banner/assets/js/hdbt-cookie-banner.js index ed966a331..820c53244 100644 --- a/modules/hdbt_cookie_banner/assets/js/hdbt-cookie-banner.js +++ b/modules/hdbt_cookie_banner/assets/js/hdbt-cookie-banner.js @@ -9,7 +9,7 @@ }, loadFunction: (loadFunction) => { if (typeof loadFunction === 'function') { - document.addEventListener('hds_cookieConsent_ready', loadFunction); + document.addEventListener('hds-cookie-consent-ready', loadFunction); } }, getConsentStatus: (categories) => { @@ -67,12 +67,12 @@ window.addEventListener( 'hds-cookie-consent-unapproved-item-found', (e) => { - const { type, keys, consentedGroups } = e.detail + const { storageType, keys, acceptedGroups } = e.detail if (window.Sentry) { // Sentry requires a unique name for each error in order to record // each found unapproved item per type. - const name = `Unapproved ${type}` + const name = `Unapproved ${storageType}` const message = `Found: ${keys.join(', ')}` class UnapprovedItemError extends Error { @@ -87,12 +87,12 @@ window.Sentry.captureException(new UnapprovedItemError(message), { level: 'warning', tags: { - approvedCategories: consentedGroups.join(', '), + approvedCategories: acceptedGroups.join(', '), }, extra: { - type, + storageType, cookieNames: keys, - approvedCategories: consentedGroups, + approvedCategories: acceptedGroups, }, }) } else { diff --git a/modules/hdbt_cookie_banner/assets/js/hds-cookie-consent.min.js b/modules/hdbt_cookie_banner/assets/js/hds-cookie-consent.min.js index 0f6ff1a26..5e80ca117 100644 --- a/modules/hdbt_cookie_banner/assets/js/hds-cookie-consent.min.js +++ b/modules/hdbt_cookie_banner/assets/js/hds-cookie-consent.min.js @@ -1,8 +1,9 @@ -var hds=function(e){"use strict";function o(e,o,t,n,r,s){if("key"===t)return{value:o,fallback:!0,lang:t,dir:"ltr"};function i(e,o,t){return"string"==typeof o&&(o=o.split(".")),1===o.length&&void 0!==t?(e[o[0]]=t,t):0===o.length?e:i(e[o[0]],o.slice(1),t)}r||(r="en");const a=e=>n[e]||"ltr";let c={value:null,fallback:!1,lang:"en",dir:"ltr"};const l=!e[o],d=Array.isArray(e[o]),h="object"==typeof e[o]&&!d&&0===Object.keys(e[o]).length;if(l||h)c={value:o,fallback:!0,lang:"en",dir:"ltr"},console.error(`Cookie consent: Missing translation key: ${o}, falling back to key as translation`);else if("string"==typeof e[o])c={value:e[o],fallback:!1,lang:t,dir:a(t)};else{if("object"!=typeof e[o]||d)throw new Error(`Cookie consent: Invalid translation: ${o}, should be string, number or object`);if(e[o][t]&&""!==e[o][t])c={value:e[o][t],fallback:!1,lang:t,dir:a(t)};else if(e[o][r]&&""!==e[o][r])c={value:e[o][r],fallback:!0,lang:r,dir:a(r)},n[t]&&console.error(`Cookie consent: Missing translation: ${o}:${t}, using fallback language: ${r}`);else{const n=Object.keys(e[o])[0];c={value:e[o][n],fallback:!0,lang:n,dir:a(n)},console.error(`Cookie consent: Missing primary and fallback translation: ${o}:${t}/${r}, using first known language: ${n}`)}}if(c&&null!==c.value)return c.value=c.value.toString(),c.value=c.value.replace(/\$\{.+?\}/g,(e=>{const o=e.replace(/(^\$\{|\}$)/g,""),n=i(s,o);if("object"==typeof n){if(n[t])return n[t];if(n[r])return n[r];const e=Object.keys(n)[0];if(e)return n[e]}return n})),c;throw new Error(`Cookie consent: Missing translation: ${o}:${t}`)}const t={cookieConsentClass:"hds-cc",ariaLiveId:"hds-cc-aria-live",targetClass:"hds-cc__target",spacerId:"hds-cc__spacer",containerClass:"hds-cc__container",groupHighlightClass:"hds-cc__group--highlight",accordionButtonDetailsClass:"hds-cc__accordion-button--details"};function n(e,t,n,r){const s={};return e.forEach((e=>{s[e.key]=o(e.translations,e.key,t,n,r,e.parameters)})),s}function r(e){return e.fallback?`lang="${e.lang}" dir="${e.dir}"`:""}function s(e){const o=e?"hds-cc__notification_container":"hds-cc__aria-live-container";return`
`}function i(e,o,t="success"){let n,s;if("info"===t)n="hds-notification--info",s="hds-icon--info-circle-fill";else n="hds-notification--success",s="hds-icon--check-circle-fill";return`\n
\n
\n
\n \n
\n
${e.value}
\n
\n
`}function a(e,o,t,s,i,a){const c=n([{translations:t,key:"acceptedAt",parameters:e}],s,i,a);return e?`

${c.acceptedAt.value}

`:""} +var hds=function(e){"use strict";function o(e,o,t,r,n="en",i){if("key"===t)return{value:o,fallback:!0,lang:t,dir:"ltr"};function a(e,o,t){return"string"==typeof o&&(o=o.split(".")),1===o.length&&void 0!==t?(e[o[0]]=t,t):0===o.length?e:a(e[o[0]],o.slice(1),t)}const s=e=>r[e]||"ltr";let c={value:null,fallback:!1,lang:"en",dir:"ltr"};const l=!e[o],d=Array.isArray(e[o]),h="object"==typeof e[o]&&!d&&0===Object.keys(e[o]).length;if(l||h)c={value:o,fallback:!0,lang:"en",dir:"ltr"},console.error(`Cookie consent: Missing translation key: ${o}, falling back to key as translation`);else if("string"==typeof e[o])c={value:e[o],fallback:!1,lang:t,dir:s(t)};else{if("object"!=typeof e[o]||d)throw new Error(`Cookie consent: Invalid translation: ${o}, should be string, number or object`);if(e[o][t]&&""!==e[o][t])c={value:e[o][t],fallback:!1,lang:t,dir:s(t)};else if(e[o][n]&&""!==e[o][n])c={value:e[o][n],fallback:!0,lang:n,dir:s(n)},r[t]&&console.error(`Cookie consent: Missing translation: ${o}:${t}, using fallback language: ${n}`);else{const r=Object.keys(e[o])[0];c={value:e[o][r],fallback:!0,lang:r,dir:s(r)},console.error(`Cookie consent: Missing primary and fallback translation: ${o}:${t}/${n}, using first known language: ${r}`)}}if(c&&null!==c.value)return c.value=c.value.toString(),c.value=c.value.replace(/\{\{.+?\}\}/g,(e=>{const o=e.replace(/(^\{\{|\}\}$)/g,""),r=a(i,o);if("object"==typeof r){if(r[t])return r[t];if(r[n])return r[n];const e=Object.keys(r)[0];if(e)return r[e]}return r})),c;throw new Error(`Cookie consent: Missing translation: ${o}:${t}`)}const t={cookieConsentClass:"hds-cc",ariaLiveId:"hds-cc-aria-live",targetClass:"hds-cc__target",spacerId:"hds-cc__spacer",containerClass:"hds-cc__container",groupHighlightClass:"hds-cc__group--highlight",accordionButtonDetailsClass:"hds-cc__accordion-button--details"},r="\n border: 0;\n clip: rect(0, 0, 0, 0);\n clip-path: inset(50%);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;";function n(e,t,r,n){const i={};return e.forEach((e=>{i[e.key]=o(e.translations,e.key,t,r,n,e.parameters)})),i}function i(e){return e.fallback?`lang="${e.lang}" dir="${e.dir}"`:""}function a(e){const o=e?"hds-cc__notification_container":"",n=e?"":r;return`
`}function s(e,o,t="success"){let r,n;if("info"===t)r="hds-notification--info",n="hds-icon--info-circle-fill";else r="hds-notification--success",n="hds-icon--check-circle-fill";return`\n
\n
\n
\n \n
\n
${e.value}
\n
\n
`}function c(e,o,t,r,a,s){const c=n([{translations:t,key:"acceptedAt",parameters:e}],r,a,s);return e?`

${c.acceptedAt.value}

`:""} /*! * cookie * Copyright(c) 2012-2014 Roman Shtylman * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ -var c=function(e,o){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var t={},n=o||{},r=e.split(";"),s=n.decode||d,i=0;i""!==e&&!this.#s(e,o)));r.length>0&&r.forEach((o=>{if(!this.#r[e].includes(o))if(console.log(`Cookie consent: will delete ${n} ${e}(s): '${r.join("', '")}'`),"cookie"===e)(e=>{function o(e){const o=`; ${document.cookie}`.split(`; ${e}=`);return 2===o.length?o.pop().split(";").shift():null}function t(e,o,t){const n={expires:new Date(0),path:o,domain:t},r=l(e,"",n);document.cookie=r}const{hostname:n,pathname:r}=window.location;if(null!==o(e)&&(t(e,"/",void 0),null!==o(e))){const s=n.split(".");for(;s.length>1;){const n=`${s.join(".")}`,i=r.split("/");let a="";i.forEach(((r,s)=>{(r||0===s)&&(a+=r+(s{console.log(`Cookie consent: IndexedDB database '${o}' deleted successfully.`),this.#r.indexedDB=this.#r.indexedDB.filter((e=>e!==o))},e.onerror=()=>{console.warn(`Cookie consent: Error deleting IndexedDB database '${o}'`),this.#r.indexedDB.push(o)},e.onblocked=()=>{console.error(`Cookie consent: IndexedDB database '${o}' deletion blocked.`),this.#r.indexedDB.push(o)}}else"cacheStorage"===e&&caches.delete(o).then((e=>{e?console.log(`Cookie consent: Cache '${o}' has been deleted`):console.log(`Cookie consent: Cache '${o}' not found`)}))}))}#a(){return document.cookie.split(";").map((e=>e.split("=")[0].trim()))}#i(e){try{if(!e)return!1;const o=c(document.cookie)[e];return!!o&&JSON.parse(o)}catch(e){return console.error(`Cookie parsing unsuccessful:\n${e}`),!1}}async#c(){if(indexedDB&&indexedDB.databases){return(await indexedDB.databases()).map((e=>e.name))}return[]}async#l(){if("caches"in window){return await caches.keys()}return[]}#s(e,o){if(!Array.isArray(o)||0===o.length)return!1;if(o.includes(e))return!0;return o.filter((e=>e.includes("*"))).map((e=>new RegExp(`^${e.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*")}$`))).some((o=>o.test(e)))}#d(e,o,t,n,r){const s=n.filter((e=>""!==e&&!t.includes(e)&&!this.#s(e,o)));if(s.length>0){console.log(`Cookie consent: found unapproved ${e}(s): '${s.join("', '")}'`);const o=new CustomEvent("hds-cookie-consent-unapproved-item-found",{detail:{type:e,keys:s,consentedGroups:r}});window.dispatchEvent(o),t.push(...s)}this.#o&&this.deleteKeys(e,o,n,"unapproved")}async getCurrentKeys(e){switch(e){case"cookie":return this.#a();case"localStorage":return Object.keys(localStorage);case"sessionStorage":return Object.keys(sessionStorage);case"indexedDB":return this.#c();case"cacheStorage":return this.#l();default:return[]}}async#h(){this.BROWSER_STORAGES.forEach((async e=>{const o=this.#t.getConsentedGroupNames(),t=this.#t.getAllKeysInConsentedGroups();this.#d(e,t[e],this.#n[e],await this.getCurrentKeys(e),o)}))}#u(){this.#h(),setInterval((()=>{this.#h()}),this.#e)}init(e,o=0,t=!1){this.#t=e,this.#e=Math.max(o,50),this.#o=t,o>0&&this.#u()}}class g{#b=100;#p;#g;#m;#f;#v="city-of-helsinki-cookie-consents";#k;constructor({siteSettingsObj:e,lang:o,shadowDomUpdateCallback:t}){this.#g=e,this.#m=o,this.#p=e=>{t(e,this.#k)},this.#v=this.#g.cookieName||this.#v,this.#_()}setFormReference(e){this.#k=e}getConsentStatus(e){if(!Array.isArray(e)||0===e.length)return console.error("Cookie consent: Group names must be provided as an non-empty array."),!1;const o=this.getCookie();return!(!o||!o.groups)&&e.every((e=>!!o.groups[e]))}async setGroupsStatusToAccepted(e){if(!Array.isArray(e))return console.error("Cookie consent: Accepted groups must be provided as an array to setGroupsStatusToAccepted function."),!1;const o=this.getCookie(),t=!o||o.showBanner||!1;let n=[];o&&(n=Object.keys(o.groups));const r=[...this.#g.requiredGroups,...this.#g.optionalGroups];await Promise.all(r.map((async e=>{const{...o}=e;delete o.checksum,e.checksum=await this.#y(o)})));const s=this.#g.groupsWhitelistedForApi||[],i=e.filter((e=>!s.includes(e)));if(i.length>0)return console.error(`Cookie consent: The group(s) "${i.join('", "')}" not found in groupsWhitelistedForApi: "${s.join('", "')}".`),!1;const a=e.filter((e=>!r.some((o=>o.groupId===e))));if(a.length>0)return console.error(`Cookie consent: The group(s) "${a.join('", "')}" not found in required or optional groups in site settings.`),!1;const c=[...new Set([...n,...e])];return this.saveConsentedGroups(c,t),!0}getCookie(e=void 0){try{let o;if(this&&this.#v&&!e)o=this.#v;else if(!e)return!1;const t=c(document.cookie)[o];return!!t&&JSON.parse(t)}catch(e){return console.error(`Cookie parsing unsuccessful:\n${e}`),!1}}getAllKeysInConsentedGroups(e=null){let o=e;o||(o=this.getConsentedGroupNames());const t={};return t.cookie=this.#x(o,1),t.cookie.includes(this.#v)||t.cookie.push(this.#v),t.localStorage=this.#x(o,2),t.sessionStorage=this.#x(o,3),t.indexedDB=this.#x(o,4),t.cacheStorage=this.#x(o,5),t}#w(e){return{date:new Date(e).toLocaleDateString("fi-FI"),time:new Date(e).toLocaleTimeString("fi-FI",{hour:"numeric",minute:"numeric"})}}timestampElementHandler(e){if(!this.#k)return;const o=this.#k.querySelectorAll("div[data-timestamp]"),t=this.getCookie();let n=[];t&&t.groups&&(n=t.groups),o.forEach((o=>{const t=o.dataset.timestamp;let r;if(e.includes(t)){let e;const o=n[t];e=o?o.timestamp:Date.now(),r=a(this.#w(e),t,this.#g.translations,this.#m,this.#f,this.#g.fallbackLanguage)}else r="";o.innerHTML=r}))}saveConsentedGroups(e=[],o=!1){const t={},n=[...this.getRequiredGroupNames(),...e],{groups:r}=this.getCookie();[...this.#g.requiredGroups,...this.#g.optionalGroups].forEach((e=>{if(n.includes(e.groupId)){const o=r?.[e.groupId]?.timestamp;t[e.groupId]={checksum:e.checksum,timestamp:o||Date.now()}}}));const s={groups:t,...o&&{showBanner:!0}};this.#C(s),this.timestampElementHandler(e),this.#p(e)}removeConsentWithdrawnCookiesBeforeSave(e,o){const t=this.getAllKeysInConsentedGroups(e);o.BROWSER_STORAGES.forEach((async e=>{const n=await o.getCurrentKeys(e);o.deleteKeys(e,t[e],n,"consent withdrawn")}))}getRequiredGroupNames(){return this.#g.requiredGroups.map((e=>e.groupId))}async#y(e,o=8){let t=e;"string"!=typeof e&&(t=JSON.stringify(e));const n=(new TextEncoder).encode(t),r=await crypto.subtle.digest("SHA-1",n);return Array.from(new Uint8Array(r)).map((e=>e.toString(16).padStart(2,"0"))).join("").substring(0,o)}getConsentedGroupNames(){let e=[];const o=this.getCookie();o&&o.groups&&(e=Object.keys(o.groups));const t=this.getRequiredGroupNames();return e=[...new Set([...t,...e])],e}#C(e){const o=new Date;o.setDate(o.getDate()+this.#b),document.cookie=l(this.#v,JSON.stringify(e),{sameSite:"strict",expires:o,path:"/"})}#x(e,o){const t=new Set;this.#g.robotCookies?.forEach((e=>{e.type===o&&t.add(e.name)}));return[...this.#g.requiredGroups,...this.#g.optionalGroups].forEach((n=>{e.includes(n.groupId)&&n.cookies.forEach((e=>{e.type===o&&t.add(e.name)}))})),Array.from(t)}async#S(){const e=this.getCookie(),o=[...this.#g.requiredGroups,...this.#g.optionalGroups];await Promise.all(o.map((async e=>{e.checksum=await this.#y(e)})));let t=!1;const n=[],r={};if(o.forEach((e=>{r[e.groupId]=e.checksum})),e.groups&&Object.keys(e.groups).forEach((o=>{const s=e.groups[o];r[o]&&r[o]===s.checksum?n.push(o):(t=!0,console.info(`Invalid group found in browser cookie: '${o}', removing from cookie.`))})),t){const e=!0;this.saveConsentedGroups(n,e)}}#_(){if(0===this.#g.requiredGroups.length)throw new Error(`Cookie consent: At least one required group is needed to store consent in '${this.#v}'.`);if(!this.#g.requiredGroups.find((e=>e.cookies.some((e=>e.name===this.#v&&1===e.type)))))throw new Error(`Cookie consent: No group found in requiredGroups that contains cookie '${this.#v}'.`);const e=[...this.#g.requiredGroups,...this.#g.optionalGroups],o=new Set,t=new Set;if(e.forEach((e=>{o.has(e.groupId)&&t.add(e.groupId),o.add(e.groupId)})),t.size>0)throw new Error(`Cookie consent: Groups '${Array.from(t).join(", ")}' found multiple times in settings.`)}async init(){return await this.#S(),this.#f=this.#g.languages.reduce(((e,o)=>(e[o.code]=o.direction,e)),{}),{siteSettings:this.#g,directions:this.#f}}}const m=Symbol("private");class f{#E;#$;#z;#A;#L;#H=!1;#D;#d;#I;#g;#f;#O=null;#G={bannerContainer:null,spacer:null,ariaLive:null};#T=null;#R={resizeObserver:null,bannerHeightElement:null};constructor(e,{language:o="en",theme:t="bus",targetSelector:n="body",spacerParentSelector:r="body",pageContentSelector:s="body",submitEvent:i=!1,settingsPageSelector:a=null},c=!1){if(c!==m)throw new Error("Cookie consent: direct construction not allowed. Use `await CookieConsentCore.create()` instead.");this.#E=o,this.#$=t,this.#z=n,this.#A=r,this.#L=s,this.#H=i,this.#D=a,f.addToHdsScope("cookieConsent",this);this.#I=new g({siteSettingsObj:e,lang:o,shadowDomUpdateCallback:(e,o)=>{if(o){o.querySelectorAll("input").forEach((o=>{o.checked=e.includes(o.dataset.group)}))}}}),this.#d=new p}static addToHdsScope(e,o){window.hds||(window.hds={}),window.hds[e]=o}static async create(e,o){let t;if(!e&&("string"!=typeof e||"object"!=typeof e))throw new Error("Cookie consent: siteSettingsParam is required, it should be an URL string or an siteSettings object.");if("string"==typeof e){const n=await fetch(e).then((o=>{if(!o.ok)throw new Error(`Cookie consent: Unable to fetch cookie consent settings: '${o.status}' from: '${e}' `);return o.text()}));let r;try{r=JSON.parse(n)}catch(e){throw new Error(`Cookie consent: siteSettings JSON parsing failed: ${e}`)}t=new f(r,o,m)}else t=new f(e,o,m);await t.#B();const n=new Event("hds_cookieConsent_ready");return document.dispatchEvent(n),t}getConsentStatus(e){return this.#I.getConsentStatus(e)}async setGroupsStatusToAccepted(e){return this.#I.setGroupsStatusToAccepted(e)}async openBanner(e=[]){this.#D&&document.querySelector(this.#D)?console.error("Cookie consent: The user is already on settings page"):(this.#N(),await this.#q(this.#E,this.#g,!0,null,e))}#N(){this.#R.resizeObserver&&this.#R.bannerHeightElement&&this.#R.resizeObserver.unobserve(this.#R.bannerHeightElement),this.#G.bannerContainer&&(this.#G.bannerContainer.remove(),this.#G.bannerContainer=null),this.#G.spacer&&(this.#G.spacer.remove(),this.#G.spacer=null),this.#G.ariaLive&&(this.#G.ariaLive.remove(),this.#G.ariaLive=null),document.documentElement.style.removeProperty("--hds-cookie-consent-height")}#j(e,o=!1){const t=[];return e.querySelectorAll("input[data-group]").forEach((e=>{(e.checked||o)&&t.push(e.dataset.group)})),t}#M(e,o){let t=[];switch(e){case"required":t=this.#I.getRequiredGroupNames(),this.#I.removeConsentWithdrawnCookiesBeforeSave(t,this.#d),this.#I.saveConsentedGroups(t,!1);break;case"all":t=this.#j(o,!0),this.#I.saveConsentedGroups(t,!1);break;case"selected":t=this.#j(o),this.#I.removeConsentWithdrawnCookiesBeforeSave(t,this.#d),this.#I.saveConsentedGroups(t,!1)}if(this.#H){if(window.dispatchEvent(new CustomEvent(this.#H,{detail:{acceptedGroups:t}})),!this.#T)return this.#K(),void this.#N();this.#K()}else window.location.reload()}#P(){if(!this.#G.ariaLive){const e=this.#O.getElementById(t.ariaLiveId);this.#G.ariaLive=e}}#K(){this.#G.ariaLive||this.#P();const e=o(this.#g.translations,"settingsSaved",this.#E,this.#f,this.#g.fallbackLanguage),t=o(this.#g.translations,"notificationAriaLabel",this.#E,this.#f,this.#g.fallbackLanguage);if(this.#T){const o=i(e,t,"success");this.#G.ariaLive.innerHTML=o}else this.#G.ariaLive.textContent=e.value;setTimeout((()=>{if(this.#G.ariaLive)if(this.#G.bannerContainer){const e=this.#G.ariaLive.querySelector(".hds-notification");e?(e.classList.remove("enter"),e.classList.add("exit"),e.addEventListener("animationend",(()=>{e.remove(),this.#G.ariaLive=null}))):(this.#G.ariaLive.innerHTML="",this.#G.ariaLive=null)}else if(this.#T){const e=this.#G.ariaLive.querySelector(".hds-notification");e?(e.classList.remove("enter"),e.classList.add("exit"),e.addEventListener("animationend",(()=>{e.remove(),this.#G.ariaLive=null}))):(this.#G.ariaLive.innerHTML="",this.#G.ariaLive=null)}else this.#G.ariaLive.remove(),this.#G.ariaLive=null}),5e3)}#F(){const e=this.#I.getCookie();return!e||e.showBanner}#w(e){return{date:new Date(e).toLocaleDateString("fi-FI"),time:new Date(e).toLocaleTimeString("fi-FI",{hour:"numeric",minute:"numeric"})}}#U(e,o,t,s,c){let l="";const d=Object.keys(c);return e.forEach((e=>{const h=d.includes(e.groupId);let u=!1;h&&(u=this.#w(c[e.groupId].timestamp));let b="";e.cookies.forEach((e=>{b+=function(e,o,t,s,i){const a=`type_${e.type}`,c=n([{translations:e,key:"name"},{translations:e,key:"host"},{translations:e,key:"description"},{translations:e,key:"expiration"},{translations:o,key:a}],t,s,i);return`\n \n ${c.name.value}\n ${c.host.value}\n ${c.description.value}\n ${c.expiration.value}\n ${c[a].value}\n \n `}(e,t,o,this.#f,this.#g.fallbackLanguage)})),l+=function(e,o,t,s,c,l,d,h,u,b){const p=h?" checked disabled":"",g=u?"checked":"",m=n([{translations:e,key:"title"},{translations:e,key:"description"},{translations:o,key:"highlightedGroup"},{translations:o,key:"showCookieSettings"},{translations:o,key:"hideCookieSettings"},{translations:o,key:"tableHeadingsName"},{translations:o,key:"tableHeadingsHostName"},{translations:o,key:"tableHeadingsDescription"},{translations:o,key:"tableHeadingsExpiration"},{translations:o,key:"tableHeadingsType"}],t,s,c);return Object.assign(m,n([{translations:o,key:"highlightedGroupAria",parameters:{title:m.title.value}}],t,s,c)),`\n
\n
\n \n \n
\n ${i(m.highlightedGroup,m.highlightedGroupAria,"info")}\n

${m.description.value}

\n
\n ${a(b,l,o,t,s,c)}\n
\n\n
\n `}(e,t,o,this.#f,this.#g.fallbackLanguage,e.groupId,b,s,h,u)})),l}async#V(e){const o=document.createElement("style");o.textContent=":host{--container-width-xl:1200px;--color-bus:#0000bf;--color-bus-light:#f0f0ff;--color-bus-dark:#00005e;--color-coat-of-arms:#0072c6;--color-coat-of-arms-light:#e6f4ff;--color-coat-of-arms-dark:#005799;--color-silver:#dedfe1;--color-focus-outline:#0072c6;--color-black:#000;--color-white:#fff;--color-black-5:#f2f2f2;--color-black-10:#e6e6e6;--color-black-20:#ccc;--color-black-40:#999;--color-black-50:grey;--color-black-60:#666;--color-black-80:#333;--color-black-90:#1a1a1a;--color-error:#b01038;--color-error-light:#f6e2e6;--color-error-dark:#8d0d2d;--color-success:#007a64;--color-success-light:#e2f5f3;--color-success-dark:#006250;--color-info:#0062b9;--color-info-light:#e5eff8;--spacing-layout-2-xs:1rem;--spacing-layout-xs:1.5rem;--spacing-layout-s:2rem;--spacing-layout-m:3rem;--spacing-layout-l:4rem;--spacing-3-xs:0.25rem;--spacing-2-xs:0.5rem;--spacing-xs:0.75rem;--spacing-s:1rem;--spacing-m:1.5rem;--fontsize-heading-xxs:1rem;--fontsize-body-s:0.875rem;--fontsize-body-m:1rem;--fontsize-body-l:1.125rem;--font-default:helsinkigrotesk,arial,sans-serif;--lineheight-s:1;--lineheight-m:1.2;--lineheight-l:1.5}.hds-icon--angle-down{-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 13.5l5-5 1.5 1.5-6.5 6.5L5.5 10 7 8.5l5 5z' fill='currentColor'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 13.5l5-5 1.5 1.5-6.5 6.5L5.5 10 7 8.5l5 5z' fill='currentColor'/%3E%3C/svg%3E\")}.hds-icon--check-circle-fill{-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 3a9 9 0 100 18 9 9 0 000-18zm4.5 5L18 9.5 10.5 17 6 12.5 7.5 11l3 3 6-6z' fill='currentColor'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 3a9 9 0 100 18 9 9 0 000-18zm4.5 5L18 9.5 10.5 17 6 12.5 7.5 11l3 3 6-6z' fill='currentColor'/%3E%3C/svg%3E\")}.hds-icon--info-circle-fill{-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 3a9 9 0 100 18 9 9 0 000-18zm1 7v6.5h2V18H9v-1.5h2v-5H9V10h4zm-1.188-4a1.312 1.312 0 110 2.625 1.312 1.312 0 010-2.625z' fill='currentColor'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 3a9 9 0 100 18 9 9 0 000-18zm1 7v6.5h2V18H9v-1.5h2v-5H9V10h4zm-1.188-4a1.312 1.312 0 110 2.625 1.312 1.312 0 010-2.625z' fill='currentColor'/%3E%3C/svg%3E\")}.hds-button{--border-width:2px;--color:inherit;--min-size:44px;--outline-gutter:2px;--outline-width:3px;align-content:flex-start;align-items:center;background-color:var(--background-color,transparent);border:var(--border-width) solid var(--border-color,transparent);border-radius:0;color:var(--color);cursor:pointer;display:inline-flex;font-family:inherit;font-size:100%;font-weight:500;justify-content:center;line-height:1.15;margin:0;min-height:var(--min-size);min-width:var(--min-size);padding:0 var(--spacing-2-xs);position:relative;text-decoration:none;text-transform:none;vertical-align:top}.hds-button,.hds-button *,.hds-button:after,.hds-button :after,.hds-button:before,.hds-button :before{box-sizing:border-box}.hds-button[type=button],.hds-button[type=reset],.hds-button[type=submit],button.hds-button{-webkit-appearance:button}.hds-button:-moz-focus-inner,.hds-button[type=button]:-moz-focus-inner,.hds-button[type=reset]:-moz-focus-inner,.hds-button[type=submit]:-moz-focus-inner{border-style:none;padding:0}.hds-button:-moz-focusring,.hds-button[type=button]:-moz-focusring,.hds-button[type=reset]:-moz-focusring,.hds-button[type=submit]:-moz-focusring{outline:1px dotted ButtonText}.hds-button.focus-visible,.hds-button:focus-visible,.hds-button:hover{transition-duration:85ms;transition-property:background-color,border-color,color;transition-timing-function:ease-out}.hds-button:hover{background-color:var(--background-color-hover,transparent);color:var(--color-hover)}.hds-button.focus-visible,.hds-button:active,.hds-button:focus-visible{background-color:var(--background-color-focus,transparent);color:var(--color-focus);outline:none}.hds-button:not(:disabled){border-color:var(--border-color,transparent)}.hds-button:disabled{background-color:var(--background-color-disabled,transparent);border-color:var(--border-color-disabled,transparent);color:var(--color-disabled);cursor:not-allowed}.hds-button.focus-visible:hover,.hds-button:active:hover,.hds-button:focus-visible:hover{background-color:var(--background-color-hover-focus,transparent)}.hds-button:not(:disabled):hover{border-color:var(--border-color-hover,transparent)}.hds-button:not(:disabled).focus-visible,.hds-button:not(:disabled):active,.hds-button:not(:disabled):focus-visible{border-color:var(--border-color-focus,transparent)}.hds-button:not(:disabled).focus-visible:hover,.hds-button:not(:disabled):active:hover,.hds-button:not(:disabled):focus-visible:hover{border-color:var(--border-color-hover-focus,transparent);color:var(--color-hover-focus)}.hds-button:after{--size:100%;border:var(--outline-width) solid transparent;content:\"\";height:var(--size);position:absolute;width:var(--size)}.hds-button.focus-visible:after,.hds-button:active:after,.hds-button:focus-visible:after{--size:calc(100% + calc(var(--outline-width) * 2 + var(--border-width) * 2 + var(--outline-gutter) * 2));border-color:var(--focus-outline-color)}.hds-button__label,input[type=button].hds-button,input[type=reset].hds-button,input[type=submit].hds-button{font-weight:inherit;line-height:1.25em;padding:var(--spacing-s)}input[type=button].hds-button,input[type=reset].hds-button,input[type=submit].hds-button{cursor:pointer;padding:var(--spacing-s) var(--spacing-l)}input[type=button].hds-button.focus-visible,input[type=button].hds-button:focus-visible,input[type=reset].hds-button.focus-visible,input[type=reset].hds-button:focus-visible,input[type=submit].hds-button.focus-visible,input[type=submit].hds-button:focus-visible{box-shadow:0 0 0 var(--outline-gutter) var(--submit-input-focus-gutter-color),0 0 0 calc(var(--outline-gutter) + var(--outline-width)) var(--focus-outline-color)}.hds-button__label:only-child{margin:0 var(--spacing-2-xs)}.hds-button--small .hds-button__label{line-height:var(--lineheight-s);padding:var(--spacing-2-xs) var(--spacing-xs)}.hds-button--supplementary .hds-button__label:first-child{padding-right:var(--spacing-2-xs)}.hds-button--small .hds-button__label:only-child{margin:0 var(--spacing-xs)}.hds-button--supplementary .hds-icon+.hds-button__label:last-child{padding-left:var(--spacing-2-xs)}.hds-button--supplementary .hds-icon+.hds-button__label:not(:last-child){padding-left:var(--spacing-2-xs);padding-right:var(--spacing-2-xs)}.hds-button--small{padding:0}input[type=button].hds-button--small,input[type=reset].hds-button--small,input[type=submit].hds-button--small{line-height:var(--lineheight-s);padding:var(--spacing-2-xs) var(--spacing-m)}.hds-button--small .hds-button__label:not(:first-of-type):not(:last-of-type){padding:var(--spacing-2-xs) var(--spacing-2-xs)}.hds-button .hds-icon{height:var(--spacing-m);margin-left:var(--spacing-s);width:var(--spacing-m)}.hds-button__label~.hds-icon{margin:0 var(--spacing-s) 0 0}.hds-button--small .hds-icon{margin-left:var(--spacing-2-xs)}.hds-button .hds-button--small .hds-button__label~.hds-icon{margin:0 var(--spacing-2-xs) 0 0}.hds-button .hds-icon:first-of-type:not(:last-of-type){margin:0 0 0 var(--spacing-2-xs)}.hds-button .hds-icon:last-of-type:not(:first-of-type){margin:0 var(--spacing-2-xs) 0 0}.hds-button--small .hds-icon:first-child:not(:last-of-type){margin:0 0 0 var(--spacing-2-xs)}.hds-button--small .hds-icon:last-child:not(:first-of-type){margin:0 var(--spacing-2-xs) 0 0}.hds-button--secondary,.hds-theme--bus .hds-button--secondary{--border-color:var(--color-bus);--border-color-hover:var(--color-bus-dark);--border-color-focus:var(--color-bus);--border-color-hover-focus:var(--color-bus-dark);--border-color-disabled:var(--color-black-50);--focus-outline-color:var(--color-focus-outline);--submit-input-focus-gutter-color:var(--color-white)}.hds-button--secondary,.hds-button--supplementary,.hds-theme--bus .hds-button--secondary,.hds-theme--bus .hds-button--supplementary{--background-color:transparent;--background-color-hover:var(--color-bus-light);--background-color-focus:transparent;--background-color-hover-focus:var(--color-bus-light);--background-color-disabled:transparent;--color:var(--color-bus);--color-hover:var(--color-bus-dark);--color-focus:var(--color-bus);--color-hover-focus:var(--color-bus-dark);--color-disabled:var(--color-black-40)}.hds-button--supplementary,.hds-theme--bus .hds-button--supplementary{--border-color:transparent;--border-color-hover:transparent;--border-color-focus:var(--color-focus-outline);--border-color-hover-focus:var(--color-focus-outline);--border-color-disabled:transparent;--focus-outline-color:transparent;--submit-input-focus-gutter-color:transparent}.hds-button--secondary.hds-button--theme-coat,.hds-theme--coat.hds-button--secondary,.hds-theme--coat .hds-button--secondary{--border-color:var(--color-coat-of-arms);--border-color-hover:var(--color-coat-of-arms-dark);--border-color-focus:var(--color-coat-of-arms);--border-color-hover-focus:var(--color-coat-of-arms-dark)}.hds-button--secondary.hds-button--theme-coat,.hds-button--supplementary.hds-button--theme-coat,.hds-theme--coat.hds-button--secondary,.hds-theme--coat .hds-button--secondary,.hds-theme--coat.hds-button--supplementary,.hds-theme--coat .hds-button--supplementary{--background-color:transparent;--background-color-hover:var(--color-coat-of-arms-light);--background-color-focus:transparent;--background-color-hover-focus:var(--color-coat-of-arms-light);--color:var(--color-coat-of-arms);--color-hover:var(--color-coat-of-arms);--color-focus:var(--color-coat-of-arms);--color-hover-focus:var(--color-coat-of-arms)}.hds-button--supplementary.hds-button--theme-coat,.hds-theme--coat.hds-button--supplementary,.hds-theme--coat .hds-button--supplementary{--border-color:transparent;--border-color-hover:transparent;--border-color-focus:var(--color-focus-outline);--border-color-hover-focus:var(--color-focus-outline)}.hds-button--secondary.hds-button--theme-black,.hds-theme--black.hds-button--secondary,.hds-theme--black .hds-button--secondary{--border-color:var(--color-black);--border-color-hover:var(--color-black);--border-color-focus:var(--color-black);--border-color-hover-focus:var(--color-black)}.hds-button--secondary.hds-button--theme-black,.hds-button--supplementary.hds-button--theme-black,.hds-theme--black.hds-button--secondary,.hds-theme--black .hds-button--secondary,.hds-theme--black.hds-button--supplementary,.hds-theme--black .hds-button--supplementary{--background-color:transparent;--background-color-hover:var(--color-black-5);--background-color-focus:transparent;--background-color-hover-focus:var(--color-black-5);--color:var(--color-black);--color-hover:var(--color-black);--color-focus:var(--color-black);--color-hover-focus:var(--color-black)}.hds-button--supplementary.hds-button--theme-black,.hds-theme--black.hds-button--supplementary,.hds-theme--black .hds-button--supplementary{--border-color:transparent;--border-color-hover:transparent;--border-color-focus:var(--color-focus-outline);--border-color-hover-focus:var(--color-focus-outline)}.hds-checkbox{--size:24px;--icon-scale:1;--border-width:2px;--outline-width:3px;--label-font-size:var(--fontsize-body-m);--label-padding:var(--spacing-2-xs);--icon-size:var(--spacing-m);display:flex;flex-wrap:wrap;min-height:var(--size);position:relative}.hds-checkbox,.hds-checkbox *,.hds-checkbox :after,.hds-checkbox :before{box-sizing:border-box}.hds-checkbox,.hds-theme--bus .hds-checkbox{--background-unselected:transparent;--background-selected:var(--color-bus);--background-hover:var(--color-bus-dark);--background-disabled:var(--color-black-10);--border-color-selected:var(--color-bus);--border-color-selected-hover:var(--color-bus-dark);--border-color-selected-focus:var(--color-bus);--border-color-unselected:var(--color-black-50);--border-color-unselected-hover:var(--color-black-90);--border-color-unselected-focus:var(--color-black-90);--border-color-disabled:var(--color-black-10);--icon-color-unselected:transparent;--icon-color-selected:var(--color-white);--icon-color-disabled:var(--color-white);--label-color:var(--color-black-90);--label-color-disabled:var(--color-black-40)}.hds-theme--coat .hds-checkbox{--background-selected:var(--color-coat-of-arms);--background-hover:var(--color-coat-of-arms-dark);--border-color-selected:var(--color-coat-of-arms);--border-color-selected-hover:var(--color-coat-of-arms-dark);--border-color-selected-focus:var(--color-coat-of-arms)}.hds-theme--black .hds-checkbox{--background-selected:var(--color-black);--background-hover:var(--color-black-80);--border-color-selected:var(--color-black);--border-color-selected-hover:var(--color-black-80);--border-color-selected-focus:var(--color-black)}.hds-checkbox:not(:first-of-type){margin-top:var(--spacing-2-xs)}.hds-checkbox .hds-checkbox__input:before,.hds-checkbox .hds-checkbox__label:after,.hds-checkbox .hds-checkbox__label:before{content:\"\";left:0;position:absolute;top:0}.hds-checkbox .hds-checkbox__input:before{background-color:var(--icon-color-unselected);height:var(--size);-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cpath d='M0 0h24v24H0z'/%3E%3Cpath fill='currentColor' d='M21 7L10 18l-5.5-5.5L6 11l4 4 9.5-9.5z'/%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cpath d='M0 0h24v24H0z'/%3E%3Cpath fill='currentColor' d='M21 7L10 18l-5.5-5.5L6 11l4 4 9.5-9.5z'/%3E%3C/g%3E%3C/svg%3E\");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:calc(var(--size) * var(--icon-scale));mask-size:calc(var(--size) * var(--icon-scale));transform:scale(.6);width:var(--size);z-index:1}.hds-checkbox .hds-checkbox__label:before{height:var(--size);width:var(--size)}.hds-checkbox .hds-checkbox__label:after{background-color:var(--background-unselected);border:var(--border-width) solid var(--border-color-unselected);height:var(--size);width:var(--size)}.hds-checkbox .hds-checkbox__input:focus+.hds-checkbox__label:after,.hds-checkbox .hds-checkbox__input:focus:before,.hds-checkbox .hds-checkbox__input:hover+.hds-checkbox__label:after,.hds-checkbox .hds-checkbox__input:hover:before{transition:85ms ease-out;transition-property:background-color,border-color,transform}.hds-checkbox .hds-checkbox__input:focus+.hds-checkbox__label:before{outline:var(--outline-width) solid var(--focus-outline-color,var(--color-focus-outline));outline-offset:var(--focus-outline-offset,0);transform:translateZ(0);transition:85ms ease-out;transition-property:outline,outline-offset,transform}.hds-checkbox .hds-checkbox__input{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;font-family:inherit;font-size:100%;height:var(--size);left:0;line-height:1.15;margin:0;outline:none;position:absolute;top:0;width:var(--size)}.hds-checkbox .hds-checkbox__label{color:var(--label-color);cursor:pointer;font-size:var(--label-font-size);line-height:var(--lineheight-m);padding-left:calc(var(--size) + var(--label-padding));padding-top:calc((var(--size) - var(--label-font-size) * var(--lineheight-m)) / 2);position:relative}.hds-checkbox .hds-checkbox__label--hidden{padding-left:var(--size)}.hds-checkbox__error-text{background-color:var(--color-error-light);border-left:8px solid var(--color-error);color:var(--color-black);display:flex;flex-basis:100%;font-size:var(--fontsize-body-m);margin-top:var(--spacing-2-xs);padding:var(--spacing-2-xs);position:relative}.hds-checkbox__error-text:before{background:var(--color-error);content:\"\";display:inline-block;height:var(--icon-size);margin-right:var(--spacing-2-xs);-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11.175 3.456c.349-.586 1.223-.607 1.61-.063l.04.063 9.052 15.21c.343.577-.072 1.285-.753 1.332l-.072.002H2.948c-.7 0-1.15-.689-.858-1.273l.033-.06 9.052-15.21zM13 16v2h-2v-2h2zm0-7.5v6h-2v-6h2z' fill='currentColor'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11.175 3.456c.349-.586 1.223-.607 1.61-.063l.04.063 9.052 15.21c.343.577-.072 1.285-.753 1.332l-.072.002H2.948c-.7 0-1.15-.689-.858-1.273l.033-.06 9.052-15.21zM13 16v2h-2v-2h2zm0-7.5v6h-2v-6h2z' fill='currentColor'/%3E%3C/svg%3E\");pointer-events:none;width:var(--icon-size)}.hds-checkbox .hds-checkbox__input:checked:before{background-color:var(--icon-color-selected);transform:scale(1)}.hds-checkbox .hds-checkbox__input:checked+.hds-checkbox__label:after,.hds-checkbox .hds-checkbox__input:indeterminate+.hds-checkbox__label:after{background-color:var(--background-selected);border-color:var(--border-color-selected)}.hds-checkbox .hds-checkbox__input:disabled+.hds-checkbox__label:after{background-color:var(--background-disabled);border-color:var(--border-color-disabled)}.hds-checkbox .hds-checkbox__input:not(:disabled):focus+.hds-checkbox__label:after{border-color:var(--border-color-unselected-focus)}.hds-checkbox .hds-checkbox__input:not(:disabled):hover+.hds-checkbox__label:after,.hds-checkbox .hds-checkbox__input:not(:disabled):hover:focus+.hds-checkbox__label:after{border-color:var(--border-color-unselected-hover)}.hds-checkbox .hds-checkbox__input:not(:disabled):checked:focus+.hds-checkbox__label:after,.hds-checkbox .hds-checkbox__input:not(:disabled):indeterminate:focus+.hds-checkbox__label:after{border-color:var(--border-color-selected-focus)}.hds-checkbox .hds-checkbox__input:not(:disabled):checked:hover+.hds-checkbox__label:after,.hds-checkbox .hds-checkbox__input:not(:disabled):checked:hover:focus+.hds-checkbox__label:after,.hds-checkbox .hds-checkbox__input:not(:disabled):indeterminate:hover+.hds-checkbox__label:after,.hds-checkbox .hds-checkbox__input:not(:disabled):indeterminate:hover:focus+.hds-checkbox__label:after{background-color:var(--background-hover);border-color:var(--border-color-selected-hover)}.hds-checkbox .hds-checkbox__input:disabled+.hds-checkbox__label{color:var(--label-color-disabled)}.hds-checkbox .hds-checkbox__input:checked:disabled:before{background-color:var(--icon-color-disabled)}.hds-checkbox .hds-checkbox__input:disabled,.hds-checkbox .hds-checkbox__input:disabled+.hds-checkbox__label{cursor:not-allowed}:host .hds-cc__form .hds-checkbox{--label-color-disabled:var(--color-black-60)}.hds-icon{--icon-size:100%;background-color:currentcolor;display:inline-block;height:var(--icon-size);-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:auto;mask-size:auto;width:var(--icon-size)}.hds-notification{--notification-background-color:var(--color-info-light);--notification-border-color:var(--color-info);--notification-border-width:var(--spacing-2-xs);--notification-icon-color:var(--color-info);--notification-color:var(--color-black-90);--notification-max-width-inline:none;--notification-max-width-toast:21rem;--notification-z-index-inline:auto;--notification-z-index-toast:99;--notification-offset:var(--spacing-layout-s);--notification-padding:var(--spacing-s);background-color:var(--notification-background-color);border:solid var(--notification-border-color);border-left-width:var(--notification-border-width);border-bottom-width:0;border-right-width:0;border-top-width:0;box-sizing:border-box;color:var(--notification-color);max-width:var(--notification-max-width-inline);padding:var(--notification-padding);position:relative;width:100%;z-index:var(--notification-z-index-inline)}.hds-notification__content{display:grid;grid-gap:var(--spacing-s);gap:var(--spacing-s)}.hds-notification__label{align-items:flex-start;display:flex;font-size:var(--fontsize-heading-xs);font-weight:700;letter-spacing:.4px;line-height:24px;margin-right:var(--spacing-l)}.hds-notification__label>.hds-icon{color:var(--notification-icon-color);flex:none;margin-right:var(--spacing-2-xs)}.hds-notification__body{font-size:var(--fontsize-body-s);line-height:24px}.hds-notification--small{--notification-padding:var(--spacing-2-xs)}.hds-notification--small .hds-notification__content{display:flex;grid-gap:0;gap:0}.hds-notification--small .hds-notification__label{margin-right:0}.hds-notification--small .hds-notification__body{margin-right:var(--spacing-l)}.hds-notification .hds-icon{--icon-size:var(--spacing-layout-xs)}.hds-notification__close-button{--notification-close-button-offset:var(--spacing-s);background:none;border:none;cursor:pointer;display:flex;outline:none;padding:0;position:absolute;right:var(--notification-close-button-offset);top:var(--notification-close-button-offset)}.hds-notification--large .hds-notification__close-button,.hds-notification--small .hds-notification__close-button{--notification-close-button-offset:var(--spacing-2-xs)}.hds-notification__close-button:focus{box-shadow:0 0 0 3px var(--color-focus-outline)}@media only screen and (max-width:765.98px){.hds-notification{--notification-offset:var(--spacing-s)}}.hds-notification--success{--notification-background-color:var(--color-success-light);--notification-border-color:var(--color-success);--notification-icon-color:var(--color-success)}.hds-table-container{overflow-x:auto}.hds-table-container:focus{outline:var(--color-focus-outline) 3px solid}.hds-table{--content-background-color:var(--color-white);border-collapse:collapse;line-height:1.5;width:100%}.hds-table th{border-bottom:1px solid var(--color-black-20);font-weight:500;line-height:var(--lineheight-l);text-align:left;white-space:nowrap}.hds-table__content tr td,.hds-table th{font-size:var(--fontsize-body-m);padding:var(--spacing-xs) var(--spacing-m)}.hds-table__content tr td{background-color:var(--content-background-color);border-bottom:1px solid var(--color-black-50);color:var(--color-black-90);font-weight:400;line-height:24px}.hds-table__header-row{background-color:var(--header-background-color)}.hds-table--light{--header-background-color:var(--color-silver)}.hds-table.hds-table--light th{color:var(--color-black-90)}@media (max-width:767px){.hds-table th{font-weight:700}.hds-table__content tr td,.hds-table th{font-size:var(--fontsize-body-s);padding:9px var(--spacing-s)}}.hds-theme--coat,.hds-theme--coat-of-arms{--hds-cc-border-color:var(--color-coat-of-arms)}.hds-cc--page{margin-top:var(--spacing-layout-xs);margin-bottom:var(--spacing-layout-xs)}*,:after,:before{box-sizing:inherit}html{-webkit-text-size-adjust:100%}.hds-cc{--autoheight-open-time:0.15s;--common-spacing:var(--spacing-s);--focus-outline-color:var(--focus-outline-color-override,var(--color-focus-outline,var(--color-coat-of-arms)));--outline-width:3px;color:var(--color-black-90);font-family:var(--font-default);font-size:var(--fontsize-body-m)}.hds-cc.hds-cc--banner{bottom:0;left:0;overscroll-behavior:contain;position:fixed;width:100vw;z-index:999}.hds-cc.hds-cc--page{padding-top:var(--spacing-layout-xs)}.hds-cc__container{background:var(--color-white)}.hds-cc--banner .hds-cc__container{border-top:8px solid var(--hds-cc-border-color,var(--color-bus));bottom:0;max-height:80vh;overflow-y:auto;position:absolute;width:100%;z-index:2}.hds-cc__aligner{margin-left:auto;margin-right:auto;max-width:var(--container-width-override,var(--container-width-xl))}.hds-cc--banner .hds-cc__aligner{padding:var(--spacing-layout-2-xs)}@media (min-width:768px){.hds-cc--banner .hds-cc__aligner{padding:var(--spacing-layout-s) var(--spacing-layout-xs)}}.visually-hidden{border:0;clip:rect(0,0,0,0);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.hds-cc__heading{font-size:2rem;font-weight:400;line-height:1;margin:0}.hds-cc__heading:focus{outline:var(--outline-width,3px) solid var(--focus-outline-color,#000);outline-offset:var(--outline-gutter,2px)}.hds-cc__description,.hds-cc__form p{max-width:860px}.hds-cc__description{font-size:1rem;font-weight:400;line-height:1.5;margin-bottom:var(--spacing-layout-2-xs)}.hds-cc__accordion-button .hds-icon{transition:transform .15s linear}.hds-cc__accordion-button[aria-expanded=true] .hds-icon{transform:rotate(180deg)}.hds-cc__accordion-button .hds-button__label{padding-left:var(--spacing-2-xs);padding-right:var(--spacing-2-xs)}.hds-cc__accordion-button:not(.hds-cc__accordion-button--read-more){margin-bottom:16px;padding-right:6px}.hds-cc__accordion-button--read-more{display:none;font-size:1rem;grid-area:readmore;line-height:2}.hds-cc--banner .hds-cc__form{--internal-autoheight-open-time:var(--autoheight-open-time,0.3s);display:grid;grid-template-rows:1fr;transition:grid-template-rows var(--internal-autoheight-open-time) linear}@media (prefers-reduced-motion){.hds-cc--banner .hds-cc__form{--internal-autoheight-open-time:0s}}.hds-cc__form__animator{margin-left:-5px;margin-right:-5px;overflow:hidden;padding-left:5px;padding-right:5px;transform:translateY(0)}.hds-cc--banner :not([aria-expanded=true])+.hds-cc__form{grid-template-rows:0fr}.hds-cc--banner :not([aria-expanded=true])+.hds-cc__form .hds-cc__form__animator{transition:visibility 0s linear var(--internal-autoheight-open-time);visibility:hidden}.hds-cc--page .hds-cc__accordion-button--details{display:none}.hds-cc__groups{padding-bottom:var(--spacing-layout-s)}.hds-cc__notification_container .hds-notification{margin-bottom:var(--spacing-layout-s)}@keyframes entryAnimation{0%{opacity:0;transform:translateY(-20px)}to{opacity:1;transform:translateY(0)}}@keyframes exitAnimation{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(20px)}}.hds-notification.enter{animation:entryAnimation .5s ease-out forwards}.hds-notification.exit{animation:exitAnimation .5s ease-out forwards}@media (prefers-reduced-motion:reduce){.hds-notification.enter,.hds-notification.exit{animation-duration:0s!important}}.hds-cc__group{border-bottom:1px solid var(--color-black-60);padding-bottom:var(--spacing-layout-2-xs);padding-top:var(--spacing-layout-s)}.hds-cc__group:first-of-type{border-top:1px solid var(--color-black-60)}.hds-cc__group .hds-notification{display:none}.hds-cc__group--highlight .hds-notification{display:block;margin-top:var(--spacing-layout-2-xs)}.hds-cc__group-details{--internal-autoheight-open-time:var(--autoheight-open-time,0.3s);display:grid;grid-template-rows:1fr;transition:grid-template-rows var(--internal-autoheight-open-time) linear}@media (prefers-reduced-motion){.hds-cc__group-details{--internal-autoheight-open-time:0s}}.hds-cc__group-details__animator{margin-left:-5px;margin-right:-5px;overflow:hidden;padding-left:5px;padding-right:5px;transform:translateY(0)}:not([aria-expanded=true])+.hds-cc__group-details{grid-template-rows:0fr}:not([aria-expanded=true])+.hds-cc__group-details .hds-cc__group-details__animator{transition:visibility 0s linear var(--internal-autoheight-open-time);visibility:hidden}.hds-cc__group-details__animator .hds-table-container{margin-top:5px;margin-bottom:5px}.hds-cc--banner [aria-controls=hds-cc-form]:not([aria-expanded=true])~.hds-cc__buttons .hds-cc__selected-cookies-button,.hds-cc--page .hds-cc__all-cookies-button,:not([aria-expanded=true])>.hds-cc__accordion-button-hide,[aria-controls=hds-cc-form][aria-expanded=true]~.hds-cc__buttons .hds-cc__all-cookies-button,[aria-expanded=true]>.hds-cc__accordion-button-show{display:none}.hds-cc__form{--autoheight-open-time:0.2s}.hds-cc__buttons{grid-column-gap:32px;-moz-column-gap:32px;column-gap:32px;display:flex;flex-direction:column;grid-row-gap:16px;row-gap:16px}@media (min-width:768px){.hds-cc__buttons{flex-direction:row}}",e.appendChild(o)}async#q(e,o,i,a=null,c=[]){let l,d=a;if(i){const e=document.querySelector(this.#z);if(!e)throw new Error(`Cookie consent: The targetSelector element '${this.#z}' was not found`);if(l=document.querySelector(this.#A),!l)throw new Error(`Cookie consent: The spacerParentSelector element '${this.#A}' was not found`);if(!document.querySelector(this.#L))throw new Error(`Cookie consent: The pageContentSelector element '${this.#L}' was not found`);d=e}const h=document.createElement("div");if(h.classList.add(t.targetClass),h.style.all="var(--hds-cc--all-override, initial)!important",i||(d.innerHTML=""),d.prepend(h),i){const e=s(!1);h.insertAdjacentHTML("beforebegin",e),this.#G.ariaLive=d.querySelector(`#${t.ariaLiveId}`)}const u=h.attachShadow({mode:"open"});await this.#V(u);const b=this.#I.getCookie(),p=b?b.groups:[],g=[this.#U(o.requiredGroups,e,o.translations,!0,p),this.#U(o.optionalGroups,e,o.translations,!1,p)].join("");u.innerHTML+=function(e,o,i,a,c,l,d,h=!0){let u="";h||(u=s(!0));const b=n([{translations:e,key:"bannerAriaLabel",parameters:c},{translations:e,key:"heading",parameters:c},{translations:e,key:"description",parameters:c},{translations:e,key:"showDetails",parameters:c},{translations:e,key:"hideDetails",parameters:c},{translations:e,key:"form_heading",parameters:c},{translations:e,key:"form_text",parameters:c},{translations:e,key:"approveRequiredAndSelectedConsents",parameters:c},{translations:e,key:"approveAllConsents",parameters:c},{translations:e,key:"approveOnlyRequiredConsents",parameters:c}],o,i,a),p=i[o]?o:a,g=i[p]||"ltr";return`\n
\n
\n
\n\n

\n ${b.heading.value}\n

\n

\n ${b.description.value}\n

\n\n
\n
\n
`}(o.translations,e,this.#f,o.fallbackLanguage,o,g,this.#$,i),this.#O=u,this.#I.setFormReference(u.querySelector("form"));const m=u.querySelector("form");if(u.querySelectorAll("button[type=submit]").forEach((e=>{e.addEventListener("click",(e=>{this.#M(e.target.dataset.approved,m)}))})),i){this.#G.bannerContainer=h;const e=document.createElement("style");e.innerHTML=`${this.#L} * {scroll-margin-bottom: calc(var(--hds-cookie-consent-height, -8px) + 8px);}`,document.head.appendChild(e);const o=document.createElement("div");o.id=t.spacerId,this.#G.spacer=o,l.appendChild(o),o.style.height="var(--hds-cookie-consent-height, 0)";const n=new ResizeObserver((e=>{e.forEach((e=>{const o=parseInt(e.contentRect.height,10),t=parseInt(getComputedStyle(e.target).borderTopWidth,10);document.documentElement.style.setProperty("--hds-cookie-consent-height",`${o+t}px`)}))})),r=u.querySelector(`.${t.containerClass}`);n.observe(r),this.#R={resizeObserver:n,bannerHeightElement:r},u.querySelector(".hds-cc").focus()}if(this.#P(),c.length>0){let e=null;c.forEach((o=>{const n=m.querySelector(`div[data-group-id=${o}]`);n&&(n.classList.add(t.groupHighlightClass),null===e&&(e=n))})),null!==e&&(u.querySelector(`.${t.accordionButtonDetailsClass}`).click(),setTimeout((()=>{e.scrollIntoView({behavior:"auto"})}),500))}}async#B(){await new Promise((e=>{"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()})),this.#N();let e=null;this.#D&&(e=document.querySelector(this.#D));const{siteSettings:o,directions:t}=await this.#I.init();if(this.#g=o,this.#f=t,e)this.#T=e,await this.#q(this.#E,o,!1,e);else{this.#F()&&await this.#q(this.#E,o,!0)}const n=o.monitorInterval||0,r=o.remove||!1;this.#d.init(this.#I,n,r)}}return f.addToHdsScope("CookieConsentClass",f),e.CookieConsentCore=f,Object.defineProperty(e,"__esModule",{value:!0}),e}({}); +var l=function(e,o){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var t={},r=o||{},n=e.split(";"),i=r.decode||h,a=0;a!(""===e||this.#i(e,o))));n.forEach((o=>{if(!this.#n[e].includes(o))if(console.log(`Cookie consent: will delete ${r} ${e}(s): '${n.join("', '")}'`),"cookie"===e)(e=>{function o(e){const o=`; ${document.cookie}`.split(`; ${e}=`);return 2===o.length?o.pop().split(";").shift():null}function t(e,o,t){const r={expires:new Date(0),path:o,domain:t},n=d(e,"",r);document.cookie=n}const{hostname:r,pathname:n}=window.location;if(null!==o(e)&&(t(e,"/",void 0),null!==o(e))){const i=r.split(".");for(;i.length>1;){const r=`${i.join(".")}`,a=n.split("/");let s="";a.forEach(((n,i)=>{(n||0===i)&&(s+=n+(i{console.log(`Cookie consent: IndexedDB database '${o}' deleted successfully.`),this.#n.indexedDB=this.#n.indexedDB.filter((e=>e!==o))},e.onerror=()=>{console.warn(`Cookie consent: Error deleting IndexedDB database '${o}'`),this.#n.indexedDB.push(o)},e.onblocked=()=>{console.error(`Cookie consent: IndexedDB database '${o}' deletion blocked.`),this.#n.indexedDB.push(o)}}else"cacheStorage"===e&&caches.delete(o).then((e=>{e?console.log(`Cookie consent: Cache '${o}' has been deleted`):console.log(`Cookie consent: Cache '${o}' not found`)}))}))}#s(){return document.cookie.split(";").map((e=>e.split("=")[0].trim()))}#a(e){try{if(!e)return!1;const o=l(document.cookie)[e];return!!o&&JSON.parse(o)}catch(e){return console.error(`Cookie parsing unsuccessful:\n${e}`),!1}}async#c(){if(indexedDB&&indexedDB.databases){return(await indexedDB.databases()).map((e=>e.name))}return[]}async#l(){if("caches"in window){return await caches.keys()}return[]}#i(e,o){if(!Array.isArray(o)||0===o.length)return!1;if(o.includes(e))return!0;return o.filter((e=>e.includes("*"))).map((e=>new RegExp(`^${e.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*")}$`))).some((o=>o.test(e)))}#d(e,o,t,r,n){const i=r.filter((e=>!(""===e||t.includes(e)||this.#i(e,o))));if(i.length>0){console.log(`Cookie consent: found unapproved ${e}(s): '${i.join("', '")}'`);const o=new CustomEvent("hds-cookie-consent-unapproved-item-found",{detail:{storageType:e,keys:i,acceptedGroups:n}});window.dispatchEvent(o),t.push(...i)}this.#o&&this.deleteKeys(e,o,r,"unapproved")}async getCurrentKeys(e){switch(e){case"cookie":return this.#s();case"localStorage":return Object.keys(localStorage);case"sessionStorage":return Object.keys(sessionStorage);case"indexedDB":return this.#c();case"cacheStorage":return this.#l();default:return[]}}async#h(){this.BROWSER_STORAGES.forEach((async e=>{const o=this.#t.getConsentedGroupNames(),t=this.#t.getAllKeysInConsentedGroups();this.#d(e,t[e],this.#r[e],await this.getCurrentKeys(e),o)}))}#u(){this.#h(),setInterval((()=>{this.#h()}),this.#e)}init(e,o=500,t=!1){this.#t=e,this.#e=Math.max(o,500),this.#o=t,o>0&&this.#u()}}class b{#g=100;#p;#m;#b;#f;#v="city-of-helsinki-cookie-consents";#k;constructor({siteSettingsObj:e,lang:o,shadowDomUpdateCallback:t}){this.#m=e,this.#b=o,this.#p=e=>{t(e,this.#k)},this.#v=this.#m.cookieName||this.#v,this.#x()}setFormReference(e){this.#k=e}getConsentStatus(e){if(!Array.isArray(e)||0===e.length)return console.error("Cookie consent: Group names must be provided as an non-empty array."),!1;const o=this.getCookie();return!(!o||!o.groups)&&e.every((e=>!!o.groups[e]))}async setGroupsStatusToAccepted(e){if(!Array.isArray(e))return console.error("Cookie consent: Accepted groups must be provided as an array to setGroupsStatusToAccepted function."),!1;const o=this.getCookie(),t=!o||o.showBanner||!1;let r=[];o&&(r=Object.keys(o.groups));const n=[...this.#m.requiredGroups,...this.#m.optionalGroups];await Promise.all(n.map((async e=>{const{...o}=e;delete o.checksum,e.checksum=await this.#w(o)})));const i=this.#m.groupsWhitelistedForApi||[],a=e.filter((e=>!i.includes(e)));if(a.length>0)return console.error(`Cookie consent: The group(s) "${a.join('", "')}" not found in groupsWhitelistedForApi: "${i.join('", "')}".`),!1;const s=e.filter((e=>!n.some((o=>o.groupId===e))));if(s.length>0)return console.error(`Cookie consent: The group(s) "${s.join('", "')}" not found in required or optional groups in site settings.`),!1;const c=[...new Set([...r,...e])];return this.saveConsentedGroups(c,t),!0}getCookie(e=void 0){try{let o;if(this&&this.#v&&!e)o=this.#v;else if(!e)return!1;const t=l(document.cookie)[o];return!!t&&JSON.parse(t)}catch(e){return console.error(`Cookie parsing unsuccessful:\n${e}`),!1}}getAllKeysInConsentedGroups(e=null){let o=e;o||(o=this.getConsentedGroupNames());const t={};return t.cookie=this.#y(o,1),t.cookie.includes(this.#v)||t.cookie.push(this.#v),t.localStorage=this.#y(o,2),t.sessionStorage=this.#y(o,3),t.indexedDB=this.#y(o,4),t.cacheStorage=this.#y(o,5),t}setLanguage(e=void 0){this.#b=e}#_(e){return{date:new Date(e).toLocaleDateString("fi-FI"),time:new Date(e).toLocaleTimeString("fi-FI",{hour:"numeric",minute:"numeric"})}}timestampElementHandler(e){if(!this.#k)return;const o=this.#k.querySelectorAll("div[data-timestamp]"),t=this.getCookie();let r=[];t&&t.groups&&(r=t.groups),o.forEach((o=>{const t=o.dataset.timestamp;let n;if(e.includes(t)){let e;const o=r[t];e=o?o.timestamp:Date.now(),n=c(this.#_(e),t,this.#m.translations,this.#b,this.#f,this.#m.fallbackLanguage)}else n="";o.innerHTML=n}))}saveConsentedGroups(e=[],o=!1){const t={},r=[...this.getRequiredGroupNames(),...e],{groups:n}=this.getCookie();[...this.#m.requiredGroups,...this.#m.optionalGroups].forEach((e=>{if(r.includes(e.groupId)){const o=n?.[e.groupId]?.timestamp;t[e.groupId]={checksum:e.checksum,timestamp:o||Date.now()}}}));const i={groups:t,...o&&{showBanner:!0}};this.#C(i),this.timestampElementHandler(e),this.#p(e)}removeConsentWithdrawnCookiesBeforeSave(e,o){const t=this.getAllKeysInConsentedGroups(e);o.BROWSER_STORAGES.forEach((async e=>{const r=await o.getCurrentKeys(e);o.deleteKeys(e,t[e],r,"consent withdrawn")}))}getRequiredGroupNames(){return this.#m.requiredGroups.map((e=>e.groupId))}getAllGroupNames(){return[...this.#m.requiredGroups,...this.#m.optionalGroups].map((e=>e.groupId))}async#w(e,o=8){let t=e;"string"!=typeof e&&(t=JSON.stringify(e));const r=(new TextEncoder).encode(t),n=await crypto.subtle.digest("SHA-1",r);return Array.from(new Uint8Array(n)).map((e=>e.toString(16).padStart(2,"0"))).join("").substring(0,o)}getConsentedGroupNames(){let e=[];const o=this.getCookie();o&&o.groups&&(e=Object.keys(o.groups));const t=this.getRequiredGroupNames();return e=[...new Set([...t,...e])],e}#C(e){const o=new Date;o.setDate(o.getDate()+this.#g),document.cookie=d(this.#v,JSON.stringify(e),{sameSite:"strict",expires:o,path:"/"})}#y(e,o){const t=new Set;this.#m.robotCookies?.forEach((e=>{e.storageType===o&&t.add(e.name)}));return[...this.#m.requiredGroups,...this.#m.optionalGroups].forEach((r=>{e.includes(r.groupId)&&r.cookies.forEach((e=>{e.storageType===o&&t.add(e.name)}))})),Array.from(t)}async#S(){const e=this.getCookie(),o=[...this.#m.requiredGroups,...this.#m.optionalGroups];await Promise.all(o.map((async e=>{e.checksum=await this.#w(e)})));let t=!1;const r=[],n={};if(o.forEach((e=>{n[e.groupId]=e.checksum})),e.groups&&Object.keys(e.groups).forEach((o=>{const i=e.groups[o];n[o]&&n[o]===i.checksum?r.push(o):(t=!0,console.info(`Invalid group found in browser cookie: '${o}', removing from cookie.`))})),t){const e=!0;this.saveConsentedGroups(r,e)}}#x(){if(0===this.#m.requiredGroups.length)throw new Error(`Cookie consent: At least one required group is needed to store consent in '${this.#v}'.`);if(!this.#m.requiredGroups.find((e=>e.cookies.some((e=>e.name===this.#v&&1===e.storageType)))))throw new Error(`Cookie consent: No group found in requiredGroups that contains cookie '${this.#v}'.`);const e=[...this.#m.requiredGroups,...this.#m.optionalGroups].map((e=>e.groupId)),o=e.filter(((o,t)=>e.indexOf(o)!==t));if(o.length>0)throw new Error(`Cookie consent: Groups '${Array.from(o).join(", ")}' found multiple times in settings.`)}async init(){return await this.#S(),this.#f=this.#m.languages.reduce(((e,o)=>(e[o.code]=o.direction,e)),{}),{siteSettings:this.#m,directions:this.#f}}}const f=()=>"undefined"==typeof window||"undefined"==typeof document,v=Symbol("private"),k={MONITOR:"hds-cookie-consent-unapproved-item-found",READY:"hds-cookie-consent-ready",CHANGE:"hds-cookie-consent-changed"};class x{#E;#$;#z;#A;#H;#T=!1;#G;#L;#O;#d;#D;#m;#f;#I=null;#R=null;#N={bannerContainer:null,spacer:null,ariaLive:null};#B=null;#q={resizeObserver:null,bannerHeightElement:null};constructor(e,{language:o="en",theme:t="bus",targetSelector:r="body",spacerParentSelector:n="body",pageContentSelector:i="body",submitEvent:a=!1,settingsPageSelector:s=null,focusTargetSelector:c=null,disableAutoRender:l=!1},d=!1){if(d!==v)throw new Error("Cookie consent: direct construction not allowed. Use `await CookieConsentCore.create()` instead.");this.#E=o,this.#$=t,this.#z=r,this.#A=n,this.#H=i,this.#T=a,this.#G=s,this.#L=c,this.#O=l,x.addToHdsScope("cookieConsent",this);this.#D=new b({siteSettingsObj:e,lang:o,shadowDomUpdateCallback:(e,o)=>{if(o){o.querySelectorAll("input").forEach((o=>{o.checked=e.includes(o.dataset.group)}))}}}),this.#d=new m}static addToHdsScope(e,o){f()||(window.hds||(window.hds={}),window.hds[e]=o)}static async create(e,o){let t;if(!e&&("string"!=typeof e||"object"!=typeof e))throw new Error("Cookie consent: siteSettingsParam is required, it should be an URL string or an siteSettings object.");if("string"==typeof e){const r=await fetch(e).then((o=>{if(!o.ok)throw new Error(`Cookie consent: Unable to fetch cookie consent settings: '${o.status}' from: '${e}' `);return o.text()}));let n;try{n=JSON.parse(r)}catch(e){throw new Error(`Cookie consent: siteSettings JSON parsing failed: ${e}`)}t=new x(n,o,v)}else t=new x(e,o,v);if(await t.#M(),!f()){const e=new Event(k.READY);window.dispatchEvent(e)}return t}getConsentStatus(e){return this.#D.getConsentStatus(e)}getAllConsentStatuses(){const e=this.#D.getCookie(),o=e&&e.groups||[];return this.#D.getAllGroupNames().map((e=>({group:e,consented:!!o[e]})))}async setGroupsStatusToAccepted(e){const o=await this.#D.setGroupsStatusToAccepted(e);if(o){const e=this.getAllConsentStatuses().filter((e=>e.consented)).map((e=>e.group));window.dispatchEvent(new CustomEvent(k.CHANGE,{detail:{acceptedGroups:e}}))}return Promise.resolve(o)}openBanner(e=[],o=""){this.#G&&document.querySelector(this.#G)?console.error("Cookie consent: The user is already on settings page"):(o&&(this.#L=o),this.removeBanner(),this.#j(this.#E,this.#m,!0,null,e))}openBannerIfNeeded(e=[]){return this.#P()?(this.openBanner(e),Promise.resolve(!0)):Promise.resolve(!1)}renderPage(e=void 0){const o=e||this.#G,t=o?document.querySelector(o):null;this.#B=t,t&&this.#j(this.#E,this.#m,!1,t)}removePage(){if(this.killTimeout(),this.#K(),!this.#B)return!1;try{this.#B.innerHTML="",this.#B=null}catch(e){return this.#B=null,!1}return!0}setLanguage(e){e&&this.#E!==e&&(this.#E=e,this.#D.setLanguage(e))}setTheme(e){e&&this.#$!==e&&(this.#$=e)}killTimeout(){this.#R&&(window.clearTimeout(this.#R),this.#R=null)}removeBanner(e=!1){if(this.killTimeout(),this.#q.resizeObserver&&this.#q.bannerHeightElement&&this.#q.resizeObserver.unobserve(this.#q.bannerHeightElement),this.#N.bannerContainer&&(this.#N.bannerContainer.remove(),this.#N.bannerContainer=null),this.#N.spacer&&(this.#N.spacer.remove(),this.#N.spacer=null),document.documentElement.style.removeProperty("--hds-cookie-consent-height"),e&&this.#L){const e=document.querySelector(this.#L);e&&e.focus()}}#F(e,o=!1){const t=[];return e.querySelectorAll("input[data-group]").forEach((e=>{(e.checked||o)&&t.push(e.dataset.group)})),t}#U(e,o){let t=[];switch(e){case"required":t=this.#D.getRequiredGroupNames(),this.#D.removeConsentWithdrawnCookiesBeforeSave(t,this.#d),this.#D.saveConsentedGroups(t,!1);break;case"all":t=this.#F(o,!0),this.#D.saveConsentedGroups(t,!1);break;case"selected":t=this.#F(o),this.#D.removeConsentWithdrawnCookiesBeforeSave(t,this.#d),this.#D.saveConsentedGroups(t,!1)}if(this.#T){if(window.dispatchEvent(new CustomEvent(k.CHANGE,{detail:{acceptedGroups:t}})),!this.#B)return this.removeBanner(!0),void this.#V();this.#V()}else window.location.reload()}#Y(){if(!this.#N.ariaLive)return!1;const e=this.#N.ariaLive.querySelector(".hds-notification");return!!e&&(e.classList.remove("enter"),e.classList.add("exit"),e.addEventListener("animationend",(e=>{e.currentTarget.remove()})),!0)}#K(e){this.#N.ariaLive&&(e?this.#N.ariaLive.innerHTML="":this.#N.ariaLive.remove(),this.#N.ariaLive=null)}#W(){this.#N.bannerContainer||this.#B||this.#K(!1);this.#Y()||this.#K(!0)}#J(){if(!this.#N.ariaLive){const e=this.#I.getElementById(t.ariaLiveId);this.#N.ariaLive=e}}#V(){this.killTimeout();this.#J();const e=o(this.#m.translations,"settingsSaved",this.#E,this.#f,this.#m.fallbackLanguage);if(this.#B){const t=s(e,o(this.#m.translations,"notificationAriaLabel",this.#E,this.#f,this.#m.fallbackLanguage),"success");this.#N.ariaLive.innerHTML=t}else this.#N.ariaLive.textContent=e.value;this.#R=setTimeout((()=>{this.#W()}),5e3)}#P(){const e=this.#D.getCookie();return!e||e.showBanner}#_(e){return{date:new Date(e).toLocaleDateString("fi-FI"),time:new Date(e).toLocaleTimeString("fi-FI",{hour:"numeric",minute:"numeric"})}}#Z(e,o,t,r,a){let l="";const d=Object.keys(a);return e.forEach((e=>{const h=d.includes(e.groupId);let u=!1;h&&(u=this.#_(a[e.groupId].timestamp));let g="";e.cookies.forEach((e=>{g+=function(e,o,t,r,a){const s=`storageType${e.storageType}`,c=n([{translations:e,key:"name"},{translations:e,key:"host"},{translations:e,key:"description"},{translations:e,key:"expiration"},{translations:o,key:s}],t,r,a);return`\n \n ${c.name.value}\n ${c.host.value}\n ${c.description.value}\n ${c.expiration.value}\n ${c[s].value}\n \n `}(e,t,o,this.#f,this.#m.fallbackLanguage)})),l+=function(e,o,t,r,a,l,d,h,u,g){const p=h?" checked disabled":"",m=u?"checked":"",b=n([{translations:e,key:"title"},{translations:e,key:"description"},{translations:o,key:"highlightedGroup"},{translations:o,key:"showCookieSettings"},{translations:o,key:"hideCookieSettings"},{translations:o,key:"tableHeadingsName"},{translations:o,key:"tableHeadingsHostName"},{translations:o,key:"tableHeadingsDescription"},{translations:o,key:"tableHeadingsExpiration"},{translations:o,key:"tableHeadingsType"}],t,r,a);return Object.assign(b,n([{translations:o,key:"highlightedGroupAria",parameters:{title:b.title.value}}],t,r,a)),`\n
\n
\n \n \n
\n ${s(b.highlightedGroup,b.highlightedGroupAria,"info")}\n

${b.description.value}

\n
\n ${c(g,l,o,t,r,a)}\n
\n\n
\n `}(e,t,o,this.#f,this.#m.fallbackLanguage,e.groupId,g,r,h,u)})),l}#Q(e){const o=document.createElement("style");o.textContent= +":host{--container-width-xl:1200px;--color-bus:#0000bf;--color-bus-light:#f0f0ff;--color-bus-dark:#00005e;--color-coat-of-arms:#0072c6;--color-coat-of-arms-light:#e6f4ff;--color-coat-of-arms-dark:#005799;--color-silver:#dedfe1;--color-focus-outline:#0072c6;--color-black:#000;--color-white:#fff;--color-black-5:#f2f2f2;--color-black-10:#e6e6e6;--color-black-20:#ccc;--color-black-40:#999;--color-black-50:grey;--color-black-60:#666;--color-black-80:#333;--color-black-90:#1a1a1a;--color-error:#b01038;--color-error-light:#f6e2e6;--color-error-dark:#8d0d2d;--color-success:#007a64;--color-success-light:#e2f5f3;--color-success-dark:#006250;--color-info:#0062b9;--color-info-light:#e5eff8;--spacing-layout-2-xs:1rem;--spacing-layout-xs:1.5rem;--spacing-layout-s:2rem;--spacing-layout-m:3rem;--spacing-layout-l:4rem;--spacing-3-xs:0.25rem;--spacing-2-xs:0.5rem;--spacing-xs:0.75rem;--spacing-s:1rem;--spacing-m:1.5rem;--fontsize-heading-xxs:1rem;--fontsize-body-s:0.875rem;--fontsize-body-m:1rem;--fontsize-body-l:1.125rem;--font-default:helsinkigrotesk,arial,sans-serif;--lineheight-s:1;--lineheight-m:1.2;--lineheight-l:1.5}.hds-icon--angle-down{-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 13.5l5-5 1.5 1.5-6.5 6.5L5.5 10 7 8.5l5 5z' fill='currentColor'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 13.5l5-5 1.5 1.5-6.5 6.5L5.5 10 7 8.5l5 5z' fill='currentColor'/%3E%3C/svg%3E\")}.hds-icon--check-circle-fill{-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 3a9 9 0 100 18 9 9 0 000-18zm4.5 5L18 9.5 10.5 17 6 12.5 7.5 11l3 3 6-6z' fill='currentColor'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 3a9 9 0 100 18 9 9 0 000-18zm4.5 5L18 9.5 10.5 17 6 12.5 7.5 11l3 3 6-6z' fill='currentColor'/%3E%3C/svg%3E\")}.hds-icon--info-circle-fill{-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 3a9 9 0 100 18 9 9 0 000-18zm1 7v6.5h2V18H9v-1.5h2v-5H9V10h4zm-1.188-4a1.312 1.312 0 110 2.625 1.312 1.312 0 010-2.625z' fill='currentColor'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 3a9 9 0 100 18 9 9 0 000-18zm1 7v6.5h2V18H9v-1.5h2v-5H9V10h4zm-1.188-4a1.312 1.312 0 110 2.625 1.312 1.312 0 010-2.625z' fill='currentColor'/%3E%3C/svg%3E\")}.hds-button{--border-width:2px;--color:inherit;--min-size:44px;--outline-gutter:2px;--outline-width:3px;align-content:flex-start;align-items:center;background-color:var(--background-color,transparent);border:var(--border-width) solid var(--border-color,transparent);border-radius:0;color:var(--color);cursor:pointer;display:inline-flex;font-family:inherit;font-size:100%;font-weight:500;justify-content:center;line-height:1.15;margin:0;min-height:var(--min-size);min-width:var(--min-size);padding:0 var(--spacing-2-xs);position:relative;text-decoration:none;text-transform:none;vertical-align:top}.hds-button,.hds-button *,.hds-button:after,.hds-button :after,.hds-button:before,.hds-button :before{box-sizing:border-box}.hds-button[type=button],.hds-button[type=reset],.hds-button[type=submit],button.hds-button{-webkit-appearance:button}.hds-button:-moz-focus-inner,.hds-button[type=button]:-moz-focus-inner,.hds-button[type=reset]:-moz-focus-inner,.hds-button[type=submit]:-moz-focus-inner{border-style:none;padding:0}.hds-button:-moz-focusring,.hds-button[type=button]:-moz-focusring,.hds-button[type=reset]:-moz-focusring,.hds-button[type=submit]:-moz-focusring{outline:1px dotted ButtonText}.hds-button.focus-visible,.hds-button:focus-visible,.hds-button:hover{transition-duration:85ms;transition-property:background-color,border-color,color;transition-timing-function:ease-out}.hds-button:hover{background-color:var(--background-color-hover,transparent);color:var(--color-hover)}.hds-button.focus-visible,.hds-button:active,.hds-button:focus-visible{background-color:var(--background-color-focus,transparent);color:var(--color-focus);outline:none}.hds-button:not(:disabled){border-color:var(--border-color,transparent)}.hds-button:disabled{background-color:var(--background-color-disabled,transparent);border-color:var(--border-color-disabled,transparent);color:var(--color-disabled);cursor:not-allowed}.hds-button.focus-visible:hover,.hds-button:active:hover,.hds-button:focus-visible:hover{background-color:var(--background-color-hover-focus,transparent)}.hds-button:not(:disabled):hover{border-color:var(--border-color-hover,transparent)}.hds-button:not(:disabled).focus-visible,.hds-button:not(:disabled):active,.hds-button:not(:disabled):focus-visible{border-color:var(--border-color-focus,transparent)}.hds-button:not(:disabled).focus-visible:hover,.hds-button:not(:disabled):active:hover,.hds-button:not(:disabled):focus-visible:hover{border-color:var(--border-color-hover-focus,transparent);color:var(--color-hover-focus)}.hds-button:after{--size:100%;border:var(--outline-width) solid transparent;content:\"\";height:var(--size);position:absolute;width:var(--size)}.hds-button.focus-visible:after,.hds-button:active:after,.hds-button:focus-visible:after{--size:calc(100% + calc(var(--outline-width) * 2 + var(--border-width) * 2 + var(--outline-gutter) * 2));border-color:var(--focus-outline-color)}.hds-button__label,input[type=button].hds-button,input[type=reset].hds-button,input[type=submit].hds-button{font-weight:inherit;line-height:1.25em;padding:var(--spacing-s)}input[type=button].hds-button,input[type=reset].hds-button,input[type=submit].hds-button{cursor:pointer;padding:var(--spacing-s) var(--spacing-l)}input[type=button].hds-button.focus-visible,input[type=button].hds-button:focus-visible,input[type=reset].hds-button.focus-visible,input[type=reset].hds-button:focus-visible,input[type=submit].hds-button.focus-visible,input[type=submit].hds-button:focus-visible{box-shadow:0 0 0 var(--outline-gutter) var(--submit-input-focus-gutter-color),0 0 0 calc(var(--outline-gutter) + var(--outline-width)) var(--focus-outline-color)}.hds-button__label:only-child{margin:0 var(--spacing-2-xs)}.hds-button--small .hds-button__label{line-height:var(--lineheight-s);padding:var(--spacing-2-xs) var(--spacing-xs)}.hds-button--supplementary .hds-button__label:first-child{padding-right:var(--spacing-2-xs)}.hds-button--small .hds-button__label:only-child{margin:0 var(--spacing-xs)}.hds-button--supplementary .hds-icon+.hds-button__label:last-child{padding-left:var(--spacing-2-xs)}.hds-button--supplementary .hds-icon+.hds-button__label:not(:last-child){padding-left:var(--spacing-2-xs);padding-right:var(--spacing-2-xs)}.hds-button--small{padding:0}input[type=button].hds-button--small,input[type=reset].hds-button--small,input[type=submit].hds-button--small{line-height:var(--lineheight-s);padding:var(--spacing-2-xs) var(--spacing-m)}.hds-button--small .hds-button__label:not(:first-of-type):not(:last-of-type){padding:var(--spacing-2-xs) var(--spacing-2-xs)}.hds-button .hds-icon{height:var(--spacing-m);margin-left:var(--spacing-s);width:var(--spacing-m)}.hds-button__label~.hds-icon{margin:0 var(--spacing-s) 0 0}.hds-button--small .hds-icon{margin-left:var(--spacing-2-xs)}.hds-button .hds-button--small .hds-button__label~.hds-icon{margin:0 var(--spacing-2-xs) 0 0}.hds-button .hds-icon:first-of-type:not(:last-of-type){margin:0 0 0 var(--spacing-2-xs)}.hds-button .hds-icon:last-of-type:not(:first-of-type){margin:0 var(--spacing-2-xs) 0 0}.hds-button--small .hds-icon:first-child:not(:last-of-type){margin:0 0 0 var(--spacing-2-xs)}.hds-button--small .hds-icon:last-child:not(:first-of-type){margin:0 var(--spacing-2-xs) 0 0}.hds-button--secondary,.hds-theme--bus .hds-button--secondary{--border-color:var(--color-bus);--border-color-hover:var(--color-bus-dark);--border-color-focus:var(--color-bus);--border-color-hover-focus:var(--color-bus-dark);--border-color-disabled:var(--color-black-50);--focus-outline-color:var(--color-focus-outline);--submit-input-focus-gutter-color:var(--color-white)}.hds-button--secondary,.hds-button--supplementary,.hds-theme--bus .hds-button--secondary,.hds-theme--bus .hds-button--supplementary{--background-color:transparent;--background-color-hover:var(--color-bus-light);--background-color-focus:transparent;--background-color-hover-focus:var(--color-bus-light);--background-color-disabled:transparent;--color:var(--color-bus);--color-hover:var(--color-bus-dark);--color-focus:var(--color-bus);--color-hover-focus:var(--color-bus-dark);--color-disabled:var(--color-black-40)}.hds-button--supplementary,.hds-theme--bus .hds-button--supplementary{--border-color:transparent;--border-color-hover:transparent;--border-color-focus:var(--color-focus-outline);--border-color-hover-focus:var(--color-focus-outline);--border-color-disabled:transparent;--focus-outline-color:transparent;--submit-input-focus-gutter-color:transparent}.hds-button--secondary.hds-button--theme-coat,.hds-theme--coat.hds-button--secondary,.hds-theme--coat .hds-button--secondary{--border-color:var(--color-coat-of-arms);--border-color-hover:var(--color-coat-of-arms-dark);--border-color-focus:var(--color-coat-of-arms);--border-color-hover-focus:var(--color-coat-of-arms-dark)}.hds-button--secondary.hds-button--theme-coat,.hds-button--supplementary.hds-button--theme-coat,.hds-theme--coat.hds-button--secondary,.hds-theme--coat .hds-button--secondary,.hds-theme--coat.hds-button--supplementary,.hds-theme--coat .hds-button--supplementary{--background-color:transparent;--background-color-hover:var(--color-coat-of-arms-light);--background-color-focus:transparent;--background-color-hover-focus:var(--color-coat-of-arms-light);--color:var(--color-coat-of-arms);--color-hover:var(--color-coat-of-arms);--color-focus:var(--color-coat-of-arms);--color-hover-focus:var(--color-coat-of-arms)}.hds-button--supplementary.hds-button--theme-coat,.hds-theme--coat.hds-button--supplementary,.hds-theme--coat .hds-button--supplementary{--border-color:transparent;--border-color-hover:transparent;--border-color-focus:var(--color-focus-outline);--border-color-hover-focus:var(--color-focus-outline)}.hds-button--secondary.hds-button--theme-black,.hds-theme--black.hds-button--secondary,.hds-theme--black .hds-button--secondary{--border-color:var(--color-black);--border-color-hover:var(--color-black);--border-color-focus:var(--color-black);--border-color-hover-focus:var(--color-black)}.hds-button--secondary.hds-button--theme-black,.hds-button--supplementary.hds-button--theme-black,.hds-theme--black.hds-button--secondary,.hds-theme--black .hds-button--secondary,.hds-theme--black.hds-button--supplementary,.hds-theme--black .hds-button--supplementary{--background-color:transparent;--background-color-hover:var(--color-black-5);--background-color-focus:transparent;--background-color-hover-focus:var(--color-black-5);--color:var(--color-black);--color-hover:var(--color-black);--color-focus:var(--color-black);--color-hover-focus:var(--color-black)}.hds-button--supplementary.hds-button--theme-black,.hds-theme--black.hds-button--supplementary,.hds-theme--black .hds-button--supplementary{--border-color:transparent;--border-color-hover:transparent;--border-color-focus:var(--color-focus-outline);--border-color-hover-focus:var(--color-focus-outline)}.hds-checkbox{--size:24px;--icon-scale:1;--border-width:2px;--outline-width:3px;--label-font-size:var(--fontsize-body-m);--label-padding:var(--spacing-2-xs);--icon-size:var(--spacing-m);display:flex;flex-wrap:wrap;min-height:var(--size);position:relative}.hds-checkbox,.hds-checkbox *,.hds-checkbox :after,.hds-checkbox :before{box-sizing:border-box}.hds-checkbox,.hds-theme--bus .hds-checkbox{--background-unselected:transparent;--background-selected:var(--color-bus);--background-hover:var(--color-bus-dark);--background-disabled:var(--color-black-10);--border-color-selected:var(--color-bus);--border-color-selected-hover:var(--color-bus-dark);--border-color-selected-focus:var(--color-bus);--border-color-unselected:var(--color-black-50);--border-color-unselected-hover:var(--color-black-90);--border-color-unselected-focus:var(--color-black-90);--border-color-disabled:var(--color-black-10);--icon-color-unselected:transparent;--icon-color-selected:var(--color-white);--icon-color-disabled:var(--color-white);--label-color:var(--color-black-90);--label-color-disabled:var(--color-black-40)}.hds-theme--coat .hds-checkbox{--background-selected:var(--color-coat-of-arms);--background-hover:var(--color-coat-of-arms-dark);--border-color-selected:var(--color-coat-of-arms);--border-color-selected-hover:var(--color-coat-of-arms-dark);--border-color-selected-focus:var(--color-coat-of-arms)}.hds-theme--black .hds-checkbox{--background-selected:var(--color-black);--background-hover:var(--color-black-80);--border-color-selected:var(--color-black);--border-color-selected-hover:var(--color-black-80);--border-color-selected-focus:var(--color-black)}.hds-checkbox:not(:first-of-type){margin-top:var(--spacing-2-xs)}.hds-checkbox .hds-checkbox__input:before,.hds-checkbox .hds-checkbox__label:after,.hds-checkbox .hds-checkbox__label:before{content:\"\";left:0;position:absolute;top:0}.hds-checkbox .hds-checkbox__input:before{background-color:var(--icon-color-unselected);height:var(--size);-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cpath d='M0 0h24v24H0z'/%3E%3Cpath fill='currentColor' d='M21 7L10 18l-5.5-5.5L6 11l4 4 9.5-9.5z'/%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cpath d='M0 0h24v24H0z'/%3E%3Cpath fill='currentColor' d='M21 7L10 18l-5.5-5.5L6 11l4 4 9.5-9.5z'/%3E%3C/g%3E%3C/svg%3E\");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:calc(var(--size) * var(--icon-scale));mask-size:calc(var(--size) * var(--icon-scale));transform:scale(.6);width:var(--size);z-index:1}.hds-checkbox .hds-checkbox__label:before{height:var(--size);width:var(--size)}.hds-checkbox .hds-checkbox__label:after{background-color:var(--background-unselected);border:var(--border-width) solid var(--border-color-unselected);height:var(--size);width:var(--size)}.hds-checkbox .hds-checkbox__input:focus+.hds-checkbox__label:after,.hds-checkbox .hds-checkbox__input:focus:before,.hds-checkbox .hds-checkbox__input:hover+.hds-checkbox__label:after,.hds-checkbox .hds-checkbox__input:hover:before{transition:85ms ease-out;transition-property:background-color,border-color,transform}.hds-checkbox .hds-checkbox__input:focus+.hds-checkbox__label:before{outline:var(--outline-width) solid var(--focus-outline-color,var(--color-focus-outline));outline-offset:var(--focus-outline-offset,0);transform:translateZ(0);transition:85ms ease-out;transition-property:outline,outline-offset,transform}.hds-checkbox .hds-checkbox__input{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;font-family:inherit;font-size:100%;height:var(--size);left:0;line-height:1.15;margin:0;outline:none;position:absolute;top:0;width:var(--size)}.hds-checkbox .hds-checkbox__label{color:var(--label-color);cursor:pointer;font-size:var(--label-font-size);line-height:var(--lineheight-m);padding-left:calc(var(--size) + var(--label-padding));padding-top:calc((var(--size) - var(--label-font-size) * var(--lineheight-m)) / 2);position:relative}.hds-checkbox .hds-checkbox__label--hidden{padding-left:var(--size)}.hds-checkbox__error-text{background-color:var(--color-error-light);border-left:8px solid var(--color-error);color:var(--color-black);display:flex;flex-basis:100%;font-size:var(--fontsize-body-m);margin-top:var(--spacing-2-xs);padding:var(--spacing-2-xs);position:relative}.hds-checkbox__error-text:before{background:var(--color-error);content:\"\";display:inline-block;height:var(--icon-size);margin-right:var(--spacing-2-xs);-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11.175 3.456c.349-.586 1.223-.607 1.61-.063l.04.063 9.052 15.21c.343.577-.072 1.285-.753 1.332l-.072.002H2.948c-.7 0-1.15-.689-.858-1.273l.033-.06 9.052-15.21zM13 16v2h-2v-2h2zm0-7.5v6h-2v-6h2z' fill='currentColor'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11.175 3.456c.349-.586 1.223-.607 1.61-.063l.04.063 9.052 15.21c.343.577-.072 1.285-.753 1.332l-.072.002H2.948c-.7 0-1.15-.689-.858-1.273l.033-.06 9.052-15.21zM13 16v2h-2v-2h2zm0-7.5v6h-2v-6h2z' fill='currentColor'/%3E%3C/svg%3E\");pointer-events:none;width:var(--icon-size)}.hds-checkbox .hds-checkbox__input:checked:before{background-color:var(--icon-color-selected);transform:scale(1)}.hds-checkbox .hds-checkbox__input:checked+.hds-checkbox__label:after,.hds-checkbox .hds-checkbox__input:indeterminate+.hds-checkbox__label:after{background-color:var(--background-selected);border-color:var(--border-color-selected)}.hds-checkbox .hds-checkbox__input:disabled+.hds-checkbox__label:after{background-color:var(--background-disabled);border-color:var(--border-color-disabled)}.hds-checkbox .hds-checkbox__input:not(:disabled):focus+.hds-checkbox__label:after{border-color:var(--border-color-unselected-focus)}.hds-checkbox .hds-checkbox__input:not(:disabled):hover+.hds-checkbox__label:after,.hds-checkbox .hds-checkbox__input:not(:disabled):hover:focus+.hds-checkbox__label:after{border-color:var(--border-color-unselected-hover)}.hds-checkbox .hds-checkbox__input:not(:disabled):checked:focus+.hds-checkbox__label:after,.hds-checkbox .hds-checkbox__input:not(:disabled):indeterminate:focus+.hds-checkbox__label:after{border-color:var(--border-color-selected-focus)}.hds-checkbox .hds-checkbox__input:not(:disabled):checked:hover+.hds-checkbox__label:after,.hds-checkbox .hds-checkbox__input:not(:disabled):checked:hover:focus+.hds-checkbox__label:after,.hds-checkbox .hds-checkbox__input:not(:disabled):indeterminate:hover+.hds-checkbox__label:after,.hds-checkbox .hds-checkbox__input:not(:disabled):indeterminate:hover:focus+.hds-checkbox__label:after{background-color:var(--background-hover);border-color:var(--border-color-selected-hover)}.hds-checkbox .hds-checkbox__input:disabled+.hds-checkbox__label{color:var(--label-color-disabled)}.hds-checkbox .hds-checkbox__input:checked:disabled:before{background-color:var(--icon-color-disabled)}.hds-checkbox .hds-checkbox__input:disabled,.hds-checkbox .hds-checkbox__input:disabled+.hds-checkbox__label{cursor:not-allowed}:host .hds-cc__form .hds-checkbox{--label-color-disabled:var(--color-black-60)}.hds-icon{--icon-size:100%;background-color:currentcolor;display:inline-block;height:var(--icon-size);-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:auto;mask-size:auto;width:var(--icon-size)}.hds-notification{--notification-background-color:var(--color-info-light);--notification-border-color:var(--color-info);--notification-border-width:var(--spacing-2-xs);--notification-icon-color:var(--color-info);--notification-color:var(--color-black-90);--notification-max-width-inline:none;--notification-max-width-toast:21rem;--notification-z-index-inline:auto;--notification-z-index-toast:99;--notification-offset:var(--spacing-layout-s);--notification-padding:var(--spacing-s);background-color:var(--notification-background-color);border:solid var(--notification-border-color);border-left-width:var(--notification-border-width);border-bottom-width:0;border-right-width:0;border-top-width:0;box-sizing:border-box;color:var(--notification-color);max-width:var(--notification-max-width-inline);padding:var(--notification-padding);position:relative;width:100%;z-index:var(--notification-z-index-inline)}.hds-notification__content{display:grid;grid-gap:var(--spacing-s);gap:var(--spacing-s)}.hds-notification__label{align-items:flex-start;display:flex;font-size:var(--fontsize-heading-xs);font-weight:700;letter-spacing:.4px;line-height:24px;margin-right:var(--spacing-l)}.hds-notification__label>.hds-icon{color:var(--notification-icon-color);flex:none;margin-right:var(--spacing-2-xs)}.hds-notification__body{font-size:var(--fontsize-body-s);line-height:24px}.hds-notification--small{--notification-padding:var(--spacing-2-xs)}.hds-notification--small .hds-notification__content{display:flex;grid-gap:0;gap:0}.hds-notification--small .hds-notification__label{margin-right:0}.hds-notification--small .hds-notification__body{margin-right:var(--spacing-l)}.hds-notification .hds-icon{--icon-size:var(--spacing-layout-xs)}.hds-notification__close-button{--notification-close-button-offset:var(--spacing-s);background:none;border:none;cursor:pointer;display:flex;outline:none;padding:0;position:absolute;right:var(--notification-close-button-offset);top:var(--notification-close-button-offset)}.hds-notification--large .hds-notification__close-button,.hds-notification--small .hds-notification__close-button{--notification-close-button-offset:var(--spacing-2-xs)}.hds-notification__close-button:focus{box-shadow:0 0 0 3px var(--color-focus-outline)}@media only screen and (max-width:765.98px){.hds-notification{--notification-offset:var(--spacing-s)}}.hds-notification--success{--notification-background-color:var(--color-success-light);--notification-border-color:var(--color-success);--notification-icon-color:var(--color-success)}.hds-table-container{overflow-x:auto}.hds-table-container:focus{outline:var(--color-focus-outline) 3px solid}.hds-table{--content-background-color:var(--color-white);border-collapse:collapse;line-height:1.5;width:100%}.hds-table th{border-bottom:1px solid var(--color-black-20);font-weight:500;line-height:var(--lineheight-l);text-align:left;white-space:nowrap}.hds-table__content tr td,.hds-table th{font-size:var(--fontsize-body-m);padding:var(--spacing-xs) var(--spacing-m)}.hds-table__content tr td{background-color:var(--content-background-color);border-bottom:1px solid var(--color-black-50);color:var(--color-black-90);font-weight:400;line-height:24px}.hds-table__header-row{background-color:var(--header-background-color)}.hds-table--light{--header-background-color:var(--color-silver)}.hds-table.hds-table--light th{color:var(--color-black-90)}@media (max-width:767px){.hds-table th{font-weight:700}.hds-table__content tr td,.hds-table th{font-size:var(--fontsize-body-s);padding:9px var(--spacing-s)}}.hds-theme--coat,.hds-theme--coat-of-arms{--hds-cc-border-color:var(--color-coat-of-arms)}.hds-cc--page{margin-top:var(--spacing-layout-xs);margin-bottom:var(--spacing-layout-xs)}*,:after,:before{box-sizing:inherit}html{-webkit-text-size-adjust:100%}.hds-cc{--autoheight-open-time:0.15s;--common-spacing:var(--spacing-s);--focus-outline-color:var(--focus-outline-color-override,var(--color-focus-outline,var(--color-coat-of-arms)));--outline-width:3px;color:var(--color-black-90);font-family:var(--font-default);font-size:var(--fontsize-body-m)}.hds-cc.hds-cc--banner{bottom:0;left:0;overscroll-behavior:contain;position:fixed;width:100vw;z-index:999}.hds-cc.hds-cc--page{padding-top:var(--spacing-layout-xs)}.hds-cc__container{background:var(--color-white)}.hds-cc--banner .hds-cc__container{border-top:8px solid var(--hds-cc-border-color,var(--color-bus));bottom:0;max-height:80vh;overflow-y:auto;position:absolute;width:100%;z-index:2}.hds-cc__aligner{margin-left:auto;margin-right:auto;max-width:var(--container-width-override,var(--container-width-xl))}.hds-cc--banner .hds-cc__aligner{padding:var(--spacing-layout-2-xs)}@media (min-width:768px){.hds-cc--banner .hds-cc__aligner{padding:var(--spacing-layout-s) var(--spacing-layout-xs)}}.visually-hidden{border:0;clip:rect(0,0,0,0);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.hds-cc__heading{font-size:2rem;font-weight:400;line-height:1;margin:0}.hds-cc__heading:focus{outline:var(--outline-width,3px) solid var(--focus-outline-color,#000);outline-offset:var(--outline-gutter,2px)}.hds-cc__description,.hds-cc__form p{max-width:860px}.hds-cc__description{font-size:1rem;font-weight:400;line-height:1.5;margin-bottom:var(--spacing-layout-2-xs)}.hds-cc__accordion-button .hds-icon{transition:transform .15s linear}.hds-cc__accordion-button[aria-expanded=true] .hds-icon{transform:rotate(180deg)}.hds-cc__accordion-button .hds-button__label{padding-left:var(--spacing-2-xs);padding-right:var(--spacing-2-xs)}.hds-cc__accordion-button:not(.hds-cc__accordion-button--read-more){margin-bottom:16px;padding-right:6px}.hds-cc__accordion-button--read-more{display:none;font-size:1rem;grid-area:readmore;line-height:2}.hds-cc--banner .hds-cc__form{--internal-autoheight-open-time:var(--autoheight-open-time,0.3s);display:grid;grid-template-rows:1fr;transition:grid-template-rows var(--internal-autoheight-open-time) linear}@media (prefers-reduced-motion){.hds-cc--banner .hds-cc__form{--internal-autoheight-open-time:0s}}.hds-cc__form__animator{margin-left:-5px;margin-right:-5px;overflow:hidden;padding-left:5px;padding-right:5px;transform:translateY(0)}.hds-cc--banner :not([aria-expanded=true])+.hds-cc__form{grid-template-rows:0fr}.hds-cc--banner :not([aria-expanded=true])+.hds-cc__form .hds-cc__form__animator{transition:visibility 0s linear var(--internal-autoheight-open-time);visibility:hidden}.hds-cc--page .hds-cc__accordion-button--details{display:none}.hds-cc__groups{padding-bottom:var(--spacing-layout-s)}.hds-cc__notification_container .hds-notification{margin-bottom:var(--spacing-layout-s)}@keyframes entryAnimation{0%{opacity:0;transform:translateY(-20px)}to{opacity:1;transform:translateY(0)}}@keyframes exitAnimation{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(20px)}}.hds-notification.enter{animation:entryAnimation .5s ease-out forwards}.hds-notification.exit{animation:exitAnimation .5s ease-out forwards}@media (prefers-reduced-motion:reduce){.hds-notification.enter,.hds-notification.exit{animation-duration:0s!important}}.hds-cc__group{border-bottom:1px solid var(--color-black-60);padding-bottom:var(--spacing-layout-2-xs);padding-top:var(--spacing-layout-s)}.hds-cc__group:first-of-type{border-top:1px solid var(--color-black-60)}.hds-cc__group .hds-notification{display:none}.hds-cc__group--highlight .hds-notification{display:block;margin-top:var(--spacing-layout-2-xs)}.hds-cc__group-details{--internal-autoheight-open-time:var(--autoheight-open-time,0.3s);display:grid;grid-template-rows:1fr;transition:grid-template-rows var(--internal-autoheight-open-time) linear}@media (prefers-reduced-motion){.hds-cc__group-details{--internal-autoheight-open-time:0s}}.hds-cc__group-details__animator{margin-left:-5px;margin-right:-5px;overflow:hidden;padding-left:5px;padding-right:5px;transform:translateY(0)}:not([aria-expanded=true])+.hds-cc__group-details{grid-template-rows:0fr}:not([aria-expanded=true])+.hds-cc__group-details .hds-cc__group-details__animator{transition:visibility 0s linear var(--internal-autoheight-open-time);visibility:hidden}.hds-cc__group-details__animator .hds-table-container{margin-top:5px;margin-bottom:5px}.hds-cc--banner [aria-controls=hds-cc-form]:not([aria-expanded=true])~.hds-cc__buttons .hds-cc__selected-cookies-button,.hds-cc--page .hds-cc__all-cookies-button,:not([aria-expanded=true])>.hds-cc__accordion-button-hide,[aria-controls=hds-cc-form][aria-expanded=true]~.hds-cc__buttons .hds-cc__all-cookies-button,[aria-expanded=true]>.hds-cc__accordion-button-show{display:none}.hds-cc__form{--autoheight-open-time:0.2s}.hds-cc__buttons{grid-column-gap:32px;-moz-column-gap:32px;column-gap:32px;display:flex;flex-direction:column;grid-row-gap:16px;row-gap:16px}@media (min-width:768px){.hds-cc__buttons{flex-direction:row}}",e.appendChild(o)}#j(e,o,r,s=null,c=[]){let l,d=s;if(r){const e=document.querySelector(this.#z);if(!e)throw new Error(`Cookie consent: The targetSelector element '${this.#z}' was not found`);if(l=document.querySelector(this.#A),!l)throw new Error(`Cookie consent: The spacerParentSelector element '${this.#A}' was not found`);if(!document.querySelector(this.#H))throw new Error(`Cookie consent: The pageContentSelector element '${this.#H}' was not found`);d=e}const h=document.createElement("div");if(h.classList.add(t.targetClass),h.style.all="var(--hds-cc--all-override, initial)!important",r||(d.innerHTML=""),d.prepend(h),r){const e=a(!1);h.insertAdjacentHTML("beforebegin",e),this.#N.ariaLive=d.querySelector(`#${t.ariaLiveId}`)}const u=h.attachShadow({mode:"open"});this.#Q(u);const g=this.#D.getCookie(),p=g?g.groups:[],m=[this.#Z(o.requiredGroups,e,o.translations,!0,p),this.#Z(o.optionalGroups,e,o.translations,!1,p)].join("");u.innerHTML+=function(e,o,r,s,c,l,d,h=!0){let u="";h||(u=a(!0));const g=n([{translations:e,key:"bannerAriaLabel",parameters:c},{translations:e,key:"heading",parameters:c},{translations:e,key:"description",parameters:c},{translations:e,key:"showDetails",parameters:c},{translations:e,key:"hideDetails",parameters:c},{translations:e,key:"formHeading",parameters:c},{translations:e,key:"formText",parameters:c},{translations:e,key:"approveRequiredAndSelectedConsents",parameters:c},{translations:e,key:"approveAllConsents",parameters:c},{translations:e,key:"approveOnlyRequiredConsents",parameters:c}],o,r,s),p=r[o]?o:s,m=r[p]||"ltr";return`\n
\n
\n
\n\n

\n ${g.heading.value}\n

\n

\n ${g.description.value}\n

\n\n
\n
\n
`}(o.translations,e,this.#f,o.fallbackLanguage,o,m,this.#$,r),this.#I=u,this.#D.setFormReference(u.querySelector("form"));const b=u.querySelector("form");if(u.querySelectorAll("button[type=submit]").forEach((e=>{e.addEventListener("click",(e=>{this.#U(e.currentTarget.dataset.approved,b)}))})),r){this.#N.bannerContainer=h;const e=document.createElement("style");e.innerHTML=`${this.#H} * {scroll-margin-bottom: calc(var(--hds-cookie-consent-height, -8px) + 8px);}`,document.head.appendChild(e);const o=document.createElement("div");o.id=t.spacerId,this.#N.spacer=o,l.appendChild(o),o.style.height="var(--hds-cookie-consent-height, 0)";const r=new ResizeObserver((e=>{e.forEach((e=>{const o=parseInt(e.contentRect.height,10),t=parseInt(getComputedStyle(e.target).borderTopWidth,10);document.documentElement.style.setProperty("--hds-cookie-consent-height",`${o+t}px`)}))})),n=u.querySelector(`.${t.containerClass}`);r.observe(n),this.#q={resizeObserver:r,bannerHeightElement:n},u.querySelector(".hds-cc").focus()}if(this.#J(),c.length>0){let e=null;c.forEach((o=>{const r=b.querySelector(`div[data-group-id=${o}]`);r&&(r.classList.add(t.groupHighlightClass),null===e&&(e=r))})),null!==e&&(u.querySelector(`.${t.accordionButtonDetailsClass}`).click(),setTimeout((()=>{e.scrollIntoView({behavior:"auto"})}),500))}}async#M(){await new Promise((e=>{"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()})),this.removeBanner();let e=null;this.#G&&(e=document.querySelector(this.#G));const{siteSettings:o,directions:t}=await this.#D.init();if(this.#m=o,this.#f=t,!this.#O)if(e)this.#B=e,this.#j(this.#E,o,!1,e);else{this.#P()&&this.#j(this.#E,o,!0)}const r=o.monitorInterval||0,n=o.remove||!1;return this.#d.init(this.#D,r,n),Promise.resolve()}}return x.addToHdsScope("CookieConsentClass",x),e.CookieConsentCore=x,e.cookieEventType=k,Object.defineProperty(e,"__esModule",{value:!0}),e}({}); \ No newline at end of file diff --git a/modules/hdbt_cookie_banner/assets/json/siteSettings.schema.json b/modules/hdbt_cookie_banner/assets/json/siteSettings.schema.json index 810df5d65..835eb304b 100644 --- a/modules/hdbt_cookie_banner/assets/json/siteSettings.schema.json +++ b/modules/hdbt_cookie_banner/assets/json/siteSettings.schema.json @@ -77,9 +77,9 @@ } ] }, - "type": { + "storageType": { "type": "integer", - "title": "Type", + "title": "Storage type", "description": "Type of the stored item, shown to the user and used in code.", "default": 1, "enum": [ @@ -121,7 +121,7 @@ "host", "description", "expiration", - "type" + "storageType" ] }, "Group": { @@ -340,9 +340,9 @@ "description": "Machine name for the cookie, used only in code", "minLength": 1 }, - "type": { + "storageType": { "type": "integer", - "title": "Type", + "title": "Storage type", "description": "Type of the stored item", "enum": [ 1, @@ -365,14 +365,14 @@ "title": "Robot cookie or item", "required": [ "name", - "type" + "storageType" ], "description": "(Not visible to end user)" }, "default": [ { "name": "exampleCookieName", - "type": 1 + "storageType": 1 } ] }, @@ -423,7 +423,7 @@ }, "heading": { "title": "Banner heading", - "description": "Banner heading supports ${siteName} token, it's replaced with the value from siteName setting", + "description": "Banner heading supports {{siteName}} token, it's replaced with the value from siteName setting", "options": { "disable_collapse": true }, @@ -431,9 +431,9 @@ { "$ref": "#/$defs/LocalisedUniversalText" }, { "default": { - "fi": "${siteName} käyttää evästeitä", - "sv": "${siteName} använder kakor", - "en": "${siteName} uses cookies" + "fi": "{{siteName}} käyttää evästeitä", + "sv": "{{siteName}} använder kakor", + "en": "{{siteName}} uses cookies" } } ] @@ -486,7 +486,7 @@ } ] }, - "form_heading": { + "formHeading": { "title": "Form heading", "description": "Visible when details are opened", "options": { @@ -503,7 +503,7 @@ } ] }, - "form_text": { + "formText": { "title": "Form text", "description": "Visible when details are opened", "options": { @@ -547,9 +547,9 @@ { "$ref": "#/$defs/LocalisedUniversalText" }, { "default": { - "fi": "Hyvä tietää kategorialle: ${title}", - "sv": "Bra att veta för kategorin: ${title}", - "en": "Good to know for category: ${title}" + "fi": "Hyvä tietää kategorialle: {{title}}", + "sv": "Bra att veta för kategorin: {{title}}", + "en": "Good to know for category: {{title}}" } } ] @@ -588,7 +588,7 @@ }, "acceptedAt": { "title": "Accepted at", - "description": "Formats the ${date} and ${time} (in Finnish datetime format) to tell the user when this group of cookies has been accepted.", + "description": "Formats the {{date}} and {{time}} (in Finnish datetime format) to tell the user when this group of cookies has been accepted.", "options": { "disable_collapse": true }, @@ -596,9 +596,9 @@ { "$ref": "#/$defs/LocalisedUniversalText" }, { "default": { - "fi": "Olet hyväksynyt tämän kategorian: ${date} klo ${time}.", - "sv": "Du har accepterat denna kategori: ${date} kl. ${time}.", - "en": "You have accepted this category: ${date} at ${time}." + "fi": "Olet hyväksynyt tämän kategorian: {{date}} klo {{time}}.", + "sv": "Du har accepterat denna kategori: {{date}} kl. {{time}}.", + "en": "You have accepted this category: {{date}} at {{time}}." } } ] @@ -765,7 +765,7 @@ } ] }, - "type_1": { + "storageType1": { "title": "Type 1 - Cookie", "description": "Text for type column to show to users with cookies", "options": { @@ -782,7 +782,7 @@ } ] }, - "type_2": { + "storageType2": { "title": "Type 2 - localStorage", "description": "Text for type column to show to users with localStorage items", "options": { @@ -795,7 +795,7 @@ } ] }, - "type_3": { + "storageType3": { "title": "Type 3 - sessionStorage", "description": "Text for type column to show to users with sessionStorage items", "options": { @@ -808,7 +808,7 @@ } ] }, - "type_4": { + "storageType4": { "title": "Type 4 - IndexedDB", "description": "Text for type column to show to users with indexedDB tables", "options": { @@ -821,7 +821,7 @@ } ] }, - "type_5": { + "storageType5": { "title": "Type 5 - Cache Storage", "description": "Text for type column to show to users with Cache Storage items", "options": { @@ -841,8 +841,8 @@ "description", "showDetails", "hideDetails", - "form_heading", - "form_text", + "formHeading", + "formText", "highlightedGroup", "highlightedGroupAria", "showCookieSettings", @@ -858,11 +858,11 @@ "approveOnlyRequiredConsents", "settingsSaved", "notificationAriaLabel", - "type_1", - "type_2", - "type_3", - "type_4", - "type_5" + "storageType1", + "storageType2", + "storageType3", + "storageType4", + "storageType5" ] } }, diff --git a/modules/hdbt_cookie_banner/assets/json/siteSettingsTemplate.json b/modules/hdbt_cookie_banner/assets/json/siteSettingsTemplate.json index b1dd3ee1d..4484457f1 100644 --- a/modules/hdbt_cookie_banner/assets/json/siteSettingsTemplate.json +++ b/modules/hdbt_cookie_banner/assets/json/siteSettingsTemplate.json @@ -37,7 +37,7 @@ { "name": "change-me", "host": "change-me.hel.fi", - "type": 1, + "storageType": 1, "description": { "fi": "Sivusto käyttää tätä evästettä tietojen tallentamiseen siitä, ovatko kävijät antaneet hyväksyntänsä tai kieltäytyneet evästeiden käytöstä.", "sv": "Cookie möjliggör hantering av cookies på webbplatsen.", @@ -52,7 +52,7 @@ { "name": "SSESS*", "host": "change-me.hel.fi", - "type": 1, + "storageType": 1, "description": { "fi": "Sisällönhallintajärjestelmän toimintaan liittyvä eväste.", "sv": "En cookie relaterad till driften av innehållshanteringssystemet.", @@ -67,7 +67,7 @@ { "name": "mtm_cookie_consent", "host": "kartta.hel.fi", - "type": 1, + "storageType": 1, "description": { "fi": "Tekninen eväste johon talletetaan tieto valinnastasi evästeiden käytöstä kertovan bannerin kohdalla", "sv": "A technical cookie that stores information about how you responded to the notice in the cookie banner about the use of cookies.", @@ -82,7 +82,7 @@ { "name": "JSESSIONID", "host": "helsinkikanava.fi", - "type": 1, + "storageType": 1, "description": { "fi": "Sivuston pakollinen eväste mahdollistaa kävijän vierailun sivustolla.", "sv": "Kakan är en obligatorisk kaka som gör det möjligt för besökaren att besöka webbplatsen.", @@ -97,7 +97,7 @@ { "name": "COOKIE_SUPPORT", "host": "helsinkikanava.fi", - "type": 1, + "storageType": 1, "description": { "fi": "Mahdollistaa evästeiden hallinnan sivustolla.", "sv": "Kakan möjliggör hanteringen av kakor på webbplatsen.", @@ -112,7 +112,7 @@ { "name": "GUEST_LANGUAGE_ID", "host": "helsinkikanava.fi", - "type": 1, + "storageType": 1, "description": { "fi": "Tämän evästeen on luonut Liferay, se tallentaa kieliasetukset.", "sv": "Denna cookie genereras av Liferay, dess funktion är att lagra språkinställningarna.", @@ -127,7 +127,7 @@ { "name": "helfi-settings", "host": "change-me.hel.fi", - "type": 2, + "storageType": 2, "description": { "fi": "Sivusto käyttää tätä tietuetta tietojen tallentamiseen siitä, mitä poikkeusilmoituksia on suljettu ja mikä on avattavien sisältöalueiden tila.", "sv": "Används av hel.fi Drupal för att lagra information om stängda meddelanden och accordions' tillstånd.", @@ -153,7 +153,7 @@ { "name": "editoria11yResultCount", "host": "change-me.hel.fi", - "type": 2, + "storageType": 2, "description": { "fi": "Tallentaa sisällöntuottajan näkemien saavutettavuusongelmien lukumäärän nykyisellä sivulla.", "sv": "Spårar tillgänglighetsproblem för den aktuella sidan när du är inloggad som redaktör på hel.fi.", @@ -164,7 +164,7 @@ { "name": "Drupal.gin.sidebarExpanded.desktop", "host": "change-me.hel.fi", - "type": 2, + "storageType": 2, "description": { "fi": "Tallentaa tiedon sisällöntuottajan käyttöliittymän sivupalkin näkyvyydestä työpöytänäkymässä.", "sv": "Lagrar om admin-sidopanelen är expanderad eller kollapsad på skrivbordet när du är inloggad som redaktör på hel.fi.", @@ -175,7 +175,7 @@ { "name": "Drupal.gin.sidebarExpanded.mobile", "host": "change-me.hel.fi", - "type": 2, + "storageType": 2, "description": { "fi": "Tallentaa tiedon sisällöntuottajan käyttöliittymän sivupalkin näkyvyydestä mobiilinäkymässä.", "sv": "Lagrar om admin-sidopanelen är expanderad eller kollapsad på mobil när du är inloggad som redaktör på hel.fi.", @@ -186,7 +186,7 @@ { "name": "Drupal.gin.darkmode", "host": "change-me.hel.fi", - "type": 2, + "storageType": 2, "description": { "fi": "Tallentaa tiedon sisällöntuottajan valitsemasta \"tumma tila\"-asetuksesta.", "sv": "Lagrar användarens mörkt läge-inställning i admin-temat när du är inloggad som redaktör på hel.fi.", @@ -197,7 +197,7 @@ { "name": "Drupal.toolbar.subtrees.*", "host": "change-me.hel.fi", - "type": 2, + "storageType": 2, "description": { "fi": "Tallentaa sisällöntuottajan näkymissä alivalikoiden tilan (laajennettu tai kutistettu), jotta se säilyy yhdenmukaisena sivulatausten välillä.", "sv": "Lagrar tillståndet för expanderade eller kollapsade undermenyer i Drupals admin-verktygsfält för en inloggad redaktör, vilket säkerställer konsekvens mellan sidladdningar.", @@ -208,7 +208,7 @@ { "name": "Drupal.off-canvas.css.*", "host": "change-me.hel.fi", - "type": 2, + "storageType": 2, "description": { "fi": "Tallentaa sisällöntuottajan käyttämän wysiwyg-editorin tyylit välimuistiin varmistaakseen viimeisimpien CSS-tyylien latauksen.", "sv": "Lagrar cachelagrad CKEditor CSS i localStorage för en inloggad redaktör, med en nyckel som använder en cache-brytande fråga för att säkerställa att den senaste CSS-filen laddas.", @@ -219,7 +219,7 @@ { "name": "ed11ySeen", "host": "change-me.hel.fi", - "type": 2, + "storageType": 2, "description": { "fi": "Tallentaa sisällöntuottajan näkemät saavutettavuusongelmat, jotta vältetään ongelmien kaksoisilmoitukset.", "sv": "Spårar vilka tillgänglighetsproblem en inloggad redaktör redan har sett för att undvika dubbla aviseringar.", @@ -230,7 +230,7 @@ { "name": "Drupal.toolbar.toolbarState", "host": "change-me.hel.fi", - "type": 3, + "storageType": 3, "description": { "fi": "Tallentaa sisällöntuottajan hallintatyökalupalkin orientaation, aktiivisen välilehden ja laajennustilan.", "sv": "Lagrar tillståndet för admin-verktygsfältet för en inloggad redaktör, inklusive dess orientering, aktiva flik och expanderade tillstånd.", @@ -245,7 +245,7 @@ { "name": "escapeAdminPath", "host": "change-me.hel.fi", - "type": 3, + "storageType": 3, "description": { "fi": "Tallentaa URL-osoitteen, jota käytetään ohjaamaan kirjautunut sisällöntuottaja hallintaliittymästä takaisin pääsivustolle.", "sv": "Lagrar URL för att omdirigera en inloggad redaktör från admin-gränssnittet tillbaka till huvudsidan.", @@ -277,7 +277,7 @@ { "name": "httpskartta.hel.fi.SWCulture", "host": "kartta.hel.fi", - "type": 1, + "storageType": 1, "description": { "fi": "Kaupungin karttapalvelun evästeeseen tallennetaan kieli, jolla palvelua käytetään.", "sv": "I kakan på stadens kaktjänst sparas det språk som användaren använder i tjänsten.", @@ -292,7 +292,7 @@ { "name": "icareus-device", "host": "helsinkikanava.fi", - "type": 1, + "storageType": 1, "description": { "fi": "Helsinki-kanavan videopalvelimen eväste.", "sv": "Helsinki-kanavas kaka gör det möjligt att göra videor till en del av innehållet på webbplatsen.", @@ -307,7 +307,7 @@ { "name": "VISITOR_INFO1_LIVE", "host": "youtube.com", - "type": 1, + "storageType": 1, "description": { "fi": "YouTuben eväste valitsee yhteyden nopeuden mukaan, joko vanhan tai uuden videosoittimen.", "sv": "YouTubes kaka väljer antingen den nya eller gamla videospelaren enligt förbindelsens hastighet.", @@ -322,7 +322,7 @@ { "name": "CONSENT", "host": "youtube.com", - "type": 1, + "storageType": 1, "description": { "fi": "Googlen eväste tallentaa kävijän evästehyväskynnän.", "sv": "Används av Google för att lagra inställningar för användarens samtycke", @@ -352,7 +352,7 @@ { "name": "_pk_id.*", "host": "change-me.hel.fi", - "type": 1, + "storageType": 1, "description": { "fi": "Matomo-tilastointijärjestelmän eväste.", "sv": "Matomo-statistiksystemets kaka samlar information om hur webbplatsen används.", @@ -367,7 +367,7 @@ { "name": "_pk_id.*", "host": "kartta.hel.fi", - "type": 1, + "storageType": 1, "description": { "fi": "Matomo-tilastointijärjestelmän eväste.", "sv": "Matomo-statistiksystemets kaka samlar information om hur webbplatsen används.", @@ -382,7 +382,7 @@ { "name": "_pk_ses.*", "host": "kartta.hel.fi", - "type": 1, + "storageType": 1, "description": { "fi": "Matomo-tilastointijärjestelmän eväste.", "sv": "Matomo-statistiksystemets kaka samlar information om hur webbplatsen används.", @@ -397,7 +397,7 @@ { "name": "_pk_id.*", "host": "palvelukartta.hel.fi", - "type": 1, + "storageType": 1, "description": { "fi": "Matomo-tilastointijärjestelmän eväste.", "sv": "Matomo-statistiksystemets kaka samlar information om hur webbplatsen används.", @@ -412,7 +412,7 @@ { "name": "_pk_ses.*", "host": "palvelukartta.hel.fi", - "type": 1, + "storageType": 1, "description": { "fi": "Matomo-tilastointijärjestelmän eväste.", "sv": "Matomo-statistiksystemets kaka samlar information om hur webbplatsen används.", @@ -427,7 +427,7 @@ { "name": "YSC", "host": "youtube.com", - "type": 1, + "storageType": 1, "description": { "fi": "YouTuben eväste mahdollistaa videoiden upottamisen sivustolle.", "sv": "YouTubes kaka gör det möjligt att göra videor till en del av innehållet på webbplatsen.", @@ -445,7 +445,7 @@ "robotCookies": [ { "name": "helfi_accordions_open", - "type": 1 + "storageType": 1 } ], "translations": { @@ -455,9 +455,9 @@ "en": "Cookie settings" }, "heading": { - "fi": "${siteName} käyttää evästeitä", - "sv": "${siteName} använder kakor", - "en": "${siteName} uses cookies" + "fi": "{{siteName}} käyttää evästeitä", + "sv": "{{siteName}} använder kakor", + "en": "{{siteName}} uses cookies" }, "description": { "fi": "Tämä sivusto käyttää välttämättömiä evästeitä sivun perustoimintojen ja suorituskyvyn varmistamiseksi. Lisäksi käytämme kohdennusevästeitä käyttäjäkokemuksen parantamiseksi, analytiikkaan ja yksilöidyn sisällön näyttämiseen.", @@ -474,12 +474,12 @@ "sv": "Stänga detaljer", "en": "Hide details" }, - "form_heading": { + "formHeading": { "fi": "Tietoa sivustolla käytetyistä evästeistä", "sv": "Information om kakor som används på webbplatsen", "en": "About the cookies used on the website" }, - "form_text": { + "formText": { "fi": "Sivustolla käytetyt evästeet on luokiteltu käyttötarkoituksen mukaan. Alla voit lukea eri luokista ja sallia tai kieltää evästeiden käytön.", "sv": "Kakorna som används på webbplatsen har klassificerats enligt användningsändamål. Du kan läsa om de olika klasserna och acceptera eller förbjuda användningen av kakor.", "en": "The cookies used on the website have been classified according to their intended use. Below, you can read about the various categories and accept or reject the use of cookies." @@ -490,9 +490,9 @@ "en": "You need to accept this category to display the content you have selected." }, "highlightedGroupAria": { - "fi": "Hyvä tietää kategorialle: ${title}", - "sv": "Bra att veta för kategorin: ${title}", - "en": "Good to know for category: ${title}" + "fi": "Hyvä tietää kategorialle: {{title}}", + "sv": "Bra att veta för kategorin: {{title}}", + "en": "Good to know for category: {{title}}" }, "showCookieSettings": { "fi": "Näytä evästeasetukset", @@ -505,9 +505,9 @@ "en": "Hide cookie settings" }, "acceptedAt": { - "fi": "Olet hyväksynyt tämän kategorian: ${date} klo ${time}.", - "sv": "Du har accepterat denna kategori: ${date} kl. ${time}.", - "en": "You have accepted this category: ${date} at ${time}." + "fi": "Olet hyväksynyt tämän kategorian: {{date}} klo {{time}}.", + "sv": "Du har accepterat denna kategori: {{date}} kl. {{time}}.", + "en": "You have accepted this category: {{date}} at {{time}}." }, "tableHeadingsName": { "fi": "Nimi", @@ -559,14 +559,14 @@ "sv": "Meddelande", "en": "Annoucement" }, - "type_1": { + "storageType1": { "fi": "Eväste", "sv": "Kakan", "en": "Cookie" }, - "type_2": "localStorage", - "type_3": "sessionStorage", - "type_4": "IndexedDB", - "type_5": "Cache Storage" + "storageType2": "localStorage", + "storageType3": "sessionStorage", + "storageType4": "IndexedDB", + "storageType5": "Cache Storage" } } From 869f1527cbfead6bac7b3c9b8bc2989376862b99 Mon Sep 17 00:00:00 2001 From: Anna Lonka Date: Mon, 2 Dec 2024 11:30:30 +0200 Subject: [PATCH 2/2] UHF-11039: Fixed loadFunction to use window instead of document --- modules/hdbt_cookie_banner/assets/js/hdbt-cookie-banner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hdbt_cookie_banner/assets/js/hdbt-cookie-banner.js b/modules/hdbt_cookie_banner/assets/js/hdbt-cookie-banner.js index 820c53244..de8b48682 100644 --- a/modules/hdbt_cookie_banner/assets/js/hdbt-cookie-banner.js +++ b/modules/hdbt_cookie_banner/assets/js/hdbt-cookie-banner.js @@ -9,7 +9,7 @@ }, loadFunction: (loadFunction) => { if (typeof loadFunction === 'function') { - document.addEventListener('hds-cookie-consent-ready', loadFunction); + window.addEventListener('hds-cookie-consent-ready', loadFunction); } }, getConsentStatus: (categories) => {