@burdenoff/microfe-movethewheels 2026.1101.4 → 2026.1102.2

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 (47) hide show
  1. package/dist/components/CustomerDeliveryUpdatesFields.js +57 -0
  2. package/dist/components/CustomerNotificationSettingsCard.js +368 -0
  3. package/dist/components/freight-cost/FreightCommercialFactEditor.js +46 -46
  4. package/dist/components/freight-cost/FreightCommercialHistory.js +7 -7
  5. package/dist/components/freight-cost/FreightDraftForm.js +20 -20
  6. package/dist/components/freight-invoice/InvoiceReviewPanel.js +255 -0
  7. package/dist/components/freight-invoice/InvoiceReviewQueue.js +93 -0
  8. package/dist/generated/freight-invoice-operations.d.ts +461 -0
  9. package/dist/generated/tracking-quality-operations.d.ts +275 -0
  10. package/dist/hooks/useCustomers.js +9 -3
  11. package/dist/hooks/useInvoiceComparisonRecovery.js +26 -26
  12. package/dist/hooks/useInvoiceReviewPermissions.js +14 -0
  13. package/dist/movethewheels/components/CustomerDeliveryUpdatesFields.d.ts +12 -0
  14. package/dist/movethewheels/components/CustomerNotificationSettingsCard.d.ts +3 -0
  15. package/dist/movethewheels/components/freight-invoice/InvoiceReviewPanel.d.ts +11 -0
  16. package/dist/movethewheels/components/freight-invoice/InvoiceReviewQueue.d.ts +22 -0
  17. package/dist/movethewheels/hooks/useInvoiceReviewPermissions.d.ts +5 -0
  18. package/dist/movethewheels/pages/FinancePage.d.ts +3 -1
  19. package/dist/movethewheels/types/index.d.ts +4 -0
  20. package/dist/movethewheels/utils/customerNotifications.d.ts +66 -0
  21. package/dist/movethewheels/utils/invoiceReview.d.ts +26 -0
  22. package/dist/node_modules/lucide-react/dist/esm/icons/bell-ring.js +22 -0
  23. package/dist/pages/CustomerDetailsPage.js +279 -231
  24. package/dist/pages/FinancePage.js +109 -67
  25. package/dist/pages/FreightEstimatePage.js +89 -89
  26. package/dist/pages/FreightInvoicePage.js +138 -120
  27. package/dist/pages/SettingsPage.js +242 -238
  28. package/dist/src/generated/freight-invoice-operations.js +2100 -1
  29. package/dist/utils/customerNotifications.js +83 -0
  30. package/dist/utils/invoiceReview.js +84 -0
  31. package/package.json +4 -3
  32. package/src/generated/freight-invoice-operations.ts +245 -1
  33. package/src/generated/tracking-quality-operations.ts +304 -0
  34. package/src/movethewheels/components/CustomerDeliveryUpdatesFields.tsx +67 -0
  35. package/src/movethewheels/components/CustomerNotificationSettingsCard.tsx +465 -0
  36. package/src/movethewheels/components/freight-invoice/InvoiceReviewPanel.tsx +319 -0
  37. package/src/movethewheels/components/freight-invoice/InvoiceReviewQueue.tsx +96 -0
  38. package/src/movethewheels/hooks/useCustomers.ts +17 -0
  39. package/src/movethewheels/hooks/useInvoiceReviewPermissions.ts +25 -0
  40. package/src/movethewheels/pages/CustomerDetailsPage.tsx +39 -0
  41. package/src/movethewheels/pages/FinancePage.tsx +34 -2
  42. package/src/movethewheels/pages/FreightInvoicePage.tsx +44 -3
  43. package/src/movethewheels/pages/SettingsPage.tsx +221 -208
  44. package/src/movethewheels/types/index.ts +4 -0
  45. package/src/movethewheels/utils/customerNotifications.ts +209 -0
  46. package/src/movethewheels/utils/invoiceReview.ts +146 -0
  47. package/src/operations/freight-invoice/review.graphql +26 -0
@@ -1,30 +1,32 @@
1
1
  import { ArrowLeft as e } from "../node_modules/lucide-react/dist/esm/icons/arrow-left.js";
2
- import { Building as t } from "../node_modules/lucide-react/dist/esm/icons/building.js";
3
- import { FileText as n } from "../node_modules/lucide-react/dist/esm/icons/file-text.js";
4
- import { Mail as r } from "../node_modules/lucide-react/dist/esm/icons/mail.js";
5
- import { MapPin as ee } from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
6
- import { Package as i } from "../node_modules/lucide-react/dist/esm/icons/package.js";
7
- import { Phone as a } from "../node_modules/lucide-react/dist/esm/icons/phone.js";
8
- import { Save as o } from "../node_modules/lucide-react/dist/esm/icons/save.js";
9
- import { SquarePen as s } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
10
- import { Star as c } from "../node_modules/lucide-react/dist/esm/icons/star.js";
11
- import { Trash2 as l } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
12
- import { Users as u } from "../node_modules/lucide-react/dist/esm/icons/users.js";
13
- import { X as d } from "../node_modules/lucide-react/dist/esm/icons/x.js";
14
- import { buildOrderCustomerPath as f, getSafeCustomerReturnPath as p, joinPath as m } from "../utils/navigation.js";
15
- import { useMoveTheWheels as h } from "../providers/MoveTheWheelsProvider.js";
16
- import { formatAddress as g, formatCurrency as _, formatDate as v } from "../utils/formatters.js";
17
- import { useOrders as y } from "../hooks/useOrders.js";
18
- import { useCustomer as b, useCustomers as x } from "../hooks/useCustomers.js";
19
- import { Button as S, Card as C, CardContent as w, CardHeader as T, CardTitle as E, Input as D, Label as O, Select as k, SelectContent as A, SelectItem as j, SelectTrigger as te, SelectValue as ne } from "../components/ui.js";
20
- import { ErrorState as re, LoadingState as ie, PageLayout as ae } from "../components/PageLayout.js";
21
- import { StatusBadge as oe, TypeBadge as se } from "../components/StatusBadge.js";
22
- import { FormError as M } from "../components/FormError.js";
23
- import { Notice as ce, useNotice as le } from "../components/Notice.js";
24
- import { useEffect as ue, useState as N } from "react";
25
- import { useParams as de, useSearchParams as P } from "react-router";
26
- import { Fragment as fe, jsx as F, jsxs as I } from "react/jsx-runtime";
27
- import { EmphasisPanel as L, NextSteps as pe, PagePurpose as R, ResponsiveDialog as me, ResponsiveDialogContent as he, ResponsiveDialogDescription as ge, ResponsiveDialogFooter as _e, ResponsiveDialogHeader as ve, ResponsiveDialogTitle as ye } from "@burdenoff/fe-libs/ui";
2
+ import { BellRing as t } from "../node_modules/lucide-react/dist/esm/icons/bell-ring.js";
3
+ import { Building as n } from "../node_modules/lucide-react/dist/esm/icons/building.js";
4
+ import { FileText as r } from "../node_modules/lucide-react/dist/esm/icons/file-text.js";
5
+ import { Mail as i } from "../node_modules/lucide-react/dist/esm/icons/mail.js";
6
+ import { MapPin as a } from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
7
+ import { Package as o } from "../node_modules/lucide-react/dist/esm/icons/package.js";
8
+ import { Phone as s } from "../node_modules/lucide-react/dist/esm/icons/phone.js";
9
+ import { Save as c } from "../node_modules/lucide-react/dist/esm/icons/save.js";
10
+ import { SquarePen as l } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
11
+ import { Star as u } from "../node_modules/lucide-react/dist/esm/icons/star.js";
12
+ import { Trash2 as d } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
13
+ import { Users as f } from "../node_modules/lucide-react/dist/esm/icons/users.js";
14
+ import { X as p } from "../node_modules/lucide-react/dist/esm/icons/x.js";
15
+ import { buildOrderCustomerPath as m, getSafeCustomerReturnPath as h, joinPath as g } from "../utils/navigation.js";
16
+ import { useMoveTheWheels as _ } from "../providers/MoveTheWheelsProvider.js";
17
+ import { formatAddress as v, formatCurrency as y, formatDate as b } from "../utils/formatters.js";
18
+ import { useOrders as x } from "../hooks/useOrders.js";
19
+ import { useCustomer as ee, useCustomers as te } from "../hooks/useCustomers.js";
20
+ import { Button as S, Card as C, CardContent as w, CardHeader as T, CardTitle as E, Input as D, Label as O, Select as k, SelectContent as ne, SelectItem as A, SelectTrigger as re, SelectValue as ie } from "../components/ui.js";
21
+ import { ErrorState as ae, LoadingState as oe, PageLayout as se } from "../components/PageLayout.js";
22
+ import { StatusBadge as ce, TypeBadge as le } from "../components/StatusBadge.js";
23
+ import { FormError as j } from "../components/FormError.js";
24
+ import { Notice as ue, useNotice as de } from "../components/Notice.js";
25
+ import { CustomerDeliveryUpdatesFields as M, deliveryUpdatesSummary as fe } from "../components/CustomerDeliveryUpdatesFields.js";
26
+ import { useEffect as pe, useState as N } from "react";
27
+ import { useParams as me, useSearchParams as P } from "react-router";
28
+ import { Fragment as he, jsx as F, jsxs as I } from "react/jsx-runtime";
29
+ import { EmphasisPanel as L, NextSteps as ge, PagePurpose as R, ResponsiveDialog as _e, ResponsiveDialogContent as ve, ResponsiveDialogDescription as ye, ResponsiveDialogFooter as be, ResponsiveDialogHeader as xe, ResponsiveDialogTitle as Se } from "@burdenoff/fe-libs/ui";
28
30
  //#region src/movethewheels/pages/CustomerDetailsPage.tsx
29
31
  var z = {
30
32
  name: "",
@@ -39,67 +41,71 @@ var z = {
39
41
  country: "",
40
42
  businessLicense: "",
41
43
  taxId: "",
42
- rating: ""
44
+ rating: "",
45
+ notifyByEmail: !0,
46
+ notifyBySms: !1
43
47
  };
44
- function be() {
45
- let { basePath: t, navigate: r } = h(), [i] = P(), a = p(i.get("returnTo")), { createCustomer: s } = x(), [c, l] = N(z), [d, g] = N(!1), [_, v] = N(null), y = () => r?.(m(t, "customers")), b = async (e) => {
46
- if (e.preventDefault(), !c.name.trim()) {
47
- v("Customer name is required.");
48
+ function Ce() {
49
+ let { basePath: t, navigate: n } = _(), [i] = P(), o = h(i.get("returnTo")), { createCustomer: s } = te(), [l, u] = N(z), [d, p] = N(!1), [v, y] = N(null), b = () => n?.(g(t, "customers")), x = async (e) => {
50
+ if (e.preventDefault(), !l.name.trim()) {
51
+ y("Customer name is required.");
48
52
  return;
49
53
  }
50
- g(!0), v(null);
54
+ p(!0), y(null);
51
55
  try {
52
56
  let e = await s({
53
- name: c.name.trim(),
54
- type: c.type,
55
- email: c.email.trim() || void 0,
56
- phone: c.phone.trim() || void 0,
57
- company: c.company.trim() || void 0,
58
- address: c.street || c.city || c.state || c.postalCode || c.country ? {
59
- street: c.street.trim(),
60
- city: c.city.trim(),
61
- state: c.state.trim(),
62
- postalCode: c.postalCode.trim(),
63
- country: c.country.trim()
57
+ name: l.name.trim(),
58
+ type: l.type,
59
+ email: l.email.trim() || void 0,
60
+ phone: l.phone.trim() || void 0,
61
+ company: l.company.trim() || void 0,
62
+ address: l.street || l.city || l.state || l.postalCode || l.country ? {
63
+ street: l.street.trim(),
64
+ city: l.city.trim(),
65
+ state: l.state.trim(),
66
+ postalCode: l.postalCode.trim(),
67
+ country: l.country.trim()
64
68
  } : void 0,
65
- businessLicense: c.businessLicense.trim() || void 0,
66
- taxId: c.taxId.trim() || void 0,
67
- rating: c.rating ? Number(c.rating) : void 0
68
- }), n = a ? f(a, e.id) : `customers/${e.id}`;
69
- r?.(m(t, n));
69
+ businessLicense: l.businessLicense.trim() || void 0,
70
+ taxId: l.taxId.trim() || void 0,
71
+ rating: l.rating ? Number(l.rating) : void 0,
72
+ notifyByEmail: l.notifyByEmail,
73
+ notifyBySms: l.notifyBySms
74
+ }), r = o ? m(o, e.id) : `customers/${e.id}`;
75
+ n?.(g(t, r));
70
76
  } catch (e) {
71
- console.error("Failed to create customer:", e), v(e instanceof Error ? e.message : "Failed to create customer. Please try again."), g(!1);
77
+ console.error("Failed to create customer:", e), y(e instanceof Error ? e.message : "Failed to create customer. Please try again."), p(!1);
72
78
  }
73
79
  };
74
- return /* @__PURE__ */ I(ae, {
80
+ return /* @__PURE__ */ I(se, {
75
81
  title: "New Customer",
76
82
  subtitle: "Add a new customer to your account",
77
- icon: /* @__PURE__ */ F(u, { size: 24 }),
83
+ icon: /* @__PURE__ */ F(f, { size: 24 }),
78
84
  headerActions: /* @__PURE__ */ I("div", {
79
85
  className: "flex gap-2",
80
86
  children: [/* @__PURE__ */ I(S, {
81
87
  variant: "outline",
82
- onClick: y,
88
+ onClick: b,
83
89
  disabled: d,
84
90
  children: [/* @__PURE__ */ F(e, { size: 16 }), " Cancel"]
85
91
  }), /* @__PURE__ */ I(S, {
86
- onClick: b,
92
+ onClick: x,
87
93
  disabled: d,
88
94
  children: [
89
- /* @__PURE__ */ F(o, { size: 16 }),
95
+ /* @__PURE__ */ F(c, { size: 16 }),
90
96
  " ",
91
97
  d ? "Saving..." : "Create Customer"
92
98
  ]
93
99
  })]
94
100
  }),
95
101
  children: [/* @__PURE__ */ F(R, {
96
- icon: /* @__PURE__ */ F(u, { size: 18 }),
102
+ icon: /* @__PURE__ */ F(f, { size: 18 }),
97
103
  children: "Add a customer once and their contact details auto-fill every future order you book for them. Only a name is required — add email, phone and company to make deliveries easier to arrange."
98
104
  }), /* @__PURE__ */ I("form", {
99
- onSubmit: b,
105
+ onSubmit: x,
100
106
  className: "max-w-2xl space-y-6",
101
107
  children: [
102
- /* @__PURE__ */ F(M, { message: _ }),
108
+ /* @__PURE__ */ F(j, { message: v }),
103
109
  /* @__PURE__ */ I(L, { children: [/* @__PURE__ */ F("h2", {
104
110
  className: "text-base font-semibold text-text-primary mb-4",
105
111
  children: "Customer Details"
@@ -118,8 +124,8 @@ function be() {
118
124
  })]
119
125
  }), /* @__PURE__ */ F(D, {
120
126
  id: "name",
121
- value: c.name,
122
- onChange: (e) => l((t) => ({
127
+ value: l.name,
128
+ onChange: (e) => u((t) => ({
123
129
  ...t,
124
130
  name: e.target.value
125
131
  })),
@@ -132,18 +138,18 @@ function be() {
132
138
  htmlFor: "type",
133
139
  children: "Customer Type"
134
140
  }), /* @__PURE__ */ I(k, {
135
- value: c.type,
136
- onValueChange: (e) => l((t) => ({
141
+ value: l.type,
142
+ onValueChange: (e) => u((t) => ({
137
143
  ...t,
138
144
  type: e
139
145
  })),
140
- children: [/* @__PURE__ */ F(te, {
146
+ children: [/* @__PURE__ */ F(re, {
141
147
  id: "type",
142
- children: /* @__PURE__ */ F(ne, {})
143
- }), /* @__PURE__ */ I(A, { children: [/* @__PURE__ */ F(j, {
148
+ children: /* @__PURE__ */ F(ie, {})
149
+ }), /* @__PURE__ */ I(ne, { children: [/* @__PURE__ */ F(A, {
144
150
  value: "b2c",
145
151
  children: "B2C (Individual)"
146
- }), /* @__PURE__ */ F(j, {
152
+ }), /* @__PURE__ */ F(A, {
147
153
  value: "b2b",
148
154
  children: "B2B (Business)"
149
155
  })] })]
@@ -160,8 +166,8 @@ function be() {
160
166
  }), /* @__PURE__ */ F(D, {
161
167
  id: "email",
162
168
  type: "email",
163
- value: c.email,
164
- onChange: (e) => l((t) => ({
169
+ value: l.email,
170
+ onChange: (e) => u((t) => ({
165
171
  ...t,
166
172
  email: e.target.value
167
173
  })),
@@ -174,8 +180,8 @@ function be() {
174
180
  children: "Phone"
175
181
  }), /* @__PURE__ */ F(D, {
176
182
  id: "phone",
177
- value: c.phone,
178
- onChange: (e) => l((t) => ({
183
+ value: l.phone,
184
+ onChange: (e) => u((t) => ({
179
185
  ...t,
180
186
  phone: e.target.value
181
187
  })),
@@ -190,8 +196,8 @@ function be() {
190
196
  children: "Company"
191
197
  }), /* @__PURE__ */ F(D, {
192
198
  id: "company",
193
- value: c.company,
194
- onChange: (e) => l((t) => ({
199
+ value: l.company,
200
+ onChange: (e) => u((t) => ({
195
201
  ...t,
196
202
  company: e.target.value
197
203
  })),
@@ -202,7 +208,7 @@ function be() {
202
208
  })] }),
203
209
  /* @__PURE__ */ I(C, { children: [/* @__PURE__ */ F(T, { children: /* @__PURE__ */ I(E, {
204
210
  className: "flex items-center gap-2",
205
- children: [/* @__PURE__ */ F(ee, { size: 18 }), " Address"]
211
+ children: [/* @__PURE__ */ F(a, { size: 18 }), " Address"]
206
212
  }) }), /* @__PURE__ */ I(w, {
207
213
  className: "space-y-4",
208
214
  children: [/* @__PURE__ */ I("div", {
@@ -212,8 +218,8 @@ function be() {
212
218
  children: "Street"
213
219
  }), /* @__PURE__ */ F(D, {
214
220
  id: "street",
215
- value: c.street,
216
- onChange: (e) => l((t) => ({
221
+ value: l.street,
222
+ onChange: (e) => u((t) => ({
217
223
  ...t,
218
224
  street: e.target.value
219
225
  })),
@@ -229,8 +235,8 @@ function be() {
229
235
  children: "City"
230
236
  }), /* @__PURE__ */ F(D, {
231
237
  id: "city",
232
- value: c.city,
233
- onChange: (e) => l((t) => ({
238
+ value: l.city,
239
+ onChange: (e) => u((t) => ({
234
240
  ...t,
235
241
  city: e.target.value
236
242
  }))
@@ -243,8 +249,8 @@ function be() {
243
249
  children: "State"
244
250
  }), /* @__PURE__ */ F(D, {
245
251
  id: "state",
246
- value: c.state,
247
- onChange: (e) => l((t) => ({
252
+ value: l.state,
253
+ onChange: (e) => u((t) => ({
248
254
  ...t,
249
255
  state: e.target.value
250
256
  }))
@@ -257,8 +263,8 @@ function be() {
257
263
  children: "Postal Code"
258
264
  }), /* @__PURE__ */ F(D, {
259
265
  id: "postalCode",
260
- value: c.postalCode,
261
- onChange: (e) => l((t) => ({
266
+ value: l.postalCode,
267
+ onChange: (e) => u((t) => ({
262
268
  ...t,
263
269
  postalCode: e.target.value
264
270
  }))
@@ -271,8 +277,8 @@ function be() {
271
277
  children: "Country"
272
278
  }), /* @__PURE__ */ F(D, {
273
279
  id: "country",
274
- value: c.country,
275
- onChange: (e) => l((t) => ({
280
+ value: l.country,
281
+ onChange: (e) => u((t) => ({
276
282
  ...t,
277
283
  country: e.target.value
278
284
  }))
@@ -283,8 +289,8 @@ function be() {
283
289
  })] }),
284
290
  /* @__PURE__ */ I(C, { children: [/* @__PURE__ */ F(T, { children: /* @__PURE__ */ I(E, {
285
291
  className: "flex items-center gap-2",
286
- children: [/* @__PURE__ */ F(n, { size: 18 }), " Business Details"]
287
- }) }), /* @__PURE__ */ F(w, { children: /* @__PURE__ */ I("div", {
292
+ children: [/* @__PURE__ */ F(r, { size: 18 }), " Business Details"]
293
+ }) }), /* @__PURE__ */ I(w, { children: [/* @__PURE__ */ I("div", {
288
294
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
289
295
  children: [
290
296
  /* @__PURE__ */ I("div", {
@@ -294,8 +300,8 @@ function be() {
294
300
  children: "Business License"
295
301
  }), /* @__PURE__ */ F(D, {
296
302
  id: "businessLicense",
297
- value: c.businessLicense,
298
- onChange: (e) => l((t) => ({
303
+ value: l.businessLicense,
304
+ onChange: (e) => u((t) => ({
299
305
  ...t,
300
306
  businessLicense: e.target.value
301
307
  }))
@@ -308,8 +314,8 @@ function be() {
308
314
  children: "Tax ID"
309
315
  }), /* @__PURE__ */ F(D, {
310
316
  id: "taxId",
311
- value: c.taxId,
312
- onChange: (e) => l((t) => ({
317
+ value: l.taxId,
318
+ onChange: (e) => u((t) => ({
313
319
  ...t,
314
320
  taxId: e.target.value
315
321
  }))
@@ -326,20 +332,33 @@ function be() {
326
332
  min: 0,
327
333
  max: 5,
328
334
  step: .1,
329
- value: c.rating,
330
- onChange: (e) => l((t) => ({
335
+ value: l.rating,
336
+ onChange: (e) => u((t) => ({
331
337
  ...t,
332
338
  rating: e.target.value
333
339
  }))
334
340
  })]
335
341
  })
336
342
  ]
337
- }) })] })
343
+ }), /* @__PURE__ */ F("div", {
344
+ className: "mt-6",
345
+ children: /* @__PURE__ */ F(M, {
346
+ idPrefix: "new-customer",
347
+ value: {
348
+ notifyByEmail: l.notifyByEmail,
349
+ notifyBySms: l.notifyBySms
350
+ },
351
+ onChange: (e) => u((t) => ({
352
+ ...t,
353
+ ...e
354
+ }))
355
+ })
356
+ })] })] })
338
357
  ]
339
358
  })]
340
359
  });
341
360
  }
342
- function B(e) {
361
+ function we(e) {
343
362
  return {
344
363
  name: e.name,
345
364
  email: e.email,
@@ -353,118 +372,122 @@ function B(e) {
353
372
  country: e.address.country ?? "",
354
373
  businessLicense: e.businessLicense ?? "",
355
374
  taxId: e.taxId ?? "",
356
- rating: e.rating ? String(e.rating) : ""
375
+ rating: e.rating ? String(e.rating) : "",
376
+ notifyByEmail: e.notifyByEmail,
377
+ notifyBySms: e.notifyBySms
357
378
  };
358
379
  }
359
- function V() {
360
- let { customerId: p } = de(), { basePath: P, navigate: V } = h(), { customer: H, isLoading: xe, error: Se, refetch: U } = b(p), { updateCustomer: Ce, deleteCustomer: we } = x(), { orders: W, isLoading: Te } = y({ filters: { customerId: p } }), { message: Ee, notify: De } = le(), [Oe, G] = N(!1), [K, ke] = N(!1), [Ae, q] = N(null), [J, Y] = N(z), [je, X] = N(!1), [Z, Me] = N(!1), [Ne, Pe] = N(null);
361
- ue(() => {
362
- H && Y(B(H));
363
- }, [H]);
364
- let Fe = () => V?.(m(P, "customers")), Q = (e) => V?.(m(P, e)), $ = () => {
365
- q(null), G(!0);
380
+ function B() {
381
+ let { customerId: h } = me(), { basePath: P, navigate: B } = _(), { customer: V, isLoading: Te, error: Ee, refetch: H } = ee(h), { updateCustomer: De, deleteCustomer: Oe } = te(), { orders: U, isLoading: ke } = x({ filters: { customerId: h } }), { message: W, notify: Ae } = de(), [G, K] = N(!1), [q, je] = N(!1), [Me, J] = N(null), [Y, X] = N(z), [Ne, Z] = N(!1), [Q, Pe] = N(!1), [Fe, Ie] = N(null);
382
+ pe(() => {
383
+ V && X(we(V));
384
+ }, [V]);
385
+ let Le = () => B?.(g(P, "customers")), $ = (e) => B?.(g(P, e)), Re = () => {
386
+ J(null), K(!0);
366
387
  };
367
- return p ? xe ? /* @__PURE__ */ F(ie, { message: "Loading customer details..." }) : Se || !H ? /* @__PURE__ */ F(re, {
388
+ return h ? Te ? /* @__PURE__ */ F(oe, { message: "Loading customer details..." }) : Ee || !V ? /* @__PURE__ */ F(ae, {
368
389
  title: "Customer not found",
369
- onRetry: U
370
- }) : /* @__PURE__ */ I(ae, {
371
- title: H.name,
372
- subtitle: H.company || H.email,
373
- icon: /* @__PURE__ */ F(u, { size: 24 }),
390
+ onRetry: H
391
+ }) : /* @__PURE__ */ I(se, {
392
+ title: V.name,
393
+ subtitle: V.company || V.email,
394
+ icon: /* @__PURE__ */ F(f, { size: 24 }),
374
395
  headerActions: /* @__PURE__ */ I("div", {
375
396
  className: "flex gap-2",
376
397
  children: [/* @__PURE__ */ I(S, {
377
398
  variant: "outline",
378
- onClick: Fe,
399
+ onClick: Le,
379
400
  children: [/* @__PURE__ */ F(e, { size: 16 }), " Back"]
380
- }), Oe ? /* @__PURE__ */ I(fe, { children: [/* @__PURE__ */ I(S, {
401
+ }), G ? /* @__PURE__ */ I(he, { children: [/* @__PURE__ */ I(S, {
381
402
  variant: "outline",
382
403
  onClick: () => {
383
- q(null), G(!1), H && Y(B(H));
404
+ J(null), K(!1), V && X(we(V));
384
405
  },
385
- disabled: K,
386
- children: [/* @__PURE__ */ F(d, { size: 16 }), " Cancel"]
406
+ disabled: q,
407
+ children: [/* @__PURE__ */ F(p, { size: 16 }), " Cancel"]
387
408
  }), /* @__PURE__ */ I(S, {
388
409
  onClick: async () => {
389
- if (p) {
390
- if (!J.name.trim()) {
391
- q("Customer name is required.");
410
+ if (h) {
411
+ if (!Y.name.trim()) {
412
+ J("Customer name is required.");
392
413
  return;
393
414
  }
394
- ke(!0), q(null);
415
+ je(!0), J(null);
395
416
  try {
396
- await Ce(p, {
397
- name: J.name.trim(),
398
- email: J.email.trim(),
399
- phone: J.phone.trim(),
400
- company: J.company.trim() || void 0,
401
- type: J.type,
417
+ await De(h, {
418
+ name: Y.name.trim(),
419
+ email: Y.email.trim(),
420
+ phone: Y.phone.trim(),
421
+ company: Y.company.trim() || void 0,
422
+ type: Y.type,
402
423
  address: {
403
- street: J.street.trim(),
404
- city: J.city.trim(),
405
- state: J.state.trim(),
406
- postalCode: J.postalCode.trim(),
407
- country: J.country.trim()
424
+ street: Y.street.trim(),
425
+ city: Y.city.trim(),
426
+ state: Y.state.trim(),
427
+ postalCode: Y.postalCode.trim(),
428
+ country: Y.country.trim()
408
429
  },
409
- businessLicense: J.businessLicense.trim() || void 0,
410
- taxId: J.taxId.trim() || void 0,
411
- rating: J.rating ? Number(J.rating) : void 0
412
- }), De("Customer updated."), G(!1), U();
430
+ businessLicense: Y.businessLicense.trim() || void 0,
431
+ taxId: Y.taxId.trim() || void 0,
432
+ rating: Y.rating ? Number(Y.rating) : void 0,
433
+ notifyByEmail: Y.notifyByEmail,
434
+ notifyBySms: Y.notifyBySms
435
+ }), Ae("Customer updated."), K(!1), H();
413
436
  } catch (e) {
414
- q(e instanceof Error ? e.message : "Failed to update customer.");
437
+ J(e instanceof Error ? e.message : "Failed to update customer.");
415
438
  } finally {
416
- ke(!1);
439
+ je(!1);
417
440
  }
418
441
  }
419
442
  },
420
- disabled: K,
443
+ disabled: q,
421
444
  children: [
422
- /* @__PURE__ */ F(o, { size: 16 }),
445
+ /* @__PURE__ */ F(c, { size: 16 }),
423
446
  " ",
424
- K ? "Saving…" : "Save"
447
+ q ? "Saving…" : "Save"
425
448
  ]
426
449
  })] }) : /* @__PURE__ */ I(S, {
427
- onClick: $,
428
- children: [/* @__PURE__ */ F(s, { size: 16 }), " Edit"]
450
+ onClick: Re,
451
+ children: [/* @__PURE__ */ F(l, { size: 16 }), " Edit"]
429
452
  })]
430
453
  }),
431
454
  headerContent: /* @__PURE__ */ I("div", {
432
455
  className: "flex items-center gap-4",
433
- children: [/* @__PURE__ */ F(se, { type: H.type }), H.rating !== void 0 && /* @__PURE__ */ I("div", {
456
+ children: [/* @__PURE__ */ F(le, { type: V.type }), V.rating !== void 0 && /* @__PURE__ */ I("div", {
434
457
  className: "flex items-center gap-1",
435
- children: [/* @__PURE__ */ F(c, {
458
+ children: [/* @__PURE__ */ F(u, {
436
459
  size: 16,
437
460
  className: "text-status-warning-text fill-current"
438
461
  }), /* @__PURE__ */ F("span", {
439
462
  className: "font-medium",
440
- children: H.rating.toFixed(1)
463
+ children: V.rating.toFixed(1)
441
464
  })]
442
465
  })]
443
466
  }),
444
467
  children: [
445
468
  /* @__PURE__ */ F(R, {
446
- icon: /* @__PURE__ */ F(u, { size: 18 }),
469
+ icon: /* @__PURE__ */ F(f, { size: 18 }),
447
470
  children: "Everything you know about this customer — how to reach them, where they are, and their account standing. Use it to confirm contact details before a delivery, check their rating, or book their next order."
448
471
  }),
449
- /* @__PURE__ */ F(pe, {
472
+ /* @__PURE__ */ F(ge, {
450
473
  storageKey: "movethewheels-customer-details",
451
474
  steps: [{
452
475
  id: "new-order",
453
476
  label: "Book a delivery for this customer",
454
477
  description: "Start a new order pre-filled for this account.",
455
- icon: /* @__PURE__ */ F(n, { size: 16 }),
456
- onClick: () => Q(f("orders/new", H.id))
478
+ icon: /* @__PURE__ */ F(r, { size: 16 }),
479
+ onClick: () => $(m("orders/new", V.id))
457
480
  }, {
458
481
  id: "edit",
459
482
  label: "Update contact details",
460
483
  description: "Keep email, phone and address current.",
461
- icon: /* @__PURE__ */ F(s, { size: 16 }),
462
- onClick: $
484
+ icon: /* @__PURE__ */ F(l, { size: 16 }),
485
+ onClick: Re
463
486
  }]
464
487
  }),
465
- Ee && /* @__PURE__ */ F("div", {
488
+ W && /* @__PURE__ */ F("div", {
466
489
  className: "mb-2",
467
- children: /* @__PURE__ */ F(ce, { message: Ee })
490
+ children: /* @__PURE__ */ F(ue, { message: W })
468
491
  }),
469
492
  /* @__PURE__ */ I("div", {
470
493
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
@@ -474,10 +497,10 @@ function V() {
474
497
  /* @__PURE__ */ I(L, { children: [/* @__PURE__ */ F("h2", {
475
498
  className: "text-base font-semibold text-text-primary mb-4",
476
499
  children: "Contact Information"
477
- }), Oe ? /* @__PURE__ */ I("div", {
500
+ }), G ? /* @__PURE__ */ I("div", {
478
501
  className: "space-y-4",
479
502
  children: [
480
- /* @__PURE__ */ F(M, { message: Ae }),
503
+ /* @__PURE__ */ F(j, { message: Me }),
481
504
  /* @__PURE__ */ I("div", {
482
505
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
483
506
  children: [
@@ -491,8 +514,8 @@ function V() {
491
514
  })]
492
515
  }), /* @__PURE__ */ F(D, {
493
516
  id: "edit-name",
494
- value: J.name,
495
- onChange: (e) => Y((t) => ({
517
+ value: Y.name,
518
+ onChange: (e) => X((t) => ({
496
519
  ...t,
497
520
  name: e.target.value
498
521
  }))
@@ -505,8 +528,8 @@ function V() {
505
528
  children: "Company"
506
529
  }), /* @__PURE__ */ F(D, {
507
530
  id: "edit-company",
508
- value: J.company,
509
- onChange: (e) => Y((t) => ({
531
+ value: Y.company,
532
+ onChange: (e) => X((t) => ({
510
533
  ...t,
511
534
  company: e.target.value
512
535
  })),
@@ -521,8 +544,8 @@ function V() {
521
544
  }), /* @__PURE__ */ F(D, {
522
545
  id: "edit-email",
523
546
  type: "email",
524
- value: J.email,
525
- onChange: (e) => Y((t) => ({
547
+ value: Y.email,
548
+ onChange: (e) => X((t) => ({
526
549
  ...t,
527
550
  email: e.target.value
528
551
  }))
@@ -535,8 +558,8 @@ function V() {
535
558
  children: "Phone"
536
559
  }), /* @__PURE__ */ F(D, {
537
560
  id: "edit-phone",
538
- value: J.phone,
539
- onChange: (e) => Y((t) => ({
561
+ value: Y.phone,
562
+ onChange: (e) => X((t) => ({
540
563
  ...t,
541
564
  phone: e.target.value
542
565
  }))
@@ -548,18 +571,18 @@ function V() {
548
571
  htmlFor: "edit-type",
549
572
  children: "Customer Type"
550
573
  }), /* @__PURE__ */ I(k, {
551
- value: J.type,
552
- onValueChange: (e) => Y((t) => ({
574
+ value: Y.type,
575
+ onValueChange: (e) => X((t) => ({
553
576
  ...t,
554
577
  type: e
555
578
  })),
556
- children: [/* @__PURE__ */ F(te, {
579
+ children: [/* @__PURE__ */ F(re, {
557
580
  id: "edit-type",
558
- children: /* @__PURE__ */ F(ne, {})
559
- }), /* @__PURE__ */ I(A, { children: [/* @__PURE__ */ F(j, {
581
+ children: /* @__PURE__ */ F(ie, {})
582
+ }), /* @__PURE__ */ I(ne, { children: [/* @__PURE__ */ F(A, {
560
583
  value: "b2c",
561
584
  children: "B2C (Individual)"
562
- }), /* @__PURE__ */ F(j, {
585
+ }), /* @__PURE__ */ F(A, {
563
586
  value: "b2b",
564
587
  children: "B2B (Business)"
565
588
  })] })]
@@ -576,8 +599,8 @@ function V() {
576
599
  min: 0,
577
600
  max: 5,
578
601
  step: .1,
579
- value: J.rating,
580
- onChange: (e) => Y((t) => ({
602
+ value: Y.rating,
603
+ onChange: (e) => X((t) => ({
581
604
  ...t,
582
605
  rating: e.target.value
583
606
  }))
@@ -595,8 +618,8 @@ function V() {
595
618
  children: "Street"
596
619
  }), /* @__PURE__ */ F(D, {
597
620
  id: "edit-street",
598
- value: J.street,
599
- onChange: (e) => Y((t) => ({
621
+ value: Y.street,
622
+ onChange: (e) => X((t) => ({
600
623
  ...t,
601
624
  street: e.target.value
602
625
  }))
@@ -609,8 +632,8 @@ function V() {
609
632
  children: "City"
610
633
  }), /* @__PURE__ */ F(D, {
611
634
  id: "edit-city",
612
- value: J.city,
613
- onChange: (e) => Y((t) => ({
635
+ value: Y.city,
636
+ onChange: (e) => X((t) => ({
614
637
  ...t,
615
638
  city: e.target.value
616
639
  }))
@@ -623,8 +646,8 @@ function V() {
623
646
  children: "State"
624
647
  }), /* @__PURE__ */ F(D, {
625
648
  id: "edit-state",
626
- value: J.state,
627
- onChange: (e) => Y((t) => ({
649
+ value: Y.state,
650
+ onChange: (e) => X((t) => ({
628
651
  ...t,
629
652
  state: e.target.value
630
653
  }))
@@ -637,8 +660,8 @@ function V() {
637
660
  children: "Postal Code"
638
661
  }), /* @__PURE__ */ F(D, {
639
662
  id: "edit-postalCode",
640
- value: J.postalCode,
641
- onChange: (e) => Y((t) => ({
663
+ value: Y.postalCode,
664
+ onChange: (e) => X((t) => ({
642
665
  ...t,
643
666
  postalCode: e.target.value
644
667
  }))
@@ -651,8 +674,8 @@ function V() {
651
674
  children: "Country"
652
675
  }), /* @__PURE__ */ F(D, {
653
676
  id: "edit-country",
654
- value: J.country,
655
- onChange: (e) => Y((t) => ({
677
+ value: Y.country,
678
+ onChange: (e) => X((t) => ({
656
679
  ...t,
657
680
  country: e.target.value
658
681
  }))
@@ -665,8 +688,8 @@ function V() {
665
688
  children: "Business License"
666
689
  }), /* @__PURE__ */ F(D, {
667
690
  id: "edit-businessLicense",
668
- value: J.businessLicense,
669
- onChange: (e) => Y((t) => ({
691
+ value: Y.businessLicense,
692
+ onChange: (e) => X((t) => ({
670
693
  ...t,
671
694
  businessLicense: e.target.value
672
695
  }))
@@ -679,14 +702,26 @@ function V() {
679
702
  children: "Tax ID"
680
703
  }), /* @__PURE__ */ F(D, {
681
704
  id: "edit-taxId",
682
- value: J.taxId,
683
- onChange: (e) => Y((t) => ({
705
+ value: Y.taxId,
706
+ onChange: (e) => X((t) => ({
684
707
  ...t,
685
708
  taxId: e.target.value
686
709
  }))
687
710
  })]
688
711
  })
689
712
  ]
713
+ }),
714
+ /* @__PURE__ */ F(M, {
715
+ idPrefix: "edit-customer",
716
+ value: {
717
+ notifyByEmail: Y.notifyByEmail,
718
+ notifyBySms: Y.notifyBySms
719
+ },
720
+ onChange: (e) => X((t) => ({
721
+ ...t,
722
+ ...e
723
+ })),
724
+ disabled: q
690
725
  })
691
726
  ]
692
727
  }) : /* @__PURE__ */ I("div", {
@@ -695,7 +730,7 @@ function V() {
695
730
  className: "space-y-4",
696
731
  children: [/* @__PURE__ */ I("div", {
697
732
  className: "flex items-center gap-3",
698
- children: [/* @__PURE__ */ F(r, {
733
+ children: [/* @__PURE__ */ F(i, {
699
734
  size: 18,
700
735
  className: "text-text-secondary"
701
736
  }), /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
@@ -703,11 +738,11 @@ function V() {
703
738
  children: "Email"
704
739
  }), /* @__PURE__ */ F("p", {
705
740
  className: "font-medium",
706
- children: H.email || "—"
741
+ children: V.email || "—"
707
742
  })] })]
708
743
  }), /* @__PURE__ */ I("div", {
709
744
  className: "flex items-center gap-3",
710
- children: [/* @__PURE__ */ F(a, {
745
+ children: [/* @__PURE__ */ F(s, {
711
746
  size: 18,
712
747
  className: "text-text-secondary"
713
748
  }), /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
@@ -715,14 +750,14 @@ function V() {
715
750
  children: "Phone"
716
751
  }), /* @__PURE__ */ F("p", {
717
752
  className: "font-medium",
718
- children: H.phone || "—"
753
+ children: V.phone || "—"
719
754
  })] })]
720
755
  })]
721
- }), /* @__PURE__ */ F("div", {
756
+ }), /* @__PURE__ */ I("div", {
722
757
  className: "space-y-4",
723
- children: H.company && /* @__PURE__ */ I("div", {
758
+ children: [V.company && /* @__PURE__ */ I("div", {
724
759
  className: "flex items-center gap-3",
725
- children: [/* @__PURE__ */ F(t, {
760
+ children: [/* @__PURE__ */ F(n, {
726
761
  size: 18,
727
762
  className: "text-text-secondary"
728
763
  }), /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
@@ -730,34 +765,47 @@ function V() {
730
765
  children: "Company"
731
766
  }), /* @__PURE__ */ F("p", {
732
767
  className: "font-medium",
733
- children: H.company
768
+ children: V.company
734
769
  })] })]
735
- })
770
+ }), /* @__PURE__ */ I("div", {
771
+ className: "flex items-center gap-3",
772
+ children: [/* @__PURE__ */ F(t, {
773
+ size: 18,
774
+ className: "text-text-secondary"
775
+ }), /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
776
+ className: "text-sm text-text-secondary",
777
+ children: "Delivery updates"
778
+ }), /* @__PURE__ */ F("p", {
779
+ className: "font-medium",
780
+ "data-testid": "customer-delivery-updates",
781
+ children: fe(V)
782
+ })] })]
783
+ })]
736
784
  })]
737
785
  })] }),
738
786
  /* @__PURE__ */ I(C, { children: [/* @__PURE__ */ F(T, { children: /* @__PURE__ */ I(E, {
739
787
  className: "flex items-center gap-2",
740
- children: [/* @__PURE__ */ F(ee, { size: 18 }), " Address"]
741
- }) }), /* @__PURE__ */ F(w, { children: /* @__PURE__ */ F("p", { children: g(H.address) || "—" }) })] }),
788
+ children: [/* @__PURE__ */ F(a, { size: 18 }), " Address"]
789
+ }) }), /* @__PURE__ */ F(w, { children: /* @__PURE__ */ F("p", { children: v(V.address) || "—" }) })] }),
742
790
  /* @__PURE__ */ I(C, { children: [/* @__PURE__ */ I(T, {
743
791
  className: "flex flex-row items-center justify-between",
744
792
  children: [/* @__PURE__ */ I(E, {
745
793
  className: "flex items-center gap-2",
746
- children: [/* @__PURE__ */ F(i, { size: 18 }), " Orders"]
794
+ children: [/* @__PURE__ */ F(o, { size: 18 }), " Orders"]
747
795
  }), /* @__PURE__ */ I(S, {
748
796
  variant: "outline",
749
797
  size: "sm",
750
- onClick: () => Q(f("orders/new", H.id)),
751
- children: [/* @__PURE__ */ F(n, { size: 14 }), " New order"]
798
+ onClick: () => $(m("orders/new", V.id)),
799
+ children: [/* @__PURE__ */ F(r, { size: 14 }), " New order"]
752
800
  })]
753
- }), /* @__PURE__ */ F(w, { children: Te ? /* @__PURE__ */ F("p", {
801
+ }), /* @__PURE__ */ F(w, { children: ke ? /* @__PURE__ */ F("p", {
754
802
  className: "text-text-secondary text-center py-4",
755
803
  children: "Loading orders…"
756
- }) : W.length > 0 ? /* @__PURE__ */ F("div", {
804
+ }) : U.length > 0 ? /* @__PURE__ */ F("div", {
757
805
  className: "space-y-2",
758
- children: W.map((e) => /* @__PURE__ */ I("button", {
806
+ children: U.map((e) => /* @__PURE__ */ I("button", {
759
807
  type: "button",
760
- onClick: () => Q(`orders/${e.id}`),
808
+ onClick: () => $(`orders/${e.id}`),
761
809
  className: "w-full flex items-center justify-between gap-3 p-3 border rounded-lg text-left hover:bg-bg-sunken/50 transition-colors",
762
810
  children: [/* @__PURE__ */ I("div", {
763
811
  className: "min-w-0",
@@ -767,13 +815,13 @@ function V() {
767
815
  }), /* @__PURE__ */ I("p", {
768
816
  className: "text-sm text-text-secondary",
769
817
  children: [
770
- v(e.createdAt, "relative"),
818
+ b(e.createdAt, "relative"),
771
819
  " ·",
772
820
  " ",
773
- _(e.pricing.total)
821
+ y(e.pricing.total)
774
822
  ]
775
823
  })]
776
- }), /* @__PURE__ */ F(oe, {
824
+ }), /* @__PURE__ */ F(ce, {
777
825
  status: e.status,
778
826
  type: "order",
779
827
  size: "sm"
@@ -782,7 +830,7 @@ function V() {
782
830
  }) : /* @__PURE__ */ I("div", {
783
831
  className: "text-center py-6",
784
832
  children: [
785
- /* @__PURE__ */ F(i, {
833
+ /* @__PURE__ */ F(o, {
786
834
  size: 32,
787
835
  className: "mx-auto mb-2 text-text-secondary opacity-50"
788
836
  }),
@@ -792,7 +840,7 @@ function V() {
792
840
  }),
793
841
  /* @__PURE__ */ F("button", {
794
842
  type: "button",
795
- onClick: () => Q(f("orders/new", H.id)),
843
+ onClick: () => $(m("orders/new", V.id)),
796
844
  className: "mt-1 text-sm text-primary hover:underline",
797
845
  children: "Book their first delivery"
798
846
  })
@@ -802,20 +850,20 @@ function V() {
802
850
  }), /* @__PURE__ */ I("div", {
803
851
  className: "space-y-6",
804
852
  children: [
805
- (H.businessLicense || H.taxId) && /* @__PURE__ */ I(C, { children: [/* @__PURE__ */ F(T, { children: /* @__PURE__ */ F(E, { children: "Business Details" }) }), /* @__PURE__ */ I(w, {
853
+ (V.businessLicense || V.taxId) && /* @__PURE__ */ I(C, { children: [/* @__PURE__ */ F(T, { children: /* @__PURE__ */ F(E, { children: "Business Details" }) }), /* @__PURE__ */ I(w, {
806
854
  className: "space-y-3",
807
- children: [H.businessLicense && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
855
+ children: [V.businessLicense && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
808
856
  className: "text-sm text-text-secondary",
809
857
  children: "Business License"
810
858
  }), /* @__PURE__ */ F("p", {
811
859
  className: "font-mono",
812
- children: H.businessLicense
813
- })] }), H.taxId && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
860
+ children: V.businessLicense
861
+ })] }), V.taxId && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
814
862
  className: "text-sm text-text-secondary",
815
863
  children: "Tax ID"
816
864
  }), /* @__PURE__ */ F("p", {
817
865
  className: "font-mono",
818
- children: H.taxId
866
+ children: V.taxId
819
867
  })] })]
820
868
  })] }),
821
869
  /* @__PURE__ */ I(C, { children: [/* @__PURE__ */ F(T, { children: /* @__PURE__ */ F(E, { children: "Account Info" }) }), /* @__PURE__ */ I(w, {
@@ -823,16 +871,16 @@ function V() {
823
871
  children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
824
872
  className: "text-sm text-text-secondary",
825
873
  children: "Created"
826
- }), /* @__PURE__ */ F("p", { children: v(H.createdAt, "full") })] }), /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
874
+ }), /* @__PURE__ */ F("p", { children: b(V.createdAt, "full") })] }), /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
827
875
  className: "text-sm text-text-secondary",
828
876
  children: "Last Updated"
829
- }), /* @__PURE__ */ F("p", { children: v(H.updatedAt, "relative") })] })]
877
+ }), /* @__PURE__ */ F("p", { children: b(V.updatedAt, "relative") })] })]
830
878
  })] }),
831
879
  /* @__PURE__ */ I(C, {
832
880
  className: "border-status-error-border",
833
881
  children: [/* @__PURE__ */ F(T, { children: /* @__PURE__ */ I(E, {
834
882
  className: "flex items-center gap-2 text-status-error-text",
835
- children: [/* @__PURE__ */ F(l, { size: 18 }), " Delete Customer"]
883
+ children: [/* @__PURE__ */ F(d, { size: 18 }), " Delete Customer"]
836
884
  }) }), /* @__PURE__ */ I(w, { children: [/* @__PURE__ */ F("p", {
837
885
  className: "mb-3 text-sm text-text-secondary",
838
886
  children: "Removes this customer from your account. Their past orders stay on record. This cannot be undone from here."
@@ -840,50 +888,50 @@ function V() {
840
888
  type: "button",
841
889
  variant: "outline",
842
890
  className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
843
- onClick: () => X(!0),
844
- children: [/* @__PURE__ */ F(l, { size: 16 }), " Delete this customer"]
891
+ onClick: () => Z(!0),
892
+ children: [/* @__PURE__ */ F(d, { size: 16 }), " Delete this customer"]
845
893
  })] })]
846
894
  })
847
895
  ]
848
896
  })]
849
897
  }),
850
- /* @__PURE__ */ F(me, {
851
- open: je,
852
- onOpenChange: X,
853
- children: /* @__PURE__ */ I(he, { children: [
854
- /* @__PURE__ */ I(ve, { children: [/* @__PURE__ */ F(ye, { children: "Delete this customer?" }), /* @__PURE__ */ I(ge, { children: [
898
+ /* @__PURE__ */ F(_e, {
899
+ open: Ne,
900
+ onOpenChange: Z,
901
+ children: /* @__PURE__ */ I(ve, { children: [
902
+ /* @__PURE__ */ I(xe, { children: [/* @__PURE__ */ F(Se, { children: "Delete this customer?" }), /* @__PURE__ */ I(ye, { children: [
855
903
  "This removes ",
856
- H.name,
904
+ V.name,
857
905
  " from your account. It cannot be undone from here."
858
906
  ] })] }),
859
907
  /* @__PURE__ */ F("div", {
860
908
  className: "px-1",
861
- children: /* @__PURE__ */ F(M, { message: Ne })
909
+ children: /* @__PURE__ */ F(j, { message: Fe })
862
910
  }),
863
- /* @__PURE__ */ I(_e, { children: [/* @__PURE__ */ F(S, {
911
+ /* @__PURE__ */ I(be, { children: [/* @__PURE__ */ F(S, {
864
912
  variant: "outline",
865
- onClick: () => X(!1),
866
- disabled: Z,
913
+ onClick: () => Z(!1),
914
+ disabled: Q,
867
915
  children: "Cancel"
868
916
  }), /* @__PURE__ */ F(S, {
869
917
  className: "bg-status-error-text text-text-inverse hover:opacity-90",
870
918
  onClick: async () => {
871
- if (p) {
872
- Me(!0), Pe(null);
919
+ if (h) {
920
+ Pe(!0), Ie(null);
873
921
  try {
874
- await we(p), X(!1), Fe();
922
+ await Oe(h), Z(!1), Le();
875
923
  } catch (e) {
876
- Pe(e instanceof Error ? e.message : "Failed to delete customer."), Me(!1);
924
+ Ie(e instanceof Error ? e.message : "Failed to delete customer."), Pe(!1);
877
925
  }
878
926
  }
879
927
  },
880
- disabled: Z,
881
- children: Z ? "Deleting..." : "Delete customer"
928
+ disabled: Q,
929
+ children: Q ? "Deleting..." : "Delete customer"
882
930
  })] })
883
931
  ] })
884
932
  })
885
933
  ]
886
- }) : /* @__PURE__ */ F(be, {});
934
+ }) : /* @__PURE__ */ F(Ce, {});
887
935
  }
888
936
  //#endregion
889
- export { V as default };
937
+ export { B as default };