{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/iBuyssgagIHWn7bOJDYh/TcZnxvJvbfLMM12fz4gV/Download_Button.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";// Learn more: https://www.framer.com/docs/guides/overrides/\n// By Vinaykumar C (www.linkedin.com/in/vinay-sc)\nexport default function Download(props){const{title,tint,style,file,downloadFileName}=props;const downloadFile=()=>{fetch(file).then(response=>response.blob()).then(blob=>{const url=window.URL.createObjectURL(blob);const link=document.createElement(\"a\");link.href=url;link.download=downloadFileName||getFileNameFromUrl(file)||\"download\";document.body.appendChild(link);link.click();document.body.removeChild(link);window.URL.revokeObjectURL(url);}).catch(error=>{console.error(\"Error downloading the file:\",error);});};return /*#__PURE__*/_jsx(motion.div,{style:{...style,...containerStyle},children:/*#__PURE__*/_jsx(motion.div,{onTap:downloadFile,style:{margin:0,padding:15,borderRadius:40,backgroundColor:tint,color:\"white\",fontSize:\"16px\",fontWeight:\"bold\",width:\"100%\",height:\"100%\"},whileHover:{scale:1.01},children:title})});}Download.defaultProps={tint:\"#09F\",title:\"Download\",downloadFileName:\"\"};addPropertyControls(Download,{tint:{title:\"Tint\",type:ControlType.Color},title:{title:\"Label\",type:ControlType.String},file:{title:\"File\",type:ControlType.File,allowedFileTypes:[]},downloadFileName:{title:\"Download File Name\",type:ControlType.String,defaultValue:\"\"}});const containerStyle={display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\"};function getFileNameFromUrl(url){const decodedUrl=decodeURIComponent(url);const parts=decodedUrl.split(\"/\");return parts[parts.length-1];}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Download\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Download_Button.map"],
  "mappings": "qJAAAA,IAEe,SAARC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EAAe,CAAC,QAAQ,OAAO,eAAe,SAAS,WAAW,SAAS,SAAS,QAAQ,EAAE,SAASJ,EAAmBF,EAAI,CAA0C,IAAMS,EAA9B,mBAAmBT,CAAG,EAAyB,MAAM,GAAG,EAAE,OAAOS,EAAMA,EAAM,OAAO,CAAC,CAAE",
  "names": ["init_ssg_sandbox_shims", "Download", "props", "title", "tint", "style", "file", "downloadFileName", "downloadFile", "response", "blob", "url", "link", "getFileNameFromUrl", "error", "p", "motion", "containerStyle", "addPropertyControls", "ControlType", "parts"]
}
