import { sleep } from "../core/sleep.js"; import { XNode } from "../core/XNode.js"; export default class CookieConsent { static async show() { await sleep(2000); if (!(await this.needed())) { return; } let popupShown = false; // show cookie popup... try { popupShown = /yes|true/i.test(localStorage.getItem("cookie-consent")); } catch (error) { } if (popupShown) { return; } return new Promise((resolve, reject) => { const popup = document.createElement("popup-window"); popup.setAttribute("hide-close", "1"); popup.setAttribute("title", "Cookies"); popup.className = "cookie-consent"; XNode.render(popup,
This website uses cookies or similar technologies, to enhance your browsing experience and provide personalized recommendations.
); document.body.appendChild(popup); }); } private static async needed() { // we will add this in future... return false; // try { // // const r = await fetch("/social-mail/public/geo/country"); // // const { country } = await r.json(); // // return /FR|/i.test(country); // } catch (error) { // return true; // } } }