{"version":3,"file":"WithHubspotFormStyles.Conl8aSv.mjs","names":["_Fragment"],"sources":["https:/framerusercontent.com/modules/uGQZtcsxBzvxqsgxQ0Tz/b7VYVaGCWWNyhqVsgsiv/Hubspot.js","https:/framerusercontent.com/modules/Nk1jwayzfrlLHV0hrNX9/bRV3U8Pli34uhKmfiLEV/WithHubspotFormStyles.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{emptyStateStyle,stateParagraphStyle,stateTitleStyle}from\"https://framer.com/m/framer/integrations-styles.js@0.2.0\";// Poll for 5 minutes ...\nfunction poll(f,delay=200,count=5*60*5,i=0){if(i>count){console.error(\"poll max attempts\",f);return;}if(!f()){console.log(\"poll\",delay,count,i);setTimeout(()=>{poll(f,delay,count,i+1);},delay);}}function EmptyState({title,description}){return /*#__PURE__*/_jsxs(\"div\",{style:{...emptyStateStyle,width:\"100%\",height:\"100%\"},children:[/*#__PURE__*/_jsx(\"h1\",{style:stateTitleStyle,children:title}),/*#__PURE__*/_jsx(\"p\",{style:stateParagraphStyle,children:description})]});}/**\n * HUBSPOT\n *\n * @framerIntrinsicWidth 480\n * @framerIntrinsicHeight 300\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function HubSpotForm({portalId,formId,advanced,region,id}){if(!portalId||!formId||!region){return /*#__PURE__*/_jsx(EmptyState,{title:\"Hubspot\",description:\"Set a portal ID and form in the Properties.\"});}// const ref = React.createRef<HTMLDivElement>()\nconst elementId=`hubspot_form_${id}`;const cleanup=()=>{const element=document.querySelector(`#${elementId}`);if(element)element.innerHTML=\"\";};React.useEffect(()=>{if(window.hbspt){handleScriptLoad();return cleanup;}const script=document.createElement(\"script\");script.src=`https://js-${region}.hsforms.net/forms/shell.js`;script.onload=handleScriptLoad();document.body.appendChild(script);return cleanup;},[portalId,formId,region]);const handleScriptLoad=()=>{console.log(\"Loading HubSpot form...\",portalId);poll(()=>{if(!window.hbspt){console.warn(`HubSpot could not be loaded: window.hbspt is missing`);return false;}if(!document.querySelector(`#${elementId}`)){console.warn(`HubSpot could not be loaded: element not found #${elementId}`);return false;}cleanup();window.hbspt.forms.create({region,portalId,formId,target:`#${elementId}`,formInstanceId:formId});return true;});};return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\"},id:elementId});}addPropertyControls(HubSpotForm,{portalId:{title:\"Portal\",type:ControlType.String,placeholder:\"25276298\",// defaultValue: \"25276298\",\ndescription:\"Create a [Hubspot](https://www.hubspot.com/) account, add a new form and copy your portal ID. [Learn more…](https://www.framer.com/plugins/hubspot/)\"},formId:{title:\"Form\",type:ControlType.String,placeholder:\"e7167571-4bc4-4c2c-bfdc-a0a8dbfd22f1\"},advanced:{title:\"Advanced\",type:ControlType.Boolean,enabledTitle:\"Show\",disabledTitle:\"Hide\",defaultValue:false},region:{title:\"Region\",type:ControlType.String,placeholder:\"eu1\",defaultValue:\"eu1\",hidden:({advanced})=>!advanced}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HubSpotForm\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"300\",\"framerIntrinsicWidth\":\"480\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Hubspot.map","import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";// Learn more: https://www.framer.com/developers/overrides/\nexport function WithHubspotFormStyles(Component){return props=>{return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                    > div {\n                        height: auto !important;\n                    }\n\n                    form {\n                        display: grid;\n                        grid-template-columns: repeat(2, 1fr);\n                        gap: 24px;\n\n                        input, textarea {\n                            border: 1px solid #EBEBED;\n                            padding: 12px 16px;\n                            border-radius: 8px;\n                            width: 100%;\n                            font-family: Inter, sans-serif;\n                            font-size: 16px;\n                            font-weight: 400;\n                            line-height: 26px;\n                            color: #1A1A26;\n                        }\n\n                        input[type=\"checkbox\"] {\n                            width: 20px;\n                            height: 20px;\n                            appearance: none;\n                            padding: 0;\n                            border-radius: 3px;\n                            cursor: pointer;\n                            margin: 0;\n                            margin-right: 12px;\n                        }\n                    }\n\n                    .hs-form-field > label {\n                        display: none;\n                    }\n\n                    .hs-form-field {\n                        position: relative;\n                    }\n\n                    .hs-form-field.hs_email {\n                        grid-area: 2 / 1 / 3 / 3; \n                    }\n\n                    .hs-form-field.hs-message {\n                        grid-area: 4 / 1 / 5 / 3; \n\n                        textarea {\n                            min-height: 115px;\n                        }\n                    }\n\n                    .hs-form-field .hs-error-msgs, .hs_error_rollup {\n                        font-size: 12px;\n                        font-family: Inter, sans-serif;\n                        line-height: 14px;\n                        color: #df2e36;\n                        position: absolute;\n                        bottom: 0;\n                        transform: translateY(calc(100% + 4px));\n                        white-space: nowrap;\n                    }\n\n                    .legal-consent-container {\n                        grid-area: 5 / 1 / 6 / 3; \n                        font-family: Inter, sans-serif;\n                        font-size: 16px;\n                        font-weight: 500;\n                        line-height: 20px;\n                        color: #1A1A26;\n\n                        .hs-richtext {\n                            margin-top: 100px;\n                            font-size: 12px;\n                            line-height: 18px;\n                            font-weight: 400;\n                        }\n                    }\n\n                    .hs_error_rollup {\n                        grid-area: 6 / 1 / 7 / 3;; \n                    }\n\n                    .hs_submit {\n                        position: absolute;\n                        left: 0;\n                        bottom: 200px;\n                    }\n\n                    input[type=\"checkbox\"]:checked::before {\n                        display: block;\n                        width: 100%;\n                        height: 100%;\n                        background: red;\n                        content: \" \";\n                        border-radius: 2px;\n                        background-repeat: no-repeat;\n                        background-position: center;\n                        background-image: url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTAiIHZpZXdCb3g9IjAgMCAxMiAxMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTQuMzAyMzMgOS4xNjQzNkMzLjk0MTY1IDkuMTY0MzYgMy42MDIxOSA5LjAyMjkyIDMuMzQ3NiA4Ljc2ODMyTDAuNTY4MjQ2IDUuOTg4OTdDMC4xNDM5MTggNS41NjQ2NSAwLjE0MzkxOCA0Ljg3ODY0IDAuNTY4MjQ2IDQuNDU0MzJDMC45OTI1NzQgNC4wMjk5OSAxLjY3ODU3IDQuMDI5OTkgMi4xMDI5IDQuNDU0MzJMNC4zMDIzMyA2LjY1Mzc1TDkuOTAzNDYgMS4wNTI2MkMxMC4zMjc4IDAuNjI4MjkzIDExLjAxMzggMC42MjgyOTMgMTEuNDM4MSAxLjA1MjYyQzExLjg2MjQgMS40NzY5NSAxMS44NjI0IDIuMTYyOTUgMTEuNDM4MSAyLjU4NzI3TDUuMjU3MDcgOC43NjgzMkM1LjAwMjQ3IDkuMDIyOTIgNC42NjMwMSA5LjE2NDM2IDQuMzAyMzMgOS4xNjQzNloiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=\"), linear-gradient(209.53deg, #2CC3FF 34.69%, #0B55F7 148.18%);\n                    }\n\n                    ul {\n                        padding: 0;\n                        margin: 0;\n                        list-style: none;\n                    }\n\n                    input[type=\"submit\"] {\n                        background: linear-gradient(180deg, #0873EF 0%, #1881FA 100%);\n                        max-width: auto;\n                        color: #ffffff;\n                        cursor: pointer;\n                        box-shadow: 0px 20px 20px -16px #1881FA1A, 0px 10px 24px -10px #1881FA1A, 0px 3px 6px -2px #1881FA3D;\n\n                        &:hover, &:active {\n                            background: linear-gradient(180deg, #0873EF 0%, #55A0F6 100%);\n                        }\n                    }\n\n                    @media (max-width: 768px) {\n                        form {\n                            gap: 20px;\n                        }\n\n                        .hs-form-field .hs-error-msgs {\n                            position: static;\n                            white-space: initial;\n                            transform: none;\n                        }\n\n                        .hs_error_rollup {\n                            white-space: initial;\n                        }\n\n                        .legal-consent-container, input, textarea {\n                            font-size: 14px;\n                            font-weight: 400;\n                            line-height: 22px;\n                        }\n\n                        .legal-consent-container {\n                            font-weight: 500;\n                            line-height: 20px;\n\n                            .hs-richtext {\n                                margin-top: 80px;\n                            }\n                        }\n\n                        .hs_submit {\n                            bottom: 200px;\n                        }\n                    }\n                `}),/*#__PURE__*/_jsx(Component,{...props,\"data-custom-test-id\":\"test-id\"})]});};}\nexport const __FramerMetadata__ = {\"exports\":{\"WithHubspotFormStyles\":{\"type\":\"reactHoc\",\"name\":\"WithHubspotFormStyles\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WithHubspotFormStyles.map"],"mappings":"yRACA,SAAS,EAAK,EAAE,EAAM,IAAI,EAAM,IAAK,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,EAAM,CAAC,QAAQ,MAAM,oBAAoB,EAAE,CAAC,OAAY,GAAG,GAAE,QAAQ,IAAI,OAAO,EAAM,EAAM,EAAE,CAAC,eAAe,CAAC,EAAK,EAAE,EAAM,EAAM,EAAE,EAAE,EAAG,EAAM,EAAG,SAAS,EAAW,CAAC,QAAM,eAAa,CAAC,OAAoB,EAAM,MAAM,CAAC,MAAM,CAAC,GAAG,EAAgB,MAAM,OAAO,OAAO,OAAO,CAAC,SAAS,CAAc,EAAK,KAAK,CAAC,MAAM,EAAgB,SAAS,EAAM,CAAC,CAAc,EAAK,IAAI,CAAC,MAAM,EAAoB,SAAS,EAAY,CAAC,CAAC,CAAC,CAAC,CAQnd,SAAwB,EAAY,CAAC,WAAS,SAAO,WAAS,SAAO,MAAI,CAAC,GAAG,CAAC,GAAU,CAAC,GAAQ,CAAC,EAAQ,OAAoB,EAAK,EAAW,CAAC,MAAM,UAAU,YAAY,8CAA8C,CAAC,CAC7N,IAAM,EAAU,gBAAgB,IAAW,MAAY,CAAC,IAAM,EAAQ,SAAS,cAAc,IAAI,IAA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