@burdenoff/microfe-movethewheels 2026.929.4 → 2026.930.1

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