{"version":3,"file":"PDFButton.BE3L6CuQ.mjs","names":["useState","useCallback","startTransition"],"sources":["https:/framerusercontent.com/modules/elldCHrBrXsTJNmko81q/EwIXonQVdZWizd5bnpc7/PDFButton.js"],"sourcesContent":["// Customizable PDF Button for Framer\n// - Open PDF in new tab or download\n// - Choose viewer (browser, Google Drive, or download)\n// - Style hover, color, and font\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useCallback,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Customizable PDF Button\n *\n * @framerIntrinsicWidth 180\n * @framerIntrinsicHeight 48\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function PDFButton(props){const{label,pdfFile=\"https://framerusercontent.com/assets/MLWPbW1dUQawJLhhun3dBwpgJak.mp4\",action,backgroundColor,hoverColor,textColor,font,borderRadius,style}=props;const[isHover,setIsHover]=useState(false);const handleClick=useCallback(e=>{if(!pdfFile)return;if(action===\"open\"){window.open(pdfFile,\"_blank\",\"noopener,noreferrer\");}else if(action===\"google\"){const url=`https://drive.google.com/viewerng/viewer?embedded=true&url=${encodeURIComponent(pdfFile)}`;window.open(url,\"_blank\",\"noopener,noreferrer\");}else if(action===\"download\"){const link=document.createElement(\"a\");link.href=pdfFile;link.download=pdfFile.split(\"/\").pop()||\"file.pdf\";document.body.appendChild(link);link.click();document.body.removeChild(link);}},[pdfFile,action]);return /*#__PURE__*/_jsx(\"button\",{type:\"button\",style:{...style,width:\"100%\",height:\"100%\",background:isHover?hoverColor:backgroundColor,color:textColor,border:`${props.strokeWidth}px solid ${props.strokeColor}`,borderRadius,cursor:\"pointer\",transition:\"background 0.18s cubic-bezier(.4,0,.2,1)\",outline:\"none\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",...font},onMouseEnter:()=>startTransition(()=>setIsHover(true)),onMouseLeave:()=>startTransition(()=>setIsHover(false)),onClick:handleClick,\"aria-label\":label,children:label});}addPropertyControls(PDFButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Open PDF\"},pdfFile:{type:ControlType.File,allowedFileTypes:[\"pdf\"]},action:{type:ControlType.Enum,title:\"Action\",options:[\"open\",\"google\",\"download\"],optionTitles:[\"Open in Tab\",\"Google Viewer\",\"Download\"],defaultValue:\"open\",displaySegmentedControl:true},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#111111\"},hoverColor:{type:ControlType.Color,title:\"Hover\",defaultValue:\"#222222\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#FFFFFF\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:32},strokeColor:{type:ControlType.Color,title:\"Stroke Color\",defaultValue:\"#222222\"},strokeWidth:{type:ControlType.Number,title:\"Stroke Width\",defaultValue:1,min:0,max:8}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PDFButton\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"180\",\"framerIntrinsicHeight\":\"48\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PDFButton.map"],"mappings":"iMAYG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,QAAM,UAAQ,uEAAuE,SAAO,kBAAgB,aAAW,YAAU,OAAK,eAAa,SAAO,EAAW,CAAC,EAAQ,GAAYA,EAAS,GAAM,CAAO,EAAYC,EAAY,GAAG,CAAK,KAAe,IAAG,IAAS,OAAQ,EAAO,KAAK,EAAQ,SAAS,sBAAsB,SAAU,IAAS,SAAS,CAAC,IAAM,EAAI,8DAA8D,mBAAmB,EAAQ,GAAG,EAA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