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,EAEAE,UAAAA,GACiC,WAAzBlB,KAAKN,gBACLM,KAAKN,gBAAkBF,EAChBQ,KAAKN,kBAAoBF,EAChCQ,KAAKN,gBAAkBD,EAEvBO,KAAKN,gBAAkB,SAE3BM,KAAKY,YACT,EAEAO,WAAAA,GACQnB,KAAKH,iBAAmBL,EACxBQ,KAAKN,gBAAkBD,EAEvBO,KAAKN,gBAAkBF,EAE3BQ,KAAKY,YACT,EAER,EAyBAjC,OAAOyC,QAlBP,SAAiBC,EAASC,EAAQC,EAAQ,EAAGC,EAAW,MACpD,IAAIC,EAAQ,EACZ,MAAMC,EAAcC,KAAKC,MAAMJ,GAAY,IAAO,KAC5CK,GAAaP,EAASC,GAASG,EAE/BI,EAAUA,KACZL,IACA,MAAMM,EAAeJ,KAAKC,MAAML,EAASM,EAAYJ,GACjDA,GAASC,EACTL,EAAQW,YAAcV,EAAOW,kBAGjCZ,EAAQW,YAAcD,EAAaE,iBACnCC,sBAAsBJ,KAE1BI,sBAAsBJ,EAC1B,EAKAK,EAAAA,EAAOC,OAAOC,EAAAA,GACdF,EAAAA,EAAOZ,O","sources":["webpack://python-webpack-boilerplate/./transportation/frontend/src/application/app.js"],"sourcesContent":["\n// This is the style entry file\nimport \"../styles/index.css\";\n\nimport Alpine from 'alpinejs';\nimport intersect from '@alpinejs/intersect';\nimport Clarity from '@microsoft/clarity';\n\n\nfunction initClarity() {\n  const clarityMeta = document.querySelector('meta[name=\"clarity-project-id\"]');\n  if (clarityMeta) {\n    const projectId = clarityMeta.getAttribute('content');\n    if (projectId) {\n    //   console.log('Initializing Clarity...'); // Uncomment for debugging\n      Clarity.init(projectId);\n    }\n  }\n}\n\nwindow.document.addEventListener(\"DOMContentLoaded\", function () {\n    window.console.log(\"dom ready\");\n    initClarity();\n});\n\nfunction themeManager() {\n    const $firstTheme = 'light';\n    const $secondTheme = 'dark';\n\n    return {\n        themePreference: localStorage.getItem('theme') || 'system',\n        effectiveTheme: document.documentElement.getAttribute('data-theme') || $firstTheme,\n\n        init() {\n            const initialDOMTheme = document.documentElement.getAttribute('data-theme');\n            // Sync themePreference if it was 'system' and DOM reflects the resolved system theme\n            if (this.themePreference === 'system') {\n                this.effectiveTheme = initialDOMTheme;\n            } else if (this.themePreference !== initialDOMTheme) {\n                this.effectiveTheme = initialDOMTheme;\n            }\n\n            const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n            // Store the listener function to be able to remove it if the component is destroyed (if using a framework that supports that)\n            // For Alpine.js, this is generally managed by Alpine itself when the element is removed from DOM.\n            this.osThemeChangeListener = (e) => { // Changed to arrow function for consistent 'this' if needed elsewhere\n                if (this.themePreference === 'system') {\n                    this.setEffectiveTheme(e.matches ? $secondTheme : $firstTheme);\n                }\n            };\n            mediaQuery.addEventListener('change', this.osThemeChangeListener);\n\n            this.storageChangeListener = (event) => { // Arrow function for 'this'\n                if (event.key === 'theme') {\n                    const newPreference = event.newValue || 'system';\n                    if (newPreference !== this.themePreference) {\n                        this.themePreference = newPreference;\n                        this.applyTheme();\n                    }\n                }\n            };\n            window.addEventListener('storage', this.storageChangeListener);\n        },\n\n        applyTheme() {\n            let newEffectiveTheme; // 'let' as it's conditionally assigned\n            if (this.themePreference === 'system') {\n                newEffectiveTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? $secondTheme : $firstTheme;\n                localStorage.removeItem('theme');\n            } else {\n                newEffectiveTheme = this.themePreference;\n                localStorage.setItem('theme', this.themePreference);\n            }\n            this.setEffectiveTheme(newEffectiveTheme);\n        },\n\n        setEffectiveTheme(theme) {\n            this.effectiveTheme = theme;\n            document.documentElement.setAttribute('data-theme', theme);\n            // document.documentElement.classList.toggle($secondTheme, theme === $secondTheme); // If using Tailwind's dark class\n        },\n\n        cycleTheme() {\n            if (this.themePreference === 'system') {\n                this.themePreference = $firstTheme;\n            } else if (this.themePreference === $firstTheme) {\n                this.themePreference = $secondTheme;\n            } else { // themePreference === $secondTheme\n                this.themePreference = 'system';\n            }\n            this.applyTheme();\n        },\n\n        toggleTheme() {\n            if (this.effectiveTheme === $firstTheme) {\n                this.themePreference = $secondTheme;\n            } else {\n                this.themePreference = $firstTheme;\n            }\n            this.applyTheme();\n        }\n    };\n};\n\nwindow.themeManager = themeManager;\n\n\n// In base.html, inside a <script> tag\n\nfunction countUp(element, target, start = 0, duration = 1500) { // Added 'element' parameter\n    let frame = 0;\n    const totalFrames = Math.round(duration / (1000 / 60));\n    const increment = (target - start) / totalFrames;\n\n    const counter = () => {\n        frame++;\n        const currentCount = Math.round(start + (increment * frame));\n        if (frame >= totalFrames) {\n            element.textContent = target.toLocaleString();\n            return;\n        }\n        element.textContent = currentCount.toLocaleString();\n        requestAnimationFrame(counter);\n    };\n    requestAnimationFrame(counter);\n}\n\nwindow.countUp = countUp;\n\n\nAlpine.plugin(intersect);\nAlpine.start();\n"],"names":["window","document","addEventListener","console","log","clarityMeta","querySelector","projectId","getAttribute","Clarity","init","initClarity","themeManager","$firstTheme","$secondTheme","themePreference","localStorage","getItem","effectiveTheme","documentElement","initialDOMTheme","this","mediaQuery","matchMedia","osThemeChangeListener","e","setEffectiveTheme","matches","storageChangeListener","event","key","newPreference","newValue","applyTheme","newEffectiveTheme","removeItem","setItem","theme","setAttribute","cycleTheme","toggleTheme","countUp","element","target","start","duration","frame","totalFrames","Math","round","increment","counter","currentCount","textContent","toLocaleString","requestAnimationFrame","Alpine","plugin","intersect"],"ignoreList":[],"sourceRoot":""}