@burdenoff/microfe-movethewheels 2026.929.4 → 2026.930.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/components/CustomerPicker.js +52 -48
  2. package/dist/components/EntityCombobox.js +25 -23
  3. package/dist/components/OrderItemRow.js +123 -78
  4. package/dist/hooks/useCustomers.js +52 -17
  5. package/dist/hooks/useFleet.js +126 -44
  6. package/dist/hooks/useInventory.js +43 -7
  7. package/dist/hooks/useMultiModalShipments.js +30 -26
  8. package/dist/hooks/useRoutes.js +55 -15
  9. package/dist/movethewheels/components/CustomerPicker.d.ts +5 -1
  10. package/dist/movethewheels/components/EntityCombobox.d.ts +6 -3
  11. package/dist/movethewheels/components/OrderItemRow.d.ts +7 -1
  12. package/dist/movethewheels/hooks/useCustomers.d.ts +3 -0
  13. package/dist/movethewheels/hooks/useFleet.d.ts +6 -0
  14. package/dist/movethewheels/hooks/useInventory.d.ts +2 -0
  15. package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +1 -0
  16. package/dist/movethewheels/hooks/useRoutes.d.ts +3 -0
  17. package/dist/movethewheels/utils/orderValidation.d.ts +11 -0
  18. package/dist/pages/CreateOrderPage.js +349 -297
  19. package/dist/pages/DriverDetailsPage.js +337 -333
  20. package/dist/pages/DriversPage.js +3 -1
  21. package/dist/pages/MultiModalShipmentPage.js +139 -125
  22. package/dist/pages/OrderDetailsPage.js +132 -140
  23. package/dist/pages/RouteDetailsPage.js +202 -202
  24. package/dist/pages/TrackingPage.js +2 -1
  25. package/dist/utils/orderValidation.js +18 -0
  26. package/package.json +1 -1
  27. package/src/movethewheels/components/CustomerPicker.tsx +12 -0
  28. package/src/movethewheels/components/EntityCombobox.tsx +30 -11
  29. package/src/movethewheels/components/OrderItemRow.tsx +44 -0
  30. package/src/movethewheels/hooks/useCustomers.ts +38 -0
  31. package/src/movethewheels/hooks/useFleet.ts +125 -5
  32. package/src/movethewheels/hooks/useInventory.ts +42 -0
  33. package/src/movethewheels/hooks/useMultiModalShipments.ts +9 -7
  34. package/src/movethewheels/hooks/useRoutes.ts +51 -0
  35. package/src/movethewheels/pages/CreateOrderPage.tsx +66 -2
  36. package/src/movethewheels/pages/DriverDetailsPage.tsx +12 -1
  37. package/src/movethewheels/pages/DriversPage.tsx +7 -1
  38. package/src/movethewheels/pages/MultiModalShipmentPage.tsx +15 -1
  39. package/src/movethewheels/pages/OrderDetailsPage.tsx +25 -25
  40. package/src/movethewheels/pages/RouteDetailsPage.tsx +8 -4
  41. package/src/movethewheels/pages/TrackingPage.tsx +7 -2
  42. package/src/movethewheels/utils/orderValidation.ts +53 -0
@@ -12,27 +12,27 @@ import { Phone as ae } from "../node_modules/lucide-react/dist/esm/icons/phone.j
12
12
  import { Printer as a } from "../node_modules/lucide-react/dist/esm/icons/printer.js";
13
13
  import { Search as oe } from "../node_modules/lucide-react/dist/esm/icons/search.js";
14
14
  import { SquarePen as o } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
15
- import { Truck as se } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
16
- import { UserCheck as ce } from "../node_modules/lucide-react/dist/esm/icons/user-check.js";
17
- import { User as le } from "../node_modules/lucide-react/dist/esm/icons/user.js";
18
- import { joinPath as s } from "../utils/navigation.js";
19
- import { useMoveTheWheels as ue } from "../providers/MoveTheWheelsProvider.js";
20
- import { useOrder as de, useOrders as fe } from "../hooks/useOrders.js";
21
- import { useDriver as pe, useDrivers as me, useVehicle as he, useVehicles as ge } from "../hooks/useFleet.js";
22
- import { Badge as c, Button as l, Card as u, CardContent as d, CardHeader as f, CardTitle as p, Input as _e, Label as m, Separator as h, Table as ve, TableBody as ye, TableCell as g, TableHead as _, TableHeader as be, TableRow as v } from "../components/ui.js";
23
- import { ErrorState as xe, LoadingState as Se, PageLayout as Ce } from "../components/PageLayout.js";
24
- import { PaymentStatusBadge as we, PriorityBadge as Te, StatusBadge as y } from "../components/StatusBadge.js";
25
- import { FormError as Ee } from "../components/FormError.js";
26
- import { Notice as De, useNotice as Oe } from "../components/Notice.js";
27
- import { formatAddress as b, formatCurrency as x, formatDate as S } from "../utils/formatters.js";
28
- import { DocumentsCard as ke } from "../components/DocumentsCard.js";
29
- import { useDebouncedValue as Ae } from "../hooks/useDebouncedValue.js";
30
- import { EntityCombobox as C } from "../components/EntityCombobox.js";
31
- import { ProofOfDeliveryCard as je } from "../components/ProofOfDeliveryCard.js";
32
- import { useEffect as w, useState as T } from "react";
33
- import { useParams as Me } from "react-router";
15
+ import { Truck as s } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
16
+ import { UserCheck as se } from "../node_modules/lucide-react/dist/esm/icons/user-check.js";
17
+ import { User as ce } from "../node_modules/lucide-react/dist/esm/icons/user.js";
18
+ import { joinPath as c } from "../utils/navigation.js";
19
+ import { useMoveTheWheels as le } from "../providers/MoveTheWheelsProvider.js";
20
+ import { useOrder as ue, useOrders as de } from "../hooks/useOrders.js";
21
+ import { useDriver as fe, useDrivers as pe, useVehicle as me, useVehicles as he } from "../hooks/useFleet.js";
22
+ import { Badge as l, Button as u, Card as d, CardContent as f, CardHeader as p, CardTitle as m, Input as ge, Label as h, Separator as g, Table as _e, TableBody as ve, TableCell as _, TableHead as v, TableHeader as ye, TableRow as y } from "../components/ui.js";
23
+ import { ErrorState as be, LoadingState as xe, PageLayout as Se } from "../components/PageLayout.js";
24
+ import { PaymentStatusBadge as Ce, PriorityBadge as we, StatusBadge as b } from "../components/StatusBadge.js";
25
+ import { FormError as Te } from "../components/FormError.js";
26
+ import { Notice as Ee, useNotice as De } from "../components/Notice.js";
27
+ import { formatAddress as x, formatCurrency as S, formatDate as C } from "../utils/formatters.js";
28
+ import { DocumentsCard as Oe } from "../components/DocumentsCard.js";
29
+ import { useDebouncedValue as ke } from "../hooks/useDebouncedValue.js";
30
+ import { EntityCombobox as w } from "../components/EntityCombobox.js";
31
+ import { ProofOfDeliveryCard as Ae } from "../components/ProofOfDeliveryCard.js";
32
+ import { useState as T } from "react";
33
+ import { useParams as je } from "react-router";
34
34
  import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
35
- import { EmphasisPanel as Ne, NextSteps as Pe, PagePurpose as Fe } from "@burdenoff/fe-libs/ui";
35
+ import { EmphasisPanel as Me, NextSteps as Ne, PagePurpose as Pe } from "@burdenoff/fe-libs/ui";
36
36
  //#region src/movethewheels/pages/OrderDetailsPage.tsx
37
37
  var k = [
38
38
  "pending",
@@ -59,34 +59,18 @@ var k = [
59
59
  "cancelled",
60
60
  "failed"
61
61
  ]);
62
- function Ie(e) {
62
+ function Fe(e) {
63
63
  let t = k.indexOf(e);
64
64
  return t === -1 || t >= k.length - 1 ? null : k[t + 1];
65
65
  }
66
66
  function M() {
67
- let { orderId: k } = Me(), { basePath: M, navigate: N } = ue(), { order: P, isLoading: Le, error: Re, refetch: F } = de(k), { updateOrder: ze, updateOrderStatus: I } = fe(), [L, Be] = T(""), [R, z] = T(""), [B, V] = T(""), [H, U] = T(!1), [W, G] = T(!1), [K, q] = T(null), J = Ae(L), { vehicles: Y, isLoading: X } = ge({
67
+ let { orderId: k } = je(), { basePath: M, navigate: N } = le(), { order: P, isLoading: Ie, error: Le, refetch: F } = ue(k), { updateOrder: Re, updateOrderStatus: I } = de(), [L, ze] = T(""), [R, z] = T(""), [B, V] = T(""), [H, U] = T(!1), [W, G] = T(!1), [K, q] = T(null), J = ke(L), { vehicles: Be, isLoading: Ve, isLoadingMore: He, hasMore: Ue, totalVehicles: We, loadMore: Ge } = he({
68
68
  limit: 20,
69
- search: J || void 0,
70
- driverId: B || void 0
71
- }), { drivers: Z, isLoading: Q } = me({
69
+ search: J || void 0
70
+ }), { drivers: Ke, isLoading: qe, isLoadingMore: Je, hasMore: Ye, totalDrivers: Xe, loadMore: Ze } = pe({
72
71
  limit: 20,
73
- search: J || void 0,
74
- vehicleId: R || void 0
75
- }), { vehicle: Ve, isLoading: He } = he(R || void 0), { driver: Ue, isLoading: We } = pe(B || void 0), { message: Ge, notify: Ke } = Oe(), qe = Y.filter((e) => e.status === "available" || e.id === P?.vehicleId), Je = Z.filter((e) => e.status === "available" || e.id === P?.driverId);
76
- w(() => {
77
- !Q && B && !Z.some((e) => e.id === B) && V("");
78
- }, [
79
- Z,
80
- Q,
81
- B
82
- ]), w(() => {
83
- !X && R && !Y.some((e) => e.id === R) && z("");
84
- }, [
85
- R,
86
- Y,
87
- X
88
- ]);
89
- let Ye = async () => {
72
+ search: J || void 0
73
+ }), { vehicle: Qe, isLoading: Y } = me(R || void 0), { driver: $e, isLoading: et } = fe(B || void 0), { message: X, notify: Z } = De(), tt = Be.filter((e) => e.status === "available" || e.id === P?.vehicleId), nt = Ke.filter((e) => e.status === "available" || e.id === P?.driverId), rt = async () => {
90
74
  if (!k || !P) {
91
75
  q("This order is no longer available. Refresh and try again.");
92
76
  return;
@@ -99,16 +83,16 @@ function M() {
99
83
  let n = !!(P.vehicleId && P.driverId);
100
84
  U(!0), q(null);
101
85
  try {
102
- await ze(k, {
86
+ await Re(k, {
103
87
  vehicleId: e,
104
88
  driverId: t
105
- }), !n && P.status === "confirmed" && await I(k, "assigned"), Ke(!n && P.status === "confirmed" ? "Fleet assigned and order advanced to Assigned." : "Assignment updated."), z(""), V(""), F();
89
+ }), !n && P.status === "confirmed" && await I(k, "assigned"), Z(!n && P.status === "confirmed" ? "Fleet assigned and order advanced to Assigned." : "Assignment updated."), z(""), V(""), F();
106
90
  } catch (e) {
107
91
  q(e instanceof Error ? e.message : "Failed to update assignment.");
108
92
  } finally {
109
93
  U(!1);
110
94
  }
111
- }, Xe = async (e, t) => {
95
+ }, Q = async (e, t) => {
112
96
  if (!(!k || !P)) {
113
97
  if (e === "assigned" && (!P.vehicleId || !P.driverId)) {
114
98
  q("Assign both a compatible vehicle and driver before advancing to Assigned.");
@@ -117,7 +101,7 @@ function M() {
117
101
  if (!j.has(P.status)) {
118
102
  G(!0), q(null);
119
103
  try {
120
- await I(k, e), Ke(t), F();
104
+ await I(k, e), Z(t), F();
121
105
  } catch (e) {
122
106
  q(e instanceof Error ? e.message : "Failed to update status.");
123
107
  } finally {
@@ -126,32 +110,32 @@ function M() {
126
110
  }
127
111
  }
128
112
  }, $ = (e) => {
129
- N && N(s(M, e));
113
+ N && N(c(M, e));
130
114
  };
131
- return Le ? /* @__PURE__ */ D(Se, { message: "Loading order details..." }) : Re || !P ? /* @__PURE__ */ D(xe, {
115
+ return Ie ? /* @__PURE__ */ D(xe, { message: "Loading order details..." }) : Le || !P ? /* @__PURE__ */ D(be, {
132
116
  title: "Order not found",
133
117
  message: "The order you're looking for doesn't exist or has been removed.",
134
118
  onRetry: F
135
- }) : /* @__PURE__ */ O(Ce, {
119
+ }) : /* @__PURE__ */ O(Se, {
136
120
  title: P.orderNumber,
137
- subtitle: `Created ${S(P.createdAt, "full")}`,
121
+ subtitle: `Created ${C(P.createdAt, "full")}`,
138
122
  icon: /* @__PURE__ */ D(i, { size: 24 }),
139
123
  headerActions: /* @__PURE__ */ O("div", {
140
124
  className: "flex gap-2",
141
125
  children: [
142
- /* @__PURE__ */ O(l, {
126
+ /* @__PURE__ */ O(u, {
143
127
  variant: "outline",
144
128
  onClick: () => {
145
- N && N(s(M, "orders"));
129
+ N && N(c(M, "orders"));
146
130
  },
147
131
  children: [/* @__PURE__ */ D(e, { size: 16 }), "Back"]
148
132
  }),
149
- /* @__PURE__ */ O(l, {
133
+ /* @__PURE__ */ O(u, {
150
134
  variant: "outline",
151
135
  onClick: () => window.print(),
152
136
  children: [/* @__PURE__ */ D(a, { size: 16 }), "Print"]
153
137
  }),
154
- /* @__PURE__ */ O(l, {
138
+ /* @__PURE__ */ O(u, {
155
139
  onClick: () => $(`orders/${k}/edit`),
156
140
  children: [/* @__PURE__ */ D(o, { size: 16 }), "Edit"]
157
141
  })
@@ -160,20 +144,20 @@ function M() {
160
144
  headerContent: /* @__PURE__ */ O("div", {
161
145
  className: "flex flex-wrap gap-2",
162
146
  children: [
163
- /* @__PURE__ */ D(y, {
147
+ /* @__PURE__ */ D(b, {
164
148
  status: P.status,
165
149
  type: "order"
166
150
  }),
167
- /* @__PURE__ */ D(Te, { priority: P.priority }),
168
- /* @__PURE__ */ D(we, { status: P.pricing.paymentStatus })
151
+ /* @__PURE__ */ D(we, { priority: P.priority }),
152
+ /* @__PURE__ */ D(Ce, { status: P.pricing.paymentStatus })
169
153
  ]
170
154
  }),
171
155
  children: [
172
- /* @__PURE__ */ D(Fe, {
156
+ /* @__PURE__ */ D(Pe, {
173
157
  icon: /* @__PURE__ */ D(i, { size: 18 }),
174
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."
175
159
  }),
176
- /* @__PURE__ */ D(Pe, {
160
+ /* @__PURE__ */ D(Ne, {
177
161
  storageKey: "movethewheels-order-details",
178
162
  steps: [
179
163
  {
@@ -204,10 +188,10 @@ function M() {
204
188
  children: [/* @__PURE__ */ O("div", {
205
189
  className: "lg:col-span-2 space-y-6",
206
190
  children: [
207
- /* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
191
+ /* @__PURE__ */ O(d, { children: [/* @__PURE__ */ D(p, { children: /* @__PURE__ */ O(m, {
208
192
  className: "flex items-center gap-2",
209
- children: [/* @__PURE__ */ D(le, { size: 18 }), "Customer Information"]
210
- }) }), /* @__PURE__ */ D(d, { children: /* @__PURE__ */ O("div", {
193
+ children: [/* @__PURE__ */ D(ce, { size: 18 }), "Customer Information"]
194
+ }) }), /* @__PURE__ */ D(f, { children: /* @__PURE__ */ O("div", {
211
195
  className: "grid grid-cols-1 md:grid-cols-2 gap-6",
212
196
  children: [/* @__PURE__ */ O("div", { children: [
213
197
  /* @__PURE__ */ D("h4", {
@@ -251,26 +235,26 @@ function M() {
251
235
  children: P.customerInfo.deliveryInstructions
252
236
  })] })] })]
253
237
  }) })] }),
254
- /* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
238
+ /* @__PURE__ */ O(d, { children: [/* @__PURE__ */ D(p, { children: /* @__PURE__ */ O(m, {
255
239
  className: "flex items-center gap-2",
256
240
  children: [/* @__PURE__ */ D(r, { size: 18 }), "Addresses"]
257
- }) }), /* @__PURE__ */ D(d, { children: /* @__PURE__ */ O("div", {
241
+ }) }), /* @__PURE__ */ D(f, { children: /* @__PURE__ */ O("div", {
258
242
  className: "grid grid-cols-1 md:grid-cols-2 gap-6",
259
243
  children: [/* @__PURE__ */ O("div", { children: [
260
244
  /* @__PURE__ */ D("h4", {
261
245
  className: "font-medium mb-2 flex items-center gap-2",
262
- children: /* @__PURE__ */ D(c, {
246
+ children: /* @__PURE__ */ D(l, {
263
247
  variant: "outline",
264
248
  children: "Pickup"
265
249
  })
266
250
  }),
267
251
  /* @__PURE__ */ D("p", {
268
252
  className: "text-sm",
269
- children: b(P.pickupAddress)
253
+ children: x(P.pickupAddress)
270
254
  }),
271
255
  P.scheduledPickup && /* @__PURE__ */ O("p", {
272
256
  className: "text-sm text-text-secondary mt-2",
273
- children: ["Scheduled: ", S(P.scheduledPickup, "full")]
257
+ children: ["Scheduled: ", C(P.scheduledPickup, "full")]
274
258
  }),
275
259
  P.actualPickup && /* @__PURE__ */ O("p", {
276
260
  className: "text-sm text-status-success-text mt-1",
@@ -280,24 +264,24 @@ function M() {
280
264
  className: "inline mr-1"
281
265
  }),
282
266
  "Picked up: ",
283
- S(P.actualPickup, "full")
267
+ C(P.actualPickup, "full")
284
268
  ]
285
269
  })
286
270
  ] }), /* @__PURE__ */ O("div", { children: [
287
271
  /* @__PURE__ */ D("h4", {
288
272
  className: "font-medium mb-2 flex items-center gap-2",
289
- children: /* @__PURE__ */ D(c, {
273
+ children: /* @__PURE__ */ D(l, {
290
274
  variant: "outline",
291
275
  children: "Delivery"
292
276
  })
293
277
  }),
294
278
  /* @__PURE__ */ D("p", {
295
279
  className: "text-sm",
296
- children: b(P.deliveryAddress)
280
+ children: x(P.deliveryAddress)
297
281
  }),
298
282
  P.scheduledDelivery && /* @__PURE__ */ O("p", {
299
283
  className: "text-sm text-text-secondary mt-2",
300
- children: ["Scheduled: ", S(P.scheduledDelivery, "full")]
284
+ children: ["Scheduled: ", C(P.scheduledDelivery, "full")]
301
285
  }),
302
286
  P.actualDelivery && /* @__PURE__ */ O("p", {
303
287
  className: "text-sm text-status-success-text mt-1",
@@ -307,15 +291,15 @@ function M() {
307
291
  className: "inline mr-1"
308
292
  }),
309
293
  "Delivered: ",
310
- S(P.actualDelivery, "full")
294
+ C(P.actualDelivery, "full")
311
295
  ]
312
296
  })
313
297
  ] })]
314
298
  }) })] }),
315
- /* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
299
+ /* @__PURE__ */ O(d, { children: [/* @__PURE__ */ D(p, { children: /* @__PURE__ */ O(m, {
316
300
  className: "flex items-center gap-2",
317
- children: [/* @__PURE__ */ D(se, { size: 18 }), "Saved Route"]
318
- }) }), /* @__PURE__ */ D(d, { children: P.route ? /* @__PURE__ */ O("div", {
301
+ children: [/* @__PURE__ */ D(s, { size: 18 }), "Saved Route"]
302
+ }) }), /* @__PURE__ */ D(f, { children: P.route ? /* @__PURE__ */ O("div", {
319
303
  className: "space-y-3",
320
304
  children: [/* @__PURE__ */ O("div", {
321
305
  className: "flex items-center justify-between gap-3",
@@ -330,7 +314,7 @@ function M() {
330
314
  " ",
331
315
  P.route.status.replace("_", " ").toLowerCase()
332
316
  ]
333
- })] }), /* @__PURE__ */ D(c, {
317
+ })] }), /* @__PURE__ */ D(l, {
334
318
  variant: "outline",
335
319
  children: "Reusable route"
336
320
  })]
@@ -348,7 +332,7 @@ function M() {
348
332
  }),
349
333
  " ·",
350
334
  " ",
351
- b(e.address)
335
+ x(e.address)
352
336
  ] })]
353
337
  }, e.id))
354
338
  })]
@@ -356,7 +340,7 @@ function M() {
356
340
  className: "text-sm text-text-secondary",
357
341
  children: "No saved route was selected for this order."
358
342
  }) })] }),
359
- /* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
343
+ /* @__PURE__ */ O(d, { children: [/* @__PURE__ */ D(p, { children: /* @__PURE__ */ O(m, {
360
344
  className: "flex items-center gap-2",
361
345
  children: [
362
346
  /* @__PURE__ */ D(i, { size: 18 }),
@@ -364,53 +348,53 @@ function M() {
364
348
  P.items.length,
365
349
  ")"
366
350
  ]
367
- }) }), /* @__PURE__ */ D(d, {
351
+ }) }), /* @__PURE__ */ D(f, {
368
352
  className: "p-0",
369
- children: /* @__PURE__ */ O(ve, { children: [/* @__PURE__ */ D(be, { children: /* @__PURE__ */ O(v, { children: [
370
- /* @__PURE__ */ D(_, { children: "Item" }),
371
- /* @__PURE__ */ D(_, { children: "SKU" }),
372
- /* @__PURE__ */ D(_, {
353
+ children: /* @__PURE__ */ O(_e, { children: [/* @__PURE__ */ D(ye, { children: /* @__PURE__ */ O(y, { children: [
354
+ /* @__PURE__ */ D(v, { children: "Item" }),
355
+ /* @__PURE__ */ D(v, { children: "SKU" }),
356
+ /* @__PURE__ */ D(v, {
373
357
  className: "text-center",
374
358
  children: "Qty"
375
359
  }),
376
- /* @__PURE__ */ D(_, {
360
+ /* @__PURE__ */ D(v, {
377
361
  className: "text-right",
378
362
  children: "Unit Price"
379
363
  }),
380
- /* @__PURE__ */ D(_, {
364
+ /* @__PURE__ */ D(v, {
381
365
  className: "text-right",
382
366
  children: "Total"
383
367
  })
384
- ] }) }), /* @__PURE__ */ D(ye, { children: P.items.map((e) => /* @__PURE__ */ O(v, { children: [
385
- /* @__PURE__ */ D(g, { children: /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
368
+ ] }) }), /* @__PURE__ */ D(ve, { children: P.items.map((e) => /* @__PURE__ */ O(y, { children: [
369
+ /* @__PURE__ */ D(_, { children: /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
386
370
  className: "font-medium",
387
371
  children: e.name
388
372
  }), e.description && /* @__PURE__ */ D("p", {
389
373
  className: "text-sm text-text-secondary",
390
374
  children: e.description
391
375
  })] }) }),
392
- /* @__PURE__ */ D(g, {
376
+ /* @__PURE__ */ D(_, {
393
377
  className: "font-mono text-sm",
394
378
  children: e.sku
395
379
  }),
396
- /* @__PURE__ */ D(g, {
380
+ /* @__PURE__ */ D(_, {
397
381
  className: "text-center",
398
382
  children: e.quantity
399
383
  }),
400
- /* @__PURE__ */ D(g, {
384
+ /* @__PURE__ */ D(_, {
401
385
  className: "text-right",
402
- children: x(e.value)
386
+ children: S(e.value)
403
387
  }),
404
- /* @__PURE__ */ D(g, {
388
+ /* @__PURE__ */ D(_, {
405
389
  className: "text-right font-medium",
406
- children: x(e.value * e.quantity)
390
+ children: S(e.value * e.quantity)
407
391
  })
408
392
  ] }, e.id)) })] })
409
393
  })] }),
410
- /* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
394
+ /* @__PURE__ */ O(d, { children: [/* @__PURE__ */ D(p, { children: /* @__PURE__ */ O(m, {
411
395
  className: "flex items-center gap-2",
412
396
  children: [/* @__PURE__ */ D(te, { size: 18 }), "Order Timeline"]
413
- }) }), /* @__PURE__ */ D(d, { children: /* @__PURE__ */ D("div", {
397
+ }) }), /* @__PURE__ */ D(f, { children: /* @__PURE__ */ D("div", {
414
398
  className: "relative",
415
399
  children: P.timeline.map((e, t) => /* @__PURE__ */ O("div", {
416
400
  className: "flex gap-4 pb-6 last:pb-0",
@@ -422,13 +406,13 @@ function M() {
422
406
  children: [
423
407
  /* @__PURE__ */ O("div", {
424
408
  className: "flex items-center gap-2 mb-1",
425
- children: [/* @__PURE__ */ D(y, {
409
+ children: [/* @__PURE__ */ D(b, {
426
410
  status: e.status,
427
411
  type: "order",
428
412
  size: "sm"
429
413
  }), /* @__PURE__ */ D("span", {
430
414
  className: "text-sm text-text-secondary",
431
- children: S(e.timestamp, "full")
415
+ children: C(e.timestamp, "full")
432
416
  })]
433
417
  }),
434
418
  e.notes && /* @__PURE__ */ D("p", {
@@ -447,7 +431,7 @@ function M() {
447
431
  }), /* @__PURE__ */ O("div", {
448
432
  className: "space-y-6",
449
433
  children: [
450
- /* @__PURE__ */ O(Ne, { children: [/* @__PURE__ */ O("h2", {
434
+ /* @__PURE__ */ O(Me, { children: [/* @__PURE__ */ O("h2", {
451
435
  className: "flex items-center gap-2 text-base font-semibold text-text-primary mb-4",
452
436
  children: [/* @__PURE__ */ D(ne, { size: 18 }), "Order Summary"]
453
437
  }), /* @__PURE__ */ O("div", {
@@ -458,42 +442,42 @@ function M() {
458
442
  children: [/* @__PURE__ */ D("span", {
459
443
  className: "text-text-secondary",
460
444
  children: "Subtotal"
461
- }), /* @__PURE__ */ D("span", { children: x(P.pricing.subtotal) })]
445
+ }), /* @__PURE__ */ D("span", { children: S(P.pricing.subtotal) })]
462
446
  }),
463
447
  /* @__PURE__ */ O("div", {
464
448
  className: "flex justify-between text-sm",
465
449
  children: [/* @__PURE__ */ D("span", {
466
450
  className: "text-text-secondary",
467
451
  children: "Delivery"
468
- }), /* @__PURE__ */ D("span", { children: x(P.pricing.fees.delivery) })]
452
+ }), /* @__PURE__ */ D("span", { children: S(P.pricing.fees.delivery) })]
469
453
  }),
470
454
  /* @__PURE__ */ O("div", {
471
455
  className: "flex justify-between text-sm",
472
456
  children: [/* @__PURE__ */ D("span", {
473
457
  className: "text-text-secondary",
474
458
  children: "Handling"
475
- }), /* @__PURE__ */ D("span", { children: x(P.pricing.fees.handling) })]
459
+ }), /* @__PURE__ */ D("span", { children: S(P.pricing.fees.handling) })]
476
460
  }),
477
461
  P.pricing.fees.insurance && /* @__PURE__ */ O("div", {
478
462
  className: "flex justify-between text-sm",
479
463
  children: [/* @__PURE__ */ D("span", {
480
464
  className: "text-text-secondary",
481
465
  children: "Insurance"
482
- }), /* @__PURE__ */ D("span", { children: x(P.pricing.fees.insurance) })]
466
+ }), /* @__PURE__ */ D("span", { children: S(P.pricing.fees.insurance) })]
483
467
  }),
484
468
  /* @__PURE__ */ O("div", {
485
469
  className: "flex justify-between text-sm",
486
470
  children: [/* @__PURE__ */ D("span", {
487
471
  className: "text-text-secondary",
488
472
  children: "Taxes"
489
- }), /* @__PURE__ */ D("span", { children: x(P.pricing.taxes) })]
473
+ }), /* @__PURE__ */ D("span", { children: S(P.pricing.taxes) })]
490
474
  }),
491
- /* @__PURE__ */ D(h, {}),
475
+ /* @__PURE__ */ D(g, {}),
492
476
  /* @__PURE__ */ O("div", {
493
477
  className: "flex justify-between font-medium",
494
478
  children: [/* @__PURE__ */ D("span", { children: "Total" }), /* @__PURE__ */ D("span", {
495
479
  className: "text-lg",
496
- children: x(P.pricing.total)
480
+ children: S(P.pricing.total)
497
481
  })]
498
482
  }),
499
483
  /* @__PURE__ */ O("div", {
@@ -508,14 +492,14 @@ function M() {
508
492
  })
509
493
  ]
510
494
  })] }),
511
- /* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
495
+ /* @__PURE__ */ O(d, { children: [/* @__PURE__ */ D(p, { children: /* @__PURE__ */ O(m, {
512
496
  className: "flex items-center gap-2",
513
- children: [/* @__PURE__ */ D(se, { size: 18 }), "Assignment"]
514
- }) }), /* @__PURE__ */ D(d, { children: /* @__PURE__ */ O("div", {
497
+ children: [/* @__PURE__ */ D(s, { size: 18 }), "Assignment"]
498
+ }) }), /* @__PURE__ */ D(f, { children: /* @__PURE__ */ O("div", {
515
499
  className: "space-y-4",
516
500
  children: [
517
- K && /* @__PURE__ */ D(Ee, { message: K }),
518
- Ge && /* @__PURE__ */ D(De, { message: Ge }),
501
+ K && /* @__PURE__ */ D(Te, { message: K }),
502
+ X && /* @__PURE__ */ D(Ee, { message: X }),
519
503
  /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
520
504
  className: "text-sm text-text-secondary",
521
505
  children: "Tracking Number"
@@ -523,21 +507,21 @@ function M() {
523
507
  className: "text-sm font-mono",
524
508
  children: P.trackingNumber || "—"
525
509
  })] }),
526
- /* @__PURE__ */ D(h, {}),
510
+ /* @__PURE__ */ D(g, {}),
527
511
  /* @__PURE__ */ O("div", {
528
512
  className: "space-y-3",
529
513
  children: [
530
514
  /* @__PURE__ */ O("div", {
531
515
  className: "space-y-1.5",
532
- children: [/* @__PURE__ */ D(m, {
516
+ children: [/* @__PURE__ */ D(h, {
533
517
  htmlFor: "assign-fleet-search",
534
518
  children: "Search vehicles & drivers"
535
519
  }), /* @__PURE__ */ O("div", {
536
520
  className: "relative",
537
- children: [/* @__PURE__ */ D(oe, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ D(_e, {
521
+ children: [/* @__PURE__ */ D(oe, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ D(ge, {
538
522
  id: "assign-fleet-search",
539
523
  value: L,
540
- onChange: (e) => Be(e.target.value),
524
+ onChange: (e) => ze(e.target.value),
541
525
  placeholder: "Vehicle number, driver name or employee ID",
542
526
  className: "pl-9"
543
527
  })]
@@ -545,15 +529,15 @@ function M() {
545
529
  }),
546
530
  /* @__PURE__ */ O("div", {
547
531
  className: "space-y-1.5",
548
- children: [/* @__PURE__ */ D(m, {
532
+ children: [/* @__PURE__ */ D(h, {
549
533
  htmlFor: "assign-vehicle",
550
534
  children: "Vehicle"
551
- }), /* @__PURE__ */ D(C, {
535
+ }), /* @__PURE__ */ D(w, {
552
536
  id: "assign-vehicle",
553
537
  value: R,
554
538
  onChange: z,
555
- options: qe,
556
- loading: X,
539
+ options: tt,
540
+ loading: Ve,
557
541
  getId: (e) => e.id,
558
542
  getLabel: (e) => `${e.vehicleNumber} (${e.type})`,
559
543
  renderOption: (e) => /* @__PURE__ */ O(E, { children: [
@@ -562,8 +546,12 @@ function M() {
562
546
  e.type,
563
547
  ")"
564
548
  ] }),
565
- selectedOption: Ve,
566
- selectedLoading: He,
549
+ selectedOption: Qe,
550
+ selectedLoading: Y,
551
+ hasMore: Ue,
552
+ totalCount: We,
553
+ onLoadMore: Ge,
554
+ loadingMore: He,
567
555
  required: !0,
568
556
  placeholder: P.vehicleId ? `Current: ${P.vehicleId}` : "Select a vehicle",
569
557
  emptyText: "No available vehicles."
@@ -571,15 +559,15 @@ function M() {
571
559
  }),
572
560
  /* @__PURE__ */ O("div", {
573
561
  className: "space-y-1.5",
574
- children: [/* @__PURE__ */ D(m, {
562
+ children: [/* @__PURE__ */ D(h, {
575
563
  htmlFor: "assign-driver",
576
564
  children: "Driver"
577
- }), /* @__PURE__ */ D(C, {
565
+ }), /* @__PURE__ */ D(w, {
578
566
  id: "assign-driver",
579
567
  value: B,
580
568
  onChange: V,
581
- options: Je,
582
- loading: Q,
569
+ options: nt,
570
+ loading: qe,
583
571
  getId: (e) => e.id,
584
572
  getLabel: (e) => `${e.fullName} (${e.employeeId})`,
585
573
  renderOption: (e) => /* @__PURE__ */ O(E, { children: [
@@ -588,22 +576,26 @@ function M() {
588
576
  e.employeeId,
589
577
  ")"
590
578
  ] }),
591
- selectedOption: Ue,
592
- selectedLoading: We,
579
+ selectedOption: $e,
580
+ selectedLoading: et,
581
+ hasMore: Ye,
582
+ totalCount: Xe,
583
+ onLoadMore: Ze,
584
+ loadingMore: Je,
593
585
  required: !0,
594
586
  placeholder: P.driverId ? `Current: ${P.driverId}` : "Select a driver",
595
587
  emptyText: "No available drivers."
596
588
  })]
597
589
  }),
598
- /* @__PURE__ */ O(l, {
590
+ /* @__PURE__ */ O(u, {
599
591
  className: "w-full",
600
- onClick: Ye,
592
+ onClick: rt,
601
593
  disabled: H || !R && !B,
602
- children: [/* @__PURE__ */ D(ce, { size: 16 }), H ? "Assigning…" : "Assign driver & vehicle"]
594
+ children: [/* @__PURE__ */ D(se, { size: 16 }), H ? "Assigning…" : "Assign driver & vehicle"]
603
595
  })
604
596
  ]
605
597
  }),
606
- /* @__PURE__ */ D(h, {}),
598
+ /* @__PURE__ */ D(g, {}),
607
599
  /* @__PURE__ */ O("div", {
608
600
  className: "space-y-2",
609
601
  children: [
@@ -619,13 +611,13 @@ function M() {
619
611
  ]
620
612
  }),
621
613
  (() => {
622
- let e = Ie(P.status);
614
+ let e = Fe(P.status);
623
615
  if (!e) return null;
624
616
  let n = e === "assigned" && (!P.vehicleId || !P.driverId);
625
- return /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ O(l, {
617
+ return /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ O(u, {
626
618
  variant: "outline",
627
619
  className: "w-full",
628
- onClick: () => Xe(e, `Order advanced to ${A[e]}.`),
620
+ onClick: () => Q(e, `Order advanced to ${A[e]}.`),
629
621
  disabled: W || n,
630
622
  children: [/* @__PURE__ */ D(t, { size: 16 }), W ? "Updating…" : `Advance to ${A[e]}`]
631
623
  }), n && /* @__PURE__ */ D("p", {
@@ -633,16 +625,16 @@ function M() {
633
625
  children: "Assign both a compatible vehicle and driver before dispatching this order."
634
626
  })] });
635
627
  })(),
636
- P.status !== "cancelled" && !j.has(P.status) && /* @__PURE__ */ O(l, {
628
+ P.status !== "cancelled" && !j.has(P.status) && /* @__PURE__ */ O(u, {
637
629
  variant: "outline",
638
630
  className: "w-full text-status-error-text",
639
- onClick: () => Xe("cancelled", "Order cancelled."),
631
+ onClick: () => Q("cancelled", "Order cancelled."),
640
632
  disabled: W,
641
633
  children: [/* @__PURE__ */ D(ee, { size: 16 }), "Cancel order"]
642
634
  })
643
635
  ]
644
636
  }),
645
- /* @__PURE__ */ O(l, {
637
+ /* @__PURE__ */ O(u, {
646
638
  variant: "outline",
647
639
  className: "w-full",
648
640
  onClick: () => $(`tracking?order=${P.id}`),
@@ -650,15 +642,15 @@ function M() {
650
642
  })
651
643
  ]
652
644
  }) })] }),
653
- /* @__PURE__ */ D(ke, {
645
+ /* @__PURE__ */ D(Oe, {
654
646
  entityType: "order",
655
647
  entityId: P.id
656
648
  }),
657
- /* @__PURE__ */ D(je, { deliveryJobId: P.id }),
658
- P.specialInstructions && /* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
649
+ /* @__PURE__ */ D(Ae, { deliveryJobId: P.id }),
650
+ P.specialInstructions && /* @__PURE__ */ O(d, { children: [/* @__PURE__ */ D(p, { children: /* @__PURE__ */ O(m, {
659
651
  className: "flex items-center gap-2",
660
652
  children: [/* @__PURE__ */ D(re, { size: 18 }), "Special Instructions"]
661
- }) }), /* @__PURE__ */ D(d, { children: /* @__PURE__ */ D("p", {
653
+ }) }), /* @__PURE__ */ D(f, { children: /* @__PURE__ */ D("p", {
662
654
  className: "text-sm",
663
655
  children: P.specialInstructions
664
656
  }) })] })