1import{a as l,j as e}from"./react-vendor-Cj4cBEvf.js";import{a as B}from"./index-BqvpdcJu.js";import{u as K}from"./use-seo-DQxU_M65.js";import"./fullcalendar-DxFl_for.js";import"./router-BMgApeuJ.js";import"./query-DuA8FwnC.js";import"./radix-Cu77hBNh.js";import"./charts-C3VUr0cJ.js";import"./icons-BolBVcAj.js";function m({value:i,onChange:o,color:d}){const[n,p]=l.useState(0);return e.jsx("div",{style:{display:"flex",gap:"4px"},children:[1,2,3,4,5].map(a=>e.jsx("button",{type:"button",onClick:()=>o(a),onMouseEnter:()=>p(a),onMouseLeave:()=>p(0),style:{background:"none",border:"none",cursor:"pointer",padding:"4px",fontSize:"28px",color:a<=(n||i)?d:"#d1d5db",transition:"color 0.15s, transform 0.1s",transform:a<=(n||i)?"scale(1.1)":"scale(1)"},"aria-label":`${a} star`,children:"â
"},a))})}function g({label:i,selected:o,onClick:d,color:n}){return e.jsx("button",{type:"button",onClick:d,style:{display:"inline-block",padding:"10px 18px",borderRadius:"24px",border:`2px solid ${o?n:"#e5e7eb"}`,backgroundColor:o?n:"#ffffff",color:o?"#ffffff":"#374151",fontSize:"14px",fontWeight:o?600:400,cursor:"pointer",transition:"all 0.15s",margin:"4px"},children:i})}function O({value:i,onChange:o,color:d}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"center"},children:[e.jsx("span",{style:{fontSize:"12px",color:"#9ca3af",marginRight:"8px"},children:"Unlikely"}),[1,2,3,4,5].map(n=>e.jsx("button",{type:"button",onClick:()=>o(n),style:{width:"40px",height:"40px",borderRadius:"50%",border:`2px solid ${n===i?d:"#e5e7eb"}`,backgroundColor:n===i?d:"#ffffff",color:n===i?"#ffffff":"#374151",fontSize:"16px",fontWeight:600,cursor:"pointer",transition:"all 0.15s"},children:n},n)),e.jsx("span",{style:{fontSize:"12px",color:"#9ca3af",marginLeft:"8px"},children:"Definitely"})]})}function le(){const i=window.location.pathname.split("/").pop(),[o,d]=l.useState(null),[n,p]=l.useState(!0),[a,x]=l.useState(""),[v,S]=l.useState(!1),[y,k]=l.useState(!1),[w,q]=l.useState(0),[C,A]=l.useState(""),[z,$]=l.useState(0),[F,E]=l.useState(""),[T,_]=l.useState(""),[W,L]=l.useState(0),[H,U]=l.useState(0),[P,D]=l.useState(0),[N,I]=l.useState(""),[R,M]=l.useState("");K(o?`Feedback | ${o.companyName}`:"Feedback","Share your experience",{noIndex:!0}),l.useEffect(()=>{if(!i){x("Invalid survey link."),p(!1);return}B(`/api/client-feedback/${i}`).then(async t=>{if(!t.ok){const j=await t.json().catch(()=>({}));x(j.error||"Unable to find this survey.");return}const u=await t.json();u.alreadyCompleted?(S(!0),d({...u,type:"post_meeting"})):d(u)}).catch(()=>x("Failed to load survey.")).finally(()=>p(!1))},[i]);const Y=async()=>{if(!y){k(!0);try{const t={additionalFeedback:R||null};o?.type==="post_meeting"?(t.experienceRating=w||null,t.understoodNeeds=C||null,t.likelihoodToProceed=z||null,t.topPriority=F||null):(t.priceExpectation=T||null,t.scopeClarity=W||null,t.qualityConfidence=H||null,t.pmKnowledge=P||null,t.decisionStatus=N||null);const u=await B(`/api/client-feedback/${i}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!u.ok){const j=await u.json().catch(()=>({}));x(j.error||"Failed to submit feedback.");return}S(!0)}catch{x("Failed to submit feedback.")}finally{k(!1)}}},s=o?.primaryColor||"#2563eb",h={minHeight:"100vh",backgroundColor:"#f9fafb",display:"flex",alignItems:"flex-start",justifyContent:"center",padding:"24px 16px",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},b={maxWidth:"480px",width:"100%",backgroundColor:"#ffffff",borderRadius:"16px",boxShadow:"0 1px 3px rgba(0,0,0,0.1), 0 4px 20px rgba(0,0,0,0.06)",padding:"32px 24px",marginTop:"24px"},r={marginBottom:"28px"},c={fontSize:"15px",fontWeight:600,color:"#1f2937",marginBottom:"12px",display:"block"};if(n)return e.jsx("div",{style:h,children:e.jsx("div",{style:{...b,textAlign:"center"},children:e.jsx("p",{style:{color:"#6b7280",fontSize:"15px"},children:"Loading..."})})});if(a&&!v)return e.jsx("div",{style:h,children:e.jsxs("div",{style:{...b,textAlign:"center"}
1,children:[e.jsx("div",{style:{fontSize:"48px",marginBottom:"16px"},children:"ð"}),e.jsx("p",{style:{color:"#dc2626",fontSize:"15px"},children:a})]})});if(v)return e.jsx("div",{style:h,children:e.jsxs("div",{style:{...b,textAlign:"center"},children:[e.jsx("div",{style:{fontSize:"48px",marginBottom:"16px"},children:"ð"}),e.jsx("h2",{style:{fontSize:"22px",fontWeight:700,color:"#1f2937",marginBottom:"8px"},children:"Thank you!"}),e.jsx("p",{style:{color:"#6b7280",fontSize:"15px",lineHeight:1.6},children:"Your feedback means a lot to us. We'll be in touch soon."}),o?.companyName&&e.jsxs("p",{style:{color:"#9ca3af",fontSize:"13px",marginTop:"20px"},children:["â The ",o.companyName," Team"]})]})});const f=o?.type==="post_meeting";return o?.clientName?.split(" ")[0],e.jsx("div",{style:h,children:e.jsxs("div",{style:b,children:[o?.logoUrl&&e.jsx("div",{style:{textAlign:"center",marginBottom:"20px"},children:e.jsx("img",{src:o.logoUrl,alt:o.companyName,style:{maxHeight:"48px",maxWidth:"200px",objectFit:"contain"}})}),e.jsx("h1",{style:{fontSize:"22px",fontWeight:700,color:"#1f2937",textAlign:"center",marginBottom:"6px"},children:f?`Thanks for meeting with ${o?.companyName}!`:`Your quote from ${o?.companyName}`}),e.jsx("p",{style:{fontSize:"14px",color:"#6b7280",textAlign:"center",marginBottom:"28px",lineHeight:1.6},children:f?"We'd love your quick feedback â takes 30 seconds.":`We sent you a quote${o?.projectType?` for your ${o.projectType} project`:""}. Your feedback helps us serve you better.`}),f&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:r,children:[e.jsx("label",{style:c,children:"1. How was your consultation experience?"}),e.jsx(m,{value:w,onChange:q,color:s})]}),e.jsxs("div",{style:r,children:[e.jsx("label",{style:c,children:"2. Did our team understand your project needs?"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap"},children:[{value:"yes",label:"Yes"},{value:"somewhat",label:"Somewhat"},{value:"no",label:"No"}].map(t=>e.jsx(g,{label:t.label,selected:C===t.value,onClick:()=>A(t.value),color:s},t.value))})]}),e.jsxs("div",{style:r,children:[e.jsx("label",{style:c,children:"3. How likely are you to move forward with us?"}),e.jsx(O,{value:z,onChange:$,color:s})]}),e.jsxs("div",{style:r,children:[e.jsx("label",{style:c,children:"4. What matters most to you?"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap"},children:[{value:"price",label:"Price"},{value:"quality",label:"Quality"},{value:"timeline",label:"Timeline"},{value:"communication",label:"Communication"}].map(t=>e.jsx(g,{label:t.label,selected:F===t.value,onClick:()=>E(t.value),color:s},t.value))})]})]}),!f&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:r,children:[e.jsx("label",{style:c,children:"1. How does the quote compare to your expectations?"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap"},children:[{value:"lower",label:"Lower than expected"},{value:"about_right",label:"About right"},{value:"higher",label:"Higher than expected"}].map(t=>e.jsx(g,{label:t.label,selected:T===t.value,onClick:()=>_(t.value),color:s},t.value))})]}),e.jsxs("div",{style:r,children:[e.jsx("label",{style:c,children:"2. How clear was the scope of work?"}),e.jsx(m,{value:W,onChange:L,color:s})]}),e.jsxs("div",{style:r,children:[e.jsx("label",{style:c,children:"3. How confident are you we'll deliver a quality product?"}),e.jsx(m,{value:H,onChange:U,color:s})]}),e.jsxs("div",{style:r,children:[e.jsx("label",{style:c,children:"4. How knowledgeable was your project manager?"}),e.jsx(m,{value:P,onChange:D,color:s})]}),e.jsxs("div",{style:r,children:[e.jsx("label",{style:c,children:"5. What would help you make a decision?"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap"},children:[{value:"ready_to_sign",label:"Ready to sign"},{value:"comparing",label:"Need to compare"},{value:"have_questions",label:"Have questions"},{value:"budget_concerns",label:"Budget concerns"}].map(t=>e.jsx(g,{label:t.label,selected:N===t.value,onClick:()=>I(t.value),color:s},t.value))})]})]}),e.jsxs("div",{style:r,children:[e.jsxs("label",{style:c,children:[f?"5. ":"6. ","Anything else you'd like us to know?"]}),e.jsx("textarea",{value:R,onChange:t=>M(t.target.value),placeholder:"Optional â share any thoughts or suggestions...",style:{width:"100%",minHeight:"80px",padding:"12px",borderRadius:"8px",border:"1px solid #e5e7eb",fontSize:"14px",fontFamily:"inherit",resize:"vertical",outline:"none",boxSizing:"border-box"},onFocus:t=>{t.currentTarget.style.borderColor=s},onBlur:t=>{t.currentTarget.style.borderColor="#e5e7eb"}})]}),e.jsx("button",{onClick:Y,disabled:y,style:{width:"100%",padding:"14px",borderRadius:"10px",border:"none",backgroundColor:y?"#9ca3af":s,color:"#ffffff",fontSize:"16px",fontWeight:600,cursor:y?"not-allowed":"pointer",transition:"background-color 0.15s"},children:y?"Submitting...":"Submit Feedback"}),a&&e.jsx("p",{style:{color:"#dc2626",fontSize:"13px",textAlign:"center",marginTop:"12px"},children:a})]})})}export{le 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.