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