{"version":3,"file":"Variant.DFTmD7Lo.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/bdSFyYY9n94E5Sr0sRXQ/kt6t34HBWxuzWNBnKY3B/Variant.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";export function withResponsiveTheme(Wrapped){return props=>{const[variant,setVariant]=useState(null);const getStoredTheme=()=>{try{const stored=localStorage.getItem(\"currentOsTheme\");if(stored===\"dark\")return\"dark\";if(stored===\"light\")return\"light\";return null;}catch{return null;}};useEffect(()=>{if(typeof window===\"undefined\")return;let interval=null;const syncTheme=()=>{const stored=getStoredTheme();if(stored===\"dark\"){setVariant(\"Dark\");if(interval){clearInterval(interval);interval=null;}}else if(stored===\"light\"){setVariant(\"Light\");if(interval){clearInterval(interval);interval=null;}}};// Başlangıçta değer yoksa 100ms aralıkla dene\nif(!getStoredTheme()){interval=setInterval(syncTheme,100);}else{syncTheme();}const handleStorage=e=>{if(e.key===\"currentOsTheme\")syncTheme();};const handleCustom=()=>syncTheme();window.addEventListener(\"storage\",handleStorage);window.addEventListener(\"currentOsThemeChanged\",handleCustom);// localStorage.setItem override\nconst originalSetItem=localStorage.setItem;localStorage.setItem=function(key,value){originalSetItem.call(this,key,value);if(key===\"currentOsTheme\"){window.dispatchEvent(new CustomEvent(\"currentOsThemeChanged\",{detail:value}));}};return()=>{if(interval)clearInterval(interval);window.removeEventListener(\"storage\",handleStorage);window.removeEventListener(\"currentOsThemeChanged\",handleCustom);localStorage.setItem=originalSetItem;};},[]);if(variant===null)return null// yüklenene kadar boş dön\n;return /*#__PURE__*/_jsx(Wrapped,{...props,variant:variant});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withResponsiveTheme\":{\"type\":\"reactHoc\",\"name\":\"withResponsiveTheme\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Variant.map"],"mappings":"uIAAiF,SAAgB,EAAoB,EA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