{"version":3,"file":"OneStepBookDemoForm.BmZU-AIh.mjs","names":[],"sources":["https:/framerusercontent.com/modules/mUyjRlDdmNm0wX9OjbJw/cUSWHFXLjKzVRRPVYo7d/OneStepBookDemoForm.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";const BASE_CALENDLY_URL=\"https://calendly.com/thomas-747/jimo-intro-call?hide_gdpr_banner=1&hide_event_type_details=1\";const useStore=createStore({formFieldsValid:false,firstName:\"\",companyName:\"Jimo\",calendlyLink:BASE_CALENDLY_URL});// ─── HELPER: Extract company name from email domain ───────────────────────────\n// e.g. thomas@jimo.ai → \"Jimo\" | sarah@usejimo.com → \"Usejimo\"\nconst extractCompanyName=email=>{const domain=email.split(\"@\")[1];if(!domain)return\"\";const base=domain.split(\".\")[0];return base.charAt(0).toUpperCase()+base.slice(1).toLowerCase();};// ─── withNextButton ───────────────────────────────────────────────────────────\nexport function withNextButton(Component){return props=>{const[store]=useStore();const variant=store.formFieldsValid?\"Default\":\"Disabled\";return /*#__PURE__*/_jsx(Component,{...props,variant:variant});};}// ─── withCalendly ─────────────────────────────────────────────────────────────\nexport function withCalendly(Component){return props=>{const[store]=useStore();return /*#__PURE__*/_jsx(Component,{...props,calendlylink:store.calendlyLink});};}function capitalize(word){if(!word)return\"\";return word[0].toUpperCase()+word.slice(1).toLowerCase();}// ─── withFirstName ────────────────────────────────────────────────────────────\nexport function withFirstName(Component){return props=>{const[store]=useStore();const textCapital=capitalize(store.firstName);const text=store.firstName?`Welcome ${textCapital}, let's have a quick chat!`:\"Welcome, let's have a quick chat!\";return /*#__PURE__*/_jsx(Component,{...props,text:text});};}// ─── withCompanyName ──────────────────────────────────────────────────────────\nexport function withCompanyName(Component){return props=>{const[store]=useStore();return /*#__PURE__*/_jsx(Component,{...props,text:store.companyName});};}// ─── withCompanyInitial ───────────────────────────────────────────────────────\nexport function withCompanyInitial(Component){return props=>{const[store]=useStore();const initial=store.companyName?store.companyName.charAt(0):\"\";return /*#__PURE__*/_jsx(Component,{...props,text:initial});};}// ─── withCompanyVariant ───────────────────────────────────────────────────────\nexport function withCompanyVariant(Component){return props=>{const[store]=useStore();const isJimo=store.companyName.toLowerCase()===\"jimo\"||store.companyName.toLowerCase()===\"usejimo\";const variant=isJimo?\"default\":\"filled\";return /*#__PURE__*/_jsx(Component,{...props,variant:variant});};}// ─── withFormValidation ───────────────────────────────────────────────────────\nexport function withFormValidation(Component){return props=>{const[,setStore]=useStore();useEffect(()=>{const emailInput=document.querySelector(\"input[name='email']\");const nameInput=document.querySelector(\"input[name='first-name']\");const lastNameInput=document.querySelector(\"input[name='last-name']\");const channelInput=document.querySelector(\"input[name='channel']\");const buildCalendlyLink=()=>{const name=nameInput?.value.trim()??\"\";const email=emailInput?.value.trim()??\"\";return`${BASE_CALENDLY_URL}&name=${encodeURIComponent(name)}&email=${encodeURIComponent(email)}`;};const checkFormValidity=()=>{const isEmailValid=emailInput&&emailInput.value.trim()!==\"\"&&emailInput.checkValidity()&&emailInput.validationMessage===\"\";const isNameValid=nameInput&&nameInput.value.trim()!==\"\";const isLastNameValid=lastNameInput&&lastNameInput.value.trim()!==\"\";const isChannelValid=channelInput&&channelInput.value.trim()!==\"\";const allValid=!!isEmailValid&&!!isNameValid&&!!isLastNameValid&&!!isChannelValid;const firstName=nameInput?.value.trim()??\"\";const extracted=extractCompanyName(emailInput?.value.trim()??\"\");const companyName=extracted!==\"\"?extracted:\"Jimo\";const calendlyLink=buildCalendlyLink();setStore({formFieldsValid:allValid,firstName,companyName,calendlyLink});};const handleEmailInput=()=>{if(!emailInput)return;const blockedEmailDomains=[\"gmail\",\"yahoo\",\"hotmail\",\"outlook\",\"live\",\"aol\",\"icloud\",\"mail\",\"protonmail\",\"zoho\",\"test\",\"gmai\",\"msn\",\"yandex\",\"gmx\",\"aim\",\"inbox\",\"example\",\"gmail.com\",\"10minutemail\",\"guerrillamail\",\"mailinator\",\"tempmail\",\"maildrop\",\"yopmail\",\"trashmail\",\"getnada\",\"mailnesia\",\"fakemail\",\"throwawaymail\",\"sharklasers\",\"spamgourmet\",\"moakt\",\"dispostable\",\"mailcatch\",\"mintemail\",\"mytempemail\",\"tempinbox\",\"spam4.me\",\"qq\",\"163\",\"bhuxp.org\",\"volku.org\",\"laxiw.org\",\"tst\",\"xxx\"];const emailPattern=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;const value=emailInput.value.trim();const domain=value.split(\"@\")[1];if(value===\"\"){emailInput.setCustomValidity(\"\");}else if(!emailPattern.test(value)){emailInput.setCustomValidity(\"Please input your email in the valid format.\");}else if(domain&&blockedEmailDomains.some(d=>domain.toLowerCase().includes(d.toLowerCase()))){emailInput.setCustomValidity(\"Please only enter your work email.\");}else{emailInput.setCustomValidity(\"\");}emailInput.reportValidity();setTimeout(checkFormValidity,100);};const handleFieldChange=()=>{setTimeout(checkFormValidity,100);};emailInput?.addEventListener(\"input\",handleEmailInput);emailInput?.addEventListener(\"blur\",handleEmailInput);nameInput?.addEventListener(\"input\",handleFieldChange);nameInput?.addEventListener(\"blur\",handleFieldChange);lastNameInput?.addEventListener(\"input\",handleFieldChange);lastNameInput?.addEventListener(\"blur\",handleFieldChange);channelInput?.addEventListener(\"input\",handleFieldChange);channelInput?.addEventListener(\"blur\",handleFieldChange);setTimeout(checkFormValidity,200);return()=>{emailInput?.removeEventListener(\"input\",handleEmailInput);emailInput?.removeEventListener(\"blur\",handleEmailInput);nameInput?.removeEventListener(\"input\",handleFieldChange);nameInput?.removeEventListener(\"blur\",handleFieldChange);lastNameInput?.removeEventListener(\"input\",handleFieldChange);lastNameInput?.removeEventListener(\"blur\",handleFieldChange);channelInput?.removeEventListener(\"input\",handleFieldChange);channelInput?.removeEventListener(\"blur\",handleFieldChange);};},[props.className]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withCompanyInitial\":{\"type\":\"reactHoc\",\"name\":\"withCompanyInitial\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCalendly\":{\"type\":\"reactHoc\",\"name\":\"withCalendly\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFormValidation\":{\"type\":\"reactHoc\",\"name\":\"withFormValidation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCompanyVariant\":{\"type\":\"reactHoc\",\"name\":\"withCompanyVariant\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withNextButton\":{\"type\":\"reactHoc\",\"name\":\"withNextButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCompanyName\":{\"type\":\"reactHoc\",\"name\":\"withCompanyName\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFirstName\":{\"type\":\"reactHoc\",\"name\":\"withFirstName\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./OneStepBookDemoForm.map"],"mappings":"0KAIA,SAAgB,EAAa,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,GAAO,GAAU,CAAC,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,aAAa,EAAM,aAAa,CAAC,EAAI,SAAS,EAAW,EAAK,CAAmB,OAAd,EAAqB,EAAK,GAAG,aAAa,CAAC,EAAK,MAAM,EAAE,CAAC,aAAa,CAA3D,GAC1M,SAAgB,EAAc,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,GAAO,GAAU,CAAO,EAAY,EAAW,EAAM,UAAU,CAAO,EAAK,EAAM,UAAU,WAAW,EAAY,4BAA4B,oCAAoC,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAW,OAAK,CAAC,EACxS,SAAgB,EAAgB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,GAAO,GAAU,CAAC,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,KAAK,EAAM,YAAY,CAAC,EACvJ,SAAgB,EAAm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