@burdenoff/microfe-movethewheels 2026.930.2 → 2026.930.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,31 +7,32 @@ import { Save as a } from "../node_modules/lucide-react/dist/esm/icons/save.js";
7
7
  import { SquarePen as o } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
8
8
  import { Star as s } from "../node_modules/lucide-react/dist/esm/icons/star.js";
9
9
  import { StickyNote as ee } from "../node_modules/lucide-react/dist/esm/icons/sticky-note.js";
10
- import { Truck as te } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
11
- import { UserX as c } from "../node_modules/lucide-react/dist/esm/icons/user-x.js";
12
- import { Users as l } from "../node_modules/lucide-react/dist/esm/icons/users.js";
13
- import { joinPath as u } from "../utils/navigation.js";
14
- import { useMoveTheWheels as ne } from "../providers/MoveTheWheelsProvider.js";
15
- import { toApiDriverStatus as d, useDriver as f, useFleet as p, useVehicle as m, useVehicles as h } from "../hooks/useFleet.js";
16
- import { Button as g, Card as _, CardContent as v, CardHeader as y, CardTitle as b, Input as x, Label as S, Select as C, SelectContent as w, SelectItem as T, SelectTrigger as E, SelectValue as D, Textarea as O } from "../components/ui.js";
17
- import { ErrorState as k, LoadingState as A, PageLayout as j } from "../components/PageLayout.js";
18
- import { DRIVER_STATUS_LABELS as M } from "../constants/index.js";
19
- import { StatusBadge as N } from "../components/StatusBadge.js";
20
- import { FormError as P } from "../components/FormError.js";
21
- import { formatCurrency as F, formatDate as I } from "../utils/formatters.js";
22
- import { DocumentsCard as L } from "../components/DocumentsCard.js";
23
- import { useDebouncedValue as re } from "../hooks/useDebouncedValue.js";
24
- import { EntityCombobox as ie } from "../components/EntityCombobox.js";
25
- import { useRefetchOnLeaveEdit as R } from "../hooks/useRefetchOnLeaveEdit.js";
26
- import { useEffect as ae, useState as z } from "react";
27
- import { useLocation as B, useParams as V } from "react-router";
28
- import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
29
- import { EmphasisPanel as oe, NextSteps as G, PagePurpose as K, ResponsiveDialog as se, ResponsiveDialogContent as ce, ResponsiveDialogDescription as le, ResponsiveDialogFooter as ue, ResponsiveDialogHeader as de, ResponsiveDialogTitle as fe } from "@burdenoff/fe-libs/ui";
10
+ import { Trash2 as c } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
11
+ import { Truck as l } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
12
+ import { UserX as u } from "../node_modules/lucide-react/dist/esm/icons/user-x.js";
13
+ import { Users as d } from "../node_modules/lucide-react/dist/esm/icons/users.js";
14
+ import { joinPath as f } from "../utils/navigation.js";
15
+ import { useMoveTheWheels as te } from "../providers/MoveTheWheelsProvider.js";
16
+ import { toApiDriverStatus as p, useDriver as ne, useFleet as m, useVehicle as re, useVehicles as ie } from "../hooks/useFleet.js";
17
+ import { Button as h, Card as g, CardContent as _, CardHeader as v, CardTitle as y, Input as b, Label as x, Select as S, SelectContent as C, SelectItem as w, SelectTrigger as T, SelectValue as E, Textarea as D } from "../components/ui.js";
18
+ import { ErrorState as ae, LoadingState as O, PageLayout as oe } from "../components/PageLayout.js";
19
+ import { DRIVER_STATUS_LABELS as k } from "../constants/index.js";
20
+ import { StatusBadge as A } from "../components/StatusBadge.js";
21
+ import { FormError as j } from "../components/FormError.js";
22
+ import { formatCurrency as M, formatDate as N } from "../utils/formatters.js";
23
+ import { DocumentsCard as P } from "../components/DocumentsCard.js";
24
+ import { useDebouncedValue as se } from "../hooks/useDebouncedValue.js";
25
+ import { EntityCombobox as ce } from "../components/EntityCombobox.js";
26
+ import { useRefetchOnLeaveEdit as F } from "../hooks/useRefetchOnLeaveEdit.js";
27
+ import { useEffect as le, useState as I } from "react";
28
+ import { useLocation as L, useParams as R } from "react-router";
29
+ import { Fragment as ue, jsx as z, jsxs as B } from "react/jsx-runtime";
30
+ import { EmphasisPanel as de, NextSteps as V, PagePurpose as H, ResponsiveDialog as U, ResponsiveDialogContent as fe, ResponsiveDialogDescription as pe, ResponsiveDialogFooter as me, ResponsiveDialogHeader as he, ResponsiveDialogTitle as ge } from "@burdenoff/fe-libs/ui";
30
31
  //#region src/movethewheels/pages/DriverDetailsPage.tsx
31
- var pe = Object.entries(M).map(([e, t]) => ({
32
+ var _e = Object.entries(k).map(([e, t]) => ({
32
33
  value: e,
33
34
  label: t
34
- })), q = (e) => e ? e.toISOString().slice(0, 10) : "", J = (e) => e ? `${e}T12:00:00.000Z` : void 0, me = {
35
+ })), W = (e) => e ? e.toISOString().slice(0, 10) : "", G = (e) => e ? `${e}T12:00:00.000Z` : void 0, ve = {
35
36
  employeeId: "",
36
37
  firstName: "",
37
38
  lastName: "",
@@ -51,186 +52,197 @@ var pe = Object.entries(M).map(([e, t]) => ({
51
52
  payCurrency: "",
52
53
  onLeaveUntil: ""
53
54
  };
54
- function Y({ editId: t }) {
55
- let { basePath: r, navigate: i } = ne(), { createDriver: o, updateDriver: s } = p(), { driver: k, refetch: A } = f(t), M = !!t, [N, F] = z(me), [L, R] = z(!1), [B, V] = z(null), [G, Y] = z(!1), [X, he] = z(""), [Z, ge] = z(!1), [_e, Q] = z(null), [ve, ye] = z(""), { vehicles: be, isLoading: xe, isLoadingMore: Se, hasMore: Ce, totalVehicles: we, loadMore: Te } = h({
55
+ function K({ editId: t }) {
56
+ let { basePath: r, navigate: i } = te(), { createDriver: o, updateDriver: s, deleteDriver: ae } = m(), { driver: O, refetch: k } = ne(t), A = !!t, [M, P] = I(ve), [F, L] = I(!1), [R, V] = I(null), [K, q] = I(!1), [J, ye] = I(""), [Y, be] = I(!1), [xe, X] = I(null), [Se, Z] = I(!1), [Q, Ce] = I(!1), [we, Te] = I(null), [Ee, De] = I(""), { vehicles: Oe, isLoading: ke, isLoadingMore: Ae, hasMore: je, totalVehicles: Me, loadMore: Ne } = ie({
56
57
  limit: 20,
57
- search: re(ve) || void 0
58
- }), { vehicle: Ee, isLoading: De } = m(N.vehicleId || void 0);
59
- ae(() => {
60
- if (!t || !k) return;
61
- let [e, ...n] = k.fullName.trim().split(/\s+/);
62
- F({
63
- employeeId: k.employeeId || "",
58
+ search: se(Ee) || void 0
59
+ }), { vehicle: Pe, isLoading: Fe } = re(M.vehicleId || void 0);
60
+ le(() => {
61
+ if (!t || !O) return;
62
+ let [e, ...n] = O.fullName.trim().split(/\s+/);
63
+ P({
64
+ employeeId: O.employeeId || "",
64
65
  firstName: e || "",
65
66
  lastName: n.join(" "),
66
- email: k.email || "",
67
- phone: k.phone || "",
68
- licenseNumber: k.licenseNumber || "",
69
- licenseClass: k.licenseType || "",
70
- licenseExpiry: q(k.licenseExpiry),
71
- status: k.status,
72
- vehicleId: k.assignedVehicle || "",
73
- vehicleIds: k.vehicleIds,
74
- rating: k.rating ? String(k.rating) : "",
75
- notes: k.notes || "",
76
- hireDate: q(k.hireDate),
77
- baseSalary: k.baseSalary === void 0 ? "" : String(k.baseSalary),
78
- bonusYtd: k.bonusYtd === void 0 ? "" : String(k.bonusYtd),
79
- payCurrency: k.payCurrency || "",
80
- onLeaveUntil: q(k.onLeaveUntil)
67
+ email: O.email || "",
68
+ phone: O.phone || "",
69
+ licenseNumber: O.licenseNumber || "",
70
+ licenseClass: O.licenseType || "",
71
+ licenseExpiry: W(O.licenseExpiry),
72
+ status: O.status,
73
+ vehicleId: O.assignedVehicle || "",
74
+ vehicleIds: O.vehicleIds,
75
+ rating: O.rating ? String(O.rating) : "",
76
+ notes: O.notes || "",
77
+ hireDate: W(O.hireDate),
78
+ baseSalary: O.baseSalary === void 0 ? "" : String(O.baseSalary),
79
+ bonusYtd: O.bonusYtd === void 0 ? "" : String(O.bonusYtd),
80
+ payCurrency: O.payCurrency || "",
81
+ onLeaveUntil: W(O.onLeaveUntil)
81
82
  });
82
- }, [t, k]);
83
- let Oe = () => i?.(u(r, "fleet/drivers")), $ = (e = !0) => ({
84
- firstName: N.firstName.trim(),
85
- lastName: N.lastName.trim(),
86
- email: N.email.trim() || void 0,
87
- phone: N.phone.trim() || void 0,
88
- licenseNumber: N.licenseNumber.trim() || void 0,
89
- licenseClass: N.licenseClass.trim() || void 0,
90
- licenseExpiry: J(N.licenseExpiry),
91
- status: d(N.status),
92
- vehicleId: N.vehicleId || null,
93
- vehicleIds: N.vehicleIds,
94
- rating: N.rating.trim() ? Number(N.rating) : void 0,
95
- notes: N.notes.trim() || void 0,
96
- hireDate: J(N.hireDate),
97
- baseSalary: N.baseSalary.trim() ? Number(N.baseSalary) : void 0,
98
- bonusYtd: N.bonusYtd.trim() ? Number(N.bonusYtd) : void 0,
99
- payCurrency: N.payCurrency.trim() || void 0,
100
- ...e ? { onLeaveUntil: J(N.onLeaveUntil) ?? null } : {}
101
- }), ke = () => ({
102
- employeeId: N.employeeId.trim(),
83
+ }, [t, O]);
84
+ let Ie = () => i?.(f(r, "fleet/drivers")), $ = (e = !0) => ({
85
+ firstName: M.firstName.trim(),
86
+ lastName: M.lastName.trim(),
87
+ email: M.email.trim() || void 0,
88
+ phone: M.phone.trim() || void 0,
89
+ licenseNumber: M.licenseNumber.trim() || void 0,
90
+ licenseClass: M.licenseClass.trim() || void 0,
91
+ licenseExpiry: G(M.licenseExpiry),
92
+ status: p(M.status),
93
+ vehicleId: M.vehicleId || null,
94
+ vehicleIds: M.vehicleIds,
95
+ rating: M.rating.trim() ? Number(M.rating) : void 0,
96
+ notes: M.notes.trim() || void 0,
97
+ hireDate: G(M.hireDate),
98
+ baseSalary: M.baseSalary.trim() ? Number(M.baseSalary) : void 0,
99
+ bonusYtd: M.bonusYtd.trim() ? Number(M.bonusYtd) : void 0,
100
+ payCurrency: M.payCurrency.trim() || void 0,
101
+ ...e ? { onLeaveUntil: G(M.onLeaveUntil) ?? null } : {}
102
+ }), Le = () => ({
103
+ employeeId: M.employeeId.trim(),
103
104
  ...$(!1)
104
- }), Ae = async (e) => {
105
- if (e.preventDefault(), !N.employeeId.trim() || !N.firstName.trim() || !N.lastName.trim()) {
105
+ }), Re = async (e) => {
106
+ if (e.preventDefault(), !M.employeeId.trim() || !M.firstName.trim() || !M.lastName.trim()) {
106
107
  V("Employee ID, first name and last name are required.");
107
108
  return;
108
109
  }
109
- if (!N.phone.trim()) {
110
+ if (!M.phone.trim()) {
110
111
  V("Phone is required so this driver can be reached.");
111
112
  return;
112
113
  }
113
- R(!0), V(null);
114
+ L(!0), V(null);
114
115
  try {
115
116
  if (t) {
116
117
  let e = await s(t, $());
117
- i?.(u(r, `fleet/drivers/${e.id}`));
118
+ i?.(f(r, `fleet/drivers/${e.id}`));
118
119
  } else {
119
- let e = await o(ke());
120
- i?.(u(r, `fleet/drivers/${e.id}`));
120
+ let e = await o(Le());
121
+ i?.(f(r, `fleet/drivers/${e.id}`));
121
122
  }
122
123
  } catch (e) {
123
- console.error("Failed to save driver:", e), V(e instanceof Error ? e.message : "Failed to save driver. Please try again."), R(!1);
124
+ console.error("Failed to save driver:", e), V(e instanceof Error ? e.message : "Failed to save driver. Please try again."), L(!1);
124
125
  }
125
- }, je = async () => {
126
- if (!t || !X.trim()) {
127
- Q("A reason is required to dismiss a driver.");
126
+ }, ze = async () => {
127
+ if (!t || !J.trim()) {
128
+ X("A reason is required to dismiss a driver.");
128
129
  return;
129
130
  }
130
- ge(!0), Q(null);
131
+ be(!0), X(null);
131
132
  try {
132
133
  await s(t, {
133
134
  ...$(),
134
135
  terminatedAt: (/* @__PURE__ */ new Date()).toISOString(),
135
- terminationReason: X.trim()
136
- }), Y(!1), await A(), i?.(u(r, `fleet/drivers/${t}`));
136
+ terminationReason: J.trim()
137
+ }), q(!1), await k(), i?.(f(r, `fleet/drivers/${t}`));
137
138
  } catch (e) {
138
- Q(e instanceof Error ? e.message : "Failed to dismiss driver.");
139
+ X(e instanceof Error ? e.message : "Failed to dismiss driver.");
139
140
  } finally {
140
- ge(!1);
141
+ be(!1);
141
142
  }
142
- }, Me = M && !!k?.terminatedAt;
143
- return /* @__PURE__ */ W(j, {
144
- title: M ? "Edit Driver" : "Add Driver",
143
+ }, Be = async () => {
144
+ if (t) {
145
+ Ce(!0), Te(null);
146
+ try {
147
+ await ae(t), Z(!1), i?.(f(r, "fleet/drivers"));
148
+ } catch (e) {
149
+ Te(e instanceof Error ? e.message : "Failed to delete driver.");
150
+ } finally {
151
+ Ce(!1);
152
+ }
153
+ }
154
+ }, Ve = A && !!O?.terminatedAt;
155
+ return /* @__PURE__ */ B(oe, {
156
+ title: A ? "Edit Driver" : "Add Driver",
145
157
  subtitle: "Add a driver to your workforce",
146
- icon: /* @__PURE__ */ U(l, { size: 24 }),
147
- headerActions: /* @__PURE__ */ W("div", {
158
+ icon: /* @__PURE__ */ z(d, { size: 24 }),
159
+ headerActions: /* @__PURE__ */ B("div", {
148
160
  className: "flex gap-2",
149
- children: [/* @__PURE__ */ W(g, {
161
+ children: [/* @__PURE__ */ B(h, {
150
162
  variant: "outline",
151
- onClick: Oe,
152
- disabled: L,
153
- children: [/* @__PURE__ */ U(e, { size: 16 }), " Cancel"]
154
- }), /* @__PURE__ */ W(g, {
155
- onClick: Ae,
156
- disabled: L,
163
+ onClick: Ie,
164
+ disabled: F,
165
+ children: [/* @__PURE__ */ z(e, { size: 16 }), " Cancel"]
166
+ }), /* @__PURE__ */ B(h, {
167
+ onClick: Re,
168
+ disabled: F,
157
169
  children: [
158
- /* @__PURE__ */ U(a, { size: 16 }),
170
+ /* @__PURE__ */ z(a, { size: 16 }),
159
171
  " ",
160
- M ? L ? "Saving..." : "Save Changes" : L ? "Saving..." : "Add Driver"
172
+ A ? F ? "Saving..." : "Save Changes" : F ? "Saving..." : "Add Driver"
161
173
  ]
162
174
  })]
163
175
  }),
164
176
  children: [
165
- /* @__PURE__ */ U(K, {
166
- icon: /* @__PURE__ */ U(l, { size: 18 }),
177
+ /* @__PURE__ */ z(H, {
178
+ icon: /* @__PURE__ */ z(d, { size: 18 }),
167
179
  children: "Add a driver so they can be assigned to orders and routes. An employee ID, name and phone get them on the roster — add licensing, a vehicle and HR details to keep the record complete."
168
180
  }),
169
- Me && k?.terminatedAt && /* @__PURE__ */ W("div", {
181
+ Ve && O?.terminatedAt && /* @__PURE__ */ B("div", {
170
182
  className: "rounded-card border border-status-error-border bg-status-error-bg-subtle p-4 text-sm text-status-error-text",
171
- children: [/* @__PURE__ */ W("p", {
183
+ children: [/* @__PURE__ */ B("p", {
172
184
  className: "font-medium",
173
185
  children: [
174
186
  "This driver was dismissed on ",
175
- I(k.terminatedAt, "full"),
187
+ N(O.terminatedAt, "full"),
176
188
  "."
177
189
  ]
178
- }), k.terminationReason && /* @__PURE__ */ W("p", {
190
+ }), O.terminationReason && /* @__PURE__ */ B("p", {
179
191
  className: "mt-1",
180
- children: ["Reason: ", k.terminationReason]
192
+ children: ["Reason: ", O.terminationReason]
181
193
  })]
182
194
  }),
183
- /* @__PURE__ */ W("form", {
184
- onSubmit: Ae,
195
+ /* @__PURE__ */ B("form", {
196
+ onSubmit: Re,
185
197
  className: "max-w-3xl space-y-6",
186
198
  children: [
187
- /* @__PURE__ */ U(P, { message: B }),
188
- /* @__PURE__ */ W(oe, { children: [/* @__PURE__ */ U("h2", {
199
+ /* @__PURE__ */ z(j, { message: R }),
200
+ /* @__PURE__ */ B(de, { children: [/* @__PURE__ */ z("h2", {
189
201
  className: "text-base font-semibold text-text-primary mb-4",
190
202
  children: "Driver Details"
191
- }), /* @__PURE__ */ W("div", {
203
+ }), /* @__PURE__ */ B("div", {
192
204
  className: "space-y-4",
193
205
  children: [
194
- /* @__PURE__ */ W("div", {
206
+ /* @__PURE__ */ B("div", {
195
207
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
196
208
  children: [
197
- /* @__PURE__ */ W("div", {
209
+ /* @__PURE__ */ B("div", {
198
210
  className: "space-y-2",
199
- children: [/* @__PURE__ */ W(S, {
211
+ children: [/* @__PURE__ */ B(x, {
200
212
  htmlFor: "employeeId",
201
213
  children: [
202
214
  "Employee ID ",
203
- M ? "(immutable)" : "",
215
+ A ? "(immutable)" : "",
204
216
  " ",
205
- /* @__PURE__ */ U("span", {
217
+ /* @__PURE__ */ z("span", {
206
218
  className: "text-status-error-text",
207
- children: !M && "*"
219
+ children: !A && "*"
208
220
  })
209
221
  ]
210
- }), /* @__PURE__ */ U(x, {
222
+ }), /* @__PURE__ */ z(b, {
211
223
  id: "employeeId",
212
- value: N.employeeId,
213
- onChange: (e) => F((t) => ({
224
+ value: M.employeeId,
225
+ onChange: (e) => P((t) => ({
214
226
  ...t,
215
227
  employeeId: e.target.value
216
228
  })),
217
229
  placeholder: "EMP-001",
218
230
  required: !0,
219
- disabled: M
231
+ disabled: A
220
232
  })]
221
233
  }),
222
- /* @__PURE__ */ W("div", {
234
+ /* @__PURE__ */ B("div", {
223
235
  className: "space-y-2",
224
- children: [/* @__PURE__ */ W(S, {
236
+ children: [/* @__PURE__ */ B(x, {
225
237
  htmlFor: "firstName",
226
- children: ["First Name ", /* @__PURE__ */ U("span", {
238
+ children: ["First Name ", /* @__PURE__ */ z("span", {
227
239
  className: "text-status-error-text",
228
240
  children: "*"
229
241
  })]
230
- }), /* @__PURE__ */ U(x, {
242
+ }), /* @__PURE__ */ z(b, {
231
243
  id: "firstName",
232
- value: N.firstName,
233
- onChange: (e) => F((t) => ({
244
+ value: M.firstName,
245
+ onChange: (e) => P((t) => ({
234
246
  ...t,
235
247
  firstName: e.target.value
236
248
  })),
@@ -238,18 +250,18 @@ function Y({ editId: t }) {
238
250
  required: !0
239
251
  })]
240
252
  }),
241
- /* @__PURE__ */ W("div", {
253
+ /* @__PURE__ */ B("div", {
242
254
  className: "space-y-2",
243
- children: [/* @__PURE__ */ W(S, {
255
+ children: [/* @__PURE__ */ B(x, {
244
256
  htmlFor: "lastName",
245
- children: ["Last Name ", /* @__PURE__ */ U("span", {
257
+ children: ["Last Name ", /* @__PURE__ */ z("span", {
246
258
  className: "text-status-error-text",
247
259
  children: "*"
248
260
  })]
249
- }), /* @__PURE__ */ U(x, {
261
+ }), /* @__PURE__ */ z(b, {
250
262
  id: "lastName",
251
- value: N.lastName,
252
- onChange: (e) => F((t) => ({
263
+ value: M.lastName,
264
+ onChange: (e) => P((t) => ({
253
265
  ...t,
254
266
  lastName: e.target.value
255
267
  })),
@@ -259,37 +271,37 @@ function Y({ editId: t }) {
259
271
  })
260
272
  ]
261
273
  }),
262
- /* @__PURE__ */ W("div", {
274
+ /* @__PURE__ */ B("div", {
263
275
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
264
276
  children: [
265
- /* @__PURE__ */ W("div", {
277
+ /* @__PURE__ */ B("div", {
266
278
  className: "space-y-2",
267
- children: [/* @__PURE__ */ U(S, {
279
+ children: [/* @__PURE__ */ z(x, {
268
280
  htmlFor: "email",
269
281
  children: "Email"
270
- }), /* @__PURE__ */ U(x, {
282
+ }), /* @__PURE__ */ z(b, {
271
283
  id: "email",
272
284
  type: "email",
273
- value: N.email,
274
- onChange: (e) => F((t) => ({
285
+ value: M.email,
286
+ onChange: (e) => P((t) => ({
275
287
  ...t,
276
288
  email: e.target.value
277
289
  })),
278
290
  placeholder: "jane.doe@example.com"
279
291
  })]
280
292
  }),
281
- /* @__PURE__ */ W("div", {
293
+ /* @__PURE__ */ B("div", {
282
294
  className: "space-y-2",
283
- children: [/* @__PURE__ */ W(S, {
295
+ children: [/* @__PURE__ */ B(x, {
284
296
  htmlFor: "phone",
285
- children: ["Phone ", /* @__PURE__ */ U("span", {
297
+ children: ["Phone ", /* @__PURE__ */ z("span", {
286
298
  className: "text-status-error-text",
287
299
  children: "*"
288
300
  })]
289
- }), /* @__PURE__ */ U(x, {
301
+ }), /* @__PURE__ */ z(b, {
290
302
  id: "phone",
291
- value: N.phone,
292
- onChange: (e) => F((t) => ({
303
+ value: M.phone,
304
+ onChange: (e) => P((t) => ({
293
305
  ...t,
294
306
  phone: e.target.value
295
307
  })),
@@ -297,21 +309,21 @@ function Y({ editId: t }) {
297
309
  required: !0
298
310
  })]
299
311
  }),
300
- /* @__PURE__ */ W("div", {
312
+ /* @__PURE__ */ B("div", {
301
313
  className: "space-y-2",
302
- children: [/* @__PURE__ */ U(S, {
314
+ children: [/* @__PURE__ */ z(x, {
303
315
  htmlFor: "status",
304
316
  children: "Status"
305
- }), /* @__PURE__ */ W(C, {
306
- value: N.status,
307
- onValueChange: (e) => F((t) => ({
317
+ }), /* @__PURE__ */ B(S, {
318
+ value: M.status,
319
+ onValueChange: (e) => P((t) => ({
308
320
  ...t,
309
321
  status: e
310
322
  })),
311
- children: [/* @__PURE__ */ U(E, {
323
+ children: [/* @__PURE__ */ z(T, {
312
324
  id: "status",
313
- children: /* @__PURE__ */ U(D, {})
314
- }), /* @__PURE__ */ U(w, { children: pe.map((e) => /* @__PURE__ */ U(T, {
325
+ children: /* @__PURE__ */ z(E, {})
326
+ }), /* @__PURE__ */ z(C, { children: _e.map((e) => /* @__PURE__ */ z(w, {
315
327
  value: e.value,
316
328
  children: e.label
317
329
  }, e.value)) })]
@@ -319,49 +331,49 @@ function Y({ editId: t }) {
319
331
  })
320
332
  ]
321
333
  }),
322
- /* @__PURE__ */ W("div", {
334
+ /* @__PURE__ */ B("div", {
323
335
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
324
336
  children: [
325
- /* @__PURE__ */ W("div", {
337
+ /* @__PURE__ */ B("div", {
326
338
  className: "space-y-2",
327
- children: [/* @__PURE__ */ U(S, {
339
+ children: [/* @__PURE__ */ z(x, {
328
340
  htmlFor: "licenseNumber",
329
341
  children: "License Number"
330
- }), /* @__PURE__ */ U(x, {
342
+ }), /* @__PURE__ */ z(b, {
331
343
  id: "licenseNumber",
332
- value: N.licenseNumber,
333
- onChange: (e) => F((t) => ({
344
+ value: M.licenseNumber,
345
+ onChange: (e) => P((t) => ({
334
346
  ...t,
335
347
  licenseNumber: e.target.value
336
348
  })),
337
349
  placeholder: "D1234567"
338
350
  })]
339
351
  }),
340
- /* @__PURE__ */ W("div", {
352
+ /* @__PURE__ */ B("div", {
341
353
  className: "space-y-2",
342
- children: [/* @__PURE__ */ U(S, {
354
+ children: [/* @__PURE__ */ z(x, {
343
355
  htmlFor: "licenseClass",
344
356
  children: "License Class"
345
- }), /* @__PURE__ */ U(x, {
357
+ }), /* @__PURE__ */ z(b, {
346
358
  id: "licenseClass",
347
- value: N.licenseClass,
348
- onChange: (e) => F((t) => ({
359
+ value: M.licenseClass,
360
+ onChange: (e) => P((t) => ({
349
361
  ...t,
350
362
  licenseClass: e.target.value
351
363
  })),
352
364
  placeholder: "Class A"
353
365
  })]
354
366
  }),
355
- /* @__PURE__ */ W("div", {
367
+ /* @__PURE__ */ B("div", {
356
368
  className: "space-y-2",
357
- children: [/* @__PURE__ */ U(S, {
369
+ children: [/* @__PURE__ */ z(x, {
358
370
  htmlFor: "licenseExpiry",
359
371
  children: "License Expiry"
360
- }), /* @__PURE__ */ U(x, {
372
+ }), /* @__PURE__ */ z(b, {
361
373
  id: "licenseExpiry",
362
374
  type: "date",
363
- value: N.licenseExpiry,
364
- onChange: (e) => F((t) => ({
375
+ value: M.licenseExpiry,
376
+ onChange: (e) => P((t) => ({
365
377
  ...t,
366
378
  licenseExpiry: e.target.value
367
379
  }))
@@ -369,38 +381,38 @@ function Y({ editId: t }) {
369
381
  })
370
382
  ]
371
383
  }),
372
- /* @__PURE__ */ W("div", {
384
+ /* @__PURE__ */ B("div", {
373
385
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
374
- children: [/* @__PURE__ */ W("div", {
386
+ children: [/* @__PURE__ */ B("div", {
375
387
  className: "space-y-2",
376
- children: [/* @__PURE__ */ U(S, {
388
+ children: [/* @__PURE__ */ z(x, {
377
389
  htmlFor: "vehicleSearch",
378
390
  children: "Search vehicles"
379
- }), /* @__PURE__ */ U(x, {
391
+ }), /* @__PURE__ */ z(b, {
380
392
  id: "vehicleSearch",
381
- value: ve,
382
- onChange: (e) => ye(e.target.value),
393
+ value: Ee,
394
+ onChange: (e) => De(e.target.value),
383
395
  placeholder: "Vehicle number or type"
384
396
  })]
385
- }), /* @__PURE__ */ W("div", {
397
+ }), /* @__PURE__ */ B("div", {
386
398
  className: "space-y-2",
387
- children: [/* @__PURE__ */ U(S, {
399
+ children: [/* @__PURE__ */ z(x, {
388
400
  htmlFor: "vehicle",
389
401
  children: "Assigned Vehicle"
390
- }), /* @__PURE__ */ U(ie, {
402
+ }), /* @__PURE__ */ z(ce, {
391
403
  id: "vehicle",
392
- value: N.vehicleId,
393
- onChange: (e) => F((t) => ({
404
+ value: M.vehicleId,
405
+ onChange: (e) => P((t) => ({
394
406
  ...t,
395
407
  vehicleId: e,
396
408
  vehicleIds: e ? [e] : []
397
409
  })),
398
- options: be,
399
- loading: xe,
410
+ options: Oe,
411
+ loading: ke,
400
412
  getId: (e) => e.id,
401
413
  getLabel: (e) => `${e.vehicleNumber} (${e.type})`,
402
- renderOption: (e) => /* @__PURE__ */ W(H, { children: [
403
- /* @__PURE__ */ U(te, {
414
+ renderOption: (e) => /* @__PURE__ */ B(ue, { children: [
415
+ /* @__PURE__ */ z(l, {
404
416
  size: 14,
405
417
  className: "mr-2 inline text-text-secondary"
406
418
  }),
@@ -409,76 +421,76 @@ function Y({ editId: t }) {
409
421
  e.type,
410
422
  ")"
411
423
  ] }),
412
- selectedOption: Ee,
413
- selectedLoading: De,
414
- hasMore: Ce,
415
- totalCount: we,
416
- onLoadMore: Te,
417
- loadingMore: Se,
424
+ selectedOption: Pe,
425
+ selectedLoading: Fe,
426
+ hasMore: je,
427
+ totalCount: Me,
428
+ onLoadMore: Ne,
429
+ loadingMore: Ae,
418
430
  placeholder: "Unassigned",
419
431
  emptyText: "No vehicles match that search."
420
432
  })]
421
433
  })]
422
434
  }),
423
- /* @__PURE__ */ W("div", {
435
+ /* @__PURE__ */ B("div", {
424
436
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
425
437
  children: [
426
- /* @__PURE__ */ W("div", {
438
+ /* @__PURE__ */ B("div", {
427
439
  className: "space-y-2",
428
- children: [/* @__PURE__ */ U(S, {
440
+ children: [/* @__PURE__ */ z(x, {
429
441
  htmlFor: "rating",
430
442
  children: "Rating (0–5)"
431
- }), /* @__PURE__ */ U(x, {
443
+ }), /* @__PURE__ */ z(b, {
432
444
  id: "rating",
433
445
  type: "number",
434
446
  min: 0,
435
447
  max: 5,
436
448
  step: .1,
437
- value: N.rating,
438
- onChange: (e) => F((t) => ({
449
+ value: M.rating,
450
+ onChange: (e) => P((t) => ({
439
451
  ...t,
440
452
  rating: e.target.value
441
453
  })),
442
454
  placeholder: "4.8"
443
455
  })]
444
456
  }),
445
- /* @__PURE__ */ W("div", {
457
+ /* @__PURE__ */ B("div", {
446
458
  className: "space-y-2",
447
- children: [/* @__PURE__ */ U(S, {
459
+ children: [/* @__PURE__ */ z(x, {
448
460
  htmlFor: "hireDate",
449
461
  children: "Hire Date"
450
- }), /* @__PURE__ */ U(x, {
462
+ }), /* @__PURE__ */ z(b, {
451
463
  id: "hireDate",
452
464
  type: "date",
453
- value: N.hireDate,
454
- onChange: (e) => F((t) => ({
465
+ value: M.hireDate,
466
+ onChange: (e) => P((t) => ({
455
467
  ...t,
456
468
  hireDate: e.target.value
457
469
  }))
458
470
  })]
459
471
  }),
460
- /* @__PURE__ */ W("div", {
472
+ /* @__PURE__ */ B("div", {
461
473
  className: "space-y-2",
462
- children: [/* @__PURE__ */ W("div", {
474
+ children: [/* @__PURE__ */ B("div", {
463
475
  className: "flex items-center justify-between gap-2",
464
- children: [/* @__PURE__ */ U(S, {
476
+ children: [/* @__PURE__ */ z(x, {
465
477
  htmlFor: "onLeaveUntil",
466
478
  children: "On Leave Until"
467
- }), N.onLeaveUntil && /* @__PURE__ */ U(g, {
479
+ }), M.onLeaveUntil && /* @__PURE__ */ z(h, {
468
480
  type: "button",
469
481
  variant: "ghost",
470
482
  size: "sm",
471
- onClick: () => F((e) => ({
483
+ onClick: () => P((e) => ({
472
484
  ...e,
473
485
  onLeaveUntil: ""
474
486
  })),
475
487
  children: "Clear"
476
488
  })]
477
- }), /* @__PURE__ */ U(x, {
489
+ }), /* @__PURE__ */ z(b, {
478
490
  id: "onLeaveUntil",
479
491
  type: "date",
480
- value: N.onLeaveUntil,
481
- onChange: (e) => F((t) => ({
492
+ value: M.onLeaveUntil,
493
+ onChange: (e) => P((t) => ({
482
494
  ...t,
483
495
  onLeaveUntil: e.target.value
484
496
  }))
@@ -488,57 +500,57 @@ function Y({ editId: t }) {
488
500
  })
489
501
  ]
490
502
  })] }),
491
- /* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
503
+ /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
492
504
  className: "flex items-center gap-2",
493
- children: [/* @__PURE__ */ U(n, { size: 18 }), " Compensation"]
494
- }) }), /* @__PURE__ */ U(v, { children: /* @__PURE__ */ W("div", {
505
+ children: [/* @__PURE__ */ z(n, { size: 18 }), " Compensation"]
506
+ }) }), /* @__PURE__ */ z(_, { children: /* @__PURE__ */ B("div", {
495
507
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
496
508
  children: [
497
- /* @__PURE__ */ W("div", {
509
+ /* @__PURE__ */ B("div", {
498
510
  className: "space-y-2",
499
- children: [/* @__PURE__ */ U(S, {
511
+ children: [/* @__PURE__ */ z(x, {
500
512
  htmlFor: "baseSalary",
501
513
  children: "Base Salary (annual)"
502
- }), /* @__PURE__ */ U(x, {
514
+ }), /* @__PURE__ */ z(b, {
503
515
  id: "baseSalary",
504
516
  type: "number",
505
517
  min: 0,
506
518
  step: .01,
507
- value: N.baseSalary,
508
- onChange: (e) => F((t) => ({
519
+ value: M.baseSalary,
520
+ onChange: (e) => P((t) => ({
509
521
  ...t,
510
522
  baseSalary: e.target.value
511
523
  })),
512
524
  placeholder: "55000"
513
525
  })]
514
526
  }),
515
- /* @__PURE__ */ W("div", {
527
+ /* @__PURE__ */ B("div", {
516
528
  className: "space-y-2",
517
- children: [/* @__PURE__ */ U(S, {
529
+ children: [/* @__PURE__ */ z(x, {
518
530
  htmlFor: "bonusYtd",
519
531
  children: "Bonus (YTD)"
520
- }), /* @__PURE__ */ U(x, {
532
+ }), /* @__PURE__ */ z(b, {
521
533
  id: "bonusYtd",
522
534
  type: "number",
523
535
  min: 0,
524
536
  step: .01,
525
- value: N.bonusYtd,
526
- onChange: (e) => F((t) => ({
537
+ value: M.bonusYtd,
538
+ onChange: (e) => P((t) => ({
527
539
  ...t,
528
540
  bonusYtd: e.target.value
529
541
  })),
530
542
  placeholder: "1200"
531
543
  })]
532
544
  }),
533
- /* @__PURE__ */ W("div", {
545
+ /* @__PURE__ */ B("div", {
534
546
  className: "space-y-2",
535
- children: [/* @__PURE__ */ U(S, {
547
+ children: [/* @__PURE__ */ z(x, {
536
548
  htmlFor: "payCurrency",
537
549
  children: "Currency"
538
- }), /* @__PURE__ */ U(x, {
550
+ }), /* @__PURE__ */ z(b, {
539
551
  id: "payCurrency",
540
- value: N.payCurrency,
541
- onChange: (e) => F((t) => ({
552
+ value: M.payCurrency,
553
+ onChange: (e) => P((t) => ({
542
554
  ...t,
543
555
  payCurrency: e.target.value
544
556
  })),
@@ -548,112 +560,154 @@ function Y({ editId: t }) {
548
560
  })
549
561
  ]
550
562
  }) })] }),
551
- /* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
563
+ /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
552
564
  className: "flex items-center gap-2",
553
- children: [/* @__PURE__ */ U(ee, { size: 18 }), " HR Notes"]
554
- }) }), /* @__PURE__ */ U(v, { children: /* @__PURE__ */ U(O, {
555
- value: N.notes,
556
- onChange: (e) => F((t) => ({
565
+ children: [/* @__PURE__ */ z(ee, { size: 18 }), " HR Notes"]
566
+ }) }), /* @__PURE__ */ z(_, { children: /* @__PURE__ */ z(D, {
567
+ value: M.notes,
568
+ onChange: (e) => P((t) => ({
557
569
  ...t,
558
570
  notes: e.target.value
559
571
  })),
560
572
  placeholder: "Performance notes, disciplinary history, anything worth tracking for this driver...",
561
573
  rows: 4
562
574
  }) })] }),
563
- M && !Me && /* @__PURE__ */ W(_, {
575
+ A && !Ve && /* @__PURE__ */ B(g, {
564
576
  className: "border-status-error-border",
565
- children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
577
+ children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
566
578
  className: "flex items-center gap-2 text-status-error-text",
567
- children: [/* @__PURE__ */ U(c, { size: 18 }), " Dismiss Driver"]
568
- }) }), /* @__PURE__ */ W(v, { children: [/* @__PURE__ */ U("p", {
579
+ children: [/* @__PURE__ */ z(u, { size: 18 }), " Dismiss Driver"]
580
+ }) }), /* @__PURE__ */ B(_, { children: [/* @__PURE__ */ z("p", {
569
581
  className: "mb-3 text-sm text-text-secondary",
570
582
  children: "Dismissing a driver marks them as no longer employed. Their delivery and route history stays visible; they can no longer be assigned new work. This cannot be undone from here."
571
- }), /* @__PURE__ */ W(g, {
583
+ }), /* @__PURE__ */ B(h, {
572
584
  type: "button",
573
585
  variant: "outline",
574
586
  className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
575
- onClick: () => Y(!0),
576
- children: [/* @__PURE__ */ U(c, { size: 16 }), " Dismiss this driver"]
587
+ onClick: () => q(!0),
588
+ children: [/* @__PURE__ */ z(u, { size: 16 }), " Dismiss this driver"]
589
+ })] })]
590
+ }),
591
+ A && /* @__PURE__ */ B(g, {
592
+ className: "border-status-error-border",
593
+ children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
594
+ className: "flex items-center gap-2 text-status-error-text",
595
+ children: [/* @__PURE__ */ z(c, { size: 18 }), " Delete Driver"]
596
+ }) }), /* @__PURE__ */ B(_, { children: [/* @__PURE__ */ z("p", {
597
+ className: "mb-3 text-sm text-text-secondary",
598
+ children: "Removes this driver record, for example one entered by mistake, and unlinks them from any vehicle. To keep delivery history for someone who has left, dismiss them instead. This cannot be undone from here."
599
+ }), /* @__PURE__ */ B(h, {
600
+ type: "button",
601
+ variant: "outline",
602
+ className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
603
+ onClick: () => Z(!0),
604
+ children: [/* @__PURE__ */ z(c, { size: 16 }), " Delete this driver"]
577
605
  })] })]
578
606
  })
579
607
  ]
580
608
  }),
581
- /* @__PURE__ */ U(se, {
582
- open: G,
583
- onOpenChange: Y,
584
- children: /* @__PURE__ */ W(ce, { children: [
585
- /* @__PURE__ */ W(de, { children: [/* @__PURE__ */ U(fe, { children: "Dismiss this driver?" }), /* @__PURE__ */ U(le, { children: "This records the driver as dismissed and requires a reason. It cannot be undone from here." })] }),
586
- /* @__PURE__ */ W("div", {
609
+ /* @__PURE__ */ z(U, {
610
+ open: Se,
611
+ onOpenChange: Z,
612
+ children: /* @__PURE__ */ B(fe, { children: [
613
+ /* @__PURE__ */ B(he, { children: [/* @__PURE__ */ z(ge, { children: "Delete this driver?" }), /* @__PURE__ */ B(pe, { children: [
614
+ "This removes ",
615
+ `${M.firstName} ${M.lastName}`.trim() || "this driver",
616
+ " and unlinks them from any vehicle. It cannot be undone from here."
617
+ ] })] }),
618
+ /* @__PURE__ */ z("div", {
619
+ className: "px-1",
620
+ children: /* @__PURE__ */ z(j, { message: we })
621
+ }),
622
+ /* @__PURE__ */ B(me, { children: [/* @__PURE__ */ z(h, {
623
+ variant: "outline",
624
+ onClick: () => Z(!1),
625
+ disabled: Q,
626
+ children: "Cancel"
627
+ }), /* @__PURE__ */ z(h, {
628
+ className: "bg-status-error-text text-text-inverse hover:opacity-90",
629
+ onClick: Be,
630
+ disabled: Q,
631
+ children: Q ? "Deleting..." : "Delete driver"
632
+ })] })
633
+ ] })
634
+ }),
635
+ /* @__PURE__ */ z(U, {
636
+ open: K,
637
+ onOpenChange: q,
638
+ children: /* @__PURE__ */ B(fe, { children: [
639
+ /* @__PURE__ */ B(he, { children: [/* @__PURE__ */ z(ge, { children: "Dismiss this driver?" }), /* @__PURE__ */ z(pe, { children: "This records the driver as dismissed and requires a reason. It cannot be undone from here." })] }),
640
+ /* @__PURE__ */ B("div", {
587
641
  className: "space-y-2 px-1",
588
642
  children: [
589
- /* @__PURE__ */ W(S, {
643
+ /* @__PURE__ */ B(x, {
590
644
  htmlFor: "dismissReason",
591
- children: ["Reason ", /* @__PURE__ */ U("span", {
645
+ children: ["Reason ", /* @__PURE__ */ z("span", {
592
646
  className: "text-status-error-text",
593
647
  children: "*"
594
648
  })]
595
649
  }),
596
- /* @__PURE__ */ U(O, {
650
+ /* @__PURE__ */ z(D, {
597
651
  id: "dismissReason",
598
- value: X,
599
- onChange: (e) => he(e.target.value),
652
+ value: J,
653
+ onChange: (e) => ye(e.target.value),
600
654
  placeholder: "e.g. Repeated policy violations, voluntary resignation, performance...",
601
655
  rows: 3
602
656
  }),
603
- /* @__PURE__ */ U(P, { message: _e })
657
+ /* @__PURE__ */ z(j, { message: xe })
604
658
  ]
605
659
  }),
606
- /* @__PURE__ */ W(ue, { children: [/* @__PURE__ */ U(g, {
660
+ /* @__PURE__ */ B(me, { children: [/* @__PURE__ */ z(h, {
607
661
  variant: "outline",
608
- onClick: () => Y(!1),
609
- disabled: Z,
662
+ onClick: () => q(!1),
663
+ disabled: Y,
610
664
  children: "Cancel"
611
- }), /* @__PURE__ */ U(g, {
665
+ }), /* @__PURE__ */ z(h, {
612
666
  className: "bg-status-error-text text-text-inverse hover:opacity-90",
613
- onClick: je,
614
- disabled: Z,
615
- children: Z ? "Dismissing..." : "Confirm dismissal"
667
+ onClick: ze,
668
+ disabled: Y,
669
+ children: Y ? "Dismissing..." : "Confirm dismissal"
616
670
  })] })
617
671
  ] })
618
672
  })
619
673
  ]
620
674
  });
621
675
  }
622
- function X() {
623
- let { driverId: a } = V(), c = B().pathname.endsWith("/edit"), { basePath: d, navigate: p } = ne(), { driver: h, isLoading: x, error: S, refetch: C } = f(a);
624
- R(c, C);
625
- let { vehicle: w } = m(h?.assignedVehicle), T = () => p?.(u(d, "fleet/drivers")), E = (e) => p?.(u(d, e));
626
- if (!a) return /* @__PURE__ */ U(Y, {});
627
- if (c) return /* @__PURE__ */ U(Y, { editId: a });
628
- if (x) return /* @__PURE__ */ U(A, { message: "Loading driver details..." });
629
- if (S || !h) return /* @__PURE__ */ U(k, {
676
+ function q() {
677
+ let { driverId: a } = R(), c = L().pathname.endsWith("/edit"), { basePath: u, navigate: p } = te(), { driver: m, isLoading: ie, error: b, refetch: x } = ne(a);
678
+ F(c, x);
679
+ let { vehicle: S } = re(m?.assignedVehicle), C = () => p?.(f(u, "fleet/drivers")), w = (e) => p?.(f(u, e));
680
+ if (!a) return /* @__PURE__ */ z(K, {});
681
+ if (c) return /* @__PURE__ */ z(K, { editId: a });
682
+ if (ie) return /* @__PURE__ */ z(O, { message: "Loading driver details..." });
683
+ if (b || !m) return /* @__PURE__ */ z(ae, {
630
684
  title: "Driver not found",
631
- onRetry: C
685
+ onRetry: x
632
686
  });
633
- let D = !!h.terminatedAt, O = h.onLeaveUntil && h.onLeaveUntil.getTime() > (/* @__PURE__ */ new Date()).getTime() ? h.onLeaveUntil : void 0, M = h.baseSalary !== void 0 || h.bonusYtd !== void 0;
634
- return /* @__PURE__ */ W(j, {
635
- title: h.fullName,
636
- subtitle: `Employee ID: ${h.employeeId}`,
637
- icon: /* @__PURE__ */ U(l, { size: 24 }),
638
- headerActions: /* @__PURE__ */ W("div", {
687
+ let T = !!m.terminatedAt, E = m.onLeaveUntil && m.onLeaveUntil.getTime() > (/* @__PURE__ */ new Date()).getTime() ? m.onLeaveUntil : void 0, D = m.baseSalary !== void 0 || m.bonusYtd !== void 0;
688
+ return /* @__PURE__ */ B(oe, {
689
+ title: m.fullName,
690
+ subtitle: `Employee ID: ${m.employeeId}`,
691
+ icon: /* @__PURE__ */ z(d, { size: 24 }),
692
+ headerActions: /* @__PURE__ */ B("div", {
639
693
  className: "flex gap-2",
640
- children: [/* @__PURE__ */ W(g, {
694
+ children: [/* @__PURE__ */ B(h, {
641
695
  variant: "outline",
642
- onClick: T,
643
- children: [/* @__PURE__ */ U(e, { size: 16 }), " Back"]
644
- }), /* @__PURE__ */ W(g, {
645
- onClick: () => p?.(u(d, "fleet/drivers/" + a + "/edit")),
646
- children: [/* @__PURE__ */ U(o, { size: 16 }), " Edit"]
696
+ onClick: C,
697
+ children: [/* @__PURE__ */ z(e, { size: 16 }), " Back"]
698
+ }), /* @__PURE__ */ B(h, {
699
+ onClick: () => p?.(f(u, "fleet/drivers/" + a + "/edit")),
700
+ children: [/* @__PURE__ */ z(o, { size: 16 }), " Edit"]
647
701
  })]
648
702
  }),
649
- headerContent: /* @__PURE__ */ W("div", {
703
+ headerContent: /* @__PURE__ */ B("div", {
650
704
  className: "flex flex-wrap items-center gap-4",
651
705
  children: [
652
- /* @__PURE__ */ U(N, {
653
- status: h.status,
706
+ /* @__PURE__ */ z(A, {
707
+ status: m.status,
654
708
  type: "driver"
655
709
  }),
656
- D && /* @__PURE__ */ U(N, {
710
+ T && /* @__PURE__ */ z(A, {
657
711
  status: "dismissed",
658
712
  label: "Dismissed",
659
713
  customColors: {
@@ -661,168 +715,168 @@ function X() {
661
715
  text: "text-status-error-text"
662
716
  }
663
717
  }),
664
- O && !D && /* @__PURE__ */ U(N, {
718
+ E && !T && /* @__PURE__ */ z(A, {
665
719
  status: "on_leave",
666
- label: `On leave until ${I(O, "short")}`,
720
+ label: `On leave until ${N(E, "short")}`,
667
721
  customColors: {
668
722
  bg: "bg-status-warning-bg-subtle",
669
723
  text: "text-status-warning-text"
670
724
  }
671
725
  }),
672
- h.rating !== void 0 && /* @__PURE__ */ W("div", {
726
+ m.rating !== void 0 && /* @__PURE__ */ B("div", {
673
727
  className: "flex items-center gap-1",
674
- children: [/* @__PURE__ */ U(s, {
728
+ children: [/* @__PURE__ */ z(s, {
675
729
  size: 16,
676
730
  className: "text-status-warning-text fill-current"
677
- }), /* @__PURE__ */ U("span", {
731
+ }), /* @__PURE__ */ z("span", {
678
732
  className: "font-medium",
679
- children: h.rating.toFixed(1)
733
+ children: m.rating.toFixed(1)
680
734
  })]
681
735
  })
682
736
  ]
683
737
  }),
684
738
  children: [
685
- /* @__PURE__ */ U(K, {
686
- icon: /* @__PURE__ */ U(l, { size: 18 }),
739
+ /* @__PURE__ */ z(H, {
740
+ icon: /* @__PURE__ */ z(d, { size: 18 }),
687
741
  children: "A driver's full profile — licensing, assigned vehicle, documents and HR record. Use it to confirm someone is road-ready and compliant before assigning them an order or route."
688
742
  }),
689
- /* @__PURE__ */ U(G, {
743
+ /* @__PURE__ */ z(V, {
690
744
  storageKey: "movethewheels-driver-details",
691
745
  steps: [
692
746
  {
693
747
  id: "assign",
694
748
  label: "Assign to an order",
695
749
  description: "Hand a pending delivery to this driver.",
696
- icon: /* @__PURE__ */ U(i, { size: 16 }),
697
- onClick: () => E("orders")
750
+ icon: /* @__PURE__ */ z(i, { size: 16 }),
751
+ onClick: () => w("orders")
698
752
  },
699
753
  {
700
754
  id: "routes",
701
755
  label: "Plan their route",
702
756
  description: "Batch nearby drop-offs into an optimized itinerary.",
703
- icon: /* @__PURE__ */ U(t, { size: 16 }),
704
- onClick: () => E("routes")
757
+ icon: /* @__PURE__ */ z(t, { size: 16 }),
758
+ onClick: () => w("routes")
705
759
  },
706
760
  {
707
761
  id: "edit",
708
762
  label: "Update driver record",
709
763
  description: "Refresh documents, license or HR details.",
710
- icon: /* @__PURE__ */ U(o, { size: 16 }),
764
+ icon: /* @__PURE__ */ z(o, { size: 16 }),
711
765
  onClick: () => {}
712
766
  }
713
767
  ]
714
768
  }),
715
- D && /* @__PURE__ */ W("div", {
769
+ T && /* @__PURE__ */ B("div", {
716
770
  className: "rounded-card border border-status-error-border bg-status-error-bg-subtle p-4 text-sm text-status-error-text",
717
- children: [/* @__PURE__ */ W("p", {
771
+ children: [/* @__PURE__ */ B("p", {
718
772
  className: "font-medium",
719
- children: ["Dismissed ", h.terminatedAt && I(h.terminatedAt, "full")]
720
- }), h.terminationReason && /* @__PURE__ */ W("p", {
773
+ children: ["Dismissed ", m.terminatedAt && N(m.terminatedAt, "full")]
774
+ }), m.terminationReason && /* @__PURE__ */ B("p", {
721
775
  className: "mt-1",
722
- children: ["Reason: ", h.terminationReason]
776
+ children: ["Reason: ", m.terminationReason]
723
777
  })]
724
778
  }),
725
- /* @__PURE__ */ W("div", {
779
+ /* @__PURE__ */ B("div", {
726
780
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
727
- children: [/* @__PURE__ */ W("div", {
781
+ children: [/* @__PURE__ */ B("div", {
728
782
  className: "lg:col-span-2 space-y-6",
729
783
  children: [
730
- /* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
784
+ /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
731
785
  className: "flex items-center gap-2",
732
- children: [/* @__PURE__ */ U(r, { size: 18 }), " License"]
733
- }) }), /* @__PURE__ */ U(v, { children: /* @__PURE__ */ U("div", {
786
+ children: [/* @__PURE__ */ z(r, { size: 18 }), " License"]
787
+ }) }), /* @__PURE__ */ z(_, { children: /* @__PURE__ */ z("div", {
734
788
  className: "flex items-center justify-between p-3 border rounded-lg",
735
- children: /* @__PURE__ */ W("div", { children: [
736
- /* @__PURE__ */ U("p", {
789
+ children: /* @__PURE__ */ B("div", { children: [
790
+ /* @__PURE__ */ z("p", {
737
791
  className: "font-medium",
738
792
  children: "Driver's License"
739
793
  }),
740
- /* @__PURE__ */ W("p", {
794
+ /* @__PURE__ */ B("p", {
741
795
  className: "text-sm text-text-secondary",
742
- children: [h.licenseNumber || "—", h.licenseType ? ` - ${h.licenseType}` : ""]
796
+ children: [m.licenseNumber || "—", m.licenseType ? ` - ${m.licenseType}` : ""]
743
797
  }),
744
- /* @__PURE__ */ U("p", {
798
+ /* @__PURE__ */ z("p", {
745
799
  className: "text-sm text-text-secondary",
746
- children: h.licenseExpiry ? `Expires: ${I(h.licenseExpiry)}` : "Expiry not recorded"
800
+ children: m.licenseExpiry ? `Expires: ${N(m.licenseExpiry)}` : "Expiry not recorded"
747
801
  })
748
802
  ] })
749
803
  }) })] }),
750
- h.notes && /* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
804
+ m.notes && /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
751
805
  className: "flex items-center gap-2",
752
- children: [/* @__PURE__ */ U(ee, { size: 18 }), " HR Notes"]
753
- }) }), /* @__PURE__ */ U(v, { children: /* @__PURE__ */ U("p", {
806
+ children: [/* @__PURE__ */ z(ee, { size: 18 }), " HR Notes"]
807
+ }) }), /* @__PURE__ */ z(_, { children: /* @__PURE__ */ z("p", {
754
808
  className: "text-sm whitespace-pre-wrap",
755
- children: h.notes
809
+ children: m.notes
756
810
  }) })] }),
757
- /* @__PURE__ */ U(L, {
811
+ /* @__PURE__ */ z(P, {
758
812
  entityType: "driver",
759
- entityId: h.id
813
+ entityId: m.id
760
814
  })
761
815
  ]
762
- }), /* @__PURE__ */ W("div", {
816
+ }), /* @__PURE__ */ B("div", {
763
817
  className: "space-y-6",
764
818
  children: [
765
- /* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
819
+ /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
766
820
  className: "flex items-center gap-2",
767
- children: [/* @__PURE__ */ U(te, { size: 18 }), " Assigned Vehicle"]
768
- }) }), /* @__PURE__ */ U(v, { children: h.assignedVehicle ? w ? /* @__PURE__ */ W("button", {
821
+ children: [/* @__PURE__ */ z(l, { size: 18 }), " Assigned Vehicle"]
822
+ }) }), /* @__PURE__ */ z(_, { children: m.assignedVehicle ? S ? /* @__PURE__ */ B("button", {
769
823
  type: "button",
770
824
  className: "text-sm font-medium text-primary hover:underline",
771
- onClick: () => E(`fleet/vehicles/${w.id}`),
825
+ onClick: () => w(`fleet/vehicles/${S.id}`),
772
826
  children: [
773
- w.vehicleNumber,
827
+ S.vehicleNumber,
774
828
  " (",
775
- w.type,
829
+ S.type,
776
830
  ")"
777
831
  ]
778
- }) : /* @__PURE__ */ U("p", {
832
+ }) : /* @__PURE__ */ z("p", {
779
833
  className: "text-sm text-text-secondary",
780
834
  children: "Loading…"
781
- }) : /* @__PURE__ */ U("p", {
835
+ }) : /* @__PURE__ */ z("p", {
782
836
  className: "text-sm text-text-secondary",
783
837
  children: "No vehicle assigned"
784
838
  }) })] }),
785
- /* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ U(b, { children: "Record" }) }), /* @__PURE__ */ U(v, {
839
+ /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ z(y, { children: "Record" }) }), /* @__PURE__ */ z(_, {
786
840
  className: "space-y-4",
787
- children: /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("p", {
841
+ children: /* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("p", {
788
842
  className: "text-sm text-text-secondary",
789
843
  children: "Hire Date"
790
- }), /* @__PURE__ */ U("p", {
844
+ }), /* @__PURE__ */ z("p", {
791
845
  className: "font-medium",
792
- children: h.hireDate ? I(h.hireDate) : "Not recorded"
846
+ children: m.hireDate ? N(m.hireDate) : "Not recorded"
793
847
  })] })
794
848
  })] }),
795
- /* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
849
+ /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
796
850
  className: "flex items-center gap-2",
797
- children: [/* @__PURE__ */ U(n, { size: 18 }), " Compensation"]
798
- }) }), /* @__PURE__ */ U(v, {
851
+ children: [/* @__PURE__ */ z(n, { size: 18 }), " Compensation"]
852
+ }) }), /* @__PURE__ */ z(_, {
799
853
  className: "space-y-3",
800
- children: M ? /* @__PURE__ */ W(H, { children: [h.baseSalary !== void 0 && /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("p", {
854
+ children: D ? /* @__PURE__ */ B(ue, { children: [m.baseSalary !== void 0 && /* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("p", {
801
855
  className: "text-sm text-text-secondary",
802
856
  children: "Base Salary"
803
- }), /* @__PURE__ */ W("p", {
857
+ }), /* @__PURE__ */ B("p", {
804
858
  className: "font-medium",
805
- children: [F(h.baseSalary, h.payCurrency || void 0), "/year"]
806
- })] }), h.bonusYtd !== void 0 && /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("p", {
859
+ children: [M(m.baseSalary, m.payCurrency || void 0), "/year"]
860
+ })] }), m.bonusYtd !== void 0 && /* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("p", {
807
861
  className: "text-sm text-text-secondary",
808
862
  children: "Bonus (YTD)"
809
- }), /* @__PURE__ */ U("p", {
863
+ }), /* @__PURE__ */ z("p", {
810
864
  className: "font-medium",
811
- children: F(h.bonusYtd, h.payCurrency || void 0)
812
- })] })] }) : /* @__PURE__ */ U("p", {
865
+ children: M(m.bonusYtd, m.payCurrency || void 0)
866
+ })] })] }) : /* @__PURE__ */ z("p", {
813
867
  className: "text-sm text-text-secondary",
814
868
  children: "Not recorded"
815
869
  })
816
870
  })] }),
817
- h.currentLocation && /* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
871
+ m.currentLocation && /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
818
872
  className: "flex items-center gap-2",
819
- children: [/* @__PURE__ */ U(i, { size: 18 }), " Current Location"]
820
- }) }), /* @__PURE__ */ W(v, { children: [/* @__PURE__ */ U("p", {
873
+ children: [/* @__PURE__ */ z(i, { size: 18 }), " Current Location"]
874
+ }) }), /* @__PURE__ */ B(_, { children: [/* @__PURE__ */ z("p", {
821
875
  className: "text-sm",
822
- children: h.currentLocation.address || "Location updating..."
823
- }), /* @__PURE__ */ U("p", {
876
+ children: m.currentLocation.address || "Location updating..."
877
+ }), /* @__PURE__ */ z("p", {
824
878
  className: "text-xs text-text-secondary mt-1",
825
- children: h.currentLocation.timestamp ? `Updated ${I(h.currentLocation.timestamp, "relative")}` : "Update time not recorded"
879
+ children: m.currentLocation.timestamp ? `Updated ${N(m.currentLocation.timestamp, "relative")}` : "Update time not recorded"
826
880
  })] })] })
827
881
  ]
828
882
  })]
@@ -831,4 +885,4 @@ function X() {
831
885
  });
832
886
  }
833
887
  //#endregion
834
- export { X as default };
888
+ export { q as default };