1import{j as e}from"./vendor-query-CVGh-ELh.js";import{r as f}from"./vendor-react-DB9rAGvu.js";import{u as q,e as F,F as n,a as r,b as t,c as o,d as c,t as E}from"./zod-C39BDLij.js";import{z as a}from"./index-DXqQCM1T.js";import{supabase as W}from"./client-BfCCFsgL.js";import{u as M}from"./use-toast-B7MW8ed7.js";import{S as b,N as C,F as N}from"./index-CTpZEOwk.js";import{B as w}from"./button-BbdshpzA.js";import{I as d}from"./input-Eg9fBFwO.js";import{C as O,T as S}from"./checkbox-D4zI2WCr.js";import{S as A,a as $,b as B,c as D,d as x}from"./select-2LJCC3zI.js";import{R as U,a as u}from"./radio-group-DIQk-UVv.js";import{C as k,c as v,a as V,b as Y,d as L}from"./card-BiOUXYze.js";import{C as z}from"./circle-check-big-DMZWilXS.js";import{S as H}from"./send-C3A3vFwn.js";import"./label-CRk45R_w.js";import"./index-BfEctM-5.js";import"./index-zFWbu1Fx.js";const G=a.object({name:a.string().min(2,"Name must be at least 2 characters").max(100),email:a.string().email("Please enter a valid email address").max(255),company:a.string().optional(),projectType:a.array(a.string()).min(1,"Please select at least one project type"),priority:a.string().min(1,"Please select a priority level"),scope:a.string().min(1,"Please select the scope"),timeline:a.string().optional(),description:a.string().min(20,"Please provide more details about your project (at least 20 characters)").max(2e3),successCriteria:a.string().min(10,"Please describe how you'll know the work is complete").max(1e3)}),J=["Website Updates","New Feature Development","Bug Fixes","SEO Improvements","Content Updates","Design Changes","Performance Optimization","AI Integration","Marketing Campaign","CRM Updates","CRM Automations","CRM Workflows","Other"],ue=()=>{const[p,h]=f.useState(!1),[T,j]=f.useState(!1),{toast:g}=M(),i=q({resolver:E(G),defaultValues:{name:"",email:"",company:"",projectType:[],priority:"",scope:"",timeline:"",description:"",successCriteria:""}}),R=async s=>{h(!0);try{const l=` 2PROJECT TYPE: ${s.projectType.join(", ")} 3 4PRIORITY: ${s.priority} 5 6SCOPE: ${s.scope} 7 8TIMELINE: ${s.timeline||"Not specified"} 9 10PROJECT DETAILS: 11${s.description} 12 13SUCCESS CRITERIA: 14${s.successCriteria} 15 16COMPANY: ${s.company||"Not specified"} 17 `.trim(),{error:m}=await W.functions.invoke("send-contact-email",{body:{name:s.name,email:s.email,company:s.company||"",message:l,subject:`Client Work Request: ${s.projectType.join(", ")}`}});if(m)throw m;j(!0),g({title:"Request Submitted!",description:"We've received your work request and will get back to you soon."})}catch(l){console.error("Error submitting work request:",l),g({title:"Submission Failed",description:"There was an error submitting your request. Please try again.",variant:"destructive"})}finally{h(!1)}};return T?e.jsxs(e.Fragment,{children:[e.jsx(b,{title:"Work Request Submitted",description:"Your work request has been submitted successfully."}),e.jsx(C,{}),e.jsx("main",{className:"min-h-screen bg-background pt-24 pb-16",children:e.jsx("div",{className:"container max-w-2xl mx-auto px-4",children:e.jsx(k,{className:"text-center",children:e.jsxs(v,{className:"pt-12 pb-8",children:[e.jsx(z,{className:"w-16 h-16 text-primary mx-auto mb-6"}),e.jsx("h1",{className:"text-2xl font-bold text-foreground mb-4",children:"Request Submitted!"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Thank you for your work request. We've received your submission and will review it shortly. Expect to hear back from us within 1-2 business days."}),e.jsx(w,{onClick:()=>j(!1),variant:"outline",children:"Submit Another Request"})]})})})}),e.jsx(N,{})]}):e.jsxs(e.Fragment,{children:[e.jsx(b,{title:"Client Work Request",description:"Submit a work request for your project. Tell us what you need and we'll get back to you promptly."}),e.jsx(C,{}),e.jsx("main",{className:"min-h-screen bg-background pt-24 pb-16",children:e.jsx("div",{className:"container max-w-2xl mx-auto px-4",children:e.jsxs(k,{children:[e.jsxs(V,{className:"text-center",children:[e.jsx(Y,{className:"text-2xl md:text-3xl",children:"Client Work Request"}),e.jsx(L,{className:"text-base",children:"Tell us about the work you need completed on your project"})]}),e.jsx(v,{children:e.jsx(F,{...i,children:e.jsxs("form",{onSubmit:i.handleSubmit(R),className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(n,{control:i.control,name:"name",render:({field:s})=>e.jsxs(r,{children:[e.jsx(t,{children:"Name *"}),e.jsx(o,{children:e.jsx(d,{placeholder:"Your name",...s})}),e.jsx(c,{})]})}),e.jsx(n,{control:i.control,name:"email",render:({field:s})=>e.jsxs(r,{children:[e.jsx(t,{children:"Email *"}),e.jsx(o,{children:e.jsx(d,{type:"email",placeholder:"[email protected]",...s})}),e.jsx(c,{})]})})]}),e.jsx(n,{control:i.control,name:"company",render:({field:s})=>
17e.jsxs(r,{children:[e.jsx(t,{children:"Company / Business Name"}),e.jsx(o,{children:e.jsx(d,{placeholder:"Your company name",...s})}),e.jsx(c,{})]})}),e.jsx(n,{control:i.control,name:"projectType",render:()=>e.jsxs(r,{children:[e.jsx(t,{children:"Type of Work Needed *"}),e.jsx("div",{className:"grid grid-cols-2 gap-3 mt-2",children:J.map(s=>e.jsx(n,{control:i.control,name:"projectType",render:({field:l})=>{var m;return e.jsxs(r,{className:"flex items-center space-x-2 space-y-0",children:[e.jsx(o,{children:e.jsx(O,{checked:(m=l.value)==null?void 0:m.includes(s),onCheckedChange:P=>{const y=l.value||[];P?l.onChange([...y,s]):l.onChange(y.filter(I=>I!==s))}})}),e.jsx(t,{className:"text-sm font-normal cursor-pointer",children:s})]})}},s))}),e.jsx(c,{})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(n,{control:i.control,name:"priority",render:({field:s})=>e.jsxs(r,{children:[e.jsx(t,{children:"Priority Level *"}),e.jsxs(A,{onValueChange:s.onChange,defaultValue:s.value,children:[e.jsx(o,{children:e.jsx($,{children:e.jsx(B,{placeholder:"Select priority"})})}),e.jsxs(D,{children:[e.jsx(x,{value:"low",children:"Low - No rush"}),e.jsx(x,{value:"medium",children:"Medium - Within a few weeks"}),e.jsx(x,{value:"high",children:"High - This week if possible"}),e.jsx(x,{value:"urgent",children:"Urgent - ASAP"})]})]}),e.jsx(c,{})]})}),e.jsx(n,{control:i.control,name:"timeline",render:({field:s})=>e.jsxs(r,{children:[e.jsx(t,{children:"Preferred Timeline"}),e.jsx(o,{children:e.jsx(d,{placeholder:"e.g., 2 weeks, by March 15",...s})}),e.jsx(c,{})]})})]}),e.jsx(n,{control:i.control,name:"scope",render:({field:s})=>e.jsxs(r,{className:"space-y-3",children:[e.jsx(t,{children:"Scope Clarification *"}),e.jsx(o,{children:e.jsxs(U,{onValueChange:s.onChange,defaultValue:s.value,className:"flex flex-col space-y-2",children:[e.jsxs(r,{className:"flex items-center space-x-3 space-y-0",children:[e.jsx(o,{children:e.jsx(u,{value:"existing"})}),e.jsx(t,{className:"font-normal cursor-pointer",children:"Update or fix an existing feature"})]}),e.jsxs(r,{className:"flex items-center space-x-3 space-y-0",children:[e.jsx(o,{children:e.jsx(u,{value:"new"})}),e.jsx(t,{className:"font-normal cursor-pointer",children:"Build something new"})]}),e.jsxs(r,{className:"flex items-center space-x-3 space-y-0",children:[e.jsx(o,{children:e.jsx(u,{value:"both"})}),e.jsx(t,{className:"font-normal cursor-pointer",children:"Both - updates and new features"})]})]})}),e.jsx(c,{})]})}),e.jsx(n,{control:i.control,name:"description",render:({field:s})=>e.jsxs(r,{children:[e.jsx(t,{children:"Project Details *"}),e.jsx(o,{children:e.jsx(S,{placeholder:"Please describe the work you need completed in detail. Include any specific requirements, goals, or reference materials...",className:"min-h-[120px] resize-y",...s})}),e.jsx(c,{})]})}),e.jsx(n,{control:i.control,name:"successCriteria",render:({field:s})=>e.jsxs(r,{children:[e.jsx(t,{children:"Success Criteria *"}),e.jsx(o,{children:e.jsx(S,{placeholder:"How will you know this work is complete? Describe the expected outcome...",className:"min-h-[100px] resize-y",...s})}),e.jsx(c,{})]})}),e.jsx(w,{type:"submit",className:"w-full",disabled:p,children:p?"Submitting...":e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"w-4 h-4 mr-2"}),"Submit Work Request"]})})]})})})]})})}),e.jsx(N,{})]})};export{ue 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.