{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/oz8LbimHQqM5Ulxjy5PL/JMGT4igGLZGlSHtoVUMb/ThemeImage.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,Image}from\"framer\";import{useState,useEffect}from\"react\";import{EmptyState}from\"https://framerusercontent.com/modules/n9cR4gFLy0DjoxfkLrIe/eDj1MxSfupkYrrIeXQ6b/Shared.js\";import{borderPropertyControl,Border}from\"https://framerusercontent.com/modules/n9cR4gFLy0DjoxfkLrIe/eDj1MxSfupkYrrIeXQ6b/Shared.js\";const THEME_ATTRIBUTE=\"framestack-theme\";const SIGNAL_NAME=\"framestack-theme-changed\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ThemeImage(props){var _props_dark,_props_light;const[isDarkTheme,setIsDarkTheme]=useState(null);useEffect(()=>{const updateTheme=()=>{// For compatibility with the theme toggle component.\n// https://framestack.co/components/theme-toggle\n// If the site does not have a theme toggle, the device theme will be used.\nconst currentToggleState=document.body.getAttribute(THEME_ATTRIBUTE);// Check if page has the theme toggle attribute.\nif(!currentToggleState||currentToggleState==\"deviceTheme\"){if(document.body.hasAttribute(\"data-framer-theme\")){setIsDarkTheme(document.body.getAttribute(\"data-framer-theme\")==\"dark\");}else{const mediaQuery=window.matchMedia(\"(prefers-color-scheme: dark)\");setIsDarkTheme(mediaQuery.matches);}}else{// Use device theme\nsetIsDarkTheme(currentToggleState==\"dark\")// light or dark\n;}};// Event listener for changes in the device theme\nconst osThemeChange=e=>{setIsDarkTheme(e.matches);};// Update the theme when the page loads\nupdateTheme();// Listen for theme changes made by the theme toggle component\nwindow.addEventListener(SIGNAL_NAME,updateTheme);// Listen for changes in the device theme\nconst mediaQuery=window.matchMedia(\"(prefers-color-scheme: dark)\");mediaQuery.addListener(osThemeChange);// Clean up the event listeners when the theme toggle component unmounts\nreturn()=>{window.removeEventListener(SIGNAL_NAME,updateTheme);mediaQuery.removeListener(osThemeChange);};},[]);// Before the theme has been determined, render nothing.\n// This prevents flashing while the page loads.\nif(isDarkTheme===null){return null;}// Empty state\nif(!((_props_dark=props.dark)===null||_props_dark===void 0?void 0:_props_dark.src)||!((_props_light=props.light)===null||_props_light===void 0?void 0:_props_light.src)){return /*#__PURE__*/_jsx(EmptyState,{title:\"Add dark and light images.\",subtitle:\"Use the properties panel on the right side to upload images for dark and light theme.\"});}return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",borderRadius:props.radiusIsMixed?`${props.topLeft}px ${props.topRight}px ${props.bottomRight}px ${props.bottomLeft}px`:`${props.radius}px`,boxShadow:props.shadows,...props.style},children:[/*#__PURE__*/_jsx(Image,{background:{fit:props.sizing,...isDarkTheme?props.dark:props.light},style:{borderRadius:\"inherit\",...props.style}}),/*#__PURE__*/_jsx(Border,{...props.border})]});}ThemeImage.displayName=\"Theme Image\";addPropertyControls(ThemeImage,{light:{type:ControlType.ResponsiveImage},dark:{type:ControlType.ResponsiveImage},sizing:{type:ControlType.Enum,defaultValue:\"cover\",options:[\"fill\",\"fit\",\"stretch\"],optionTitles:[\"Fill\",\"Fit\",\"Stretch\"]},radius:{type:ControlType.FusedNumber,defaultValue:0,toggleKey:\"radiusIsMixed\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"topLeft\",\"topRight\",\"bottomRight\",\"bottomLeft\"],valueLabels:[\"TL\",\"TR\",\"BR\",\"BL\"],min:0},border:borderPropertyControl(),shadows:{type:ControlType.BoxShadow,description:\"*Note:* Theming may not work properly in the editor or preview.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ThemeImage\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],
  "mappings": "kOAAAA,IAA+Y,IAAMC,EAA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KAAK,EAAE,MAAM,CAAC,aAAa,UAAU,GAAGA,EAAM,KAAK,CAAC,CAAC,EAAeY,EAAKI,EAAO,CAAC,GAAGhB,EAAM,MAAM,CAAC,CAAC,CAAC,CAAC,CAAE,CAACD,EAAW,YAAY,cAAckB,EAAoBlB,EAAW,CAAC,MAAM,CAAC,KAAKmB,EAAY,eAAe,EAAE,KAAK,CAAC,KAAKA,EAAY,eAAe,EAAE,OAAO,CAAC,KAAKA,EAAY,KAAK,aAAa,QAAQ,QAAQ,CAAC,OAAO,MAAM,SAAS,EAAE,aAAa,CAAC,OAAO,MAAM,SAAS,CAAC,EAAE,OAAO,CAAC,KAAKA,EAAY,YAAY,aAAa,EAAE,UAAU,gBAAgB,aAAa,CAAC,MAAM,YAAY,EAAE,UAAU,CAAC,UAAU,WAAW,cAAc,YAAY,EAAE,YAAY,CAAC,KAAK,KAAK,KAAK,IAAI,EAAE,IAAI,CAAC,EAAE,OAAOC,EAAsB,EAAE,QAAQ,CAAC,KAAKD,EAAY,UAAU,YAAY,iEAAiE,CAAC,CAAC",
  "names": ["init_ssg_sandbox_shims", "THEME_ATTRIBUTE", "SIGNAL_NAME", "ThemeImage", "props", "_props_dark", "_props_light", "isDarkTheme", "setIsDarkTheme", "ye", "ue", "updateTheme", "currentToggleState", "mediaQuery", "osThemeChange", "e", "p", "EmptyState", "u", "Image2", "Border", "addPropertyControls", "ControlType", "borderPropertyControl"]
}
