PageSourceSearch

https://app.hvacquote.ai/assets/ContactFormIframe-Blp6iV5B.js

js hvacquote.ai collected 2026-10-05 12:03:55 UTC 14,078 bytes, 7 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/virtualPageview-CqNLKNYK.js","assets/index-EWkg1c6C.js","assets/index-CwWVFayG.css"])))=>i.map(i=>d[i]);
2import{j as e,l as q,r as _,t as M,s as x,m as R,Z as $,R as A,_ as B,u as W,Y}from"./index-EWkg1c6C.js";import{C as Z,a as J,b as K,c as Q,d as X}from"./card-D0d-k7yW.js";import{u as ee,F,a as I,b as N,c as T,d as te}from"./form-BNlskfht.js";import{s as oe}from"./zod-IW2ToB8l.js";import{o as re,b as ne,s as k}from"./index-D_6T-AOl.js";import{s as se}from"./smsService-CCXDd6nY.js";import{sendToZapier as ae}from"./zapierUtils-Oor4FNIE.js";import{trackLeadSubmission as ie,loadCompanyTracking as ce}from"./googleTrackingUtils-BLFb_lLn.js";import{d as le,F as me,C as G,L as ue}from"./LoadingIndicator-DnlHB5Ln.js";import{deriveAttributionSource as de}from"./sourceMapping-iKGtgk1K.js";import{deriveSourceFromCurrentContext as pe}from"./deriveSourceContext-Cex3hQ9j.js";import{getAttributionData as H,buildTouchpointEvents as fe,clearAttributionData as ge,initAttributionTracking as he}from"./attributionTracking-BMaIWpVW.js";import{T as ye}from"./textarea-DzZ4A2Ed.js";import{C as _e,u as be}from"./useFormAnalytics-DpLs7PIv.js";import{useFormColorsStore as U}from"./form-colors-BM-q2uj6.js";import{u as ve}from"./useCompanyData-o5WF9n1T.js";import{u as xe}from"./useNoIndex-B7MCCrm0.js";import"./pricingConfigForSubmission-C491F_Ed.js";import"./waterFiltrationTypes-CpS4bVyr.js";import"./pricing-configuration-B4MxP6s6.js";import"./persistence-vLURGQXX.js";import"./estimator-bootstrap-DOXejGiW.js";import"./system-settings-DId-8D5N.js";import"./tune-up-BJJHaQVf.js";import"./tuneUpService-BO3MYvor.js";import"./rebates-BjHesgMK.js";import"./reviews-00BSxLfv.js";import"./reviewService-D_s1OzFY.js";import"./companySettings-Bb2zmqm1.js";import"./clarityUtils-C0rJw3Qr.js";import"./checkbox-B3M24npy.js";import"./index-D5V2VfrB.js";import"./legalUrls-DuixqaIk.js";const we=({children:i,className:a,direction:c="column",spacing:h="4",align:u,justify:g,wrap:p=!1,as:o="div"})=>{const f=()=>c==="row"?"flex-row":"flex-col",y=()=>c==="row"?`space-x-${h}`:`space-y-${h}`,b=()=>{if(!u)return"";switch(u){case"start":return"items-start";case"center":return"items-center";case"end":return"items-end";case"between":return"items-stretch";default:return""}},n=()=>{if(!g)return"";switch(g){case"start":return"justify-start";case"center":return"justify-center";case"end":return"justify-end";case"between":return"justify-between";case"around":return"justify-around";case"evenly":return"justify-evenly";default:return""}};return e.jsx(o,{className:q("flex",f(),y(),b(),n(),p&&"flex-wrap",a),children:i})},je=re({name:k().min(1,{message:"Name is required"}),email:k().email({message:"Invalid email address"}),phone:k().min(10,{message:"Phone number must be at least 10 digits"}).max(10,{message:"Phone number must be exactly 10 digits"}).refine(i=>/^\d{10}$/.test(i.replace(/\D/g,"")),{message:"Phone number must contain 10 digits only"}),problem:k().min(1,{message:"Please describe your problem"}),acceptPrivacyPolicy:ne().optional()}),Ce=({privacyPolicyUrl:i,sourcePath:a="default",referrer:c="unknown"}={})=>{const[h,u]=_.useState(!1),[g,p]=_.useState(!1),o=ee({resolver:oe(je),defaultValues:{name:"",email:"",phone:"",problem:"",acceptPrivacyPolicy:!1}}),f=o.watch("acceptPrivacyPolicy");return{form:o,isSubmitting:h,submitted:g,watchAcceptPrivacyPolicy:f,onSubmit:async n=>{u(!0);try{const m=new URLSearchParams(window.location.search),s=m.get("companyId");if(!s){M({title:"Error",description:"Unable to determine company, please try again",variant:"destructive"}),u(!1);return}const l=!!n.acceptPrivacyPolicy;n.acceptPrivacyPolicy;const v=m.get("utm_source")||void 0,w=m.get("utm_medium")||void 0,S=m.get("utm_campaign")||void 0,L=m.get("utm_term")||void 0,D=m.get("utm_content")||void 0,j=m.get("fbclid")||void 0,E=m.get("gclid")||void 0,C=le(v,w,j,c),P=pe({utm_source:v,utm_medium:w,gclid:E,fbclid:j,referrer_url:c}),z=`${n.problem||""}
3Source Path: ${a||"Not specified"}
4Referrer: ${c||"Not specified"}
5UTM Source: ${v||"Not specified"}
6UTM Medium: ${w||"Not specified"}
7UTM Campaign: ${S||"Not specified"}`,{data:d,error:O}=await x.from("leads").insert([{name:n.name,email:n.email,phone:n.phone,notes:z,company_id:s,status:"New",source:P.source,conversion_surface:"contact_form",integration_origin:"native",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),contact_consent:l,contact_consent_at:l?new Date().toISOString():null,attribution_source:de(P.source),attribution_confidence:P.confidence,fbclid:j||null,gclid:E||null,utm_source:v||null,utm_medium:w||null,utm_campaign:S||null,utm_term:L||null,utm_content:D||null}]).select("id").single();if(O)console.error("Error creating lead:",O);else{d.id;try{const t=H(),V=fe(t);await x.from("lead_attribution").insert({lead_id:d.id,company_id:s,visitor_id:t.visitor_id||null,gclid:E||t.gclid||null,fbclid:j||t.fbclid||null,fbp:t.fbp||null,fbc:t.fbc||null,user_agent:t.user_agent||null,utm_source:v||t.utm_source||null,utm_medium:w||t.utm_medium||null,utm_campaign:S||t.utm_campaign||null,utm_term:L||t.utm_term||null,utm_content:D||t.utm_content||null,landing_page_url:t.landing_page_url||null,landing_page_path:t.landing_page_path||null,referrer_url:t.referrer_url||c||null,device_type:t.device_type||null,device_os:t.device_os||null,user_city:t.user_city||null,user_state:t.user_state||null,first_touch_at:t.first_touch_at||null,conversion_at:t.conversion_at||new Date().toISOString(),page_visits:t.page_visits||[],touchpoint_events:V}),ge()}catch(t){console.error("Error saving attribution data:",t)}const r={id:d.id,name:n.name,email:n.email,phone:n.phone};l&&se(d.id,s,r).then(t=>{}).catch(t=>{console.error("Error sending immediate follow-up:",t)});try{const t=await x.functions.invoke("send-lead-notifications",{body:{leadId:d.id,companyId:s}})}catch(t){console.error("Error sending lead notification:",t)}C.shouldTrackGoogle&&ie("contact_form",{customer_name:n.name,customer_email:n.email,customer_phone:n.phone||"Not provided",problem:n.problem||"Not provided",source_path:a||"Not provided",attribution_source:C.platform,attribution_confidence:C.confidence}),C.confidence}try{const r=H(),t={leadId:d?.id||null,quoteType:"contact",name:n.name,email:n.email,phone:n.phone||null,address:null,type:null,size:null,heat:null,numberOfUnits:null,estimatedPrice:null,notes:n.problem||null,source:P.source,sourcePath:a||null,conversionSurface:"contact_form",integrationOrigin:"native",referrer:c||null,utmSource:v||null,utmMedium:w||null,utmCampaign:S||null,utmTerm:L||null,utmContent:D||null,gclid:E||r.gclid||null,fbclid:j||r.fbclid||null,fbp:r.fbp||null,fbc:r.fbc||null,userAgent:r.user_agent||null,contactConsent:n.acceptPrivacyPolicy||!1};await ae(null,t,"contact",s)}catch(r){console.error("Error sending data to Zapier:",r)}d?.id&&x.functions.invoke("send-to-callrail",{body:{lead_id:d.id,company_id:s}}).then(({error:r})=>{r&&console.error("CallRail dispatch error:",r)}).catch(r=>{console.error("CallRail dispatch failed:",r)}),d?.id&&x.functions.invoke("google-ads-upload-conversion",{body:{lead_id:d.id,company_id:s,currency:"USD"}}).then(({error:r})=>{r&&console.error("Google Ads conversion upload error:",r)}).catch(r=>{console.error("Google Ads conversion upload failed:",r)});try{const{data:r}=await x.from("integration_settings").select("default_assignee_id").eq("company_id",s).maybeSingle();r?.default_assignee_id&&d&&(await x.from("leads").update({assigned_to:r.default_assignee_id}).eq("id",d.id),r.default_assignee_id)}catch(r){console.error("Error assigning lead:",r)}try{window.parent.postMessage({type:"CONTACT_FORM_SUBMITTED",success:!0},"*")}catch(r){console.error("Error notifying parent window:",r)}p(!0),M({title:"Success",description:"Your message has been sent successfully!"})}catch(m){console.error("Error submitting contact form:",m),M({title:"Error",description:"There was an error submitting your message. Please try again.",variant:"destructive"})}finally{u(!1)}},resetForm:()=>{p(!1),o.reset()}}},Se=({form:i,privacyPolicyUrl:a,termsOfServiceUrl:c,isSubmitting:h,watchAcceptPrivacyPolicy:u,companyName:g="",companySlug:p})=>e.jsxs(e.Fragment,{children:[e.jsx(F,{control:i.control,name:"name",render:({field:o})=>e.jsxs(I,{children:[e.jsx(N,{children:e.jsx(R,{label:"Name",error:i.formState.errors.name?.message,...o})}),e.jsx(T,{})]})}),e.jsx(F,{control:i.control,name:"email",render:({field:o})=>e.jsxs(I,{children:[e.jsx(N,{children:e.jsx(R,{label:"Email",error:i.formState.errors.email?.message,...o})}),e.jsx(T,{})]})}),e.jsx(F,{control:i.control,name:"phone",render:({field:o})=>e.jsxs(I,{children:[e.jsx(N,{children:e.jsx(R,{label:"Phone",error:i.formState.errors.phone?.message,...o})}),e.jsx(T,{})]})}),e.jsx(F,{control:i.control,name:"problem",render:({field:o})=>e.jsx(I,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Describe Your Problem"}),e.jsx(N,{children:e.jsx(ye,{className:"min-h-16",placeholder:"Please describe what issues you're experiencing...",...o})}),e.jsx(T,{})]})})}),e.jsx("div",{className:"mt-4",children:e.jsx(_e,{companyName:g,companySlug:p,checked:u,onChange:o=>i.setValue("acceptPrivacyPolicy",o,{shouldValidate:!0}),error:i.formState.errors.acceptPrivacyPolicy?.message,privacyPolicyUrl:a,termsOfServiceUrl:c})}),e.jsx($,{type:"submit",isLoading:h,className:"w-full mt-4",children:"Submit"})]}),Ee=({onReset:i})=>(A.useEffect(()=>{B(async()=>{const{fireVirtualPageview:a,VIRTUAL_PAGES:c}=await import("./virtualPageview-CqNLKNYK.js");return{fireVirtualPageview:a,VIRTUAL_PAGES:c}},__vite__mapDeps([0,1,2])).then(({fireVirtualPageview:a,VIRTUAL_PAGES:c})=>{a(c.contactSuccess)})},[]),e.jsxs("div",{className:"text-center py-4",children:[e.jsx("h3",{className:"font-medium text-lg text-primary",children:"Thank You!"}),e.jsx("p",{className:"mt-2",children:"We've received your message and will get back to you soon."}),e.jsx($,{className:"mt-4",onClick:i,variant:"outline",children:"Submit Another Inquiry"})]})),Pe=({privacyPolicyUrl:i,termsOfServiceUrl:a,sourcePath:c,referrer:h,maxWidth:u="3xl",companyName:g,companySlug:p})=>{const{form:o,isSubmitting:f,submitted:y,watchAcceptPrivacyPolicy:b,onSubmit:n,resetForm:m}=Ce({privacyPolicyUrl:i,sourcePath:c,referrer:h}),s=U(l=>l.getCssVariables);return U(l=>l.load),U(l=>l.companyId),A.useEffect(()=>{},[]),A.useEffect(()=>{},[i]),A.useEffect(()=>{o.formState},[o.formState]),e.jsx("div",{style:s(),className:"form-colors-container",children:e.jsx(me,{maxWidth:u,children:e.jsxs(Z,{className:"border-primary/10",children:[e.jsxs(J,{className:"space-y-1",children:[e.jsx(K,{className:"text-2xl text-form-heading",style:{color:"var(--form-heading-color, #1e3a5a)"},children:"Contact Us"}),e.jsx(Q,{className:"text-form-text",style:{color:"var(--form-text-color, #4b5563)"},children:y?"Thank you for contacting us. We'll get back to you shortly.":"Fill out the form below and we'll get back to you as soon as possible."})]}),e.jsx(X,{children:y?e.jsx(Ee,{onReset:m}):e.jsx(te,{...o,children:e.jsx("form",{onSubmit:o.handleSubmit(n),className:"space-y-2.5",children:e.jsx(Se,{form:o,privacyPolicyUrl:i,termsOfServiceUrl:a,isSubmitting:f,watchAcceptPrivacyPolicy:b,companyName:g,companySlug:p})})})})]})})})},it=()=>{xe();const[i]=W(),a=i.get("companyId"),c=i.get("page_url"),[h,u]=_.useState(0),[g,p]=_.useState(!1),{data:o,isLoading:f}
7=ve(a),y=c?decodeURIComponent(c):Y(),b=window.location.pathname.substring(1)||"default",n=be(a,"contact");return _.useEffect(()=>{n.trackStep("contact-form",0)},[]),_.useEffect(()=>{a&&ce(a),he()},[a]),_.useEffect(()=>{if(a){if(o?.is_exited){p(!0);return}p(!1)}},[a,o]),_.useEffect(()=>{const m=()=>{const s=document.documentElement.offsetHeight;u(s);try{window.parent.postMessage({type:"IFRAME_HEIGHT",height:s},"*")}catch(l){console.error("Error sending height to parent:",l)}};if(!f){m();const s=new ResizeObserver(()=>{m()}),l=document.getElementById("contact-form-container");return l&&s.observe(l),()=>{l&&s.unobserve(l),s.disconnect()}}},[f,o?.privacy_policy_url]),_.useEffect(()=>{o?.privacy_policy_url;try{f||window.parent.postMessage({type:"CONTACT_FORM_LOADED",companyId:a,parentPageUrl:y,sourcePath:b,hasPrivacyPolicy:!!o?.privacy_policy_url},"*")}catch(s){console.error("Error sending loaded message to parent:",s)}const m=s=>{if(s.data&&s.data.type==="GET_HEIGHT"){const l=document.documentElement.offsetHeight;try{window.parent.postMessage({type:"IFRAME_HEIGHT",height:l},"*")}catch(v){console.error("Error sending height to parent:",v)}}};return window.addEventListener("message",m),()=>{window.removeEventListener("message",m)}},[o?.privacy_policy_url,a,f,y,b,c]),g?e.jsx("div",{id:"contact-form-container",className:"p-6 min-h-screen bg-background flex items-center justify-center",children:e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx("div",{className:"w-12 h-12 mx-auto mb-4 bg-destructive/10 rounded-full flex items-center justify-center",children:e.jsx("svg",{className:"w-6 h-6 text-destructive",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),e.jsx("h3",{className:"text-lg font-semibold text-destructive mb-2",children:"Service Unavailable"}),e.jsx("p",{className:"text-muted-foreground",children:"This service is temporarily unavailable. Please try again later."})]})}):e.jsx("div",{id:"contact-form-container",className:"p-6 min-h-screen bg-background",children:f?e.jsx(G,{children:e.jsx(we,{align:"center",justify:"center",className:"min-h-[300px]",children:e.jsx(ue,{message:"Loading Contact Form",size:"md"})})}):e.jsx(G,{children:e.jsx(Pe,{privacyPolicyUrl:o?.privacy_policy_url||null,termsOfServiceUrl:o?.terms_of_service_url||null,sourcePath:b,referrer:y,companyName:o?.name||void 0,companySlug:o?.slug||null})})})};export{it as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.