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