{"version":3,"file":"AdvancedImageEmbed.CHClMEc5.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/RiGxsGL6mFNBPuxu3nQW/gqtud3KRvpk0dPnSBdFS/AdvancedImageEmbed.js"],"sourcesContent":["// Advanced image embed component that loads images from external URLs to save bandwidth.\n// CMS-ready with URL and alt text properties. Performance optimized with fixed sizing.\n// Includes fallback support and accessibility features.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useState,useEffect}from\"react\";/**\n * Advanced Image Embed\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 300\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight any\n */export default function AdvancedImageEmbed(props){const{imageUrl=\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",altText=\"Image\",fitSettings={objectFit:\"cover\",objectPosition:\"center\"},useVariableFit=false,variableObjectFit=\"cover\",variableFocalPoint=\"center\",loading=\"lazy\",borderRadius=0,style}=props;const[hasError,setHasError]=useState(false);const[isLoading,setIsLoading]=useState(false);// Reset states when imageUrl changes\nuseEffect(()=>{setHasError(false);setIsLoading(false);},[imageUrl]);const fallbackImage=\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\";const displayUrl=hasError?fallbackImage:imageUrl||fallbackImage;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const showLoading=isLoading&&!isCanvas;// Determine which fit settings to use\nconst actualObjectFit=useVariableFit?variableObjectFit:fitSettings?.objectFit||\"cover\";const actualObjectPosition=useVariableFit?variableFocalPoint:fitSettings?.objectPosition||\"center\";return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",backgroundColor:showLoading?\"#f0f0f0\":\"transparent\",borderRadius:`${borderRadius}px`},children:[showLoading&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:\"50%\",left:\"50%\",transform:\"translate(-50%, -50%)\",color:\"#999\",fontSize:\"14px\"},children:\"Loading...\"}),/*#__PURE__*/_jsx(\"img\",{src:displayUrl,alt:altText,loading:loading,onLoad:()=>setIsLoading(false),onError:()=>{setHasError(true);setIsLoading(false);},style:{width:\"100%\",height:\"100%\",objectFit:actualObjectFit,objectPosition:actualObjectPosition,display:\"block\",opacity:showLoading?0:1,transition:\"opacity 0.3s ease\"}}),hasError&&isCanvas&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",bottom:\"8px\",left:\"8px\",right:\"8px\",backgroundColor:\"rgba(255, 0, 0, 0.8)\",color:\"white\",padding:\"4px 8px\",fontSize:\"12px\",borderRadius:\"4px\"},children:\"Failed to load image. Using fallback.\"})]});}addPropertyControls(AdvancedImageEmbed,{imageUrl:{type:ControlType.String,title:\"Image URL\",defaultValue:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",placeholder:\"https://example.com/image.jpg\",description:\"External image URL to load\"},altText:{type:ControlType.String,title:\"Alt Text\",defaultValue:\"Image\",placeholder:\"Describe the image...\",description:\"Alternative text for accessibility and SEO\"},borderRadius:{type:ControlType.Number,title:\"Corner Radius\",defaultValue:0,min:0,max:100,step:1,unit:\"px\",displayStepper:false},useVariableFit:{type:ControlType.Boolean,title:\"Variable Fit\",defaultValue:false,enabledTitle:\"Variable\",disabledTitle:\"Fixed\",description:\"Enable to control fit settings from outside (CMS-ready)\"},fitSettings:{type:ControlType.Object,title:\"Fit Settings\",controls:{objectFit:{type:ControlType.Enum,title:\"Object Fit\",options:[\"contain\",\"cover\",\"fill\",\"none\",\"scale-down\"],optionTitles:[\"Contain\",\"Cover\",\"Fill\",\"None\",\"Scale Down\"],defaultValue:\"cover\"},objectPosition:{type:ControlType.Enum,title:\"Focal Point\",options:[\"center\",\"top\",\"bottom\",\"left\",\"right\",\"top left\",\"top right\",\"bottom left\",\"bottom right\"],optionTitles:[\"Center\",\"Top\",\"Bottom\",\"Left\",\"Right\",\"Top Left\",\"Top Right\",\"Bottom Left\",\"Bottom Right\"],defaultValue:\"center\"}},defaultValue:{objectFit:\"cover\",objectPosition:\"center\"},hidden:({useVariableFit})=>useVariableFit},variableObjectFit:{type:ControlType.Enum,title:\"Object Fit\",options:[\"contain\",\"cover\",\"fill\",\"none\",\"scale-down\"],optionTitles:[\"Contain\",\"Cover\",\"Fill\",\"None\",\"Scale Down\"],defaultValue:\"cover\",hidden:({useVariableFit})=>!useVariableFit},variableFocalPoint:{type:ControlType.Enum,title:\"Focal Point\",options:[\"center\",\"top\",\"bottom\",\"left\",\"right\",\"top left\",\"top right\",\"bottom left\",\"bottom right\"],optionTitles:[\"Center\",\"Top\",\"Bottom\",\"Left\",\"Right\",\"Top Left\",\"Top Right\",\"Bottom Left\",\"Bottom Right\"],defaultValue:\"center\",hidden:({useVariableFit})=>!useVariableFit},loading:{type:ControlType.Enum,title:\"Loading\",options:[\"lazy\",\"eager\"],optionTitles:[\"Lazy\",\"Eager\"],defaultValue:\"lazy\",displaySegmentedControl:true,description:\"Image loading strategy\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AdvancedImageEmbed\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerIntrinsicHeight\":\"300\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicWidth\":\"400\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AdvancedImageEmbed.map"],"mappings":"0LAWG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,WAAS,sEAAsE,UAAQ,QAAQ,cAAY,CAAC,UAAU,QAAQ,eAAe,SAAS,CAAC,iBAAe,GAAM,oBAAkB,QAAQ,qBAAmB,SAAS,UAAQ,OAAO,eAAa,EAAE,SAAO,EAAW,CAAC,EAAS,GAAaA,EAAS,GAAM,CAAM,CAAC,EAAU,GAAcA,EAAS,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