1import{f as fe,a as O,b as C,r as j,j as e,D as ye,p as be,q as _e,s as ke,S as ie,e as m,m as $,T as qe,v as X,i as ve,k as je,a7 as Z,B as _,X as es,w as S,ah as ee,a4 as Le,N as Ee,O as Oe,Q as Re,$ as Te,a0 as Be,a1 as Fe,an as ss,R as Ve,z as Ie,A as Pe,G as P,n as Ne,C as z,h as Y,d as H,u as as,a2 as ts,o as J,l as rs,Y as ls,E as we,_ as is,aj as ns,ak as cs,ai as ds}from"./index-CLuVgEp7.js";import{N as ze}from"./navigation-CCFX36cD.js";import{a as Ce}from"./addMonths-aX5lKiCr.js";import{d as Ye}from"./differenceInDays-CUx-ZW3M.js";import{f as R}from"./format-B1qf2TaJ.js";import{H as He}from"./history-zKUxIlU9.js";import{C as ue}from"./clock-8aDtVbiQ.js";import{P as ge}from"./plus-C11ZxXFy.js";import{p as xe}from"./parseISO-x_uHMx_J.js";import{C as os}from"./circle-x-C6V06k88.js";import{T as ms}from"./textarea-B8uWSCXN.js";import{W as te}from"./wrench-DjRD1B6h.js";import{P as us}from"./printer-BDVqA1cR.js";import{u as $e}from"./use_paginated_query-HQoSkUmt.js";import{T as Je}from"./trash-2-CzA1_PDU.js";import{H as ps}from"./heart-pulse-BPCZ8YFi.js";import{E as hs,a as gs,b as xs,c as fs,d as ys}from"./empty-BlBaCsbZ.js";import{A as Se}from"./ambulance-BlPRE_BL.js";import{C as Xe}from"./circle-alert-DXEO5vTo.js";import"./en-US-BEJgoTcg.js";const We=[{id:"amb1",model:"Drivemaster 55",vehicleLocation:"Ambulance 1 - YX59EKC"},{id:"amb2",model:"Nuvi 68",vehicleLocation:"Ambulance 2 - YJ58XFM"},{id:"amb3",model:"Drive 51",vehicleLocation:"Ambulance 3 - YX59EXB"},{id:"amb4",model:"Nuvi 65",vehicleLocation:"Ambulance 4 - YX59EJE"},{id:"amb5",model:"Nuvi 65",vehicleLocation:"Ambulance 5 - YX59EJG"},{id:"amb6",model:"Fleet",vehicleLocation:"Ambulance 6 - YX59EJL"},{id:"amb7",model:"Drive 51",vehicleLocation:"Ambulance 7 - YX59EKM"},{id:"shogun",model:"Drive 51",vehicleLocation:"Shogun - SY10NPE"},{id:"patrol",model:"Drivemaster 55",vehicleLocation:"Patrol - AJ59CFX"}];function bs(s){if(!s)return"empty";const a=Ce(new Date(s),6),n=Ye(a,new Date);return n<0?"overdue":n<=30?"warning":"ok"}function _s({satnavId:s,onClose:a}){const n=We.find(l=>l.id===s),i=O(C.satnav.getHistory,{satnavId:s});return e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:54:4","data-hercules-name":"div",className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50",children:e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:55:6","data-hercules-name":"div",className:"bg-card rounded-2xl shadow-2xl w-full max-w-md max-h-[80vh] flex flex-col",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:56:8","data-hercules-name":"div",className:"flex items-center justify-between p-4 border-b",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:57:10","data-hercules-name":"div",children:[e.jsxs("p",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:58:12","data-hercules-name":"p",className:"font-bold text-sm",children:[n?.model," â ",n?.vehicleLocation]}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:59:12","data-hercules-name":"p",className:"text-xs text-muted-foreground",children:"Full update history"})]}),e.jsx("button",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:61:10","data-hercules-name":"button",onClick:a,className:"cursor-pointer p-1.5 rounded-lg hover:bg-accent","aria-label":"Close dialog",children:e.jsx(es,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:62:12","data-hercules-name":"X",className:"w-4 h-4"})})]}),e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:65:8","data-hercules-name":"div",className:"overflow-y-auto flex-1 p-4 space-y-2",children:i?i.length===0?e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:69:12","data-hercules-name":"p",className:"text-sm text-muted-foreground text-center py-8",children:"No updates recorded yet"}):i.map((l,r)=>e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:72:14","data-hercules-name":"div",className:m("p-3 rounded-lg border text-sm",r===0?"border-primary/40 bg-primary/5":"border-border bg-muted/30"),children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:76:16","data-hercules-name":"div",className:"flex items-center justify-between gap-2",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:77:18","data-hercules-name":"p",className:"font-semibold",children:R(new Date(l.updatedDate),"dd MMM yyyy")}),r===0&&e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:78:30","data-hercules-name":"span",className:"text-[10px] font-bold text-primary bg-primary/10 px-1.5 py-0.5 rounded-full",children:"Latest"})]}),l.updatedByName&&e.jsxs("p",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:80:36","data-hercules-name":"p",className:"text-xs text-muted-foreground mt-0.5",children:["By ",l.updatedByName]}),l.notes&&e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:81:28","data-hercules-name":"p",className:"text-xs text-muted-foreground mt-1 italic",children:l.notes}),e.jsxs("p",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:82:16","data-hercules-name":"p",className:"text-[10px] text-muted-foreground
1/60 mt-1",children:["Recorded ",R(new Date(l._creationTime),"dd MMM yyyy HH:mm")]})]},l._id)):e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:67:12","data-hercules-name":"div",className:"space-y-2",children:Array.from({length:3}).map((l,r)=>e.jsx(ie,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:67:80","data-hercules-name":"Skeleton",className:"h-12 w-full"},r))})})]})})}function Me({entry:s,currentDate:a,onSaved:n}){const[i,l]=j.useState(!1),[r,t]=j.useState(()=>new Date().toISOString().split("T")[0]),[p,k]=j.useState(""),[v,h]=j.useState(!1),b=X(C.satnav.recordUpdate);async function o(){if(!r){S.error("Please enter a date");return}h(!0);try{await b({satnavId:s.id,satnavModel:s.model,vehicleLocation:s.vehicleLocation,updatedDate:r,notes:p||void 0}),S.success("Update recorded"),l(!1),k(""),n()}catch{S.error("Failed to save â check your connection and try again")}finally{h(!1)}}return e.jsxs(e.Fragment,{children:[e.jsxs("button",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:126:6","data-hercules-name":"button",onClick:()=>l(!i),className:"flex items-center gap-1 text-xs text-primary hover:underline cursor-pointer",children:[e.jsx(ge,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:130:8","data-hercules-name":"Plus",className:"w-3 h-3"})," Record update",i?e.jsx(ve,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:131:16","data-hercules-name":"ChevronUp",className:"w-3 h-3"}):e.jsx(je,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:131:
152","data-hercules-name":"ChevronDown",className:"w-3 h-3"})]}),i&&e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:134:8","data-hercules-name":"div",className:"mt-2 p-3 bg-muted/40 rounded-lg border space-y-2 text-sm",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:135:10","data-hercules-name":"div",className:"flex gap-2 items-center",children:[e.jsx("label",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:136:12","data-hercules-name":"label",className:"text-xs text-muted-foreground shrink-0",children:"Update date"}),e.jsx(Z,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:137:12","data-hercules-name":"Input",type:"date",value:r,onChange:y=>t(y.target.value),className:"h-7 text-xs"})]}),e.jsx(Z,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:139:10","data-hercules-name":"Input",placeholder:"Notes (optional)",value:p,onChange:y=>k(y.target.value),className:"h-7 text-xs"}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:145:10","data-hercules-name":"div",className:"flex gap-2",children:[e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:146:12","data-hercules-name":"Button",size:"sm",className:"h-7 text-xs",onClick:o,disabled:v,children:"Save"}),e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:147:12","data-hercules-name":"Button",size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>l(!1),children:"Cancel"})]})]})]})}function ks({open:s,onClose:a}){const{isAdmin:n}=fe(),i=O(C.satnav.getLatest,{}),[l,r]=j.useState(null),[t,p]=j.useState(0),k=new Map;if(i)for(const b of i)k.set(b.satnavId,{updatedDate:b.updatedDate,updatedByName:b.updatedByName});const v={ok:e.jsx($,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:171:8","data-hercules-name":"CheckCircle2",className:"w-3.5 h-3.5 text-green-500 shrink-0"}),warning:e.jsx(ue,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:172:13","data-hercules-name":"Clock",className:"w-3.5 h-3.5 text-amber-500 shrink-0"}),overdue:e.jsx(qe,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:173:13","data-hercules-name":"AlertTriangle",className:"w-3.5 h-3.5 text-red-500 shrink-0"}),empty:null},h={ok:"",warning:"bg-amber-50 dark:bg-amber-950/20",overdue:"bg-red-50 dark:bg-red-950/20",empty:""};return e.jsxs(e.Fragment,{children:[e.jsx(ye,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:186:6","data-hercules-name":"Dialog",open:s,onOpenChange:b=>{b||a()},children:e.jsxs(be,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:187:8","data-hercules-name":"DialogContent",className:"max-w-2xl flex flex-col max-h-[90vh]",children:[e.jsx(_e,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:188:10","data-hercules-name":"DialogHeader",children:e.jsxs(ke,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:189:12","data-hercules-name":"DialogTitle",className:"flex items-center gap-2",children:[e.jsx(ze,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:190:14","data-hercules-name":"Navigation",className:"w-5 h-5 text-lime-600"}),"Satnav Updates"]})}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:195:10","data-hercules-name":"p",className:"text-xs text-muted-foreground -mt-2",children:"Update dates are logged per satnav. A reminder will appear on the dashboard 1 month before the 6-month update is due."}),e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:199:10","data-hercules-name":"div",className:"overflow-y-auto flex-1",children:i?e.jsxs("table",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:203:14","data-hercules-name":"table",className:"w-full text-sm border-collapse",children:[e.jsx("thead",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:204:16","data-hercules-name":"thead",className:"sticky top-0 bg-card z-10",children:e.jsxs("tr",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:205:18","data-hercules-name":"tr",className:"border-b",children:[e.jsx("th",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:206:20","data-hercules-name":"th",className:"text-left px-3 py-2 text-xs font-bold text-muted-foreground",children:"Satnav Model"}),e.jsx("th",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:207:20","data-hercules-name":"th",className:"text-left px-3 py-2 text-xs font-bold text-muted-foreground",children:"Vehicle Location"}),e.jsx("th",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:208:20","data-hercules-name":"th",className:"text-left px-3 py-2 text-xs font-bold text-muted-foreground",children:"Last Updated"}),e.jsx("th",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:209:20","data-hercules-name":"th",className:"text-left px-3 py-2 text-xs font-bold text-muted-foreground",children:"Next Due"}),e.jsx("th",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:210:20","data-hercules-name":"th",className:"px-3 py-2 text-xs font-bold text-muted-foreground text-center",children:"History"})]})}),e.jsx("tbody",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:213:16","data-hercules-name":"tbody",children:We.map((b,o)=>{const y=k.get(b.id),d=bs(y?.updatedDate),g=y?Ce(new Date(y.updatedDate),6):null,q=g?Ye(g,new Date):null;return e.jsxs("tr",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:221:22","data-hercules-name":"tr",className:m("border-b last:border-0",o%2===0?"bg-background":"bg-muted/20",h[d]),children:[e.jsx("td",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:230:24","data-hercules-name":"td",className:"px-3 py-2.5",children:e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:231:26","data-hercules-name":"span",className:"font-semibold text-sm",children:b.model})}),e.jsx("td",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:234:24","data-hercules-name":"td",className:"px-3 py-2.5 text-xs text-muted-foreground",children:b.vehicleLocation}),e.jsx("td",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:236:24","data-hercules-name":"td",className:"px-3 py-2.5",children:y?e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:238:28","data-hercules-name":"div",className:"space-y-0.5",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:239:30","data-hercules-name":"div",className:"flex items-center gap-1",children:[v[d],e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:241:32","data-hercules-name":"span",className:"text-xs font-medium",children:R(new Date(y.updatedDate),"dd MMM yyyy")})]}),n&&e.jsx(Me,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:244:32","data-hercules-name":"RecordUpdateRow",entry:b,currentDate:y.updatedDate,onSaved:()=>p(A=>A+1)})]}):e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:252:28","data-hercules-name":"div",className:"space-y-0.5",children:[e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:253:30","data-hercules-name":"span",className:"text-xs text-muted-foreground
1/60 italic",children:"Not recorded"}),n&&e.jsx(Me,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:255:32","data-hercules-name":"RecordUpdateRow",entry:b,currentDate:void 0,onSaved:()=>p(A=>A+1)})]})}),e.jsx("td",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:265:24","data-hercules-name":"td",className:"px-3 py-2.5",children:g?e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:267:28","data-hercules-name":"div",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:268:30","data-hercules-name":"p",className:m("text-xs font-semibold",d==="overdue"?"text-red-600":d==="warning"?"text-amber-600":"text-muted-foreground"),children:R(g,"dd MMM yyyy")}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:276:30","data-hercules-name":"p",className:m("text-[10px]",d==="overdue"?"text-red-500 font-bold":d==="warning"?"text-amber-500":"text-muted-foreground/60"),children:q!==null&&q<0?`${Math.abs(q)}d overdue`:q!==null?`${q}d left`:""})]}):e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:290:28","data-hercules-name":"span",className:"text-xs text-muted-foreground/40",children:"â"})}),e.jsx("td",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:294:24","data-hercules-name":"td",className:"px-3 py-2.5 text-center",children:e.jsx("button",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:295:26","data-hercules-name":"button",onClick:()=>r(b.id),className:"inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground cursor-pointer p-1 rounded-md hover:bg-accent",title:"View update history",children:e.jsx(He,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:300:28","data-hercules-name":"History",className:"w-3.5 h-3.5"})})})]},b.id)})})]}):e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:201:14","data-hercules-name":"div",className:"space-y-2 p-2",children:Array.from({length:5}).map((b,o)=>e.jsx(ie,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:201:86","data-hercules-name":"Skeleton",className:"h-14 w-full"},o))})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:312:10","data-hercules-name":"div",className:"flex gap-4 flex-wrap text-[10px] text-muted-foreground pt-2 border-t",children:[e.jsxs("span",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:313:12","data-hercules-name":"span",className:"flex items-center gap-1",children:[e.jsx($,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:313:54","data-hercules-name":"CheckCircle2",className:"w-3 h-3 text-green-500"})," Up to date"]}),e.jsxs("span",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:314:12","data-hercules-name":"span",className:"flex items-center gap-1",children:[e.jsx(ue,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:314:54","data-hercules-name":"Clock",className:"w-3 h-3 text-amber-500"})," Due within 30 days"]}),e.jsxs("span",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:315:12","data-hercules-name":"span",className:"flex items-center gap-1",children:[e.jsx(qe,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:315:54","data-hercules-name":"AlertTriangle",className:"w-3 h-3 text-red-500"})," Overdue"]}),e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:316:12","data-hercules-name":"span",className:"ml-auto",children:"6-month update cycle"})]})]})}),l&&e.jsx(_s,{"data-hercules-id":"src/pages/forms/limes/_components/satnav-update-dialog.tsx:323:8","data-hercules-name":"HistoryPanel",satnavId:l,onClose:()=>r(null)})]})}const vs=[{reg:"YX59EKC",name:"Ambulance 1"},{reg:"YJ58XFM",name:"Ambulance 2"},{reg:"YX59EXB",name:"Ambulance 3"},{reg:"YX59EJE",name:"Ambulance 4"},{reg:"YX59EJG",name:"Ambulance 5"},{reg:"YX59EJL",name:"Ambulance 6"},{reg:"YX59EKM",name:"Ambulance 7"}],me=[{key:"trolley_locked",label:"Trolley can be locked into place"},{key:"trolley_lift",label:"Trolley mechanism for lifting is fully working"},{key:"trolley_brakes",label:"Trolley brakes work"},{key:"straps_present",label:"Straps are present and in good condition"},{key:"mattress_clean",label:"Mattress is clean and undamaged"},{key:"safety_sides",label:"Safety sides function and lock into place"},{key:"swl_sticker",label:"SWL sticker present"}];function js(s){return s<0?"text-red-600 dark:text-red-400":s<=30?"text-amber-600 dar
1k:text-amber-400":"text-green-600 dark:text-green-400"}function Ns(s){return s<0?"bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800":s<=30?"bg-amber-50 dark:bg-amber-900/20 border-amber-200 dark:border-amber-800":"bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800"}function ws({onSelect:s,onHistory:a}){const n=O(C.loler.getLatest,{});return e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:55:4","data-hercules-name":"div",className:"space-y-2 py-1",children:vs.map(i=>{const r=n?.find(k=>k.vehicleReg===i.reg)?.latest?.checkDate??null,t=r?Ce(xe(r),6):null,p=t?Math.round((t.getTime()-Date.now())/(1e3*60*60*24)):null;return e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:65:10","data-hercules-name":"div",className:m("flex items-center gap-3 p-3 rounded-lg border transition-colors",p===null?"bg-muted/40 border-border":Ns(p)),children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:75:12","data-hercules-name":"div",className:"shrink-0",children:p===null?e.jsx(ue,{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:77:16","data-hercules-name":"Clock",className:"w-4 h-4 text-muted-foreground"}):p<0?e.jsx(os,{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:79:16","data-hercules-name":"XCircle",className:"w-4 h-4 text-red-500"}):p<=30?e.jsx(ue,{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:81:16","data-hercules-name":"Clock",className:"w-4 h-4 text-amber-500"}):e.jsx($,{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:83:16","data-hercules-name":"CheckCircle2",className:"w-4 h-4 text-green-500"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:88:12","data-hercules-name":"div",className:"flex-1 min-w-0",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:89:14","data-hercules-name":"p",className:"text-sm font-semibold",children:i.name}),e.jsxs("p",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:90:14","data-hercules-name":"p",className:"text-xs text-muted-foreground",children:[i.reg,r&&e.jsxs(e.Fragment,{children:[" · Last: ",R(xe(r),"dd MMM yyyy")]}),t&&e.jsxs(e.Fragment,{children:[" ·"," ",e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:97:20","data-hercules-name":"span",className:m("font-medium",js(p)),children:p<0?`Overdue by ${Math.abs(p)}d`:`Due in ${p}d`})]}),!r&&e.jsxs(e.Fragment,{children:[" · ",e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:104:42","data-hercules-name":"span",className:"text-amber-600 font-medium",children:"Never checked"})]})]})]}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:109:12","data-hercules-name":"div",className:"flex gap-1.5 shrink-0",children:[e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:110:14","data-hercules-name":"Button",size:"sm",variant:"ghost",className:"h-7 w-7 p-0 cursor-pointer",title:"View history",onClick:()=>a(i),children:e.jsx(He,{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:117:16","data-hercules-name":"History",className:"w-3.5 h-3.5"})}),e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:119:14","data-hercules-name":"Button",size:"sm",className:"h-7 text-xs px-2.5 cursor-pointer",onClick:()=>s(i),children:"Record Check"})]})]},i.reg)})})}function Cs({amb:s,onBack:a}){const n=X(C.loler.recordCheck),[i,l]=j.useState(new Date().toISOString().split("T")[0]),[r,t]=j.useState({}),[p,k]=j.useState(!1),v=(o,y)=>{t(d=>({...d,[o]:d[o]===y?void 0:y}))},h=me.every(o=>r[o.key]!==void 0),b=async()=>{if(h){k(!0);try{const o={};for(const y of me)o[y.key]=r[y.key];await n({vehicleReg:s.reg,vehicleName:s.name,checkDate:i,checks:o}),S.success(`LOLER check recorded for ${s.name}`),a()}catch{S.error("Failed to save LOLER check")}finally{k(!1)}}};return e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:172:4","data-hercules-name":"div",className:"space-y-4 py-1",children:[e.jsxs("button",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:173:6","data-hercules-name":"button",onClick:a,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[e.jsx(ee,{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:177:8","data-hercules-name":"ArrowLeft",className:"w-3.5 h-3.5"}),"Back to matrix"]}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:181:6","data-hercules-name":"div",className:"flex items-center gap-2",children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:182:8","data-hercules-name":"div",className:"w-8 h-8 rounded-lg bg-lime-100 dar
1k:bg-lime-900/30 flex items-center justify-center shrink-0",children:e.jsx($,{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:183:10","data-hercules-name":"CheckCircle2",className:"w-4 h-4 text-lime-600 dark:text-lime-400"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:185:8","data-hercules-name":"div",children:[e.jsx("h3",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:186:10","data-hercules-name":"h3",className:"font-semibold text-sm",children:s.name}),e.jsxs("p",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:187:10","data-hercules-name":"p",className:"text-xs text-muted-foreground",children:[s.reg," â LOLER Inspection"]})]})]}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:192:6","data-hercules-name":"div",className:"space-y-1.5",children:[e.jsx("label",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:193:8","data-hercules-name":"label",className:"text-sm font-medium",children:"Date checks conducted"}),e.jsx("input",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:194:8","data-hercules-name":"input",type:"date",value:i,onChange:o=>l(o.target.value),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:203:6","data-hercules-name":"div",className:"space-y-2",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:204:8","data-hercules-name":"p",className:"text-sm font-medium",children:"Checklist"}),e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:205:8","data-hercules-name":"div",className:"rounded-lg border divide-y",children:me.map(o=>e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:207:12","data-hercules-name":"div",className:"flex items-center justify-between gap-3 px-3 py-2.5",children:[e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:208:14","data-hercules-name":"span",className:"text-sm flex-1",children:o.label}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:209:14","data-hercules-name":"div",className:"flex gap-1.5 shrink-0",children:[e.jsx("button",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:210:16","data-hercules-name":"button",onClick:()=>v(o.key,"yes"),className:m("px-3 py-1 rounded-full text-xs font-semibold border transition-all cursor-pointer",r[o.key]==="yes"?"bg-green-500 border-green-500 text-white":"border-input text-muted-foreground hover:border-green-400 hover:text-green-600"),children:"Yes"}),e.jsx("button",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:221:16","data-hercules-name":"button",onClick:()=>v(o.key,"no"),className:m("px-3 py-1 rounded-full text-xs font-semibold border transition-all cursor-pointer",r[o.key]==="no"?"bg-red-500 border-red-500 text-white":"border-input text-muted-foreground hover:border-red-400 hover:text-red-600"),children:"No"})]})]},o.key))})]}),e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:238:6","data-hercules-name":"Button",className:"w-full",disabled:!h||p,onClick:b,children:p?e.jsxs(e.Fragment,{children:[e.jsx(Le,{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:243:24","data-hercules-name":"Loader2",className:"w-4 h-4 animate-spin mr-2"}),"Savingâ¦"]}):"Save LOLER Check"})]})}function Ds({amb:s,onBack:a}){const n=O(C.loler.getHistory,{vehicleReg:s.reg});return e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:255:4","data-hercules-name":"div",className:"space-y-4 py-1",children:[e.jsxs("button",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:256:6","data-hercules-name":"button",onClick:a,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[e.jsx(ee,{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:260:8","data-hercules-name":"ArrowLeft",className:"w-3.5 h-3.5"}),"Back to matrix"]}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:264:6","data-hercules-name":"div",children:[e.jsxs("h3",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:265:8","data-hercules-name":"h3",className:"font-semibold text-sm",children:[s.name," â Check History"]}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:266:8","data-hercules-name":"p",className:"text-xs text-muted-foreground",children:s.reg})]}),n===void 0&&e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:270:8","data-hercules-name":"div",className:"flex items-center justify-center py-8",children:e.jsx(Le,{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:271:10","data-hercules-name":"Loader2",className:"w-5 h-5 animate-spin text-muted-foreground"})}),n?.length===0&&e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:276:8","data-hercules-name":"p",className:"text-sm text-muted-foreground text-center py-6",children:"No checks recorded yet."}),e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:279:6","data-hercules-name":"div",className:"space-y-3",children:n?.map(i=>{const l=Object.values(i.checks).every(t=>t==="yes"),r=Object.values(i.checks).filter(t=>t==="no").length;return e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:284:12","data-hercules-name":"div",className:"rounded-lg border p-3 space-y-2",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:285:14","data-hercules-name":"div",className:"flex items-center justify-between",children:[e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:286:16","data-hercules-name":"span",className:"text-sm font-semibold",children:R(xe(i.checkDate),"dd MMM yyyy")}),e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:289:16","data-hercules-name":"span",className:m("text-xs px-2 py-0.5 rounded-full font-medium",l?"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-400":"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400"),children:l?"All passed":`${r} failed`})]}),i.submittedByName&&e.jsxs("p",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:299:16","data-hercules-name":"p",className:"text-xs text-muted-foreground",children:["By ",i.submittedByName]}),e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:301:14","data-hercules-name":"div",className:"grid grid-cols-1 gap-1 pt-1",children:me.map(t=>e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:303:18","data-hercules-name":"div",className:"flex items-center justify-between text-xs",children:[e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:304:20","data-hercules-name":"span",className:"text-muted-foreground",children:t.label}),e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:305:20","data-hercules-name":"span",className:m("font-semibold ml-2 shrink-0",i.checks[t.key]==="yes"?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"),children:i.checks[t.key]==="yes"?"Yes":"No"})]},t.key))})]},i._id)})})]})}function qs({open:s,onClose:a}){const[n,i]=j.useState({type:"list"}),l=r=>{r||(i({type:"list"}),a())};return e.jsx(ye,{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:335:4","data-hercules-name":"Dialog",open:s,onOpenChange:l,children:e.jsxs(be,{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:336:6","data-hercules-name":"DialogContent",className:"max-w-lg max-h-[85vh] flex flex-col gap-0 p-0",children:[e.jsx(_e,{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:337:8","data-hercules-name":"DialogHeader",className:"px-5 pt-5 pb-3 border-b shrink-0",children:e.jsxs(ke,{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:338:10","data-hercules-name":"DialogTitle",className:"flex items-center gap-2 text-base",children:[e.jsx($,{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:339:12","data-hercules-name":"CheckCircle2",className:"w-4 h-4 text-lime-600"}),"LOLER Checks â Ambulance Fleet"]})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:344:8","data-hercules-name":"div",className:"flex-1 overflow-y-auto px-5 pb-5",children:[n.type==="list"&&e.jsx(ws,{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:346:12","data-hercules-name":"LolerList",onSelect:r=>i({type:"fill",amb:r}),onHistory:r=>i({type:"history",amb:r})}),n.type==="fill"&&e.jsx(Cs,{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:352:12","data-hercules-name":"LolerFillForm",amb:n.amb,onBack:()=>i({type:"list"})}),n.type==="history"&&e.jsx(Ds,{"data-hercules-id":"src/pages/forms/limes/_components/loler-check-dialog.tsx:355:12","data-hercules-name":"LolerHistory",amb:n.amb,onBack:()=>i({type:"list"})})]})]})})}const Ss=[{name:"Ambulance 1",reg:"YX59EKC",type:"Ambulance"},{name:"Ambulance 2",reg:"YJ58XFM",type:"Ambulance"},{name:"Ambulance 3",reg:"YX59EXB",type:"Ambulance"},{name:"Ambulance 4",reg:"YX59EJE",type:"Ambulance"},{name:"Ambulance 5",reg:"YX59EJG",type:"Ambulance"},{name:"Ambulance 6",reg:"YX59EJL",type:"Ambulance"},{name:"Ambulance 7",reg:"YX59EKM",type:"Ambulance"},{name:"Shogun",reg:"SY10NPE",type:"4x4"},{name:"Patrol",reg:"AJ59CFX",type:"4x4"},{name:"Van",reg:"DY16YUL",type:"Van"},{name:"Dacia",reg:"HN67XCF",type:"Car"}];function Ms({entry:s,onDelete:a}){const{attributes:n,listeners:i,setNodeRef:l,transform:r,transition:t,isDragging:p}=Ie({id:s._id}),k={transform:Pe.Transform.toString(r),transition:t};return e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:86:4","data-hercules-name":"div",ref:l,style:k,className:m("flex items-start justify-between gap-3 rounded-lg border p-3 bg-muted/30",p&&"opacity-50 shadow-lg ring-2 ring-primary/30"),children:[e.jsx("button",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:94:6","data-hercules-name":"button",...n,...i,className:"mt-1 shrink-0 cursor-grab active:cursor-grabbing touch-none text-muted-foreground hover:text-foreground","aria-label":"Drag to reorder. Use Space then arrow keys to move.",children:e.jsx(P,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:100:8","data-hercules-name":"GripVertical",className:"w-4 h-4"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:102:6","data-hercules-name":"div",className:"flex-1 min-w-0 space-y-0.5",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:103:8","data-hercules-name":"p",className:"text-sm font-medium",children:s.repairCompleted}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:104:8","data-hercules-name":"div",className:"flex flex-wrap gap-x-4 gap-y-0.5 text-xs text-muted-foreground",children:[e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:105:10","data-hercules-name":"span",children:R(new Date(s.repairDate),"dd MMM yyyy")}),e.jsxs("span",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:106:10","data-hercules-name":"span",children:["Mileage: ",s.mileage.toLocaleStr
1ing()]}),e.jsxs("span",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:107:10","data-hercules-name":"span",children:["By: ",s.submittedByName]})]})]}),e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:110:6","data-hercules-name":"Button",variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-destructive hover:text-destructive shrink-0",onClick:()=>a(s._id),children:e.jsx(Je,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:116:8","data-hercules-name":"Trash2",className:"w-3.5 h-3.5"})})]})}function As({vehicle:s}){const{results:a,status:n,loadMore:i}=$e(C.vehicleRepairLogs.listByVehicle,{vehicleReg:s.reg},{initialNumItems:10}),l=X(C.vehicleRepairLogs.deleteRepair),r=X(C.vehicleRepairLogs.reorderRepairs),[t,p]=j.useState(!0),k=Ee(Oe(Re,{activationConstraint:{distance:5}}));if(n==="LoadingFirstPage")return e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:138:6","data-hercules-name":"div",className:"space-y-2 py-2",children:Array.from({length:2}).map((o,y)=>e.jsx(ie,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:140:10","data-hercules-name":"Skeleton",className:"h-14 w-full rounded-lg"},y))});if(a.length===0)return e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:148:6","data-hercules-name":"div",className:"py-4 text-center",children:e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:149:8","data-hercules-name":"p",className:"text-sm text-muted-foreground",children:"No repairs logged yet"})});const v=async o=>{try{await l({id:o}),S.success("Repair entry deleted")}catch{S.error("Failed to delete â admin access required")}},h=[...a].sort((o,y)=>{const d=o.sortOrder??1/0,g=y.sortOrder??1/0;return d===1/0&&g===1/0?0:d-g}),b=async o=>{const{active:y,over:d}=o;if(!d||y.id===d.id)return;const g=h.findIndex(D=>D._id===y.id),q=h.findIndex(D=>D._id===d.id);if(g===-1||q===-1)return;const M=Ve(h,g,q).map(D=>D._id);try{await r({orderedIds:M})}catch{S.error("Failed to reorder entries")}};return e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:190:4","data-hercules-name":"div",className:"space-y-2",children:[e.jsx("button",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:191:6","data-hercules-name":"button",onClick:()=>p(!t),className:"text-xs text-primary flex items-center gap-1 cursor-pointer",children:t?e.jsxs(e.Fragment,{children:[e.jsx(ve,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:196:14","data-hercules-name":"ChevronUp",className:"w-3 h-3"}),"Hide history (",a.length,")"]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:197:14","data-hercules-name":"ChevronDown",className:"w-3 h-3"}),"Show history (",a.length,")"]})}),t&&e.jsx(Te,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:200:8","data-hercules-name":"DndContext",sensors:k,collisionDetection:Be,onDragEnd:b,children:e.jsx(Fe,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:205:10","data-hercules-name":"SortableContext",items:h.map(o=>o._id),strategy:ss,children:e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:209:12","data-hercules-name":"div",className:"space-y-2",children:[h.map(o=>e.jsx(Ms,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:211:16","data-hercules-name":"SortableRepairItem",entry:o,onDelete:v},o._id)),n==="CanLoadMore"&&e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:218:16","data-hercules-name":"Button",variant:"secondary",size:"sm",onClick:()=>i(10),children:"Load More"})]})})})]})}function Ls({vehicle:s,onAdded:a}){const n=X(C.vehicleRepairLogs.addRepair),[i,l]=j.useState(R(new Date,"yyyy-MM-dd")),[r,t]=j.useState(""),[p,k]=j.useState(""),[v,h]=j.useState(!1),b=async()=>
1{if(!r.trim()||!p.trim()||!i){S.error("Please fill in all fields");return}const o=parseInt(p,10);if(isNaN(o)||o<0){S.error("Please enter a valid mileage");return}h(!0);try{await n({vehicleReg:s.reg,vehicleName:s.name,repairDate:i,repairCompleted:r.trim(),mileage:o}),S.success("Repair logged successfully"),t(""),k(""),l(R(new Date,"yyyy-MM-dd")),a()}catch{S.error("Failed to log repair")}finally{h(!1)}};return e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:275:4","data-hercules-name":"div",className:"space-y-3 border-t pt-3",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:276:6","data-hercules-name":"p",className:"text-sm font-medium",children:"Add New Repair"}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:277:6","data-hercules-name":"div",className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:278:8","data-hercules-name":"div",className:"space-y-1.5",children:[e.jsx("label",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:279:10","data-hercules-name":"label",className:"text-xs font-medium text-muted-foreground",children:"Date of Repair"}),e.jsx(Z,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:280:10","data-hercules-name":"Input",type:"date",value:i,onChange:o=>l(o.target.value)})]}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:286:8","data-hercules-name":"div",className:"space-y-1.5",children:[e.jsx("label",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:287:10","data-hercules-name":"label",className:"text-xs font-medium text-muted-foreground",children:"Mileage"}),e.jsx(Z,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:288:10","data-hercules-name":"Input",type:"number",placeholder:"e.g. 45000",value:p,onChange:o=>k(o.target.value)})]})]}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:296:6","data-hercules-name":"div",className:"space-y-1.5",children:[e.jsx("label",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:297:8","data-hercules-name":"label",className:"text-xs font-medium text-muted-foreground",children:"Repair Completed"}),e.jsx(ms,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:298:8","data-hercules-name":"Textarea",placeholder:"Describe the repair that was completed...",value:r,onChange:o=>t(o.target.value),rows:2})]}),e.jsxs(_,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:305:6","data-hercules-name":"Button",size:"sm",onClick:b,disabled:v,children:[e.jsx(ge,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:306:8","data-hercules-name":"Plus",className:"w-3.5 h-3.5 mr-1"}),v?"Saving...":"Add Repair"]})]})}function Es({vehicle:s}){const a=O(C.vehicleRepairLogs.listAllByVehicle,{vehicleReg:s.reg}),n=j.useCallback(()=>{if(!a||a.length===0){S.error("No repairs to print");return}const i=window.open("","_blank");if(!i){S.error("Pop-up blocked â please allow pop-ups to print");return}const l=a.map((t,p)=>`<tr> 2 <td style="padding:6px 10px;border:1px solid #ddd;text-align:center;">${p+1}</td> 3 <td style="padding:6px 10px;border:1px solid #ddd;">${R(new Date(t.repairDate),"dd MMM yyyy")}</td> 4 <td style="padding:6px 10px;border:1px solid #ddd;">${t.repairCompleted}</td> 5 <td style="padding:6px 10px;border:1px solid #ddd;text-align:right;">${t.mileage.toLocaleString()}</td> 6 <td style="padding:6px 10px;border:1px solid #ddd;">${t.submittedByName}</td> 7 </tr>`).join(""),r=`<!DOCTYPE html> 8<html> 9<head> 10 <title>Repair Log â ${s.name} (${s.reg})</title> 11 <style> 12 body { font-family: Arial, sans-serif; margin: 20px; color: #222; } 13 h1 { font-size: 18px; margin-bottom: 4px; } 14 .meta { font-size: 13px; color: #555; margin-bottom: 16px; } 15 table { width: 100%; border-collapse: collapse; font-size: 13px; } 16 th { padding: 8px 10px; border: 1px solid #ddd; background: #f5f5f5; text-align: left; font-weight: 600; } 17 tr:nth-child(even) td { background: #fafafa; } 18 .footer { margin-top: 20px; font-size: 11px; color: #888; } 19 @media print { 20 body { margin: 0; } 21 .no-print { display: none; } 22 } 23 </style> 24</head> 25<body> 26 <h1>Repair Log: ${s.name}</h1> 27 <div class="meta">Registration: ${s.reg} | Type: ${s.type} | Total Repairs: ${a.length} | Printed: ${R(new Date,"dd MMM yyyy HH:mm")}</div> 28 <table> 29 <thead> 30 <tr> 31 <th style="width:40px;text-align:center;">#</th> 32 <th style="width:110px;">Date</th> 33 <th>Repair Completed</th> 34 <th style="width:90px;text-align:right;">Mileage</th> 35 <th style="width:130px;">Submitted By</th> 36 </tr> 37 </thead> 38 <tbody>${l}</tbody> 39 </table> 40 <div class="footer">Generated from Vehicle Repair Log system</div> 41 <script>window.onload = function() { window.print(); }<\/script> 42</body> 43</html>`;i.document.write(r),i.document.close()},[a,s]);return e.jsxs(_,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:384:4","data-hercules-name":"Button",variant:"ghost",size:"sm",onClick:n,disabled:!a||a.length===0,title:"Print full repair history",children:[e.jsx(us,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:391:6","data-hercules-name":"Printer",className:"w-3.5 h-3.5 mr-1"}),"Print"]})}function Os({vehicle:s}){const[a,n]=j.useState(!1);return e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:401:4","data-hercules-name":"div",className:"rounded-xl border bg-card p-4 space-y-3",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:402:6","data-hercules-name":"div",className:"flex items-center justify-between",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:403:8","data-hercules-name":"div",className:"flex items-center gap-3",children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:404:10","data-hercules-name":"div",className:"w-9 h-9 rounded-lg bg-orange-50 dark:bg-orange-900/20 flex items-center justify-center shrink-0",children:e.jsx(te,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:405:12","data-hercules-name":"Wrench",className:"w-4 h-4 text-orange-600 dar
43k:text-orange-400"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:407:10","data-hercules-name":"div",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:408:12","data-hercules-name":"p",className:"font-semibold text-sm",children:s.name}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:409:12","data-hercules-name":"div",className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:410:14","data-hercules-name":"span",className:"font-mono",children:s.reg}),e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:411:14","data-hercules-name":"span",className:"px-1.5 py-0.5 rounded bg-muted text-[10px] font-medium uppercase",children:s.type})]})]})]}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:417:8","data-hercules-name":"div",className:"flex items-center gap-2",children:[e.jsx(Es,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:418:10","data-hercules-name":"PrintRepairList",vehicle:s}),e.jsxs(_,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:419:10","data-hercules-name":"Button",variant:"secondary",size:"sm",onClick:()=>n(!a),className:m(a&&"bg-primary text-primary-foreground hover:bg-primary/90"),children:[e.jsx(ge,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:425:12","data-hercules-name":"Plus",className:"w-3.5 h-3.5 mr-1"}),"Log Repair"]})]})]}),a&&e.jsx(Ls,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:432:8","data-hercules-name":"AddRepairForm",vehicle:s,onAdded:()=>n(!1)}),e.jsx(As,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:435:6","data-hercules-name":"VehicleRepairList",vehicle:s})]})}function Rs({open:s,onClose:a}){return e.jsx(ye,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:448:4","data-hercules-name":"Dialog",open:s,onOpenChange:n=>{n||a()},children:e.jsxs(be,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:449:6","data-hercules-name":"DialogContent",className:"max-w-4xl max-h-[85vh] overflow-y-auto",children:[e.jsxs(_e,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:450:8","data-hercules-name":"DialogHeader",children:[e.jsxs(ke,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:451:10","data-hercules-name":"DialogTitle",className:"flex items-center gap-2",children:[e.jsx(te,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:452:12","data-hercules-name":"Wrench",className:"w-5 h-5 text-orange-600"}),"Vehicle Repair Log"]}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:455:10","data-hercules-name":"p",className:"text-sm text-muted-foreground",children:"Repair history for each fleet vehicle â type, registration, repairs completed and mileage."})]}),e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:460:8","data-hercules-name":"div",className:"space-y-4 mt-4",children:Ss.map(n=>e.jsx(Os,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-repair-log-dialog.tsx:462:12","data-hercules-name":"VehicleRepairCard",vehicle:n},n.reg))})]})})}const Ts=new Set(["limes_weekly_maintenance","limes_annual_maintenance","limes_monthly_maintenance"]);function Bs(s){return Ts.has(s)?te:s.startsWith("limes_annual_service_")?te:s==="limes_lifepak_aed_check"?ps:Ne}const W=[{name:"Ambulance 1",reg:"YX59EKC",img:"https://hercules-cdn.com/file_kaJ3e644uagvd5lFS2Dh1cVe"},{name:"Ambulance 2",reg:"YJ58XFM",img:"https://hercules-cdn.com/file_kaJ3e644uagvd5lFS2Dh1cVe"},{name:"Ambulance 3",reg:"YX59EXB",img:"https://hercules-cdn.com/file_kaJ3e644uagvd5lFS2Dh1cVe"},{name:"Ambulance 4",reg:"YX59EJE",img:"https://hercules-cdn.com/file_kaJ3e644uagvd5lFS2Dh1cVe"},{name:"Ambulance 5",reg:"YX59EJG",img:"https://hercules-cdn.com/file_kaJ3e644uagvd5lFS2Dh1cVe"},{name:"Ambulance 6",reg:"YX59EJL",img:"https://hercules-cdn.com/file_kaJ3e644uagvd5lFS2Dh1cVe"},{name:"Ambulance 7",reg:"YX59EKM",img:"https://hercules-cdn.com/file_kaJ3e644uagvd5lFS2Dh1cVe"},{name:"Shogun",reg:"SY10NPE",img:"https://hercules-cdn.com/file_LAaCCl288q8VdEbCSUj8RqK4"},{name:"Patrol",reg:"AJ59CFX",img:"https://hercules-cdn.com/file_CVY5AOgV6Y5gx0LPC3bhYSwj"},{name:"Van",reg:"DY16YUL",img:"https://hercules-cdn.com/file_tro5pQsch3bQp8CA2Cez8K0a"},{name:"Dacia",reg:"HN67XCF",img:"https://hercules-cdn.com/file_DqjD7cY3hWMJC4LywjAHnRaV"}],pe=W.slice(0,7);function Ke(s){return{formType:`limes_deep_clean_${s.reg}`,title:`Deep Clean â ${s.name} (${s.reg})`,description:`Deep clean and ozone treatment log for ${s.name} (${s.reg})`,sections:[{title:"Details",questions:[{key:"date_of_clean",label:"Date of clean",type:"date",required:!0},{key:"completed_by",label:"Completed by (full name)",type:"text",required:!0}]},{title:"Deep Clean & Ozone",questions:[{key:"deep_clean_completed",label:"Deep clean completed",type:"yesno",required:!0}
43,{key:"ozone_treatment_completed",label:"Ozone treatment completed",type:"yesno",required:!0},{key:"contamination_clean",label:"Deep clean was due to contamination at an event",type:"yesno",required:!0}]},{title:"Notes",questions:[{key:"notes",label:"Notes / issues",type:"text"}]},{title:"Sign Off",questions:[{key:"signature",label:"Signature (type full name to confirm)",type:"text",required:!0}]}]}}function Ge(s){return{formType:`limes_annual_service_${s.reg}`,title:`Annual Service â ${s.name} (${s.reg})`,description:`Annual vehicle service check (Gold â 24,000 miles / 24 months) for ${s.name} (${s.reg}). 44 45For each item: confirm done, record mileage and date completed.`,sections:[{title:"Details",questions:[{key:"completed_by",label:"Completed by (full name)",type:"text",required:!0}]},{title:"Lights and Electrical System",questions:[{key:"item_1_done",label:"1. Check operation of exterior lights",type:"yesno",required:!0},{key:"item_1_mileage",label:"Mileage at time of check",type:"number"},{key:"item_1_date",label:"Date done",type:"date"},{key:"item_2_done",label:"2. Check headlight alignment",type:"yesno",required:!0},{key:"item_2_mileage",label:"Mileage at time of check",type:"number"},{key:"item_2_date",label:"Date done",type:"date"},{key:"item_3_done",label:"3. Check rear reflectors",type:"yesno",required:!0},{key:"item_3_mileage",label:"Mileage at time of check",type:"number"},{key:"item_3_date",label:"Date done",type:"date"},{key:"item_4_done",label:"4. Check operation of instrument warning lamps",type:"yesno",required:!0},{key:"item_4_mileage",label:"Mileage at time of check",type:"number"},{key:"item_4_date",label:"Date done",type:"date"},{key:"item_5_done",label:"5. Check illumination of dash and heater control lamps",type:"yesno",required:!0},{key:"item_5_mileage",label:"Mileage at time of check",type:"number"},{key:"item_5_date",label:"Date done",type:"date"},{key:"item_6_done",label:"6. Check battery condition and connections",type:"yesno",required:!0},{key:"item_6_mileage",label:"Mileage at time of check",type:"number"},{key:"item_6_date",label:"Date done",type:"date"},{key:"item_7_done",label:"7. Clean & grease battery terminals",type:"yesno",required:!0},{key:"item_7_mileage",label:"Mileage at time of check",type:"number"},{key:"item_7_date",label:"Date done",type:"date"},{key:"item_8_done",label:"8. Check horn",type:"yesno",required:!0},{key:"item_8_mileage",label:"Mileage at time of check",type:"number"},{key:"item_8_date",label:"Date done",type:"date"},{key:"item_9_done",label:"9. Test / advise alternator output and security",type:"yesno",required:!0},{key:"item_9_mileage",label:"Mileage at time of check",type:"number"},{key:"item_9_date",label:"Date done",type:"date"}]},{title:"Internal / Vision",questions:[{key:"item_10_done",label:"10. Check door / bonnet lock operation and lubricate locks, hinges and catches",type:"yesno",required:!0},{key:"item_10_mileage",label:"Mileage at time of check",type:"number"},{key:"item_10_date",label:"Date done",type:"date"},{key:"item_11_done",label:"11. Check windscreen wiper and washer condition and operation",type:"yesno",required:!0},{key:"item_11_mileage",label:"Mileage at time of check",type:"number"},{key:"item_11_date",label:"Date done",type:"date"},{key:"item_12_done",label:"12. Empty and clean washer bottle - refill",type:"yesno",required:!0},{key:"item_12_mileage",label:"Mileage at time of check",type:"number"},{key:"item_12_date",label:"Date done",type:"date"},{key:"item_13_done",label:"13. Check / advise pollen filter condition, replace if necessary",type:"yesno",required:!0},{key:"item_13_mileage",label:"Mileage at time of check",type:"number"},{key:"item_13_date",label:"Date done",type:"date"},{key:"item_14_done",label:"14. Check air conditioning system / temperature if applicable",type:"yesno",required:!0},{key:"item_14_mileage",label:"Mileage at time of check",type:"number"},{key:"item_14_date",label:"Date done",type:"date"}]},{title:"Engine",questions:[{key:"item_15_done",label:"15. Drain engine oil and refill",type:"yesno",required:!0},{key:"item_15_mileage",label:"Mileage at time of check",type:"number"},{key:"item_15_date",label:"Date done",type:"date"},{key:"item_16_done",label:"16. Replace oil filter",type:"yesno",required:!0},{key:"item_16_mileage",label:"Mileage at time of check",type:"number"},{key:"item_16_date",label:"Date done",type:"date"},{key:"item_17_done",label:"17. Replace sump plug and washer",type:"yesno",required:!0},{key:"item_17_mileage",label:"Mileage at time of check",type:"number"},{key:"item_17_date",label:"Date done",type:"date"},{key:"item_18_done",label:"18. Replace air filter cleaned or changed - interval 54,000",type:"yesno",required:!0},{key:"item_18_mileage",label:"Mileage at time of check",type:"number"},{key:"item_18_date",label:"Date done",type:"date"},{key:"item_19_done",label:"19. Replace fuel filter (if fitted and external from fuel tank) - interval 54,000",type:"yesno",required:!0},{key:"item_19_mileage",label:"Mileage at time of check",type:"number"},{key:"item_19_date",label:"Date done",type:"date"},{key:"item_20_done",label:"20. Check / advise general oil leaks",type:"yesno",required:!0},{key:"item_20_mileage",label:"Mileage at time of check",type:"number"},{key:"item_20_date",label:"Date done",type:"date"},{key:"item_21_done",label:"21. Check / advise coolant level and antifreeze strength",type:"yesno",required:!0},{key:"item_21_mileage",label:"Mileage at time of check",type:"number"},{key:"item_21_date",label:"Date done",type:"date"},{key:"item_22_done",label:"22. Top up antifreeze if required - interval 72,000",type:"yesno",required:!0},{key:"item_22_mileage",label:"Mileage at time of check",type:"number"},{key:"item_22_date",label:"Date done",type:"date"},{key:"item_23_done",label:"23. Check all coolant hoses for leaks and condition, incl. header tank",type:"yesno",required:!0},{key:"item_23_mileage",label:"Mileage at time of check",type:"number"},{key:"item_23_date",label:"Date done",type:"date"},{key:"item_24_done",label:"24. Check condition and tension of auxiliary drive belts (excl. timing belt)",type:"yesno",required:!0},{key:"item_24_mileage",label:"Mileage at time of check",type:"number"},{key:"item_24_date",label:"Date done",type:"date"},{key:"item_25_done",label:"25. Spark plugs changed according to mileage",type:"yesno",required:!0},{key:"item_25_mileage",label:"Mileage at time of check",type:"number"},{key:"item_25_date",label:"Date done",type:"date"},{key:"item_26_done",label:"26. Change glow plugs - interval 25,000",type:"yesno",required:!0},{key:"item_26_mileage",label:"Mileage at time of check",type:"number"},{key:"item_26_date",label:"Date done",type:"date"},{key:"item_27_done",label:"27. Check / clean HT leads and components (if fitted)",type:"yesno",required:!0},{key:"item_27_mileage",label:"Mileage at time of check",type:"number"},{key:"item_27_date",label:"Date done",type:"date"},{key:"item_28_done",label:"28. Visual check of fuel system (incl. tank and cap)",type:"yesno",required:!0},{key:"item_28_mileage",label:"Mileage at time of check",type:"number"},{key:"item_28_date",label:"Date done",type:"date"},{key:"item_29_done",label:"29. Check timing belt replacement interval & report if due according to mileage / age",type:"yesno",required:!0},{key:"item_29_mileage",label:"Mileage at time of check",type:"number"},{key:"item_29_date",label:"Date done",type:"date"}]},{title:"Brakes",questions:[{key:"item_30_done",label:"30. Check brake servo operation",type:"yesno",required:!0},{key:"item_30_mileage",label:"Mileage at time of check",type:"number"},{key:"item_30_date",label:"Date done",type:"date"},{key:"item_31_done",label:"31. Check / advise brake fluid level and boiling point",type:"yesno",required:!0},{key:"item_31_mileage",label:"Mileage at time of check",type:"number"},{key:"item_31_date",label:"Date done",type:"date"},{key:"item_32_done",label:"32. Change brake fluid - interval 72,000",type:"yesno",required:!0},{key:"item_32_mileage",label:"Mileage at time of check",type:"number"},{key:"item_32_date",label:"Date done",type:"date"},{key:"item_33_done",label:"33. Top up brake fluid if required",type:"yesno",required:!0},{key:"item_33_mileage",label:"Mileage at time of check",type:"number"},{key:"item_33_date",label:"Date done",type:"date"}
45,{key:"item_34_done",label:"34. Strip brake callipers and clean",type:"yesno",required:!0},{key:"item_34_mileage",label:"Mileage at time of check",type:"number"},{key:"item_34_date",label:"Date done",type:"date"},{key:"item_35_done",label:"35. Check brake callipers for smooth operation",type:"yesno",required:!0},{key:"item_35_mileage",label:"Mileage at time of check",type:"number"},{key:"item_35_date",label:"Date done",type:"date"},{key:"item_36_done",label:"36. Visual check of brake pads for wear or damage",type:"yesno",required:!0},{key:"item_36_mileage",label:"Mileage at time of check",type:"number"},{key:"item_36_date",label:"Date done",type:"date"},{key:"item_37_done",label:"37. Visual check of brake discs, shoes and cylinders for wear or damage",type:"yesno",required:!0},{key:"item_37_mileage",label:"Mileage at time of check",type:"number"},{key:"item_37_date",label:"Date done",type:"date"},{key:"item_38_done",label:"38. Visual check of brake pipes and hoses",type:"yesno",required:!0},{key:"item_38_mileage",label:"Mileage at time of check",type:"number"},{key:"item_38_date",label:"Date done",type:"date"},{key:"item_39_done",label:"39. Check operation of handbrake and adjust",type:"yesno",required:!0},{key:"item_39_mileage",label:"Mileage at time of check",type:"number"},{key:"item_39_date",label:"Date done",type:"date"},{key:"item_40_done",label:"40. Check security of handbrake linkages and travel",type:"yesno",required:!0},{key:"item_40_mileage",label:"Mileage at time of check",type:"number"},{key:"item_40_date",label:"Date done",type:"date"}]},{title:"Steering / Suspension",questions:[{key:"item_41_done",label:"41. Check condition of road springs",type:"yesno",required:!0},{key:"item_41_mileage",label:"Mileage at time of check",type:"number"},{key:"item_41_date",label:"Date done",type:"date"},{key:"item_42_done",label:"42. Check power steering fluid reservoir",type:"yesno",required:!0},{key:"item_42_mileage",label:"Mileage at time of check",type:"number"},{key:"item_42_date",label:"Date done",type:"date"},{key:"item_43_done",label:"43. Check steering / suspension components for wear and corrosion",type:"yesno",required:!0},{key:"item_43_mileage",label:"Mileage at time of check",type:"number"},{key:"item_43_date",label:"Date done",type:"date"},{key:"item_44_done",label:"44. Check steering rack gaitors condition",type:"yesno",required:!0},{key:"item_44_mileage",label:"Mileage at time of check",type:"number"},{key:"item_44_date",label:"Date done",type:"date"},{key:"item_45_done",label:"45. Check shock absorber condition and mounting, report any leaks",type:"yesno",required:!0},{key:"item_45_mileage",label:"Mileage at time of check",type:"number"},{key:"item_45_date",label:"Date done",type:"date"},{key:"item_46_done",label:"46. Check wheel bearings for excessive play or noise",type:"yesno",required:!0},{key:"item_46_mileage",label:"Mileage at time of check",type:"number"},{key:"item_46_date",label:"Date done",type:"date"}]},{title:"Drive System",questions:[{key:"item_47_done",label:"47. Check drive shaft gaitors for security and report any leaks",type:"yesno",required:!0},{key:"item_47_mileage",label:"Mileage at time of check",type:"number"},{key:"item_47_date",label:"Date done",type:"date"},{key:"item_48_done",label:"48. Check gear box fluid level manual / automatic differential (if applicable)",type:"yesno",required:!0},{key:"item_48_mileage",label:"Mileage at time of check",type:"number"},{key:"item_48_date",label:"Date done",type:"date"},{key:"item_49_done",label:"49. Top up gear box fluid if required",type:"yesno",required:!0},{key:"item_49_mileage",label:"Mileage at time of check",type:"number"},{key:"item_49_date",label:"Date done",type:"date"},{key:"item_50_done",label:"50. Check / adjust clutch operation",type:"yesno",required:!0},{key:"item_50_mileage",label:"Mileage at time of check",type:"number"},{key:"item_50_date",label:"Date done",type:"date"},{key:"item_51_done",label:"51. Check for transmission oil leaks",type:"yesno",required:!0},{key:"item_51_mileage",label:"Mileage at time of check",type:"number"},{key:"item_51_date",label:"Date done",type:"date"},{key:"item_52_done",label:"52. Check condition of clutch cable (where visible)",type:"yesno",required:!0},{key:"item_52_mileage",label:"Mileage at time of check",type:"number"},{key:"item_52_date",label:"Date done",type:"date"}]},{title:"Exhaust",questions:[{key:"item_53_done",label:"53. Check exhaust mountings",type:"yesno",required:!0},{key:"item_53_mileage",label:"Mileage at time of check",type:"number"},{key:"item_53_date",label:"Date done",type:"date"},{key:"item_54_done",label:"54. Check exhaust body",type:"yesno",required:!0},{key:"item_54_mileage",label:"Mileage at time of check",type:"number"},{key:"item_54_date",label:"Date done",type:"date"}]},{title:"Tyres / Wheels",questions:[{key:"item_55_done",label:"55. Check tyre condition and tread depth (incl. spare)",type:"yesno",required:!0},{key:"item_55_mileage",label:"Mileage at time of check",type:"number"},{key:"item_55_date",label:"Date done",type:"date"},{key:"item_56_done",label:"56. Check / adjust tyre pressures (incl. spare)",type:"yesno",required:!0},{key:"item_56_mileage",label:"Mileage at time of check",type:"number"},{key:"item_56_date",label:"Date done",type:"date"},{key:"item_57_done",label:"57. Remove all road wheels and check flanges and mountings",type:"yesno",required:!0},{key:"item_57_mileage",label:"Mileage at time of check",type:"number"},{key:"item_57_date",label:"Date done",type:"date"},{key:"item_58_done",label:"58. Check wheel nut torque to manufacturer's specification",type:"yesno",required:!0},{key:"item_58_mileage",label:"Mileage at time of check",type:"number"},{key:"item_58_date",label:"Date done",type:"date"}]},{title:"Final Checks",questions:[{key:"item_59_done",label:"59. Conduct OBD scan for error codes",type:"yesno",required:!0},{key:"item_59_mileage",label:"Mileage at time of check",type:"number"},{key:"item_59_date",label:"Date done",type:"date"},{key:"item_60_done",label:"60. Reset vehicle service light where applicable",type:"yesno",required:!0},{key:"item_60_mileage",label:"Mileage at time of check",type:"number"},{key:"item_60_date",label:"Date done",type:"date"}]},{title:"Notes",questions:[{key:"notes",label:"Additional notes / issues found",type:"text"}]},{title:"Sign Off",questions:[{key:"technician_signature",label:"Technician signature (type full name)",type:"text",required:!0},{key:"control_checked_by",label:"Control checked by (type full name)",type:"text"}]}]}}function Ue(s){return{formType:`limes_vehicle_${s.reg}`,title:`${s.name} â ${s.reg}`,description:`Weekly service check for ${s.name} (${s.reg})`,sections:[{title:"Details",questions:[{key:"week_commencing",label:"Week commencing (date)",type:"date",required:!0},{key:"completed_by",label:"Completed by (full name)",type:"text",required:!0}]},{title:"Vehicle Checks",questions:[{key:"mileage",label:"Mileage",type:"number",required:!0},{key:"tyre_tread",label:"Tyres â tread",type:"yesno",required:!0},{key:"tyre_pressure",label:"Tyres â pressure",type:"yesno",required:!0},{key:"suspension_pressure",label:"Suspension â pressure",type:"yesno",required:!0},{key:"wheel_nuts",label:"Wheel nuts",type:"yesno",required:!0}
45,{key:"oil",label:"Oil",type:"yesno",required:!0},{key:"screen_wash",label:"Screen wash",type:"yesno",required:!0},{key:"coolant",label:"Coolant",type:"yesno",required:!0},{key:"horn",label:"Horn",type:"yesno",required:!0},{key:"lights",label:"Lights",type:"yesno",required:!0},{key:"wipers",label:"Wipers",type:"yesno",required:!0},{key:"windscreen",label:"Windscreen",type:"yesno",required:!0},{key:"extinguisher",label:"Extinguisher",type:"yesno",required:!0},{key:"weekly_clean",label:"Routine weekly clean",type:"yesno",required:!0}]},{title:"Sign Off",questions:[{key:"signature",label:"Signature (type full name to confirm all checks completed)",type:"text",required:!0}]}]}}const he=[{formType:"limes_weekly_maintenance",title:"Weekly Maintenance Jobs",description:"Planned maintenance calendar â vehicles, grounds, facilities and equipment checks.",sections:[{title:"Details",questions:[{key:"completion_date",label:"Date of completion",type:"date",required:!0}]},{title:"Vehicles",questions:[{key:"clean_vehicles",label:"Clean all vehicles that have been used",type:"yesno",required:!0},{key:"vehicle_service_checks",label:"Complete all vehicle service checks â fill in folder",type:"yesno",required:!0},{key:"fuel_vehicles",label:"Fuel all vehicles",type:"yesno",required:!0},{key:"restock_vehicles",label:"Re-stock and check dates for all vehicles",type:"yesno",required:!0},{key:"restock_green_bags",label:"Re-stock and check dates - green bags â record in med bag log",type:"yesno",required:!0}]},{title:"Grounds",questions:[{key:"clean_grounds",label:"Clean all grounds of rubbish, mud and leaves",type:"yesno",required:!0}]},{title:"Facilities",questions:[{key:"check_fire_alarms",label:"Check fire alarms â Limes (record in folder)",type:"yesno",required:!0},{key:"deep_clean_toilets",label:"Deep clean toilets",type:"yesno",required:!0},{key:"mop_toilet_floors",label:"Mop toilet floors",type:"yesno",required:!0},{key:"mop_kitchen_floors",label:"Mop kitchen floors",type:"yesno",required:!0},{key:"hoover_carpets",label:"Hoover all carpets",type:"yesno",required:!0},{key:"clean_sink",label:"Clean sink & drainer",type:"yesno",required:!0},{key:"wash_fridge",label:"Wash inside fridge",type:"yesno",required:!0},{key:"empty_dehumidifier",label:"Empty de-humidifier",type:"yesno",required:!0}]},{title:"Sign Off",questions:[{key:"signature",label:"Sign after completion of all tasks (type full name)",type:"text",required:!0}]}]},{formType:"limes_annual_maintenance",title:"Annual Maintenance Jobs",description:"Yearly scheduled maintenance â grounds treatment, pest control, water systems and equipment checks.",sections:[{title:"Grounds â March",questions:[{key:"treat_grass_iron_sulphate",label:"Treat grass with Iron Sulphate (March)",type:"yesno",required:!0},{key:"treat_grass_iron_sulphate_date",label:"Date done",type:"date",required:!0},{key:"spray_insect_killer",label:"Spray inside with insect killer (March)",type:"yesno",required:!0},{key:"spray_insect_killer_date",label:"Date done",type:"date",required:!0}]},{title:"Grounds â 2 Weeks After Iron Sulphate",questions:[{key:"rake_dead_moss",label:"Rake grass to remove dead moss (2 weeks after Iron Sulphate treatment)",type:"yesno",required:!0},{key:"rake_dead_moss_date",label:"Date done",type:"date",required:!0}]},{title:"Grounds â April",questions:[{key:"treat_grass_weed_feed",label:"Treat grass with weed and feed (April)",type:"yesno",required:!0},{key:"treat_grass_weed_feed_date",label:"Date done",type:"date",required:!0}]},{title:"Facilities â April",questions:[{key:"change_water_filter",label:"Change water filter (April)",type:"yesno",required:!0},{key:"change_water_filter_date",label:"Date done",type:"date",required:!0}]},{title:"Equipment â October",questions:[{key:"check_adjust_aeds",label:"Check and adjust all AEDs (October)",type:"yesno",required:!0},{key:"check_adjust_aeds_date",label:"Date done",type:"date",required:!0},{key:"suction_unit_battery_check",label:"Suction unit battery check (October)",type:"yesno",required:!0},{key:"suction_unit_battery_check_date",label:"Date done",type:"date",required:!0}]},{title:"Sign Off",questions:[{key:"signature",label:"Sign after completion of all tasks (type full name)",type:"text",required:!0}]}]},{formType:"limes_monthly_maintenance",title:"Monthly Maintenance Jobs",description:"Monthly site maintenance â drains, windows, stock check, grounds and hedges.",sections:[{title:"Details",questions:[{key:"completion_date",label:"Date of completion",type:"date",required:!0}]},{title:"Drains",questions:[{key:"clean_roof_drains",label:"Clean drains on roof",type:"yesno",required:!0},{key:"clean_carpark_drain_1",label:"Clean drains in car park (1 of 3)",type:"yesno",required:!0},{key:"clean_carpark_drain_2",label:"Clean drains in car park (2 of 3)",type:"yesno",required:!0},{key:"clean_carpark_drain_3",label:"Clean drains in car park (3 of 3)",type:"yesno",required:!0}]},{title:"Stock & Facilities",questions:[{key:"medical_stock_check",label:"Medical stock room check",type:"yesno",required:!0}]},{title:"Windows",questions:[{key:"wash_outside_windows",label:"Wash outside windows",type:"yesno",required:!0},{key:"wash_inside_windows",label:"Wash inside windows",type:"yesno",required:!0},{key:"wash_training_hub_windows",label:"Wash training hub windows",type:"yesno",required:!0}]},{title:"Grounds",questions:[{key:"cut_grass",label:"Cut grass",type:"yesno",required:!0},{key:"cut_hedge",label:"Cut hedge",type:"yesno",required:!0}]},{title:"Sign Off",questions:[{key:"signature",label:"Sign after completion of all tasks (type full name)",type:"text",required:!0}]}]}
45,{formType:"limes_medic_bag_check",title:"Medic Bag Check",description:"Weekly check of all medic bags â confirm each bag has been checked and is ready for deployment.",sections:[{title:"Details",questions:[{key:"check_date",label:"Date of check",type:"date",required:!0},{key:"checked_by",label:"Checked by (full name)",type:"text",required:!0}]},{title:"Bags 1â14",questions:[{key:"bag_1",label:"Bag 1",type:"yesno",required:!0},{key:"bag_2",label:"Bag 2",type:"yesno",required:!0},{key:"bag_3",label:"Bag 3",type:"yesno",required:!0},{key:"bag_4",label:"Bag 4",type:"yesno",required:!0},{key:"bag_5",label:"Bag 5",type:"yesno",required:!0},{key:"bag_6",label:"Bag 6",type:"yesno",required:!0},{key:"bag_7",label:"Bag 7",type:"yesno",required:!0},{key:"bag_8",label:"Bag 8",type:"yesno",required:!0},{key:"bag_9",label:"Bag 9",type:"yesno",required:!0},{key:"bag_10",label:"Bag 10",type:"yesno",required:!0},{key:"bag_11",label:"Bag 11",type:"yesno",required:!0},{key:"bag_12",label:"Bag 12",type:"yesno",required:!0},{key:"bag_13",label:"Bag 13",type:"yesno",required:!0},{key:"bag_14",label:"Bag 14",type:"yesno",required:!0}]},{title:"BP Bags",questions:[{key:"bp_1",label:"BP1",type:"yesno",required:!0},{key:"bp_2",label:"BP2",type:"yesno",required:!0},{key:"bp_3",label:"BP3",type:"yesno",required:!0},{key:"bp_4",label:"BP4",type:"yesno",required:!0},{key:"bp_5",label:"BP5",type:"yesno",required:!0}]},{title:"Other Bags",questions:[{key:"tower_1",label:"Tower 1",type:"yesno",required:!0},{key:"tower_2",label:"Tower 2",type:"yesno",required:!0},{key:"paramedic_bag",label:"Paramedic bag",type:"yesno",required:!0}]},{title:"Notes",questions:[{key:"notes",label:"Notes / issues",type:"text"}]},{title:"Sign Off",questions:[{key:"signature",label:"Signature (type full name to confirm check completed)",type:"text",required:!0}]}]},{formType:"limes_entonox_bag_check",title:"Entonox Bag Check",description:`Weekly check of all Entonox bags â confirm each bag has been checked and is ready for deployment. 46 47For each bag confirm: Cylinder is undamaged and in date. Stock is present: 3 mouthpieces, 3 sick bowls, 3 ice packs, pain score card and giving set.`,sections:[{title:"Details",questions:[{key:"check_date",label:"Date of check",type:"date",required:!0},{key:"checked_by",label:"Checked by (full name)",type:"text",required:!0}]},{title:"Bags 1â17",questions:[{key:"bag_1",label:"Bag 1",type:"yesno",required:!0},{key:"bag_2",label:"Bag 2",type:"yesno",required:!0},{key:"bag_3",label:"Bag 3",type:"yesno",required:!0},{key:"bag_4",label:"Bag 4",type:"yesno",required:!0},{key:"bag_5",label:"Bag 5",type:"yesno",required:!0},{key:"bag_6",label:"Bag 6",type:"yesno",required:!0},{key:"bag_7",label:"Bag 7",type:"yesno",required:!0},{key:"bag_8",label:"Bag 8",type:"yesno",required:!0},{key:"bag_9",label:"Bag 9",type:"yesno",required:!0},{key:"bag_10",label:"Bag 10",type:"yesno",required:!0},{key:"bag_11",label:"Bag 11",type:"yesno",required:!0},{key:"bag_12",label:"Bag 12",type:"yesno",required:!0},{key:"bag_13",label:"Bag 13",type:"yesno",required:!0},{key:"bag_14",label:"Bag 14",type:"yesno",required:!0},{key:"bag_15",label:"Bag 15",type:"yesno",required:!0},{key:"bag_16",label:"Bag 16",type:"yesno",required:!0},{key:"bag_17",label:"Bag 17",type:"yesno",required:!0}]},{title:"Notes",questions:[{key:"notes",label:"Notes / issues",type:"text"}]},{title:"Sign Off",questions:[{key:"signature",label:"Signature (type full name to confirm check completed)",type:"text",required:!0}]}]},{formType:"limes_lifepak_aed_check",title:"Lifepak and AED Check",description:`Weekly check of all Lifepak and AED units â confirm each device has been checked and is ready for deployment. 48 49For each device confirm: Check pods are in date, check 2 x packs of dots in Lifepak's, check razor and flannel are present and clean. Azo wipe all surfaces.`,sections:[{title:"Details",questions:[{key:"check_date",label:"Date of check",type:"date",required:!0},{key:"checked_by",label:"Checked by (full name)",type:"text",required:!0}]},{title:"Lifepaks 1â8",questions:[{key:"lifepak_1",label:"Lifepak 1",type:"yesno",required:!0},{key:"lifepak_2",label:"Lifepak 2",type:"yesno",required:!0},{key:"lifepak_3",label:"Lifepak 3",type:"yesno",required:!0},{key:"lifepak_4",label:"Lifepak 4",type:"yesno",required:!0},{key:"lifepak_5",label:"Lifepak 5",type:"yesno",required:!0},{key:"lifepak_6",label:"Lifepak 6",type:"yesno",required:!0},{key:"lifepak_7",label:"Lifepak 7",type:"yesno",required:!0},{key:"lifepak_8",label:"Lifepak 8",type:"yesno",required:!0}]},{title:"Lifepak 4x4",questions:[{key:"lifepak_4x4",label:"Lifepak 4x4",type:"yesno",required:!0}]},{title:"AEDs 1â21",questions:[{key:"aed_1",label:"AED 1",type:"yesno",required:!0},{key:"aed_2",label:"AED 2",type:"yesno",required:!0},{key:"aed_3",label:"AED 3",type:"yesno",required:!0},{key:"aed_4",label:"AED 4",type:"yesno",required:!0},{key:"aed_5",label:"AED 5",type:"yesno",required:!0},{key:"aed_6",label:"AED 6",type:"yesno",required:!0},{key:"aed_7",label:"AED 7",type:"yesno",required:!0},{key:"aed_8",label:"AED 8",type:"yesno",required:!0},{key:"aed_9",label:"AED 9",type:"yesno",required:!0},{key:"aed_10",label:"AED 10",type:"yesno",required:!0},{key:"aed_11",label:"AED 11",type:"yesno",required:!0},{key:"aed_12",label:"AED 12",type:"yesno",required:!0},{key:"aed_13",label:"AED 13",type:"yesno",required:!0},{key:"aed_14",label:"AED 14",type:"yesno",required:!0},{key:"aed_15",label:"AED 15",type:"yesno",required:!0},{key:"aed_16",label:"AED 16",type:"yesno",required:!0},{key:"aed_17",label:"AED 17",type:"yesno",required:!0},{key:"aed_18",label:"AED 18",type:"yesno",required:!0},{key:"aed_19",label:"AED 19",type:"yesno",required:!0},{key:"aed_20",label:"AED 20",type:"yesno",required:!0},{key:"aed_21",label:"AED 21",type:"yesno",required:!0}]},{title:"Notes",questions:[{key:"notes",label:"Notes / issues",type:"text"}]},{title:"Sign Off",questions:[{key:"signature",label:"Signature (type full name to confirm check completed)",type:"text",required:!0}]}]}];function Fs(s){return s.sections.reduce((a,n)=>a+n.questions.length,0)}const Qe=s=>`limes_draft_${s}`;function Vs(s){return Qe(s)}function Is(){try{const s=Qe("limes_weekly_maintenance");if(localStorage.getItem(s))return;for(let a=0;a<localStorage.length;a++){const n=localStorage.key(a);if(n&&n.startsWith("limes_weekly_draft_")){const i=localStorage.getItem(n);if(i){const l=JSON.parse(i);Object.values(l).some(r=>r.trim()!=="")&&localStorage.setItem(s,i)}localStorage.removeItem(n)}}}catch{}}const Ze="limes-card-order";function Ae(){return["vehicle-service","annual-service","deep-clean","ambulance-stock","vehicle-dates","loler","satnav","repair-log","fire-checks",...he.map(s=>s.formType)]}function Ps(){try{const s=localStorage.getItem(Ze);
49if(s){const a=JSON.parse(s),n=Ae(),i=new Set(a),l=[...a.filter(r=>n.includes(r))];for(const r of n)i.has(r)||l.push(r);return l}}catch{}return Ae()}const zs=new Set(["limes_medic_bag_check","limes_entonox_bag_check","limes_lifepak_aed_check"]);function Ys({question:s,value:a,onChange:n,formType:i}){if(s.type==="yesno"){const r=(i?zs.has(i):!1)?["Yes","No","Out at event","Unaccounted for"]:["Yes","No","N/A"];return e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/answer-input.tsx:30:6","data-hercules-name":"div",className:"flex gap-2",children:r.map(t=>e.jsx("button",{"data-hercules-id":"src/pages/forms/limes/_components/answer-input.tsx:32:10","data-hercules-name":"button",type:"button",onClick:()=>n(a===t?"":t),className:m("flex-1 py-2 rounded-lg text-sm font-medium border transition-colors cursor-pointer",a===t?t==="Yes"?"bg-green-500 text-white border-green-500":t==="N/A"||t==="Out at event"?"bg-blue-500 text-white border-blue-500":t==="Unaccounted for"?"bg-orange-500 text-white border-orange-500":"bg-red-500 text-white border-red-500":"bg-background border-border hover:bg-accent"),children:t},t))})}return s.type==="date"?e.jsx(Z,{"data-hercules-id":"src/pages/forms/limes/_components/answer-input.tsx:58:6","data-hercules-name":"Input",type:"date",value:a,onChange:l=>n(l.target.value),className:"max-w-[220px]"}):s.type==="number"?e.jsx(Z,{"data-hercules-id":"src/pages/forms/limes/_components/answer-input.tsx:69:6","data-hercules-name":"Input",type:"number",value:a,onChange:l=>n(l.target.value),className:"max-w-[180px]"}):e.jsx(Z,{"data-hercules-id":"src/pages/forms/limes/_components/answer-input.tsx:79:4","data-hercules-name":"Input",value:a,onChange:l=>n(l.target.value),placeholder:"Type your answerâ¦"})}function Hs({form:s,onClose:a,onSubmitted:n,draftKey:i,onDraftChange:l}){const r=Vs(s.formType),t=s.formType.startsWith("limes_vehicle_"),p=O(C.forms.getSharedDraft,{formType:s.formType}),k=X(C.forms.saveSharedDraft),v=X(C.forms.clearSharedDraft),[h,b]=j.useState(()=>{try{const c=localStorage.getItem(r);if(c)return JSON.parse(c)}catch{}return{}}),[o,y]=j.useState(!1);j.useEffect(()=>{o||p!==void 0&&(p&&Object.values(p.data).some(c=>c.trim()!=="")&&b(c=>{const N={...c,...p.data};try{localStorage.setItem(r,JSON.stringify(N))}catch{}return l?.(N),N}),y(!0))},[p,o]);const[d,g]=j.useState(!1),[q,A]=j.useState(!1),[M,D]=j.useState(""),se=X(C.forms.submit),{session:ne}=fe(),K=ne.staffId??void 0,ae=j.useRef(null),T=j.useCallback(c=>{ae.current&&clearTimeout(ae.current),ae.current=setTimeout(()=>{k({formType:s.formType,data:c}).catch(()=>{})},1500)},[s.formType,k]),ce=(c,N)=>{b(L=>{const x={...L,[c]:N};try{localStorage.setItem(r,JSON.stringify(x))}catch{}return l?.(x),T(x),x})},G=c=>{g(c),c&&A(!1);const L=s.sections.flatMap(x=>x.questions).filter(x=>x.type==="yesno").map(x=>x.key);b(c?x=>{const w={...x};for(const I of L)w[I]="N/A";try{localStorage.setItem(r,JSON.stringify(w))}catch{}return l?.(w),T(w),w}:x=>{const w={...x};for(const I of L)w[I]==="N/A"&&delete w[I];try{localStorage.setItem(r,JSON.stringify(w))}catch{}return l?.(w),T(w),w})},De=c=>{A(c),c||D(""),c&&g(!1);const L=s.sections.flatMap(x=>x.questions).filter(x=>x.type==="yesno").map(x=>x.key);b(c?x=>{const w={...x};for(const I of L)w[I]="N/A";try{localStorage.setItem(r,JSON.stringify(w))}catch{}return l?.(w),T(w),w}:x=>{const w={...x};for(const I of L)w[I]==="N/A"&&delete w[I];try{localStorage.setItem(r,JSON.stringify(w))}catch{}return l?.(w),T(w),w})},re=t&&(d||q)?s.sections.filter(c=>c.title!=="Sign Off").map(c=>({...c,questions:c.questions.filter(N=>N.key!=="mileage")})):s.sections,V=re.flatMap(c=>c.questions),le=V.filter(c=>c.required),de=le.filter(c=>h[c.key]?.trim()),U=de.length===le.length,B=V.filter(c=>c.type==="yesno"),oe=B.filter(c=>h[c.key]==="Yes"||h[c.key]==="N/A"||h[c.key]==="Out at event").length,f=B.length>0?Math.round(oe/B.length*100):null,E=async()=>{if(!U){S.error("Please answer all required questions");return}if(q&&!M.trim()){S.error("Please provide a reason for the vehicle being off road");return}try{const c={};t&&d?c.vehicle_status="Vehicle out and unable to service":t&&q&&(c.vehicle_status="Vehicle off road",M.trim()&&(c.off_road_reason=M.trim()));const N=new Set(V.map(x=>x.key)),L=new Set(Object.keys(h).filter(x=>x.toLowerCase().includes("signature")));
49Object.keys(h).forEach(x=>{!N.has(x)&&!L.has(x)&&(c[x]=h[x])}),V.forEach(x=>{h[x.key]!==void 0&&(c[x.key]=h[x.key])}),L.forEach(x=>{c[x]=h[x]}),await se({formType:s.formType,data:c,staffProfileId:K});try{localStorage.removeItem(r)}catch{}v({formType:s.formType}).catch(()=>{}),l?.({}),S.success("Form submitted successfully"),n()}catch{S.error("Failed to submit form")}};return e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:226:4","data-hercules-name":"div",className:"space-y-6",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:227:6","data-hercules-name":"div",className:"text-xs text-muted-foreground",children:[de.length," / ",le.length," required questions answered"]}),t&&e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:233:8","data-hercules-name":"div",className:"space-y-2",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:234:10","data-hercules-name":"div",className:"flex items-center gap-3 p-3 rounded-xl border-2 border-amber-300 bg-amber-50 dark:border-amber-700 dark:bg-amber-950/30",children:[e.jsx("input",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:235:12","data-hercules-name":"input",type:"checkbox",id:"vehicle-out",checked:d,onChange:c=>G(c.target.checked),className:"w-5 h-5 rounded border-amber-400 text-amber-600 focus:ring-amber-500 cursor-pointer accent-amber-600"}),e.jsx("label",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:242:12","data-hercules-name":"label",htmlFor:"vehicle-out",className:"text-sm font-medium cursor-pointer select-none",children:"Vehicle out and unable to service"})]}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:246:10","data-hercules-name":"div",className:"flex flex-col gap-2 p-3 rounded-xl border-2 border-red-300 bg-red-50 dark:border-red-700 dark:bg-red-950/30",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:247:12","data-hercules-name":"div",className:"flex items-center gap-3",children:[e.jsx("input",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:248:14","data-hercules-name":"input",type:"checkbox",id:"vehicle-off-road",checked:q,onChange:c=>De(c.target.checked),className:"w-5 h-5 rounded border-red-400 text-red-600 focus:ring-red-500 cursor-pointer accent-red-600"}),e.jsx("label",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:255:14","data-hercules-name":"label",htmlFor:"vehicle-off-road",className:"text-sm font-medium cursor-pointer select-none",children:"Vehicle off road"})]}),q&&e.jsx("input",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:260:14","data-hercules-name":"input",type:"text",id:"off-road-reason",value:M,onChange:c=>D(c.target.value),placeholder:"Reason...",className:"w-full rounded-md border border-red-200 dark:border-red-800 bg-white dark:bg-red-950/50 px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-red-400"})]})]}),re.map(c=>e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:274:8","data-hercules-name":"div",className:"space-y-4",children:[e.jsx("h3",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:275:10","data-hercules-name":"h3",className:"font-semibold text-sm uppercase tracking-wide text-muted-foreground border-b pb-1.5",children:c.title}),e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:278:10","data-hercules-name":"div",className:"space-y-5",children:c.questions.map(N=>e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:280:14","data-hercules-name":"div",className:"space-y-2",children:[e.jsxs("label",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:281:16","data-hercules-name":"label",className:"text-sm font-medium",children:[N.label,N.required&&e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:283:33","data-hercules-name":"span",className:"text-destructive ml-1",children:"*"})]}),e.jsx(Ys,{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:285:16","data-hercules-name":"AnswerInput",question:N,value:h[N.key]??"",onChange:L=>ce(N.key,L),formType:s.formType})]},N.key))})]},c.title)),B.length>0&&e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:298:8","data-hercules-name":"div",className:m("rounded-xl p-5 border-2",f===null?"border-border bg-muted/40":f>=80?"border-green-500 bg-green-50 dark:bg-green-950/30":f>=60?"border-yellow-500 bg-yellow-50 dark:bg-yellow-950/30":"border-red-500 bg-red-50 dark:bg-red-950/30"),children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:305:10","data-hercules-name":"div",className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:306:12","data-hercules-name":"div",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:307:14","data-hercules-name":"p",className:"text-sm font-semibold",children:"Completion Score"}),e.jsxs("p",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:308:14","data-hercules-name":"p",className:"text-xs text-muted-foreground mt-0.5",children:[B.filter(c=>h[c.key]).length," of ",B.length," tasks answered"]})]}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:312:12","data-hercules-name":"div",className:"text-right",children:[e.jsxs("p",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:313:14","data-hercules-name":"p",className:m("text-4xl font-bold",f===null?"text-muted-foreground":f>=80?"text-green-600 dark:text-green-400":f>=60?"text-yellow-600 dark:text-yellow-400":"text-red-600 dark:text-red-400"),children:[f??"â",f!==null&&e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:321:43","data-hercules-name":"span",className:"text-2xl",children:"%"})]}),e.jsxs("p",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:323:14","data-hercules-name":"p",className:"text-xs text-muted-foreground",children:[oe," positive / ",B.length," total"]})]})]}),e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:326:10","data-hercules-name":"div",className:"w-full bg-black/10 dark:bg-white/10 rounded-full h-2.5 overflow-hidden",children:e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:327:12","data-hercules-name":"div",className:m("h-2.5 rounded-full transition-all duration-500",(f??0)>=80?"bg-green-500":(f??0)>=60?"bg-yellow-500":"bg-red-500"),style:{width:`${f??0}%`}})}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:337:10","data-hercules-name":"p",className:m("text-xs font-medium mt
49-2",(f??0)>=80?"text-green-600 dark:text-green-400":(f??0)>=60?"text-yellow-600 dark:text-yellow-400":"text-red-600 dark:text-red-400"),children:f===null?"Complete tasks to see your score":f>=80?"Good â most tasks completed":f>=60?"Moderate â some tasks outstanding":"Incomplete â significant tasks remaining"})]}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:351:6","data-hercules-name":"div",className:"flex gap-3 justify-end pt-2",children:[e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:352:8","data-hercules-name":"Button",variant:"ghost",onClick:a,children:"Cancel"}),e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/fill-form.tsx:353:8","data-hercules-name":"Button",onClick:E,disabled:!U,children:"Submit Form"})]})]})}const $s={submitted:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300",reviewed:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-300",approved:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300",rejected:"bg-red-100 text-red-700 dark:bg-red-900/20 dark:text-red-400"};function Js({form:s}){const{session:a}=fe(),n=a.groups?.includes("admins"),i=a.staffId??void 0,{results:l,status:r,loadMore:t}=$e(C.forms.listByType,{formType:s.formType,staffProfileId:i},{initialNumItems:20}),p=X(C.forms.updateStatus),k=X(C.forms.deleteSubmission),[v,h]=j.useState(null),o=s.sections.flatMap(d=>d.questions).filter(d=>d.type==="yesno");if(r==="LoadingFirstPage")return e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:52:6","data-hercules-name":"div",className:"space-y-3",children:Array.from({length:3}).map((d,g)=>e.jsx(ie,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:53:49","data-hercules-name":"Skeleton",className:"h-28 w-full rounded-xl"},g))});if(l.length===0)return e.jsx(hs,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:60:6","data-hercules-name":"Empty",children:e.jsxs(gs,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:61:8","data-hercules-name":"EmptyHeader",children:[e.jsx(xs,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:62:10","data-hercules-name":"EmptyMedia",variant:"icon",children:e.jsx(Ne,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:62:37","data-hercules-name":"ClipboardList"})}),e.jsx(fs,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:63:10","data-hercules-name":"EmptyTitle",children:"No submissions yet"}),e.jsx(ys,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:64:10","data-hercules-name":"EmptyDescription",children:"Complete this form to create the first submission"})]})});const y=async(d,g)=>{try{await p({id:d,status:g}),S.success("Status updated")}catch{S.error("Failed to update")}};return e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:76:4","data-hercules-name":"div",className:"space-y-3",children:[l.map(d=>{const g=v===d._id,q=o.filter(M=>d.data[M.key]==="Yes"||d.data[M.key]==="N/A"||d.data[M.key]==="Out at event").length,A=o.length>0?Math.round(q/o.length*100):null;return e.jsxs(z,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:85:10","data-hercules-name":"Card",children:[e.jsx(Y,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:86:12","data-hercules-name":"CardHeader",className:"pb-2",children:e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:87:14","data-hercules-name":"div",className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:88:16","data-hercules-name":"div",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:89:18","data-hercules-name":"p",className:"text-sm font-semibold",children:d.submitterName}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:90:18","data-hercules-name":"p",className:"text-xs text-muted-foreground",children:R(new Date(d._creationTime),"d MMM yyyy, HH:mm")}
49),d.data.completion_date&&e.jsxs("p",{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:94:20","data-hercules-name":"p",className:"text-xs text-muted-foreground",children:["Completion date: ",R(new Date(d.data.completion_date),"dd MMM yyyy")]})]}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:99:16","data-hercules-name":"div",className:"flex items-center gap-2 shrink-0",children:[A!==null&&e.jsxs("span",{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:101:20","data-hercules-name":"span",className:m("text-xs px-2 py-0.5 rounded-full font-semibold",A>=80?"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-400":A>=60?"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/40 dark:text-yellow-400":"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400"),children:[A,"% complete"]}),e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:112:18","data-hercules-name":"span",className:m("text-xs px-2 py-0.5 rounded-full font-medium",$s[d.status]),children:d.status})]})]})}),e.jsxs(H,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:118:12","data-hercules-name":"CardContent",className:"space-y-3",children:[e.jsx("button",{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:119:14","data-hercules-name":"button",onClick:()=>h(g?null:d._id),className:"text-xs text-primary flex items-center gap-1 cursor-pointer",children:g?e.jsxs(e.Fragment,{children:[e.jsx(ve,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:124:22","data-hercules-name":"ChevronUp",className:"w-3 h-3"}),"Hide answers"]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:125:22","data-hercules-name":"ChevronDown",className:"w-3 h-3"}),"Show answers"]})}),g&&e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:129:16","data-hercules-name":"div",className:"space-y-3 border-t pt-3",children:s.sections.map(M=>e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:131:20","data-hercules-name":"div",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:132:22","data-hercules-name":"p",className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground mb-1.5",children:M.title}),e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:135:22","data-hercules-name":"div",className:"space-y-1.5",children:M.questions.map(D=>e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:137:26","data-hercules-name":"div",className:"flex gap-2 text-sm",children:[e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:138:28","data-hercules-name":"span",className:"text-muted-foreground flex-1",children:D.label}),e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:139:28","data-hercules-name":"span",className:m("font-medium shrink-0",d.data[D.key]==="Yes"&&"text-green-600",d.data[D.key]==="N/A"&&"text-blue-600",d.data[D.key]==="Out at event"&&"text-blue-600",d.data[D.key]==="Unaccounted for"&&"text-orange-600",d.data[D.key]==="No"&&"text-red-600"),children:d.data[D.key]||"â"})]},D.key))})]},M.title))}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:157:14","data-hercules-name":"div",className:"flex gap-2 flex-wrap",children:[d.status==="submitted"&&e.jsxs(e.Fragment,{children:[e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:160:20","data-hercules-name":"Button",size:"sm",variant:"secondary",onClick:()=>y(d._id,"reviewed"),children:"Mark Reviewed"}),e.jsxs(_,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:161:20","data-hercules-name":"Button",size:"sm",onClick:()=>y(d._id,"approved"),children:[e.jsx($,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:162:22","data-hercules-name":"CheckCircle2",className:"w-3.5 h-3.5 mr-1"}),"Approve"]}),e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:164:20","data-hercules-name":"Button",size:"sm",variant:"secondary",className:"text-destructive",onClick:()=>y(d._id,"rejected"),children:"Reject"})]}),d.status==="reviewed"&&e.jsxs(e.Fragment,{children:[e.jsxs(_,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:169:20","data-hercules-name":"Button",size:"sm",onClick:()=>y(d._id,"approved"),children:[e.jsx($,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:170:22","data-hercules-name":"CheckCircle2",className:"w-3.5 h-3.5 mr-1"}),"Approve"]}),e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:172:20","data-hercules-name":"Button",size:"sm",variant:"secondary",className:"text-destructive",onClick:()=>y(d._id,"rejected"),children:"Reject"})]}),d.status==="approved"&&e.jsxs(e.Fragment,{children:[e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:177:20","data-hercules-name":"Button",size:"sm",variant:"secondary",onClick:()=>y(d._id,"reviewed"),children:"Mark Reviewed"}),e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:178:20","data-hercules-name":"Button",size:"sm",variant:"secondary",className:"text-destructive",onClick:()=>y(d._id,"rejected"),children:"Reject"})]}),d.status==="rejected"&&e.jsxs(e.Fragment,{children:[e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:183:20","data-hercules-name":"Button",size:"sm",variant:"secondary",onClick:()=>y(d._id,"reviewed"),children:"Mark Reviewed"}),e.jsxs(_,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:184:20","data-hercules-name":"Button",size:"sm",onClick:()=>y(d._id,"approved"),children:[e.jsx($,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:185:22","data-hercules-name":"CheckCircle2",className:"w-3.5 h-3.5 mr-1"}),"Approve"]})]}),n&&e.jsxs(_,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:190:18","data-hercules-name":"Button",size:"sm",variant:"ghost",className:"text-destructive hover:text-destructive ml-auto",onClick:async()=>{try{await k({id:d._id}),S.success("Deleted")}catch{S.error("Failed to delete")}},children:[e.jsx(Je,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:193:20","data-hercules-name":"Trash2",className:"w-3.5 h-3.5 mr-1"}),"Delete"]})]})]})]},d._id)}),r==="CanLoadMore"&&e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:203:8","data-hercules-name":"div",className:"text-center",children:e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/submission-list.tsx:204:10","data-hercules-name":"Button",variant:"secondary",onClick:()=>t(20),children:"Load More"})})]})}function Xs({id:s,children:a}){const{attributes:n,listeners:i,setNodeRef:l,transform:r,transition:t,isDragging:p}=Ie({id:s}),k={transform:Pe.Transform.toString(r),transition:t,opacity:p?.5:1,zIndex:p?50:void 0};return e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:54:4","data-hercules-name":"div",ref:l,style:k,className:"flex",children:a({...n,...i},p)})}function Ws({formsInProgress:s,overdueFormTypes:a,onSelectVehicle:n,onSelectAnnualService:i,onSelectDeepClean:l,onOpenLoler:r,onOpenSatnav:t,onOpenRepairLog:p,onFillForm:k,onViewSubmissions:v}){const[h,b]=j.useState(Ps),o=as(),y=W.map(f=>f.reg),d=O(C.vehicleServiceStatus.getWeeklyStatus,{vehicleRegs:y}),g=d?Object.values(d).filter(f=>!f.serviced).length:0,q=g>0,A=pe.map(f=>f.reg),M=O(C.vehicleDeepCleanStatus.getDeepCleanStatus,{vehicleRegs:A}),D=M?Object.values(M).filter(f=>!f.cleaned).length:0,se=D>0,ne=O(C.vehicleDates.getOverdueCount,{}),K=(ne??0)>0,ae=O(C.loler.getOverdueCount,{}),T=(ae??0)>0,ce=O(C.satnav.getOverdueCount,{}),G=(ce??0)>0,re=O(C.limesFireLog.getOverdueSummary,{})?.overdue??0,V=re>0,le=Ee(Oe(Re,{activationConstraint:{distance:8}})),de=f=>{const{active:E,over:c}=f;if(c&&E.id!==c.id){const N=h.indexOf(E.id),L=h.indexOf(c.id),x=Ve(h,N,L);b(x),localStorage.setItem(Ze,JSON.stringify(x))}},U=W.some(f=>s[Ue(f).formType]??!1),B=q||U,oe=(f,E,c)=>{if(f==="vehicle-service")return e.jsxs(z,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:142:8","data-hercules-name":"Card",className:m("relative flex flex-col hover:shadow-md transition-shadow w-full h-full overflow-hidden py-3",B&&"ring-2 ring-red-500",c&&"shadow-xl"),children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:146:10","data-hercules-name":"div",...E,className:"absolute top-2 right-2 z-10 p-1 rounded cursor-grab active:cursor-grabbing text-muted-foreground hover:text-foreground opacity-40 hover:opacity-100 transition-opacity bg-background/80 rounded-md",onClick:u=>u.stopPropagation(),children:e.jsx(P,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:151:12","data-hercules-name":"GripVertical",className:"w-4 h-4"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:153:10","data-hercules-name":"div",className:"cursor-pointer flex flex-col flex-1",role:"button",tabIndex:0,onClick:n,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n())},children:[e.jsx(Y,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:154:12","data-hercules-name":"CardHeader",className:"pb-1 pt-0",children:e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:155:14","data-hercules-name":"div",className:"flex items-start gap-2.5 min-w-0",children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:156:16","data-hercules-name":"div",className:m("w-8 h-8 rounded-lg flex items-center justify-center shrink-0",B?"bg-red-50 dark:bg-red-900/20":"bg-lime-50 dark:bg-lime-900/20"),children:e.jsx(Ne,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:157:18","data-hercules-name":"ClipboardList",className:m("w-4 h-4",B?"text-red-600 dark:text-red-400":"text-lime-600 dar
49k:text-lime-400")})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:159:16","data-hercules-name":"div",className:"min-w-0 flex-1",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:160:18","data-hercules-name":"div",className:"flex items-center gap-2 flex-wrap",children:[e.jsx(J,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:161:20","data-hercules-name":"CardTitle",className:"text-sm",children:"Vehicle Service Jobs"}),U&&e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:163:22","data-hercules-name":"span",className:"text-[10px] px-1.5 py-0.5 rounded-full font-semibold bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400 shrink-0",children:"In Progress"}),q&&!U&&e.jsxs("span",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:168:22","data-hercules-name":"span",className:"text-[10px] px-1.5 py-0.5 rounded-full font-semibold bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400 shrink-0",children:[g," Pending"]})]}),e.jsxs("p",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:173:18","data-hercules-name":"p",className:"text-[11px] text-muted-foreground mt-0.5",children:[W.length," vehicles · 13 checks each"]})]})]})}),e.jsxs(H,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:179:12","data-hercules-name":"CardContent",className:"flex flex-col flex-1 justify-between gap-2 pt-1",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:180:14","data-hercules-name":"p",className:"text-[11px] text-muted-foreground line-clamp-2",children:"Weekly service checks for all fleet vehicles â mileage, safety, fluids and cleaning."}),e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:181:14","data-hercules-name":"Button",className:m("w-full",B&&"bg-red-600 hover:bg-red-700 text-white"),size:"sm",children:U?"Continue â In Progress":q?"Complete â Overdue":"Select Vehicle"})]})]})]});if(f==="annual-service"){const u=W.some(F=>s[Ge(F).formType]??!1);return e.jsxs(z,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:193:8","data-hercules-name":"Card",className:m("relative flex flex-col hover:shadow-md transition-shadow w-full h-full overflow-hidden py-3",u&&"ring-2 ring-orange-500",c&&"shadow-xl"),children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:196:10","data-hercules-name":"div",...E,className:"absolute top-2 right-2 z-10 p-1 rounded cursor-grab active:cursor-grabbing text-muted-foreground hover:text-foreground opacity-40 hover:opacity-100 transition-opacity bg-background/80 rounded-md",onClick:F=>F.stopPropagation(),children:e.jsx(P,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:201:12","data-hercules-name":"GripVertical",className:"w-4 h-4"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:203:10","data-hercules-name":"div",className:"cursor-pointer flex flex-col flex-1",role:"button",tabIndex:0,onClick:i,onKeyDown:F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),i())},children:[e.jsx(Y,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:204:12","data-hercules-name":"CardHeader",className:"pb-1 pt-0",children:e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:205:14","data-hercules-name":"div",className:"flex items-start gap-2.5 min-w-0",children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:206:16","data-hercules-name":"div",className:m("w-8 h-8 rounded-lg flex items-center justify-center shrink-0",u?"bg-orange-50 dark:bg-orange-900/20":"bg-blue-50 dark:bg-blue-900/20"),children:e.jsx(te,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:207:18","data-hercules-name":"Wrench",className:m("w-4 h-4",u?"text-orange-600 dark:text-orange-400":"text-blue-600 dar
49k:text-blue-400")})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:209:16","data-hercules-name":"div",className:"min-w-0 flex-1",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:210:18","data-hercules-name":"div",className:"flex items-center gap-2 flex-wrap",children:[e.jsx(J,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:211:20","data-hercules-name":"CardTitle",className:"text-sm",children:"Annual Vehicle Servicing"}),u&&e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:213:22","data-hercules-name":"span",className:"text-[10px] px-1.5 py-0.5 rounded-full font-semibold bg-orange-100 text-orange-700 dark:bg-orange-900/40 dark:text-orange-400 shrink-0",children:"In Progress"})]}),e.jsxs("p",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:218:18","data-hercules-name":"p",className:"text-[11px] text-muted-foreground mt-0.5",children:[W.length," vehicles · 60 service items each"]})]})]})}),e.jsxs(H,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:224:12","data-hercules-name":"CardContent",className:"flex flex-col flex-1 justify-between gap-2 pt-1",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:225:14","data-hercules-name":"p",className:"text-[11px] text-muted-foreground line-clamp-2",children:"Gold service (24,000 miles / 24 months) â lights, engine, brakes, steering, drive system, exhaust, tyres and final checks."}),e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:226:14","data-hercules-name":"Button",className:m("w-full",u&&"bg-orange-600 hover:bg-orange-700 text-white"),size:"sm",children:u?"Continue â In Progress":"Select Vehicle"})]})]})]})}if(f==="deep-clean"){const u=pe.some(Q=>s[Ke(Q).formType]??!1),F=se||u;return e.jsxs(z,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:239:8","data-hercules-name":"Card",className:m("relative flex flex-col hover:shadow-md transition-shadow w-full h-full overflow-hidden py-3",F&&"ring-2 ring-red-500",c&&"shadow-xl"),children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:242:10","data-hercules-name":"div",...E,className:"absolute top-2 right-2 z-10 p-1 rounded cursor-grab active:cursor-grabbing text-muted-foreground hover:text-foreground opacity-40 hover:opacity-100 transition-opacity bg-background/80 rounded-md",onClick:Q=>Q.stopPropagation(),children:e.jsx(P,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:247:12","data-hercules-name":"GripVertical",className:"w-4 h-4"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:249:10","data-hercules-name":"div",className:"cursor-pointer flex flex-col flex-1",role:"button",tabIndex:0,onClick:l,onKeyDown:Q=>{(Q.key==="Enter"||Q.key===" ")&&(Q.preventDefault(),l())},children:[e.jsx(Y,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:250:12","data-hercules-name":"CardHeader",className:"pb-1 pt-0",children:e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:251:14","data-hercules-name":"div",className:"flex items-start gap-2.5 min-w-0",children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:252:16","data-hercules-name":"div",className:m("w-8 h-8 rounded-lg flex items-center justify-center shrink-0",F?"bg-red-50 dark:bg-red-900/20":"bg-purple-50 dark:bg-purple-900/20"),children:e.jsx(Se,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:253:18","data-hercules-name":"Ambulance",className:m("w-4 h-4",F?"text-red-600 dark:text-red-400":"text-purple-600 dark:text-purple-400")})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:255:16","data-hercules-name":"div",className:"min-w-0 flex-1",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:256:18","data-hercules-name":"div",className:"flex items-center gap-2 flex-wrap",children:[e.jsx(J,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:257:20","data-hercules-name":"CardTitle",className:"text-sm",children:"Vehicle Deep Clean Log"}),u&&e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:259:22","data-hercules-name":"span",className:"text-[10px] px-1.5 py-0.5 rounded-full font-semibold bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400 shrink-0",children:"In Progress"}),se&&!u&&e.jsxs("span",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:264:22","data-hercules-name":"span",className:"text-[10px] px-1.5 py-0.5 rounded-full font-semibold bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400 shrink-0",children:[D," Overdue"]})]}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:269:18","data-hercules-name":"p",className:"text-[11px] text-muted-foreground mt-0.5",children:"7 ambulances · 4-month cycle"})]})]})}),e.jsxs(H,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:275:12","data-hercules-name":"CardContent",className:"flex flex-col flex-1 justify-between gap-2 pt-1",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:276:14","data-hercules-name":"p",className:"text-[11px] text-muted-foreground line-clamp-2",children:"Deep clean and ozone treatment log â each ambulance must be cleaned at least once every 4 months."}),e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:277:14","data-hercules-name":"Button",className:m("w-full",F&&"bg-red-600 hover:bg-red-700 text-white"),size:"sm",children:u?"Continue â In Progress":se?"Complete â Overdue":"Select Vehicle"})]})]})]})}if(f==="ambulance-stock")return e.jsxs(z,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:288:8","data-hercules-name":"Card",className:m("relative flex flex-col hover:shadow-md transition-shadow w-full h-full py-3",c&&"shadow-xl"),children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:289:10","data-hercules-name":"div",...E,className:"absolute top-2 right-2 z-10 p-1 rounded cursor-grab active:cursor-grabbing text-muted-foreground hover:text-foreground opacity-40 hover:opacity-100 transition-opacity",onClick:u=>u.stopPropagation(),children:e.jsx(P,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:294:12","data-hercules-name":"GripVertical",className:"w-4 h-4"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:296:10","data-hercules-name":"div",className:"cursor-pointer flex flex-col flex-1",role:"button",tabIndex:0,onClick:()=>o("/forms/driver/ambulance-stock"),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),o("/forms/driver/ambulance-stock"))},children:[e.jsx(Y,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:297:12","data-hercules-name":"CardHeader",className:"pb-1 pt-0",children:e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:298:14","data-hercules-name":"div",className:"flex items-start gap-2.5 min-w-0",children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:299:16","data-hercules-name":"div",className:"w-8 h-8 rounded-lg flex items-center justify-center shrink-0 bg-lime-50 dark:bg-lime-900/20",children:e.jsx(Se,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:300:18","data-hercules-name":"Ambulance",className:"w-4 h-4 text-lime-600 dar
49k:text-lime-400"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:302:16","data-hercules-name":"div",className:"min-w-0 flex-1",children:[e.jsx(J,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:303:18","data-hercules-name":"CardTitle",className:"text-sm",children:"Ambulance Stock Check"}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:304:18","data-hercules-name":"p",className:"text-[11px] text-muted-foreground mt-0.5",children:"7 ambulances · full stock inventory"})]})]})}),e.jsxs(H,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:308:12","data-hercules-name":"CardContent",className:"flex flex-col flex-1 justify-between gap-2 pt-1",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:309:14","data-hercules-name":"p",className:"text-[11px] text-muted-foreground line-clamp-2",children:"Full stock check for ambulances 1â7 including medical supplies, equipment, medicines and more."}),e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:310:14","data-hercules-name":"Button",className:"w-full",size:"sm",children:"Open Form"})]})]})]});if(f==="vehicle-dates")return e.jsxs(z,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:319:8","data-hercules-name":"Card",className:m("relative flex flex-col hover:shadow-md transition-shadow w-full h-full py-3",K&&"ring-2 ring-red-500",c&&"shadow-xl"),children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:320:10","data-hercules-name":"div",...E,className:"absolute top-2 right-2 z-10 p-1 rounded cursor-grab active:cursor-grabbing text-muted-foreground hover:text-foreground opacity-40 hover:opacity-100 transition-opacity",onClick:u=>u.stopPropagation(),children:e.jsx(P,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:325:12","data-hercules-name":"GripVertical",className:"w-4 h-4"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:327:10","data-hercules-name":"div",className:"cursor-pointer flex flex-col flex-1",role:"button",tabIndex:0,onClick:()=>o("/operations/vehicle-dates"),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),o("/operations/vehicle-dates"))},children:[e.jsx(Y,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:328:12","data-hercules-name":"CardHeader",className:"pb-1 pt-0",children:e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:329:14","data-hercules-name":"div",className:"flex items-start gap-2.5 min-w-0",children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:330:16","data-hercules-name":"div",className:m("w-8 h-8 rounded-lg flex items-center justify-center shrink-0",K?"bg-red-50 dark:bg-red-900/20":"bg-blue-50 dark:bg-blue-900/20"),children:e.jsx(rs,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:331:18","data-hercules-name":"Car",className:m("w-4 h-4",K?"text-red-600 dark:text-red-400":"text-blue-600 dark:text-blue-400")})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:333:16","data-hercules-name":"div",className:"min-w-0 flex-1",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:334:18","data-hercules-name":"div",className:"flex items-center gap-2 flex-wrap",children:[e.jsx(J,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:335:20","data-hercules-name":"CardTitle",className:"text-sm",children:"Vehicle Dates Reminder Sheet"}),K&&e.jsxs("span",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:337:22","data-hercules-name":"span",className:"text-[10px] px-1.5 py-0.5 rounded-full font-semibold bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400 shrink-0",children:[ne," Overdue"]})]}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:342:18","data-hercules-name":"p",className:"text-[11px] text-muted-foreground mt-0.5",children:"11 vehicles · MOT, Insurance, Tax, Battery"})]})]})}),e.jsxs(H,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:346:12","data-hercules-name":"CardContent",className:"flex flex-col flex-1 justify-between gap-2 pt-1",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:347:14","data-hercules-name":"p",className:"text-[11px] text-muted-foreground line-clamp-2",children:"Track MOT, insurance, tax and battery renewal dates for all fleet vehicles with expiry alerts."}),e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:348:14","data-hercules-name":"Button",className:m("w-full",K&&"bg-red-600 hover:bg-red-700 text-white"),size:"sm",children:K?"Complete â Overdue":"Open Dates"})]})]})]});if(f==="loler")return e.jsxs(z,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:359:8","data-hercules-name":"Card",className:m("relative flex flex-col hover:shadow-md transition-shadow w-full h-full py-3",T&&"ring-2 ring-red-500",c&&"shadow-xl"),children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:360:10","data-hercules-name":"div",...E,className:"absolute top-2 right-2 z-10 p-1 rounded cursor-grab active:cursor-grabbing text-muted-foreground hover:text-foreground opacity-40 hover:opacity-100 transition-opacity",onClick:u=>u.stopPropagation(),children:e.jsx(P,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:365:12","data-hercules-name":"GripVertical",className:"w-4 h-4"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:367:10","data-hercules-name":"div",className:"cursor-pointer flex flex-col flex-1",role:"button",tabIndex:0,onClick:r,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),r())},children:[e.jsx(Y,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:368:12","data-hercules-name":"CardHeader",className:"pb-1 pt-0",children:e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:369:14","data-hercules-name":"div",className:"flex items-start gap-2.5 min-w-0",children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:370:16","data-hercules-name":"div",className:m("w-8 h-8 rounded-lg flex items-center justify-center shrink-0",T?"bg-red-50 dark:bg-red-900/20":"bg-lime-50 dark:bg-lime-900/20"),children:e.jsx($,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:371:18","data-hercules-name":"CheckCircle2",className:m("w-4 h-4",T?"text-red-600 dark:text-red-400":"text-lime-600 dar
49k:text-lime-400")})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:373:16","data-hercules-name":"div",className:"min-w-0 flex-1",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:374:18","data-hercules-name":"div",className:"flex items-center gap-2 flex-wrap",children:[e.jsx(J,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:375:20","data-hercules-name":"CardTitle",className:"text-sm",children:"LOLER Checks"}),T&&e.jsxs("span",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:377:22","data-hercules-name":"span",className:"text-[10px] px-1.5 py-0.5 rounded-full font-semibold bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400 shrink-0",children:[ae," Overdue"]})]}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:382:18","data-hercules-name":"p",className:"text-[11px] text-muted-foreground mt-0.5",children:"7 ambulances · 6-month cycle"})]})]})}),e.jsxs(H,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:386:12","data-hercules-name":"CardContent",className:"flex flex-col flex-1 justify-between gap-2 pt-1",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:387:14","data-hercules-name":"p",className:"text-[11px] text-muted-foreground line-clamp-2",children:"Lifting Operations and Lifting Equipment Regulations inspection for all ambulance trolleys."}),e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:388:14","data-hercules-name":"Button",className:m("w-full",T&&"bg-red-600 hover:bg-red-700 text-white"),size:"sm",children:T?"Complete â Overdue":"Open Checks"})]})]})]});if(f==="satnav")return e.jsxs(z,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:399:8","data-hercules-name":"Card",className:m("relative flex flex-col hover:shadow-md transition-shadow w-full h-full py-3",G&&"ring-2 ring-red-500",c&&"shadow-xl"),children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:400:10","data-hercules-name":"div",...E,className:"absolute top-2 right-2 z-10 p-1 rounded cursor-grab active:cursor-grabbing text-muted-foreground hover:text-foreground opacity-40 hover:opacity-100 transition-opacity",onClick:u=>u.stopPropagation(),children:e.jsx(P,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:405:12","data-hercules-name":"GripVertical",className:"w-4 h-4"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:407:10","data-hercules-name":"div",className:"cursor-pointer flex flex-col flex-1",role:"button",tabIndex:0,onClick:t,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),t())},children:[e.jsx(Y,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:408:12","data-hercules-name":"CardHeader",className:"pb-1 pt-0",children:e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:409:14","data-hercules-name":"div",className:"flex items-start gap-2.5 min-w-0",children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:410:16","data-hercules-name":"div",className:m("w-8 h-8 rounded-lg flex items-center justify-center shrink-0",G?"bg-red-50 dark:bg-red-900/20":"bg-lime-50 dark:bg-lime-900/20"),children:e.jsx(ze,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:411:18","data-hercules-name":"Navigation",className:m("w-4 h-4",G?"text-red-600 dark:text-red-400":"text-lime-600 dark:text-lime-400")})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:413:16","data-hercules-name":"div",className:"min-w-0 flex-1",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:414:18","data-hercules-name":"div",className:"flex items-center gap-2 flex-wrap",children:[e.jsx(J,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:415:20","data-hercules-name":"CardTitle",className:"text-sm",children:"Satnav Update"}),G&&e.jsxs("span",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:417:22","data-hercules-name":"span",className:"text-[10px] px-1.5 py-0.5 rounded-full font-semibold bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400 shrink-0",children:[ce," Overdue"]})]}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:422:18","data-hercules-name":"p",className:"text-[11px] text-muted-foreground mt-0.5",children:"9 units · 6-month cycle"})]})]})}),e.jsxs(H,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:426:12","data-hercules-name":"CardContent",className:"flex flex-col flex-1 justify-between gap-2 pt-1",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:427:14","data-hercules-name":"p",className:"text-[11px] text-muted-foreground line-clamp-2",children:"Record satnav map updates across the fleet and track next due dates for each unit."}),e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:428:14","data-hercules-name":"Button",className:m("w-full",G&&"bg-red-600 hover:bg-red-700 text-white"),size:"sm",children:G?"Complete â Overdue":"Open Matrix"})]})]})]});if(f==="repair-log")return e.jsxs(z,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:439:8","data-hercules-name":"Card",className:m("relative flex flex-col hover:shadow-md transition-shadow w-full h-full py-3",c&&"shadow-xl"),children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:440:10","data-hercules-name":"div",...E,className:"absolute top-2 right-2 z-10 p-1 rounded cursor-grab active:cursor-grabbing text-muted-foreground hover:text-foreground opacity-40 hover:opacity-100 transition-opacity",onClick:u=>u.stopPropagation(),children:e.jsx(P,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:445:12","data-hercules-name":"GripVertical",className:"w-4 h-4"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:447:10","data-hercules-name":"div",className:"cursor-pointer flex flex-col flex-1",role:"button",tabIndex:0,onClick:p,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),p())},children:[e.jsx(Y,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:448:12","data-hercules-name":"CardHeader",className:"pb-1 pt-0",children:e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:449:14","data-hercules-name":"div",className:"flex items-start gap-2.5 min-w-0",children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:450:16","data-hercules-name":"div",className:"w-8 h-8 rounded-lg flex items-center justify-center shrink-0 bg-orange-50 dark:bg-orange-900/20",children:e.jsx(te,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:451:18","data-hercules-name":"Wrench",className:"w-4 h-4 text-orange-600 dar
49k:text-orange-400"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:453:16","data-hercules-name":"div",className:"min-w-0 flex-1",children:[e.jsx(J,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:454:18","data-hercules-name":"CardTitle",className:"text-sm",children:"Vehicle Repair Log"}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:455:18","data-hercules-name":"p",className:"text-[11px] text-muted-foreground mt-0.5",children:"11 vehicles · ongoing log"})]})]})}),e.jsxs(H,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:459:12","data-hercules-name":"CardContent",className:"flex flex-col flex-1 justify-between gap-2 pt-1",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:460:14","data-hercules-name":"p",className:"text-[11px] text-muted-foreground line-clamp-2",children:"Log repairs for each fleet vehicle â type of vehicle, registration, repair completed and mileage."}),e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:461:14","data-hercules-name":"Button",className:"w-full",size:"sm",children:"Open Repair Log"})]})]})]});if(f==="fire-checks")return e.jsxs(z,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:470:8","data-hercules-name":"Card",className:m("relative flex flex-col hover:shadow-md transition-shadow w-full h-full py-3",V&&"ring-2 ring-red-500",c&&"shadow-xl"),children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:471:10","data-hercules-name":"div",...E,className:"absolute top-2 right-2 z-10 p-1 rounded cursor-grab active:cursor-grabbing text-muted-foreground hover:text-foreground opacity-40 hover:opacity-100 transition-opacity",onClick:u=>u.stopPropagation(),children:e.jsx(P,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:476:12","data-hercules-name":"GripVertical",className:"w-4 h-4"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:478:10","data-hercules-name":"div",className:"cursor-pointer flex flex-col flex-1",role:"button",tabIndex:0,onClick:()=>o("/operations/limes-fire-checks"),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),o("/operations/limes-fire-checks"))},children:[e.jsx(Y,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:479:12","data-hercules-name":"CardHeader",className:"pb-1 pt-0",children:e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:480:14","data-hercules-name":"div",className:"flex items-start gap-2.5 min-w-0",children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:481:16","data-hercules-name":"div",className:m("w-8 h-8 rounded-lg flex items-center justify-center shrink-0",V?"bg-red-50 dark:bg-red-900/20":"bg-emerald-50 dark:bg-emerald-900/20"),children:e.jsx(ls,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:482:18","data-hercules-name":"ShieldCheck",className:m("w-4 h-4",V?"text-red-600 dark:text-red-400":"text-emerald-600 dark:text-emerald-400")})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:484:16","data-hercules-name":"div",className:"min-w-0 flex-1",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:485:18","data-hercules-name":"div",className:"flex items-center gap-2 flex-wrap",children:[e.jsx(J,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:486:20","data-hercules-name":"CardTitle",className:"text-sm",children:"Fire Checks"}),V&&e.jsxs("span",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:488:22","data-hercules-name":"span",className:"text-[10px] px-1.5 py-0.5 rounded-full font-semibold bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400 shrink-0",children:[re," Overdue"]})]}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:493:18","data-hercules-name":"p",className:"text-[11px] text-muted-foreground mt-0.5",children:"Fire safety log · Limes building"})]})]})}),e.jsxs(H,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:497:12","data-hercules-name":"CardContent",className:"flex flex-col flex-1 justify-between gap-2 pt-1",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:498:14","data-hercules-name":"p",className:"text-[11px] text-muted-foreground line-clamp-2",children:"Fire extinguishers, exits, alarms, emergency lights, smoke detectors and risk assessments."}),e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:499:14","data-hercules-name":"Button",className:m("w-full",V&&"bg-red-600 hover:bg-red-700 text-white"),size:"sm",children:V?"Complete â Overdue":"Open Fire Checks"})]})]})]});const N=he.find(u=>u.formType===f);if(!N)return null;const L=s[N.formType]??!1,x=a.has(N.formType),w=L||x,I=Bs(N.formType);return e.jsxs(z,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:516:6","data-hercules-name":"Card",className:m("relative flex flex-col hover:shadow-md transition-shadow w-full h-full py-3",w&&"ring-2 ring-red-500",c&&"shadow-xl"),children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:517:8","data-hercules-name":"div",...E,className:"absolute top-2 right-2 z-10 p-1 rounded cursor-grab active:cursor-grabbing text-muted-foreground hover:text-foreground opacity-40 hover:opacity-100 transition-opacity",onClick:u=>u.stopPropagation(),children:e.jsx(P,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:522:10","data-hercules-name":"GripVertical",className:"w-4 h-4"})}),e.jsx(Y,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:524:8","data-hercules-name":"CardHeader",className:"pb-1 pt-0",children:e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:525:10","data-hercules-name":"div",className:"flex items-start gap-2.5 min-w-0",children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:526:12","data-hercules-name":"div",className:m("w-8 h-8 rounded-lg flex items-center justify-center shrink-0",w?"bg-red-50 dark:bg-red-900/20":"bg-lime-50 dark:bg-lime-900/20"),children:e.jsx(I,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:527:14","data-hercules-name":"FormIcon",className:m("w-4 h-4",w?"text-red-600 dark:text-red-400":"text-lime-600 dar
49k:text-lime-400")})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:529:12","data-hercules-name":"div",className:"min-w-0 flex-1 pr-6",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:530:14","data-hercules-name":"div",className:"flex items-center gap-2 flex-wrap",children:[e.jsx(J,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:531:16","data-hercules-name":"CardTitle",className:"text-sm",children:N.title}),L&&e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:533:18","data-hercules-name":"span",className:"text-[10px] px-1.5 py-0.5 rounded-full font-semibold bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400 shrink-0",children:"In Progress"}),x&&!L&&e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:538:18","data-hercules-name":"span",className:"text-[10px] px-1.5 py-0.5 rounded-full font-semibold bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400 shrink-0",children:"OVERDUE"})]}),e.jsxs("p",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:543:14","data-hercules-name":"p",className:"text-[11px] text-muted-foreground mt-0.5",children:[N.sections.length," section",N.sections.length!==1?"s":""," ·"," ",Fs(N)," questions"]})]})]})}),e.jsxs(H,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:550:8","data-hercules-name":"CardContent",className:"flex flex-col flex-1 justify-between gap-2 pt-1",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:551:10","data-hercules-name":"p",className:"text-[11px] text-muted-foreground line-clamp-2",children:N.description}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:552:10","data-hercules-name":"div",className:"flex flex-col gap-1.5 mt-auto",children:[e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:553:12","data-hercules-name":"Button",className:m("w-full",w&&"bg-red-600 hover:bg-red-700 text-white"),size:"sm",onClick:()=>k(N),children:L?"Continue â In Progress":x?"Complete â Overdue":"Complete Form"}),e.jsx(_,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:560:12","data-hercules-name":"Button",variant:"secondary",size:"sm",className:"w-full",onClick:()=>v(N),children:"View Submissions"})]})]})]})};return e.jsx(Te,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:570:4","data-hercules-name":"DndContext",sensors:le,collisionDetection:Be,onDragEnd:de,children:e.jsx(Fe,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:571:6","data-hercules-name":"SortableContext",items:h,strategy:ts,children:e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:572:8","data-hercules-name":"div",className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:h.map(f=>e.jsx(Xs,{"data-hercules-id":"src/pages/forms/limes/_components/limes-card-grid.tsx:574:12","data-hercules-name":"SortableCardWrapper",id:f,children:(E,c)=>oe(f,E,c)},f))})})})}function Ks({formsInProgress:s,onBack:a,onFill:n,onViewSubmissions:i}){const l=W.map(t=>t.reg),r=O(C.vehicleServiceStatus.getWeeklyStatus,{vehicleRegs:l});return e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:30:4","data-hercules-name":"div",className:"p-6 max-w-5xl mx-auto space-y-5",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:31:6","data-hercules-name":"div",className:"flex items-center gap-3",children:[e.jsx("button",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:32:8","data-hercules-name":"button",onClick:a,className:"p-1.5 rounded-lg hover:bg-accent cursor-pointer",children:e.jsx(ee,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:36:10","data-hercules-name":"ArrowLeft",className:"w-4 h-4"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:38:8","data-hercules-name":"div",children:[e.jsx("h1",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:39:10","data-hercules-name":"h1",className:"text-2xl font-bold",children:"Vehicle Service Jobs"}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:40:10","data-hercules-name":"p",className:"text-muted-foreground text-sm",children:"Select a vehicle to begin or view its weekly service check"})]})]}),r&&e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:46:8","data-hercules-name":"div",className:"flex items-center gap-3 p-3 rounded-xl border bg-card",children:e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:47:10","data-hercules-name":"div",className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:48:12","data-hercules-name":"span",className:"font-medium",children:"This week:"}),e.jsxs("span",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:49:12","data-hercules-name":"span",className:"text-green-600 dark:text-green-400 font-semibold",children:[Object.values(r).filter(t=>t.serviced).length," done"]}),e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:52:12","data-hercules-name":"span",className:"text-muted-foreground",children:"/"}),e.jsxs("span",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:53:12","data-hercules-name":"span",className:"text-red-600 dark:text-red-400 font-semibold",children:[Object.values(r).filter(t=>!t.serviced).length," pending"]})]})}),e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:60:6","data-hercules-name":"div",className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:W.map(t=>{const p=Ue(t),k=s[p.formType]??!1,v=r?.[t.reg],h=v&&!v.serviced;return e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:68:12","data-hercules-name":"div",className:m("group relative overflow-hidden rounded-2xl border bg-card shadow-sm hover:shadow-xl hover:-translate-y-1 transition-all duration-200 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",h&&"ring-2 ring-red-500",k&&!h&&"ring-2 ring-orange-500"),children:[h&&e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:78:16","data-hercules-name":"div",className:"absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-0.5 rounded-full bg-red-600 text-white text-[10px] font-bold uppercase tracking-wide shadow-sm",children:[e.jsx(Xe,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:79:18","data-hercules-name":"AlertCircle",className:"w-3 h-3"}),"Pending"]}),v?.serviced&&e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:86:16","data-hercules-name":"div",className:"absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-600 text-white text-[10px] font-bold uppercase tracking-wide shadow-sm",children:[e.jsx($,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:87:18","data-hercules-name":"CheckCircle2",className:"w-3 h-3"}),"Done"]}),e.jsxs("button",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:92:14","data-hercules-name":"button",onClick:()=>n(p),className:"w-full cursor-pointer text-left",children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:96:16","data-hercules-name":"div",className:"aspect-[4/3] overflow-hidden bg-muted/30 flex items-center justify-center p-2",children:e.jsx("img",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:97:18","data-hercules-name":"img",loading:"lazy",src:t.img,alt:`${t.name} ${t.reg}`,className:"w-full h-full object-contain group-hover:scale-105 transition-transform duration-300"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:104:16","data-hercules-name":"div",className:"p-3 pb-1",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:105:18","data-hercules-name":"div",className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:106:20","data-hercules-name":"p",className:"font-semibold text-sm leading-tight",children:t.name}),k&&e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:108:22","data-hercules-name":"span",className:"text-[10px] px-1.5 py-0.5 rounded-full font-semibold bg-orange-100 text-orange-700 dark:bg-orange-900/40 dark:text-orange-400 shrink-0",children:"Draft"})]}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:113:18","data-hercules-name":"p",className:"text-xs text-muted-foreground font-mono mt-0.5",children:t.reg})]})]}),e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:118:14","data-hercules-name":"div",className:"px-3 pb-3",children:e.jsxs("button",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:119:16","data-hercules-name":"button",onClick:()=>i(p),className:"w-full flex items-center justify-center gap-1.5 py-1.5 rounded-lg text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-accent border border-border transition-colors cursor-pointer",children:[e.jsx(we,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:123:18","data-hercules-name":"Eye",className:"w-3 h-3"}),"View Submissions"]})}),e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:128:14","data-hercules-name":"div",className:m("absolute inset-0 transition-colors duration-200 rounded-2xl pointer-events-none",h?"bg-red-500/5":"bg-lime-500/0 group-hover:bg-lime-500/5")})]},t.reg)}
49)}),e.jsxs("p",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:136:6","data-hercules-name":"p",className:"text-sm text-muted-foreground text-center pt-2",children:["Vehicles marked ",e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:137:24","data-hercules-name":"span",className:"text-red-600 font-semibold",children:"Pending"})," have not been serviced this week. Once a submission is completed for the current week, status resets to ",e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:137:188","data-hercules-name":"span",className:"text-green-600 font-semibold",children:"Done"}),"."]})]})}function Gs({formsInProgress:s,onBack:a,onFill:n,onViewSubmissions:i}){const l=pe.map(t=>t.reg),r=O(C.vehicleDeepCleanStatus.getDeepCleanStatus,{vehicleRegs:l});return e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:158:4","data-hercules-name":"div",className:"p-6 max-w-5xl mx-auto space-y-5",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:159:6","data-hercules-name":"div",className:"flex items-center gap-3",children:[e.jsx("button",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:160:8","data-hercules-name":"button",onClick:a,className:"p-1.5 rounded-lg hover:bg-accent cursor-pointer",children:e.jsx(ee,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:164:10","data-hercules-name":"ArrowLeft",className:"w-4 h-4"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:166:8","data-hercules-name":"div",children:[e.jsx("h1",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:167:10","data-hercules-name":"h1",className:"text-2xl font-bold",children:"Vehicle Deep Clean Log"}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:168:10","data-hercules-name":"p",className:"text-muted-foreground text-sm",children:"Select an ambulance to log a deep clean and ozone treatment (4-month cycle)"})]})]}),r&&e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:174:8","data-hercules-name":"div",className:"flex items-center gap-3 p-3 rounded-xl border bg-card",children:e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:175:10","data-hercules-name":"div",className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:176:12","data-hercules-name":"span",className:"font-medium",children:"4-month status:"}),e.jsxs("span",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:177:12","data-hercules-name":"span",className:"text-green-600 dark:text-green-400 font-semibold",children:[Object.values(r).filter(t=>t.cleaned).length," up to date"]}),e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:180:12","data-hercules-name":"span",className:"text-muted-foreground",children:"/"}),e.jsxs("span",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:181:12","data-hercules-name":"span",className:"text-red-600 dark:text-red-400 font-semibold",children:[Object.values(r).filter(t=>!t.cleaned).length," overdue"]})]})}),e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:188:6","data-hercules-name":"div",className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:pe.map(t=>{const p=Ke(t),k=s[p.formType]??!1,v=r?.[t.reg],h=v&&!v.cleaned;return e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:196:12","data-hercules-name":"div",className:m("group relative overflow-hidden rounded-2xl border bg-card shadow-sm hover:shadow-xl hover:-translate-y-1 transition-all duration-200 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",h&&"ring-2 ring-red-500",k&&!h&&"ring-2 ring-orange-500"),children:[h&&e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:206:16","data-hercules-name":"div",className:"absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-0.5 rounded-full bg-red-600 text-white text-[10px] font-bold uppercase tracking-wide shadow-sm",children:[e.jsx(Xe,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:207:18","data-hercules-name":"AlertCircle",className:"w-3 h-3"}),"Overdue"]}),v?.cleaned&&e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:214:16","data-hercules-name":"div",className:"absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-600 text-white text-[10px] font-bold uppercase tracking-wide shadow-sm",children:[e.jsx($,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:215:18","data-hercules-name":"CheckCircle2",className:"w-3 h-3"}),v.daysRemaining!==null&&v.daysRemaining>30?`${Math.ceil(v.daysRemaining/30)}mo left`:`${v.daysRemaining}d left`]}),e.jsxs("button",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:222:14","data-hercules-name":"button",onClick:()=>n(p),className:"w-full cursor-pointer text-left",children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:226:16","data-hercules-name":"div",className:"aspect-[4/3] overflow-hidden bg-muted/30 flex items-center justify-center p-2",children:e.jsx("img",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:227:18","data-hercules-name":"img",loading:"lazy",src:t.img,alt:`${t.name} ${t.reg}`,className:"w-full h-full object-contain group-hover:scale-105 transition-transform duration-300"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:234:16","data-hercules-name":"div",className:"p-3 pb-1",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:235:18","data-hercules-name":"div",className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:236:20","data-hercules-name":"p",className:"font-semibold text-sm leading-tight",children:t.name}),k&&e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:238:22","data-hercules-name":"span",className:"text-[10px] px-1.5 py-0.5 rounded-full font-semibold bg-orange-100 text-orange-700 dark:bg-orange-900/40 dark:text-orange-400 shrink-0",children:"Draft"})]}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:243:18","data-hercules-name":"p",className:"text-xs text-muted-foreground font-mono mt-0.5",children:t.reg}),v?.lastCleanTime&&e.jsxs("p",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:245:20","data-hercules-name":"p",className:"text-[10px] text-muted-foreground mt-0.5",children:["Last cleaned: ",R(new Date(v.lastCleanTime),"dd MMM yyyy")]})]})]}),e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:253:14","data-hercules-name":"div",className:"px-3 pb-3",children:e.jsxs("button",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:254:16","data-hercules-name":"button",onClick:()=>i(p),className:"w-full flex items-center justify-center gap-1.5 py-1.5 rounded-lg text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-accent border border-border transition-colors cursor-pointer",children:[e.jsx(we,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:258:18","data-hercules-name":"Eye",className:"w-3 h-3"}),"View Submissions"]})}),e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:263:14","data-hercules-name":"div",className:m("absolute inset-0 transition-colors duration-200 rounded-2xl pointer-events-none",h?"bg-red-500/5":"bg-purple-500/0 group-hover:bg-purple-500/5")})]},t.reg)}
49)}),e.jsxs("p",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:271:6","data-hercules-name":"p",className:"text-sm text-muted-foreground text-center pt-2",children:["Vehicles marked ",e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:272:24","data-hercules-name":"span",className:"text-red-600 font-semibold",children:"Overdue"})," have not been deep cleaned in 4+ months. The timer starts immediately after the first deep clean is logged."]})]})}function Us({formsInProgress:s,onBack:a,onFill:n,onViewSubmissions:i}){return e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:290:4","data-hercules-name":"div",className:"p-6 max-w-5xl mx-auto space-y-5",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:291:6","data-hercules-name":"div",className:"flex items-center gap-3",children:[e.jsx("button",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:292:8","data-hercules-name":"button",onClick:a,className:"p-1.5 rounded-lg hover:bg-accent cursor-pointer",children:e.jsx(ee,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:296:10","data-hercules-name":"ArrowLeft",className:"w-4 h-4"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:298:8","data-hercules-name":"div",children:[e.jsx("h1",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:299:10","data-hercules-name":"h1",className:"text-2xl font-bold",children:"Annual Vehicle Servicing"}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:300:10","data-hercules-name":"p",className:"text-muted-foreground text-sm",children:"Gold service (24,000 miles / 24 months) â select a vehicle to begin or view its annual service record"})]})]}),e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:304:6","data-hercules-name":"div",className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:W.map(l=>{const r=Ge(l),t=s[r.formType]??!1;return e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:310:12","data-hercules-name":"div",className:m("group relative overflow-hidden rounded-2xl border bg-card shadow-sm hover:shadow-xl hover:-translate-y-1 transition-all duration-200 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",t&&"ring-2 ring-orange-500"),children:[e.jsxs("button",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:317:14","data-hercules-name":"button",onClick:()=>n(r),className:"w-full cursor-pointer text-left",children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:321:16","data-hercules-name":"div",className:"aspect-[4/3] overflow-hidden bg-muted/30 flex items-center justify-center p-2",children:e.jsx("img",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:322:18","data-hercules-name":"img",loading:"lazy",src:l.img,alt:`${l.name} ${l.reg}`,className:"w-full h-full object-contain group-hover:scale-105 transition-transform duration-300"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:329:16","data-hercules-name":"div",className:"p-3 pb-1",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:330:18","data-hercules-name":"div",className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:331:20","data-hercules-name":"p",className:"font-semibold text-sm leading-tight",children:l.name}),t&&e.jsx("span",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:333:22","data-hercules-name":"span",className:"text-[10px] px-1.5 py-0.5 rounded-full font-semibold bg-orange-100 text-orange-700 dark:bg-orange-900/40 dark:text-orange-400 shrink-0",children:"Draft"})]}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:338:18","data-hercules-name":"p",className:"text-xs text-muted-foreground font-mono mt-0.5",children:l.reg})]})]}),e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:343:14","data-hercules-name":"div",className:"px-3 pb-3",children:e.jsxs("button",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:344:16","data-hercules-name":"button",onClick:()=>i(r),className:"w-full flex items-center justify-center gap-1.5 py-1.5 rounded-lg text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-accent border border-border transition-colors cursor-pointer",children:[e.jsx(we,{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:348:18","data-hercules-name":"Eye",className:"w-3 h-3"}),"View Submissions"]})}),e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:353:14","data-hercules-name":"div",className:"absolute inset-0 transition-colors duration-200 rounded-2xl pointer-events-none bg-blue-500/0 group-hover:bg-blue-500/5"})]},l.reg)})}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/_components/vehicle-pickers.tsx:358:6","data-hercules-name":"p",className:"text-sm text-muted-foreground text-center pt-2",children:"Annual service items are done once per year. Each form includes 60 checks from the Bosch Gold service schedule with mileage and date recorded."})]})}Is();function Qs(){const[s,a]=j.useState({type:"list"}),[n,i]=j.useState(!1),[l,r]=j.useState(!1),[t,p]=j.useState(!1),k={limes_weekly_maintenance:7,limes_monthly_maintenance:30,limes_annual_maintenance:365,limes_medic_bag_check:7},v=he.map(g=>g.formType),h=O(C.forms.getLatestByFormTypes,{formTypes:v}),b=O(C.forms.getSharedDraftsWithProgress,{}),o=j.useMemo(()=>{const g=new Set;if(!h)return g;const q=Date.now();for(const A of he){const M=k[A.formType];if(!M)continue;const D=h[A.formType];D?(q-D)/864e5>M&&g.add(A.formType):g.add(A.formType)}return g},[h]),y=j.useMemo(()=>b??{},[b]),d=g=>a(g==="vehicle-picker"?{type:"vehicle-picker"}:g==="deep-clean-picker"?{type:"deep-clean-picker"}:g==="annual-service-picker"?{type:"annual-service-picker"}:{type:"list"});return s.type==="fill"?e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/page.tsx:87:6","data-hercules-name":"div",className:"p-6 max-w-3xl mx-auto
49space-y-5",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/page.tsx:88:8","data-hercules-name":"div",className:"flex items-center gap-3",children:[e.jsx("button",{"data-hercules-id":"src/pages/forms/limes/page.tsx:89:10","data-hercules-name":"button",onClick:()=>d(s.backTo),className:"p-1.5 rounded-lg hover:bg-accent cursor-pointer",children:e.jsx(ee,{"data-hercules-id":"src/pages/forms/limes/page.tsx:93:12","data-hercules-name":"ArrowLeft",className:"w-4 h-4"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/page.tsx:95:10","data-hercules-name":"div",children:[e.jsx("h1",{"data-hercules-id":"src/pages/forms/limes/page.tsx:96:12","data-hercules-name":"h1",className:"text-2xl font-bold",children:s.form.title}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/page.tsx:97:12","data-hercules-name":"p",className:"text-muted-foreground text-sm whitespace-pre-line",children:s.form.description})]})]}),e.jsx(Hs,{"data-hercules-id":"src/pages/forms/limes/page.tsx:100:8","data-hercules-name":"FillForm",form:s.form,onClose:()=>d(s.backTo),onSubmitted:()=>a({type:"submissions",form:s.form,backTo:s.backTo})})]}):s.type==="submissions"?e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/page.tsx:111:6","data-hercules-name":"div",className:"p-6 max-w-4xl mx-auto space-y-5",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/page.tsx:112:8","data-hercules-name":"div",className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/page.tsx:113:10","data-hercules-name":"div",className:"flex items-center gap-3",children:[e.jsx("button",{"data-hercules-id":"src/pages/forms/limes/page.tsx:114:12","data-hercules-name":"button",onClick:()=>d(s.backTo),className:"p-1.5 rounded-lg hover:bg-accent cursor-pointer",children:e.jsx(ee,{"data-hercules-id":"src/pages/forms/limes/page.tsx:118:14","data-hercules-name":"ArrowLeft",className:"w-4 h-4"})}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/page.tsx:120:12","data-hercules-name":"div",children:[e.jsxs("h1",{"data-hercules-id":"src/pages/forms/limes/page.tsx:121:14","data-hercules-name":"h1",className:"text-2xl font-bold",children:[s.form.title," â Submissions"]}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/page.tsx:122:14","data-hercules-name":"p",className:"text-muted-foreground text-sm whitespace-pre-line",children:s.form.description})]})]}),e.jsxs(_,{"data-hercules-id":"src/pages/forms/limes/page.tsx:125:10","data-hercules-name":"Button",onClick:()=>a({type:"fill",form:s.form,backTo:s.backTo}),children:[e.jsx(ge,{"data-hercules-id":"src/pages/forms/limes/page.tsx:126:12","data-hercules-name":"Plus",className:"w-4 h-4 mr-1.5"})," Complete Form"]})]}),e.jsx(Js,{"data-hercules-id":"src/pages/forms/limes/page.tsx:129:8","data-hercules-name":"SubmissionList",form:s.form})]}):s.type==="vehicle-picker"?e.jsx(Ks,{"data-hercules-id":"src/pages/forms/limes/page.tsx:137:6","data-hercules-name":"VehiclePickerView",formsInProgress:y,onBack:()=>a({type:"list"}),onFill:g=>a({type:"fill",form:g,backTo:"vehicle-picker"}),onViewSubmissions:g=>a({type:"submissions",form:g,backTo:"vehicle-picker"})}):s.type==="deep-clean-picker"?e.jsx(Gs,{"data-hercules-id":"src/pages/forms/limes/page.tsx:149:6","data-hercules-name":"DeepCleanPickerView",formsInProgress:y,onBack:()=>a({type:"list"}),onFill:g=>a({type:"fill",form:g,backTo:"deep-clean-picker"}),onViewSubmissions:g=>a({type:"submissions",form:g,backTo:"deep-clean-picker"})}):s.type==="annual-service-picker"?e.jsx(Us,{"data-hercules-id":"src/pages/forms/limes/page.tsx:161:6","data-hercules-name":"AnnualServicePickerView",formsInProgress:y,onBack:()=>a({type:"list"}),onFill:g=>a({type:"fill",form:g,backTo:"annual-service-picker"}),onViewSubmissions:g=>a({type:"submissions",form:g,backTo:"annual-service-picker"})}):e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/page.tsx:172:4","data-hercules-name":"div",className:"p-6 max-w-5xl mx-auto space-y-5",children:[e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/page.tsx:173:6","data-hercules-name":"div",className:"flex items-center gap-2",children:[e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/page.tsx:174:8","data-hercules-name":"div",className:"w-2 h-8 rounded-full bg-lime-500"}),e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/page.tsx:175:8","data-hercules-name":"div",children:[e.jsx("h1",{"data-hercules-id":"src/pages/forms/limes/page.tsx:176:10","data-hercules-name":"h1",className:"text-2xl font-bold",children:"Limes Forms"}),e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/page.tsx:177:10","data-hercules-name":"p",className:"text-muted-foreground text-sm mt-0.5",children:"Limes operational documentation and reporting forms"})]})]}),e.jsx(ks,{"data-hercules-id":"src/pages/forms/limes/page.tsx:181:6","data-hercules-name":"SatnavUpdateDialog",open:n,onClose:()=>i(!1)}),e.jsx(qs,{"data-hercules-id":"src/pages/forms/limes/page.tsx:182:6","data-hercules-name":"LolerCheckDialog",open:l,onClose:()=>r(!1)}),e.jsx(Rs,{"data-hercules-id":"src/pages/forms/limes/page.tsx:183:6","data-hercules-name":"VehicleRepairLogDialog",open:t,onClose:()=>p(!1)}),e.jsx(Ws,{"data-hercules-id":"src/pages/forms/limes/page.tsx:185:6","data-hercules-name":"LimesCardGrid",formsInProgress:y,overdueFormTypes:o,onSelectVehicle:()=>a({type:"vehicle-picker"}),onSelectAnnualService:()=>a({type:"annual-service-picker"}),onSelectDeepClean:()=>a({type:"deep-clean-picker"}),onOpenLoler:()=>r(!0),onOpenSatnav:()=>i(!0),onOpenRepairLog:()=>p(!0),onFillForm:g=>a({type:"fill",form:g}),onViewSubmissions:g=>a({type:"submissions",form:g})})]})}function ba(){return e.jsxs(e.Fragment,{children:[e.jsx(is,{"data-hercules-id":"src/pages/forms/limes/page.tsx:204:6","data-hercules-name":"Authenticated",children:e.jsx(Qs,{"data-hercules-id":"src/pages/forms/limes/page.tsx:204:21","data-hercules-name":"LimesFormsInner"})}),e.jsx(ns,{"data-hercules-id":"src/pages/forms/limes/page.tsx:205:6","data-hercules-name":"Unauthenticated",children:e.jsxs("div",{"data-hercules-id":"src/pages/forms/limes/page.tsx:206:8","data-hercules-name":"div",className:"flex flex-col items-center justify-center h-[60vh] gap-4",children:[e.jsx("p",{"data-hercules-id":"src/pages/forms/limes/page.tsx:207:10","data-hercules-name":"p",className:"text-muted-foreground",children:"Sign in to access Limes forms"}),e.jsx(cs,{"data-hercules-id":"src/pages/forms/limes/page.tsx:208:10","data-hercules-name":"SignInButton"})]})}),e.jsx(ds,{"data-hercules-id":"src/pages/forms/limes/page.tsx:211:6","data-hercules-name":"AuthLoading",children:e.jsx("div",{"data-hercules-id":"src/pages/forms/limes/page.tsx:212:8","data-hercules-name":"div",className:"p-6 space-y-4",children:Array.from({length:3}).map((s,a)=>e.jsx(ie,{"data-hercules-id":"src/pages/forms/limes/page.tsx:213:51","data-hercules-name":"Skeleton",className:"h-44 rounded-xl"},a))})})]})}export{ba 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.