{"version":3,"file":"HS_form.BKk-RmDc.mjs","names":["useRef","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/CcMLZU9yHot4XSVFzxAX/XIeJlDkQQmzG0JkWU4Mq/HS_form.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";export function HubspotFormSwapOnSubmit(){const ref=useRef(null);useEffect(()=>{let detach=null;const tryAttach=()=>{if(!ref.current||detach)return;const root=ref.current;const form=root.querySelector(\"form.hs-form\");const formContainer=root.querySelector(\".framer-m68ano-container\");if(!form)return;const handler=()=>{// let HubSpot finish its own async stuff\nsetTimeout(()=>{// hide the form\nformContainer.style.display=\"none\";form.style.display=\"none\";// find existing TY or create one\nlet ty=root.querySelector(\".submitted-message\");if(!ty){ty=document.createElement(\"div\");ty.className=\"custom-submitted-message\";ty.textContent=\"Thanks for subscribing.\";// optional basic inline styling; you can override via CSS\nty.style.display=\"block\";}else{ty.style.display=\"block\";}// make sure it’s in the root\nif(!ty.parentElement){root.appendChild(ty);}},80);};form.addEventListener(\"submit\",handler);detach=()=>{form.removeEventListener(\"submit\",handler);};};// poll until HubSpot has injected the form into this frame\nconst intervalId=window.setInterval(()=>{if(!ref.current||detach)return;tryAttach();},200);return()=>{window.clearInterval(intervalId);if(detach)detach();};},[]);return{ref};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withHubspotFormSwapOnSubmit(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...HubspotFormSwapOnSubmit(props)});};}withHubspotFormSwapOnSubmit.displayName=\"HubspotFormSwapOnSubmit\";\nexport const __FramerMetadata__ = {\"exports\":{\"withHubspotFormSwapOnSubmit\":{\"type\":\"reactHoc\",\"name\":\"withHubspotFormSwapOnSubmit\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"HubspotFormSwapOnSubmit\":{\"type\":\"override\",\"name\":\"HubspotFormSwapOnSubmit\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HS_form.map"],"mappings":"+LAA+E,SAAgB,GAAyB,CAAC,IAAM,EAAIA,EAAO,KAAK,CAMmB,OANlB,MAAc,CAAC,IAAI,EAAO,KAAW,MAAc,CAAC,GAAG,CAAC,EAAI,SAAS,EAAO,OAAO,IAAM,EAAK,EAAI,QAAc,EAAK,EAAK,cAAc,eAAe,CAAO,EAAc,EAAK,cAAc,2BAA2B,CAAC,GAAG,CAAC,EAAK,OAAO,IAAM,MAAY,CAC7Y,eAAe,CACf,EAAc,MAAM,QAAQ,OAAO,EAAK,MAAM,QAAQ,OACtD,IAAI,EAAG,EAAK,cAAc,qBAAqB,CAAK,EACrB,EAAG,MAAM,QAAQ,SADQ,EAAG,SAAS,cAAc,MAAM,CAAC,EAAG,UAAU,2BAA2B,EAAG,YAAY,0BAChJ,EAAG,MAAM,QAAQ,SACb,EAAG,eAAe,EAAK,YAAY,EAAG,EAAI,GAAG,EAAG,EAAK,iBAAiB,SAAS,EAAQ,CAAC,MAAW,CAAC,EAAK,oBAAoB,SAAS,EAAQ,GAC5I,EAAW,EAAO,gBAAgB,CAAI,CAAC,EAAI,SAAS,GAAc,GAAW,EAAG,IAAI,CAAC,UAAU,CAAC,EAAO,cAAc,EAAW,CAAI,GAAO,GAAQ,GAAK,EAAE,CAAC,CAAO,CAAC,MAAI,CAAqJ,SAAgB,EAA4B,EAAE,CAAC,MAAO,KAAQ,EAA+BC,EAAwC,CAAQC,EAAK,EAAE,CAAC,GAAG,EAAM,GAAG,EAAwB,EAAM,CAAC,CAAC,uBANxd,IAAoC,IAMmP,CAAqM,EAA4B,YAAY"}