1import{r as n,j as e}from"./vendor-react-B2RT89U9.js";import{g as nt,a as Gt,u as lt,B as g,f as Jt,d as Qe,P as zt,X as Xe,S as Ae,J as Pe,A as ct}from"./index-gDpiPSoZ.js";import{I as m}from"./input-Ds8nB8-7.js";import{L as r}from"./label-C2dLx4EC.js";import{T as w}from"./textarea--E27rxpX.js";import{C as f,b as T,c as D,a as v}from"./card-CV4rleUf.js";import{B as P}from"./badge-BLy_vRrO.js";import{P as Ye}from"./progress-EleUydrq.js";import{S as qt}from"./slider-DG6wY5o3.js";import{S as Ht}from"./switch-BULs2WFJ.js";import{S as M,a as G,b as J,c as z,d as C}from"./select-CUmIl25z.js";import{D as Y,f as ke,a as ee,b as te,c as se}from"./dialog-DJNN0GXk.js";import{T as Vt,a as Wt,b as L,c as U}from"./tabs-hjRNQtMh.js";import{M as pe}from"./map-pin-DEjH_fkr.js";import{C as Q}from"./clock-CL0zg-Qj.js";import{E as Zt}from"./eye-B8C_Tsf8.js";import{U as ue}from"./upload-hNpfGlvq.js";import{F as ae}from"./file-text-CooFOPAI.js";import{C as ge}from"./camera-Bt-nRAsU.js";import{C as $e}from"./clipboard-check-CJ3bTjYa.js";import{D as je}from"./dollar-sign-B7rzcbEI.js";import{S as Kt}from"./settings-CfHJr-Nz.js";import{A as Re}from"./activity-bLOBFm9D.js";import{C as fe}from"./circle-check-big-DYqNqHzq.js";import{C as et}from"./circle-x-DZPiuL83.js";import{L as A}from"./loader-circle-CCVKtMXL.js";import{S as ie}from"./share-2-BVhv9RbF.js";import{T as Qt}from"./trash-2-CaUyu2i3.js";import{C as Xt}from"./calendar-Dim9-jMT.js";import{T as Yt}from"./triangle-alert-DM6P9QYL.js";import{G as ot}from"./globe-DiR4E9al.js";import{U as es}from"./user-plus-ZvloY9TS.js";import{N as ts}from"./navigation-O5cHMiMy.js";import{I as ss}from"./image-CuSxszI9.js";import{Z as as}from"./zap-BrFbhTAN.js";import{S as is}from"./square-pen-Bv8ViLuN.js";import"./vendor-tanstack-MRWYOJqo.js";import"./vendor-radix-PXtjYgzj.js";import"./check-DyEIay8l.js";const rs=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],ns=nt("folder-plus",rs);const ls=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],cs=nt("rotate-cw",ls),tt=["pre_construction","demolition","rough_work","inspection","finish_work","final_inspection","punch_list","complete"],X={pre_construction:"Pre-Construction",demolition:"Demolition",rough_work:"Rough Work",inspection:"Inspection",finish_work:"Finish Work",final_inspection:"Final Inspection",punch_list:"Punch List",complete:"Complete"},st=[{value:"before",label:"Before"},{value:"demolition",label:"Demo"},{value:"foundation",label:"Foundation"},{value:"framing",label:"Framing"},{value:"rough",label:"Rough"},{value:"finish",label:"Finish"},{value:"after",label:"After"}];function Te(p){switch(p){case"pre_construction":case"before":return"bg-gray-100 text-gray-700 border-gray-200";case"demolition":case"demo":return"bg-red-100 text-red-700 border-red-200";case"rough_work":case"rough":return"bg-orange-100 text-orange-700 border-orange-200";case"inspection":return"bg-blue-100 text-blue-700 border-blue-200";case"finish_work":case"finish":return"bg-yellow-100 text-yellow-700 border-yellow-200";case"final_inspection":return"bg-purple-100 text-purple-700 border-purple-200";case"punch_list":return"bg-pink-100 text-pink-700 border-pink-200";case"complete":case"after":return"bg-green-100 text-green-700 border-green-200";case"foundation":return"bg-amber-100 text-amber-700 border-amber-200";case"framing":return"bg-cyan-100 text-cyan-700 border-cyan-200";default:return"bg-gray-100 text-gray-700 border-gray-200"}}function at(p){switch(p){case"active":return"bg-emerald-100 text-emerald-700 border-emerald-200";case"completed":return"bg-blue-100 text-blue-700 border-blue-200";case"on_hold":return"bg-amber-100 text-amber-700 border-amber-200";default:return"bg-gray-100 text-gray-700 border-gray-200"}}function os(p){switch(p){case"passed":return"bg-green-100 text-green-700 border-green-200";case"failed":return"bg-red-100 text-red-700 border-red-200";case"needs_reinspection":return"bg-orange-100 text-orange-700 border-orange-200";default:return"bg-gray-100 text-gray-700 border-gray-200"}}function De(p){if(!p)return"â";const N=parseFloat(p);return isNaN(N)?p:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(N)}function it(p){const N=new Date(p),$=new Date().getTime()-N.getTime(),s=Math.floor($/1e3),c=Math.floor(s/60),j=Math.floor(c/60),I=Math.floor(j/24);return s<60?"just now":c<60?`${c}m ago`:j<24?`${j}h ago`:I<30?`${I}d ago`:N.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function ds(p){switch(p){case"stage_change":return e.jsx(ct,{className:"w-4 h-4 text-blue-500"});case"photo":case"photo_added":return e.jsx(ge,{className:"w-4 h-4 text-green-500"});case"inspection":case"inspection_scheduled":case"inspection_result":return e.jsx($e,{className:"w-4 h-4 text-purple-500"});case"note":return e.jsx(is,{className:"w-4 h-4 text-orange-500"});case"payment":return e.jsx(je,{className:"w-4 h-4 text-emerald-500"});case"status_change":return e.jsx(as,{className:"w-4 h-4 text-yellow-500"});case"update_added":return e.jsx(ae,{className:"w-4 h-4 text-teal-500"});default:return e.jsx(Re,{className:"w-4 h-4 text-gray-500"})}}
1function rt(p,N){if(!p)return null;const u=new Date(p),s=Math.max(1,Math.ceil((new Date().getTime()-u.getTime())/(10080*60*1e3)));if(N){const c=new Date(N),j=Math.max(1,Math.ceil((c.getTime()-u.getTime())/(10080*60*1e3)));return`Week ${Math.min(s,j)} of ${j}`}return`Week ${s}`}const ms=["Kitchen Remodel","Bathroom Remodel","Full Home Remodel","Room Addition","ADU","Custom Home","Outdoor Living","Garage Conversion","Foundation","Roofing","Other"],hs=["Foundation","Framing","Electrical","Plumbing","HVAC","Insulation","Drywall","Roofing","Final","Other"];function ea(){Gt("Admin | Oria Builders","Internal admin page",{noIndex:!0});const[p,N]=n.useState([]),[u,$]=n.useState(!0),[s,c]=n.useState(null),[j,I]=n.useState([]),[h,k]=n.useState([]),[re,dt]=n.useState([]),[ne,mt]=n.useState([]),[ht,Ee]=n.useState(!1),[xt,ve]=n.useState(!1),[q,F]=n.useState(!1),[pt,W]=n.useState("overview"),[le,ut]=n.useState("all"),[ce,gt]=n.useState(""),{toast:l}=lt(),[d,y]=n.useState({clientName:"",clientEmail:"",clientPhone:"",projectAddress:"",projectCity:"",projectType:"",contractPrice:"",startDate:"",estimatedCompletion:"",notes:"",projectDescription:""}),[R,oe]=n.useState({url:"",caption:"",stage:""}),[S,Z]=n.useState({inspectionType:"",scheduledDate:"",inspector:"",notes:""}),[jt,Oe]=n.useState(!1),[ft,Ie]=n.useState(!1),[Fe,vt]=n.useState([]),[Nt,Le]=n.useState(!1),[b,H]=n.useState([]),[V,Ue]=n.useState(""),[E,Be]=n.useState(""),[de,Ne]=n.useState(""),[_e,Me]=n.useState(!1),[Ge,Je]=n.useState(!1),[yt,ze]=n.useState(!1),[ye,be]=n.useState([]),[bt,me]=n.useState(!1),[qe,He]=n.useState(null),Ve=n.useRef(null),wt=n.useRef(null),he=async()=>{try{const a=await fetch("/api/admin/projects",{credentials:"include"});if(a.ok){const t=await a.json();N(t)}}catch(a){console.error("Failed to fetch projects:",a)}$(!1)},B=async a=>{try{const[t,i]=await Promise.all([fetch(`/api/admin/projects/${a}`,{credentials:"include"}),fetch(`/api/admin/projects/${a}/activities`,{credentials:"include"})]);if(t.ok){const o=await t.json();c(o),I(o.photos||[]),k(o.inspections||[]),mt(o.updates||[])}if(i.ok){const o=await i.json();dt(o)}}catch(t){console.error("Failed to fetch project detail:",t)}},Ct=async()=>{Le(!0);try{const a=await fetch("/api/leads",{credentials:"include"});if(a.ok){const t=await a.json();vt(t)}}catch(a){console.error("Failed to fetch leads:",a)}Le(!1)};n.useEffect(()=>{he()},[]);const St=async()=>{if(!d.clientName||!d.projectAddress||!d.projectType){l({title:"Please fill in required fields",variant:"destructive"});return}F(!0);try{const a=await fetch("/api/admin/projects",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(d)});if(a.ok)l({title:"Project created successfully"}),Ee(!1),y({clientName:"",clientEmail:"",clientPhone:"",projectAddress:"",projectCity:"",projectType:"",contractPrice:"",startDate:"",estimatedCompletion:"",notes:"",projectDescription:""}),he();else{const t=await a.json();l({title:t.error||"Failed to create project",variant:"destructive"})}}catch{l({title:"Connection error",variant:"destructive"})}F(!1)},Pt=async a=>{F(!0);try{const t=a.projectAddress?.split(",").slice(-2,-1)[0]?.trim()||"",i=await fetch("/api/admin/projects",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({leadId:a.id,clientName:a.name,clientEmail:a.email,clientPhone:a.phone||"",projectAddress:a.projectAddress||"",projectCity:t,projectType:a.projectType||"Other"})});if(i.ok)l({title:`Project created from lead: ${a.name}`}),ve(!1),he();else{const o=await i.json();l({title:o.error||"Failed to create project",variant:"destructive"})}}catch{l({title:"Connection error",variant:"destructive"})}F(!1)},x=async a=>{if(s)try{const t=await fetch(`/api/admin/projects/${s.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(a)});if(t.ok){const i=await t.json();c(o=>o?{...o,...i}:i),he(),l({title:"Project updated"})}else l({title:"Failed to update project",variant:"destructive"})}catch{l({title:"Connection error",variant:"destructive"})}},kt=async()=>
1{if(!(!s||!R.url)){F(!0);try{(await fetch(`/api/admin/projects/${s.id}/photos`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(R)})).ok?(l({title:"Photo added"}),oe({url:"",caption:"",stage:""}),Oe(!1),B(s.id)):l({title:"Failed to add photo",variant:"destructive"})}catch{l({title:"Connection error",variant:"destructive"})}F(!1)}},Tt=async a=>{if(s)try{(await fetch(`/api/admin/projects/${s.id}/photos/${a}`,{method:"DELETE",credentials:"include"})).ok&&(l({title:"Photo deleted"}),B(s.id))}catch{l({title:"Connection error",variant:"destructive"})}},[Dt,At]=n.useState(0),[We,Ze]=n.useState(null),$t=async a=>{Ze(a);try{const t=await fetch(`/api/admin/projects/photos/${a}/rotate`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({degrees:90})});if(t.ok)l({title:"Photo rotated 90°"}),At(i=>i+1),s&&B(s.id);else{const i=await t.json();l({title:i.error||"Failed to rotate",variant:"destructive"})}}catch{l({title:"Connection error",variant:"destructive"})}Ze(null)},Rt=async()=>{if(!(!s||!S.inspectionType)){F(!0);try{(await fetch(`/api/admin/projects/${s.id}/inspections`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(S)})).ok?(l({title:"Inspection added"}),Z({inspectionType:"",scheduledDate:"",inspector:"",notes:""}),Ie(!1),B(s.id)):l({title:"Failed to add inspection",variant:"destructive"})}catch{l({title:"Connection error",variant:"destructive"})}F(!1)}},we=async(a,t)=>{if(s)try{(await fetch(`/api/admin/projects/${s.id}/inspections/${a}`,{method:"PATCH",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({result:t})})).ok&&(l({title:`Inspection marked as ${t}`}),B(s.id))}catch{l({title:"Connection error",variant:"destructive"})}},Ce=n.useCallback(a=>{const t=Array.from(a).filter(i=>i.type.startsWith("image/")).slice(0,15).map(i=>({file:i,preview:URL.createObjectURL(i),progress:0,uploaded:!1}));H(i=>[...i,...t].slice(0,15))},[]),Et=n.useCallback(a=>{a.preventDefault(),a.stopPropagation(),a.dataTransfer.files.length>0&&Ce(a.dataTransfer.files)},[Ce]),Ot=n.useCallback(a=>{a.preventDefault(),a.stopPropagation()},[]),It=a=>{H(t=>{const i=t[a];return i&&URL.revokeObjectURL(i.preview),t.filter((o,_)=>_!==a)})},Ft=async()=>{if(!(!s||!E.trim())){Me(!0);try{const a=await fetch(`/api/admin/projects/${s.id}/expand-update`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({shortNote:E,stage:V})});if(a.ok){const t=await a.json();Ne(t.aiDescription||E),l({title:"Note expanded with AI"})}else l({title:"Failed to expand note",variant:"destructive"})}catch{l({title:"Connection error",variant:"destructive"})}Me(!1)}},Lt=async()=>{if(!s||b.length===0)return;Je(!0);const a=new FormData;b.forEach(t=>a.append("photos",t.file)),V&&a.append("stage",V),E&&a.append("caption",E);try{H(i=>i.map(o=>({...o,progress:20})));const t=await fetch(`/api/admin/projects/${s.id}/upload-photos`,{method:"POST",credentials:"include",body:a});if(t.ok){const i=await t.json();H(O=>O.map(K=>({...K,progress:100,uploaded:!0})));const o=(i.photos||[]).map(O=>({url:O.url,originalName:O.originalName}));if(be(o),o.length>0){ze(!0);try{const O=await fetch("/api/admin/projects/generate-alt-text",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({photos:o.map(K=>({url:K.url,stage:V})),projectId:s.id})});if(O.ok){const K=await O.json(),Bt=o.map((_t,Mt)=>({..._t,altText:K.results?.[Mt]?.altText||void 0}));be(Bt)}}catch{console.error("Alt text generation failed")}ze(!1)}const _={shortNote:E||null,aiDescription:de||null,stage:V||null,photos:o},xe=await fetch(`/api/admin/projects/${s.id}/updates`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(_)});if(xe.ok){const O=await xe.json();He(O)}l({title:`${i.count} photo${i.count>1?"s":""} uploaded successfully`}),B(s.id)}else{const i=await t.json();l({title:i.error||"Upload failed",variant:"destructive"}),H(o=>o.map(_=>({..._,error:"Upload failed"})))}}catch{l({title:"Connection error",variant:"destructive"})}Je(!1)},Se=()=>{b.forEach(a=>URL.revokeObjectURL(a.preview)),H([]),Ue(""),Be(""),Ne(""),be([]),He(null),me(!1)},Ut=async a=>{if(!(!qe||!s)){l({title:`Sharing to ${a.join(", ")}...`});try{await fetch(`/api/admin/projects/${s.id}/updates/${qe.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({socialShared:Object.fromEntries(a.map(t=>[t,!0]))})}),l({title:"Social sharing recorded"}),me(!1)}catch{l({title:"Failed to record sharing",variant:"destructive"})}}},Ke=p.filter(a=>{if(le!=="all"&&a.status!==le)return!1;if(ce){const t=ce.toLowerCase();return a.clientName.toLowerCase().includes(t)||a.projectAddress.toLowerCase().includes(t)||(a.projectCity||"").toLowerCase().includes(t)||a.projectType.toLowerCase().includes(t)}return!0});
1if(s){const a=rt(s.startDate,s.estimatedCompletion);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsxs(g,{variant:"ghost",size:"sm",onClick:()=>{c(null),W("overview"),Se()},className:"min-h-[44px] min-w-[44px]","data-testid":"button-back-to-projects",children:[e.jsx(Jt,{className:"w-4 h-4 mr-1"})," Back"]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("h2",{className:"text-xl font-bold text-gray-900 truncate","data-testid":"text-project-detail-title",children:[s.clientName," â ",s.projectType]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500 mt-0.5",children:[e.jsx(pe,{className:"w-3 h-3"}),e.jsxs("span",{children:[s.projectAddress,s.projectCity?`, ${s.projectCity}`:""]}),a&&e.jsxs(P,{variant:"outline",className:"text-[10px] ml-2","data-testid":"badge-duration",children:[e.jsx(Q,{className:"w-3 h-3 mr-0.5"})," ",a]})]})]}),e.jsx(P,{className:`${at(s.status)} border text-xs`,"data-testid":`badge-status-${s.id}`,children:s.status.replace("_"," ")})]}),e.jsxs(Vt,{value:pt,onValueChange:W,children:[e.jsxs(Wt,{className:"flex flex-nowrap overflow-x-auto scrollbar-hide h-auto w-full justify-start","data-testid":"tabs-project-detail",children:[e.jsxs(L,{value:"overview","data-testid":"tab-overview",className:"shrink-0",children:[e.jsx(Zt,{className:"w-4 h-4 sm:mr-1"})," ",e.jsx("span",{className:"hidden sm:inline",children:"Overview"})]}),e.jsxs(L,{value:"upload","data-testid":"tab-upload",className:"shrink-0",children:[e.jsx(ue,{className:"w-4 h-4 sm:mr-1"})," ",e.jsx("span",{className:"hidden sm:inline",children:"Upload"})]}),e.jsxs(L,{value:"timeline","data-testid":"tab-timeline",className:"shrink-0",children:[e.jsx(ae,{className:"w-4 h-4 sm:mr-1"})," ",e.jsxs("span",{className:"hidden sm:inline",children:["Timeline (",ne.length,")"]})]}),e.jsxs(L,{value:"photos","data-testid":"tab-photos",className:"shrink-0",children:[e.jsx(ge,{className:"w-4 h-4 sm:mr-1"})," ",e.jsxs("span",{className:"hidden sm:inline",children:["Photos (",j.length,")"]})]}),e.jsxs(L,{value:"inspections","data-testid":"tab-inspections",className:"shrink-0",children:[e.jsx($e,{className:"w-4 h-4 sm:mr-1"})," ",e.jsx("span",{className:"hidden sm:inline",children:"Inspections"})]}),e.jsxs(L,{value:"payments","data-testid":"tab-payments",className:"shrink-0",children:[e.jsx(je,{className:"w-4 h-4 sm:mr-1"})," ",e.jsx("span",{className:"hidden sm:inline",children:"Payments"})]}),e.jsxs(L,{value:"settings","data-testid":"tab-settings",className:"shrink-0",children:[e.jsx(Kt,{className:"w-4 h-4 sm:mr-1"})," ",e.jsx("span",{className:"hidden sm:inline",children:"Settings"})]}),e.jsxs(L,{value:"activity","data-testid":"tab-activity",className:"shrink-0",children:[e.jsx(Re,{className:"w-4 h-4 sm:mr-1"})," ",e.jsx("span",{className:"hidden sm:inline",children:"Activity"})]})]}),e.jsxs(U,{value:"overview",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs(f,{"data-testid":"card-client-info",children:[e.jsx(T,{className:"pb-2",children:e.jsx(D,{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide",children:"Client Info"})}),e.jsxs(v,{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qe,{className:"w-4 h-4 text-gray-400"})," ",e.jsx("span",{className:"font-medium",children:s.clientName})]}),s.clientEmail&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qe,{className:"w-4 h-4 text-gray-400"})," ",s.clientEmail]}),s.clientPhone&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(zt,{className:"w-4 h-4 text-gray-400"})," ",s.clientPhone]})]})]}),e.jsxs(f,{"data-testid":"card-project-info",children:[e.jsx(T,{className:"pb-2",children:e.jsx(D,{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide",children:"Project Info"})}),e.jsxs(v,{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(pe,{className:"w-4 h-4 text-gray-400"})," ",s.projectAddress,s.projectCity?`, ${s.projectCity}`:""]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ae,{className:"w-4 h-4 text-gray-400"})," ",s.projectType]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(je,{className:"w-4 h-4 text-gray-400"})," ",De(s.contractPrice)]}),a&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Q,{className:"w-4 h-4 text-gray-400"})," ",a]})]})]})]}),e.jsxs(f,{"data-testid":"card-stage-progress",children:[e.jsx(T,{className:"pb-2",children:e.jsx(D,{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide",children:"Stage & Progress"})}),e.jsxs(v,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500 mb-1 block",children:"Stage"}),e.jsxs(M,{value:s.stage,onValueChange:t=>x({stage:t}),"data-testid":"select-stage",children:[e.jsx(G,{"data-testid":"select-stage-trigger",className:"w-full md:w-64",children:e.jsx(J,{})}),e.jsx(z,{children:tt.map(t=>e.jsx(C,{value:t,"data-testid":`select-stage-${t}`,children:X[t]},t))})]})]}),e.jsxs("div",{children:[e.jsxs(r,{className:"text-xs text-gray-500 mb-1 block",children:["Progress: ",s.progressPercent,"%"]}),e.jsx(qt,{value:[s.progressPercent],min:0,max:100,step:5,onValueCommit:t=>x({progressPercent:t[0]}),"data-testid":"slider-progress"})]}),e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500 mb-1 block",children:"Status"}),e.jsxs(M,{value:s.status,onValueChange:t=>x({status:t}),children:[e.jsx(G,{className:"w-full md:w-64","data-testid":"select-status-trigger",children:e.jsx(J,{})}),e.jsxs(z,{children:[e.jsx(C,{value:"active",children:"Active"}),e.jsx(C,{value:"completed",children:"Completed"}),e.jsx(C,{value:"on_hold",children:"On Hold"})]})]})]})]})]}),e.jsxs(f,{"data-testid":"card-dates-notes",children:[e.jsx(T,{className:"pb-2",children:e.jsx(D,{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide",children:"Dates & Notes"})}),e.jsxs(v,{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500",children:"Start Date"}),e.jsx(m,{type:"date",value:s.startDate||"",onChange:t=>x({startDate:t.target.value}),"data-testid":"input-start-date"})]}),e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500",children:"Estimated Completion"}),e.jsx(m,{type:"date",value:s.estimatedCompletion||"",onChange:t=>x({estimatedCompletion:t.target.value}),"data-testid":"input-estimated-completion"})]})]}),e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500",children:"Notes"}),e.jsx(w,{value:s.notes||"",onChange:t=>c({...s,notes:t.target.value}),onBlur:()=>x({notes:s.notes||""}),rows:3,"data-testid":"textarea-notes"})]})]})]}),e.jsx(ps,{projectId:s.id,projectStatus:s.status})]}
1),e.jsxs(U,{value:"upload",className:"space-y-4 mt-4",children:[e.jsxs(f,{"data-testid":"card-upload-zone",children:[e.jsx(T,{className:"pb-2",children:e.jsxs(D,{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide flex items-center gap-2",children:[e.jsx(ue,{className:"w-4 h-4"})," Bulk Photo Upload"]})}),e.jsxs(v,{className:"space-y-4",children:[e.jsxs("div",{ref:wt,onDrop:Et,onDragOver:Ot,onClick:()=>Ve.current?.click(),className:"border-2 border-dashed border-gray-300 rounded-lg p-4 sm:p-8 text-center cursor-pointer hover:border-[hsl(174,62%,47%)] hover:bg-gray-50 transition-colors","data-testid":"dropzone-photos",children:[e.jsx(ge,{className:"w-10 h-10 mx-auto mb-3 text-gray-400"}),e.jsx("p",{className:"text-sm font-medium text-gray-700 hidden sm:block",children:"Drag & drop photos here"}),e.jsx("p",{className:"text-sm font-medium text-gray-700 sm:hidden",children:"Tap to select photos or take a photo"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 hidden sm:block",children:"or click to browse â up to 15 files (JPEG, PNG, WebP, HEIC)"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 sm:hidden",children:"Up to 15 files (JPEG, PNG, WebP, HEIC)"}),e.jsx("input",{ref:Ve,type:"file",multiple:!0,accept:"image/jpeg,image/png,image/webp,image/heic,image/heif",className:"hidden",onChange:t=>t.target.files&&Ce(t.target.files),"data-testid":"input-file-upload"})]}),b.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-700",children:[b.length," file",b.length>1?"s":""," selected"]}),e.jsxs(g,{variant:"ghost",size:"sm",onClick:Se,"data-testid":"button-clear-uploads",children:[e.jsx(Xe,{className:"w-4 h-4 mr-1"})," Clear All"]})]}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 lg:grid-cols-6 gap-2",children:b.map((t,i)=>e.jsxs("div",{className:"relative group rounded-lg overflow-hidden border","data-testid":`upload-preview-${i}`,children:[e.jsx("img",{src:t.preview,alt:t.file.name,className:"w-full h-28 sm:h-20 object-cover"}),t.progress>0&&t.progress<100&&e.jsx("div",{className:"absolute bottom-0 left-0 right-0",children:e.jsx(Ye,{value:t.progress,className:"h-2 sm:h-1 rounded-none"})}),t.uploaded&&e.jsx("div",{className:"absolute inset-0 bg-green-500/20 flex items-center justify-center",children:e.jsx(fe,{className:"w-5 h-5 text-green-600"})}),t.error&&e.jsx("div",{className:"absolute inset-0 bg-red-500/20 flex items-center justify-center",children:e.jsx(et,{className:"w-5 h-5 text-red-600"})}),e.jsx("button",{onClick:o=>{o.stopPropagation(),It(i)},className:"absolute top-1 right-1 bg-red-500 text-white rounded-full w-7 h-7 min-w-[28px] min-h-[28px] sm:w-auto sm:h-auto sm:p-0.5 flex items-center justify-center opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity","data-testid":`button-remove-upload-${i}`,children:e.jsx(Xe,{className:"w-4 h-4 sm:w-3 sm:h-3"})}),e.jsx("div",{className:"p-1",children:e.jsx("p",{className:"text-[9px] text-gray-500 truncate",children:t.file.name})})]},i))})]}),e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500",children:"Stage"}),e.jsxs(M,{value:V,onValueChange:Ue,children:[e.jsx(G,{"data-testid":"select-upload-stage",children:e.jsx(J,{placeholder:"Select photo stage"})}),e.jsx(z,{children:st.map(t=>e.jsx(C,{value:t.value,children:t.label},t.value))})]})]}),e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500",children:"Quick Note"}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsx(w,{value:E,onChange:t=>{Be(t.target.value),Ne("")},placeholder:'e.g. "passed plumbing inspection"',rows:2,className:"flex-1 w-full","data-testid":"textarea-upload-note"}),e.jsxs(g,{variant:"outline",size:"sm",onClick:Ft,disabled:_e||!E.trim(),className:"w-full sm:w-auto sm:self-end shrink-0 min-h-[44px] sm:min-h-0","data-testid":"button-expand-note",children:[_e?e.jsx(A,{className:"w-4 h-4 animate-spin"}):e.jsx(Ae,{className:"w-4 h-4"}),e.jsx("span",{className:"ml-1",children:"Expand with AI"})]})]}),de&&e.jsxs("div",{className:"mt-2 p-3 bg-blue-50 border border-blue-200 rounded-lg","data-testid":"expanded-note-preview",children:[e.jsx("p",{className:"text-xs font-semibold text-blue-700 mb-1",children:"AI-Expanded Description"}),e.jsx("p",{className:"text-sm text-gray-700",children:de})]})]}),e.jsx("div",{className:"flex gap-2",children:e.jsx(g,{onClick:Lt,disabled:Ge||b.length===0||b.every(t=>t.uploaded),className:"flex-1 min-h-[48px] sm:min-h-0 bg-[hsl(174,62%,47%)] hover:bg-[hsl(174,62%,40%)]","data-testid":"button-submit-upload",children:Ge?e.jsxs(e.Fragment,{children:[e.jsx(A,{className:"w-4 h-4 animate-spin mr-2"})," Uploading..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ue,{className:"w-4 h-4 mr-2"})," Upload ",b.length," Photo",b.length>
11?"s":""]})})}),yt&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500","data-testid":"status-generating-alt",children:[e.jsx(A,{className:"w-4 h-4 animate-spin"})," Generating SEO alt text..."]}),ye.length>0&&b.every(t=>t.uploaded)&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium text-green-700 flex items-center gap-1",children:[e.jsx(fe,{className:"w-4 h-4"})," Upload complete"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(g,{variant:"outline",size:"sm",onClick:()=>me(!0),"data-testid":"button-share-social",children:[e.jsx(ie,{className:"w-4 h-4 mr-1"})," Share to Social"]}),e.jsxs(g,{variant:"ghost",size:"sm",onClick:Se,"data-testid":"button-upload-another",children:[e.jsx(Pe,{className:"w-4 h-4 mr-1"})," Upload More"]})]})]}),ye.some(t=>t.altText)&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-semibold text-gray-500",children:"Generated Alt Text"}),ye.filter(t=>t.altText).map((t,i)=>e.jsxs("div",{className:"text-xs text-gray-600 bg-gray-50 rounded p-2","data-testid":`alt-text-${i}`,children:[e.jsxs("span",{className:"font-medium",children:[t.originalName||`Photo ${i+1}`,":"]})," ",t.altText]},i))]})]})]})]}),e.jsx(xs,{open:bt,onOpenChange:me,onShare:Ut,description:de||E})]}),e.jsxs(U,{value:"timeline",className:"space-y-4 mt-4",children:[e.jsxs("h3",{className:"font-semibold text-gray-700",children:["Project Timeline (",ne.length," updates)"]}),ne.length===0?e.jsxs("div",{className:"text-center py-12 text-gray-400",children:[e.jsx(ae,{className:"w-12 h-12 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:"No updates yet"}),e.jsx("p",{className:"text-sm mt-1",children:"Upload photos to create timeline entries"})]}):e.jsx("div",{className:"space-y-4",children:ne.map(t=>e.jsx(f,{"data-testid":`card-update-${t.id}`,children:e.jsxs(v,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[t.stage&&e.jsx(P,{className:`${Te(t.stage)} border text-[10px]`,children:st.find(i=>i.value===t.stage)?.label||X[t.stage]||t.stage}),e.jsxs("span",{className:"text-xs text-gray-400 flex items-center gap-1",children:[e.jsx(Q,{className:"w-3 h-3"})," ",it(t.createdAt)]})]}),t.socialShared&&Object.keys(t.socialShared).length>0&&e.jsxs(P,{variant:"outline",className:"text-[10px]",children:[e.jsx(ie,{className:"w-3 h-3 mr-0.5"})," Shared"]})]}),t.shortNote&&e.jsxs("p",{className:"text-sm text-gray-600 italic",children:['"',t.shortNote,'"']}),t.aiDescription&&e.jsx("p",{className:"text-sm text-gray-800",children:t.aiDescription}),t.photos&&Array.isArray(t.photos)&&t.photos.length>0&&e.jsx("div",{className:"grid grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-2",children:t.photos.map((i,o)=>e.jsx("div",{className:"rounded-lg overflow-hidden border",children:e.jsx("img",{src:i.url,alt:i.altText||"Project photo",className:"w-full h-24 object-cover",loading:"lazy"})},o))})]})},t.id))})]}),e.jsxs(U,{value:"photos",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("h3",{className:"font-semibold text-gray-700",children:["All Photos (",j.length,")"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(g,{size:"sm",variant:"outline",onClick:()=>W("upload"),"data-testid":"button-go-to-upload",children:[e.jsx(ue,{className:"w-4 h-4 mr-1"})," Bulk Upload"]}),e.jsxs(Y,{open:jt,onOpenChange:Oe,children:[e.jsx(ke,{asChild:!0,children:e.jsxs(g,{size:"sm",className:"bg-[hsl(174,62%,47%)] hover:bg-[hsl(174,62%,40%)]","data-testid":"button-add-photo",children:[e.jsx(Pe,{className:"w-4 h-4 mr-1"})," Add by URL"]})}),e.jsxs(ee,{"data-testid":"dialog-add-photo",children:[e.jsx(te,{children:e.jsx(se,{children:"Add Photo by URL"})}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(r,{children:"Image URL *"}),e.jsx(m,{value:R.url,onChange:t=>oe({...R,url:t.target.value}),placeholder:"https://...","data-testid":"input-photo-url"})]}),e.jsxs("div",{children:[e.jsx(r,{children:"Caption"}),e.jsx(m,{value:R.caption,onChange:t=>oe({...R,caption:t.target.value}),placeholder:"Photo description","data-testid":"input-photo-caption"})]}),e.jsxs("div",{children:[e.jsx(r,{children:"Stage"}),e.jsxs(M,{value:R.stage,onValueChange:t=>oe({...R,stage:t}),children:[e.jsx(G,{"data-testid":"select-photo-stage",children:e.jsx(J,{placeholder:"Select stage"})}),e.jsx(z,{children:tt.map(t=>e.jsx(C,{value:t,children:X[t]},t))})]})]}),e.jsxs(g,{onClick:kt,disabled:q||!R.url,className:"w-full bg-[hsl(174,62%,47%)] hover:bg-[hsl(174,62%,40%)]","data-testid":"button-submit-photo",children:[q?e.jsx(A,{className:"w-4 h-4 animate-spin mr-1"}):null,"Add Photo"]})]})]})]})]})]}),j.length===0?e.jsxs("div",{className:"text-center py-12 text-gray-400",children:[e.jsx(ge,{className:"w-12 h-12 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:"No photos yet"}),e.jsx(g,{variant:"link",onClick:()=>W("upload"),className:"mt-2","data-testid":"link-go-upload",children:"Upload photos now â"})]}):e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3",children:j.map(t=>e.jsxs("div",{className:"relative group rounded-lg overflow-hidden border","data-testid":`card-photo-${t.id}`,children:[e.jsx("img",{src:`${t.url}${t.url.includes("?")?"&":"?"}v=${Dt}`,alt:t.caption||"Project photo",className:"w-full h-40 object-cover",loading:"lazy"}),e.jsxs("div",{className:"p-2 space-y-1",children:[t.caption&&e.jsx("p",{className:"text-xs text-gray-600 truncate",children:t.caption}),t.stage&&e.jsx(P,{className:`${Te(t.stage)} border text-[10px]`,children:X[t.stage]||t.stage})]}),e.jsxs("div",{className:"absolute top-1 right-1 flex gap-1 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity",children:[e.jsx("button",{onClick:()=>$t(t.id),disabled:We===t.id,className:"bg-blue-500 text-white rounded-full w-8 h-8 min-w-[32px] min-h-[32px] flex items-center justify-center disabled:opacity-50",title:"Rotate 90°","data-testid":`button-rotate-photo-${t.id}`,children:We===t.id?e.jsx(A,{className:"w-4 h-4 animate-spin"}):e.jsx(cs,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>Tt(t.id),className:"bg-red-500 text-white rounded-full w-8 h-8 min-w-[32px] min-h-[32px] flex items-center justify-center","data-testid":`button-delete-photo-${t.id}`,children:e.jsx(Qt,{className:"w-4 h-4"})})]})]},t.id))})]}
1),e.jsxs(U,{value:"inspections",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("h3",{className:"font-semibold text-gray-700",children:["Inspections (",h.length,")"]}),e.jsxs(Y,{open:ft,onOpenChange:Ie,children:[e.jsx(ke,{asChild:!0,children:e.jsxs(g,{size:"sm",className:"bg-[hsl(174,62%,47%)] hover:bg-[hsl(174,62%,40%)]","data-testid":"button-add-inspection",children:[e.jsx(Pe,{className:"w-4 h-4 mr-1"})," Add Inspection"]})}),e.jsxs(ee,{"data-testid":"dialog-add-inspection",children:[e.jsx(te,{children:e.jsx(se,{children:"Add Inspection"})}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(r,{children:"Type *"}),e.jsxs(M,{value:S.inspectionType,onValueChange:t=>Z({...S,inspectionType:t}),children:[e.jsx(G,{"data-testid":"select-inspection-type",children:e.jsx(J,{placeholder:"Select type"})}),e.jsx(z,{children:hs.map(t=>e.jsx(C,{value:t,children:t},t))})]})]}),e.jsxs("div",{children:[e.jsx(r,{children:"Scheduled Date"}),e.jsx(m,{type:"date",value:S.scheduledDate,onChange:t=>Z({...S,scheduledDate:t.target.value}),"data-testid":"input-inspection-date"})]}),e.jsxs("div",{children:[e.jsx(r,{children:"Inspector Name"}),e.jsx(m,{value:S.inspector,onChange:t=>Z({...S,inspector:t.target.value}),placeholder:"Inspector name","data-testid":"input-inspector-name"})]}),e.jsxs("div",{children:[e.jsx(r,{children:"Notes"}),e.jsx(w,{value:S.notes,onChange:t=>Z({...S,notes:t.target.value}),rows:2,"data-testid":"textarea-inspection-notes"})]}),e.jsxs(g,{onClick:Rt,disabled:q||!S.inspectionType,className:"w-full bg-[hsl(174,62%,47%)] hover:bg-[hsl(174,62%,40%)]","data-testid":"button-submit-inspection",children:[q?e.jsx(A,{className:"w-4 h-4 animate-spin mr-1"}):null,"Add Inspection"]})]})]})]})]}),h.length===0?e.jsxs("div",{className:"text-center py-12 text-gray-400",children:[e.jsx($e,{className:"w-12 h-12 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:"No inspections scheduled"})]}):e.jsx("div",{className:"space-y-2",children:h.map(t=>e.jsx(f,{"data-testid":`card-inspection-${t.id}`,children:e.jsx(v,{className:"p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"font-medium text-sm",children:t.inspectionType}),t.scheduledDate&&e.jsxs("div",{className:"text-xs text-gray-500 flex items-center gap-1",children:[e.jsx(Xt,{className:"w-3 h-3"})," ",t.scheduledDate]}),t.inspector&&e.jsx("div",{className:"text-xs text-gray-500",children:t.inspector}),t.notes&&e.jsx("div",{className:"text-xs text-gray-400 mt-1",children:t.notes})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(P,{className:`${os(t.result)} border text-xs`,"data-testid":`badge-inspection-result-${t.id}`,children:t.result.replace("_"," ")}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{onClick:()=>we(t.id,"passed"),className:"p-1 rounded hover:bg-green-50 text-green-600",title:"Mark Passed","data-testid":`button-inspection-pass-${t.id}`,children:e.jsx(fe,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>we(t.id,"failed"),className:"p-1 rounded hover:bg-red-50 text-red-600",title:"Mark Failed","data-testid":`button-inspection-fail-${t.id}`,children:e.jsx(et,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>we(t.id,"needs_reinspection"),className:"p-1 rounded hover:bg-orange-50 text-orange-600",title:"Needs Reinspection","data-testid":`button-inspection-reinspect-${t.id}`,children:e.jsx(Yt,{className:"w-4 h-4"})})]})]})]})})},t.id))})]}),e.jsxs(U,{value:"payments",className:"space-y-4 mt-4",children:[e.jsx("h3",{className:"font-semibold text-gray-700",children:"Payment Schedule"}),s.contractId&&s.paymentSchedule&&s.paymentSchedule.length>0?e.jsx("div",{className:"space-y-2",children:s.paymentSchedule.map((t,i)=>{const o=parseFloat(s.contractPrice||"0"),_=parseFloat(t.percentage||"0"),xe=o*_/100;return e.jsx(f,{"data-testid":`card-milestone-${i}`,children:e.jsxs(v,{className:"p-4 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-sm",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-gray-500",children:t.description}),e.jsxs("div",{className:"text-xs text-gray-400",children:[t.percentage,"%"]})]}),e.jsx("div",{className:"text-right",children:e.jsx("div",{className:"font-semibold text-sm",children:De(xe.toString())})})]})},i)})}):e.jsxs("div",{className:"text-center py-12 text-gray-400",children:[e.jsx(je,{className:"w-12 h-12 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:s.contractId?"No payment schedule found":"No linked contract"})]})]}
1),e.jsxs(U,{value:"settings",className:"space-y-4 mt-4",children:[e.jsxs(f,{"data-testid":"card-project-settings",children:[e.jsx(T,{className:"pb-2",children:e.jsx(D,{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide",children:"Website Visibility"})}),e.jsxs(v,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(r,{className:"text-sm font-medium",children:"Show on Website"}),e.jsx("p",{className:"text-xs text-gray-500",children:"Make this project visible on the public portfolio"})]}),e.jsx(Ht,{checked:s.publicVisible||!1,onCheckedChange:t=>x({publicVisible:t}),"data-testid":"switch-public-visible"})]}),s.projectSlug&&e.jsxs("div",{className:"text-xs text-gray-500 flex items-center gap-1",children:[e.jsx(ot,{className:"w-3 h-3"})," /projects/",s.projectSlug]})]})]}),e.jsxs(f,{"data-testid":"card-project-description",children:[e.jsx(T,{className:"pb-2",children:e.jsx(D,{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide",children:"Project Description"})}),e.jsx(v,{children:e.jsx(w,{value:s.projectDescription||"",onChange:t=>c({...s,projectDescription:t.target.value}),onBlur:()=>x({projectDescription:s.projectDescription||""}),rows:4,placeholder:"Public-facing description of this project...","data-testid":"textarea-project-description"})})]}),e.jsxs(f,{"data-testid":"card-seo-content",children:[e.jsx(T,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(D,{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide",children:"SEO Content"}),e.jsxs(g,{size:"sm",variant:"outline",className:"min-h-[36px] gap-1",onClick:async()=>{try{l({title:"Generating SEO content...",description:"AI is creating optimized content for this project page."});const t=await fetch(`/api/admin/projects/${s.id}/generate-seo`,{method:"POST"});if(!t.ok)throw new Error("Failed to generate");const i=await t.json();i.success&&i.project&&(c({...s,seoTitle:i.project.seoTitle||s.seoTitle,budgetRange:i.project.budgetRange||s.budgetRange,homeStyle:i.project.homeStyle||s.homeStyle,scopeSummary:i.project.scopeSummary||s.scopeSummary,designDetails:i.project.designDetails||s.designDetails,costRangeParagraph:i.project.costRangeParagraph||s.costRangeParagraph,timelineDesignPhase:i.project.timelineDesignPhase||s.timelineDesignPhase,timelineConstructionPhase:i.project.timelineConstructionPhase||s.timelineConstructionPhase,localContextParagraph:i.project.localContextParagraph||s.localContextParagraph,projectStory:i.project.projectStory||s.projectStory,faqEntries:i.project.faqEntries||s.faqEntries}),l({title:"SEO content generated",description:"All fields have been filled with AI-generated content."}))}catch{l({title:"Generation failed",description:"Could not generate SEO content.",variant:"destructive"})}},"data-testid":"button-generate-seo",children:[e.jsx(Ae,{className:"w-3.5 h-3.5"}),"AI Generate"]})]})}),e.jsxs(v,{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500",children:"SEO Title"}),e.jsx(m,{value:s.seoTitle||"",onChange:t=>c({...s,seoTitle:t.target.value}),onBlur:()=>x({seoTitle:s.seoTitle||null}),placeholder:"e.g. Kitchen Remodel in Encino â Modern Open-Concept Transformation","data-testid":"input-seo-title"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500",children:"Budget Range"}),e.jsx(m,{value:s.budgetRange||"",onChange:t=>c({...s,budgetRange:t.target.value}),onBlur:()=>x({budgetRange:s.budgetRange||null}),placeholder:"e.g. $35,000 â $85,000","data-testid":"input-budget-range"})]}),e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500",children:"Home Style"}),e.jsx(m,{value:s.homeStyle||"",onChange:t=>c({...s,homeStyle:t.target.value}),onBlur:()=>x({homeStyle:s.homeStyle||null}),placeholder:"e.g. Mid-Century Modern","data-testid":"input-home-style"})]})]}),e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500",children:"Scope Summary"}),e.jsx(m,{value:s.scopeSummary||"",onChange:t=>c({...s,scopeSummary:t.target.value}),onBlur:()=>x({scopeSummary:s.scopeSummary||null}),placeholder:"e.g. Full gut remodel with structural changes","data-testid":"input-scope-summary"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500",children:"Design Phase Timeline"}),e.jsx(m,{value:s.timelineDesignPhase||"",onChange:t=>c({...s,timelineDesignPhase:t.target.value}),onBlur:()=>x({timelineDesignPhase:s.timelineDesignPhase||null}),placeholder:"e.g. 2-4 weeks","data-testid":"input-timeline-design"})]}),e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500",children:"Construction Phase Timeline"}),e.jsx(m,{value:s.timelineConstructionPhase||"",onChange:t=>c({...s,timelineConstructionPhase:t.target.value}),onBlur:()=>x({timelineConstructionPhase:s.timelineConstructionPhase||null}),placeholder:"e.g. 10-14 weeks","data-testid":"input-timeline-construction"})]})]}),e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500",children:"Project Story"}),e.jsx(w,{value:s.projectStory||"",onChange:t=>c({...s,projectStory:t.target.value}),onBlur:()=>x({projectStory:s.projectStory||null}),rows:3,placeholder:"Narrative about the project's inspiration and design intent...","data-testid":"textarea-project-story"})]}),e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500",children:"Cost Range Paragraph"}),e.jsx(w,{value:s.costRangeParagraph||"",onChange:t=>c({...s,costRangeParagraph:t.target.value}),onBlur:()=>x({costRangeParagraph:s.costRangeParagraph||null}),rows:2,placeholder:"Investment context paragraph...","data-testid":"textarea-cost-range"})]}),e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500",children:"Neighborhood Context"}),e.jsx(w,{value:s.localContextParagraph||"",onChange:t=>c({...s,localContextParagraph:t.target.value}),onBlur:()=>x({localContextParagraph:s.localContextParagraph||null}),rows:2,placeholder:"Paragraph about the neighborhood and local architecture...","data-testid":"textarea-local-context"})]}),e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500",children:"Design Details (one per line)"}),e.jsx(w,{value:(s.designDetails||[]).join(` 2`),onChange:t=>c({...s,designDetails:t.target.value.split(`
3`).filter(Boolean)}),onBlur:()=>x({designDetails:(s.designDetails||[]).filter(Boolean)}),rows:4,placeholder:`Quartz countertops 4Custom shaker cabinets 5Matte black hardware`,"data-testid":"textarea-design-details"})]}),e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500",children:"FAQ Entries (JSON)"}),e.jsx(w,{value:s.faqEntries?JSON.stringify(s.faqEntries,null,2):"",onChange:t=>{try{const i=JSON.parse(t.target.value);c({...s,faqEntries:i})}catch{}},onBlur:()=>{s.faqEntries&&x({faqEntries:s.faqEntries})},rows:6,placeholder:'[{"question": "...", "answer": "..."}]',"data-testid":"textarea-faq-entries"})]}),e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500",children:"Related Service Links (JSON)"}),e.jsx(w,{value:s.relatedServiceLinks?JSON.stringify(s.relatedServiceLinks,null,2):"",onChange:t=>{try{const i=JSON.parse(t.target.value);c({...s,relatedServiceLinks:i})}catch{}},onBlur:()=>{s.relatedServiceLinks&&x({relatedServiceLinks:s.relatedServiceLinks})},rows:4,placeholder:'[{"label": "Kitchen Remodeling Services", "href": "/services/kitchen-remodeling"}]',"data-testid":"textarea-related-service-links"}),e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Auto-computed from project type/city if left empty."})]}),e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500",children:"Similar Project IDs (comma-separated)"}),e.jsx(m,{value:(s.similarProjectIds||[]).join(", "),onChange:t=>{const i=t.target.value.split(",").map(o=>parseInt(o.trim())).filter(o=>!isNaN(o));c({...s,similarProjectIds:i})},onBlur:()=>x({similarProjectIds:s.similarProjectIds||[]}),placeholder:"e.g. 12, 15, 23","data-testid":"input-similar-project-ids"}),e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Override auto-detected similar projects. Leave empty for automatic matching."})]})]})]}),e.jsxs(f,{"data-testid":"card-geo-data",children:[e.jsx(T,{className:"pb-2",children:e.jsx(D,{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide",children:"Geo Data"})}),e.jsxs(v,{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500",children:"Latitude"}),e.jsx(m,{value:s.latitude||"",onChange:t=>c({...s,latitude:t.target.value}),onBlur:()=>x({latitude:s.latitude||null}),placeholder:"e.g. 34.0522","data-testid":"input-latitude"})]}),e.jsxs("div",{children:[e.jsx(r,{className:"text-xs text-gray-500",children:"Longitude"}),e.jsx(m,{value:s.longitude||"",onChange:t=>c({...s,longitude:t.target.value}),onBlur:()=>x({longitude:s.longitude||null}),placeholder:"e.g. -118.2437","data-testid":"input-longitude"})]})]}),e.jsx("p",{className:"text-xs text-gray-400",children:"Auto-filled from address. Edit manually if needed."})]})]})]}),e.jsxs(U,{value:"activity",className:"space-y-4 mt-4",children:[e.jsx("h3",{className:"font-semibold text-gray-700",children:"Activity Timeline"}),re.length===0?e.jsxs("div",{className:"text-center py-12 text-gray-400",children:[e.jsx(Re,{className:"w-12 h-12 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:"No activity recorded"})]}):e.jsx("div",{className:"space-y-3",children:re.map(t=>e.jsxs("div",{className:"flex gap-3 items-start","data-testid":`activity-${t.id}`,children:[e.jsx("div",{className:"mt-0.5 p-1.5 rounded-full bg-gray-50 border",children:ds(t.type)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-sm",children:t.title}),t.description&&e.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:t.description}),e.jsxs("div",{className:"text-xs text-gray-400 mt-0.5 flex items-center gap-1",children:[e.jsx(Q,{className:"w-3 h-3"})," ",it(t.createdAt)]})]})]},t.id))})]})]})]})}return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[e.jsx("h2",{className:"text-2xl font-bold text-gray-900","data-testid":"text-production-title",children:"Production"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(g,{variant:"outline",onClick:()=>{ve(!0),Ct()},"data-testid":"button-from-lead",children:[e.jsx(es,{className:"w-4 h-4 mr-1"})," From Lead"]}),e.jsxs(Y,{open:ht,onOpenChange:Ee,children:[e.jsx(ke,{asChild:!0,children:e.jsxs(g,{className:"bg-[hsl(174,62%,47%)] hover:bg-[hsl(174,62%,40%)]","data-testid":"button-new-project",children:[e.jsx(ns,{className:"w-4 h-4 mr-1"})," Add Past Project"]})}),e.jsxs(ee,{className:"max-w-lg max-h-[90vh] overflow-y-auto","data-testid":"dialog-create-project",children:[e.jsx(te,{children:e.jsx(se,{children:"Add Past Project"})}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(r,{children:"Client Name *"}),e.jsx(m,{value:d.clientName,onChange:a=>y({...d,clientName:a.target.value}),"data-testid":"input-client-name"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(r,{children:"Client Email"}),e.jsx(m,{type:"email",value:d.clientEmail,onChange:a=>y({...d,clientEmail:a.target.value}),"data-testid":"input-client-email"})]}),e.jsxs("div",{children:[e.jsx(r,{children:"Client Phone"}),e.jsx(m,{value:d.clientPhone,onChange:a=>y({...d,clientPhone:a.target.value}),"data-testid":"input-client-phone"})]})]}),e.jsxs("div",{children:[e.jsx(r,{children:"Project Address *"}),e.jsx(m,{value:d.projectAddress,onChange:a=>y({...d,projectAddress:a.target.value}),"data-testid":"input-project-address"})]}),e.jsxs("div",{children:[e.jsx(r,{children:"City"}),e.jsx(m,{value:d.projectCity,onChange:a=>y({...d,projectCity:a.target.value}),"data-testid":"input-project-city"})]}),e.jsxs("div",{children:[e.jsx(r,{children:"Project Type *"}),e.jsxs(M,{value:d.projectType,onValueChange:a=>y({...d,projectType:a}),children:[e.jsx(G,{"data-testid":"select-project-type",children:e.jsx(J,{placeholder:"Select type"})}),e.jsx(z,{children:ms.map(a=>e.jsx(C,{value:a,children:a},a))})]})]}),e.jsxs("div",{children:[e.jsx(r,{children:"Contract Price"}),e.jsx(m,{type:"number",value:d.contractPrice,onChange:a=>y({...d,contractPrice:a.target.value}),placeholder:"0","data-testid":"input-contract-price"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(r,{children:"Start Date"}),e.jsx(m,{type:"date",value:d.startDate,onChange:a=>y({...d,startDate:a.target.value}),"data-testid":"input-create-start-date"})]}),e.jsxs("div",{children:[e.jsx(r,{children:"Estimated Completion"}),e.jsx(m,{type:"date",value:d.estimatedCompletion,onChange:a=>y({...d,estimatedCompletion:a.target.value}),"data-testid":"input-create-completion"})]})]}),e.jsxs("div",{children:[e.jsx(r,{children:"Description"}),e.jsx(w,{value:d.projectDescription,onChange:a=>y({...d,projectDescription:a.target.value}),rows:2,placeholder:"Brief description for portfolio...","data-testid":"textarea-project-description-create"})]}),e.jsxs("div",{children:[e.jsx(r,{children:"Notes"}),e.jsx(w,{value:d.notes,onChange:a=>y({...d,notes:a.target.value}),rows:2,"data-testid":"textarea-create-notes"})]}),e.jsxs(g,{onClick:St,disabled:q,className:"w-full bg-[hsl(174,62%,47%)] hover:bg-[hsl(174,62%,40%)]","data-testid":"button-submit-project",children:[q?e.jsx(A,{className:"w-4 h-4 animate-spin mr-1"}):null,"Create Project"]})]})]})]})]})]}),e.jsxs("div",{className:"flex gap-3 flex-wrap",children:[e.jsx(m,{placeholder:"Search projects...",value:ce,onChange:a=>gt(a.target.value),className:"max-w-xs","data-testid":"input-search-projects"}),e.jsxs(M,{value:le,onValueChange:ut,children:[e.jsx(G,{className:"w-36","data-testid":"select-filter-status",children:e.jsx(J,{})}),e.jsxs(z,{children:[e.jsx(C,{value:"all",children:"All Status"}),e.jsx(C,{value:"active",children:"Active"}),e.jsx(C,{value:"completed",children:"Completed"}),e.jsx(C,{value:"on_hold",children:"On Hold"})]})]})]}),e.jsx(Y,{open:xt,onOpenChange:ve,children:e.jsxs(ee,{className:"max-w-lg max-h-[80vh] overflow-y-auto","data-testid":"dialog-from-lead",children:[e.jsx(te,{children:e.jsx(se,{children:"Create Project from Lead"})}),Nt?e.jsx("div",{className:"flex items-center justify-center py-10",children:e.jsx(A,{className:"w-6 h-6 animate-spin text-[hsl(174,62%,47%)]"})}):Fe.length===0?e.jsx("div",{className:"text-center py-10 text-gray-400",children:e.jsx("p",{children:"No leads found"})}):e.jsx("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:Fe.map(a=>e.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg hover:bg-gray-50 cursor-pointer",onClick:()=>Pt(a),"data-testid":`lead-option-${a.id}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-sm",children:a.name}),e.jsx("div",{className:"text-xs text-gray-500",children:a.email}),a.projectType&&e.jsx(P,{variant:"outline",className:"text-[10px] mt-1",children:a.projectType}),a.projectAddress&&e.jsxs("div",{className:"text-xs text-gray-400 mt-0.5 flex items-center gap-1",children:[e.jsx(pe,{className:"w-3 h-3"}),a.projectAddress]})]}),e.jsx(ct,{className:"w-4 h-4 text-gray-400"})]},a.id))})]})}),u?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(A,{className:"w-8 h-8 animate-spin text-[hsl(174,62%,47%)]","data-testid":"spinner-loading"})}):Ke.length===0?e.jsxs("div",{className:"text-center py-20 text-gray-400",children:[e.jsx(ae,{className:"w-16 h-16 mx-auto mb-3 opacity-50"}),e.jsx("p",{className:"text-lg",children:ce||le!=="all"?"No matching projects":"No projects yet"}),e.jsx("p",{className:"text-sm mt-1",children:'Click "Add Past Project" or "From Lead" to get started'})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4","data-testid":"grid-projects",children:Ke.map(a=>{const t=rt(a.startDate,a.estimatedCompletion),i=a.photos?.[0];return e.jsxs(f,{className:"cursor-pointer hover:shadow-md transition-shadow border overflow-hidden",onClick:()=>{c(a),W("overview"),B(a.id)},"data-testid":`card-project-${a.id}`,children:[i&&e.jsx("div",{className:"h-32 overflow-hidden",children:e.jsx("img",{src:i.url,alt:i.caption||"Project",className:"w-full h-full object-cover",loading:"lazy"})}),e.jsxs(v,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-bold text-gray-900 truncate","data-testid":`text-client-name-${a.id}`,children:a.clientName}),e.jsxs("div",{className:"text-xs text-gray-500 flex items-center gap-1 mt-0.5",children:[e.jsx(pe,{className:"w-3 h-3 shrink-0"}),e.jsx("span",{className:"truncate",children:a.projectCity||a.projectAddress})]})]}),e.jsx(P,{className:`${at(a.status)} border text-[10px] shrink-0 ml-2`,"data-testid":`badge-project-status-${a.id}`,children:a.status.replace("_"," ")})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(P,{variant:"outline",className:"text-[10px]",children:a.projectType}),e.jsx(P,{className:`${Te(a.stage)} border text-[10px]`,"data-testid":`badge-stage-${a.id}`,children:X[a.stage]||a.stage}),t&&e.jsxs(P,{variant:"outline",className:"text-[10px]",children:[e.jsx(Q,{className:"w-3 h-3 mr-0.5"})," ",t]})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"font-semibold text-gray-700","data-testid":`text-price-${a.id}`,children:De(a.contractPrice)}),e.jsxs("span",{className:"text-gray-400",children:[a.progressPercent,"%"]})]}),e.jsx(Ye,{value:a.progressPercent,className:"h-1.5","data-testid":`progress-${a.id}`})]})]},a.id)})})]})}function xs({open:p,onOpenChange:N,onShare:u,description:$}){const[s,c]=n.useState([]),j=[{id:"gbp",label:"Google Business Profile",icon:ot},{id:"facebook",label:"Facebook",icon:ie},{id:"instagram",label:"Instagram",icon:ss},{id:"twitter",label:"X / Twitter",icon:ie}],I=h=>{c(k=>k.includes(h)?k.filter(re=>re!==h):[...k,h])};return e.jsx(Y,{open:p,onOpenChange:N,children:e.jsxs(ee,{"data-testid":"dialog-social-share",children:[e.jsx(te,{children:e.jsx(se,{children:"Share to Social Media"})}),e.jsxs("div",{className:"space-y-4",children:[$&&e.jsxs("div",{className:"p-3 bg-gray-50 rounded-lg text-sm text-gray-700",children:[e.jsx("p",{className:"text-xs font-semibold text-gray-500 mb-1",children:"Content Preview"}),$]}),e.jsx("div",{className:"space-y-2",children:j.map(h=>e.jsxs("button",{onClick:()=>I(h.id),className:`w-full flex items-center gap-3 p-4 min-h-[48px] rounded-lg border transition-colors ${s.includes(h.id)?"border-[hsl(174,62%,47%)] bg-teal-50":"border-gray-200 hover:bg-gray-50"}`,"data-testid":`toggle-platform-${h.id}`,children:[e.jsx(h.icon,{className:`w-5 h-5 ${s.includes(h.id)?"text-[hsl(174,62%,47%)]":"text-gray-400"}`}),e.jsx("span",{className:"text-sm font-medium",children:h.label}),s.includes(h.id)&&e.jsx(fe,{className:"w-4 h-4 text-[hsl(174,62%,47%)] ml-auto"})]}
5,h.id))}),e.jsxs(g,{onClick:()=>u(s),disabled:s.length===0,className:"w-full min-h-[48px] bg-[hsl(174,62%,47%)] hover:bg-[hsl(174,62%,40%)]","data-testid":"button-confirm-share",children:[e.jsx(ie,{className:"w-4 h-4 mr-2"}),"Share to ",s.length," Platform",s.length!==1?"s":""]})]})]})})}function ps({projectId:p,projectStatus:N}){const[u,$]=n.useState(null),[s,c]=n.useState(!1),{toast:j}=lt(),I=async()=>{c(!0);try{const h=await fetch(`/api/projects/${p}/maps-ripple`,{method:"POST",credentials:"include"});if(!h.ok)throw new Error("Failed to trigger ripple");const k=await h.json();$(k),j({title:"Maps Ripple Generated",description:`Campaign suggestions ready for ${k.city}`})}catch(h){j({title:"Ripple failed",description:h.message,variant:"destructive"})}c(!1)};return e.jsxs(f,{"data-testid":"card-maps-ripple",children:[e.jsx(T,{className:"pb-2",children:e.jsxs(D,{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide flex items-center gap-2",children:[e.jsx(Ae,{className:"w-4 h-4 text-[hsl(174,62%,47%)]"}),"Maps Ripple Effect"]})}),e.jsxs(v,{className:"space-y-3",children:[e.jsx("p",{className:"text-xs text-gray-500",children:"Generate a Google Post, local ad campaign, and outreach plan targeting neighbors around this project."}),e.jsxs(g,{onClick:I,disabled:s,className:"bg-[hsl(174,62%,47%)] hover:bg-[hsl(174,62%,40%)]","data-testid":"button-trigger-ripple",children:[s?e.jsx(A,{className:"w-4 h-4 mr-1 animate-spin"}):e.jsx(ts,{className:"w-4 h-4 mr-1"}),"Trigger Maps Ripple"]}),u&&e.jsxs("div",{className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3","data-testid":"ripple-google-post",children:[e.jsx("p",{className:"text-xs font-semibold text-blue-700 mb-1",children:"Generated Google Post"}),e.jsx("p",{className:"text-xs text-gray-700 whitespace-pre-wrap",children:u.googlePost})]}),u.campaignSuggestion&&e.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-3","data-testid":"ripple-campaign-suggestion",children:[e.jsx("p",{className:"text-xs font-semibold text-green-700 mb-1",children:"Suggested Maps Campaign"}),e.jsxs("div",{className:"text-xs text-gray-700 space-y-1",children:[e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Name:"})," ",u.campaignSuggestion.name]}),e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Service:"})," ",u.campaignSuggestion.serviceType]}),e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Target:"})," ",u.campaignSuggestion.targetCities?.join(", ")]}),e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Radius:"})," ",u.campaignSuggestion.radius," miles"]}),e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Budget:"})," ",u.campaignSuggestion.estimatedCost]}),e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Est. Reach:"})," ",u.campaignSuggestion.estimatedReach?.toLocaleString()," homeowners"]})]})]}),u.outreachPlan&&e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-3","data-testid":"ripple-outreach-plan",children:[e.jsx("p",{className:"text-xs font-semibold text-amber-700 mb-1",children:"Outreach Plan"}),e.jsx("ul",{className:"text-xs text-gray-700 space-y-1 list-disc list-inside",children:u.outreachPlan.map((h,k)=>e.jsx("li",{children:h},k))})]})]})]})]})}export{ea 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.