@burdenoff/microfe-movethewheels 2026.925.1 → 2026.925.3

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