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