{"version":3,"file":"ImageModal.ZUTIeGiZ.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/phHIoV4sU5KJAfovhsUI/7EU4mpCn0ZXkDQgoena9/ImageModal.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{Frame,addPropertyControls,ControlType,motion}from\"framer\";import{createPortal}from\"react-dom\";export default function ImageModal({preview,largeImage,width,height}){const[isOpen,setIsOpen]=useState(false);const[imageSize,setImageSize]=useState({width:200,height:80});// Detect uploaded image's natural width & height\nuseEffect(()=>{if(preview){const img=new Image;img.src=preview;img.onload=()=>{setImageSize({width:img.naturalWidth,height:img.naturalHeight});};}},[preview]);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Frame,{width:width,height:height,background:\"transparent\",style:{display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\",cursor:\"pointer\",objectFit:\"contain\"},onClick:()=>setIsOpen(true),children:/*#__PURE__*/_jsx(\"img\",{src:preview,alt:\"Preview\",style:{width:\"100%\",height:\"100%\",justifyContent:\"center\",alignItems:\"center\",objectFit:\"contain\"}})}),isOpen&&/*#__PURE__*/createPortal(/*#__PURE__*/_jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},style:{position:\"fixed\",top:0,left:0,width:\"100vw\",height:\"100vh\",background:\"rgba(0, 0, 0, 0.8)\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",zIndex:9999},onClick:()=>setIsOpen(false),children:/*#__PURE__*/_jsx(\"img\",{src:largeImage,alt:\"Fullscreen Image\",style:{maxWidth:\"90vw\",maxHeight:\"90vh\",objectFit:\"contain\",cursor:\"pointer\"},onClick:()=>setIsOpen(false)})}),document.body)]});}// Add property controls for Framer UI\naddPropertyControls(ImageModal,{preview:{type:ControlType.Image,title:\"Preview Image\"},largeImage:{type:ControlType.Image,title:\"Large Image\"},width:{type:ControlType.Number,title:\"ImageModal Width\",min:200,max:2e3,step:10},height:{type:ControlType.Number,title:\"ImageModal Height\",min:80,max:1500,step:10}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageModal\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageModal.map"],"mappings":"8PAA0N,SAAwB,EAAW,CAAC,UAAQ,aAAW,QAAM,UAAQ,CAAC,GAAK,CAAC,EAAO,GAAWA,EAAS,GAAM,CAAM,CAAC,EAAU,GAAcA,EAAS,CAAC,MAAM,IAAI,OAAO,GAAG,CAAC,CACtO,OAA/J,MAAc,CAAC,GAAG,EAAQ,CAAC,IAAM,EAAI,IAAI,MAAM,EAAI,IAAI,EAAQ,EAAI,WAAW,CAAC,EAAa,CAAC,MAAM,EAAI,aAAa,OAAO,EAAI,cAAc,CAAC,IAAM,CAAC,EAAQ,CAAC,CAAqB,EAAMC,EAAU,CAAC,SAAS,CAAc,EAAK,EAAM,CAAO,QAAa,SAAO,WAAW,cAAc,MAAM,CAAC,QAAQ,OAAO,eAAe,SAAS,WAAW,SAAS,SAAS,SAAS,OAAO,UAAU,UAAU,UAAU,CAAC,YAAY,EAAU,GAAK,CAAC,SAAsB,EAAK,MAAM,CAAC,IAAI,EAAQ,IAAI,UAAU,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,eAAe,SAAS,WAAW,SAAS,UAAU,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,GAAqB,EAA0B,EAAK,EAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,SAAS,GAAG,CAAC,MAAM,CAAC,SAAS,QAAQ,IAAI,EAAE,KAAK,EAAE,MAAM,QAAQ,OAAO,QAAQ,WAAW,qBAAqB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