{"version":3,"file":"material.modern.min.js","sources":["../../src/js/material.modern.js"],"sourcesContent":["/**\n * Minimal Material Design script\n * Initializes only the components present on the page\n */\nimport { onDOMReady, $$ } from './utils.js';\n\n// Initialize all Material Design components on the page\nfunction initMaterialComponents() {\n // Check if Material Design is available\n if (!window.componentHandler) {\n // Silently return - no need to warn as this is expected in some cases\n return;\n }\n\n // Get all MDL components on the page\n const mdlComponents = $$('[class*=\"mdl-\"]');\n \n if (mdlComponents.length === 0) {\n return; // No MDL components on this page\n }\n \n // Upgrade all components\n window.componentHandler.upgradeAllRegistered();\n \n // Handle dynamic components that might be added later\n const observer = new MutationObserver((mutations) => {\n let needsUpgrade = false;\n \n mutations.forEach((mutation) => {\n if (mutation.type === 'childList') {\n // Check if any new nodes have MDL classes\n Array.from(mutation.addedNodes).forEach((node) => {\n if (node.nodeType === 1 && node.className && node.className.indexOf && node.className.indexOf('mdl-') !== -1) {\n needsUpgrade = true;\n }\n });\n }\n });\n \n if (needsUpgrade) {\n window.componentHandler.upgradeAllRegistered();\n }\n });\n \n // Observe the entire document for changes\n observer.observe(document.body, {\n childList: true,\n subtree: true\n });\n}\n\n// Initialize when the DOM is ready\nonDOMReady(initMaterialComponents); "],"names":["onDOMReady","$$","window","componentHandler","length","upgradeAllRegistered","MutationObserver","mutations","needsUpgrade","forEach","mutation","type","Array","from","addedNodes","node","nodeType","className","indexOf","observe","document","body","childList","subtree"],"mappings":"qBAAAA,QAAAC,MAAA,aAoDAD,GA7CA,WAEOE,OAAOC,kBAQiB,IAFPF,EAAG,mBAEPG,SAKlBF,OAAOC,iBAAiBE,uBAGP,IAAIC,kBAAkBC,IACrC,IAAIC,GAAe,EAEnBD,EAAUE,SAASC,IACK,cAAlBA,EAASC,MAEXC,MAAMC,KAAKH,EAASI,YAAYL,SAASM,IACjB,IAAlBA,EAAKC,UAAkBD,EAAKE,WAAaF,EAAKE,UAAUC,UAA+C,IAApCH,EAAKE,UAAUC,QAAQ,UAC5FV,GAAe,EAChB,GAEJ,IAGCA,GACFN,OAAOC,iBAAiBE,sBACzB,IAIMc,QAAQC,SAASC,KAAM,CAC9BC,WAAW,EACXC,SAAS,IAEb"}