{"version":3,"file":"HubSpotReportDownloadForm.II6-zAFZ.mjs","names":["React.forwardRef","React.useRef","React.useState","React.useCallback","React.useMemo"],"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":"kUAC0C,IAAsE,IAA4B,EAAqC,EAAK,krBAA0rB,EAAiB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,WAAS,GAAG,GAAM,EA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