{"version":3,"file":"static/js/581.ebd7ed3c.chunk.js","mappings":"0IAGA,MAAMA,GAA2BC,E,OAAAA,KAOjC,EALcC,KACbF,IACO,K,8CCDR,MAAMG,EAA8B,GAEvBF,EAAiC,WAExC,IACDG,EAFJC,IAAsBC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,KAAAA,UAAA,GAGtB,MAAO,MACNG,EAAAA,EAAAA,YAAU,KAGT,KAAIC,SAASC,YAAYJ,OAAS,GAiBlC,OAduB,MAAnBH,IACHA,EAAkBM,SAASC,YAAYD,SAASC,YAAYJ,OAAS,GACrEJ,EAA4BS,KAAKR,IAI7BC,GACJF,EAA4BU,SAAQC,GAAcA,EAAWC,UAAW,IAIzEX,EAAgBW,UAAW,EAGvBV,EAA+B,KACX,MAAnBD,IAAyBA,EAAgBW,UAAW,EAAI,OAD7D,CAEC,GAEA,CAEJ,C","sources":["components/themes/light.jsx","components/themes/useDisableImportedStyles.jsx"],"sourcesContent":["import '../../css/themes/light.css';\nimport {createUseDisableImportedStyles} from \"./useDisableImportedStyles\";\n\nconst useDisableImportedStyles = createUseDisableImportedStyles()\n\nconst Theme = () => {\n\tuseDisableImportedStyles();\n\treturn null;\n}\n\nexport default Theme;","import { useEffect } from 'react'\n\n// https://gist.github.com/arniebradfo/dc1dcb0793108cfc4cfca8faf0cb15d3\n// https://stackoverflow.com/questions/48047362/how-to-remove-imported-css-in-reactjs\n// Black magic.\n\nconst switchableGlobalStyleSheets = []\n\nexport const createUseDisableImportedStyles = (\n\timmediatelyUnloadStyle = true\n) => {\n\tlet localStyleSheet\n\treturn () => {\n\t\tuseEffect(() => {\n\n\t\t\t// if there are no stylesheets, you did something wrong...\n\t\t\tif (document.styleSheets.length < 1) return\n\n\t\t\t// set the localStyleSheet if this is the first time this instance of this useEffect is called\n\t\t\tif (localStyleSheet == null) {\n\t\t\t\tlocalStyleSheet = document.styleSheets[document.styleSheets.length - 1]\n\t\t\t\tswitchableGlobalStyleSheets.push(localStyleSheet)\n\t\t\t}\n\n\t\t\t// if we are switching StyleSheets, disable all switchableGlobalStyleSheets\n\t\t\tif (!immediatelyUnloadStyle) {\n\t\t\t\tswitchableGlobalStyleSheets.forEach(styleSheet => styleSheet.disabled = true)\n\t\t\t}\n\n\t\t\t// enable our StyleSheet!\n\t\t\tlocalStyleSheet.disabled = false\n\n\t\t\t// if we are NOT switching StyleSheets, disable this StyleSheet when the component is unmounted\n\t\t\tif (immediatelyUnloadStyle) return () => {\n\t\t\t\tif (localStyleSheet != null) localStyleSheet.disabled = true\n\t\t\t}\n\n\t\t})\n\t}\n}"],"names":["useDisableImportedStyles","createUseDisableImportedStyles","Theme","switchableGlobalStyleSheets","localStyleSheet","immediatelyUnloadStyle","arguments","length","undefined","useEffect","document","styleSheets","push","forEach","styleSheet","disabled"],"sourceRoot":""}