{"version":3,"file":"HeroEmailCapture.BtTbg2ql.mjs","names":["useState","useRef","useCallback","useMemo","startTransition"],"sources":["https:/framerusercontent.com/modules/ynhtWaxo4uYmCwVudCFT/Qz85Ezzc8QP0suPG0mdj/HeroEmailCapture.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useRef,useCallback,useEffect,useMemo,startTransition}from\"react\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n *//**\n * User request: Restyle HeroEmailCapture to match QuroHostSignupBar (two-row pill layout,\n * cream fields, red CTA pill, matching typography and visual states), keep existing submission\n * logic and controls, preserve responsive stacking under stack breakpoint, and expose sensible\n * style knobs.\n *\n * HeroEmailCapture — the sign-up strip.\n *\n * Josh: \"You already know that we kept your first name, last name, and email.\n * I don't know why you've designed it differently, but fix that!\"\n *\n * So the form asks for exactly what HubSpot stores: first name, last name,\n * email. It used to ask for one \"Your name\" box and split it on the server,\n * which guessed wrong on any name that is not two words.\n *\n * It posts to our own endpoint, which writes the contact through HubSpot's CRM\n * API with the private token held server-side. That token must never reach this\n * file: a code component ships to every visitor's browser.\n */const colors={espresso:\"rgb(75, 9, 4)\",lobster:\"rgb(235, 57, 16)\",mango:\"rgb(255, 180, 35)\",oat:\"rgb(242, 237, 208)\",richBlack:\"rgb(10, 10, 10)\"};// Four controls on one line needs real width. Below this the names pair up on\n// one line with the email under them; below `stackBreakpoint` all four go one\n// per line.\nconst ROW_MIN_WIDTH=760;export default function HeroEmailCapture({apiBaseUrl=\"https://journeys.qurocollective.com\",firstNamePlaceholder=\"First name\",lastNamePlaceholder=\"Last name\",placeholder=\"Email address\",buttonText=\"JOIN THE WAITLIST\",successMessage=\"You're on the list.\",stackBreakpoint=400,contactCategory=\"\",fieldFill=\"#FAF8EA\",fieldTextColor=\"#4B0904\",buttonFill=\"#EB3910\",buttonTextColor=\"#FAF8EA\",cornerRadius=999,controlHeight=56,style}){const[firstName,setFirstName]=useState(\"\");const[lastName,setLastName]=useState(\"\");const[email,setEmail]=useState(\"\");const[status,setStatus]=useState(\"idle\");const[message,setMessage]=useState(\"\");const[hovered,setHovered]=useState(false);const[focusedField,setFocusedField]=useState(null);const containerRef=useRef(null);const[width,setWidth]=useState(ROW_MIN_WIDTH);useEffect(()=>{const el=containerRef.current;if(!el)return;const check=()=>{startTransition(()=>setWidth(el.offsetWidth));};check();if(typeof ResizeObserver===\"undefined\")return;const ro=new ResizeObserver(check);ro.observe(el);return()=>ro.disconnect();},[]);const stacked=width<stackBreakpoint;const handleSubmit=useCallback(async()=>{if(status===\"loading\")return;const emailRegex=/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;if(!email||!emailRegex.test(email)||!firstName.trim()||!lastName.trim()){startTransition(()=>{setStatus(\"error\");setMessage(\"Please enter your first name, last name, and a valid email.\");});return;}startTransition(()=>{setStatus(\"loading\");setMessage(\"\");});try{const res=await fetch(`${apiBaseUrl.replace(/\\/$/,\"\")}/api/newsletter`,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({firstname:firstName.trim(),lastname:lastName.trim(),email:email.trim(),category:contactCategory||undefined})});if(res.ok){startTransition(()=>{setStatus(\"success\");setMessage(successMessage);setFirstName(\"\");setLastName(\"\");setEmail(\"\");});}else{startTransition(()=>{setStatus(\"error\");setMessage(\"Something went wrong. Please try again.\");});}}catch{startTransition(()=>{setStatus(\"error\");setMessage(\"Something went wrong. Please try again.\");});}},[firstName,lastName,email,status,apiBaseUrl,contactCategory,successMessage]);const handleKeyDown=useCallback(e=>{if(e.key===\"Enter\"){e.preventDefault();handleSubmit();}},[handleSubmit]);const fieldBase=useMemo(()=>({minWidth:0,height:controlHeight,minHeight:controlHeight,padding:\"0 24px\",border:\"1.5px solid rgba(75,9,4,0.18)\",borderRadius:cornerRadius,outline:\"none\",background:fieldFill,color:fieldTextColor,fontFamily:\"'Filson Pro', 'Helvetica Neue', Arial, sans-serif\",fontSize:16,fontWeight:500,letterSpacing:\"-0.01em\",boxSizing:\"border-box\",transition:\"box-shadow 0.2s ease, border-color 0.2s ease\"}),[controlHeight,cornerRadius,fieldFill,fieldTextColor]);const fieldWithFocus=useCallback((name,extra)=>({...fieldBase,...extra,borderColor:focusedField===name?\"rgba(75,9,4,0.55)\":\"rgba(75,9,4,0.18)\",boxShadow:focusedField===name?\"0 0 0 3px rgba(235,57,16,0.14)\":\"inset 0 0 0 1px rgba(255,255,255,0.28)\"}),[fieldBase,focusedField]);const buttonStyle=useMemo(()=>({flexShrink:0,height:controlHeight,minHeight:controlHeight,width:stacked?\"100%\":undefined,padding:\"0 38px\",border:\"none\",borderRadius:cornerRadius,cursor:status===\"loading\"?\"default\":\"pointer\",background:buttonFill,color:buttonTextColor,fontFamily:\"'Filson Pro', 'Helvetica Neue', Arial, sans-serif\",fontSize:14,fontWeight:800,letterSpacing:\"0.14em\",textTransform:\"uppercase\",opacity:status===\"loading\"?.8:1,filter:hovered&&status!==\"loading\"?\"brightness(0.94)\":\"none\",transition:\"filter 0.18s ease, opacity 0.18s ease\"}),[controlHeight,stacked,cornerRadius,status,buttonFill,buttonTextColor,hovered]);const firstNameField=/*#__PURE__*/_jsx(\"input\",{type:\"text\",autoComplete:\"given-name\",value:firstName,onChange:e=>{startTransition(()=>{setFirstName(e.target.value);if(status===\"error\"){setStatus(\"idle\");setMessage(\"\");}});},onKeyDown:handleKeyDown,onFocus:()=>startTransition(()=>setFocusedField(\"first\")),onBlur:()=>startTransition(()=>setFocusedField(null)),placeholder:firstNamePlaceholder,\"aria-label\":firstNamePlaceholder,style:fieldWithFocus(\"first\",{flex:stacked?undefined:\"1 1 180px\",width:stacked?\"100%\":undefined})});const lastNameField=/*#__PURE__*/_jsx(\"input\",{type:\"text\",autoComplete:\"family-name\",value:lastName,onChange:e=>{startTransition(()=>{setLastName(e.target.value);if(status===\"error\"){setStatus(\"idle\");setMessage(\"\");}});},onKeyDown:handleKeyDown,onFocus:()=>startTransition(()=>setFocusedField(\"last\")),onBlur:()=>startTransition(()=>setFocusedField(null)),placeholder:lastNamePlaceholder,\"aria-label\":lastNamePlaceholder,style:fieldWithFocus(\"last\",{flex:stacked?undefined:\"1 1 180px\",width:stacked?\"100%\":undefined})});const emailField=/*#__PURE__*/_jsx(\"input\",{type:\"email\",autoComplete:\"email\",value:email,onChange:e=>{startTransition(()=>{setEmail(e.target.value);if(status===\"error\"){setStatus(\"idle\");setMessage(\"\");}});},onKeyDown:handleKeyDown,onFocus:()=>startTransition(()=>setFocusedField(\"email\")),onBlur:()=>startTransition(()=>setFocusedField(null)),placeholder:placeholder,\"aria-label\":placeholder,style:fieldWithFocus(\"email\",{flex:stacked?undefined:1,width:stacked?\"100%\":undefined})});const button=/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:handleSubmit,onMouseEnter:()=>startTransition(()=>setHovered(true)),onMouseLeave:()=>startTransition(()=>setHovered(false)),disabled:status===\"loading\",style:buttonStyle,children:status===\"loading\"?\"…\":buttonText});const nameRow={display:\"flex\",flexDirection:stacked?\"column\":\"row\",width:\"100%\",gap:12};const emailRow={display:\"flex\",flexDirection:stacked?\"column\":\"row\",alignItems:stacked?\"stretch\":\"center\",width:\"100%\",gap:12};return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{...style,position:\"relative\",display:\"flex\",flexDirection:\"column\",width:\"100%\",gap:10,boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsxs(\"div\",{style:nameRow,children:[firstNameField,lastNameField]}),/*#__PURE__*/_jsxs(\"div\",{style:emailRow,children:[emailField,button]}),message?/*#__PURE__*/_jsx(\"p\",{style:{margin:0,fontFamily:\"'Filson Pro', 'Helvetica Neue', Arial, sans-serif\",fontSize:13,fontWeight:500,color:status===\"success\"?fieldTextColor:status===\"error\"?buttonFill:fieldTextColor},children:message}):null]});}addPropertyControls(HeroEmailCapture,{apiBaseUrl:{type:ControlType.String,title:\"Endpoint\",defaultValue:\"https://journeys.qurocollective.com\",description:\"Where the sign-up is sent. The HubSpot token lives there, never here.\"},firstNamePlaceholder:{type:ControlType.String,title:\"First Name Placeholder\",defaultValue:\"First name\"},lastNamePlaceholder:{type:ControlType.String,title:\"Last Name Placeholder\",defaultValue:\"Last name\"},placeholder:{type:ControlType.String,title:\"Email Placeholder\",defaultValue:\"Email address\"},buttonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"JOIN THE WAITLIST\"},successMessage:{type:ControlType.String,title:\"Success Message\",defaultValue:\"You're on the list.\"},stackBreakpoint:{type:ControlType.Number,title:\"Stack Below\",defaultValue:400,min:200,max:600,unit:\"px\"},contactCategory:{type:ControlType.String,title:\"Contact Category\",defaultValue:\"\",description:\"Hidden field value for HubSpot contact_category property\"},fieldFill:{type:ControlType.Color,title:\"Field Fill\",defaultValue:\"#FAF8EA\"},fieldTextColor:{type:ControlType.Color,title:\"Field Text\",defaultValue:\"#4B0904\"},buttonFill:{type:ControlType.Color,title:\"Button Fill\",defaultValue:\"#EB3910\"},buttonTextColor:{type:ControlType.Color,title:\"Button Text\",defaultValue:\"#FAF8EA\"},cornerRadius:{type:ControlType.Number,title:\"Corner Radius\",defaultValue:999,min:8,max:999},controlHeight:{type:ControlType.Number,title:\"Height\",defaultValue:56,min:36,max:80,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HeroEmailCapture\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HeroEmailCapture.map"],"mappings":"oNAwBwB,SAAwB,EAAiB,CAAC,aAAW,sCAAsC,uBAAqB,aAAa,sBAAoB,YAAY,cAAY,gBAAgB,aAAW,oBAAoB,iBAAe,sBAAsB,kBAAgB,IAAI,kBAAgB,GAAG,YAAU,UAAU,iBAAe,UAAU,aAAW,UAAU,kBAAgB,UAAU,eAAa,IAAI,gBAAc,GAAG,SAAO,CAAC,GAAK,CAAC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