{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/aFxgcRN1U8OOQcaOyEIy/mMSAMJ43B5aBlH5uHn1q/Remote_image.js"],
  "sourcesContent": ["// Welcome to Code in Framer\n// Get Started: https://www.framer.com/docs/guides/\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState}from\"react\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/docs/guides/auto-sizing\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function Remote_image(props){// This is a React component containing an Example component\n// - Replace <Example /> with your own code\n// - Find inspiration: https://www.framer.com/developers/\nconst imgSource=prepare(props.image,props.slug,props.routeSlugs,props.folder,props.useThumbnail,props.cornerRadius);const[imageError,setImageError]=useState(false);const handleImageError=()=>{setImageError(true);};const[loading,setLoading]=useState(true);const onLoaded=()=>{setLoading(false);};const spinnerStyle={border:\"3px solid #f3f3f300\",borderTop:\"3px solid #BBBBBB\",borderRadius:\"50%\",width:\"40px\",height:\"40px\",animation:loading?\"spin 1s linear infinite\":\"none\",marginTop:\"-40px\",position:\"absolute\",top:\"50%\",left:\"50%\"};const spinnerAnimation=`\n    @keyframes spin {\n      0% {\n        transform: rotate(0deg);\n      }\n      100% {\n        transform: rotate(360deg);\n      }\n    }\n  `;return /*#__PURE__*/_jsxs(\"div\",{style:{width:props.width==\"\"?\"auto\":props.width,height:props.height==\"\"?\"auto\":props.height,borderRadius:props.roundCorners?props.cornerRadius==\"\"?\"25px\":props.cornerRadius:\"0px\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\"},children:[/*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsx(\"style\",{children:spinnerAnimation}),/*#__PURE__*/_jsx(\"div\",{style:{display:loading?\"block\":\"none\"},children:/*#__PURE__*/_jsx(\"div\",{style:spinnerStyle})})]}),/*#__PURE__*/_jsx(\"img\",{src:imgSource,onError:handleImageError,onLoad:onLoaded,style:{width:props.needsWidth?\"100%\":null,height:\"100%\",objectFit:\"contain\",borderRadius:props.roundCorners?props.cornerRadius==\"\"?\"25px\":props.cornerRadius:\"0px\",opacity:imageError?0:1}})]});}function prepare(link,_slug,routeSlugs,folder,useThumbnail){var slug=_slug;if(slug==\"\"){slug=routeSlugs.slice(1,-1).split(\",\")[0].trim();}if(slug.startsWith(\"ru/\")){slug=slug.substring(3);}// Replace '-' with '_'\nif(folder==\"paris\"&&slug!=\"eiffel-tower\"){slug=slug.replace(/-/g,\"_\");}const urlParts=link.split(\"/\");const filenameWithExtension=urlParts[urlParts.length-1];const filenameParts=filenameWithExtension.split(\".\");const extension=filenameParts.pop();let filename=filenameParts.join(\".\");const hasRegularSuffix=filename.endsWith(\"_regular\");const hasThumbnailSuffix=filename.endsWith(\"_thumbnail\");// Remove any part of the filename after the first dot\nif(filename.includes(\".\")){filename=filename.split(\".\")[0];}if(hasRegularSuffix){filename=filename.slice(0,-8)// Remove \"_regular\"\n;}else if(hasThumbnailSuffix){filename=filename.slice(0,-10)// Remove \"_thumbnail\"\n;}const postfix=useThumbnail?\"_thumbnail\":\"_regular\";filename+=postfix;const folderPath=folder==\"\"?\"\":folder+\"/\";return`https://d2v34uqyvfxwo4.cloudfront.net/${folderPath}${slug}/${filename}.jpg`;}addPropertyControls(Remote_image,{image:{type:ControlType.String},height:{type:ControlType.String},width:{type:ControlType.String},slug:{type:ControlType.String},routeSlugs:{type:ControlType.String},folder:{type:ControlType.String},useThumbnail:{type:ControlType.Boolean},roundCorners:{type:ControlType.Boolean},cornerRadius:{type:ControlType.String},needsWidth:{type:ControlType.Boolean}});// Styles are written in object syntax\n// Learn more: https://reactjs.org/docs/dom-elements.html#style\nconst containerStyle={height:\"100%\",display:\"flex\",flexWrap:\"wrap\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Remote_image\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Remote_image.map"],
  "mappings": "uGAQkB,SAARA,EAA8BC,EAAM,CAG9C,IAAMC,EAAUC,EAAQF,EAAM,MAAMA,EAAM,KAAKA,EAAM,WAAWA,EAAM,OAAOA,EAAM,aAAaA,EAAM,YAAY,EAAO,CAACG,EAAWC,CAAa,EAAEC,EAAS,EAAK,EAAQC,EAAiB,IAAI,CAACF,EAAc,EAAI,CAAE,EAAO,CAACG,EAAQC,CAAU,EAAEH,EAAS,EAAI,EAAQI,EAAS,IAAI,CAACD,EAAW,EAAK,CAAE,EAAQE,EAAa,CAAC,OAAO,sBAAsB,UAAU,oBAAoB,aAAa,MAAM,MAAM,OAAO,OAAO,OAAO,UAAUH,EAAQ,0BAA0B,OAAO,UAAU,QAAQ,SAAS,WAAW,IAAI,MAAM,KAAK,KAAK,EAS7gB,OAAoBI,EAAM,MAAM,CAAC,MAAM,CAAC,MAAMX,EAAM,OAAO,GAAG,OAAOA,EAAM,MAAM,OAAOA,EAAM,QAAQ,GAAG,OAAOA,EAAM,OAAO,aAAaA,EAAM,aAAaA,EAAM,cAAc,GAAG,OAAOA,EAAM,aAAa,MAAM,QAAQ,OAAO,eAAe,SAAS,WAAW,SAAS,SAAS,QAAQ,EAAE,SAAS,CAAcW,EAAM,MAAM,CAAC,SAAS,CAAcC,EAAK,QAAQ,CAAC,SAT2L;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASlK,CAAC,EAAeA,EAAK,MAAM,CAAC,MAAM,CAAC,QAAQL,EAAQ,QAAQ,MAAM,EAAE,SAAsBK,EAAK,MAAM,CAAC,MAAMF,CAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAeE,EAAK,MAAM,CAAC,IAAIX,EAAU,QAAQK,EAA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AKA,EAAY,MAAM,EAAE,aAAa,CAAC,KAAKA,EAAY,OAAO,EAAE,aAAa,CAAC,KAAKA,EAAY,OAAO,EAAE,aAAa,CAAC,KAAKA,EAAY,MAAM,EAAE,WAAW,CAAC,KAAKA,EAAY,OAAO,CAAC,CAAC",
  "names": ["Remote_image", "props", "imgSource", "prepare", "imageError", "setImageError", "ye", "handleImageError", "loading", "setLoading", "onLoaded", "spinnerStyle", "u", "p", "link", "_slug", "routeSlugs", "folder", "useThumbnail", "slug", "urlParts", "filenameParts", "extension", "filename", "hasRegularSuffix", "hasThumbnailSuffix", "addPropertyControls", "ControlType"]
}
