{"version":3,"file":"Offload_image.D3PyHdyS.mjs","names":[],"sources":["https:/framerusercontent.com/modules/gaMHfiDovF1i5LJhcXmY/WquCQKxdiMN4GfchvWlH/Component_instructions.js","https:/framer.com/m/Component-instructions-nvSSIr.js@WquCQKxdiMN4GfchvWlH","https:/framerusercontent.com/modules/cq5pAi87Ma2t1Hlf5lap/BEYhYbDapdVKu0ieObak/Offload_image.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";export default function ComponentInstructions({title=\"Component Instructions\",description=\"Set up the component by adding image to the component properties.\"}){return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",gap:10,backgroundColor:\"#1C1C1C\",padding:\"40px\"},children:[/*#__PURE__*/_jsx(\"img\",{src:\"https://framerusercontent.com/images/GfOx3f6nJ3zn9ncjOQOsysz6gM.png\",alt:\"Component Instructions\",style:{width:\"32px\",height:\"32px\"}}),/*#__PURE__*/_jsx(\"h1\",{style:{color:\"#ededed\",fontSize:\"16px\",fontWeight:\"400\",margin:0,textAlign:\"center\",marginTop:\"6px\"},children:title}),/*#__PURE__*/_jsx(\"p\",{style:{color:\"#999999\",fontSize:\"13px\",fontWeight:\"300\",margin:0,textAlign:\"center\"},children:description})]});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ComponentInstructions\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Component_instructions.map","/*\n * Component_instructions\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/gaMHfiDovF1i5LJhcXmY/WquCQKxdiMN4GfchvWlH/Component_instructions.js\"\nexport { default } from \"https://framerusercontent.com/modules/gaMHfiDovF1i5LJhcXmY/WquCQKxdiMN4GfchvWlH/Component_instructions.js\"\n","import{jsx as _jsx}from\"react/jsx-runtime\";import{ControlType,addPropertyControls}from\"framer\";import{motion}from\"framer-motion\";// import ComponentInstructions from \"../component-template/componentInstructions.tsx\";\nimport ComponentInstructions from\"https://framer.com/m/Component-instructions-nvSSIr.js@WquCQKxdiMN4GfchvWlH\";// ------------------------------------------------------------ //\n// PROPERTY CONTROLS\n// ------------------------------------------------------------ //\naddPropertyControls(OffloadImage,{imageType:{title:\"Source\",type:ControlType.Enum,options:[\"json-urls\",\"url\"],optionTitles:[\"URL json\",\"URL\"],defaultValue:\"json-urls\",displaySegmentedControl:true},jsonUrls:{title:\"JSON URLs\",type:ControlType.String,description:\"JSON with url, mobileUrl, tabletUrl keys\",hidden:props=>props.imageType!==\"json-urls\"},imageUrl:{title:\"URL\",type:ControlType.String,hidden:props=>props.imageType!==\"url\"},tabletImageUrl:{title:\"Tablet URL\",type:ControlType.String,optional:true,description:\"Medium image for tablet devices\",hidden:props=>props.imageType!==\"url\"},mobileImageUrl:{title:\"Mobile URL\",type:ControlType.String,optional:true,description:\"Smaller image for mobile devices\",hidden:props=>props.imageType!==\"url\"},imageAlt:{title:\"Alt Text\",type:ControlType.String},objectFit:{type:ControlType.Enum,options:[\"fill\",\"fit\",\"strech\"],optionTitles:[\"Fill\",\"Fit\",\"Stretch\"],defaultValue:\"fit\",displaySegmentedControl:true,segmentedControlDirection:\"vertical\"},borderRadius:{title:\"Radius\",type:ControlType.BorderRadius,defaultValue:\"0px\"},focalPointX:{title:\"X Focal Point\",type:ControlType.Number,min:0,max:100,step:1,defaultValue:50},focalPointY:{title:\"Y Focal Point\",type:ControlType.Number,min:0,max:100,step:1,defaultValue:50},loading:{type:ControlType.Enum,options:[\"lazy\",\"priority\"],optionTitles:[\"Lazy\",\"Priority\"],displaySegmentedControl:true,defaultValue:\"lazy\",description:\"More components at [Framer Coder](https://framercoder.com).\"},onTap:{type:ControlType.EventHandler,title:\"On Click\"}});// ------------------------------------------------------------ //\n// MAIN COMPONENT\n// ------------------------------------------------------------ //\n/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 600\n * @framerDisableUnlink\n */export default function OffloadImage(props){const focalPoint={x:props.focalPointX,y:props.focalPointY};const sharedStyle={width:\"100%\",height:\"100%\",objectFit:getObjectFit(props.objectFit),objectPosition:`${focalPoint.x}% ${focalPoint.y}%`,borderRadius:props.borderRadius};// Handle JSON URLs image type\nif(props.imageType===\"json-urls\"){if(!props.jsonUrls){return /*#__PURE__*/_jsx(ComponentInstructions,{title:\"Offload Image\",description:\"Set up the component by adding a JSON URLs string to the component properties.\"});}let parsed={};try{parsed=JSON.parse(props.jsonUrls);}catch{return /*#__PURE__*/_jsx(ComponentInstructions,{title:\"Offload Image\",description:'Invalid JSON URLs string. Expected format: {\"url\":\"...\",\"mobileUrl\":\"...\",\"tabletUrl\":\"...\"}'});}const{url,mobileUrl,tabletUrl}=parsed;if(!url){return /*#__PURE__*/_jsx(ComponentInstructions,{title:\"Offload Image\",description:'JSON URLs must include a \"url\" key.'});}return /*#__PURE__*/_jsx(motion.img,{src:url,srcSet:mobileUrl||tabletUrl?[mobileUrl&&`${mobileUrl} 720w`,tabletUrl&&`${tabletUrl} 1200w`,`${url} 1440w`].filter(Boolean).join(\", \"):undefined,sizes:mobileUrl||tabletUrl?\"(max-width: 768px) 100vw, (max-width: 1200px) 100vw, 100vw\":undefined,alt:\"\",loading:props.loading===\"lazy\"?\"lazy\":\"eager\",fetchPriority:props.loading===\"priority\"?\"high\":\"auto\",style:sharedStyle,onTap:props.onTap});}// Handle URL image type\nif(!props.imageUrl){return /*#__PURE__*/_jsx(ComponentInstructions,{title:\"Offload Image\",description:\"Set up the component by adding an image URL to the component properties.\"});}return /*#__PURE__*/_jsx(motion.img,{src:props.imageUrl,srcSet:props.mobileImageUrl||props.tabletImageUrl?[props.mobileImageUrl&&`${props.mobileImageUrl} 720w`,props.tabletImageUrl&&`${props.tabletImageUrl} 1200w`,`${props.imageUrl} 1440w`].filter(Boolean).join(\", \"):undefined,sizes:props.mobileImageUrl||props.tabletImageUrl?\"(max-width: 768px) 100vw, (max-width: 1200px) 100vw, 100vw\":undefined,alt:props.imageAlt||\"\",loading:props.loading===\"lazy\"?\"lazy\":\"eager\",fetchPriority:props.loading===\"priority\"?\"high\":\"auto\",style:sharedStyle,onTap:props.onTap});}// ------------------------------------------------------------ //\n// HELPER FUNCTIONS\n// ------------------------------------------------------------ //\nfunction getObjectFit(objectFit){if(objectFit===\"fill\")return\"cover\";if(objectFit===\"fit\")return\"contain\";if(objectFit===\"strech\")return\"fill\";return\"cover\";}OffloadImage.displayName=\"Offload Image\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"OffloadImage\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"600\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"600\",\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Offload_image.map"],"mappings":"oNAAyD,SAAwB,EAAsB,CAAC,QAAM,yBAAyB,cAAY,qEAAqE,CAAC,OAAoB,EAAM,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,QAAQ,OAAO,cAAc,SAAS,WAAW,SAAS,eAAe,SAAS,IAAI,GAAG,gBAAgB,UAAU,QAAQ,OAAO,CAAC,SAAS,CAAc,EAAK,MAAM,CAAC,IAAI,sEAAsE,IAAI,yBAAyB,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,CAAC,CAAC,CAAc,EAAK,KAAK,CAAC,MAAM,CAAC,MAAM,UAAU,SAAS,OAAO,WAAW,MAAM,OAAO,EAAE,UAAU,SAAS,UAAU,MAAM,CAAC,SAAS,EAAM,CAAC,CAAc,EAAK,IAAI,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