{"version":3,"file":"FileDownload.CP2rmZjM.mjs","names":["useCallback"],"sources":["https:/framerusercontent.com/modules/E5w20RDyIuTSKMWTMSQ8/f9KSgB7xvL4r2JLTH5Xx/FileDownload.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useCallback}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * File Download Button\n *\n * A customizable download button component that downloads files with the specified filename.\n *\n * @framerIntrinsicWidth 280\n * @framerIntrinsicHeight 56\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function FileDownload(props){const{fileUrl=\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",displayText=\"Awards Nomination Form\",fileName=\"awards-nomination-form.pdf\",backgroundColor=\"#B93636\",textColor=\"#FFFFFF\",font,borderRadius=8,paddingX=24,paddingY=16}=props;const handleDownload=useCallback(async()=>{if(!fileUrl)return;try{// Fetch the file as blob to enable custom filename download\nconst response=await fetch(fileUrl);const blob=await response.blob();const blobUrl=window.URL.createObjectURL(blob);// Create an anchor element\nconst link=document.createElement(\"a\");link.href=blobUrl;link.download=fileName;document.body.appendChild(link);link.click();document.body.removeChild(link);// Clean up the blob URL\nwindow.URL.revokeObjectURL(blobUrl);}catch(error){// Fallback to direct download if fetch fails\nconst link=document.createElement(\"a\");link.href=fileUrl;link.download=fileName;document.body.appendChild(link);link.click();document.body.removeChild(link);}},[fileUrl,fileName]);return /*#__PURE__*/_jsxs(\"button\",{onClick:handleDownload,style:{...props.style,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:12,backgroundColor,color:textColor,border:\"none\",borderRadius,paddingLeft:paddingX,paddingRight:paddingX,paddingTop:paddingY,paddingBottom:paddingY,cursor:\"pointer\",width:\"100%\",height:\"100%\",transition:\"opacity 0.2s ease\"},onMouseEnter:e=>{e.currentTarget.style.opacity=\"0.9\";},onMouseLeave:e=>{e.currentTarget.style.opacity=\"1\";},\"aria-label\":`Download ${displayText}`,children:[/*#__PURE__*/_jsxs(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:textColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",style:{flexShrink:0},children:[/*#__PURE__*/_jsx(\"path\",{d:\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"}),/*#__PURE__*/_jsx(\"polyline\",{points:\"7 10 12 15 17 10\"}),/*#__PURE__*/_jsx(\"line\",{x1:\"12\",y1:\"15\",x2:\"12\",y2:\"3\"})]}),/*#__PURE__*/_jsx(\"span\",{style:{...font,whiteSpace:\"nowrap\",overflow:\"hidden\",textOverflow:\"ellipsis\"},children:displayText})]});}addPropertyControls(FileDownload,{fileUrl:{type:ControlType.File,title:\"File\",allowedFileTypes:[\"pdf\",\"doc\",\"docx\",\"txt\",\"jpg\",\"jpeg\",\"png\",\"gif\",\"webp\",\"svg\",\"mp4\",\"webm\",\"mov\",\"mp3\",\"wav\",\"ogg\"]},displayText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Awards Nomination Form\",placeholder:\"Enter button label...\"},fileName:{type:ControlType.String,title:\"Download Name\",defaultValue:\"awards-nomination-form.pdf\",placeholder:\"Enter filename for download...\",description:\"The exact filename users will see when downloading\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#B93636\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Medium\",letterSpacing:\"0em\",lineHeight:\"1.2em\"}},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:50,step:1,unit:\"px\"},paddingX:{type:ControlType.Number,title:\"Padding X\",defaultValue:24,min:8,max:60,step:4,unit:\"px\"},paddingY:{type:ControlType.Number,title:\"Padding Y\",defaultValue:16,min:8,max:40,step:4,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FileDownload\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"280\",\"framerIntrinsicHeight\":\"56\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FileDownload.map"],"mappings":"0LAUG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,UAAQ,sEAAsE,cAAY,yBAAyB,WAAS,6BAA6B,kBAAgB,UAAU,YAAU,UAAU,OAAK,eAAa,EAAE,WAAS,GAAG,WAAS,IAAI,EAIrH,OAAoB,EAAM,SAAS,CAAC,QAJ4GA,EAAY,SAAS,CAAK,KAAe,GAAG,CAC5U,IAAM,EAAK,MAAM,MAAhC,MAAM,CAAO,EAAA,CAA4B,KAAK,EAAQ,EAAQ,EAAO,IAAI,gBAAgB,CAAI,EAC5G,EAAK,SAAS,cAAc,GAAG,EAAE,EAAK,KAAK,EAAQ,EAAK,SAAS,EAAS,SAAS,KAAK,YAAY,CAAI,EAAE,EAAK,MAAM,EAAE,SAAS,KAAK,YAAY,CAAI,EAC3J,EAAO,IAAI,gBAAgB,CAAO,CAAE,MAAa,CACjD,IAAM,EAAK,SAAS,cAAc,GAAG,EAAE,EAAK,KAAK,EAAQ,EAAK,SAAS,EAAS,SAAS,KAAK,YAAY,CAAI,EAAE,EAAK,MAAM,EAAE,SAAS,KAAK,YAAY,CAAI,CAAE,CAAC,EAAE,CAAC,EAAQ,CAAQ,CAA4D,EAAE,MAAM,CAAC,GAAG,EAAM,MAAM,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,IAAI,GAAG,kBAAgB,MAAM,EAAU,OAAO,OAAO,eAAa,YAAY,EAAS,aAAa,EAAS,WAAW,EAAS,cAAc,EAAS,OAAO,UAAU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