{"version":3,"file":"ImageLoader.CQn9f8eT.mjs","names":[],"sources":["https:/framerusercontent.com/modules/28gAUAjmhYhx2jCTGfRn/xspDErfeUQopOWpjtEU5/ImageLoader.js"],"sourcesContent":["// Image component that loads an image from a URL\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * ImageLoader\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ImageLoader(props){const{imageUrl,altText,fit,position,style,borderRadius,borderRadiusPerCorner,border,shadow,focalPoint}=props;// Map position prop to CSS objectPosition value\nconst objectPositionMap={center:\"center\",top:\"top center\",bottom:\"bottom center\",left:\"center left\",right:\"center right\",\"top left\":\"top left\",\"top right\":\"top right\",\"bottom left\":\"bottom left\",\"bottom right\":\"bottom right\"};// Determine objectPosition, using focalPoint if provided\nlet objectPosition=objectPositionMap[position]||\"center\";if(focalPoint&&typeof focalPoint.x===\"number\"&&typeof focalPoint.y===\"number\"){objectPosition=`${focalPoint.x}% ${focalPoint.y}%`;}if(fit===\"scale-down\"){// fallback to objectFit: scale-down for legacy option\nreturn /*#__PURE__*/_jsx(\"img\",{src:imageUrl,alt:altText,style:{width:\"100%\",height:\"100%\",objectFit:\"scale-down\",objectPosition,display:\"block\",...style,borderRadius:borderRadiusPerCorner?`${borderRadiusPerCorner.topLeft}px ${borderRadiusPerCorner.topRight}px ${borderRadiusPerCorner.bottomRight}px ${borderRadiusPerCorner.bottomLeft}px`:borderRadius,...border?border:{},boxShadow:shadow}});}if(fit===\"none\"){// fallback to objectFit: none for legacy option\nreturn /*#__PURE__*/_jsx(\"img\",{src:imageUrl,alt:altText,style:{width:\"100%\",height:\"100%\",objectFit:\"none\",objectPosition,display:\"block\",...style,borderRadius:borderRadiusPerCorner?`${borderRadiusPerCorner.topLeft}px ${borderRadiusPerCorner.topRight}px ${borderRadiusPerCorner.bottomRight}px ${borderRadiusPerCorner.bottomLeft}px`:borderRadius,...border?border:{},boxShadow:shadow}});}if(fit===\"tile\"){// Use a div with background-repeat for tile\nconst scale=props.tileScale??1;// Calculate background size and spacing for tiling\nconst backgroundSize=scale!==1?`${scale*100}% auto`:\"auto\";const backgroundPosition=objectPositionMap[position]||\"center\";return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",backgroundImage:`url(${imageUrl})`,backgroundRepeat:\"repeat\",backgroundPosition,backgroundSize,display:\"block\",...style,boxSizing:\"border-box\",borderRadius:borderRadiusPerCorner?`${borderRadiusPerCorner.topLeft}px ${borderRadiusPerCorner.topRight}px ${borderRadiusPerCorner.bottomRight}px ${borderRadiusPerCorner.bottomLeft}px`:borderRadius,...border?border:{},boxShadow:shadow},\"aria-label\":altText,role:\"img\"});}// fill, contain, cover\nreturn /*#__PURE__*/_jsx(\"img\",{src:imageUrl,alt:altText,style:{width:\"100%\",height:\"100%\",objectFit:fit,objectPosition,display:\"block\",...style,borderRadius:borderRadiusPerCorner?`${borderRadiusPerCorner.topLeft}px ${borderRadiusPerCorner.topRight}px ${borderRadiusPerCorner.bottomRight}px ${borderRadiusPerCorner.bottomLeft}px`:borderRadius,...border?border:{},boxShadow:shadow}});}addPropertyControls(ImageLoader,{imageUrl:{type:ControlType.String,title:\"Image URL\",defaultValue:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",placeholder:\"https://...\"},altText:{type:ControlType.String,title:\"Alt Text\",defaultValue:\"Image\",placeholder:\"Describe the image\"},fit:{type:ControlType.Enum,title:\"Object Fit\",options:[\"fill\",\"contain\",\"cover\",\"tile\",\"none\",\"scale-down\"],optionTitles:[\"Fill\",\"Fit\",\"Stretch\",\"Tile\",\"None\",\"Scale Down\"],defaultValue:\"cover\",displaySegmentedControl:false},position:{type:ControlType.Enum,title:\"Position\",options:[\"center\",\"top\",\"bottom\",\"left\",\"right\",\"top left\",\"top right\",\"bottom left\",\"bottom right\"],optionTitles:[\"Center\",\"Top Center\",\"Bottom Center\",\"Center Left\",\"Center Right\",\"Top Left\",\"Top Right\",\"Bottom Left\",\"Bottom Right\"],defaultValue:\"center\",displaySegmentedControl:false},focalPoint:{type:ControlType.Object,title:\"Focal Point\",controls:{x:{type:ControlType.Number,title:\"X\",defaultValue:50,min:0,max:100,unit:\"%\"},y:{type:ControlType.Number,title:\"Y\",defaultValue:50,min:0,max:100,unit:\"%\"}},optional:true,hidden:({fit})=>fit===\"tile\"},tileScale:{type:ControlType.Number,title:\"Tile Scale\",defaultValue:1,min:.1,max:5,step:.05,unit:\"x\",hidden:({fit})=>fit!==\"tile\"},borderRadius:{type:ControlType.BorderRadius,title:\"Radius\",defaultValue:\"0px\"},border:{type:ControlType.Border,title:\"Border\",defaultValue:{borderWidth:0,borderStyle:\"solid\",borderColor:\"rgba(0,0,0,0.1)\"}},shadow:{type:ControlType.BoxShadow,title:\"Shadow\",defaultValue:\"\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageLoader\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageLoader.map"],"mappings":"4JAMG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,WAAS,UAAQ,MAAI,WAAS,QAAM,eAAa,wBAAsB,SAAO,SAAO,cAAY,EAC/I,EAAkB,CAAC,OAAO,SAAS,IAAI,aAAa,OAAO,gBAAgB,KAAK,cAAc,MAAM,eAAe,WAAW,WAAW,YAAY,YAAY,cAAc,cAAc,eAAe,cAAc,EAC5N,EAAe,EAAkB,IAAW,SAA4I,GAAhI,GAAY,OAAO,EAAW,GAAI,UAAU,OAAO,EAAW,GAAI,WAAU,EAAe,GAAG,EAAW,EAAE,IAAI,EAAW,EAAE,IAAO,IAAM,aACrM,OAAoB,EAAK,MAAM,CAAC,IAAI,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