{"version":3,"file":"accept_cookies.js","mappings":"YAGA,MAAMA,EAAc,gBAOpB,SAASC,EAAWC,GAClB,MAAMC,EAAMC,SAASC,eAAe,eAChCF,GAAKA,EAAIG,UAAUC,OAAO,UAAWL,EAC3C,CANSE,SAASI,OAAOC,MAAM,MAAMC,MAAMC,GAAUA,EAAMC,WAAW,GAAGZ,SActDC,GAAW,GAE9B,MAAMY,EAAeT,SAASC,eAAe,kBACzCQ,GAAcA,EAAaC,iBAAiB,SAThD,SAAuBC,GACrBA,EAAMC,iBACNZ,SAASI,OAAS,GAAGR,iDACrBC,GAAW,EACb,G","sources":["webpack://trace_taiwan/./app/javascript/packs/accept_cookies.js"],"sourcesContent":["// Cookie-consent banner. Pages are edge-cached, so the banner markup is always\n// present and hidden by default; visibility is decided client-side from the cookie\n// so a visitor who has accepted never sees it again (on any path).\nconst COOKIE_NAME = \"allow_cookies\";\nconst ONE_YEAR_SECONDS = 60 * 60 * 24 * 365;\n\nfunction hasConsent() {\n return document.cookie.split(\"; \").some((entry) => entry.startsWith(`${COOKIE_NAME}=`));\n}\n\nfunction setVisible(visible) {\n const bar = document.getElementById(\"cookies-bar\");\n if (bar) bar.classList.toggle(\"hidden\", !visible);\n}\n\nfunction acceptCookies(event) {\n event.preventDefault();\n document.cookie = `${COOKIE_NAME}=true; path=/; max-age=${ONE_YEAR_SECONDS}; SameSite=Lax`;\n setVisible(false);\n}\n\nif (!hasConsent()) setVisible(true);\n\nconst acceptButton = document.getElementById(\"accept-cookies\");\nif (acceptButton) acceptButton.addEventListener(\"click\", acceptCookies);\n"],"names":["COOKIE_NAME","setVisible","visible","bar","document","getElementById","classList","toggle","cookie","split","some","entry","startsWith","acceptButton","addEventListener","event","preventDefault"],"ignoreList":[],"sourceRoot":""}