@burdenoff/microfe-coolandlovely 2026.1109.4 → 2026.1109.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.
Files changed (42) hide show
  1. package/dist/coolandlovely/CoolAndLovelyRoot.d.ts.map +1 -1
  2. package/dist/coolandlovely/CoolAndLovelyRoot.js +8 -0
  3. package/dist/coolandlovely/CoolAndLovelyRoot.js.map +1 -1
  4. package/dist/coolandlovely/CoolAndLovelyRoutes.d.ts.map +1 -1
  5. package/dist/coolandlovely/CoolAndLovelyRoutes.js +32 -16
  6. package/dist/coolandlovely/CoolAndLovelyRoutes.js.map +1 -1
  7. package/dist/coolandlovely/api/resaleTransport.d.ts +13 -0
  8. package/dist/coolandlovely/api/resaleTransport.d.ts.map +1 -0
  9. package/dist/coolandlovely/api/resaleTransport.js +38 -0
  10. package/dist/coolandlovely/api/resaleTransport.js.map +1 -0
  11. package/dist/coolandlovely/hooks/useResale.d.ts +12 -0
  12. package/dist/coolandlovely/hooks/useResale.d.ts.map +1 -0
  13. package/dist/coolandlovely/hooks/useResale.js +132 -0
  14. package/dist/coolandlovely/hooks/useResale.js.map +1 -0
  15. package/dist/coolandlovely/pages/resale/ResaleBrowsePage.d.ts +2 -0
  16. package/dist/coolandlovely/pages/resale/ResaleBrowsePage.d.ts.map +1 -0
  17. package/dist/coolandlovely/pages/resale/ResaleBrowsePage.js +164 -0
  18. package/dist/coolandlovely/pages/resale/ResaleBrowsePage.js.map +1 -0
  19. package/dist/coolandlovely/pages/resale/ResaleListingPage.d.ts +2 -0
  20. package/dist/coolandlovely/pages/resale/ResaleListingPage.d.ts.map +1 -0
  21. package/dist/coolandlovely/pages/resale/ResaleListingPage.js +161 -0
  22. package/dist/coolandlovely/pages/resale/ResaleListingPage.js.map +1 -0
  23. package/dist/coolandlovely/pages/resale/ResaleReportsPage.d.ts +2 -0
  24. package/dist/coolandlovely/pages/resale/ResaleReportsPage.d.ts.map +1 -0
  25. package/dist/coolandlovely/pages/resale/ResaleReportsPage.js +80 -0
  26. package/dist/coolandlovely/pages/resale/ResaleReportsPage.js.map +1 -0
  27. package/dist/coolandlovely/pages/resale/ResaleSellerPage.d.ts +2 -0
  28. package/dist/coolandlovely/pages/resale/ResaleSellerPage.d.ts.map +1 -0
  29. package/dist/coolandlovely/pages/resale/ResaleSellerPage.js +235 -0
  30. package/dist/coolandlovely/pages/resale/ResaleSellerPage.js.map +1 -0
  31. package/dist/coolandlovely/utils/resalePresentation.d.ts +5 -0
  32. package/dist/coolandlovely/utils/resalePresentation.d.ts.map +1 -0
  33. package/dist/coolandlovely/utils/resalePresentation.js +33 -0
  34. package/dist/coolandlovely/utils/resalePresentation.js.map +1 -0
  35. package/dist/generated/wspace-operations.d.ts +974 -0
  36. package/dist/generated/wspace-operations.d.ts.map +1 -1
  37. package/dist/generated/wspace-operations.js +252 -18
  38. package/dist/generated/wspace-operations.js.map +1 -1
  39. package/dist/generated/wspace-types.d.ts +66230 -9890
  40. package/dist/generated/wspace-types.d.ts.map +1 -1
  41. package/dist/generated/wspace-types.js.map +1 -1
  42. package/package.json +5 -4
@@ -0,0 +1,235 @@
1
+ import { PageLayout as e } from "../../components/PageLayout.js";
2
+ import { useTr as t } from "../../hooks/useTr.js";
3
+ import { StatusBadge as n } from "../../components/StatusBadge.js";
4
+ import { ErrorView as r, LoadingView as i } from "../../components/StateViews.js";
5
+ import { useContextNavigation as a } from "../../hooks/useContextNavigation.js";
6
+ import { CooResaleSaveShopDocument as o } from "../../../generated/wspace-operations.js";
7
+ import { refreshResaleRead as s, useResaleMutation as c, useResaleSeller as l } from "../../hooks/useResale.js";
8
+ import { formatResalePrice as u } from "../../utils/resalePresentation.js";
9
+ import { useState as d } from "react";
10
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
11
+ import { Button as h, GlassCard as g, Pagination as _ } from "@burdenoff/fe-libs/ui";
12
+ //#region src/coolandlovely/pages/resale/ResaleSellerPage.tsx
13
+ var v = "2026-11-02", y = "w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-text-primary";
14
+ function b({ shop: e, onClose: n }) {
15
+ let r = t(), i = c(o), [a, s] = d(e?.handle ?? ""), [l, u] = d(e?.name ?? ""), [f, g] = d(e?.description ?? ""), [_, b] = d(!1), [x, S] = d("");
16
+ return /* @__PURE__ */ m("form", {
17
+ onSubmit: (t) => {
18
+ if (t.preventDefault(), !(!_ || i.isPending || i.isError)) {
19
+ if (!l.trim() || !f.trim()) {
20
+ S(r("coolandlovely.resale.shopDetailsRequired", "Enter a shop name and description containing non-space characters."));
21
+ return;
22
+ }
23
+ S(""), i.mutate({ input: {
24
+ handle: a.trim().toLowerCase(),
25
+ name: l.trim(),
26
+ description: f.trim(),
27
+ acceptedPolicyVersion: v,
28
+ expectedVersion: e?.version
29
+ } }, { onSuccess: n });
30
+ }
31
+ },
32
+ "aria-label": "Resale shop details",
33
+ className: "space-y-4",
34
+ children: [
35
+ /* @__PURE__ */ m("label", {
36
+ className: "grid gap-1 text-sm text-text-secondary",
37
+ children: [r("coolandlovely.resale.shopHandle", "Shop handle"), /* @__PURE__ */ p("input", {
38
+ required: !0,
39
+ minLength: 3,
40
+ maxLength: 80,
41
+ pattern: "[a-z0-9]([a-z0-9-]{1,78}[a-z0-9])",
42
+ value: a,
43
+ disabled: i.isPending,
44
+ onChange: (e) => s(e.target.value.toLowerCase()),
45
+ className: y
46
+ })]
47
+ }),
48
+ /* @__PURE__ */ p("p", {
49
+ className: "text-sm text-text-secondary",
50
+ children: r("coolandlovely.resale.handleHelp", "Use 3–80 lowercase letters, digits or interior hyphens.")
51
+ }),
52
+ /* @__PURE__ */ m("label", {
53
+ className: "grid gap-1 text-sm text-text-secondary",
54
+ children: [r("coolandlovely.resale.shopName", "Shop name"), /* @__PURE__ */ p("input", {
55
+ required: !0,
56
+ maxLength: 160,
57
+ value: l,
58
+ disabled: i.isPending,
59
+ onChange: (e) => u(e.target.value),
60
+ className: y
61
+ })]
62
+ }),
63
+ /* @__PURE__ */ m("label", {
64
+ className: "grid gap-1 text-sm text-text-secondary",
65
+ children: [r("coolandlovely.resale.shopDescription", "Shop description"), /* @__PURE__ */ p("textarea", {
66
+ required: !0,
67
+ maxLength: 2e3,
68
+ value: f,
69
+ disabled: i.isPending,
70
+ onChange: (e) => g(e.target.value),
71
+ className: `${y} min-h-28`
72
+ })]
73
+ }),
74
+ /* @__PURE__ */ m("div", {
75
+ className: "space-y-2 rounded-lg border border-border-seam p-4 text-sm text-text-secondary",
76
+ children: [
77
+ /* @__PURE__ */ m("h3", {
78
+ className: "font-semibold text-text-primary",
79
+ children: [
80
+ r("coolandlovely.resale.policyTitle", "Seller declaration"),
81
+ " · ",
82
+ v
83
+ ]
84
+ }),
85
+ /* @__PURE__ */ p("p", { children: r("coolandlovely.resale.policyOwnership", "Offer only fashion items you own and can accurately describe. Counterfeit or prohibited items are not permitted. Use product photos you have the right to publish.") }),
86
+ /* @__PURE__ */ p("p", { children: r("coolandlovely.resale.policyReview", "Your shop and listings require review before publication. Editing shop details starts a new review; existing approval does not apply to changed details.") }),
87
+ /* @__PURE__ */ m("label", {
88
+ className: "flex items-start gap-2",
89
+ children: [/* @__PURE__ */ p("input", {
90
+ type: "checkbox",
91
+ required: !0,
92
+ checked: _,
93
+ disabled: i.isPending,
94
+ onChange: (e) => b(e.target.checked)
95
+ }), /* @__PURE__ */ p("span", { children: r("coolandlovely.resale.acceptPolicy", "I confirm this declaration and accept the current resale policy version.") })]
96
+ })
97
+ ]
98
+ }),
99
+ x && /* @__PURE__ */ p("p", {
100
+ role: "alert",
101
+ className: "text-status-error-text",
102
+ children: x
103
+ }),
104
+ i.isError && /* @__PURE__ */ p("p", {
105
+ role: "alert",
106
+ className: "text-status-error-text",
107
+ children: r("coolandlovely.resale.shopUnconfirmed", "The shop update was not confirmed. Close this form and refresh the authoritative shop status before trying again.")
108
+ }),
109
+ /* @__PURE__ */ m("div", {
110
+ className: "flex flex-wrap gap-2",
111
+ children: [/* @__PURE__ */ p(h, {
112
+ type: "submit",
113
+ disabled: !_ || i.isPending || i.isError,
114
+ children: r("coolandlovely.resale.saveShop", "Submit shop for review")
115
+ }), /* @__PURE__ */ p(h, {
116
+ variant: "outline",
117
+ type: "button",
118
+ disabled: i.isPending,
119
+ onClick: n,
120
+ children: r("coolandlovely.common.cancel", "Cancel")
121
+ })]
122
+ })
123
+ ]
124
+ });
125
+ }
126
+ function x({ items: e }) {
127
+ let r = t();
128
+ return e.length === 0 ? /* @__PURE__ */ p("p", {
129
+ role: "status",
130
+ className: "text-text-secondary",
131
+ children: r("coolandlovely.resale.noOwnListings", "No listings were found for your current account and workspace.")
132
+ }) : /* @__PURE__ */ p("ul", {
133
+ className: "grid gap-4 sm:grid-cols-2",
134
+ "aria-label": "My resale listings",
135
+ children: e.map((e) => /* @__PURE__ */ p("li", { children: /* @__PURE__ */ m(g, {
136
+ className: "min-w-0 space-y-3 p-4",
137
+ children: [
138
+ e.photoUrls[0] && /* @__PURE__ */ p("img", {
139
+ src: e.photoUrls[0],
140
+ alt: e.title,
141
+ loading: "lazy",
142
+ className: "aspect-video w-full rounded-lg object-cover"
143
+ }),
144
+ /* @__PURE__ */ p("h3", {
145
+ className: "break-words text-lg font-semibold text-text-primary",
146
+ children: e.title
147
+ }),
148
+ /* @__PURE__ */ p("p", {
149
+ className: "text-text-primary",
150
+ children: u(e.priceMinor, e.currency)
151
+ }),
152
+ /* @__PURE__ */ m("div", {
153
+ className: "flex flex-wrap gap-2",
154
+ children: [/* @__PURE__ */ p(n, { status: e.status }), /* @__PURE__ */ p(n, { status: e.moderationStatus })]
155
+ }),
156
+ e.reviewNotes && /* @__PURE__ */ p("p", {
157
+ className: "whitespace-pre-wrap break-words text-sm text-text-secondary",
158
+ children: e.reviewNotes
159
+ })
160
+ ]
161
+ }) }, e.id))
162
+ });
163
+ }
164
+ function S() {
165
+ let o = t(), c = a(), [u, v] = d(0), [y, S] = d(!1), C = l(u), w = C.data?.cooMyResaleShop, T = C.data?.cooMyResaleListings.items ?? [];
166
+ return /* @__PURE__ */ p(e, {
167
+ title: o("coolandlovely.resale.myShop", "My resale shop"),
168
+ actions: /* @__PURE__ */ p(h, {
169
+ variant: "outline",
170
+ onClick: () => c("resale"),
171
+ children: o("coolandlovely.resale.back", "Back to marketplace")
172
+ }),
173
+ children: /* @__PURE__ */ m("div", {
174
+ className: "space-y-5",
175
+ children: [/* @__PURE__ */ m("div", {
176
+ className: "flex flex-wrap gap-2",
177
+ children: [/* @__PURE__ */ p(h, {
178
+ variant: "outline",
179
+ disabled: C.isFetching,
180
+ onClick: () => s(C.refetch),
181
+ children: o("coolandlovely.resale.refreshShop", "Refresh shop status")
182
+ }), /* @__PURE__ */ p(h, {
183
+ variant: "outline",
184
+ onClick: () => c("resale/reports"),
185
+ children: o("coolandlovely.resale.myReports", "My reports")
186
+ })]
187
+ }), C.isPending ? /* @__PURE__ */ p(i, {}) : C.isError ? /* @__PURE__ */ p(r, { onRetry: () => s(C.refetch) }) : /* @__PURE__ */ m(f, { children: [
188
+ /* @__PURE__ */ m(g, {
189
+ className: "space-y-4 p-5",
190
+ children: [/* @__PURE__ */ m("div", {
191
+ className: "flex flex-wrap items-center justify-between gap-2",
192
+ children: [/* @__PURE__ */ p("h2", {
193
+ className: "break-words text-xl font-semibold text-text-primary",
194
+ children: w?.name ?? o("coolandlovely.resale.openShop", "Open a resale shop")
195
+ }), w && /* @__PURE__ */ p(n, { status: w.reviewStatus })]
196
+ }), y || !w ? /* @__PURE__ */ p(b, {
197
+ shop: w,
198
+ onClose: () => w ? S(!1) : c("resale")
199
+ }, `${w?.id ?? "new"}:${w?.version ?? 0}`) : /* @__PURE__ */ m(f, { children: [
200
+ /* @__PURE__ */ p("p", {
201
+ className: "whitespace-pre-wrap break-words text-text-secondary",
202
+ children: w.description
203
+ }),
204
+ w.reviewNotes && /* @__PURE__ */ p("p", {
205
+ className: "whitespace-pre-wrap break-words text-sm text-text-secondary",
206
+ children: w.reviewNotes
207
+ }),
208
+ /* @__PURE__ */ p(h, {
209
+ variant: "outline",
210
+ onClick: () => S(!0),
211
+ children: o("coolandlovely.resale.editShop", "Edit shop details")
212
+ })
213
+ ] })]
214
+ }),
215
+ /* @__PURE__ */ p("h2", {
216
+ className: "text-xl font-semibold text-text-primary",
217
+ children: o("coolandlovely.resale.myListings", "My listings")
218
+ }),
219
+ /* @__PURE__ */ p(x, { items: T }),
220
+ /* @__PURE__ */ p(_, {
221
+ page: u + 1,
222
+ pageSize: 20,
223
+ hasNextPage: C.data?.cooMyResaleListings.pageInfo.hasMore ?? !1,
224
+ hasPreviousPage: u > 0,
225
+ loading: C.isFetching,
226
+ onPageChange: (e) => v(e - 1)
227
+ })
228
+ ] })]
229
+ })
230
+ });
231
+ }
232
+ //#endregion
233
+ export { S as ResaleSellerPage };
234
+
235
+ //# sourceMappingURL=ResaleSellerPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResaleSellerPage.js","names":[],"sources":["../../../../src/coolandlovely/pages/resale/ResaleSellerPage.tsx"],"sourcesContent":["import { useState, type FormEvent } from 'react';\nimport { Button, GlassCard, Pagination } from '@burdenoff/fe-libs/ui';\nimport {\n CooResaleSaveShopDocument,\n type CooResaleSaveShopMutation,\n type CooResaleSaveShopMutationVariables,\n} from '../../../generated/wspace-operations';\nimport { PageLayout } from '../../components/PageLayout';\nimport { ErrorView, LoadingView } from '../../components/StateViews';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { useContextNavigation } from '../../hooks/useContextNavigation';\nimport {\n RESALE_PAGE_SIZE,\n refreshResaleRead,\n useResaleMutation,\n useResaleSeller,\n type ResaleShop,\n type ResaleOwnListing,\n} from '../../hooks/useResale';\nimport { useTr } from '../../hooks/useTr';\nimport { formatResalePrice } from '../../utils/resalePresentation';\n\nconst POLICY_VERSION = '2026-11-02';\nconst control =\n 'w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-text-primary';\n\nfunction ShopEditor({ shop, onClose }: { shop?: ResaleShop | null; onClose(): void }) {\n const tr = useTr();\n const save = useResaleMutation<CooResaleSaveShopMutation, CooResaleSaveShopMutationVariables>(\n CooResaleSaveShopDocument\n );\n const [handle, setHandle] = useState(shop?.handle ?? '');\n const [name, setName] = useState(shop?.name ?? '');\n const [description, setDescription] = useState(shop?.description ?? '');\n const [accepted, setAccepted] = useState(false);\n const [validation, setValidation] = useState('');\n const submit = (event: FormEvent) => {\n event.preventDefault();\n if (!accepted || save.isPending || save.isError) return;\n if (!name.trim() || !description.trim()) {\n setValidation(\n tr(\n 'coolandlovely.resale.shopDetailsRequired',\n 'Enter a shop name and description containing non-space characters.'\n )\n );\n return;\n }\n setValidation('');\n save.mutate(\n {\n input: {\n handle: handle.trim().toLowerCase(),\n name: name.trim(),\n description: description.trim(),\n acceptedPolicyVersion: POLICY_VERSION,\n expectedVersion: shop?.version,\n },\n },\n { onSuccess: onClose }\n );\n };\n return (\n <form onSubmit={submit} aria-label=\"Resale shop details\" className=\"space-y-4\">\n <label className=\"grid gap-1 text-sm text-text-secondary\">\n {tr('coolandlovely.resale.shopHandle', 'Shop handle')}\n <input\n required\n minLength={3}\n maxLength={80}\n pattern=\"[a-z0-9]([a-z0-9-]{1,78}[a-z0-9])\"\n value={handle}\n disabled={save.isPending}\n onChange={(event) => setHandle(event.target.value.toLowerCase())}\n className={control}\n />\n </label>\n <p className=\"text-sm text-text-secondary\">\n {tr(\n 'coolandlovely.resale.handleHelp',\n 'Use 3–80 lowercase letters, digits or interior hyphens.'\n )}\n </p>\n <label className=\"grid gap-1 text-sm text-text-secondary\">\n {tr('coolandlovely.resale.shopName', 'Shop name')}\n <input\n required\n maxLength={160}\n value={name}\n disabled={save.isPending}\n onChange={(event) => setName(event.target.value)}\n className={control}\n />\n </label>\n <label className=\"grid gap-1 text-sm text-text-secondary\">\n {tr('coolandlovely.resale.shopDescription', 'Shop description')}\n <textarea\n required\n maxLength={2000}\n value={description}\n disabled={save.isPending}\n onChange={(event) => setDescription(event.target.value)}\n className={`${control} min-h-28`}\n />\n </label>\n <div className=\"space-y-2 rounded-lg border border-border-seam p-4 text-sm text-text-secondary\">\n <h3 className=\"font-semibold text-text-primary\">\n {tr('coolandlovely.resale.policyTitle', 'Seller declaration')} · {POLICY_VERSION}\n </h3>\n <p>\n {tr(\n 'coolandlovely.resale.policyOwnership',\n 'Offer only fashion items you own and can accurately describe. Counterfeit or prohibited items are not permitted. Use product photos you have the right to publish.'\n )}\n </p>\n <p>\n {tr(\n 'coolandlovely.resale.policyReview',\n 'Your shop and listings require review before publication. Editing shop details starts a new review; existing approval does not apply to changed details.'\n )}\n </p>\n <label className=\"flex items-start gap-2\">\n <input\n type=\"checkbox\"\n required\n checked={accepted}\n disabled={save.isPending}\n onChange={(event) => setAccepted(event.target.checked)}\n />\n <span>\n {tr(\n 'coolandlovely.resale.acceptPolicy',\n 'I confirm this declaration and accept the current resale policy version.'\n )}\n </span>\n </label>\n </div>\n {validation && (\n <p role=\"alert\" className=\"text-status-error-text\">\n {validation}\n </p>\n )}\n {save.isError && (\n <p role=\"alert\" className=\"text-status-error-text\">\n {tr(\n 'coolandlovely.resale.shopUnconfirmed',\n 'The shop update was not confirmed. Close this form and refresh the authoritative shop status before trying again.'\n )}\n </p>\n )}\n <div className=\"flex flex-wrap gap-2\">\n <Button type=\"submit\" disabled={!accepted || save.isPending || save.isError}>\n {tr('coolandlovely.resale.saveShop', 'Submit shop for review')}\n </Button>\n <Button variant=\"outline\" type=\"button\" disabled={save.isPending} onClick={onClose}>\n {tr('coolandlovely.common.cancel', 'Cancel')}\n </Button>\n </div>\n </form>\n );\n}\n\nfunction SellerListings({ items }: { items: ResaleOwnListing[] }) {\n const tr = useTr();\n return items.length === 0 ? (\n <p role=\"status\" className=\"text-text-secondary\">\n {tr(\n 'coolandlovely.resale.noOwnListings',\n 'No listings were found for your current account and workspace.'\n )}\n </p>\n ) : (\n <ul className=\"grid gap-4 sm:grid-cols-2\" aria-label=\"My resale listings\">\n {items.map((item) => (\n <li key={item.id}>\n <GlassCard className=\"min-w-0 space-y-3 p-4\">\n {item.photoUrls[0] && (\n <img\n src={item.photoUrls[0]}\n alt={item.title}\n loading=\"lazy\"\n className=\"aspect-video w-full rounded-lg object-cover\"\n />\n )}\n <h3 className=\"break-words text-lg font-semibold text-text-primary\">{item.title}</h3>\n <p className=\"text-text-primary\">{formatResalePrice(item.priceMinor, item.currency)}</p>\n <div className=\"flex flex-wrap gap-2\">\n <StatusBadge status={item.status} />\n <StatusBadge status={item.moderationStatus} />\n </div>\n {item.reviewNotes && (\n <p className=\"whitespace-pre-wrap break-words text-sm text-text-secondary\">\n {item.reviewNotes}\n </p>\n )}\n </GlassCard>\n </li>\n ))}\n </ul>\n );\n}\n\nexport function ResaleSellerPage() {\n const tr = useTr();\n const navigate = useContextNavigation();\n const [page, setPage] = useState(0);\n const [editing, setEditing] = useState(false);\n const seller = useResaleSeller(page);\n const shop = seller.data?.cooMyResaleShop;\n const items = seller.data?.cooMyResaleListings.items ?? [];\n return (\n <PageLayout\n title={tr('coolandlovely.resale.myShop', 'My resale shop')}\n actions={\n <Button variant=\"outline\" onClick={() => navigate('resale')}>\n {tr('coolandlovely.resale.back', 'Back to marketplace')}\n </Button>\n }\n >\n <div className=\"space-y-5\">\n <div className=\"flex flex-wrap gap-2\">\n <Button\n variant=\"outline\"\n disabled={seller.isFetching}\n onClick={() => refreshResaleRead(seller.refetch)}\n >\n {tr('coolandlovely.resale.refreshShop', 'Refresh shop status')}\n </Button>\n <Button variant=\"outline\" onClick={() => navigate('resale/reports')}>\n {tr('coolandlovely.resale.myReports', 'My reports')}\n </Button>\n </div>\n {seller.isPending ? (\n <LoadingView />\n ) : seller.isError ? (\n <ErrorView onRetry={() => refreshResaleRead(seller.refetch)} />\n ) : (\n <>\n <GlassCard className=\"space-y-4 p-5\">\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <h2 className=\"break-words text-xl font-semibold text-text-primary\">\n {shop?.name ?? tr('coolandlovely.resale.openShop', 'Open a resale shop')}\n </h2>\n {shop && <StatusBadge status={shop.reviewStatus} />}\n </div>\n {editing || !shop ? (\n <ShopEditor\n key={`${shop?.id ?? 'new'}:${shop?.version ?? 0}`}\n shop={shop}\n onClose={() => (shop ? setEditing(false) : navigate('resale'))}\n />\n ) : (\n <>\n <p className=\"whitespace-pre-wrap break-words text-text-secondary\">\n {shop.description}\n </p>\n {shop.reviewNotes && (\n <p className=\"whitespace-pre-wrap break-words text-sm text-text-secondary\">\n {shop.reviewNotes}\n </p>\n )}\n <Button variant=\"outline\" onClick={() => setEditing(true)}>\n {tr('coolandlovely.resale.editShop', 'Edit shop details')}\n </Button>\n </>\n )}\n </GlassCard>\n <h2 className=\"text-xl font-semibold text-text-primary\">\n {tr('coolandlovely.resale.myListings', 'My listings')}\n </h2>\n <SellerListings items={items} />\n <Pagination\n page={page + 1}\n pageSize={RESALE_PAGE_SIZE}\n hasNextPage={seller.data?.cooMyResaleListings.pageInfo.hasMore ?? false}\n hasPreviousPage={page > 0}\n loading={seller.isFetching}\n onPageChange={(next) => setPage(next - 1)}\n />\n </>\n )}\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAsBA,IAAM,IAAiB,cACjB,IACJ;AAEF,SAAS,EAAW,EAAE,SAAM,cAA0D;CACpF,IAAM,IAAK,EAAM,GACX,IAAO,EACX,CACF,GACM,CAAC,GAAQ,KAAa,EAAS,GAAM,UAAU,EAAE,GACjD,CAAC,GAAM,KAAW,EAAS,GAAM,QAAQ,EAAE,GAC3C,CAAC,GAAa,KAAkB,EAAS,GAAM,eAAe,EAAE,GAChE,CAAC,GAAU,KAAe,EAAS,EAAK,GACxC,CAAC,GAAY,KAAiB,EAAS,EAAE;CA2B/C,OACE,kBAAC,QAAD;EAAM,WA3BQ,MAAqB;GACnC,MAAM,eAAe,GACjB,GAAC,KAAY,EAAK,aAAa,EAAK,UACxC;QAAI,CAAC,EAAK,KAAK,KAAK,CAAC,EAAY,KAAK,GAAG;KACvC,EACE,EACE,4CACA,oEACF,CACF;KAC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,KAAQ,kBAAC,GAAD,EAAa,QAAQ,EAAK,aAAe,CAAA,CAC/C;SACJ,KAAW,CAAC,IACX,kBAAC,GAAD;MAEQ;MACN,eAAgB,IAAO,EAAW,EAAK,IAAI,EAAS,QAAQ;KAC7D,GAHM,GAAG,GAAM,MAAM,MAAM,GAAG,GAAM,WAAW,GAG/C,IAED,kBAAA,GAAA,EAAA,UAAA;MACE,kBAAC,KAAD;OAAG,WAAU;iBACV,EAAK;MACL,CAAA;MACF,EAAK,eACJ,kBAAC,KAAD;OAAG,WAAU;iBACV,EAAK;MACL,CAAA;MAEL,kBAAC,GAAD;OAAQ,SAAQ;OAAU,eAAe,EAAW,EAAI;iBACrD,EAAG,iCAAiC,mBAAmB;MAClD,CAAA;KACR,EAAA,CAAA,CAEK;;IACX,kBAAC,MAAD;KAAI,WAAU;eACX,EAAG,mCAAmC,aAAa;IAClD,CAAA;IACJ,kBAAC,GAAD,EAAuB,SAAQ,CAAA;IAC/B,kBAAC,GAAD;KACE,MAAM,IAAO;KACb,UAAA;KACA,aAAa,EAAO,MAAM,oBAAoB,SAAS,WAAW;KAClE,iBAAiB,IAAO;KACxB,SAAS,EAAO;KAChB,eAAe,MAAS,EAAQ,IAAO,CAAC;IACzC,CAAA;GACD,EAAA,CAAA,CAED;;CACK,CAAA;AAEhB"}
@@ -0,0 +1,5 @@
1
+ /** Resale prices are integer minor units, unlike the product's legacy major-unit prices. */
2
+ export declare function formatResalePrice(minor: number, currency: string): string;
3
+ export declare const RESALE_CATEGORIES: readonly ["TOPS", "BOTTOMS", "DRESSES", "OUTERWEAR", "FOOTWEAR", "BAGS", "ACCESSORIES", "JEWELLERY"];
4
+ export declare const RESALE_CONDITIONS: readonly ["NEW_WITH_TAGS", "EXCELLENT", "GOOD", "FAIR"];
5
+ //# sourceMappingURL=resalePresentation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resalePresentation.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/utils/resalePresentation.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAazE;AAED,eAAO,MAAM,iBAAiB,sGASpB,CAAC;AAEX,eAAO,MAAM,iBAAiB,yDAA0D,CAAC"}
@@ -0,0 +1,33 @@
1
+ //#region src/coolandlovely/utils/resalePresentation.ts
2
+ function e(e, t) {
3
+ if (!Number.isSafeInteger(e) || e < 0) return "Price unavailable";
4
+ try {
5
+ if (!Intl.supportedValuesOf("currency").includes(t)) return `${t} ${e} minor units`;
6
+ let n = new Intl.NumberFormat(void 0, {
7
+ style: "currency",
8
+ currency: t
9
+ }), r = n.resolvedOptions().maximumFractionDigits;
10
+ return r === void 0 ? `${t} ${e} minor units` : n.format(e / 10 ** r);
11
+ } catch {
12
+ return `${t} ${e} minor units`;
13
+ }
14
+ }
15
+ var t = [
16
+ "TOPS",
17
+ "BOTTOMS",
18
+ "DRESSES",
19
+ "OUTERWEAR",
20
+ "FOOTWEAR",
21
+ "BAGS",
22
+ "ACCESSORIES",
23
+ "JEWELLERY"
24
+ ], n = [
25
+ "NEW_WITH_TAGS",
26
+ "EXCELLENT",
27
+ "GOOD",
28
+ "FAIR"
29
+ ];
30
+ //#endregion
31
+ export { t as RESALE_CATEGORIES, n as RESALE_CONDITIONS, e as formatResalePrice };
32
+
33
+ //# sourceMappingURL=resalePresentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resalePresentation.js","names":[],"sources":["../../../src/coolandlovely/utils/resalePresentation.ts"],"sourcesContent":["/** Resale prices are integer minor units, unlike the product's legacy major-unit prices. */\nexport function formatResalePrice(minor: number, currency: string): string {\n if (!Number.isSafeInteger(minor) || minor < 0) return 'Price unavailable';\n try {\n if (!Intl.supportedValuesOf('currency').includes(currency)) {\n return `${currency} ${minor} minor units`;\n }\n const format = new Intl.NumberFormat(undefined, { style: 'currency', currency });\n const digits = format.resolvedOptions().maximumFractionDigits;\n if (digits === undefined) return `${currency} ${minor} minor units`;\n return format.format(minor / 10 ** digits);\n } catch {\n return `${currency} ${minor} minor units`;\n }\n}\n\nexport const RESALE_CATEGORIES = [\n 'TOPS',\n 'BOTTOMS',\n 'DRESSES',\n 'OUTERWEAR',\n 'FOOTWEAR',\n 'BAGS',\n 'ACCESSORIES',\n 'JEWELLERY',\n] as const;\n\nexport const RESALE_CONDITIONS = ['NEW_WITH_TAGS', 'EXCELLENT', 'GOOD', 'FAIR'] as const;\n"],"mappings":";AACA,SAAgB,EAAkB,GAAe,GAA0B;CACzE,IAAI,CAAC,OAAO,cAAc,CAAK,KAAK,IAAQ,GAAG,OAAO;CACtD,IAAI;EACF,IAAI,CAAC,KAAK,kBAAkB,UAAU,CAAC,CAAC,SAAS,CAAQ,GACvD,OAAO,GAAG,EAAS,GAAG,EAAM;EAE9B,IAAM,IAAS,IAAI,KAAK,aAAa,KAAA,GAAW;GAAE,OAAO;GAAY;EAAS,CAAC,GACzE,IAAS,EAAO,gBAAgB,CAAC,CAAC;EAExC,OADI,MAAW,KAAA,IAAkB,GAAG,EAAS,GAAG,EAAM,gBAC/C,EAAO,OAAO,IAAQ,MAAM,CAAM;CAC3C,QAAQ;EACN,OAAO,GAAG,EAAS,GAAG,EAAM;CAC9B;AACF;AAEA,IAAa,IAAoB;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAEa,IAAoB;CAAC;CAAiB;CAAa;CAAQ;AAAM"}