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