From c5269381d3e9bb89f53ef9fbfac51469c3c78d2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Tue, 11 Apr 2023 14:55:04 +0000 Subject: [PATCH] Ldcweb cookies --- .babelrc | 13 + .gitlab-ci.yml | 6 +- .stylelintrc.json | 4 - README.md | 51 +- changelog.md | 3 + dist/css/cookie-notice-standard.css | 1 - dist/esm/index.js | 594 + dist/js/cookie-notice.js | 1 - dist/typings/index.d.ts | 219 + dist/umd/css/standard.css | 442 + dist/umd/main.js | 884 ++ dist/umd/main.js.map | 1 + ...cookies.blade.php => cn-cookies.blade.php} | 61 +- examples/templates/standard.blade.php | 23 +- jsconfig.json | 2 +- package-lock.json | 12322 +++------------- package.json | 98 +- src/index.ts | 858 ++ src/scss/themes/standard.scss | 51 +- src/scss/variables.scss | 4 +- src/ts/ldcweb-cookies.ts | 764 - tsconfig.json | 13 +- webpack.config.cjs | 60 + webpack.mix.js | 63 - 24 files changed, 5449 insertions(+), 11089 deletions(-) create mode 100644 .babelrc create mode 100644 changelog.md delete mode 100644 dist/css/cookie-notice-standard.css create mode 100644 dist/esm/index.js delete mode 100644 dist/js/cookie-notice.js create mode 100644 dist/typings/index.d.ts create mode 100644 dist/umd/css/standard.css create mode 100644 dist/umd/main.js create mode 100644 dist/umd/main.js.map rename examples/{ldcweb-cookies.blade.php => cn-cookies.blade.php} (81%) create mode 100644 src/index.ts delete mode 100644 src/ts/ldcweb-cookies.ts create mode 100644 webpack.config.cjs delete mode 100644 webpack.mix.js diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..b722ae8 --- /dev/null +++ b/.babelrc @@ -0,0 +1,13 @@ +{ + "presets": [ + [ + "@babel/preset-env", + { + "bugfixes": true, + "useBuiltIns": "entry", + "corejs": "3.22" + } + ], + "@babel/preset-typescript" + ] +} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ad373a3..47e235d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,6 +8,9 @@ include: - project: 'ldc-web/shared-ci' ref: 'main' file: 'security/npm.yml' + - project: 'ldc-web/shared-ci' + ref: 'main' + file: 'build/npm.yml' deploy: image: node:latest @@ -23,4 +26,5 @@ deploy: stages: - lint - security - - deploy \ No newline at end of file + - build + - deploy diff --git a/.stylelintrc.json b/.stylelintrc.json index bf30b6f..1863b37 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -18,15 +18,11 @@ ], "customSyntax": "postcss-scss", "rules": { - "indentation": 4, - "string-quotes": "double", "selector-max-id": null, "color-no-invalid-hex": true, "order/properties-alphabetical-order": null, "max-nesting-depth": 5, "selector-max-compound-selectors": 5, - "declaration-colon-space-after": "always-single-line", - "function-parentheses-space-inside": "never-single-line", "declaration-colon-newline-after": null, "scss/double-slash-comment-empty-line-before": [ "always", diff --git a/README.md b/README.md index 80d9a8a..695acc3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# LDC Web Cookie Notice +# Web Cookie Notice
@@ -9,24 +9,43 @@
-## Contenu : -- `ldcweb-cookie.blade.php` : structure du bandeau des cookies (le DOM) & script. -- `ldcweb-cookies.scss` : stylisation des éléments du DOM. -- `ldcweb-cookies.ts` : typescript du projet. -- `ldcweb-cookies.php` : configuration des variables d'environnement. +## Exemples : +Voir dans la dossier `exemples`. +Ici pour l'instant seulement un exemple pour **Laravel**. ## Étape 1 : implémentation + +### Ajouter le package avec npm +- https://docs.gitlab.com/ee/user/packages/npm_registry/ +- https://lab.s-web.fr/ldc-web/projets/laravel-base-project/-/snippets/8 +- `npm i @ldc-web/cookie-notice --save-dev` + +### Laravel - Ajouter dans le projet, les fichiers au bon endroit : - - `.blade.php` dans le dossier `./resources/view/front(/...)` - - `.scss` dans le dossier `./resources/sass/utilities` - - `.ts` dans le dossier `./resources/ts/utilities` - - `.php` dans le dossier `./config` -- Mettre à jour le fichier `webpack.mix.js` ou importer ces derniers dans les autres fichiers `.scss` ou `.ts` pour la compilation. + - [`cn-cookies.blade.php`](./examples/cn-cookies.blade.php) dans le dossier `resources/view/vendor/` + - [`standard.blade.php`](./examples/templates/standard.blade.php) dans le dossier `resources/view/vendor/cookie-notice-templates` +- Inclure dans le layout general `@include('vendor.cn-cookies')` + +- Ensuite inclure les éléments **style** et **script** + - SCSS + + @import "~@ldc-web/cookie-notice"; + // ou + @import "~@ldc-web/cookie-notice/dist/css/cookie-notice-standard.css"; + // ou + @import "~@ldc-web/cookie-notice/src/scss/themes/standard"; + - **TS/JS** + + @import "@ldc-web/cookie-notice" + import CookieNotice from "@ldc-web/cookie-notice"; + window.WebCookieNotice = CookieNotice; + +### Wordpress +**TODO: Add instructions for wordpress** + ## Étape 2 : customisation -- Ajouter et renseigner la variable d'environnement `ANALYTICS_GOOGLE_ID` dans le fichier `.env`. -- Personnaliser le script des cookies dans le fichier `ldcweb-cookie.blade.php` (Analytics ? ReCaptcha ? Youtube ? Viméo ?), et ajouter les clés du site si nécessaire. -- Personnaliser les fichiers `ldcweb-cookies.blade.php` et `ldcweb-cookies.scss` afin de respecter la charte graphique du projet. +- Couleurs : Pour l'instant les variables **SASS** sont personalisables. Elle se trouvent ici [`node_modules/@ldc-web/cookie-notice/src/scss/variables.scss`](./src/scss/variables.scss) ## Étape 3 : finalisation -- Ajouter un bouton `Gestion des cookies` dans le footer et lui attribuer la classe `ldcweb-cn-cookie-link`. -- Si des vidéos sont présentes, attribuer aux `
` la classe `ldcweb-cn-youtube` pour Youtube, et/ou `ldcweb-cn-vimeo` pour Viméo. \ No newline at end of file +- Ajouter un bouton `Gestion des cookies` dans le footer et lui attribuer la classe `cn-cookie-link`. +- Si des vidéos sont présentes, attribuer aux `
` la classe `cn-youtube` pour Youtube, et/ou `cn-vimeo` pour Viméo. diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..9f6007d --- /dev/null +++ b/changelog.md @@ -0,0 +1,3 @@ +# Changelog + +## 3.0.2 Initial release as UMD + ESM diff --git a/dist/css/cookie-notice-standard.css b/dist/css/cookie-notice-standard.css deleted file mode 100644 index a0dd95c..0000000 --- a/dist/css/cookie-notice-standard.css +++ /dev/null @@ -1 +0,0 @@ -:root{--cs-primary-color:var()}#cn-wrapper *{box-sizing:border-box}#cn-wrapper :before{display:none}#cn-wrapper button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#b9b9b9;border:0;color:#000;cursor:pointer;display:inline-block;font-family:Barlow,sans-serif;font-size:1rem;line-height:1;margin:0;padding:.2rem .5rem;text-align:center;text-decoration:none;transition:background .25s ease-in-out,transform .15s ease}#cn-wrapper button:focus,#cn-wrapper button:hover{background:#a0a0a0;color:#000}#cn-wrapper button:focus{outline:1px solid;outline-color:#000;outline-offset:-4px}#cn-wrapper button:active{transform:scale(.99)}#cn-wrapper .cn-nav #cn-accept-banner,#cn-wrapper .cn-nav #cn-deny-banner,#cn-wrapper .cn-nav #cn-settings-banner{align-items:center;display:flex;flex-direction:column;font-family:Barlow,sans-serif;font-size:1rem;height:3rem;justify-content:center;padding:0}#cn-wrapper{z-index:1050}#cn-wrapper #cn-cookie-btn{background-color:#fff;border-radius:100%;bottom:1rem;box-shadow:0 .1rem 1rem rgba(0,0,0,.35);cursor:pointer;height:50px;left:1rem;padding:8px;position:fixed;right:auto;width:50px}#cn-wrapper #cn-cookie-btn-icon circle,#cn-wrapper #cn-cookie-btn-icon path{fill:#dc9c52}#cn-wrapper #cn-banner{align-items:center;background-color:#fff;border-radius:0;bottom:0;box-shadow:0 .1rem 1rem rgba(0,0,0,.35);display:flex;flex-direction:column;height:100vh;justify-content:flex-end;left:0;line-height:normal;margin:0;max-height:100vh;opacity:0;padding:0;pointer-events:none;position:fixed;top:0;transition:.3s;-webkit-user-select:none;-moz-user-select:none;user-select:none;visibility:hidden;width:100vw;z-index:1050}#cn-wrapper #cn-banner>*{pointer-events:all}@media (min-width:535px){#cn-wrapper #cn-banner{border-radius:.5rem;bottom:calc(1rem + 60px);height:auto;left:0;margin-top:1rem;max-height:80vh;right:auto;width:30rem}}#cn-wrapper #cn-li-template{display:none}#cn-wrapper .cn-content{flex-grow:1;overflow-y:auto;padding:0 .8rem}#cn-wrapper .cn-content .cn-banner-content{color:#b9b9b9;display:flex;flex-direction:column;font-family:Barlow,sans-serif;font-size:14px}#cn-wrapper .cn-content .cn-banner-content .cn-banner-img{text-align:center}#cn-wrapper .cn-content .cn-banner-content .cn-banner-text{flex:2}#cn-wrapper .cn-content .cn-banner-content .cn-banner-text .cn-banner-title{color:#dc9c52;font-family:Satisfy,sans-serif;font-size:25px;font-weight:700;line-height:inherit;text-align:left}#cn-wrapper .cn-content .cn-banner-content .cn-banner-text .cn-banner-para-p{margin:6px 0;text-align:justify}#cn-wrapper .cn-content .cn-banner-content .cn-banner-details{align-items:flex-start;display:flex;flex-direction:row;height:0;justify-content:center;overflow:hidden;text-align:justify;transition:.3s}#cn-wrapper .cn-content .cn-banner-content .cn-banner-btn-details{margin:1rem 0;width:100%}#cn-wrapper .cn-content .cn-banner-content .cn-banner-btn-details-p{background-color:inherit;color:#dc9c52;cursor:pointer;display:inline-block;font-size:14px;margin:0 auto;text-align:center;width:100%}#cn-wrapper .cn-nav{align-items:center;border-bottom-left-radius:.5rem;border-bottom-right-radius:.5rem;border-top:1px solid grey;display:flex;flex-shrink:0;height:3rem;overflow:hidden;width:100%}#cn-wrapper .cn-nav #cn-deny-banner{width:50%}#cn-wrapper .cn-nav #cn-accept-banner{border-left:1px solid grey;border-right:1px solid grey;width:50%}#cn-wrapper .cn-nav #cn-settings-banner{border-top:1px solid grey;width:100%}@media (min-width:535px){#cn-wrapper .cn-nav{flex-wrap:inherit}#cn-wrapper .cn-nav #cn-accept-banner,#cn-wrapper .cn-nav #cn-deny-banner{width:33.33%}#cn-wrapper .cn-nav #cn-settings-banner{border-top:inherit;width:33.33%}#cn-wrapper{height:100%;width:100%}}.cn-open{overflow:hidden!important}.cn-open #cn-wrapper #cn-banner{opacity:1;visibility:visible}@media (min-width:535px){.cn-open #cn-wrapper #cn-banner{left:1rem;right:auto}}#ldcweb-cn.open-banner,#ldcweb-cn.open-banner .ldcweb-cn-banner,#ldcweb-cn.open-modal{display:flex}#ldcweb-cn a,#ldcweb-cn p{color:#b9b9b9;font-family:Barlow,sans-serif;font-size:14px}#ldcweb-cn a{text-decoration:underline;transition:0s}#ldcweb-cn a:hover{color:#dc9c52} diff --git a/dist/esm/index.js b/dist/esm/index.js new file mode 100644 index 0000000..e4821ff --- /dev/null +++ b/dist/esm/index.js @@ -0,0 +1,594 @@ +export default class CookieNotice { + constructor(config) { + this.browserCookieName = "cn-init"; + this.cookiePolicies = { + sameSite: CookiePolicySameSite.lax, + secure: "", + }; + // * Setup Config + this.config = config; + // * Inject DOM modal BG + const modalBg = document.createElement("div"); + modalBg.classList.add("cn-modal-bg"); + document.body.append(modalBg); + this.modalBg = modalBg; + // * Setup Dom Elements + const cookieContainer = document.querySelector("div#cn-wrapper"), cookieShowModalBtn = document.querySelector("button#cn-cookie-btn"), cookieCloseModalBtn = document.querySelector("button#cn-close-modal"), cookieLinkShowCustomizeModalPageList = document.querySelectorAll("a.cn-cookie-link"), bannerContainer = document.querySelector("div#cn-banner"), bannerContent = document.querySelector("div.cn-banner-content"), bannerDetails = document.querySelector("div.cn-banner-details"), bannerParaP = document.querySelector("div.cn-banner-para-p"), detailsTextOpen = document.querySelector("p.cn-banner-para-p-open"), detailsTextClose = document.querySelector("p.cn-banner-para-p-close"), bannerDetailsCollapseBtn = document.querySelector("button.cn-banner-btn-details-p"), bannerDetailsContainer = document.querySelector("div.cn-banner-btn-details"), modalContainer = document.querySelector("div.cn-modal-container"), acceptAllBtn = document.querySelector("button#cn-accept-banner"), denyAllBtn = document.querySelector("button#cn-deny-banner"), customizeBtn = document.querySelector("button#cn-settings-banner"), cookiesUnorderedList = document.querySelector("ul#cn-modal-list"), modalWrapper = document.querySelector("div.cn-modal-wrapper"), template = document.querySelector("div#cn-li-template"); + if (!cookieContainer) { + throw new Error("Cannot find div#cn-wrapper"); + } + if (!cookieShowModalBtn) { + throw new Error("Cannot find 'button#cn-cookie-btn' element"); + } + if (!cookieCloseModalBtn) { + throw new Error("Cannot find 'button#cn-close-modal' element"); + } + if (!bannerContainer) { + throw new Error("Cannot find 'div#cn-banner' element"); + } + if (!bannerContent) { + throw new Error("Cannot find 'div.cn-banner-content' element"); + } + if (!bannerDetails) { + throw new Error("Cannot find 'div.cn-banner-details' element"); + } + if (!bannerParaP) { + throw new Error("Cannot find 'div.cn-banner-para-p' element"); + } + if (!detailsTextOpen) { + throw new Error("Cannot find 'p.cn-banner-para-p-open' element"); + } + if (!detailsTextClose) { + throw new Error("Cannot find 'p.cn-banner-para-p-close' element"); + } + if (!bannerDetailsCollapseBtn) { + throw new Error("Cannot find 'button.cn-banner-btn-details-p' element"); + } + if (!bannerDetailsContainer) { + throw new Error("Cannot find '.cn-banner-btn-details' element"); + } + if (!modalContainer) { + throw new Error("Cannot find 'div.cn-modal-container' element"); + } + if (!acceptAllBtn) { + throw new Error("Cannot find 'button#cn-accept-banner' element"); + } + if (!denyAllBtn) { + throw new Error("Cannot find 'button#cn-deny-banner' element"); + } + if (!customizeBtn) { + throw new Error("Cannot find 'button.cn-settings-banner' element"); + } + if (!cookiesUnorderedList) { + throw new Error("Cannot find 'ul#cn-modal-list' element"); + } + if (!modalWrapper) { + throw new Error("Cannot find 'div.cn-modal-wrapper' element"); + } + if (!template) { + throw new Error("Cannot find 'div#cn-li-template' element"); + } + this.cookieShowModalBtn = cookieShowModalBtn; + this.cookieCloseModalBtn = cookieCloseModalBtn; + this.cookieLinkShowCustomizeModalList = + cookieLinkShowCustomizeModalPageList; + this.cookieContainer = cookieContainer; + this.bannerDetailsContainer = bannerDetailsContainer; + this.bannerContainer = bannerContainer; + this.bannerContent = bannerContent; + this.cookiesUnorderedList = cookiesUnorderedList; + this.modalWrapper = modalWrapper; + this.bannerParaP = bannerParaP; + this.detailsTextOpen = detailsTextOpen; + this.detailsTextClose = detailsTextClose; + this.bannerDetails = bannerDetails; + this.bannerDetailsCollapseBtn = bannerDetailsCollapseBtn; + this.modalContainer = modalContainer; + this.acceptAllBtn = acceptAllBtn; + this.denyAllBtn = denyAllBtn; + this.customizeBtn = customizeBtn; + this.bannerDetailsAreExpanded = false; + this.template = template; + const memoryTemplate = this.template.cloneNode(true); + this.template.remove(); + this.template = memoryTemplate; + // * Setup Events + 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.toggleCookieModalPages); + this.addEventPrevent(this.bannerDetailsCollapseBtn, "click", this.toggleBannerDetails); + this.addEventPrevent(this.cookieShowModalBtn, "click", this.toggleCookieModal); + this.cookieLinkShowCustomizeModalList.forEach((cookieLink) => { + this.addEventPrevent(cookieLink, "click", this.openCookieModalToCookiePage); + }); + // * Setup CN Cookie + if (!this.cookiesMatchesConfig()) { + // * Setup Browser Cookie if none. + this.resetBrowserCookie(); + this.openCookieModalToBannerPage(); + } + // * Cookie should have been created from here. + const cookies = this.getCookieStatusList(); + Object.entries(cookies).forEach(([cookieName, cookieStatus]) => { + if (cookieStatus === CookieStatus.wait) { + // * Open modal if any cookie config is not set. + this.openCookieModalToBannerPage(); + return; + } + if (!this.config[cookieName]) { + // * Ignore missing config + return; + } + if (cookieStatus === CookieStatus.true) { + // * Exec script part for accepted cookie. + this.config[cookieName].script(); + return; + } + if (this.config[cookieName].fallback != null) { + // * Exec fallback part for accepted cookie if provided. + this.config[cookieName].fallback(); + } + }); + } + // COOKIES + /** + * Check if the actual cookie matches the config + */ + cookiesMatchesConfig() { + const cookies = this.getCookieStatusList(); + return Object.keys(cookies).length === Object.keys(this.config).length; + } + /** + * Accept a specific cookie + */ + acceptAllCookies() { + Object.entries(this.config).forEach(([cookieName, cookieOption]) => this.setCookieStatus(cookieName, CookieStatus.true, cookieOption)); + for (const acceptLabel of this.cookieContainer.querySelectorAll(".accept > label")) { + acceptLabel.classList.add("active"); + } + for (const denyLabel of this.cookieContainer.querySelectorAll(".deny > label")) { + denyLabel.classList.remove("active"); + } + this.closeCookieModal(); + } + /** + * Deny a specific cookie + */ + denyAllCookies() { + Object.entries(this.config).forEach(([cookieName, cookieOption]) => this.setCookieStatus(cookieName, CookieStatus.false, cookieOption)); + for (const acceptLabel of this.cookieContainer.querySelectorAll(".accept > label")) { + acceptLabel.classList.remove("active"); + } + for (const denyLabel of this.cookieContainer.querySelectorAll(".deny > label")) { + denyLabel.classList.add("active"); + } + this.closeCookieModal(); + } + /** + * Fetch the cookie status list + * + * @returns the cookie status list + */ + getCookieStatusList() { + const cookies = this.getBrowserCookieValue(), statusList = {}; + if (cookies === undefined) { + return statusList; + } + /** specificCookieString contains youtube=true like */ + cookies.split(",").forEach((specificCookieString) => { + const values = specificCookieString.split("="); + statusList[values[0]] = values[1]; + }); + return statusList; + } + /** + * Check has cookie status + * + * @param key + * @param value + */ + containsCookieStatus(key) { + const statusList = this.getCookieStatusList(); + return (Object.keys(statusList).find((cookieName) => cookieName === key) !== + undefined); + } + /** + * Set the cookie value + * + * @param cookieName + * @param status + * @param cookieOption + */ + setCookieStatus(cookieName, status, cookieOption) { + if (status === CookieStatus.true) { + this.addCookieStatus(cookieName, cookieOption); + return; + } + if (status === CookieStatus.false) { + this.removeCookieStatus(cookieName, cookieOption); + return; + } + this.setBrowserCookieStatus(cookieName, CookieStatus.wait); + } + /** + * Add a specific cookie and + * change his status to true + * + * @param cookieName + * @param cookieOption + */ + addCookieStatus(cookieName, cookieOption) { + if (cookieOption.script) { + cookieOption.script(); + } + this.setBrowserCookieStatus(cookieName, CookieStatus.true); + } + /** + * Remove a specific cookie and + * change his status to false + * + * @param cookieName + * @param cookieOption + */ + removeCookieStatus(cookieName, cookieOption) { + const cookieNameElement = document.getElementById(cookieName); + if (cookieNameElement) { + cookieNameElement.remove(); + } + if (cookieOption.fallback) { + cookieOption.fallback(); + } + this.setBrowserCookieStatus(cookieName, CookieStatus.false); + } + /** + * Change the status of a cookie + * + * @param cookieName + * @param status + */ + setBrowserCookieStatus(cookieName, status) { + const statusList = this.getCookieStatusList(); + // * Force refresh + this.deleteBrowserCookie(); + statusList[cookieName] = status; + this.saveBrowserCookie(statusList); + } + /** + * Has CN cokie setup ? + * @returns true if the cookie is setup + */ + hasBrowserCookie() { + return Boolean(this.getBrowserCookieValue()); + } + /** + * Get the Ldcweb cookie + * + * @returns A string like analytics=true,youtube=true or undefined + */ + getBrowserCookieValue() { + const matches = document.cookie.match(new RegExp("(?:^|; )" + + this.browserCookieName.replace(/([.$?*|{}()[\]\\/+^])/g, "\\$1") + + "=([^;]*)")); + return matches ? decodeURIComponent(matches[1]) : undefined; + } + /** + * Save cookie content on web browser + * + * @param list + */ + saveBrowserCookie(statusList) { + const date = new Date(), newDate = new Date(date.setMonth(date.getMonth() + 13)), content = Object.entries(statusList) + .map(([cookieName, cookieStatus]) => { + return `${cookieName}=${cookieStatus}`; + }) + .join(","); + document.cookie = `${this.browserCookieName}=${content};path=/${location.hostname ? `;domain=${location.hostname}` : ""};expires=${newDate.toUTCString()};${this.getCookiePoliciesAsString()}`; + } + /** + * Set an older expire parameter to a specific cookie + */ + deleteBrowserCookie() { + if (this.hasBrowserCookie()) { + // * Suppression du cookie et de sa version precedé d'un point + document.cookie = `${this.browserCookieName}=;path=/${location.hostname ? `;domain=.${location.hostname}` : ""};expires=Thu, 01 Jan 1970 00:00:01 GMT;${this.getCookiePoliciesAsString()}`; + document.cookie = `${this.browserCookieName}=;path=/${location.hostname ? `;domain=${location.hostname}` : ""};expires=Thu, 01 Jan 1970 00:00:01 GMT;${this.getCookiePoliciesAsString()}`; + } + } + getCookiePoliciesAsString() { + return Object.entries(this.cookiePolicies) + .map(([policyName, policyValue]) => `${policyName}=${policyValue}`) + .join(";"); + } + /** + * Reset Ldc Web CN cookie + */ + resetBrowserCookie() { + // * Create Cookie as It does not exists. + const newCookieList = {}; + Object.entries(this.config).forEach(([cookieName]) => (newCookieList[cookieName] = CookieStatus.wait)); + this.saveBrowserCookie(newCookieList); + } + // LISTENERS + /** + * Add event on a specific element + * + * @param element + * @param evnt + * @param funct + * @returns + */ + addEvent(element, evnt, funct) { + return element.addEventListener(evnt, funct.bind(this), false); + } + /** + * Add event on a specific element and prevent default + * + * @param element + * @param evnt + * @param funct + * @returns + */ + addEventPrevent(element, evnt, funct) { + return element.addEventListener(evnt, (e) => { + e.preventDefault(); + funct.call(this, e); + }, false); + } + /** + * Add event on a specific element + * + * @param element + * @param evnt + * @param funct + * @returns + */ + addEventKbdValidate(element, funct) { + return this.addEvent(element, "keyup", (e) => { + const kbdEvt = e; + if (kbdEvt.key == " " || + kbdEvt.code == "Space" || + kbdEvt.keyCode == 32 || + kbdEvt.key == "Enter" || + kbdEvt.code == "Enter" || + kbdEvt.keyCode == 13) { + funct.call(this, kbdEvt); + } + }); + } + // COOKIE MODAL + /** + * Show or hide Cookie modal + * @returns + */ + toggleCookieModal() { + if (!document.body.classList.contains("cn-open")) { + this.openCookieModalToBannerPage(); + return; + } + this.closeCookieModal(); + } + /** + * Open the cookies modal to the banner page + */ + openCookieModalToBannerPage() { + this.openCookieModalToCookiePage(); + this.toggleCookieModalPages(); + } + /** + * Open the cookies modal to the cookies page + */ + openCookieModalToCookiePage() { + document.body.classList.add("cn-open"); + this.resetCookieModal(); + this.bannerContent.classList.add("d-none"); + this.bannerDetails.classList.add("d-none"); + this.bannerDetailsContainer.classList.add("d-none"); + this.modalContainer.classList.remove("d-none"); + // Scroll to the top of the cookies list + this.modalWrapper.scrollTop = 0; + this.setupCookieModalList(); + this.setTabIndex(); + } + /** + * Hide the cookies modal + */ + closeCookieModal() { + document.body.classList.remove("cn-open"); + this.bannerContent.classList.toggle("d-none"); + this.bannerDetails.classList.toggle("d-none"); + this.bannerDetailsContainer.classList.toggle("d-none"); + this.modalContainer.classList.toggle("d-none"); + this.unsetTabIndex(); + this.setupCookieModalList(); + } + /** + * Setup tab indexes on visible elements + */ + setTabIndex() { + // * Prevent focus html tag + document.documentElement.setAttribute("tabindex", "-1"); + setTimeout(() => { + const focusableSelector = "a[href], button, [role=\"button\"], input, embed, object, iframe, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])"; + // * Only focusable elements + [...document.body.querySelectorAll(focusableSelector)] + .filter((el) => !el.hasAttribute("disabled") && + !el.getAttribute("aria-hidden")) + .forEach((el) => { + el.setAttribute("tabindex", "-1"); + el.classList.add("cn-disabled"); + }); + [...this.cookieContainer.querySelectorAll(focusableSelector)] + .filter((el) => !el.hasAttribute("disabled") && + !el.getAttribute("aria-hidden") && + // * Only visible elements + !!(el.offsetWidth || + el.offsetHeight || + el.getClientRects().length)) + .forEach((el) => { + el.setAttribute("tabindex", "0"); + el.classList.remove("cn-disabled"); + }); + this.cookieShowModalBtn.setAttribute("tabindex", "-1"); + }, 500); + } + /** + * Undo setup tab indexes on visible elements + */ + unsetTabIndex() { + document.documentElement.setAttribute("tabindex", "0"); + setTimeout(() => { + document.body.querySelectorAll(".cn-disabled").forEach((el) => { + el.setAttribute("tabindex", "0"); + el.classList.remove("cn-disabled"); + }); + this.cookieShowModalBtn.setAttribute("tabindex", "0"); + }, 500); + } + /** + * Reset the modal view state + */ + resetCookieModal() { + this.bannerContent.classList.remove("d-none"); + this.bannerDetails.classList.remove("d-none"); + this.bannerDetailsContainer.classList.remove("d-none"); + this.modalContainer.classList.add("d-none"); + if (!this.customizeBtn.dataset.openModal) { + throw new Error("Cannot find attribut data-open-modal"); + } + this.customizeBtn.innerHTML = this.customizeBtn.dataset.openModal; + } + /** + * Set the cookies list in the modal + */ + setupCookieModalList() { + this.cookiesUnorderedList.innerHTML = ""; + Object.entries(this.config).forEach(([cookieName, cookieConfig]) => { + const cookie = document.createElement("li"); + const childItem = this.template.children.item(0); + if (childItem === null) { + throw new Error("Cannot find child item"); + } + cookie.append(childItem.cloneNode(true)); + const name = cookie.querySelector("span.cn-cookie-name"); + const description = cookie.querySelector("span.cn-cookie-description"); + const link = cookie.querySelector(".cn-cookie-link"); + const acceptInput = cookie.querySelector(".accept > input"); + const denyInput = cookie.querySelector(".deny > input"); + const acceptLabel = cookie.querySelector(".accept > label"); + const denyLabel = cookie.querySelector(".deny > label"); + name.textContent = cookieConfig.name; + description.textContent = cookieConfig.description; + link.textContent = cookieConfig.labelLink; + link.setAttribute("href", cookieConfig.link); + acceptInput.id = cookieName + "1"; + acceptInput.name = cookieName; + acceptInput.dataset.name = cookieName; + acceptLabel.htmlFor = cookieName + "1"; + denyInput.id = cookieName + "2"; + denyInput.name = cookieName; + denyInput.dataset.name = cookieName; + denyLabel.htmlFor = cookieName + "2"; + const acceptFn = () => { + acceptLabel.classList.add("active"); + denyLabel.classList.remove("active"); + this.setCookieStatus(cookieName, CookieStatus.true, cookieConfig); + }, denyFn = () => { + acceptLabel.classList.remove("active"); + denyLabel.classList.add("active"); + this.setCookieStatus(cookieName, CookieStatus.false, cookieConfig); + }; + this.addEvent(acceptInput, "click", acceptFn); + this.addEventKbdValidate(acceptLabel, acceptFn); + this.addEvent(denyInput, "click", denyFn); + this.addEventKbdValidate(denyLabel, denyFn); + this.cookiesUnorderedList.append(cookie); + if (!this.hasBrowserCookie()) { + // * Ldcweb cookie is not set. + return; + } + // * Setup list status state + Object.entries(this.getCookieStatusList()).forEach(([ckName, cookieStatus]) => { + if (ckName === cookieName) { + acceptLabel.classList.remove("active"); + denyLabel.classList.remove("active"); + switch (cookieStatus) { + case CookieStatus.true: + acceptLabel.classList.add("active"); + break; + case CookieStatus.false: + denyLabel.classList.add("active"); + break; + } + } + }); + }); + } + /** + * Toggle show hide banner details + */ + toggleBannerDetails() { + this.bannerDetails.classList.toggle("cn-details-open"); + if (!this.bannerDetailsCollapseBtn.dataset.open || + !this.bannerDetailsCollapseBtn.dataset.close) { + throw new Error("Cannot find attribute data-open or data-close"); + } + if (this.bannerDetailsAreExpanded) { + this.bannerDetailsCollapseBtn.innerHTML = + this.bannerDetailsCollapseBtn.dataset.close; + this.detailsTextOpen.classList.add("d-none"); + this.detailsTextClose.classList.remove("d-none"); + this.bannerDetails.style.height = "0px"; + this.bannerDetailsAreExpanded = false; + } + else { + this.bannerDetailsCollapseBtn.innerHTML = + this.bannerDetailsCollapseBtn.dataset.open; + this.detailsTextOpen.classList.remove("d-none"); + this.detailsTextClose.classList.add("d-none"); + this.bannerDetails.style.height = + this.bannerDetails.children[0].clientHeight + "px"; + this.bannerDetailsAreExpanded = true; + } + } + /** + * Toggle Cookie modal pages + */ + toggleCookieModalPages() { + this.bannerContent.classList.toggle("d-none"); + this.bannerDetails.classList.toggle("d-none"); + this.bannerDetailsContainer.classList.toggle("d-none"); + this.modalContainer.classList.toggle("d-none"); + this.setTabIndex(); + this.setupCookieModalList(); + this.togglePersonalizeBtn(); + } + /** + * Toggle customize btn + */ + togglePersonalizeBtn() { + const customizeBtnBannerDataset = this.customizeBtn.dataset; + this.modalWrapper.scrollTop = 0; + if (this.bannerContent.classList.contains("d-none")) { + this.customizeBtn.innerHTML = + customizeBtnBannerDataset.openModal; + } + else { + this.customizeBtn.innerHTML = + customizeBtnBannerDataset.closeModal; + } + } +} +var CookieStatus; +(function (CookieStatus) { + CookieStatus["true"] = "true"; + CookieStatus["false"] = "false"; + CookieStatus["wait"] = "wait"; +})(CookieStatus || (CookieStatus = {})); +var CookiePolicySameSite; +(function (CookiePolicySameSite) { + CookiePolicySameSite["lax"] = "lax"; + CookiePolicySameSite["strict"] = "strict"; + CookiePolicySameSite["none"] = "none"; +})(CookiePolicySameSite || (CookiePolicySameSite = {})); diff --git a/dist/js/cookie-notice.js b/dist/js/cookie-notice.js deleted file mode 100644 index 58e2f32..0000000 --- a/dist/js/cookie-notice.js +++ /dev/null @@ -1 +0,0 @@ -!function(){var t,r={5829:function(t,r,n){"use strict";var e;n(9720),n(9600),n(1539),n(4747),n(8309),n(2526),n(1817),n(9254),n(7042),n(2772),n(4916),n(4723),n(4603),n(9714),n(5306),n(6649),n(6078),n(9653),n(9070),n(2165),n(6992),n(8783),n(3948),n(1038);!function(t){t.true="true",t.false="false",t.wait="wait"}(e||(e={}))},9662:function(t,r,n){var e=n(614),o=n(6330),i=TypeError;t.exports=function(t){if(e(t))return t;throw i(o(t)+" is not a function")}},6077:function(t,r,n){var e=n(614),o=String,i=TypeError;t.exports=function(t){if("object"==typeof t||e(t))return t;throw i("Can't set "+o(t)+" as a prototype")}},1223:function(t,r,n){var e=n(5112),o=n(30),i=n(3070).f,u=e("unscopables"),c=Array.prototype;null==c[u]&&i(c,u,{configurable:!0,value:o(null)}),t.exports=function(t){c[u][t]=!0}},1530:function(t,r,n){"use strict";var e=n(8710).charAt;t.exports=function(t,r,n){return r+(n?e(t,r).length:1)}},9670:function(t,r,n){var e=n(111),o=String,i=TypeError;t.exports=function(t){if(e(t))return t;throw i(o(t)+" is not an object")}},8533:function(t,r,n){"use strict";var e=n(2092).forEach,o=n(9341)("forEach");t.exports=o?[].forEach:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}},8457:function(t,r,n){"use strict";var e=n(9974),o=n(6916),i=n(7908),u=n(3411),c=n(7659),a=n(4411),f=n(6244),s=n(6135),p=n(4121),l=n(1246),v=Array;t.exports=function(t){var r=i(t),n=a(this),g=arguments.length,y=g>1?arguments[1]:void 0,h=void 0!==y;h&&(y=e(y,g>2?arguments[2]:void 0));var d,x,b,m,S,O,w=l(r),E=0;if(!w||this===v&&c(w))for(d=f(r),x=n?new this(d):v(d);d>E;E++)O=h?y(r[E],E):r[E],s(x,E,O);else for(S=(m=p(r,w)).next,x=n?new this:[];!(b=o(S,m)).done;E++)O=h?u(m,y,[b.value,E],!0):b.value,s(x,E,O);return x.length=E,x}},1318:function(t,r,n){var e=n(5656),o=n(1400),i=n(6244),u=function(t){return function(r,n,u){var c,a=e(r),f=i(a),s=o(u,f);if(t&&n!=n){for(;f>s;)if((c=a[s++])!=c)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===n)return t||s||0;return!t&&-1}};t.exports={includes:u(!0),indexOf:u(!1)}},2092:function(t,r,n){var e=n(9974),o=n(1702),i=n(8361),u=n(7908),c=n(6244),a=n(5417),f=o([].push),s=function(t){var r=1==t,n=2==t,o=3==t,s=4==t,p=6==t,l=7==t,v=5==t||p;return function(g,y,h,d){for(var x,b,m=u(g),S=i(m),O=e(y,h),w=c(S),E=0,j=d||a,I=r?j(g,w):n||l?j(g,0):void 0;w>E;E++)if((v||E in S)&&(b=O(x=S[E],E,m),t))if(r)I[E]=b;else if(b)switch(t){case 3:return!0;case 5:return x;case 6:return E;case 2:f(I,x)}else switch(t){case 4:return!1;case 7:f(I,x)}return p?-1:o||s?s:I}};t.exports={forEach:s(0),map:s(1),filter:s(2),some:s(3),every:s(4),find:s(5),findIndex:s(6),filterReject:s(7)}},1194:function(t,r,n){var e=n(7293),o=n(5112),i=n(7392),u=o("species");t.exports=function(t){return i>=51||!e((function(){var r=[];return(r.constructor={})[u]=function(){return{foo:1}},1!==r[t](Boolean).foo}))}},9341:function(t,r,n){"use strict";var e=n(7293);t.exports=function(t,r){var n=[][t];return!!n&&e((function(){n.call(null,r||function(){return 1},1)}))}},1589:function(t,r,n){var e=n(1400),o=n(6244),i=n(6135),u=Array,c=Math.max;t.exports=function(t,r,n){for(var a=o(t),f=e(r,a),s=e(void 0===n?a:n,a),p=u(c(s-f,0)),l=0;f"+a+""}},6178:function(t){t.exports=function(t,r){return{value:t,done:r}}},8880:function(t,r,n){var e=n(9781),o=n(3070),i=n(9114);t.exports=e?function(t,r,n){return o.f(t,r,i(1,n))}:function(t,r,n){return t[r]=n,t}},9114:function(t){t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},6135:function(t,r,n){"use strict";var e=n(4948),o=n(3070),i=n(9114);t.exports=function(t,r,n){var u=e(r);u in t?o.f(t,u,i(0,n)):t[u]=n}},8709:function(t,r,n){"use strict";var e=n(9670),o=n(2140),i=TypeError;t.exports=function(t){if(e(this),"string"===t||"default"===t)t="string";else if("number"!==t)throw i("Incorrect hint");return o(this,t)}},7045:function(t,r,n){var e=n(6339),o=n(3070);t.exports=function(t,r,n){return n.get&&e(n.get,r,{getter:!0}),n.set&&e(n.set,r,{setter:!0}),o.f(t,r,n)}},8052:function(t,r,n){var e=n(614),o=n(3070),i=n(6339),u=n(3072);t.exports=function(t,r,n,c){c||(c={});var a=c.enumerable,f=void 0!==c.name?c.name:r;if(e(n)&&i(n,f,c),c.global)a?t[r]=n:u(r,n);else{try{c.unsafe?t[r]&&(a=!0):delete t[r]}catch(t){}a?t[r]=n:o.f(t,r,{value:n,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return t}},3072:function(t,r,n){var e=n(7854),o=Object.defineProperty;t.exports=function(t,r){try{o(e,t,{value:r,configurable:!0,writable:!0})}catch(n){e[t]=r}return r}},9781:function(t,r,n){var e=n(7293);t.exports=!e((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4154:function(t){var r="object"==typeof document&&document.all,n=void 0===r&&void 0!==r;t.exports={all:r,IS_HTMLDDA:n}},317:function(t,r,n){var e=n(7854),o=n(111),i=e.document,u=o(i)&&o(i.createElement);t.exports=function(t){return u?i.createElement(t):{}}},8324:function(t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8509:function(t,r,n){var e=n(317)("span").classList,o=e&&e.constructor&&e.constructor.prototype;t.exports=o===Object.prototype?void 0:o},8113:function(t){t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},7392:function(t,r,n){var e,o,i=n(7854),u=n(8113),c=i.process,a=i.Deno,f=c&&c.versions||a&&a.version,s=f&&f.v8;s&&(o=(e=s.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!o&&u&&(!(e=u.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=u.match(/Chrome\/(\d+)/))&&(o=+e[1]),t.exports=o},748:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:function(t,r,n){var e=n(7854),o=n(1236).f,i=n(8880),u=n(8052),c=n(3072),a=n(9920),f=n(4705);t.exports=function(t,r){var n,s,p,l,v,g=t.target,y=t.global,h=t.stat;if(n=y?e:h?e[g]||c(g,{}):(e[g]||{}).prototype)for(s in r){if(l=r[s],p=t.dontCallGetSet?(v=o(n,s))&&v.value:n[s],!f(y?s:g+(h?".":"#")+s,t.forced)&&void 0!==p){if(typeof l==typeof p)continue;a(l,p)}(t.sham||p&&p.sham)&&i(l,"sham",!0),u(n,s,l,t)}}},7293:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},7007:function(t,r,n){"use strict";n(4916);var e=n(1470),o=n(8052),i=n(2261),u=n(7293),c=n(5112),a=n(8880),f=c("species"),s=RegExp.prototype;t.exports=function(t,r,n,p){var l=c(t),v=!u((function(){var r={};return r[l]=function(){return 7},7!=""[t](r)})),g=v&&!u((function(){var r=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[f]=function(){return n},n.flags="",n[l]=/./[l]),n.exec=function(){return r=!0,null},n[l](""),!r}));if(!v||!g||n){var y=e(/./[l]),h=r(l,""[t],(function(t,r,n,o,u){var c=e(t),a=r.exec;return a===i||a===s.exec?v&&!u?{done:!0,value:y(r,n,o)}:{done:!0,value:c(n,r,o)}:{done:!1}}));o(String.prototype,t,h[0]),o(s,l,h[1])}p&&a(s[l],"sham",!0)}},2104:function(t,r,n){var e=n(4374),o=Function.prototype,i=o.apply,u=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(e?u.bind(i):function(){return u.apply(i,arguments)})},9974:function(t,r,n){var e=n(1470),o=n(9662),i=n(4374),u=e(e.bind);t.exports=function(t,r){return o(t),void 0===r?t:i?u(t,r):function(){return t.apply(r,arguments)}}},4374:function(t,r,n){var e=n(7293);t.exports=!e((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},6916:function(t,r,n){var e=n(4374),o=Function.prototype.call;t.exports=e?o.bind(o):function(){return o.apply(o,arguments)}},6530:function(t,r,n){var e=n(9781),o=n(2597),i=Function.prototype,u=e&&Object.getOwnPropertyDescriptor,c=o(i,"name"),a=c&&"something"===function(){}.name,f=c&&(!e||e&&u(i,"name").configurable);t.exports={EXISTS:c,PROPER:a,CONFIGURABLE:f}},5668:function(t,r,n){var e=n(1702),o=n(9662);t.exports=function(t,r,n){try{return e(o(Object.getOwnPropertyDescriptor(t,r)[n]))}catch(t){}}},1470:function(t,r,n){var e=n(4326),o=n(1702);t.exports=function(t){if("Function"===e(t))return o(t)}},1702:function(t,r,n){var e=n(4374),o=Function.prototype,i=o.call,u=e&&o.bind.bind(i,i);t.exports=e?u:function(t){return function(){return i.apply(t,arguments)}}},5005:function(t,r,n){var e=n(7854),o=n(614);t.exports=function(t,r){return arguments.length<2?(n=e[t],o(n)?n:void 0):e[t]&&e[t][r];var n}},1246:function(t,r,n){var e=n(648),o=n(8173),i=n(8554),u=n(7497),c=n(5112)("iterator");t.exports=function(t){if(!i(t))return o(t,c)||o(t,"@@iterator")||u[e(t)]}},4121:function(t,r,n){var e=n(6916),o=n(9662),i=n(9670),u=n(6330),c=n(1246),a=TypeError;t.exports=function(t,r){var n=arguments.length<2?c(t):r;if(o(n))return i(e(n,t));throw a(u(t)+" is not iterable")}},8044:function(t,r,n){var e=n(1702),o=n(3157),i=n(614),u=n(4326),c=n(1340),a=e([].push);t.exports=function(t){if(i(t))return t;if(o(t)){for(var r=t.length,n=[],e=0;e]*>)/g,s=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,r,n,e,p,l){var v=n+t.length,g=e.length,y=s;return void 0!==p&&(p=o(p),y=f),c(l,y,(function(o,c){var f;switch(u(c,0)){case"$":return"$";case"&":return t;case"`":return a(r,0,n);case"'":return a(r,v);case"<":f=p[a(c,1,-1)];break;default:var s=+c;if(0===s)return o;if(s>g){var l=i(s/10);return 0===l?o:l<=g?void 0===e[l-1]?u(c,1):e[l-1]+u(c,1):o}f=e[s-1]}return void 0===f?"":f}))}},7854:function(t,r,n){var e=function(t){return t&&t.Math==Math&&t};t.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},2597:function(t,r,n){var e=n(1702),o=n(7908),i=e({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,r){return i(o(t),r)}},3501:function(t){t.exports={}},490:function(t,r,n){var e=n(5005);t.exports=e("document","documentElement")},4664:function(t,r,n){var e=n(9781),o=n(7293),i=n(317);t.exports=!e&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:function(t,r,n){var e=n(1702),o=n(7293),i=n(4326),u=Object,c=e("".split);t.exports=o((function(){return!u("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?c(t,""):u(t)}:u},9587:function(t,r,n){var e=n(614),o=n(111),i=n(7674);t.exports=function(t,r,n){var u,c;return i&&e(u=r.constructor)&&u!==n&&o(c=u.prototype)&&c!==n.prototype&&i(t,c),t}},2788:function(t,r,n){var e=n(1702),o=n(614),i=n(5465),u=e(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return u(t)}),t.exports=i.inspectSource},9909:function(t,r,n){var e,o,i,u=n(4811),c=n(7854),a=n(111),f=n(8880),s=n(2597),p=n(5465),l=n(6200),v=n(3501),g="Object already initialized",y=c.TypeError,h=c.WeakMap;if(u||p.state){var d=p.state||(p.state=new h);d.get=d.get,d.has=d.has,d.set=d.set,e=function(t,r){if(d.has(t))throw y(g);return r.facade=t,d.set(t,r),r},o=function(t){return d.get(t)||{}},i=function(t){return d.has(t)}}else{var x=l("state");v[x]=!0,e=function(t,r){if(s(t,x))throw y(g);return r.facade=t,f(t,x,r),r},o=function(t){return s(t,x)?t[x]:{}},i=function(t){return s(t,x)}}t.exports={set:e,get:o,has:i,enforce:function(t){return i(t)?o(t):e(t,{})},getterFor:function(t){return function(r){var n;if(!a(r)||(n=o(r)).type!==t)throw y("Incompatible receiver, "+t+" required");return n}}}},7659:function(t,r,n){var e=n(5112),o=n(7497),i=e("iterator"),u=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||u[i]===t)}},3157:function(t,r,n){var e=n(4326);t.exports=Array.isArray||function(t){return"Array"==e(t)}},614:function(t,r,n){var e=n(4154),o=e.all;t.exports=e.IS_HTMLDDA?function(t){return"function"==typeof t||t===o}:function(t){return"function"==typeof t}},4411:function(t,r,n){var e=n(1702),o=n(7293),i=n(614),u=n(648),c=n(5005),a=n(2788),f=function(){},s=[],p=c("Reflect","construct"),l=/^\s*(?:class|function)\b/,v=e(l.exec),g=!l.exec(f),y=function(t){if(!i(t))return!1;try{return p(f,s,t),!0}catch(t){return!1}},h=function(t){if(!i(t))return!1;switch(u(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return g||!!v(l,a(t))}catch(t){return!0}};h.sham=!0,t.exports=!p||o((function(){var t;return y(y.call)||!y(Object)||!y((function(){t=!0}))||t}))?h:y},4705:function(t,r,n){var e=n(7293),o=n(614),i=/#|\.prototype\./,u=function(t,r){var n=a[c(t)];return n==s||n!=f&&(o(r)?e(r):!!r)},c=u.normalize=function(t){return String(t).replace(i,".").toLowerCase()},a=u.data={},f=u.NATIVE="N",s=u.POLYFILL="P";t.exports=u},8554:function(t){t.exports=function(t){return null==t}},111:function(t,r,n){var e=n(614),o=n(4154),i=o.all;t.exports=o.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:e(t)||t===i}:function(t){return"object"==typeof t?null!==t:e(t)}},1913:function(t){t.exports=!1},7850:function(t,r,n){var e=n(111),o=n(4326),i=n(5112)("match");t.exports=function(t){var r;return e(t)&&(void 0!==(r=t[i])?!!r:"RegExp"==o(t))}},2190:function(t,r,n){var e=n(5005),o=n(614),i=n(7976),u=n(3307),c=Object;t.exports=u?function(t){return"symbol"==typeof t}:function(t){var r=e("Symbol");return o(r)&&i(r.prototype,c(t))}},9212:function(t,r,n){var e=n(6916),o=n(9670),i=n(8173);t.exports=function(t,r,n){var u,c;o(t);try{if(!(u=i(t,"return"))){if("throw"===r)throw n;return n}u=e(u,t)}catch(t){c=!0,u=t}if("throw"===r)throw n;if(c)throw u;return o(u),n}},3061:function(t,r,n){"use strict";var e=n(3383).IteratorPrototype,o=n(30),i=n(9114),u=n(8003),c=n(7497),a=function(){return this};t.exports=function(t,r,n,f){var s=r+" Iterator";return t.prototype=o(e,{next:i(+!f,n)}),u(t,s,!1,!0),c[s]=a,t}},1656:function(t,r,n){"use strict";var e=n(2109),o=n(6916),i=n(1913),u=n(6530),c=n(614),a=n(3061),f=n(9518),s=n(7674),p=n(8003),l=n(8880),v=n(8052),g=n(5112),y=n(7497),h=n(3383),d=u.PROPER,x=u.CONFIGURABLE,b=h.IteratorPrototype,m=h.BUGGY_SAFARI_ITERATORS,S=g("iterator"),O="keys",w="values",E="entries",j=function(){return this};t.exports=function(t,r,n,u,g,h,I){a(n,r,u);var A,P,T,R=function(t){if(t===g&&N)return N;if(!m&&t in k)return k[t];switch(t){case O:case w:case E:return function(){return new n(this,t)}}return function(){return new n(this)}},_=r+" Iterator",L=!1,k=t.prototype,F=k[S]||k["@@iterator"]||g&&k[g],N=!m&&F||R(g),M="Array"==r&&k.entries||F;if(M&&(A=f(M.call(new t)))!==Object.prototype&&A.next&&(i||f(A)===b||(s?s(A,b):c(A[S])||v(A,S,j)),p(A,_,!0,!0),i&&(y[_]=j)),d&&g==w&&F&&F.name!==w&&(!i&&x?l(k,"name",w):(L=!0,N=function(){return o(F,this)})),g)if(P={values:R(w),keys:h?N:R(O),entries:R(E)},I)for(T in P)(m||L||!(T in k))&&v(k,T,P[T]);else e({target:r,proto:!0,forced:m||L},P);return i&&!I||k[S]===N||v(k,S,N,{name:g}),y[r]=N,P}},3383:function(t,r,n){"use strict";var e,o,i,u=n(7293),c=n(614),a=n(111),f=n(30),s=n(9518),p=n(8052),l=n(5112),v=n(1913),g=l("iterator"),y=!1;[].keys&&("next"in(i=[].keys())?(o=s(s(i)))!==Object.prototype&&(e=o):y=!0),!a(e)||u((function(){var t={};return e[g].call(t)!==t}))?e={}:v&&(e=f(e)),c(e[g])||p(e,g,(function(){return this})),t.exports={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:y}},7497:function(t){t.exports={}},6244:function(t,r,n){var e=n(7466);t.exports=function(t){return e(t.length)}},6339:function(t,r,n){var e=n(1702),o=n(7293),i=n(614),u=n(2597),c=n(9781),a=n(6530).CONFIGURABLE,f=n(2788),s=n(9909),p=s.enforce,l=s.get,v=String,g=Object.defineProperty,y=e("".slice),h=e("".replace),d=e([].join),x=c&&!o((function(){return 8!==g((function(){}),"length",{value:8}).length})),b=String(String).split("String"),m=t.exports=function(t,r,n){"Symbol("===y(v(r),0,7)&&(r="["+h(v(r),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(r="get "+r),n&&n.setter&&(r="set "+r),(!u(t,"name")||a&&t.name!==r)&&(c?g(t,"name",{value:r,configurable:!0}):t.name=r),x&&n&&u(n,"arity")&&t.length!==n.arity&&g(t,"length",{value:n.arity});try{n&&u(n,"constructor")&&n.constructor?c&&g(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var e=p(t);return u(e,"source")||(e.source=d(b,"string"==typeof r?r:"")),t};Function.prototype.toString=m((function(){return i(this)&&l(this).source||f(this)}),"toString")},4758:function(t){var r=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var e=+t;return(e>0?n:r)(e)}},30:function(t,r,n){var e,o=n(9670),i=n(6048),u=n(748),c=n(3501),a=n(490),f=n(317),s=n(6200),p="prototype",l="script",v=s("IE_PROTO"),g=function(){},y=function(t){return"<"+l+">"+t+""},h=function(t){t.write(y("")),t.close();var r=t.parentWindow.Object;return t=null,r},d=function(){try{e=new ActiveXObject("htmlfile")}catch(t){}var t,r,n;d="undefined"!=typeof document?document.domain&&e?h(e):(r=f("iframe"),n="java"+l+":",r.style.display="none",a.appendChild(r),r.src=String(n),(t=r.contentWindow.document).open(),t.write(y("document.F=Object")),t.close(),t.F):h(e);for(var o=u.length;o--;)delete d[p][u[o]];return d()};c[v]=!0,t.exports=Object.create||function(t,r){var n;return null!==t?(g[p]=o(t),n=new g,g[p]=null,n[v]=t):n=d(),void 0===r?n:i.f(n,r)}},6048:function(t,r,n){var e=n(9781),o=n(3353),i=n(3070),u=n(9670),c=n(5656),a=n(1956);r.f=e&&!o?Object.defineProperties:function(t,r){u(t);for(var n,e=c(r),o=a(r),f=o.length,s=0;f>s;)i.f(t,n=o[s++],e[n]);return t}},3070:function(t,r,n){var e=n(9781),o=n(4664),i=n(3353),u=n(9670),c=n(4948),a=TypeError,f=Object.defineProperty,s=Object.getOwnPropertyDescriptor,p="enumerable",l="configurable",v="writable";r.f=e?i?function(t,r,n){if(u(t),r=c(r),u(n),"function"==typeof t&&"prototype"===r&&"value"in n&&v in n&&!n[v]){var e=s(t,r);e&&e[v]&&(t[r]=n.value,n={configurable:l in n?n[l]:e[l],enumerable:p in n?n[p]:e[p],writable:!1})}return f(t,r,n)}:f:function(t,r,n){if(u(t),r=c(r),u(n),o)try{return f(t,r,n)}catch(t){}if("get"in n||"set"in n)throw a("Accessors not supported");return"value"in n&&(t[r]=n.value),t}},1236:function(t,r,n){var e=n(9781),o=n(6916),i=n(5296),u=n(9114),c=n(5656),a=n(4948),f=n(2597),s=n(4664),p=Object.getOwnPropertyDescriptor;r.f=e?p:function(t,r){if(t=c(t),r=a(r),s)try{return p(t,r)}catch(t){}if(f(t,r))return u(!o(i.f,t,r),t[r])}},1156:function(t,r,n){var e=n(4326),o=n(5656),i=n(8006).f,u=n(1589),c="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return c&&"Window"==e(t)?function(t){try{return i(t)}catch(t){return u(c)}}(t):i(o(t))}},8006:function(t,r,n){var e=n(6324),o=n(748).concat("length","prototype");r.f=Object.getOwnPropertyNames||function(t){return e(t,o)}},5181:function(t,r){r.f=Object.getOwnPropertySymbols},9518:function(t,r,n){var e=n(2597),o=n(614),i=n(7908),u=n(6200),c=n(8544),a=u("IE_PROTO"),f=Object,s=f.prototype;t.exports=c?f.getPrototypeOf:function(t){var r=i(t);if(e(r,a))return r[a];var n=r.constructor;return o(n)&&r instanceof n?n.prototype:r instanceof f?s:null}},7976:function(t,r,n){var e=n(1702);t.exports=e({}.isPrototypeOf)},6324:function(t,r,n){var e=n(1702),o=n(2597),i=n(5656),u=n(1318).indexOf,c=n(3501),a=e([].push);t.exports=function(t,r){var n,e=i(t),f=0,s=[];for(n in e)!o(c,n)&&o(e,n)&&a(s,n);for(;r.length>f;)o(e,n=r[f++])&&(~u(s,n)||a(s,n));return s}},1956:function(t,r,n){var e=n(6324),o=n(748);t.exports=Object.keys||function(t){return e(t,o)}},5296:function(t,r){"use strict";var n={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,o=e&&!n.call({1:2},1);r.f=o?function(t){var r=e(this,t);return!!r&&r.enumerable}:n},7674:function(t,r,n){var e=n(5668),o=n(9670),i=n(6077);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,r=!1,n={};try{(t=e(Object.prototype,"__proto__","set"))(n,[]),r=n instanceof Array}catch(t){}return function(n,e){return o(n),i(e),r?t(n,e):n.__proto__=e,n}}():void 0)},4699:function(t,r,n){var e=n(9781),o=n(1702),i=n(1956),u=n(5656),c=o(n(5296).f),a=o([].push),f=function(t){return function(r){for(var n,o=u(r),f=i(o),s=f.length,p=0,l=[];s>p;)n=f[p++],e&&!c(o,n)||a(l,t?[n,o[n]]:o[n]);return l}};t.exports={entries:f(!0),values:f(!1)}},288:function(t,r,n){"use strict";var e=n(1694),o=n(648);t.exports=e?{}.toString:function(){return"[object "+o(this)+"]"}},2140:function(t,r,n){var e=n(6916),o=n(614),i=n(111),u=TypeError;t.exports=function(t,r){var n,c;if("string"===r&&o(n=t.toString)&&!i(c=e(n,t)))return c;if(o(n=t.valueOf)&&!i(c=e(n,t)))return c;if("string"!==r&&o(n=t.toString)&&!i(c=e(n,t)))return c;throw u("Can't convert object to primitive value")}},3887:function(t,r,n){var e=n(5005),o=n(1702),i=n(8006),u=n(5181),c=n(9670),a=o([].concat);t.exports=e("Reflect","ownKeys")||function(t){var r=i.f(c(t)),n=u.f;return n?a(r,n(t)):r}},857:function(t,r,n){var e=n(7854);t.exports=e},2626:function(t,r,n){var e=n(3070).f;t.exports=function(t,r,n){n in t||e(t,n,{configurable:!0,get:function(){return r[n]},set:function(t){r[n]=t}})}},7651:function(t,r,n){var e=n(6916),o=n(9670),i=n(614),u=n(4326),c=n(2261),a=TypeError;t.exports=function(t,r){var n=t.exec;if(i(n)){var f=e(n,t,r);return null!==f&&o(f),f}if("RegExp"===u(t))return e(c,t,r);throw a("RegExp#exec called on incompatible receiver")}},2261:function(t,r,n){"use strict";var e,o,i=n(6916),u=n(1702),c=n(1340),a=n(7066),f=n(2999),s=n(2309),p=n(30),l=n(9909).get,v=n(9441),g=n(7168),y=s("native-string-replace",String.prototype.replace),h=RegExp.prototype.exec,d=h,x=u("".charAt),b=u("".indexOf),m=u("".replace),S=u("".slice),O=(o=/b*/g,i(h,e=/a/,"a"),i(h,o,"a"),0!==e.lastIndex||0!==o.lastIndex),w=f.BROKEN_CARET,E=void 0!==/()??/.exec("")[1];(O||E||w||v||g)&&(d=function(t){var r,n,e,o,u,f,s,v=this,g=l(v),j=c(t),I=g.raw;if(I)return I.lastIndex=v.lastIndex,r=i(d,I,j),v.lastIndex=I.lastIndex,r;var A=g.groups,P=w&&v.sticky,T=i(a,v),R=v.source,_=0,L=j;if(P&&(T=m(T,"y",""),-1===b(T,"g")&&(T+="g"),L=S(j,v.lastIndex),v.lastIndex>0&&(!v.multiline||v.multiline&&"\n"!==x(j,v.lastIndex-1))&&(R="(?: "+R+")",L=" "+L,_++),n=new RegExp("^(?:"+R+")",T)),E&&(n=new RegExp("^"+R+"$(?!\\s)",T)),O&&(e=v.lastIndex),o=i(h,P?n:v,L),P?o?(o.input=S(o.input,_),o[0]=S(o[0],_),o.index=v.lastIndex,v.lastIndex+=o[0].length):v.lastIndex=0:O&&o&&(v.lastIndex=v.global?o.index+o[0].length:e),E&&o&&o.length>1&&i(y,o[0],n,(function(){for(u=1;ub)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$c")}))},4488:function(t,r,n){var e=n(8554),o=TypeError;t.exports=function(t){if(e(t))throw o("Can't call method on "+t);return t}},6340:function(t,r,n){"use strict";var e=n(5005),o=n(7045),i=n(5112),u=n(9781),c=i("species");t.exports=function(t){var r=e(t);u&&r&&!r[c]&&o(r,c,{configurable:!0,get:function(){return this}})}},8003:function(t,r,n){var e=n(3070).f,o=n(2597),i=n(5112)("toStringTag");t.exports=function(t,r,n){t&&!n&&(t=t.prototype),t&&!o(t,i)&&e(t,i,{configurable:!0,value:r})}},6200:function(t,r,n){var e=n(2309),o=n(9711),i=e("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},5465:function(t,r,n){var e=n(7854),o=n(3072),i="__core-js_shared__",u=e[i]||o(i,{});t.exports=u},2309:function(t,r,n){var e=n(1913),o=n(5465);(t.exports=function(t,r){return o[t]||(o[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.29.1",mode:e?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.29.1/LICENSE",source:"https://github.com/zloirock/core-js"})},3429:function(t,r,n){var e=n(7293);t.exports=function(t){return e((function(){var r=""[t]('"');return r!==r.toLowerCase()||r.split('"').length>3}))}},8710:function(t,r,n){var e=n(1702),o=n(9303),i=n(1340),u=n(4488),c=e("".charAt),a=e("".charCodeAt),f=e("".slice),s=function(t){return function(r,n){var e,s,p=i(u(r)),l=o(n),v=p.length;return l<0||l>=v?t?"":void 0:(e=a(p,l))<55296||e>56319||l+1===v||(s=a(p,l+1))<56320||s>57343?t?c(p,l):e:t?f(p,l,l+2):s-56320+(e-55296<<10)+65536}};t.exports={codeAt:s(!1),charAt:s(!0)}},3111:function(t,r,n){var e=n(1702),o=n(4488),i=n(1340),u=n(1361),c=e("".replace),a=RegExp("^["+u+"]+"),f=RegExp("(^|[^"+u+"])["+u+"]+$"),s=function(t){return function(r){var n=i(o(r));return 1&t&&(n=c(n,a,"")),2&t&&(n=c(n,f,"$1")),n}};t.exports={start:s(1),end:s(2),trim:s(3)}},6293:function(t,r,n){var e=n(7392),o=n(7293);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41}))},6532:function(t,r,n){var e=n(6916),o=n(5005),i=n(5112),u=n(8052);t.exports=function(){var t=o("Symbol"),r=t&&t.prototype,n=r&&r.valueOf,c=i("toPrimitive");r&&!r[c]&&u(r,c,(function(t){return e(n,this)}),{arity:1})}},2015:function(t,r,n){var e=n(6293);t.exports=e&&!!Symbol.for&&!!Symbol.keyFor},863:function(t,r,n){var e=n(1702);t.exports=e(1..valueOf)},1400:function(t,r,n){var e=n(9303),o=Math.max,i=Math.min;t.exports=function(t,r){var n=e(t);return n<0?o(n+r,0):i(n,r)}},5656:function(t,r,n){var e=n(8361),o=n(4488);t.exports=function(t){return e(o(t))}},9303:function(t,r,n){var e=n(4758);t.exports=function(t){var r=+t;return r!=r||0===r?0:e(r)}},7466:function(t,r,n){var e=n(9303),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},7908:function(t,r,n){var e=n(4488),o=Object;t.exports=function(t){return o(e(t))}},7593:function(t,r,n){var e=n(6916),o=n(111),i=n(2190),u=n(8173),c=n(2140),a=n(5112),f=TypeError,s=a("toPrimitive");t.exports=function(t,r){if(!o(t)||i(t))return t;var n,a=u(t,s);if(a){if(void 0===r&&(r="default"),n=e(a,t,r),!o(n)||i(n))return n;throw f("Can't convert object to primitive value")}return void 0===r&&(r="number"),c(t,r)}},4948:function(t,r,n){var e=n(7593),o=n(2190);t.exports=function(t){var r=e(t,"string");return o(r)?r:r+""}},1694:function(t,r,n){var e={};e[n(5112)("toStringTag")]="z",t.exports="[object z]"===String(e)},1340:function(t,r,n){var e=n(648),o=String;t.exports=function(t){if("Symbol"===e(t))throw TypeError("Cannot convert a Symbol value to a string");return o(t)}},6330:function(t){var r=String;t.exports=function(t){try{return r(t)}catch(t){return"Object"}}},9711:function(t,r,n){var e=n(1702),o=0,i=Math.random(),u=e(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+u(++o+i,36)}},3307:function(t,r,n){var e=n(6293);t.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:function(t,r,n){var e=n(9781),o=n(7293);t.exports=e&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},4811:function(t,r,n){var e=n(7854),o=n(614),i=e.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},6800:function(t,r,n){var e=n(857),o=n(2597),i=n(6061),u=n(3070).f;t.exports=function(t){var r=e.Symbol||(e.Symbol={});o(r,t)||u(r,t,{value:i.f(t)})}},6061:function(t,r,n){var e=n(5112);r.f=e},5112:function(t,r,n){var e=n(7854),o=n(2309),i=n(2597),u=n(9711),c=n(6293),a=n(3307),f=e.Symbol,s=o("wks"),p=a?f.for||f:f&&f.withoutSetter||u;t.exports=function(t){return i(s,t)||(s[t]=c&&i(f,t)?f[t]:p("Symbol."+t)),s[t]}},1361:function(t){t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},1038:function(t,r,n){var e=n(2109),o=n(8457);e({target:"Array",stat:!0,forced:!n(7072)((function(t){Array.from(t)}))},{from:o})},2772:function(t,r,n){"use strict";var e=n(2109),o=n(1470),i=n(1318).indexOf,u=n(9341),c=o([].indexOf),a=!!c&&1/c([1],1,-0)<0;e({target:"Array",proto:!0,forced:a||!u("indexOf")},{indexOf:function(t){var r=arguments.length>1?arguments[1]:void 0;return a?c(this,t,r)||0:i(this,t,r)}})},6992:function(t,r,n){"use strict";var e=n(5656),o=n(1223),i=n(7497),u=n(9909),c=n(3070).f,a=n(1656),f=n(6178),s=n(1913),p=n(9781),l="Array Iterator",v=u.set,g=u.getterFor(l);t.exports=a(Array,"Array",(function(t,r){v(this,{type:l,target:e(t),index:0,kind:r})}),(function(){var t=g(this),r=t.target,n=t.kind,e=t.index++;return!r||e>=r.length?(t.target=void 0,f(void 0,!0)):f("keys"==n?e:"values"==n?r[e]:[e,r[e]],!1)}),"values");var y=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!s&&p&&"values"!==y.name)try{c(y,"name",{value:"values"})}catch(t){}},9600:function(t,r,n){"use strict";var e=n(2109),o=n(1702),i=n(8361),u=n(5656),c=n(9341),a=o([].join);e({target:"Array",proto:!0,forced:i!=Object||!c("join",",")},{join:function(t){return a(u(this),void 0===t?",":t)}})},7042:function(t,r,n){"use strict";var e=n(2109),o=n(3157),i=n(4411),u=n(111),c=n(1400),a=n(6244),f=n(5656),s=n(6135),p=n(5112),l=n(1194),v=n(206),g=l("slice"),y=p("species"),h=Array,d=Math.max;e({target:"Array",proto:!0,forced:!g},{slice:function(t,r){var n,e,p,l=f(this),g=a(l),x=c(t,g),b=c(void 0===r?g:r,g);if(o(l)&&(n=l.constructor,(i(n)&&(n===h||o(n.prototype))||u(n)&&null===(n=n[y]))&&(n=void 0),n===h||void 0===n))return v(l,x,b);for(e=new(void 0===n?h:n)(d(b-x,0)),p=0;x2)if(f=m(f),43===(r=A(f,0))||45===r){if(88===(n=A(f,2))||120===n)return NaN}else if(48===r){switch(A(f,1)){case 66:case 98:e=2,o=49;break;case 79:case 111:e=8,o=55;break;default:return+f}for(u=(i=I(f,2)).length,c=0;co)return NaN;return parseInt(i,e)}return+f},T=f(S,!O(" 0o1")||!O("0b1")||O("+0x1")),R=function(t){var r,n=arguments.length<1?0:O(function(t){var r=g(t,"number");return"bigint"==typeof r?r:P(r)}(t));return l(E,r=this)&&y((function(){b(r)}))?p(Object(n),this,R):n};R.prototype=E,T&&!o&&(E.constructor=R),e({global:!0,constructor:!0,wrap:!0,forced:T},{Number:R});var _=function(t,r){for(var n,e=i?h(r):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),o=0;e.length>o;o++)s(r,n=e[o])&&!s(t,n)&&x(t,n,d(r,n))};o&&w&&_(c[S],w),(T||o)&&_(c[S],O)},9070:function(t,r,n){var e=n(2109),o=n(9781),i=n(3070).f;e({target:"Object",stat:!0,forced:Object.defineProperty!==i,sham:!o},{defineProperty:i})},9720:function(t,r,n){var e=n(2109),o=n(4699).entries;e({target:"Object",stat:!0},{entries:function(t){return o(t)}})},9660:function(t,r,n){var e=n(2109),o=n(6293),i=n(7293),u=n(5181),c=n(7908);e({target:"Object",stat:!0,forced:!o||i((function(){u.f(1)}))},{getOwnPropertySymbols:function(t){var r=u.f;return r?r(c(t)):[]}})},1539:function(t,r,n){var e=n(1694),o=n(8052),i=n(288);e||o(Object.prototype,"toString",i,{unsafe:!0})},4603:function(t,r,n){var e=n(9781),o=n(7854),i=n(1702),u=n(4705),c=n(9587),a=n(8880),f=n(8006).f,s=n(7976),p=n(7850),l=n(1340),v=n(4706),g=n(2999),y=n(2626),h=n(8052),d=n(7293),x=n(2597),b=n(9909).enforce,m=n(6340),S=n(5112),O=n(9441),w=n(7168),E=S("match"),j=o.RegExp,I=j.prototype,A=o.SyntaxError,P=i(I.exec),T=i("".charAt),R=i("".replace),_=i("".indexOf),L=i("".slice),k=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,F=/a/g,N=/a/g,M=new j(F)!==F,C=g.MISSED_STICKY,D=g.UNSUPPORTED_Y,$=e&&(!M||C||O||w||d((function(){return N[E]=!1,j(F)!=F||j(N)==N||"/a/i"!=j(F,"i")})));if(u("RegExp",$)){for(var G=function(t,r){var n,e,o,i,u,f,g=s(I,this),y=p(t),h=void 0===r,d=[],m=t;if(!g&&y&&h&&t.constructor===G)return t;if((y||s(I,t))&&(t=t.source,h&&(r=v(m))),t=void 0===t?"":l(t),r=void 0===r?"":l(r),m=t,O&&"dotAll"in F&&(e=!!r&&_(r,"s")>-1)&&(r=R(r,/s/g,"")),n=r,C&&"sticky"in F&&(o=!!r&&_(r,"y")>-1)&&D&&(r=R(r,/y/g,"")),w&&(i=function(t){for(var r,n=t.length,e=0,o="",i=[],u={},c=!1,a=!1,f=0,s="";e<=n;e++){if("\\"===(r=T(t,e)))r+=T(t,++e);else if("]"===r)c=!1;else if(!c)switch(!0){case"["===r:c=!0;break;case"("===r:P(k,L(t,e+1))&&(e+=2,a=!0),o+=r,f++;continue;case">"===r&&a:if(""===s||x(u,s))throw new A("Invalid capture group name");u[s]=!0,i[i.length]=[s,f],a=!1,s="";continue}a?s+=r:o+=r}return[o,i]}(t),t=i[0],d=i[1]),u=c(j(t,r),g?this:I,G),(e||o||d.length)&&(f=b(u),e&&(f.dotAll=!0,f.raw=G(function(t){for(var r,n=t.length,e=0,o="",i=!1;e<=n;e++)"\\"!==(r=T(t,e))?i||"."!==r?("["===r?i=!0:"]"===r&&(i=!1),o+=r):o+="[\\s\\S]":o+=r+T(t,++e);return o}(t),n)),o&&(f.sticky=!0),d.length&&(f.groups=d)),t!==m)try{a(u,"source",""===m?"(?:)":m)}catch(t){}return u},U=f(j),V=0;U.length>V;)y(G,j,U[V++]);I.constructor=G,G.prototype=I,h(o,"RegExp",G,{constructor:!0})}m("RegExp")},4916:function(t,r,n){"use strict";var e=n(2109),o=n(2261);e({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},9714:function(t,r,n){"use strict";var e=n(6530).PROPER,o=n(8052),i=n(9670),u=n(1340),c=n(7293),a=n(4706),f="toString",s=RegExp.prototype[f],p=c((function(){return"/a/b"!=s.call({source:"a",flags:"b"})})),l=e&&s.name!=f;(p||l)&&o(RegExp.prototype,f,(function(){var t=i(this);return"/"+u(t.source)+"/"+u(a(t))}),{unsafe:!0})},8783:function(t,r,n){"use strict";var e=n(8710).charAt,o=n(1340),i=n(9909),u=n(1656),c=n(6178),a="String Iterator",f=i.set,s=i.getterFor(a);u(String,"String",(function(t){f(this,{type:a,string:o(t),index:0})}),(function(){var t,r=s(this),n=r.string,o=r.index;return o>=n.length?c(void 0,!0):(t=e(n,o),r.index+=t.length,c(t,!1))}))},9254:function(t,r,n){"use strict";var e=n(2109),o=n(4230);e({target:"String",proto:!0,forced:n(3429)("link")},{link:function(t){return o(this,"a","href",t)}})},4723:function(t,r,n){"use strict";var e=n(6916),o=n(7007),i=n(9670),u=n(8554),c=n(7466),a=n(1340),f=n(4488),s=n(8173),p=n(1530),l=n(7651);o("match",(function(t,r,n){return[function(r){var n=f(this),o=u(r)?void 0:s(r,t);return o?e(o,r,n):new RegExp(r)[t](a(n))},function(t){var e=i(this),o=a(t),u=n(r,e,o);if(u.done)return u.value;if(!e.global)return l(e,o);var f=e.unicode;e.lastIndex=0;for(var s,v=[],g=0;null!==(s=l(e,o));){var y=a(s[0]);v[g]=y,""===y&&(e.lastIndex=p(o,c(e.lastIndex),f)),g++}return 0===g?null:v}]}))},5306:function(t,r,n){"use strict";var e=n(2104),o=n(6916),i=n(1702),u=n(7007),c=n(7293),a=n(9670),f=n(614),s=n(8554),p=n(9303),l=n(7466),v=n(1340),g=n(4488),y=n(1530),h=n(8173),d=n(647),x=n(7651),b=n(5112)("replace"),m=Math.max,S=Math.min,O=i([].concat),w=i([].push),E=i("".indexOf),j=i("".slice),I="$0"==="a".replace(/./,"$0"),A=!!/./[b]&&""===/./[b]("a","$0");u("replace",(function(t,r,n){var i=A?"$":"$0";return[function(t,n){var e=g(this),i=s(t)?void 0:h(t,b);return i?o(i,t,e,n):o(r,v(e),t,n)},function(t,o){var u=a(this),c=v(t);if("string"==typeof o&&-1===E(o,i)&&-1===E(o,"$<")){var s=n(r,u,c,o);if(s.done)return s.value}var g=f(o);g||(o=v(o));var h=u.global;if(h){var b=u.unicode;u.lastIndex=0}for(var I=[];;){var A=x(u,c);if(null===A)break;if(w(I,A),!h)break;""===v(A[0])&&(u.lastIndex=y(c,l(u.lastIndex),b))}for(var P,T="",R=0,_=0;_=R&&(T+=j(c,R,k)+D,R=k+L.length)}return T+j(c,R)}]}),!!c((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}))||!I||A)},4032:function(t,r,n){"use strict";var e=n(2109),o=n(7854),i=n(6916),u=n(1702),c=n(1913),a=n(9781),f=n(6293),s=n(7293),p=n(2597),l=n(7976),v=n(9670),g=n(5656),y=n(4948),h=n(1340),d=n(9114),x=n(30),b=n(1956),m=n(8006),S=n(1156),O=n(5181),w=n(1236),E=n(3070),j=n(6048),I=n(5296),A=n(8052),P=n(7045),T=n(2309),R=n(6200),_=n(3501),L=n(9711),k=n(5112),F=n(6061),N=n(6800),M=n(6532),C=n(8003),D=n(9909),$=n(2092).forEach,G=R("hidden"),U="Symbol",V="prototype",B=D.set,Y=D.getterFor(U),z=Object[V],H=o.Symbol,W=H&&H[V],K=o.TypeError,X=o.QObject,q=w.f,J=E.f,Q=S.f,Z=I.f,tt=u([].push),rt=T("symbols"),nt=T("op-symbols"),et=T("wks"),ot=!X||!X[V]||!X[V].findChild,it=a&&s((function(){return 7!=x(J({},"a",{get:function(){return J(this,"a",{value:7}).a}})).a}))?function(t,r,n){var e=q(z,r);e&&delete z[r],J(t,r,n),e&&t!==z&&J(z,r,e)}:J,ut=function(t,r){var n=rt[t]=x(W);return B(n,{type:U,tag:t,description:r}),a||(n.description=r),n},ct=function(t,r,n){t===z&&ct(nt,r,n),v(t);var e=y(r);return v(n),p(rt,e)?(n.enumerable?(p(t,G)&&t[G][e]&&(t[G][e]=!1),n=x(n,{enumerable:d(0,!1)})):(p(t,G)||J(t,G,d(1,{})),t[G][e]=!0),it(t,e,n)):J(t,e,n)},at=function(t,r){v(t);var n=g(r),e=b(n).concat(lt(n));return $(e,(function(r){a&&!i(ft,n,r)||ct(t,r,n[r])})),t},ft=function(t){var r=y(t),n=i(Z,this,r);return!(this===z&&p(rt,r)&&!p(nt,r))&&(!(n||!p(this,r)||!p(rt,r)||p(this,G)&&this[G][r])||n)},st=function(t,r){var n=g(t),e=y(r);if(n!==z||!p(rt,e)||p(nt,e)){var o=q(n,e);return!o||!p(rt,e)||p(n,G)&&n[G][e]||(o.enumerable=!0),o}},pt=function(t){var r=Q(g(t)),n=[];return $(r,(function(t){p(rt,t)||p(_,t)||tt(n,t)})),n},lt=function(t){var r=t===z,n=Q(r?nt:g(t)),e=[];return $(n,(function(t){!p(rt,t)||r&&!p(z,t)||tt(e,rt[t])})),e};f||(H=function(){if(l(W,this))throw K("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?h(arguments[0]):void 0,r=L(t),n=function(t){this===z&&i(n,nt,t),p(this,G)&&p(this[G],r)&&(this[G][r]=!1),it(this,r,d(1,t))};return a&&ot&&it(z,r,{configurable:!0,set:n}),ut(r,t)},A(W=H[V],"toString",(function(){return Y(this).tag})),A(H,"withoutSetter",(function(t){return ut(L(t),t)})),I.f=ft,E.f=ct,j.f=at,w.f=st,m.f=S.f=pt,O.f=lt,F.f=function(t){return ut(k(t),t)},a&&(P(W,"description",{configurable:!0,get:function(){return Y(this).description}}),c||A(z,"propertyIsEnumerable",ft,{unsafe:!0}))),e({global:!0,constructor:!0,wrap:!0,forced:!f,sham:!f},{Symbol:H}),$(b(et),(function(t){N(t)})),e({target:U,stat:!0,forced:!f},{useSetter:function(){ot=!0},useSimple:function(){ot=!1}}),e({target:"Object",stat:!0,forced:!f,sham:!a},{create:function(t,r){return void 0===r?x(t):at(x(t),r)},defineProperty:ct,defineProperties:at,getOwnPropertyDescriptor:st}),e({target:"Object",stat:!0,forced:!f},{getOwnPropertyNames:pt}),M(),C(H,U),_[G]=!0},1817:function(t,r,n){"use strict";var e=n(2109),o=n(9781),i=n(7854),u=n(1702),c=n(2597),a=n(614),f=n(7976),s=n(1340),p=n(7045),l=n(9920),v=i.Symbol,g=v&&v.prototype;if(o&&a(v)&&(!("description"in g)||void 0!==v().description)){var y={},h=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:s(arguments[0]),r=f(g,this)?new v(t):void 0===t?v():v(t);return""===t&&(y[r]=!0),r};l(h,v),h.prototype=g,g.constructor=h;var d="Symbol(test)"==String(v("test")),x=u(g.valueOf),b=u(g.toString),m=/^Symbol\((.*)\)[^)]+$/,S=u("".replace),O=u("".slice);p(g,"description",{configurable:!0,get:function(){var t=x(this);if(c(y,t))return"";var r=b(t),n=d?O(r,7,-1):S(r,m,"$1");return""===n?void 0:n}}),e({global:!0,constructor:!0,forced:!0},{Symbol:h})}},763:function(t,r,n){var e=n(2109),o=n(5005),i=n(2597),u=n(1340),c=n(2309),a=n(2015),f=c("string-to-symbol-registry"),s=c("symbol-to-string-registry");e({target:"Symbol",stat:!0,forced:!a},{for:function(t){var r=u(t);if(i(f,r))return f[r];var n=o("Symbol")(r);return f[r]=n,s[n]=r,n}})},2165:function(t,r,n){n(6800)("iterator")},2526:function(t,r,n){n(4032),n(763),n(6620),n(8862),n(9660)},6620:function(t,r,n){var e=n(2109),o=n(2597),i=n(2190),u=n(6330),c=n(2309),a=n(2015),f=c("symbol-to-string-registry");e({target:"Symbol",stat:!0,forced:!a},{keyFor:function(t){if(!i(t))throw TypeError(u(t)+" is not a symbol");if(o(f,t))return f[t]}})},6649:function(t,r,n){var e=n(6800),o=n(6532);e("toPrimitive"),o()},4747:function(t,r,n){var e=n(7854),o=n(8324),i=n(8509),u=n(8533),c=n(8880),a=function(t){if(t&&t.forEach!==u)try{c(t,"forEach",u)}catch(r){t.forEach=u}};for(var f in o)o[f]&&a(e[f]&&e[f].prototype);a(i)},3948:function(t,r,n){var e=n(7854),o=n(8324),i=n(8509),u=n(6992),c=n(8880),a=n(5112),f=a("iterator"),s=a("toStringTag"),p=u.values,l=function(t,r){if(t){if(t[f]!==p)try{c(t,f,p)}catch(r){t[f]=p}if(t[s]||c(t,s,r),o[r])for(var n in u)if(t[n]!==u[n])try{c(t,n,u[n])}catch(r){t[n]=u[n]}}};for(var v in o)l(e[v]&&e[v].prototype,v);l(i,"DOMTokenList")},322:function(){}},n={};function e(t){var o=n[t];if(void 0!==o)return o.exports;var i=n[t]={exports:{}};return r[t](i,i.exports,e),i.exports}e.m=r,t=[],e.O=function(r,n,o,i){if(!n){var u=1/0;for(s=0;s=i)&&Object.keys(e.O).every((function(t){return e.O[t](n[a])}))?n.splice(a--,1):(c=!1,i0&&t[s-1][2]>i;s--)t[s]=t[s-1];t[s]=[n,o,i]},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,{a:r}),r},e.d=function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},function(){var t={474:0,246:0};e.O.j=function(r){return 0===t[r]};var r=function(r,n){var o,i,u=n[0],c=n[1],a=n[2],f=0;if(u.some((function(r){return 0!==t[r]}))){for(o in c)e.o(c,o)&&(e.m[o]=c[o]);if(a)var s=a(e)}for(r&&r(n);f; + modalBg: HTMLDivElement; + cookieContainer: HTMLDivElement; + bannerContainer: HTMLDivElement; + modalContainer: HTMLDivElement; + cookieShowModalBtn: HTMLButtonElement; + cookieCloseModalBtn: HTMLButtonElement; + bannerDetailsCollapseBtn: HTMLButtonElement; + bannerParaP: HTMLDivElement; + detailsTextOpen: HTMLParagraphElement; + detailsTextClose: HTMLParagraphElement; + bannerContent: HTMLDivElement; + bannerDetails: HTMLDivElement; + bannerDetailsContainer: HTMLDivElement; + acceptAllBtn: HTMLButtonElement; + denyAllBtn: HTMLButtonElement; + customizeBtn: HTMLButtonElement; + cookiesUnorderedList: HTMLUListElement; + cookieLinkShowCustomizeModalList: NodeListOf; + modalWrapper: HTMLDivElement; + template: HTMLDivElement; + bannerDetailsAreExpanded: boolean; + constructor(config: Record); + /** + * Check if the actual cookie matches the config + */ + cookiesMatchesConfig(): boolean; + /** + * Accept a specific cookie + */ + acceptAllCookies(): void; + /** + * Deny a specific cookie + */ + denyAllCookies(): void; + /** + * Fetch the cookie status list + * + * @returns the cookie status list + */ + getCookieStatusList(): CookieStatusList; + /** + * Check has cookie status + * + * @param key + * @param value + */ + containsCookieStatus(key: string): boolean; + /** + * Set the cookie value + * + * @param cookieName + * @param status + * @param cookieOption + */ + setCookieStatus(cookieName: string, status: CookieStatus, cookieOption: CookieOptions): void; + /** + * Add a specific cookie and + * change his status to true + * + * @param cookieName + * @param cookieOption + */ + addCookieStatus(cookieName: string, cookieOption: CookieOptions): void; + /** + * Remove a specific cookie and + * change his status to false + * + * @param cookieName + * @param cookieOption + */ + removeCookieStatus(cookieName: string, cookieOption: CookieOptions): void; + /** + * Change the status of a cookie + * + * @param cookieName + * @param status + */ + setBrowserCookieStatus(cookieName: string, status: CookieStatus): void; + /** + * Has CN cokie setup ? + * @returns true if the cookie is setup + */ + hasBrowserCookie(): boolean; + /** + * Get the Ldcweb cookie + * + * @returns A string like analytics=true,youtube=true or undefined + */ + getBrowserCookieValue(): string | undefined; + /** + * Save cookie content on web browser + * + * @param list + */ + saveBrowserCookie(statusList: CookieStatusList): void; + /** + * Set an older expire parameter to a specific cookie + */ + deleteBrowserCookie(): void; + getCookiePoliciesAsString(): string; + /** + * Reset Ldc Web CN cookie + */ + resetBrowserCookie(): void; + /** + * Add event on a specific element + * + * @param element + * @param evnt + * @param funct + * @returns + */ + addEvent(element: HTMLElement, evnt: string, funct: (e: Event) => void): void; + /** + * Add event on a specific element and prevent default + * + * @param element + * @param evnt + * @param funct + * @returns + */ + addEventPrevent(element: HTMLElement, evnt: string, funct: (e: Event) => void): void; + /** + * Add event on a specific element + * + * @param element + * @param evnt + * @param funct + * @returns + */ + addEventKbdValidate(element: HTMLElement, funct: (e: Event) => void): void; + /** + * Show or hide Cookie modal + * @returns + */ + toggleCookieModal(): void; + /** + * Open the cookies modal to the banner page + */ + openCookieModalToBannerPage(): void; + /** + * Open the cookies modal to the cookies page + */ + openCookieModalToCookiePage(): void; + /** + * Hide the cookies modal + */ + closeCookieModal(): void; + /** + * Setup tab indexes on visible elements + */ + setTabIndex(): void; + /** + * Undo setup tab indexes on visible elements + */ + unsetTabIndex(): void; + /** + * Reset the modal view state + */ + resetCookieModal(): void; + /** + * Set the cookies list in the modal + */ + setupCookieModalList(): void; + /** + * Toggle show hide banner details + */ + toggleBannerDetails(): void; + /** + * Toggle Cookie modal pages + */ + toggleCookieModalPages(): void; + /** + * Toggle customize btn + */ + togglePersonalizeBtn(): void; +} +declare enum CookieStatus { + true = "true", + false = "false", + wait = "wait" +} +type CookieStatusList = Record; +type CookiePolicy = { + sameSite: CookiePolicySameSite; + secure: string; +}; +declare enum CookiePolicySameSite { + lax = "lax", + strict = "strict", + none = "none" +} +export type CookieOptions = { + name: string; + description: string; + link: string; + labelLink: string; + cookies: string[]; + /** + * Fonction qui sert à initialiser la fonctionnalité + * conduisant à la génération du cookie + * @return void + */ + script: () => void; + /** + * Fonction qui sert à informer l'utilisateur + * sur chaque élèment que le cookie + * associé à la fonctionnalité + * est désactivé et propose un lien sur + * cookie notice pour l'activer + * @return void + */ + fallback: () => void | null; +}; +export {}; diff --git a/dist/umd/css/standard.css b/dist/umd/css/standard.css new file mode 100644 index 0000000..26d365d --- /dev/null +++ b/dist/umd/css/standard.css @@ -0,0 +1,442 @@ +@charset "UTF-8"; +:root { + --cs-primary-color: var(); +} + +/* Distance par rapport à la gauche de la fenêtre */ +/* Distance par rapport à la droite de la fenêtre */ +/* Distance par rapport au bas de la fenêtre */ +/* Position gauche de base des cookies */ +/* Position droite de base des cookies */ +#cn-wrapper { + /* Buttons styles start */ + /* Button styles end */ +} +#cn-wrapper * { + box-sizing: border-box; +} +#cn-wrapper *::before { + display: none; +} +#cn-wrapper button { + display: inline-block; + padding: 0.2rem 0.5rem; + border: 0; + margin: 0; + appearance: none; + background: #b9b9b9; + color: #000; + cursor: pointer; + font-family: "Barlow", sans-serif; + font-size: 1rem; + line-height: 1; + text-align: center; + text-decoration: none; + transition: background 250ms ease-in-out, transform 150ms ease; +} +#cn-wrapper button:hover, +#cn-wrapper button:focus { + background: #a0a0a0; + color: #000; +} +#cn-wrapper button:focus { + outline: 1px solid; + outline-color: #000; + outline-offset: -4px; +} +#cn-wrapper button:active { + transform: scale(0.99); +} + +/** 3.0.0 */ +/* FENETRE D'ACCUEIL */ +/* Title settings */ +/* Text settings */ +/* Button settings */ +/* Title settings */ +/* Text settings */ +/* Accept/Deny btn settings */ +/* Cookies list settings */ +#cn-wrapper .cn-nav #cn-settings-banner, #cn-wrapper .cn-nav #cn-accept-banner, #cn-wrapper .cn-nav #cn-deny-banner, #cn-wrapper .cn-content .cn-modal-container .accept label, +#cn-wrapper .cn-content .cn-modal-container .deny label, #cn-wrapper .cn-content .cn-banner-content .cn-banner-btn-details-p { + display: flex; + height: 3rem; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 0; + background-color: #000; + color: #b9b9b9; + font-family: "Barlow", sans-serif; + font-size: 1rem; +} +#cn-wrapper .cn-nav #cn-settings-banner:hover, #cn-wrapper .cn-nav #cn-accept-banner:hover, #cn-wrapper .cn-nav #cn-deny-banner:hover, #cn-wrapper .cn-content .cn-modal-container .accept label:hover, +#cn-wrapper .cn-content .cn-modal-container .deny label:hover, #cn-wrapper .cn-content .cn-banner-content .cn-banner-btn-details-p:hover, #cn-wrapper .cn-nav #cn-settings-banner:focus, #cn-wrapper .cn-nav #cn-accept-banner:focus, #cn-wrapper .cn-nav #cn-deny-banner:focus, #cn-wrapper .cn-content .cn-modal-container .accept label:focus, +#cn-wrapper .cn-content .cn-modal-container .deny label:focus, #cn-wrapper .cn-content .cn-banner-content .cn-banner-btn-details-p:focus { + background-color: #a0a0a0; + color: #000; +} +#cn-wrapper .cn-nav #cn-settings-banner:focus, #cn-wrapper .cn-nav #cn-accept-banner:focus, #cn-wrapper .cn-nav #cn-deny-banner:focus, #cn-wrapper .cn-content .cn-modal-container .accept label:focus, +#cn-wrapper .cn-content .cn-modal-container .deny label:focus, #cn-wrapper .cn-content .cn-banner-content .cn-banner-btn-details-p:focus { + outline-color: #000; +} + +.cn-modal-bg { + display: none; +} + +.cn-open .cn-modal-bg { + position: fixed; + z-index: 1030; + top: 0; + display: block; + width: 100vw; + height: 100vh; + background-color: rgba(0, 0, 0, 0.6); +} + +.cn-disabled { + pointer-events: none; +} + +#cn-wrapper { + z-index: 1050; +} +#cn-wrapper #cn-cookie-btn { + position: fixed; + right: auto; + bottom: 1rem; + left: 1rem; + width: 3rem; + height: 3rem; + padding: 0.5rem; + border-radius: 100%; + background-color: #fff; + box-shadow: 0 0.1rem 1rem rgba(0, 0, 0, 0.35); + cursor: pointer; +} +#cn-wrapper #cn-cookie-btn:focus { + outline-color: #d1842a; +} +#cn-wrapper #cn-cookie-btn-icon path { + fill: #dc9c52; +} +#cn-wrapper #cn-cookie-btn-icon circle { + fill: #dc9c52; +} +#cn-wrapper #cn-banner { + position: fixed; + z-index: 1050; + top: 0; + bottom: 0; + left: 0; + display: flex; + width: 100vw; + height: 100vh; + max-height: 100vh; + flex-direction: column; + align-items: center; + justify-content: flex-end; + padding: 0; + border-radius: 0; + margin: auto; + margin-bottom: 0; + background-color: #fff; + box-shadow: 0 0.1rem 1rem rgba(0, 0, 0, 0.35); + line-height: initial; + opacity: 0; + pointer-events: none; + transition: 0.3s; + user-select: none; + visibility: hidden; +} +#cn-wrapper #cn-banner .cn-modal-top-line { + align-self: end; +} +#cn-wrapper #cn-banner .cn-modal-top-line #cn-close-modal { + width: 4rem; + height: 3rem; + border-bottom-left-radius: 0.5rem; +} +@media (min-width: 535px) { + #cn-wrapper #cn-banner .cn-modal-top-line #cn-close-modal { + width: 3rem; + height: 2rem; + border-top-right-radius: 0.5rem; + } +} +#cn-wrapper #cn-banner > * { + pointer-events: all; +} +@media (min-width: 535px) { + #cn-wrapper #cn-banner { + right: auto; + bottom: calc(1rem + 60px); + left: 0; + width: 30rem; + height: auto; + max-height: 26rem; + border-radius: 0.5rem; + } +} +#cn-wrapper #cn-li-template { + display: none; +} +#cn-wrapper .d-none { + display: none !important; +} +#cn-wrapper .cn-content { + flex-grow: 1; + padding: 0.8rem; + overflow-y: auto; +} +#cn-wrapper .cn-content .cn-banner-content { + display: flex; + min-height: 100%; + flex-direction: column; + color: #b9b9b9; + font-family: "Barlow", sans-serif; + font-size: 14px; +} +@media (min-width: 535px) { + #cn-wrapper .cn-content .cn-banner-content { + flex-flow: row wrap; + align-items: center; + } + #cn-wrapper .cn-content .cn-banner-content .cn-banner-img { + width: 33%; + } + #cn-wrapper .cn-content .cn-banner-content .cn-banner-text { + width: 66%; + } +} +#cn-wrapper .cn-content .cn-banner-content .cn-banner-img { + text-align: center; +} +#cn-wrapper .cn-content .cn-banner-content .cn-banner-text { + flex: 2; +} +#cn-wrapper .cn-content .cn-banner-content .cn-banner-text .cn-banner-title { + color: #dc9c52; + font-family: "Satisfy", sans-serif; + font-size: 25px; + font-weight: bold; + line-height: inherit; + text-align: left; +} +#cn-wrapper .cn-content .cn-banner-content .cn-banner-text .cn-banner-para-p { + margin: 6px 0; + text-align: justify; +} +#cn-wrapper .cn-content .cn-banner-content .cn-banner-details { + display: flex; + overflow: hidden; + height: 0; + flex-direction: row; + align-items: flex-start; + justify-content: center; + text-align: justify; + transition: 0.3s; +} +#cn-wrapper .cn-content .cn-banner-content .cn-banner-btn-details { + width: 100%; + margin: 1rem 0; +} +#cn-wrapper .cn-content .cn-banner-content .cn-banner-btn-details-p { + display: inline-block; + width: 100%; + margin: 0 auto; + cursor: pointer; + font-size: 14px; + text-align: center; +} +#cn-wrapper .cn-content .cn-modal-container .cn-modal-title { + color: #dc9c52; + font-family: "Satisfy", sans-serif; + font-size: 25px; + font-weight: bold; + text-align: center; +} +#cn-wrapper .cn-content .cn-modal-container .cn-modal-subtitle { + margin-bottom: 6px; + color: #b9b9b9; + color: #dc9c52; + font-family: "Barlow", sans-serif; + font-size: 14px; + text-align: center; +} +#cn-wrapper .cn-content .cn-modal-container .cn-modal-description { + display: flex; + flex-direction: column; + align-items: center; + color: #b9b9b9; + font-family: "Barlow", sans-serif; + font-size: 14px; + font-weight: normal; + line-height: initial; +} +#cn-wrapper .cn-content .cn-modal-container .cn-modal-wrapper { + position: relative; + display: flex; + overflow: auto; + flex-direction: column; + align-items: center; +} +#cn-wrapper .cn-content .cn-modal-container .cn-modal-wrapper ul { + display: flex; + flex-direction: column; + padding: 0 20px; + list-style: none; +} +#cn-wrapper .cn-content .cn-modal-container .cn-modal-wrapper .cn-cookie-wrapper { + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-between; + padding: 20px; + border: 1px solid #e4e4e4; + border-radius: 20px; + margin: 10px 0; +} +#cn-wrapper .cn-content .cn-modal-container .cn-modal-wrapper span { + color: #dc9c52; + font-family: "Barlow", sans-serif; + font-size: 14px; +} +#cn-wrapper .cn-content .cn-modal-container .cn-modal-wrapper a { + color: #dc9c52; + font-family: "Barlow", sans-serif; + font-size: 14px; +} +#cn-wrapper .cn-content .cn-modal-container .cn-modal-wrapper label { + color: #dc9c52; + font-family: "Barlow", sans-serif; + font-size: 14px; +} +#cn-wrapper .cn-content .cn-modal-container .cn-cookie-name { + color: #dc9c52; +} +#cn-wrapper .cn-content .cn-modal-container .cn-cookie-infos { + display: flex; + width: 100%; + flex: 1; + flex-direction: column; +} +#cn-wrapper .cn-content .cn-modal-container .cn-cookie-infos span:first-of-type { + font-size: 17.5px; + font-weight: bold; +} +#cn-wrapper .cn-content .cn-modal-container .cn-cookie-infos .cn-cookie-description { + color: #b9b9b9; +} +#cn-wrapper .cn-content .cn-modal-container .cn-cookie-infos a { + width: fit-content; +} +#cn-wrapper .cn-content .cn-modal-container .cn-cookie-buttons { + display: flex; + width: 200px; + justify-content: space-around; + margin-top: 6px; +} +#cn-wrapper .cn-content .cn-modal-container .cn-cookie-buttons input { + display: none; +} +#cn-wrapper .cn-content .cn-modal-container .cn-cookie-buttons label { + display: block; + width: 100px; + padding: 6px 20px; + color: #fff; + cursor: pointer; + transition: color 0.3s; +} +#cn-wrapper .cn-content .cn-modal-container .cn-cookie-buttons div { + display: table; + margin: 0.5em; + text-align: center; +} +#cn-wrapper .cn-content .cn-modal-container .accept label, +#cn-wrapper .cn-content .cn-modal-container .deny label { + height: inherit; + background: #808080; +} +#cn-wrapper .cn-content .cn-modal-container .accept label:hover, +#cn-wrapper .cn-content .cn-modal-container .accept label:focus { + background-color: #278327; +} +#cn-wrapper .cn-content .cn-modal-container .accept .active { + background-color: #3a3; +} +#cn-wrapper .cn-content .cn-modal-container .deny label:hover, +#cn-wrapper .cn-content .cn-modal-container .deny label:focus { + background-color: #832727; +} +#cn-wrapper .cn-content .cn-modal-container .deny .active { + background-color: #a33; +} +#cn-wrapper .cn-content .cn-modal-container .accept input:checked ~ label { + background-color: #3a3; +} +#cn-wrapper .cn-content .cn-modal-container .deny input:checked ~ label { + background-color: #a33; +} +#cn-wrapper .cn-nav { + display: flex; + overflow: hidden; + width: 100%; + height: 6rem; + flex-shrink: 0; + flex-wrap: wrap; + align-items: center; + border-top: 1px solid #808080; +} +#cn-wrapper .cn-nav #cn-deny-banner { + width: 50%; +} +#cn-wrapper .cn-nav #cn-accept-banner { + width: 50%; + border-right: 1px solid #808080; + border-left: 1px solid #808080; + font-weight: bolder; +} +#cn-wrapper .cn-nav #cn-settings-banner { + width: 100%; + border-top: 1px solid #808080; +} +@media (min-width: 535px) { + #cn-wrapper .cn-nav { + height: 3rem; + flex-wrap: initial; + border-bottom-left-radius: 0.5rem; + border-bottom-right-radius: 0.5rem; + } + #cn-wrapper .cn-nav #cn-deny-banner { + width: 33.33%; + } + #cn-wrapper .cn-nav #cn-accept-banner { + width: 33.33%; + } + #cn-wrapper .cn-nav #cn-settings-banner { + width: 33.33%; + border-top: initial; + } +} +@media (min-width: 535px) { + #cn-wrapper { + width: 100%; + height: 100%; + } +} + +.cn-open { + overflow: hidden !important; +} +.cn-open #cn-wrapper #cn-banner { + opacity: 1; + visibility: visible; +} +@media (min-width: 535px) { + .cn-open #cn-wrapper #cn-banner { + right: auto; + left: 1rem; + } +} \ No newline at end of file diff --git a/dist/umd/main.js b/dist/umd/main.js new file mode 100644 index 0000000..b96bc46 --- /dev/null +++ b/dist/umd/main.js @@ -0,0 +1,884 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["CookieNotice"] = factory(); + else + root["CookieNotice"] = factory(); +})(this, function() { +return /******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "./dist/esm/index.js": +/*!***************************!*\ + !*** ./dist/esm/index.js ***! + \***************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": function() { return /* binding */ CookieNotice; } +/* harmony export */ }); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +var CookieNotice = /*#__PURE__*/function () { + function CookieNotice(config) { + var _this = this; + _classCallCheck(this, CookieNotice); + this.browserCookieName = "cn-init"; + this.cookiePolicies = { + sameSite: CookiePolicySameSite.lax, + secure: "" + }; + // * Setup Config + this.config = config; + // * Inject DOM modal BG + var modalBg = document.createElement("div"); + modalBg.classList.add("cn-modal-bg"); + document.body.append(modalBg); + this.modalBg = modalBg; + // * Setup Dom Elements + var cookieContainer = document.querySelector("div#cn-wrapper"), + cookieShowModalBtn = document.querySelector("button#cn-cookie-btn"), + cookieCloseModalBtn = document.querySelector("button#cn-close-modal"), + cookieLinkShowCustomizeModalPageList = document.querySelectorAll("a.cn-cookie-link"), + bannerContainer = document.querySelector("div#cn-banner"), + bannerContent = document.querySelector("div.cn-banner-content"), + bannerDetails = document.querySelector("div.cn-banner-details"), + bannerParaP = document.querySelector("div.cn-banner-para-p"), + detailsTextOpen = document.querySelector("p.cn-banner-para-p-open"), + detailsTextClose = document.querySelector("p.cn-banner-para-p-close"), + bannerDetailsCollapseBtn = document.querySelector("button.cn-banner-btn-details-p"), + bannerDetailsContainer = document.querySelector("div.cn-banner-btn-details"), + modalContainer = document.querySelector("div.cn-modal-container"), + acceptAllBtn = document.querySelector("button#cn-accept-banner"), + denyAllBtn = document.querySelector("button#cn-deny-banner"), + customizeBtn = document.querySelector("button#cn-settings-banner"), + cookiesUnorderedList = document.querySelector("ul#cn-modal-list"), + modalWrapper = document.querySelector("div.cn-modal-wrapper"), + template = document.querySelector("div#cn-li-template"); + if (!cookieContainer) { + throw new Error("Cannot find div#cn-wrapper"); + } + if (!cookieShowModalBtn) { + throw new Error("Cannot find 'button#cn-cookie-btn' element"); + } + if (!cookieCloseModalBtn) { + throw new Error("Cannot find 'button#cn-close-modal' element"); + } + if (!bannerContainer) { + throw new Error("Cannot find 'div#cn-banner' element"); + } + if (!bannerContent) { + throw new Error("Cannot find 'div.cn-banner-content' element"); + } + if (!bannerDetails) { + throw new Error("Cannot find 'div.cn-banner-details' element"); + } + if (!bannerParaP) { + throw new Error("Cannot find 'div.cn-banner-para-p' element"); + } + if (!detailsTextOpen) { + throw new Error("Cannot find 'p.cn-banner-para-p-open' element"); + } + if (!detailsTextClose) { + throw new Error("Cannot find 'p.cn-banner-para-p-close' element"); + } + if (!bannerDetailsCollapseBtn) { + throw new Error("Cannot find 'button.cn-banner-btn-details-p' element"); + } + if (!bannerDetailsContainer) { + throw new Error("Cannot find '.cn-banner-btn-details' element"); + } + if (!modalContainer) { + throw new Error("Cannot find 'div.cn-modal-container' element"); + } + if (!acceptAllBtn) { + throw new Error("Cannot find 'button#cn-accept-banner' element"); + } + if (!denyAllBtn) { + throw new Error("Cannot find 'button#cn-deny-banner' element"); + } + if (!customizeBtn) { + throw new Error("Cannot find 'button.cn-settings-banner' element"); + } + if (!cookiesUnorderedList) { + throw new Error("Cannot find 'ul#cn-modal-list' element"); + } + if (!modalWrapper) { + throw new Error("Cannot find 'div.cn-modal-wrapper' element"); + } + if (!template) { + throw new Error("Cannot find 'div#cn-li-template' element"); + } + this.cookieShowModalBtn = cookieShowModalBtn; + this.cookieCloseModalBtn = cookieCloseModalBtn; + this.cookieLinkShowCustomizeModalList = cookieLinkShowCustomizeModalPageList; + this.cookieContainer = cookieContainer; + this.bannerDetailsContainer = bannerDetailsContainer; + this.bannerContainer = bannerContainer; + this.bannerContent = bannerContent; + this.cookiesUnorderedList = cookiesUnorderedList; + this.modalWrapper = modalWrapper; + this.bannerParaP = bannerParaP; + this.detailsTextOpen = detailsTextOpen; + this.detailsTextClose = detailsTextClose; + this.bannerDetails = bannerDetails; + this.bannerDetailsCollapseBtn = bannerDetailsCollapseBtn; + this.modalContainer = modalContainer; + this.acceptAllBtn = acceptAllBtn; + this.denyAllBtn = denyAllBtn; + this.customizeBtn = customizeBtn; + this.bannerDetailsAreExpanded = false; + this.template = template; + var memoryTemplate = this.template.cloneNode(true); + this.template.remove(); + this.template = memoryTemplate; + // * Setup Events + 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.toggleCookieModalPages); + this.addEventPrevent(this.bannerDetailsCollapseBtn, "click", this.toggleBannerDetails); + this.addEventPrevent(this.cookieShowModalBtn, "click", this.toggleCookieModal); + this.cookieLinkShowCustomizeModalList.forEach(function (cookieLink) { + _this.addEventPrevent(cookieLink, "click", _this.openCookieModalToCookiePage); + }); + // * Setup CN Cookie + if (!this.cookiesMatchesConfig()) { + // * Setup Browser Cookie if none. + this.resetBrowserCookie(); + this.openCookieModalToBannerPage(); + } + // * Cookie should have been created from here. + var cookies = this.getCookieStatusList(); + Object.entries(cookies).forEach(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + cookieName = _ref2[0], + cookieStatus = _ref2[1]; + if (cookieStatus === CookieStatus.wait) { + // * Open modal if any cookie config is not set. + _this.openCookieModalToBannerPage(); + return; + } + if (!_this.config[cookieName]) { + // * Ignore missing config + return; + } + if (cookieStatus === CookieStatus.true) { + // * Exec script part for accepted cookie. + _this.config[cookieName].script(); + return; + } + if (_this.config[cookieName].fallback != null) { + // * Exec fallback part for accepted cookie if provided. + _this.config[cookieName].fallback(); + } + }); + } + // COOKIES + /** + * Check if the actual cookie matches the config + */ + _createClass(CookieNotice, [{ + key: "cookiesMatchesConfig", + value: function cookiesMatchesConfig() { + var cookies = this.getCookieStatusList(); + return Object.keys(cookies).length === Object.keys(this.config).length; + } + /** + * Accept a specific cookie + */ + }, { + key: "acceptAllCookies", + value: function acceptAllCookies() { + var _this2 = this; + Object.entries(this.config).forEach(function (_ref3) { + var _ref4 = _slicedToArray(_ref3, 2), + cookieName = _ref4[0], + cookieOption = _ref4[1]; + return _this2.setCookieStatus(cookieName, CookieStatus.true, cookieOption); + }); + var _iterator = _createForOfIteratorHelper(this.cookieContainer.querySelectorAll(".accept > label")), + _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var acceptLabel = _step.value; + acceptLabel.classList.add("active"); + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + var _iterator2 = _createForOfIteratorHelper(this.cookieContainer.querySelectorAll(".deny > label")), + _step2; + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + var denyLabel = _step2.value; + denyLabel.classList.remove("active"); + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); + } + this.closeCookieModal(); + } + /** + * Deny a specific cookie + */ + }, { + key: "denyAllCookies", + value: function denyAllCookies() { + var _this3 = this; + Object.entries(this.config).forEach(function (_ref5) { + var _ref6 = _slicedToArray(_ref5, 2), + cookieName = _ref6[0], + cookieOption = _ref6[1]; + return _this3.setCookieStatus(cookieName, CookieStatus.false, cookieOption); + }); + var _iterator3 = _createForOfIteratorHelper(this.cookieContainer.querySelectorAll(".accept > label")), + _step3; + try { + for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { + var acceptLabel = _step3.value; + acceptLabel.classList.remove("active"); + } + } catch (err) { + _iterator3.e(err); + } finally { + _iterator3.f(); + } + var _iterator4 = _createForOfIteratorHelper(this.cookieContainer.querySelectorAll(".deny > label")), + _step4; + try { + for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { + var denyLabel = _step4.value; + denyLabel.classList.add("active"); + } + } catch (err) { + _iterator4.e(err); + } finally { + _iterator4.f(); + } + this.closeCookieModal(); + } + /** + * Fetch the cookie status list + * + * @returns the cookie status list + */ + }, { + key: "getCookieStatusList", + value: function getCookieStatusList() { + var cookies = this.getBrowserCookieValue(), + statusList = {}; + if (cookies === undefined) { + return statusList; + } + /** specificCookieString contains youtube=true like */ + cookies.split(",").forEach(function (specificCookieString) { + var values = specificCookieString.split("="); + statusList[values[0]] = values[1]; + }); + return statusList; + } + /** + * Check has cookie status + * + * @param key + * @param value + */ + }, { + key: "containsCookieStatus", + value: function containsCookieStatus(key) { + var statusList = this.getCookieStatusList(); + return Object.keys(statusList).find(function (cookieName) { + return cookieName === key; + }) !== undefined; + } + /** + * Set the cookie value + * + * @param cookieName + * @param status + * @param cookieOption + */ + }, { + key: "setCookieStatus", + value: function setCookieStatus(cookieName, status, cookieOption) { + if (status === CookieStatus.true) { + this.addCookieStatus(cookieName, cookieOption); + return; + } + if (status === CookieStatus.false) { + this.removeCookieStatus(cookieName, cookieOption); + return; + } + this.setBrowserCookieStatus(cookieName, CookieStatus.wait); + } + /** + * Add a specific cookie and + * change his status to true + * + * @param cookieName + * @param cookieOption + */ + }, { + key: "addCookieStatus", + value: function addCookieStatus(cookieName, cookieOption) { + if (cookieOption.script) { + cookieOption.script(); + } + this.setBrowserCookieStatus(cookieName, CookieStatus.true); + } + /** + * Remove a specific cookie and + * change his status to false + * + * @param cookieName + * @param cookieOption + */ + }, { + key: "removeCookieStatus", + value: function removeCookieStatus(cookieName, cookieOption) { + var cookieNameElement = document.getElementById(cookieName); + if (cookieNameElement) { + cookieNameElement.remove(); + } + if (cookieOption.fallback) { + cookieOption.fallback(); + } + this.setBrowserCookieStatus(cookieName, CookieStatus.false); + } + /** + * Change the status of a cookie + * + * @param cookieName + * @param status + */ + }, { + key: "setBrowserCookieStatus", + value: function setBrowserCookieStatus(cookieName, status) { + var statusList = this.getCookieStatusList(); + // * Force refresh + this.deleteBrowserCookie(); + statusList[cookieName] = status; + this.saveBrowserCookie(statusList); + } + /** + * Has CN cokie setup ? + * @returns true if the cookie is setup + */ + }, { + key: "hasBrowserCookie", + value: function hasBrowserCookie() { + return Boolean(this.getBrowserCookieValue()); + } + /** + * Get the Ldcweb cookie + * + * @returns A string like analytics=true,youtube=true or undefined + */ + }, { + key: "getBrowserCookieValue", + value: function getBrowserCookieValue() { + var matches = document.cookie.match(new RegExp("(?:^|; )" + this.browserCookieName.replace(/([.$?*|{}()[\]\\/+^])/g, "\\$1") + "=([^;]*)")); + return matches ? decodeURIComponent(matches[1]) : undefined; + } + /** + * Save cookie content on web browser + * + * @param list + */ + }, { + key: "saveBrowserCookie", + value: function saveBrowserCookie(statusList) { + var date = new Date(), + newDate = new Date(date.setMonth(date.getMonth() + 13)), + content = Object.entries(statusList).map(function (_ref7) { + var _ref8 = _slicedToArray(_ref7, 2), + cookieName = _ref8[0], + cookieStatus = _ref8[1]; + return "".concat(cookieName, "=").concat(cookieStatus); + }).join(","); + document.cookie = "".concat(this.browserCookieName, "=").concat(content, ";path=/").concat(location.hostname ? ";domain=".concat(location.hostname) : "", ";expires=").concat(newDate.toUTCString(), ";").concat(this.getCookiePoliciesAsString()); + } + /** + * Set an older expire parameter to a specific cookie + */ + }, { + key: "deleteBrowserCookie", + value: function deleteBrowserCookie() { + if (this.hasBrowserCookie()) { + // * Suppression du cookie et de sa version precedé d'un point + document.cookie = "".concat(this.browserCookieName, "=;path=/").concat(location.hostname ? ";domain=.".concat(location.hostname) : "", ";expires=Thu, 01 Jan 1970 00:00:01 GMT;").concat(this.getCookiePoliciesAsString()); + document.cookie = "".concat(this.browserCookieName, "=;path=/").concat(location.hostname ? ";domain=".concat(location.hostname) : "", ";expires=Thu, 01 Jan 1970 00:00:01 GMT;").concat(this.getCookiePoliciesAsString()); + } + } + }, { + key: "getCookiePoliciesAsString", + value: function getCookiePoliciesAsString() { + return Object.entries(this.cookiePolicies).map(function (_ref9) { + var _ref10 = _slicedToArray(_ref9, 2), + policyName = _ref10[0], + policyValue = _ref10[1]; + return "".concat(policyName, "=").concat(policyValue); + }).join(";"); + } + /** + * Reset Ldc Web CN cookie + */ + }, { + key: "resetBrowserCookie", + value: function resetBrowserCookie() { + // * Create Cookie as It does not exists. + var newCookieList = {}; + Object.entries(this.config).forEach(function (_ref11) { + var _ref12 = _slicedToArray(_ref11, 1), + cookieName = _ref12[0]; + return newCookieList[cookieName] = CookieStatus.wait; + }); + this.saveBrowserCookie(newCookieList); + } + // LISTENERS + /** + * Add event on a specific element + * + * @param element + * @param evnt + * @param funct + * @returns + */ + }, { + key: "addEvent", + value: function addEvent(element, evnt, funct) { + return element.addEventListener(evnt, funct.bind(this), false); + } + /** + * Add event on a specific element and prevent default + * + * @param element + * @param evnt + * @param funct + * @returns + */ + }, { + key: "addEventPrevent", + value: function addEventPrevent(element, evnt, funct) { + var _this4 = this; + return element.addEventListener(evnt, function (e) { + e.preventDefault(); + funct.call(_this4, e); + }, false); + } + /** + * Add event on a specific element + * + * @param element + * @param evnt + * @param funct + * @returns + */ + }, { + key: "addEventKbdValidate", + value: function addEventKbdValidate(element, funct) { + var _this5 = this; + return this.addEvent(element, "keyup", function (e) { + var kbdEvt = e; + if (kbdEvt.key == " " || kbdEvt.code == "Space" || kbdEvt.keyCode == 32 || kbdEvt.key == "Enter" || kbdEvt.code == "Enter" || kbdEvt.keyCode == 13) { + funct.call(_this5, kbdEvt); + } + }); + } + // COOKIE MODAL + /** + * Show or hide Cookie modal + * @returns + */ + }, { + key: "toggleCookieModal", + value: function toggleCookieModal() { + if (!document.body.classList.contains("cn-open")) { + this.openCookieModalToBannerPage(); + return; + } + this.closeCookieModal(); + } + /** + * Open the cookies modal to the banner page + */ + }, { + key: "openCookieModalToBannerPage", + value: function openCookieModalToBannerPage() { + this.openCookieModalToCookiePage(); + this.toggleCookieModalPages(); + } + /** + * Open the cookies modal to the cookies page + */ + }, { + key: "openCookieModalToCookiePage", + value: function openCookieModalToCookiePage() { + document.body.classList.add("cn-open"); + this.resetCookieModal(); + this.bannerContent.classList.add("d-none"); + this.bannerDetails.classList.add("d-none"); + this.bannerDetailsContainer.classList.add("d-none"); + this.modalContainer.classList.remove("d-none"); + // Scroll to the top of the cookies list + this.modalWrapper.scrollTop = 0; + this.setupCookieModalList(); + this.setTabIndex(); + } + /** + * Hide the cookies modal + */ + }, { + key: "closeCookieModal", + value: function closeCookieModal() { + document.body.classList.remove("cn-open"); + this.bannerContent.classList.toggle("d-none"); + this.bannerDetails.classList.toggle("d-none"); + this.bannerDetailsContainer.classList.toggle("d-none"); + this.modalContainer.classList.toggle("d-none"); + this.unsetTabIndex(); + this.setupCookieModalList(); + } + /** + * Setup tab indexes on visible elements + */ + }, { + key: "setTabIndex", + value: function setTabIndex() { + var _this6 = this; + // * Prevent focus html tag + document.documentElement.setAttribute("tabindex", "-1"); + setTimeout(function () { + var focusableSelector = "a[href], button, [role=\"button\"], input, embed, object, iframe, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])"; + // * Only focusable elements + _toConsumableArray(document.body.querySelectorAll(focusableSelector)).filter(function (el) { + return !el.hasAttribute("disabled") && !el.getAttribute("aria-hidden"); + }).forEach(function (el) { + el.setAttribute("tabindex", "-1"); + el.classList.add("cn-disabled"); + }); + _toConsumableArray(_this6.cookieContainer.querySelectorAll(focusableSelector)).filter(function (el) { + return !el.hasAttribute("disabled") && !el.getAttribute("aria-hidden") && + // * Only visible elements + !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length); + }).forEach(function (el) { + el.setAttribute("tabindex", "0"); + el.classList.remove("cn-disabled"); + }); + _this6.cookieShowModalBtn.setAttribute("tabindex", "-1"); + }, 500); + } + /** + * Undo setup tab indexes on visible elements + */ + }, { + key: "unsetTabIndex", + value: function unsetTabIndex() { + var _this7 = this; + document.documentElement.setAttribute("tabindex", "0"); + setTimeout(function () { + document.body.querySelectorAll(".cn-disabled").forEach(function (el) { + el.setAttribute("tabindex", "0"); + el.classList.remove("cn-disabled"); + }); + _this7.cookieShowModalBtn.setAttribute("tabindex", "0"); + }, 500); + } + /** + * Reset the modal view state + */ + }, { + key: "resetCookieModal", + value: function resetCookieModal() { + this.bannerContent.classList.remove("d-none"); + this.bannerDetails.classList.remove("d-none"); + this.bannerDetailsContainer.classList.remove("d-none"); + this.modalContainer.classList.add("d-none"); + if (!this.customizeBtn.dataset.openModal) { + throw new Error("Cannot find attribut data-open-modal"); + } + this.customizeBtn.innerHTML = this.customizeBtn.dataset.openModal; + } + /** + * Set the cookies list in the modal + */ + }, { + key: "setupCookieModalList", + value: function setupCookieModalList() { + var _this8 = this; + this.cookiesUnorderedList.innerHTML = ""; + Object.entries(this.config).forEach(function (_ref13) { + var _ref14 = _slicedToArray(_ref13, 2), + cookieName = _ref14[0], + cookieConfig = _ref14[1]; + var cookie = document.createElement("li"); + var childItem = _this8.template.children.item(0); + if (childItem === null) { + throw new Error("Cannot find child item"); + } + cookie.append(childItem.cloneNode(true)); + var name = cookie.querySelector("span.cn-cookie-name"); + var description = cookie.querySelector("span.cn-cookie-description"); + var link = cookie.querySelector(".cn-cookie-link"); + var acceptInput = cookie.querySelector(".accept > input"); + var denyInput = cookie.querySelector(".deny > input"); + var acceptLabel = cookie.querySelector(".accept > label"); + var denyLabel = cookie.querySelector(".deny > label"); + name.textContent = cookieConfig.name; + description.textContent = cookieConfig.description; + link.textContent = cookieConfig.labelLink; + link.setAttribute("href", cookieConfig.link); + acceptInput.id = cookieName + "1"; + acceptInput.name = cookieName; + acceptInput.dataset.name = cookieName; + acceptLabel.htmlFor = cookieName + "1"; + denyInput.id = cookieName + "2"; + denyInput.name = cookieName; + denyInput.dataset.name = cookieName; + denyLabel.htmlFor = cookieName + "2"; + var acceptFn = function acceptFn() { + acceptLabel.classList.add("active"); + denyLabel.classList.remove("active"); + _this8.setCookieStatus(cookieName, CookieStatus.true, cookieConfig); + }, + denyFn = function denyFn() { + acceptLabel.classList.remove("active"); + denyLabel.classList.add("active"); + _this8.setCookieStatus(cookieName, CookieStatus.false, cookieConfig); + }; + _this8.addEvent(acceptInput, "click", acceptFn); + _this8.addEventKbdValidate(acceptLabel, acceptFn); + _this8.addEvent(denyInput, "click", denyFn); + _this8.addEventKbdValidate(denyLabel, denyFn); + _this8.cookiesUnorderedList.append(cookie); + if (!_this8.hasBrowserCookie()) { + // * Ldcweb cookie is not set. + return; + } + // * Setup list status state + Object.entries(_this8.getCookieStatusList()).forEach(function (_ref15) { + var _ref16 = _slicedToArray(_ref15, 2), + ckName = _ref16[0], + cookieStatus = _ref16[1]; + if (ckName === cookieName) { + acceptLabel.classList.remove("active"); + denyLabel.classList.remove("active"); + switch (cookieStatus) { + case CookieStatus.true: + acceptLabel.classList.add("active"); + break; + case CookieStatus.false: + denyLabel.classList.add("active"); + break; + } + } + }); + }); + } + /** + * Toggle show hide banner details + */ + }, { + key: "toggleBannerDetails", + value: function toggleBannerDetails() { + this.bannerDetails.classList.toggle("cn-details-open"); + if (!this.bannerDetailsCollapseBtn.dataset.open || !this.bannerDetailsCollapseBtn.dataset.close) { + throw new Error("Cannot find attribute data-open or data-close"); + } + if (this.bannerDetailsAreExpanded) { + this.bannerDetailsCollapseBtn.innerHTML = this.bannerDetailsCollapseBtn.dataset.close; + this.detailsTextOpen.classList.add("d-none"); + this.detailsTextClose.classList.remove("d-none"); + this.bannerDetails.style.height = "0px"; + this.bannerDetailsAreExpanded = false; + } else { + this.bannerDetailsCollapseBtn.innerHTML = this.bannerDetailsCollapseBtn.dataset.open; + this.detailsTextOpen.classList.remove("d-none"); + this.detailsTextClose.classList.add("d-none"); + this.bannerDetails.style.height = this.bannerDetails.children[0].clientHeight + "px"; + this.bannerDetailsAreExpanded = true; + } + } + /** + * Toggle Cookie modal pages + */ + }, { + key: "toggleCookieModalPages", + value: function toggleCookieModalPages() { + this.bannerContent.classList.toggle("d-none"); + this.bannerDetails.classList.toggle("d-none"); + this.bannerDetailsContainer.classList.toggle("d-none"); + this.modalContainer.classList.toggle("d-none"); + this.setTabIndex(); + this.setupCookieModalList(); + this.togglePersonalizeBtn(); + } + /** + * Toggle customize btn + */ + }, { + key: "togglePersonalizeBtn", + value: function togglePersonalizeBtn() { + var customizeBtnBannerDataset = this.customizeBtn.dataset; + this.modalWrapper.scrollTop = 0; + if (this.bannerContent.classList.contains("d-none")) { + this.customizeBtn.innerHTML = customizeBtnBannerDataset.openModal; + } else { + this.customizeBtn.innerHTML = customizeBtnBannerDataset.closeModal; + } + } + }]); + return CookieNotice; +}(); + +var CookieStatus; +(function (CookieStatus) { + CookieStatus["true"] = "true"; + CookieStatus["false"] = "false"; + CookieStatus["wait"] = "wait"; +})(CookieStatus || (CookieStatus = {})); +var CookiePolicySameSite; +(function (CookiePolicySameSite) { + CookiePolicySameSite["lax"] = "lax"; + CookiePolicySameSite["strict"] = "strict"; + CookiePolicySameSite["none"] = "none"; +})(CookiePolicySameSite || (CookiePolicySameSite = {})); + +/***/ }), + +/***/ "./src/scss/themes/standard.scss": +/*!***************************************!*\ + !*** ./src/scss/themes/standard.scss ***! + \***************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +module.exports = __webpack_require__.p + "css/standard.css"; + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(exports, definition) { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ !function() { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ }(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/publicPath */ +/******/ !function() { +/******/ var scriptUrl; +/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; +/******/ var document = __webpack_require__.g.document; +/******/ if (!scriptUrl && document) { +/******/ if (document.currentScript) +/******/ scriptUrl = document.currentScript.src; +/******/ if (!scriptUrl) { +/******/ var scripts = document.getElementsByTagName("script"); +/******/ if(scripts.length) scriptUrl = scripts[scripts.length - 1].src +/******/ } +/******/ } +/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration +/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic. +/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); +/******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); +/******/ __webpack_require__.p = scriptUrl; +/******/ }(); +/******/ +/************************************************************************/ +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ __webpack_require__("./dist/esm/index.js"); +/******/ // This entry module doesn't tell about it's top-level declarations so it can't be inlined +/******/ var __webpack_exports__ = __webpack_require__("./src/scss/themes/standard.scss"); +/******/ +/******/ return __webpack_exports__; +/******/ })() +; +}); +//# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/dist/umd/main.js.map b/dist/umd/main.js.map new file mode 100644 index 0000000..8277a89 --- /dev/null +++ b/dist/umd/main.js.map @@ -0,0 +1 @@ +{"version":3,"file":"main.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICVqBA,YAAY;EAC7B,SAAAA,aAAYC,MAAM,EAAE;IAAA,IAAAC,KAAA;IAAA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oB,EAAE;EAC7BA,oBAAoB,CAAC,KAAK,CAAC,GAAG,KAAK;EACnCA,oBAAoB,CAAC,QAAQ,CAAC,GAAG,QAAQ;EACzCA,oBAAoB,CAAC,MAAM,CAAC,GAAG,MAAM;AACzC,CAAC,EAAEA,oBAAoB,KAAKA,oBAAoB,GAAG,CAAC,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;UCjlBvD;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;;;;;UEfA;UACA;UACA;UACA;UACA","sources":["webpack://CookieNotice/webpack/universalModuleDefinition","webpack://CookieNotice/./dist/esm/index.js","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 ","export default class CookieNotice {\n constructor(config) {\n this.browserCookieName = \"cn-init\";\n this.cookiePolicies = {\n sameSite: CookiePolicySameSite.lax,\n secure: \"\",\n };\n // * Setup Config\n this.config = config;\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 // * Setup Dom Elements\n const cookieContainer = document.querySelector(\"div#cn-wrapper\"), cookieShowModalBtn = document.querySelector(\"button#cn-cookie-btn\"), cookieCloseModalBtn = document.querySelector(\"button#cn-close-modal\"), cookieLinkShowCustomizeModalPageList = document.querySelectorAll(\"a.cn-cookie-link\"), bannerContainer = document.querySelector(\"div#cn-banner\"), bannerContent = document.querySelector(\"div.cn-banner-content\"), bannerDetails = document.querySelector(\"div.cn-banner-details\"), bannerParaP = document.querySelector(\"div.cn-banner-para-p\"), detailsTextOpen = document.querySelector(\"p.cn-banner-para-p-open\"), detailsTextClose = document.querySelector(\"p.cn-banner-para-p-close\"), bannerDetailsCollapseBtn = document.querySelector(\"button.cn-banner-btn-details-p\"), bannerDetailsContainer = document.querySelector(\"div.cn-banner-btn-details\"), modalContainer = document.querySelector(\"div.cn-modal-container\"), acceptAllBtn = document.querySelector(\"button#cn-accept-banner\"), denyAllBtn = document.querySelector(\"button#cn-deny-banner\"), customizeBtn = document.querySelector(\"button#cn-settings-banner\"), cookiesUnorderedList = document.querySelector(\"ul#cn-modal-list\"), modalWrapper = document.querySelector(\"div.cn-modal-wrapper\"), template = document.querySelector(\"div#cn-li-template\");\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 (!bannerDetails) {\n throw new Error(\"Cannot find 'div.cn-banner-details' element\");\n }\n if (!bannerParaP) {\n throw new Error(\"Cannot find 'div.cn-banner-para-p' element\");\n }\n if (!detailsTextOpen) {\n throw new Error(\"Cannot find 'p.cn-banner-para-p-open' element\");\n }\n if (!detailsTextClose) {\n throw new Error(\"Cannot find 'p.cn-banner-para-p-close' element\");\n }\n if (!bannerDetailsCollapseBtn) {\n throw new Error(\"Cannot find 'button.cn-banner-btn-details-p' element\");\n }\n if (!bannerDetailsContainer) {\n throw new Error(\"Cannot find '.cn-banner-btn-details' 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 this.cookieShowModalBtn = cookieShowModalBtn;\n this.cookieCloseModalBtn = cookieCloseModalBtn;\n this.cookieLinkShowCustomizeModalList =\n cookieLinkShowCustomizeModalPageList;\n this.cookieContainer = cookieContainer;\n this.bannerDetailsContainer = bannerDetailsContainer;\n this.bannerContainer = bannerContainer;\n this.bannerContent = bannerContent;\n this.cookiesUnorderedList = cookiesUnorderedList;\n this.modalWrapper = modalWrapper;\n this.bannerParaP = bannerParaP;\n this.detailsTextOpen = detailsTextOpen;\n this.detailsTextClose = detailsTextClose;\n this.bannerDetails = bannerDetails;\n this.bannerDetailsCollapseBtn = bannerDetailsCollapseBtn;\n this.modalContainer = modalContainer;\n this.acceptAllBtn = acceptAllBtn;\n this.denyAllBtn = denyAllBtn;\n this.customizeBtn = customizeBtn;\n this.bannerDetailsAreExpanded = false;\n this.template = template;\n const memoryTemplate = this.template.cloneNode(true);\n this.template.remove();\n this.template = memoryTemplate;\n // * Setup Events\n this.addEventPrevent(this.modalBg, \"click\", this.closeCookieModal);\n this.addEventPrevent(this.cookieCloseModalBtn, \"click\", this.closeCookieModal);\n this.addEventPrevent(this.acceptAllBtn, \"click\", this.acceptAllCookies);\n this.addEventPrevent(this.denyAllBtn, \"click\", this.denyAllCookies);\n this.addEventPrevent(this.customizeBtn, \"click\", this.toggleCookieModalPages);\n this.addEventPrevent(this.bannerDetailsCollapseBtn, \"click\", this.toggleBannerDetails);\n this.addEventPrevent(this.cookieShowModalBtn, \"click\", this.toggleCookieModal);\n this.cookieLinkShowCustomizeModalList.forEach((cookieLink) => {\n this.addEventPrevent(cookieLink, \"click\", this.openCookieModalToCookiePage);\n });\n // * Setup CN Cookie\n if (!this.cookiesMatchesConfig()) {\n // * Setup Browser Cookie if none.\n this.resetBrowserCookie();\n this.openCookieModalToBannerPage();\n }\n // * Cookie should have been created from here.\n const cookies = this.getCookieStatusList();\n Object.entries(cookies).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 // COOKIES\n /**\n * Check if the actual cookie matches the config\n */\n cookiesMatchesConfig() {\n const cookies = this.getCookieStatusList();\n return Object.keys(cookies).length === Object.keys(this.config).length;\n }\n /**\n * Accept a specific cookie\n */\n acceptAllCookies() {\n Object.entries(this.config).forEach(([cookieName, cookieOption]) => this.setCookieStatus(cookieName, CookieStatus.true, cookieOption));\n for (const acceptLabel of this.cookieContainer.querySelectorAll(\".accept > label\")) {\n acceptLabel.classList.add(\"active\");\n }\n for (const denyLabel of this.cookieContainer.querySelectorAll(\".deny > label\")) {\n denyLabel.classList.remove(\"active\");\n }\n this.closeCookieModal();\n }\n /**\n * Deny a specific cookie\n */\n denyAllCookies() {\n Object.entries(this.config).forEach(([cookieName, cookieOption]) => this.setCookieStatus(cookieName, CookieStatus.false, cookieOption));\n for (const acceptLabel of this.cookieContainer.querySelectorAll(\".accept > label\")) {\n acceptLabel.classList.remove(\"active\");\n }\n for (const denyLabel of this.cookieContainer.querySelectorAll(\".deny > label\")) {\n denyLabel.classList.add(\"active\");\n }\n this.closeCookieModal();\n }\n /**\n * Fetch the cookie status list\n *\n * @returns the cookie status list\n */\n getCookieStatusList() {\n const cookies = this.getBrowserCookieValue(), statusList = {};\n if (cookies === undefined) {\n return statusList;\n }\n /** specificCookieString contains youtube=true like */\n cookies.split(\",\").forEach((specificCookieString) => {\n const values = specificCookieString.split(\"=\");\n statusList[values[0]] = values[1];\n });\n return statusList;\n }\n /**\n * Check has cookie status\n *\n * @param key\n * @param value\n */\n containsCookieStatus(key) {\n const statusList = this.getCookieStatusList();\n return (Object.keys(statusList).find((cookieName) => cookieName === key) !==\n undefined);\n }\n /**\n * Set the cookie value\n *\n * @param cookieName\n * @param status\n * @param cookieOption\n */\n setCookieStatus(cookieName, status, cookieOption) {\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 * Add a specific cookie and\n * change his status to true\n *\n * @param cookieName\n * @param cookieOption\n */\n addCookieStatus(cookieName, cookieOption) {\n if (cookieOption.script) {\n cookieOption.script();\n }\n this.setBrowserCookieStatus(cookieName, CookieStatus.true);\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, cookieOption) {\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 * Change the status of a cookie\n *\n * @param cookieName\n * @param status\n */\n setBrowserCookieStatus(cookieName, status) {\n const statusList = this.getCookieStatusList();\n // * Force refresh\n this.deleteBrowserCookie();\n statusList[cookieName] = status;\n this.saveBrowserCookie(statusList);\n }\n /**\n * Has CN cokie setup ?\n * @returns true if the cookie is setup\n */\n hasBrowserCookie() {\n return Boolean(this.getBrowserCookieValue());\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(new RegExp(\"(?:^|; )\" +\n this.browserCookieName.replace(/([.$?*|{}()[\\]\\\\/+^])/g, \"\\\\$1\") +\n \"=([^;]*)\"));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n }\n /**\n * Save cookie content on web browser\n *\n * @param list\n */\n saveBrowserCookie(statusList) {\n const date = new Date(), newDate = new Date(date.setMonth(date.getMonth() + 13)), content = Object.entries(statusList)\n .map(([cookieName, cookieStatus]) => {\n return `${cookieName}=${cookieStatus}`;\n })\n .join(\",\");\n document.cookie = `${this.browserCookieName}=${content};path=/${location.hostname ? `;domain=${location.hostname}` : \"\"};expires=${newDate.toUTCString()};${this.getCookiePoliciesAsString()}`;\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=/${location.hostname ? `;domain=.${location.hostname}` : \"\"};expires=Thu, 01 Jan 1970 00:00:01 GMT;${this.getCookiePoliciesAsString()}`;\n document.cookie = `${this.browserCookieName}=;path=/${location.hostname ? `;domain=${location.hostname}` : \"\"};expires=Thu, 01 Jan 1970 00:00:01 GMT;${this.getCookiePoliciesAsString()}`;\n }\n }\n getCookiePoliciesAsString() {\n return Object.entries(this.cookiePolicies)\n .map(([policyName, policyValue]) => `${policyName}=${policyValue}`)\n .join(\";\");\n }\n /**\n * Reset Ldc Web CN cookie\n */\n resetBrowserCookie() {\n // * Create Cookie as It does not exists.\n const newCookieList = {};\n Object.entries(this.config).forEach(([cookieName]) => (newCookieList[cookieName] = CookieStatus.wait));\n this.saveBrowserCookie(newCookieList);\n }\n // LISTENERS\n /**\n * Add event on a specific element\n *\n * @param element\n * @param evnt\n * @param funct\n * @returns\n */\n addEvent(element, evnt, funct) {\n return element.addEventListener(evnt, funct.bind(this), false);\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(element, evnt, funct) {\n return element.addEventListener(evnt, (e) => {\n e.preventDefault();\n funct.call(this, e);\n }, false);\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, funct) {\n return this.addEvent(element, \"keyup\", (e) => {\n const kbdEvt = e;\n if (kbdEvt.key == \" \" ||\n kbdEvt.code == \"Space\" ||\n kbdEvt.keyCode == 32 ||\n kbdEvt.key == \"Enter\" ||\n kbdEvt.code == \"Enter\" ||\n kbdEvt.keyCode == 13) {\n funct.call(this, kbdEvt);\n }\n });\n }\n // COOKIE MODAL\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 * Open the cookies modal to the banner page\n */\n openCookieModalToBannerPage() {\n this.openCookieModalToCookiePage();\n this.toggleCookieModalPages();\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.bannerDetails.classList.add(\"d-none\");\n this.bannerDetailsContainer.classList.add(\"d-none\");\n this.modalContainer.classList.remove(\"d-none\");\n // Scroll to the top of the cookies list\n this.modalWrapper.scrollTop = 0;\n this.setupCookieModalList();\n this.setTabIndex();\n }\n /**\n * Hide the cookies modal\n */\n closeCookieModal() {\n document.body.classList.remove(\"cn-open\");\n this.bannerContent.classList.toggle(\"d-none\");\n this.bannerDetails.classList.toggle(\"d-none\");\n this.bannerDetailsContainer.classList.toggle(\"d-none\");\n this.modalContainer.classList.toggle(\"d-none\");\n this.unsetTabIndex();\n this.setupCookieModalList();\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 = \"a[href], button, [role=\\\"button\\\"], input, embed, object, iframe, textarea, select, details, [tabindex]:not([tabindex=\\\"-1\\\"])\";\n // * Only focusable elements\n [...document.body.querySelectorAll(focusableSelector)]\n .filter((el) => !el.hasAttribute(\"disabled\") &&\n !el.getAttribute(\"aria-hidden\"))\n .forEach((el) => {\n el.setAttribute(\"tabindex\", \"-1\");\n el.classList.add(\"cn-disabled\");\n });\n [...this.cookieContainer.querySelectorAll(focusableSelector)]\n .filter((el) => !el.hasAttribute(\"disabled\") &&\n !el.getAttribute(\"aria-hidden\") &&\n // * Only visible elements\n !!(el.offsetWidth ||\n el.offsetHeight ||\n el.getClientRects().length))\n .forEach((el) => {\n el.setAttribute(\"tabindex\", \"0\");\n el.classList.remove(\"cn-disabled\");\n });\n this.cookieShowModalBtn.setAttribute(\"tabindex\", \"-1\");\n }, 500);\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.setAttribute(\"tabindex\", \"0\");\n el.classList.remove(\"cn-disabled\");\n });\n this.cookieShowModalBtn.setAttribute(\"tabindex\", \"0\");\n }, 500);\n }\n /**\n * Reset the modal view state\n */\n resetCookieModal() {\n this.bannerContent.classList.remove(\"d-none\");\n this.bannerDetails.classList.remove(\"d-none\");\n this.bannerDetailsContainer.classList.remove(\"d-none\");\n this.modalContainer.classList.add(\"d-none\");\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 * 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(0);\n if (childItem === null) {\n throw new Error(\"Cannot find child item\");\n }\n cookie.append(childItem.cloneNode(true));\n const name = cookie.querySelector(\"span.cn-cookie-name\");\n const description = cookie.querySelector(\"span.cn-cookie-description\");\n const link = cookie.querySelector(\".cn-cookie-link\");\n const acceptInput = cookie.querySelector(\".accept > input\");\n const denyInput = cookie.querySelector(\".deny > input\");\n const acceptLabel = cookie.querySelector(\".accept > label\");\n const denyLabel = cookie.querySelector(\".deny > label\");\n name.textContent = cookieConfig.name;\n description.textContent = cookieConfig.description;\n link.textContent = cookieConfig.labelLink;\n link.setAttribute(\"href\", cookieConfig.link);\n acceptInput.id = cookieName + \"1\";\n acceptInput.name = cookieName;\n acceptInput.dataset.name = cookieName;\n acceptLabel.htmlFor = cookieName + \"1\";\n denyInput.id = cookieName + \"2\";\n denyInput.name = cookieName;\n denyInput.dataset.name = cookieName;\n denyLabel.htmlFor = cookieName + \"2\";\n const acceptFn = () => {\n acceptLabel.classList.add(\"active\");\n denyLabel.classList.remove(\"active\");\n this.setCookieStatus(cookieName, CookieStatus.true, cookieConfig);\n }, denyFn = () => {\n acceptLabel.classList.remove(\"active\");\n denyLabel.classList.add(\"active\");\n this.setCookieStatus(cookieName, CookieStatus.false, cookieConfig);\n };\n this.addEvent(acceptInput, \"click\", acceptFn);\n this.addEventKbdValidate(acceptLabel, acceptFn);\n this.addEvent(denyInput, \"click\", denyFn);\n this.addEventKbdValidate(denyLabel, denyFn);\n this.cookiesUnorderedList.append(cookie);\n if (!this.hasBrowserCookie()) {\n // * Ldcweb cookie is not set.\n return;\n }\n // * Setup list status state\n Object.entries(this.getCookieStatusList()).forEach(([ckName, cookieStatus]) => {\n if (ckName === cookieName) {\n acceptLabel.classList.remove(\"active\");\n denyLabel.classList.remove(\"active\");\n switch (cookieStatus) {\n case CookieStatus.true:\n acceptLabel.classList.add(\"active\");\n break;\n case CookieStatus.false:\n denyLabel.classList.add(\"active\");\n break;\n }\n }\n });\n });\n }\n /**\n * Toggle show hide banner details\n */\n toggleBannerDetails() {\n this.bannerDetails.classList.toggle(\"cn-details-open\");\n if (!this.bannerDetailsCollapseBtn.dataset.open ||\n !this.bannerDetailsCollapseBtn.dataset.close) {\n throw new Error(\"Cannot find attribute data-open or data-close\");\n }\n if (this.bannerDetailsAreExpanded) {\n this.bannerDetailsCollapseBtn.innerHTML =\n this.bannerDetailsCollapseBtn.dataset.close;\n this.detailsTextOpen.classList.add(\"d-none\");\n this.detailsTextClose.classList.remove(\"d-none\");\n this.bannerDetails.style.height = \"0px\";\n this.bannerDetailsAreExpanded = false;\n }\n else {\n this.bannerDetailsCollapseBtn.innerHTML =\n this.bannerDetailsCollapseBtn.dataset.open;\n this.detailsTextOpen.classList.remove(\"d-none\");\n this.detailsTextClose.classList.add(\"d-none\");\n this.bannerDetails.style.height =\n this.bannerDetails.children[0].clientHeight + \"px\";\n this.bannerDetailsAreExpanded = true;\n }\n }\n /**\n * Toggle Cookie modal pages\n */\n toggleCookieModalPages() {\n this.bannerContent.classList.toggle(\"d-none\");\n this.bannerDetails.classList.toggle(\"d-none\");\n this.bannerDetailsContainer.classList.toggle(\"d-none\");\n this.modalContainer.classList.toggle(\"d-none\");\n this.setTabIndex();\n this.setupCookieModalList();\n this.togglePersonalizeBtn();\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;\n }\n else {\n this.customizeBtn.innerHTML =\n customizeBtnBannerDataset.closeModal;\n }\n }\n}\nvar CookieStatus;\n(function (CookieStatus) {\n CookieStatus[\"true\"] = \"true\";\n CookieStatus[\"false\"] = \"false\";\n CookieStatus[\"wait\"] = \"wait\";\n})(CookieStatus || (CookieStatus = {}));\nvar CookiePolicySameSite;\n(function (CookiePolicySameSite) {\n CookiePolicySameSite[\"lax\"] = \"lax\";\n CookiePolicySameSite[\"strict\"] = \"strict\";\n CookiePolicySameSite[\"none\"] = \"none\";\n})(CookiePolicySameSite || (CookiePolicySameSite = {}));\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) scriptUrl = scripts[scripts.length - 1].src\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__(\"./dist/esm/index.js\");\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","browserCookieName","cookiePolicies","sameSite","CookiePolicySameSite","lax","secure","modalBg","document","createElement","classList","add","body","append","cookieContainer","querySelector","cookieShowModalBtn","cookieCloseModalBtn","cookieLinkShowCustomizeModalPageList","querySelectorAll","bannerContainer","bannerContent","bannerDetails","bannerParaP","detailsTextOpen","detailsTextClose","bannerDetailsCollapseBtn","bannerDetailsContainer","modalContainer","acceptAllBtn","denyAllBtn","customizeBtn","cookiesUnorderedList","modalWrapper","template","Error","cookieLinkShowCustomizeModalList","bannerDetailsAreExpanded","memoryTemplate","cloneNode","remove","addEventPrevent","closeCookieModal","acceptAllCookies","denyAllCookies","toggleCookieModalPages","toggleBannerDetails","toggleCookieModal","forEach","cookieLink","openCookieModalToCookiePage","cookiesMatchesConfig","resetBrowserCookie","openCookieModalToBannerPage","cookies","getCookieStatusList","Object","entries","_ref","_ref2","_slicedToArray","cookieName","cookieStatus","CookieStatus","wait","true","script","fallback","_createClass","key","value","keys","length","_this2","_ref3","_ref4","cookieOption","setCookieStatus","_iterator","_createForOfIteratorHelper","_step","s","n","done","acceptLabel","err","e","f","_iterator2","_step2","denyLabel","_this3","_ref5","_ref6","false","_iterator3","_step3","_iterator4","_step4","getBrowserCookieValue","statusList","undefined","split","specificCookieString","values","containsCookieStatus","find","status","addCookieStatus","removeCookieStatus","setBrowserCookieStatus","cookieNameElement","getElementById","deleteBrowserCookie","saveBrowserCookie","hasBrowserCookie","Boolean","matches","cookie","match","RegExp","replace","decodeURIComponent","date","Date","newDate","setMonth","getMonth","content","map","_ref7","_ref8","concat","join","location","hostname","toUTCString","getCookiePoliciesAsString","_ref9","_ref10","policyName","policyValue","newCookieList","_ref11","_ref12","addEvent","element","evnt","funct","addEventListener","bind","_this4","preventDefault","call","addEventKbdValidate","_this5","kbdEvt","code","keyCode","contains","resetCookieModal","scrollTop","setupCookieModalList","setTabIndex","toggle","unsetTabIndex","_this6","documentElement","setAttribute","setTimeout","focusableSelector","_toConsumableArray","filter","el","hasAttribute","getAttribute","offsetWidth","offsetHeight","getClientRects","_this7","dataset","openModal","innerHTML","_this8","_ref13","_ref14","cookieConfig","childItem","children","item","name","description","link","acceptInput","denyInput","textContent","labelLink","id","htmlFor","acceptFn","denyFn","_ref15","_ref16","ckName","open","close","style","height","clientHeight","togglePersonalizeBtn","customizeBtnBannerDataset","closeModal","default"],"sourceRoot":""} \ No newline at end of file diff --git a/examples/ldcweb-cookies.blade.php b/examples/cn-cookies.blade.php similarity index 81% rename from examples/ldcweb-cookies.blade.php rename to examples/cn-cookies.blade.php index 9e84680..ee3a39c 100644 --- a/examples/ldcweb-cookies.blade.php +++ b/examples/cn-cookies.blade.php @@ -14,10 +14,10 @@ $strings = (object)[ 'button_customize' => Str::upper(__('Personnaliser')), 'button_back' => Str::upper(__('Retour')), 'banner_title' => __('Le site internet :site_name utilise des cookies !', ['site_name' => $site_name]), - 'banner_text_open' => __('Ce site web stocke les cookies sur votre ordinateur. :site_name utilise ces informations + 'banner_text_open' => __("Ce site web stocke les cookies sur votre ordinateur. :site_name utilise ces informations afin d’améliorer et de personnaliser votre expérience de navigation, ainsi que pour l’analyse et les indicateurs concernant nos - visiteurs à la fois sur ce site web et sur d’autres supports. Vous pouvez cliquer sur « Accepter » si vous consentez à l’utilisation - de ces cookies.', ['site_name' => $site_name]), + visiteurs à la fois sur ce site web et sur d’autres supports.\n Vous pouvez cliquer sur « Accepter » si vous consentez à l’utilisation + de ces cookies.", ['site_name' => $site_name]), 'banner_text' => __('Nous utilisons des cookies pour nous assurer du bon fonctionnement de notre site et à des fins analytiques. En poursuivant votre navigation sur ce site ou en fermant ce bandeau, vous consentez à l’utilisationde ces cookies.'), 'banner_details' => __('Si vous refusez l’utilisation des cookies, vos informations ne seront pas suivies lors de votre visite sur ce site. @@ -50,7 +50,7 @@ $cookies['youtube'] = [ $cookies['youtube']['script'] = << -@endpush - - -@push('scripts') - @endpush diff --git a/examples/templates/standard.blade.php b/examples/templates/standard.blade.php index a6a988f..c691fa4 100644 --- a/examples/templates/standard.blade.php +++ b/examples/templates/standard.blade.php @@ -1,4 +1,4 @@ -
+