{"version":3,"file":"PdfDownloadFallback.3YpAdutb.mjs","names":["__esmMin","init_jsx_runtime","J","init_npm_react_18_3_1","c","withPdfIfNoEmail","form","event","email","link","Component","props","init_PdfDownloadFallback"],"sources":["https:/framerusercontent.com/modules/3uMh3bjQugEkQYnY9Lmy/12H2ddr75jImfFlwvsOH/PdfDownloadFallback.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef}from\"react\";/**\n * Email-gated downloads: if the visitor clicks the download button without\n * typing an email, open the PDF straight away instead of blocking the form.\n * If an email is typed, the form submits as usual (with normal validation).\n * The PDF comes from the modal's \"Or download it now\" link (component control\n * \"Redirect link to PDF\"), so tracking on that link still fires.\n */export function withPdfIfNoEmail(Component){return /*#__PURE__*/forwardRef(function PdfIfNoEmail(props,ref){const onClickCapture=event=>{const target=event.target;const form=target?.closest?.(\"form\");if(!form)return;const email=form.querySelector('input[type=\"email\"], input[name=\"Email\"], input[name=\"email\"]');// No email field on screen (e.g. the \"ready\" state): do nothing.\nif(!email)return;if(email.value.trim()!==\"\")return;const scope=form.parentElement;const link=scope?.querySelector(\"a[href]\");if(!link)return;event.preventDefault();event.stopPropagation();link.click();};return /*#__PURE__*/_jsx(\"div\",{style:{display:\"contents\"},onClickCapture:onClickCapture,children:/*#__PURE__*/_jsx(Component,{...props,ref:ref})});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withPdfIfNoEmail\":{\"type\":\"reactHoc\",\"name\":\"withPdfIfNoEmail\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PdfDownloadFallback.map"],"mappings":"A,kHAMG,SAAgBK,EAAiB,EAAU,CAAC,MAAoB,gBAAW,SAAsB,EAAM,EAAI,CAC6F,MAAoB,gBAAK,MAAM,CAAC,MAAM,CAAC,QAAQ,UAAU,EAAiB,eADjJ,GAAO,CAA2B,IAAMC,EAAnBC,EAAM,QAA0B,UAAU,MAAM,EAAE,GAAG,CAACD,EAAK,OAAO,IAAME,EAAMF,EAAK,cAAc,+DAA+D,EACxS,GAAd,CAACE,GAAgBA,EAAM,MAAM,KAAK,IAAI,GAAG,OAAsC,IAAMC,EAAzBH,EAAK,eAAgC,cAAc,SAAS,EAAMG,IAAYF,EAAM,eAAe,EAAEA,EAAM,gBAAgB,EAAEE,EAAK,MAAM,EAAE,EAA2F,SAAsB,gBAAKC,EAAU,CAAC,GAAGC,EAAU,KAAG,CAAC,CAAC,CAAC,CAAE,CAAC,CAAE,C"}