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