{"version":3,"file":"PdfViewerButton.Bwv6X01e.mjs","names":[],"sources":["https:/framerusercontent.com/modules/jXq7KJ6XkHAHMTxOZfkP/8guzxfpWBYYRtQqRaNY8/PdfUploader.js","https:/framerusercontent.com/modules/aM3kBZBqPtiw9tk28UHt/8cKBqX9YpdUUUF9UZSSB/PdfViewerButton.js"],"sourcesContent":["// PDF download button with customizable filename\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function PdfUploader(props){const{pdfFile=\"https://framerusercontent.com/assets/sample.pdf\",fileName,buttonText,backgroundColor,textColor,borderRadius,padding,font,showIcon,iconColor,style}=props;const handleDownload=()=>{if(typeof window!==\"undefined\"){// Récupérer le fichier et forcer le nom personnalisé\nfetch(pdfFile).then(response=>response.blob()).then(blob=>{const url=window.URL.createObjectURL(blob);const link=document.createElement(\"a\");link.href=url;link.download=fileName||\"document.pdf\";document.body.appendChild(link);link.click();document.body.removeChild(link);window.URL.revokeObjectURL(url);}).catch(error=>{console.error(\"Erreur lors du t\\xe9l\\xe9chargement:\",error);// Fallback vers la méthode simple\nconst link=document.createElement(\"a\");link.href=pdfFile;link.download=fileName||\"document.pdf\";document.body.appendChild(link);link.click();document.body.removeChild(link);});}};const isFixedWidth=style&&style.width===\"100%\";return /*#__PURE__*/_jsxs(\"button\",{onClick:handleDownload,style:{...style,...isFixedWidth?{}:{width:\"max-content\"},backgroundColor,color:textColor,border:\"none\",borderRadius,padding:`${padding}px ${padding*1.5}px`,cursor:\"pointer\",display:\"flex\",alignItems:\"center\",gap:showIcon?\"8px\":\"0\",transition:\"all 0.2s ease\",...font},onMouseEnter:e=>{e.currentTarget.style.opacity=\"0.9\";e.currentTarget.style.transform=\"translateY(-1px)\";},onMouseLeave:e=>{e.currentTarget.style.opacity=\"1\";e.currentTarget.style.transform=\"translateY(0)\";},onMouseDown:e=>{e.currentTarget.style.transform=\"translateY(0)\";},\"aria-label\":`T\\xe9l\\xe9charger ${fileName||\"document.pdf\"}`,children:[showIcon&&/*#__PURE__*/_jsxs(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:iconColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",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\"})]}),buttonText]});}addPropertyControls(PdfUploader,{pdfFile:{type:ControlType.File,title:\"Fichier PDF\",allowedFileTypes:[\"pdf\"]},fileName:{type:ControlType.String,title:\"Nom du fichier\",defaultValue:\"document.pdf\",placeholder:\"document.pdf\"},buttonText:{type:ControlType.String,title:\"Texte du bouton\",defaultValue:\"T\\xe9l\\xe9charger PDF\"},backgroundColor:{type:ControlType.Color,title:\"Couleur de fond\",defaultValue:\"#000000\"},textColor:{type:ControlType.Color,title:\"Couleur du texte\",defaultValue:\"#FFFFFF\"},borderRadius:{type:ControlType.Number,title:\"Rayon des coins\",defaultValue:8,min:0,max:32,unit:\"px\"},padding:{type:ControlType.Number,title:\"Espacement\",defaultValue:12,min:4,max:32,unit:\"px\"},font:{type:ControlType.Font,title:\"Police\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},showIcon:{type:ControlType.Boolean,title:\"Afficher l'ic\\xf4ne\",defaultValue:true,enabledTitle:\"Oui\",disabledTitle:\"Non\"},iconColor:{type:ControlType.Color,title:\"Couleur de l'ic\\xf4ne\",defaultValue:\"#FFFFFF\",hidden:({showIcon})=>!showIcon}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PdfUploader\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PdfUploader.map","// PDF Viewer Button - Opens uploaded PDF in modal overlay without navigating to new page\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * PDF Viewer Button\n * \n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 50\n * \n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function PdfViewerButton(props){const{label,pdfFile=\"https://framerusercontent.com/assets/sample.pdf\",buttonColor,buttonTextColor,buttonFont,borderRadius}=props;const openPDF=()=>{if(typeof window!==\"undefined\"&&pdfFile){// Try multiple approaches to force PDF viewing in browser\nconst pdfUrl=pdfFile+\"#view=FitH&toolbar=1&navpanes=1\";// First try: Open with PDF.js viewer if available\ntry{const viewerUrl=`https://mozilla.github.io/pdf.js/web/viewer.html?file=${encodeURIComponent(pdfFile)}`;window.open(viewerUrl,\"_blank\");}catch(error){// Fallback: Try direct URL with PDF parameters\nwindow.open(pdfUrl,\"_blank\");}}};const isFixedWidth=props?.style&&props.style.width===\"100%\";return /*#__PURE__*/_jsx(\"button\",{onClick:openPDF,style:{...props.style,...isFixedWidth?{...props?.style}:{minWidth:\"max-content\"},background:buttonColor,color:buttonTextColor,border:\"none\",borderRadius,padding:\"12px 24px\",cursor:\"pointer\",transition:\"all 0.2s ease\",...buttonFont},onMouseEnter:e=>{e.currentTarget.style.opacity=\"0.9\";e.currentTarget.style.transform=\"translateY(-1px)\";},onMouseLeave:e=>{e.currentTarget.style.opacity=\"1\";e.currentTarget.style.transform=\"translateY(0)\";},onMouseDown:e=>{e.currentTarget.style.transform=\"translateY(0)\";},onMouseUp:e=>{e.currentTarget.style.transform=\"translateY(-1px)\";},\"aria-label\":`Ouvrir le PDF: ${label}`,children:label});}addPropertyControls(PdfViewerButton,{label:{type:ControlType.String,title:\"Texte du bouton\",defaultValue:\"Voir le PDF\"},pdfFile:{type:ControlType.File,title:\"Fichier PDF\",allowedFileTypes:[\"pdf\"]},buttonColor:{type:ControlType.Color,title:\"Couleur du bouton\",defaultValue:\"#000000\"},buttonTextColor:{type:ControlType.Color,title:\"Couleur du texte\",defaultValue:\"#FFFFFF\"},buttonFont:{type:ControlType.Font,title:\"Police du bouton\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},borderRadius:{type:ControlType.Number,title:\"Arrondi\",defaultValue:8,min:0,max:32,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PdfViewerButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"200\",\"framerIntrinsicHeight\":\"50\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PdfViewerButton.map"],"mappings":"iLAIG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,UAAQ,kDAAkD,WAAS,aAAW,kBAAgB,YAAU,eAAa,UAAQ,OAAK,WAAS,YAAU,SAAO,EAAY,MAAmB,CAAW,IAAS,QACnQ,MAAM,EAAQ,CAAC,KAAK,GAAU,EAAS,MAAM,CAAC,CAAC,KAAK,GAAM,CAAC,IAAM,EAAI,EAAO,IAAI,gBAAgB,EAAK,CAAO,EAAK,SAAS,cAAc,IAAI,CAAC,EAAK,KAAK,EAAI,EAAK,SAAS,GAAU,eAAe,SAAS,KAAK,YAAY,EAAK,CAAC,EAAK,OAAO,CAAC,SAAS,KAAK,YAAY,EAAK,CAAC,EAAO,IAAI,gBAAgB,EAAI,EAAG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