{"version":3,"file":"FileDownloadButton.D_E2rbrA.mjs","names":["blobUrl"],"sources":["https:/framerusercontent.com/modules/Az0Aw1M6pTfeiPGinvEM/FVtP8w878W53pUu4Mzdo/FileDownloadButton.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";import{useState,useEffect}from\"react\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function FileDownloadButton(props){const[blobUrl,setBlobUrl]=useState(null);const initializeBlob=async()=>{const response=await fetch(props.file);const blob=await response.blob();const blobUrl=URL.createObjectURL(blob);setBlobUrl(blobUrl);};useEffect(()=>{initializeBlob();},[props.file]);let button=/*#__PURE__*/_jsx(\"a\",{href:blobUrl,download:`${props.fileName||\"download\"}.pdf`,style:{backgroundColor:props.fill,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:\"max-content\",textDecoration:\"none\",userSelect:\"none\",color:props.fontColor,cursor:props.pointerCursor?\"pointer\":\"auto\",padding:props.paddingIsMixed?`${props.paddingTopLeft}px ${props.paddingTopRight}px ${props.paddingBottomRight}px ${props.paddingBottomLeft}px`:`${props.padding}px`,borderRadius:props.radiusIsMixed?`${props.radiusTopLeft}px ${props.radiusTopRight}px ${props.radiusBottomRight}px ${props.radiusBottomLeft}px`:`${props.radius}px`,border:props.border||\"1px solid #0076D6\",...props.font,...props.style},children:props.text});let buttonLayer=button;if(props.effects){buttonLayer=/*#__PURE__*/_jsx(motion.div,{whileHover:{scale:props.effects.hoverScale},whileTap:{scale:props.effects.pressScale},initial:false,transition:props.effects.transition,style:{...props.style},children:button});}return buttonLayer;}FileDownloadButton.displayName=\"File Download Button\";const effectsDefault={hoverScale:1.1,pressScale:.9};addPropertyControls(FileDownloadButton,{file:{type:ControlType.File,allowedFileTypes:[],description:\"Up to 50MB\"},fileName:{type:ControlType.String,placeholder:\"File\"},text:{type:ControlType.String,defaultValue:\"Download\"},fill:{type:ControlType.Color,defaultValue:\"#EDEDED\",optional:true},fontColor:{type:ControlType.Color,defaultValue:\"#000\"},font:{type:\"font\",controls:\"extended\"},padding:{type:ControlType.FusedNumber,defaultValue:12,toggleKey:\"paddingIsMixed\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"paddingTopLeft\",\"paddingTopRight\",\"paddingBottomRight\",\"paddingBottomLeft\"],valueLabels:[\"T\",\"R\",\"B\",\"L\"],min:0},radius:{type:ControlType.FusedNumber,defaultValue:8,toggleKey:\"radiusIsMixed\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"radiusTopLeft\",\"radiusTopRight\",\"radiusBottomRight\",\"radiusBottomLeft\"],valueLabels:[\"TL\",\"TR\",\"BR\",\"BL\"],min:0},pointerCursor:{type:ControlType.Boolean,defaultValue:true},effects:{type:ControlType.Object,defaultValue:effectsDefault,optional:true,buttonTitle:\"Hover & Press\",icon:\"effect\",controls:{hoverScale:{type:ControlType.Number,defaultValue:effectsDefault.hoverScale,min:0,step:.01,displayStepper:true},pressScale:{type:ControlType.Number,defaultValue:effectsDefault.pressScale,min:0,step:.01,displayStepper:true},transition:{type:ControlType.Transition}}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FileDownloadButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FileDownloadButton.map"],"mappings":"0VAGG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,EAAQ,EAAW,CAAC,EAAS,KAAK,CAAO,EAAe,SAAS,CAAC,IAAM,EAAS,KAAM,OAAM,EAAM,KAAK,CAAO,EAAK,KAAM,GAAS,MAAM,CAAOA,EAAQ,IAAI,gBAAgB,EAAK,CAAC,EAAWA,EAAQ,AAAE,EAAC,EAAU,IAAI,CAAC,GAAgB,AAAE,EAAC,CAAC,E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