@burdenoff/microfe-movethewheels 2026.925.1 → 2026.925.3

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 (47) hide show
  1. package/dist/components/StatusBadge.js +31 -31
  2. package/dist/constants/index.js +19 -5
  3. package/dist/hooks/useCustomers.js +0 -3
  4. package/dist/hooks/useFleet.js +197 -175
  5. package/dist/hooks/useInventory.js +144 -145
  6. package/dist/hooks/useRoutes.js +5 -14
  7. package/dist/movethewheels/components/StatusBadge.d.ts +3 -1
  8. package/dist/movethewheels/constants/index.d.ts +2 -0
  9. package/dist/movethewheels/hooks/useFleet.d.ts +53 -1
  10. package/dist/movethewheels/hooks/useInventory.d.ts +10 -0
  11. package/dist/movethewheels/types/index.d.ts +29 -108
  12. package/dist/node_modules/lucide-react/dist/esm/icons/sticky-note.js +11 -0
  13. package/dist/node_modules/lucide-react/dist/esm/icons/user-x.js +30 -0
  14. package/dist/pages/CustomerDetailsPage.js +666 -344
  15. package/dist/pages/CustomersPage.js +71 -80
  16. package/dist/pages/DriverDetailsPage.js +702 -421
  17. package/dist/pages/DriversPage.js +106 -117
  18. package/dist/pages/FleetPage.js +5 -13
  19. package/dist/pages/InventoryPage.js +4 -4
  20. package/dist/pages/OrderDetailsPage.js +279 -274
  21. package/dist/pages/RouteDetailsPage.js +300 -263
  22. package/dist/pages/RoutesPage.js +130 -67
  23. package/dist/pages/VehicleDetailsPage.js +562 -287
  24. package/dist/pages/VehiclesPage.js +119 -70
  25. package/dist/pages/WarehouseDetailsPage.js +410 -370
  26. package/dist/pages/WarehousesPage.js +131 -82
  27. package/package.json +1 -1
  28. package/src/movethewheels/components/StatusBadge.tsx +16 -2
  29. package/src/movethewheels/constants/index.ts +21 -0
  30. package/src/movethewheels/hooks/useCustomers.ts +0 -3
  31. package/src/movethewheels/hooks/useFleet.ts +236 -62
  32. package/src/movethewheels/hooks/useInventory.ts +76 -32
  33. package/src/movethewheels/hooks/useRoutes.ts +17 -12
  34. package/src/movethewheels/pages/CustomerDetailsPage.tsx +376 -109
  35. package/src/movethewheels/pages/CustomersPage.tsx +6 -15
  36. package/src/movethewheels/pages/DriverDetailsPage.tsx +516 -156
  37. package/src/movethewheels/pages/DriversPage.tsx +28 -11
  38. package/src/movethewheels/pages/FleetPage.tsx +9 -11
  39. package/src/movethewheels/pages/InventoryPage.tsx +14 -5
  40. package/src/movethewheels/pages/OrderDetailsPage.tsx +12 -7
  41. package/src/movethewheels/pages/RouteDetailsPage.tsx +89 -41
  42. package/src/movethewheels/pages/RoutesPage.tsx +66 -2
  43. package/src/movethewheels/pages/VehicleDetailsPage.tsx +282 -20
  44. package/src/movethewheels/pages/VehiclesPage.tsx +68 -3
  45. package/src/movethewheels/pages/WarehouseDetailsPage.tsx +213 -135
  46. package/src/movethewheels/pages/WarehousesPage.tsx +77 -16
  47. package/src/movethewheels/types/index.ts +30 -108
@@ -5,27 +5,29 @@ import { MapPin as r } from "../node_modules/lucide-react/dist/esm/icons/map-pin
5
5
  import { Phone as i } from "../node_modules/lucide-react/dist/esm/icons/phone.js";
6
6
  import { Save as a } from "../node_modules/lucide-react/dist/esm/icons/save.js";
7
7
  import { SquarePen as o } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
8
- import { Truck as s } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
9
- import { UserRound as c } from "../node_modules/lucide-react/dist/esm/icons/user-round.js";
10
- import { joinPath as l } from "../utils/navigation.js";
11
- import { useMoveTheWheels as u } from "../providers/MoveTheWheelsProvider.js";
12
- import { useFleet as d, useVehicle as f, useVehicleDrivers as p } from "../hooks/useFleet.js";
13
- import { Avatar as m, AvatarFallback as h, Button as g, Card as _, CardContent as v, CardHeader as y, CardTitle as b, Input as x, Label as S, Progress as C, Select as w, SelectContent as T, SelectItem as E, SelectTrigger as D, SelectValue as O } from "../components/ui.js";
14
- import { ErrorState as k, LoadingState as A, PageLayout as j } from "../components/PageLayout.js";
15
- import { StatusBadge as M, VehicleTypeBadge as N } from "../components/StatusBadge.js";
16
- import { FormError as P } from "../components/FormError.js";
17
- import { Notice as F, useNotice as I } from "../components/Notice.js";
18
- import { formatDate as L, getInitials as R } from "../utils/formatters.js";
19
- import { DocumentsCard as z } from "../components/DocumentsCard.js";
20
- import { useRecordVehicleService as B } from "../hooks/useFleetIntelligence.js";
21
- import { VehicleServiceCard as V } from "../components/VehicleServiceCard.js";
22
- import { useEffect as H, useState as U } from "react";
23
- import { useLocation as W, useParams as ee } from "react-router";
24
- import { jsx as G, jsxs as K } from "react/jsx-runtime";
25
- import { useI18n as te } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
26
- import { EmphasisPanel as q, NextSteps as ne, PagePurpose as J } from "@burdenoff/fe-libs/ui";
8
+ import { Trash2 as s } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
9
+ import { Truck as c } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
10
+ import { UserRound as l } from "../node_modules/lucide-react/dist/esm/icons/user-round.js";
11
+ import { joinPath as u } from "../utils/navigation.js";
12
+ import { useMoveTheWheels as d } from "../providers/MoveTheWheelsProvider.js";
13
+ import { toApiVehicleStatus as f, useFleet as p, useVehicle as m, useVehicleDrivers as h } from "../hooks/useFleet.js";
14
+ import { Avatar as g, AvatarFallback as _, Button as v, Card as y, CardContent as b, CardHeader as x, CardTitle as S, Input as C, Label as w, Progress as T, Select as E, SelectContent as D, SelectItem as O, SelectTrigger as k, SelectValue as A } from "../components/ui.js";
15
+ import { ErrorState as j, LoadingState as M, PageLayout as N } from "../components/PageLayout.js";
16
+ import { VEHICLE_STATUS_LABELS as P } from "../constants/index.js";
17
+ import { StatusBadge as F, VehicleTypeBadge as I } from "../components/StatusBadge.js";
18
+ import { FormError as L } from "../components/FormError.js";
19
+ import { Notice as R, useNotice as z } from "../components/Notice.js";
20
+ import { formatDate as B, getInitials as V } from "../utils/formatters.js";
21
+ import { DocumentsCard as H } from "../components/DocumentsCard.js";
22
+ import { useRecordVehicleService as U } from "../hooks/useFleetIntelligence.js";
23
+ import { VehicleServiceCard as W } from "../components/VehicleServiceCard.js";
24
+ import { useEffect as G, useState as K } from "react";
25
+ import { useLocation as ee, useParams as te } from "react-router";
26
+ import { jsx as q, jsxs as J } from "react/jsx-runtime";
27
+ import { useI18n as ne } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
28
+ import { EmphasisPanel as Y, NextSteps as re, PagePurpose as X, ResponsiveDialog as Z, ResponsiveDialogContent as Q, ResponsiveDialogDescription as $, ResponsiveDialogFooter as ie, ResponsiveDialogHeader as ae, ResponsiveDialogTitle as oe } from "@burdenoff/fe-libs/ui";
27
29
  //#region src/movethewheels/pages/VehicleDetailsPage.tsx
28
- var Y = [
30
+ var se = [
29
31
  {
30
32
  value: "TRUCK",
31
33
  label: "Truck"
@@ -58,380 +60,653 @@ var Y = [
58
60
  value: "DRONE",
59
61
  label: "Drone"
60
62
  }
63
+ ], ce = Object.entries(P).map(([e, t]) => ({
64
+ value: e,
65
+ label: t
66
+ })), le = [
67
+ {
68
+ value: "owned",
69
+ label: "Owned"
70
+ },
71
+ {
72
+ value: "leased",
73
+ label: "Leased"
74
+ },
75
+ {
76
+ value: "rented",
77
+ label: "Rented"
78
+ }
61
79
  ];
62
- function X({ editId: t }) {
63
- let { basePath: n, navigate: r } = u(), { createVehicle: i, updateVehicle: o } = d(), { vehicle: c } = f(t), p = !!t, [m, h] = U({
80
+ function ue({ editId: t }) {
81
+ let { basePath: n, navigate: r } = d(), { createVehicle: i, updateVehicle: o, deleteVehicle: l } = p(), { vehicle: h } = m(t), g = !!t, [_, T] = K({
64
82
  vehicleNumber: "",
65
83
  type: "VAN",
66
84
  make: "",
67
85
  model: "",
68
- licensePlate: ""
69
- }), [_, v] = U(!1), [y, b] = U(null);
70
- H(() => {
71
- t && c && h({
72
- vehicleNumber: c.vehicleNumber ?? "",
73
- type: c.type ? c.type.toUpperCase() : "VAN",
74
- make: c.make ?? "",
75
- model: c.model ?? "",
76
- licensePlate: c.licensePlate ?? ""
86
+ licensePlate: "",
87
+ ownershipType: "",
88
+ year: "",
89
+ status: "available",
90
+ fuelType: "",
91
+ fuelEfficiencyLPer100Km: "",
92
+ capacityWeight: "",
93
+ capacityVolume: "",
94
+ capacityPallets: ""
95
+ }), [j, M] = K(!1), [P, F] = K(null), [I, R] = K(!1), [z, B] = K(!1), [V, H] = K(null);
96
+ G(() => {
97
+ t && h && T({
98
+ vehicleNumber: h.vehicleNumber ?? "",
99
+ type: h.type ? h.type.toUpperCase() : "VAN",
100
+ make: h.make ?? "",
101
+ model: h.model ?? "",
102
+ licensePlate: h.licensePlate ?? "",
103
+ ownershipType: h.ownershipType ?? "",
104
+ year: h.year ? String(h.year) : "",
105
+ status: h.status,
106
+ fuelType: h.fuelType ?? "",
107
+ fuelEfficiencyLPer100Km: h.fuelEfficiencyLPer100Km === void 0 ? "" : String(h.fuelEfficiencyLPer100Km),
108
+ capacityWeight: h.capacity.weight ? String(h.capacity.weight) : "",
109
+ capacityVolume: h.capacity.volume ? String(h.capacity.volume) : "",
110
+ capacityPallets: h.capacity.pallets ? String(h.capacity.pallets) : ""
77
111
  });
78
- }, [t, c]);
79
- let C = () => r?.(l(n, "fleet/vehicles")), k = async (e) => {
80
- if (e.preventDefault(), !m.vehicleNumber.trim()) {
81
- b("Vehicle number is required.");
112
+ }, [t, h]);
113
+ let U = () => r?.(u(n, "fleet/vehicles")), W = async (e) => {
114
+ if (e.preventDefault(), !_.vehicleNumber.trim()) {
115
+ F("Vehicle number is required.");
82
116
  return;
83
117
  }
84
- v(!0), b(null);
118
+ M(!0), F(null);
85
119
  try {
120
+ let e = {
121
+ vehicleNumber: _.vehicleNumber.trim(),
122
+ type: _.type,
123
+ make: _.make.trim() || void 0,
124
+ model: _.model.trim() || void 0,
125
+ licensePlate: _.licensePlate.trim() || void 0,
126
+ ownershipType: _.ownershipType || void 0,
127
+ year: _.year ? Number(_.year) : void 0,
128
+ status: f(_.status),
129
+ fuelType: _.fuelType || void 0,
130
+ fuelEfficiencyLPer100Km: _.fuelEfficiencyLPer100Km ? Number(_.fuelEfficiencyLPer100Km) : void 0,
131
+ capacity: _.capacityWeight || _.capacityVolume || _.capacityPallets ? {
132
+ weight: _.capacityWeight ? Number(_.capacityWeight) : void 0,
133
+ volume: _.capacityVolume ? Number(_.capacityVolume) : void 0,
134
+ pallets: _.capacityPallets ? Number(_.capacityPallets) : void 0
135
+ } : void 0
136
+ };
86
137
  if (t) {
87
- let e = await o(t, {
88
- vehicleNumber: m.vehicleNumber.trim(),
89
- type: m.type,
90
- make: m.make.trim() || void 0,
91
- model: m.model.trim() || void 0,
92
- licensePlate: m.licensePlate.trim() || void 0
93
- });
94
- r?.(l(n, `fleet/vehicles/${e.id}`));
138
+ let i = await o(t, e);
139
+ r?.(u(n, `fleet/vehicles/${i.id}`));
95
140
  } else {
96
- let e = await i({
97
- vehicleNumber: m.vehicleNumber.trim(),
98
- type: m.type,
99
- make: m.make.trim() || void 0,
100
- model: m.model.trim() || void 0,
101
- licensePlate: m.licensePlate.trim() || void 0
102
- });
103
- r?.(l(n, `fleet/vehicles/${e.id}`));
141
+ let t = await i(e);
142
+ r?.(u(n, `fleet/vehicles/${t.id}`));
104
143
  }
105
144
  } catch (e) {
106
- console.error("Failed to create vehicle:", e), b(e instanceof Error ? e.message : "Failed to create vehicle. Please try again."), v(!1);
145
+ console.error("Failed to create vehicle:", e), F(e instanceof Error ? e.message : "Failed to create vehicle. Please try again."), M(!1);
107
146
  }
108
147
  };
109
- return /* @__PURE__ */ K(j, {
110
- title: p ? "Edit Vehicle" : "Add Vehicle",
148
+ return /* @__PURE__ */ J(N, {
149
+ title: g ? "Edit Vehicle" : "Add Vehicle",
111
150
  subtitle: "Register a new vehicle in your fleet",
112
- icon: /* @__PURE__ */ G(s, { size: 24 }),
113
- headerActions: /* @__PURE__ */ K("div", {
151
+ icon: /* @__PURE__ */ q(c, { size: 24 }),
152
+ headerActions: /* @__PURE__ */ J("div", {
114
153
  className: "flex gap-2",
115
- children: [/* @__PURE__ */ K(g, {
154
+ children: [/* @__PURE__ */ J(v, {
116
155
  variant: "outline",
117
- onClick: C,
118
- disabled: _,
119
- children: [/* @__PURE__ */ G(e, { size: 16 }), " Cancel"]
120
- }), /* @__PURE__ */ K(g, {
121
- onClick: k,
122
- disabled: _,
156
+ onClick: U,
157
+ disabled: j,
158
+ children: [/* @__PURE__ */ q(e, { size: 16 }), " Cancel"]
159
+ }), /* @__PURE__ */ J(v, {
160
+ onClick: W,
161
+ disabled: j,
123
162
  children: [
124
- /* @__PURE__ */ G(a, { size: 16 }),
163
+ /* @__PURE__ */ q(a, { size: 16 }),
125
164
  " ",
126
- p ? _ ? "Saving..." : "Save Changes" : _ ? "Saving..." : "Add Vehicle"
165
+ g ? j ? "Saving..." : "Save Changes" : j ? "Saving..." : "Add Vehicle"
127
166
  ]
128
167
  })]
129
168
  }),
130
- children: [/* @__PURE__ */ G(J, {
131
- icon: /* @__PURE__ */ G(s, { size: 18 }),
132
- children: "Add a vehicle so it can be assigned to deliveries and routes. Give it a fleet number and type to start — make, model and plate help identify it on the road."
133
- }), /* @__PURE__ */ K("form", {
134
- onSubmit: k,
135
- className: "max-w-2xl space-y-6",
136
- children: [/* @__PURE__ */ G(P, { message: y }), /* @__PURE__ */ K(q, { children: [/* @__PURE__ */ G("h2", {
137
- className: "text-base font-semibold text-text-primary mb-4",
138
- children: "Vehicle Details"
139
- }), /* @__PURE__ */ K("div", {
140
- className: "space-y-4",
141
- children: [/* @__PURE__ */ K("div", {
142
- className: "grid grid-cols-1 md:grid-cols-2 gap-4",
143
- children: [/* @__PURE__ */ K("div", {
144
- className: "space-y-2",
145
- children: [/* @__PURE__ */ K(S, {
146
- htmlFor: "vehicleNumber",
147
- children: ["Vehicle Number ", /* @__PURE__ */ G("span", {
148
- className: "text-status-error-text",
149
- children: "*"
150
- })]
151
- }), /* @__PURE__ */ G(x, {
152
- id: "vehicleNumber",
153
- value: m.vehicleNumber,
154
- onChange: (e) => h((t) => ({
155
- ...t,
156
- vehicleNumber: e.target.value
157
- })),
158
- placeholder: "MTW-001",
159
- required: !0
160
- })]
161
- }), /* @__PURE__ */ K("div", {
162
- className: "space-y-2",
163
- children: [/* @__PURE__ */ K(S, {
164
- htmlFor: "type",
165
- children: ["Type ", /* @__PURE__ */ G("span", {
166
- className: "text-status-error-text",
167
- children: "*"
168
- })]
169
- }), /* @__PURE__ */ K(w, {
170
- value: m.type,
171
- onValueChange: (e) => h((t) => ({
172
- ...t,
173
- type: e
174
- })),
175
- children: [/* @__PURE__ */ G(D, {
176
- id: "type",
177
- children: /* @__PURE__ */ G(O, {})
178
- }), /* @__PURE__ */ G(T, { children: Y.map((e) => /* @__PURE__ */ G(E, {
179
- value: e.value,
180
- children: e.label
181
- }, e.value)) })]
182
- })]
183
- })]
184
- }), /* @__PURE__ */ K("div", {
185
- className: "grid grid-cols-1 md:grid-cols-3 gap-4",
186
- children: [
187
- /* @__PURE__ */ K("div", {
188
- className: "space-y-2",
189
- children: [/* @__PURE__ */ G(S, {
190
- htmlFor: "make",
191
- children: "Make"
192
- }), /* @__PURE__ */ G(x, {
193
- id: "make",
194
- value: m.make,
195
- onChange: (e) => h((t) => ({
196
- ...t,
197
- make: e.target.value
198
- })),
199
- placeholder: "Ford"
200
- })]
201
- }),
202
- /* @__PURE__ */ K("div", {
203
- className: "space-y-2",
204
- children: [/* @__PURE__ */ G(S, {
205
- htmlFor: "model",
206
- children: "Model"
207
- }), /* @__PURE__ */ G(x, {
208
- id: "model",
209
- value: m.model,
210
- onChange: (e) => h((t) => ({
211
- ...t,
212
- model: e.target.value
213
- })),
214
- placeholder: "Transit"
215
- })]
216
- }),
217
- /* @__PURE__ */ K("div", {
218
- className: "space-y-2",
219
- children: [/* @__PURE__ */ G(S, {
220
- htmlFor: "licensePlate",
221
- children: "License Plate"
222
- }), /* @__PURE__ */ G(x, {
223
- id: "licensePlate",
224
- value: m.licensePlate,
225
- onChange: (e) => h((t) => ({
226
- ...t,
227
- licensePlate: e.target.value
228
- })),
229
- placeholder: "ABC-1234"
230
- })]
231
- })
232
- ]
233
- })]
234
- })] })]
235
- })]
169
+ children: [
170
+ /* @__PURE__ */ q(X, {
171
+ icon: /* @__PURE__ */ q(c, { size: 18 }),
172
+ children: "Add a vehicle so it can be assigned to deliveries and routes. Give it a fleet number and type to start — make, model and plate help identify it on the road."
173
+ }),
174
+ /* @__PURE__ */ J("form", {
175
+ onSubmit: W,
176
+ className: "max-w-2xl space-y-6",
177
+ children: [
178
+ /* @__PURE__ */ q(L, { message: P }),
179
+ /* @__PURE__ */ J(Y, { children: [/* @__PURE__ */ q("h2", {
180
+ className: "text-base font-semibold text-text-primary mb-4",
181
+ children: "Vehicle Details"
182
+ }), /* @__PURE__ */ J("div", {
183
+ className: "space-y-4",
184
+ children: [
185
+ /* @__PURE__ */ J("div", {
186
+ className: "grid grid-cols-1 md:grid-cols-2 gap-4",
187
+ children: [/* @__PURE__ */ J("div", {
188
+ className: "space-y-2",
189
+ children: [/* @__PURE__ */ J(w, {
190
+ htmlFor: "vehicleNumber",
191
+ children: ["Vehicle Number ", /* @__PURE__ */ q("span", {
192
+ className: "text-status-error-text",
193
+ children: "*"
194
+ })]
195
+ }), /* @__PURE__ */ q(C, {
196
+ id: "vehicleNumber",
197
+ value: _.vehicleNumber,
198
+ onChange: (e) => T((t) => ({
199
+ ...t,
200
+ vehicleNumber: e.target.value
201
+ })),
202
+ placeholder: "MTW-001",
203
+ required: !0
204
+ })]
205
+ }), /* @__PURE__ */ J("div", {
206
+ className: "space-y-2",
207
+ children: [/* @__PURE__ */ J(w, {
208
+ htmlFor: "type",
209
+ children: ["Type ", /* @__PURE__ */ q("span", {
210
+ className: "text-status-error-text",
211
+ children: "*"
212
+ })]
213
+ }), /* @__PURE__ */ J(E, {
214
+ value: _.type,
215
+ onValueChange: (e) => T((t) => ({
216
+ ...t,
217
+ type: e
218
+ })),
219
+ children: [/* @__PURE__ */ q(k, {
220
+ id: "type",
221
+ children: /* @__PURE__ */ q(A, {})
222
+ }), /* @__PURE__ */ q(D, { children: se.map((e) => /* @__PURE__ */ q(O, {
223
+ value: e.value,
224
+ children: e.label
225
+ }, e.value)) })]
226
+ })]
227
+ })]
228
+ }),
229
+ /* @__PURE__ */ J("div", {
230
+ className: "grid grid-cols-1 md:grid-cols-3 gap-4",
231
+ children: [
232
+ /* @__PURE__ */ J("div", {
233
+ className: "space-y-2",
234
+ children: [/* @__PURE__ */ q(w, {
235
+ htmlFor: "make",
236
+ children: "Make"
237
+ }), /* @__PURE__ */ q(C, {
238
+ id: "make",
239
+ value: _.make,
240
+ onChange: (e) => T((t) => ({
241
+ ...t,
242
+ make: e.target.value
243
+ })),
244
+ placeholder: "Ford"
245
+ })]
246
+ }),
247
+ /* @__PURE__ */ J("div", {
248
+ className: "space-y-2",
249
+ children: [/* @__PURE__ */ q(w, {
250
+ htmlFor: "model",
251
+ children: "Model"
252
+ }), /* @__PURE__ */ q(C, {
253
+ id: "model",
254
+ value: _.model,
255
+ onChange: (e) => T((t) => ({
256
+ ...t,
257
+ model: e.target.value
258
+ })),
259
+ placeholder: "Transit"
260
+ })]
261
+ }),
262
+ /* @__PURE__ */ J("div", {
263
+ className: "space-y-2",
264
+ children: [/* @__PURE__ */ q(w, {
265
+ htmlFor: "licensePlate",
266
+ children: "License Plate"
267
+ }), /* @__PURE__ */ q(C, {
268
+ id: "licensePlate",
269
+ value: _.licensePlate,
270
+ onChange: (e) => T((t) => ({
271
+ ...t,
272
+ licensePlate: e.target.value
273
+ })),
274
+ placeholder: "ABC-1234"
275
+ })]
276
+ })
277
+ ]
278
+ }),
279
+ /* @__PURE__ */ J("div", {
280
+ className: "grid grid-cols-1 md:grid-cols-3 gap-4",
281
+ children: [
282
+ /* @__PURE__ */ J("div", {
283
+ className: "space-y-2",
284
+ children: [/* @__PURE__ */ q(w, {
285
+ htmlFor: "ownershipType",
286
+ children: "Ownership"
287
+ }), /* @__PURE__ */ J(E, {
288
+ value: _.ownershipType || void 0,
289
+ onValueChange: (e) => T((t) => ({
290
+ ...t,
291
+ ownershipType: e
292
+ })),
293
+ children: [/* @__PURE__ */ q(k, {
294
+ id: "ownershipType",
295
+ children: /* @__PURE__ */ q(A, { placeholder: "Select ownership" })
296
+ }), /* @__PURE__ */ q(D, { children: le.map((e) => /* @__PURE__ */ q(O, {
297
+ value: e.value,
298
+ children: e.label
299
+ }, e.value)) })]
300
+ })]
301
+ }),
302
+ /* @__PURE__ */ J("div", {
303
+ className: "space-y-2",
304
+ children: [/* @__PURE__ */ q(w, {
305
+ htmlFor: "year",
306
+ children: "Year"
307
+ }), /* @__PURE__ */ q(C, {
308
+ id: "year",
309
+ type: "number",
310
+ min: 1980,
311
+ max: (/* @__PURE__ */ new Date()).getFullYear() + 1,
312
+ value: _.year,
313
+ onChange: (e) => T((t) => ({
314
+ ...t,
315
+ year: e.target.value
316
+ })),
317
+ placeholder: String((/* @__PURE__ */ new Date()).getFullYear())
318
+ })]
319
+ }),
320
+ /* @__PURE__ */ J("div", {
321
+ className: "space-y-2",
322
+ children: [/* @__PURE__ */ q(w, {
323
+ htmlFor: "vehicleStatus",
324
+ children: "Status"
325
+ }), /* @__PURE__ */ J(E, {
326
+ value: _.status,
327
+ onValueChange: (e) => T((t) => ({
328
+ ...t,
329
+ status: e
330
+ })),
331
+ children: [/* @__PURE__ */ q(k, {
332
+ id: "vehicleStatus",
333
+ children: /* @__PURE__ */ q(A, {})
334
+ }), /* @__PURE__ */ q(D, { children: ce.map((e) => /* @__PURE__ */ q(O, {
335
+ value: e.value,
336
+ children: e.label
337
+ }, e.value)) })]
338
+ })]
339
+ })
340
+ ]
341
+ }),
342
+ /* @__PURE__ */ J("div", {
343
+ className: "grid grid-cols-1 md:grid-cols-2 gap-4",
344
+ children: [/* @__PURE__ */ J("div", {
345
+ className: "space-y-2",
346
+ children: [/* @__PURE__ */ q(w, {
347
+ htmlFor: "fuelType",
348
+ children: "Fuel Type"
349
+ }), /* @__PURE__ */ q(C, {
350
+ id: "fuelType",
351
+ value: _.fuelType,
352
+ onChange: (e) => T((t) => ({
353
+ ...t,
354
+ fuelType: e.target.value
355
+ })),
356
+ placeholder: "Diesel"
357
+ })]
358
+ }), /* @__PURE__ */ J("div", {
359
+ className: "space-y-2",
360
+ children: [/* @__PURE__ */ q(w, {
361
+ htmlFor: "fuelEfficiency",
362
+ children: "Fuel Efficiency (L/100km)"
363
+ }), /* @__PURE__ */ q(C, {
364
+ id: "fuelEfficiency",
365
+ type: "number",
366
+ min: 0,
367
+ step: .1,
368
+ value: _.fuelEfficiencyLPer100Km,
369
+ onChange: (e) => T((t) => ({
370
+ ...t,
371
+ fuelEfficiencyLPer100Km: e.target.value
372
+ })),
373
+ placeholder: "12.5"
374
+ })]
375
+ })]
376
+ }),
377
+ /* @__PURE__ */ J("div", {
378
+ className: "grid grid-cols-1 md:grid-cols-3 gap-4",
379
+ children: [
380
+ /* @__PURE__ */ J("div", {
381
+ className: "space-y-2",
382
+ children: [/* @__PURE__ */ q(w, {
383
+ htmlFor: "capacityWeight",
384
+ children: "Capacity — Weight (kg)"
385
+ }), /* @__PURE__ */ q(C, {
386
+ id: "capacityWeight",
387
+ type: "number",
388
+ min: 0,
389
+ value: _.capacityWeight,
390
+ onChange: (e) => T((t) => ({
391
+ ...t,
392
+ capacityWeight: e.target.value
393
+ })),
394
+ placeholder: "5000"
395
+ })]
396
+ }),
397
+ /* @__PURE__ */ J("div", {
398
+ className: "space-y-2",
399
+ children: [/* @__PURE__ */ q(w, {
400
+ htmlFor: "capacityVolume",
401
+ children: "Capacity — Volume (m³)"
402
+ }), /* @__PURE__ */ q(C, {
403
+ id: "capacityVolume",
404
+ type: "number",
405
+ min: 0,
406
+ step: .1,
407
+ value: _.capacityVolume,
408
+ onChange: (e) => T((t) => ({
409
+ ...t,
410
+ capacityVolume: e.target.value
411
+ })),
412
+ placeholder: "18"
413
+ })]
414
+ }),
415
+ /* @__PURE__ */ J("div", {
416
+ className: "space-y-2",
417
+ children: [/* @__PURE__ */ q(w, {
418
+ htmlFor: "capacityPallets",
419
+ children: "Capacity — Pallets"
420
+ }), /* @__PURE__ */ q(C, {
421
+ id: "capacityPallets",
422
+ type: "number",
423
+ min: 0,
424
+ value: _.capacityPallets,
425
+ onChange: (e) => T((t) => ({
426
+ ...t,
427
+ capacityPallets: e.target.value
428
+ })),
429
+ placeholder: "12"
430
+ })]
431
+ })
432
+ ]
433
+ })
434
+ ]
435
+ })] }),
436
+ g && /* @__PURE__ */ J(y, {
437
+ className: "border-status-error-border",
438
+ children: [/* @__PURE__ */ q(x, { children: /* @__PURE__ */ J(S, {
439
+ className: "flex items-center gap-2 text-status-error-text",
440
+ children: [/* @__PURE__ */ q(s, { size: 18 }), " Delete Vehicle"]
441
+ }) }), /* @__PURE__ */ J(b, { children: [/* @__PURE__ */ q("p", {
442
+ className: "mb-3 text-sm text-text-secondary",
443
+ children: "Removes this vehicle from the active fleet. It can no longer be assigned to drivers, orders, or routes. This cannot be undone from here."
444
+ }), /* @__PURE__ */ J(v, {
445
+ type: "button",
446
+ variant: "outline",
447
+ className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
448
+ onClick: () => R(!0),
449
+ children: [/* @__PURE__ */ q(s, { size: 16 }), " Delete this vehicle"]
450
+ })] })]
451
+ })
452
+ ]
453
+ }),
454
+ /* @__PURE__ */ q(Z, {
455
+ open: I,
456
+ onOpenChange: R,
457
+ children: /* @__PURE__ */ J(Q, { children: [
458
+ /* @__PURE__ */ J(ae, { children: [/* @__PURE__ */ q(oe, { children: "Delete this vehicle?" }), /* @__PURE__ */ J($, { children: [
459
+ "This removes ",
460
+ _.vehicleNumber || "this vehicle",
461
+ " from the active fleet. It cannot be undone from here."
462
+ ] })] }),
463
+ /* @__PURE__ */ q("div", {
464
+ className: "px-1",
465
+ children: /* @__PURE__ */ q(L, { message: V })
466
+ }),
467
+ /* @__PURE__ */ J(ie, { children: [/* @__PURE__ */ q(v, {
468
+ variant: "outline",
469
+ onClick: () => R(!1),
470
+ disabled: z,
471
+ children: "Cancel"
472
+ }), /* @__PURE__ */ q(v, {
473
+ className: "bg-status-error-text text-text-inverse hover:opacity-90",
474
+ onClick: async () => {
475
+ if (t) {
476
+ B(!0), H(null);
477
+ try {
478
+ await l(t), R(!1), r?.(u(n, "fleet/vehicles"));
479
+ } catch (e) {
480
+ H(e instanceof Error ? e.message : "Failed to delete vehicle.");
481
+ } finally {
482
+ B(!1);
483
+ }
484
+ }
485
+ },
486
+ disabled: z,
487
+ children: z ? "Deleting..." : "Delete vehicle"
488
+ })] })
489
+ ] })
490
+ })
491
+ ]
236
492
  });
237
493
  }
238
- function Z() {
239
- let { vehicleId: a } = ee(), { basePath: d, navigate: x } = u(), { vehicle: S, isLoading: w, error: T, refetch: E } = f(a), D = B(), { message: O, notify: P } = I(), { t: H } = te(), U = (e, t) => {
240
- let n = H(e);
494
+ function de() {
495
+ let { vehicleId: a } = te(), { basePath: s, navigate: f } = d(), { vehicle: p, isLoading: C, error: w, refetch: E } = m(a), D = U(), { message: O, notify: k } = z(), { t: A } = ne(), P = (e, t) => {
496
+ let n = A(e);
241
497
  return n === e ? t : n;
242
- }, Y = W().pathname.endsWith("/edit"), { drivers: Z, isLoading: re, error: Q } = p(Y ? void 0 : a), ie = () => x?.(l(d, "fleet/vehicles")), $ = (e) => x?.(l(d, e));
243
- return a ? Y ? /* @__PURE__ */ G(X, { editId: a }) : w ? /* @__PURE__ */ G(A, { message: "Loading vehicle details..." }) : T || !S ? /* @__PURE__ */ G(k, {
498
+ }, L = ee().pathname.endsWith("/edit"), { drivers: G, isLoading: K, error: Z } = h(L ? void 0 : a), Q = () => f?.(u(s, "fleet/vehicles")), $ = (e) => f?.(u(s, e));
499
+ return a ? L ? /* @__PURE__ */ q(ue, { editId: a }) : C ? /* @__PURE__ */ q(M, { message: "Loading vehicle details..." }) : w || !p ? /* @__PURE__ */ q(j, {
244
500
  title: "Vehicle not found",
245
501
  onRetry: E
246
- }) : /* @__PURE__ */ K(j, {
247
- title: S.vehicleNumber,
248
- subtitle: `${S.make} ${S.model} (${S.year})`,
249
- icon: /* @__PURE__ */ G(s, { size: 24 }),
250
- headerActions: /* @__PURE__ */ K("div", {
502
+ }) : /* @__PURE__ */ J(N, {
503
+ title: p.vehicleNumber,
504
+ subtitle: `${p.make} ${p.model}${p.year ? ` (${p.year})` : ""}`,
505
+ icon: /* @__PURE__ */ q(c, { size: 24 }),
506
+ headerActions: /* @__PURE__ */ J("div", {
251
507
  className: "flex gap-2",
252
- children: [/* @__PURE__ */ K(g, {
508
+ children: [/* @__PURE__ */ J(v, {
253
509
  variant: "outline",
254
- onClick: ie,
255
- children: [/* @__PURE__ */ G(e, { size: 16 }), " Back"]
256
- }), /* @__PURE__ */ K(g, {
257
- onClick: () => x?.(l(d, "fleet/vehicles/" + a + "/edit")),
258
- children: [/* @__PURE__ */ G(o, { size: 16 }), " Edit"]
510
+ onClick: Q,
511
+ children: [/* @__PURE__ */ q(e, { size: 16 }), " Back"]
512
+ }), /* @__PURE__ */ J(v, {
513
+ onClick: () => f?.(u(s, "fleet/vehicles/" + a + "/edit")),
514
+ children: [/* @__PURE__ */ q(o, { size: 16 }), " Edit"]
259
515
  })]
260
516
  }),
261
- headerContent: /* @__PURE__ */ K("div", {
517
+ headerContent: /* @__PURE__ */ J("div", {
262
518
  className: "flex gap-2",
263
- children: [/* @__PURE__ */ G(M, {
264
- status: S.status,
519
+ children: [/* @__PURE__ */ q(F, {
520
+ status: p.status,
265
521
  type: "vehicle"
266
- }), /* @__PURE__ */ G(N, { type: S.type })]
522
+ }), /* @__PURE__ */ q(I, { type: p.type })]
267
523
  }),
268
524
  children: [
269
- /* @__PURE__ */ G(J, {
270
- icon: /* @__PURE__ */ G(s, { size: 18 }),
525
+ /* @__PURE__ */ q(X, {
526
+ icon: /* @__PURE__ */ q(c, { size: 18 }),
271
527
  children: "The full record for this vehicle — specs, capacity, fuel and mileage, who is driving it and where it is right now. Use it to confirm a vehicle is fuelled, crewed and the right size before dispatching it on a delivery."
272
528
  }),
273
- /* @__PURE__ */ G(ne, {
529
+ /* @__PURE__ */ q(re, {
274
530
  storageKey: "movethewheels-vehicle-details",
275
531
  steps: [{
276
532
  id: "assign",
277
533
  label: "Assign to a delivery",
278
534
  description: "Put this vehicle on an order that fits its capacity.",
279
- icon: /* @__PURE__ */ G(r, { size: 16 }),
535
+ icon: /* @__PURE__ */ q(r, { size: 16 }),
280
536
  onClick: () => $("orders")
281
537
  }, {
282
538
  id: "driver",
283
- label: Z.length > 0 ? "Review the assigned driver" : "Assign a driver",
539
+ label: G.length > 0 ? "Review the assigned driver" : "Assign a driver",
284
540
  description: "A vehicle needs a driver before it can be dispatched.",
285
- icon: /* @__PURE__ */ G(c, { size: 16 }),
286
- done: Z.length > 0,
287
- onClick: () => Z[0] ? $(`fleet/drivers/${Z[0].id}`) : $("fleet/drivers")
541
+ icon: /* @__PURE__ */ q(l, { size: 16 }),
542
+ done: G.length > 0,
543
+ onClick: () => G[0] ? $(`fleet/drivers/${G[0].id}`) : $("fleet/drivers")
288
544
  }]
289
545
  }),
290
- O && /* @__PURE__ */ G("div", {
546
+ O && /* @__PURE__ */ q("div", {
291
547
  className: "mb-2",
292
- children: /* @__PURE__ */ G(F, { message: O })
548
+ children: /* @__PURE__ */ q(R, { message: O })
293
549
  }),
294
- /* @__PURE__ */ K("div", {
550
+ /* @__PURE__ */ J("div", {
295
551
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
296
- children: [/* @__PURE__ */ K("div", {
552
+ children: [/* @__PURE__ */ J("div", {
297
553
  className: "lg:col-span-2 space-y-6",
298
554
  children: [
299
- /* @__PURE__ */ K(q, { children: [/* @__PURE__ */ G("h2", {
555
+ /* @__PURE__ */ J(Y, { children: [/* @__PURE__ */ q("h2", {
300
556
  className: "text-base font-semibold text-text-primary mb-4",
301
557
  children: "Vehicle Information"
302
- }), /* @__PURE__ */ K("div", {
558
+ }), /* @__PURE__ */ J("div", {
303
559
  className: "grid grid-cols-2 md:grid-cols-3 gap-6",
304
560
  children: [
305
- /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G("p", {
561
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
306
562
  className: "text-sm text-text-secondary",
307
563
  children: "Type"
308
- }), /* @__PURE__ */ G("p", {
564
+ }), /* @__PURE__ */ q("p", {
309
565
  className: "font-medium capitalize",
310
- children: S.type
566
+ children: p.type
311
567
  })] }),
312
- /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G("p", {
568
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
313
569
  className: "text-sm text-text-secondary",
314
570
  children: "Make"
315
- }), /* @__PURE__ */ G("p", {
571
+ }), /* @__PURE__ */ q("p", {
316
572
  className: "font-medium",
317
- children: S.make || "—"
573
+ children: p.make || "—"
318
574
  })] }),
319
- /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G("p", {
575
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
320
576
  className: "text-sm text-text-secondary",
321
577
  children: "Model"
322
- }), /* @__PURE__ */ G("p", {
578
+ }), /* @__PURE__ */ q("p", {
323
579
  className: "font-medium",
324
- children: S.model || "—"
580
+ children: p.model || "—"
325
581
  })] }),
326
- /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G("p", {
582
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
327
583
  className: "text-sm text-text-secondary",
328
584
  children: "Year"
329
- }), /* @__PURE__ */ G("p", {
585
+ }), /* @__PURE__ */ q("p", {
330
586
  className: "font-medium",
331
- children: S.year
587
+ children: p.year ?? "—"
332
588
  })] }),
333
- /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G("p", {
589
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
334
590
  className: "text-sm text-text-secondary",
335
591
  children: "License Plate"
336
- }), /* @__PURE__ */ G("p", {
592
+ }), /* @__PURE__ */ q("p", {
337
593
  className: "font-medium",
338
- children: S.licensePlate || "—"
594
+ children: p.licensePlate || "—"
339
595
  })] }),
340
- /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G("p", {
596
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
341
597
  className: "text-sm text-text-secondary",
342
598
  children: "Ownership"
343
- }), /* @__PURE__ */ G("p", {
599
+ }), /* @__PURE__ */ q("p", {
344
600
  className: "font-medium capitalize",
345
- children: S.ownershipType || "—"
601
+ children: p.ownershipType || "—"
346
602
  })] })
347
603
  ]
348
604
  })] }),
349
- /* @__PURE__ */ K(_, { children: [/* @__PURE__ */ G(y, { children: /* @__PURE__ */ G(b, { children: "Capacity" }) }), /* @__PURE__ */ G(v, { children: /* @__PURE__ */ K("div", {
605
+ /* @__PURE__ */ J(y, { children: [/* @__PURE__ */ q(x, { children: /* @__PURE__ */ q(S, { children: "Capacity" }) }), /* @__PURE__ */ q(b, { children: /* @__PURE__ */ J("div", {
350
606
  className: "grid grid-cols-1 sm:grid-cols-3 gap-6",
351
607
  children: [
352
- /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G("p", {
608
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
353
609
  className: "text-sm text-text-secondary",
354
610
  children: "Weight"
355
- }), /* @__PURE__ */ K("p", {
611
+ }), /* @__PURE__ */ J("p", {
356
612
  className: "text-2xl font-bold",
357
- children: [S.capacity.weight, /* @__PURE__ */ G("span", {
613
+ children: [p.capacity.weight, /* @__PURE__ */ q("span", {
358
614
  className: "text-sm font-normal",
359
615
  children: " kg"
360
616
  })]
361
617
  })] }),
362
- /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G("p", {
618
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
363
619
  className: "text-sm text-text-secondary",
364
620
  children: "Volume"
365
- }), /* @__PURE__ */ K("p", {
621
+ }), /* @__PURE__ */ J("p", {
366
622
  className: "text-2xl font-bold",
367
- children: [S.capacity.volume, /* @__PURE__ */ G("span", {
623
+ children: [p.capacity.volume, /* @__PURE__ */ q("span", {
368
624
  className: "text-sm font-normal",
369
625
  children: " m³"
370
626
  })]
371
627
  })] }),
372
- S.capacity.pallets && /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G("p", {
628
+ p.capacity.pallets && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
373
629
  className: "text-sm text-text-secondary",
374
630
  children: "Pallets"
375
- }), /* @__PURE__ */ G("p", {
631
+ }), /* @__PURE__ */ q("p", {
376
632
  className: "text-2xl font-bold",
377
- children: S.capacity.pallets
633
+ children: p.capacity.pallets
378
634
  })] })
379
635
  ]
380
636
  }) })] }),
381
- /* @__PURE__ */ G(z, {
637
+ /* @__PURE__ */ q(H, {
382
638
  entityType: "vehicle",
383
- entityId: S.id
639
+ entityId: p.id
384
640
  })
385
641
  ]
386
- }), /* @__PURE__ */ K("div", {
642
+ }), /* @__PURE__ */ J("div", {
387
643
  className: "space-y-6",
388
644
  children: [
389
- /* @__PURE__ */ K(_, { children: [/* @__PURE__ */ G(y, { children: /* @__PURE__ */ K(b, {
645
+ /* @__PURE__ */ J(y, { children: [/* @__PURE__ */ q(x, { children: /* @__PURE__ */ J(S, {
390
646
  className: "flex items-center gap-2",
391
- children: [/* @__PURE__ */ G(t, { size: 18 }), " Fuel & Mileage"]
392
- }) }), /* @__PURE__ */ K(v, {
647
+ children: [/* @__PURE__ */ q(t, { size: 18 }), " Fuel & Mileage"]
648
+ }) }), /* @__PURE__ */ J(b, {
393
649
  className: "space-y-4",
394
- children: [S.fuelLevel !== void 0 && /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ K("div", {
395
- className: "flex justify-between text-sm mb-2",
396
- children: [/* @__PURE__ */ G("span", { children: "Fuel Level" }), /* @__PURE__ */ K("span", { children: [S.fuelLevel, "%"] })]
397
- }), /* @__PURE__ */ G(C, { value: S.fuelLevel })] }), S.mileage !== void 0 && /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G("p", {
398
- className: "text-sm text-text-secondary",
399
- children: "Total Mileage"
400
- }), /* @__PURE__ */ K("p", {
401
- className: "text-2xl font-bold",
402
- children: [
403
- S.mileage.toLocaleString(),
404
- " ",
405
- /* @__PURE__ */ G("span", {
406
- className: "text-sm font-normal",
407
- children: "miles"
408
- })
409
- ]
410
- })] })]
650
+ children: [
651
+ p.fuelLevel !== void 0 && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ J("div", {
652
+ className: "flex justify-between text-sm mb-2",
653
+ children: [/* @__PURE__ */ q("span", { children: "Fuel Level" }), /* @__PURE__ */ J("span", { children: [p.fuelLevel, "%"] })]
654
+ }), /* @__PURE__ */ q(T, { value: p.fuelLevel })] }),
655
+ p.mileage !== void 0 && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
656
+ className: "text-sm text-text-secondary",
657
+ children: "Total Mileage"
658
+ }), /* @__PURE__ */ J("p", {
659
+ className: "text-2xl font-bold",
660
+ children: [
661
+ p.mileage.toLocaleString(),
662
+ " ",
663
+ /* @__PURE__ */ q("span", {
664
+ className: "text-sm font-normal",
665
+ children: "miles"
666
+ })
667
+ ]
668
+ })] }),
669
+ (p.fuelType || p.fuelEfficiencyLPer100Km !== void 0) && /* @__PURE__ */ J("div", {
670
+ className: "grid grid-cols-2 gap-4",
671
+ children: [p.fuelType && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
672
+ className: "text-sm text-text-secondary",
673
+ children: "Fuel Type"
674
+ }), /* @__PURE__ */ q("p", {
675
+ className: "font-medium",
676
+ children: p.fuelType
677
+ })] }), p.fuelEfficiencyLPer100Km !== void 0 && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
678
+ className: "text-sm text-text-secondary",
679
+ children: "Efficiency"
680
+ }), /* @__PURE__ */ J("p", {
681
+ className: "font-medium",
682
+ children: [p.fuelEfficiencyLPer100Km, " L/100km"]
683
+ })] })]
684
+ })
685
+ ]
411
686
  })] }),
412
- /* @__PURE__ */ K(_, { children: [/* @__PURE__ */ G(y, { children: /* @__PURE__ */ K(b, {
687
+ /* @__PURE__ */ J(y, { children: [/* @__PURE__ */ q(x, { children: /* @__PURE__ */ J(S, {
413
688
  className: "flex items-center gap-2",
414
- children: [/* @__PURE__ */ G(c, { size: 18 }), " Assigned Driver"]
415
- }) }), /* @__PURE__ */ G(v, {
689
+ children: [/* @__PURE__ */ q(l, { size: 18 }), " Assigned Driver"]
690
+ }) }), /* @__PURE__ */ q(b, {
416
691
  className: "space-y-4",
417
- children: re ? /* @__PURE__ */ G("p", {
692
+ children: K ? /* @__PURE__ */ q("p", {
418
693
  className: "text-sm text-text-secondary",
419
694
  children: "Loading assignment…"
420
- }) : Q ? /* @__PURE__ */ G("p", {
695
+ }) : Z ? /* @__PURE__ */ q("p", {
421
696
  className: "text-sm text-status-error-text",
422
- children: Q.message
423
- }) : Z.length === 0 ? /* @__PURE__ */ K("div", {
697
+ children: Z.message
698
+ }) : G.length === 0 ? /* @__PURE__ */ J("div", {
424
699
  className: "space-y-3",
425
- children: [/* @__PURE__ */ G("p", {
700
+ children: [/* @__PURE__ */ q("p", {
426
701
  className: "text-sm text-text-secondary",
427
702
  children: "No driver is assigned to this vehicle yet."
428
- }), /* @__PURE__ */ G(g, {
703
+ }), /* @__PURE__ */ q(v, {
429
704
  variant: "outline",
430
705
  size: "sm",
431
706
  onClick: () => $("fleet/drivers"),
432
707
  children: "Assign from the roster"
433
708
  })]
434
- }) : Z.map((e) => /* @__PURE__ */ K("div", {
709
+ }) : G.map((e) => /* @__PURE__ */ J("div", {
435
710
  role: "button",
436
711
  tabIndex: 0,
437
712
  className: "flex w-full items-start gap-3 rounded-lg p-2 text-left hover:bg-bg-sunken/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg",
@@ -439,34 +714,34 @@ function Z() {
439
714
  onKeyDown: (t) => {
440
715
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), $(`fleet/drivers/${e.id}`));
441
716
  },
442
- children: [/* @__PURE__ */ G(m, { children: /* @__PURE__ */ G(h, { children: R(e.fullName) }) }), /* @__PURE__ */ K("div", {
717
+ children: [/* @__PURE__ */ q(g, { children: /* @__PURE__ */ q(_, { children: V(e.fullName) }) }), /* @__PURE__ */ J("div", {
443
718
  className: "min-w-0 space-y-1",
444
719
  children: [
445
- /* @__PURE__ */ G("p", {
720
+ /* @__PURE__ */ q("p", {
446
721
  className: "font-medium",
447
722
  children: e.fullName
448
723
  }),
449
- /* @__PURE__ */ G("p", {
724
+ /* @__PURE__ */ q("p", {
450
725
  className: "text-xs text-text-secondary",
451
726
  children: e.employeeId
452
727
  }),
453
- /* @__PURE__ */ G(M, {
728
+ /* @__PURE__ */ q(F, {
454
729
  status: e.status,
455
730
  type: "driver",
456
731
  size: "sm"
457
732
  }),
458
- e.email && /* @__PURE__ */ K("p", {
733
+ e.email && /* @__PURE__ */ J("p", {
459
734
  className: "flex items-center gap-1.5 truncate text-sm text-text-secondary",
460
735
  children: [
461
- /* @__PURE__ */ G(n, { size: 13 }),
736
+ /* @__PURE__ */ q(n, { size: 13 }),
462
737
  " ",
463
738
  e.email
464
739
  ]
465
740
  }),
466
- e.phone && /* @__PURE__ */ K("p", {
741
+ e.phone && /* @__PURE__ */ J("p", {
467
742
  className: "flex items-center gap-1.5 text-sm text-text-secondary",
468
743
  children: [
469
- /* @__PURE__ */ G(i, { size: 13 }),
744
+ /* @__PURE__ */ q(i, { size: 13 }),
470
745
  " ",
471
746
  e.phone
472
747
  ]
@@ -475,28 +750,28 @@ function Z() {
475
750
  })]
476
751
  }, e.id))
477
752
  })] }),
478
- /* @__PURE__ */ G(V, {
479
- vehicle: S,
480
- t: U,
753
+ /* @__PURE__ */ q(W, {
754
+ vehicle: p,
755
+ t: P,
481
756
  onRecord: async (e) => {
482
- await D(S.id, e), P(U("movethewheels.vehicles.service.saved", "Service recorded.")), E();
757
+ await D(p.id, e), k(P("movethewheels.vehicles.service.saved", "Service recorded.")), E();
483
758
  }
484
759
  }),
485
- S.currentLocation && /* @__PURE__ */ K(_, { children: [/* @__PURE__ */ G(y, { children: /* @__PURE__ */ K(b, {
760
+ p.currentLocation && /* @__PURE__ */ J(y, { children: [/* @__PURE__ */ q(x, { children: /* @__PURE__ */ J(S, {
486
761
  className: "flex items-center gap-2",
487
- children: [/* @__PURE__ */ G(r, { size: 18 }), " Current Location"]
488
- }) }), /* @__PURE__ */ K(v, { children: [/* @__PURE__ */ G("p", {
762
+ children: [/* @__PURE__ */ q(r, { size: 18 }), " Current Location"]
763
+ }) }), /* @__PURE__ */ J(b, { children: [/* @__PURE__ */ q("p", {
489
764
  className: "text-sm",
490
- children: S.currentLocation.address || "Location updating..."
491
- }), /* @__PURE__ */ K("p", {
765
+ children: p.currentLocation.address || "Location updating..."
766
+ }), /* @__PURE__ */ J("p", {
492
767
  className: "text-xs text-text-secondary mt-1",
493
- children: ["Updated ", L(S.currentLocation.timestamp || /* @__PURE__ */ new Date(), "relative")]
768
+ children: ["Updated ", B(p.currentLocation.timestamp || /* @__PURE__ */ new Date(), "relative")]
494
769
  })] })] })
495
770
  ]
496
771
  })]
497
772
  })
498
773
  ]
499
- }) : /* @__PURE__ */ G(X, {});
774
+ }) : /* @__PURE__ */ q(ue, {});
500
775
  }
501
776
  //#endregion
502
- export { Z as default };
777
+ export { de as default };