@burdenoff/microfe-devportal 2026.916.6 → 2026.916.7

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.
@@ -1,14 +1,16 @@
1
1
  import { useDevportal as e } from "../providers/DevportalProvider.js";
2
2
  import { cn as t } from "../utils/cn.js";
3
3
  import { PageLayout as n, PageSection as r } from "../components/PageLayout.js";
4
- import { CheckboxField as i, InputField as a, SelectField as o, TextareaField as s } from "../components/FormField.js";
4
+ import { DetailList as i } from "../components/DataTable.js";
5
+ import { CheckboxField as a, InputField as o, SelectField as s, TextareaField as c } from "../components/FormField.js";
5
6
  import { usePackageUpload as ee } from "../hooks/usePackageUpload.js";
6
- import { useCallback as c, useEffect as te, useRef as ne, useState as l } from "react";
7
- import { AlertCircle as u, AlertTriangle as d, Info as re, Loader2 as f, RotateCw as ie, Upload as ae, X as oe } from "lucide-react";
8
- import { useParams as se } from "react-router";
9
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
7
+ import { useCallback as l, useEffect as te, useRef as ne, useState as u } from "react";
8
+ import { AlertCircle as re, AlertTriangle as ie, CheckCircle as ae, Clock as oe, Edit as se, ImageOff as ce, Info as le, Loader2 as d, RotateCw as ue, Upload as de, X as fe, XCircle as pe } from "lucide-react";
9
+ import { useParams as me } from "react-router";
10
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
11
+ import { EmphasisPanel as he, GlassCard as h } from "@burdenoff/fe-libs/ui";
10
12
  //#region src/devportal/pages/EditPhysicalItemPage.tsx
11
- var g = [
13
+ var ge = [
12
14
  {
13
15
  value: "USD",
14
16
  label: "USD — US Dollar"
@@ -33,7 +35,7 @@ var g = [
33
35
  value: "AED",
34
36
  label: "AED — UAE Dirham"
35
37
  }
36
- ], _ = [
38
+ ], _e = [
37
39
  {
38
40
  value: "GRAM",
39
41
  label: "Grams (g)"
@@ -50,7 +52,7 @@ var g = [
50
52
  value: "POUND",
51
53
  label: "Pounds (lb)"
52
54
  }
53
- ], v = [
55
+ ], g = [
54
56
  {
55
57
  value: "CENTIMETER",
56
58
  label: "Centimeters (cm)"
@@ -63,21 +65,61 @@ var g = [
63
65
  value: "METER",
64
66
  label: "Meters (m)"
65
67
  }
66
- ], y = [
68
+ ], _ = [
67
69
  "name",
68
70
  "shortDescription",
69
71
  "price",
70
72
  "currency",
71
73
  "stockQuantity"
72
- ], b = "\n query GetPhysicalProduct($id: ID!) {\n product(id: $id) {\n id\n name\n slug\n type\n status\n nature\n description\n longDescription\n price\n currency\n tags\n stockQuantity\n sku\n trackInventory\n allowBackorder\n lowStockThreshold\n requiresShipping\n weight\n weightUnit\n length\n width\n height\n dimensionUnit\n brand\n manufacturer\n countryOfOrigin\n warrantyInfo\n returnPolicy\n icon\n screenshots\n }\n }\n", x = "\n mutation UpdatePhysicalProduct(\n $id: ID!\n $input: UpdatePhysicalProductInput!\n ) {\n updatePhysicalProduct(id: $id, input: $input) {\n id\n name\n status\n }\n }\n", S = "\n mutation SubmitProductForReview($id: ID!, $notes: String) {\n submitProduct(id: $id, notes: $notes) {\n id\n status\n }\n }\n";
73
- function ce(e) {
74
- return y.every((t) => {
74
+ ], ve = {
75
+ MERCHANDISE: "Merchandise",
76
+ HARDWARE: "Hardware",
77
+ ACCESSORY: "Accessory",
78
+ BOOK: "Book",
79
+ EQUIPMENT: "Equipment",
80
+ APPAREL: "Apparel",
81
+ COLLECTIBLE: "Collectible",
82
+ CONSUMABLE: "Consumable"
83
+ }, ye = {
84
+ PUBLISHED: {
85
+ label: "Published",
86
+ className: "text-status-success-text bg-status-success-bg-subtle"
87
+ },
88
+ PENDING_REVIEW: {
89
+ label: "Pending Review",
90
+ className: "text-status-warning-text bg-status-warning-bg-subtle"
91
+ },
92
+ DRAFT: {
93
+ label: "Draft",
94
+ className: "text-text-muted bg-bg-muted"
95
+ },
96
+ REJECTED: {
97
+ label: "Rejected",
98
+ className: "text-status-error-text bg-status-error-bg/10"
99
+ },
100
+ INACTIVE: {
101
+ label: "Inactive",
102
+ className: "text-text-muted bg-bg-muted"
103
+ }
104
+ }, be = "\n query GetPhysicalProduct($id: ID!) {\n product(id: $id) {\n id\n name\n slug\n type\n status\n nature\n description\n longDescription\n price\n currency\n tags\n stockQuantity\n sku\n trackInventory\n allowBackorder\n lowStockThreshold\n requiresShipping\n weight\n weightUnit\n length\n width\n height\n dimensionUnit\n brand\n manufacturer\n countryOfOrigin\n warrantyInfo\n returnPolicy\n icon\n screenshots\n category\n viewCount\n rating\n reviewCount\n createdAt\n updatedAt\n submittedAt\n reviewedAt\n reviewNotes\n rejectedReason\n publishedAt\n }\n }\n", xe = "\n mutation UpdatePhysicalProduct(\n $id: ID!\n $input: UpdatePhysicalProductInput!\n ) {\n updatePhysicalProduct(id: $id, input: $input) {\n id\n name\n status\n }\n }\n", Se = "\n mutation SubmitProductForReview($id: ID!, $notes: String) {\n submitProduct(id: $id, notes: $notes) {\n id\n status\n }\n }\n";
105
+ function Ce(e) {
106
+ return _.every((t) => {
75
107
  let n = e[t];
76
108
  return typeof n == "boolean" ? !0 : String(n).trim() !== "";
77
109
  });
78
110
  }
79
- var C = () => {
80
- let { navigate: y, basePath: C, apiGatewayUrl: le, authToken: w, workspacesGatewayUrl: ue, workspaceId: de, getWorkspaceToken: fe } = e(), { itemId: T } = se(), E = `${le || ""}/global/graphql`, [pe, D] = l(!0), [O, k] = l(null), [A, j] = l(null), [M, N] = l({
111
+ var v = ({ label: e, value: t }) => /* @__PURE__ */ m(h, {
112
+ treatment: "metric",
113
+ className: "p-4",
114
+ children: [/* @__PURE__ */ p("p", {
115
+ className: "text-sm text-text-secondary",
116
+ children: e
117
+ }), /* @__PURE__ */ p("p", {
118
+ className: "text-2xl font-bold tabular-nums",
119
+ children: t
120
+ })]
121
+ }), y = () => {
122
+ let { navigate: h, basePath: _, apiGatewayUrl: y, authToken: b, workspacesGatewayUrl: we, workspaceId: Te, getWorkspaceToken: Ee } = e(), { itemId: x } = me(), S = `${y || ""}/global/graphql`, [De, C] = u(!0), [w, T] = u(null), [E, Oe] = u(null), [D, O] = u("overview"), [k, ke] = u(null), [A, j] = u({
81
123
  name: "",
82
124
  shortDescription: "",
83
125
  longDescription: "",
@@ -101,13 +143,13 @@ var C = () => {
101
143
  countryOfOrigin: "",
102
144
  warrantyInfo: "",
103
145
  returnPolicy: ""
104
- }), [P, F] = l([]), [I, L] = l(!1), R = ne(null), { upload: z } = ee(ue, w, de, fe, "/DevPortal/Assets"), [B, V] = l(!1), [H, U] = l(null), [me, W] = l(!1), he = P.some((e) => e.uploading), G = ce(M) && !he;
105
- async function K(e, t) {
106
- let n = await (await fetch(E, {
146
+ }), [M, N] = u([]), [P, F] = u(!1), I = ne(null), { upload: L } = ee(we, b, Te, Ee, "/DevPortal/Assets"), [R, z] = u(!1), [B, V] = u(null), [Ae, H] = u(!1), je = M.some((e) => e.uploading), U = Ce(A) && !je;
147
+ async function W(e, t) {
148
+ let n = await (await fetch(S, {
107
149
  method: "POST",
108
150
  headers: {
109
151
  "Content-Type": "application/json",
110
- ...w ? { Authorization: `Bearer ${w}` } : {}
152
+ ...b ? { Authorization: `Bearer ${b}` } : {}
111
153
  },
112
154
  credentials: "include",
113
155
  body: JSON.stringify({
@@ -119,18 +161,18 @@ var C = () => {
119
161
  return n.data;
120
162
  }
121
163
  te(() => {
122
- if (!T) return;
164
+ if (!x) return;
123
165
  let e = !1;
124
- return D(!0), k(null), (async () => {
166
+ return C(!0), T(null), (async () => {
125
167
  try {
126
- let t = await K(b, { id: T });
168
+ let t = await W(be, { id: x });
127
169
  if (e) return;
128
170
  let n = t.product;
129
171
  if (!n) {
130
- k("Product not found.");
172
+ T("Product not found.");
131
173
  return;
132
174
  }
133
- j(n.status), N({
175
+ Oe(n.status), j({
134
176
  name: n.name,
135
177
  shortDescription: n.description ?? "",
136
178
  longDescription: n.longDescription ?? "",
@@ -154,518 +196,792 @@ var C = () => {
154
196
  countryOfOrigin: n.countryOfOrigin ?? "",
155
197
  warrantyInfo: n.warrantyInfo ?? "",
156
198
  returnPolicy: n.returnPolicy ?? ""
157
- }), F([n.icon, ...n.screenshots ?? []].filter((e) => !!e).map((e) => ({
199
+ }), ke({
200
+ slug: n.slug,
201
+ type: n.type,
202
+ category: n.category,
203
+ viewCount: n.viewCount,
204
+ rating: n.rating,
205
+ reviewCount: n.reviewCount,
206
+ createdAt: n.createdAt,
207
+ updatedAt: n.updatedAt,
208
+ submittedAt: n.submittedAt,
209
+ reviewedAt: n.reviewedAt,
210
+ reviewNotes: n.reviewNotes,
211
+ rejectedReason: n.rejectedReason,
212
+ publishedAt: n.publishedAt
213
+ }), N([n.icon, ...n.screenshots ?? []].filter((e) => !!e).map((e) => ({
158
214
  id: crypto.randomUUID(),
159
215
  url: e,
160
216
  downloadUrl: e,
161
217
  uploading: !1
162
218
  })));
163
219
  } catch (t) {
164
- e || k(t instanceof Error ? t.message : "Failed to load product");
220
+ e || T(t instanceof Error ? t.message : "Failed to load product");
165
221
  } finally {
166
- e || D(!1);
222
+ e || C(!1);
167
223
  }
168
224
  })(), () => {
169
225
  e = !0;
170
226
  };
171
227
  }, [
172
- T,
173
- E,
174
- w
228
+ x,
229
+ S,
230
+ b
175
231
  ]);
176
- let q = (e, t) => {
177
- N((n) => ({
232
+ let G = (e, t) => {
233
+ j((n) => ({
178
234
  ...n,
179
235
  [e]: t
180
236
  }));
181
- }, J = (e) => (t) => {
182
- q(e, t.target.checked);
183
- }, Y = c((e, t) => {
184
- z(t).then((t) => {
185
- F((n) => n.map((n) => n.id === e ? {
237
+ }, K = (e) => (t) => {
238
+ G(e, t.target.checked);
239
+ }, q = l((e, t) => {
240
+ L(t).then((t) => {
241
+ N((n) => n.map((n) => n.id === e ? {
186
242
  ...n,
187
243
  uploading: !1,
188
244
  downloadUrl: t.downloadUrl,
189
245
  error: void 0
190
246
  } : n));
191
247
  }).catch((t) => {
192
- F((n) => n.map((n) => n.id === e ? {
248
+ N((n) => n.map((n) => n.id === e ? {
193
249
  ...n,
194
250
  uploading: !1,
195
251
  error: t instanceof Error ? t.message : "Upload failed"
196
252
  } : n));
197
253
  });
198
- }, [z]), X = c((e) => {
254
+ }, [L]), J = l((e) => {
199
255
  let t = Array.from(e).filter((e) => e.type.startsWith("image/")).map((e) => ({
200
256
  id: crypto.randomUUID(),
201
257
  file: e,
202
258
  url: URL.createObjectURL(e),
203
259
  uploading: !0
204
260
  }));
205
- F((e) => [...e, ...t]), t.forEach((e) => Y(e.id, e.file));
206
- }, [Y]), ge = (e) => {
207
- e.target.files && X(e.target.files), e.target.value = "";
208
- }, _e = (e) => {
209
- e.preventDefault(), L(!1), e.dataTransfer.files && X(e.dataTransfer.files);
210
- }, ve = (e) => {
211
- e.preventDefault(), L(!0);
212
- }, Z = () => L(!1), ye = (e) => {
213
- F((t) => {
261
+ N((e) => [...e, ...t]), t.forEach((e) => q(e.id, e.file));
262
+ }, [q]), Me = (e) => {
263
+ e.target.files && J(e.target.files), e.target.value = "";
264
+ }, Ne = (e) => {
265
+ e.preventDefault(), F(!1), e.dataTransfer.files && J(e.dataTransfer.files);
266
+ }, Pe = (e) => {
267
+ e.preventDefault(), F(!0);
268
+ }, Fe = () => F(!1), Y = (e) => {
269
+ N((t) => {
214
270
  let n = t.find((t) => t.id === e);
215
271
  return n?.file && URL.revokeObjectURL(n.url), t.filter((t) => t.id !== e);
216
272
  });
217
- }, be = (e) => {
218
- let t = P.find((t) => t.id === e);
219
- t?.file && (F((t) => t.map((t) => t.id === e ? {
273
+ }, Ie = (e) => {
274
+ let t = M.find((t) => t.id === e);
275
+ t?.file && (N((t) => t.map((t) => t.id === e ? {
220
276
  ...t,
221
277
  uploading: !0,
222
278
  error: void 0
223
- } : t)), Y(e, t.file));
224
- }, Q = async (e = !1) => {
225
- if (!(!G || B || !T)) {
226
- V(!0), U(null), W(!1);
279
+ } : t)), q(e, t.file));
280
+ }, X = async (e = !1) => {
281
+ if (!(!U || R || !x)) {
282
+ z(!0), V(null), H(!1);
227
283
  try {
228
- let t = M.tags.split(",").map((e) => e.trim()).filter(Boolean), n = P.map((e) => e.downloadUrl).filter((e) => !!e), r = M.length.trim() || M.width.trim() || M.height.trim();
229
- await K(x, {
230
- id: T,
284
+ let t = A.tags.split(",").map((e) => e.trim()).filter(Boolean), n = M.map((e) => e.downloadUrl).filter((e) => !!e), r = A.length.trim() || A.width.trim() || A.height.trim();
285
+ await W(xe, {
286
+ id: x,
231
287
  input: {
232
- name: M.name.trim(),
233
- description: M.shortDescription.trim(),
234
- longDescription: M.longDescription.trim() || null,
235
- price: parseFloat(M.price),
236
- currency: M.currency,
288
+ name: A.name.trim(),
289
+ description: A.shortDescription.trim(),
290
+ longDescription: A.longDescription.trim() || null,
291
+ price: parseFloat(A.price),
292
+ currency: A.currency,
237
293
  tags: t.length > 0 ? t : null,
238
- stockQuantity: parseInt(M.stockQuantity, 10),
239
- sku: M.sku.trim() || null,
240
- trackInventory: M.trackInventory,
241
- allowBackorder: M.allowBackorder,
242
- lowStockThreshold: M.lowStockThreshold.trim() ? parseInt(M.lowStockThreshold, 10) : null,
243
- requiresShipping: M.requiresShipping,
244
- weight: M.requiresShipping && M.weightKg.trim() ? parseFloat(M.weightKg) : null,
245
- weightUnit: M.requiresShipping && M.weightKg.trim() ? M.weightUnit : null,
246
- length: M.requiresShipping && M.length.trim() ? parseFloat(M.length) : null,
247
- width: M.requiresShipping && M.width.trim() ? parseFloat(M.width) : null,
248
- height: M.requiresShipping && M.height.trim() ? parseFloat(M.height) : null,
249
- dimensionUnit: M.requiresShipping && r ? M.dimensionUnit : null,
250
- brand: M.brand.trim() || null,
251
- manufacturer: M.manufacturer.trim() || null,
252
- countryOfOrigin: M.countryOfOrigin.trim() || null,
253
- warrantyInfo: M.warrantyInfo.trim() || null,
254
- returnPolicy: M.returnPolicy.trim() || null,
294
+ stockQuantity: parseInt(A.stockQuantity, 10),
295
+ sku: A.sku.trim() || null,
296
+ trackInventory: A.trackInventory,
297
+ allowBackorder: A.allowBackorder,
298
+ lowStockThreshold: A.lowStockThreshold.trim() ? parseInt(A.lowStockThreshold, 10) : null,
299
+ requiresShipping: A.requiresShipping,
300
+ weight: A.requiresShipping && A.weightKg.trim() ? parseFloat(A.weightKg) : null,
301
+ weightUnit: A.requiresShipping && A.weightKg.trim() ? A.weightUnit : null,
302
+ length: A.requiresShipping && A.length.trim() ? parseFloat(A.length) : null,
303
+ width: A.requiresShipping && A.width.trim() ? parseFloat(A.width) : null,
304
+ height: A.requiresShipping && A.height.trim() ? parseFloat(A.height) : null,
305
+ dimensionUnit: A.requiresShipping && r ? A.dimensionUnit : null,
306
+ brand: A.brand.trim() || null,
307
+ manufacturer: A.manufacturer.trim() || null,
308
+ countryOfOrigin: A.countryOfOrigin.trim() || null,
309
+ warrantyInfo: A.warrantyInfo.trim() || null,
310
+ returnPolicy: A.returnPolicy.trim() || null,
255
311
  icon: n[0] ?? null,
256
312
  screenshots: n.length > 1 ? n.slice(1) : null
257
313
  }
258
- }), e && await K(S, {
259
- id: T,
314
+ }), e && await W(Se, {
315
+ id: x,
260
316
  notes: "Resubmitted after edits"
261
- }), W(!0), setTimeout(() => {
262
- y?.(`${C}/seller/items`);
317
+ }), H(!0), setTimeout(() => {
318
+ h?.(`${_}/seller/items`);
263
319
  }, 1500);
264
320
  } catch (e) {
265
- U(e instanceof Error ? e.message : "Save failed. Please try again.");
321
+ V(e instanceof Error ? e.message : "Save failed. Please try again.");
266
322
  } finally {
267
- V(!1);
323
+ z(!1);
268
324
  }
269
325
  }
270
326
  };
271
- if (pe) return /* @__PURE__ */ m(n, {
327
+ if (De) return /* @__PURE__ */ p(n, {
272
328
  title: "Edit Item",
273
329
  backLink: "/seller/items",
274
330
  backLabel: "Back to My Items",
275
- children: /* @__PURE__ */ m("div", {
331
+ children: /* @__PURE__ */ p("div", {
276
332
  className: "flex items-center justify-center py-20",
277
- children: /* @__PURE__ */ m(f, { className: "h-8 w-8 animate-spin text-text-secondary" })
333
+ children: /* @__PURE__ */ p(d, { className: "h-8 w-8 animate-spin text-text-secondary" })
278
334
  })
279
335
  });
280
- if (O) return /* @__PURE__ */ m(n, {
336
+ if (w) return /* @__PURE__ */ p(n, {
281
337
  title: "Edit Item",
282
338
  backLink: "/seller/items",
283
339
  backLabel: "Back to My Items",
284
- children: /* @__PURE__ */ h("div", {
340
+ children: /* @__PURE__ */ m("div", {
285
341
  className: "flex items-center gap-3 rounded-lg border border-status-error-border/50 bg-status-error-bg/10 px-4 py-3 text-sm",
286
- children: [/* @__PURE__ */ m(u, {
342
+ children: [/* @__PURE__ */ p(re, {
287
343
  size: 16,
288
344
  className: "shrink-0 text-status-error-text"
289
- }), /* @__PURE__ */ m("span", {
345
+ }), /* @__PURE__ */ p("span", {
290
346
  className: "text-status-error-text",
291
- children: O
347
+ children: w
292
348
  })]
293
349
  })
294
350
  });
295
- let $ = A === "DRAFT" || A === "REJECTED";
296
- return /* @__PURE__ */ m(n, {
297
- title: `Edit: ${M.name || "Item"}`,
298
- description: "Update your listing details. Changes take effect immediately for drafts; published items may require re-review.",
351
+ let Z = E === "DRAFT" || E === "REJECTED", Q = M.find((e) => e.downloadUrl) ?? M[0], $ = E ? ye[E] : void 0;
352
+ return /* @__PURE__ */ p(n, {
353
+ title: /* @__PURE__ */ m("div", {
354
+ className: "flex items-center gap-3",
355
+ children: [Q ? /* @__PURE__ */ p("img", {
356
+ src: Q.url,
357
+ alt: "",
358
+ className: "h-10 w-10 shrink-0 rounded-input border border-border-subtle object-cover"
359
+ }) : /* @__PURE__ */ p("div", {
360
+ className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-input border border-border-subtle bg-bg-sunken",
361
+ children: /* @__PURE__ */ p(ce, {
362
+ size: 16,
363
+ className: "text-text-muted"
364
+ })
365
+ }), /* @__PURE__ */ p("span", { children: A.name || "Item" })]
366
+ }),
367
+ description: A.shortDescription || void 0,
368
+ purpose: "Everything about this listing in one place — its performance, its store presence, and its editable details. Use the tabs to review or update it.",
299
369
  backLink: "/seller/items",
300
370
  backLabel: "Back to My Items",
301
- children: /* @__PURE__ */ h("div", {
302
- className: "space-y-8 max-w-3xl",
371
+ actions: D === "overview" ? /* @__PURE__ */ m("button", {
372
+ type: "button",
373
+ onClick: () => O("edit"),
374
+ className: "inline-flex items-center gap-2 rounded-button bg-action-primary-bg px-5 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
375
+ children: [/* @__PURE__ */ p(se, { size: 15 }), "Edit Listing"]
376
+ }) : void 0,
377
+ children: /* @__PURE__ */ m("div", {
378
+ className: "space-y-6",
303
379
  children: [
304
- me && /* @__PURE__ */ m("div", {
380
+ Ae && /* @__PURE__ */ p("div", {
305
381
  className: "rounded-card border border-status-success-text/30 bg-status-success-bg-subtle px-4 py-3 text-sm text-status-success-text",
306
382
  children: "Saved successfully! Redirecting to your items..."
307
383
  }),
308
- H && /* @__PURE__ */ m("div", {
384
+ B && /* @__PURE__ */ p("div", {
309
385
  className: "rounded-card border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text",
310
- children: H
386
+ children: B
311
387
  }),
312
- A && /* @__PURE__ */ h("div", {
313
- className: "flex items-start gap-2 rounded-input border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
388
+ /* @__PURE__ */ m("div", {
389
+ className: "flex flex-wrap items-center gap-2",
314
390
  children: [
315
- /* @__PURE__ */ m(re, {
316
- size: 13,
317
- className: "mt-0.5 shrink-0 text-text-muted"
391
+ $ && /* @__PURE__ */ p("span", {
392
+ className: t("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium", $.className),
393
+ children: $.label
318
394
  }),
319
- "Current status:",
320
- " ",
321
- /* @__PURE__ */ m("span", {
322
- className: "font-medium text-text-primary",
323
- children: A.replace(/_/g, " ")
395
+ /* @__PURE__ */ p("span", {
396
+ className: "text-sm text-text-secondary",
397
+ children: ve[k?.type ?? ""] || k?.type
324
398
  }),
325
- $ && /* @__PURE__ */ m("span", {
326
- className: "ml-1",
327
- children: "— use \"Save & Resubmit\" to send it for review again."
399
+ k?.category && /* @__PURE__ */ p("span", {
400
+ className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs text-text-secondary",
401
+ children: k.category
328
402
  })
329
403
  ]
330
404
  }),
331
- /* @__PURE__ */ m(r, {
332
- title: "Basic Information",
333
- description: "Core details shown in the store listing.",
334
- children: /* @__PURE__ */ h("div", {
335
- className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
405
+ E === "PENDING_REVIEW" && /* @__PURE__ */ m("div", {
406
+ className: "flex items-start gap-3 rounded-lg border border-border-subtle bg-status-warning-bg-subtle p-4",
407
+ children: [/* @__PURE__ */ p(oe, {
408
+ size: 18,
409
+ className: "text-status-warning-text mt-0.5 flex-shrink-0"
410
+ }), /* @__PURE__ */ m("div", {
411
+ className: "text-sm",
412
+ children: [/* @__PURE__ */ p("p", {
413
+ className: "font-medium text-status-warning-text",
414
+ children: "Under Review"
415
+ }), /* @__PURE__ */ m("p", {
416
+ className: "mt-0.5 text-text-secondary",
417
+ children: ["Your listing is being reviewed by our team. You'll be notified of the outcome.", k?.submittedAt && /* @__PURE__ */ m("span", {
418
+ className: "ml-1",
419
+ children: [
420
+ "Submitted",
421
+ " ",
422
+ new Date(k.submittedAt).toLocaleDateString(),
423
+ "."
424
+ ]
425
+ })]
426
+ })]
427
+ })]
428
+ }),
429
+ E === "REJECTED" && /* @__PURE__ */ m("div", {
430
+ className: "flex items-start gap-3 rounded-lg border border-status-error-bg bg-status-error-bg-subtle p-4",
431
+ children: [/* @__PURE__ */ p(pe, {
432
+ size: 18,
433
+ className: "text-status-error-text mt-0.5 flex-shrink-0"
434
+ }), /* @__PURE__ */ m("div", {
435
+ className: "text-sm",
336
436
  children: [
337
- /* @__PURE__ */ m(a, {
338
- label: "Name",
339
- required: !0,
340
- value: M.name,
341
- onChange: (e) => q("name", e.target.value),
342
- placeholder: "e.g. Wireless Ergonomic Keyboard",
343
- maxLength: 120
437
+ /* @__PURE__ */ p("p", {
438
+ className: "font-medium text-status-error-text",
439
+ children: "Review Rejected"
344
440
  }),
345
- /* @__PURE__ */ m(a, {
346
- label: "Short Description",
347
- required: !0,
348
- value: M.shortDescription,
349
- onChange: (e) => q("shortDescription", e.target.value),
350
- placeholder: "One-line summary shown on the store card",
351
- maxLength: 160,
352
- hint: `${M.shortDescription.length}/160`
441
+ /* @__PURE__ */ p("p", {
442
+ className: "mt-0.5 text-text-secondary",
443
+ children: k?.rejectedReason || k?.reviewNotes || "Your submission was not approved. Please review the feedback, update your listing, and re-submit."
353
444
  }),
354
- /* @__PURE__ */ m(s, {
355
- label: "Long Description",
356
- value: M.longDescription,
357
- onChange: (e) => q("longDescription", e.target.value),
358
- rows: 5,
359
- placeholder: "Detailed product description, features, specs…"
445
+ /* @__PURE__ */ p("button", {
446
+ type: "button",
447
+ onClick: () => O("edit"),
448
+ className: "mt-2 inline-flex items-center gap-1 text-xs font-medium text-primary underline",
449
+ children: "Edit listing and re-submit →"
360
450
  })
361
451
  ]
452
+ })]
453
+ }),
454
+ E === "PUBLISHED" && /* @__PURE__ */ m("div", {
455
+ className: "flex items-start gap-3 rounded-lg border border-status-success-bg bg-status-success-bg-subtle p-4",
456
+ children: [/* @__PURE__ */ p(ae, {
457
+ size: 18,
458
+ className: "text-status-success-text mt-0.5 flex-shrink-0"
459
+ }), /* @__PURE__ */ m("div", {
460
+ className: "text-sm",
461
+ children: [/* @__PURE__ */ p("p", {
462
+ className: "font-medium text-status-success-text",
463
+ children: "Live in the Store"
464
+ }), /* @__PURE__ */ p("p", {
465
+ className: "mt-0.5 text-text-secondary",
466
+ children: "Your listing is published and visible to buyers in the marketplace."
467
+ })]
468
+ })]
469
+ }),
470
+ /* @__PURE__ */ p("div", {
471
+ className: "border-b",
472
+ children: /* @__PURE__ */ p("nav", {
473
+ className: "-mb-px flex gap-4 overflow-x-auto",
474
+ role: "tablist",
475
+ "aria-label": "Item sections",
476
+ children: [{
477
+ id: "overview",
478
+ label: "Overview"
479
+ }, {
480
+ id: "edit",
481
+ label: "Edit Listing"
482
+ }].map((e) => /* @__PURE__ */ p("button", {
483
+ id: `item-tab-${e.id}`,
484
+ role: "tab",
485
+ "aria-selected": D === e.id,
486
+ "aria-controls": `item-panel-${e.id}`,
487
+ onClick: () => O(e.id),
488
+ className: t("flex items-center gap-2 border-b-2 px-1 py-3 text-sm font-medium transition-colors", D === e.id ? "border-primary text-primary" : "border-transparent text-text-secondary hover:text-text-primary hover:border-muted-foreground"),
489
+ children: e.label
490
+ }, e.id))
362
491
  })
363
492
  }),
364
- /* @__PURE__ */ m(r, {
365
- title: "Product Images",
366
- description: "The first image is used as the main icon.",
367
- children: /* @__PURE__ */ h("div", {
368
- className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-4",
369
- children: [/* @__PURE__ */ h("div", {
370
- onDrop: _e,
371
- onDragOver: ve,
372
- onDragLeave: Z,
373
- onClick: () => R.current?.click(),
374
- className: t("flex flex-col items-center justify-center gap-3 rounded-input border-2 border-dashed px-6 py-10 cursor-pointer transition-colors", I ? "border-action-primary-bg bg-action-primary-bg/5" : "border-border-subtle hover:border-border-strong"),
493
+ D === "overview" && /* @__PURE__ */ m("div", {
494
+ id: "item-panel-overview",
495
+ role: "tabpanel",
496
+ "aria-labelledby": "item-tab-overview",
497
+ className: "grid gap-6 lg:grid-cols-3",
498
+ children: [/* @__PURE__ */ m("div", {
499
+ className: "lg:col-span-2 space-y-6",
500
+ children: [
501
+ /* @__PURE__ */ p(he, { children: /* @__PURE__ */ m("div", {
502
+ className: "grid gap-4 sm:grid-cols-4",
503
+ children: [
504
+ /* @__PURE__ */ p(v, {
505
+ label: "Price",
506
+ value: `${A.currency} ${Number(A.price || 0).toFixed(2)}`
507
+ }),
508
+ /* @__PURE__ */ p(v, {
509
+ label: "Stock",
510
+ value: A.stockQuantity || "0"
511
+ }),
512
+ /* @__PURE__ */ p(v, {
513
+ label: "Views",
514
+ value: (k?.viewCount ?? 0).toLocaleString()
515
+ }),
516
+ /* @__PURE__ */ p(v, {
517
+ label: "Rating",
518
+ value: k?.rating ? `${k.rating.toFixed(1)} ★` : "N/A"
519
+ })
520
+ ]
521
+ }) }),
522
+ /* @__PURE__ */ p(r, {
523
+ title: "Product Images",
524
+ children: M.length > 0 ? /* @__PURE__ */ p("div", {
525
+ className: "flex flex-wrap gap-3",
526
+ children: M.map((e, t) => /* @__PURE__ */ p("img", {
527
+ src: e.url,
528
+ alt: `Product image ${t + 1}`,
529
+ className: "h-24 w-24 rounded-input border border-border-subtle object-cover"
530
+ }, e.id))
531
+ }) : /* @__PURE__ */ p("p", {
532
+ className: "text-sm text-text-secondary",
533
+ children: "No images uploaded yet."
534
+ })
535
+ }),
536
+ /* @__PURE__ */ m(r, {
537
+ title: "Description",
538
+ children: [A.shortDescription && /* @__PURE__ */ p("p", {
539
+ className: "text-sm font-medium text-text-primary",
540
+ children: A.shortDescription
541
+ }), A.longDescription ? /* @__PURE__ */ p("p", {
542
+ className: "mt-2 whitespace-pre-wrap text-sm text-text-secondary",
543
+ children: A.longDescription
544
+ }) : !A.shortDescription && /* @__PURE__ */ p("p", {
545
+ className: "text-sm text-text-secondary",
546
+ children: "No description provided."
547
+ })]
548
+ }),
549
+ A.tags && /* @__PURE__ */ p(r, {
550
+ title: "Tags",
551
+ children: /* @__PURE__ */ p("div", {
552
+ className: "flex flex-wrap gap-2",
553
+ children: A.tags.split(",").map((e) => e.trim()).filter(Boolean).map((e) => /* @__PURE__ */ p("span", {
554
+ className: "rounded-full bg-action-primary-bg/10 px-3 py-1 text-xs font-medium text-primary",
555
+ children: e
556
+ }, e))
557
+ })
558
+ })
559
+ ]
560
+ }), /* @__PURE__ */ m("div", {
561
+ className: "space-y-6",
562
+ children: [/* @__PURE__ */ p(r, {
563
+ title: "Details",
564
+ children: /* @__PURE__ */ p(i, { items: [
565
+ {
566
+ label: "Item ID",
567
+ value: /* @__PURE__ */ p("code", {
568
+ className: "text-xs",
569
+ children: x
570
+ })
571
+ },
572
+ {
573
+ label: "Slug",
574
+ value: k?.slug ?? "—"
575
+ },
576
+ {
577
+ label: "SKU",
578
+ value: A.sku || "—"
579
+ },
580
+ {
581
+ label: "Brand",
582
+ value: A.brand || "—"
583
+ },
584
+ {
585
+ label: "Created",
586
+ value: k?.createdAt ? new Date(k.createdAt).toLocaleDateString() : "—"
587
+ },
588
+ {
589
+ label: "Updated",
590
+ value: k?.updatedAt ? new Date(k.updatedAt).toLocaleDateString() : "—"
591
+ },
592
+ ...k?.publishedAt ? [{
593
+ label: "Published",
594
+ value: new Date(k.publishedAt).toLocaleDateString()
595
+ }] : []
596
+ ] })
597
+ }), /* @__PURE__ */ p(r, {
598
+ title: "Inventory & Shipping",
599
+ children: /* @__PURE__ */ p(i, { items: [
600
+ {
601
+ label: "Stock quantity",
602
+ value: A.stockQuantity || "0"
603
+ },
604
+ {
605
+ label: "Track inventory",
606
+ value: A.trackInventory ? "Yes" : "No"
607
+ },
608
+ {
609
+ label: "Requires shipping",
610
+ value: A.requiresShipping ? "Yes" : "No"
611
+ },
612
+ ...A.requiresShipping && A.weightKg ? [{
613
+ label: "Weight",
614
+ value: `${A.weightKg} ${A.weightUnit.toLowerCase()}`
615
+ }] : []
616
+ ] })
617
+ })]
618
+ })]
619
+ }),
620
+ D === "edit" && /* @__PURE__ */ m("div", {
621
+ id: "item-panel-edit",
622
+ role: "tabpanel",
623
+ "aria-labelledby": "item-tab-edit",
624
+ className: "space-y-8 max-w-3xl",
625
+ children: [
626
+ E && /* @__PURE__ */ m("div", {
627
+ className: "flex items-start gap-2 rounded-input border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
375
628
  children: [
376
- /* @__PURE__ */ m(ae, {
377
- size: 28,
378
- className: I ? "text-action-primary-bg" : "text-text-muted"
629
+ /* @__PURE__ */ p(le, {
630
+ size: 13,
631
+ className: "mt-0.5 shrink-0 text-text-muted"
379
632
  }),
380
- /* @__PURE__ */ h("div", {
381
- className: "text-center space-y-1",
382
- children: [/* @__PURE__ */ m("p", {
383
- className: "text-sm font-medium text-text-primary",
384
- children: "Drag and drop images here"
385
- }), /* @__PURE__ */ m("p", {
386
- className: "text-xs text-text-muted",
387
- children: "or click to browse — accepts any image format, multiple files"
388
- })]
633
+ "Current status:",
634
+ " ",
635
+ /* @__PURE__ */ p("span", {
636
+ className: "font-medium text-text-primary",
637
+ children: E.replace(/_/g, " ")
389
638
  }),
390
- /* @__PURE__ */ m("input", {
391
- ref: R,
392
- type: "file",
393
- accept: "image/*",
394
- multiple: !0,
395
- className: "sr-only",
396
- onChange: ge
639
+ Z && /* @__PURE__ */ p("span", {
640
+ className: "ml-1",
641
+ children: "— use \"Save & Resubmit\" to send it for review again."
397
642
  })
398
643
  ]
399
- }), P.length > 0 && /* @__PURE__ */ m("div", {
400
- className: "flex flex-wrap gap-3",
401
- children: (() => {
402
- let e = P.find((e) => e.downloadUrl)?.id;
403
- return P.map((n, r) => /* @__PURE__ */ h("div", {
404
- className: "relative group",
644
+ }),
645
+ /* @__PURE__ */ p(r, {
646
+ title: "Basic Information",
647
+ description: "Core details shown in the store listing.",
648
+ children: /* @__PURE__ */ m("div", {
649
+ className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
650
+ children: [
651
+ /* @__PURE__ */ p(o, {
652
+ label: "Name",
653
+ required: !0,
654
+ value: A.name,
655
+ onChange: (e) => G("name", e.target.value),
656
+ placeholder: "e.g. Wireless Ergonomic Keyboard",
657
+ maxLength: 120
658
+ }),
659
+ /* @__PURE__ */ p(o, {
660
+ label: "Short Description",
661
+ required: !0,
662
+ value: A.shortDescription,
663
+ onChange: (e) => G("shortDescription", e.target.value),
664
+ placeholder: "One-line summary shown on the store card",
665
+ maxLength: 160,
666
+ hint: `${A.shortDescription.length}/160`
667
+ }),
668
+ /* @__PURE__ */ p(c, {
669
+ label: "Long Description",
670
+ value: A.longDescription,
671
+ onChange: (e) => G("longDescription", e.target.value),
672
+ rows: 5,
673
+ placeholder: "Detailed product description, features, specs…"
674
+ })
675
+ ]
676
+ })
677
+ }),
678
+ /* @__PURE__ */ p(r, {
679
+ title: "Product Images",
680
+ description: "The first image is used as the main icon.",
681
+ children: /* @__PURE__ */ m("div", {
682
+ className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-4",
683
+ children: [/* @__PURE__ */ m("div", {
684
+ onDrop: Ne,
685
+ onDragOver: Pe,
686
+ onDragLeave: Fe,
687
+ onClick: () => I.current?.click(),
688
+ className: t("flex flex-col items-center justify-center gap-3 rounded-input border-2 border-dashed px-6 py-10 cursor-pointer transition-colors", P ? "border-action-primary-bg bg-action-primary-bg/5" : "border-border-subtle hover:border-border-strong"),
405
689
  children: [
406
- /* @__PURE__ */ m("img", {
407
- src: n.url,
408
- alt: `Product image ${r + 1}`,
409
- className: t("h-20 w-20 rounded-input object-cover border", n.error ? "border-status-error-text/50" : "border-border-subtle")
410
- }),
411
- n.uploading && /* @__PURE__ */ m("div", {
412
- className: "absolute inset-0 flex items-center justify-center rounded-input bg-bg-overlay",
413
- children: /* @__PURE__ */ m(f, {
414
- size: 16,
415
- className: "animate-spin text-white"
416
- })
417
- }),
418
- n.error && /* @__PURE__ */ h("button", {
419
- type: "button",
420
- onClick: (e) => {
421
- e.stopPropagation(), be(n.id);
422
- },
423
- title: `${n.error} — click to retry`,
424
- className: "absolute inset-0 flex flex-col items-center justify-center gap-0.5 rounded-input bg-status-error-bg/80 text-status-error-text",
425
- children: [/* @__PURE__ */ m(d, { size: 14 }), /* @__PURE__ */ m(ie, { size: 11 })]
690
+ /* @__PURE__ */ p(de, {
691
+ size: 28,
692
+ className: P ? "text-action-primary-bg" : "text-text-muted"
426
693
  }),
427
- n.id === e && /* @__PURE__ */ m("span", {
428
- className: "absolute bottom-0 left-0 right-0 rounded-b-input bg-bg-surface/80 text-center text-[10px] font-medium py-0.5 text-text-secondary",
429
- children: "Main"
694
+ /* @__PURE__ */ m("div", {
695
+ className: "text-center space-y-1",
696
+ children: [/* @__PURE__ */ p("p", {
697
+ className: "text-sm font-medium text-text-primary",
698
+ children: "Drag and drop images here"
699
+ }), /* @__PURE__ */ p("p", {
700
+ className: "text-xs text-text-muted",
701
+ children: "or click to browse — accepts any image format, multiple files"
702
+ })]
430
703
  }),
431
- /* @__PURE__ */ m("button", {
432
- type: "button",
433
- onClick: (e) => {
434
- e.stopPropagation(), ye(n.id);
435
- },
436
- className: "absolute -top-1.5 -right-1.5 hidden group-hover:flex h-5 w-5 items-center justify-center rounded-full bg-bg-surface border border-border-subtle text-text-muted hover:text-status-error-text hover:border-status-error-text/40 transition-colors",
437
- "aria-label": "Remove image",
438
- children: /* @__PURE__ */ m(oe, { size: 11 })
704
+ /* @__PURE__ */ p("input", {
705
+ ref: I,
706
+ type: "file",
707
+ accept: "image/*",
708
+ multiple: !0,
709
+ className: "sr-only",
710
+ onChange: Me
439
711
  })
440
712
  ]
441
- }, n.id));
442
- })()
443
- })]
444
- })
445
- }),
446
- /* @__PURE__ */ m(r, {
447
- title: "Pricing",
448
- children: /* @__PURE__ */ h("div", {
449
- className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
450
- children: [/* @__PURE__ */ h("div", {
451
- className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
452
- children: [/* @__PURE__ */ m(a, {
453
- label: "Price",
454
- required: !0,
455
- type: "number",
456
- value: M.price,
457
- onChange: (e) => q("price", e.target.value),
458
- placeholder: "0.00",
459
- min: .01,
460
- step: "0.01"
461
- }), /* @__PURE__ */ m(o, {
462
- label: "Currency",
463
- required: !0,
464
- value: M.currency,
465
- onChange: (e) => q("currency", e.target.value),
466
- options: g,
467
- placeholder: "Select currency"
468
- })]
469
- }), /* @__PURE__ */ m(a, {
470
- label: "Tags",
471
- value: M.tags,
472
- onChange: (e) => q("tags", e.target.value),
473
- placeholder: "mechanical, wireless, ergonomic",
474
- hint: "Comma-separated keywords."
475
- })]
476
- })
477
- }),
478
- /* @__PURE__ */ m(r, {
479
- title: "Inventory",
480
- children: /* @__PURE__ */ h("div", {
481
- className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
482
- children: [
483
- /* @__PURE__ */ h("div", {
484
- className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
485
- children: [/* @__PURE__ */ m(a, {
486
- label: "Stock Quantity",
487
- required: !0,
488
- type: "number",
489
- value: M.stockQuantity,
490
- onChange: (e) => q("stockQuantity", e.target.value),
491
- min: 0,
492
- step: 1
493
- }), /* @__PURE__ */ m(a, {
494
- label: "SKU",
495
- value: M.sku,
496
- onChange: (e) => q("sku", e.target.value),
497
- placeholder: "e.g. KB-WL-001",
498
- hint: "Your internal stock-keeping unit reference."
713
+ }), M.length > 0 && /* @__PURE__ */ p("div", {
714
+ className: "flex flex-wrap gap-3",
715
+ children: (() => {
716
+ let e = M.find((e) => e.downloadUrl)?.id;
717
+ return M.map((n, r) => /* @__PURE__ */ m("div", {
718
+ className: "relative group",
719
+ children: [
720
+ /* @__PURE__ */ p("img", {
721
+ src: n.url,
722
+ alt: `Product image ${r + 1}`,
723
+ className: t("h-20 w-20 rounded-input object-cover border", n.error ? "border-status-error-text/50" : "border-border-subtle")
724
+ }),
725
+ n.uploading && /* @__PURE__ */ p("div", {
726
+ className: "absolute inset-0 flex items-center justify-center rounded-input bg-bg-overlay",
727
+ children: /* @__PURE__ */ p(d, {
728
+ size: 16,
729
+ className: "animate-spin text-white"
730
+ })
731
+ }),
732
+ n.error && /* @__PURE__ */ m("button", {
733
+ type: "button",
734
+ onClick: (e) => {
735
+ e.stopPropagation(), Ie(n.id);
736
+ },
737
+ title: `${n.error} — click to retry`,
738
+ className: "absolute inset-0 flex flex-col items-center justify-center gap-0.5 rounded-input bg-status-error-bg/80 text-status-error-text",
739
+ children: [/* @__PURE__ */ p(ie, { size: 14 }), /* @__PURE__ */ p(ue, { size: 11 })]
740
+ }),
741
+ n.id === e && /* @__PURE__ */ p("span", {
742
+ className: "absolute bottom-0 left-0 right-0 rounded-b-input bg-bg-surface/80 text-center text-[10px] font-medium py-0.5 text-text-secondary",
743
+ children: "Main"
744
+ }),
745
+ /* @__PURE__ */ p("button", {
746
+ type: "button",
747
+ onClick: (e) => {
748
+ e.stopPropagation(), Y(n.id);
749
+ },
750
+ className: "absolute -top-1.5 -right-1.5 hidden group-hover:flex h-5 w-5 items-center justify-center rounded-full bg-bg-surface border border-border-subtle text-text-muted hover:text-status-error-text hover:border-status-error-text/40 transition-colors",
751
+ "aria-label": "Remove image",
752
+ children: /* @__PURE__ */ p(fe, { size: 11 })
753
+ })
754
+ ]
755
+ }, n.id));
756
+ })()
499
757
  })]
500
- }),
501
- /* @__PURE__ */ m(a, {
502
- label: "Low Stock Threshold",
503
- type: "number",
504
- value: M.lowStockThreshold,
505
- onChange: (e) => q("lowStockThreshold", e.target.value),
506
- placeholder: "e.g. 5",
507
- min: 0,
508
- step: 1,
509
- hint: "Get flagged when stock falls to or below this number."
510
- }),
511
- /* @__PURE__ */ m(i, {
512
- label: "Track Inventory",
513
- description: "Automatically reduce stock when orders are placed.",
514
- checked: M.trackInventory,
515
- onChange: J("trackInventory")
516
- }),
517
- /* @__PURE__ */ m(i, {
518
- label: "Allow Backorder",
519
- description: "Let buyers order even when stock quantity is zero.",
520
- checked: M.allowBackorder,
521
- onChange: J("allowBackorder")
522
758
  })
523
- ]
524
- })
525
- }),
526
- /* @__PURE__ */ m(r, {
527
- title: "Shipping",
528
- children: /* @__PURE__ */ h("div", {
529
- className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
530
- children: [/* @__PURE__ */ m(i, {
531
- label: "Requires Shipping",
532
- description: "This item will be physically shipped to the buyer.",
533
- checked: M.requiresShipping,
534
- onChange: J("requiresShipping")
535
- }), M.requiresShipping && /* @__PURE__ */ h(p, { children: [
536
- /* @__PURE__ */ h("div", {
537
- className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
538
- children: [/* @__PURE__ */ m(a, {
539
- label: "Weight",
540
- type: "number",
541
- value: M.weightKg,
542
- onChange: (e) => q("weightKg", e.target.value),
543
- placeholder: "0.0",
544
- min: 0,
545
- step: "0.01",
546
- hint: "Used to calculate shipping costs."
547
- }), /* @__PURE__ */ m(o, {
548
- label: "Weight Unit",
549
- value: M.weightUnit,
550
- onChange: (e) => q("weightUnit", e.target.value),
551
- options: _
552
- })]
553
- }),
554
- /* @__PURE__ */ h("div", {
555
- className: "grid grid-cols-1 gap-5 sm:grid-cols-3",
556
- children: [
557
- /* @__PURE__ */ m(a, {
558
- label: "Length",
759
+ }),
760
+ /* @__PURE__ */ p(r, {
761
+ title: "Pricing",
762
+ children: /* @__PURE__ */ m("div", {
763
+ className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
764
+ children: [/* @__PURE__ */ m("div", {
765
+ className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
766
+ children: [/* @__PURE__ */ p(o, {
767
+ label: "Price",
768
+ required: !0,
559
769
  type: "number",
560
- value: M.length,
561
- onChange: (e) => q("length", e.target.value),
562
- placeholder: "0.0",
563
- min: 0,
770
+ value: A.price,
771
+ onChange: (e) => G("price", e.target.value),
772
+ placeholder: "0.00",
773
+ min: .01,
564
774
  step: "0.01"
775
+ }), /* @__PURE__ */ p(s, {
776
+ label: "Currency",
777
+ required: !0,
778
+ value: A.currency,
779
+ onChange: (e) => G("currency", e.target.value),
780
+ options: ge,
781
+ placeholder: "Select currency"
782
+ })]
783
+ }), /* @__PURE__ */ p(o, {
784
+ label: "Tags",
785
+ value: A.tags,
786
+ onChange: (e) => G("tags", e.target.value),
787
+ placeholder: "mechanical, wireless, ergonomic",
788
+ hint: "Comma-separated keywords."
789
+ })]
790
+ })
791
+ }),
792
+ /* @__PURE__ */ p(r, {
793
+ title: "Inventory",
794
+ children: /* @__PURE__ */ m("div", {
795
+ className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
796
+ children: [
797
+ /* @__PURE__ */ m("div", {
798
+ className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
799
+ children: [/* @__PURE__ */ p(o, {
800
+ label: "Stock Quantity",
801
+ required: !0,
802
+ type: "number",
803
+ value: A.stockQuantity,
804
+ onChange: (e) => G("stockQuantity", e.target.value),
805
+ min: 0,
806
+ step: 1
807
+ }), /* @__PURE__ */ p(o, {
808
+ label: "SKU",
809
+ value: A.sku,
810
+ onChange: (e) => G("sku", e.target.value),
811
+ placeholder: "e.g. KB-WL-001",
812
+ hint: "Your internal stock-keeping unit reference."
813
+ })]
565
814
  }),
566
- /* @__PURE__ */ m(a, {
567
- label: "Width",
815
+ /* @__PURE__ */ p(o, {
816
+ label: "Low Stock Threshold",
568
817
  type: "number",
569
- value: M.width,
570
- onChange: (e) => q("width", e.target.value),
571
- placeholder: "0.0",
818
+ value: A.lowStockThreshold,
819
+ onChange: (e) => G("lowStockThreshold", e.target.value),
820
+ placeholder: "e.g. 5",
572
821
  min: 0,
573
- step: "0.01"
822
+ step: 1,
823
+ hint: "Get flagged when stock falls to or below this number."
574
824
  }),
575
- /* @__PURE__ */ m(a, {
576
- label: "Height",
577
- type: "number",
578
- value: M.height,
579
- onChange: (e) => q("height", e.target.value),
580
- placeholder: "0.0",
581
- min: 0,
582
- step: "0.01"
825
+ /* @__PURE__ */ p(a, {
826
+ label: "Track Inventory",
827
+ description: "Automatically reduce stock when orders are placed.",
828
+ checked: A.trackInventory,
829
+ onChange: K("trackInventory")
830
+ }),
831
+ /* @__PURE__ */ p(a, {
832
+ label: "Allow Backorder",
833
+ description: "Let buyers order even when stock quantity is zero.",
834
+ checked: A.allowBackorder,
835
+ onChange: K("allowBackorder")
583
836
  })
584
837
  ]
585
- }),
586
- /* @__PURE__ */ m(o, {
587
- label: "Dimension Unit",
588
- value: M.dimensionUnit,
589
- onChange: (e) => q("dimensionUnit", e.target.value),
590
- options: v,
591
- hint: "Applies to length, width, and height above."
592
838
  })
593
- ] })]
594
- })
595
- }),
596
- /* @__PURE__ */ m(r, {
597
- title: "Product Details",
598
- description: "Optional supplemental information for buyers.",
599
- children: /* @__PURE__ */ h("div", {
600
- className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
601
- children: [
602
- /* @__PURE__ */ h("div", {
603
- className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
604
- children: [/* @__PURE__ */ m(a, {
605
- label: "Brand",
606
- value: M.brand,
607
- onChange: (e) => q("brand", e.target.value),
608
- placeholder: "e.g. Logitech"
609
- }), /* @__PURE__ */ m(a, {
610
- label: "Manufacturer",
611
- value: M.manufacturer,
612
- onChange: (e) => q("manufacturer", e.target.value),
613
- placeholder: "e.g. Logitech Manufacturing Ltd."
614
- })]
615
- }),
616
- /* @__PURE__ */ m(a, {
617
- label: "Country of Origin",
618
- value: M.countryOfOrigin,
619
- onChange: (e) => q("countryOfOrigin", e.target.value),
620
- placeholder: "e.g. China"
621
- }),
622
- /* @__PURE__ */ m(a, {
623
- label: "Warranty Info",
624
- value: M.warrantyInfo,
625
- onChange: (e) => q("warrantyInfo", e.target.value),
626
- placeholder: "e.g. 1-year limited manufacturer warranty"
627
- }),
628
- /* @__PURE__ */ m(s, {
629
- label: "Return Policy",
630
- value: M.returnPolicy,
631
- onChange: (e) => q("returnPolicy", e.target.value),
632
- rows: 3,
633
- placeholder: "e.g. 30-day returns accepted"
839
+ }),
840
+ /* @__PURE__ */ p(r, {
841
+ title: "Shipping",
842
+ children: /* @__PURE__ */ m("div", {
843
+ className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
844
+ children: [/* @__PURE__ */ p(a, {
845
+ label: "Requires Shipping",
846
+ description: "This item will be physically shipped to the buyer.",
847
+ checked: A.requiresShipping,
848
+ onChange: K("requiresShipping")
849
+ }), A.requiresShipping && /* @__PURE__ */ m(f, { children: [
850
+ /* @__PURE__ */ m("div", {
851
+ className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
852
+ children: [/* @__PURE__ */ p(o, {
853
+ label: "Weight",
854
+ type: "number",
855
+ value: A.weightKg,
856
+ onChange: (e) => G("weightKg", e.target.value),
857
+ placeholder: "0.0",
858
+ min: 0,
859
+ step: "0.01",
860
+ hint: "Used to calculate shipping costs."
861
+ }), /* @__PURE__ */ p(s, {
862
+ label: "Weight Unit",
863
+ value: A.weightUnit,
864
+ onChange: (e) => G("weightUnit", e.target.value),
865
+ options: _e
866
+ })]
867
+ }),
868
+ /* @__PURE__ */ m("div", {
869
+ className: "grid grid-cols-1 gap-5 sm:grid-cols-3",
870
+ children: [
871
+ /* @__PURE__ */ p(o, {
872
+ label: "Length",
873
+ type: "number",
874
+ value: A.length,
875
+ onChange: (e) => G("length", e.target.value),
876
+ placeholder: "0.0",
877
+ min: 0,
878
+ step: "0.01"
879
+ }),
880
+ /* @__PURE__ */ p(o, {
881
+ label: "Width",
882
+ type: "number",
883
+ value: A.width,
884
+ onChange: (e) => G("width", e.target.value),
885
+ placeholder: "0.0",
886
+ min: 0,
887
+ step: "0.01"
888
+ }),
889
+ /* @__PURE__ */ p(o, {
890
+ label: "Height",
891
+ type: "number",
892
+ value: A.height,
893
+ onChange: (e) => G("height", e.target.value),
894
+ placeholder: "0.0",
895
+ min: 0,
896
+ step: "0.01"
897
+ })
898
+ ]
899
+ }),
900
+ /* @__PURE__ */ p(s, {
901
+ label: "Dimension Unit",
902
+ value: A.dimensionUnit,
903
+ onChange: (e) => G("dimensionUnit", e.target.value),
904
+ options: g,
905
+ hint: "Applies to length, width, and height above."
906
+ })
907
+ ] })]
634
908
  })
635
- ]
636
- })
637
- }),
638
- /* @__PURE__ */ h("div", {
639
- className: "flex flex-wrap items-center gap-3 pb-8",
640
- children: [
641
- /* @__PURE__ */ m("button", {
642
- type: "button",
643
- onClick: () => y?.(`${C}/seller/items`),
644
- className: "rounded-button border border-border-strong px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
645
- children: "Cancel"
646
909
  }),
647
- /* @__PURE__ */ m("button", {
648
- type: "button",
649
- onClick: () => void Q(!1),
650
- disabled: !G || B,
651
- "aria-disabled": !G || B,
652
- title: G ? void 0 : "Fill in all required fields to continue",
653
- className: t("inline-flex items-center gap-2 rounded-button px-5 py-2 text-sm font-medium transition-colors", "border border-border-strong bg-bg-surface text-text-primary", "hover:bg-bg-sunken", "disabled:opacity-50 disabled:cursor-not-allowed"),
654
- children: B ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(f, {
655
- size: 15,
656
- className: "animate-spin"
657
- }), "Saving..."] }) : "Save Changes"
910
+ /* @__PURE__ */ p(r, {
911
+ title: "Product Details",
912
+ description: "Optional supplemental information for buyers.",
913
+ children: /* @__PURE__ */ m("div", {
914
+ className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
915
+ children: [
916
+ /* @__PURE__ */ m("div", {
917
+ className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
918
+ children: [/* @__PURE__ */ p(o, {
919
+ label: "Brand",
920
+ value: A.brand,
921
+ onChange: (e) => G("brand", e.target.value),
922
+ placeholder: "e.g. Logitech"
923
+ }), /* @__PURE__ */ p(o, {
924
+ label: "Manufacturer",
925
+ value: A.manufacturer,
926
+ onChange: (e) => G("manufacturer", e.target.value),
927
+ placeholder: "e.g. Logitech Manufacturing Ltd."
928
+ })]
929
+ }),
930
+ /* @__PURE__ */ p(o, {
931
+ label: "Country of Origin",
932
+ value: A.countryOfOrigin,
933
+ onChange: (e) => G("countryOfOrigin", e.target.value),
934
+ placeholder: "e.g. China"
935
+ }),
936
+ /* @__PURE__ */ p(o, {
937
+ label: "Warranty Info",
938
+ value: A.warrantyInfo,
939
+ onChange: (e) => G("warrantyInfo", e.target.value),
940
+ placeholder: "e.g. 1-year limited manufacturer warranty"
941
+ }),
942
+ /* @__PURE__ */ p(c, {
943
+ label: "Return Policy",
944
+ value: A.returnPolicy,
945
+ onChange: (e) => G("returnPolicy", e.target.value),
946
+ rows: 3,
947
+ placeholder: "e.g. 30-day returns accepted"
948
+ })
949
+ ]
950
+ })
658
951
  }),
659
- $ && /* @__PURE__ */ m("button", {
660
- type: "button",
661
- onClick: () => void Q(!0),
662
- disabled: !G || B,
663
- "aria-disabled": !G || B,
664
- className: t("inline-flex items-center gap-2 rounded-button px-5 py-2 text-sm font-medium transition-colors", "bg-action-primary-bg text-action-primary-text", "hover:bg-action-primary-bg/90", "disabled:opacity-50 disabled:cursor-not-allowed"),
665
- children: B ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(f, {
666
- size: 15,
667
- className: "animate-spin"
668
- }), "Saving..."] }) : "Save & Resubmit for Review"
952
+ /* @__PURE__ */ m("div", {
953
+ className: "flex flex-wrap items-center gap-3 pb-8",
954
+ children: [
955
+ /* @__PURE__ */ p("button", {
956
+ type: "button",
957
+ onClick: () => h?.(`${_}/seller/items`),
958
+ className: "rounded-button border border-border-strong px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
959
+ children: "Cancel"
960
+ }),
961
+ /* @__PURE__ */ p("button", {
962
+ type: "button",
963
+ onClick: () => void X(!1),
964
+ disabled: !U || R,
965
+ "aria-disabled": !U || R,
966
+ title: U ? void 0 : "Fill in all required fields to continue",
967
+ className: t("inline-flex items-center gap-2 rounded-button px-5 py-2 text-sm font-medium transition-colors", "border border-border-strong bg-bg-surface text-text-primary", "hover:bg-bg-sunken", "disabled:opacity-50 disabled:cursor-not-allowed"),
968
+ children: R ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(d, {
969
+ size: 15,
970
+ className: "animate-spin"
971
+ }), "Saving..."] }) : "Save Changes"
972
+ }),
973
+ Z && /* @__PURE__ */ p("button", {
974
+ type: "button",
975
+ onClick: () => void X(!0),
976
+ disabled: !U || R,
977
+ "aria-disabled": !U || R,
978
+ className: t("inline-flex items-center gap-2 rounded-button px-5 py-2 text-sm font-medium transition-colors", "bg-action-primary-bg text-action-primary-text", "hover:bg-action-primary-bg/90", "disabled:opacity-50 disabled:cursor-not-allowed"),
979
+ children: R ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(d, {
980
+ size: 15,
981
+ className: "animate-spin"
982
+ }), "Saving..."] }) : "Save & Resubmit for Review"
983
+ })
984
+ ]
669
985
  })
670
986
  ]
671
987
  })
@@ -674,6 +990,6 @@ var C = () => {
674
990
  });
675
991
  };
676
992
  //#endregion
677
- export { C as EditPhysicalItemPage };
993
+ export { y as EditPhysicalItemPage };
678
994
 
679
995
  //# sourceMappingURL=EditPhysicalItemPage.js.map