{"version":3,"file":"ImageFromURL.DsSKWdMq.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/9LC3hYUGe6WJzO6gIUe9/3yZZoJboHpBXS9uARba8/ImageFromURL.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,startTransition}from\"react\";/**\n * Image from URL\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ImageFromURL(props){const{imageURL=\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",fallbackURL={src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Fallback image\"},altText=\"Image\",imageSizing=\"frame\",objectFit=\"cover\",borderWidth=0,borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth,borderStyle=\"solid\",borderColor=\"#000000\",borderRadius=\"0px\",grayscale=false,style}=props;const[hasError,setHasError]=useState(false);const handleError=()=>{if(!hasError){startTransition(()=>{setHasError(true);});}};const displayImageURL=hasError&&fallbackURL?.src?fallbackURL.src:imageURL;const displayAltText=hasError&&fallbackURL?.alt?fallbackURL.alt:altText;const top=borderTopWidth??borderWidth;const right=borderRightWidth??borderWidth;const bottom=borderBottomWidth??borderWidth;const left=borderLeftWidth??borderWidth;const isIntrinsicSizing=imageSizing===\"intrinsic\";const isFitContentSizing=imageSizing===\"fit-content\";return /*#__PURE__*/_jsx(\"div\",{style:{width:isIntrinsicSizing?\"max-content\":\"100%\",height:isIntrinsicSizing||isFitContentSizing?\"auto\":\"100%\",maxWidth:\"100%\",maxHeight:isIntrinsicSizing?\"100%\":undefined,position:\"relative\",overflow:\"hidden\",boxSizing:\"border-box\",...style,borderStyle,borderColor,borderTopWidth:`${top}px`,borderRightWidth:`${right}px`,borderBottomWidth:`${bottom}px`,borderLeftWidth:`${left}px`,borderRadius},children:/*#__PURE__*/_jsx(\"img\",{src:displayImageURL,alt:displayAltText,onError:handleError,style:{width:isIntrinsicSizing?\"auto\":\"100%\",height:isIntrinsicSizing||isFitContentSizing?\"auto\":\"100%\",maxWidth:\"100%\",maxHeight:isIntrinsicSizing?\"100%\":undefined,objectFit:isIntrinsicSizing||isFitContentSizing?\"contain\":objectFit,display:\"block\",filter:grayscale?\"grayscale(100%)\":\"none\"}})});}addPropertyControls(ImageFromURL,{imageURL:{type:ControlType.String,title:\"Image URL\",defaultValue:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",placeholder:\"https://example.com/image.jpg\"},fallbackURL:{type:ControlType.ResponsiveImage,title:\"Fallback Image\"},altText:{type:ControlType.String,title:\"Alt Text\",defaultValue:\"Image\",placeholder:\"Describe the image...\"},imageSizing:{type:ControlType.Enum,title:\"Image Sizing\",options:[\"frame\",\"intrinsic\",\"fit-content\"],optionTitles:[\"Fill Frame\",\"Intrinsic\",\"Fit Content\"],defaultValue:\"frame\",displaySegmentedControl:false},objectFit:{type:ControlType.Enum,title:\"Object Fit\",options:[\"contain\",\"cover\",\"fill\",\"none\",\"scale-down\"],optionTitles:[\"Contain\",\"Cover\",\"Fill\",\"None\",\"Scale Down\"],defaultValue:\"cover\",displaySegmentedControl:false},borderStyle:{type:ControlType.Enum,title:\"Border Style\",options:[\"none\",\"solid\",\"dashed\",\"dotted\"],optionTitles:[\"None\",\"Solid\",\"Dashed\",\"Dotted\"],defaultValue:\"solid\"},borderWidth:{type:ControlType.Number,title:\"Width\",defaultValue:0,min:0,max:50,step:1,unit:\"px\",hidden:props=>props.borderStyle===\"none\"},borderTopWidth:{type:ControlType.Number,title:\"Top Width\",defaultValue:0,min:0,max:50,step:1,unit:\"px\",hidden:props=>props.borderStyle===\"none\"},borderRightWidth:{type:ControlType.Number,title:\"Right Width\",defaultValue:0,min:0,max:50,step:1,unit:\"px\",hidden:props=>props.borderStyle===\"none\"},borderBottomWidth:{type:ControlType.Number,title:\"Bottom Width\",defaultValue:0,min:0,max:50,step:1,unit:\"px\",hidden:props=>props.borderStyle===\"none\"},borderLeftWidth:{type:ControlType.Number,title:\"Left Width\",defaultValue:0,min:0,max:50,step:1,unit:\"px\",hidden:props=>props.borderStyle===\"none\"},borderColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\",hidden:props=>props.borderStyle===\"none\"},borderRadius:{type:ControlType.BorderRadius,title:\"Radius\",defaultValue:\"0px\"},grayscale:{type:ControlType.Boolean,title:\"Grayscale\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageFromURL\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageFromURL.map"],"mappings":"kLAKG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,WAAS,sEAAsE,cAAY,CAAC,IAAI,oEAAoE,IAAI,gBAAgB,EAAE,UAAQ,QAAQ,cAAY,QAAQ,YAAU,QAAQ,cAAY,EAAE,iBAAe,mBAAiB,oBAAkB,kBAAgB,cAAY,QAAQ,cAAY,UAAU,eAAa,MAAM,YAAU,GAAM,SAAO,EAAW,CAAC,EAAS,GAAaA,EAAS,EAAK,EAAQ,MAAgB,CAAK,GAAU,MAAoB,CAAC,EAAY,EAAI,CAAE,CAAC,CAAG,EAAQ,EAAgB,GAAU,GAAa,IAAI,EAAY,IAAI,EAAe,EAAe,GAAU,GAAa,IAAI,EAAY,IAAI,EAAc,EAAI,GAAgB,EAAkB,EAAM,GAAkB,EAAkB,EAAO,GAAmB,EAAkB,EAAK,GAAiB,EAAkB,EAAkB,IAAc,YAAkB,EAAmB,IAAc,cAAc,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,EAAkB,cAAc,OAAO,OAAO,GAAmB,EAAmB,OAAO,OAAO,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