@burdenoff/microfe-movethewheels 2026.1031.3 → 2026.1031.5

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