{"version":3,"file":"CustomHubspotForm.CfaFjeeZ.mjs","names":["customEvent","useRef","useState"],"sources":["https:/framerusercontent.com/modules/QCcFJn7mJo0fDqQ5uoNi/K1xT8UF9wRAlW9QqpRH7/CustomHubspotForm.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Locked — not exposed as props\nconst PORTAL_ID=\"146070825\";const REGION=\"eu1\";const COLORS={grey100:\"rgba(230, 230, 230, 1)\",grey200:\"rgba(208, 205, 200, 1)\",grey400:\"rgba(104, 101, 94, 1)\",black:\"rgba(13, 16, 22, 1)\",green:\"#005032\"};// ─── Default styles ───────────────────────────────────────────────────────────\nconst defaultCss=`\n    @font-face {\n        font-family: 'AktivGroteskRegular';\n        src: url('https://146070825.fs1.hubspotusercontent-eu1.net/hubfs/146070825/fonts/AktivGrotesk_Rg.woff2') format('woff2');\n        font-weight: normal;a\n        font-style: normal;\n    }\n\n    @font-face {\n        font-family: 'AktivGroteskMedium';\n        src: url('https://146070825.fs1.hubspotusercontent-eu1.net/hubfs/146070825/fonts/AktivGrotesk_Md.woff2') format('woff2');\n        font-weight: 700;\n        font-style: normal;\n    }\n\n    .hs-form-html {\n        width: 100%;\n        height: 100%;\n        --hsf-heading__font-family: 'AktivGroteskMedium', sans-serif;\n        --hsf-richtext__font-family: 'AktivGroteskRegular', sans-serif;\n        --hsf-global__font-size: 14px;\n        --hsf-default-richtext__font-family: 'AktivGroteskRegular', sans-serif;\n        --hsf-global__font-family: 'AktivGroteskRegular', sans-serif;\n        --hsf-background__padding: 0;\n        --hsf-field-input__background-color: white;\n        --hsf-default-field-input__background-color: white;\n        --hsf-button__padding: 10px 20px;\n        --hsf-heading__color: #0a0a0a;\n        --hsf-field-input__border-color: #989898;\n        --hsf-field-input__border-color--active: #0a0a0a;\n        --hsf-field-input__border-radius: 4px;\n        --hsf-field-dropdown-options__border-radius: 4px;\n        --hsf-field-input__padding: 8px 12px 8px 12px;\n        --hsf-field-radio__padding: 6px;\n        --hsf-field-checkbox__padding: 6px;\n        --hsf-field-description__color: #989898;\n        --hsf-field-input__placeholder-color: #989898;\n    }\n\n    textarea {\n        box-shadow: none !important;\n\n        &:focus, &:active {\n            box-shadow: none !important;\n            border-color: #0a0a0a !important;\n        }\n    }\n\n    .hs-form-html .hsfc-FileInput {\n        &::file-selector-button {\n            background: var(--hsf-field-input__background-color);\n            color: var(--hsf-field-input__color);\n            border: 1px solid var(--hsf-field-input__border-color);\n            padding: var(--hsf-field-input__padding);\n            border-radius: var(--hsf-field-input__border-radius);\n            cursor: pointer;\n        }\n    }\n    .hs-form-html .hsfc-TextInput:hover,\n    .hs-form-html .hsfc-TextInput:focus,\n    .hs-form-html .hsfc-TextInput:active {\n        box-shadow: none !important;\n    }\n\n    .hs-form-html .hsfc-TextInput:focus,\n    .hs-form-html .hsfc-TextInput:active {\n        border-color: #0a0a0a;\n    }\n\n    .hs-form-html [data-hsfc-id=Renderer] .hsfc-DropdownOptions {\n        border-color: #0a0a0a;\n    }\n\n    .hs-form-html [data-hsfc-id=Renderer] .hsfc-DropdownInput__Caret {\n        padding-inline: 12px;\n    }\n\n    input[type=\"radio\"], input[type=\"checkbox\"] {\n        box-shadow: none !important;\n    }\n\n    input[type=\"checkbox\"] {\n        border-width: 1px !important;\n    }\n\n    h1, h2, h3, h4 {\n        margin-block-start: 0;\n        margin-block-end: 0;\n    }\n\n    .hsfc-RichText {\n        p  {\n            margin-block: 0;\n        }\n        a {\n            color: inherit !important;\n            text-decoration: none;\n            color: ${COLORS.black} !important;\n\n            &:hover {\n                text-decoration: underline\n            }\n        }\n    }\n`;// ─── Precedent preset ─────────────────────────────────────────────────────────\nconst precedentCss=formId=>`\n    .hs-form-html[data-form-id=\"${formId}\"] {\n        --hsf-field-input__border-radius: 5px;\n        --hsf-field-dropdown-options__border-radius: 5px;\n        --hsf-field-input__background-color: ${COLORS.grey100};\n        --hsf-field-input__border-color: transparent;\n        --hsf-field-input__border-color--active: transparent;\n        --hsf-button__padding: 14px 32px;\n        --hsf-global__font-size: 13px;\n        position: relative;\n        overflow: hidden;\n    }\n\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-DropdownInput {\n        overflow: visible;\n    }\n\n    .hs-form-html[data-form-id=\"${formId}\"] .hsf-floating-field__shell .hsfc-DropdownInput {\n        overflow: visible;\n    }\n\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-DropdownOptions {\n        left: 0 !important;\n        right: 0;\n        width: 100% !important;\n        max-width: 100%;\n        max-height: min(240px, 50vh);\n        overflow-y: auto;\n        overscroll-behavior: contain;\n        box-sizing: border-box;\n        z-index: 20;\n    }\n\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-DropdownOptions__List {\n        max-height: none;\n    }\n \n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-TextInput::placeholder {\n        color: #0a0a0a;\n    }\n \n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-TextInput,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-TextInput:hover,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-TextInput:focus,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-TextInput:active {\n        border-color: transparent !important;\n        box-shadow: none !important;\n    }\n\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-TextInput:focus,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-TextInput:active,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-EmailInput:focus,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-EmailInput:active,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-PhoneInput:focus,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-PhoneInput:active {\n        background: ${COLORS.grey200};\n    }\n\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-EmailInput,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-EmailInput:hover,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-EmailInput:focus,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-EmailInput:active,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-PhoneInput,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-PhoneInput:hover,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-PhoneInput:focus,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-PhoneInput:active {\n        border-color: transparent !important;\n        box-shadow: none !important;\n    }\n\n    /* Floating labels (text-like fields + dropdowns) */\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-TextField.hsf-floating-field,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-EmailField.hsf-floating-field,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-NumberField.hsf-floating-field,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsfc-DropdownField.hsf-floating-field {\n        width: 100%;\n    }\n\n    .hs-form-html[data-form-id=\"${formId}\"] .hsf-floating-field__shell {\n        position: relative;\n        width: 100%;\n    }\n\n    .hs-form-html[data-form-id=\"${formId}\"] .hsf-floating-field__shell .hsfc-FieldLabel {\n        position: absolute !important;\n        top: 50%;\n        left: 12px;\n        right: auto;\n        margin: 0 !important;\n        padding: 0;\n        display: block;\n        width: auto;\n        max-width: calc(100% - 24px);\n        white-space: nowrap;\n        overflow: hidden;\n        text-overflow: ellipsis;\n        transform: translateY(-50%);\n        transform-origin: right center;\n        z-index: 1;\n        pointer-events: none;\n        color: ${COLORS.black};\n        font-size: 13px;\n        line-height: 1;\n        transition:\n            left 0.15s ease,\n            right 0.15s ease,\n            transform 0.15s ease,\n            color 0.15s ease,\n            opacity 0.15s ease,\n            visibility 0.15s ease;\n    }\n\n    .hs-form-html[data-form-id=\"${formId}\"] .hsf-floating-field__shell .hsfc-FieldLabel span span.hsfc-FieldLabel__RequiredIndicator {\n        display: inline-block !important;\n        color: inherit;\n    }\n\n    .hs-form-html[data-form-id=\"${formId}\"] .hsf-floating-field:not(.hsf-floating-field--dropdown) .hsf-floating-field__shell:focus-within .hsfc-FieldLabel,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsf-floating-field:not(.hsf-floating-field--dropdown).is-filled .hsfc-FieldLabel {\n        left: auto;\n        right: 12px;\n        color: ${COLORS.grey400};\n        transform: translateY(-50%) scale(0.85);\n    }\n\n    .hs-form-html[data-form-id=\"${formId}\"] .hsf-floating-field--dropdown.is-filled .hsfc-FieldLabel {\n        opacity: 0;\n        visibility: hidden;\n    }\n\n    .hs-form-html[data-form-id=\"${formId}\"] .hsf-floating-field--dropdown .hsf-floating-field__shell .hsfc-DropdownInput > input.hsfc-TextInput {\n        width: 100%;\n        padding-inline: 12px;\n    }\n\n    .hs-form-html[data-form-id=\"${formId}\"] .hsf-floating-field__shell .hsfc-TextInput,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsf-floating-field__shell .hsfc-EmailInput,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsf-floating-field__shell .hsfc-PhoneInput {\n        width: 100%;\n        padding-inline: 12px;\n    }\n\n    .hs-form-html[data-form-id=\"${formId}\"] .hsf-floating-field__shell .hsfc-TextInput::placeholder,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsf-floating-field__shell .hsfc-EmailInput::placeholder,\n    .hs-form-html[data-form-id=\"${formId}\"] .hsf-floating-field__shell .hsfc-PhoneInput::placeholder {\n        color: transparent;\n    }\n\n    .hs-form-html[data-form-id=\"${formId}\"] .hsf-floating-field .hsfc-ErrorAlert {\n        margin-top: 6px;\n    }\n \n    .hs-form-html[data-form-id=\"${formId}\"] button[type=submit] {\n        height: 30px;\n        display: flex;\n        flex-direction: row;\n        align-items: center;\n        line-height: 1;\n        padding: 5px 40px 5px 15px;\n        background-color: ${COLORS.grey100};\n        color: ${COLORS.black};\n        background-image: url('data:image/svg+xml,<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"20\" height=\"20\" rx=\"10\" fill=\"white\"/><path d=\"M7.08301 10H12.4997\" stroke=\"%230D1016\" stroke-linecap=\"square\"/><path d=\"M10 7.08301L12.9167 9.99967L10 12.9163\" stroke=\"%230D1016\" stroke-linecap=\"square\"/></svg>');\n        background-repeat: no-repeat;\n        background-position: right 6px center;\n        gap: 10px;\n        border-radius: 30px;\n        font-weight: normal;\n        transition: background-color 0.1s ease-out, color 0.1s ease-out, color 0.1s ease-out;\n    }\n \n    .hs-form-html[data-form-id=\"${formId}\"] button[type=submit]:hover {\n        background-color: ${COLORS.green};\n        transform: translateY(0px);\n        color: #ffffff;\n    }\n`;// ─── Precedent Green preset ───────────────────────────────────────────────────\nconst precedentGreenCss=formId=>`\n    ${precedentCss(formId)}\n\n    .hs-form-html[data-form-id=\"${formId}\"] button[type=submit] {\n        background-color: ${COLORS.green};\n        color: #ffffff;\n    }\n\n    .hs-form-html[data-form-id=\"${formId}\"] button[type=submit]:hover {\n        background-color: #003d26;\n        color: #ffffff;\n    }\n`;// ─── Oneline preset ───────────────────────────────────────────────────────────\nconst onelineCss=formId=>`\n    .hs-form-html[data-form-id=\"${formId}\"] {\n        --hsf-field-input__border-radius: 0px;\n    }\n`;// ─── Style preset map ─────────────────────────────────────────────────────────\nconst STYLE_PRESETS={precedent:precedentCss,\"precedent-green\":precedentGreenCss,oneline:onelineCss};// ─── Style injection ──────────────────────────────────────────────────────────\nfunction injectDefaultStyles(){const id=\"hubspot-form-styles-default\";if(!document.getElementById(id)){const el=document.createElement(\"style\");el.id=id;el.textContent=defaultCss;document.head.appendChild(el);}}function injectInstanceStyles(formId,customStyling){const id=`hubspot-form-styles-${formId}`;let el=document.getElementById(id);const presetFn=customStyling?STYLE_PRESETS[customStyling]??null:null;if(presetFn){if(!el){el=document.createElement(\"style\");el.id=id;document.head.appendChild(el);}el.textContent=presetFn(formId);}else if(el){el.remove();}}function isHubSpotReady(){const win=window;return!!(win.HubSpotFormsV4||win.HubSpotForms);}function waitForHubSpotReady(timeoutMs=3e3){return new Promise((resolve,reject)=>{if(isHubSpotReady()){resolve();return;}const start=Date.now();const poll=()=>{if(isHubSpotReady()){resolve();}else if(Date.now()-start>=timeoutMs){reject(new Error(\"HubSpot script failed to load\"));}else{setTimeout(poll,100);}};poll();});}let scriptLoadPromise=null;function loadScriptOnce(retries=3){return new Promise((resolve,reject)=>{const scriptId=`hubspot-embed-script-${PORTAL_ID}`;const existing=document.getElementById(scriptId);let settled=false;const done=()=>{if(settled)return;settled=true;resolve();};const fail=err=>{if(settled)return;settled=true;reject(err);};if(existing){if(isHubSpotReady()){done();return;}existing.addEventListener(\"load\",()=>{existing.dataset.hsfLoaded=\"true\";done();},{once:true});existing.addEventListener(\"error\",()=>fail(new Error(\"HubSpot script failed to load\")),{once:true});// load may have already fired before we attached listeners\nwaitForHubSpotReady().then(done).catch(fail);return;}const attempt=n=>{const script=document.createElement(\"script\");script.id=scriptId;script.src=`https://js-eu1.hsforms.net/forms/embed/developer/${PORTAL_ID}.js`;script.defer=true;script.onload=()=>{script.dataset.hsfLoaded=\"true\";done();};script.onerror=()=>{document.getElementById(scriptId)?.remove();if(n>0){setTimeout(()=>attempt(n-1),500);}else{fail(new Error(\"HubSpot script failed to load\"));}};document.head.appendChild(script);};attempt(retries);});}function loadScript(retries=3){if(!scriptLoadPromise){scriptLoadPromise=loadScriptOnce(retries).catch(err=>{scriptLoadPromise=null;throw err;});}return scriptLoadPromise;}// ─── Form init ────────────────────────────────────────────────────────────────\n// Container renders as a plain div in JSX/SSR so HubSpot cannot start early.\n// After the SDK loads, attrs are applied and the node is re-inserted so\n// HubSpot's MutationObserver picks it up (attrs alone are not enough).\nfunction initForm(el,formId){el.className=\"hs-form-html\";el.setAttribute(\"data-region\",REGION);el.setAttribute(\"data-form-id\",formId);el.setAttribute(\"data-portal-id\",PORTAL_ID);const parent=el.parentNode;if(!parent)return;const anchor=document.createComment(\"hs-reinit\");parent.replaceChild(anchor,el);requestAnimationFrame(()=>parent.replaceChild(el,anchor));}function waitForFormReady(formRoot,timeoutMs=1e4){return new Promise((resolve,reject)=>{if(formRoot.querySelector(\"[data-hsfc-id=Renderer]\")){resolve();return;}const timeout=setTimeout(()=>{window.removeEventListener(\"hs-form-event:on-ready\",onReady);reject(new Error(\"HubSpot form failed to render\"));},timeoutMs);const onReady=event=>{const customEvent=event;if(customEvent.detail?.formId!==formRoot.dataset.formId)return;clearTimeout(timeout);window.removeEventListener(\"hs-form-event:on-ready\",onReady);resolve();};window.addEventListener(\"hs-form-event:on-ready\",onReady);});}// ─── Floating labels (precedent preset) ───────────────────────────────────────\nconst FLOATING_FIELD_SELECTOR=\".hsfc-TextField, .hsfc-EmailField, .hsfc-NumberField, .hsfc-DropdownField\";function wrapFloatingShell(field,label,control){if(field.querySelector(\".hsf-floating-field__shell\"))return;const shell=document.createElement(\"div\");shell.className=\"hsf-floating-field__shell\";field.insertBefore(shell,label);shell.appendChild(label);shell.appendChild(control);}function constrainDropdownPanel(formRoot,options,anchor){const formRect=formRoot.getBoundingClientRect();const anchorRect=anchor.getBoundingClientRect();const spaceBelow=formRect.bottom-anchorRect.bottom-8;const spaceAbove=anchorRect.top-formRect.top-8;const maxHeight=Math.min(240,Math.max(80,Math.max(spaceBelow,spaceAbove)));options.style.maxHeight=`${maxHeight}px`;}function setupDropdownBounds(formRoot){const observers=[];const constrainOpenPanels=()=>{formRoot.querySelectorAll(\".hsfc-DropdownOptions\").forEach(options=>{if(getComputedStyle(options).display===\"none\")return;const anchor=options.closest(\".hsfc-DropdownInput\");if(anchor)constrainDropdownPanel(formRoot,options,anchor);});};const attachToDropdown=dropdownInput=>{const options=dropdownInput.querySelector(\".hsfc-DropdownOptions\");if(!options||options.dataset.hsfBounds===\"true\")return;options.dataset.hsfBounds=\"true\";const observer=new MutationObserver(constrainOpenPanels);observer.observe(options,{attributes:true,attributeFilter:[\"style\",\"class\"]});observers.push(observer);};formRoot.querySelectorAll(\".hsfc-DropdownInput\").forEach(attachToDropdown);const rootObserver=new MutationObserver(()=>{formRoot.querySelectorAll(\".hsfc-DropdownInput\").forEach(attachToDropdown);constrainOpenPanels();});rootObserver.observe(formRoot,{childList:true,subtree:true});window.addEventListener(\"resize\",constrainOpenPanels);return()=>{rootObserver.disconnect();observers.forEach(observer=>observer.disconnect());window.removeEventListener(\"resize\",constrainOpenPanels);};}function setupFloatingLabels(formRoot){const fieldCleanups=new Map;let debounceTimer=null;const syncTextFilled=(field,input)=>{field.classList.toggle(\"is-filled\",input.value.trim()!==\"\");};const syncDropdownFilled=(field,combobox,hidden)=>{const hasValue=combobox.value.trim()!==\"\"||(hidden?.value.trim()??\"\")!==\"\";field.classList.toggle(\"is-filled\",hasValue);};const enhanceTextField=field=>{const input=field.querySelector(\"input.hsfc-TextInput\");if(!input)return;const label=field.querySelector(\"label.hsfc-FieldLabel\");if(!label)return;wrapFloatingShell(field,label,input);field.classList.add(\"hsf-floating-field\");field.dataset.hsfFloating=\"true\";const update=()=>syncTextFilled(field,input);input.addEventListener(\"focus\",update);input.addEventListener(\"blur\",update);input.addEventListener(\"input\",update);fieldCleanups.set(field,()=>{input.removeEventListener(\"focus\",update);input.removeEventListener(\"blur\",update);input.removeEventListener(\"input\",update);});update();};const enhanceDropdownField=field=>{const dropdownInput=field.querySelector(\".hsfc-DropdownInput\");const combobox=field.querySelector('input[role=\"combobox\"].hsfc-TextInput');if(!dropdownInput||!combobox)return;const label=field.querySelector(\"label.hsfc-FieldLabel\");if(!label)return;const hidden=field.querySelector('input[type=\"hidden\"]');wrapFloatingShell(field,label,dropdownInput);field.classList.add(\"hsf-floating-field\",\"hsf-floating-field--dropdown\");field.dataset.hsfFloating=\"true\";const options=dropdownInput.querySelector(\".hsfc-DropdownOptions\");const update=()=>{syncDropdownFilled(field,combobox,hidden);if(options&&getComputedStyle(options).display!==\"none\"){constrainDropdownPanel(formRoot,options,dropdownInput);}};combobox.addEventListener(\"focus\",update);combobox.addEventListener(\"blur\",update);combobox.addEventListener(\"input\",update);combobox.addEventListener(\"click\",update);const attrObserver=new MutationObserver(update);attrObserver.observe(combobox,{attributes:true,attributeFilter:[\"value\",\"aria-expanded\"]});const hiddenObserver=hidden?new MutationObserver(update):null;if(hidden&&hiddenObserver){hiddenObserver.observe(hidden,{attributes:true,attributeFilter:[\"value\"]});hidden.addEventListener(\"change\",update);}fieldCleanups.set(field,()=>{combobox.removeEventListener(\"focus\",update);combobox.removeEventListener(\"blur\",update);combobox.removeEventListener(\"input\",update);combobox.removeEventListener(\"click\",update);attrObserver.disconnect();hiddenObserver?.disconnect();hidden?.removeEventListener(\"change\",update);});update();};const enhanceField=field=>{if(field.dataset.hsfFloating===\"true\")return;if(field.classList.contains(\"hsfc-DropdownField\")){enhanceDropdownField(field);return;}enhanceTextField(field);};const enhanceAll=()=>{formRoot.querySelectorAll(FLOATING_FIELD_SELECTOR).forEach(enhanceField);};const scheduleEnhance=()=>{if(debounceTimer)clearTimeout(debounceTimer);debounceTimer=setTimeout(()=>{debounceTimer=null;enhanceAll();},50);};enhanceAll();const observer=new MutationObserver(scheduleEnhance);observer.observe(formRoot,{childList:true,subtree:true});const dropdownBoundsCleanup=setupDropdownBounds(formRoot);return{disconnect:()=>{observer.disconnect();if(debounceTimer)clearTimeout(debounceTimer);fieldCleanups.forEach(cleanup=>cleanup());fieldCleanups.clear();dropdownBoundsCleanup();}};}// ─── Component ────────────────────────────────────────────────────────────────\n/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function HubSpotForm({formId,customStyling,style}){const trimmedId=(formId??\"\").trim();const trimmedStyle=(customStyling??\"\").trim();const formNodeRef=useRef(null);const[error,setError]=useState(null);const[instanceKey]=useState(()=>Date.now());// ── Form init: runs on mount and when formId/style changes ──────────────\nuseEffect(()=>{if(!trimmedId)return;const el=formNodeRef.current;if(!el)return;setError(null);injectDefaultStyles();let floatingController=null;let cancelled=false;loadScript().then(()=>{if(cancelled)return;initForm(el,trimmedId);const setupEnhancements=()=>{if(cancelled||trimmedStyle!==\"precedent\"&&trimmedStyle!==\"precedent-green\")return;floatingController?.disconnect();floatingController=setupFloatingLabels(el);};if(el.querySelector(\"[data-hsfc-id=Renderer]\")){setupEnhancements();return;}waitForFormReady(el).then(setupEnhancements).catch(err=>{if(cancelled)return;console.error(\"[HubSpotForm] Render error:\",err,{formId:trimmedId});});}).catch(err=>{if(cancelled)return;console.error(\"[HubSpotForm] Load error:\",err,{formId:trimmedId});setError(err.message);});return()=>{cancelled=true;floatingController?.disconnect();el.className=\"\";el.removeAttribute(\"data-region\");el.removeAttribute(\"data-form-id\");el.removeAttribute(\"data-portal-id\");el.innerHTML=\"\";document.getElementById(`hubspot-form-styles-${trimmedId}`)?.remove();};},[trimmedId,trimmedStyle,instanceKey]);// ── Style-only update: only when trimmedStyle changes ───────────────────\nuseEffect(()=>{if(!trimmedId)return;injectInstanceStyles(trimmedId,trimmedStyle||undefined);},[trimmedStyle,trimmedId]);return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\",...style},children:[error&&/*#__PURE__*/_jsxs(\"p\",{style:{color:\"red\",fontFamily:\"sans-serif\",fontSize:13,margin:0},children:[\"⚠️ \",error]}),!trimmedId?/*#__PURE__*/_jsx(\"p\",{style:{color:\"#999\",fontFamily:\"sans-serif\",fontSize:13,margin:0},children:\"Enter a Form ID to load the HubSpot form.\"}):/*#__PURE__*/_jsx(\"div\",{ref:formNodeRef},instanceKey)]});}addPropertyControls(HubSpotForm,{formId:{type:ControlType.String,title:\"Form ID\",description:'The ID of the HubSpot form to load. You can find the ID at the very end of the URL when editing the form. It\\'s the part that comes after the last \"/\". For example: https://app-eu1.hubspot.com/forms/146070825/new-editor/*b433628c-eba6-4352-b480-c8847f3bd941*',defaultValue:\"\"},customStyling:{type:ControlType.String,title:\"Custom Styling\",placeholder:\"\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HubSpotForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"fram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