{"version":3,"file":"FileDownloadButton_3.CMhtrGCB.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/PbDbDAjACLxxQBKfD0ft/h1uB4W3Oufe47lWSIRTA/FileDownloadButton_3.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 PDFDownloadButton(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();},[]);// Automatically add .pdf if it doesn't exist\nconst getFileName=()=>{if(!props.fileName)return\"File.pdf\";const fileName=props.fileName.trim();return fileName.toLowerCase().endsWith(\".pdf\")?fileName:`${fileName}.pdf`;};let button=/*#__PURE__*/_jsx(\"a\",{href:blobUrl,download:getFileName(),style:{backgroundColor:props.fill,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:\"100%\",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`,...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;}PDFDownloadButton.displayName=\"PDF Download Button\";const effectsDefault={hoverScale:1.1,pressScale:.9};addPropertyControls(PDFDownloadButton,{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\":\"PDFDownloadButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FileDownloadButton_3.map"],"mappings":"kOAGG,SAAwB,EAAkB,EAAM,CAAC,GAAK,CAAC,EAAQ,GAAYA,EAAS,KAAK,CAAO,EAAe,SAAS,CAAwC,IAAM,EAAK,MAAnC,MAAM,MAAM,EAAM,KAAK,EAA2B,MAAM,CAAyC,EAA1B,IAAI,gBAAgB,EA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