-
Notifications
You must be signed in to change notification settings - Fork 0
/
head.inject.8b1bdd48.js.map
1 lines (1 loc) · 3.78 KB
/
head.inject.8b1bdd48.js.map
1
{"version":3,"sources":["utils/logger.ts","utils/nightModeStorage.ts","head.inject.ts"],"names":[],"mappings":";AAYC,aAAA,IAAA,EAAA,MAAA,KAAA,gBAAA,WAAA,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAAA,OAAA,EAAA,EAAA,IAAA,GAAA,UAAA,GAAA,OAAA,IAAA,EAAA,MAAA,GAAA,EAAA,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,IAAA,IAAA,IAAA,EAAA,UAAA,GAAA,EAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,IAAA,IAAA,EAAA,GAAA,EAAA,GAAA,OAAA,GAAA,OAAA,eAAA,QAAA,aAAA,CAAA,OAAA,IAAA,QAAA,YAAA,EAZD,IAAI,EAAQ,WAAC,IAAA,IAAA,EAAA,GAAA,EAAA,EAAA,EAAA,UAAA,OAAA,IAAA,EAAA,GAAA,UAAA,GAAmB,OAAA,WAAC,IAAA,IAAA,EAAA,GAAA,EAAA,EAAA,EAAA,UAAA,OAAA,IAAA,EAAA,GAAA,UAAA,KAMpB,QAAA,OAAS,SAAC,GACrB,IAAM,EAAM,EAAM,GAClB,OAAO,SAAC,GAAe,IAAA,IAAA,EAAA,GAAA,EAAA,EAAA,EAAA,UAAA,OAAA,IAAA,EAAA,EAAA,GAAA,UAAA,GACrB,IAAM,EAAY,KAAK,MAAM,KAAK,UAAU,EAAK,OAAO,SAAA,GAAO,YAAQ,IAAR,MAC/D,EAAG,WAAA,EAAA,EAAA,CAAC,KAAK,EAAS,qBAAwB;;ACM7C,aAAA,OAAA,eAAA,QAAA,aAAA,CAAA,OAAA,IAAA,QAAA,UAAA,QAAA,eAAA,QAAA,SAAA,EAhBD,IAAA,EAAA,QAAA,YAEa,QAAA,IAAM,EAAA,OAAO,iBAC1B,IAAM,EAAc,aAEP,QA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: any[]) => {};\n\nif (process.env.NODE_ENV !== \"production\") {\n debug = require(\"debug\");\n}\n\nexport const logger = (name1: string) => {\n const log = debug(name1);\n return (name2: string, ...args: any[]) => {\n const argsClone = JSON.parse(JSON.stringify(args.filter(arg => arg !== undefined)));\n log(`%c${name2}`, \"font-weight: bold\", ...argsClone);\n };\n};\n","import { logger } from \"./logger\";\n\nexport const log = logger(\"🌗 night mode\");\nconst STORAGE_KEY = \"night-mode\";\n\nexport const getActiveTheme = () => {\n const isDarkMode = JSON.parse(localStorage.getItem(STORAGE_KEY));\n const mediaQueryValue = matchMedia(\"(prefers-color-scheme: dark)\").matches;\n const returnValue = typeof isDarkMode === \"boolean\" ? isDarkMode : mediaQueryValue;\n log(\"getActiveTheme\", { isDarkMode, returnValue, mediaQueryValue });\n return returnValue;\n};\n\nexport const saveTheme = (value: boolean) => {\n log(\"saveTheme\", { KEY: STORAGE_KEY, value });\n localStorage.setItem(STORAGE_KEY, JSON.stringify(value));\n};\n","// should be imported to the body separetely\n// for quicker night-mode application\n\nimport { getActiveTheme, saveTheme } from \"./utils/nightModeStorage\";\n\nwindow.onerror = error => console.trace(\"onerror\", error);\nwindow.onunhandledrejection = event => console.error(\"onunhandledrejection\", event.reason, event);\nwindow.alert = (...args) => console.warn(\"alert\", ...args);\n\nwindow.addEventListener(\"DOMContentLoaded\", () => {\n let isNightMode = getActiveTheme();\n let html = document.documentElement;\n html.classList.add(isNightMode ? \"night-mode-on\" : \"night-mode-off\");\n html.classList.remove(isNightMode ? \"night-mode-off\" : \"night-mode-on\");\n saveTheme(isNightMode);\n});\n"]}