@burdenoff/microfe-movethewheels 2026.1031.3 → 2026.1031.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/MoveTheWheelsRoot.js +136 -127
  2. package/dist/MoveTheWheelsRoutes.js +143 -135
  3. package/dist/components/DocumentsCard.js +11 -11
  4. package/dist/components/ProofOfDeliveryCard.js +13 -13
  5. package/dist/components/ShipmentRiskDialog.js +24 -24
  6. package/dist/components/ShippingQuoteResults.js +46 -46
  7. package/dist/components/TrackingAlertList.js +17 -17
  8. package/dist/generated/tracking-quality-operations.d.ts +56 -0
  9. package/dist/hooks/useOrderDispatch.js +17 -17
  10. package/dist/movethewheels/pages/SettingsPage.d.ts +1 -0
  11. package/dist/movethewheels/providers/ModuleSettingsProvider.d.ts +17 -0
  12. package/dist/movethewheels/utils/formatters.d.ts +23 -3
  13. package/dist/movethewheels/utils/moduleSettings.d.ts +52 -0
  14. package/dist/node_modules/lucide-react/dist/esm/icons/bell.js +11 -0
  15. package/dist/node_modules/lucide-react/dist/esm/icons/key-round.js +14 -0
  16. package/dist/node_modules/lucide-react/dist/esm/icons/plug.js +22 -0
  17. package/dist/node_modules/lucide-react/dist/esm/icons/rotate-ccw.js +11 -0
  18. package/dist/node_modules/lucide-react/dist/esm/icons/settings.js +13 -0
  19. package/dist/pages/AnalyticsPage.js +27 -27
  20. package/dist/pages/CreateOrderPage.js +340 -317
  21. package/dist/pages/CustomerDetailsPage.js +246 -246
  22. package/dist/pages/CustomersPage.js +19 -19
  23. package/dist/pages/DashboardPage.js +24 -24
  24. package/dist/pages/DeliveryCapturePage.js +74 -74
  25. package/dist/pages/DriverDetailsPage.js +337 -337
  26. package/dist/pages/DriversPage.js +26 -26
  27. package/dist/pages/FinancePage.js +26 -26
  28. package/dist/pages/InventoryPage.js +28 -28
  29. package/dist/pages/LiveTrackingPage.js +108 -108
  30. package/dist/pages/MarketplacePage.js +44 -44
  31. package/dist/pages/OrderDetailsPage.js +306 -306
  32. package/dist/pages/OrdersListPage.js +27 -27
  33. package/dist/pages/ProductDetailsPage.js +89 -89
  34. package/dist/pages/ProductsPage.js +73 -73
  35. package/dist/pages/RouteDetailsPage.js +282 -285
  36. package/dist/pages/RoutesPage.js +78 -78
  37. package/dist/pages/SettingsPage.js +459 -0
  38. package/dist/pages/TrackingPage.js +41 -41
  39. package/dist/pages/VehicleDetailsPage.js +207 -207
  40. package/dist/pages/VehiclesPage.js +17 -16
  41. package/dist/pages/WarehouseDetailsPage.js +132 -132
  42. package/dist/providers/ModuleSettingsProvider.js +74 -0
  43. package/dist/utils/formatters.js +53 -26
  44. package/dist/utils/moduleSettings.js +132 -0
  45. package/package.json +3 -2
  46. package/src/generated/tracking-quality-operations.ts +62 -0
  47. package/src/movethewheels/MoveTheWheelsRoot.tsx +18 -5
  48. package/src/movethewheels/MoveTheWheelsRoutes.tsx +19 -4
  49. package/src/movethewheels/pages/CreateOrderPage.tsx +38 -6
  50. package/src/movethewheels/pages/ProductsPage.tsx +2 -2
  51. package/src/movethewheels/pages/RouteDetailsPage.tsx +3 -6
  52. package/src/movethewheels/pages/RoutesPage.tsx +2 -2
  53. package/src/movethewheels/pages/SettingsPage.tsx +516 -0
  54. package/src/movethewheels/pages/VehicleDetailsPage.tsx +4 -2
  55. package/src/movethewheels/pages/VehiclesPage.tsx +2 -1
  56. package/src/movethewheels/providers/ModuleSettingsProvider.tsx +133 -0
  57. package/src/movethewheels/utils/formatters.ts +69 -10
  58. package/src/movethewheels/utils/moduleSettings.ts +224 -0
  59. package/dist/movethewheels/pages/AIAssistantPage.d.ts +0 -22
  60. package/dist/node_modules/lucide-react/dist/esm/icons/message-circle.js +0 -8
  61. package/dist/node_modules/lucide-react/dist/esm/icons/wallet.js +0 -11
  62. package/dist/pages/AIAssistantPage.js +0 -81
  63. package/src/movethewheels/pages/AIAssistantPage.tsx +0 -123
@@ -8,169 +8,178 @@ import { Save as ee } from "../node_modules/lucide-react/dist/esm/icons/save.js"
8
8
  import { Users as te } from "../node_modules/lucide-react/dist/esm/icons/users.js";
9
9
  import { buildCustomerCreatePath as ne, joinPath as o } from "../utils/navigation.js";
10
10
  import { useMoveTheWheels as re } from "../providers/MoveTheWheelsProvider.js";
11
- import { useRoute as ie, useRoutes as ae } from "../hooks/useRoutes.js";
12
- import { useOrder as oe, useOrders as se } from "../hooks/useOrders.js";
13
- import { useProducts as s } from "../hooks/useInventory.js";
14
- import { useCustomer as ce, useCustomers as le } from "../hooks/useCustomers.js";
15
- import { Badge as c, Button as l, Card as u, CardContent as d, CardDescription as f, CardHeader as p, CardTitle as m, Input as h, Label as g, Select as ue, SelectContent as de, SelectItem as _, SelectTrigger as fe, SelectValue as pe, Separator as me, Textarea as he } from "../components/ui.js";
16
- import { EmptyState as ge, PageLayout as _e } from "../components/PageLayout.js";
17
- import { FormError as ve } from "../components/FormError.js";
18
- import { EntityCombobox as v } from "../components/EntityCombobox.js";
19
- import { CustomerPicker as ye } from "../components/CustomerPicker.js";
20
- import { OrderItemRow as be } from "../components/OrderItemRow.js";
21
- import { validateOrderItems as xe } from "../utils/orderValidation.js";
22
- import { calculateOrderPricing as Se } from "../utils/orderPricing.js";
23
- import { useEffect as y, useState as b } from "react";
24
- import { useParams as Ce, useSearchParams as we } from "react-router";
25
- import { Fragment as Te, jsx as x, jsxs as S } from "react/jsx-runtime";
26
- import { EmphasisPanel as Ee, PagePurpose as De, Stepper as Oe } from "@burdenoff/fe-libs/ui";
27
- import { FormSection as C } from "@burdenoff/fe-libs/form";
11
+ import { deliveryWindowValue as ie, orderFormPriority as ae } from "../utils/moduleSettings.js";
12
+ import { useModuleSettings as oe } from "../providers/ModuleSettingsProvider.js";
13
+ import { useRoute as se, useRoutes as ce } from "../hooks/useRoutes.js";
14
+ import { useOrder as le, useOrders as ue } from "../hooks/useOrders.js";
15
+ import { useProducts as de } from "../hooks/useInventory.js";
16
+ import { useCustomer as fe, useCustomers as pe } from "../hooks/useCustomers.js";
17
+ import { Badge as s, Button as c, Card as l, CardContent as u, CardDescription as d, CardHeader as f, CardTitle as p, Input as m, Label as h, Select as me, SelectContent as he, SelectItem as g, SelectTrigger as ge, SelectValue as _e, Separator as ve, Textarea as ye } from "../components/ui.js";
18
+ import { EmptyState as be, PageLayout as xe } from "../components/PageLayout.js";
19
+ import { FormError as Se } from "../components/FormError.js";
20
+ import { EntityCombobox as Ce } from "../components/EntityCombobox.js";
21
+ import { CustomerPicker as we } from "../components/CustomerPicker.js";
22
+ import { OrderItemRow as Te } from "../components/OrderItemRow.js";
23
+ import { validateOrderItems as Ee } from "../utils/orderValidation.js";
24
+ import { calculateOrderPricing as De } from "../utils/orderPricing.js";
25
+ import { useEffect as _, useRef as Oe, useState as v } from "react";
26
+ import { useParams as ke, useSearchParams as Ae } from "react-router";
27
+ import { Fragment as je, jsx as y, jsxs as b } from "react/jsx-runtime";
28
+ import { EmphasisPanel as Me, PagePurpose as Ne, Stepper as Pe } from "@burdenoff/fe-libs/ui";
29
+ import { FormSection as x } from "@burdenoff/fe-libs/form";
28
30
  //#region src/movethewheels/pages/CreateOrderPage.tsx
29
- function w(e) {
31
+ function S(e) {
30
32
  if (!e || Number.isNaN(e.getTime())) return "";
31
33
  let t = (e) => String(e).padStart(2, "0");
32
34
  return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`;
33
35
  }
34
- function T() {
35
- let { orderId: T } = Ce(), [ke] = we(), E = ke.get("customerId")?.trim() || void 0, { basePath: D, navigate: O } = re(), { order: k } = oe(T), { createOrder: Ae, updateOrder: je } = se(), [Me, Ne] = b(""), { customers: A, createCustomer: Pe, isLoading: j, isLoadingMore: Fe, error: M, refetch: Ie, loadMore: Le, hasMore: Re, totalCustomers: ze } = le({
36
+ function C() {
37
+ let { orderId: C } = ke(), [Fe] = Ae(), w = Fe.get("customerId")?.trim() || void 0, { basePath: T, navigate: E } = re(), { order: D } = le(C), { createOrder: Ie, updateOrder: Le } = ue(), [Re, ze] = v(""), { customers: O, createCustomer: Be, isLoading: k, isLoadingMore: Ve, error: A, refetch: He, loadMore: Ue, hasMore: We, totalCustomers: Ge } = pe({
36
38
  limit: 20,
37
- filters: { search: Me || void 0 }
38
- }), { customer: N } = ce(E ?? k?.customerId), [Be, Ve] = b(""), { routes: P, isLoading: F, error: I, hasMore: He, totalRoutes: Ue, loadMore: L, isLoadingMore: We } = ae({
39
+ filters: { search: Re || void 0 }
40
+ }), { customer: j } = fe(w ?? D?.customerId), [Ke, qe] = v(""), { routes: M, isLoading: N, error: P, hasMore: Je, totalRoutes: Ye, loadMore: Xe, isLoadingMore: Ze } = ce({
39
41
  status: "planned",
40
- search: Be || void 0,
42
+ search: Ke || void 0,
41
43
  limit: 20
42
- }), [R, Ge] = b(""), { products: Ke, isLoading: qe, isLoadingMore: Je, hasMore: Ye, totalProducts: Xe, loadMore: Ze } = s({
43
- search: R || void 0,
44
+ }), [F, Qe] = v(""), { products: $e, isLoading: et, isLoadingMore: tt, hasMore: nt, totalProducts: rt, loadMore: it } = de({
45
+ search: F || void 0,
44
46
  limit: 20
45
- }), z = !!T && !!k, [B, V] = b(null), [H, U] = b({
46
- customerId: E || k?.customerId || "",
47
- priority: k?.priority || "normal",
48
- routeId: k?.routeId || "",
47
+ }), I = !!C && !!D, { settings: L } = oe(), R = ae(L.defaultOrderPriority), z = L.defaultDeliveryWindowHours, B = Oe(!1), [V, H] = v(null), [U, W] = v({
48
+ customerId: w || D?.customerId || "",
49
+ priority: D?.priority || R,
50
+ routeId: D?.routeId || "",
49
51
  pickupAddress: {
50
- street: k?.pickupAddress.street || "",
51
- city: k?.pickupAddress.city || "",
52
- state: k?.pickupAddress.state || "",
53
- postalCode: k?.pickupAddress.postalCode || "",
54
- country: k?.pickupAddress.country || "USA"
52
+ street: D?.pickupAddress.street || "",
53
+ city: D?.pickupAddress.city || "",
54
+ state: D?.pickupAddress.state || "",
55
+ postalCode: D?.pickupAddress.postalCode || "",
56
+ country: D?.pickupAddress.country || "USA"
55
57
  },
56
58
  deliveryAddress: {
57
- street: k?.deliveryAddress.street || "",
58
- city: k?.deliveryAddress.city || "",
59
- state: k?.deliveryAddress.state || "",
60
- postalCode: k?.deliveryAddress.postalCode || "",
61
- country: k?.deliveryAddress.country || "USA"
59
+ street: D?.deliveryAddress.street || "",
60
+ city: D?.deliveryAddress.city || "",
61
+ state: D?.deliveryAddress.state || "",
62
+ postalCode: D?.deliveryAddress.postalCode || "",
63
+ country: D?.deliveryAddress.country || "USA"
62
64
  },
63
- items: k?.items || [],
64
- trackingNumber: k?.trackingNumber || "",
65
- scheduledDelivery: w(k?.scheduledDelivery),
66
- specialInstructions: k?.specialInstructions || ""
67
- }), { route: Qe, isLoading: $e } = ie(H.routeId || void 0), [W, G] = b(!1), [et, K] = b(null), [q, J] = b({});
68
- y(() => {
69
- N && (V((e) => e?.id === N.id ? e : N), U((e) => e.customerId ? e : {
65
+ items: D?.items || [],
66
+ trackingNumber: D?.trackingNumber || "",
67
+ scheduledDelivery: S(D?.scheduledDelivery),
68
+ specialInstructions: D?.specialInstructions || ""
69
+ }), { route: at, isLoading: ot } = se(U.routeId || void 0), [G, K] = v(!1), [st, q] = v(null), [J, Y] = v({});
70
+ _(() => {
71
+ j && (H((e) => e?.id === j.id ? e : j), W((e) => e.customerId ? e : {
70
72
  ...e,
71
- customerId: N.id
73
+ customerId: j.id
72
74
  }));
73
- }, [N]), y(() => {
74
- k && U({
75
- customerId: k.customerId || "",
76
- priority: k.priority || "normal",
77
- routeId: k.routeId || "",
75
+ }, [j]), _(() => {
76
+ D && W({
77
+ customerId: D.customerId || "",
78
+ priority: D.priority || "normal",
79
+ routeId: D.routeId || "",
78
80
  pickupAddress: {
79
- street: k.pickupAddress.street || "",
80
- city: k.pickupAddress.city || "",
81
- state: k.pickupAddress.state || "",
82
- postalCode: k.pickupAddress.postalCode || "",
83
- country: k.pickupAddress.country || "USA"
81
+ street: D.pickupAddress.street || "",
82
+ city: D.pickupAddress.city || "",
83
+ state: D.pickupAddress.state || "",
84
+ postalCode: D.pickupAddress.postalCode || "",
85
+ country: D.pickupAddress.country || "USA"
84
86
  },
85
87
  deliveryAddress: {
86
- street: k.deliveryAddress.street || "",
87
- city: k.deliveryAddress.city || "",
88
- state: k.deliveryAddress.state || "",
89
- postalCode: k.deliveryAddress.postalCode || "",
90
- country: k.deliveryAddress.country || "USA"
88
+ street: D.deliveryAddress.street || "",
89
+ city: D.deliveryAddress.city || "",
90
+ state: D.deliveryAddress.state || "",
91
+ postalCode: D.deliveryAddress.postalCode || "",
92
+ country: D.deliveryAddress.country || "USA"
91
93
  },
92
- items: k.items || [],
93
- trackingNumber: k.trackingNumber || "",
94
- scheduledDelivery: w(k.scheduledDelivery),
95
- specialInstructions: k.specialInstructions || ""
94
+ items: D.items || [],
95
+ trackingNumber: D.trackingNumber || "",
96
+ scheduledDelivery: S(D.scheduledDelivery),
97
+ specialInstructions: D.specialInstructions || ""
96
98
  });
97
- }, [k]);
98
- let Y = () => {
99
- if (O) {
100
- if (!z && E) {
101
- O(o(D, `customers/${E}`));
99
+ }, [D]);
100
+ let X = () => {
101
+ if (E) {
102
+ if (!I && w) {
103
+ E(o(T, `customers/${w}`));
102
104
  return;
103
105
  }
104
- O(o(D, "orders"));
106
+ E(o(T, "orders"));
105
107
  }
106
- }, X = () => B ?? A.find((e) => e.id === H.customerId), tt = () => {
107
- if (!H.customerId || !X()) return M ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order.";
108
- if (!H.pickupAddress.street.trim()) return "Enter a pickup street address.";
109
- if (!H.deliveryAddress.street.trim()) return "Enter a delivery street address.";
110
- if (H.items.length === 0) return "Add at least one item to the order.";
111
- let e = xe(H.items);
112
- return J(e), Object.keys(e).length > 0 ? "Fix the highlighted shipment item fields before continuing." : H.scheduledDelivery && Number.isNaN(Date.parse(H.scheduledDelivery)) ? "Enter a valid scheduled delivery date and time." : null;
113
- }, nt = async (e) => {
114
- e.preventDefault(), K(null);
115
- let t = tt();
108
+ }, ct = () => V ?? O.find((e) => e.id === U.customerId), lt = () => {
109
+ if (!U.customerId || !ct()) return A ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order.";
110
+ if (!U.pickupAddress.street.trim()) return "Enter a pickup street address.";
111
+ if (!U.deliveryAddress.street.trim()) return "Enter a delivery street address.";
112
+ if (U.items.length === 0) return "Add at least one item to the order.";
113
+ let e = Ee(U.items);
114
+ return Y(e), Object.keys(e).length > 0 ? "Fix the highlighted shipment item fields before continuing." : U.scheduledDelivery && Number.isNaN(Date.parse(U.scheduledDelivery)) ? "Enter a valid scheduled delivery date and time." : null;
115
+ }, ut = async (e) => {
116
+ e.preventDefault(), q(null);
117
+ let t = lt();
116
118
  if (t) {
117
- K(t);
119
+ q(t);
118
120
  return;
119
121
  }
120
- let n = X();
122
+ let n = ct();
121
123
  if (!n) {
122
- K(M ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order.");
124
+ q(A ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order.");
123
125
  return;
124
126
  }
125
- G(!0);
127
+ K(!0);
126
128
  try {
127
129
  let e = {
128
- customerId: H.customerId,
130
+ customerId: U.customerId,
129
131
  customerInfo: {
130
132
  name: n.name,
131
133
  email: n.email,
132
134
  phone: n.phone,
133
135
  company: n.company
134
136
  },
135
- priority: H.priority,
136
- pickupAddress: H.pickupAddress,
137
- deliveryAddress: H.deliveryAddress,
138
- items: H.items,
139
- pricing: Se(H.items, z ? k?.pricing : void 0),
140
- trackingNumber: H.trackingNumber.trim() || void 0,
141
- scheduledDelivery: H.scheduledDelivery ? new Date(H.scheduledDelivery) : null,
142
- routeId: H.routeId || void 0,
143
- specialInstructions: H.specialInstructions
137
+ priority: U.priority,
138
+ pickupAddress: U.pickupAddress,
139
+ deliveryAddress: U.deliveryAddress,
140
+ items: U.items,
141
+ pricing: De(U.items, I ? D?.pricing : void 0),
142
+ trackingNumber: U.trackingNumber.trim() || void 0,
143
+ scheduledDelivery: U.scheduledDelivery ? new Date(U.scheduledDelivery) : null,
144
+ routeId: U.routeId || void 0,
145
+ specialInstructions: U.specialInstructions
144
146
  };
145
- if (z && T) await je(T, e), O && O(o(D, `orders/${T}`));
147
+ if (I && C) await Le(C, e), E && E(o(T, `orders/${C}`));
146
148
  else {
147
- let t = await Ae(e);
148
- O ? O(o(D, `orders/${t.id}`)) : Y();
149
+ let t = await Ie(e);
150
+ E ? E(o(T, `orders/${t.id}`)) : X();
149
151
  }
150
152
  } catch (e) {
151
- K(e instanceof Error ? e.message : z ? "Could not update the order. Please try again." : "Could not create the order. Please try again.");
153
+ q(e instanceof Error ? e.message : I ? "Could not update the order. Please try again." : "Could not create the order. Please try again.");
152
154
  } finally {
153
- G(!1);
155
+ K(!1);
154
156
  }
155
157
  }, Z = (e, t) => {
156
- U((n) => ({
158
+ e === "priority" && (B.current = !0), W((n) => ({
157
159
  ...n,
158
160
  [e]: t
159
161
  }));
160
- }, Q = (e, t, n) => {
161
- U((r) => ({
162
+ };
163
+ _(() => {
164
+ C || B.current || W((e) => e.priority === R ? e : {
165
+ ...e,
166
+ priority: R
167
+ });
168
+ }, [C, R]);
169
+ let Q = (e, t, n) => {
170
+ W((r) => ({
162
171
  ...r,
163
172
  [e]: {
164
173
  ...r[e],
165
174
  [t]: n
166
175
  }
167
176
  }));
168
- }, rt = (e) => {
177
+ }, dt = (e) => {
169
178
  if (!e) {
170
179
  Z("routeId", "");
171
180
  return;
172
181
  }
173
- let t = P.find((t) => t.id === e);
182
+ let t = M.find((t) => t.id === e);
174
183
  if (!t) return;
175
184
  let n = t.stops.find((e) => e.type === "pickup")?.address, r = [...t.stops].reverse().find((e) => e.type === "delivery")?.address, i = (e, t) => t ? {
176
185
  street: e.street.trim() ? e.street : t.street,
@@ -179,14 +188,14 @@ function T() {
179
188
  postalCode: e.postalCode.trim() ? e.postalCode : t.postalCode,
180
189
  country: e.country.trim() ? e.country : t.country
181
190
  } : e;
182
- U((e) => ({
191
+ W((e) => ({
183
192
  ...e,
184
193
  routeId: t.id,
185
194
  pickupAddress: i(e.pickupAddress, n),
186
195
  deliveryAddress: i(e.deliveryAddress, r)
187
196
  }));
188
197
  }, $ = () => {
189
- U((e) => ({
198
+ W((e) => ({
190
199
  ...e,
191
200
  items: [...e.items, {
192
201
  id: `item-${Date.now()}`,
@@ -204,56 +213,56 @@ function T() {
204
213
  sku: ""
205
214
  }]
206
215
  }));
207
- }, it = (e) => {
208
- let t = H.items[e]?.id;
209
- t && J((e) => {
216
+ }, ft = (e) => {
217
+ let t = U.items[e]?.id;
218
+ t && Y((e) => {
210
219
  let n = { ...e };
211
220
  return delete n[t], n;
212
- }), U((t) => ({
221
+ }), W((t) => ({
213
222
  ...t,
214
223
  items: t.items.filter((t, n) => n !== e)
215
224
  }));
216
- }, at = (e, t, n) => {
217
- let r = H.items[e]?.id;
218
- r && q[r] && J((e) => {
225
+ }, pt = (e, t, n) => {
226
+ let r = U.items[e]?.id;
227
+ r && J[r] && Y((e) => {
219
228
  let t = { ...e };
220
229
  return delete t[r], t;
221
- }), U((r) => ({
230
+ }), W((r) => ({
222
231
  ...r,
223
232
  items: r.items.map((r, i) => i === e ? {
224
233
  ...r,
225
234
  [t]: n
226
235
  } : r)
227
236
  }));
228
- }, ot = () => {
229
- O && O(o(D, ne(z && T ? `orders/${T}/edit` : "orders/new")));
230
- }, st = H.customerId ? !H.pickupAddress.street || !H.deliveryAddress.street ? 1 : H.items.length === 0 ? 2 : 3 : 0;
231
- return /* @__PURE__ */ S(_e, {
232
- title: z ? "Edit Order" : "Create Order",
233
- subtitle: z ? `Editing ${k?.orderNumber}` : "Create a new delivery order",
234
- icon: /* @__PURE__ */ x(i, { size: 24 }),
237
+ }, mt = () => {
238
+ E && E(o(T, ne(I && C ? `orders/${C}/edit` : "orders/new")));
239
+ }, ht = U.customerId ? !U.pickupAddress.street || !U.deliveryAddress.street ? 1 : U.items.length === 0 ? 2 : 3 : 0;
240
+ return /* @__PURE__ */ b(xe, {
241
+ title: I ? "Edit Order" : "Create Order",
242
+ subtitle: I ? `Editing ${D?.orderNumber}` : "Create a new delivery order",
243
+ icon: /* @__PURE__ */ y(i, { size: 24 }),
235
244
  maxWidth: "2xl",
236
- headerActions: /* @__PURE__ */ S("div", {
245
+ headerActions: /* @__PURE__ */ b("div", {
237
246
  className: "flex w-full flex-col-reverse gap-2 sm:w-auto sm:flex-row",
238
- children: [/* @__PURE__ */ S(l, {
247
+ children: [/* @__PURE__ */ b(c, {
239
248
  type: "button",
240
249
  variant: "outline",
241
- onClick: Y,
242
- disabled: W,
243
- children: [/* @__PURE__ */ x(e, { size: 16 }), "Cancel"]
244
- }), /* @__PURE__ */ S(l, {
250
+ onClick: X,
251
+ disabled: G,
252
+ children: [/* @__PURE__ */ y(e, { size: 16 }), "Cancel"]
253
+ }), /* @__PURE__ */ b(c, {
245
254
  type: "submit",
246
255
  form: "order-form",
247
- disabled: W || j,
248
- children: [/* @__PURE__ */ x(ee, { size: 16 }), W ? "Saving..." : z ? "Save Changes" : "Create Order"]
256
+ disabled: G || k,
257
+ children: [/* @__PURE__ */ y(ee, { size: 16 }), G ? "Saving..." : I ? "Save Changes" : "Create Order"]
249
258
  })]
250
259
  }),
251
260
  children: [
252
- /* @__PURE__ */ x(De, {
253
- icon: /* @__PURE__ */ x(i, { size: 18 }),
254
- children: z ? "Update the customer, delivery plan, shipment contents, or handling details before saving." : "Set the customer and delivery plan, add what is being shipped, then choose any timing or handling preferences."
261
+ /* @__PURE__ */ y(Ne, {
262
+ icon: /* @__PURE__ */ y(i, { size: 18 }),
263
+ children: I ? "Update the customer, delivery plan, shipment contents, or handling details before saving." : "Set the customer and delivery plan, add what is being shipped, then choose any timing or handling preferences."
255
264
  }),
256
- /* @__PURE__ */ x(Oe, {
265
+ /* @__PURE__ */ y(Pe, {
257
266
  steps: [
258
267
  {
259
268
  key: "customer",
@@ -276,7 +285,7 @@ function T() {
276
285
  description: "Add optional delivery instructions."
277
286
  }
278
287
  ],
279
- active: st,
288
+ active: ht,
280
289
  onStepClick: (e) => {
281
290
  let t = document.getElementById([
282
291
  "customer",
@@ -295,255 +304,255 @@ function T() {
295
304
  },
296
305
  allowSkipAhead: !0
297
306
  }),
298
- /* @__PURE__ */ S("form", {
307
+ /* @__PURE__ */ b("form", {
299
308
  id: "order-form",
300
- onSubmit: nt,
309
+ onSubmit: ut,
301
310
  className: "space-y-6",
302
311
  children: [
303
- /* @__PURE__ */ x(ve, { message: et }),
304
- /* @__PURE__ */ x("section", {
312
+ /* @__PURE__ */ y(Se, { message: st }),
313
+ /* @__PURE__ */ y("section", {
305
314
  "aria-labelledby": "order-details-title",
306
- children: /* @__PURE__ */ S(Ee, {
315
+ children: /* @__PURE__ */ b(Me, {
307
316
  className: "space-y-5",
308
- children: [/* @__PURE__ */ S("div", {
317
+ children: [/* @__PURE__ */ b("div", {
309
318
  className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
310
- children: [/* @__PURE__ */ S("div", {
319
+ children: [/* @__PURE__ */ b("div", {
311
320
  className: "flex items-start gap-3",
312
- children: [/* @__PURE__ */ x("div", {
321
+ children: [/* @__PURE__ */ y("div", {
313
322
  className: "rounded-xl bg-action-primary-bg/10 p-2 text-action-primary-bg",
314
- children: /* @__PURE__ */ x(te, {
323
+ children: /* @__PURE__ */ y(te, {
315
324
  size: 18,
316
325
  "aria-hidden": "true"
317
326
  })
318
- }), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("h2", {
327
+ }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h2", {
319
328
  id: "order-details-title",
320
329
  className: "text-base font-semibold text-text-primary",
321
330
  children: "Customer & priority"
322
- }), /* @__PURE__ */ x("p", {
331
+ }), /* @__PURE__ */ y("p", {
323
332
  className: "mt-1 text-sm text-text-secondary",
324
333
  children: "Choose who this delivery is for and how urgently it should be handled."
325
334
  })] })]
326
- }), /* @__PURE__ */ x(c, {
335
+ }), /* @__PURE__ */ y(s, {
327
336
  variant: "outline",
328
337
  children: "Required"
329
338
  })]
330
- }), /* @__PURE__ */ S("div", {
339
+ }), /* @__PURE__ */ b("div", {
331
340
  className: "grid grid-cols-1 gap-4 md:grid-cols-2",
332
- children: [/* @__PURE__ */ x(ye, {
333
- customers: A,
334
- value: H.customerId,
341
+ children: [/* @__PURE__ */ y(we, {
342
+ customers: O,
343
+ value: U.customerId,
335
344
  onValueChange: (e) => {
336
- e && (Z("customerId", e), V(A.find((t) => t.id === e) ?? (B?.id === e ? B : null)), K(null));
345
+ e && (Z("customerId", e), H(O.find((t) => t.id === e) ?? (V?.id === e ? V : null)), q(null));
337
346
  },
338
347
  onCreated: (e) => {
339
- V(e), Z("customerId", e.id), K(null);
348
+ H(e), Z("customerId", e.id), q(null);
340
349
  },
341
- createCustomer: Pe,
342
- isLoading: j,
343
- error: M,
344
- onRetry: Ie,
345
- onOpenCustomers: ot,
346
- selectedCustomer: B,
347
- onSearchQueryChange: Ne,
348
- hasMore: Re,
349
- totalCount: ze,
350
- onLoadMore: Le,
351
- isLoadingMore: Fe
352
- }), /* @__PURE__ */ S("div", {
350
+ createCustomer: Be,
351
+ isLoading: k,
352
+ error: A,
353
+ onRetry: He,
354
+ onOpenCustomers: mt,
355
+ selectedCustomer: V,
356
+ onSearchQueryChange: ze,
357
+ hasMore: We,
358
+ totalCount: Ge,
359
+ onLoadMore: Ue,
360
+ isLoadingMore: Ve
361
+ }), /* @__PURE__ */ b("div", {
353
362
  className: "min-w-0 space-y-2",
354
363
  children: [
355
- /* @__PURE__ */ x(g, {
364
+ /* @__PURE__ */ y(h, {
356
365
  htmlFor: "priority",
357
366
  children: "Priority"
358
367
  }),
359
- /* @__PURE__ */ S(ue, {
360
- value: H.priority,
368
+ /* @__PURE__ */ b(me, {
369
+ value: U.priority,
361
370
  onValueChange: (e) => Z("priority", e),
362
- children: [/* @__PURE__ */ x(fe, {
371
+ children: [/* @__PURE__ */ y(ge, {
363
372
  id: "priority",
364
- children: /* @__PURE__ */ x(pe, {})
365
- }), /* @__PURE__ */ S(de, { children: [
366
- /* @__PURE__ */ x(_, {
373
+ children: /* @__PURE__ */ y(_e, {})
374
+ }), /* @__PURE__ */ b(he, { children: [
375
+ /* @__PURE__ */ y(g, {
367
376
  value: "low",
368
377
  children: "Low"
369
378
  }),
370
- /* @__PURE__ */ x(_, {
379
+ /* @__PURE__ */ y(g, {
371
380
  value: "normal",
372
381
  children: "Normal"
373
382
  }),
374
- /* @__PURE__ */ x(_, {
383
+ /* @__PURE__ */ y(g, {
375
384
  value: "high",
376
385
  children: "High"
377
386
  }),
378
- /* @__PURE__ */ x(_, {
387
+ /* @__PURE__ */ y(g, {
379
388
  value: "urgent",
380
389
  children: "Urgent"
381
390
  })
382
391
  ] })]
383
392
  }),
384
- /* @__PURE__ */ x("p", {
393
+ /* @__PURE__ */ y("p", {
385
394
  className: "text-xs text-text-secondary",
386
- children: "Normal is selected by default."
395
+ children: "New orders start with this workspace's default priority."
387
396
  })
388
397
  ]
389
398
  })]
390
399
  })]
391
400
  })
392
401
  }),
393
- /* @__PURE__ */ x("div", {
402
+ /* @__PURE__ */ y("div", {
394
403
  id: "locations-section",
395
- children: /* @__PURE__ */ S(C, {
396
- title: /* @__PURE__ */ S("span", {
404
+ children: /* @__PURE__ */ b(x, {
405
+ title: /* @__PURE__ */ b("span", {
397
406
  className: "flex items-center gap-2",
398
- children: [/* @__PURE__ */ x(r, {
407
+ children: [/* @__PURE__ */ y(r, {
399
408
  size: 18,
400
409
  "aria-hidden": "true"
401
410
  }), "Route & addresses"]
402
411
  }),
403
412
  description: "Choose an optional saved route, then review or enter the collection and destination details.",
404
413
  children: [
405
- /* @__PURE__ */ S("div", {
414
+ /* @__PURE__ */ b("div", {
406
415
  className: "rounded-card border border-border-subtle bg-bg-sunken/40 p-4",
407
416
  children: [
408
- /* @__PURE__ */ S("div", {
417
+ /* @__PURE__ */ b("div", {
409
418
  className: "mb-3 flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",
410
- children: [/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("h3", {
419
+ children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h3", {
411
420
  className: "text-sm font-semibold text-text-primary",
412
421
  children: "Use a saved route"
413
- }), /* @__PURE__ */ x("p", {
422
+ }), /* @__PURE__ */ y("p", {
414
423
  className: "mt-1 text-xs text-text-secondary",
415
424
  children: "Optional — fills only blank address fields; you can always edit them below."
416
- })] }), /* @__PURE__ */ x(c, {
425
+ })] }), /* @__PURE__ */ y(s, {
417
426
  variant: "secondary",
418
427
  children: "Optional"
419
428
  })]
420
429
  }),
421
- /* @__PURE__ */ x(v, {
430
+ /* @__PURE__ */ y(Ce, {
422
431
  id: "saved-route",
423
- value: H.routeId,
424
- onChange: rt,
425
- options: P,
426
- loading: F,
432
+ value: U.routeId,
433
+ onChange: dt,
434
+ options: M,
435
+ loading: N,
427
436
  getId: (e) => e.id,
428
437
  getLabel: (e) => `${e.name} · ${e.stops.length} stops`,
429
- renderOption: (e) => /* @__PURE__ */ S(Te, { children: [
438
+ renderOption: (e) => /* @__PURE__ */ b(je, { children: [
430
439
  e.name,
431
440
  " · ",
432
441
  e.stops.length,
433
442
  " stops"
434
443
  ] }),
435
- selectedOption: Qe,
436
- selectedLoading: $e,
444
+ selectedOption: at,
445
+ selectedLoading: ot,
437
446
  placeholder: "Choose a saved route",
438
447
  searchPlaceholder: "Search saved routes",
439
448
  emptyText: "No saved routes found.",
440
449
  noneLabel: "No saved route",
441
- error: I ? "Saved routes are unavailable" : void 0,
442
- onSearchChange: Ve,
443
- hasMore: He,
444
- totalCount: Ue,
445
- onLoadMore: L,
446
- loadingMore: We
450
+ error: P ? "Saved routes are unavailable" : void 0,
451
+ onSearchChange: qe,
452
+ hasMore: Je,
453
+ totalCount: Ye,
454
+ onLoadMore: Xe,
455
+ loadingMore: Ze
447
456
  }),
448
- /* @__PURE__ */ x("p", {
457
+ /* @__PURE__ */ y("p", {
449
458
  className: "mt-2 text-xs text-text-secondary",
450
459
  role: "status",
451
- children: F ? "Loading planned routes…" : I ? "Saved routes are unavailable; enter pickup and delivery addresses manually." : "Manual values always remain authoritative when a route is selected."
460
+ children: N ? "Loading planned routes…" : P ? "Saved routes are unavailable; enter pickup and delivery addresses manually." : "Manual values always remain authoritative when a route is selected."
452
461
  })
453
462
  ]
454
463
  }),
455
- /* @__PURE__ */ x(me, {}),
456
- /* @__PURE__ */ S("div", {
464
+ /* @__PURE__ */ y(ve, {}),
465
+ /* @__PURE__ */ b("div", {
457
466
  className: "grid grid-cols-1 gap-4 lg:grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] lg:items-stretch",
458
467
  children: [
459
- /* @__PURE__ */ S(u, {
468
+ /* @__PURE__ */ b(l, {
460
469
  className: "border-border-seam shadow-none",
461
- children: [/* @__PURE__ */ S(p, { children: [/* @__PURE__ */ S(m, {
470
+ children: [/* @__PURE__ */ b(f, { children: [/* @__PURE__ */ b(p, {
462
471
  className: "flex items-center gap-2 text-base",
463
472
  children: [
464
- /* @__PURE__ */ x(r, {
473
+ /* @__PURE__ */ y(r, {
465
474
  size: 17,
466
475
  className: "text-text-secondary",
467
476
  "aria-hidden": "true"
468
477
  }),
469
478
  "Pickup address ",
470
- /* @__PURE__ */ x("span", {
479
+ /* @__PURE__ */ y("span", {
471
480
  className: "text-status-error-text",
472
481
  children: "*"
473
482
  })
474
483
  ]
475
- }), /* @__PURE__ */ x(f, { children: "Where the shipment is collected." })] }), /* @__PURE__ */ x(d, {
484
+ }), /* @__PURE__ */ y(d, { children: "Where the shipment is collected." })] }), /* @__PURE__ */ y(u, {
476
485
  className: "space-y-4",
477
- children: /* @__PURE__ */ S("fieldset", {
486
+ children: /* @__PURE__ */ b("fieldset", {
478
487
  className: "space-y-4",
479
488
  children: [
480
- /* @__PURE__ */ x("legend", {
489
+ /* @__PURE__ */ y("legend", {
481
490
  className: "sr-only",
482
491
  children: "Pickup address details"
483
492
  }),
484
- /* @__PURE__ */ S("div", {
493
+ /* @__PURE__ */ b("div", {
485
494
  className: "space-y-2",
486
- children: [/* @__PURE__ */ S(g, {
495
+ children: [/* @__PURE__ */ b(h, {
487
496
  htmlFor: "pickupStreet",
488
- children: ["Street address ", /* @__PURE__ */ x("span", {
497
+ children: ["Street address ", /* @__PURE__ */ y("span", {
489
498
  className: "text-status-error-text",
490
499
  children: "*"
491
500
  })]
492
- }), /* @__PURE__ */ x(h, {
501
+ }), /* @__PURE__ */ y(m, {
493
502
  id: "pickupStreet",
494
- value: H.pickupAddress.street,
503
+ value: U.pickupAddress.street,
495
504
  onChange: (e) => Q("pickupAddress", "street", e.target.value),
496
505
  placeholder: "123 Main St",
497
506
  "aria-required": "true"
498
507
  })]
499
508
  }),
500
- /* @__PURE__ */ S("div", {
509
+ /* @__PURE__ */ b("div", {
501
510
  className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
502
- children: [/* @__PURE__ */ S("div", {
511
+ children: [/* @__PURE__ */ b("div", {
503
512
  className: "space-y-2",
504
- children: [/* @__PURE__ */ x(g, {
513
+ children: [/* @__PURE__ */ y(h, {
505
514
  htmlFor: "pickupCity",
506
515
  children: "City"
507
- }), /* @__PURE__ */ x(h, {
516
+ }), /* @__PURE__ */ y(m, {
508
517
  id: "pickupCity",
509
- value: H.pickupAddress.city,
518
+ value: U.pickupAddress.city,
510
519
  onChange: (e) => Q("pickupAddress", "city", e.target.value),
511
520
  placeholder: "San Francisco"
512
521
  })]
513
- }), /* @__PURE__ */ S("div", {
522
+ }), /* @__PURE__ */ b("div", {
514
523
  className: "space-y-2",
515
- children: [/* @__PURE__ */ x(g, {
524
+ children: [/* @__PURE__ */ y(h, {
516
525
  htmlFor: "pickupState",
517
526
  children: "State"
518
- }), /* @__PURE__ */ x(h, {
527
+ }), /* @__PURE__ */ y(m, {
519
528
  id: "pickupState",
520
- value: H.pickupAddress.state,
529
+ value: U.pickupAddress.state,
521
530
  onChange: (e) => Q("pickupAddress", "state", e.target.value),
522
531
  placeholder: "CA"
523
532
  })]
524
533
  })]
525
534
  }),
526
- /* @__PURE__ */ S("div", {
535
+ /* @__PURE__ */ b("div", {
527
536
  className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
528
- children: [/* @__PURE__ */ S("div", {
537
+ children: [/* @__PURE__ */ b("div", {
529
538
  className: "space-y-2",
530
- children: [/* @__PURE__ */ x(g, {
539
+ children: [/* @__PURE__ */ y(h, {
531
540
  htmlFor: "pickupPostal",
532
541
  children: "Postal Code"
533
- }), /* @__PURE__ */ x(h, {
542
+ }), /* @__PURE__ */ y(m, {
534
543
  id: "pickupPostal",
535
- value: H.pickupAddress.postalCode,
544
+ value: U.pickupAddress.postalCode,
536
545
  onChange: (e) => Q("pickupAddress", "postalCode", e.target.value),
537
546
  placeholder: "94103"
538
547
  })]
539
- }), /* @__PURE__ */ S("div", {
548
+ }), /* @__PURE__ */ b("div", {
540
549
  className: "space-y-2",
541
- children: [/* @__PURE__ */ x(g, {
550
+ children: [/* @__PURE__ */ y(h, {
542
551
  htmlFor: "pickupCountry",
543
552
  children: "Country"
544
- }), /* @__PURE__ */ x(h, {
553
+ }), /* @__PURE__ */ y(m, {
545
554
  id: "pickupCountry",
546
- value: H.pickupAddress.country,
555
+ value: U.pickupAddress.country,
547
556
  onChange: (e) => Q("pickupAddress", "country", e.target.value),
548
557
  placeholder: "USA"
549
558
  })]
@@ -553,102 +562,102 @@ function T() {
553
562
  })
554
563
  })]
555
564
  }),
556
- /* @__PURE__ */ x("div", {
565
+ /* @__PURE__ */ y("div", {
557
566
  className: "hidden items-center justify-center lg:flex",
558
567
  "aria-hidden": "true",
559
- children: /* @__PURE__ */ x(t, {
568
+ children: /* @__PURE__ */ y(t, {
560
569
  size: 18,
561
570
  className: "text-text-muted"
562
571
  })
563
572
  }),
564
- /* @__PURE__ */ S(u, {
573
+ /* @__PURE__ */ b(l, {
565
574
  className: "border-border-seam shadow-none",
566
- children: [/* @__PURE__ */ S(p, { children: [/* @__PURE__ */ S(m, {
575
+ children: [/* @__PURE__ */ b(f, { children: [/* @__PURE__ */ b(p, {
567
576
  className: "flex items-center gap-2 text-base",
568
577
  children: [
569
- /* @__PURE__ */ x(r, {
578
+ /* @__PURE__ */ y(r, {
570
579
  size: 17,
571
580
  className: "text-text-secondary",
572
581
  "aria-hidden": "true"
573
582
  }),
574
583
  "Delivery address ",
575
- /* @__PURE__ */ x("span", {
584
+ /* @__PURE__ */ y("span", {
576
585
  className: "text-status-error-text",
577
586
  children: "*"
578
587
  })
579
588
  ]
580
- }), /* @__PURE__ */ x(f, { children: "Where the shipment is delivered." })] }), /* @__PURE__ */ x(d, {
589
+ }), /* @__PURE__ */ y(d, { children: "Where the shipment is delivered." })] }), /* @__PURE__ */ y(u, {
581
590
  className: "space-y-4",
582
- children: /* @__PURE__ */ S("fieldset", {
591
+ children: /* @__PURE__ */ b("fieldset", {
583
592
  className: "space-y-4",
584
593
  children: [
585
- /* @__PURE__ */ x("legend", {
594
+ /* @__PURE__ */ y("legend", {
586
595
  className: "sr-only",
587
596
  children: "Delivery address details"
588
597
  }),
589
- /* @__PURE__ */ S("div", {
598
+ /* @__PURE__ */ b("div", {
590
599
  className: "space-y-2",
591
- children: [/* @__PURE__ */ S(g, {
600
+ children: [/* @__PURE__ */ b(h, {
592
601
  htmlFor: "deliveryStreet",
593
- children: ["Street address ", /* @__PURE__ */ x("span", {
602
+ children: ["Street address ", /* @__PURE__ */ y("span", {
594
603
  className: "text-status-error-text",
595
604
  children: "*"
596
605
  })]
597
- }), /* @__PURE__ */ x(h, {
606
+ }), /* @__PURE__ */ y(m, {
598
607
  id: "deliveryStreet",
599
- value: H.deliveryAddress.street,
608
+ value: U.deliveryAddress.street,
600
609
  onChange: (e) => Q("deliveryAddress", "street", e.target.value),
601
610
  placeholder: "456 Oak Ave",
602
611
  "aria-required": "true"
603
612
  })]
604
613
  }),
605
- /* @__PURE__ */ S("div", {
614
+ /* @__PURE__ */ b("div", {
606
615
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
607
- children: [/* @__PURE__ */ S("div", {
616
+ children: [/* @__PURE__ */ b("div", {
608
617
  className: "space-y-2",
609
- children: [/* @__PURE__ */ x(g, {
618
+ children: [/* @__PURE__ */ y(h, {
610
619
  htmlFor: "deliveryCity",
611
620
  children: "City"
612
- }), /* @__PURE__ */ x(h, {
621
+ }), /* @__PURE__ */ y(m, {
613
622
  id: "deliveryCity",
614
- value: H.deliveryAddress.city,
623
+ value: U.deliveryAddress.city,
615
624
  onChange: (e) => Q("deliveryAddress", "city", e.target.value),
616
625
  placeholder: "Los Angeles"
617
626
  })]
618
- }), /* @__PURE__ */ S("div", {
627
+ }), /* @__PURE__ */ b("div", {
619
628
  className: "space-y-2",
620
- children: [/* @__PURE__ */ x(g, {
629
+ children: [/* @__PURE__ */ y(h, {
621
630
  htmlFor: "deliveryState",
622
631
  children: "State"
623
- }), /* @__PURE__ */ x(h, {
632
+ }), /* @__PURE__ */ y(m, {
624
633
  id: "deliveryState",
625
- value: H.deliveryAddress.state,
634
+ value: U.deliveryAddress.state,
626
635
  onChange: (e) => Q("deliveryAddress", "state", e.target.value),
627
636
  placeholder: "CA"
628
637
  })]
629
638
  })]
630
639
  }),
631
- /* @__PURE__ */ S("div", {
640
+ /* @__PURE__ */ b("div", {
632
641
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
633
- children: [/* @__PURE__ */ S("div", {
642
+ children: [/* @__PURE__ */ b("div", {
634
643
  className: "space-y-2",
635
- children: [/* @__PURE__ */ x(g, {
644
+ children: [/* @__PURE__ */ y(h, {
636
645
  htmlFor: "deliveryPostal",
637
646
  children: "Postal code"
638
- }), /* @__PURE__ */ x(h, {
647
+ }), /* @__PURE__ */ y(m, {
639
648
  id: "deliveryPostal",
640
- value: H.deliveryAddress.postalCode,
649
+ value: U.deliveryAddress.postalCode,
641
650
  onChange: (e) => Q("deliveryAddress", "postalCode", e.target.value),
642
651
  placeholder: "90210"
643
652
  })]
644
- }), /* @__PURE__ */ S("div", {
653
+ }), /* @__PURE__ */ b("div", {
645
654
  className: "space-y-2",
646
- children: [/* @__PURE__ */ x(g, {
655
+ children: [/* @__PURE__ */ y(h, {
647
656
  htmlFor: "deliveryCountry",
648
657
  children: "Country"
649
- }), /* @__PURE__ */ x(h, {
658
+ }), /* @__PURE__ */ y(m, {
650
659
  id: "deliveryCountry",
651
- value: H.deliveryAddress.country,
660
+ value: U.deliveryAddress.country,
652
661
  onChange: (e) => Q("deliveryAddress", "country", e.target.value),
653
662
  placeholder: "USA"
654
663
  })]
@@ -663,143 +672,157 @@ function T() {
663
672
  ]
664
673
  })
665
674
  }),
666
- /* @__PURE__ */ x("div", {
675
+ /* @__PURE__ */ y("div", {
667
676
  id: "items-section",
668
- children: /* @__PURE__ */ x(C, {
669
- title: /* @__PURE__ */ S("span", {
677
+ children: /* @__PURE__ */ y(x, {
678
+ title: /* @__PURE__ */ b("span", {
670
679
  className: "flex items-center gap-2",
671
680
  children: [
672
- /* @__PURE__ */ x(i, {
681
+ /* @__PURE__ */ y(i, {
673
682
  size: 18,
674
683
  "aria-hidden": "true"
675
684
  }),
676
685
  "Shipment contents ",
677
- /* @__PURE__ */ x(c, {
686
+ /* @__PURE__ */ y(s, {
678
687
  variant: "secondary",
679
- children: H.items.length
688
+ children: U.items.length
680
689
  })
681
690
  ]
682
691
  }),
683
692
  description: "Add each item being shipped. Use the catalog to prefill details or enter a one-off item manually.",
684
- actions: /* @__PURE__ */ S(l, {
693
+ actions: /* @__PURE__ */ b(c, {
685
694
  type: "button",
686
695
  variant: "outline",
687
696
  size: "sm",
688
697
  onClick: $,
689
- children: [/* @__PURE__ */ x(a, { size: 16 }), "Add item"]
698
+ children: [/* @__PURE__ */ y(a, { size: 16 }), "Add item"]
690
699
  }),
691
- children: H.items.length === 0 ? /* @__PURE__ */ x(ge, {
700
+ children: U.items.length === 0 ? /* @__PURE__ */ y(be, {
692
701
  illustration: "empty-files",
693
702
  title: "No items added yet",
694
703
  description: "Add the products this order will ship — each with a name, SKU, quantity and value.",
695
- action: /* @__PURE__ */ S(l, {
704
+ action: /* @__PURE__ */ b(c, {
696
705
  type: "button",
697
706
  variant: "outline",
698
707
  onClick: $,
699
- children: [/* @__PURE__ */ x(a, {
708
+ children: [/* @__PURE__ */ y(a, {
700
709
  size: 16,
701
710
  className: "mr-1.5"
702
711
  }), "Add your first item"]
703
712
  })
704
- }) : /* @__PURE__ */ S("div", {
713
+ }) : /* @__PURE__ */ b("div", {
705
714
  className: "space-y-4",
706
- children: [/* @__PURE__ */ S("div", {
715
+ children: [/* @__PURE__ */ b("div", {
707
716
  className: "rounded-card border border-border-subtle bg-bg-sunken/40 p-4",
708
717
  children: [
709
- /* @__PURE__ */ x(g, {
718
+ /* @__PURE__ */ y(h, {
710
719
  htmlFor: "item-product-search",
711
720
  children: "Search product catalog"
712
721
  }),
713
- /* @__PURE__ */ x(h, {
722
+ /* @__PURE__ */ y(m, {
714
723
  id: "item-product-search",
715
- value: R,
716
- onChange: (e) => Ge(e.target.value),
724
+ value: F,
725
+ onChange: (e) => Qe(e.target.value),
717
726
  placeholder: "Search by name or SKU",
718
727
  className: "mt-2"
719
728
  }),
720
- /* @__PURE__ */ x("p", {
729
+ /* @__PURE__ */ y("p", {
721
730
  className: "mt-2 text-xs text-text-secondary",
722
731
  children: "This filters the catalog picker for every item below. You can still edit any autofilled value or enter item details manually."
723
732
  })
724
733
  ]
725
- }), /* @__PURE__ */ x("ol", {
734
+ }), /* @__PURE__ */ y("ol", {
726
735
  className: "space-y-4",
727
736
  "aria-label": "Shipment items",
728
- children: H.items.map((e, t) => /* @__PURE__ */ x("li", { children: /* @__PURE__ */ x(be, {
737
+ children: U.items.map((e, t) => /* @__PURE__ */ y("li", { children: /* @__PURE__ */ y(Te, {
729
738
  item: e,
730
739
  index: t,
731
- products: Ke,
732
- productsLoading: qe,
733
- productsLoadingMore: Je,
734
- productsHasMore: Ye,
735
- productsTotalCount: Xe,
736
- onLoadMoreProducts: Ze,
737
- errors: q[e.id],
738
- onUpdate: at,
739
- onRemove: it
740
+ products: $e,
741
+ productsLoading: et,
742
+ productsLoadingMore: tt,
743
+ productsHasMore: nt,
744
+ productsTotalCount: rt,
745
+ onLoadMoreProducts: it,
746
+ errors: J[e.id],
747
+ onUpdate: pt,
748
+ onRemove: ft
740
749
  }) }, e.id))
741
750
  })]
742
751
  })
743
752
  })
744
753
  }),
745
- /* @__PURE__ */ x(C, {
746
- title: /* @__PURE__ */ S("span", {
754
+ /* @__PURE__ */ y(x, {
755
+ title: /* @__PURE__ */ b("span", {
747
756
  className: "flex items-center gap-2",
748
- children: [/* @__PURE__ */ x(n, {
757
+ children: [/* @__PURE__ */ y(n, {
749
758
  size: 18,
750
759
  "aria-hidden": "true"
751
760
  }), "Timing & handling"]
752
761
  }),
753
762
  description: "Optional delivery timing and instructions for the carrier.",
754
- children: /* @__PURE__ */ S("div", {
763
+ children: /* @__PURE__ */ b("div", {
755
764
  className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
756
765
  children: [
757
- /* @__PURE__ */ S("div", {
766
+ /* @__PURE__ */ b("div", {
758
767
  className: "space-y-2",
759
768
  children: [
760
- /* @__PURE__ */ x(g, {
769
+ /* @__PURE__ */ y(h, {
761
770
  htmlFor: "trackingNumber",
762
771
  children: "Tracking / reference number"
763
772
  }),
764
- /* @__PURE__ */ x(h, {
773
+ /* @__PURE__ */ y(m, {
765
774
  id: "trackingNumber",
766
- value: H.trackingNumber,
775
+ value: U.trackingNumber,
767
776
  onChange: (e) => Z("trackingNumber", e.target.value),
768
777
  placeholder: "Optional carrier reference"
769
778
  }),
770
- /* @__PURE__ */ x("p", {
779
+ /* @__PURE__ */ y("p", {
771
780
  className: "text-xs text-text-secondary",
772
781
  children: "Use this when a carrier or customer already supplied a tracking reference."
773
782
  })
774
783
  ]
775
784
  }),
776
- /* @__PURE__ */ S("div", {
785
+ /* @__PURE__ */ b("div", {
777
786
  className: "space-y-2",
778
787
  children: [
779
- /* @__PURE__ */ x(g, {
788
+ /* @__PURE__ */ y(h, {
780
789
  htmlFor: "scheduledDelivery",
781
790
  children: "Scheduled delivery"
782
791
  }),
783
- /* @__PURE__ */ x(h, {
792
+ /* @__PURE__ */ y(m, {
784
793
  id: "scheduledDelivery",
785
794
  type: "datetime-local",
786
- value: H.scheduledDelivery,
795
+ value: U.scheduledDelivery,
787
796
  onChange: (e) => Z("scheduledDelivery", e.target.value)
788
797
  }),
789
- /* @__PURE__ */ x("p", {
790
- className: "text-xs text-text-secondary",
791
- children: "Leave blank to dispatch as soon as a driver is available."
798
+ /* @__PURE__ */ b("div", {
799
+ className: "flex flex-wrap items-center gap-2",
800
+ children: [/* @__PURE__ */ y("p", {
801
+ className: "text-xs text-text-secondary",
802
+ children: "Leave blank to dispatch as soon as a driver is available."
803
+ }), /* @__PURE__ */ b(c, {
804
+ type: "button",
805
+ variant: "link",
806
+ size: "sm",
807
+ className: "h-auto p-0 text-xs",
808
+ onClick: () => Z("scheduledDelivery", ie(z)),
809
+ children: [
810
+ "Use the default window (",
811
+ z,
812
+ " h from now)"
813
+ ]
814
+ })]
792
815
  })
793
816
  ]
794
817
  }),
795
- /* @__PURE__ */ S("div", {
818
+ /* @__PURE__ */ b("div", {
796
819
  className: "space-y-2 lg:col-span-1",
797
- children: [/* @__PURE__ */ x(g, {
820
+ children: [/* @__PURE__ */ y(h, {
798
821
  htmlFor: "specialInstructions",
799
822
  children: "Special instructions"
800
- }), /* @__PURE__ */ x(he, {
823
+ }), /* @__PURE__ */ y(ye, {
801
824
  id: "specialInstructions",
802
- value: H.specialInstructions,
825
+ value: U.specialInstructions,
803
826
  onChange: (e) => Z("specialInstructions", e.target.value),
804
827
  placeholder: "Any special handling or delivery instructions...",
805
828
  rows: 4
@@ -814,4 +837,4 @@ function T() {
814
837
  });
815
838
  }
816
839
  //#endregion
817
- export { T as default };
840
+ export { C as default };