{"version":3,"file":"DownloadButton_1.PyBVGdYz.mjs","names":[],"sources":["https:/framerusercontent.com/modules/Vnh1yNPH3kDLJhjISB2R/7uhdsDlc077X7vgKcP5I/DownloadButton_1.js"],"sourcesContent":["// Download button component with customizable file URL, filename, and button text\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Download Button\n *\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 50\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function DownloadButton(props){const{buttonText,fileUrl=\"https://framerusercontent.com/assets/8w3IUatLX9a5JVJ6XPCVuHi94.mp3\",fileName,backgroundColor,hoverBackgroundColor,textColor,borderRadius,buttonFont,showIcon,iconPosition,iconColor,iconSize,iconGap,style}=props;const handleDownload=async()=>{if(typeof window===\"undefined\")return;try{const response=await fetch(fileUrl);const blob=await response.blob();const url=window.URL.createObjectURL(blob);const link=document.createElement(\"a\");link.href=url;link.download=fileName;document.body.appendChild(link);link.click();document.body.removeChild(link);window.URL.revokeObjectURL(url);}catch(error){console.error(\"Failed to download file:\",error);}};const isFixedWidth=style&&style.width===\"100%\";return /*#__PURE__*/_jsxs(\"button\",{onClick:handleDownload,style:{...style,position:\"relative\",backgroundColor,color:textColor,border:\"none\",borderRadius,padding:\"12px 24px\",cursor:\"pointer\",transition:\"opacity 0.2s ease\",...buttonFont,...isFixedWidth?{}:{minWidth:\"max-content\"}},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=hoverBackgroundColor;},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=backgroundColor;},type:\"button\",children:[showIcon&&iconPosition===\"left\"&&/*#__PURE__*/_jsx(\"svg\",{style:{marginRight:iconGap,width:iconSize,height:iconSize},viewBox:\"0 0 256 256\",xmlns:\"http://www.w3.org/2000/svg\",fill:iconColor,children:/*#__PURE__*/_jsx(\"path\",{d:\"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V40a8,8,0,0,0-16,0v84.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z\"})}),buttonText,showIcon&&iconPosition===\"right\"&&/*#__PURE__*/_jsx(\"svg\",{style:{marginLeft:iconGap,width:iconSize,height:iconSize},viewBox:\"0 0 256 256\",xmlns:\"http://www.w3.org/2000/svg\",fill:iconColor,children:/*#__PURE__*/_jsx(\"path\",{d:\"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V40a8,8,0,0,0-16,0v84.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z\"})})]});}addPropertyControls(DownloadButton,{buttonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Download File\"},fileUrl:{type:ControlType.File,title:\"File\",allowedFileTypes:[\"pdf\",\"doc\",\"docx\",\"txt\",\"jpg\",\"jpeg\",\"png\",\"gif\",\"webp\",\"svg\",\"mp4\",\"webm\",\"mov\",\"mp3\",\"wav\",\"ogg\",\"zip\",\"rar\"]},fileName:{type:ControlType.String,title:\"File Name\",defaultValue:\"download.mp3\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},hoverBackgroundColor:{type:ControlType.Color,title:\"Hover Background\",defaultValue:\"#333333\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:50,step:1,unit:\"px\"},buttonFont:{type:ControlType.Font,title:\"Button Font\",defaultValue:{variant:\"Semibold\",fontSize:\"14px\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},showIcon:{type:ControlType.Boolean,title:\"Show Icon\",defaultValue:true},iconPosition:{type:ControlType.Enum,title:\"Icon Position\",options:[\"left\",\"right\"],defaultValue:\"right\"},iconColor:{type:ControlType.Color,title:\"Icon Color\",defaultValue:\"#FFFFFF\"},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:16,min:8,max:32,step:1,unit:\"px\"},iconGap:{type:ControlType.Number,title:\"Icon Gap\",defaultValue:8,min:0,max:32,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DownloadButton\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"50\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"200\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DownloadButton_1.map"],"mappings":"kLASG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,aAAW,UAAQ,qEAAqE,WAAS,kBAAgB,uBAAqB,YAAU,eAAa,aAAW,WAAS,eAAa,YAAU,WAAS,UAAQ,SAAO,EAAY,EAAe,SAAS,CAAI,GAAO,IAAS,OAAmB,GAAG,CAAqC,IAAM,EAAK,MAAhC,MAAM,MAAM,EAAQ,EAA2B,MAAM,CAAO,EAAI,EAAO,IAAI,gBAAgB,EAAK,CAAO,EAAK,SAAS,cAAc,IAAI,CAAC,EAAK,KAAK,EAAI,EAAK,SAAS,EAAS,SAAS,KAAK,YAAY,EAAK,CAAC,EAAK,OAAO,CAAC,SAAS,KAAK,YAAY,EAAK,CAAC,EAAO,IAAI,gBAAgB,EAAI,OAAQ,EAAM,CAAC,QAAQ,MAAM,2BAA2B,EAAM,GAAU,EAAa,GAAO,EAAM,QAAQ,OAAO,OAAoB,EAAM,SAAS,CAAC,QAAQ,EAAe,MAAM,CAAC,GAAG,EAAM,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