1import{r as s,j as e,x as E,ad as M,ae as O,z as $,t as p}from"./index-CKp-ZQ4b.js";import{C as T}from"./circle-alert-9HQKozo7.js";const h=[{value:"general_question",label:"General Wagging"},{value:"account_subscription",label:"Account & Subscription"},{value:"billing_payments",label:"Billing & Payments"},{value:"technical_support",label:"Technical Support / Bug"},{value:"canineq_app_help",label:"CanineQ App Help"},{value:"press_media",label:"Press & Media"},{value:"partnership_business",label:"Partnership / Business"},{value:"feedback_suggestions",label:"Feedback & Suggestions"}];function z(){const r=s.useId(),i=s.useId(),n=s.useId(),l=s.useId(),o=s.useId(),[f,y]=s.useState(""),[j,N]=s.useState(""),[c,w]=s.useState(h[0].value),[v,S]=s.useState(""),[k,C]=s.useState(""),[d,u]=s.useState("idle"),[t,I]=s.useState({}),[q,m]=s.useState("");function P(){const a={};return f.trim()||(a.fullName="Please enter your full name."),/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(j.trim())||(a.email="Please enter a valid email address."),v.trim()||(a.message="Please enter a message."),h.some(x=>x.value===c)||(a.inquirySubject="Please choose a subject."),I(a),Object.keys(a).length===0}async function F(a){if(a.preventDefault(),!P()){p("form_error",{form:"contact",field:Object.keys(t)[0]||"unknown"});return}u("submitting"),m("");try{const x=await fetch("/api/public/contact",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({full_name:f.trim(),email:j.trim(),inquiry_subject:c,message:v.trim(),website:k})}),_=await x.json().catch(()=>({}));if(!x.ok||!_.ok){u("error"),m(_.error||"Something went wrong. Please try again."),p("form_error",{form:"contact",field:"server"});return}u("success"),m("Message sent â we'll be in touch!"),p("generate_lead",{form:"contact",inquiry_subject:c}),y(""),N(""),w(h[0].value),S("")}catch{u("error"),m("Network error. Please try again."),p("form_error",{form:"contact",field:"network"})}}return e.jsxs("div",{className:"min-h-screen bg-surface",children:[e.jsx(E,{variant:"solid"}),e.jsxs("main",{className:"pt-24",children:[e.jsxs("section",{className:"relative isolate overflow-hidden",children:[e.jsxs("div",{className:"absolute inset-0 -z-10",children:[e.jsx("img",{src:"https://images.unsplash.com/photo-1552053831-71594a27632d?auto=format&fit=crop&w=2000&q=80",alt:"",className:"h-full w-full object-cover object-[center_30%]","aria-hidden":!0}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-black/55 via-black/25 to-surface"})]}),e.jsxs("div",{className:"mx-auto max-w-3xl px-6 pt-16 pb-10 text-center text-white",children:[e.jsxs("h1",{className:"font-display text-4xl font-extrabold leading-tight sm:text-5xl",children:["How can we help you and your",e.jsx("br",{}),e.jsx("span",{className:"italic text-[hsl(var(--primary))]",children:"furry friend?"})]}),e.jsx("p",{className:"mx-auto mt-4 max-w-xl text-sm text-white/90 sm:text-base",children:"Our team of specialists is dedicated to guiding your dog's journey through precision science and compassionate support."})]}),e.jsx("div",{className:"mx-auto -mb-24 max-w-xl px-6 pb-24",children:e.jsx("div",{className:"rounded-3xl bg-white p-7 shadow-[var(--shadow-lift)] sm:p-9",children:e.jsxs("form",{noValidate:!0,onSubmit:F,className:"space-y-5",children:[e.jsxs("div",{className:"hidden","aria-hidden":"true",children:[e.jsx("label",{htmlFor:o,children:"Website"}),e.jsx("input",{id:o,name:"website",type:"text",tabIndex:-1,autoComplete:"off",value:k,onChange:a=>C(a.target.value)})]}),e.jsx(g,{id:r,label:"Full Name",required:!0,error:t.fullName,children:e.jsx("input",{id:r,type:"text",autoComplete:"name",required:!0,value:f,onChange:a=>y(a.target.value),"aria-invalid":!!t.fullName,"aria-describedby":t.fullName?`${r}-err`:void 0,placeholder:"Enter your name",className:b})}),e.jsx(g,{id:i,label:"Email Address",required:!0,error:t.email,children:e.jsx("input",{id:i,type:"email",autoComplete:"email",required:!0,value:j,onChange:a=>N(a.target.value),"aria-invalid":!!t.email,"aria-describedby":t.email?`${i}-err`:void 0,placeholder:"[email protected]",className:b})}),e.jsx(g,{id:n,label:"Inquiry Subject",required:!0,error:t.inquirySubject,children:e.jsx("select",{id:n,required:!0,value:c,onChange:a=>w(a.target.value),className:`${b} pr-10`,children:h.map(a=>e.jsx("option",{value:a.value,children:a.label},a.value))})}),e.jsx(g,{id:l,label:"Message for the Team",required:!0,error:t.message,children:e.jsx("textarea",{id:l,required:!0,rows:5,value:v,onCh
1ange:a=>S(a.target.value),"aria-invalid":!!t.message,"aria-describedby":t.message?`${l}-err`:void 0,placeholder:"How can we assist you today?",className:`${b} resize-y`})}),e.jsx("button",{type:"submit",disabled:d==="submitting",className:"flex w-full items-center justify-center gap-2 rounded-full px-6 py-4 text-sm font-semibold uppercase tracking-[0.18em] text-primary-foreground shadow-[var(--shadow-soft)] transition-all duration-300 ease-out hover:-translate-y-0.5 hover:shadow-[var(--shadow-lift)] disabled:cursor-not-allowed disabled:opacity-70",style:{backgroundImage:"var(--gradient-primary)"},children:d==="submitting"?e.jsxs(e.Fragment,{children:[e.jsx(M,{className:"h-4 w-4 animate-spin"})," Sendingâ¦"]}):"Dispatch Message"}),d==="success"&&e.jsxs("div",{role:"status",className:"flex items-start gap-2 rounded-xl bg-emerald-50 px-4 py-3 text-sm text-emerald-800",children:[e.jsx(O,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("span",{children:q})]}),d==="error"&&e.jsxs("div",{role:"alert",className:"flex items-start gap-2 rounded-xl bg-red-50 px-4 py-3 text-sm text-red-800",children:[e.jsx(T,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("span",{children:q})]})]})})})]}),e.jsx("div",{className:"h-24"}),e.jsx($,{})]})]})}
1const b="block w-full rounded-xl border border-foreground/10 bg-surface-lowest px-4 py-3 text-sm text-foreground placeholder:text-foreground/40 focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/30";function g({id:r,label:i,required:n,error:l,children:o}){return e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("label",{htmlFor:r,className:"block text-[11px] font-semibold uppercase tracking-[0.16em] text-foreground/70",children:[i,n&&e.jsx("span",{className:"ml-1 text-primary",children:"*"})]}),o,l&&e.jsx("p",{id:`${r}-err`,className:"text-xs font-medium text-red-600",children:l})]})}export{z as component};
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.