@burdenoff/microfe-movethewheels 2026.920.3 → 2026.923.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/components/CarbonFootprintPanel.js +1 -1
  2. package/dist/components/CustomerPicker.js +76 -65
  3. package/dist/components/DataTable.js +140 -139
  4. package/dist/components/DocumentsCard.js +14 -8
  5. package/dist/generated/wspace-types.d.ts +2719 -8
  6. package/dist/hooks/index.js +1 -1
  7. package/dist/hooks/useAnalytics.js +21 -1
  8. package/dist/hooks/useCustomers.js +94 -78
  9. package/dist/hooks/useDebouncedValue.js +11 -0
  10. package/dist/hooks/useEntityDocuments.js +28 -18
  11. package/dist/hooks/useEpod.js +24 -17
  12. package/dist/hooks/useFleet.js +148 -125
  13. package/dist/hooks/useInventory.js +255 -186
  14. package/dist/hooks/useMultiModalShipments.js +35 -27
  15. package/dist/hooks/useOrders.js +139 -134
  16. package/dist/hooks/useRoutes.js +97 -75
  17. package/dist/hooks/useTracking.js +100 -88
  18. package/dist/index.js +6 -6
  19. package/dist/movethewheels/components/CustomerPicker.d.ts +3 -1
  20. package/dist/movethewheels/components/DataTable.d.ts +5 -1
  21. package/dist/movethewheels/hooks/useCustomers.d.ts +0 -1
  22. package/dist/movethewheels/hooks/useDebouncedValue.d.ts +1 -0
  23. package/dist/movethewheels/hooks/useEntityDocuments.d.ts +2 -0
  24. package/dist/movethewheels/hooks/useEpod.d.ts +6 -1
  25. package/dist/movethewheels/hooks/useFleet.d.ts +49 -5
  26. package/dist/movethewheels/hooks/useInventory.d.ts +24 -17
  27. package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +6 -1
  28. package/dist/movethewheels/hooks/useOrders.d.ts +48 -5
  29. package/dist/movethewheels/hooks/useRoutes.d.ts +18 -1
  30. package/dist/movethewheels/hooks/useTracking.d.ts +12 -11
  31. package/dist/movethewheels/types/index.d.ts +12 -5
  32. package/dist/pages/CreateOrderPage.js +191 -129
  33. package/dist/pages/CustomersPage.js +61 -54
  34. package/dist/pages/DeliveryCapturePage.js +131 -109
  35. package/dist/pages/DriversPage.js +100 -92
  36. package/dist/pages/InventoryPage.js +239 -236
  37. package/dist/pages/MultiModalShipmentPage.js +163 -130
  38. package/dist/pages/OrderDetailsPage.js +190 -106
  39. package/dist/pages/OrdersListPage.js +66 -60
  40. package/dist/pages/ProductDetailsPage.js +241 -200
  41. package/dist/pages/ProductsPage.js +59 -52
  42. package/dist/pages/RouteDetailsPage.js +324 -293
  43. package/dist/pages/RoutesPage.js +55 -48
  44. package/dist/pages/VehiclesPage.js +63 -56
  45. package/dist/pages/WarehousesPage.js +60 -53
  46. package/package.json +1 -1
  47. package/src/generated/wspace-types.ts +3136 -8
  48. package/src/movethewheels/components/CarbonFootprintPanel.tsx +0 -1
  49. package/src/movethewheels/components/CustomerPicker.tsx +14 -0
  50. package/src/movethewheels/components/DataTable.tsx +34 -18
  51. package/src/movethewheels/components/DocumentsCard.tsx +6 -1
  52. package/src/movethewheels/components/maps/leaflet-setup.ts +1 -8
  53. package/src/movethewheels/hooks/useAnalytics.ts +27 -0
  54. package/src/movethewheels/hooks/useCustomers.ts +64 -24
  55. package/src/movethewheels/hooks/useDebouncedValue.ts +12 -0
  56. package/src/movethewheels/hooks/useEntityDocuments.ts +43 -25
  57. package/src/movethewheels/hooks/useEpod.ts +14 -7
  58. package/src/movethewheels/hooks/useFleet.ts +66 -38
  59. package/src/movethewheels/hooks/useFleetIntelligence.ts +1 -4
  60. package/src/movethewheels/hooks/useInventory.ts +211 -90
  61. package/src/movethewheels/hooks/useMultiModalShipments.ts +15 -11
  62. package/src/movethewheels/hooks/useOrders.ts +48 -14
  63. package/src/movethewheels/hooks/useRoutes.ts +81 -24
  64. package/src/movethewheels/hooks/useTracking.ts +130 -98
  65. package/src/movethewheels/pages/CreateOrderPage.tsx +93 -2
  66. package/src/movethewheels/pages/CustomersPage.tsx +11 -1
  67. package/src/movethewheels/pages/DeliveryCapturePage.tsx +31 -1
  68. package/src/movethewheels/pages/DriversPage.tsx +24 -12
  69. package/src/movethewheels/pages/InventoryPage.tsx +57 -32
  70. package/src/movethewheels/pages/MultiModalShipmentPage.tsx +52 -3
  71. package/src/movethewheels/pages/OrderDetailsPage.tsx +91 -6
  72. package/src/movethewheels/pages/OrdersListPage.tsx +20 -3
  73. package/src/movethewheels/pages/ProductDetailsPage.tsx +52 -3
  74. package/src/movethewheels/pages/ProductsPage.tsx +11 -1
  75. package/src/movethewheels/pages/RouteDetailsPage.tsx +45 -5
  76. package/src/movethewheels/pages/RoutesPage.tsx +11 -1
  77. package/src/movethewheels/pages/VehiclesPage.tsx +19 -2
  78. package/src/movethewheels/pages/WarehousesPage.tsx +11 -1
  79. package/src/movethewheels/types/index.ts +12 -5
@@ -11,25 +11,26 @@ import { Package as i } from "../node_modules/lucide-react/dist/esm/icons/packag
11
11
  import { Phone as ae } from "../node_modules/lucide-react/dist/esm/icons/phone.js";
12
12
  import { Printer as a } from "../node_modules/lucide-react/dist/esm/icons/printer.js";
13
13
  import { SquarePen as o } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
14
- import { Truck as oe } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
15
- import { UserCheck as se } from "../node_modules/lucide-react/dist/esm/icons/user-check.js";
16
- import { User as ce } from "../node_modules/lucide-react/dist/esm/icons/user.js";
17
- import { joinPath as s } from "../utils/navigation.js";
18
- import { useMoveTheWheels as le } from "../providers/MoveTheWheelsProvider.js";
19
- import { useOrder as ue, useOrders as de } from "../hooks/useOrders.js";
20
- import { useFleet as fe } from "../hooks/useFleet.js";
21
- import { Badge as c, Button as l, Card as u, CardContent as d, CardHeader as f, CardTitle as p, Label as m, Select as h, SelectContent as g, SelectItem as _, SelectTrigger as v, SelectValue as y, Separator as b, Table as pe, TableBody as me, TableCell as x, TableHead as S, TableHeader as he, TableRow as C } from "../components/ui.js";
14
+ import { Truck as s } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
15
+ import { UserCheck as oe } from "../node_modules/lucide-react/dist/esm/icons/user-check.js";
16
+ import { User as se } from "../node_modules/lucide-react/dist/esm/icons/user.js";
17
+ import { joinPath as c } from "../utils/navigation.js";
18
+ import { useMoveTheWheels as ce } from "../providers/MoveTheWheelsProvider.js";
19
+ import { useOrder as le, useOrders as ue } from "../hooks/useOrders.js";
20
+ import { useFleet as l } from "../hooks/useFleet.js";
21
+ import { Badge as u, Button as d, Card as f, CardContent as p, CardHeader as m, CardTitle as h, Input as de, Label as g, Select as _, SelectContent as v, SelectItem as y, SelectTrigger as fe, SelectValue as b, Separator as x, Table as pe, TableBody as me, TableCell as S, TableHead as C, TableHeader as he, TableRow as w } from "../components/ui.js";
22
22
  import { ErrorState as ge, LoadingState as _e, PageLayout as ve } from "../components/PageLayout.js";
23
- import { PaymentStatusBadge as ye, PriorityBadge as be, StatusBadge as w } from "../components/StatusBadge.js";
23
+ import { PaymentStatusBadge as ye, PriorityBadge as be, StatusBadge as T } from "../components/StatusBadge.js";
24
24
  import { FormError as xe } from "../components/FormError.js";
25
- import { Notice as Se, useNotice as T } from "../components/Notice.js";
25
+ import { Notice as Se, useNotice as Ce } from "../components/Notice.js";
26
26
  import { formatAddress as E, formatCurrency as D, formatDate as O } from "../utils/formatters.js";
27
- import { DocumentsCard as Ce } from "../components/DocumentsCard.js";
28
- import { ProofOfDeliveryCard as we } from "../components/ProofOfDeliveryCard.js";
29
- import { useState as k } from "react";
30
- import { useParams as Te } from "react-router";
27
+ import { DocumentsCard as we } from "../components/DocumentsCard.js";
28
+ import { useDebouncedValue as Te } from "../hooks/useDebouncedValue.js";
29
+ import { ProofOfDeliveryCard as Ee } from "../components/ProofOfDeliveryCard.js";
30
+ import { useEffect as De, useState as k } from "react";
31
+ import { useParams as Oe } from "react-router";
31
32
  import { jsx as A, jsxs as j } from "react/jsx-runtime";
32
- import { EmphasisPanel as Ee, NextSteps as De, PagePurpose as Oe } from "@burdenoff/fe-libs/ui";
33
+ import { EmphasisPanel as ke, NextSteps as Ae, PagePurpose as je } from "@burdenoff/fe-libs/ui";
33
34
  //#region src/movethewheels/pages/OrderDetailsPage.tsx
34
35
  var M = [
35
36
  "pending",
@@ -50,42 +51,68 @@ var M = [
50
51
  cancelled: "Cancelled",
51
52
  failed: "Failed"
52
53
  };
53
- function ke(e) {
54
+ function Me(e) {
54
55
  let t = M.indexOf(e);
55
56
  return t === -1 || t >= M.length - 1 ? null : M[t + 1];
56
57
  }
57
58
  function P() {
58
- let { orderId: M } = Te(), { basePath: P, navigate: F } = le(), { order: I, isLoading: Ae, error: je, refetch: L } = ue(M), { updateOrder: Me, updateOrderStatus: Ne } = de(), { vehicles: Pe, drivers: Fe } = fe(), { message: R, notify: z } = T(), [B, V] = k(""), [H, U] = k(""), [W, G] = k(!1), [K, q] = k(!1), [J, Y] = k(null), X = Pe.filter((e) => e.status === "available" || e.id === I?.vehicleId), Z = Fe.filter((e) => e.status === "available" || e.id === I?.driverId), Ie = async () => {
59
- if (!M || !B && !H) {
60
- Y("Pick a vehicle and/or a driver to assign.");
59
+ let { orderId: M } = Oe(), { basePath: P, navigate: F } = ce(), { order: I, isLoading: Ne, error: Pe, refetch: L } = le(M), { updateOrder: Fe, updateOrderStatus: Ie } = ue(), [R, Le] = k(""), [z, B] = k(""), [V, H] = k(""), [U, W] = k(!1), [G, K] = k(!1), [q, J] = k(null), Y = Te(R), { vehicles: X, isLoading: Z } = l({
60
+ limit: 20,
61
+ filters: {
62
+ search: Y || void 0,
63
+ driverId: V || void 0
64
+ }
65
+ }), { drivers: Q, isLoading: Re } = l({
66
+ limit: 20,
67
+ filters: {
68
+ search: Y || void 0,
69
+ vehicleId: z || void 0
70
+ }
71
+ }), { message: ze, notify: Be } = Ce(), Ve = X.filter((e) => e.status === "available" || e.id === I?.vehicleId), He = Q.filter((e) => e.status === "available" || e.id === I?.driverId);
72
+ De(() => {
73
+ !Re && V && !Q.some((e) => e.id === V) && H("");
74
+ }, [
75
+ Q,
76
+ Re,
77
+ V
78
+ ]), De(() => {
79
+ !Z && z && !X.some((e) => e.id === z) && B("");
80
+ }, [
81
+ z,
82
+ X,
83
+ Z
84
+ ]);
85
+ let Ue = async () => {
86
+ if (!M || !z && !V) {
87
+ J("Pick a vehicle and/or a driver to assign.");
61
88
  return;
62
89
  }
63
- G(!0), Y(null);
90
+ W(!0), J(null);
64
91
  try {
65
- await Me(M, {
66
- vehicleId: B || void 0,
67
- driverId: H || void 0
68
- }), z("Assignment updated."), V(""), U(""), L();
92
+ await Fe(M, {
93
+ vehicleId: z || void 0,
94
+ driverId: V || void 0
95
+ }), Be("Assignment updated."), B(""), H(""), L();
69
96
  } catch (e) {
70
- Y(e instanceof Error ? e.message : "Failed to update assignment.");
97
+ J(e instanceof Error ? e.message : "Failed to update assignment.");
71
98
  } finally {
72
- G(!1);
99
+ W(!1);
73
100
  }
74
- }, Q = async (e, t) => {
101
+ }, We = async (e, t) => {
75
102
  if (M) {
76
- q(!0), Y(null);
103
+ K(!0), J(null);
77
104
  try {
78
- await Ne(M, e), z(t), L();
105
+ await Ie(M, e), Be(t), L();
79
106
  } catch (e) {
80
- Y(e instanceof Error ? e.message : "Failed to update status.");
107
+ J(e instanceof Error ? e.message : "Failed to update status.");
81
108
  } finally {
82
- q(!1);
109
+ K(!1);
83
110
  }
84
111
  }
85
112
  }, $ = (e) => {
86
- F && F(s(P, e));
113
+ F && F(c(P, e));
87
114
  };
88
- return Ae ? /* @__PURE__ */ A(_e, { message: "Loading order details..." }) : je || !I ? /* @__PURE__ */ A(ge, {
115
+ return Ne ? /* @__PURE__ */ A(_e, { message: "Loading order details..." }) : Pe || !I ? /* @__PURE__ */ A(ge, {
89
116
  title: "Order not found",
90
117
  message: "The order you're looking for doesn't exist or has been removed.",
91
118
  onRetry: L
@@ -96,18 +123,19 @@ function P() {
96
123
  headerActions: /* @__PURE__ */ j("div", {
97
124
  className: "flex gap-2",
98
125
  children: [
99
- /* @__PURE__ */ j(l, {
126
+ /* @__PURE__ */ j(d, {
100
127
  variant: "outline",
101
128
  onClick: () => {
102
- F && F(s(P, "orders"));
129
+ F && F(c(P, "orders"));
103
130
  },
104
131
  children: [/* @__PURE__ */ A(e, { size: 16 }), "Back"]
105
132
  }),
106
- /* @__PURE__ */ j(l, {
133
+ /* @__PURE__ */ j(d, {
107
134
  variant: "outline",
135
+ onClick: () => window.print(),
108
136
  children: [/* @__PURE__ */ A(a, { size: 16 }), "Print"]
109
137
  }),
110
- /* @__PURE__ */ j(l, {
138
+ /* @__PURE__ */ j(d, {
111
139
  onClick: () => $(`orders/${M}/edit`),
112
140
  children: [/* @__PURE__ */ A(o, { size: 16 }), "Edit"]
113
141
  })
@@ -116,7 +144,7 @@ function P() {
116
144
  headerContent: /* @__PURE__ */ j("div", {
117
145
  className: "flex flex-wrap gap-2",
118
146
  children: [
119
- /* @__PURE__ */ A(w, {
147
+ /* @__PURE__ */ A(T, {
120
148
  status: I.status,
121
149
  type: "order"
122
150
  }),
@@ -125,11 +153,11 @@ function P() {
125
153
  ]
126
154
  }),
127
155
  children: [
128
- /* @__PURE__ */ A(Oe, {
156
+ /* @__PURE__ */ A(je, {
129
157
  icon: /* @__PURE__ */ A(i, { size: 18 }),
130
158
  children: "Everything about this one delivery in a single place — who it's for, where it's going, what's inside, the running cost and the full status history. Use this page to review the order, hand it to a driver, print the docket, or jump into live tracking."
131
159
  }),
132
- /* @__PURE__ */ A(De, {
160
+ /* @__PURE__ */ A(Ae, {
133
161
  storageKey: "movethewheels-order-details",
134
162
  steps: [
135
163
  {
@@ -160,10 +188,10 @@ function P() {
160
188
  children: [/* @__PURE__ */ j("div", {
161
189
  className: "lg:col-span-2 space-y-6",
162
190
  children: [
163
- /* @__PURE__ */ j(u, { children: [/* @__PURE__ */ A(f, { children: /* @__PURE__ */ j(p, {
191
+ /* @__PURE__ */ j(f, { children: [/* @__PURE__ */ A(m, { children: /* @__PURE__ */ j(h, {
164
192
  className: "flex items-center gap-2",
165
- children: [/* @__PURE__ */ A(ce, { size: 18 }), "Customer Information"]
166
- }) }), /* @__PURE__ */ A(d, { children: /* @__PURE__ */ j("div", {
193
+ children: [/* @__PURE__ */ A(se, { size: 18 }), "Customer Information"]
194
+ }) }), /* @__PURE__ */ A(p, { children: /* @__PURE__ */ j("div", {
167
195
  className: "grid grid-cols-1 md:grid-cols-2 gap-6",
168
196
  children: [/* @__PURE__ */ j("div", { children: [
169
197
  /* @__PURE__ */ A("h4", {
@@ -207,15 +235,15 @@ function P() {
207
235
  children: I.customerInfo.deliveryInstructions
208
236
  })] })] })]
209
237
  }) })] }),
210
- /* @__PURE__ */ j(u, { children: [/* @__PURE__ */ A(f, { children: /* @__PURE__ */ j(p, {
238
+ /* @__PURE__ */ j(f, { children: [/* @__PURE__ */ A(m, { children: /* @__PURE__ */ j(h, {
211
239
  className: "flex items-center gap-2",
212
240
  children: [/* @__PURE__ */ A(r, { size: 18 }), "Addresses"]
213
- }) }), /* @__PURE__ */ A(d, { children: /* @__PURE__ */ j("div", {
241
+ }) }), /* @__PURE__ */ A(p, { children: /* @__PURE__ */ j("div", {
214
242
  className: "grid grid-cols-1 md:grid-cols-2 gap-6",
215
243
  children: [/* @__PURE__ */ j("div", { children: [
216
244
  /* @__PURE__ */ A("h4", {
217
245
  className: "font-medium mb-2 flex items-center gap-2",
218
- children: /* @__PURE__ */ A(c, {
246
+ children: /* @__PURE__ */ A(u, {
219
247
  variant: "outline",
220
248
  children: "Pickup"
221
249
  })
@@ -242,7 +270,7 @@ function P() {
242
270
  ] }), /* @__PURE__ */ j("div", { children: [
243
271
  /* @__PURE__ */ A("h4", {
244
272
  className: "font-medium mb-2 flex items-center gap-2",
245
- children: /* @__PURE__ */ A(c, {
273
+ children: /* @__PURE__ */ A(u, {
246
274
  variant: "outline",
247
275
  children: "Delivery"
248
276
  })
@@ -268,7 +296,51 @@ function P() {
268
296
  })
269
297
  ] })]
270
298
  }) })] }),
271
- /* @__PURE__ */ j(u, { children: [/* @__PURE__ */ A(f, { children: /* @__PURE__ */ j(p, {
299
+ /* @__PURE__ */ j(f, { children: [/* @__PURE__ */ A(m, { children: /* @__PURE__ */ j(h, {
300
+ className: "flex items-center gap-2",
301
+ children: [/* @__PURE__ */ A(s, { size: 18 }), "Saved Route"]
302
+ }) }), /* @__PURE__ */ A(p, { children: I.route ? /* @__PURE__ */ j("div", {
303
+ className: "space-y-3",
304
+ children: [/* @__PURE__ */ j("div", {
305
+ className: "flex items-center justify-between gap-3",
306
+ children: [/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
307
+ className: "font-medium",
308
+ children: I.route.name
309
+ }), /* @__PURE__ */ j("p", {
310
+ className: "text-sm text-text-secondary",
311
+ children: [
312
+ I.route.stops.length,
313
+ " stops ·",
314
+ " ",
315
+ I.route.status.replace("_", " ").toLowerCase()
316
+ ]
317
+ })] }), /* @__PURE__ */ A(u, {
318
+ variant: "outline",
319
+ children: "Reusable route"
320
+ })]
321
+ }), /* @__PURE__ */ A("div", {
322
+ className: "space-y-2",
323
+ children: I.route.stops.map((e, t) => /* @__PURE__ */ j("div", {
324
+ className: "flex items-start gap-2 text-sm",
325
+ children: [/* @__PURE__ */ j("span", {
326
+ className: "text-text-secondary",
327
+ children: [t + 1, "."]
328
+ }), /* @__PURE__ */ j("span", { children: [
329
+ /* @__PURE__ */ A("span", {
330
+ className: "font-medium capitalize",
331
+ children: e.type
332
+ }),
333
+ " ·",
334
+ " ",
335
+ E(e.address)
336
+ ] })]
337
+ }, e.id))
338
+ })]
339
+ }) : /* @__PURE__ */ A("p", {
340
+ className: "text-sm text-text-secondary",
341
+ children: "No saved route was selected for this order."
342
+ }) })] }),
343
+ /* @__PURE__ */ j(f, { children: [/* @__PURE__ */ A(m, { children: /* @__PURE__ */ j(h, {
272
344
  className: "flex items-center gap-2",
273
345
  children: [
274
346
  /* @__PURE__ */ A(i, { size: 18 }),
@@ -276,53 +348,53 @@ function P() {
276
348
  I.items.length,
277
349
  ")"
278
350
  ]
279
- }) }), /* @__PURE__ */ A(d, {
351
+ }) }), /* @__PURE__ */ A(p, {
280
352
  className: "p-0",
281
- children: /* @__PURE__ */ j(pe, { children: [/* @__PURE__ */ A(he, { children: /* @__PURE__ */ j(C, { children: [
282
- /* @__PURE__ */ A(S, { children: "Item" }),
283
- /* @__PURE__ */ A(S, { children: "SKU" }),
284
- /* @__PURE__ */ A(S, {
353
+ children: /* @__PURE__ */ j(pe, { children: [/* @__PURE__ */ A(he, { children: /* @__PURE__ */ j(w, { children: [
354
+ /* @__PURE__ */ A(C, { children: "Item" }),
355
+ /* @__PURE__ */ A(C, { children: "SKU" }),
356
+ /* @__PURE__ */ A(C, {
285
357
  className: "text-center",
286
358
  children: "Qty"
287
359
  }),
288
- /* @__PURE__ */ A(S, {
360
+ /* @__PURE__ */ A(C, {
289
361
  className: "text-right",
290
362
  children: "Unit Price"
291
363
  }),
292
- /* @__PURE__ */ A(S, {
364
+ /* @__PURE__ */ A(C, {
293
365
  className: "text-right",
294
366
  children: "Total"
295
367
  })
296
- ] }) }), /* @__PURE__ */ A(me, { children: I.items.map((e) => /* @__PURE__ */ j(C, { children: [
297
- /* @__PURE__ */ A(x, { children: /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
368
+ ] }) }), /* @__PURE__ */ A(me, { children: I.items.map((e) => /* @__PURE__ */ j(w, { children: [
369
+ /* @__PURE__ */ A(S, { children: /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
298
370
  className: "font-medium",
299
371
  children: e.name
300
372
  }), e.description && /* @__PURE__ */ A("p", {
301
373
  className: "text-sm text-text-secondary",
302
374
  children: e.description
303
375
  })] }) }),
304
- /* @__PURE__ */ A(x, {
376
+ /* @__PURE__ */ A(S, {
305
377
  className: "font-mono text-sm",
306
378
  children: e.sku
307
379
  }),
308
- /* @__PURE__ */ A(x, {
380
+ /* @__PURE__ */ A(S, {
309
381
  className: "text-center",
310
382
  children: e.quantity
311
383
  }),
312
- /* @__PURE__ */ A(x, {
384
+ /* @__PURE__ */ A(S, {
313
385
  className: "text-right",
314
386
  children: D(e.value)
315
387
  }),
316
- /* @__PURE__ */ A(x, {
388
+ /* @__PURE__ */ A(S, {
317
389
  className: "text-right font-medium",
318
390
  children: D(e.value * e.quantity)
319
391
  })
320
392
  ] }, e.id)) })] })
321
393
  })] }),
322
- /* @__PURE__ */ j(u, { children: [/* @__PURE__ */ A(f, { children: /* @__PURE__ */ j(p, {
394
+ /* @__PURE__ */ j(f, { children: [/* @__PURE__ */ A(m, { children: /* @__PURE__ */ j(h, {
323
395
  className: "flex items-center gap-2",
324
396
  children: [/* @__PURE__ */ A(te, { size: 18 }), "Order Timeline"]
325
- }) }), /* @__PURE__ */ A(d, { children: /* @__PURE__ */ A("div", {
397
+ }) }), /* @__PURE__ */ A(p, { children: /* @__PURE__ */ A("div", {
326
398
  className: "relative",
327
399
  children: I.timeline.map((e, t) => /* @__PURE__ */ j("div", {
328
400
  className: "flex gap-4 pb-6 last:pb-0",
@@ -334,7 +406,7 @@ function P() {
334
406
  children: [
335
407
  /* @__PURE__ */ j("div", {
336
408
  className: "flex items-center gap-2 mb-1",
337
- children: [/* @__PURE__ */ A(w, {
409
+ children: [/* @__PURE__ */ A(T, {
338
410
  status: e.status,
339
411
  type: "order",
340
412
  size: "sm"
@@ -359,7 +431,7 @@ function P() {
359
431
  }), /* @__PURE__ */ j("div", {
360
432
  className: "space-y-6",
361
433
  children: [
362
- /* @__PURE__ */ j(Ee, { children: [/* @__PURE__ */ j("h2", {
434
+ /* @__PURE__ */ j(ke, { children: [/* @__PURE__ */ j("h2", {
363
435
  className: "flex items-center gap-2 text-base font-semibold text-text-primary mb-4",
364
436
  children: [/* @__PURE__ */ A(ne, { size: 18 }), "Order Summary"]
365
437
  }), /* @__PURE__ */ j("div", {
@@ -400,7 +472,7 @@ function P() {
400
472
  children: "Taxes"
401
473
  }), /* @__PURE__ */ A("span", { children: D(I.pricing.taxes) })]
402
474
  }),
403
- /* @__PURE__ */ A(b, {}),
475
+ /* @__PURE__ */ A(x, {}),
404
476
  /* @__PURE__ */ j("div", {
405
477
  className: "flex justify-between font-medium",
406
478
  children: [/* @__PURE__ */ A("span", { children: "Total" }), /* @__PURE__ */ A("span", {
@@ -420,14 +492,14 @@ function P() {
420
492
  })
421
493
  ]
422
494
  })] }),
423
- /* @__PURE__ */ j(u, { children: [/* @__PURE__ */ A(f, { children: /* @__PURE__ */ j(p, {
495
+ /* @__PURE__ */ j(f, { children: [/* @__PURE__ */ A(m, { children: /* @__PURE__ */ j(h, {
424
496
  className: "flex items-center gap-2",
425
- children: [/* @__PURE__ */ A(oe, { size: 18 }), "Assignment"]
426
- }) }), /* @__PURE__ */ A(d, { children: /* @__PURE__ */ j("div", {
497
+ children: [/* @__PURE__ */ A(s, { size: 18 }), "Assignment"]
498
+ }) }), /* @__PURE__ */ A(p, { children: /* @__PURE__ */ j("div", {
427
499
  className: "space-y-4",
428
500
  children: [
429
- J && /* @__PURE__ */ A(xe, { message: J }),
430
- R && /* @__PURE__ */ A(Se, { message: R }),
501
+ q && /* @__PURE__ */ A(xe, { message: q }),
502
+ ze && /* @__PURE__ */ A(Se, { message: ze }),
431
503
  /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
432
504
  className: "text-sm text-text-secondary",
433
505
  children: "Tracking Number"
@@ -435,26 +507,38 @@ function P() {
435
507
  className: "text-sm font-mono",
436
508
  children: I.trackingNumber || "—"
437
509
  })] }),
438
- /* @__PURE__ */ A(b, {}),
510
+ /* @__PURE__ */ A(x, {}),
439
511
  /* @__PURE__ */ j("div", {
440
512
  className: "space-y-3",
441
513
  children: [
442
514
  /* @__PURE__ */ j("div", {
443
515
  className: "space-y-1.5",
444
- children: [/* @__PURE__ */ A(m, {
516
+ children: [/* @__PURE__ */ A(g, {
517
+ htmlFor: "assign-fleet-search",
518
+ children: "Search fleet"
519
+ }), /* @__PURE__ */ A(de, {
520
+ id: "assign-fleet-search",
521
+ value: R,
522
+ onChange: (e) => Le(e.target.value),
523
+ placeholder: "Vehicle number, driver name or ID"
524
+ })]
525
+ }),
526
+ /* @__PURE__ */ j("div", {
527
+ className: "space-y-1.5",
528
+ children: [/* @__PURE__ */ A(g, {
445
529
  htmlFor: "assign-vehicle",
446
530
  children: "Vehicle"
447
- }), /* @__PURE__ */ j(h, {
448
- value: B,
449
- onValueChange: V,
450
- children: [/* @__PURE__ */ A(v, {
531
+ }), /* @__PURE__ */ j(_, {
532
+ value: z,
533
+ onValueChange: B,
534
+ children: [/* @__PURE__ */ A(fe, {
451
535
  id: "assign-vehicle",
452
- children: /* @__PURE__ */ A(y, { placeholder: I.vehicleId ? `Current: ${I.vehicleId}` : "Select a vehicle" })
453
- }), /* @__PURE__ */ A(g, { children: X.length === 0 ? /* @__PURE__ */ A(_, {
536
+ children: /* @__PURE__ */ A(b, { placeholder: I.vehicleId ? `Current: ${I.vehicleId}` : "Select a vehicle" })
537
+ }), /* @__PURE__ */ A(v, { children: Ve.length === 0 ? /* @__PURE__ */ A(y, {
454
538
  value: "none",
455
539
  disabled: !0,
456
540
  children: "No available vehicles"
457
- }) : X.map((e) => /* @__PURE__ */ j(_, {
541
+ }) : Ve.map((e) => /* @__PURE__ */ j(y, {
458
542
  value: e.id,
459
543
  children: [
460
544
  e.vehicleNumber,
@@ -467,20 +551,20 @@ function P() {
467
551
  }),
468
552
  /* @__PURE__ */ j("div", {
469
553
  className: "space-y-1.5",
470
- children: [/* @__PURE__ */ A(m, {
554
+ children: [/* @__PURE__ */ A(g, {
471
555
  htmlFor: "assign-driver",
472
556
  children: "Driver"
473
- }), /* @__PURE__ */ j(h, {
474
- value: H,
475
- onValueChange: U,
476
- children: [/* @__PURE__ */ A(v, {
557
+ }), /* @__PURE__ */ j(_, {
558
+ value: V,
559
+ onValueChange: H,
560
+ children: [/* @__PURE__ */ A(fe, {
477
561
  id: "assign-driver",
478
- children: /* @__PURE__ */ A(y, { placeholder: I.driverId ? `Current: ${I.driverId}` : "Select a driver" })
479
- }), /* @__PURE__ */ A(g, { children: Z.length === 0 ? /* @__PURE__ */ A(_, {
562
+ children: /* @__PURE__ */ A(b, { placeholder: I.driverId ? `Current: ${I.driverId}` : "Select a driver" })
563
+ }), /* @__PURE__ */ A(v, { children: He.length === 0 ? /* @__PURE__ */ A(y, {
480
564
  value: "none",
481
565
  disabled: !0,
482
566
  children: "No available drivers"
483
- }) : Z.map((e) => /* @__PURE__ */ j(_, {
567
+ }) : He.map((e) => /* @__PURE__ */ j(y, {
484
568
  value: e.id,
485
569
  children: [
486
570
  e.fullName,
@@ -491,15 +575,15 @@ function P() {
491
575
  }, e.id)) })]
492
576
  })]
493
577
  }),
494
- /* @__PURE__ */ j(l, {
578
+ /* @__PURE__ */ j(d, {
495
579
  className: "w-full",
496
- onClick: Ie,
497
- disabled: W || !B && !H,
498
- children: [/* @__PURE__ */ A(se, { size: 16 }), W ? "Assigning…" : "Assign driver & vehicle"]
580
+ onClick: Ue,
581
+ disabled: U || !z && !V,
582
+ children: [/* @__PURE__ */ A(oe, { size: 16 }), U ? "Assigning…" : "Assign driver & vehicle"]
499
583
  })
500
584
  ]
501
585
  }),
502
- /* @__PURE__ */ A(b, {}),
586
+ /* @__PURE__ */ A(x, {}),
503
587
  /* @__PURE__ */ j("div", {
504
588
  className: "space-y-2",
505
589
  children: [
@@ -515,25 +599,25 @@ function P() {
515
599
  ]
516
600
  }),
517
601
  (() => {
518
- let e = ke(I.status);
519
- return e ? /* @__PURE__ */ j(l, {
602
+ let e = Me(I.status);
603
+ return e ? /* @__PURE__ */ j(d, {
520
604
  variant: "outline",
521
605
  className: "w-full",
522
- onClick: () => Q(e, `Order advanced to ${N[e]}.`),
523
- disabled: K,
524
- children: [/* @__PURE__ */ A(t, { size: 16 }), K ? "Updating…" : `Advance to ${N[e]}`]
606
+ onClick: () => We(e, `Order advanced to ${N[e]}.`),
607
+ disabled: G,
608
+ children: [/* @__PURE__ */ A(t, { size: 16 }), G ? "Updating…" : `Advance to ${N[e]}`]
525
609
  }) : null;
526
610
  })(),
527
- I.status !== "cancelled" && I.status !== "delivered" && /* @__PURE__ */ j(l, {
611
+ I.status !== "cancelled" && I.status !== "delivered" && /* @__PURE__ */ j(d, {
528
612
  variant: "outline",
529
613
  className: "w-full text-status-error-text",
530
- onClick: () => Q("cancelled", "Order cancelled."),
531
- disabled: K,
614
+ onClick: () => We("cancelled", "Order cancelled."),
615
+ disabled: G,
532
616
  children: [/* @__PURE__ */ A(ee, { size: 16 }), "Cancel order"]
533
617
  })
534
618
  ]
535
619
  }),
536
- /* @__PURE__ */ j(l, {
620
+ /* @__PURE__ */ j(d, {
537
621
  variant: "outline",
538
622
  className: "w-full",
539
623
  onClick: () => $(`tracking?order=${I.id}`),
@@ -541,15 +625,15 @@ function P() {
541
625
  })
542
626
  ]
543
627
  }) })] }),
544
- /* @__PURE__ */ A(Ce, {
628
+ /* @__PURE__ */ A(we, {
545
629
  entityType: "order",
546
630
  entityId: I.id
547
631
  }),
548
- /* @__PURE__ */ A(we, { deliveryJobId: I.id }),
549
- I.specialInstructions && /* @__PURE__ */ j(u, { children: [/* @__PURE__ */ A(f, { children: /* @__PURE__ */ j(p, {
632
+ /* @__PURE__ */ A(Ee, { deliveryJobId: I.id }),
633
+ I.specialInstructions && /* @__PURE__ */ j(f, { children: [/* @__PURE__ */ A(m, { children: /* @__PURE__ */ j(h, {
550
634
  className: "flex items-center gap-2",
551
635
  children: [/* @__PURE__ */ A(re, { size: 18 }), "Special Instructions"]
552
- }) }), /* @__PURE__ */ A(d, { children: /* @__PURE__ */ A("p", {
636
+ }) }), /* @__PURE__ */ A(p, { children: /* @__PURE__ */ A("p", {
553
637
  className: "text-sm",
554
638
  children: I.specialInstructions
555
639
  }) })] })