@burdenoff/microfe-healthybowl 2026.714.1 → 2026.714.3

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/healthybowl/HealthyBowlRoutes.js +123 -107
  2. package/dist/healthybowl/HealthyBowlRoutes.js.map +1 -1
  3. package/dist/healthybowl/hooks/useOrderPayments.js +87 -0
  4. package/dist/healthybowl/hooks/useOrderPayments.js.map +1 -0
  5. package/dist/healthybowl/hooks/useSharedMarket.js +54 -0
  6. package/dist/healthybowl/hooks/useSharedMarket.js.map +1 -0
  7. package/dist/healthybowl/pages/marketplace/MarketplacePage.js +484 -432
  8. package/dist/healthybowl/pages/marketplace/MarketplacePage.js.map +1 -1
  9. package/dist/healthybowl/pages/marketplace/OrdersPage.js +400 -267
  10. package/dist/healthybowl/pages/marketplace/OrdersPage.js.map +1 -1
  11. package/dist/healthybowl/pages/marketplace/SharedMarketView.js +247 -0
  12. package/dist/healthybowl/pages/marketplace/SharedMarketView.js.map +1 -0
  13. package/dist/healthybowl/pages/satellite/CropHealthAlertsPage.js +188 -0
  14. package/dist/healthybowl/pages/satellite/CropHealthAlertsPage.js.map +1 -0
  15. package/dist/healthybowl/pages/satellite/NdviComparePanel.js +196 -0
  16. package/dist/healthybowl/pages/satellite/NdviComparePanel.js.map +1 -0
  17. package/dist/healthybowl/pages/satellite/NdviGridThumbnail.js +44 -0
  18. package/dist/healthybowl/pages/satellite/NdviGridThumbnail.js.map +1 -0
  19. package/dist/healthybowl/pages/satellite/NdviHeatmapMap.js +144 -0
  20. package/dist/healthybowl/pages/satellite/NdviHeatmapMap.js.map +1 -0
  21. package/dist/healthybowl/pages/satellite/SatelliteCropHealthPage.js +278 -0
  22. package/dist/healthybowl/pages/satellite/SatelliteCropHealthPage.js.map +1 -0
  23. package/dist/healthybowl/pages/satellite/SatelliteFieldDetailPage.js +447 -0
  24. package/dist/healthybowl/pages/satellite/SatelliteFieldDetailPage.js.map +1 -0
  25. package/dist/healthybowl/pages/satellite/SatelliteSettingsPage.js +252 -0
  26. package/dist/healthybowl/pages/satellite/SatelliteSettingsPage.js.map +1 -0
  27. package/dist/healthybowl/pages/satellite/YieldReportPanel.js +236 -0
  28. package/dist/healthybowl/pages/satellite/YieldReportPanel.js.map +1 -0
  29. package/dist/healthybowl/pages/satellite/YieldSimulationPanel.js +363 -0
  30. package/dist/healthybowl/pages/satellite/YieldSimulationPanel.js.map +1 -0
  31. package/dist/healthybowl/pages/satellite/ndviColors.js +116 -0
  32. package/dist/healthybowl/pages/satellite/ndviColors.js.map +1 -0
  33. package/dist/healthybowl/pages/satellite/satelliteApi.js +191 -0
  34. package/dist/healthybowl/pages/satellite/satelliteApi.js.map +1 -0
  35. package/dist/healthybowl/pages/satellite/useSatelliteApi.js +15 -0
  36. package/dist/healthybowl/pages/satellite/useSatelliteApi.js.map +1 -0
  37. package/dist/node_modules/recharts/es6/cartesian/Scatter.js +368 -0
  38. package/dist/node_modules/recharts/es6/cartesian/Scatter.js.map +1 -0
  39. package/dist/node_modules/recharts/es6/cartesian/ZAxis.js +103 -0
  40. package/dist/node_modules/recharts/es6/cartesian/ZAxis.js.map +1 -0
  41. package/dist/node_modules/recharts/es6/chart/ComposedChart.js +38 -0
  42. package/dist/node_modules/recharts/es6/chart/ComposedChart.js.map +1 -0
  43. package/dist/node_modules/recharts/es6/util/DataUtils.js +12 -2
  44. package/dist/node_modules/recharts/es6/util/DataUtils.js.map +1 -1
  45. package/dist/node_modules/recharts/es6/util/ScatterUtils.js +48 -0
  46. package/dist/node_modules/recharts/es6/util/ScatterUtils.js.map +1 -0
  47. package/package.json +1 -1
@@ -2,65 +2,66 @@ import { cn as e, formatCurrency as t, formatDate as n } from "../../utils/helpe
2
2
  import { PageLayout as r } from "../../components/PageLayout.js";
3
3
  import { StatCard as i } from "../../components/StatCard.js";
4
4
  import { StatusBadge as a } from "../../components/StatusBadge.js";
5
- import { EmptyState as ee } from "../../components/EmptyState.js";
6
- import { ErrorState as te } from "../../components/ErrorState.js";
7
- import { ToastContainer as o } from "../../components/Toast.js";
8
- import { useConfirm as s } from "../../components/ConfirmDialog.js";
9
- import { Breadcrumbs as c } from "../../components/Breadcrumbs.js";
10
- import { PageLoader as l } from "../../components/PageLoader.js";
11
- import { Modal as u } from "../../components/Modal.js";
12
- import { useToast as ne } from "../../hooks/useToast.js";
5
+ import { EmptyState as o } from "../../components/EmptyState.js";
6
+ import { ErrorState as s } from "../../components/ErrorState.js";
7
+ import { ToastContainer as c } from "../../components/Toast.js";
8
+ import { useConfirm as ee } from "../../components/ConfirmDialog.js";
9
+ import { Breadcrumbs as te } from "../../components/Breadcrumbs.js";
10
+ import { PageLoader as ne } from "../../components/PageLoader.js";
11
+ import { Modal as re } from "../../components/Modal.js";
12
+ import { useToast as ie } from "../../hooks/useToast.js";
13
13
  import "../../components/index.js";
14
- import { useHealthyBowlData as re } from "../../hooks/useHealthyBowlData.js";
15
- import { useHealthyBowlStore as ie } from "../../store/healthybowlStore.js";
16
- import { useEffect as ae, useState as d } from "react";
17
- import { useI18n as oe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
18
- import { Calendar as f, CheckCircle as p, ChevronDown as se, ChevronUp as m, Clock as h, CreditCard as g, Info as ce, Package as _, RotateCcw as le, Search as ue, Truck as v, X as y, XCircle as b } from "lucide-react";
19
- import { useLocation as x, useNavigate as de } from "react-router-dom";
20
- import { jsx as S, jsxs as C } from "react/jsx-runtime";
21
- import { Button as w } from "@burdenoff/fe-libs/ui";
14
+ import { useHealthyBowlData as ae } from "../../hooks/useHealthyBowlData.js";
15
+ import { useHealthyBowlStore as oe } from "../../store/healthybowlStore.js";
16
+ import { loadRazorpayCheckout as se, useOrderPayments as l } from "../../hooks/useOrderPayments.js";
17
+ import { useEffect as u, useState as d } from "react";
18
+ import { useI18n as f } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
19
+ import { Calendar as p, CheckCircle as m, ChevronDown as ce, ChevronUp as le, Clock as h, CreditCard as g, Info as ue, Package as _, ReceiptText as de, RotateCcw as fe, Search as pe, Truck as v, Wallet as me, X as he, XCircle as y } from "lucide-react";
20
+ import { useLocation as ge, useNavigate as _e } from "react-router-dom";
21
+ import { jsx as b, jsxs as x } from "react/jsx-runtime";
22
+ import { Button as S } from "@burdenoff/fe-libs/ui";
22
23
  //#region src/healthybowl/pages/marketplace/OrdersPage.tsx
23
- var T = [
24
+ var C = [
24
25
  "All",
25
26
  "Pending",
26
27
  "Confirmed",
27
28
  "Shipped",
28
29
  "Delivered",
29
30
  "Cancelled"
30
- ], E = (e) => ({
31
+ ], w = (e) => ({
31
32
  delivered: "success",
32
33
  shipped: "info",
33
34
  confirmed: "warning",
34
35
  pending: "muted",
35
36
  cancelled: "error"
36
- })[e] ?? "muted", D = (e) => {
37
+ })[e] ?? "muted", T = (e) => {
37
38
  switch (e) {
38
- case "delivered": return /* @__PURE__ */ S(p, { className: "h-4 w-4" });
39
- case "shipped": return /* @__PURE__ */ S(v, { className: "h-4 w-4" });
40
- case "confirmed": return /* @__PURE__ */ S(h, { className: "h-4 w-4" });
41
- case "cancelled": return /* @__PURE__ */ S(b, { className: "h-4 w-4" });
42
- default: return /* @__PURE__ */ S(h, { className: "h-4 w-4" });
39
+ case "delivered": return /* @__PURE__ */ b(m, { className: "h-4 w-4" });
40
+ case "shipped": return /* @__PURE__ */ b(v, { className: "h-4 w-4" });
41
+ case "confirmed": return /* @__PURE__ */ b(h, { className: "h-4 w-4" });
42
+ case "cancelled": return /* @__PURE__ */ b(y, { className: "h-4 w-4" });
43
+ default: return /* @__PURE__ */ b(h, { className: "h-4 w-4" });
43
44
  }
44
- }, O = (e) => ({
45
+ }, E = (e) => ({
45
46
  paid: "success",
46
47
  pending: "warning",
47
48
  refunded: "error"
48
- })[e] ?? "muted", k = () => {
49
- let { t: k } = oe(), A = s(), { orders: j, errors: M, loadings: N, updateOrder: P, refetch: F } = re(), I = (e) => {
49
+ })[e] ?? "muted", D = () => {
50
+ let { t: D } = f(), O = ee(), { orders: k, errors: A, loadings: j, updateOrder: M, refetch: N } = ae(), { payments: P, refetchPayments: F, checkoutOrder: I, syncOrderPayment: ve } = l(), ye = (e) => {
50
51
  switch (e) {
51
- case "All": return k("healthybowl.common.all", "All");
52
- case "Pending": return k("healthybowl.marketplace.orders.tabs.pending", "Pending");
53
- case "Confirmed": return k("healthybowl.marketplace.orders.tabs.confirmed", "Confirmed");
54
- case "Shipped": return k("healthybowl.marketplace.orders.tabs.shipped", "Shipped");
55
- case "Delivered": return k("healthybowl.marketplace.orders.tabs.delivered", "Delivered");
56
- case "Cancelled": return k("healthybowl.marketplace.orders.tabs.cancelled", "Cancelled");
52
+ case "All": return D("healthybowl.common.all", "All");
53
+ case "Pending": return D("healthybowl.marketplace.orders.tabs.pending", "Pending");
54
+ case "Confirmed": return D("healthybowl.marketplace.orders.tabs.confirmed", "Confirmed");
55
+ case "Shipped": return D("healthybowl.marketplace.orders.tabs.shipped", "Shipped");
56
+ case "Delivered": return D("healthybowl.marketplace.orders.tabs.delivered", "Delivered");
57
+ case "Cancelled": return D("healthybowl.marketplace.orders.tabs.cancelled", "Cancelled");
57
58
  default: return e;
58
59
  }
59
- }, [L, R] = d(""), [z, B] = d("All"), [V, H] = d(null), [U, W] = d(null), [G, K] = d(null), { toasts: fe, toast: q, dismiss: pe } = ne(), { addToCart: me } = ie(), J = x(), Y = de();
60
- ae(() => {
60
+ }, [L, R] = d(""), [z, B] = d("All"), [be, xe] = d(null), [V, H] = d(null), [U, W] = d(null), [G, K] = d(null), { toasts: Se, toast: q, dismiss: Ce } = ie(), { addToCart: we } = oe(), J = ge(), Y = _e();
61
+ u(() => {
61
62
  J.state?.orderPlaced && (q({
62
- title: k("healthybowl.marketplace.orders.toast.placed.title", "Order placed"),
63
- description: k("healthybowl.marketplace.orders.toast.placed.description", "Your order has been placed. Payment is collected separately."),
63
+ title: D("healthybowl.marketplace.orders.toast.placed.title", "Order placed"),
64
+ description: D("healthybowl.marketplace.orders.toast.placed.description", "Your order has been placed. Use \"Pay Now\" on the order to pay for it."),
64
65
  variant: "success"
65
66
  }), Y(J.pathname, {
66
67
  replace: !0,
@@ -71,24 +72,24 @@ var T = [
71
72
  J.pathname,
72
73
  Y,
73
74
  q,
74
- k
75
+ D
75
76
  ]);
76
- let X = j.filter((e) => {
77
+ let X = k.filter((e) => {
77
78
  let t = (e.orderNumber ?? "").toLowerCase().includes(L.toLowerCase()), n = z === "All" || e.status === z.toLowerCase();
78
79
  return t && n;
79
- }), Z = j.length, he = j.filter((e) => e.status === "delivered").length, ge = j.filter((e) => e.status === "shipped").length, _e = j.filter((e) => e.status === "pending" || e.status === "confirmed").length, Q = (e) => {
80
- H((t) => t === e ? null : e);
81
- }, ve = (e) => {
82
- W(e);
80
+ }), Z = k.length, Te = k.filter((e) => e.status === "delivered").length, Ee = k.filter((e) => e.status === "shipped").length, De = k.filter((e) => e.status === "pending" || e.status === "confirmed").length, Oe = (e) => {
81
+ xe((t) => t === e ? null : e);
82
+ }, Q = (e) => {
83
+ H(e);
83
84
  }, $ = async (e, t, n) => {
84
- K(e.id);
85
+ W(e.id);
85
86
  try {
86
- await P({
87
+ await M({
87
88
  id: e.id,
88
89
  status: t
89
90
  }), q({
90
91
  title: n,
91
- description: k("healthybowl.marketplace.orders.toast.statusChanged", "{{orderNumber}} is now {{status}}.", {
92
+ description: D("healthybowl.marketplace.orders.toast.statusChanged", "{{orderNumber}} is now {{status}}.", {
92
93
  orderNumber: e.orderNumber,
93
94
  status: t
94
95
  }),
@@ -96,58 +97,178 @@ var T = [
96
97
  });
97
98
  } catch (e) {
98
99
  q({
99
- title: k("healthybowl.marketplace.orders.toast.updateFailed", "Update failed"),
100
- description: e instanceof Error ? e.message : k("healthybowl.common.error", "Unknown error"),
100
+ title: D("healthybowl.marketplace.orders.toast.updateFailed", "Update failed"),
101
+ description: e instanceof Error ? e.message : D("healthybowl.common.error", "Unknown error"),
101
102
  variant: "error"
102
103
  });
103
104
  } finally {
104
- K(null);
105
+ W(null);
105
106
  }
106
- }, ye = async (e) => {
107
- K(e.id);
107
+ }, ke = async (e) => {
108
108
  try {
109
- await P({
110
- id: e.id,
111
- paymentStatus: "paid"
112
- }), q({
113
- title: k("healthybowl.marketplace.orders.toast.paymentRecorded.title", "Payment recorded"),
114
- description: k("healthybowl.marketplace.orders.toast.paymentRecorded.description", "{{orderNumber}} marked paid.", { orderNumber: e.orderNumber }),
109
+ let t = await ve(e.id);
110
+ await Promise.all([N(), F()]).catch(() => void 0), (t.paymentStatus ?? "").toLowerCase() === "paid" ? q({
111
+ title: D("healthybowl.marketplace.orders.toast.paid.title", "Payment confirmed"),
112
+ description: t.paymentReference ? D("healthybowl.marketplace.orders.toast.paid.withRef", "{{orderNumber}} paid — reference {{reference}}.", {
113
+ orderNumber: e.orderNumber,
114
+ reference: t.paymentReference
115
+ }) : D("healthybowl.marketplace.orders.toast.paid.description", "{{orderNumber}} is now paid.", { orderNumber: e.orderNumber }),
115
116
  variant: "success"
117
+ }) : q({
118
+ title: D("healthybowl.marketplace.orders.toast.notPaid.title", "Payment not completed"),
119
+ description: D("healthybowl.marketplace.orders.toast.notPaid.description", "{{orderNumber}} is still pending. Nothing was charged — you can pay again any time.", { orderNumber: e.orderNumber }),
120
+ variant: "info"
116
121
  });
117
122
  } catch (e) {
118
123
  q({
119
- title: k("healthybowl.marketplace.orders.toast.updateFailed", "Update failed"),
120
- description: e instanceof Error ? e.message : k("healthybowl.common.error", "Unknown error"),
124
+ title: D("healthybowl.marketplace.orders.toast.syncFailed.title", "Could not confirm the payment"),
125
+ description: e instanceof Error ? e.message : D("healthybowl.common.error", "Unknown error"),
121
126
  variant: "error"
122
127
  });
123
128
  } finally {
124
- K(null);
129
+ K((t) => t === e.id ? null : t);
125
130
  }
126
- }, be = async (e) => {
127
- if (await A({ message: k("healthybowl.marketplace.orders.confirm.cancel", "Cancel order {{orderNumber}}? This cannot be undone.", { orderNumber: e.orderNumber }) })) {
128
- K(e.id);
131
+ }, Ae = async (e) => {
132
+ K(e.id);
133
+ let t = !1;
134
+ try {
135
+ let n = await I(e.id);
136
+ if (n.provider !== "RAZORPAY") {
137
+ q({
138
+ title: D("healthybowl.marketplace.orders.toast.unsupportedProvider.title", "Unsupported payment provider"),
139
+ description: D("healthybowl.marketplace.orders.toast.unsupportedProvider.description", "Billing routed this order to {{provider}}, which this checkout cannot open yet. Settle it offline, or contact support.", { provider: n.provider }),
140
+ variant: "warning"
141
+ });
142
+ return;
143
+ }
144
+ if (!n.providerOrderId || !n.razorpayKeyId) {
145
+ q({
146
+ title: D("healthybowl.marketplace.orders.toast.checkoutIncomplete.title", "Payment session incomplete"),
147
+ description: D("healthybowl.marketplace.orders.toast.checkoutIncomplete.description", "Billing did not return the handles needed to open the checkout. Please try again."),
148
+ variant: "error"
149
+ });
150
+ return;
151
+ }
152
+ let r = await se(), i = !1, a = () => {
153
+ i || (i = !0, ke(e));
154
+ };
155
+ new r({
156
+ key: n.razorpayKeyId,
157
+ order_id: n.providerOrderId,
158
+ amount: Math.round(n.total * 100),
159
+ currency: n.currency,
160
+ name: "HealthyBowl",
161
+ description: e.orderNumber,
162
+ handler: a,
163
+ modal: { ondismiss: a }
164
+ }).open(), t = !0;
165
+ } catch (e) {
166
+ q({
167
+ title: D("healthybowl.marketplace.orders.toast.checkoutFailed.title", "Could not start the payment"),
168
+ description: e instanceof Error ? e.message : D("healthybowl.common.error", "Unknown error"),
169
+ variant: "error"
170
+ });
171
+ } finally {
172
+ t || K(null);
173
+ }
174
+ }, je = async (e) => {
175
+ if (await O({
176
+ title: D("healthybowl.marketplace.orders.confirm.offline.title", "Record an offline payment?"),
177
+ message: D("healthybowl.marketplace.orders.confirm.offline.message", "{{orderNumber}} will be marked paid without going through the payment gateway — use this only when the buyer has settled in cash or by bank transfer. To take a real card/UPI payment, use \"Pay Now\" instead.", { orderNumber: e.orderNumber }),
178
+ okButtonTitle: D("healthybowl.marketplace.orders.actions.markPaidOffline", "Mark Paid (Offline)"),
179
+ cancelButtonTitle: D("healthybowl.common.cancel", "Cancel")
180
+ })) {
181
+ W(e.id);
129
182
  try {
130
- await P({
183
+ await M({
184
+ id: e.id,
185
+ paymentStatus: "paid"
186
+ }), await F(), q({
187
+ title: D("healthybowl.marketplace.orders.toast.paymentRecorded.title", "Offline payment recorded"),
188
+ description: D("healthybowl.marketplace.orders.toast.paymentRecorded.description", "{{orderNumber}} marked paid offline (no gateway reference).", { orderNumber: e.orderNumber }),
189
+ variant: "success"
190
+ });
191
+ } catch (e) {
192
+ q({
193
+ title: D("healthybowl.marketplace.orders.toast.updateFailed", "Update failed"),
194
+ description: e instanceof Error ? e.message : D("healthybowl.common.error", "Unknown error"),
195
+ variant: "error"
196
+ });
197
+ } finally {
198
+ W(null);
199
+ }
200
+ }
201
+ }, Me = async (e) => {
202
+ if (await O({ message: D("healthybowl.marketplace.orders.confirm.cancel", "Cancel order {{orderNumber}}? This cannot be undone.", { orderNumber: e.orderNumber }) })) {
203
+ W(e.id);
204
+ try {
205
+ await M({
131
206
  id: e.id,
132
207
  status: "cancelled"
133
208
  }), q({
134
- title: k("healthybowl.marketplace.orders.toast.cancelled", "Order cancelled"),
209
+ title: D("healthybowl.marketplace.orders.toast.cancelled", "Order cancelled"),
135
210
  description: e.orderNumber,
136
211
  variant: "success"
137
212
  });
138
213
  } catch (e) {
139
214
  q({
140
- title: k("healthybowl.marketplace.orders.toast.updateFailed", "Update failed"),
141
- description: e instanceof Error ? e.message : k("healthybowl.common.error", "Unknown error"),
215
+ title: D("healthybowl.marketplace.orders.toast.updateFailed", "Update failed"),
216
+ description: e instanceof Error ? e.message : D("healthybowl.common.error", "Unknown error"),
142
217
  variant: "error"
143
218
  });
144
219
  } finally {
145
- K(null);
220
+ W(null);
146
221
  }
147
222
  }
148
- }, xe = (e) => {
223
+ }, Ne = (e) => {
224
+ if (e.paymentStatus !== "paid") return null;
225
+ let r = P[e.id], i = (r?.paymentProvider ?? "").toUpperCase(), a = i === "MANUAL";
226
+ return /* @__PURE__ */ x("div", {
227
+ className: "mt-2 space-y-1.5 rounded-md border border-border-subtle bg-bg-sunken/40 px-3 py-2",
228
+ children: [
229
+ /* @__PURE__ */ x("div", {
230
+ className: "flex items-center gap-2 text-xs font-medium text-text-primary",
231
+ children: [/* @__PURE__ */ b(de, { className: "h-3.5 w-3.5 shrink-0 text-text-secondary" }), a ? D("healthybowl.marketplace.orders.payment.offline", "Paid offline") : i ? D("healthybowl.marketplace.orders.payment.viaProvider", "Paid via {{provider}}", { provider: i }) : D("healthybowl.marketplace.orders.payment.paid", "Paid")]
232
+ }),
233
+ r?.paymentReference && /* @__PURE__ */ x("div", {
234
+ className: "flex items-center justify-between gap-2 text-xs",
235
+ children: [/* @__PURE__ */ b("span", {
236
+ className: "text-text-secondary",
237
+ children: D("healthybowl.marketplace.orders.payment.reference", "Payment reference")
238
+ }), /* @__PURE__ */ b("span", {
239
+ className: "break-all font-mono text-text-primary",
240
+ children: r.paymentReference
241
+ })]
242
+ }),
243
+ r?.paidAmount != null && /* @__PURE__ */ x("div", {
244
+ className: "flex items-center justify-between gap-2 text-xs",
245
+ children: [/* @__PURE__ */ b("span", {
246
+ className: "text-text-secondary",
247
+ children: D("healthybowl.marketplace.orders.payment.paidAmount", "Amount charged")
248
+ }), /* @__PURE__ */ b("span", {
249
+ className: "text-text-primary",
250
+ children: t(r.paidAmount)
251
+ })]
252
+ }),
253
+ r?.paidAt && /* @__PURE__ */ x("div", {
254
+ className: "flex items-center justify-between gap-2 text-xs",
255
+ children: [/* @__PURE__ */ b("span", {
256
+ className: "text-text-secondary",
257
+ children: D("healthybowl.marketplace.orders.payment.paidAt", "Paid on")
258
+ }), /* @__PURE__ */ b("span", {
259
+ className: "text-text-primary",
260
+ children: n(r.paidAt)
261
+ })]
262
+ }),
263
+ a && /* @__PURE__ */ b("p", {
264
+ className: "text-[11px] text-text-secondary",
265
+ children: D("healthybowl.marketplace.orders.payment.offlineHint", "Settled outside the payment gateway, so there is no gateway reference.")
266
+ })
267
+ ]
268
+ });
269
+ }, Pe = (e) => {
149
270
  let t = 0;
150
- for (let n of e.items ?? []) me({
271
+ for (let n of e.items ?? []) we({
151
272
  productId: n.productId ?? n.id,
152
273
  name: n.productName,
153
274
  price: n.price,
@@ -155,340 +276,352 @@ var T = [
155
276
  seller: n.seller
156
277
  }), t++;
157
278
  q({
158
- title: k("healthybowl.marketplace.orders.toast.reorder.title", "Items added to cart (this session)"),
159
- description: k("healthybowl.marketplace.orders.toast.reorder.description", "{{count}} item(s) from {{orderNumber}}. Cart isn't saved yet — it resets on refresh.", {
279
+ title: D("healthybowl.marketplace.orders.toast.reorder.title", "Items added to cart (this session)"),
280
+ description: D("healthybowl.marketplace.orders.toast.reorder.description", "{{count}} item(s) from {{orderNumber}}. Cart isn't saved yet — it resets on refresh.", {
160
281
  count: t,
161
282
  orderNumber: e.orderNumber
162
283
  }),
163
284
  variant: "info"
164
285
  });
165
286
  };
166
- return /* @__PURE__ */ C(r, {
167
- title: k("healthybowl.marketplace.orders.title", "Orders"),
168
- description: k("healthybowl.marketplace.orders.description", "Track and manage your marketplace orders"),
287
+ return /* @__PURE__ */ x(r, {
288
+ title: D("healthybowl.marketplace.orders.title", "Orders"),
289
+ description: D("healthybowl.marketplace.orders.description", "Track and manage your marketplace orders"),
169
290
  purpose: "Every order you've placed on the marketplace and where it stands — confirmed, shipped or delivered. Come here to track deliveries, reorder, and keep a record of what you've bought.",
170
- actions: /* @__PURE__ */ S(_, { className: "h-5 w-5 text-text-secondary" }),
291
+ actions: /* @__PURE__ */ b(_, { className: "h-5 w-5 text-text-secondary" }),
171
292
  children: [
172
- /* @__PURE__ */ S(c, { items: [{
173
- label: k("healthybowl.marketplace.orders.breadcrumbs.marketplace", "Marketplace"),
293
+ /* @__PURE__ */ b(te, { items: [{
294
+ label: D("healthybowl.marketplace.orders.breadcrumbs.marketplace", "Marketplace"),
174
295
  href: "/marketplace"
175
- }, { label: k("healthybowl.marketplace.orders.breadcrumbs.orders", "Orders") }] }),
176
- /* @__PURE__ */ C("div", {
296
+ }, { label: D("healthybowl.marketplace.orders.breadcrumbs.orders", "Orders") }] }),
297
+ /* @__PURE__ */ x("div", {
177
298
  className: "flex items-start gap-2 rounded-lg border border-border-subtle bg-bg-sunken/40 p-3 text-xs text-text-secondary",
178
- children: [/* @__PURE__ */ S(ce, { className: "mt-0.5 h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ S("p", { children: k("healthybowl.marketplace.orders.notice", "This page shows real orders. Place an order from the cart to record it here — payment is collected separately and isn't taken at checkout.") })]
299
+ children: [/* @__PURE__ */ b(ue, { className: "mt-0.5 h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ b("p", { children: D("healthybowl.marketplace.orders.notice", "This page shows real orders. Place an order from the cart to record it here, then use \"Pay Now\" to pay for it through the payment gateway — the order is marked paid only once the gateway confirms the money arrived. \"Mark Paid (Offline)\" is for cash or bank-transfer settlements and records no gateway reference.") })]
179
300
  }),
180
- /* @__PURE__ */ C("div", {
301
+ /* @__PURE__ */ x("div", {
181
302
  className: "grid grid-cols-2 gap-4 lg:grid-cols-4",
182
303
  children: [
183
- /* @__PURE__ */ S(i, {
304
+ /* @__PURE__ */ b(i, {
184
305
  hero: !0,
185
- label: k("healthybowl.marketplace.orders.stats.totalOrders", "Total Orders"),
306
+ label: D("healthybowl.marketplace.orders.stats.totalOrders", "Total Orders"),
186
307
  value: Z,
187
- icon: /* @__PURE__ */ S(_, { className: "h-5 w-5" })
308
+ icon: /* @__PURE__ */ b(_, { className: "h-5 w-5" })
188
309
  }),
189
- /* @__PURE__ */ S(i, {
190
- label: k("healthybowl.marketplace.orders.stats.delivered", "Delivered"),
191
- value: he,
192
- icon: /* @__PURE__ */ S(p, { className: "h-5 w-5" })
310
+ /* @__PURE__ */ b(i, {
311
+ label: D("healthybowl.marketplace.orders.stats.delivered", "Delivered"),
312
+ value: Te,
313
+ icon: /* @__PURE__ */ b(m, { className: "h-5 w-5" })
193
314
  }),
194
- /* @__PURE__ */ S(i, {
195
- label: k("healthybowl.marketplace.orders.stats.inTransit", "In Transit"),
196
- value: ge,
197
- icon: /* @__PURE__ */ S(v, { className: "h-5 w-5" })
315
+ /* @__PURE__ */ b(i, {
316
+ label: D("healthybowl.marketplace.orders.stats.inTransit", "In Transit"),
317
+ value: Ee,
318
+ icon: /* @__PURE__ */ b(v, { className: "h-5 w-5" })
198
319
  }),
199
- /* @__PURE__ */ S(i, {
200
- label: k("healthybowl.marketplace.orders.stats.pending", "Pending"),
201
- value: _e,
202
- icon: /* @__PURE__ */ S(h, { className: "h-5 w-5" })
320
+ /* @__PURE__ */ b(i, {
321
+ label: D("healthybowl.marketplace.orders.stats.pending", "Pending"),
322
+ value: De,
323
+ icon: /* @__PURE__ */ b(h, { className: "h-5 w-5" })
203
324
  })
204
325
  ]
205
326
  }),
206
- /* @__PURE__ */ C("div", {
327
+ /* @__PURE__ */ x("div", {
207
328
  className: "flex flex-col gap-4 rounded-lg border border-border-subtle bg-bg-surface p-4 sm:flex-row sm:items-center sm:justify-between",
208
- children: [/* @__PURE__ */ S("div", {
329
+ children: [/* @__PURE__ */ b("div", {
209
330
  className: "flex flex-1 flex-wrap items-center gap-3",
210
- children: /* @__PURE__ */ C("div", {
331
+ children: /* @__PURE__ */ x("div", {
211
332
  className: "relative",
212
333
  children: [
213
- /* @__PURE__ */ S(ue, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }),
214
- /* @__PURE__ */ S("input", {
334
+ /* @__PURE__ */ b(pe, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }),
335
+ /* @__PURE__ */ b("input", {
215
336
  type: "text",
216
- placeholder: k("healthybowl.marketplace.orders.searchPlaceholder", "Search by order number..."),
337
+ placeholder: D("healthybowl.marketplace.orders.searchPlaceholder", "Search by order number..."),
217
338
  value: L,
218
339
  onChange: (e) => R(e.target.value),
219
340
  className: "w-56 rounded-md border border-border-subtle bg-bg-surface py-2 pl-10 pr-8 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
220
341
  }),
221
- L && /* @__PURE__ */ S(w, {
342
+ L && /* @__PURE__ */ b(S, {
222
343
  variant: "ghost",
223
344
  size: "icon-sm",
224
345
  onClick: () => R(""),
225
- "aria-label": k("healthybowl.common.clearSearch", "Clear search"),
346
+ "aria-label": D("healthybowl.common.clearSearch", "Clear search"),
226
347
  className: "absolute right-2.5 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text-primary",
227
- children: /* @__PURE__ */ S(y, { className: "h-3.5 w-3.5" })
348
+ children: /* @__PURE__ */ b(he, { className: "h-3.5 w-3.5" })
228
349
  })
229
350
  ]
230
351
  })
231
- }), /* @__PURE__ */ S("span", {
352
+ }), /* @__PURE__ */ b("span", {
232
353
  className: "text-xs text-text-secondary",
233
- children: k("healthybowl.marketplace.orders.showingCount", "Showing {{shown}} of {{total}} orders", {
354
+ children: D("healthybowl.marketplace.orders.showingCount", "Showing {{shown}} of {{total}} orders", {
234
355
  shown: X.length,
235
356
  total: Z
236
357
  })
237
358
  })]
238
359
  }),
239
- /* @__PURE__ */ S("div", {
360
+ /* @__PURE__ */ b("div", {
240
361
  className: "flex flex-wrap gap-1.5",
241
- children: T.map((t) => {
242
- let n = t === "All" ? j.length : j.filter((e) => e.status === t.toLowerCase()).length;
243
- return /* @__PURE__ */ C("button", {
362
+ children: C.map((t) => {
363
+ let n = t === "All" ? k.length : k.filter((e) => e.status === t.toLowerCase()).length;
364
+ return /* @__PURE__ */ x("button", {
244
365
  type: "button",
245
366
  onClick: () => B(t),
246
367
  className: e("flex items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium transition-colors", z === t ? "bg-action-primary-bg text-action-primary-text" : "border border-border-subtle text-text-secondary hover:text-text-primary hover:bg-bg-sunken/50"),
247
- children: [I(t), /* @__PURE__ */ S("span", {
368
+ children: [ye(t), /* @__PURE__ */ b("span", {
248
369
  className: e("rounded-full px-1.5 text-[10px] font-bold", z === t ? "bg-primary-foreground/20 text-action-primary-text" : "bg-bg-sunken text-text-secondary"),
249
370
  children: n
250
371
  })]
251
372
  }, t);
252
373
  })
253
374
  }),
254
- X.length > 0 ? /* @__PURE__ */ S("div", {
375
+ X.length > 0 ? /* @__PURE__ */ b("div", {
255
376
  className: "space-y-3",
256
377
  children: X.map((e) => {
257
- let r = V === e.id;
258
- return /* @__PURE__ */ C("div", {
378
+ let r = be === e.id;
379
+ return /* @__PURE__ */ x("div", {
259
380
  className: "rounded-lg border border-border-subtle bg-bg-surface shadow-sm transition-shadow hover:shadow-md",
260
- children: [/* @__PURE__ */ C("button", {
381
+ children: [/* @__PURE__ */ x("button", {
261
382
  type: "button",
262
- onClick: () => Q(e.id),
383
+ onClick: () => Oe(e.id),
263
384
  className: "flex w-full items-center gap-4 p-4 text-left",
264
385
  children: [
265
- /* @__PURE__ */ S("div", {
386
+ /* @__PURE__ */ b("div", {
266
387
  className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary",
267
- children: D(e.status)
388
+ children: T(e.status)
268
389
  }),
269
- /* @__PURE__ */ C("div", {
390
+ /* @__PURE__ */ x("div", {
270
391
  className: "min-w-0 flex-1",
271
- children: [/* @__PURE__ */ C("div", {
392
+ children: [/* @__PURE__ */ x("div", {
272
393
  className: "flex items-center gap-2",
273
394
  children: [
274
- /* @__PURE__ */ S("span", {
395
+ /* @__PURE__ */ b("span", {
275
396
  className: "text-sm font-semibold text-text-primary",
276
397
  children: e.orderNumber
277
398
  }),
278
- /* @__PURE__ */ S(a, {
399
+ /* @__PURE__ */ b(a, {
279
400
  label: e.status,
280
- variant: E(e.status ?? "unknown"),
401
+ variant: w(e.status ?? "unknown"),
281
402
  dot: !0
282
403
  }),
283
- /* @__PURE__ */ S(a, {
404
+ /* @__PURE__ */ b(a, {
284
405
  label: e.paymentStatus,
285
- variant: O(e.paymentStatus)
406
+ variant: E(e.paymentStatus)
286
407
  })
287
408
  ]
288
- }), /* @__PURE__ */ C("div", {
409
+ }), /* @__PURE__ */ x("div", {
289
410
  className: "mt-1 flex items-center gap-3 text-xs text-text-secondary",
290
- children: [/* @__PURE__ */ C("span", {
411
+ children: [/* @__PURE__ */ x("span", {
291
412
  className: "flex items-center gap-1",
292
413
  children: [
293
- /* @__PURE__ */ S(f, { className: "h-3 w-3" }),
414
+ /* @__PURE__ */ b(p, { className: "h-3 w-3" }),
294
415
  " ",
295
416
  n(e.date)
296
417
  ]
297
- }), /* @__PURE__ */ S("span", { children: k("healthybowl.marketplace.orders.itemCount", "{{count}} item(s)", { count: (e.items ?? []).length }) })]
418
+ }), /* @__PURE__ */ b("span", { children: D("healthybowl.marketplace.orders.itemCount", "{{count}} item(s)", { count: (e.items ?? []).length }) })]
298
419
  })]
299
420
  }),
300
- /* @__PURE__ */ S("span", {
421
+ /* @__PURE__ */ b("span", {
301
422
  className: "text-sm font-bold text-text-primary",
302
423
  children: t(e.total)
303
424
  }),
304
- S(r ? m : se, { className: "h-4 w-4 shrink-0 text-text-secondary" })
425
+ b(r ? le : ce, { className: "h-4 w-4 shrink-0 text-text-secondary" })
305
426
  ]
306
- }), r && /* @__PURE__ */ C("div", {
427
+ }), r && /* @__PURE__ */ x("div", {
307
428
  className: "border-t border-border-subtle px-4 pb-4 pt-3",
308
429
  children: [
309
- /* @__PURE__ */ S("h4", {
430
+ /* @__PURE__ */ b("h4", {
310
431
  className: "text-xs font-semibold text-text-secondary uppercase tracking-wide",
311
- children: k("healthybowl.marketplace.orders.details.orderItems", "Order Items")
432
+ children: D("healthybowl.marketplace.orders.details.orderItems", "Order Items")
312
433
  }),
313
- /* @__PURE__ */ S("div", {
434
+ /* @__PURE__ */ b("div", {
314
435
  className: "mt-2 divide-y divide-border rounded-md border border-border-subtle",
315
- children: (e.items ?? []).map((e) => /* @__PURE__ */ C("div", {
436
+ children: (e.items ?? []).map((e) => /* @__PURE__ */ x("div", {
316
437
  className: "flex items-center justify-between px-3 py-2.5",
317
- children: [/* @__PURE__ */ C("div", {
438
+ children: [/* @__PURE__ */ x("div", {
318
439
  className: "flex items-center gap-3",
319
- children: [/* @__PURE__ */ S(_, { className: "h-4 w-4 text-text-secondary" }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
440
+ children: [/* @__PURE__ */ b(_, { className: "h-4 w-4 text-text-secondary" }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
320
441
  className: "text-sm font-medium text-text-primary",
321
442
  children: e.productName
322
- }), /* @__PURE__ */ S("p", {
443
+ }), /* @__PURE__ */ b("p", {
323
444
  className: "text-xs text-text-secondary",
324
445
  children: e.seller
325
446
  })] })]
326
- }), /* @__PURE__ */ C("div", {
447
+ }), /* @__PURE__ */ x("div", {
327
448
  className: "text-right",
328
- children: [/* @__PURE__ */ C("p", {
449
+ children: [/* @__PURE__ */ x("p", {
329
450
  className: "text-sm font-medium text-text-primary",
330
451
  children: [
331
452
  e.quantity,
332
453
  " × ",
333
454
  t(e.price)
334
455
  ]
335
- }), /* @__PURE__ */ S("p", {
456
+ }), /* @__PURE__ */ b("p", {
336
457
  className: "text-xs text-text-secondary",
337
458
  children: t(e.quantity * e.price)
338
459
  })]
339
460
  })]
340
461
  }, e.id))
341
462
  }),
342
- /* @__PURE__ */ C("div", {
463
+ /* @__PURE__ */ x("div", {
343
464
  className: "mt-3 grid gap-4 sm:grid-cols-2",
344
- children: [/* @__PURE__ */ C("div", {
465
+ children: [/* @__PURE__ */ x("div", {
345
466
  className: "space-y-2 text-sm",
346
467
  children: [
347
- /* @__PURE__ */ S("h4", {
468
+ /* @__PURE__ */ b("h4", {
348
469
  className: "text-xs font-semibold text-text-secondary uppercase tracking-wide",
349
- children: k("healthybowl.marketplace.orders.details.paymentDetails", "Payment Details")
470
+ children: D("healthybowl.marketplace.orders.details.paymentDetails", "Payment Details")
350
471
  }),
351
- /* @__PURE__ */ C("div", {
472
+ /* @__PURE__ */ x("div", {
352
473
  className: "flex justify-between",
353
- children: [/* @__PURE__ */ S("span", {
474
+ children: [/* @__PURE__ */ b("span", {
354
475
  className: "text-text-secondary",
355
- children: k("healthybowl.marketplace.orders.details.subtotal", "Subtotal")
356
- }), /* @__PURE__ */ S("span", {
476
+ children: D("healthybowl.marketplace.orders.details.subtotal", "Subtotal")
477
+ }), /* @__PURE__ */ b("span", {
357
478
  className: "text-text-primary",
358
479
  children: t(e.subtotal)
359
480
  })]
360
481
  }),
361
- /* @__PURE__ */ C("div", {
482
+ /* @__PURE__ */ x("div", {
362
483
  className: "flex justify-between",
363
- children: [/* @__PURE__ */ S("span", {
484
+ children: [/* @__PURE__ */ b("span", {
364
485
  className: "text-text-secondary",
365
- children: k("healthybowl.marketplace.orders.details.tax", "Tax")
366
- }), /* @__PURE__ */ S("span", {
486
+ children: D("healthybowl.marketplace.orders.details.tax", "Tax")
487
+ }), /* @__PURE__ */ b("span", {
367
488
  className: "text-text-primary",
368
489
  children: t(e.tax)
369
490
  })]
370
491
  }),
371
- /* @__PURE__ */ C("div", {
492
+ /* @__PURE__ */ x("div", {
372
493
  className: "flex justify-between",
373
- children: [/* @__PURE__ */ S("span", {
494
+ children: [/* @__PURE__ */ b("span", {
374
495
  className: "text-text-secondary",
375
- children: k("healthybowl.marketplace.orders.details.shipping", "Shipping")
376
- }), /* @__PURE__ */ S("span", {
496
+ children: D("healthybowl.marketplace.orders.details.shipping", "Shipping")
497
+ }), /* @__PURE__ */ b("span", {
377
498
  className: "text-text-primary",
378
499
  children: t(e.shipping)
379
500
  })]
380
501
  }),
381
- /* @__PURE__ */ C("div", {
502
+ /* @__PURE__ */ x("div", {
382
503
  className: "flex justify-between border-t border-border-subtle pt-2 font-semibold",
383
- children: [/* @__PURE__ */ S("span", {
504
+ children: [/* @__PURE__ */ b("span", {
384
505
  className: "text-text-primary",
385
- children: k("healthybowl.marketplace.orders.details.total", "Total")
386
- }), /* @__PURE__ */ S("span", {
506
+ children: D("healthybowl.marketplace.orders.details.total", "Total")
507
+ }), /* @__PURE__ */ b("span", {
387
508
  className: "text-text-primary",
388
509
  children: t(e.total)
389
510
  })]
390
- })
511
+ }),
512
+ Ne(e)
391
513
  ]
392
- }), /* @__PURE__ */ C("div", {
514
+ }), /* @__PURE__ */ x("div", {
393
515
  className: "space-y-2 text-sm",
394
516
  children: [
395
- /* @__PURE__ */ S("h4", {
517
+ /* @__PURE__ */ b("h4", {
396
518
  className: "text-xs font-semibold text-text-secondary uppercase tracking-wide",
397
- children: k("healthybowl.marketplace.orders.details.shippingInfo", "Shipping Info")
519
+ children: D("healthybowl.marketplace.orders.details.shippingInfo", "Shipping Info")
398
520
  }),
399
- /* @__PURE__ */ C("div", {
521
+ /* @__PURE__ */ x("div", {
400
522
  className: "flex items-center gap-2 text-text-secondary",
401
- children: [/* @__PURE__ */ S(g, { className: "h-3.5 w-3.5 shrink-0" }), /* @__PURE__ */ S("span", { children: k("healthybowl.marketplace.orders.details.payment", "Payment: {{status}}", { status: e.paymentStatus }) })]
523
+ children: [/* @__PURE__ */ b(g, { className: "h-3.5 w-3.5 shrink-0" }), /* @__PURE__ */ b("span", { children: D("healthybowl.marketplace.orders.details.payment", "Payment: {{status}}", { status: e.paymentStatus }) })]
402
524
  }),
403
- e.deliveryDate && /* @__PURE__ */ C("div", {
525
+ e.deliveryDate && /* @__PURE__ */ x("div", {
404
526
  className: "flex items-center gap-2 text-text-secondary",
405
- children: [/* @__PURE__ */ S(f, { className: "h-3.5 w-3.5 shrink-0" }), /* @__PURE__ */ S("span", { children: k("healthybowl.marketplace.orders.details.delivered", "Delivered: {{date}}", { date: n(e.deliveryDate) }) })]
527
+ children: [/* @__PURE__ */ b(p, { className: "h-3.5 w-3.5 shrink-0" }), /* @__PURE__ */ b("span", { children: D("healthybowl.marketplace.orders.details.delivered", "Delivered: {{date}}", { date: n(e.deliveryDate) }) })]
406
528
  }),
407
- !e.deliveryDate && e.status !== "cancelled" && /* @__PURE__ */ C("div", {
529
+ !e.deliveryDate && e.status !== "cancelled" && /* @__PURE__ */ x("div", {
408
530
  className: "flex items-center gap-2 text-text-secondary",
409
- children: [/* @__PURE__ */ S(v, { className: "h-3.5 w-3.5 shrink-0" }), /* @__PURE__ */ S("span", { children: k("healthybowl.marketplace.orders.details.estDelivery", "Est. delivery: 3-5 business days") })]
531
+ children: [/* @__PURE__ */ b(v, { className: "h-3.5 w-3.5 shrink-0" }), /* @__PURE__ */ b("span", { children: D("healthybowl.marketplace.orders.details.estDelivery", "Est. delivery: 3-5 business days") })]
410
532
  })
411
533
  ]
412
534
  })]
413
535
  }),
414
- /* @__PURE__ */ C("div", {
536
+ /* @__PURE__ */ x("div", {
415
537
  className: "mt-4 flex flex-wrap gap-2",
416
538
  children: [
417
- e.status === "pending" && /* @__PURE__ */ C(w, {
539
+ e.status === "pending" && /* @__PURE__ */ x(S, {
418
540
  variant: "default",
419
541
  size: "sm",
420
- onClick: () => $(e, "confirmed", k("healthybowl.marketplace.orders.toast.confirmed", "Order confirmed")),
421
- disabled: G === e.id,
542
+ onClick: () => $(e, "confirmed", D("healthybowl.marketplace.orders.toast.confirmed", "Order confirmed")),
543
+ disabled: U === e.id,
422
544
  children: [
423
- /* @__PURE__ */ S(p, { className: "h-3.5 w-3.5" }),
545
+ /* @__PURE__ */ b(m, { className: "h-3.5 w-3.5" }),
424
546
  " ",
425
- k("healthybowl.marketplace.orders.actions.confirm", "Confirm")
547
+ D("healthybowl.marketplace.orders.actions.confirm", "Confirm")
426
548
  ]
427
549
  }),
428
- e.status === "confirmed" && /* @__PURE__ */ C(w, {
550
+ e.status === "confirmed" && /* @__PURE__ */ x(S, {
429
551
  variant: "default",
430
552
  size: "sm",
431
- onClick: () => $(e, "shipped", k("healthybowl.marketplace.orders.toast.shipped", "Order marked shipped")),
432
- disabled: G === e.id,
553
+ onClick: () => $(e, "shipped", D("healthybowl.marketplace.orders.toast.shipped", "Order marked shipped")),
554
+ disabled: U === e.id,
433
555
  children: [
434
- /* @__PURE__ */ S(v, { className: "h-3.5 w-3.5" }),
556
+ /* @__PURE__ */ b(v, { className: "h-3.5 w-3.5" }),
435
557
  " ",
436
- k("healthybowl.marketplace.orders.actions.markShipped", "Mark Shipped")
558
+ D("healthybowl.marketplace.orders.actions.markShipped", "Mark Shipped")
437
559
  ]
438
560
  }),
439
- e.status === "shipped" && /* @__PURE__ */ C(w, {
561
+ e.status === "shipped" && /* @__PURE__ */ x(S, {
440
562
  variant: "secondary",
441
563
  size: "sm",
442
- onClick: () => $(e, "delivered", k("healthybowl.marketplace.orders.toast.delivered", "Order marked delivered")),
443
- disabled: G === e.id,
564
+ onClick: () => $(e, "delivered", D("healthybowl.marketplace.orders.toast.delivered", "Order marked delivered")),
565
+ disabled: U === e.id,
444
566
  className: "bg-success-subtle text-success hover:bg-success-subtle/80",
445
567
  children: [
446
- /* @__PURE__ */ S(p, { className: "h-3.5 w-3.5" }),
568
+ /* @__PURE__ */ b(m, { className: "h-3.5 w-3.5" }),
569
+ " ",
570
+ D("healthybowl.marketplace.orders.actions.markDelivered", "Mark Delivered")
571
+ ]
572
+ }),
573
+ e.paymentStatus === "pending" && e.status !== "cancelled" && /* @__PURE__ */ x(S, {
574
+ variant: "default",
575
+ size: "sm",
576
+ onClick: () => void Ae(e),
577
+ disabled: G === e.id || U === e.id,
578
+ children: [
579
+ /* @__PURE__ */ b(me, { className: "h-3.5 w-3.5" }),
447
580
  " ",
448
- k("healthybowl.marketplace.orders.actions.markDelivered", "Mark Delivered")
581
+ G === e.id ? D("healthybowl.marketplace.orders.actions.paying", "Opening checkout...") : D("healthybowl.marketplace.orders.actions.payNow", "Pay Now")
449
582
  ]
450
583
  }),
451
- e.paymentStatus === "pending" && e.status !== "cancelled" && /* @__PURE__ */ C(w, {
584
+ e.paymentStatus === "pending" && e.status !== "cancelled" && /* @__PURE__ */ x(S, {
452
585
  variant: "outline",
453
586
  size: "sm",
454
- onClick: () => ye(e),
455
- disabled: G === e.id,
587
+ onClick: () => je(e),
588
+ disabled: U === e.id || G === e.id,
456
589
  children: [
457
- /* @__PURE__ */ S(g, { className: "h-3.5 w-3.5" }),
590
+ /* @__PURE__ */ b(g, { className: "h-3.5 w-3.5" }),
458
591
  " ",
459
- k("healthybowl.marketplace.orders.actions.markPaid", "Mark Paid")
592
+ D("healthybowl.marketplace.orders.actions.markPaidOffline", "Mark Paid (Offline)")
460
593
  ]
461
594
  }),
462
- (e.status === "shipped" || e.status === "confirmed") && /* @__PURE__ */ C(w, {
595
+ (e.status === "shipped" || e.status === "confirmed") && /* @__PURE__ */ x(S, {
463
596
  variant: "outline",
464
597
  size: "sm",
465
- onClick: () => ve(e),
598
+ onClick: () => Q(e),
466
599
  children: [
467
- /* @__PURE__ */ S(v, { className: "h-3.5 w-3.5" }),
600
+ /* @__PURE__ */ b(v, { className: "h-3.5 w-3.5" }),
468
601
  " ",
469
- k("healthybowl.marketplace.orders.actions.trackOrder", "Track Order")
602
+ D("healthybowl.marketplace.orders.actions.trackOrder", "Track Order")
470
603
  ]
471
604
  }),
472
- /* @__PURE__ */ C(w, {
605
+ /* @__PURE__ */ x(S, {
473
606
  variant: "outline",
474
607
  size: "sm",
475
- onClick: () => xe(e),
608
+ onClick: () => Pe(e),
476
609
  children: [
477
- /* @__PURE__ */ S(le, { className: "h-3.5 w-3.5" }),
610
+ /* @__PURE__ */ b(fe, { className: "h-3.5 w-3.5" }),
478
611
  " ",
479
- k("healthybowl.marketplace.orders.actions.reorder", "Reorder")
612
+ D("healthybowl.marketplace.orders.actions.reorder", "Reorder")
480
613
  ]
481
614
  }),
482
- (e.status === "pending" || e.status === "confirmed") && /* @__PURE__ */ C(w, {
615
+ (e.status === "pending" || e.status === "confirmed") && /* @__PURE__ */ x(S, {
483
616
  variant: "outline",
484
617
  size: "sm",
485
- onClick: () => be(e),
486
- disabled: G === e.id,
618
+ onClick: () => Me(e),
619
+ disabled: U === e.id,
487
620
  className: "text-text-secondary hover:border-status-error-border hover:text-status-error-text",
488
621
  children: [
489
- /* @__PURE__ */ S(b, { className: "h-3.5 w-3.5" }),
622
+ /* @__PURE__ */ b(y, { className: "h-3.5 w-3.5" }),
490
623
  " ",
491
- k("healthybowl.common.cancel", "Cancel")
624
+ D("healthybowl.common.cancel", "Cancel")
492
625
  ]
493
626
  })
494
627
  ]
@@ -497,138 +630,138 @@ var T = [
497
630
  })]
498
631
  }, e.id);
499
632
  })
500
- }) : N.marketplace ? /* @__PURE__ */ S(l, {}) : M.marketplace ? /* @__PURE__ */ S(te, { onRetry: F }) : /* @__PURE__ */ S(ee, {
633
+ }) : j.marketplace ? /* @__PURE__ */ b(ne, {}) : A.marketplace ? /* @__PURE__ */ b(s, { onRetry: N }) : /* @__PURE__ */ b(o, {
501
634
  illustration: "empty-files",
502
- title: L || z !== "All" ? k("healthybowl.marketplace.orders.emptyState.noResults.title", "No orders found") : k("healthybowl.marketplace.orders.emptyState.noOrders.title", "No orders yet"),
503
- description: L || z !== "All" ? k("healthybowl.marketplace.orders.emptyState.noResults.description", "Try adjusting your search or filter.") : k("healthybowl.marketplace.orders.emptyState.noOrders.description", "You have no orders yet. Orders shown here come only from real backend data."),
504
- action: L || z !== "All" ? /* @__PURE__ */ S(w, {
635
+ title: L || z !== "All" ? D("healthybowl.marketplace.orders.emptyState.noResults.title", "No orders found") : D("healthybowl.marketplace.orders.emptyState.noOrders.title", "No orders yet"),
636
+ description: L || z !== "All" ? D("healthybowl.marketplace.orders.emptyState.noResults.description", "Try adjusting your search or filter.") : D("healthybowl.marketplace.orders.emptyState.noOrders.description", "You have no orders yet. Orders shown here come only from real backend data."),
637
+ action: L || z !== "All" ? /* @__PURE__ */ b(S, {
505
638
  variant: "default",
506
639
  onClick: () => {
507
640
  R(""), B("All");
508
641
  },
509
- children: k("healthybowl.marketplace.orders.emptyState.clearFilters", "Clear Filters")
642
+ children: D("healthybowl.marketplace.orders.emptyState.clearFilters", "Clear Filters")
510
643
  }) : void 0
511
644
  }),
512
- /* @__PURE__ */ S(u, {
513
- open: U !== null,
514
- onClose: () => W(null),
515
- title: k("healthybowl.marketplace.orders.tracking.title", "Order Tracking"),
516
- description: U ? k("healthybowl.marketplace.orders.tracking.subtitle", "Tracking {{orderNumber}}", { orderNumber: U.orderNumber }) : "",
645
+ /* @__PURE__ */ b(re, {
646
+ open: V !== null,
647
+ onClose: () => H(null),
648
+ title: D("healthybowl.marketplace.orders.tracking.title", "Order Tracking"),
649
+ description: V ? D("healthybowl.marketplace.orders.tracking.subtitle", "Tracking {{orderNumber}}", { orderNumber: V.orderNumber }) : "",
517
650
  size: "md",
518
- footer: /* @__PURE__ */ S(w, {
651
+ footer: /* @__PURE__ */ b(S, {
519
652
  variant: "outline",
520
- onClick: () => W(null),
521
- children: k("healthybowl.common.close", "Close")
653
+ onClick: () => H(null),
654
+ children: D("healthybowl.common.close", "Close")
522
655
  }),
523
- children: U && /* @__PURE__ */ C("div", {
656
+ children: V && /* @__PURE__ */ x("div", {
524
657
  className: "space-y-4",
525
658
  children: [
526
- /* @__PURE__ */ C("div", {
659
+ /* @__PURE__ */ x("div", {
527
660
  className: "flex items-center gap-3",
528
- children: [/* @__PURE__ */ S(v, { className: "h-6 w-6 text-primary" }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
661
+ children: [/* @__PURE__ */ b(v, { className: "h-6 w-6 text-primary" }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
529
662
  className: "text-sm font-medium text-text-primary",
530
- children: k("healthybowl.marketplace.orders.tracking.status", "Status: {{status}}", { status: U.status })
531
- }), /* @__PURE__ */ S("p", {
663
+ children: D("healthybowl.marketplace.orders.tracking.status", "Status: {{status}}", { status: V.status })
664
+ }), /* @__PURE__ */ b("p", {
532
665
  className: "text-xs text-text-secondary",
533
- children: k("healthybowl.marketplace.orders.tracking.orderPlacedDate", "Order placed: {{date}}", { date: n(U.date) })
666
+ children: D("healthybowl.marketplace.orders.tracking.orderPlacedDate", "Order placed: {{date}}", { date: n(V.date) })
534
667
  })] })]
535
668
  }),
536
- /* @__PURE__ */ C("div", {
669
+ /* @__PURE__ */ x("div", {
537
670
  className: "space-y-3 border-l-2 border-primary/30 pl-4",
538
671
  children: [
539
- /* @__PURE__ */ C("div", {
672
+ /* @__PURE__ */ x("div", {
540
673
  className: "relative",
541
674
  children: [
542
- /* @__PURE__ */ S("div", { className: "absolute -left-[21px] top-1 h-3 w-3 rounded-full bg-action-primary-bg" }),
543
- /* @__PURE__ */ S("p", {
675
+ /* @__PURE__ */ b("div", { className: "absolute -left-[21px] top-1 h-3 w-3 rounded-full bg-action-primary-bg" }),
676
+ /* @__PURE__ */ b("p", {
544
677
  className: "text-sm font-medium text-text-primary",
545
- children: k("healthybowl.marketplace.orders.tracking.steps.placed.label", "Order Placed")
678
+ children: D("healthybowl.marketplace.orders.tracking.steps.placed.label", "Order Placed")
546
679
  }),
547
- /* @__PURE__ */ S("p", {
680
+ /* @__PURE__ */ b("p", {
548
681
  className: "text-xs text-text-secondary",
549
- children: n(U.date)
682
+ children: n(V.date)
550
683
  })
551
684
  ]
552
685
  }),
553
- U.status !== "pending" && /* @__PURE__ */ C("div", {
686
+ V.status !== "pending" && /* @__PURE__ */ x("div", {
554
687
  className: "relative",
555
688
  children: [
556
- /* @__PURE__ */ S("div", { className: "absolute -left-[21px] top-1 h-3 w-3 rounded-full bg-action-primary-bg" }),
557
- /* @__PURE__ */ S("p", {
689
+ /* @__PURE__ */ b("div", { className: "absolute -left-[21px] top-1 h-3 w-3 rounded-full bg-action-primary-bg" }),
690
+ /* @__PURE__ */ b("p", {
558
691
  className: "text-sm font-medium text-text-primary",
559
- children: k("healthybowl.marketplace.orders.tracking.steps.confirmed.label", "Confirmed")
692
+ children: D("healthybowl.marketplace.orders.tracking.steps.confirmed.label", "Confirmed")
560
693
  }),
561
- /* @__PURE__ */ S("p", {
694
+ /* @__PURE__ */ b("p", {
562
695
  className: "text-xs text-text-secondary",
563
- children: k("healthybowl.marketplace.orders.tracking.steps.confirmed.detail", "Order confirmed by seller")
696
+ children: D("healthybowl.marketplace.orders.tracking.steps.confirmed.detail", "Order confirmed by seller")
564
697
  })
565
698
  ]
566
699
  }),
567
- (U.status === "shipped" || U.status === "delivered") && /* @__PURE__ */ C("div", {
700
+ (V.status === "shipped" || V.status === "delivered") && /* @__PURE__ */ x("div", {
568
701
  className: "relative",
569
702
  children: [
570
- /* @__PURE__ */ S("div", { className: "absolute -left-[21px] top-1 h-3 w-3 rounded-full bg-action-primary-bg" }),
571
- /* @__PURE__ */ S("p", {
703
+ /* @__PURE__ */ b("div", { className: "absolute -left-[21px] top-1 h-3 w-3 rounded-full bg-action-primary-bg" }),
704
+ /* @__PURE__ */ b("p", {
572
705
  className: "text-sm font-medium text-text-primary",
573
- children: k("healthybowl.marketplace.orders.tracking.steps.shipped.label", "Shipped")
706
+ children: D("healthybowl.marketplace.orders.tracking.steps.shipped.label", "Shipped")
574
707
  }),
575
- /* @__PURE__ */ S("p", {
708
+ /* @__PURE__ */ b("p", {
576
709
  className: "text-xs text-text-secondary",
577
- children: k("healthybowl.marketplace.orders.tracking.steps.shipped.detail", "Package is on its way")
710
+ children: D("healthybowl.marketplace.orders.tracking.steps.shipped.detail", "Package is on its way")
578
711
  })
579
712
  ]
580
713
  }),
581
- U.status === "delivered" && /* @__PURE__ */ C("div", {
714
+ V.status === "delivered" && /* @__PURE__ */ x("div", {
582
715
  className: "relative",
583
716
  children: [
584
- /* @__PURE__ */ S("div", { className: "absolute -left-[21px] top-1 h-3 w-3 rounded-full bg-success" }),
585
- /* @__PURE__ */ S("p", {
717
+ /* @__PURE__ */ b("div", { className: "absolute -left-[21px] top-1 h-3 w-3 rounded-full bg-success" }),
718
+ /* @__PURE__ */ b("p", {
586
719
  className: "text-sm font-medium text-text-primary",
587
- children: k("healthybowl.marketplace.orders.tracking.steps.delivered.label", "Delivered")
720
+ children: D("healthybowl.marketplace.orders.tracking.steps.delivered.label", "Delivered")
588
721
  }),
589
- /* @__PURE__ */ S("p", {
722
+ /* @__PURE__ */ b("p", {
590
723
  className: "text-xs text-text-secondary",
591
- children: U.deliveryDate ? n(U.deliveryDate) : k("healthybowl.marketplace.orders.tracking.steps.delivered.label", "Delivered")
724
+ children: V.deliveryDate ? n(V.deliveryDate) : D("healthybowl.marketplace.orders.tracking.steps.delivered.label", "Delivered")
592
725
  })
593
726
  ]
594
727
  }),
595
- U.status !== "delivered" && U.status !== "cancelled" && /* @__PURE__ */ C("div", {
728
+ V.status !== "delivered" && V.status !== "cancelled" && /* @__PURE__ */ x("div", {
596
729
  className: "relative",
597
730
  children: [
598
- /* @__PURE__ */ S("div", { className: "absolute -left-[21px] top-1 h-3 w-3 rounded-full border-2 border-muted-foreground bg-bg-surface" }),
599
- /* @__PURE__ */ S("p", {
731
+ /* @__PURE__ */ b("div", { className: "absolute -left-[21px] top-1 h-3 w-3 rounded-full border-2 border-muted-foreground bg-bg-surface" }),
732
+ /* @__PURE__ */ b("p", {
600
733
  className: "text-sm text-text-secondary",
601
- children: k("healthybowl.marketplace.orders.tracking.steps.estimated.label", "Estimated Delivery")
734
+ children: D("healthybowl.marketplace.orders.tracking.steps.estimated.label", "Estimated Delivery")
602
735
  }),
603
- /* @__PURE__ */ S("p", {
736
+ /* @__PURE__ */ b("p", {
604
737
  className: "text-xs text-text-secondary",
605
- children: k("healthybowl.marketplace.orders.tracking.steps.estimated.detail", "3-5 business days")
738
+ children: D("healthybowl.marketplace.orders.tracking.steps.estimated.detail", "3-5 business days")
606
739
  })
607
740
  ]
608
741
  })
609
742
  ]
610
743
  }),
611
- /* @__PURE__ */ C("div", {
744
+ /* @__PURE__ */ x("div", {
612
745
  className: "rounded-lg border border-border-subtle p-3",
613
- children: [/* @__PURE__ */ S("p", {
746
+ children: [/* @__PURE__ */ b("p", {
614
747
  className: "text-sm font-medium text-text-primary",
615
- children: k("healthybowl.marketplace.orders.tracking.total", "Total: {{total}}", { total: t(U.total) })
616
- }), /* @__PURE__ */ S("p", {
748
+ children: D("healthybowl.marketplace.orders.tracking.total", "Total: {{total}}", { total: t(V.total) })
749
+ }), /* @__PURE__ */ b("p", {
617
750
  className: "text-xs text-text-secondary",
618
- children: k("healthybowl.marketplace.orders.itemCount", "{{count}} item(s)", { count: (U.items ?? []).length })
751
+ children: D("healthybowl.marketplace.orders.itemCount", "{{count}} item(s)", { count: (V.items ?? []).length })
619
752
  })]
620
753
  })
621
754
  ]
622
755
  })
623
756
  }),
624
- /* @__PURE__ */ S(o, {
625
- toasts: fe,
626
- onDismiss: pe
757
+ /* @__PURE__ */ b(c, {
758
+ toasts: Se,
759
+ onDismiss: Ce
627
760
  })
628
761
  ]
629
762
  });
630
763
  };
631
764
  //#endregion
632
- export { k as OrdersPage };
765
+ export { D as OrdersPage };
633
766
 
634
767
  //# sourceMappingURL=OrdersPage.js.map