{"version":3,"file":"Hubspot.o7ozuviW.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/Z7XCPkNjjj1LCyoOqtIP/hjJn7KAldSR6gHYOCDEW/Hubspot.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{withCSS,addPropertyControls,ControlType}from\"framer\";import{useEffect,useRef,useState}from\"react\";const HubspotPrimitive=({region,portalId,formId,onLoad,containerClassName})=>{const hubspotContainerRef=useRef(null);const[loaded,setLoaded]=useState(false);const uniqueFormId=useRef(`hubspotForm-${Math.random().toString(36).substring(2,11)}`);useEffect(()=>{const script=document.createElement(\"script\");script.src=\"https://js-eu1.hsforms.net/forms/embed/v2.js\";script.async=true;document.body.appendChild(script);const loadHandler=()=>{if(window.hbspt&&hubspotContainerRef.current){window.hbspt.forms.create({region:region||\"eu1\",portalId:portalId||\"25780729\",formId:formId||\"233f04b8-3a88-4b25-998d-511fb8c55741\",target:`#${uniqueFormId.current}`,cssClass:containerClassName});setLoaded(true)// Set state to trigger fade-in\n;if(typeof onLoad===\"function\"){onLoad()// Notify parent component that the form has loaded\n;}}};script.addEventListener(\"load\",loadHandler);return()=>{script.removeEventListener(\"load\",loadHandler);// Check if script still exists in document before removing\nif(document.body.contains(script)){document.body.removeChild(script);}};},[region,portalId,formId,onLoad,containerClassName]);return /*#__PURE__*/_jsx(\"div\",{id:uniqueFormId.current,ref:hubspotContainerRef,style:{opacity:loaded?1:0,transition:\"opacity 0.15s ease-in-out\"}});};/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function Hubspot(props){const{primary,secondary,error,inputBackground,buttonText,buttonBackground,region,portalId,formId}=props;const hubspotContainerRef=useRef(null);const[loading,setLoading]=useState(true);// Use a consistent class name for targeting in CSS\nconst containerClassName=\"hubspot-form-container\";const styles=[`.${containerClassName} {\n            font-family: \"Roobert Regular\";\n            display: flex;\n            flex-direction: column;\n            gap: 2rem;\n        }`,`.${containerClassName} .form-columns-2 {\n            display: flex;\n            gap: 1rem;\n        }`,`@media (max-width: 839px) {\n            .${containerClassName} .form-columns-2 {\n                display: flex;\n                flex-direction: column;\n                gap: 1rem;\n            }\n        }`,`.${containerClassName} .hs-fieldtype-text {\n            width: 100% !important;\n            max-width: 100% !important;\n        }`,`.${containerClassName} fieldset {\n            width: 100% !important;\n            max-width: 100% !important;\n        }`,`.${containerClassName} .input {\n            width: 100% !important;\n            max-width: 100% !important;\n        }`,`.${containerClassName} input {\n            width: 100% !important;\n            border: 0;\n            border-bottom: 1px solid ${primary};\n            background-color: ${inputBackground};\n            padding: 1rem;\n            margin-top: 0.5rem;\n        }`,`.${containerClassName} label {\n            color: ${primary};\n            font-family: \"Roobert Semibold\";\n            font-size: 1rem;\n        }`,`.${containerClassName} .hs-richtext {\n            color: ${secondary};\n        }`,`.${containerClassName} .hs-error-msgs {\n            list-style: none;\n            padding-inline-start: 0;\n        }`,`.${containerClassName} .hs-error-msg {\n            font-family: \"Roobert Regular\";\n            color: ${error};\n        }`,`.${containerClassName} .hs-button {\n            font-family: \"Roobert Semibold\";\n            font-size: 1rem;\n            color: ${buttonText};\n            background-color: ${buttonBackground};\n            border-radius: 0.25rem;\n        }`,`.${containerClassName} .inputs-list {\n            list-style: none;\n            padding: 0;\n            margin: 0\n        }`,`.${containerClassName} .hs-form-booleancheckbox-display {\n            display: flex;\n            align-items:baseline;\n        }`,`.${containerClassName} .hs-form-booleancheckbox-display .hs-input[type=\"checkbox\"] {\n            flex: 0\n        }`,`.${containerClassName} .legal-consent-container span, .${containerClassName} .legal-consent-container p, .${containerClassName} .legal-consent-container a {\n            font-family: \"Roobert Regular\" !important;\n            font-size: 0.75rem !important;\n            color: ${secondary} !important;\n        }`,`.${containerClassName} textarea {\n            width: 100% !important;\n            border: 0;\n            border-bottom: 1px solid ${primary};\n            background-color: ${inputBackground};\n            padding: 1rem;\n            margin-top: 0.5rem;\n            min-height: 6rem;\n        }`];const HubspotStyled=withCSS(HubspotPrimitive,styles,undefined);return /*#__PURE__*/_jsx(\"div\",{ref:hubspotContainerRef,style:{width:\"100%\"},children:/*#__PURE__*/_jsx(HubspotStyled,{region:region,portalId:portalId,formId:formId,onLoad:()=>setLoading(false),containerClassName:containerClassName})});}addPropertyControls(Hubspot,{primary:{type:ControlType.Color,defaultValue:\"#000000\",title:\"Primary Text Color\"},secondary:{type:ControlType.Color,defaultValue:\"#555555\",title:\"Secondary Text Color\"},error:{type:ControlType.Color,defaultValue:\"#FF0000\",title:\"Error Text Color\"},inputBackground:{type:ControlType.Color,defaultValue:\"#00000022\",title:\"Input Background Color\"},buttonText:{type:ControlType.Color,defaultValue:\"#ffffff\",title:\"Button Text Color\"},buttonBackground:{type:ControlType.Color,defaultValue:\"#000000\",title:\"Button Background Color\"},region:{type:ControlType.String,defaultValue:\"eu1\",title:\"Region\"},portalId:{type:ControlType.String,defaultValue:\"25780729\",title:\"Portal ID\"},formId:{type:ControlType.String,defaultValue:\"612c86b1-318e-4133-a1ba-9cf5b523c35e\",title:\"Form ID\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Hubspot\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Hubspot.map"],"mappings":"uUAMG,SAAwB,EAAQ,EAAM,CAAC,GAAK,CAAC,UAAQ,YAAU,QAAM,kBAAgB,aAAW,mBAAiB,SAAO,WAAS,UAAQ,EAAY,EAAoBA,EAAO,KAAK,CAAM,CAAC,EAAQ,GAAYC,EAAS,GAAK,CAC3N,EAAmB,yBAA+B,EAAO,CAAC,IAAI,EAAmB;;;;;WAK5E,IAAI,EAAmB;;;WAGvB;eACI,EAAmB;;;;;WAKvB,IAAI,EAAmB;;;WAGvB,IAAI,EAAmB;;;WAGvB,IAAI,EAAmB;;;WAGvB,IAAI,EAAmB;;;uCAGK,EAA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