@burdenoff/microfe-healthybowl 2026.810.5 → 2026.810.6

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.
@@ -12,12 +12,12 @@ import "../../components/index.js";
12
12
  import { useAuctions as d } from "../../hooks/useAuctions.js";
13
13
  import { useCallback as f, useEffect as p, useMemo as m, useState as h } from "react";
14
14
  import { useI18n as g } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
15
- import { ChevronDown as _, ChevronUp as v, Clock as y, Flame as ee, Gavel as b, Leaf as te, Package as ne, Play as re, Plus as x, Tag as ie, TrendingUp as ae, X as oe } from "lucide-react";
16
- import { Fragment as se, jsx as S, jsxs as C } from "react/jsx-runtime";
17
- import { Button as w } from "@burdenoff/fe-libs/ui";
15
+ import { ChevronDown as _, ChevronUp as v, Clock as y, Flame as b, Gavel as x, Info as ee, Leaf as te, Lock as ne, Package as re, Play as ie, Plus as S, Tag as ae, TrendingUp as oe, X as se } from "lucide-react";
16
+ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
17
+ import { Button as E } from "@burdenoff/fe-libs/ui";
18
18
  //#region src/healthybowl/pages/marketplace/AuctionsView.tsx
19
- var T = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]";
20
- function E(e = 24) {
19
+ var D = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]";
20
+ function O(e = 24) {
21
21
  let t = new Date(Date.now() + e * 36e5), n = (e) => String(e).padStart(2, "0");
22
22
  return `${t.getFullYear()}-${n(t.getMonth() + 1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`;
23
23
  }
@@ -27,50 +27,50 @@ var ce = ({ endTime: t, status: n, t: r }) => {
27
27
  if (c || s) return;
28
28
  let e = window.setInterval(() => a(Date.now()), 1e3);
29
29
  return () => window.clearInterval(e);
30
- }, [c, s]), c) return /* @__PURE__ */ C("span", {
30
+ }, [c, s]), c) return /* @__PURE__ */ T("span", {
31
31
  className: "inline-flex items-center gap-1 text-xs font-medium text-text-secondary",
32
- children: [/* @__PURE__ */ S(y, { className: "h-3.5 w-3.5" }), n === "cancelled" ? r("healthybowl.marketplace.auctions.cancelled", "Cancelled") : r("healthybowl.marketplace.auctions.closed", "Closed")]
32
+ children: [/* @__PURE__ */ w(y, { className: "h-3.5 w-3.5" }), n === "cancelled" ? r("healthybowl.marketplace.auctions.cancelled", "Cancelled") : r("healthybowl.marketplace.auctions.closed", "Closed")]
33
33
  });
34
- if (s) return /* @__PURE__ */ C("span", {
34
+ if (s) return /* @__PURE__ */ T("span", {
35
35
  className: "inline-flex items-center gap-1 text-xs font-semibold text-status-warning-text",
36
- children: [/* @__PURE__ */ S(y, { className: "h-3.5 w-3.5" }), r("healthybowl.marketplace.auctions.ended", "Ended — awaiting close")]
36
+ children: [/* @__PURE__ */ w(y, { className: "h-3.5 w-3.5" }), r("healthybowl.marketplace.auctions.ended", "Ended — awaiting close")]
37
37
  });
38
- let l = Math.max(0, o - i), u = Math.floor(l / 1e3), d = Math.floor(u / 86400), f = Math.floor(u % 86400 / 3600), g = Math.floor(u % 3600 / 60), _ = u % 60, v = (e) => String(e).padStart(2, "0"), ee = d > 0 ? `${d}d ${v(f)}:${v(g)}:${v(_)}` : `${v(f)}:${v(g)}:${v(_)}`;
39
- return /* @__PURE__ */ C("span", {
38
+ let l = Math.max(0, o - i), u = Math.floor(l / 1e3), d = Math.floor(u / 86400), f = Math.floor(u % 86400 / 3600), g = Math.floor(u % 3600 / 60), _ = u % 60, v = (e) => String(e).padStart(2, "0"), b = d > 0 ? `${d}d ${v(f)}:${v(g)}:${v(_)}` : `${v(f)}:${v(g)}:${v(_)}`;
39
+ return /* @__PURE__ */ T("span", {
40
40
  className: e("inline-flex items-center gap-1 font-mono text-xs font-semibold tabular-nums", l < 36e5 ? "text-status-error-text" : "text-text-primary"),
41
- children: [/* @__PURE__ */ S(y, { className: "h-3.5 w-3.5" }), ee]
41
+ children: [/* @__PURE__ */ w(y, { className: "h-3.5 w-3.5" }), b]
42
42
  });
43
- }, D = () => ({
43
+ }, k = () => ({
44
44
  marketplaceProductId: "",
45
45
  startingPrice: "",
46
46
  reservePrice: "",
47
47
  bidIncrement: "1",
48
- endTime: E(24),
48
+ endTime: O(24),
49
49
  startLive: !0
50
- }), O = ({ products: e }) => {
51
- let { t: y } = g(), E = f((e, t, n) => {
50
+ }), le = ({ products: e }) => {
51
+ let { t: y } = g(), O = f((e, t, n) => {
52
52
  let r = y(e, t, n);
53
53
  return r === e ? t : r;
54
- }, [y]), O = s(), { toasts: le, toast: k, dismiss: ue } = u(), { auctions: A, loading: de, error: fe, refetch: pe, createAuction: me, setAuctionStatus: he, placeBid: ge, closeAuction: _e, fetchBids: j } = d(), M = m(() => new Map(e.map((e) => [e.id, e])), [e]), N = f((e) => M.get(e)?.name ?? E("healthybowl.marketplace.auctions.unknownProduct", "Product"), [M, E]), [P, F] = h({}), [ve, ye] = h(/* @__PURE__ */ new Set()), I = f(async (e) => {
54
+ }, [y]), le = s(), { toasts: ue, toast: A, dismiss: de } = u(), { auctions: j, loading: fe, error: pe, refetch: me, createAuction: he, setAuctionStatus: ge, placeBid: _e, closeAuction: ve, fetchBids: M } = d(), N = m(() => new Map(e.map((e) => [e.id, e])), [e]), P = f((e) => N.get(e)?.name ?? O("healthybowl.marketplace.auctions.unknownProduct", "Product"), [N, O]), [F, I] = h({}), [ye, be] = h(/* @__PURE__ */ new Set()), L = f(async (e) => {
55
55
  try {
56
- let t = await j(e);
57
- F((n) => ({
56
+ let t = await M(e);
57
+ I((n) => ({
58
58
  ...n,
59
59
  [e]: t
60
60
  }));
61
61
  } catch {}
62
- }, [j]);
62
+ }, [M]);
63
63
  p(() => {
64
64
  let e = !1;
65
65
  return (async () => {
66
- let t = await Promise.all(A.map(async (e) => {
66
+ let t = await Promise.all(j.map(async (e) => {
67
67
  try {
68
- return [e.id, await j(e.id)];
68
+ return [e.id, await M(e.id)];
69
69
  } catch {
70
70
  return [e.id, []];
71
71
  }
72
72
  }));
73
- e || F((e) => {
73
+ e || I((e) => {
74
74
  let n = { ...e };
75
75
  for (let [e, r] of t) n[e] = r;
76
76
  return n;
@@ -78,318 +78,334 @@ var ce = ({ endTime: t, status: n, t: r }) => {
78
78
  })(), () => {
79
79
  e = !0;
80
80
  };
81
- }, [A.map((e) => e.id).join(","), j]);
82
- let L = f((e) => {
83
- let t = (P[e.id] ?? []).reduce((e, t) => Math.max(e, t.amount), 0);
81
+ }, [j.map((e) => e.id).join(","), M]);
82
+ let R = f((e) => {
83
+ let t = (F[e.id] ?? []).reduce((e, t) => Math.max(e, t.amount), 0);
84
84
  return Math.max(t, e.startingPrice);
85
- }, [P]), R = f((e) => {
86
- let t = (P[e.id] ?? []).reduce((e, t) => Math.max(e, t.amount), 0);
85
+ }, [F]), z = f((e) => {
86
+ let t = (F[e.id] ?? []).reduce((e, t) => Math.max(e, t.amount), 0);
87
87
  return t > 0 ? t + e.bidIncrement : e.startingPrice;
88
- }, [P]), z = m(() => A.filter((e) => e.status === "live"), [A]), be = m(() => {
88
+ }, [F]), B = m(() => j.filter((e) => e.status === "live"), [j]), xe = m(() => {
89
89
  let e = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
90
- return Object.values(P).flat().filter((t) => (t.createdAt ?? "").slice(0, 10) === e).length;
91
- }, [P]), B = m(() => z.reduce((e, t) => Math.max(e, L(t)), 0), [z, L]), [V, H] = h(null), [U, W] = h(""), [G, K] = h(!1), xe = (e) => {
92
- H(e), W(String(R(e)));
90
+ return Object.values(F).flat().filter((t) => (t.createdAt ?? "").slice(0, 10) === e).length;
91
+ }, [F]), V = m(() => B.reduce((e, t) => Math.max(e, R(t)), 0), [B, R]), [H, U] = h(null), [W, G] = h(""), [K, Se] = h(!1), Ce = (e) => {
92
+ U(e), G(String(z(e)));
93
93
  }, q = () => {
94
- H(null), W("");
95
- }, Se = async () => {
96
- if (!V) return;
97
- let e = Number(U);
94
+ U(null), G("");
95
+ }, we = async () => {
96
+ if (!H) return;
97
+ let e = Number(W);
98
98
  if (!Number.isFinite(e) || e <= 0) {
99
- k({
100
- title: E("healthybowl.marketplace.auctions.bid.invalid.title", "Enter a valid amount"),
99
+ A({
100
+ title: O("healthybowl.marketplace.auctions.bid.invalid.title", "Enter a valid amount"),
101
101
  variant: "warning"
102
102
  });
103
103
  return;
104
104
  }
105
- K(!0);
105
+ Se(!0);
106
106
  try {
107
- await ge(V.id, e), await I(V.id), k({
108
- title: E("healthybowl.marketplace.auctions.bid.success.title", "Bid placed"),
109
- description: E("healthybowl.marketplace.auctions.bid.success.description", "Your bid of {{amount}} is in.", { amount: t(e, "INR") }),
107
+ await _e(H.id, e), await L(H.id), A({
108
+ title: O("healthybowl.marketplace.auctions.bid.success.title", "Bid placed"),
109
+ description: O("healthybowl.marketplace.auctions.bid.success.description", "Your bid of {{amount}} is in.", { amount: t(e, "INR") }),
110
110
  variant: "success"
111
111
  }), q();
112
112
  } catch (e) {
113
- k({
114
- title: E("healthybowl.marketplace.auctions.bid.error.title", "Could not place bid"),
113
+ A({
114
+ title: O("healthybowl.marketplace.auctions.bid.error.title", "Could not place bid"),
115
115
  description: e instanceof Error ? e.message : String(e),
116
116
  variant: "error"
117
117
  });
118
118
  } finally {
119
- K(!1);
119
+ Se(!1);
120
120
  }
121
- }, [Ce, J] = h(!1), [Y, X] = h(D), [Z, we] = h(!1), Q = (e, t) => X((n) => ({
121
+ }, [Te, Ee] = h(!1), [J, Y] = h(k), [X, De] = h(!1), Z = (e, t) => Y((n) => ({
122
122
  ...n,
123
123
  [e]: t
124
- })), Te = () => {
125
- X({
126
- ...D(),
124
+ })), Q = () => {
125
+ Y({
126
+ ...k(),
127
127
  marketplaceProductId: e[0]?.id ?? ""
128
- }), J(!0);
128
+ }), Ee(!0);
129
129
  }, $ = () => {
130
- J(!1), X(D());
131
- }, Ee = async () => {
132
- let e = Number(Y.startingPrice);
133
- if (!Y.marketplaceProductId || !Y.startingPrice || !Y.endTime) {
134
- k({
135
- title: E("healthybowl.marketplace.auctions.create.required.title", "Missing required fields"),
136
- description: E("healthybowl.marketplace.auctions.create.required.description", "Product, starting price and end time are required."),
130
+ Ee(!1), Y(k());
131
+ }, Oe = async () => {
132
+ let e = Number(J.startingPrice);
133
+ if (!J.marketplaceProductId || !J.startingPrice || !J.endTime) {
134
+ A({
135
+ title: O("healthybowl.marketplace.auctions.create.required.title", "Missing required fields"),
136
+ description: O("healthybowl.marketplace.auctions.create.required.description", "Product, starting price and end time are required."),
137
137
  variant: "warning"
138
138
  });
139
139
  return;
140
140
  }
141
141
  if (!Number.isFinite(e) || e < 0) {
142
- k({
143
- title: E("healthybowl.marketplace.auctions.create.invalid.title", "Invalid starting price"),
142
+ A({
143
+ title: O("healthybowl.marketplace.auctions.create.invalid.title", "Invalid starting price"),
144
144
  variant: "warning"
145
145
  });
146
146
  return;
147
147
  }
148
- let t = new Date(Y.endTime).getTime();
148
+ let t = new Date(J.endTime).getTime();
149
149
  if (Number.isNaN(t) || t <= Date.now()) {
150
- k({
151
- title: E("healthybowl.marketplace.auctions.create.endPast.title", "End time must be in the future"),
150
+ A({
151
+ title: O("healthybowl.marketplace.auctions.create.endPast.title", "End time must be in the future"),
152
152
  variant: "warning"
153
153
  });
154
154
  return;
155
155
  }
156
- let n = Y.reservePrice.trim() ? Number(Y.reservePrice) : void 0, r = Y.bidIncrement.trim() ? Number(Y.bidIncrement) : void 0;
157
- we(!0);
156
+ let n = J.reservePrice.trim() ? Number(J.reservePrice) : void 0, r = J.bidIncrement.trim() ? Number(J.bidIncrement) : void 0;
157
+ De(!0);
158
158
  try {
159
- await me({
160
- marketplaceProductId: Y.marketplaceProductId,
159
+ await he({
160
+ marketplaceProductId: J.marketplaceProductId,
161
161
  startingPrice: e,
162
162
  reservePrice: Number.isFinite(n) ? n : void 0,
163
163
  bidIncrement: Number.isFinite(r) ? r : void 0,
164
- endTime: new Date(Y.endTime).toISOString(),
165
- status: Y.startLive ? "live" : "draft"
166
- }), k({
167
- title: E("healthybowl.marketplace.auctions.create.success.title", "Auction created"),
168
- description: Y.startLive ? E("healthybowl.marketplace.auctions.create.successLive", "{{name}} is now live for bidding.", { name: N(Y.marketplaceProductId) }) : E("healthybowl.marketplace.auctions.create.successDraft", "{{name}} saved as a draft.", { name: N(Y.marketplaceProductId) }),
164
+ endTime: new Date(J.endTime).toISOString(),
165
+ status: J.startLive ? "live" : "draft"
166
+ }), A({
167
+ title: O("healthybowl.marketplace.auctions.create.success.title", "Auction created"),
168
+ description: J.startLive ? O("healthybowl.marketplace.auctions.create.successLive", "{{name}} is now live for bidding.", { name: P(J.marketplaceProductId) }) : O("healthybowl.marketplace.auctions.create.successDraft", "{{name}} saved as a draft.", { name: P(J.marketplaceProductId) }),
169
169
  variant: "success"
170
170
  }), $();
171
171
  } catch (e) {
172
- k({
173
- title: E("healthybowl.marketplace.auctions.create.error.title", "Could not create auction"),
172
+ A({
173
+ title: O("healthybowl.marketplace.auctions.create.error.title", "Could not create auction"),
174
174
  description: e instanceof Error ? e.message : String(e),
175
175
  variant: "error"
176
176
  });
177
177
  } finally {
178
- we(!1);
178
+ De(!1);
179
179
  }
180
- }, De = async (e) => {
180
+ }, ke = async (e) => {
181
181
  try {
182
- await he(e.id, "live"), k({
183
- title: E("healthybowl.marketplace.auctions.goLive.success", "Auction is now live"),
182
+ await ge(e.id, "live"), A({
183
+ title: O("healthybowl.marketplace.auctions.goLive.success", "Auction is now live"),
184
184
  variant: "success"
185
185
  });
186
186
  } catch (e) {
187
- k({
188
- title: E("healthybowl.marketplace.auctions.action.error", "Action failed"),
187
+ A({
188
+ title: O("healthybowl.marketplace.auctions.action.error", "Action failed"),
189
189
  description: e instanceof Error ? e.message : String(e),
190
190
  variant: "error"
191
191
  });
192
192
  }
193
- }, Oe = async (e) => {
194
- if (await O({
195
- title: E("healthybowl.marketplace.auctions.close.confirm.title", "Close this auction?"),
196
- message: E("healthybowl.marketplace.auctions.close.confirm.message", "The top qualifying bid on {{name}} wins and a pending order is created. This cannot be undone.", { name: N(e.marketplaceProductId) }),
197
- okButtonTitle: E("healthybowl.marketplace.auctions.close.confirm.ok", "Close Auction"),
198
- cancelButtonTitle: E("healthybowl.common.cancel", "Cancel")
193
+ }, Ae = async (e) => {
194
+ if (await le({
195
+ title: O("healthybowl.marketplace.auctions.close.confirm.title", "Close this auction?"),
196
+ message: O("healthybowl.marketplace.auctions.close.confirm.message", "The top qualifying bid on {{name}} wins and a pending order is created. This cannot be undone.", { name: P(e.marketplaceProductId) }),
197
+ okButtonTitle: O("healthybowl.marketplace.auctions.close.confirm.ok", "Close Auction"),
198
+ cancelButtonTitle: O("healthybowl.common.cancel", "Cancel")
199
199
  })) try {
200
- await _e(e.id), k({
201
- title: E("healthybowl.marketplace.auctions.close.success", "Auction closed"),
200
+ await ve(e.id), A({
201
+ title: O("healthybowl.marketplace.auctions.close.success", "Auction closed"),
202
202
  variant: "success"
203
203
  });
204
204
  } catch (e) {
205
- k({
206
- title: E("healthybowl.marketplace.auctions.action.error", "Action failed"),
205
+ A({
206
+ title: O("healthybowl.marketplace.auctions.action.error", "Action failed"),
207
207
  description: e instanceof Error ? e.message : String(e),
208
208
  variant: "error"
209
209
  });
210
210
  }
211
- }, ke = (e) => {
212
- ye((t) => {
211
+ }, je = (e) => {
212
+ be((t) => {
213
213
  let n = new Set(t);
214
- return n.has(e) ? n.delete(e) : (n.add(e), I(e)), n;
214
+ return n.has(e) ? n.delete(e) : (n.add(e), L(e)), n;
215
215
  });
216
- }, Ae = (e) => {
216
+ }, Me = (e) => {
217
217
  switch (e) {
218
218
  case "live": return "success";
219
219
  case "draft": return "warning";
220
220
  case "cancelled": return "error";
221
221
  default: return "muted";
222
222
  }
223
- }, je = (e) => E(`healthybowl.marketplace.auctions.status.${e}`, e.charAt(0).toUpperCase() + e.slice(1)), Me = (e) => {
223
+ }, Ne = (e) => O(`healthybowl.marketplace.auctions.status.${e}`, e.charAt(0).toUpperCase() + e.slice(1)), Pe = (e) => {
224
224
  let t = new Date(e.endTime).getTime();
225
225
  return !Number.isNaN(t) && Date.now() >= t;
226
226
  };
227
- return de && A.length === 0 ? /* @__PURE__ */ S(c, {}) : fe && A.length === 0 ? /* @__PURE__ */ S(a, { onRetry: () => void pe() }) : /* @__PURE__ */ C("div", {
227
+ return fe && j.length === 0 ? /* @__PURE__ */ w(c, {}) : pe && j.length === 0 ? /* @__PURE__ */ w(a, { onRetry: () => void me() }) : /* @__PURE__ */ T("div", {
228
228
  className: "space-y-6",
229
229
  children: [
230
- /* @__PURE__ */ C("div", {
230
+ /* @__PURE__ */ T("div", {
231
231
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
232
232
  children: [
233
- /* @__PURE__ */ S(n, {
233
+ /* @__PURE__ */ w(n, {
234
234
  hero: !0,
235
- label: E("healthybowl.marketplace.auctions.stats.active", "Active Auctions"),
236
- value: z.length,
237
- icon: /* @__PURE__ */ S(b, { className: "h-5 w-5" })
235
+ label: O("healthybowl.marketplace.auctions.stats.active", "Active Auctions"),
236
+ value: B.length,
237
+ icon: /* @__PURE__ */ w(x, { className: "h-5 w-5" })
238
238
  }),
239
- /* @__PURE__ */ S(n, {
240
- label: E("healthybowl.marketplace.auctions.stats.bidsToday", "Total Bids Today"),
241
- value: be,
242
- icon: /* @__PURE__ */ S(ee, { className: "h-5 w-5" })
239
+ /* @__PURE__ */ w(n, {
240
+ label: O("healthybowl.marketplace.auctions.stats.bidsToday", "Total Bids Today"),
241
+ value: xe,
242
+ icon: /* @__PURE__ */ w(b, { className: "h-5 w-5" })
243
243
  }),
244
- /* @__PURE__ */ S(n, {
245
- label: E("healthybowl.marketplace.auctions.stats.fixedListings", "Fixed Listings"),
244
+ /* @__PURE__ */ w(n, {
245
+ label: O("healthybowl.marketplace.auctions.stats.fixedListings", "Fixed Listings"),
246
246
  value: e.length,
247
- icon: /* @__PURE__ */ S(ne, { className: "h-5 w-5" })
247
+ icon: /* @__PURE__ */ w(re, { className: "h-5 w-5" })
248
248
  }),
249
- /* @__PURE__ */ S(n, {
250
- label: E("healthybowl.marketplace.auctions.stats.highestBid", "Highest Live Bid"),
251
- value: B > 0 ? t(B, "INR") : "—",
252
- icon: /* @__PURE__ */ S(ae, { className: "h-5 w-5" })
249
+ /* @__PURE__ */ w(n, {
250
+ label: O("healthybowl.marketplace.auctions.stats.highestBid", "Highest Live Bid"),
251
+ value: V > 0 ? t(V, "INR") : "—",
252
+ icon: /* @__PURE__ */ w(oe, { className: "h-5 w-5" })
253
253
  })
254
254
  ]
255
255
  }),
256
- /* @__PURE__ */ C("div", {
256
+ /* @__PURE__ */ T("div", {
257
257
  className: "flex items-center justify-between",
258
- children: [/* @__PURE__ */ S("p", {
258
+ children: [/* @__PURE__ */ w("p", {
259
259
  className: "text-sm text-text-secondary",
260
- children: E("healthybowl.marketplace.auctions.subtitle", "Bid on fresh produce — highest bid at close wins.")
261
- }), /* @__PURE__ */ C(w, {
262
- onClick: Te,
260
+ children: O("healthybowl.marketplace.auctions.subtitle", "Bid on fresh produce — highest bid at close wins.")
261
+ }), /* @__PURE__ */ T(E, {
262
+ onClick: Q,
263
263
  disabled: e.length === 0,
264
264
  children: [
265
- /* @__PURE__ */ S(x, { className: "h-4 w-4" }),
265
+ /* @__PURE__ */ w(S, { className: "h-4 w-4" }),
266
266
  " ",
267
- E("healthybowl.marketplace.auctions.actions.startAuction", "Start Auction")
267
+ O("healthybowl.marketplace.auctions.actions.startAuction", "Start Auction")
268
268
  ]
269
269
  })]
270
270
  }),
271
- A.length === 0 ? /* @__PURE__ */ S(i, {
271
+ /* @__PURE__ */ T("div", {
272
+ className: "flex items-start gap-2 rounded-lg border border-border-subtle bg-bg-sunken/40 p-3 text-xs text-text-secondary",
273
+ children: [/* @__PURE__ */ w(ee, { className: "mt-0.5 h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ w("p", { children: O("healthybowl.marketplace.auctions.scopeNotice", "Auctions are internal to your farm: only members of your own farm workspace can see or bid on them. To reach buyers on other farms, publish a fixed-price listing to the Shared Market — cross-farm auction bidding is not available yet.") })]
274
+ }),
275
+ j.length === 0 ? /* @__PURE__ */ w(i, {
272
276
  illustration: "empty-files",
273
- title: E("healthybowl.marketplace.auctions.empty.title", "No auctions yet"),
274
- description: e.length === 0 ? E("healthybowl.marketplace.auctions.empty.needProduct", "List a product under the Fixed-Price tab first, then auction it here.") : E("healthybowl.marketplace.auctions.empty.description", "Start a live auction for one of your marketplace products and let buyers bid."),
275
- action: e.length > 0 ? /* @__PURE__ */ C(w, {
276
- onClick: Te,
277
+ title: O("healthybowl.marketplace.auctions.empty.title", "No auctions yet"),
278
+ description: e.length === 0 ? O("healthybowl.marketplace.auctions.empty.needProduct", "List a product under the Fixed-Price tab first, then auction it here.") : O("healthybowl.marketplace.auctions.empty.description", "Start a live auction for one of your marketplace products and let buyers bid."),
279
+ action: e.length > 0 ? /* @__PURE__ */ T(E, {
280
+ onClick: Q,
277
281
  children: [
278
- /* @__PURE__ */ S(x, { className: "h-4 w-4" }),
282
+ /* @__PURE__ */ w(S, { className: "h-4 w-4" }),
279
283
  " ",
280
- E("healthybowl.marketplace.auctions.actions.startAuction", "Start Auction")
284
+ O("healthybowl.marketplace.auctions.actions.startAuction", "Start Auction")
281
285
  ]
282
286
  }) : void 0
283
- }) : /* @__PURE__ */ S("div", {
287
+ }) : /* @__PURE__ */ w("div", {
284
288
  className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
285
- children: A.map((e) => {
286
- let n = M.get(e.marketplaceProductId), i = P[e.id] ?? [], a = L(e), o = Me(e), s = ve.has(e.id), c = e.status === "live" && !o;
287
- return /* @__PURE__ */ C("div", {
289
+ children: j.map((e) => {
290
+ let n = N.get(e.marketplaceProductId), i = F[e.id] ?? [], a = R(e), o = Pe(e), s = ye.has(e.id), c = e.status === "live" && !o;
291
+ return /* @__PURE__ */ T("div", {
288
292
  className: "flex flex-col rounded-lg border border-border-subtle bg-bg-surface p-4 shadow-sm transition-shadow hover:shadow-md",
289
293
  children: [
290
- /* @__PURE__ */ C("div", {
294
+ /* @__PURE__ */ T("div", {
291
295
  className: "flex items-start justify-between gap-2",
292
- children: [/* @__PURE__ */ S("p", {
296
+ children: [/* @__PURE__ */ w("p", {
293
297
  className: "text-sm font-semibold text-text-primary",
294
- children: N(e.marketplaceProductId)
295
- }), /* @__PURE__ */ S(r, {
296
- label: je(e.status),
297
- variant: Ae(e.status),
298
+ children: P(e.marketplaceProductId)
299
+ }), /* @__PURE__ */ w(r, {
300
+ label: Ne(e.status),
301
+ variant: Me(e.status),
298
302
  dot: !0
299
303
  })]
300
304
  }),
301
- /* @__PURE__ */ C("div", {
305
+ /* @__PURE__ */ T("div", {
302
306
  className: "mt-1.5 flex flex-wrap items-center gap-1.5",
303
- children: [n?.organicCertified && /* @__PURE__ */ C("span", {
304
- className: "flex items-center gap-0.5 rounded-full bg-success-subtle px-1.5 py-0.5 text-[10px] font-medium text-success",
305
- children: [
306
- /* @__PURE__ */ S(te, { className: "h-2.5 w-2.5" }),
307
- " ",
308
- E("healthybowl.marketplace.overview.badge.organic", "Organic")
309
- ]
310
- }), n?.category && /* @__PURE__ */ S(r, {
311
- label: n.category,
312
- variant: "muted"
313
- })]
307
+ children: [
308
+ /* @__PURE__ */ T("span", {
309
+ className: "flex items-center gap-0.5 rounded-full bg-bg-sunken px-1.5 py-0.5 text-[10px] font-medium text-text-secondary",
310
+ title: O("healthybowl.marketplace.auctions.badge.farmOnlyTooltip", "Visible and biddable only within your farm workspace"),
311
+ children: [
312
+ /* @__PURE__ */ w(ne, { className: "h-2.5 w-2.5" }),
313
+ " ",
314
+ O("healthybowl.marketplace.auctions.badge.farmOnly", "Farm-only")
315
+ ]
316
+ }),
317
+ n?.organicCertified && /* @__PURE__ */ T("span", {
318
+ className: "flex items-center gap-0.5 rounded-full bg-success-subtle px-1.5 py-0.5 text-[10px] font-medium text-success",
319
+ children: [
320
+ /* @__PURE__ */ w(te, { className: "h-2.5 w-2.5" }),
321
+ " ",
322
+ O("healthybowl.marketplace.overview.badge.organic", "Organic")
323
+ ]
324
+ }),
325
+ n?.category && /* @__PURE__ */ w(r, {
326
+ label: n.category,
327
+ variant: "muted"
328
+ })
329
+ ]
314
330
  }),
315
- /* @__PURE__ */ C("div", {
331
+ /* @__PURE__ */ T("div", {
316
332
  className: "mt-3",
317
333
  children: [
318
- /* @__PURE__ */ S("p", {
334
+ /* @__PURE__ */ w("p", {
319
335
  className: "text-[11px] uppercase tracking-wider text-text-secondary",
320
- children: E("healthybowl.marketplace.auctions.card.currentBid", "Current Bid")
336
+ children: O("healthybowl.marketplace.auctions.card.currentBid", "Current Bid")
321
337
  }),
322
- /* @__PURE__ */ C("p", {
338
+ /* @__PURE__ */ T("p", {
323
339
  className: "text-lg font-bold text-text-primary",
324
- children: [t(a, "INR"), n?.unit && /* @__PURE__ */ C("span", {
340
+ children: [t(a, "INR"), n?.unit && /* @__PURE__ */ T("span", {
325
341
  className: "text-xs font-normal text-text-secondary",
326
342
  children: ["/", n.unit]
327
343
  })]
328
344
  }),
329
- /* @__PURE__ */ C("p", {
345
+ /* @__PURE__ */ T("p", {
330
346
  className: "mt-0.5 text-[11px] text-text-secondary",
331
- children: [E("healthybowl.marketplace.auctions.card.startAt", "Start {{price}}", { price: t(e.startingPrice, "INR") }), e.reservePrice != null && ` · ${E("healthybowl.marketplace.auctions.card.reserve", "Reserve {{price}}", { price: t(e.reservePrice, "INR") })}`]
347
+ children: [O("healthybowl.marketplace.auctions.card.startAt", "Start {{price}}", { price: t(e.startingPrice, "INR") }), e.reservePrice != null && ` · ${O("healthybowl.marketplace.auctions.card.reserve", "Reserve {{price}}", { price: t(e.reservePrice, "INR") })}`]
332
348
  })
333
349
  ]
334
350
  }),
335
- /* @__PURE__ */ C("div", {
351
+ /* @__PURE__ */ T("div", {
336
352
  className: "mt-3 flex items-center justify-between border-t border-border-subtle pt-3",
337
- children: [/* @__PURE__ */ S(ce, {
353
+ children: [/* @__PURE__ */ w(ce, {
338
354
  endTime: e.endTime,
339
355
  status: e.status,
340
- t: E
341
- }), /* @__PURE__ */ C("span", {
356
+ t: O
357
+ }), /* @__PURE__ */ T("span", {
342
358
  className: "inline-flex items-center gap-1 text-xs text-text-secondary",
343
- children: [/* @__PURE__ */ S(ie, { className: "h-3.5 w-3.5" }), E("healthybowl.marketplace.auctions.card.bidCount", "{{count}} bids", { count: i.length })]
359
+ children: [/* @__PURE__ */ w(ae, { className: "h-3.5 w-3.5" }), O("healthybowl.marketplace.auctions.card.bidCount", "{{count}} bids", { count: i.length })]
344
360
  })]
345
361
  }),
346
- /* @__PURE__ */ C(w, {
362
+ /* @__PURE__ */ T(E, {
347
363
  className: "mt-3 w-full",
348
- onClick: () => xe(e),
364
+ onClick: () => Ce(e),
349
365
  disabled: !c,
350
- children: [/* @__PURE__ */ S(b, { className: "h-4 w-4" }), c ? E("healthybowl.marketplace.auctions.card.placeBid", "Place Bid") : E("healthybowl.marketplace.auctions.card.biddingClosed", "Bidding Closed")]
366
+ children: [/* @__PURE__ */ w(x, { className: "h-4 w-4" }), c ? O("healthybowl.marketplace.auctions.card.placeBid", "Place Bid") : O("healthybowl.marketplace.auctions.card.biddingClosed", "Bidding Closed")]
351
367
  }),
352
- /* @__PURE__ */ C("div", {
368
+ /* @__PURE__ */ T("div", {
353
369
  className: "mt-2 flex items-center gap-2",
354
- children: [e.status === "draft" && /* @__PURE__ */ C(w, {
370
+ children: [e.status === "draft" && /* @__PURE__ */ T(E, {
355
371
  variant: "outline",
356
372
  size: "sm",
357
373
  className: "flex-1",
358
- onClick: () => void De(e),
374
+ onClick: () => void ke(e),
359
375
  children: [
360
- /* @__PURE__ */ S(re, { className: "h-3 w-3" }),
376
+ /* @__PURE__ */ w(ie, { className: "h-3 w-3" }),
361
377
  " ",
362
- E("healthybowl.marketplace.auctions.card.goLive", "Go Live")
378
+ O("healthybowl.marketplace.auctions.card.goLive", "Go Live")
363
379
  ]
364
- }), (e.status === "live" || e.status === "draft") && /* @__PURE__ */ C(w, {
380
+ }), (e.status === "live" || e.status === "draft") && /* @__PURE__ */ T(E, {
365
381
  variant: "outline",
366
382
  size: "sm",
367
383
  className: "flex-1 text-status-error-text hover:text-status-error-text",
368
- onClick: () => void Oe(e),
384
+ onClick: () => void Ae(e),
369
385
  children: [
370
- /* @__PURE__ */ S(oe, { className: "h-3 w-3" }),
386
+ /* @__PURE__ */ w(se, { className: "h-3 w-3" }),
371
387
  " ",
372
- E("healthybowl.marketplace.auctions.card.close", "Close")
388
+ O("healthybowl.marketplace.auctions.card.close", "Close")
373
389
  ]
374
390
  })]
375
391
  }),
376
- /* @__PURE__ */ C("button", {
392
+ /* @__PURE__ */ T("button", {
377
393
  type: "button",
378
- onClick: () => ke(e.id),
394
+ onClick: () => je(e.id),
379
395
  className: "mt-3 flex items-center justify-between border-t border-border-subtle pt-2 text-xs font-medium text-text-secondary hover:text-text-primary",
380
- children: [E("healthybowl.marketplace.auctions.card.recentBids", "Recent Bids"), S(s ? v : _, { className: "h-3.5 w-3.5" })]
396
+ children: [O("healthybowl.marketplace.auctions.card.recentBids", "Recent Bids"), w(s ? v : _, { className: "h-3.5 w-3.5" })]
381
397
  }),
382
- s && /* @__PURE__ */ S("div", {
398
+ s && /* @__PURE__ */ w("div", {
383
399
  className: "mt-2 space-y-1",
384
- children: i.length === 0 ? /* @__PURE__ */ S("p", {
400
+ children: i.length === 0 ? /* @__PURE__ */ w("p", {
385
401
  className: "text-xs text-text-secondary",
386
- children: E("healthybowl.marketplace.auctions.card.noBids", "No bids yet.")
387
- }) : i.slice(0, 6).map((e) => /* @__PURE__ */ C("div", {
402
+ children: O("healthybowl.marketplace.auctions.card.noBids", "No bids yet.")
403
+ }) : i.slice(0, 6).map((e) => /* @__PURE__ */ T("div", {
388
404
  className: "flex items-center justify-between rounded-md bg-bg-sunken/40 px-2 py-1 text-xs",
389
- children: [/* @__PURE__ */ S("span", {
405
+ children: [/* @__PURE__ */ w("span", {
390
406
  className: "font-medium text-text-primary tabular-nums",
391
407
  children: t(e.amount, "INR")
392
- }), /* @__PURE__ */ S("span", {
408
+ }), /* @__PURE__ */ w("span", {
393
409
  className: "text-text-secondary",
394
410
  children: e.createdAt ? new Date(e.createdAt).toLocaleString() : ""
395
411
  })]
@@ -399,167 +415,174 @@ var ce = ({ endTime: t, status: n, t: r }) => {
399
415
  }, e.id);
400
416
  })
401
417
  }),
402
- /* @__PURE__ */ S(l, {
403
- open: !!V,
418
+ /* @__PURE__ */ w(l, {
419
+ open: !!H,
404
420
  onClose: q,
405
- title: E("healthybowl.marketplace.auctions.bid.modal.title", "Place a Bid"),
406
- description: V ? E("healthybowl.marketplace.auctions.bid.modal.description", "Bidding on {{name}}.", { name: N(V.marketplaceProductId) }) : void 0,
421
+ title: O("healthybowl.marketplace.auctions.bid.modal.title", "Place a Bid"),
422
+ description: H ? O("healthybowl.marketplace.auctions.bid.modal.description", "Bidding on {{name}}.", { name: P(H.marketplaceProductId) }) : void 0,
407
423
  size: "sm",
408
- footer: /* @__PURE__ */ C(se, { children: [/* @__PURE__ */ S(w, {
424
+ footer: /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(E, {
409
425
  variant: "outline",
410
426
  onClick: q,
411
- children: E("healthybowl.common.cancel", "Cancel")
412
- }), /* @__PURE__ */ S(w, {
413
- onClick: Se,
414
- disabled: G,
415
- children: G ? E("healthybowl.marketplace.auctions.bid.placing", "Placing...") : E("healthybowl.marketplace.auctions.card.placeBid", "Place Bid")
427
+ children: O("healthybowl.common.cancel", "Cancel")
428
+ }), /* @__PURE__ */ w(E, {
429
+ onClick: we,
430
+ disabled: K,
431
+ children: K ? O("healthybowl.marketplace.auctions.bid.placing", "Placing...") : O("healthybowl.marketplace.auctions.card.placeBid", "Place Bid")
416
432
  })] }),
417
- children: V && /* @__PURE__ */ C("div", {
433
+ children: H && /* @__PURE__ */ T("div", {
418
434
  className: "space-y-3",
419
- children: [/* @__PURE__ */ C("div", {
420
- className: "flex items-center justify-between rounded-md bg-bg-sunken/40 px-3 py-2 text-sm",
421
- children: [/* @__PURE__ */ S("span", {
422
- className: "text-text-secondary",
423
- children: E("healthybowl.marketplace.auctions.card.currentBid", "Current Bid")
424
- }), /* @__PURE__ */ S("span", {
425
- className: "font-semibold text-text-primary",
426
- children: t(L(V), "INR")
427
- })]
428
- }), /* @__PURE__ */ C("div", { children: [
429
- /* @__PURE__ */ S("label", {
430
- htmlFor: "bid-amount",
431
- className: "mb-1 block text-sm font-medium text-text-primary",
432
- children: E("healthybowl.marketplace.auctions.bid.amount.label", "Your Bid")
435
+ children: [
436
+ /* @__PURE__ */ T("div", {
437
+ className: "flex items-start gap-2 rounded-md border border-border-subtle bg-bg-sunken/40 px-3 py-2 text-xs text-text-secondary",
438
+ children: [/* @__PURE__ */ w(ee, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }), /* @__PURE__ */ w("p", { children: O("healthybowl.marketplace.auctions.bid.scopeNotice", "Only members of this farm workspace can place bids on this auction.") })]
433
439
  }),
434
- /* @__PURE__ */ S("input", {
435
- id: "bid-amount",
436
- type: "number",
437
- min: 0,
438
- step: "0.01",
439
- value: U,
440
- onChange: (e) => W(e.target.value),
441
- className: T
440
+ /* @__PURE__ */ T("div", {
441
+ className: "flex items-center justify-between rounded-md bg-bg-sunken/40 px-3 py-2 text-sm",
442
+ children: [/* @__PURE__ */ w("span", {
443
+ className: "text-text-secondary",
444
+ children: O("healthybowl.marketplace.auctions.card.currentBid", "Current Bid")
445
+ }), /* @__PURE__ */ w("span", {
446
+ className: "font-semibold text-text-primary",
447
+ children: t(R(H), "INR")
448
+ })]
442
449
  }),
443
- /* @__PURE__ */ S("p", {
444
- className: "mt-1 text-xs text-text-secondary",
445
- children: E("healthybowl.marketplace.auctions.bid.minHint", "Minimum next bid: {{amount}}", { amount: t(R(V), "INR") })
446
- })
447
- ] })]
450
+ /* @__PURE__ */ T("div", { children: [
451
+ /* @__PURE__ */ w("label", {
452
+ htmlFor: "bid-amount",
453
+ className: "mb-1 block text-sm font-medium text-text-primary",
454
+ children: O("healthybowl.marketplace.auctions.bid.amount.label", "Your Bid")
455
+ }),
456
+ /* @__PURE__ */ w("input", {
457
+ id: "bid-amount",
458
+ type: "number",
459
+ min: 0,
460
+ step: "0.01",
461
+ value: W,
462
+ onChange: (e) => G(e.target.value),
463
+ className: D
464
+ }),
465
+ /* @__PURE__ */ w("p", {
466
+ className: "mt-1 text-xs text-text-secondary",
467
+ children: O("healthybowl.marketplace.auctions.bid.minHint", "Minimum next bid: {{amount}}", { amount: t(z(H), "INR") })
468
+ })
469
+ ] })
470
+ ]
448
471
  })
449
472
  }),
450
- /* @__PURE__ */ S(l, {
451
- open: Ce,
473
+ /* @__PURE__ */ w(l, {
474
+ open: Te,
452
475
  onClose: $,
453
- title: E("healthybowl.marketplace.auctions.create.modal.title", "Start an Auction"),
454
- description: E("healthybowl.marketplace.auctions.create.modal.description", "Auction an existing marketplace product. Buyers bid until the close time."),
476
+ title: O("healthybowl.marketplace.auctions.create.modal.title", "Start an Auction"),
477
+ description: O("healthybowl.marketplace.auctions.create.modal.description", "Auction an existing marketplace product. Buyers bid until the close time."),
455
478
  size: "md",
456
- footer: /* @__PURE__ */ C(se, { children: [/* @__PURE__ */ S(w, {
479
+ footer: /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(E, {
457
480
  variant: "outline",
458
481
  onClick: $,
459
- children: E("healthybowl.common.cancel", "Cancel")
460
- }), /* @__PURE__ */ S(w, {
461
- onClick: Ee,
462
- disabled: Z,
463
- children: Z ? E("healthybowl.marketplace.auctions.create.creating", "Creating...") : E("healthybowl.marketplace.auctions.actions.startAuction", "Start Auction")
482
+ children: O("healthybowl.common.cancel", "Cancel")
483
+ }), /* @__PURE__ */ w(E, {
484
+ onClick: Oe,
485
+ disabled: X,
486
+ children: X ? O("healthybowl.marketplace.auctions.create.creating", "Creating...") : O("healthybowl.marketplace.auctions.actions.startAuction", "Start Auction")
464
487
  })] }),
465
- children: /* @__PURE__ */ C("div", {
488
+ children: /* @__PURE__ */ T("div", {
466
489
  className: "space-y-4",
467
490
  children: [
468
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
491
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
469
492
  htmlFor: "auc-product",
470
493
  className: "mb-1 block text-sm font-medium text-text-primary",
471
- children: E("healthybowl.marketplace.auctions.form.product.label", "Product *")
472
- }), /* @__PURE__ */ C("select", {
494
+ children: O("healthybowl.marketplace.auctions.form.product.label", "Product *")
495
+ }), /* @__PURE__ */ T("select", {
473
496
  id: "auc-product",
474
- value: Y.marketplaceProductId,
475
- onChange: (e) => Q("marketplaceProductId", e.target.value),
476
- className: T,
477
- children: [/* @__PURE__ */ S("option", {
497
+ value: J.marketplaceProductId,
498
+ onChange: (e) => Z("marketplaceProductId", e.target.value),
499
+ className: D,
500
+ children: [/* @__PURE__ */ w("option", {
478
501
  value: "",
479
- children: E("healthybowl.marketplace.auctions.form.product.placeholder", "Select a product")
480
- }), e.map((e) => /* @__PURE__ */ S("option", {
502
+ children: O("healthybowl.marketplace.auctions.form.product.placeholder", "Select a product")
503
+ }), e.map((e) => /* @__PURE__ */ w("option", {
481
504
  value: e.id,
482
505
  children: e.name
483
506
  }, e.id))]
484
507
  })] }),
485
- /* @__PURE__ */ C("div", {
508
+ /* @__PURE__ */ T("div", {
486
509
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
487
510
  children: [
488
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
511
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
489
512
  htmlFor: "auc-start",
490
513
  className: "mb-1 block text-sm font-medium text-text-primary",
491
- children: E("healthybowl.marketplace.auctions.form.startingPrice.label", "Starting Price *")
492
- }), /* @__PURE__ */ S("input", {
514
+ children: O("healthybowl.marketplace.auctions.form.startingPrice.label", "Starting Price *")
515
+ }), /* @__PURE__ */ w("input", {
493
516
  id: "auc-start",
494
517
  type: "number",
495
518
  min: 0,
496
519
  step: "0.01",
497
- value: Y.startingPrice,
498
- onChange: (e) => Q("startingPrice", e.target.value),
520
+ value: J.startingPrice,
521
+ onChange: (e) => Z("startingPrice", e.target.value),
499
522
  placeholder: "50",
500
- className: T
523
+ className: D
501
524
  })] }),
502
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
525
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
503
526
  htmlFor: "auc-reserve",
504
527
  className: "mb-1 block text-sm font-medium text-text-primary",
505
- children: E("healthybowl.marketplace.auctions.form.reservePrice.label", "Reserve")
506
- }), /* @__PURE__ */ S("input", {
528
+ children: O("healthybowl.marketplace.auctions.form.reservePrice.label", "Reserve")
529
+ }), /* @__PURE__ */ w("input", {
507
530
  id: "auc-reserve",
508
531
  type: "number",
509
532
  min: 0,
510
533
  step: "0.01",
511
- value: Y.reservePrice,
512
- onChange: (e) => Q("reservePrice", e.target.value),
513
- placeholder: E("healthybowl.marketplace.auctions.form.reservePrice.placeholder", "Optional"),
514
- className: T
534
+ value: J.reservePrice,
535
+ onChange: (e) => Z("reservePrice", e.target.value),
536
+ placeholder: O("healthybowl.marketplace.auctions.form.reservePrice.placeholder", "Optional"),
537
+ className: D
515
538
  })] }),
516
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
539
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
517
540
  htmlFor: "auc-increment",
518
541
  className: "mb-1 block text-sm font-medium text-text-primary",
519
- children: E("healthybowl.marketplace.auctions.form.bidIncrement.label", "Increment")
520
- }), /* @__PURE__ */ S("input", {
542
+ children: O("healthybowl.marketplace.auctions.form.bidIncrement.label", "Increment")
543
+ }), /* @__PURE__ */ w("input", {
521
544
  id: "auc-increment",
522
545
  type: "number",
523
546
  min: 0,
524
547
  step: "0.01",
525
- value: Y.bidIncrement,
526
- onChange: (e) => Q("bidIncrement", e.target.value),
548
+ value: J.bidIncrement,
549
+ onChange: (e) => Z("bidIncrement", e.target.value),
527
550
  placeholder: "1",
528
- className: T
551
+ className: D
529
552
  })] })
530
553
  ]
531
554
  }),
532
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
555
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
533
556
  htmlFor: "auc-end",
534
557
  className: "mb-1 block text-sm font-medium text-text-primary",
535
- children: E("healthybowl.marketplace.auctions.form.endTime.label", "Ends At *")
536
- }), /* @__PURE__ */ S("input", {
558
+ children: O("healthybowl.marketplace.auctions.form.endTime.label", "Ends At *")
559
+ }), /* @__PURE__ */ w("input", {
537
560
  id: "auc-end",
538
561
  type: "datetime-local",
539
- value: Y.endTime,
540
- onChange: (e) => Q("endTime", e.target.value),
541
- className: T
562
+ value: J.endTime,
563
+ onChange: (e) => Z("endTime", e.target.value),
564
+ className: D
542
565
  })] }),
543
- /* @__PURE__ */ C("label", {
566
+ /* @__PURE__ */ T("label", {
544
567
  className: "flex items-center gap-2 text-sm font-medium text-text-primary",
545
- children: [/* @__PURE__ */ S("input", {
568
+ children: [/* @__PURE__ */ w("input", {
546
569
  type: "checkbox",
547
- checked: Y.startLive,
548
- onChange: (e) => Q("startLive", e.target.checked),
570
+ checked: J.startLive,
571
+ onChange: (e) => Z("startLive", e.target.checked),
549
572
  className: "h-4 w-4 rounded border-border-subtle text-primary focus:ring-[var(--color-focus-ring)]"
550
- }), E("healthybowl.marketplace.auctions.form.startLive.label", "Go live immediately (else save as draft)")]
573
+ }), O("healthybowl.marketplace.auctions.form.startLive.label", "Go live immediately (else save as draft)")]
551
574
  })
552
575
  ]
553
576
  })
554
577
  }),
555
- /* @__PURE__ */ S(o, {
556
- toasts: le,
557
- onDismiss: ue
578
+ /* @__PURE__ */ w(o, {
579
+ toasts: ue,
580
+ onDismiss: de
558
581
  })
559
582
  ]
560
583
  });
561
584
  };
562
585
  //#endregion
563
- export { O as AuctionsView };
586
+ export { le as AuctionsView };
564
587
 
565
588
  //# sourceMappingURL=AuctionsView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AuctionsView.js","names":[],"sources":["../../../../src/healthybowl/pages/marketplace/AuctionsView.tsx"],"sourcesContent":["/**\n * Live Auctions — the auctions tab of the Marketplace page (roadmap #6, Phase A).\n *\n * A seller lists an existing marketplace product for competitive bidding with a\n * starting price, optional reserve, a minimum bid increment and a close time.\n * Buyers place bids while the auction is live; a client-side countdown ticks down\n * to the close time and the current (highest) bid updates as bids land. Sellers\n * can open a draft (draft → live), close an auction to pick the winner, or cancel\n * it. Bid history per auction is fetched on demand into the expandable panels.\n * @module healthybowl\n */\nimport { useCallback, useEffect, useMemo, useState, type FC } from 'react';\nimport {\n Gavel,\n Plus,\n Leaf,\n Clock,\n TrendingUp,\n Tag,\n ChevronDown,\n ChevronUp,\n Play,\n X,\n Package,\n Flame,\n} from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { StatCard, StatusBadge, EmptyState, ErrorState, PageLoader, Modal, useConfirm } from '../../components';\nimport { ToastContainer } from '../../components/Toast';\nimport { useToast } from '../../hooks/useToast';\nimport { useAuctions, type Auction, type Bid } from '../../hooks/useAuctions';\nimport { formatCurrency, HB_DEFAULT_CURRENCY, cn } from '../../utils/helpers';\nimport type { MarketplaceProduct } from '../../types';\n\nconst inputClass =\n 'h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]';\n\ninterface AuctionsViewProps {\n products: MarketplaceProduct[];\n}\n\ntype TFn = (key: string, fallback: string, params?: Record<string, string | number>) => string;\n\n// ── datetime-local helpers ────────────────────────────────────────────────────\n/** A datetime-local value (yyyy-MM-ddTHH:mm) N hours from now, in local time. */\nfunction defaultEndLocal(hoursAhead = 24): string {\n const d = new Date(Date.now() + hoursAhead * 3_600_000);\n const pad = (n: number) => String(n).padStart(2, '0');\n return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}`;\n}\n\n// ── Live countdown ─────────────────────────────────────────────────────────────\nconst AuctionCountdown: FC<{ endTime: string; status: string; t: TFn }> = ({ endTime, status, t }) => {\n const [now, setNow] = useState(() => Date.now());\n\n const end = useMemo(() => new Date(endTime).getTime(), [endTime]);\n const ended = Number.isNaN(end) || now >= end;\n const inactive = status === 'closed' || status === 'cancelled';\n\n useEffect(() => {\n if (inactive || ended) return;\n const id = window.setInterval(() => setNow(Date.now()), 1000);\n return () => window.clearInterval(id);\n }, [inactive, ended]);\n\n if (inactive) {\n return (\n <span className=\"inline-flex items-center gap-1 text-xs font-medium text-text-secondary\">\n <Clock className=\"h-3.5 w-3.5\" />\n {status === 'cancelled'\n ? t('healthybowl.marketplace.auctions.cancelled', 'Cancelled')\n : t('healthybowl.marketplace.auctions.closed', 'Closed')}\n </span>\n );\n }\n\n if (ended) {\n return (\n <span className=\"inline-flex items-center gap-1 text-xs font-semibold text-status-warning-text\">\n <Clock className=\"h-3.5 w-3.5\" />\n {t('healthybowl.marketplace.auctions.ended', 'Ended — awaiting close')}\n </span>\n );\n }\n\n const remaining = Math.max(0, end - now);\n const totalSec = Math.floor(remaining / 1000);\n const days = Math.floor(totalSec / 86_400);\n const hours = Math.floor((totalSec % 86_400) / 3600);\n const mins = Math.floor((totalSec % 3600) / 60);\n const secs = totalSec % 60;\n const pad = (n: number) => String(n).padStart(2, '0');\n const label =\n days > 0 ? `${days}d ${pad(hours)}:${pad(mins)}:${pad(secs)}` : `${pad(hours)}:${pad(mins)}:${pad(secs)}`;\n const urgent = remaining < 3_600_000; // < 1h\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1 font-mono text-xs font-semibold tabular-nums',\n urgent ? 'text-status-error-text' : 'text-text-primary'\n )}\n >\n <Clock className=\"h-3.5 w-3.5\" />\n {label}\n </span>\n );\n};\n\n// ── Create-auction form state ──────────────────────────────────────────────────\ninterface AuctionFormState {\n marketplaceProductId: string;\n startingPrice: string;\n reservePrice: string;\n bidIncrement: string;\n endTime: string;\n startLive: boolean;\n}\n\nconst emptyAuctionForm = (): AuctionFormState => ({\n marketplaceProductId: '',\n startingPrice: '',\n reservePrice: '',\n bidIncrement: '1',\n endTime: defaultEndLocal(24),\n startLive: true,\n});\n\nexport const AuctionsView: FC<AuctionsViewProps> = ({ products }) => {\n const { t: translate } = useI18n();\n const t = useCallback<TFn>(\n (key, fallback, params) => {\n const value = translate(key, fallback, params);\n return value === key ? fallback : value;\n },\n [translate]\n );\n const confirm = useConfirm();\n const { toasts, toast, dismiss } = useToast();\n\n const { auctions, loading, error, refetch, createAuction, setAuctionStatus, placeBid, closeAuction, fetchBids } =\n useAuctions();\n\n const productById = useMemo(() => new Map(products.map((p) => [p.id, p])), [products]);\n const productName = useCallback(\n (id: string): string =>\n productById.get(id)?.name ?? t('healthybowl.marketplace.auctions.unknownProduct', 'Product'),\n [productById, t]\n );\n\n // ── Bid history per auction (fetched on demand; also powers current-bid/counts) ─\n const [bidsByAuction, setBidsByAuction] = useState<Record<string, Bid[]>>({});\n const [expanded, setExpanded] = useState<Set<string>>(new Set());\n\n const loadBids = useCallback(\n async (auctionId: string) => {\n try {\n const bids = await fetchBids(auctionId);\n setBidsByAuction((prev) => ({ ...prev, [auctionId]: bids }));\n } catch {\n // Best-effort: leave existing bids in place on failure.\n }\n },\n [fetchBids]\n );\n\n // Load bids for every auction whenever the auction set changes (best-effort).\n useEffect(() => {\n let cancelled = false;\n (async () => {\n const results = await Promise.all(\n auctions.map(async (a) => {\n try {\n return [a.id, await fetchBids(a.id)] as const;\n } catch {\n return [a.id, [] as Bid[]] as const;\n }\n })\n );\n if (cancelled) return;\n setBidsByAuction((prev) => {\n const next = { ...prev };\n for (const [id, bids] of results) next[id] = bids;\n return next;\n });\n })();\n return () => {\n cancelled = true;\n };\n // Re-run when the set of auction ids changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [auctions.map((a) => a.id).join(','), fetchBids]);\n\n const currentBid = useCallback(\n (a: Auction): number => {\n const bids = bidsByAuction[a.id] ?? [];\n const highest = bids.reduce((max, b) => Math.max(max, b.amount), 0);\n return Math.max(highest, a.startingPrice);\n },\n [bidsByAuction]\n );\n\n const minNextBid = useCallback(\n (a: Auction): number => {\n const bids = bidsByAuction[a.id] ?? [];\n const highest = bids.reduce((max, b) => Math.max(max, b.amount), 0);\n // First bid must meet the starting price; subsequent bids add the increment.\n return highest > 0 ? highest + a.bidIncrement : a.startingPrice;\n },\n [bidsByAuction]\n );\n\n // ── Stat cards ────────────────────────────────────────────────────────────────\n const liveAuctions = useMemo(() => auctions.filter((a) => a.status === 'live'), [auctions]);\n\n const bidsToday = useMemo(() => {\n const todayKey = new Date().toISOString().slice(0, 10);\n return Object.values(bidsByAuction)\n .flat()\n .filter((b) => (b.createdAt ?? '').slice(0, 10) === todayKey).length;\n }, [bidsByAuction]);\n\n const highestLiveBid = useMemo(\n () => liveAuctions.reduce((max, a) => Math.max(max, currentBid(a)), 0),\n [liveAuctions, currentBid]\n );\n\n // ── Place-bid modal ─────────────────────────────────────────────────────────\n const [bidAuction, setBidAuction] = useState<Auction | null>(null);\n const [bidAmount, setBidAmount] = useState('');\n const [placingBid, setPlacingBid] = useState(false);\n\n const openBidModal = (a: Auction) => {\n setBidAuction(a);\n setBidAmount(String(minNextBid(a)));\n };\n const closeBidModal = () => {\n setBidAuction(null);\n setBidAmount('');\n };\n\n const submitBid = async () => {\n if (!bidAuction) return;\n const amount = Number(bidAmount);\n if (!Number.isFinite(amount) || amount <= 0) {\n toast({\n title: t('healthybowl.marketplace.auctions.bid.invalid.title', 'Enter a valid amount'),\n variant: 'warning',\n });\n return;\n }\n setPlacingBid(true);\n try {\n await placeBid(bidAuction.id, amount);\n await loadBids(bidAuction.id);\n toast({\n title: t('healthybowl.marketplace.auctions.bid.success.title', 'Bid placed'),\n description: t('healthybowl.marketplace.auctions.bid.success.description', 'Your bid of {{amount}} is in.', {\n amount: formatCurrency(amount, HB_DEFAULT_CURRENCY),\n }),\n variant: 'success',\n });\n closeBidModal();\n } catch (err) {\n // Surface the server's \"bid too low\" / \"not live\" message directly.\n toast({\n title: t('healthybowl.marketplace.auctions.bid.error.title', 'Could not place bid'),\n description: err instanceof Error ? err.message : String(err),\n variant: 'error',\n });\n } finally {\n setPlacingBid(false);\n }\n };\n\n // ── Create-auction modal ──────────────────────────────────────────────────────\n const [showCreate, setShowCreate] = useState(false);\n const [form, setForm] = useState<AuctionFormState>(emptyAuctionForm);\n const [creating, setCreating] = useState(false);\n\n const updateForm = <K extends keyof AuctionFormState>(key: K, value: AuctionFormState[K]) =>\n setForm((prev) => ({ ...prev, [key]: value }));\n\n const openCreate = () => {\n setForm({ ...emptyAuctionForm(), marketplaceProductId: products[0]?.id ?? '' });\n setShowCreate(true);\n };\n const closeCreate = () => {\n setShowCreate(false);\n setForm(emptyAuctionForm());\n };\n\n const submitCreate = async () => {\n const startingPrice = Number(form.startingPrice);\n if (!form.marketplaceProductId || !form.startingPrice || !form.endTime) {\n toast({\n title: t('healthybowl.marketplace.auctions.create.required.title', 'Missing required fields'),\n description: t(\n 'healthybowl.marketplace.auctions.create.required.description',\n 'Product, starting price and end time are required.'\n ),\n variant: 'warning',\n });\n return;\n }\n if (!Number.isFinite(startingPrice) || startingPrice < 0) {\n toast({\n title: t('healthybowl.marketplace.auctions.create.invalid.title', 'Invalid starting price'),\n variant: 'warning',\n });\n return;\n }\n const endMs = new Date(form.endTime).getTime();\n if (Number.isNaN(endMs) || endMs <= Date.now()) {\n toast({\n title: t('healthybowl.marketplace.auctions.create.endPast.title', 'End time must be in the future'),\n variant: 'warning',\n });\n return;\n }\n const reserve = form.reservePrice.trim() ? Number(form.reservePrice) : undefined;\n const increment = form.bidIncrement.trim() ? Number(form.bidIncrement) : undefined;\n setCreating(true);\n try {\n await createAuction({\n marketplaceProductId: form.marketplaceProductId,\n startingPrice,\n reservePrice: Number.isFinite(reserve as number) ? reserve : undefined,\n bidIncrement: Number.isFinite(increment as number) ? increment : undefined,\n // Persist as an ISO-8601 instant (backend stores/compares ISO strings).\n endTime: new Date(form.endTime).toISOString(),\n status: form.startLive ? 'live' : 'draft',\n });\n toast({\n title: t('healthybowl.marketplace.auctions.create.success.title', 'Auction created'),\n description: form.startLive\n ? t('healthybowl.marketplace.auctions.create.successLive', '{{name}} is now live for bidding.', {\n name: productName(form.marketplaceProductId),\n })\n : t('healthybowl.marketplace.auctions.create.successDraft', '{{name}} saved as a draft.', {\n name: productName(form.marketplaceProductId),\n }),\n variant: 'success',\n });\n closeCreate();\n } catch (err) {\n toast({\n title: t('healthybowl.marketplace.auctions.create.error.title', 'Could not create auction'),\n description: err instanceof Error ? err.message : String(err),\n variant: 'error',\n });\n } finally {\n setCreating(false);\n }\n };\n\n // ── Seller actions ────────────────────────────────────────────────────────────\n const goLive = async (a: Auction) => {\n try {\n await setAuctionStatus(a.id, 'live');\n toast({ title: t('healthybowl.marketplace.auctions.goLive.success', 'Auction is now live'), variant: 'success' });\n } catch (err) {\n toast({\n title: t('healthybowl.marketplace.auctions.action.error', 'Action failed'),\n description: err instanceof Error ? err.message : String(err),\n variant: 'error',\n });\n }\n };\n\n const handleClose = async (a: Auction) => {\n if (\n !(await confirm({\n title: t('healthybowl.marketplace.auctions.close.confirm.title', 'Close this auction?'),\n message: t(\n 'healthybowl.marketplace.auctions.close.confirm.message',\n 'The top qualifying bid on {{name}} wins and a pending order is created. This cannot be undone.',\n { name: productName(a.marketplaceProductId) }\n ),\n okButtonTitle: t('healthybowl.marketplace.auctions.close.confirm.ok', 'Close Auction'),\n cancelButtonTitle: t('healthybowl.common.cancel', 'Cancel'),\n }))\n ) {\n return;\n }\n try {\n await closeAuction(a.id);\n toast({ title: t('healthybowl.marketplace.auctions.close.success', 'Auction closed'), variant: 'success' });\n } catch (err) {\n toast({\n title: t('healthybowl.marketplace.auctions.action.error', 'Action failed'),\n description: err instanceof Error ? err.message : String(err),\n variant: 'error',\n });\n }\n };\n\n const toggleExpand = (id: string) => {\n setExpanded((prev) => {\n const next = new Set(prev);\n if (next.has(id)) next.delete(id);\n else {\n next.add(id);\n void loadBids(id);\n }\n return next;\n });\n };\n\n const statusVariant = (status: string): 'success' | 'warning' | 'muted' | 'error' => {\n switch (status) {\n case 'live':\n return 'success';\n case 'draft':\n return 'warning';\n case 'cancelled':\n return 'error';\n default:\n return 'muted';\n }\n };\n const statusLabel = (status: string): string =>\n t(`healthybowl.marketplace.auctions.status.${status}`, status.charAt(0).toUpperCase() + status.slice(1));\n\n const isEnded = (a: Auction): boolean => {\n const end = new Date(a.endTime).getTime();\n return !Number.isNaN(end) && Date.now() >= end;\n };\n\n // ── Render ────────────────────────────────────────────────────────────────────\n if (loading && auctions.length === 0) return <PageLoader />;\n if (error && auctions.length === 0) return <ErrorState onRetry={() => void refetch()} />;\n\n return (\n <div className=\"space-y-6\">\n {/* Stat cards */}\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n <StatCard\n hero\n label={t('healthybowl.marketplace.auctions.stats.active', 'Active Auctions')}\n value={liveAuctions.length}\n icon={<Gavel className=\"h-5 w-5\" />}\n />\n <StatCard\n label={t('healthybowl.marketplace.auctions.stats.bidsToday', 'Total Bids Today')}\n value={bidsToday}\n icon={<Flame className=\"h-5 w-5\" />}\n />\n <StatCard\n label={t('healthybowl.marketplace.auctions.stats.fixedListings', 'Fixed Listings')}\n value={products.length}\n icon={<Package className=\"h-5 w-5\" />}\n />\n <StatCard\n label={t('healthybowl.marketplace.auctions.stats.highestBid', 'Highest Live Bid')}\n value={highestLiveBid > 0 ? formatCurrency(highestLiveBid, HB_DEFAULT_CURRENCY) : '—'}\n icon={<TrendingUp className=\"h-5 w-5\" />}\n />\n </div>\n\n {/* Header row + create */}\n <div className=\"flex items-center justify-between\">\n <p className=\"text-sm text-text-secondary\">\n {t('healthybowl.marketplace.auctions.subtitle', 'Bid on fresh produce — highest bid at close wins.')}\n </p>\n <Button onClick={openCreate} disabled={products.length === 0}>\n <Plus className=\"h-4 w-4\" /> {t('healthybowl.marketplace.auctions.actions.startAuction', 'Start Auction')}\n </Button>\n </div>\n\n {/* Auction grid */}\n {auctions.length === 0 ? (\n <EmptyState\n illustration=\"empty-files\"\n title={t('healthybowl.marketplace.auctions.empty.title', 'No auctions yet')}\n description={\n products.length === 0\n ? t(\n 'healthybowl.marketplace.auctions.empty.needProduct',\n 'List a product under the Fixed-Price tab first, then auction it here.'\n )\n : t(\n 'healthybowl.marketplace.auctions.empty.description',\n 'Start a live auction for one of your marketplace products and let buyers bid.'\n )\n }\n action={\n products.length > 0 ? (\n <Button onClick={openCreate}>\n <Plus className=\"h-4 w-4\" />{' '}\n {t('healthybowl.marketplace.auctions.actions.startAuction', 'Start Auction')}\n </Button>\n ) : undefined\n }\n />\n ) : (\n <div className=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4\">\n {auctions.map((a) => {\n const product = productById.get(a.marketplaceProductId);\n const bids = bidsByAuction[a.id] ?? [];\n const cur = currentBid(a);\n const ended = isEnded(a);\n const isOpen = expanded.has(a.id);\n const canBid = a.status === 'live' && !ended;\n\n return (\n <div\n key={a.id}\n className=\"flex flex-col rounded-lg border border-border-subtle bg-bg-surface p-4 shadow-sm transition-shadow hover:shadow-md\"\n >\n {/* Header */}\n <div className=\"flex items-start justify-between gap-2\">\n <p className=\"text-sm font-semibold text-text-primary\">{productName(a.marketplaceProductId)}</p>\n <StatusBadge label={statusLabel(a.status)} variant={statusVariant(a.status)} dot />\n </div>\n\n {/* Badges */}\n <div className=\"mt-1.5 flex flex-wrap items-center gap-1.5\">\n {product?.organicCertified && (\n <span className=\"flex items-center gap-0.5 rounded-full bg-success-subtle px-1.5 py-0.5 text-[10px] font-medium text-success\">\n <Leaf className=\"h-2.5 w-2.5\" /> {t('healthybowl.marketplace.overview.badge.organic', 'Organic')}\n </span>\n )}\n {product?.category && <StatusBadge label={product.category} variant=\"muted\" />}\n </div>\n\n {/* Current bid */}\n <div className=\"mt-3\">\n <p className=\"text-[11px] uppercase tracking-wider text-text-secondary\">\n {t('healthybowl.marketplace.auctions.card.currentBid', 'Current Bid')}\n </p>\n <p className=\"text-lg font-bold text-text-primary\">\n {formatCurrency(cur, HB_DEFAULT_CURRENCY)}\n {product?.unit && <span className=\"text-xs font-normal text-text-secondary\">/{product.unit}</span>}\n </p>\n <p className=\"mt-0.5 text-[11px] text-text-secondary\">\n {t('healthybowl.marketplace.auctions.card.startAt', 'Start {{price}}', {\n price: formatCurrency(a.startingPrice, HB_DEFAULT_CURRENCY),\n })}\n {a.reservePrice != null &&\n ` · ${t('healthybowl.marketplace.auctions.card.reserve', 'Reserve {{price}}', {\n price: formatCurrency(a.reservePrice, HB_DEFAULT_CURRENCY),\n })}`}\n </p>\n </div>\n\n {/* Countdown + bid count */}\n <div className=\"mt-3 flex items-center justify-between border-t border-border-subtle pt-3\">\n <AuctionCountdown endTime={a.endTime} status={a.status} t={t} />\n <span className=\"inline-flex items-center gap-1 text-xs text-text-secondary\">\n <Tag className=\"h-3.5 w-3.5\" />\n {t('healthybowl.marketplace.auctions.card.bidCount', '{{count}} bids', { count: bids.length })}\n </span>\n </div>\n\n {/* Place bid */}\n <Button className=\"mt-3 w-full\" onClick={() => openBidModal(a)} disabled={!canBid}>\n <Gavel className=\"h-4 w-4\" />\n {canBid\n ? t('healthybowl.marketplace.auctions.card.placeBid', 'Place Bid')\n : t('healthybowl.marketplace.auctions.card.biddingClosed', 'Bidding Closed')}\n </Button>\n\n {/* Seller actions */}\n <div className=\"mt-2 flex items-center gap-2\">\n {a.status === 'draft' && (\n <Button variant=\"outline\" size=\"sm\" className=\"flex-1\" onClick={() => void goLive(a)}>\n <Play className=\"h-3 w-3\" /> {t('healthybowl.marketplace.auctions.card.goLive', 'Go Live')}\n </Button>\n )}\n {(a.status === 'live' || a.status === 'draft') && (\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"flex-1 text-status-error-text hover:text-status-error-text\"\n onClick={() => void handleClose(a)}\n >\n <X className=\"h-3 w-3\" /> {t('healthybowl.marketplace.auctions.card.close', 'Close')}\n </Button>\n )}\n </div>\n\n {/* Recent bids (expandable) */}\n <button\n type=\"button\"\n onClick={() => toggleExpand(a.id)}\n className=\"mt-3 flex items-center justify-between border-t border-border-subtle pt-2 text-xs font-medium text-text-secondary hover:text-text-primary\"\n >\n {t('healthybowl.marketplace.auctions.card.recentBids', 'Recent Bids')}\n {isOpen ? <ChevronUp className=\"h-3.5 w-3.5\" /> : <ChevronDown className=\"h-3.5 w-3.5\" />}\n </button>\n {isOpen && (\n <div className=\"mt-2 space-y-1\">\n {bids.length === 0 ? (\n <p className=\"text-xs text-text-secondary\">\n {t('healthybowl.marketplace.auctions.card.noBids', 'No bids yet.')}\n </p>\n ) : (\n bids.slice(0, 6).map((b) => (\n <div\n key={b.id}\n className=\"flex items-center justify-between rounded-md bg-bg-sunken/40 px-2 py-1 text-xs\"\n >\n <span className=\"font-medium text-text-primary tabular-nums\">\n {formatCurrency(b.amount, HB_DEFAULT_CURRENCY)}\n </span>\n <span className=\"text-text-secondary\">\n {b.createdAt ? new Date(b.createdAt).toLocaleString() : ''}\n </span>\n </div>\n ))\n )}\n </div>\n )}\n </div>\n );\n })}\n </div>\n )}\n\n {/* Place-bid modal */}\n <Modal\n open={!!bidAuction}\n onClose={closeBidModal}\n title={t('healthybowl.marketplace.auctions.bid.modal.title', 'Place a Bid')}\n description={\n bidAuction\n ? t('healthybowl.marketplace.auctions.bid.modal.description', 'Bidding on {{name}}.', {\n name: productName(bidAuction.marketplaceProductId),\n })\n : undefined\n }\n size=\"sm\"\n footer={\n <>\n <Button variant=\"outline\" onClick={closeBidModal}>\n {t('healthybowl.common.cancel', 'Cancel')}\n </Button>\n <Button onClick={submitBid} disabled={placingBid}>\n {placingBid\n ? t('healthybowl.marketplace.auctions.bid.placing', 'Placing...')\n : t('healthybowl.marketplace.auctions.card.placeBid', 'Place Bid')}\n </Button>\n </>\n }\n >\n {bidAuction && (\n <div className=\"space-y-3\">\n <div className=\"flex items-center justify-between rounded-md bg-bg-sunken/40 px-3 py-2 text-sm\">\n <span className=\"text-text-secondary\">\n {t('healthybowl.marketplace.auctions.card.currentBid', 'Current Bid')}\n </span>\n <span className=\"font-semibold text-text-primary\">\n {formatCurrency(currentBid(bidAuction), HB_DEFAULT_CURRENCY)}\n </span>\n </div>\n <div>\n <label htmlFor=\"bid-amount\" className=\"mb-1 block text-sm font-medium text-text-primary\">\n {t('healthybowl.marketplace.auctions.bid.amount.label', 'Your Bid')}\n </label>\n <input\n id=\"bid-amount\"\n type=\"number\"\n min={0}\n step=\"0.01\"\n value={bidAmount}\n onChange={(e) => setBidAmount(e.target.value)}\n className={inputClass}\n />\n <p className=\"mt-1 text-xs text-text-secondary\">\n {t('healthybowl.marketplace.auctions.bid.minHint', 'Minimum next bid: {{amount}}', {\n amount: formatCurrency(minNextBid(bidAuction), HB_DEFAULT_CURRENCY),\n })}\n </p>\n </div>\n </div>\n )}\n </Modal>\n\n {/* Create-auction modal */}\n <Modal\n open={showCreate}\n onClose={closeCreate}\n title={t('healthybowl.marketplace.auctions.create.modal.title', 'Start an Auction')}\n description={t(\n 'healthybowl.marketplace.auctions.create.modal.description',\n 'Auction an existing marketplace product. Buyers bid until the close time.'\n )}\n size=\"md\"\n footer={\n <>\n <Button variant=\"outline\" onClick={closeCreate}>\n {t('healthybowl.common.cancel', 'Cancel')}\n </Button>\n <Button onClick={submitCreate} disabled={creating}>\n {creating\n ? t('healthybowl.marketplace.auctions.create.creating', 'Creating...')\n : t('healthybowl.marketplace.auctions.actions.startAuction', 'Start Auction')}\n </Button>\n </>\n }\n >\n <div className=\"space-y-4\">\n <div>\n <label htmlFor=\"auc-product\" className=\"mb-1 block text-sm font-medium text-text-primary\">\n {t('healthybowl.marketplace.auctions.form.product.label', 'Product *')}\n </label>\n <select\n id=\"auc-product\"\n value={form.marketplaceProductId}\n onChange={(e) => updateForm('marketplaceProductId', e.target.value)}\n className={inputClass}\n >\n <option value=\"\">\n {t('healthybowl.marketplace.auctions.form.product.placeholder', 'Select a product')}\n </option>\n {products.map((p) => (\n <option key={p.id} value={p.id}>\n {p.name}\n </option>\n ))}\n </select>\n </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-3\">\n <div>\n <label htmlFor=\"auc-start\" className=\"mb-1 block text-sm font-medium text-text-primary\">\n {t('healthybowl.marketplace.auctions.form.startingPrice.label', 'Starting Price *')}\n </label>\n <input\n id=\"auc-start\"\n type=\"number\"\n min={0}\n step=\"0.01\"\n value={form.startingPrice}\n onChange={(e) => updateForm('startingPrice', e.target.value)}\n placeholder=\"50\"\n className={inputClass}\n />\n </div>\n <div>\n <label htmlFor=\"auc-reserve\" className=\"mb-1 block text-sm font-medium text-text-primary\">\n {t('healthybowl.marketplace.auctions.form.reservePrice.label', 'Reserve')}\n </label>\n <input\n id=\"auc-reserve\"\n type=\"number\"\n min={0}\n step=\"0.01\"\n value={form.reservePrice}\n onChange={(e) => updateForm('reservePrice', e.target.value)}\n placeholder={t('healthybowl.marketplace.auctions.form.reservePrice.placeholder', 'Optional')}\n className={inputClass}\n />\n </div>\n <div>\n <label htmlFor=\"auc-increment\" className=\"mb-1 block text-sm font-medium text-text-primary\">\n {t('healthybowl.marketplace.auctions.form.bidIncrement.label', 'Increment')}\n </label>\n <input\n id=\"auc-increment\"\n type=\"number\"\n min={0}\n step=\"0.01\"\n value={form.bidIncrement}\n onChange={(e) => updateForm('bidIncrement', e.target.value)}\n placeholder=\"1\"\n className={inputClass}\n />\n </div>\n </div>\n <div>\n <label htmlFor=\"auc-end\" className=\"mb-1 block text-sm font-medium text-text-primary\">\n {t('healthybowl.marketplace.auctions.form.endTime.label', 'Ends At *')}\n </label>\n <input\n id=\"auc-end\"\n type=\"datetime-local\"\n value={form.endTime}\n onChange={(e) => updateForm('endTime', e.target.value)}\n className={inputClass}\n />\n </div>\n <label className=\"flex items-center gap-2 text-sm font-medium text-text-primary\">\n <input\n type=\"checkbox\"\n checked={form.startLive}\n onChange={(e) => updateForm('startLive', e.target.checked)}\n className=\"h-4 w-4 rounded border-border-subtle text-primary focus:ring-[var(--color-focus-ring)]\"\n />\n {t('healthybowl.marketplace.auctions.form.startLive.label', 'Go live immediately (else save as draft)')}\n </label>\n </div>\n </Modal>\n\n <ToastContainer toasts={toasts} onDismiss={dismiss} />\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmCA,IAAM,IACJ;AAUF,SAAS,EAAgB,IAAa,IAAY;CAChD,IAAM,IAAI,IAAI,KAAK,KAAK,KAAK,GAAG,IAAa,KAAU,EACjD,KAAO,MAAc,OAAO,EAAE,CAAC,SAAS,GAAG,IAAI;AACrD,QAAO,GAAG,EAAE,aAAa,CAAC,GAAG,EAAI,EAAE,UAAU,GAAG,EAAE,CAAC,GAAG,EAAI,EAAE,SAAS,CAAC,CAAC,GAAG,EAAI,EAAE,UAAU,CAAC,CAAC,GAAG,EAAI,EAAE,YAAY,CAAC;;AAIpH,IAAM,MAAqE,EAAE,YAAS,WAAQ,WAAQ;CACpG,IAAM,CAAC,GAAK,KAAU,QAAe,KAAK,KAAK,CAAC,EAE1C,IAAM,QAAc,IAAI,KAAK,EAAQ,CAAC,SAAS,EAAE,CAAC,EAAQ,CAAC,EAC3D,IAAQ,OAAO,MAAM,EAAI,IAAI,KAAO,GACpC,IAAW,MAAW,YAAY,MAAW;AAQnD,KANA,QAAgB;AACd,MAAI,KAAY,EAAO;EACvB,IAAM,IAAK,OAAO,kBAAkB,EAAO,KAAK,KAAK,CAAC,EAAE,IAAK;AAC7D,eAAa,OAAO,cAAc,EAAG;IACpC,CAAC,GAAU,EAAM,CAAC,EAEjB,EACF,QACE,kBAAC,QAAD;EAAM,WAAU;YAAhB,CACE,kBAAC,GAAD,EAAO,WAAU,eAA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,KAAK;SACL,MAAK;SACL,OAAO,EAAK;SACZ,WAAW,MAAM,EAAW,gBAAgB,EAAE,OAAO,MAAM;SAC3D,aAAa,EAAE,kEAAkE,WAAW;SAC5F,WAAW;SACX,CAAA,CACE,EAAA,CAAA;QACN,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,SAAD;SAAO,SAAQ;SAAgB,WAAU;mBACtC,EAAE,4DAA4D,YAAY;SACrE,CAAA,EACR,kBAAC,SAAD;SACE,IAAG;SACH,MAAK;SACL,KAAK;SACL,MAAK;SACL,OAAO,EAAK;SACZ,WAAW,MAAM,EAAW,gBAAgB,EAAE,OAAO,MAAM;SAC3D,aAAY;SACZ,WAAW;SACX,CAAA,CACE,EAAA,CAAA;QACF;;MACN,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,SAAD;OAAO,SAAQ;OAAU,WAAU;iBAChC,EAAE,uDAAuD,YAAY;OAChE,CAAA,EACR,kBAAC,SAAD;OACE,IAAG;OACH,MAAK;OACL,OAAO,EAAK;OACZ,WAAW,MAAM,EAAW,WAAW,EAAE,OAAO,MAAM;OACtD,WAAW;OACX,CAAA,CACE,EAAA,CAAA;MACN,kBAAC,SAAD;OAAO,WAAU;iBAAjB,CACE,kBAAC,SAAD;QACE,MAAK;QACL,SAAS,EAAK;QACd,WAAW,MAAM,EAAW,aAAa,EAAE,OAAO,QAAQ;QAC1D,WAAU;QACV,CAAA,EACD,EAAE,yDAAyD,2CAA2C,CACjG;;MACJ;;IACA,CAAA;GAER,kBAAC,GAAD;IAAwB;IAAQ,WAAW;IAAW,CAAA;GAClD"}
1
+ {"version":3,"file":"AuctionsView.js","names":[],"sources":["../../../../src/healthybowl/pages/marketplace/AuctionsView.tsx"],"sourcesContent":["/**\n * Live Auctions — the auctions tab of the Marketplace page (roadmap #6, Phase A).\n *\n * A seller lists an existing marketplace product for competitive bidding with a\n * starting price, optional reserve, a minimum bid increment and a close time.\n * Buyers place bids while the auction is live; a client-side countdown ticks down\n * to the close time and the current (highest) bid updates as bids land. Sellers\n * can open a draft (draft → live), close an auction to pick the winner, or cancel\n * it. Bid history per auction is fetched on demand into the expandable panels.\n * @module healthybowl\n */\nimport { useCallback, useEffect, useMemo, useState, type FC } from 'react';\nimport {\n Gavel,\n Plus,\n Leaf,\n Clock,\n TrendingUp,\n Tag,\n ChevronDown,\n ChevronUp,\n Play,\n X,\n Package,\n Flame,\n Info,\n Lock,\n} from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { StatCard, StatusBadge, EmptyState, ErrorState, PageLoader, Modal, useConfirm } from '../../components';\nimport { ToastContainer } from '../../components/Toast';\nimport { useToast } from '../../hooks/useToast';\nimport { useAuctions, type Auction, type Bid } from '../../hooks/useAuctions';\nimport { formatCurrency, HB_DEFAULT_CURRENCY, cn } from '../../utils/helpers';\nimport type { MarketplaceProduct } from '../../types';\n\nconst inputClass =\n 'h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]';\n\ninterface AuctionsViewProps {\n products: MarketplaceProduct[];\n}\n\ntype TFn = (key: string, fallback: string, params?: Record<string, string | number>) => string;\n\n// ── datetime-local helpers ────────────────────────────────────────────────────\n/** A datetime-local value (yyyy-MM-ddTHH:mm) N hours from now, in local time. */\nfunction defaultEndLocal(hoursAhead = 24): string {\n const d = new Date(Date.now() + hoursAhead * 3_600_000);\n const pad = (n: number) => String(n).padStart(2, '0');\n return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}`;\n}\n\n// ── Live countdown ─────────────────────────────────────────────────────────────\nconst AuctionCountdown: FC<{ endTime: string; status: string; t: TFn }> = ({ endTime, status, t }) => {\n const [now, setNow] = useState(() => Date.now());\n\n const end = useMemo(() => new Date(endTime).getTime(), [endTime]);\n const ended = Number.isNaN(end) || now >= end;\n const inactive = status === 'closed' || status === 'cancelled';\n\n useEffect(() => {\n if (inactive || ended) return;\n const id = window.setInterval(() => setNow(Date.now()), 1000);\n return () => window.clearInterval(id);\n }, [inactive, ended]);\n\n if (inactive) {\n return (\n <span className=\"inline-flex items-center gap-1 text-xs font-medium text-text-secondary\">\n <Clock className=\"h-3.5 w-3.5\" />\n {status === 'cancelled'\n ? t('healthybowl.marketplace.auctions.cancelled', 'Cancelled')\n : t('healthybowl.marketplace.auctions.closed', 'Closed')}\n </span>\n );\n }\n\n if (ended) {\n return (\n <span className=\"inline-flex items-center gap-1 text-xs font-semibold text-status-warning-text\">\n <Clock className=\"h-3.5 w-3.5\" />\n {t('healthybowl.marketplace.auctions.ended', 'Ended — awaiting close')}\n </span>\n );\n }\n\n const remaining = Math.max(0, end - now);\n const totalSec = Math.floor(remaining / 1000);\n const days = Math.floor(totalSec / 86_400);\n const hours = Math.floor((totalSec % 86_400) / 3600);\n const mins = Math.floor((totalSec % 3600) / 60);\n const secs = totalSec % 60;\n const pad = (n: number) => String(n).padStart(2, '0');\n const label =\n days > 0 ? `${days}d ${pad(hours)}:${pad(mins)}:${pad(secs)}` : `${pad(hours)}:${pad(mins)}:${pad(secs)}`;\n const urgent = remaining < 3_600_000; // < 1h\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1 font-mono text-xs font-semibold tabular-nums',\n urgent ? 'text-status-error-text' : 'text-text-primary'\n )}\n >\n <Clock className=\"h-3.5 w-3.5\" />\n {label}\n </span>\n );\n};\n\n// ── Create-auction form state ──────────────────────────────────────────────────\ninterface AuctionFormState {\n marketplaceProductId: string;\n startingPrice: string;\n reservePrice: string;\n bidIncrement: string;\n endTime: string;\n startLive: boolean;\n}\n\nconst emptyAuctionForm = (): AuctionFormState => ({\n marketplaceProductId: '',\n startingPrice: '',\n reservePrice: '',\n bidIncrement: '1',\n endTime: defaultEndLocal(24),\n startLive: true,\n});\n\nexport const AuctionsView: FC<AuctionsViewProps> = ({ products }) => {\n const { t: translate } = useI18n();\n const t = useCallback<TFn>(\n (key, fallback, params) => {\n const value = translate(key, fallback, params);\n return value === key ? fallback : value;\n },\n [translate]\n );\n const confirm = useConfirm();\n const { toasts, toast, dismiss } = useToast();\n\n const { auctions, loading, error, refetch, createAuction, setAuctionStatus, placeBid, closeAuction, fetchBids } =\n useAuctions();\n\n const productById = useMemo(() => new Map(products.map((p) => [p.id, p])), [products]);\n const productName = useCallback(\n (id: string): string =>\n productById.get(id)?.name ?? t('healthybowl.marketplace.auctions.unknownProduct', 'Product'),\n [productById, t]\n );\n\n // ── Bid history per auction (fetched on demand; also powers current-bid/counts) ─\n const [bidsByAuction, setBidsByAuction] = useState<Record<string, Bid[]>>({});\n const [expanded, setExpanded] = useState<Set<string>>(new Set());\n\n const loadBids = useCallback(\n async (auctionId: string) => {\n try {\n const bids = await fetchBids(auctionId);\n setBidsByAuction((prev) => ({ ...prev, [auctionId]: bids }));\n } catch {\n // Best-effort: leave existing bids in place on failure.\n }\n },\n [fetchBids]\n );\n\n // Load bids for every auction whenever the auction set changes (best-effort).\n useEffect(() => {\n let cancelled = false;\n (async () => {\n const results = await Promise.all(\n auctions.map(async (a) => {\n try {\n return [a.id, await fetchBids(a.id)] as const;\n } catch {\n return [a.id, [] as Bid[]] as const;\n }\n })\n );\n if (cancelled) return;\n setBidsByAuction((prev) => {\n const next = { ...prev };\n for (const [id, bids] of results) next[id] = bids;\n return next;\n });\n })();\n return () => {\n cancelled = true;\n };\n // Re-run when the set of auction ids changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [auctions.map((a) => a.id).join(','), fetchBids]);\n\n const currentBid = useCallback(\n (a: Auction): number => {\n const bids = bidsByAuction[a.id] ?? [];\n const highest = bids.reduce((max, b) => Math.max(max, b.amount), 0);\n return Math.max(highest, a.startingPrice);\n },\n [bidsByAuction]\n );\n\n const minNextBid = useCallback(\n (a: Auction): number => {\n const bids = bidsByAuction[a.id] ?? [];\n const highest = bids.reduce((max, b) => Math.max(max, b.amount), 0);\n // First bid must meet the starting price; subsequent bids add the increment.\n return highest > 0 ? highest + a.bidIncrement : a.startingPrice;\n },\n [bidsByAuction]\n );\n\n // ── Stat cards ────────────────────────────────────────────────────────────────\n const liveAuctions = useMemo(() => auctions.filter((a) => a.status === 'live'), [auctions]);\n\n const bidsToday = useMemo(() => {\n const todayKey = new Date().toISOString().slice(0, 10);\n return Object.values(bidsByAuction)\n .flat()\n .filter((b) => (b.createdAt ?? '').slice(0, 10) === todayKey).length;\n }, [bidsByAuction]);\n\n const highestLiveBid = useMemo(\n () => liveAuctions.reduce((max, a) => Math.max(max, currentBid(a)), 0),\n [liveAuctions, currentBid]\n );\n\n // ── Place-bid modal ─────────────────────────────────────────────────────────\n const [bidAuction, setBidAuction] = useState<Auction | null>(null);\n const [bidAmount, setBidAmount] = useState('');\n const [placingBid, setPlacingBid] = useState(false);\n\n const openBidModal = (a: Auction) => {\n setBidAuction(a);\n setBidAmount(String(minNextBid(a)));\n };\n const closeBidModal = () => {\n setBidAuction(null);\n setBidAmount('');\n };\n\n const submitBid = async () => {\n if (!bidAuction) return;\n const amount = Number(bidAmount);\n if (!Number.isFinite(amount) || amount <= 0) {\n toast({\n title: t('healthybowl.marketplace.auctions.bid.invalid.title', 'Enter a valid amount'),\n variant: 'warning',\n });\n return;\n }\n setPlacingBid(true);\n try {\n await placeBid(bidAuction.id, amount);\n await loadBids(bidAuction.id);\n toast({\n title: t('healthybowl.marketplace.auctions.bid.success.title', 'Bid placed'),\n description: t('healthybowl.marketplace.auctions.bid.success.description', 'Your bid of {{amount}} is in.', {\n amount: formatCurrency(amount, HB_DEFAULT_CURRENCY),\n }),\n variant: 'success',\n });\n closeBidModal();\n } catch (err) {\n // Surface the server's \"bid too low\" / \"not live\" message directly.\n toast({\n title: t('healthybowl.marketplace.auctions.bid.error.title', 'Could not place bid'),\n description: err instanceof Error ? err.message : String(err),\n variant: 'error',\n });\n } finally {\n setPlacingBid(false);\n }\n };\n\n // ── Create-auction modal ──────────────────────────────────────────────────────\n const [showCreate, setShowCreate] = useState(false);\n const [form, setForm] = useState<AuctionFormState>(emptyAuctionForm);\n const [creating, setCreating] = useState(false);\n\n const updateForm = <K extends keyof AuctionFormState>(key: K, value: AuctionFormState[K]) =>\n setForm((prev) => ({ ...prev, [key]: value }));\n\n const openCreate = () => {\n setForm({ ...emptyAuctionForm(), marketplaceProductId: products[0]?.id ?? '' });\n setShowCreate(true);\n };\n const closeCreate = () => {\n setShowCreate(false);\n setForm(emptyAuctionForm());\n };\n\n const submitCreate = async () => {\n const startingPrice = Number(form.startingPrice);\n if (!form.marketplaceProductId || !form.startingPrice || !form.endTime) {\n toast({\n title: t('healthybowl.marketplace.auctions.create.required.title', 'Missing required fields'),\n description: t(\n 'healthybowl.marketplace.auctions.create.required.description',\n 'Product, starting price and end time are required.'\n ),\n variant: 'warning',\n });\n return;\n }\n if (!Number.isFinite(startingPrice) || startingPrice < 0) {\n toast({\n title: t('healthybowl.marketplace.auctions.create.invalid.title', 'Invalid starting price'),\n variant: 'warning',\n });\n return;\n }\n const endMs = new Date(form.endTime).getTime();\n if (Number.isNaN(endMs) || endMs <= Date.now()) {\n toast({\n title: t('healthybowl.marketplace.auctions.create.endPast.title', 'End time must be in the future'),\n variant: 'warning',\n });\n return;\n }\n const reserve = form.reservePrice.trim() ? Number(form.reservePrice) : undefined;\n const increment = form.bidIncrement.trim() ? Number(form.bidIncrement) : undefined;\n setCreating(true);\n try {\n await createAuction({\n marketplaceProductId: form.marketplaceProductId,\n startingPrice,\n reservePrice: Number.isFinite(reserve as number) ? reserve : undefined,\n bidIncrement: Number.isFinite(increment as number) ? increment : undefined,\n // Persist as an ISO-8601 instant (backend stores/compares ISO strings).\n endTime: new Date(form.endTime).toISOString(),\n status: form.startLive ? 'live' : 'draft',\n });\n toast({\n title: t('healthybowl.marketplace.auctions.create.success.title', 'Auction created'),\n description: form.startLive\n ? t('healthybowl.marketplace.auctions.create.successLive', '{{name}} is now live for bidding.', {\n name: productName(form.marketplaceProductId),\n })\n : t('healthybowl.marketplace.auctions.create.successDraft', '{{name}} saved as a draft.', {\n name: productName(form.marketplaceProductId),\n }),\n variant: 'success',\n });\n closeCreate();\n } catch (err) {\n toast({\n title: t('healthybowl.marketplace.auctions.create.error.title', 'Could not create auction'),\n description: err instanceof Error ? err.message : String(err),\n variant: 'error',\n });\n } finally {\n setCreating(false);\n }\n };\n\n // ── Seller actions ────────────────────────────────────────────────────────────\n const goLive = async (a: Auction) => {\n try {\n await setAuctionStatus(a.id, 'live');\n toast({ title: t('healthybowl.marketplace.auctions.goLive.success', 'Auction is now live'), variant: 'success' });\n } catch (err) {\n toast({\n title: t('healthybowl.marketplace.auctions.action.error', 'Action failed'),\n description: err instanceof Error ? err.message : String(err),\n variant: 'error',\n });\n }\n };\n\n const handleClose = async (a: Auction) => {\n if (\n !(await confirm({\n title: t('healthybowl.marketplace.auctions.close.confirm.title', 'Close this auction?'),\n message: t(\n 'healthybowl.marketplace.auctions.close.confirm.message',\n 'The top qualifying bid on {{name}} wins and a pending order is created. This cannot be undone.',\n { name: productName(a.marketplaceProductId) }\n ),\n okButtonTitle: t('healthybowl.marketplace.auctions.close.confirm.ok', 'Close Auction'),\n cancelButtonTitle: t('healthybowl.common.cancel', 'Cancel'),\n }))\n ) {\n return;\n }\n try {\n await closeAuction(a.id);\n toast({ title: t('healthybowl.marketplace.auctions.close.success', 'Auction closed'), variant: 'success' });\n } catch (err) {\n toast({\n title: t('healthybowl.marketplace.auctions.action.error', 'Action failed'),\n description: err instanceof Error ? err.message : String(err),\n variant: 'error',\n });\n }\n };\n\n const toggleExpand = (id: string) => {\n setExpanded((prev) => {\n const next = new Set(prev);\n if (next.has(id)) next.delete(id);\n else {\n next.add(id);\n void loadBids(id);\n }\n return next;\n });\n };\n\n const statusVariant = (status: string): 'success' | 'warning' | 'muted' | 'error' => {\n switch (status) {\n case 'live':\n return 'success';\n case 'draft':\n return 'warning';\n case 'cancelled':\n return 'error';\n default:\n return 'muted';\n }\n };\n const statusLabel = (status: string): string =>\n t(`healthybowl.marketplace.auctions.status.${status}`, status.charAt(0).toUpperCase() + status.slice(1));\n\n const isEnded = (a: Auction): boolean => {\n const end = new Date(a.endTime).getTime();\n return !Number.isNaN(end) && Date.now() >= end;\n };\n\n // ── Render ────────────────────────────────────────────────────────────────────\n if (loading && auctions.length === 0) return <PageLoader />;\n if (error && auctions.length === 0) return <ErrorState onRetry={() => void refetch()} />;\n\n return (\n <div className=\"space-y-6\">\n {/* Stat cards */}\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n <StatCard\n hero\n label={t('healthybowl.marketplace.auctions.stats.active', 'Active Auctions')}\n value={liveAuctions.length}\n icon={<Gavel className=\"h-5 w-5\" />}\n />\n <StatCard\n label={t('healthybowl.marketplace.auctions.stats.bidsToday', 'Total Bids Today')}\n value={bidsToday}\n icon={<Flame className=\"h-5 w-5\" />}\n />\n <StatCard\n label={t('healthybowl.marketplace.auctions.stats.fixedListings', 'Fixed Listings')}\n value={products.length}\n icon={<Package className=\"h-5 w-5\" />}\n />\n <StatCard\n label={t('healthybowl.marketplace.auctions.stats.highestBid', 'Highest Live Bid')}\n value={highestLiveBid > 0 ? formatCurrency(highestLiveBid, HB_DEFAULT_CURRENCY) : '—'}\n icon={<TrendingUp className=\"h-5 w-5\" />}\n />\n </div>\n\n {/* Header row + create */}\n <div className=\"flex items-center justify-between\">\n <p className=\"text-sm text-text-secondary\">\n {t('healthybowl.marketplace.auctions.subtitle', 'Bid on fresh produce — highest bid at close wins.')}\n </p>\n <Button onClick={openCreate} disabled={products.length === 0}>\n <Plus className=\"h-4 w-4\" /> {t('healthybowl.marketplace.auctions.actions.startAuction', 'Start Auction')}\n </Button>\n </div>\n\n {/* Honest scope notice: auctions are workspace-scoped — visible and biddable\n only within the seller's own farm, unlike the cross-farm Shared Market (BOFF-6038). */}\n <div className=\"flex items-start gap-2 rounded-lg border border-border-subtle bg-bg-sunken/40 p-3 text-xs text-text-secondary\">\n <Info className=\"mt-0.5 h-4 w-4 shrink-0 text-text-secondary\" />\n <p>\n {t(\n 'healthybowl.marketplace.auctions.scopeNotice',\n 'Auctions are internal to your farm: only members of your own farm workspace can see or bid on them. To reach buyers on other farms, publish a fixed-price listing to the Shared Market — cross-farm auction bidding is not available yet.'\n )}\n </p>\n </div>\n\n {/* Auction grid */}\n {auctions.length === 0 ? (\n <EmptyState\n illustration=\"empty-files\"\n title={t('healthybowl.marketplace.auctions.empty.title', 'No auctions yet')}\n description={\n products.length === 0\n ? t(\n 'healthybowl.marketplace.auctions.empty.needProduct',\n 'List a product under the Fixed-Price tab first, then auction it here.'\n )\n : t(\n 'healthybowl.marketplace.auctions.empty.description',\n 'Start a live auction for one of your marketplace products and let buyers bid.'\n )\n }\n action={\n products.length > 0 ? (\n <Button onClick={openCreate}>\n <Plus className=\"h-4 w-4\" />{' '}\n {t('healthybowl.marketplace.auctions.actions.startAuction', 'Start Auction')}\n </Button>\n ) : undefined\n }\n />\n ) : (\n <div className=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4\">\n {auctions.map((a) => {\n const product = productById.get(a.marketplaceProductId);\n const bids = bidsByAuction[a.id] ?? [];\n const cur = currentBid(a);\n const ended = isEnded(a);\n const isOpen = expanded.has(a.id);\n const canBid = a.status === 'live' && !ended;\n\n return (\n <div\n key={a.id}\n className=\"flex flex-col rounded-lg border border-border-subtle bg-bg-surface p-4 shadow-sm transition-shadow hover:shadow-md\"\n >\n {/* Header */}\n <div className=\"flex items-start justify-between gap-2\">\n <p className=\"text-sm font-semibold text-text-primary\">{productName(a.marketplaceProductId)}</p>\n <StatusBadge label={statusLabel(a.status)} variant={statusVariant(a.status)} dot />\n </div>\n\n {/* Badges */}\n <div className=\"mt-1.5 flex flex-wrap items-center gap-1.5\">\n <span\n className=\"flex items-center gap-0.5 rounded-full bg-bg-sunken px-1.5 py-0.5 text-[10px] font-medium text-text-secondary\"\n title={t(\n 'healthybowl.marketplace.auctions.badge.farmOnlyTooltip',\n 'Visible and biddable only within your farm workspace'\n )}\n >\n <Lock className=\"h-2.5 w-2.5\" /> {t('healthybowl.marketplace.auctions.badge.farmOnly', 'Farm-only')}\n </span>\n {product?.organicCertified && (\n <span className=\"flex items-center gap-0.5 rounded-full bg-success-subtle px-1.5 py-0.5 text-[10px] font-medium text-success\">\n <Leaf className=\"h-2.5 w-2.5\" /> {t('healthybowl.marketplace.overview.badge.organic', 'Organic')}\n </span>\n )}\n {product?.category && <StatusBadge label={product.category} variant=\"muted\" />}\n </div>\n\n {/* Current bid */}\n <div className=\"mt-3\">\n <p className=\"text-[11px] uppercase tracking-wider text-text-secondary\">\n {t('healthybowl.marketplace.auctions.card.currentBid', 'Current Bid')}\n </p>\n <p className=\"text-lg font-bold text-text-primary\">\n {formatCurrency(cur, HB_DEFAULT_CURRENCY)}\n {product?.unit && <span className=\"text-xs font-normal text-text-secondary\">/{product.unit}</span>}\n </p>\n <p className=\"mt-0.5 text-[11px] text-text-secondary\">\n {t('healthybowl.marketplace.auctions.card.startAt', 'Start {{price}}', {\n price: formatCurrency(a.startingPrice, HB_DEFAULT_CURRENCY),\n })}\n {a.reservePrice != null &&\n ` · ${t('healthybowl.marketplace.auctions.card.reserve', 'Reserve {{price}}', {\n price: formatCurrency(a.reservePrice, HB_DEFAULT_CURRENCY),\n })}`}\n </p>\n </div>\n\n {/* Countdown + bid count */}\n <div className=\"mt-3 flex items-center justify-between border-t border-border-subtle pt-3\">\n <AuctionCountdown endTime={a.endTime} status={a.status} t={t} />\n <span className=\"inline-flex items-center gap-1 text-xs text-text-secondary\">\n <Tag className=\"h-3.5 w-3.5\" />\n {t('healthybowl.marketplace.auctions.card.bidCount', '{{count}} bids', { count: bids.length })}\n </span>\n </div>\n\n {/* Place bid */}\n <Button className=\"mt-3 w-full\" onClick={() => openBidModal(a)} disabled={!canBid}>\n <Gavel className=\"h-4 w-4\" />\n {canBid\n ? t('healthybowl.marketplace.auctions.card.placeBid', 'Place Bid')\n : t('healthybowl.marketplace.auctions.card.biddingClosed', 'Bidding Closed')}\n </Button>\n\n {/* Seller actions */}\n <div className=\"mt-2 flex items-center gap-2\">\n {a.status === 'draft' && (\n <Button variant=\"outline\" size=\"sm\" className=\"flex-1\" onClick={() => void goLive(a)}>\n <Play className=\"h-3 w-3\" /> {t('healthybowl.marketplace.auctions.card.goLive', 'Go Live')}\n </Button>\n )}\n {(a.status === 'live' || a.status === 'draft') && (\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"flex-1 text-status-error-text hover:text-status-error-text\"\n onClick={() => void handleClose(a)}\n >\n <X className=\"h-3 w-3\" /> {t('healthybowl.marketplace.auctions.card.close', 'Close')}\n </Button>\n )}\n </div>\n\n {/* Recent bids (expandable) */}\n <button\n type=\"button\"\n onClick={() => toggleExpand(a.id)}\n className=\"mt-3 flex items-center justify-between border-t border-border-subtle pt-2 text-xs font-medium text-text-secondary hover:text-text-primary\"\n >\n {t('healthybowl.marketplace.auctions.card.recentBids', 'Recent Bids')}\n {isOpen ? <ChevronUp className=\"h-3.5 w-3.5\" /> : <ChevronDown className=\"h-3.5 w-3.5\" />}\n </button>\n {isOpen && (\n <div className=\"mt-2 space-y-1\">\n {bids.length === 0 ? (\n <p className=\"text-xs text-text-secondary\">\n {t('healthybowl.marketplace.auctions.card.noBids', 'No bids yet.')}\n </p>\n ) : (\n bids.slice(0, 6).map((b) => (\n <div\n key={b.id}\n className=\"flex items-center justify-between rounded-md bg-bg-sunken/40 px-2 py-1 text-xs\"\n >\n <span className=\"font-medium text-text-primary tabular-nums\">\n {formatCurrency(b.amount, HB_DEFAULT_CURRENCY)}\n </span>\n <span className=\"text-text-secondary\">\n {b.createdAt ? new Date(b.createdAt).toLocaleString() : ''}\n </span>\n </div>\n ))\n )}\n </div>\n )}\n </div>\n );\n })}\n </div>\n )}\n\n {/* Place-bid modal */}\n <Modal\n open={!!bidAuction}\n onClose={closeBidModal}\n title={t('healthybowl.marketplace.auctions.bid.modal.title', 'Place a Bid')}\n description={\n bidAuction\n ? t('healthybowl.marketplace.auctions.bid.modal.description', 'Bidding on {{name}}.', {\n name: productName(bidAuction.marketplaceProductId),\n })\n : undefined\n }\n size=\"sm\"\n footer={\n <>\n <Button variant=\"outline\" onClick={closeBidModal}>\n {t('healthybowl.common.cancel', 'Cancel')}\n </Button>\n <Button onClick={submitBid} disabled={placingBid}>\n {placingBid\n ? t('healthybowl.marketplace.auctions.bid.placing', 'Placing...')\n : t('healthybowl.marketplace.auctions.card.placeBid', 'Place Bid')}\n </Button>\n </>\n }\n >\n {bidAuction && (\n <div className=\"space-y-3\">\n <div className=\"flex items-start gap-2 rounded-md border border-border-subtle bg-bg-sunken/40 px-3 py-2 text-xs text-text-secondary\">\n <Info className=\"mt-0.5 h-3.5 w-3.5 shrink-0\" />\n <p>\n {t(\n 'healthybowl.marketplace.auctions.bid.scopeNotice',\n 'Only members of this farm workspace can place bids on this auction.'\n )}\n </p>\n </div>\n <div className=\"flex items-center justify-between rounded-md bg-bg-sunken/40 px-3 py-2 text-sm\">\n <span className=\"text-text-secondary\">\n {t('healthybowl.marketplace.auctions.card.currentBid', 'Current Bid')}\n </span>\n <span className=\"font-semibold text-text-primary\">\n {formatCurrency(currentBid(bidAuction), HB_DEFAULT_CURRENCY)}\n </span>\n </div>\n <div>\n <label htmlFor=\"bid-amount\" className=\"mb-1 block text-sm font-medium text-text-primary\">\n {t('healthybowl.marketplace.auctions.bid.amount.label', 'Your Bid')}\n </label>\n <input\n id=\"bid-amount\"\n type=\"number\"\n min={0}\n step=\"0.01\"\n value={bidAmount}\n onChange={(e) => setBidAmount(e.target.value)}\n className={inputClass}\n />\n <p className=\"mt-1 text-xs text-text-secondary\">\n {t('healthybowl.marketplace.auctions.bid.minHint', 'Minimum next bid: {{amount}}', {\n amount: formatCurrency(minNextBid(bidAuction), HB_DEFAULT_CURRENCY),\n })}\n </p>\n </div>\n </div>\n )}\n </Modal>\n\n {/* Create-auction modal */}\n <Modal\n open={showCreate}\n onClose={closeCreate}\n title={t('healthybowl.marketplace.auctions.create.modal.title', 'Start an Auction')}\n description={t(\n 'healthybowl.marketplace.auctions.create.modal.description',\n 'Auction an existing marketplace product. Buyers bid until the close time.'\n )}\n size=\"md\"\n footer={\n <>\n <Button variant=\"outline\" onClick={closeCreate}>\n {t('healthybowl.common.cancel', 'Cancel')}\n </Button>\n <Button onClick={submitCreate} disabled={creating}>\n {creating\n ? t('healthybowl.marketplace.auctions.create.creating', 'Creating...')\n : t('healthybowl.marketplace.auctions.actions.startAuction', 'Start Auction')}\n </Button>\n </>\n }\n >\n <div className=\"space-y-4\">\n <div>\n <label htmlFor=\"auc-product\" className=\"mb-1 block text-sm font-medium text-text-primary\">\n {t('healthybowl.marketplace.auctions.form.product.label', 'Product *')}\n </label>\n <select\n id=\"auc-product\"\n value={form.marketplaceProductId}\n onChange={(e) => updateForm('marketplaceProductId', e.target.value)}\n className={inputClass}\n >\n <option value=\"\">\n {t('healthybowl.marketplace.auctions.form.product.placeholder', 'Select a product')}\n </option>\n {products.map((p) => (\n <option key={p.id} value={p.id}>\n {p.name}\n </option>\n ))}\n </select>\n </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-3\">\n <div>\n <label htmlFor=\"auc-start\" className=\"mb-1 block text-sm font-medium text-text-primary\">\n {t('healthybowl.marketplace.auctions.form.startingPrice.label', 'Starting Price *')}\n </label>\n <input\n id=\"auc-start\"\n type=\"number\"\n min={0}\n step=\"0.01\"\n value={form.startingPrice}\n onChange={(e) => updateForm('startingPrice', e.target.value)}\n placeholder=\"50\"\n className={inputClass}\n />\n </div>\n <div>\n <label htmlFor=\"auc-reserve\" className=\"mb-1 block text-sm font-medium text-text-primary\">\n {t('healthybowl.marketplace.auctions.form.reservePrice.label', 'Reserve')}\n </label>\n <input\n id=\"auc-reserve\"\n type=\"number\"\n min={0}\n step=\"0.01\"\n value={form.reservePrice}\n onChange={(e) => updateForm('reservePrice', e.target.value)}\n placeholder={t('healthybowl.marketplace.auctions.form.reservePrice.placeholder', 'Optional')}\n className={inputClass}\n />\n </div>\n <div>\n <label htmlFor=\"auc-increment\" className=\"mb-1 block text-sm font-medium text-text-primary\">\n {t('healthybowl.marketplace.auctions.form.bidIncrement.label', 'Increment')}\n </label>\n <input\n id=\"auc-increment\"\n type=\"number\"\n min={0}\n step=\"0.01\"\n value={form.bidIncrement}\n onChange={(e) => updateForm('bidIncrement', e.target.value)}\n placeholder=\"1\"\n className={inputClass}\n />\n </div>\n </div>\n <div>\n <label htmlFor=\"auc-end\" className=\"mb-1 block text-sm font-medium text-text-primary\">\n {t('healthybowl.marketplace.auctions.form.endTime.label', 'Ends At *')}\n </label>\n <input\n id=\"auc-end\"\n type=\"datetime-local\"\n value={form.endTime}\n onChange={(e) => updateForm('endTime', e.target.value)}\n className={inputClass}\n />\n </div>\n <label className=\"flex items-center gap-2 text-sm font-medium text-text-primary\">\n <input\n type=\"checkbox\"\n checked={form.startLive}\n onChange={(e) => updateForm('startLive', e.target.checked)}\n className=\"h-4 w-4 rounded border-border-subtle text-primary focus:ring-[var(--color-focus-ring)]\"\n />\n {t('healthybowl.marketplace.auctions.form.startLive.label', 'Go live immediately (else save as draft)')}\n </label>\n </div>\n </Modal>\n\n <ToastContainer toasts={toasts} onDismiss={dismiss} />\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqCA,IAAM,IACJ;AAUF,SAAS,EAAgB,IAAa,IAAY;CAChD,IAAM,IAAI,IAAI,KAAK,KAAK,KAAK,GAAG,IAAa,KAAU,EACjD,KAAO,MAAc,OAAO,EAAE,CAAC,SAAS,GAAG,IAAI;AACrD,QAAO,GAAG,EAAE,aAAa,CAAC,GAAG,EAAI,EAAE,UAAU,GAAG,EAAE,CAAC,GAAG,EAAI,EAAE,SAAS,CAAC,CAAC,GAAG,EAAI,EAAE,UAAU,CAAC,CAAC,GAAG,EAAI,EAAE,YAAY,CAAC;;AAIpH,IAAM,MAAqE,EAAE,YAAS,WAAQ,W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AAK;SACL,OAAO,EAAK;SACZ,WAAW,MAAM,EAAW,gBAAgB,EAAE,OAAO,MAAM;SAC3D,aAAY;SACZ,WAAW;SACX,CAAA,CACE,EAAA,CAAA;QACF;;MACN,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,SAAD;OAAO,SAAQ;OAAU,WAAU;iBAChC,EAAE,uDAAuD,YAAY;OAChE,CAAA,EACR,kBAAC,SAAD;OACE,IAAG;OACH,MAAK;OACL,OAAO,EAAK;OACZ,WAAW,MAAM,EAAW,WAAW,EAAE,OAAO,MAAM;OACtD,WAAW;OACX,CAAA,CACE,EAAA,CAAA;MACN,kBAAC,SAAD;OAAO,WAAU;iBAAjB,CACE,kBAAC,SAAD;QACE,MAAK;QACL,SAAS,EAAK;QACd,WAAW,MAAM,EAAW,aAAa,EAAE,OAAO,QAAQ;QAC1D,WAAU;QACV,CAAA,EACD,EAAE,yDAAyD,2CAA2C,CACjG;;MACJ;;IACA,CAAA;GAER,kBAAC,GAAD;IAAwB;IAAQ,WAAW;IAAW,CAAA;GAClD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-healthybowl",
3
- "version": "2026.810.5",
3
+ "version": "2026.810.6",
4
4
  "description": "Burdenoff HealthyBowl Microfrontend - Comprehensive organic farming and agro-foods management platform",
5
5
  "type": "module",
6
6
  "files": [