{"version":3,"file":"HubSpotReportDownloadForm.DcAPfF2B.mjs","names":["React.forwardRef","React.useRef","React.useState","React.useCallback","React.useMemo","__esmMin","ne","init_ssg_sandbox_shims","init_npm_react_18_3_1","te","window","pe","ce","J","c","p","_e","de","motion","addPropertyControls","withCSS","ControlType","cx","useIsStaticRenderer","init_framer_CaDWdxiz","mask","SVG","getProps","Icon","init_YW4GE5nV0","init_jsx_runtime","rest","props","animated","stroke","restProps","className","UO5clYVeQ","style","loadHubSpotScript","resolve","existingScript","reject","script","HubSpotReportDownloadForm","containerRef","pendingReportTabRef","errorMessage","setErrorMessage","isSubmitted","setIsSubmitted","isStaticRenderer","openPendingReportTab","pendingTab","handleSuccessfulSubmission","downloadUrl","hubSpotConfig","portalId","formId","region","isCancelled","targetId","target","successMessage","error","init_HubSpotReportDownloadForm"],"sources":["https:/framerusercontent.com/modules/29Eu6tDVcWIZwJL1Nh4h/zpJg2oiOBazkQeZJNCYy/YW4GE5nV0.js","https:/framerusercontent.com/modules/Ru82sWi43p64g568tqDh/xPYGJ8Y7MhFDgfLdZzI1/HubSpotReportDownloadForm.js"],"sourcesContent":["// Generated by Framer (6ca5d98)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask='url(\\'data:image/svg+xml,<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 12 0 L 0 12\" fill=\"transparent\" height=\"12px\" id=\"JuEqmLwI0\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" stroke=\"var(--43q7um, rgb(0,0,0))\" transform=\"translate(6 6)\" width=\"12px\"/><path d=\"M 0 0 L 12 12\" fill=\"transparent\" height=\"12px\" id=\"aEN6gG6Cz\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" stroke=\"var(--43q7um, rgb(0,0,0))\" transform=\"translate(6 6)\" width=\"12px\"/></svg>\\') alpha no-repeat center / auto var(--framer-icon-mask-mode, add), var(--framer-icon-mask, none)';const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(motion.div,{...rest,layoutId:layoutId,ref:ref}):/*#__PURE__*/_jsx(\"div\",{...rest,ref:ref});});const getProps=({height,id,stroke,width,...props})=>{return{...props,UO5clYVeQ:stroke??props.UO5clYVeQ??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,UO5clYVeQ,...restProps}=getProps(props);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-Howa8\",className),layoutId:layoutId,ref:ref,style:{\"--43q7um\":UO5clYVeQ,...style}});});const css=[`.framer-Howa8 { -webkit-mask: ${mask}; aspect-ratio: 1; background-color: var(--43q7um); mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"UO5clYVeQ\":\"stroke\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"X\",\"color\":{\"type\":\"variable\",\"value\":\"43q7um\"},\"set\":{\"localId\":\"vectorSet/T8qKXkLfy\",\"id\":\"T8qKXkLfy\",\"moduleId\":\"fiHEoJwBMFnT6QLOcpPz\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-Howa8\");Icon.displayName=\"X\";export default Icon;addPropertyControls(Icon,{UO5clYVeQ:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Stroke\",type:ControlType.Color}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerVector\":\"{\\\"name\\\":\\\"X\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"43q7um\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/T8qKXkLfy\\\",\\\"id\\\":\\\"T8qKXkLfy\\\",\\\"moduleId\\\":\\\"fiHEoJwBMFnT6QLOcpPz\\\"}}\",\"framerIntrinsicWidth\":\"24\",\"framerVariables\":\"{\\\"UO5clYVeQ\\\":\\\"stroke\\\"}\",\"framerDisableUnlink\":\"true\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"24\",\"framerImmutableVariables\":\"true\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// User request: Create a new self-contained Framer code component named HubSpotReportDownloadForm to replace the current HubSpot embed inside a centered popup. It must load HubSpot’s v2 forms script safely, render the form using portalId 5275236, formId 58406367-677c-4862-9bfc-e2fe923a9eea, region na2, and on a successful HubSpot form submission automatically trigger a download of https://assets.coingecko.com/reports/2026/Tokenized-Equities-Report-Aug-2026.pdf. Use HubSpot’s supported form success callback/event rather than polling. Keep the component responsive: width fills its parent, height naturally follows the form, and it must not clip validation messages. Expose portalId, formId, region, downloadUrl, and downloadFileName as editable controls. Avoid hardcoded page styling; the surrounding Framer modal supplies the surface and padding. Return a code component, not an override.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";function loadHubSpotScript(){return new Promise((resolve,reject)=>{if(typeof window===\"undefined\"){resolve();return;}if(window.hbspt?.forms?.create){resolve();return;}const existingScript=document.querySelector('script[src=\"https://js.hsforms.net/forms/embed/v2.js\"]');if(existingScript){if(window.hbspt?.forms?.create){resolve();return;}existingScript.addEventListener(\"load\",()=>resolve(),{once:true});existingScript.addEventListener(\"error\",()=>reject(new Error(\"Failed to load HubSpot forms script.\")),{once:true});return;}const script=document.createElement(\"script\");script.src=\"https://js.hsforms.net/forms/embed/v2.js\";script.async=true;script.defer=true;script.addEventListener(\"load\",()=>resolve(),{once:true});script.addEventListener(\"error\",()=>reject(new Error(\"Failed to load HubSpot forms script.\")),{once:true});document.head.appendChild(script);});}/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function HubSpotReportDownloadForm(props){const{portalId,formId,region,downloadUrl,successMessage}=props;const containerRef=React.useRef(null);const pendingReportTabRef=React.useRef(null);const[errorMessage,setErrorMessage]=React.useState(\"\");const[isSubmitted,setIsSubmitted]=React.useState(false);const isStaticRenderer=useIsStaticRenderer();const openPendingReportTab=React.useCallback(()=>{if(typeof window===\"undefined\")return;const pendingTab=window.open(\"about:blank\",\"_blank\");if(pendingTab){try{pendingTab.opener=null;}catch{// Ignore if the browser blocks changing opener.\n}}pendingReportTabRef.current=pendingTab;},[]);const handleSuccessfulSubmission=React.useCallback(()=>{if(typeof window===\"undefined\")return;const pendingTab=pendingReportTabRef.current;if(pendingTab&&!pendingTab.closed){try{pendingTab.location.href=downloadUrl;}catch{window.open(downloadUrl,\"_blank\");}pendingReportTabRef.current=null;}else{window.open(downloadUrl,\"_blank\");}React.startTransition(()=>{setIsSubmitted(true);});},[downloadUrl]);const hubSpotConfig=React.useMemo(()=>({portalId,formId,region}),[portalId,formId,region]);React.useEffect(()=>{if(isStaticRenderer)return;if(typeof window===\"undefined\")return;if(!containerRef.current)return;if(isSubmitted)return;let isCancelled=false;containerRef.current.innerHTML=\"\";loadHubSpotScript().then(()=>{if(isCancelled||!containerRef.current)return;if(!window.hbspt?.forms?.create){React.startTransition(()=>{setErrorMessage(\"HubSpot forms API is unavailable.\");});return;}React.startTransition(()=>{setErrorMessage(\"\");});const targetId=`hubspot-form-${Math.random().toString(36).slice(2)}`;const target=document.createElement(\"div\");target.id=targetId;containerRef.current.appendChild(target);window.hbspt.forms.create({...hubSpotConfig,target:`#${targetId}`,redirectUrl:\"\",inlineMessage:successMessage,onFormSubmit:()=>{openPendingReportTab();},onFormSubmitted:()=>{handleSuccessfulSubmission();}});}).catch(error=>{if(isCancelled)return;React.startTransition(()=>{setErrorMessage(error.message||\"Unable to load form.\");});});return()=>{isCancelled=true;if(containerRef.current){containerRef.current.innerHTML=\"\";}const pendingTab=pendingReportTabRef.current;if(pendingTab&&!pendingTab.closed){pendingTab.close();}pendingReportTabRef.current=null;};},[hubSpotConfig,isStaticRenderer,handleSuccessfulSubmission,openPendingReportTab,isSubmitted,successMessage]);if(isStaticRenderer){return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"auto\",overflow:\"visible\"},children:/*#__PURE__*/_jsx(\"div\",{children:\"HubSpot form will render in preview/published mode.\"})});}return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"auto\",overflow:\"visible\"},children:[isSubmitted?/*#__PURE__*/_jsx(\"div\",{role:\"status\",\"aria-live\":\"polite\",style:{width:\"100%\",marginTop:20,textAlign:\"center\",color:\"#344054\",fontFamily:\"Inter, sans-serif\",fontSize:16,fontWeight:400,lineHeight:1.35},children:successMessage}):/*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{width:\"100%\",overflow:\"visible\"}}),errorMessage?/*#__PURE__*/_jsx(\"div\",{role:\"status\",\"aria-live\":\"polite\",style:{marginTop:8},children:errorMessage}):null]});}addPropertyControls(HubSpotReportDownloadForm,{portalId:{type:ControlType.String,title:\"Portal ID\",defaultValue:\"5275236\"},formId:{type:ControlType.String,title:\"Form ID\",defaultValue:\"58406367-677c-4862-9bfc-e2fe923a9eea\"},region:{type:ControlType.String,title:\"Region\",defaultValue:\"na2\"},downloadUrl:{type:ControlType.String,title:\"Download URL\",defaultValue:\"https://assets.coingecko.com/reports/2026/Tokenized-Equities-Report-Aug-2026.pdf\"},downloadFileName:{type:ControlType.String,title:\"File Name\",defaultValue:\"Tokenized-Equities-Report-Aug-2026.pdf\"},successMessage:{type:ControlType.String,title:\"Success Message\",defaultValue:\"Thanks for your interest. Your report will open in a new tab.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HubSpotReportDownloadForm\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HubSpotReportDownloadForm.map"],"mappings":"A,2VACiL,EAAK,krBAA0rB,EAAiB,iBAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,WAAS,GAAG+B,GAAMC,EAAM,OAAOC,EAAsB,gBAAKf,EAAO,IAAI,CAAC,GAAGa,EAAc,WAAa,KAAG,CAAC,EAAe,gBAAK,MAAM,CAAC,GAAGA,EAAS,KAAG,CAAC,CAAE,CAAC,EAAQ,GAAU,CAAC,SAAO,KAAG,SAAO,QAAM,GAAGC,MAAgB,CAAC,GAAGA,EAAM,UAAUE,GAAQF,EAAM,WAAW,cAAc,GAUvrC,EAAKZ,EAVmtCpB,kBAAiB,SAAS,EAAM,EAAI,CAAC,GAAK,CAAC,QAAM,YAAU,WAAS,UAAQ,YAAU,GAAGmC,GAAWR,EAASK,CAAK,EAAE,MAAoB,gBAAKN,EAAI,CAAC,GAAGS,EAAU,UAAUb,EAAG,eAAec,CAAS,EAAW,WAAa,MAAI,MAAM,CAAC,WAAWC,EAAU,GAAGC,CAAK,CAAC,CAAC,CAAE,CAU38C,EAAE,CAVu9C,iCAAiCb,EAAK,4DAA4DA,EAAK,iBAU5jD,EAAE,cAAc,EAAE,EAAK,YAAY,IAAwBN,EAAoBS,EAAK,CAAC,UAAU,CAAC,aAAa,eAAe,OAAO,GAAM,MAAM,SAAS,KAAKP,EAAY,KAAK,CAAC,CAAC,C,OCVrD,SAASkB,GAAmB,CAAC,OAAO,IAAI,SAAS,EAAQ,IAAS,CAAmD,GAAxC7B,IAAS,QAAkCA,EAA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