From ac9fdd04739861d0f5282995bbcea1bf569ebb99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Wed, 29 May 2024 14:46:06 +0200 Subject: [PATCH] chore: :package: NPm build --- dist/browser/cookie-cn.css | 2 +- dist/browser/cookie-cn.js | 2 +- dist/browser/typings/ts/index.d.ts | 19 ++++++++-- dist/esm/ts/index.js | 50 +++++++++++++++++++------- dist/typings/ts/index.d.ts | 19 ++++++++-- dist/umd/css/standard.css | 2 +- dist/umd/main.js | 56 ++++++++++++++++++++++++------ dist/umd/main.js.map | 2 +- 8 files changed, 119 insertions(+), 33 deletions(-) diff --git a/dist/browser/cookie-cn.css b/dist/browser/cookie-cn.css index 3a2f6bc..3ff85ab 100644 --- a/dist/browser/cookie-cn.css +++ b/dist/browser/cookie-cn.css @@ -50,7 +50,7 @@ transform: scale(0.99); } -/** 5.0.2 */ +/** 5.0.3 */ /* FENETRE D'ACCUEIL */ /* Title settings */ /* Text settings */ diff --git a/dist/browser/cookie-cn.js b/dist/browser/cookie-cn.js index 13d7aff..cb1e99f 100644 --- a/dist/browser/cookie-cn.js +++ b/dist/browser/cookie-cn.js @@ -1 +1 @@ -!function(){class e{constructor(e){this.browserCookieName="cn-init",this.cookieTimeLife=6,this.cookieExpirationName="_expiration",this.cookiePolicies={sameSite:o.lax,secure:""},this.config=e;let i=this.readCookiesExpirationDate();i||(i=new Date,i.setMonth(i.getMonth()+this.cookieTimeLife)),this.cookieExpirationDate=i;const n=document.createElement("div");n.classList.add("cn-modal-bg"),document.body.append(n),this.modalBg=n;const s=document.querySelector("div#cn-wrapper"),a=document.querySelector("button#cn-cookie-btn"),r=document.querySelector("button#cn-close-modal"),c=document.querySelectorAll(".cn-cookie-link"),d=document.querySelector("div#cn-banner"),l=document.querySelector("div.cn-banner-content"),h=document.querySelector("div.cn-modal-container"),u=document.querySelector("button#cn-accept-banner"),k=document.querySelector("button#cn-deny-banner"),C=document.querySelector("button#cn-settings-banner"),m=document.querySelector("ul#cn-modal-list"),b=document.querySelector("div.cn-modal-wrapper"),p=document.querySelector("div#cn-li-template");if(!s)throw new Error("Cannot find div#cn-wrapper");if(!a)throw new Error("Cannot find 'button#cn-cookie-btn' element");if(!r)throw new Error("Cannot find 'button#cn-close-modal' element");if(!d)throw new Error("Cannot find 'div#cn-banner' element");if(!l)throw new Error("Cannot find 'div.cn-banner-content' element");if(!h)throw new Error("Cannot find 'div.cn-modal-container' element");if(!u)throw new Error("Cannot find 'button#cn-accept-banner' element");if(!k)throw new Error("Cannot find 'button#cn-deny-banner' element");if(!C)throw new Error("Cannot find 'button.cn-settings-banner' element");if(!m)throw new Error("Cannot find 'ul#cn-modal-list' element");if(!b)throw new Error("Cannot find 'div.cn-modal-wrapper' element");if(!p)throw new Error("Cannot find 'div#cn-li-template' element");this.cookieShowModalBtn=a,this.cookieCloseModalBtn=r,this.cookieLinkShowCustomizeModalList=c,this.cookieContainer=s,this.bannerContainer=d,this.bannerContent=l,this.cookiesUnorderedList=m,this.modalWrapper=b,this.modalContainer=h,this.acceptAllBtn=u,this.denyAllBtn=k,this.customizeBtn=C,this.bannerDetailsAreExpanded=!1,this.template=p;const g=this.template.cloneNode(!0);this.template.remove(),this.template=g,this.restrictCloseModal=!0,this.addEventPrevent(this.modalBg,"click",this.closeCookieModal),this.addEventPrevent(this.cookieCloseModalBtn,"click",this.closeCookieModal),this.addEventPrevent(this.acceptAllBtn,"click",this.acceptAllCookies),this.addEventPrevent(this.denyAllBtn,"click",this.denyAllCookies),this.addEventPrevent(this.customizeBtn,"click",this.switchToModalPageOrClose),this.addEventPrevent(this.cookieShowModalBtn,"click",this.toggleCookieModal),this.cookieLinkShowCustomizeModalList.forEach((e=>{this.addEventPrevent(e,"click",this.openCookieModalToCookiePage),this.addEventKbdValidate(e,this.openCookieModalToCookiePage)})),this.cookiesMatchesConfig()&&!this.cookiesOlderThan(new Date)||(this.resetBrowserCookie(),this.openCookieModalToBannerPage()),this.updateRestrictCloseModal(),Object.entries(this.getCookieStatusList()).forEach((([e,o])=>{o!==t.wait?this.config[e]&&(o!==t.true?null!=this.config[e].fallback&&this.config[e].fallback():this.config[e].script()):this.openCookieModalToBannerPage()}))}updateRestrictCloseModal(){this.restrictCloseModal=!!Object.values(this.getCookieStatusList()).includes(t.wait),this.restrictCloseModal?this.cookieCloseModalBtn.classList.add("d-none"):this.cookieCloseModalBtn.classList.remove("d-none"),this.restrictCloseModal?this.modalBg.classList.add("cn-modal-bg-active"):this.modalBg.classList.remove("cn-modal-bg-active")}readCookiesExpirationDate(){var e;const t=(null!==(e=this.getBrowserCookieValue())&&void 0!==e?e:"").split(",").find((e=>e.startsWith(this.cookieExpirationName)));if(!t)return null;try{const e=Number.parseInt(t.replace(`${this.cookieExpirationName}=`,""));return isNaN(e)?null:new Date(e)}catch(e){return null}}cookiesOlderThan(e){return this.cookieExpirationDate.getTime()this.acceptCookie(e))),this.closeCookieModal()}acceptCookie(e){const o=this.getCookie(e);this.setCookieStatus(e,t.true,o);const i=document.getElementById(`${e}-switch`),n=null==i?void 0:i.querySelector("input");i&&n&&(n.checked=!0,i.ariaChecked="true")}denyAllCookies(){Object.keys(this.config).forEach((e=>this.denyCookie(e))),this.closeCookieModal()}denyCookie(e){const o=this.getCookie(e);this.setCookieStatus(e,t.false,o);const i=document.getElementById(`${e}-switch`),n=null==i?void 0:i.querySelector("input");i&&n&&(n.checked=!1,i.ariaChecked="false")}getCookie(e){var t;const o=null===(t=Object.entries(this.config).find((t=>t[0]===e)))||void 0===t?void 0:t[1];if(void 0===o)throw new Error(`Cookie options ${e} not found in list`);return o}getCookieStatusList(){const e=this.getBrowserCookieValue(),t={};return void 0===e||e.split(",").filter((e=>!e.startsWith(this.cookieExpirationName))).forEach((e=>{const o=e.split("=");t[o[0]]=o[1]})),t}containsCookieStatus(e){const t=this.getCookieStatusList();return void 0!==Object.keys(t).find((t=>t===e))}setCookieStatus(e,o,i){o!==t.true?o!==t.false?this.setBrowserCookieStatus(e,t.wait):this.removeCookieStatus(e,i):this.addCookieStatus(e,i)}addCookieStatus(e,o){o.script&&o.script(),this.setBrowserCookieStatus(e,t.true)}removeCookieStatus(e,o){const i=document.getElementById(e);i&&i.remove(),o.fallback&&o.fallback(),this.setBrowserCookieStatus(e,t.false)}setBrowserCookieStatus(e,t){const o=this.getCookieStatusList();this.deleteBrowserCookie(),o[e]=t,this.saveBrowserCookie(o),this.updateRestrictCloseModal()}hasBrowserCookie(){return Boolean(this.getBrowserCookieValue())}getBrowserCookieValue(){const e=document.cookie.match(new RegExp("(?:^|; )"+this.browserCookieName.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}saveBrowserCookie(e){const t=new Date,o=Object.entries(e).map((([e,t])=>`${e}=${t}`));this.cookieExpirationDate=new Date(t.setMonth(t.getMonth()+this.cookieTimeLife)),o.push(`${this.cookieExpirationName}=${this.cookieExpirationDate.getTime()}`),document.cookie=`${this.browserCookieName}=${o.join(",")};path=/${location.hostname?`;domain=${location.hostname}`:""};expires=${this.cookieExpirationDate.toUTCString()};${this.getCookiePoliciesAsString()}`}deleteBrowserCookie(){this.hasBrowserCookie()&&(document.cookie=`${this.browserCookieName}=;path=/${location.hostname?`;domain=.${location.hostname}`:""};expires=Thu, 01 Jan 1970 00:00:01 GMT;`,document.cookie=`${this.browserCookieName}=;path=/${location.hostname?`;domain=${location.hostname}`:""};expires=Thu, 01 Jan 1970 00:00:01 GMT;`)}getCookiePoliciesAsString(){return Object.entries(this.cookiePolicies).map((([e,t])=>`${e}=${t}`)).join(";")}resetBrowserCookie(){const e={};Object.entries(this.config).forEach((([o])=>e[o]=t.wait)),this.saveBrowserCookie(e)}addEvent(e,t,o){return e.addEventListener(t,o.bind(this),!1)}addEventPrevent(e,t,o){return e.addEventListener(t,(e=>{e.preventDefault(),o.call(this,e)}),!1)}addEventKbdValidate(e,t){return this.addEvent(e,"keydown",(e=>{const o=e;" "!=o.key&&"Space"!=o.code&&32!=o.keyCode&&"Enter"!=o.key&&"Enter"!=o.code&&13!=o.keyCode||(t.call(this,o),e.preventDefault())}))}toggleCookieModal(){document.body.classList.contains("cn-open")?this.closeCookieModal():this.openCookieModalToBannerPage()}openCookieModalToBannerPage(){this.openCookieModalToCookiePage(),this.toggleCookieModalPages()}openCookieModalToCookiePage(){document.body.classList.add("cn-open"),this.resetCookieModal(),this.bannerContent.classList.add("d-none"),this.modalContainer.classList.remove("d-none"),this.bannerContainer.classList.add("cn-modal-page"),this.modalWrapper.scrollTop=0,this.setupCookieModalList(),this.setTabIndex()}closeCookieModal(){if(this.updateRestrictCloseModal(),this.restrictCloseModal)throw new Error("You need to accept or refuse all cookies");document.body.classList.remove("cn-open"),this.isOnBannerPage()||(this.bannerContent.classList.toggle("d-none"),this.modalContainer.classList.toggle("d-none"),this.bannerContainer.classList.remove("cn-modal-page")),this.unsetTabIndex(),this.setupCookieModalList()}setTabIndex(){document.documentElement.setAttribute("tabindex","-1"),setTimeout((()=>{const e='a[href], button, [role="button"], input, embed, object, iframe, textarea, select, details, [tabindex]:not([tabindex="-1"])';[...document.body.querySelectorAll(e)].filter((e=>!e.hasAttribute("disabled")&&!e.getAttribute("aria-hidden")&&!this.cookieContainer.contains(e))).forEach((e=>{e.setAttribute("tabindex","-1"),e.classList.add("cn-disabled")})),[...this.cookieContainer.querySelectorAll(e)].filter((e=>!(e.hasAttribute("disabled")||e.getAttribute("aria-hidden")||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)||this.cookieContainer.contains(e)))).forEach((e=>{e.setAttribute("tabindex","0"),e.classList.remove("cn-disabled")})),this.cookieShowModalBtn.setAttribute("tabindex","-1")}),500)}unsetTabIndex(){document.documentElement.setAttribute("tabindex","0"),setTimeout((()=>{document.body.querySelectorAll(".cn-disabled").forEach((e=>{e.setAttribute("tabindex","0"),e.classList.remove("cn-disabled")})),this.cookieShowModalBtn.setAttribute("tabindex","0")}),500)}resetCookieModal(){if(this.bannerContent.classList.remove("d-none"),this.modalContainer.classList.add("d-none"),this.bannerContainer.classList.remove("cn-modal-page"),!this.customizeBtn.dataset.openModal)throw new Error("Cannot find attribut data-open-modal");this.customizeBtn.innerHTML=this.customizeBtn.dataset.openModal}setupCookieModalList(){this.cookiesUnorderedList.innerHTML="",Object.entries(this.config).forEach((([e,o])=>{const i=document.createElement("li"),n=this.template.children.item(0);if(null===n)throw new Error("Cannot find child item");i.append(n.cloneNode(!0));const s=i.querySelector("span.cn-cookie-name"),a=i.querySelector("span.cn-cookie-description"),r=i.querySelector(".cn-cookie-link"),c=i.querySelector(".cn-switch"),d=i.querySelector(".cn-switch > input");d.indeterminate=!0,d.checked=!1,s.textContent=o.name,a.id=`${e}-desc`,a.textContent=o.description,r.textContent=o.labelLink,r.setAttribute("href",o.link),c.id=`${e}-switch`,c.name=e,c.dataset.name=e,c.setAttribute("aria-labelledby",`${e}-desc`),c.setAttribute("aria-describedby",`${e}-desc`);const l=i=>{this.setCookieStatus(e,i?t.true:t.false,o)};this.addEvent(c,"click",(()=>{l(d.checked),c.ariaChecked=d.checked?"true":"false"})),this.addEventKbdValidate(c,(()=>{l(d.checked),d.checked=!d.checked,c.ariaChecked=d.checked?"true":"false"})),this.cookiesUnorderedList.append(i),this.hasBrowserCookie()&&Object.entries(this.getCookieStatusList()).forEach((([o,i])=>{if(o===e)switch(i){case t.true:d.indeterminate=!1,d.checked=!0;break;case t.false:d.indeterminate=!1,d.checked=!1;break;case t.wait:d.indeterminate=!0,d.checked=!1}}))}))}switchToModalPageOrClose(){this.isOnBannerPage()?this.toggleCookieModalPages():this.closeCookieModal()}toggleCookieModalPages(){this.bannerContent.classList.toggle("d-none"),this.modalContainer.classList.toggle("d-none"),this.bannerContainer.classList.toggle("cn-modal-page"),this.isOnBannerPage()||this.bannerContainer.classList.add("cn-modal-page"),this.setTabIndex(),this.setupCookieModalList(),this.togglePersonalizeBtn()}togglePersonalizeBtn(){const e=this.customizeBtn.dataset;this.modalWrapper.scrollTop=0,this.bannerContent.classList.contains("d-none")?(this.customizeBtn.innerHTML=e.openModal,this.customizeBtn.title=e.openModal):(this.customizeBtn.innerHTML=e.closeModal,this.customizeBtn.title=e.closeModal)}isOnBannerPage(){return this.modalContainer.classList.contains("d-none")}}var t,o;!function(e){e.true="true",e.false="false",e.wait="wait"}(t||(t={})),function(e){e.lax="lax",e.strict="strict",e.none="none"}(o||(o={}));const i=window.CookieNotice;e.noConflict=function(t=!1){return t&&window.CookieNotice===e&&(window.CookieNotice=i),e},window.CookieNotice=e.noConflict()}(); +!function(){class e{constructor(e){this.browserCookieName="cn-init",this.cookieTimeLife=6,this.cookieExpirationName="_expiration",this.cookiePolicies={sameSite:o.lax,secure:""},this.config=e;let i=this.readCookiesExpirationDate();i||(i=new Date,i.setMonth(i.getMonth()+this.cookieTimeLife)),this.cookieExpirationDate=i;const n=document.createElement("div");n.classList.add("cn-modal-bg"),document.body.append(n),this.modalBg=n;const s=document.querySelector("div#cn-wrapper"),a=document.querySelector("button#cn-cookie-btn"),r=document.querySelector("button#cn-close-modal"),c=document.querySelectorAll(".cn-cookie-link"),l=document.querySelector("div#cn-banner"),d=document.querySelector("div.cn-banner-content"),h=document.querySelector("div.cn-modal-container"),u=document.querySelector("button#cn-accept-banner"),k=document.querySelector("button#cn-deny-banner"),C=document.querySelector("button#cn-settings-banner"),m=document.querySelector("ul#cn-modal-list"),b=document.querySelector("div.cn-modal-wrapper"),p=document.querySelector("div#cn-li-template");if(!s)throw new Error("Cannot find div#cn-wrapper");if(!a)throw new Error("Cannot find 'button#cn-cookie-btn' element");if(!r)throw new Error("Cannot find 'button#cn-close-modal' element");if(!l)throw new Error("Cannot find 'div#cn-banner' element");if(!d)throw new Error("Cannot find 'div.cn-banner-content' element");if(!h)throw new Error("Cannot find 'div.cn-modal-container' element");if(!u)throw new Error("Cannot find 'button#cn-accept-banner' element");if(!k)throw new Error("Cannot find 'button#cn-deny-banner' element");if(!C)throw new Error("Cannot find 'button.cn-settings-banner' element");if(!m)throw new Error("Cannot find 'ul#cn-modal-list' element");if(!b)throw new Error("Cannot find 'div.cn-modal-wrapper' element");if(!p)throw new Error("Cannot find 'div#cn-li-template' element");this.cookieShowModalBtn=a,this.cookieCloseModalBtn=r,this.cookieLinkShowCustomizeModalList=c,this.cookieContainer=s,this.bannerContainer=l,this.bannerContent=d,this.cookiesUnorderedList=m,this.modalWrapper=b,this.modalContainer=h,this.acceptAllBtn=u,this.denyAllBtn=k,this.customizeBtn=C,this.template=p;const g=this.template.cloneNode(!0);this.template.remove(),this.template=g,this.restrictCloseModal=!0,this.addEventPrevent(this.modalBg,"click",this.closeCookieModal),this.addEventPrevent(this.cookieCloseModalBtn,"click",this.closeCookieModal),this.addEventPrevent(this.acceptAllBtn,"click",this.acceptAllCookies),this.addEventPrevent(this.denyAllBtn,"click",this.denyAllCookies),this.addEventPrevent(this.customizeBtn,"click",this.switchToModalPageOrClose),this.addEventPrevent(this.cookieShowModalBtn,"click",this.toggleCookieModal),this.cookieLinkShowCustomizeModalList.forEach((e=>{this.addEventPrevent(e,"click",this.openCookieModalToCookiePage),this.addEventKbdValidate(e,this.openCookieModalToCookiePage)})),this.cookiesMatchesConfig()&&!this.cookiesOlderThan(new Date)||(this.resetBrowserCookie(),this.openCookieModalToBannerPage()),this.updateRestrictCloseModal(),Object.entries(this.getCookieStatusList()).forEach((([e,o])=>{o!==t.wait?this.config[e]&&(o!==t.true?null!=this.config[e].fallback&&this.config[e].fallback():this.config[e].script()):this.openCookieModalToBannerPage()}))}updateRestrictCloseModal(){this.restrictCloseModal=!!Object.values(this.getCookieStatusList()).includes(t.wait),this.restrictCloseModal?this.cookieCloseModalBtn.classList.add("d-none"):this.cookieCloseModalBtn.classList.remove("d-none"),this.restrictCloseModal?this.modalBg.classList.add("cn-modal-bg-active"):this.modalBg.classList.remove("cn-modal-bg-active")}readCookiesExpirationDate(){var e;const t=(null!==(e=this.getBrowserCookieValue())&&void 0!==e?e:"").split(",").find((e=>e.startsWith(this.cookieExpirationName)));if(!t)return null;try{const e=Number.parseInt(t.replace(`${this.cookieExpirationName}=`,""));return isNaN(e)?null:new Date(e)}catch(e){return null}}cookiesOlderThan(e){return this.cookieExpirationDate.getTime()this.acceptCookie(e))),this.closeCookieModal()}acceptCookie(e){const o=this.getCookie(e);this.setCookieStatus(e,t.true,o);const i=document.getElementById(`${e}-switch`),n=null==i?void 0:i.querySelector("input");i&&n&&(n.checked=!0,i.ariaChecked="true")}denyAllCookies(){Object.keys(this.config).forEach((e=>this.denyCookie(e))),this.closeCookieModal()}denyCookie(e){const o=this.getCookie(e);this.setCookieStatus(e,t.false,o);const i=document.getElementById(`${e}-switch`),n=null==i?void 0:i.querySelector("input");i&&n&&(n.checked=!1,i.ariaChecked="false")}getCookie(e){var t;const o=null===(t=Object.entries(this.config).find((t=>t[0]===e)))||void 0===t?void 0:t[1];if(void 0===o)throw new Error(`Cookie options ${e} not found in list`);return o}getCookieStatusList(){const e=this.getBrowserCookieValue(),t={};return void 0===e||e.split(",").filter((e=>!e.startsWith(this.cookieExpirationName))).forEach((e=>{const o=e.split("=");t[o[0]]=o[1]})),t}containsCookieStatus(e){const t=this.getCookieStatusList();return void 0!==Object.keys(t).find((t=>t===e))}getCookieStatus(e){const t=this.getCookieStatusList(),o=Object.keys(t).find((t=>t===e));if(void 0===o)throw new Error(`Cookie options ${e} not found in list`);return t[o]}setCookieStatus(e,o,i){o!==t.true?o!==t.false?this.setBrowserCookieStatus(e,t.wait):this.removeCookieStatus(e,i):this.addCookieStatus(e,i)}addCookieStatus(e,o){o.script&&o.script(),this.setBrowserCookieStatus(e,t.true)}removeCookieStatus(e,o){const i=document.getElementById(e);i&&i.remove(),o.fallback&&o.fallback(),this.setBrowserCookieStatus(e,t.false)}setBrowserCookieStatus(e,t){const o=this.getCookieStatusList();this.deleteBrowserCookie(),o[e]=t,this.saveBrowserCookie(o),this.updateRestrictCloseModal()}hasBrowserCookie(){return Boolean(this.getBrowserCookieValue())}getBrowserCookieValue(){const e=document.cookie.match(new RegExp("(?:^|; )"+this.browserCookieName.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}saveBrowserCookie(e){const t=new Date,o=Object.entries(e).map((([e,t])=>`${e}=${t}`));this.cookieExpirationDate=new Date(t.setMonth(t.getMonth()+this.cookieTimeLife)),o.push(`${this.cookieExpirationName}=${this.cookieExpirationDate.getTime()}`),document.cookie=`${this.browserCookieName}=${o.join(",")};path=/${location.hostname?`;domain=${location.hostname}`:""};expires=${this.cookieExpirationDate.toUTCString()};${this.getCookiePoliciesAsString()}`}deleteBrowserCookie(){this.hasBrowserCookie()&&(document.cookie=`${this.browserCookieName}=;path=/${location.hostname?`;domain=.${location.hostname}`:""};expires=Thu, 01 Jan 1970 00:00:01 GMT;`,document.cookie=`${this.browserCookieName}=;path=/${location.hostname?`;domain=${location.hostname}`:""};expires=Thu, 01 Jan 1970 00:00:01 GMT;`)}getCookiePoliciesAsString(){return Object.entries(this.cookiePolicies).map((([e,t])=>`${e}=${t}`)).join(";")}resetBrowserCookie(){const e={};Object.entries(this.config).forEach((([o])=>e[o]=t.wait)),this.saveBrowserCookie(e)}addEvent(e,t,o){return e.addEventListener(t,o.bind(this),!1)}addEventPrevent(e,t,o){return e.addEventListener(t,(e=>{e.preventDefault(),o.call(this,e)}),!1)}addEventKbdValidate(e,t){return this.addEvent(e,"keydown",(e=>{const o=e;" "!=o.key&&"Space"!=o.code&&32!=o.keyCode&&"Enter"!=o.key&&"Enter"!=o.code&&13!=o.keyCode||(t.call(this,o),e.preventDefault())}))}toggleCookieModal(){document.body.classList.contains("cn-open")?this.closeCookieModal():this.openCookieModalToBannerPage()}openCookieModalToBannerPage(){this.openCookieModalToCookiePage(),this.toggleCookieModalPages()}openCookieModalToCookiePage(){document.body.classList.add("cn-open"),this.resetCookieModal(),this.bannerContent.classList.add("d-none"),this.modalContainer.classList.remove("d-none"),this.bannerContainer.classList.add("cn-modal-page"),this.modalWrapper.scrollTop=0,this.setupCookieModalList(),this.setTabIndex()}closeCookieModal(){if(this.updateRestrictCloseModal(),this.restrictCloseModal)throw new Error("You need to accept or refuse all cookies");document.body.classList.remove("cn-open"),this.isOnBannerPage()||(this.bannerContent.classList.toggle("d-none"),this.modalContainer.classList.toggle("d-none"),this.bannerContainer.classList.remove("cn-modal-page")),this.unsetTabIndex(),this.setupCookieModalList()}setTabIndex(){document.documentElement.setAttribute("tabindex","-1"),setTimeout((()=>{const e='a[href], button, [role="button"], input, embed, object, iframe, textarea, select, details, [tabindex]:not([tabindex="-1"])';[...document.body.querySelectorAll(e)].filter((e=>!e.hasAttribute("disabled")&&!e.getAttribute("aria-hidden")&&!this.cookieContainer.contains(e))).forEach((e=>{e.setAttribute("tabindex","-1"),e.classList.add("cn-disabled")})),[...this.cookieContainer.querySelectorAll(e)].filter((e=>!(e.hasAttribute("disabled")||e.getAttribute("aria-hidden")||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)||this.cookieContainer.contains(e)))).forEach((e=>{e.setAttribute("tabindex","0"),e.classList.remove("cn-disabled")})),this.cookieShowModalBtn.setAttribute("tabindex","-1")}),500)}unsetTabIndex(){document.documentElement.setAttribute("tabindex","0"),setTimeout((()=>{document.body.querySelectorAll(".cn-disabled").forEach((e=>{e.setAttribute("tabindex","0"),e.classList.remove("cn-disabled")})),this.cookieShowModalBtn.setAttribute("tabindex","0")}),500)}resetCookieModal(){if(this.bannerContent.classList.remove("d-none"),this.modalContainer.classList.add("d-none"),this.bannerContainer.classList.remove("cn-modal-page"),!this.customizeBtn.dataset.openModal)throw new Error("Cannot find attribut data-open-modal");this.customizeBtn.innerHTML=this.customizeBtn.dataset.openModal}setupCookieModalList(){this.cookiesUnorderedList.innerHTML="",Object.entries(this.config).forEach((([e,o])=>{const i=document.createElement("li"),n=this.template.children.item(0);if(null===n)throw new Error("Cannot find child item");i.append(n.cloneNode(!0));const s=i.querySelector("span.cn-cookie-name"),a=i.querySelector("span.cn-cookie-description"),r=i.querySelector(".cn-cookie-link"),c=i.querySelector(".cn-switch"),l=i.querySelector(".cn-switch > input");l.indeterminate=!0,l.checked=!1,s.textContent=o.name,a.id=`${e}-desc`,a.textContent=o.description,r.textContent=o.labelLink,r.setAttribute("href",o.link),c.id=`${e}-switch`,c.name=e,c.dataset.name=e,c.setAttribute("aria-labelledby",`${e}-desc`),c.setAttribute("aria-describedby",`${e}-desc`);const d=e=>{const t=this.getCookieStatus(e);this.setCookieStatus(e,this.invertCookieStatus(t),o)};this.addEvent(l,"click",(()=>d(e))),this.addEventKbdValidate(c,(()=>l.click())),this.cookiesUnorderedList.append(i),this.hasBrowserCookie()&&Object.entries(this.getCookieStatusList()).forEach((([o,i])=>{if(o===e)switch(i){case t.true:l.indeterminate=!1,l.checked=!0;break;case t.false:l.indeterminate=!1,l.checked=!1;break;case t.wait:l.indeterminate=!0,l.checked=!1}}))}))}switchToModalPageOrClose(){this.isOnBannerPage()?this.toggleCookieModalPages():this.closeCookieModal()}toggleCookieModalPages(){this.bannerContent.classList.toggle("d-none"),this.modalContainer.classList.toggle("d-none"),this.bannerContainer.classList.toggle("cn-modal-page"),this.isOnBannerPage()||this.bannerContainer.classList.add("cn-modal-page"),this.setTabIndex(),this.setupCookieModalList(),this.togglePersonalizeBtn()}togglePersonalizeBtn(){const e=this.customizeBtn.dataset;this.modalWrapper.scrollTop=0,this.bannerContent.classList.contains("d-none")?(this.customizeBtn.innerHTML=e.openModal,this.customizeBtn.title=e.openModal):(this.customizeBtn.innerHTML=e.closeModal,this.customizeBtn.title=e.closeModal)}isOnBannerPage(){return this.modalContainer.classList.contains("d-none")}invertCookieStatus(e){switch(e){case t.true:case t.wait:return t.false;case t.false:return t.true;default:throw new Error(`Un handled cookie status ${e}`)}}}var t,o;!function(e){e.true="true",e.false="false",e.wait="wait"}(t||(t={})),function(e){e.lax="lax",e.strict="strict",e.none="none"}(o||(o={}));const i=window.CookieNotice;e.noConflict=function(t=!1){return t&&window.CookieNotice===e&&(window.CookieNotice=i),e},window.CookieNotice=e.noConflict()}(); diff --git a/dist/browser/typings/ts/index.d.ts b/dist/browser/typings/ts/index.d.ts index 5670a82..d20e17e 100644 --- a/dist/browser/typings/ts/index.d.ts +++ b/dist/browser/typings/ts/index.d.ts @@ -1,4 +1,4 @@ -/** 5.0.2 */ +/** 5.0.3 */ export default class CookieNotice { browserCookieName: string; /** Cookie life time */ @@ -24,7 +24,6 @@ export default class CookieNotice { cookieLinkShowCustomizeModalList: NodeListOf; modalWrapper: HTMLDivElement; template: HTMLDivElement; - bannerDetailsAreExpanded: boolean; restrictCloseModal: boolean; static noConflict: (deep?: boolean) => typeof CookieNotice; constructor(config: Record); @@ -79,6 +78,13 @@ export default class CookieNotice { * @param value */ containsCookieStatus(key: string): boolean; + /** + * Get a cookie status + * + * @param key + * @returns + */ + getCookieStatus(key: string): CookieStatus; /** * Set the cookie value * @@ -209,13 +215,20 @@ export default class CookieNotice { * Get the actual page: banner or modal (with cookie choices) */ isOnBannerPage(): boolean; + /** + * Invert cookie status + * + * @param status + * @returns Inverted cookie status, `wait` will give `false`. + */ + private invertCookieStatus; } declare enum CookieStatus { true = "true", false = "false", wait = "wait" } -type CookieStatusList = Record; +type CookieStatusList = Record; type CookiePolicy = { sameSite: CookiePolicySameSite; secure: string; diff --git a/dist/esm/ts/index.js b/dist/esm/ts/index.js index 8613c18..5393246 100644 --- a/dist/esm/ts/index.js +++ b/dist/esm/ts/index.js @@ -1,4 +1,4 @@ -/** 5.0.2 */ +/** 5.0.3 */ export default class CookieNotice { constructor(config) { this.browserCookieName = "cn-init"; @@ -76,7 +76,6 @@ export default class CookieNotice { this.acceptAllBtn = acceptAllBtn; this.denyAllBtn = denyAllBtn; this.customizeBtn = customizeBtn; - this.bannerDetailsAreExpanded = false; this.template = template; const memoryTemplate = this.template.cloneNode(true); this.template.remove(); @@ -250,6 +249,20 @@ export default class CookieNotice { return (Object.keys(statusList).find((cookieName) => cookieName === key) !== undefined); } + /** + * Get a cookie status + * + * @param key + * @returns + */ + getCookieStatus(key) { + const statusList = this.getCookieStatusList(); + const cookieIndex = Object.keys(statusList).find((cookieName) => cookieName === key); + if (cookieIndex === undefined) { + throw new Error(`Cookie options ${key} not found in list`); + } + return statusList[cookieIndex]; + } /** * Set the cookie value * @@ -560,18 +573,12 @@ export default class CookieNotice { cnSwitch.dataset.name = cookieName; cnSwitch.setAttribute("aria-labelledby", `${cookieName}-desc`); cnSwitch.setAttribute("aria-describedby", `${cookieName}-desc`); - const toggleCookie = (activate) => { - this.setCookieStatus(cookieName, activate ? CookieStatus.true : CookieStatus.false, cookieConfig); + const toggleCookie = (cookieName) => { + const cookieStatus = this.getCookieStatus(cookieName); + this.setCookieStatus(cookieName, this.invertCookieStatus(cookieStatus), cookieConfig); }; - this.addEvent(cnSwitch, "click", () => { - toggleCookie(cnSwitchInput.checked); - cnSwitch.ariaChecked = cnSwitchInput.checked ? "true" : "false"; - }); - this.addEventKbdValidate(cnSwitch, () => { - toggleCookie(cnSwitchInput.checked); - cnSwitchInput.checked = !cnSwitchInput.checked; - cnSwitch.ariaChecked = cnSwitchInput.checked ? "true" : "false"; - }); + this.addEvent(cnSwitchInput, "click", () => toggleCookie(cookieName)); + this.addEventKbdValidate(cnSwitch, () => cnSwitchInput.click()); this.cookiesUnorderedList.append(cookie); if (!this.hasBrowserCookie()) { // * Ldcweb cookie is not set. @@ -645,6 +652,23 @@ export default class CookieNotice { isOnBannerPage() { return this.modalContainer.classList.contains("d-none"); } + /** + * Invert cookie status + * + * @param status + * @returns Inverted cookie status, `wait` will give `false`. + */ + invertCookieStatus(status) { + switch (status) { + case CookieStatus.true: + case CookieStatus.wait: + return CookieStatus.false; + case CookieStatus.false: + return CookieStatus.true; + default: + throw new Error(`Un handled cookie status ${status}`); + } + } } var CookieStatus; (function (CookieStatus) { diff --git a/dist/typings/ts/index.d.ts b/dist/typings/ts/index.d.ts index 5670a82..d20e17e 100644 --- a/dist/typings/ts/index.d.ts +++ b/dist/typings/ts/index.d.ts @@ -1,4 +1,4 @@ -/** 5.0.2 */ +/** 5.0.3 */ export default class CookieNotice { browserCookieName: string; /** Cookie life time */ @@ -24,7 +24,6 @@ export default class CookieNotice { cookieLinkShowCustomizeModalList: NodeListOf; modalWrapper: HTMLDivElement; template: HTMLDivElement; - bannerDetailsAreExpanded: boolean; restrictCloseModal: boolean; static noConflict: (deep?: boolean) => typeof CookieNotice; constructor(config: Record); @@ -79,6 +78,13 @@ export default class CookieNotice { * @param value */ containsCookieStatus(key: string): boolean; + /** + * Get a cookie status + * + * @param key + * @returns + */ + getCookieStatus(key: string): CookieStatus; /** * Set the cookie value * @@ -209,13 +215,20 @@ export default class CookieNotice { * Get the actual page: banner or modal (with cookie choices) */ isOnBannerPage(): boolean; + /** + * Invert cookie status + * + * @param status + * @returns Inverted cookie status, `wait` will give `false`. + */ + private invertCookieStatus; } declare enum CookieStatus { true = "true", false = "false", wait = "wait" } -type CookieStatusList = Record; +type CookieStatusList = Record; type CookiePolicy = { sameSite: CookiePolicySameSite; secure: string; diff --git a/dist/umd/css/standard.css b/dist/umd/css/standard.css index 3a2f6bc..3ff85ab 100644 --- a/dist/umd/css/standard.css +++ b/dist/umd/css/standard.css @@ -50,7 +50,7 @@ transform: scale(0.99); } -/** 5.0.2 */ +/** 5.0.3 */ /* FENETRE D'ACCUEIL */ /* Title settings */ /* Text settings */ diff --git a/dist/umd/main.js b/dist/umd/main.js index 93d311c..264f9e8 100644 --- a/dist/umd/main.js +++ b/dist/umd/main.js @@ -39,7 +39,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -/** 5.0.2 */ +/** 5.0.3 */ var CookieNotice = /*#__PURE__*/function () { /** Cookie expiration date as specified in the cookie itself */ @@ -135,7 +135,6 @@ var CookieNotice = /*#__PURE__*/function () { this.acceptAllBtn = acceptAllBtn; this.denyAllBtn = denyAllBtn; this.customizeBtn = customizeBtn; - this.bannerDetailsAreExpanded = false; this.template = template; var memoryTemplate = this.template.cloneNode(true); this.template.remove(); @@ -364,6 +363,25 @@ var CookieNotice = /*#__PURE__*/function () { }) !== undefined; } + /** + * Get a cookie status + * + * @param key + * @returns + */ + }, { + key: "getCookieStatus", + value: function getCookieStatus(key) { + var statusList = this.getCookieStatusList(); + var cookieIndex = Object.keys(statusList).find(function (cookieName) { + return cookieName === key; + }); + if (cookieIndex === undefined) { + throw new Error("Cookie options ".concat(key, " not found in list")); + } + return statusList[cookieIndex]; + } + /** * Set the cookie value * @@ -746,17 +764,15 @@ var CookieNotice = /*#__PURE__*/function () { cnSwitch.dataset.name = cookieName; cnSwitch.setAttribute("aria-labelledby", "".concat(cookieName, "-desc")); cnSwitch.setAttribute("aria-describedby", "".concat(cookieName, "-desc")); - var toggleCookie = function toggleCookie(activate) { - _this10.setCookieStatus(cookieName, activate ? CookieStatus.true : CookieStatus.false, cookieConfig); + var toggleCookie = function toggleCookie(cookieName) { + var cookieStatus = _this10.getCookieStatus(cookieName); + _this10.setCookieStatus(cookieName, _this10.invertCookieStatus(cookieStatus), cookieConfig); }; - _this10.addEvent(cnSwitch, "click", function () { - toggleCookie(cnSwitchInput.checked); - cnSwitch.ariaChecked = cnSwitchInput.checked ? "true" : "false"; + _this10.addEvent(cnSwitchInput, "click", function () { + return toggleCookie(cookieName); }); _this10.addEventKbdValidate(cnSwitch, function () { - toggleCookie(cnSwitchInput.checked); - cnSwitchInput.checked = !cnSwitchInput.checked; - cnSwitch.ariaChecked = cnSwitchInput.checked ? "true" : "false"; + return cnSwitchInput.click(); }); _this10.cookiesUnorderedList.append(cookie); if (!_this10.hasBrowserCookie()) { @@ -843,6 +859,26 @@ var CookieNotice = /*#__PURE__*/function () { value: function isOnBannerPage() { return this.modalContainer.classList.contains("d-none"); } + + /** + * Invert cookie status + * + * @param status + * @returns Inverted cookie status, `wait` will give `false`. + */ + }, { + key: "invertCookieStatus", + value: function invertCookieStatus(status) { + switch (status) { + case CookieStatus.true: + case CookieStatus.wait: + return CookieStatus.false; + case CookieStatus.false: + return CookieStatus.true; + default: + throw new Error("Un handled cookie status ".concat(status)); + } + } }]); }(); diff --git a/dist/umd/main.js.map b/dist/umd/main.js.map index 2f209a1..729f7d3 100644 --- a/dist/umd/main.js.map +++ b/dist/umd/main.js.map @@ -1 +1 @@ -{"version":3,"file":"main.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACVA;AAAA,IAEqBA,YAAY;EAe7B;;EA0BA,SAAAA,aAAYC,MAAqC,EAAE;IAAA,IAAAC,KAAA;IAAAC,eAAA,OAAAH,YAAA;IAAAI,eAAA,4BAxC/B,SAAS;IAE7B;IAAAA,eAAA,yBACiB,CAAC;IAElB;IAAAA,eAAA,+BACuB,aAAa;IAEpC;IAAAA,eAAA,yBAC+B;MAC3BC,QAAQ,EAAEC,oBAAoB,CAACC,GAAG;MAClCC,MAAM,EAAE;IACZ,CAAC;IA6BG;IACA,IAAI,CAACP,MAAM,GAAGA,MAAM;;IAEpB;IACA,IAAIQ,oBAA+B,GAAG,IAAI,CAACC,yBAAyB,CAAC,CAAC;IACtE,IAAI,CAACD,oBAAoB,EAAE;MACvBA,oBAAoB,GAAG,IAAIE,IAAI,CAAC,CAAC;MACjCF,oBAAoB,CAACG,QAAQ,CAACH,oBAAoB,CAACI,QAAQ,CAAC,CAAC,GAAG,IAAI,CAACC,cAAc,CAAC;IACxF;IACA,IAAI,CAACL,oBAAoB,GAAG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oBAAoB;EAAA,OAApBA,oBAAoB;AAAA,EAApBA,oBAAoB;;;;;;;;;;;;;;;;UC91BzB;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,GAAG;WACH;WACA;WACA,CAAC;;;;;WCPD,8CAA8C;;;;;WCA9C;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;UElBA;UACA;UACA;UACA;UACA","sources":["webpack://CookieNotice/webpack/universalModuleDefinition","webpack://CookieNotice/./src/ts/index.ts","webpack://CookieNotice/webpack/bootstrap","webpack://CookieNotice/webpack/runtime/define property getters","webpack://CookieNotice/webpack/runtime/global","webpack://CookieNotice/webpack/runtime/hasOwnProperty shorthand","webpack://CookieNotice/webpack/runtime/make namespace object","webpack://CookieNotice/webpack/runtime/publicPath","webpack://CookieNotice/webpack/before-startup","webpack://CookieNotice/webpack/startup","webpack://CookieNotice/webpack/after-startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"CookieNotice\"] = factory();\n\telse\n\t\troot[\"CookieNotice\"] = factory();\n})(this, function() {\nreturn ","/** 5.0.2 */\n\nexport default class CookieNotice {\n browserCookieName = \"cn-init\";\n\n /** Cookie life time */\n cookieTimeLife = 6;\n\n /** The index on which store the expiration date */\n cookieExpirationName = \"_expiration\";\n\n /** Cookie policies for each functionality */\n cookiePolicies: CookiePolicy = {\n sameSite: CookiePolicySameSite.lax,\n secure: \"\",\n };\n\n /** Cookie expiration date as specified in the cookie itself */\n cookieExpirationDate: Date;\n\n config: Record;\n modalBg: HTMLDivElement;\n cookieContainer: HTMLDivElement;\n bannerContainer: HTMLDivElement;\n modalContainer: HTMLDivElement;\n\n cookieShowModalBtn: HTMLButtonElement;\n cookieCloseModalBtn: HTMLButtonElement;\n\n bannerContent: HTMLDivElement;\n acceptAllBtn: HTMLButtonElement;\n denyAllBtn: HTMLButtonElement;\n customizeBtn: HTMLButtonElement;\n cookiesUnorderedList: HTMLUListElement;\n cookieLinkShowCustomizeModalList: NodeListOf;\n modalWrapper: HTMLDivElement;\n template: HTMLDivElement;\n bannerDetailsAreExpanded: boolean;\n\n restrictCloseModal: boolean;\n\n static noConflict: (deep?: boolean) => typeof CookieNotice;\n\n constructor(config: Record) {\n // * Setup Config\n this.config = config;\n\n // * Setup cookie expiration date\n let cookieExpirationDate: Date|null = this.readCookiesExpirationDate();\n if (!cookieExpirationDate) {\n cookieExpirationDate = new Date();\n cookieExpirationDate.setMonth(cookieExpirationDate.getMonth() + this.cookieTimeLife);\n }\n this.cookieExpirationDate = cookieExpirationDate;\n\n // * Inject DOM modal BG\n const modalBg = document.createElement(\"div\");\n modalBg.classList.add(\"cn-modal-bg\");\n document.body.append(modalBg);\n this.modalBg = modalBg;\n\n // * Setup Dom Elements\n const cookieContainer = document.querySelector(\n \"div#cn-wrapper\"\n ) as HTMLDivElement | null,\n cookieShowModalBtn = document.querySelector(\n \"button#cn-cookie-btn\"\n ) as HTMLButtonElement | null,\n cookieCloseModalBtn = document.querySelector(\n \"button#cn-close-modal\"\n ) as HTMLButtonElement | null,\n cookieLinkShowCustomizeModalPageList = document.querySelectorAll(\n \".cn-cookie-link\"\n ) as NodeListOf,\n bannerContainer = document.querySelector(\n \"div#cn-banner\"\n ) as HTMLDivElement | null,\n bannerContent = document.querySelector(\n \"div.cn-banner-content\"\n ) as HTMLDivElement | null,\n modalContainer = document.querySelector(\n \"div.cn-modal-container\"\n ) as HTMLDivElement | null,\n acceptAllBtn = document.querySelector(\n \"button#cn-accept-banner\"\n ) as HTMLButtonElement | null,\n denyAllBtn = document.querySelector(\n \"button#cn-deny-banner\"\n ) as HTMLButtonElement | null,\n customizeBtn = document.querySelector(\n \"button#cn-settings-banner\"\n ) as HTMLButtonElement | null,\n cookiesUnorderedList = document.querySelector(\n \"ul#cn-modal-list\"\n ) as HTMLUListElement | null,\n modalWrapper = document.querySelector(\n \"div.cn-modal-wrapper\"\n ) as HTMLDivElement,\n template = document.querySelector(\n \"div#cn-li-template\"\n ) as HTMLDivElement | null;\n if (!cookieContainer) {\n throw new Error(\"Cannot find div#cn-wrapper\");\n }\n if (!cookieShowModalBtn) {\n throw new Error(\"Cannot find 'button#cn-cookie-btn' element\");\n }\n if (!cookieCloseModalBtn) {\n throw new Error(\"Cannot find 'button#cn-close-modal' element\");\n }\n if (!bannerContainer) {\n throw new Error(\"Cannot find 'div#cn-banner' element\");\n }\n if (!bannerContent) {\n throw new Error(\"Cannot find 'div.cn-banner-content' element\");\n }\n if (!modalContainer) {\n throw new Error(\"Cannot find 'div.cn-modal-container' element\");\n }\n if (!acceptAllBtn) {\n throw new Error(\"Cannot find 'button#cn-accept-banner' element\");\n }\n if (!denyAllBtn) {\n throw new Error(\"Cannot find 'button#cn-deny-banner' element\");\n }\n if (!customizeBtn) {\n throw new Error(\"Cannot find 'button.cn-settings-banner' element\");\n }\n if (!cookiesUnorderedList) {\n throw new Error(\"Cannot find 'ul#cn-modal-list' element\");\n }\n if (!modalWrapper) {\n throw new Error(\"Cannot find 'div.cn-modal-wrapper' element\");\n }\n if (!template) {\n throw new Error(\"Cannot find 'div#cn-li-template' element\");\n }\n\n this.cookieShowModalBtn = cookieShowModalBtn;\n this.cookieCloseModalBtn = cookieCloseModalBtn;\n this.cookieLinkShowCustomizeModalList =\n cookieLinkShowCustomizeModalPageList;\n this.cookieContainer = cookieContainer;\n this.bannerContainer = bannerContainer;\n this.bannerContent = bannerContent;\n this.cookiesUnorderedList = cookiesUnorderedList;\n this.modalWrapper = modalWrapper;\n this.modalContainer = modalContainer;\n this.acceptAllBtn = acceptAllBtn;\n this.denyAllBtn = denyAllBtn;\n this.customizeBtn = customizeBtn;\n\n this.bannerDetailsAreExpanded = false;\n this.template = template;\n const memoryTemplate = this.template.cloneNode(true) as HTMLDivElement;\n this.template.remove();\n this.template = memoryTemplate;\n\n this.restrictCloseModal = true;\n\n // * Setup Events\n this.addEventPrevent(this.modalBg, \"click\", this.closeCookieModal);\n this.addEventPrevent(\n this.cookieCloseModalBtn,\n \"click\",\n this.closeCookieModal\n );\n this.addEventPrevent(this.acceptAllBtn, \"click\", this.acceptAllCookies);\n this.addEventPrevent(this.denyAllBtn, \"click\", this.denyAllCookies);\n this.addEventPrevent(\n this.customizeBtn,\n \"click\",\n this.switchToModalPageOrClose\n );\n this.addEventPrevent(\n this.cookieShowModalBtn,\n \"click\",\n this.toggleCookieModal\n );\n this.cookieLinkShowCustomizeModalList.forEach((cookieLink) => {\n this.addEventPrevent(\n cookieLink,\n \"click\",\n this.openCookieModalToCookiePage\n );\n this.addEventKbdValidate(cookieLink, this.openCookieModalToCookiePage);\n });\n\n // * Setup CN Cookie\n if (!this.cookiesMatchesConfig() || this.cookiesOlderThan(new Date())) {\n // * Setup Browser Cookie if none.\n this.resetBrowserCookie();\n this.openCookieModalToBannerPage();\n }\n\n this.updateRestrictCloseModal();\n\n // * Cookie should have been created from here.\n Object.entries(this.getCookieStatusList()).forEach(([cookieName, cookieStatus]) => {\n if (cookieStatus === CookieStatus.wait) {\n // * Open modal if any cookie config is not set.\n this.openCookieModalToBannerPage();\n return;\n }\n if (!this.config[cookieName]) {\n // * Ignore missing config\n return;\n }\n if (cookieStatus === CookieStatus.true) {\n // * Exec script part for accepted cookie.\n this.config[cookieName].script();\n return;\n }\n if (this.config[cookieName].fallback != null) {\n // * Exec fallback part for accepted cookie if provided.\n this.config[cookieName].fallback();\n }\n });\n }\n\n // COOKIES\n\n /**\n * Update restrict for closing cookie modal\n */\n updateRestrictCloseModal() {\n this.restrictCloseModal = (Object.values(this.getCookieStatusList()).includes(CookieStatus.wait)) ? true : false;\n (this.restrictCloseModal) ? this.cookieCloseModalBtn.classList.add(\"d-none\") : this.cookieCloseModalBtn.classList.remove(\"d-none\");\n (this.restrictCloseModal) ? this.modalBg.classList.add(\"cn-modal-bg-active\") : this.modalBg.classList.remove(\"cn-modal-bg-active\");\n }\n\n /**\n * Get cookies expiration date or null if not defined alread\n */\n readCookiesExpirationDate(): Date | null {\n const cookies = this.getBrowserCookieValue() ?? \"\",\n expirationDateString = cookies.split(\",\").find((cookieString) =>\n cookieString.startsWith(this.cookieExpirationName));\n if (!expirationDateString) {\n return null;\n }\n try {\n const epochExpiration = Number.parseInt(expirationDateString.replace(`${this.cookieExpirationName}=`, \"\"));\n if (isNaN(epochExpiration)) {\n return null;\n }\n return new Date(epochExpiration);\n } catch (e) {\n return null;\n }\n }\n\n /**\n * Check if the cookies date are older than a specified date\n\n * @param date The limit date for cookies\n */\n cookiesOlderThan(date: Date): boolean {\n return this.cookieExpirationDate.getTime() < date.getTime();\n }\n\n /**\n * Check if the actual cookie matches the config\n */\n cookiesMatchesConfig(): boolean {\n const cookies = this.getCookieStatusList();\n return Object.keys(cookies).length === Object.keys(this.config).length;\n }\n\n /**\n * Accept a all cookies\n */\n acceptAllCookies() {\n Object.keys(this.config).forEach((cookieName) => this.acceptCookie(cookieName));\n this.closeCookieModal();\n }\n\n /**\n * Accept a specific cookie\n */\n acceptCookie(cookieName: string) {\n const cookieOptions = this.getCookie(cookieName);\n this.setCookieStatus(cookieName, CookieStatus.true, cookieOptions);\n const cnSwitch = document.getElementById(`${cookieName}-switch`) as HTMLInputElement | null;\n const cnSwitchInput = cnSwitch?.querySelector(\"input\") as HTMLInputElement | null;\n if (!cnSwitch || !cnSwitchInput) {\n return;\n }\n cnSwitchInput.checked = true;\n cnSwitch.ariaChecked = \"true\";\n }\n\n /**\n * Deny a all cookies\n */\n denyAllCookies() {\n Object.keys(this.config).forEach((cookieName) => this.denyCookie(cookieName));\n this.closeCookieModal();\n }\n\n /**\n * Deny a specific cookie\n */\n denyCookie(cookieName: string) {\n const cookieOptions = this.getCookie(cookieName);\n this.setCookieStatus(cookieName, CookieStatus.false, cookieOptions);\n const cnSwitch = document.getElementById(`${cookieName}-switch`) as HTMLInputElement | null;\n const cnSwitchInput = cnSwitch?.querySelector(\"input\") as HTMLInputElement | null;\n if (!cnSwitch || !cnSwitchInput) {\n return;\n }\n cnSwitchInput.checked = false;\n cnSwitch.ariaChecked = \"false\";\n }\n\n /**\n * Get a specific cookie config\n */\n getCookie(cookieName: string): CookieOptions {\n const cookieOptions = Object.entries(this.config).find((entry) => entry[0] === cookieName)?.[1];\n if (cookieOptions === undefined) {\n throw new Error(`Cookie options ${cookieName} not found in list`);\n }\n return cookieOptions;\n }\n\n /**\n * Fetch the cookie status list\n *\n * @returns the cookie status list\n */\n getCookieStatusList(): CookieStatusList {\n const cookies = this.getBrowserCookieValue(),\n statusList: CookieStatusList = {};\n if (cookies === undefined) {\n return statusList;\n }\n /** specificCookieString contains youtube=true like */\n cookies.split(\",\")\n // * Ignore timestamp\n .filter((specificCookieString) => !specificCookieString.startsWith(this.cookieExpirationName))\n .forEach((specificCookieString) => {\n const values = specificCookieString.split(\"=\");\n statusList[values[0]] = values[1] as CookieStatus;\n });\n return statusList;\n }\n\n /**\n * Check has cookie status\n *\n * @param key\n * @param value\n */\n containsCookieStatus(key: string): boolean {\n const statusList: CookieStatusList = this.getCookieStatusList();\n return (\n Object.keys(statusList).find((cookieName) => cookieName === key) !==\n undefined\n );\n }\n\n /**\n * Set the cookie value\n *\n * @param cookieName\n * @param status\n * @param cookieOption\n */\n setCookieStatus(\n cookieName: string,\n status: CookieStatus,\n cookieOption: CookieOptions\n ) {\n if (status === CookieStatus.true) {\n this.addCookieStatus(cookieName, cookieOption);\n return;\n }\n if (status === CookieStatus.false) {\n this.removeCookieStatus(cookieName, cookieOption);\n return;\n }\n this.setBrowserCookieStatus(cookieName, CookieStatus.wait);\n }\n\n /**\n * Add a specific cookie and\n * change his status to true\n *\n * @param cookieName\n * @param cookieOption\n */\n addCookieStatus(cookieName: string, cookieOption: CookieOptions) {\n if (cookieOption.script) {\n cookieOption.script();\n }\n this.setBrowserCookieStatus(cookieName, CookieStatus.true);\n }\n\n /**\n * Remove a specific cookie and\n * change his status to false\n *\n * @param cookieName\n * @param cookieOption\n */\n removeCookieStatus(cookieName: string, cookieOption: CookieOptions) {\n const cookieNameElement = document.getElementById(cookieName);\n if (cookieNameElement) {\n cookieNameElement.remove();\n }\n if (cookieOption.fallback) {\n cookieOption.fallback();\n }\n this.setBrowserCookieStatus(cookieName, CookieStatus.false);\n }\n\n /**\n * Change the status of a cookie\n *\n * @param cookieName\n * @param status\n */\n setBrowserCookieStatus(cookieName: string, status: CookieStatus) {\n const statusList: CookieStatusList = this.getCookieStatusList();\n // * Force refresh\n this.deleteBrowserCookie();\n statusList[cookieName] = status;\n this.saveBrowserCookie(statusList);\n this.updateRestrictCloseModal();\n }\n\n /**\n * Has CN cokie setup ?\n * @returns true if the cookie is setup\n */\n hasBrowserCookie(): boolean {\n return Boolean(this.getBrowserCookieValue());\n }\n\n /**\n * Get the Ldcweb cookie\n *\n * @returns A string like analytics=true,youtube=true or undefined\n */\n getBrowserCookieValue() {\n const matches = document.cookie.match(\n new RegExp(\n \"(?:^|; )\" +\n this.browserCookieName.replace(\n /([.$?*|{}()[\\]\\\\/+^])/g,\n \"\\\\$1\"\n ) +\n \"=([^;]*)\"\n )\n );\n return matches ? decodeURIComponent(matches[1]) : undefined;\n }\n\n /**\n * Save cookie content on web browser\n *\n * @param list\n */\n saveBrowserCookie(statusList: CookieStatusList) {\n const date = new Date(),\n content = Object.entries(statusList)\n .map(([cookieName, cookieStatus]) => {\n return `${cookieName}=${cookieStatus}`;\n });\n // * Update expiration date\n this.cookieExpirationDate = new Date(date.setMonth(date.getMonth() + this.cookieTimeLife));\n // * Append expiration date\n content.push(`${this.cookieExpirationName}=${this.cookieExpirationDate.getTime()}`);\n document.cookie = `${this.browserCookieName}=${content.join(\",\")};path=/${\n location.hostname ? `;domain=${location.hostname}` : \"\"\n };expires=${this.cookieExpirationDate.toUTCString()};${this.getCookiePoliciesAsString()}`;\n }\n\n /**\n * Set an older expire parameter to a specific cookie\n */\n deleteBrowserCookie() {\n if (this.hasBrowserCookie()) {\n // * Suppression du cookie et de sa version precedé d'un point\n document.cookie = `${this.browserCookieName}=;path=/${\n location.hostname ? `;domain=.${location.hostname}` : \"\"\n };expires=Thu, 01 Jan 1970 00:00:01 GMT;`;\n document.cookie = `${this.browserCookieName}=;path=/${\n location.hostname ? `;domain=${location.hostname}` : \"\"\n };expires=Thu, 01 Jan 1970 00:00:01 GMT;`;\n }\n }\n\n getCookiePoliciesAsString(): string {\n return Object.entries(this.cookiePolicies)\n .map(([policyName, policyValue]) => `${policyName}=${policyValue}`)\n .join(\";\");\n }\n\n /**\n * Reset Ldc Web CN cookie\n */\n resetBrowserCookie() {\n // * Create Cookie as It does not exists.\n const newCookieList: CookieStatusList = {};\n Object.entries(this.config).forEach(\n ([cookieName]) => (newCookieList[cookieName] = CookieStatus.wait)\n );\n this.saveBrowserCookie(newCookieList);\n }\n\n // LISTENERS\n\n /**\n * Add event on a specific element\n *\n * @param element\n * @param evnt\n * @param funct\n * @returns\n */\n addEvent(element: HTMLElement, evnt: string, funct: (e: Event) => void) {\n return element.addEventListener(evnt, funct.bind(this), false);\n }\n\n /**\n * Add event on a specific element and prevent default\n *\n * @param element\n * @param evnt\n * @param funct\n * @returns\n */\n addEventPrevent(\n element: HTMLElement,\n evnt: string,\n funct: (e: Event) => void\n ) {\n return element.addEventListener(\n evnt,\n (e) => {\n e.preventDefault();\n funct.call(this, e);\n },\n false\n );\n }\n\n /**\n * Add event on a specific element\n *\n * @param element\n * @param evnt\n * @param funct\n * @returns\n */\n addEventKbdValidate(element: HTMLElement, funct: (e: Event) => void) {\n return this.addEvent(element, \"keydown\", (e: Event) => {\n const kbdEvt = e as KeyboardEvent;\n if (\n kbdEvt.key == \" \" ||\n kbdEvt.code == \"Space\" ||\n kbdEvt.keyCode == 32 ||\n kbdEvt.key == \"Enter\" ||\n kbdEvt.code == \"Enter\" ||\n kbdEvt.keyCode == 13\n ) {\n funct.call(this, kbdEvt);\n e.preventDefault();\n }\n });\n }\n\n // COOKIE MODAL\n\n /**\n * Show or hide Cookie modal\n * @returns\n */\n toggleCookieModal() {\n if (!document.body.classList.contains(\"cn-open\")) {\n this.openCookieModalToBannerPage();\n return;\n }\n this.closeCookieModal();\n }\n\n /**\n * Open the cookies modal to the banner page\n */\n openCookieModalToBannerPage() {\n this.openCookieModalToCookiePage();\n this.toggleCookieModalPages();\n }\n\n /**\n * Open the cookies modal to the cookies page\n */\n openCookieModalToCookiePage() {\n document.body.classList.add(\"cn-open\");\n this.resetCookieModal();\n this.bannerContent.classList.add(\"d-none\");\n this.modalContainer.classList.remove(\"d-none\");\n this.bannerContainer.classList.add(\"cn-modal-page\");\n\n // Scroll to the top of the cookies list\n this.modalWrapper.scrollTop = 0;\n this.setupCookieModalList();\n this.setTabIndex();\n }\n\n /**\n * Hide the cookies modal\n */\n closeCookieModal() {\n this.updateRestrictCloseModal();\n if (!this.restrictCloseModal) {\n document.body.classList.remove(\"cn-open\");\n if (!this.isOnBannerPage()) {\n // * Make toggle page to banner on closing\n this.bannerContent.classList.toggle(\"d-none\");\n this.modalContainer.classList.toggle(\"d-none\");\n this.bannerContainer.classList.remove(\"cn-modal-page\");\n }\n this.unsetTabIndex();\n this.setupCookieModalList();\n } else {\n throw new Error(\"You need to accept or refuse all cookies\");\n }\n }\n\n /**\n * Setup tab indexes on visible elements\n */\n setTabIndex() {\n // * Prevent focus html tag\n document.documentElement.setAttribute(\"tabindex\", \"-1\");\n setTimeout(() => {\n const focusableSelector =\n \"a[href], button, [role=\\\"button\\\"], input, embed, object, iframe, textarea, select, details, [tabindex]:not([tabindex=\\\"-1\\\"])\";\n\n // * Only focusable elements\n [...document.body.querySelectorAll(focusableSelector)]\n .filter(\n (el) =>\n !el.hasAttribute(\"disabled\") &&\n !el.getAttribute(\"aria-hidden\") &&\n !this.cookieContainer.contains(el)\n )\n .forEach((el) => {\n (el as HTMLElement).setAttribute(\"tabindex\", \"-1\");\n (el as HTMLElement).classList.add(\"cn-disabled\");\n });\n [...this.cookieContainer.querySelectorAll(focusableSelector)]\n .filter(\n (el) =>\n !el.hasAttribute(\"disabled\") &&\n !el.getAttribute(\"aria-hidden\") &&\n // * Only visible elements\n !!(\n (el as HTMLElement).offsetWidth ||\n (el as HTMLElement).offsetHeight ||\n el.getClientRects().length\n ) &&\n !this.cookieContainer.contains(el)\n )\n .forEach((el) => {\n (el as HTMLElement).setAttribute(\"tabindex\", \"0\");\n (el as HTMLElement).classList.remove(\"cn-disabled\");\n });\n this.cookieShowModalBtn.setAttribute(\"tabindex\", \"-1\");\n }, 500);\n }\n\n /**\n * Undo setup tab indexes on visible elements\n */\n unsetTabIndex() {\n document.documentElement.setAttribute(\"tabindex\", \"0\");\n setTimeout(() => {\n document.body.querySelectorAll(\".cn-disabled\").forEach((el) => {\n (el as HTMLElement).setAttribute(\"tabindex\", \"0\");\n (el as HTMLElement).classList.remove(\"cn-disabled\");\n });\n this.cookieShowModalBtn.setAttribute(\"tabindex\", \"0\");\n }, 500);\n }\n\n /**\n * Reset the modal view state\n */\n resetCookieModal() {\n this.bannerContent.classList.remove(\"d-none\");\n this.modalContainer.classList.add(\"d-none\");\n this.bannerContainer.classList.remove(\"cn-modal-page\");\n if (!this.customizeBtn.dataset.openModal) {\n throw new Error(\"Cannot find attribut data-open-modal\");\n }\n this.customizeBtn.innerHTML = this.customizeBtn.dataset.openModal;\n }\n\n /**\n * Set the cookies list in the modal\n */\n setupCookieModalList() {\n this.cookiesUnorderedList.innerHTML = \"\";\n Object.entries(this.config).forEach(([cookieName, cookieConfig]) => {\n const cookie = document.createElement(\"li\");\n const childItem = this.template.children.item(\n 0\n ) as HTMLDivElement | null;\n if (childItem === null) {\n throw new Error(\"Cannot find child item\");\n }\n cookie.append(childItem.cloneNode(true));\n const name = cookie.querySelector(\n \"span.cn-cookie-name\"\n ) as HTMLSpanElement;\n const description = cookie.querySelector(\n \"span.cn-cookie-description\"\n ) as HTMLSpanElement;\n const link = cookie.querySelector(\n \".cn-cookie-link\"\n ) as HTMLElement;\n const cnSwitch = cookie.querySelector(\n \".cn-switch\"\n ) as HTMLInputElement;\n const cnSwitchInput = cookie.querySelector(\n \".cn-switch > input\"\n ) as HTMLInputElement;\n\n // * Undertermined state\n cnSwitchInput.indeterminate = true;\n cnSwitchInput.checked = false;\n\n // * Assign cookie aside content\n name.textContent = cookieConfig.name;\n description.id = `${cookieName}-desc`;\n description.textContent = cookieConfig.description;\n link.textContent = cookieConfig.labelLink;\n link.setAttribute(\"href\", cookieConfig.link);\n\n // * Assign cookie controls\n cnSwitch.id = `${cookieName}-switch`;\n cnSwitch.name = cookieName;\n cnSwitch.dataset.name = cookieName;\n cnSwitch.setAttribute(\"aria-labelledby\", `${cookieName}-desc`);\n cnSwitch.setAttribute(\"aria-describedby\", `${cookieName}-desc`);\n\n const toggleCookie = (activate:boolean) => {\n this.setCookieStatus(\n cookieName,\n activate ? CookieStatus.true : CookieStatus.false,\n cookieConfig\n );\n };\n this.addEvent(cnSwitch, \"click\", () => {\n toggleCookie(cnSwitchInput.checked);\n cnSwitch.ariaChecked = cnSwitchInput.checked ? \"true\" : \"false\";\n });\n this.addEventKbdValidate(cnSwitch, () => {\n toggleCookie(cnSwitchInput.checked);\n cnSwitchInput.checked = !cnSwitchInput.checked;\n cnSwitch.ariaChecked = cnSwitchInput.checked ? \"true\" : \"false\";\n });\n\n this.cookiesUnorderedList.append(cookie);\n\n if (!this.hasBrowserCookie()) {\n // * Ldcweb cookie is not set.\n return;\n }\n // * Setup list status state\n Object.entries(this.getCookieStatusList()).forEach(\n ([ckName, cookieStatus]) => {\n if (ckName === cookieName) {\n switch (cookieStatus) {\n case CookieStatus.true:\n cnSwitchInput.indeterminate = false;\n cnSwitchInput.checked = true;\n break;\n case CookieStatus.false:\n cnSwitchInput.indeterminate = false;\n cnSwitchInput.checked = false;\n break;\n case CookieStatus.wait:\n cnSwitchInput.indeterminate = true;\n cnSwitchInput.checked = false;\n break;\n }\n }\n }\n );\n });\n }\n\n switchToModalPageOrClose(): void {\n // * Modification du comportement du bouton, même si ca n'a pas de sens.\n // https://lab.s-web.fr/ldc-web/projets/ldc-web-cookie-notice/-/issues/9`\n\n if (this.isOnBannerPage()) {\n this.toggleCookieModalPages();\n return;\n }\n // * Pas de permutation en arrière\n this.closeCookieModal();\n }\n\n /**\n * Toggle Cookie modal pages\n */\n toggleCookieModalPages() {\n this.bannerContent.classList.toggle(\"d-none\");\n this.modalContainer.classList.toggle(\"d-none\");\n this.bannerContainer.classList.toggle(\"cn-modal-page\");\n if (!this.isOnBannerPage()) {\n this.bannerContainer.classList.add(\"cn-modal-page\");\n }\n this.setTabIndex();\n this.setupCookieModalList();\n this.togglePersonalizeBtn();\n }\n\n /**\n * Toggle customize btn\n */\n togglePersonalizeBtn() {\n const customizeBtnBannerDataset = this.customizeBtn.dataset;\n this.modalWrapper.scrollTop = 0;\n if (this.bannerContent.classList.contains(\"d-none\")) {\n this.customizeBtn.innerHTML =\n customizeBtnBannerDataset.openModal as string;\n this.customizeBtn.title = customizeBtnBannerDataset.openModal as string;\n } else {\n this.customizeBtn.innerHTML =\n customizeBtnBannerDataset.closeModal as string;\n this.customizeBtn.title = customizeBtnBannerDataset.closeModal as string;\n }\n }\n\n /**\n * Get the actual page: banner or modal (with cookie choices)\n */\n isOnBannerPage(): boolean {\n return this.modalContainer.classList.contains(\"d-none\");\n }\n}\n\nenum CookieStatus {\n true = \"true\",\n false = \"false\",\n wait = \"wait\",\n}\n\ntype CookieStatusList = Record;\n\ntype CookiePolicy = {\n sameSite: CookiePolicySameSite;\n secure: string;\n};\n\nenum CookiePolicySameSite {\n lax = \"lax\",\n strict = \"strict\",\n none = \"none\",\n}\n\nexport type CookieOptions = {\n name: string;\n description: string;\n link: string;\n labelLink: string;\n cookies: string[];\n /**\n * Fonction qui sert à initialiser la fonctionnalité\n * conduisant à la génération du cookie\n * @return void\n */\n script: () => void;\n /**\n * Fonction qui sert à informer l'utilisateur\n * sur chaque élèment que le cookie\n * associé à la fonctionnalité\n * est désactivé et propose un lien sur\n * cookie notice pour l'activer\n * @return void\n */\n fallback: () => void | null;\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","","// startup\n// Load entry module and return exports\n__webpack_require__(\"./src/ts/index.ts\");\n// This entry module doesn't tell about it's top-level declarations so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./src/scss/themes/standard.scss\");\n",""],"names":["CookieNotice","config","_this","_classCallCheck","_defineProperty","sameSite","CookiePolicySameSite","lax","secure","cookieExpirationDate","readCookiesExpirationDate","Date","setMonth","getMonth","cookieTimeLife","modalBg","document","createElement","classList","add","body","append","cookieContainer","querySelector","cookieShowModalBtn","cookieCloseModalBtn","cookieLinkShowCustomizeModalPageList","querySelectorAll","bannerContainer","bannerContent","modalContainer","acceptAllBtn","denyAllBtn","customizeBtn","cookiesUnorderedList","modalWrapper","template","Error","cookieLinkShowCustomizeModalList","bannerDetailsAreExpanded","memoryTemplate","cloneNode","remove","restrictCloseModal","addEventPrevent","closeCookieModal","acceptAllCookies","denyAllCookies","switchToModalPageOrClose","toggleCookieModal","forEach","cookieLink","openCookieModalToCookiePage","addEventKbdValidate","cookiesMatchesConfig","cookiesOlderThan","resetBrowserCookie","openCookieModalToBannerPage","updateRestrictCloseModal","Object","entries","getCookieStatusList","_ref","_ref2","_slicedToArray","cookieName","cookieStatus","CookieStatus","wait","true","script","fallback","_createClass","key","value","values","includes","_this$getBrowserCooki","_this2","cookies","getBrowserCookieValue","expirationDateString","split","find","cookieString","startsWith","cookieExpirationName","epochExpiration","Number","parseInt","replace","concat","isNaN","e","date","getTime","keys","length","_this3","acceptCookie","cookieOptions","getCookie","setCookieStatus","cnSwitch","getElementById","cnSwitchInput","checked","ariaChecked","_this4","denyCookie","false","_Object$entries$find","entry","undefined","_this5","statusList","filter","specificCookieString","containsCookieStatus","status","cookieOption","addCookieStatus","removeCookieStatus","setBrowserCookieStatus","cookieNameElement","deleteBrowserCookie","saveBrowserCookie","hasBrowserCookie","Boolean","matches","cookie","match","RegExp","browserCookieName","decodeURIComponent","content","map","_ref3","_ref4","push","join","location","hostname","toUTCString","getCookiePoliciesAsString","cookiePolicies","_ref5","_ref6","policyName","policyValue","newCookieList","_ref7","_ref8","addEvent","element","evnt","funct","addEventListener","bind","_this6","preventDefault","call","_this7","kbdEvt","code","keyCode","contains","toggleCookieModalPages","resetCookieModal","scrollTop","setupCookieModalList","setTabIndex","isOnBannerPage","toggle","unsetTabIndex","_this8","documentElement","setAttribute","setTimeout","focusableSelector","_toConsumableArray","el","hasAttribute","getAttribute","offsetWidth","offsetHeight","getClientRects","_this9","dataset","openModal","innerHTML","_this10","_ref9","_ref10","cookieConfig","childItem","children","item","name","description","link","indeterminate","textContent","id","labelLink","toggleCookie","activate","_ref11","_ref12","ckName","togglePersonalizeBtn","customizeBtnBannerDataset","title","closeModal","default"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"main.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACVA;AAAA,IAEqBA,YAAY;EAe7B;;EAyBA,SAAAA,aAAYC,MAAqC,EAAE;IAAA,IAAAC,KAAA;IAAAC,eAAA,OAAAH,YAAA;IAAAI,eAAA,4BAvC/B,SAAS;IAE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A;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,GAAG;WACH;WACA;WACA,CAAC;;;;;WCPD,8CAA8C;;;;;WCA9C;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;UElBA;UACA;UACA;UACA;UACA","sources":["webpack://CookieNotice/webpack/universalModuleDefinition","webpack://CookieNotice/./src/ts/index.ts","webpack://CookieNotice/webpack/bootstrap","webpack://CookieNotice/webpack/runtime/define property getters","webpack://CookieNotice/webpack/runtime/global","webpack://CookieNotice/webpack/runtime/hasOwnProperty shorthand","webpack://CookieNotice/webpack/runtime/make namespace object","webpack://CookieNotice/webpack/runtime/publicPath","webpack://CookieNotice/webpack/before-startup","webpack://CookieNotice/webpack/startup","webpack://CookieNotice/webpack/after-startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"CookieNotice\"] = factory();\n\telse\n\t\troot[\"CookieNotice\"] = factory();\n})(this, function() {\nreturn ","/** 5.0.3 */\n\nexport default class CookieNotice {\n browserCookieName = \"cn-init\";\n\n /** Cookie life time */\n cookieTimeLife = 6;\n\n /** The index on which store the expiration date */\n cookieExpirationName = \"_expiration\";\n\n /** Cookie policies for each functionality */\n cookiePolicies: CookiePolicy = {\n sameSite: CookiePolicySameSite.lax,\n secure: \"\",\n };\n\n /** Cookie expiration date as specified in the cookie itself */\n cookieExpirationDate: Date;\n\n config: Record;\n modalBg: HTMLDivElement;\n cookieContainer: HTMLDivElement;\n bannerContainer: HTMLDivElement;\n modalContainer: HTMLDivElement;\n\n cookieShowModalBtn: HTMLButtonElement;\n cookieCloseModalBtn: HTMLButtonElement;\n\n bannerContent: HTMLDivElement;\n acceptAllBtn: HTMLButtonElement;\n denyAllBtn: HTMLButtonElement;\n customizeBtn: HTMLButtonElement;\n cookiesUnorderedList: HTMLUListElement;\n cookieLinkShowCustomizeModalList: NodeListOf;\n modalWrapper: HTMLDivElement;\n template: HTMLDivElement;\n\n restrictCloseModal: boolean;\n\n static noConflict: (deep?: boolean) => typeof CookieNotice;\n\n constructor(config: Record) {\n // * Setup Config\n this.config = config;\n\n // * Setup cookie expiration date\n let cookieExpirationDate: Date|null = this.readCookiesExpirationDate();\n if (!cookieExpirationDate) {\n cookieExpirationDate = new Date();\n cookieExpirationDate.setMonth(cookieExpirationDate.getMonth() + this.cookieTimeLife);\n }\n this.cookieExpirationDate = cookieExpirationDate;\n\n // * Inject DOM modal BG\n const modalBg = document.createElement(\"div\");\n modalBg.classList.add(\"cn-modal-bg\");\n document.body.append(modalBg);\n this.modalBg = modalBg;\n\n // * Setup Dom Elements\n const cookieContainer = document.querySelector(\n \"div#cn-wrapper\"\n ) as HTMLDivElement | null,\n cookieShowModalBtn = document.querySelector(\n \"button#cn-cookie-btn\"\n ) as HTMLButtonElement | null,\n cookieCloseModalBtn = document.querySelector(\n \"button#cn-close-modal\"\n ) as HTMLButtonElement | null,\n cookieLinkShowCustomizeModalPageList = document.querySelectorAll(\n \".cn-cookie-link\"\n ) as NodeListOf,\n bannerContainer = document.querySelector(\n \"div#cn-banner\"\n ) as HTMLDivElement | null,\n bannerContent = document.querySelector(\n \"div.cn-banner-content\"\n ) as HTMLDivElement | null,\n modalContainer = document.querySelector(\n \"div.cn-modal-container\"\n ) as HTMLDivElement | null,\n acceptAllBtn = document.querySelector(\n \"button#cn-accept-banner\"\n ) as HTMLButtonElement | null,\n denyAllBtn = document.querySelector(\n \"button#cn-deny-banner\"\n ) as HTMLButtonElement | null,\n customizeBtn = document.querySelector(\n \"button#cn-settings-banner\"\n ) as HTMLButtonElement | null,\n cookiesUnorderedList = document.querySelector(\n \"ul#cn-modal-list\"\n ) as HTMLUListElement | null,\n modalWrapper = document.querySelector(\n \"div.cn-modal-wrapper\"\n ) as HTMLDivElement,\n template = document.querySelector(\n \"div#cn-li-template\"\n ) as HTMLDivElement | null;\n if (!cookieContainer) {\n throw new Error(\"Cannot find div#cn-wrapper\");\n }\n if (!cookieShowModalBtn) {\n throw new Error(\"Cannot find 'button#cn-cookie-btn' element\");\n }\n if (!cookieCloseModalBtn) {\n throw new Error(\"Cannot find 'button#cn-close-modal' element\");\n }\n if (!bannerContainer) {\n throw new Error(\"Cannot find 'div#cn-banner' element\");\n }\n if (!bannerContent) {\n throw new Error(\"Cannot find 'div.cn-banner-content' element\");\n }\n if (!modalContainer) {\n throw new Error(\"Cannot find 'div.cn-modal-container' element\");\n }\n if (!acceptAllBtn) {\n throw new Error(\"Cannot find 'button#cn-accept-banner' element\");\n }\n if (!denyAllBtn) {\n throw new Error(\"Cannot find 'button#cn-deny-banner' element\");\n }\n if (!customizeBtn) {\n throw new Error(\"Cannot find 'button.cn-settings-banner' element\");\n }\n if (!cookiesUnorderedList) {\n throw new Error(\"Cannot find 'ul#cn-modal-list' element\");\n }\n if (!modalWrapper) {\n throw new Error(\"Cannot find 'div.cn-modal-wrapper' element\");\n }\n if (!template) {\n throw new Error(\"Cannot find 'div#cn-li-template' element\");\n }\n\n this.cookieShowModalBtn = cookieShowModalBtn;\n this.cookieCloseModalBtn = cookieCloseModalBtn;\n this.cookieLinkShowCustomizeModalList =\n cookieLinkShowCustomizeModalPageList;\n this.cookieContainer = cookieContainer;\n this.bannerContainer = bannerContainer;\n this.bannerContent = bannerContent;\n this.cookiesUnorderedList = cookiesUnorderedList;\n this.modalWrapper = modalWrapper;\n this.modalContainer = modalContainer;\n this.acceptAllBtn = acceptAllBtn;\n this.denyAllBtn = denyAllBtn;\n this.customizeBtn = customizeBtn;\n\n this.template = template;\n const memoryTemplate = this.template.cloneNode(true) as HTMLDivElement;\n this.template.remove();\n this.template = memoryTemplate;\n\n this.restrictCloseModal = true;\n\n // * Setup Events\n this.addEventPrevent(this.modalBg, \"click\", this.closeCookieModal);\n this.addEventPrevent(\n this.cookieCloseModalBtn,\n \"click\",\n this.closeCookieModal\n );\n this.addEventPrevent(this.acceptAllBtn, \"click\", this.acceptAllCookies);\n this.addEventPrevent(this.denyAllBtn, \"click\", this.denyAllCookies);\n this.addEventPrevent(\n this.customizeBtn,\n \"click\",\n this.switchToModalPageOrClose\n );\n this.addEventPrevent(\n this.cookieShowModalBtn,\n \"click\",\n this.toggleCookieModal\n );\n this.cookieLinkShowCustomizeModalList.forEach((cookieLink) => {\n this.addEventPrevent(\n cookieLink,\n \"click\",\n this.openCookieModalToCookiePage\n );\n this.addEventKbdValidate(cookieLink, this.openCookieModalToCookiePage);\n });\n\n // * Setup CN Cookie\n if (!this.cookiesMatchesConfig() || this.cookiesOlderThan(new Date())) {\n // * Setup Browser Cookie if none.\n this.resetBrowserCookie();\n this.openCookieModalToBannerPage();\n }\n\n this.updateRestrictCloseModal();\n\n // * Cookie should have been created from here.\n Object.entries(this.getCookieStatusList()).forEach(([cookieName, cookieStatus]) => {\n if (cookieStatus === CookieStatus.wait) {\n // * Open modal if any cookie config is not set.\n this.openCookieModalToBannerPage();\n return;\n }\n if (!this.config[cookieName]) {\n // * Ignore missing config\n return;\n }\n if (cookieStatus === CookieStatus.true) {\n // * Exec script part for accepted cookie.\n this.config[cookieName].script();\n return;\n }\n if (this.config[cookieName].fallback != null) {\n // * Exec fallback part for accepted cookie if provided.\n this.config[cookieName].fallback();\n }\n });\n }\n\n // COOKIES\n\n /**\n * Update restrict for closing cookie modal\n */\n updateRestrictCloseModal() {\n this.restrictCloseModal = (Object.values(this.getCookieStatusList()).includes(CookieStatus.wait)) ? true : false;\n (this.restrictCloseModal) ? this.cookieCloseModalBtn.classList.add(\"d-none\") : this.cookieCloseModalBtn.classList.remove(\"d-none\");\n (this.restrictCloseModal) ? this.modalBg.classList.add(\"cn-modal-bg-active\") : this.modalBg.classList.remove(\"cn-modal-bg-active\");\n }\n\n /**\n * Get cookies expiration date or null if not defined alread\n */\n readCookiesExpirationDate(): Date | null {\n const cookies = this.getBrowserCookieValue() ?? \"\",\n expirationDateString = cookies.split(\",\").find((cookieString) =>\n cookieString.startsWith(this.cookieExpirationName));\n if (!expirationDateString) {\n return null;\n }\n try {\n const epochExpiration = Number.parseInt(expirationDateString.replace(`${this.cookieExpirationName}=`, \"\"));\n if (isNaN(epochExpiration)) {\n return null;\n }\n return new Date(epochExpiration);\n } catch (e) {\n return null;\n }\n }\n\n /**\n * Check if the cookies date are older than a specified date\n\n * @param date The limit date for cookies\n */\n cookiesOlderThan(date: Date): boolean {\n return this.cookieExpirationDate.getTime() < date.getTime();\n }\n\n /**\n * Check if the actual cookie matches the config\n */\n cookiesMatchesConfig(): boolean {\n const cookies = this.getCookieStatusList();\n return Object.keys(cookies).length === Object.keys(this.config).length;\n }\n\n /**\n * Accept a all cookies\n */\n acceptAllCookies() {\n Object.keys(this.config).forEach((cookieName) => this.acceptCookie(cookieName));\n this.closeCookieModal();\n }\n\n /**\n * Accept a specific cookie\n */\n acceptCookie(cookieName: string) {\n const cookieOptions = this.getCookie(cookieName);\n this.setCookieStatus(cookieName, CookieStatus.true, cookieOptions);\n const cnSwitch = document.getElementById(`${cookieName}-switch`) as HTMLInputElement | null;\n const cnSwitchInput = cnSwitch?.querySelector(\"input\") as HTMLInputElement | null;\n if (!cnSwitch || !cnSwitchInput) {\n return;\n }\n cnSwitchInput.checked = true;\n cnSwitch.ariaChecked = \"true\";\n }\n\n /**\n * Deny a all cookies\n */\n denyAllCookies() {\n Object.keys(this.config).forEach((cookieName) => this.denyCookie(cookieName));\n this.closeCookieModal();\n }\n\n /**\n * Deny a specific cookie\n */\n denyCookie(cookieName: string) {\n const cookieOptions = this.getCookie(cookieName);\n this.setCookieStatus(cookieName, CookieStatus.false, cookieOptions);\n const cnSwitch = document.getElementById(`${cookieName}-switch`) as HTMLInputElement | null;\n const cnSwitchInput = cnSwitch?.querySelector(\"input\") as HTMLInputElement | null;\n if (!cnSwitch || !cnSwitchInput) {\n return;\n }\n cnSwitchInput.checked = false;\n cnSwitch.ariaChecked = \"false\";\n }\n\n /**\n * Get a specific cookie config\n */\n getCookie(cookieName: string): CookieOptions {\n const cookieOptions = Object.entries(this.config).find((entry) => entry[0] === cookieName)?.[1];\n if (cookieOptions === undefined) {\n throw new Error(`Cookie options ${cookieName} not found in list`);\n }\n return cookieOptions;\n }\n\n /**\n * Fetch the cookie status list\n *\n * @returns the cookie status list\n */\n getCookieStatusList(): CookieStatusList {\n const cookies = this.getBrowserCookieValue(),\n statusList: CookieStatusList = {};\n if (cookies === undefined) {\n return statusList;\n }\n /** specificCookieString contains youtube=true like */\n cookies.split(\",\")\n // * Ignore timestamp\n .filter((specificCookieString) => !specificCookieString.startsWith(this.cookieExpirationName))\n .forEach((specificCookieString) => {\n const values = specificCookieString.split(\"=\");\n statusList[values[0]] = values[1] as CookieStatus;\n });\n return statusList;\n }\n\n /**\n * Check has cookie status\n *\n * @param key\n * @param value\n */\n containsCookieStatus(key: string): boolean {\n const statusList: CookieStatusList = this.getCookieStatusList();\n return (\n Object.keys(statusList).find((cookieName) => cookieName === key) !==\n undefined\n );\n }\n\n /**\n * Get a cookie status\n *\n * @param key\n * @returns\n */\n getCookieStatus(key: string): CookieStatus {\n const statusList: CookieStatusList = this.getCookieStatusList();\n const cookieIndex = Object.keys(statusList).find((cookieName) => cookieName === key);\n if (cookieIndex === undefined) {\n throw new Error(`Cookie options ${key} not found in list`);\n }\n return statusList[cookieIndex];\n }\n\n /**\n * Set the cookie value\n *\n * @param cookieName\n * @param status\n * @param cookieOption\n */\n setCookieStatus(\n cookieName: string,\n status: CookieStatus,\n cookieOption: CookieOptions\n ) {\n if (status === CookieStatus.true) {\n this.addCookieStatus(cookieName, cookieOption);\n return;\n }\n if (status === CookieStatus.false) {\n this.removeCookieStatus(cookieName, cookieOption);\n return;\n }\n this.setBrowserCookieStatus(cookieName, CookieStatus.wait);\n }\n\n /**\n * Add a specific cookie and\n * change his status to true\n *\n * @param cookieName\n * @param cookieOption\n */\n addCookieStatus(cookieName: string, cookieOption: CookieOptions) {\n if (cookieOption.script) {\n cookieOption.script();\n }\n this.setBrowserCookieStatus(cookieName, CookieStatus.true);\n }\n\n /**\n * Remove a specific cookie and\n * change his status to false\n *\n * @param cookieName\n * @param cookieOption\n */\n removeCookieStatus(cookieName: string, cookieOption: CookieOptions) {\n const cookieNameElement = document.getElementById(cookieName);\n if (cookieNameElement) {\n cookieNameElement.remove();\n }\n if (cookieOption.fallback) {\n cookieOption.fallback();\n }\n this.setBrowserCookieStatus(cookieName, CookieStatus.false);\n }\n\n /**\n * Change the status of a cookie\n *\n * @param cookieName\n * @param status\n */\n setBrowserCookieStatus(cookieName: string, status: CookieStatus) {\n const statusList: CookieStatusList = this.getCookieStatusList();\n // * Force refresh\n this.deleteBrowserCookie();\n statusList[cookieName] = status;\n this.saveBrowserCookie(statusList);\n this.updateRestrictCloseModal();\n }\n\n /**\n * Has CN cokie setup ?\n * @returns true if the cookie is setup\n */\n hasBrowserCookie(): boolean {\n return Boolean(this.getBrowserCookieValue());\n }\n\n /**\n * Get the Ldcweb cookie\n *\n * @returns A string like analytics=true,youtube=true or undefined\n */\n getBrowserCookieValue() {\n const matches = document.cookie.match(\n new RegExp(\n \"(?:^|; )\" +\n this.browserCookieName.replace(\n /([.$?*|{}()[\\]\\\\/+^])/g,\n \"\\\\$1\"\n ) +\n \"=([^;]*)\"\n )\n );\n return matches ? decodeURIComponent(matches[1]) : undefined;\n }\n\n /**\n * Save cookie content on web browser\n *\n * @param list\n */\n saveBrowserCookie(statusList: CookieStatusList) {\n const date = new Date(),\n content = Object.entries(statusList)\n .map(([cookieName, cookieStatus]) => {\n return `${cookieName}=${cookieStatus}`;\n });\n // * Update expiration date\n this.cookieExpirationDate = new Date(date.setMonth(date.getMonth() + this.cookieTimeLife));\n // * Append expiration date\n content.push(`${this.cookieExpirationName}=${this.cookieExpirationDate.getTime()}`);\n document.cookie = `${this.browserCookieName}=${content.join(\",\")};path=/${\n location.hostname ? `;domain=${location.hostname}` : \"\"\n };expires=${this.cookieExpirationDate.toUTCString()};${this.getCookiePoliciesAsString()}`;\n }\n\n /**\n * Set an older expire parameter to a specific cookie\n */\n deleteBrowserCookie() {\n if (this.hasBrowserCookie()) {\n // * Suppression du cookie et de sa version precedé d'un point\n document.cookie = `${this.browserCookieName}=;path=/${\n location.hostname ? `;domain=.${location.hostname}` : \"\"\n };expires=Thu, 01 Jan 1970 00:00:01 GMT;`;\n document.cookie = `${this.browserCookieName}=;path=/${\n location.hostname ? `;domain=${location.hostname}` : \"\"\n };expires=Thu, 01 Jan 1970 00:00:01 GMT;`;\n }\n }\n\n getCookiePoliciesAsString(): string {\n return Object.entries(this.cookiePolicies)\n .map(([policyName, policyValue]) => `${policyName}=${policyValue}`)\n .join(\";\");\n }\n\n /**\n * Reset Ldc Web CN cookie\n */\n resetBrowserCookie() {\n // * Create Cookie as It does not exists.\n const newCookieList: CookieStatusList = {};\n Object.entries(this.config).forEach(\n ([cookieName]) => (newCookieList[cookieName] = CookieStatus.wait)\n );\n this.saveBrowserCookie(newCookieList);\n }\n\n // LISTENERS\n\n /**\n * Add event on a specific element\n *\n * @param element\n * @param evnt\n * @param funct\n * @returns\n */\n addEvent(element: HTMLElement, evnt: string, funct: (e: Event) => void) {\n return element.addEventListener(evnt, funct.bind(this), false);\n }\n\n /**\n * Add event on a specific element and prevent default\n *\n * @param element\n * @param evnt\n * @param funct\n * @returns\n */\n addEventPrevent(\n element: HTMLElement,\n evnt: string,\n funct: (e: Event) => void\n ) {\n return element.addEventListener(\n evnt,\n (e) => {\n e.preventDefault();\n funct.call(this, e);\n },\n false\n );\n }\n\n /**\n * Add event on a specific element\n *\n * @param element\n * @param evnt\n * @param funct\n * @returns\n */\n addEventKbdValidate(element: HTMLElement, funct: (e: Event) => void) {\n return this.addEvent(element, \"keydown\", (e: Event) => {\n const kbdEvt = e as KeyboardEvent;\n if (\n kbdEvt.key == \" \" ||\n kbdEvt.code == \"Space\" ||\n kbdEvt.keyCode == 32 ||\n kbdEvt.key == \"Enter\" ||\n kbdEvt.code == \"Enter\" ||\n kbdEvt.keyCode == 13\n ) {\n funct.call(this, kbdEvt);\n e.preventDefault();\n }\n });\n }\n\n // COOKIE MODAL\n\n /**\n * Show or hide Cookie modal\n * @returns\n */\n toggleCookieModal() {\n if (!document.body.classList.contains(\"cn-open\")) {\n this.openCookieModalToBannerPage();\n return;\n }\n this.closeCookieModal();\n }\n\n /**\n * Open the cookies modal to the banner page\n */\n openCookieModalToBannerPage() {\n this.openCookieModalToCookiePage();\n this.toggleCookieModalPages();\n }\n\n /**\n * Open the cookies modal to the cookies page\n */\n openCookieModalToCookiePage() {\n document.body.classList.add(\"cn-open\");\n this.resetCookieModal();\n this.bannerContent.classList.add(\"d-none\");\n this.modalContainer.classList.remove(\"d-none\");\n this.bannerContainer.classList.add(\"cn-modal-page\");\n\n // Scroll to the top of the cookies list\n this.modalWrapper.scrollTop = 0;\n this.setupCookieModalList();\n this.setTabIndex();\n }\n\n /**\n * Hide the cookies modal\n */\n closeCookieModal() {\n this.updateRestrictCloseModal();\n if (!this.restrictCloseModal) {\n document.body.classList.remove(\"cn-open\");\n if (!this.isOnBannerPage()) {\n // * Make toggle page to banner on closing\n this.bannerContent.classList.toggle(\"d-none\");\n this.modalContainer.classList.toggle(\"d-none\");\n this.bannerContainer.classList.remove(\"cn-modal-page\");\n }\n this.unsetTabIndex();\n this.setupCookieModalList();\n } else {\n throw new Error(\"You need to accept or refuse all cookies\");\n }\n }\n\n /**\n * Setup tab indexes on visible elements\n */\n setTabIndex() {\n // * Prevent focus html tag\n document.documentElement.setAttribute(\"tabindex\", \"-1\");\n setTimeout(() => {\n const focusableSelector =\n \"a[href], button, [role=\\\"button\\\"], input, embed, object, iframe, textarea, select, details, [tabindex]:not([tabindex=\\\"-1\\\"])\";\n\n // * Only focusable elements\n [...document.body.querySelectorAll(focusableSelector)]\n .filter(\n (el) =>\n !el.hasAttribute(\"disabled\") &&\n !el.getAttribute(\"aria-hidden\") &&\n !this.cookieContainer.contains(el)\n )\n .forEach((el) => {\n (el as HTMLElement).setAttribute(\"tabindex\", \"-1\");\n (el as HTMLElement).classList.add(\"cn-disabled\");\n });\n [...this.cookieContainer.querySelectorAll(focusableSelector)]\n .filter(\n (el) =>\n !el.hasAttribute(\"disabled\") &&\n !el.getAttribute(\"aria-hidden\") &&\n // * Only visible elements\n !!(\n (el as HTMLElement).offsetWidth ||\n (el as HTMLElement).offsetHeight ||\n el.getClientRects().length\n ) &&\n !this.cookieContainer.contains(el)\n )\n .forEach((el) => {\n (el as HTMLElement).setAttribute(\"tabindex\", \"0\");\n (el as HTMLElement).classList.remove(\"cn-disabled\");\n });\n this.cookieShowModalBtn.setAttribute(\"tabindex\", \"-1\");\n }, 500);\n }\n\n /**\n * Undo setup tab indexes on visible elements\n */\n unsetTabIndex() {\n document.documentElement.setAttribute(\"tabindex\", \"0\");\n setTimeout(() => {\n document.body.querySelectorAll(\".cn-disabled\").forEach((el) => {\n (el as HTMLElement).setAttribute(\"tabindex\", \"0\");\n (el as HTMLElement).classList.remove(\"cn-disabled\");\n });\n this.cookieShowModalBtn.setAttribute(\"tabindex\", \"0\");\n }, 500);\n }\n\n /**\n * Reset the modal view state\n */\n resetCookieModal() {\n this.bannerContent.classList.remove(\"d-none\");\n this.modalContainer.classList.add(\"d-none\");\n this.bannerContainer.classList.remove(\"cn-modal-page\");\n if (!this.customizeBtn.dataset.openModal) {\n throw new Error(\"Cannot find attribut data-open-modal\");\n }\n this.customizeBtn.innerHTML = this.customizeBtn.dataset.openModal;\n }\n\n /**\n * Set the cookies list in the modal\n */\n setupCookieModalList() {\n this.cookiesUnorderedList.innerHTML = \"\";\n Object.entries(this.config).forEach(([cookieName, cookieConfig]) => {\n const cookie = document.createElement(\"li\");\n const childItem = this.template.children.item(\n 0\n ) as HTMLDivElement | null;\n if (childItem === null) {\n throw new Error(\"Cannot find child item\");\n }\n cookie.append(childItem.cloneNode(true));\n const name = cookie.querySelector(\n \"span.cn-cookie-name\"\n ) as HTMLSpanElement;\n const description = cookie.querySelector(\n \"span.cn-cookie-description\"\n ) as HTMLSpanElement;\n const link = cookie.querySelector(\n \".cn-cookie-link\"\n ) as HTMLElement;\n const cnSwitch = cookie.querySelector(\n \".cn-switch\"\n ) as HTMLInputElement;\n const cnSwitchInput = cookie.querySelector(\n \".cn-switch > input\"\n ) as HTMLInputElement;\n\n // * Undertermined state\n cnSwitchInput.indeterminate = true;\n cnSwitchInput.checked = false;\n\n // * Assign cookie aside content\n name.textContent = cookieConfig.name;\n description.id = `${cookieName}-desc`;\n description.textContent = cookieConfig.description;\n link.textContent = cookieConfig.labelLink;\n link.setAttribute(\"href\", cookieConfig.link);\n\n // * Assign cookie controls\n cnSwitch.id = `${cookieName}-switch`;\n cnSwitch.name = cookieName;\n cnSwitch.dataset.name = cookieName;\n cnSwitch.setAttribute(\"aria-labelledby\", `${cookieName}-desc`);\n cnSwitch.setAttribute(\"aria-describedby\", `${cookieName}-desc`);\n\n const toggleCookie = (cookieName: string) => {\n const cookieStatus = this.getCookieStatus(cookieName);\n this.setCookieStatus(\n cookieName,\n this.invertCookieStatus(cookieStatus),\n cookieConfig\n );\n };\n this.addEvent(cnSwitchInput, \"click\", () => toggleCookie(cookieName));\n this.addEventKbdValidate(cnSwitch, () => cnSwitchInput.click());\n\n this.cookiesUnorderedList.append(cookie);\n\n if (!this.hasBrowserCookie()) {\n // * Ldcweb cookie is not set.\n return;\n }\n // * Setup list status state\n Object.entries(this.getCookieStatusList()).forEach(\n ([ckName, cookieStatus]) => {\n if (ckName === cookieName) {\n switch (cookieStatus) {\n case CookieStatus.true:\n cnSwitchInput.indeterminate = false;\n cnSwitchInput.checked = true;\n break;\n case CookieStatus.false:\n cnSwitchInput.indeterminate = false;\n cnSwitchInput.checked = false;\n break;\n case CookieStatus.wait:\n cnSwitchInput.indeterminate = true;\n cnSwitchInput.checked = false;\n break;\n }\n }\n }\n );\n });\n }\n\n switchToModalPageOrClose(): void {\n // * Modification du comportement du bouton, même si ca n'a pas de sens.\n // https://lab.s-web.fr/ldc-web/projets/ldc-web-cookie-notice/-/issues/9`\n\n if (this.isOnBannerPage()) {\n this.toggleCookieModalPages();\n return;\n }\n // * Pas de permutation en arrière\n this.closeCookieModal();\n }\n\n /**\n * Toggle Cookie modal pages\n */\n toggleCookieModalPages() {\n this.bannerContent.classList.toggle(\"d-none\");\n this.modalContainer.classList.toggle(\"d-none\");\n this.bannerContainer.classList.toggle(\"cn-modal-page\");\n if (!this.isOnBannerPage()) {\n this.bannerContainer.classList.add(\"cn-modal-page\");\n }\n this.setTabIndex();\n this.setupCookieModalList();\n this.togglePersonalizeBtn();\n }\n\n /**\n * Toggle customize btn\n */\n togglePersonalizeBtn() {\n const customizeBtnBannerDataset = this.customizeBtn.dataset;\n this.modalWrapper.scrollTop = 0;\n if (this.bannerContent.classList.contains(\"d-none\")) {\n this.customizeBtn.innerHTML =\n customizeBtnBannerDataset.openModal as string;\n this.customizeBtn.title = customizeBtnBannerDataset.openModal as string;\n } else {\n this.customizeBtn.innerHTML =\n customizeBtnBannerDataset.closeModal as string;\n this.customizeBtn.title = customizeBtnBannerDataset.closeModal as string;\n }\n }\n\n /**\n * Get the actual page: banner or modal (with cookie choices)\n */\n isOnBannerPage(): boolean {\n return this.modalContainer.classList.contains(\"d-none\");\n }\n\n /**\n * Invert cookie status\n *\n * @param status\n * @returns Inverted cookie status, `wait` will give `false`.\n */\n private invertCookieStatus(status: CookieStatus): CookieStatus {\n switch (status) {\n case CookieStatus.true:\n case CookieStatus.wait:\n return CookieStatus.false;\n case CookieStatus.false:\n return CookieStatus.true;\n default:\n throw new Error(`Un handled cookie status ${status}`);\n }\n }\n}\n\nenum CookieStatus {\n true = \"true\",\n false = \"false\",\n wait = \"wait\",\n}\n\ntype CookieStatusList = Record;\n\ntype CookiePolicy = {\n sameSite: CookiePolicySameSite;\n secure: string;\n};\n\nenum CookiePolicySameSite {\n lax = \"lax\",\n strict = \"strict\",\n none = \"none\",\n}\n\nexport type CookieOptions = {\n name: string;\n description: string;\n link: string;\n labelLink: string;\n cookies: string[];\n /**\n * Fonction qui sert à initialiser la fonctionnalité\n * conduisant à la génération du cookie\n * @return void\n */\n script: () => void;\n /**\n * Fonction qui sert à informer l'utilisateur\n * sur chaque élèment que le cookie\n * associé à la fonctionnalité\n * est désactivé et propose un lien sur\n * cookie notice pour l'activer\n * @return void\n */\n fallback: () => void | null;\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","","// startup\n// Load entry module and return exports\n__webpack_require__(\"./src/ts/index.ts\");\n// This entry module doesn't tell about it's top-level declarations so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./src/scss/themes/standard.scss\");\n",""],"names":["CookieNotice","config","_this","_classCallCheck","_defineProperty","sameSite","CookiePolicySameSite","lax","secure","cookieExpirationDate","readCookiesExpirationDate","Date","setMonth","getMonth","cookieTimeLife","modalBg","document","createElement","classList","add","body","append","cookieContainer","querySelector","cookieShowModalBtn","cookieCloseModalBtn","cookieLinkShowCustomizeModalPageList","querySelectorAll","bannerContainer","bannerContent","modalContainer","acceptAllBtn","denyAllBtn","customizeBtn","cookiesUnorderedList","modalWrapper","template","Error","cookieLinkShowCustomizeModalList","memoryTemplate","cloneNode","remove","restrictCloseModal","addEventPrevent","closeCookieModal","acceptAllCookies","denyAllCookies","switchToModalPageOrClose","toggleCookieModal","forEach","cookieLink","openCookieModalToCookiePage","addEventKbdValidate","cookiesMatchesConfig","cookiesOlderThan","resetBrowserCookie","openCookieModalToBannerPage","updateRestrictCloseModal","Object","entries","getCookieStatusList","_ref","_ref2","_slicedToArray","cookieName","cookieStatus","CookieStatus","wait","true","script","fallback","_createClass","key","value","values","includes","_this$getBrowserCooki","_this2","cookies","getBrowserCookieValue","expirationDateString","split","find","cookieString","startsWith","cookieExpirationName","epochExpiration","Number","parseInt","replace","concat","isNaN","e","date","getTime","keys","length","_this3","acceptCookie","cookieOptions","getCookie","setCookieStatus","cnSwitch","getElementById","cnSwitchInput","checked","ariaChecked","_this4","denyCookie","false","_Object$entries$find","entry","undefined","_this5","statusList","filter","specificCookieString","containsCookieStatus","getCookieStatus","cookieIndex","status","cookieOption","addCookieStatus","removeCookieStatus","setBrowserCookieStatus","cookieNameElement","deleteBrowserCookie","saveBrowserCookie","hasBrowserCookie","Boolean","matches","cookie","match","RegExp","browserCookieName","decodeURIComponent","content","map","_ref3","_ref4","push","join","location","hostname","toUTCString","getCookiePoliciesAsString","cookiePolicies","_ref5","_ref6","policyName","policyValue","newCookieList","_ref7","_ref8","addEvent","element","evnt","funct","addEventListener","bind","_this6","preventDefault","call","_this7","kbdEvt","code","keyCode","contains","toggleCookieModalPages","resetCookieModal","scrollTop","setupCookieModalList","setTabIndex","isOnBannerPage","toggle","unsetTabIndex","_this8","documentElement","setAttribute","setTimeout","focusableSelector","_toConsumableArray","el","hasAttribute","getAttribute","offsetWidth","offsetHeight","getClientRects","_this9","dataset","openModal","innerHTML","_this10","_ref9","_ref10","cookieConfig","childItem","children","item","name","description","link","indeterminate","textContent","id","labelLink","toggleCookie","invertCookieStatus","click","_ref11","_ref12","ckName","togglePersonalizeBtn","customizeBtnBannerDataset","title","closeModal","default"],"sourceRoot":""} \ No newline at end of file