1import{r as i,S as B,j as e,U as x}from"./vendor-CexQRgJT.js";import{c as d,B as g,I as b}from"./main-Z2LNm1R9.js";import{L as o}from"./label-DpZaEC8N.js";import{R as L}from"./quizService-r-mKDJTB.js";import{r as A,H as D,i as I,L as P}from"./icons-C-m-W0hx.js";import{m as w}from"./motion-C_xGicOG.js";import"./braintree-Dy4tYErP.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./pdf-ClIykhnB.js";import"./radix-tjr_ed6w.js";const T=["General Question","Claim Status","Payment / Withdrawal","Account Issue","Technical Problem","Other"],q=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,m={name:s=>s.trim()?s.trim().includes(" ")?"":"Please enter your full name (first name and last name).":"Full name is required.",email:s=>s.trim()?q.test(s.trim())?"":"Enter a valid email address.":"Email address is required.",category:s=>s?"":"Please select a category.",subject:s=>s.trim()?"":"Subject is required.",message:s=>s.trim()?"":"Message is required."};function V(){const[s,h]=i.useState({name:"",email:"",category:"",subject:"",message:""}),[r,u]=i.useState({name:!1,email:!1,category:!1,subject:!1,message:!1}),[S,f]=i.useState(!1),[j,p]=i.useState(!1),[y,v]=i.useState(""),k=B(),l=(a,n)=>h(E=>({...E,[a]:n})),c=a=>u(n=>({...n,[a]:!0})),t={name:m.name(s.name),email:m.email(s.email),category:m.category(s.category),subject:m.subject(s.subject),message:m.message(s.message)},N=Object.values(t).every(a=>!a);i.useEffect(()=>{localStorage.getItem("access_token")||k(d("Login"))},[]);const C=async a=>{if(a.preventDefault(),u({name:!0,email:!0,category:!0,subject:!0,message:!0}),!!N){p(!0),v("");try{await L({name:s.name,email:s.email,category:s.category,subject:s.subject,message:s.message}),f(!0)}catch(n){v(n.message||"Failed to submit ticket. Please try again.")}finally{p(!1)}}};return e.jsxs("div",{className:"min-h-screen bg-[#f5f5f0]",children:[e.jsxs("header",{className:"fixed top-0 left-0 right-0 z-50 bg-white border-b border-gray-200 px-6 h-16 flex items-center justify-between",children:[e.jsx(x,{to:d("Dashboard"),
1children:e.jsx("img",{src:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/698a0b917523116de4edac1b/2a6311660_ClaimCowHorizontal2.png",alt:"Claim Cow",className:"h-9 w-auto cursor-pointer"})}),e.jsx("div",{className:"flex items-center gap-3 mb-8",children:e.jsxs(x,{to:d("Dashboard"),className:"inline-flex items-center gap-1 text-gray-500 hover:text-black text-sm mt-10",children:[e.jsx(A,{className:"w-4 h-4"})," Back to Dashboard"]})})]}),e.jsx("div",{className:"pt-24 pb-16 px-6 flex justify-center",children:e.jsx("div",{className:"max-w-xl w-full",children:e.jsxs(w.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-black flex items-center justify-center",children:e.jsx(D,{className:"w-5 h-5 text-white"})}),e.jsx("h1",{className:"text-3xl font-bold text-black",children:"Support"})]}),e.jsx("p",{className:"text-gray-500 mb-8",children:"Submit a ticket and our team will get back to you within 1â2 business days."}),S?e.jsxs(w.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"bg-white rounded-2xl border border-gray-200 p-10 text-center shadow-sm",children:[e.jsx(I,{className:"w-16 h-16 text-emerald-500 mx-auto mb-4"}),e.jsx("h2",{className:"text-2xl font-bold text-black mb-2",children:"Ticket Submitted!"}),e.jsxs("p",{className:"text-gray-500 mb-6",children:["We've received your request and will follow up at ",e.jsx("span",{className:"font-semibold text-black",children:s.email}),"."]}),e.jsx(g,{onClick:()=>{h({name:"",email:"",category:"",subject:"",message:""}),u({name:!1,email:!1,category:!1,subject:!1,message:!1}),f(!1)},variant:"outline",className:"rounded-full px-6 mr-3",children:"Submit Another"}
1),e.jsx(x,{to:d("Dashboard"),children:e.jsx(g,{className:"bg-black hover:bg-gray-800 text-white rounded-full px-6",children:"Back to Dashboard"})})]}):e.jsxs("form",{onSubmit:C,className:"bg-white rounded-2xl border border-gray-200 p-8 space-y-5 shadow-sm",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-5",children:[e.jsxs("div",{children:[e.jsx(o,{children:"Full Name"}),e.jsx(b,{className:`mt-1 ${r.name&&t.name?"border-red-500 focus-visible:ring-red-500":""}`,placeholder:"John Smith",value:s.name,onChange:a=>l("name",a.target.value),onBlur:()=>c("name")}),r.name&&t.name&&e.jsx("p",{className:"mt-1 text-xs text-red-600",children:t.name})]}),e.jsxs("div",{children:[e.jsx(o,{children:"Email Address"}),e.jsx(b,{className:`mt-1 ${r.email&&t.email?"border-red-500 focus-visible:ring-red-500":""}`,type:"email",placeholder:"[email protected]",value:s.email,onChange:a=>l("email",a.target.value),onBlur:()=>c("email")}),r.email&&t.email&&e.jsx("p",{className:"mt-1 text-xs text-red-600",children:t.email})]})]}),e.jsxs("div",{children:[e.jsx(o,{children:"Category"}),e.jsxs("select",{value:s.category,onChange:a=>l("category",a.target.value),onBlur:()=>c("category"),className:`mt-1 w-full h-9 rounded-md border bg-background px-3 py-1 text-sm shadow-sm focus:outline-none focus:ring-1 focus:ring-ring text-gray-700 ${r.category&&t.category?"border-red-500 focus:ring-red-500":"border-input"}`,children:[e.jsx("option",{value:"",children:"Select a categoryâ¦"}),T.map(a=>e.jsx("option",{value:a,children:a},a))]}),r.category&&t.category&&e.jsx("p",{className:"mt-1 text-xs text-red-600",children:t.category})]}),e.jsxs("div",{children:[e.jsx(o,{children:"Subject"}),e.jsx(b,{className:`mt-1 ${r.subject&&t.subject?"border-red-500 focus-visible:ring-red-500":""}`,placeholder:"Brief summary of your issue",value:s.subject,onChange:a=>l("subject",a.target.value),onBlur:()=>c("subject")}),r.subject&&t.subject&&e.jsx("p",{className:"mt-1 text-xs text-red-600",children:t.subject})]}),e.jsxs("div",{children:[e.jsx(o,{children:"Message"}),e.jsx("textarea",{value:s.message,onChange:a=>l("message",a.target.value),onBlur:()=>c("message"),rows:5,placeholder:"Please describe your issue in detailâ¦",className:`mt-1 w-full rounded-md border bg-background px-3 py-2 text-sm shadow-sm focus:outline-none focus:ring-1 resize-none ${r.message&&t.message?"border-red-500 focus:ring-red-500":"border-input focus:ring-ring"}`}),r.message&&t.message&&e.jsx("p",{className:"mt-1 text-xs text-red-600",children:t.message})]}),y&&e.jsx("p",{className:"text-red-600 text-sm",children:y}),e.jsx(g,{type:"submit",disabled:!N||j,className:"w-full bg-black hover:bg-gray-800 text-white rounded-full py-5 text-base font-semibold disabled:opacity-40 flex items-center justify-center gap-2",children:j?e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"w-4 h-4 animate-spin"})," Submitting..."]}):"Submit Ticket"})]})]})})})]})}export{V 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.