{"version":3,"file":"Download_button.D9JMkFFA.mjs","names":[],"sources":["https:/framerusercontent.com/modules/DKVhtKF5mUzNR0u65b23/BNpE1EAZVR4dqJtaiCMT/Download_button.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}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,fontFamily,fontWeight,fontSize,color,paddingTop,paddingRight,paddingBottom,paddingLeft,borderRadius,icon,iconSize}=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__*/_jsxs(motion.div,{onTap:downloadFile,style:{margin:0,paddingTop:paddingTop,paddingRight:paddingRight,paddingBottom:paddingBottom,paddingLeft:paddingLeft,borderRadius:borderRadius,backgroundColor:tint,color:color,fontSize:`${fontSize}pt`,fontWeight:fontWeight,fontFamily:fontFamily,lineHeight:\"1em\",display:\"inline-flex\",justifyContent:\"center\",alignItems:\"center\",width:\"auto\",height:\"auto\",whiteSpace:\"nowrap\",boxSizing:\"border-box\",cursor:\"pointer\",gap:\"8px\"},children:[icon&&/*#__PURE__*/_jsx(\"img\",{src:icon,alt:\"Icon\",style:{width:iconSize,height:iconSize}}),title]})});}Download.defaultProps={tint:\"#09F\",title:\"Download\",downloadFileName:\"\",fontFamily:\"Inter, sans-serif\",fontWeight:\"bold\",fontSize:24,color:\"white\",paddingTop:12,paddingRight:12,paddingBottom:12,paddingLeft:12,borderRadius:20,iconSize:24};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:\"\"},fontFamily:{title:\"Font Family\",type:ControlType.String,defaultValue:\"Inter, sans-serif\"},fontWeight:{title:\"Font Weight\",type:ControlType.String,defaultValue:\"bold\"},fontSize:{title:\"Font Size (pt)\",type:ControlType.Number,defaultValue:24},color:{title:\"Font Color\",type:ControlType.Color,defaultValue:\"white\"},paddingTop:{title:\"Padding Top\",type:ControlType.Number,defaultValue:12},paddingRight:{title:\"Padding Right\",type:ControlType.Number,defaultValue:12},paddingBottom:{title:\"Padding Bottom\",type:ControlType.Number,defaultValue:12},paddingLeft:{title:\"Padding Left\",type:ControlType.Number,defaultValue:12},borderRadius:{title:\"Border Radius\",type:ControlType.Number,defaultValue:20},icon:{title:\"Icon\",type:ControlType.Image},iconSize:{title:\"Icon Size\",type:ControlType.Number,defaultValue:24}});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":"kOAEA,SAAwB,EAAS,EAAM,CAAC,GAAK,CAAC,QAAM,OAAK,QAAM,OAAK,mBAAiB,aAAW,aAAW,WAAS,QAAM,aAAW,eAAa,gBAAc,cAAY,eAAa,OAAK,YAAU,EAAY,MAAiB,CAAC,MAAM,EAAK,CAAC,KAAK,GAAU,EAAS,MAAM,CAAC,CAAC,KAAK,GAAM,CAAC,IAAM,EAAI,EAAO,IAAI,gBAAgB,EAAK,CAAO,EAAK,SAAS,cAAc,IAAI,CAAC,E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