@burdenoff/microfe-devportal 2026.902.1 → 2026.914.2
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/hooks/useSellerOrganization.d.ts +18 -0
- package/dist/devportal/hooks/useSellerOrganization.d.ts.map +1 -0
- package/dist/devportal/hooks/useSellerOrganization.js +58 -0
- package/dist/devportal/hooks/useSellerOrganization.js.map +1 -0
- package/dist/devportal/pages/CreatePhysicalItemPage.d.ts.map +1 -1
- package/dist/devportal/pages/CreatePhysicalItemPage.js +182 -174
- package/dist/devportal/pages/CreatePhysicalItemPage.js.map +1 -1
- package/dist/devportal/pages/SellerDashboardPage.d.ts.map +1 -1
- package/dist/devportal/pages/SellerDashboardPage.js +16 -24
- package/dist/devportal/pages/SellerDashboardPage.js.map +1 -1
- package/dist/devportal/pages/SellerOrdersPage.d.ts.map +1 -1
- package/dist/devportal/pages/SellerOrdersPage.js +2 -2
- package/dist/devportal/pages/SellerOrdersPage.js.map +1 -1
- package/dist/devportal/providers/DevportalProvider.d.ts +8 -0
- package/dist/devportal/providers/DevportalProvider.d.ts.map +1 -1
- package/dist/devportal/providers/DevportalProvider.js +44 -31
- package/dist/devportal/providers/DevportalProvider.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,11 +2,12 @@ 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
4
|
import { CheckboxField as i, InputField as a, SelectField as o, TextareaField as s } from "../components/FormField.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { useSellerOrganization as c } from "../hooks/useSellerOrganization.js";
|
|
6
|
+
import { useCallback as l, useRef as u, useState as d } from "react";
|
|
7
|
+
import { Info as f, Loader2 as p, Upload as m, X as h } from "lucide-react";
|
|
8
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
8
9
|
//#region src/devportal/pages/CreatePhysicalItemPage.tsx
|
|
9
|
-
var
|
|
10
|
+
var y = [
|
|
10
11
|
{
|
|
11
12
|
value: "MERCHANDISE",
|
|
12
13
|
label: "Merchandise"
|
|
@@ -39,7 +40,7 @@ var _ = [
|
|
|
39
40
|
value: "CONSUMABLE",
|
|
40
41
|
label: "Consumable"
|
|
41
42
|
}
|
|
42
|
-
],
|
|
43
|
+
], b = [
|
|
43
44
|
{
|
|
44
45
|
value: "agri-seeds",
|
|
45
46
|
label: "Agri-Inputs — Seeds"
|
|
@@ -60,7 +61,7 @@ var _ = [
|
|
|
60
61
|
value: "agri-irrigation",
|
|
61
62
|
label: "Agri-Inputs — Irrigation"
|
|
62
63
|
}
|
|
63
|
-
],
|
|
64
|
+
], ee = [
|
|
64
65
|
{
|
|
65
66
|
value: "USD",
|
|
66
67
|
label: "USD — US Dollar"
|
|
@@ -85,7 +86,7 @@ var _ = [
|
|
|
85
86
|
value: "AED",
|
|
86
87
|
label: "AED — UAE Dirham"
|
|
87
88
|
}
|
|
88
|
-
],
|
|
89
|
+
], x = [
|
|
89
90
|
"name",
|
|
90
91
|
"slug",
|
|
91
92
|
"type",
|
|
@@ -93,18 +94,18 @@ var _ = [
|
|
|
93
94
|
"price",
|
|
94
95
|
"currency",
|
|
95
96
|
"stockQuantity"
|
|
96
|
-
],
|
|
97
|
+
], S = "\n query SellerMyPublisher {\n myPublisher {\n id\n }\n }\n", C = "\n mutation RegisterPublisher($input: RegisterPublisherInput!) {\n registerPublisher(input: $input) {\n id\n name\n email\n }\n }\n", w = "\n mutation CreatePhysicalProduct($input: CreatePhysicalProductInput!) {\n createPhysicalProduct(input: $input) {\n id\n name\n slug\n status\n nature\n type\n price\n currency\n }\n }\n", T = "\n mutation SubmitProduct($id: ID!, $notes: String) {\n submitProduct(id: $id, notes: $notes) {\n id\n status\n }\n }\n";
|
|
97
98
|
function E(e) {
|
|
98
99
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-");
|
|
99
100
|
}
|
|
100
101
|
function D(e) {
|
|
101
|
-
return
|
|
102
|
+
return x.every((t) => {
|
|
102
103
|
let n = e[t];
|
|
103
104
|
return typeof n == "boolean" ? !0 : n.trim() !== "";
|
|
104
105
|
});
|
|
105
106
|
}
|
|
106
107
|
var O = () => {
|
|
107
|
-
let { navigate:
|
|
108
|
+
let { navigate: x, basePath: O, apiGatewayUrl: k, authToken: A } = e(), { organization: j, loading: M, error: N } = c(), [P, F] = d({
|
|
108
109
|
name: "",
|
|
109
110
|
slug: "",
|
|
110
111
|
type: "",
|
|
@@ -123,40 +124,40 @@ var O = () => {
|
|
|
123
124
|
countryOfOrigin: "",
|
|
124
125
|
warrantyInfo: "",
|
|
125
126
|
returnPolicy: ""
|
|
126
|
-
}), [
|
|
127
|
-
|
|
127
|
+
}), [I, L] = d([]), [R, z] = d(!1), B = u(null), [V, H] = d(!1), [U, W] = d(null), [G, K] = d(!1), q = D(P) && !!j, J = `${k || ""}/global/graphql`, Y = (e, t) => {
|
|
128
|
+
F((n) => ({
|
|
128
129
|
...n,
|
|
129
130
|
[e]: t
|
|
130
131
|
}));
|
|
131
|
-
},
|
|
132
|
+
}, X = (e) => {
|
|
132
133
|
let t = e.target.value;
|
|
133
|
-
|
|
134
|
+
F((e) => ({
|
|
134
135
|
...e,
|
|
135
136
|
name: t,
|
|
136
137
|
slug: E(t)
|
|
137
138
|
}));
|
|
138
|
-
},
|
|
139
|
-
|
|
140
|
-
},
|
|
139
|
+
}, Z = (e) => (t) => {
|
|
140
|
+
Y(e, t.target.checked);
|
|
141
|
+
}, Q = l((e) => {
|
|
141
142
|
let t = Array.from(e).filter((e) => e.type.startsWith("image/")).map((e) => ({
|
|
142
143
|
file: e,
|
|
143
144
|
url: URL.createObjectURL(e)
|
|
144
145
|
}));
|
|
145
|
-
|
|
146
|
-
}, []),
|
|
147
|
-
e.target.files &&
|
|
148
|
-
},
|
|
149
|
-
e.preventDefault(),
|
|
150
|
-
},
|
|
151
|
-
e.preventDefault(),
|
|
152
|
-
},
|
|
153
|
-
|
|
146
|
+
L((e) => [...e, ...t]);
|
|
147
|
+
}, []), te = (e) => {
|
|
148
|
+
e.target.files && Q(e.target.files), e.target.value = "";
|
|
149
|
+
}, ne = (e) => {
|
|
150
|
+
e.preventDefault(), z(!1), e.dataTransfer.files && Q(e.dataTransfer.files);
|
|
151
|
+
}, re = (e) => {
|
|
152
|
+
e.preventDefault(), z(!0);
|
|
153
|
+
}, ie = () => z(!1), ae = (e) => {
|
|
154
|
+
L((t) => {
|
|
154
155
|
let n = [...t];
|
|
155
156
|
return URL.revokeObjectURL(n[e].url), n.splice(e, 1), n;
|
|
156
157
|
});
|
|
157
158
|
};
|
|
158
159
|
async function $(e, t) {
|
|
159
|
-
let n = await (await fetch(
|
|
160
|
+
let n = await (await fetch(J, {
|
|
160
161
|
method: "POST",
|
|
161
162
|
headers: {
|
|
162
163
|
"Content-Type": "application/json",
|
|
@@ -171,145 +172,149 @@ var O = () => {
|
|
|
171
172
|
if (n.errors?.length) throw Error(n.errors.map((e) => e.message).join("; "));
|
|
172
173
|
return n.data;
|
|
173
174
|
}
|
|
174
|
-
return /* @__PURE__ */
|
|
175
|
+
return /* @__PURE__ */ _(n, {
|
|
175
176
|
title: "List a Physical Item",
|
|
176
177
|
description: "Fill in all required details. Your listing will be reviewed before it appears in the store.",
|
|
177
178
|
backLink: "/seller/items",
|
|
178
179
|
backLabel: "Back to My Items",
|
|
179
|
-
children: /* @__PURE__ */
|
|
180
|
+
children: /* @__PURE__ */ v("div", {
|
|
180
181
|
className: "space-y-8 max-w-3xl",
|
|
181
182
|
children: [
|
|
182
|
-
|
|
183
|
+
G && /* @__PURE__ */ _("div", {
|
|
183
184
|
className: "rounded-card border border-status-success-text/30 bg-status-success-bg-subtle px-4 py-3 text-sm text-status-success-text",
|
|
184
185
|
children: "Your listing has been submitted for review! Redirecting..."
|
|
185
186
|
}),
|
|
186
|
-
|
|
187
|
+
U && /* @__PURE__ */ _("div", {
|
|
188
|
+
className: "rounded-card border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text",
|
|
189
|
+
children: U
|
|
190
|
+
}),
|
|
191
|
+
N && /* @__PURE__ */ v("div", {
|
|
187
192
|
className: "rounded-card border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text",
|
|
188
|
-
children:
|
|
193
|
+
children: ["Couldn't set up your seller organization: ", N]
|
|
189
194
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ _(r, {
|
|
191
196
|
title: "Basic Information",
|
|
192
197
|
description: "Core details shown in the store listing.",
|
|
193
|
-
children: /* @__PURE__ */
|
|
198
|
+
children: /* @__PURE__ */ v("div", {
|
|
194
199
|
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
|
|
195
200
|
children: [
|
|
196
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ _(a, {
|
|
197
202
|
label: "Name",
|
|
198
203
|
required: !0,
|
|
199
|
-
value:
|
|
200
|
-
onChange:
|
|
204
|
+
value: P.name,
|
|
205
|
+
onChange: X,
|
|
201
206
|
placeholder: "e.g. Wireless Ergonomic Keyboard",
|
|
202
207
|
maxLength: 120
|
|
203
208
|
}),
|
|
204
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ _(a, {
|
|
205
210
|
label: "Slug",
|
|
206
211
|
required: !0,
|
|
207
|
-
value:
|
|
208
|
-
onChange: (e) =>
|
|
212
|
+
value: P.slug,
|
|
213
|
+
onChange: (e) => Y("slug", e.target.value),
|
|
209
214
|
placeholder: "auto-derived-from-name",
|
|
210
215
|
hint: "URL-friendly identifier. Auto-derived from name; you can edit it."
|
|
211
216
|
}),
|
|
212
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ _(o, {
|
|
213
218
|
label: "Product Type",
|
|
214
219
|
required: !0,
|
|
215
|
-
value:
|
|
216
|
-
onChange: (e) =>
|
|
217
|
-
options:
|
|
220
|
+
value: P.type,
|
|
221
|
+
onChange: (e) => Y("type", e.target.value),
|
|
222
|
+
options: y,
|
|
218
223
|
placeholder: "Select a type"
|
|
219
224
|
}),
|
|
220
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ _(o, {
|
|
221
226
|
label: "Store Category",
|
|
222
|
-
value:
|
|
223
|
-
onChange: (e) =>
|
|
224
|
-
options:
|
|
227
|
+
value: P.category,
|
|
228
|
+
onChange: (e) => Y("category", e.target.value),
|
|
229
|
+
options: b,
|
|
225
230
|
placeholder: "General / uncategorised",
|
|
226
231
|
hint: "Pick an Agri-Inputs category to list this item in the HealthyBowl Agri-Inputs Store. Leave blank for a general store listing."
|
|
227
232
|
}),
|
|
228
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ _(a, {
|
|
229
234
|
label: "Short Description",
|
|
230
235
|
required: !0,
|
|
231
|
-
value:
|
|
232
|
-
onChange: (e) =>
|
|
236
|
+
value: P.shortDescription,
|
|
237
|
+
onChange: (e) => Y("shortDescription", e.target.value),
|
|
233
238
|
placeholder: "One-line summary shown on the store card",
|
|
234
239
|
maxLength: 160,
|
|
235
|
-
hint: `${
|
|
240
|
+
hint: `${P.shortDescription.length}/160`
|
|
236
241
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ _(s, {
|
|
238
243
|
label: "Long Description",
|
|
239
|
-
value:
|
|
240
|
-
onChange: (e) =>
|
|
244
|
+
value: P.longDescription,
|
|
245
|
+
onChange: (e) => Y("longDescription", e.target.value),
|
|
241
246
|
rows: 5,
|
|
242
247
|
placeholder: "Detailed product description, features, specs…"
|
|
243
248
|
})
|
|
244
249
|
]
|
|
245
250
|
})
|
|
246
251
|
}),
|
|
247
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ _(r, {
|
|
248
253
|
title: "Product Images",
|
|
249
254
|
description: "The first image is used as the main icon.",
|
|
250
|
-
children: /* @__PURE__ */
|
|
255
|
+
children: /* @__PURE__ */ v("div", {
|
|
251
256
|
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-4",
|
|
252
257
|
children: [
|
|
253
|
-
/* @__PURE__ */
|
|
254
|
-
onDrop:
|
|
255
|
-
onDragOver:
|
|
256
|
-
onDragLeave:
|
|
257
|
-
onClick: () =>
|
|
258
|
-
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",
|
|
258
|
+
/* @__PURE__ */ v("div", {
|
|
259
|
+
onDrop: ne,
|
|
260
|
+
onDragOver: re,
|
|
261
|
+
onDragLeave: ie,
|
|
262
|
+
onClick: () => B.current?.click(),
|
|
263
|
+
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", R ? "border-action-primary-bg bg-action-primary-bg/5" : "border-border-subtle hover:border-border-strong"),
|
|
259
264
|
children: [
|
|
260
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ _(m, {
|
|
261
266
|
size: 28,
|
|
262
|
-
className:
|
|
267
|
+
className: R ? "text-action-primary-bg" : "text-text-muted"
|
|
263
268
|
}),
|
|
264
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ v("div", {
|
|
265
270
|
className: "text-center space-y-1",
|
|
266
|
-
children: [/* @__PURE__ */
|
|
271
|
+
children: [/* @__PURE__ */ _("p", {
|
|
267
272
|
className: "text-sm font-medium text-text-primary",
|
|
268
273
|
children: "Drag and drop images here"
|
|
269
|
-
}), /* @__PURE__ */
|
|
274
|
+
}), /* @__PURE__ */ _("p", {
|
|
270
275
|
className: "text-xs text-text-muted",
|
|
271
276
|
children: "or click to browse — accepts any image format, multiple files"
|
|
272
277
|
})]
|
|
273
278
|
}),
|
|
274
|
-
/* @__PURE__ */
|
|
275
|
-
ref:
|
|
279
|
+
/* @__PURE__ */ _("input", {
|
|
280
|
+
ref: B,
|
|
276
281
|
type: "file",
|
|
277
282
|
accept: "image/*",
|
|
278
283
|
multiple: !0,
|
|
279
284
|
className: "sr-only",
|
|
280
|
-
onChange:
|
|
285
|
+
onChange: te
|
|
281
286
|
})
|
|
282
287
|
]
|
|
283
288
|
}),
|
|
284
|
-
|
|
289
|
+
I.length > 0 && /* @__PURE__ */ _("div", {
|
|
285
290
|
className: "flex flex-wrap gap-3",
|
|
286
|
-
children:
|
|
291
|
+
children: I.map((e, t) => /* @__PURE__ */ v("div", {
|
|
287
292
|
className: "relative group",
|
|
288
293
|
children: [
|
|
289
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ _("img", {
|
|
290
295
|
src: e.url,
|
|
291
296
|
alt: `Product image ${t + 1}`,
|
|
292
297
|
className: "h-20 w-20 rounded-input object-cover border border-border-subtle"
|
|
293
298
|
}),
|
|
294
|
-
t === 0 && /* @__PURE__ */
|
|
299
|
+
t === 0 && /* @__PURE__ */ _("span", {
|
|
295
300
|
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",
|
|
296
301
|
children: "Main"
|
|
297
302
|
}),
|
|
298
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ _("button", {
|
|
299
304
|
type: "button",
|
|
300
305
|
onClick: (e) => {
|
|
301
|
-
e.stopPropagation(),
|
|
306
|
+
e.stopPropagation(), ae(t);
|
|
302
307
|
},
|
|
303
308
|
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",
|
|
304
309
|
"aria-label": "Remove image",
|
|
305
|
-
children: /* @__PURE__ */ h
|
|
310
|
+
children: /* @__PURE__ */ _(h, { size: 11 })
|
|
306
311
|
})
|
|
307
312
|
]
|
|
308
313
|
}, e.url))
|
|
309
314
|
}),
|
|
310
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ v("p", {
|
|
311
316
|
className: "flex items-start gap-2 rounded-input border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
|
|
312
|
-
children: [/* @__PURE__ */
|
|
317
|
+
children: [/* @__PURE__ */ _(f, {
|
|
313
318
|
size: 13,
|
|
314
319
|
className: "mt-0.5 shrink-0 text-text-muted"
|
|
315
320
|
}), "At least 1 image helps buyers — high quality photos increase conversions."]
|
|
@@ -317,91 +322,91 @@ var O = () => {
|
|
|
317
322
|
]
|
|
318
323
|
})
|
|
319
324
|
}),
|
|
320
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ _(r, {
|
|
321
326
|
title: "Pricing",
|
|
322
|
-
children: /* @__PURE__ */
|
|
327
|
+
children: /* @__PURE__ */ v("div", {
|
|
323
328
|
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
|
|
324
|
-
children: [/* @__PURE__ */
|
|
329
|
+
children: [/* @__PURE__ */ v("div", {
|
|
325
330
|
className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
|
|
326
|
-
children: [/* @__PURE__ */
|
|
331
|
+
children: [/* @__PURE__ */ _(a, {
|
|
327
332
|
label: "Price",
|
|
328
333
|
required: !0,
|
|
329
334
|
type: "number",
|
|
330
|
-
value:
|
|
331
|
-
onChange: (e) =>
|
|
335
|
+
value: P.price,
|
|
336
|
+
onChange: (e) => Y("price", e.target.value),
|
|
332
337
|
placeholder: "0.00",
|
|
333
338
|
min: .01,
|
|
334
339
|
step: "0.01"
|
|
335
|
-
}), /* @__PURE__ */
|
|
340
|
+
}), /* @__PURE__ */ _(o, {
|
|
336
341
|
label: "Currency",
|
|
337
342
|
required: !0,
|
|
338
|
-
value:
|
|
339
|
-
onChange: (e) =>
|
|
340
|
-
options:
|
|
343
|
+
value: P.currency,
|
|
344
|
+
onChange: (e) => Y("currency", e.target.value),
|
|
345
|
+
options: ee,
|
|
341
346
|
placeholder: "Select currency"
|
|
342
347
|
})]
|
|
343
|
-
}), /* @__PURE__ */
|
|
348
|
+
}), /* @__PURE__ */ _(a, {
|
|
344
349
|
label: "Tags",
|
|
345
|
-
value:
|
|
346
|
-
onChange: (e) =>
|
|
350
|
+
value: P.tags,
|
|
351
|
+
onChange: (e) => Y("tags", e.target.value),
|
|
347
352
|
placeholder: "mechanical, wireless, ergonomic",
|
|
348
353
|
hint: "Comma-separated keywords to help buyers find your item."
|
|
349
354
|
})]
|
|
350
355
|
})
|
|
351
356
|
}),
|
|
352
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ _(r, {
|
|
353
358
|
title: "Inventory",
|
|
354
|
-
children: /* @__PURE__ */
|
|
359
|
+
children: /* @__PURE__ */ v("div", {
|
|
355
360
|
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
|
|
356
|
-
children: [/* @__PURE__ */
|
|
361
|
+
children: [/* @__PURE__ */ v("div", {
|
|
357
362
|
className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
|
|
358
|
-
children: [/* @__PURE__ */
|
|
363
|
+
children: [/* @__PURE__ */ _(a, {
|
|
359
364
|
label: "Stock Quantity",
|
|
360
365
|
required: !0,
|
|
361
366
|
type: "number",
|
|
362
|
-
value:
|
|
363
|
-
onChange: (e) =>
|
|
367
|
+
value: P.stockQuantity,
|
|
368
|
+
onChange: (e) => Y("stockQuantity", e.target.value),
|
|
364
369
|
min: 0,
|
|
365
370
|
step: 1
|
|
366
|
-
}), /* @__PURE__ */
|
|
371
|
+
}), /* @__PURE__ */ _(a, {
|
|
367
372
|
label: "SKU",
|
|
368
|
-
value:
|
|
369
|
-
onChange: (e) =>
|
|
373
|
+
value: P.sku,
|
|
374
|
+
onChange: (e) => Y("sku", e.target.value),
|
|
370
375
|
placeholder: "e.g. KB-WL-001",
|
|
371
376
|
hint: "Your internal stock-keeping unit reference."
|
|
372
377
|
})]
|
|
373
|
-
}), /* @__PURE__ */
|
|
378
|
+
}), /* @__PURE__ */ _(i, {
|
|
374
379
|
label: "Track Inventory",
|
|
375
380
|
description: "Automatically reduce stock when orders are placed.",
|
|
376
|
-
checked:
|
|
377
|
-
onChange:
|
|
381
|
+
checked: P.trackInventory,
|
|
382
|
+
onChange: Z("trackInventory")
|
|
378
383
|
})]
|
|
379
384
|
})
|
|
380
385
|
}),
|
|
381
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ _(r, {
|
|
382
387
|
title: "Shipping",
|
|
383
|
-
children: /* @__PURE__ */
|
|
388
|
+
children: /* @__PURE__ */ v("div", {
|
|
384
389
|
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
|
|
385
390
|
children: [
|
|
386
|
-
/* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ _(i, {
|
|
387
392
|
label: "Requires Shipping",
|
|
388
393
|
description: "This item will be physically shipped to the buyer.",
|
|
389
|
-
checked:
|
|
390
|
-
onChange:
|
|
394
|
+
checked: P.requiresShipping,
|
|
395
|
+
onChange: Z("requiresShipping")
|
|
391
396
|
}),
|
|
392
|
-
|
|
397
|
+
P.requiresShipping && /* @__PURE__ */ _(a, {
|
|
393
398
|
label: "Weight (kg)",
|
|
394
399
|
type: "number",
|
|
395
|
-
value:
|
|
396
|
-
onChange: (e) =>
|
|
400
|
+
value: P.weightKg,
|
|
401
|
+
onChange: (e) => Y("weightKg", e.target.value),
|
|
397
402
|
placeholder: "0.0",
|
|
398
403
|
min: 0,
|
|
399
404
|
step: "0.01",
|
|
400
405
|
hint: "Used to calculate shipping costs."
|
|
401
406
|
}),
|
|
402
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ v("p", {
|
|
403
408
|
className: "flex items-start gap-2 rounded-input border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
|
|
404
|
-
children: [/* @__PURE__ */
|
|
409
|
+
children: [/* @__PURE__ */ _(f, {
|
|
405
410
|
size: 13,
|
|
406
411
|
className: "mt-0.5 shrink-0 text-text-muted"
|
|
407
412
|
}), "Delivery fees are configured at the organization level in store settings."]
|
|
@@ -409,108 +414,111 @@ var O = () => {
|
|
|
409
414
|
]
|
|
410
415
|
})
|
|
411
416
|
}),
|
|
412
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ _(r, {
|
|
413
418
|
title: "Product Details",
|
|
414
419
|
description: "Optional supplemental information for buyers.",
|
|
415
|
-
children: /* @__PURE__ */
|
|
420
|
+
children: /* @__PURE__ */ v("div", {
|
|
416
421
|
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
|
|
417
422
|
children: [
|
|
418
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ v("div", {
|
|
419
424
|
className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
|
|
420
|
-
children: [/* @__PURE__ */
|
|
425
|
+
children: [/* @__PURE__ */ _(a, {
|
|
421
426
|
label: "Brand",
|
|
422
|
-
value:
|
|
423
|
-
onChange: (e) =>
|
|
427
|
+
value: P.brand,
|
|
428
|
+
onChange: (e) => Y("brand", e.target.value),
|
|
424
429
|
placeholder: "e.g. Logitech"
|
|
425
|
-
}), /* @__PURE__ */
|
|
430
|
+
}), /* @__PURE__ */ _(a, {
|
|
426
431
|
label: "Country of Origin",
|
|
427
|
-
value:
|
|
428
|
-
onChange: (e) =>
|
|
432
|
+
value: P.countryOfOrigin,
|
|
433
|
+
onChange: (e) => Y("countryOfOrigin", e.target.value),
|
|
429
434
|
placeholder: "e.g. China"
|
|
430
435
|
})]
|
|
431
436
|
}),
|
|
432
|
-
/* @__PURE__ */
|
|
437
|
+
/* @__PURE__ */ _(a, {
|
|
433
438
|
label: "Warranty Info",
|
|
434
|
-
value:
|
|
435
|
-
onChange: (e) =>
|
|
439
|
+
value: P.warrantyInfo,
|
|
440
|
+
onChange: (e) => Y("warrantyInfo", e.target.value),
|
|
436
441
|
placeholder: "e.g. 1-year limited manufacturer warranty"
|
|
437
442
|
}),
|
|
438
|
-
/* @__PURE__ */
|
|
443
|
+
/* @__PURE__ */ _(s, {
|
|
439
444
|
label: "Return Policy",
|
|
440
|
-
value:
|
|
441
|
-
onChange: (e) =>
|
|
445
|
+
value: P.returnPolicy,
|
|
446
|
+
onChange: (e) => Y("returnPolicy", e.target.value),
|
|
442
447
|
rows: 3,
|
|
443
448
|
placeholder: "e.g. 30-day returns accepted"
|
|
444
449
|
})
|
|
445
450
|
]
|
|
446
451
|
})
|
|
447
452
|
}),
|
|
448
|
-
/* @__PURE__ */
|
|
453
|
+
/* @__PURE__ */ v("div", {
|
|
449
454
|
className: "flex items-center gap-3 pb-8",
|
|
450
|
-
children: [/* @__PURE__ */
|
|
455
|
+
children: [/* @__PURE__ */ _("button", {
|
|
451
456
|
type: "button",
|
|
452
|
-
onClick: () =>
|
|
457
|
+
onClick: () => x?.(`${O}/seller/items`),
|
|
453
458
|
className: "rounded-button border border-border-strong px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
|
|
454
459
|
children: "Cancel"
|
|
455
|
-
}), /* @__PURE__ */
|
|
460
|
+
}), /* @__PURE__ */ _("div", {
|
|
456
461
|
className: "relative",
|
|
457
|
-
children: /* @__PURE__ */
|
|
462
|
+
children: /* @__PURE__ */ _("button", {
|
|
458
463
|
type: "button",
|
|
459
464
|
onClick: async () => {
|
|
460
|
-
if (!(!
|
|
461
|
-
|
|
465
|
+
if (!(!q || V || !j)) {
|
|
466
|
+
H(!0), W(null);
|
|
462
467
|
try {
|
|
463
|
-
let e = (await $(
|
|
468
|
+
let e = (await $(S)).myPublisher?.id ?? null;
|
|
464
469
|
e ||= (await $(C, { input: {
|
|
465
|
-
name:
|
|
466
|
-
email:
|
|
467
|
-
websiteUrl:
|
|
468
|
-
legalName:
|
|
469
|
-
country:
|
|
470
|
-
contactEmail:
|
|
470
|
+
name: j.legalEntityName ?? j.name,
|
|
471
|
+
email: j.contactEmail ?? "seller@burdenoff.com",
|
|
472
|
+
websiteUrl: j.websiteUrl ?? null,
|
|
473
|
+
legalName: j.legalEntityName ?? j.name,
|
|
474
|
+
country: j.taxCountry ?? null,
|
|
475
|
+
contactEmail: j.contactEmail ?? null
|
|
471
476
|
} })).registerPublisher.id;
|
|
472
|
-
let
|
|
473
|
-
name:
|
|
474
|
-
slug:
|
|
475
|
-
type:
|
|
476
|
-
category:
|
|
477
|
-
description:
|
|
478
|
-
longDescription:
|
|
479
|
-
price: parseFloat(
|
|
480
|
-
currency:
|
|
481
|
-
tags:
|
|
482
|
-
stockQuantity: parseInt(
|
|
483
|
-
sku:
|
|
484
|
-
trackInventory:
|
|
485
|
-
requiresShipping:
|
|
486
|
-
weight:
|
|
487
|
-
brand:
|
|
488
|
-
countryOfOrigin:
|
|
489
|
-
warrantyInfo:
|
|
490
|
-
returnPolicy:
|
|
491
|
-
|
|
477
|
+
let t = P.tags.split(",").map((e) => e.trim()).filter(Boolean), n = (await $(w, { input: {
|
|
478
|
+
name: P.name.trim(),
|
|
479
|
+
slug: P.slug.trim(),
|
|
480
|
+
type: P.type,
|
|
481
|
+
category: P.category.trim() || null,
|
|
482
|
+
description: P.shortDescription.trim(),
|
|
483
|
+
longDescription: P.longDescription.trim() || null,
|
|
484
|
+
price: parseFloat(P.price),
|
|
485
|
+
currency: P.currency,
|
|
486
|
+
tags: t.length > 0 ? t : null,
|
|
487
|
+
stockQuantity: parseInt(P.stockQuantity, 10),
|
|
488
|
+
sku: P.sku.trim() || null,
|
|
489
|
+
trackInventory: P.trackInventory,
|
|
490
|
+
requiresShipping: P.requiresShipping,
|
|
491
|
+
weight: P.requiresShipping && P.weightKg.trim() ? parseFloat(P.weightKg) : null,
|
|
492
|
+
brand: P.brand.trim() || null,
|
|
493
|
+
countryOfOrigin: P.countryOfOrigin.trim() || null,
|
|
494
|
+
warrantyInfo: P.warrantyInfo.trim() || null,
|
|
495
|
+
returnPolicy: P.returnPolicy.trim() || null,
|
|
496
|
+
organizationId: j.id
|
|
492
497
|
} })).createPhysicalProduct.id;
|
|
493
498
|
await $(T, {
|
|
494
|
-
id:
|
|
499
|
+
id: n,
|
|
495
500
|
notes: "Submitted from seller portal"
|
|
496
|
-
}),
|
|
497
|
-
|
|
501
|
+
}), K(!0), setTimeout(() => {
|
|
502
|
+
x?.(`${O}/seller/items`);
|
|
498
503
|
}, 2e3);
|
|
499
504
|
} catch (e) {
|
|
500
|
-
|
|
505
|
+
W(e instanceof Error ? e.message : "Submission failed. Please try again.");
|
|
501
506
|
} finally {
|
|
502
|
-
|
|
507
|
+
H(!1);
|
|
503
508
|
}
|
|
504
509
|
}
|
|
505
510
|
},
|
|
506
|
-
disabled: !
|
|
507
|
-
"aria-disabled": !
|
|
508
|
-
title:
|
|
511
|
+
disabled: !q || V,
|
|
512
|
+
"aria-disabled": !q || V,
|
|
513
|
+
title: M ? "Setting up your seller organization..." : q ? void 0 : "Fill in all required fields to continue",
|
|
509
514
|
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", "focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2"),
|
|
510
|
-
children:
|
|
515
|
+
children: V ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(p, {
|
|
516
|
+
size: 15,
|
|
517
|
+
className: "animate-spin"
|
|
518
|
+
}), "Submitting..."] }) : M ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(p, {
|
|
511
519
|
size: 15,
|
|
512
520
|
className: "animate-spin"
|
|
513
|
-
}), "
|
|
521
|
+
}), "Setting up your store..."] }) : "Create & Submit for Review"
|
|
514
522
|
})
|
|
515
523
|
})]
|
|
516
524
|
})
|