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J,OAtBlB,CAwBJ,EAGAT,OAAOC,WAAW,gCAAgCoC,iBAAiB,UAAU,WACzE,IAAMtC,EAAcN,IACA,UAAhBM,GAA2C,SAAhBA,GAC3BI,EAASL,IAEjB,IAEAE,OAAOqC,iBAAiB,oBAAoB,WAExC9B,EAAgBT,KAEhBH,SAAS0B,iBAAiB,yBACrBC,SAAQ,SAAAgB,GACLA,EAAOD,iBAAiB,SAAS,WAC7B,IAAMjC,EAAQkC,EAAOC,aAAa,wBAtE3B,SAACnC,GACpBT,SAASC,OAAS,SAAHsB,OAAYd,EAAK,kDACpC,CAqEgBoC,CAAepC,GACfD,EAASC,GACTG,EAAgBH,GAAO,EAC3B,GACJ,GAGR,GACH,CA1FD","sources":["webpack:///./resources/js/color_mode.js"],"sourcesContent":["/*!\n * Color mode toggler for Bootstrap's docs (https://getbootstrap.com/)\n * Copyright 2011-2023 The Bootstrap Authors\n * Licensed under the Creative Commons Attribution 3.0 Unported License.\n */\n\n// console.log('Color mode js' );\n(() => {\n 'use strict'\n\n const getStoredTheme = () => {\n const cookieValue = document.cookie.match(/theme=([^;]+)/);\n if (cookieValue) {\n return cookieValue[1];\n }\n return null;\n };\n\n const setStoredTheme = (theme) => {\n document.cookie = `theme=${theme}; expires=Thu, 18 Dec 2029 12:00:00 UTC; path=/`;\n };\n\n const getPreferredTheme = () => {\n const storedTheme = getStoredTheme()\n if (storedTheme) {\n return storedTheme\n }\n\n return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'\n }\n\n const setTheme = theme => {\n if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) {\n document.documentElement.setAttribute('data-bs-theme', 'dark')\n } else {\n document.documentElement.setAttribute('data-bs-theme', theme)\n }\n }\n\n setTheme(getPreferredTheme())\n\n const showActiveTheme = (theme, focus = false) => {\n const themeSwitcher = document.querySelector('#bd-theme');\n\n if (!themeSwitcher) {\n // console.log('no theme Switcher');\n return;\n }\n\n const themeSwitcherText = document.querySelector('#bd-theme-text');\n const activeThemeIcon = document.querySelector('.theme-icon-active');\n const btnToActive = document.querySelector(`[data-bs-theme-value=\"${theme}\"]`);\n const bsIconOfActiveBtn = btnToActive.querySelector('i').classList[1];\n\n document.querySelectorAll('[data-bs-theme-value]').forEach(element => {\n element.classList.remove('active');\n element.setAttribute('aria-pressed', 'false');\n });\n\n btnToActive.classList.add('active');\n btnToActive.setAttribute('aria-pressed', 'true');\n activeThemeIcon.classList.remove('bi', 'fa');\n activeThemeIcon.classList.remove(...Array.from(activeThemeIcon.classList).filter(className => className.startsWith('bi-')));\n\n activeThemeIcon.classList.add('bi', bsIconOfActiveBtn);\n const themeSwitcherLabel = `${themeSwitcherText.textContent} (${btnToActive.dataset.bsThemeValue})`;\n themeSwitcher.setAttribute('aria-label', themeSwitcherLabel);\n\n if (focus) {\n themeSwitcher.focus();\n }\n };\n\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {\n const storedTheme = getStoredTheme()\n if (storedTheme !== 'light' && storedTheme !== 'dark') {\n setTheme(getPreferredTheme())\n }\n })\n\n window.addEventListener('DOMContentLoaded', () => {\n\n showActiveTheme(getPreferredTheme())\n\n document.querySelectorAll('[data-bs-theme-value]')\n .forEach(toggle => {\n toggle.addEventListener('click', () => {\n const theme = toggle.getAttribute('data-bs-theme-value')\n setStoredTheme(theme)\n setTheme(theme)\n showActiveTheme(theme, true)\n })\n })\n\n // console.log('Showed theme ',getPreferredTheme() );\n })\n})()\n"],"names":["getStoredTheme","cookieValue","document","cookie","match","getPreferredTheme","storedTheme","window","matchMedia","matches","setTheme","theme","documentElement","setAttribute","showActiveTheme","_activeThemeIcon$clas","focus","arguments","length","undefined","themeSwitcher","querySelector","themeSwitcherText","activeThemeIcon","btnToActive","concat","bsIconOfActiveBtn","classList","querySelectorAll","forEach","element","remove","add","apply","_toConsumableArray","Array","from","filter","className","startsWith","themeSwitcherLabel","textContent","dataset","bsThemeValue","addEventListener","toggle","getAttribute","setStoredTheme"],"sourceRoot":""}