{"version":3,"file":"theme_head.5f24ba8d7aa944e6f52b.js","mappings":"CAGA,WACE,MAAMA,EAAe,QACfC,EAASC,SAASC,gBACxB,IAAIC,EAAQJ,EAEZ,MAAMK,EAAcC,OAAOC,aAAaC,QAAQ,UAChD,GAAmB,MAAfH,EAAqB,CACvB,MAAMI,EAAkBC,KAAKC,MAAMN,GACZ,MAAnBI,GAAoD,MAAzBA,EAAgBL,QACzCK,EAAgBL,MAAMQ,QAAQ,WAAa,EAC7CR,EAAQE,OAAOO,WAAW,gCAAgCC,QAAU,OAAS,QACpEL,EAAgBL,MAAMQ,QAAQ,SAAW,IAClDR,EAAQ,SAGPH,EAAOc,UAAUC,SAAS,SAAWZ,KACxCH,EAAOc,UAAUE,OAAO,eACxBhB,EAAOc,UAAUG,IAAI,SAAWd,GAEnC,CAnBH","sources":["webpack://@bitwarden/web-vault/./src/theme.js"],"sourcesContent":["// Set theme on page load\n// This is done outside the Angular app to avoid a flash of unthemed content before it loads\n// The defaultTheme is also set in the html itself to make sure that some theming is always applied\n(function () {\n const defaultTheme = \"light\";\n const htmlEl = document.documentElement;\n let theme = defaultTheme;\n\n const globalState = window.localStorage.getItem(\"global\");\n if (globalState != null) {\n const globalStateJson = JSON.parse(globalState);\n if (globalStateJson != null && globalStateJson.theme != null) {\n if (globalStateJson.theme.indexOf(\"system\") > -1) {\n theme = window.matchMedia(\"(prefers-color-scheme: dark)\").matches ? \"dark\" : \"light\";\n } else if (globalStateJson.theme.indexOf(\"dark\") > -1) {\n theme = \"dark\";\n }\n }\n if (!htmlEl.classList.contains(\"theme_\" + theme)) {\n htmlEl.classList.remove(\"theme_\" + defaultTheme);\n htmlEl.classList.add(\"theme_\" + theme);\n }\n }\n})();\n"],"names":["defaultTheme","htmlEl","document","documentElement","theme","globalState","window","localStorage","getItem","globalStateJson","JSON","parse","indexOf","matchMedia","matches","classList","contains","remove","add"],"sourceRoot":""}