PageSourceSearch

https://site-seeker--ryanhmarcus.replit.app/assets/ExpeditionLogFinds-WGEvdz2V.js

js site-seeker--ryanhmarcus.replit.app collected 2026-10-03 03:56:40 UTC 12,602 bytes, 1 lines download raw bytes

1import{m as le,u as me,a as x,h as B,f as ue,j as e}from"./vendor-react-Dp74XvrO.js";import{d as xe,B as d,e as v,f as k,h as y,j as S,a1 as L,ak as _,k as A,I as C,p as I,t as he,Z as ge,P as pe}from"./index-CgLRPvlt.js";import{S as O,a as q,b as D,c as Y,d as U}from"./select-SlncRBHl.js";import{A as V}from"./arrow-left-DnXGtL6V.js";import{C as j}from"./circle-check-big-CMg4BMws.js";import{C as W}from"./circle-x-m4x_12YA.js";import{S as J}from"./skip-forward-CZLhIUAh.js";import{M as je}from"./map-pin-C5N1gAIc.js";import{T as fe}from"./triangle-alert-Ddm6pYoK.js";import{T as Ne}from"./target-BOGYGke5.js";import"./vendor-ui-uHkQjjD7.js";import"./vendor-charts-CMwTwPG7.js";import"./vendor-motion-SqhVTVom.js";import"./chevron-up-BEa2J_97.js";typeof globalThis.__name>"u"&&(globalThis.__name=function(c){return c});const be=["Coin","Button","Buckle","Bullet/Cartridge","Tool/Hardware","Jewelry","Relic","Iron Junk","Modern Trash","Nothing Notable"],ve=["Pre-1800","1800-1850","1850-1900","1900-1950","Post-1950","Unknown"],ke=c=>{switch(c){case"confirmed":return e.jsx(j,{className:"w-4 h-4 text-green-500"});case"corrected":return e.jsx(Ne,{className:"w-4 h-4 text-blue-500"});case"undocumented_terrain_only":return e.jsx(fe,{className:"w-4 h-4 text-amber-500"});default:return e.jsx(je,{className:"w-4 h-4 text-slate-500"})}},ye=c=>{switch(c){case"confirmed":return"Confirmed";case"corrected":return"Corrected";case"historical_only":return"Historical Only";case"undocumented_terrain_only":return"Terrain Anomaly";default:return c||"Unknown"}};function Be(){var H,M,P;const{planId:c}=le(),[,w]=me(),[h,K]=x.useState(0),[X,T]=x.useState(0),[$,g]=x.useState({}),[z,G]=x.useState({}),[R,F]=x.useState({}),[E,Q]=x.useState(""),[ee,se]=x.useState(!1),[te,ae]=x.useState(""),{data:m,isLoading:ne}=B({queryKey:["/api/expedition",c],queryFn:()=>fetch(`/api/expedition/${c}`,{credentials:"include"}).then(t=>t.json()),enabled:!!c}),{data:u}=B({queryKey:["/api/expedition",c,"feedback"],queryFn:()=>fetch(`/api/expedition/${c}/feedback`,{credentials:"include"}).then(t=>t.json()),enabled:!!c}),f=ue({mutationFn:async t=>(await xe("POST",`/api/expedition/${c}/log-finds`,t)).json(),onSuccess:t=>{se(!0),ae(t.summary||"")}}),N=((H=m==null?void 0:m.planData)==null?void 0:H.geospatialZones)||[],ie=t=>{var o;const s=N[t];if(!s)return;const r={zoneIndex:t,zoneName:s.name||`Zone ${t+1}`,zoneLat:String(s.lat),zoneLng:String(s.lng),validationStatus:s.validationStatus||"",confidenceScore:((o=s.confidenceScore)==null?void 0:o.combined)||0,description:"",category:"",estimatedEra:"",depthInches:"",findLat:"",findLng:"",usedZoneCoordinates:!0,detectorModel:E,detectorSettings:""};F(l=>({...l,[t]:[...l[t]||[],r]}))},p=(t,s,r,o)=>{F(l=>{const a=[...l[t]||[]];return a[s]={...a[s],[r]:o},{...l,[t]:a}})},re=(t,s)=>{F(r=>{const o=[...r[t]||[]];return o.splice(s,1),{...r,[t]:o}})},ce=()=>{var r,o,l;const t=[],s=[];for(let a=0;a<N.length;a++){const i=N[a],n=$[a],oe=R[a]||[],de=n==="hunted"||n==="nothing",b=oe.filter(Z=>Z.description.trim()&&Z.category);s.push({zoneIndex:a,zoneName:i.name||`Zone ${a+1}`,validationStatus:i.validationStatus||"",confidenceScore:((r=i.confidenceScore)==null?void 0:r.combined)||0,hunted:de,skipReason:n==="skipped"?z[a]||"Not specified":"",totalFinds:b.length,bestFindCategory:((o=b[0])==null?void 0:o.category)||"",bestFindEra:((l=b[0])==null?void 0:l.estimatedEra)||""}),t.push(...b)}f.mutate({zoneOutcomes:s,finds:t,starRating:h})};return ne?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx("div",{className:"text-muted-foreground",children:"Loading expedition plan..."})}):u!=null&&u.hasLogged?e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"max-w-4xl mx-auto p-6",children:[e.jsxs(d,{variant:"ghost",onClick:()=>w("/workspace"),className:"mb-6","data-testid":"button-back",children:[e.jsx(V,{className:"w-4 h-4 mr-2"})," Back"]}),e.jsxs(v,{children:[e.jsx(k,{children:e.jsxs(y,{className:"flex items-center gap-2",children:[e.jsx(j,{className:"w-5 h-5 text-green-500"}),"Finds Already Logged"]})}),e.jsxs(S,{className:"space-y-4",children:[e.jsx("p",{className:"text-muted-foreground","data-testid":"text-already-logged",children:(M=u.feedback)==null?void 0:M.summaryText}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-sm text-muted-foreground mr-2",children:"Your rating:"}),[1,2,3,4,5].map(t=>{var s;return e.jsx(L,{className:`w-5 h-5 ${t<=(((s=u.feedback)==null?void 0:s.starRating)||0)?"fill-amber-400 text-amber-400":"text-slate-300"}`},t)})]}),((P=u.feedback)==null?void 0:P.zoneHitRate)&&e.jsxs("div",{className:"grid grid-cols-2 gap-4 pt-4 border-t",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"Zone Hit Rate"}),e.jsxs("div",{className:"text-lg font-semibold","data-testid":"text-zone-hit-rate",children:[Math.round(u.feedback.zoneHitRate),"%"]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"Total Finds"}),e.jsx("div",{className:"text-lg font-semibold","data-testid":"text-total-finds",children:u.feedback.totalFinds})]})]})]})]})]})}):ee?e.jsx("div",{className:"min-h-screen bg-background",children:e.jsx("div",{className:"max-w-4xl mx-auto p-6",children:e.jsxs(v,{children:[e.jsx(k,{children:e.jsxs(y,{className:"flex items-center gap-2",children:[e.jsx(j,{className:"w-5 h-5 text-green-500"}),"Finds Logged Successfully"]})}),e.jsxs(S,{className:"space-y-4",children:[e.jsx("p",{className:"text-lg","data-testid":"text-summary",children:te}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-sm text-muted-foreground mr-2",children:"Your rating:"}),[1,2,3,4,5].map(t=>e.jsx(L,{className:`w-5 h-5 ${t<=h?"fill-amber-400 text-amber-400":"text-slate-300"}`},t))]}),e.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-1",children:[e.jsx(_,{className:"w-4 h-4"}
1),"Your exact find locations are private. Only generalized regional data is used to improve future plans."]}),e.jsx(d,{onClick:()=>w("/workspace"),"data-testid":"button-back-workspace",children:"Back to Workspace"})]})]})})}):e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"max-w-4xl mx-auto p-6",children:[e.jsxs(d,{variant:"ghost",onClick:()=>w("/workspace"),className:"mb-4","data-testid":"button-back",children:[e.jsx(V,{className:"w-4 h-4 mr-2"})," Back"]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold font-serif","data-testid":"text-title",children:"Log Your Finds"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:(m==null?void 0:m.title)||(m==null?void 0:m.locationName)}),e.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-1 mt-2",children:[e.jsx(_,{className:"w-4 h-4"}),"Your exact find locations are private. Only generalized regional data is used to improve future plans."]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx(A,{className:"text-sm",children:"Detector Used (optional, applies to all zones)"}),e.jsx(C,{value:E,onChange:t=>Q(t.target.value),placeholder:"e.g., Minelab Equinox 900, XP Deus II",className:"max-w-md mt-1","data-testid":"input-detector-model"})]}),e.jsx("div",{className:"space-y-4",children:N.map((t,s)=>{var l;const r=$[s],o=R[s]||[];return e.jsxs(v,{className:r==="hunted"?"border-green-500/30":r==="skipped"?"border-slate-500/30 opacity-70":r==="nothing"?"border-amber-500/30":"",children:[e.jsxs(k,{className:"pb-3",children:[e.jsx("div",{className:"flex items-start justify-between",children:e.jsxs("div",{className:"flex items-center gap-2",children:[ke(t.validationStatus),e.jsx(y,{className:"text-base","data-testid":`text-zone-name-${s}`,children:t.name||`Zone ${s+1}`}),e.jsx(I,{variant:"outline",className:"text-xs",children:ye(t.validationStatus)}),((l=t.confidenceScore)==null?void 0:l.combined)&&e.jsxs(I,{variant:"secondary",className:"text-xs",children:[t.confidenceScore.combined,"/100"]})]})}),t.description&&e.jsx("p",{className:"text-sm text-muted-foreground mt-1 line-clamp-2",children:t.description})]}),e.jsxs(S,{children:[!r&&e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(d,{size:"sm",variant:"outline",onClick:()=>g(a=>({...a,[s]:"hunted"})),"data-testid":`button-hunted-${s}`,children:[e.jsx(j,{className:"w-4 h-4 mr-1"})," Hunted — Found Items"]}),e.jsxs(d,{size:"sm",variant:"outline",onClick:()=>g(a=>({...a,[s]:"nothing"})),"data-testid":`button-nothing-${s}`,children:[e.jsx(W,{className:"w-4 h-4 mr-1"})," Hunted — No Finds"]}),e.jsxs(d,{size:"sm",variant:"outline",onClick:()=>g(a=>({...a,[s]:"skipped"})),"data-testid":`button-skipped-${s}`,children:[e.jsx(J,{className:"w-4 h-4 mr-1"})," Skipped"]})]}),r==="skipped"&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(J,{className:"w-4 h-4"})," Skipped",e.jsx(d,{size:"sm",variant:"ghost",onClick:()=>g(a=>({...a,[s]:null})),className:"text-xs",children:"Change"})]}),e.jsx(C,{placeholder:"Why? (optional — no access, ran out of time, terrain too difficult)",value:z[s]||"",onChange:a=>G(i=>({...i,[s]:a.target.value})),"data-testid":`input-skip-reason-${s}`})]}),r==="nothing"&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(W,{className:"w-4 h-4"})," Hunted — No notable finds",e.jsx(d,{size:"sm",variant:"ghost",onClick:()=>g(a=>({...a,[s]:null})),className:"text-xs",children:"Change"})]}),r==="hunted"&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[e.jsx(j,{className:"w-4 h-4"})," Hunted — logging finds",e.jsx(d,{size:"sm",variant:"ghost",onClick:()=>g(a=>({...a,[s]:null})),className:"text-xs",children:"Change"})]}),o.map((a,i)=>e.jsxs("div",{className:"border rounded-lg p-3 space-y-2 bg-muted/30",children:[e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("span",{className:"text-xs font-medium text-muted-foreground",children:["Find #",i+1]}),e.jsx(d,{size:"sm",variant:"ghost",onClick:()=>re(s,i),"data-testid":`button-remove-find-${s}-${i}`,children:e.jsx(he,{className:"w-3 h-3"})})]}),e.jsx(C,{placeholder:"What did you find? (e.g., Large cent 1847, Flat button military)",value:a.description,onChange:n=>p(s,i,"description",n.target.value),"data-testid":`input-find-desc-${s}-${i}`}),e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsxs(O,{value:a.category,onValueChange:n=>p(s,i,"category",n),children:[e.jsx(q,{"data-testid":`select-category-${s}-${i}`,children:e.jsx(D,{placeholder:"Category"})}),e.jsx(Y,{children:be.map(n=>e.jsx(U,{value:n,children:n},n))})]}),e.jsxs(O,{value:a.estimatedEra,onValueChange:n=>p(s,i,"estimatedEra",n),children:[e.jsx(q,{"data-testid":`select-era-${s}-${i}`,children:e.jsx(D,{placeholder:"Era"})}),e.jsx(Y,{children:ve.map(n=>e.jsx(U,{value:n,children:n},n))})]}
1),e.jsx(C,{type:"number",placeholder:"Depth (inches)",value:a.depthInches,onChange:n=>p(s,i,"depthInches",n.target.value),"data-testid":`input-depth-${s}-${i}`})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ge,{checked:a.usedZoneCoordinates,onCheckedChange:n=>p(s,i,"usedZoneCoordinates",!!n),"data-testid":`checkbox-zone-coords-${s}-${i}`}),e.jsx(A,{className:"text-xs text-muted-foreground",children:"Used zone coordinates for find location"})]})]},i)),e.jsxs(d,{size:"sm",variant:"outline",onClick:()=>ie(s),"data-testid":`button-add-find-${s}`,children:[e.jsx(pe,{className:"w-4 h-4 mr-1"})," Add Find"]})]})]})]},s)})}),e.jsxs(v,{className:"mt-6",children:[e.jsx(k,{children:e.jsx(y,{className:"text-base",children:"How accurate was this plan?"})}),e.jsxs(S,{children:[e.jsxs("div",{className:"flex items-center gap-1 mb-4",children:[[1,2,3,4,5].map(t=>e.jsx("button",{onMouseEnter:()=>T(t),onMouseLeave:()=>T(0),onClick:()=>K(t),"data-testid":`button-star-${t}`,children:e.jsx(L,{className:`w-8 h-8 cursor-pointer transition-colors ${t<=(X||h)?"fill-amber-400 text-amber-400":"text-slate-300 hover:text-amber-200"}`})},t)),h>0&&e.jsxs("span",{className:"text-sm text-muted-foreground ml-2",children:[h,"/5"]})]}),e.jsx(d,{onClick:ce,disabled:f.isPending||Object.keys($).length===0||h===0,className:"w-full","data-testid":"button-submit-finds",children:f.isPending?"Submitting...":"Submit Find Log"}),f.isError&&e.jsx("p",{className:"text-sm text-red-500 mt-2",children:"Failed to submit. Please try again."})]})]})]})})}export{Be 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.