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