{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/T1mWEADn7MYBmf5Sgv0R/alLrjj9LqQd4UfAwXVaK/Hubspot_Form.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function HubspotFormWithRedirect({portalId,formId,region,redirectPath,spinnerColor=\"#2c3fd5\",wrapperId,formType,formLanguage}){const[isLoading,setIsLoading]=useState(true);useEffect(()=>{const script=document.createElement(\"script\");script.src=\"https://js.hsforms.net/forms/embed/v2.js\";script.async=true;script.onload=()=>{if(window.hbspt){window.hbspt.forms.create({...region&&{region},portalId,formId,target:`#${wrapperId}`,onFormReady:()=>{setIsLoading(false);},onFormSubmitted:function($form){const formEl=$form.get?$form.get(0):$form;const emailInput=formEl.querySelector('input[name=\"email\"]');const email=emailInput?.value||null;if(email){localStorage.setItem(\"conversionEmail\",email);window.dataLayer=window.dataLayer||[];window.dataLayer.push({event:\"conversion\",email:email,formType:formType||formId,formLanguage:formLanguage||\"unknown\"});}setTimeout(()=>{if(window.framer?.navigate){window.framer.navigate(redirectPath);}else{window.location.href=redirectPath;}});}});}else{console.error(\"HubSpot script failed to load\");setIsLoading(false);}};document.body.appendChild(script);return()=>{document.body.removeChild(script);};},[portalId,formId,redirectPath,wrapperId,region,formType,formLanguage]);return /*#__PURE__*/_jsxs(_Fragment,{children:[isLoading&&/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",justifyContent:\"center\",alignItems:\"center\",height:\"100px\"},children:/*#__PURE__*/_jsx(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",style:{margin:\"auto\",background:\"none\",display:\"block\"},width:\"50px\",height:\"50px\",viewBox:\"0 0 100 100\",preserveAspectRatio:\"xMidYMid\",children:/*#__PURE__*/_jsx(\"circle\",{cx:\"50\",cy:\"50\",r:\"35\",stroke:spinnerColor,strokeWidth:\"10\",fill:\"none\",strokeLinecap:\"round\",children:/*#__PURE__*/_jsx(\"animateTransform\",{attributeName:\"transform\",type:\"rotate\",repeatCount:\"indefinite\",dur:\"1s\",values:\"0 50 50;360 50 50\",keyTimes:\"0;1\"})})})}),/*#__PURE__*/_jsx(\"div\",{id:wrapperId})]});}addPropertyControls(HubspotFormWithRedirect,{portalId:{type:ControlType.String,title:\"Portal ID\",defaultValue:\"\"},formId:{type:ControlType.String,title:\"Form ID\",defaultValue:\"\"},region:{type:ControlType.String,title:\"Region (e.g. na1, eu1)\",defaultValue:\"\"},redirectPath:{type:ControlType.String,title:\"Redirect Path\",defaultValue:\"\"},spinnerColor:{type:ControlType.Color,title:\"Spinner Color\",defaultValue:\"#2c3fd5\"},wrapperId:{type:ControlType.String,title:\"Wrapper ID\",defaultValue:\"hubspot-form-wrapper\",placeholder:\"e.g. hubspot-form-wrapper-contact-form\"},formType:{type:ControlType.String,title:\"Form Type\",defaultValue:\"\",placeholder:\"e.g. contact-form, request-quote\"},formLanguage:{type:ControlType.String,title:\"Form Language\",defaultValue:\"\",placeholder:\"e.g. en, de, da\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HubspotFormWithRedirect\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Hubspot_Form.map"],
  "mappings": "8JAAwL,SAARA,EAAyC,CAAC,SAAAC,EAAS,OAAAC,EAAO,OAAAC,EAAO,aAAAC,EAAa,aAAAC,EAAa,UAAU,UAAAC,EAAU,SAAAC,EAAS,aAAAC,CAAY,EAAE,CAAC,GAAK,CAACC,EAAUC,CAAY,EAAEC,EAAS,EAAI,EAAE,OAAAC,EAAU,IAAI,CAAC,IAAMC,EAAO,SAAS,cAAc,QAAQ,EAAE,OAAAA,EAAO,IAAI,2CAA2CA,EAAO,MAAM,GAAKA,EAAO,OAAO,IAAI,CAAIC,EAAO,MAAOA,EAAO,MAAM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AAY,aAAa,IAAI,KAAK,OAAO,oBAAoB,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAeA,EAAK,MAAM,CAAC,GAAGb,CAAS,CAAC,CAAC,CAAC,CAAC,CAAE,CAACc,EAAoBpB,EAAwB,CAAC,SAAS,CAAC,KAAKqB,EAAY,OAAO,MAAM,YAAY,aAAa,EAAE,EAAE,OAAO,CAAC,KAAKA,EAAY,OAAO,MAAM,UAAU,aAAa,EAAE,EAAE,OAAO,CAAC,KAAKA,EAAY,OAAO,MAAM,yBAAyB,aAAa,EAAE,EAAE,aAAa,CAAC,KAAKA,EAAY,OAAO,MAAM,gBAAgB,aAAa,EAAE,EAAE,aAAa,CAAC,KAAKA,EAAY,MAAM,MAAM,gBAAgB,aAAa,SAAS,EAAE,UAAU,CAAC,KAAKA,EAAY,OAAO,MAAM,aAAa,aAAa,uBAAuB,YAAY,wCAAwC,EAAE,SAAS,CAAC,KAAKA,EAAY,OAAO,MAAM,YAAY,aAAa,GAAG,YAAY,kCAAkC,EAAE,aAAa,CAAC,KAAKA,EAAY,OAAO,MAAM,gBAAgB,aAAa,GAAG,YAAY,iBAAiB,CAAC,CAAC",
  "names": ["HubspotFormWithRedirect", "portalId", "formId", "region", "redirectPath", "spinnerColor", "wrapperId", "formType", "formLanguage", "isLoading", "setIsLoading", "ye", "ue", "script", "window", "$form", "email", "u", "l", "p", "addPropertyControls", "ControlType"]
}
