@burdenoff/microfe-movethewheels 2026.920.2 → 2026.921.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 (82) hide show
  1. package/dist/components/CarbonFootprintPanel.js +1 -1
  2. package/dist/components/CustomerPicker.js +271 -0
  3. package/dist/components/DataTable.js +140 -139
  4. package/dist/components/DocumentsCard.js +14 -8
  5. package/dist/generated/wspace-types.d.ts +1043 -5
  6. package/dist/hooks/useAnalytics.js +21 -1
  7. package/dist/hooks/useCustomers.js +94 -78
  8. package/dist/hooks/useDebouncedValue.js +11 -0
  9. package/dist/hooks/useEntityDocuments.js +28 -18
  10. package/dist/hooks/useEpod.js +24 -17
  11. package/dist/hooks/useFleet.js +146 -125
  12. package/dist/hooks/useInventory.js +255 -186
  13. package/dist/hooks/useMultiModalShipments.js +35 -27
  14. package/dist/hooks/useOrders.js +73 -73
  15. package/dist/hooks/useRoutes.js +97 -75
  16. package/dist/hooks/useTracking.js +100 -88
  17. package/dist/movethewheels/components/CustomerPicker.d.ts +19 -0
  18. package/dist/movethewheels/components/DataTable.d.ts +5 -1
  19. package/dist/movethewheels/hooks/useCustomers.d.ts +0 -1
  20. package/dist/movethewheels/hooks/useDebouncedValue.d.ts +1 -0
  21. package/dist/movethewheels/hooks/useEntityDocuments.d.ts +2 -0
  22. package/dist/movethewheels/hooks/useEpod.d.ts +6 -1
  23. package/dist/movethewheels/hooks/useFleet.d.ts +49 -5
  24. package/dist/movethewheels/hooks/useInventory.d.ts +24 -17
  25. package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +6 -1
  26. package/dist/movethewheels/hooks/useOrders.d.ts +33 -5
  27. package/dist/movethewheels/hooks/useRoutes.d.ts +2 -1
  28. package/dist/movethewheels/hooks/useTracking.d.ts +12 -11
  29. package/dist/movethewheels/types/index.d.ts +7 -5
  30. package/dist/movethewheels/utils/navigation.d.ts +14 -0
  31. package/dist/pages/CreateOrderPage.js +228 -217
  32. package/dist/pages/CustomerDetailsPage.js +220 -220
  33. package/dist/pages/CustomersPage.js +61 -54
  34. package/dist/pages/DeliveryCapturePage.js +131 -109
  35. package/dist/pages/DriversPage.js +100 -92
  36. package/dist/pages/InventoryPage.js +239 -236
  37. package/dist/pages/MultiModalShipmentPage.js +163 -130
  38. package/dist/pages/OrderDetailsPage.js +224 -208
  39. package/dist/pages/OrdersListPage.js +66 -60
  40. package/dist/pages/ProductDetailsPage.js +241 -200
  41. package/dist/pages/ProductsPage.js +59 -52
  42. package/dist/pages/RouteDetailsPage.js +343 -321
  43. package/dist/pages/RoutesPage.js +55 -48
  44. package/dist/pages/VehiclesPage.js +63 -56
  45. package/dist/pages/WarehousesPage.js +60 -53
  46. package/dist/utils/navigation.js +22 -1
  47. package/package.json +1 -1
  48. package/src/generated/wspace-types.ts +1188 -5
  49. package/src/movethewheels/components/CarbonFootprintPanel.tsx +0 -1
  50. package/src/movethewheels/components/CustomerPicker.tsx +321 -0
  51. package/src/movethewheels/components/DataTable.tsx +34 -18
  52. package/src/movethewheels/components/DocumentsCard.tsx +6 -1
  53. package/src/movethewheels/components/maps/leaflet-setup.ts +1 -8
  54. package/src/movethewheels/hooks/useAnalytics.ts +27 -0
  55. package/src/movethewheels/hooks/useCustomers.ts +64 -24
  56. package/src/movethewheels/hooks/useDebouncedValue.ts +12 -0
  57. package/src/movethewheels/hooks/useEntityDocuments.ts +43 -25
  58. package/src/movethewheels/hooks/useEpod.ts +14 -7
  59. package/src/movethewheels/hooks/useFleet.ts +58 -37
  60. package/src/movethewheels/hooks/useFleetIntelligence.ts +1 -4
  61. package/src/movethewheels/hooks/useInventory.ts +211 -90
  62. package/src/movethewheels/hooks/useMultiModalShipments.ts +15 -11
  63. package/src/movethewheels/hooks/useOrders.ts +13 -14
  64. package/src/movethewheels/hooks/useRoutes.ts +80 -23
  65. package/src/movethewheels/hooks/useTracking.ts +130 -98
  66. package/src/movethewheels/pages/CreateOrderPage.tsx +92 -31
  67. package/src/movethewheels/pages/CustomerDetailsPage.tsx +15 -6
  68. package/src/movethewheels/pages/CustomersPage.tsx +11 -1
  69. package/src/movethewheels/pages/DeliveryCapturePage.tsx +31 -1
  70. package/src/movethewheels/pages/DriversPage.tsx +24 -12
  71. package/src/movethewheels/pages/InventoryPage.tsx +57 -32
  72. package/src/movethewheels/pages/MultiModalShipmentPage.tsx +52 -3
  73. package/src/movethewheels/pages/OrderDetailsPage.tsx +17 -1
  74. package/src/movethewheels/pages/OrdersListPage.tsx +20 -3
  75. package/src/movethewheels/pages/ProductDetailsPage.tsx +52 -3
  76. package/src/movethewheels/pages/ProductsPage.tsx +11 -1
  77. package/src/movethewheels/pages/RouteDetailsPage.tsx +35 -5
  78. package/src/movethewheels/pages/RoutesPage.tsx +11 -1
  79. package/src/movethewheels/pages/VehiclesPage.tsx +19 -2
  80. package/src/movethewheels/pages/WarehousesPage.tsx +11 -1
  81. package/src/movethewheels/types/index.ts +7 -5
  82. package/src/movethewheels/utils/navigation.ts +32 -0
@@ -4,36 +4,40 @@ import { ArrowUp as n } from "../node_modules/lucide-react/dist/esm/icons/arrow-
4
4
  import { CircleCheckBig as r } from "../node_modules/lucide-react/dist/esm/icons/circle-check-big.js";
5
5
  import { Clock as i } from "../node_modules/lucide-react/dist/esm/icons/clock.js";
6
6
  import { Fuel as a } from "../node_modules/lucide-react/dist/esm/icons/fuel.js";
7
- import { MapPin as o } from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
8
- import { Navigation as s } from "../node_modules/lucide-react/dist/esm/icons/navigation.js";
9
- import { Plus as c } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
10
- import { Save as l } from "../node_modules/lucide-react/dist/esm/icons/save.js";
11
- import { SquarePen as u } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
12
- import { Trash2 as d } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
13
- import { Zap as f } from "../node_modules/lucide-react/dist/esm/icons/zap.js";
14
- import { joinPath as p } from "../utils/navigation.js";
15
- import { useMoveTheWheels as m } from "../providers/MoveTheWheelsProvider.js";
16
- import { useFleet as h } from "../hooks/useFleet.js";
17
- import { useRoute as ee, useRoutes as g } from "../hooks/useRoutes.js";
18
- import { Badge as _, Button as v, Card as y, CardContent as b, CardHeader as x, CardTitle as S, Input as C, Label as w, Select as T, SelectContent as E, SelectItem as D, SelectTrigger as O, SelectValue as k } from "../components/ui.js";
19
- import { ErrorState as A, LoadingState as j, PageLayout as M } from "../components/PageLayout.js";
20
- import { RouteMap as N } from "../components/maps/RouteMap.js";
7
+ import { MapPin as ee } from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
8
+ import { Navigation as o } from "../node_modules/lucide-react/dist/esm/icons/navigation.js";
9
+ import { Plus as s } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
10
+ import { Save as c } from "../node_modules/lucide-react/dist/esm/icons/save.js";
11
+ import { SquarePen as l } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
12
+ import { Trash2 as u } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
13
+ import { Zap as d } from "../node_modules/lucide-react/dist/esm/icons/zap.js";
14
+ import { joinPath as f } from "../utils/navigation.js";
15
+ import { useMoveTheWheels as p } from "../providers/MoveTheWheelsProvider.js";
16
+ import { useDriver as m, useFleet as h, useVehicle as g } from "../hooks/useFleet.js";
17
+ import { useRoute as _, useRoutes as te } from "../hooks/useRoutes.js";
18
+ import { Badge as v, Button as y, Card as b, CardContent as x, CardHeader as S, CardTitle as C, Input as w, Label as T, Select as E, SelectContent as D, SelectItem as O, SelectTrigger as k, SelectValue as A } from "../components/ui.js";
19
+ import { ErrorState as ne, LoadingState as re, PageLayout as ie } from "../components/PageLayout.js";
20
+ import { RouteMap as ae } from "../components/maps/RouteMap.js";
21
21
  import "../components/maps/index.js";
22
- import { ROUTE_STATUS_COLORS as P } from "../constants/index.js";
23
- import { StatusBadge as F } from "../components/StatusBadge.js";
24
- import { FormError as I } from "../components/FormError.js";
25
- import { Notice as L, useNotice as R } from "../components/Notice.js";
26
- import { formatAddress as z, formatCurrency as B, formatDate as V } from "../utils/formatters.js";
27
- import { firstRealLatLng as te } from "../utils/mapMarkers.js";
28
- import { useAssignmentSuggestions as H } from "../hooks/useFleetIntelligence.js";
29
- import { AssignmentSuggestions as U } from "../components/AssignmentSuggestions.js";
30
- import { useEffect as W, useState as G } from "react";
31
- import { useLocation as K, useParams as q } from "react-router";
32
- import { jsx as J, jsxs as Y } from "react/jsx-runtime";
33
- import { useI18n as ne } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
34
- import { EmphasisPanel as X, NextSteps as re, PagePurpose as Z } from "@burdenoff/fe-libs/ui";
22
+ import { ROUTE_STATUS_COLORS as j } from "../constants/index.js";
23
+ import { StatusBadge as M } from "../components/StatusBadge.js";
24
+ import { FormError as oe } from "../components/FormError.js";
25
+ import { Notice as N, useNotice as P } from "../components/Notice.js";
26
+ import { formatAddress as F, formatCurrency as I, formatDate as L } from "../utils/formatters.js";
27
+ import { useDebouncedValue as R } from "../hooks/useDebouncedValue.js";
28
+ import { firstRealLatLng as z } from "../utils/mapMarkers.js";
29
+ import { useAssignmentSuggestions as B } from "../hooks/useFleetIntelligence.js";
30
+ import { AssignmentSuggestions as V } from "../components/AssignmentSuggestions.js";
31
+ import { useEffect as H, useState as U } from "react";
32
+ import { useLocation as W, useParams as G } from "react-router";
33
+ import { jsx as K, jsxs as q } from "react/jsx-runtime";
34
+ import { useI18n as se } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
35
+ import { EmphasisPanel as ce, NextSteps as le, PagePurpose as ue } from "@burdenoff/fe-libs/ui";
35
36
  //#region src/movethewheels/pages/RouteDetailsPage.tsx
36
- var Q = [
37
+ function J(e, t) {
38
+ return !t || e.some((e) => e.id === t.id) ? e : [t, ...e];
39
+ }
40
+ var Y = [
37
41
  {
38
42
  value: "planned",
39
43
  label: "Planned"
@@ -51,8 +55,11 @@ var Q = [
51
55
  label: "Cancelled"
52
56
  }
53
57
  ];
54
- function ie({ editId: r }) {
55
- let { basePath: i, navigate: a } = m(), { createRoute: o, updateRoute: u } = g(), { route: f } = ee(r), { vehicles: _, drivers: A } = h(), j = !!r, [N, P] = G({
58
+ function X({ editId: r }) {
59
+ let { basePath: i, navigate: a } = p(), { createRoute: ee, updateRoute: l } = te(), { route: d } = _(r), [v, ne] = U(""), { vehicles: re, drivers: ae } = h({
60
+ limit: 20,
61
+ filters: { search: R(v) || void 0 }
62
+ }), j = !!r, [M, N] = U({
56
63
  name: "",
57
64
  status: "planned",
58
65
  vehicleId: "",
@@ -61,38 +68,38 @@ function ie({ editId: r }) {
61
68
  address: "",
62
69
  type: "delivery"
63
70
  }]
64
- }), [F, L] = G(!1), [R, B] = G(null);
65
- W(() => {
66
- !r || !f || P({
67
- name: f.name || "",
68
- status: f.status,
69
- vehicleId: f.vehicleId || "",
70
- driverId: f.driverId || "",
71
- stops: f.stops.length > 0 ? f.stops.map((e) => ({
72
- address: z(e.address) || e.address.street || "",
71
+ }), { vehicle: P } = g(M.vehicleId || void 0), { driver: I } = m(M.driverId || void 0), L = J(re, P), z = J(ae, I), [B, V] = U(!1), [W, G] = U(null);
72
+ H(() => {
73
+ !r || !d || N({
74
+ name: d.name || "",
75
+ status: d.status,
76
+ vehicleId: d.vehicleId || "",
77
+ driverId: d.driverId || "",
78
+ stops: d.stops.length > 0 ? d.stops.map((e) => ({
79
+ address: F(e.address) || e.address.street || "",
73
80
  type: e.type
74
81
  })) : [{
75
82
  address: "",
76
83
  type: "delivery"
77
84
  }]
78
85
  });
79
- }, [r, f]);
80
- let V = () => a?.(p(i, "routes")), te = () => P((e) => ({
86
+ }, [r, d]);
87
+ let se = () => a?.(f(i, "routes")), le = () => N((e) => ({
81
88
  ...e,
82
89
  stops: [...e.stops, {
83
90
  address: "",
84
91
  type: "delivery"
85
92
  }]
86
- })), H = (e) => P((t) => ({
93
+ })), X = (e) => N((t) => ({
87
94
  ...t,
88
95
  stops: t.stops.filter((t, n) => n !== e)
89
- })), U = (e, t, n) => P((r) => ({
96
+ })), Z = (e, t, n) => N((r) => ({
90
97
  ...r,
91
98
  stops: r.stops.map((r, i) => i === e ? {
92
99
  ...r,
93
100
  [t]: n
94
101
  } : r)
95
- })), K = (e, t) => P((n) => {
102
+ })), Q = (e, t) => N((n) => {
96
103
  let r = e + t;
97
104
  if (r < 0 || r >= n.stops.length) return n;
98
105
  let i = [...n.stops];
@@ -100,17 +107,17 @@ function ie({ editId: r }) {
100
107
  ...n,
101
108
  stops: i
102
109
  };
103
- }), q = async (e) => {
104
- if (e.preventDefault(), !N.name.trim()) {
105
- B("Route name is required.");
110
+ }), $ = async (e) => {
111
+ if (e.preventDefault(), !M.name.trim()) {
112
+ G("Route name is required.");
106
113
  return;
107
114
  }
108
- let t = N.stops.filter((e) => e.address.trim());
115
+ let t = M.stops.filter((e) => e.address.trim());
109
116
  if (t.length === 0) {
110
- B("Add at least one stop with an address.");
117
+ G("Add at least one stop with an address.");
111
118
  return;
112
119
  }
113
- L(!0), B(null);
120
+ V(!0), G(null);
114
121
  try {
115
122
  let e = t.map((e, t) => ({
116
123
  id: `stop-${t + 1}`,
@@ -129,238 +136,253 @@ function ie({ editId: r }) {
129
136
  status: "pending"
130
137
  }));
131
138
  if (j) {
132
- let t = await u(r, {
133
- name: N.name.trim(),
134
- status: N.status,
135
- vehicleId: N.vehicleId || void 0,
136
- driverId: N.driverId || void 0,
139
+ let t = await l(r, {
140
+ name: M.name.trim(),
141
+ status: M.status,
142
+ vehicleId: M.vehicleId || void 0,
143
+ driverId: M.driverId || void 0,
137
144
  stops: e
138
145
  });
139
- a?.(p(i, `routes/${t.id}`));
146
+ a?.(f(i, `routes/${t.id}`));
140
147
  return;
141
148
  }
142
- let n = await o({
143
- name: N.name.trim(),
144
- status: N.status,
145
- vehicleId: N.vehicleId || void 0,
146
- driverId: N.driverId || void 0,
149
+ let n = await ee({
150
+ name: M.name.trim(),
151
+ status: M.status,
152
+ vehicleId: M.vehicleId || void 0,
153
+ driverId: M.driverId || void 0,
147
154
  stops: e
148
155
  });
149
- a?.(p(i, `routes/${n.id}`));
156
+ a?.(f(i, `routes/${n.id}`));
150
157
  } catch (e) {
151
- console.error("Failed to create route:", e), B(e instanceof Error ? e.message : "Failed to create route. Please try again."), L(!1);
158
+ console.error("Failed to create route:", e), G(e instanceof Error ? e.message : "Failed to create route. Please try again."), V(!1);
152
159
  }
153
160
  };
154
- return /* @__PURE__ */ Y(M, {
161
+ return /* @__PURE__ */ q(ie, {
155
162
  title: j ? "Edit Route" : "Create Route",
156
163
  subtitle: "Plan a new delivery route",
157
- icon: /* @__PURE__ */ J(s, { size: 24 }),
158
- headerActions: /* @__PURE__ */ Y("div", {
164
+ icon: /* @__PURE__ */ K(o, { size: 24 }),
165
+ headerActions: /* @__PURE__ */ q("div", {
159
166
  className: "flex gap-2",
160
- children: [/* @__PURE__ */ Y(v, {
167
+ children: [/* @__PURE__ */ q(y, {
161
168
  variant: "outline",
162
- onClick: V,
163
- disabled: F,
164
- children: [/* @__PURE__ */ J(t, { size: 16 }), " Cancel"]
165
- }), /* @__PURE__ */ Y(v, {
166
- onClick: q,
167
- disabled: F,
169
+ onClick: se,
170
+ disabled: B,
171
+ children: [/* @__PURE__ */ K(t, { size: 16 }), " Cancel"]
172
+ }), /* @__PURE__ */ q(y, {
173
+ onClick: $,
174
+ disabled: B,
168
175
  children: [
169
- /* @__PURE__ */ J(l, { size: 16 }),
176
+ /* @__PURE__ */ K(c, { size: 16 }),
170
177
  " ",
171
- j ? F ? "Saving..." : "Save Changes" : F ? "Saving..." : "Create Route"
178
+ j ? B ? "Saving..." : "Save Changes" : B ? "Saving..." : "Create Route"
172
179
  ]
173
180
  })]
174
181
  }),
175
- children: [/* @__PURE__ */ J(Z, {
176
- icon: /* @__PURE__ */ J(s, { size: 18 }),
182
+ children: [/* @__PURE__ */ K(ue, {
183
+ icon: /* @__PURE__ */ K(o, { size: 18 }),
177
184
  children: "Plan a new delivery route — name it, list the stops to visit, and optionally assign a vehicle and driver. Once created you can optimize it to sequence the stops into the shortest run."
178
- }), /* @__PURE__ */ Y("form", {
179
- onSubmit: q,
185
+ }), /* @__PURE__ */ q("form", {
186
+ onSubmit: $,
180
187
  className: "max-w-3xl space-y-6",
181
188
  children: [
182
- /* @__PURE__ */ J(I, { message: R }),
183
- /* @__PURE__ */ Y(X, { children: [/* @__PURE__ */ J("h2", {
189
+ /* @__PURE__ */ K(oe, { message: W }),
190
+ /* @__PURE__ */ q(ce, { children: [/* @__PURE__ */ K("h2", {
184
191
  className: "text-base font-semibold text-text-primary mb-4",
185
192
  children: "Route Details"
186
- }), /* @__PURE__ */ Y("div", {
193
+ }), /* @__PURE__ */ q("div", {
187
194
  className: "space-y-4",
188
- children: [/* @__PURE__ */ Y("div", {
189
- className: "grid grid-cols-1 md:grid-cols-2 gap-4",
190
- children: [/* @__PURE__ */ Y("div", {
191
- className: "space-y-2",
192
- children: [/* @__PURE__ */ Y(w, {
193
- htmlFor: "name",
194
- children: ["Route Name ", /* @__PURE__ */ J("span", {
195
- className: "text-status-error-text",
196
- children: "*"
195
+ children: [
196
+ /* @__PURE__ */ q("div", {
197
+ className: "grid grid-cols-1 md:grid-cols-2 gap-4",
198
+ children: [/* @__PURE__ */ q("div", {
199
+ className: "space-y-2",
200
+ children: [/* @__PURE__ */ q(T, {
201
+ htmlFor: "name",
202
+ children: ["Route Name ", /* @__PURE__ */ K("span", {
203
+ className: "text-status-error-text",
204
+ children: "*"
205
+ })]
206
+ }), /* @__PURE__ */ K(w, {
207
+ id: "name",
208
+ value: M.name,
209
+ onChange: (e) => N((t) => ({
210
+ ...t,
211
+ name: e.target.value
212
+ })),
213
+ placeholder: "Downtown morning run",
214
+ required: !0
215
+ })]
216
+ }), /* @__PURE__ */ q("div", {
217
+ className: "space-y-2",
218
+ children: [/* @__PURE__ */ K(T, {
219
+ htmlFor: "status",
220
+ children: "Status"
221
+ }), /* @__PURE__ */ q(E, {
222
+ value: M.status,
223
+ onValueChange: (e) => N((t) => ({
224
+ ...t,
225
+ status: e
226
+ })),
227
+ children: [/* @__PURE__ */ K(k, {
228
+ id: "status",
229
+ children: /* @__PURE__ */ K(A, {})
230
+ }), /* @__PURE__ */ K(D, { children: Y.map((e) => /* @__PURE__ */ K(O, {
231
+ value: e.value,
232
+ children: e.label
233
+ }, e.value)) })]
197
234
  })]
198
- }), /* @__PURE__ */ J(C, {
199
- id: "name",
200
- value: N.name,
201
- onChange: (e) => P((t) => ({
202
- ...t,
203
- name: e.target.value
204
- })),
205
- placeholder: "Downtown morning run",
206
- required: !0
207
- })]
208
- }), /* @__PURE__ */ Y("div", {
209
- className: "space-y-2",
210
- children: [/* @__PURE__ */ J(w, {
211
- htmlFor: "status",
212
- children: "Status"
213
- }), /* @__PURE__ */ Y(T, {
214
- value: N.status,
215
- onValueChange: (e) => P((t) => ({
216
- ...t,
217
- status: e
218
- })),
219
- children: [/* @__PURE__ */ J(O, {
220
- id: "status",
221
- children: /* @__PURE__ */ J(k, {})
222
- }), /* @__PURE__ */ J(E, { children: Q.map((e) => /* @__PURE__ */ J(D, {
223
- value: e.value,
224
- children: e.label
225
- }, e.value)) })]
226
235
  })]
227
- })]
228
- }), /* @__PURE__ */ Y("div", {
229
- className: "grid grid-cols-1 md:grid-cols-2 gap-4",
230
- children: [/* @__PURE__ */ Y("div", {
236
+ }),
237
+ /* @__PURE__ */ q("div", {
231
238
  className: "space-y-2",
232
- children: [/* @__PURE__ */ J(w, {
233
- htmlFor: "vehicle",
234
- children: "Vehicle (optional)"
235
- }), /* @__PURE__ */ Y(T, {
236
- value: N.vehicleId,
237
- onValueChange: (e) => P((t) => ({
238
- ...t,
239
- vehicleId: e
240
- })),
241
- children: [/* @__PURE__ */ J(O, {
242
- id: "vehicle",
243
- children: /* @__PURE__ */ J(k, { placeholder: "Assign later" })
244
- }), /* @__PURE__ */ J(E, { children: _.map((e) => /* @__PURE__ */ Y(D, {
245
- value: e.id,
246
- children: [
247
- e.vehicleNumber,
248
- " (",
249
- e.type,
250
- ")"
251
- ]
252
- }, e.id)) })]
239
+ children: [/* @__PURE__ */ K(T, {
240
+ htmlFor: "fleet-search",
241
+ children: "Search fleet"
242
+ }), /* @__PURE__ */ K(w, {
243
+ id: "fleet-search",
244
+ value: v,
245
+ onChange: (e) => ne(e.target.value),
246
+ placeholder: "Vehicle number, driver name or ID"
253
247
  })]
254
- }), /* @__PURE__ */ Y("div", {
255
- className: "space-y-2",
256
- children: [/* @__PURE__ */ J(w, {
257
- htmlFor: "driver",
258
- children: "Driver (optional)"
259
- }), /* @__PURE__ */ Y(T, {
260
- value: N.driverId,
261
- onValueChange: (e) => P((t) => ({
262
- ...t,
263
- driverId: e
264
- })),
265
- children: [/* @__PURE__ */ J(O, {
266
- id: "driver",
267
- children: /* @__PURE__ */ J(k, { placeholder: "Assign later" })
268
- }), /* @__PURE__ */ J(E, { children: A.map((e) => /* @__PURE__ */ Y(D, {
269
- value: e.id,
270
- children: [
271
- e.fullName,
272
- " (",
273
- e.employeeId,
274
- ")"
275
- ]
276
- }, e.id)) })]
248
+ }),
249
+ /* @__PURE__ */ q("div", {
250
+ className: "grid grid-cols-1 md:grid-cols-2 gap-4",
251
+ children: [/* @__PURE__ */ q("div", {
252
+ className: "space-y-2",
253
+ children: [/* @__PURE__ */ K(T, {
254
+ htmlFor: "vehicle",
255
+ children: "Vehicle (optional)"
256
+ }), /* @__PURE__ */ q(E, {
257
+ value: M.vehicleId,
258
+ onValueChange: (e) => N((t) => ({
259
+ ...t,
260
+ vehicleId: e
261
+ })),
262
+ children: [/* @__PURE__ */ K(k, {
263
+ id: "vehicle",
264
+ children: /* @__PURE__ */ K(A, { placeholder: "Assign later" })
265
+ }), /* @__PURE__ */ K(D, { children: L.map((e) => /* @__PURE__ */ q(O, {
266
+ value: e.id,
267
+ children: [
268
+ e.vehicleNumber,
269
+ " (",
270
+ e.type,
271
+ ")"
272
+ ]
273
+ }, e.id)) })]
274
+ })]
275
+ }), /* @__PURE__ */ q("div", {
276
+ className: "space-y-2",
277
+ children: [/* @__PURE__ */ K(T, {
278
+ htmlFor: "driver",
279
+ children: "Driver (optional)"
280
+ }), /* @__PURE__ */ q(E, {
281
+ value: M.driverId,
282
+ onValueChange: (e) => N((t) => ({
283
+ ...t,
284
+ driverId: e
285
+ })),
286
+ children: [/* @__PURE__ */ K(k, {
287
+ id: "driver",
288
+ children: /* @__PURE__ */ K(A, { placeholder: "Assign later" })
289
+ }), /* @__PURE__ */ K(D, { children: z.map((e) => /* @__PURE__ */ q(O, {
290
+ value: e.id,
291
+ children: [
292
+ e.fullName,
293
+ " (",
294
+ e.employeeId,
295
+ ")"
296
+ ]
297
+ }, e.id)) })]
298
+ })]
277
299
  })]
278
- })]
279
- })]
300
+ })
301
+ ]
280
302
  })] }),
281
- /* @__PURE__ */ Y(y, { children: [/* @__PURE__ */ Y(x, {
303
+ /* @__PURE__ */ q(b, { children: [/* @__PURE__ */ q(S, {
282
304
  className: "flex flex-row items-center justify-between",
283
- children: [/* @__PURE__ */ Y(S, { children: ["Stops ", /* @__PURE__ */ J("span", {
305
+ children: [/* @__PURE__ */ q(C, { children: ["Stops ", /* @__PURE__ */ K("span", {
284
306
  className: "text-status-error-text",
285
307
  children: "*"
286
- })] }), /* @__PURE__ */ Y(v, {
308
+ })] }), /* @__PURE__ */ q(y, {
287
309
  type: "button",
288
310
  variant: "outline",
289
311
  size: "sm",
290
- onClick: te,
291
- children: [/* @__PURE__ */ J(c, { size: 16 }), " Add Stop"]
312
+ onClick: le,
313
+ children: [/* @__PURE__ */ K(s, { size: 16 }), " Add Stop"]
292
314
  })]
293
- }), /* @__PURE__ */ J(b, {
315
+ }), /* @__PURE__ */ K(x, {
294
316
  className: "space-y-4",
295
- children: N.stops.map((t, r) => /* @__PURE__ */ Y("div", {
317
+ children: M.stops.map((t, r) => /* @__PURE__ */ q("div", {
296
318
  className: "grid grid-cols-1 md:grid-cols-12 gap-3 items-end",
297
319
  children: [
298
- /* @__PURE__ */ Y("div", {
320
+ /* @__PURE__ */ q("div", {
299
321
  className: "md:col-span-7 space-y-2",
300
- children: [/* @__PURE__ */ Y(w, {
322
+ children: [/* @__PURE__ */ q(T, {
301
323
  htmlFor: `stop-address-${r}`,
302
324
  children: [
303
325
  "Stop ",
304
326
  r + 1,
305
327
  " address"
306
328
  ]
307
- }), /* @__PURE__ */ J(C, {
329
+ }), /* @__PURE__ */ K(w, {
308
330
  id: `stop-address-${r}`,
309
331
  value: t.address,
310
- onChange: (e) => U(r, "address", e.target.value),
332
+ onChange: (e) => Z(r, "address", e.target.value),
311
333
  placeholder: "123 Main St, San Francisco, CA"
312
334
  })]
313
335
  }),
314
- /* @__PURE__ */ Y("div", {
336
+ /* @__PURE__ */ q("div", {
315
337
  className: "md:col-span-4 space-y-2",
316
- children: [/* @__PURE__ */ J(w, {
338
+ children: [/* @__PURE__ */ K(T, {
317
339
  htmlFor: `stop-type-${r}`,
318
340
  children: "Type"
319
- }), /* @__PURE__ */ Y(T, {
341
+ }), /* @__PURE__ */ q(E, {
320
342
  value: t.type,
321
- onValueChange: (e) => U(r, "type", e),
322
- children: [/* @__PURE__ */ J(O, {
343
+ onValueChange: (e) => Z(r, "type", e),
344
+ children: [/* @__PURE__ */ K(k, {
323
345
  id: `stop-type-${r}`,
324
- children: /* @__PURE__ */ J(k, {})
325
- }), /* @__PURE__ */ Y(E, { children: [/* @__PURE__ */ J(D, {
346
+ children: /* @__PURE__ */ K(A, {})
347
+ }), /* @__PURE__ */ q(D, { children: [/* @__PURE__ */ K(O, {
326
348
  value: "pickup",
327
349
  children: "Pickup"
328
- }), /* @__PURE__ */ J(D, {
350
+ }), /* @__PURE__ */ K(O, {
329
351
  value: "delivery",
330
352
  children: "Delivery"
331
353
  })] })]
332
354
  })]
333
355
  }),
334
- /* @__PURE__ */ Y("div", {
356
+ /* @__PURE__ */ q("div", {
335
357
  className: "md:col-span-1 flex justify-end gap-1",
336
358
  children: [
337
- /* @__PURE__ */ J(v, {
359
+ /* @__PURE__ */ K(y, {
338
360
  type: "button",
339
361
  variant: "ghost",
340
362
  size: "icon",
341
- onClick: () => K(r, -1),
363
+ onClick: () => Q(r, -1),
342
364
  disabled: r === 0,
343
365
  "aria-label": `Move stop ${r + 1} up`,
344
- children: /* @__PURE__ */ J(n, { size: 16 })
366
+ children: /* @__PURE__ */ K(n, { size: 16 })
345
367
  }),
346
- /* @__PURE__ */ J(v, {
368
+ /* @__PURE__ */ K(y, {
347
369
  type: "button",
348
370
  variant: "ghost",
349
371
  size: "icon",
350
- onClick: () => K(r, 1),
351
- disabled: r === N.stops.length - 1,
372
+ onClick: () => Q(r, 1),
373
+ disabled: r === M.stops.length - 1,
352
374
  "aria-label": `Move stop ${r + 1} down`,
353
- children: /* @__PURE__ */ J(e, { size: 16 })
375
+ children: /* @__PURE__ */ K(e, { size: 16 })
354
376
  }),
355
- /* @__PURE__ */ J(v, {
377
+ /* @__PURE__ */ K(y, {
356
378
  type: "button",
357
379
  variant: "ghost",
358
380
  size: "icon",
359
381
  className: "text-status-error-text",
360
- onClick: () => H(r),
361
- disabled: N.stops.length === 1,
382
+ onClick: () => X(r),
383
+ disabled: M.stops.length === 1,
362
384
  "aria-label": `Remove stop ${r + 1}`,
363
- children: /* @__PURE__ */ J(d, { size: 16 })
385
+ children: /* @__PURE__ */ K(u, { size: 16 })
364
386
  })
365
387
  ]
366
388
  })
@@ -371,186 +393,186 @@ function ie({ editId: r }) {
371
393
  })]
372
394
  });
373
395
  }
374
- function $() {
375
- let { routeId: e } = q(), n = K().pathname.endsWith("/edit"), { basePath: c, navigate: l } = m(), { route: d, isLoading: h, error: C, refetch: w } = ee(e), { optimizeRoute: T, updateRoute: E } = g(), D = H(e), { t: O } = ne(), k = (e, t) => {
376
- let n = O(e);
396
+ function Z() {
397
+ let { routeId: e } = G(), n = W().pathname.endsWith("/edit"), { basePath: s, navigate: c } = p(), { route: u, isLoading: m, error: h, refetch: g } = _(e), { optimizeRoute: w, updateRoute: T } = te(), E = B(e), { t: D } = se(), O = (e, t) => {
398
+ let n = D(e);
377
399
  return n === e ? t : n;
378
- }, { message: W, notify: Q } = R(), [$, ae] = G(null), [oe, se] = G(!1), ce = () => l?.(p(c, "routes")), le = (e) => l?.(p(c, e)), ue = async () => {
400
+ }, { message: k, notify: A } = P(), [R, H] = U(null), [J, Y] = U(!1), Z = () => c?.(f(s, "routes")), Q = (e) => c?.(f(s, e)), $ = async () => {
379
401
  if (e) {
380
- se(!0), ae(null);
402
+ Y(!0), H(null);
381
403
  try {
382
- await T(e), Q("Route optimized — stops resequenced for the shortest run."), w();
404
+ await w(e), A("Route optimized — stops resequenced for the shortest run."), g();
383
405
  } catch (e) {
384
- ae(e instanceof Error ? e.message : "Failed to optimize route.");
406
+ H(e instanceof Error ? e.message : "Failed to optimize route.");
385
407
  } finally {
386
- se(!1);
408
+ Y(!1);
387
409
  }
388
410
  }
389
411
  }, de = async (t) => {
390
- e && (await E(e, t), Q(k("movethewheels.routes.suggest.done", "Assignment saved.")), w(), D.refetch());
412
+ e && (await T(e, t), A(O("movethewheels.routes.suggest.done", "Assignment saved.")), g(), E.refetch());
391
413
  };
392
- if (!e) return /* @__PURE__ */ J(ie, {});
393
- if (n) return /* @__PURE__ */ J(ie, { editId: e });
394
- if (h) return /* @__PURE__ */ J(j, { message: "Loading route details..." });
395
- if (C || !d) return /* @__PURE__ */ J(A, {
414
+ if (!e) return /* @__PURE__ */ K(X, {});
415
+ if (n) return /* @__PURE__ */ K(X, { editId: e });
416
+ if (m) return /* @__PURE__ */ K(re, { message: "Loading route details..." });
417
+ if (h || !u) return /* @__PURE__ */ K(ne, {
396
418
  title: "Route not found",
397
- onRetry: w
419
+ onRetry: g
398
420
  });
399
- let fe = d.stops.map((e) => {
400
- let t = te(e.address);
421
+ let fe = u.stops.map((e) => {
422
+ let t = z(e.address);
401
423
  return t ? {
402
424
  lat: t.lat,
403
425
  lng: t.lng,
404
426
  sequence: e.sequence,
405
- label: z(e.address) || `Order #${e.orderId || e.sequence}`
427
+ label: F(e.address) || `Order #${e.orderId || e.sequence}`
406
428
  } : null;
407
429
  }).filter((e) => e !== null);
408
- return /* @__PURE__ */ Y(M, {
409
- title: d.name,
410
- subtitle: `${d.stops.length} stops - ${d.distance.toFixed(1)} km`,
411
- icon: /* @__PURE__ */ J(s, { size: 24 }),
412
- headerActions: /* @__PURE__ */ Y("div", {
430
+ return /* @__PURE__ */ q(ie, {
431
+ title: u.name,
432
+ subtitle: `${u.stops.length} stops - ${u.distance.toFixed(1)} km`,
433
+ icon: /* @__PURE__ */ K(o, { size: 24 }),
434
+ headerActions: /* @__PURE__ */ q("div", {
413
435
  className: "flex gap-2",
414
436
  children: [
415
- /* @__PURE__ */ Y(v, {
437
+ /* @__PURE__ */ q(y, {
416
438
  variant: "outline",
417
- onClick: ce,
418
- children: [/* @__PURE__ */ J(t, { size: 16 }), " Back"]
439
+ onClick: Z,
440
+ children: [/* @__PURE__ */ K(t, { size: 16 }), " Back"]
419
441
  }),
420
- !d.optimized && /* @__PURE__ */ Y(v, {
442
+ !u.optimized && /* @__PURE__ */ q(y, {
421
443
  variant: "outline",
422
- onClick: ue,
423
- disabled: oe,
444
+ onClick: $,
445
+ disabled: J,
424
446
  children: [
425
- /* @__PURE__ */ J(f, { size: 16 }),
447
+ /* @__PURE__ */ K(d, { size: 16 }),
426
448
  " ",
427
- oe ? "Optimizing…" : "Optimize"
449
+ J ? "Optimizing…" : "Optimize"
428
450
  ]
429
451
  }),
430
- /* @__PURE__ */ Y(v, {
431
- onClick: () => l?.(p(c, `routes/${e}/edit`)),
432
- children: [/* @__PURE__ */ J(u, { size: 16 }), " Edit"]
452
+ /* @__PURE__ */ q(y, {
453
+ onClick: () => c?.(f(s, `routes/${e}/edit`)),
454
+ children: [/* @__PURE__ */ K(l, { size: 16 }), " Edit"]
433
455
  })
434
456
  ]
435
457
  }),
436
- headerContent: /* @__PURE__ */ Y("div", {
458
+ headerContent: /* @__PURE__ */ q("div", {
437
459
  className: "flex gap-2",
438
- children: [/* @__PURE__ */ J(F, {
439
- status: d.status,
440
- customColors: P[d.status]
441
- }), /* @__PURE__ */ J(_, {
442
- variant: d.optimized ? "default" : "secondary",
443
- children: d.optimized ? "Optimized" : "Not Optimized"
460
+ children: [/* @__PURE__ */ K(M, {
461
+ status: u.status,
462
+ customColors: j[u.status]
463
+ }), /* @__PURE__ */ K(v, {
464
+ variant: u.optimized ? "default" : "secondary",
465
+ children: u.optimized ? "Optimized" : "Not Optimized"
444
466
  })]
445
467
  }),
446
468
  children: [
447
- /* @__PURE__ */ J(Z, {
448
- icon: /* @__PURE__ */ J(s, { size: 18 }),
469
+ /* @__PURE__ */ K(ue, {
470
+ icon: /* @__PURE__ */ K(o, { size: 18 }),
449
471
  children: "A single optimized driving plan that chains together this route's stops. Review the sequence, distance and timing here, re-optimize if traffic or stops change, then hand the itinerary to a driver."
450
472
  }),
451
- /* @__PURE__ */ J(re, {
473
+ /* @__PURE__ */ K(le, {
452
474
  storageKey: "movethewheels-route-details",
453
475
  steps: [
454
- ...d.optimized ? [] : [{
476
+ ...u.optimized ? [] : [{
455
477
  id: "optimize",
456
478
  label: "Optimize this route",
457
479
  description: "Reorder stops to cut distance and driving time.",
458
- icon: /* @__PURE__ */ J(f, { size: 16 }),
459
- onClick: ue
480
+ icon: /* @__PURE__ */ K(d, { size: 16 }),
481
+ onClick: $
460
482
  }],
461
483
  {
462
484
  id: "edit",
463
485
  label: "Adjust stops",
464
486
  description: "Add, remove or reorder the delivery stops.",
465
- icon: /* @__PURE__ */ J(u, { size: 16 }),
487
+ icon: /* @__PURE__ */ K(l, { size: 16 }),
466
488
  onClick: () => {}
467
489
  },
468
490
  {
469
491
  id: "orders",
470
492
  label: "Review the orders on this route",
471
493
  description: "Check the deliveries bundled into this run.",
472
- icon: /* @__PURE__ */ J(o, { size: 16 }),
473
- onClick: () => le("orders")
494
+ icon: /* @__PURE__ */ K(ee, { size: 16 }),
495
+ onClick: () => Q("orders")
474
496
  }
475
497
  ]
476
498
  }),
477
- $ && /* @__PURE__ */ J("div", {
499
+ R && /* @__PURE__ */ K("div", {
478
500
  className: "mb-2",
479
- children: /* @__PURE__ */ J(I, { message: $ })
501
+ children: /* @__PURE__ */ K(oe, { message: R })
480
502
  }),
481
- W && /* @__PURE__ */ J("div", {
503
+ k && /* @__PURE__ */ K("div", {
482
504
  className: "mb-2",
483
- children: /* @__PURE__ */ J(L, { message: W })
505
+ children: /* @__PURE__ */ K(N, { message: k })
484
506
  }),
485
- /* @__PURE__ */ Y("div", {
507
+ /* @__PURE__ */ q("div", {
486
508
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
487
- children: [/* @__PURE__ */ Y("div", {
509
+ children: [/* @__PURE__ */ q("div", {
488
510
  className: "lg:col-span-2 space-y-6",
489
- children: [/* @__PURE__ */ Y(y, { children: [/* @__PURE__ */ J(x, { children: /* @__PURE__ */ J(S, { children: "Route Map" }) }), /* @__PURE__ */ J(b, { children: fe.length > 0 ? /* @__PURE__ */ J(N, {
511
+ children: [/* @__PURE__ */ q(b, { children: [/* @__PURE__ */ K(S, { children: /* @__PURE__ */ K(C, { children: "Route Map" }) }), /* @__PURE__ */ K(x, { children: fe.length > 0 ? /* @__PURE__ */ K(ae, {
490
512
  className: "overflow-hidden rounded-lg border border-border-seam",
491
513
  height: 360,
492
514
  stops: fe
493
- }) : /* @__PURE__ */ Y("div", {
515
+ }) : /* @__PURE__ */ q("div", {
494
516
  className: "rounded-lg border border-border-seam bg-bg-sunken/40 p-4",
495
- children: [/* @__PURE__ */ J("p", {
517
+ children: [/* @__PURE__ */ K("p", {
496
518
  className: "mb-3 text-sm text-text-secondary",
497
519
  children: "These stops don't have map coordinates yet — showing the planned sequence instead."
498
- }), /* @__PURE__ */ J("ol", {
520
+ }), /* @__PURE__ */ K("ol", {
499
521
  className: "space-y-2",
500
- children: d.stops.map((e) => /* @__PURE__ */ Y("li", {
522
+ children: u.stops.map((e) => /* @__PURE__ */ q("li", {
501
523
  className: "flex items-start gap-3",
502
- children: [/* @__PURE__ */ J("span", {
524
+ children: [/* @__PURE__ */ K("span", {
503
525
  className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-action-primary-bg/10 text-xs font-semibold text-primary",
504
526
  children: e.sequence
505
- }), /* @__PURE__ */ J("span", {
527
+ }), /* @__PURE__ */ K("span", {
506
528
  className: "text-sm",
507
- children: z(e.address) || `Order #${e.orderId || e.sequence}`
529
+ children: F(e.address) || `Order #${e.orderId || e.sequence}`
508
530
  })]
509
531
  }, e.id))
510
532
  })]
511
- }) })] }), /* @__PURE__ */ Y(y, { children: [/* @__PURE__ */ J(x, { children: /* @__PURE__ */ Y(S, { children: [
533
+ }) })] }), /* @__PURE__ */ q(b, { children: [/* @__PURE__ */ K(S, { children: /* @__PURE__ */ q(C, { children: [
512
534
  "Stops (",
513
- d.stops.length,
535
+ u.stops.length,
514
536
  ")"
515
- ] }) }), /* @__PURE__ */ J(b, { children: /* @__PURE__ */ J("div", {
537
+ ] }) }), /* @__PURE__ */ K(x, { children: /* @__PURE__ */ K("div", {
516
538
  className: "space-y-4",
517
- children: d.stops.map((e, t) => /* @__PURE__ */ Y("div", {
539
+ children: u.stops.map((e, t) => /* @__PURE__ */ q("div", {
518
540
  className: "flex gap-4",
519
- children: [/* @__PURE__ */ Y("div", {
541
+ children: [/* @__PURE__ */ q("div", {
520
542
  className: "relative",
521
- children: [/* @__PURE__ */ J("div", {
543
+ children: [/* @__PURE__ */ K("div", {
522
544
  className: `w-8 h-8 rounded-full flex items-center justify-center ${e.status === "completed" ? "bg-status-success-text text-text-inverse" : "bg-bg-sunken"}`,
523
- children: e.status === "completed" ? /* @__PURE__ */ J(r, { size: 16 }) : e.sequence
524
- }), t < d.stops.length - 1 && /* @__PURE__ */ J("div", { className: "absolute top-8 left-4 w-px h-12 bg-border" })]
525
- }), /* @__PURE__ */ J("div", {
545
+ children: e.status === "completed" ? /* @__PURE__ */ K(r, { size: 16 }) : e.sequence
546
+ }), t < u.stops.length - 1 && /* @__PURE__ */ K("div", { className: "absolute top-8 left-4 w-px h-12 bg-border" })]
547
+ }), /* @__PURE__ */ K("div", {
526
548
  className: "flex-1 pb-4",
527
- children: /* @__PURE__ */ Y("div", {
549
+ children: /* @__PURE__ */ q("div", {
528
550
  className: "flex items-center justify-between",
529
- children: [/* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ Y("div", {
551
+ children: [/* @__PURE__ */ q("div", { children: [/* @__PURE__ */ q("div", {
530
552
  className: "flex items-center gap-2",
531
- children: [/* @__PURE__ */ J(_, {
553
+ children: [/* @__PURE__ */ K(v, {
532
554
  variant: e.type === "pickup" ? "secondary" : "default",
533
555
  className: "capitalize",
534
556
  children: e.type
535
- }), /* @__PURE__ */ Y("span", {
557
+ }), /* @__PURE__ */ q("span", {
536
558
  className: "font-medium",
537
559
  children: ["Order #", e.orderId]
538
560
  })]
539
- }), /* @__PURE__ */ J("p", {
561
+ }), /* @__PURE__ */ K("p", {
540
562
  className: "text-sm text-text-secondary mt-1",
541
- children: z(e.address)
542
- })] }), /* @__PURE__ */ Y("div", {
563
+ children: F(e.address)
564
+ })] }), /* @__PURE__ */ q("div", {
543
565
  className: "text-right",
544
566
  children: [
545
- /* @__PURE__ */ Y("p", {
567
+ /* @__PURE__ */ q("p", {
546
568
  className: "text-sm",
547
- children: ["Scheduled: ", V(e.scheduledTime, "time")]
569
+ children: ["Scheduled: ", L(e.scheduledTime, "time")]
548
570
  }),
549
- e.actualTime && /* @__PURE__ */ Y("p", {
571
+ e.actualTime && /* @__PURE__ */ q("p", {
550
572
  className: "text-sm text-status-success-text",
551
- children: ["Actual: ", V(e.actualTime, "time")]
573
+ children: ["Actual: ", L(e.actualTime, "time")]
552
574
  }),
553
- /* @__PURE__ */ Y("p", {
575
+ /* @__PURE__ */ q("p", {
554
576
  className: "text-xs text-text-secondary",
555
577
  children: [e.duration, " min stop"]
556
578
  })
@@ -560,91 +582,91 @@ function $() {
560
582
  })]
561
583
  }, e.id))
562
584
  }) })] })]
563
- }), /* @__PURE__ */ Y("div", {
585
+ }), /* @__PURE__ */ q("div", {
564
586
  className: "space-y-6",
565
587
  children: [
566
- (d.status === "planned" || d.status === "in_progress") && /* @__PURE__ */ J(U, {
567
- suggestions: D.data,
568
- isLoading: D.isLoading,
569
- error: D.error,
570
- onRetry: D.refetch,
571
- assignedVehicleId: d.vehicleId || void 0,
572
- assignedDriverId: d.driverId || void 0,
588
+ (u.status === "planned" || u.status === "in_progress") && /* @__PURE__ */ K(V, {
589
+ suggestions: E.data,
590
+ isLoading: E.isLoading,
591
+ error: E.error,
592
+ onRetry: E.refetch,
593
+ assignedVehicleId: u.vehicleId || void 0,
594
+ assignedDriverId: u.driverId || void 0,
573
595
  onAssign: de,
574
- t: k
596
+ t: O
575
597
  }),
576
- /* @__PURE__ */ Y(X, {
598
+ /* @__PURE__ */ q(ce, {
577
599
  className: "space-y-4",
578
600
  children: [
579
- /* @__PURE__ */ J("h2", {
601
+ /* @__PURE__ */ K("h2", {
580
602
  className: "text-base font-semibold text-text-primary",
581
603
  children: "Route Info"
582
604
  }),
583
- /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("p", {
605
+ /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K("p", {
584
606
  className: "text-sm text-text-secondary",
585
607
  children: "Total Distance"
586
- }), /* @__PURE__ */ Y("p", {
608
+ }), /* @__PURE__ */ q("p", {
587
609
  className: "text-2xl font-bold",
588
- children: [d.distance.toFixed(1), /* @__PURE__ */ J("span", {
610
+ children: [u.distance.toFixed(1), /* @__PURE__ */ K("span", {
589
611
  className: "text-sm font-normal",
590
612
  children: " km"
591
613
  })]
592
614
  })] }),
593
- /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("p", {
615
+ /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K("p", {
594
616
  className: "text-sm text-text-secondary",
595
617
  children: "Est. Duration"
596
- }), /* @__PURE__ */ Y("p", {
618
+ }), /* @__PURE__ */ q("p", {
597
619
  className: "text-2xl font-bold",
598
- children: [d.estimatedDuration, /* @__PURE__ */ J("span", {
620
+ children: [u.estimatedDuration, /* @__PURE__ */ K("span", {
599
621
  className: "text-sm font-normal",
600
622
  children: " min"
601
623
  })]
602
624
  })] }),
603
- d.fuelCost !== void 0 && /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ Y("p", {
625
+ u.fuelCost !== void 0 && /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ q("p", {
604
626
  className: "text-sm text-text-secondary flex items-center gap-1",
605
- children: [/* @__PURE__ */ J(a, { size: 14 }), " Est. Fuel Cost"]
606
- }), /* @__PURE__ */ J("p", {
627
+ children: [/* @__PURE__ */ K(a, { size: 14 }), " Est. Fuel Cost"]
628
+ }), /* @__PURE__ */ K("p", {
607
629
  className: "text-2xl font-bold",
608
- children: B(d.fuelCost)
630
+ children: I(u.fuelCost)
609
631
  })] }),
610
- d.actualDuration && /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("p", {
632
+ u.actualDuration && /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K("p", {
611
633
  className: "text-sm text-text-secondary",
612
634
  children: "Actual Duration"
613
- }), /* @__PURE__ */ Y("p", {
635
+ }), /* @__PURE__ */ q("p", {
614
636
  className: "text-2xl font-bold",
615
- children: [d.actualDuration, /* @__PURE__ */ J("span", {
637
+ children: [u.actualDuration, /* @__PURE__ */ K("span", {
616
638
  className: "text-sm font-normal",
617
639
  children: " min"
618
640
  })]
619
641
  })] })
620
642
  ]
621
643
  }),
622
- /* @__PURE__ */ Y(y, { children: [/* @__PURE__ */ J(x, { children: /* @__PURE__ */ Y(S, {
644
+ /* @__PURE__ */ q(b, { children: [/* @__PURE__ */ K(S, { children: /* @__PURE__ */ q(C, {
623
645
  className: "flex items-center gap-2",
624
- children: [/* @__PURE__ */ J(i, { size: 18 }), " Timeline"]
625
- }) }), /* @__PURE__ */ Y(b, {
646
+ children: [/* @__PURE__ */ K(i, { size: 18 }), " Timeline"]
647
+ }) }), /* @__PURE__ */ q(x, {
626
648
  className: "space-y-3",
627
649
  children: [
628
- d.startTime && /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("p", {
650
+ u.startTime && /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K("p", {
629
651
  className: "text-sm text-text-secondary",
630
652
  children: "Started"
631
- }), /* @__PURE__ */ J("p", { children: V(d.startTime, "full") })] }),
632
- d.endTime && /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("p", {
653
+ }), /* @__PURE__ */ K("p", { children: L(u.startTime, "full") })] }),
654
+ u.endTime && /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K("p", {
633
655
  className: "text-sm text-text-secondary",
634
656
  children: "Completed"
635
- }), /* @__PURE__ */ J("p", { children: V(d.endTime, "full") })] }),
636
- /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("p", {
657
+ }), /* @__PURE__ */ K("p", { children: L(u.endTime, "full") })] }),
658
+ /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K("p", {
637
659
  className: "text-sm text-text-secondary",
638
660
  children: "Created"
639
- }), /* @__PURE__ */ J("p", { children: V(d.createdAt, "full") })] })
661
+ }), /* @__PURE__ */ K("p", { children: L(u.createdAt, "full") })] })
640
662
  ]
641
663
  })] }),
642
- d.trafficConditions.length > 0 && /* @__PURE__ */ Y(y, { children: [/* @__PURE__ */ J(x, { children: /* @__PURE__ */ J(S, { children: "Traffic Conditions" }) }), /* @__PURE__ */ J(b, { children: d.trafficConditions.map((e, t) => /* @__PURE__ */ Y("div", {
664
+ u.trafficConditions.length > 0 && /* @__PURE__ */ q(b, { children: [/* @__PURE__ */ K(S, { children: /* @__PURE__ */ K(C, { children: "Traffic Conditions" }) }), /* @__PURE__ */ K(x, { children: u.trafficConditions.map((e, t) => /* @__PURE__ */ q("div", {
643
665
  className: `p-2 rounded mb-2 ${e.condition === "severe" ? "bg-status-error-bg-subtle" : (e.condition, "bg-status-warning-bg-subtle")}`,
644
- children: [/* @__PURE__ */ Y("p", {
666
+ children: [/* @__PURE__ */ q("p", {
645
667
  className: "text-sm font-medium capitalize",
646
668
  children: [e.condition, " traffic"]
647
- }), /* @__PURE__ */ Y("p", {
669
+ }), /* @__PURE__ */ q("p", {
648
670
  className: "text-xs text-text-secondary",
649
671
  children: [
650
672
  e.location,
@@ -661,4 +683,4 @@ function $() {
661
683
  });
662
684
  }
663
685
  //#endregion
664
- export { $ as default };
686
+ export { Z as default };