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