{"version":3,"file":"DownloadButton_1.C1offo7X.mjs","names":["__esmMin","window","init_ssg_sandbox_shims","init_jsx_runtime","c","p","init_framer_CaDWdxiz","addPropertyControls","ControlType","DownloadButton","props","handleDownload","blob","fileUrl","url","link","fileName","error","isFixedWidth","style","textColor","buttonFont","hoverBackgroundColor","backgroundColor","showIcon","iconPosition","iconGap","iconSize","iconColor","buttonText","init_DownloadButton_1"],"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":"A,iLASG,SAAwBS,EAAe,EAAM,CAAC,GAAK,CAAC,aAAW,UAAQ,qEAAqE,WAAS,kBAAgB,uBAAqB,YAAU,eAAa,aAAW,WAAS,eAAa,YAAU,WAAS,UAAQ,SAAOC,EAAYC,EAAe,SAAS,CAAC,GAAUV,IAAS,OAAmB,GAAG,CAAqC,IAAMW,EAAK,MAAM,MAAhC,MAAMC,CAAO,EAAA,CAA4B,KAAK,EAAQC,EAAIb,EAAO,IAAI,gBAAgBW,CAAI,EAAQG,EAAK,SAAS,cAAc,GAAG,EAAE,EAAK,KAAKD,EAAI,EAAK,SAASE,EAAS,SAAS,KAAK,YAAYD,C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