@burdenoff/microfe-devportal 2026.914.2 → 2026.914.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/devportal/DevportalRoutes.d.ts.map +1 -1
  2. package/dist/devportal/DevportalRoutes.js +130 -110
  3. package/dist/devportal/DevportalRoutes.js.map +1 -1
  4. package/dist/devportal/components/SectionNav.d.ts +10 -1
  5. package/dist/devportal/components/SectionNav.d.ts.map +1 -1
  6. package/dist/devportal/components/SectionNav.js +60 -42
  7. package/dist/devportal/components/SectionNav.js.map +1 -1
  8. package/dist/devportal/hooks/useIsSellerSection.d.ts +13 -0
  9. package/dist/devportal/hooks/useIsSellerSection.d.ts.map +1 -0
  10. package/dist/devportal/hooks/useIsSellerSection.js +15 -0
  11. package/dist/devportal/hooks/useIsSellerSection.js.map +1 -0
  12. package/dist/devportal/pages/CreateApplicationPage.d.ts.map +1 -1
  13. package/dist/devportal/pages/CreateApplicationPage.js +5 -1
  14. package/dist/devportal/pages/CreateApplicationPage.js.map +1 -1
  15. package/dist/devportal/pages/CreateOrganizationPage.d.ts +3 -2
  16. package/dist/devportal/pages/CreateOrganizationPage.d.ts.map +1 -1
  17. package/dist/devportal/pages/CreateOrganizationPage.js +225 -122
  18. package/dist/devportal/pages/CreateOrganizationPage.js.map +1 -1
  19. package/dist/devportal/pages/CreatePhysicalItemPage.d.ts.map +1 -1
  20. package/dist/devportal/pages/CreatePhysicalItemPage.js +371 -205
  21. package/dist/devportal/pages/CreatePhysicalItemPage.js.map +1 -1
  22. package/dist/devportal/pages/DashboardPage.d.ts.map +1 -1
  23. package/dist/devportal/pages/DashboardPage.js +1 -1
  24. package/dist/devportal/pages/DashboardPage.js.map +1 -1
  25. package/dist/devportal/pages/EditPhysicalItemPage.d.ts.map +1 -1
  26. package/dist/devportal/pages/EditPhysicalItemPage.js +427 -168
  27. package/dist/devportal/pages/EditPhysicalItemPage.js.map +1 -1
  28. package/dist/devportal/pages/OrganizationDetailPage.d.ts.map +1 -1
  29. package/dist/devportal/pages/OrganizationDetailPage.js +361 -346
  30. package/dist/devportal/pages/OrganizationDetailPage.js.map +1 -1
  31. package/dist/devportal/pages/OrganizationMembersPage.d.ts.map +1 -1
  32. package/dist/devportal/pages/OrganizationMembersPage.js +291 -290
  33. package/dist/devportal/pages/OrganizationMembersPage.js.map +1 -1
  34. package/dist/devportal/pages/OrganizationsPage.d.ts.map +1 -1
  35. package/dist/devportal/pages/OrganizationsPage.js +102 -101
  36. package/dist/devportal/pages/OrganizationsPage.js.map +1 -1
  37. package/dist/devportal/pages/RevenueDashboardPage.d.ts.map +1 -1
  38. package/dist/devportal/pages/RevenueDashboardPage.js +210 -209
  39. package/dist/devportal/pages/RevenueDashboardPage.js.map +1 -1
  40. package/dist/devportal/pages/SellerDashboardPage.d.ts.map +1 -1
  41. package/dist/devportal/pages/SellerDashboardPage.js.map +1 -1
  42. package/dist/devportal/pages/SettingsPage.d.ts.map +1 -1
  43. package/dist/devportal/pages/SettingsPage.js +1 -1
  44. package/dist/devportal/pages/SettingsPage.js.map +1 -1
  45. package/dist/devportal/types/index.d.ts +1 -0
  46. package/dist/devportal/types/index.d.ts.map +1 -1
  47. package/dist/devportal/types/index.js.map +1 -1
  48. package/dist/generated/global-operations.d.ts +103 -12
  49. package/dist/generated/global-operations.d.ts.map +1 -1
  50. package/dist/generated/global-operations.js +108 -92
  51. package/dist/generated/global-operations.js.map +1 -1
  52. package/dist/generated/global-types.d.ts +2963 -242
  53. package/dist/generated/global-types.d.ts.map +1 -1
  54. package/package.json +1 -1
@@ -2,12 +2,13 @@ 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 { 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";
5
+ import { usePackageUpload as c } from "../hooks/usePackageUpload.js";
6
+ import { useSellerOrganization as l } from "../hooks/useSellerOrganization.js";
7
+ import { useCallback as u, useRef as d, useState as f } from "react";
8
+ import { AlertTriangle as p, Info as m, Loader2 as h, RotateCw as ee, Upload as g, X as te } from "lucide-react";
9
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
9
10
  //#region src/devportal/pages/CreatePhysicalItemPage.tsx
10
- var y = [
11
+ var b = [
11
12
  {
12
13
  value: "MERCHANDISE",
13
14
  label: "Merchandise"
@@ -40,7 +41,7 @@ var y = [
40
41
  value: "CONSUMABLE",
41
42
  label: "Consumable"
42
43
  }
43
- ], b = [
44
+ ], ne = [
44
45
  {
45
46
  value: "agri-seeds",
46
47
  label: "Agri-Inputs — Seeds"
@@ -61,7 +62,7 @@ var y = [
61
62
  value: "agri-irrigation",
62
63
  label: "Agri-Inputs — Irrigation"
63
64
  }
64
- ], ee = [
65
+ ], x = [
65
66
  {
66
67
  value: "USD",
67
68
  label: "USD — US Dollar"
@@ -86,7 +87,37 @@ var y = [
86
87
  value: "AED",
87
88
  label: "AED — UAE Dirham"
88
89
  }
89
- ], x = [
90
+ ], re = [
91
+ {
92
+ value: "GRAM",
93
+ label: "Grams (g)"
94
+ },
95
+ {
96
+ value: "KILOGRAM",
97
+ label: "Kilograms (kg)"
98
+ },
99
+ {
100
+ value: "OUNCE",
101
+ label: "Ounces (oz)"
102
+ },
103
+ {
104
+ value: "POUND",
105
+ label: "Pounds (lb)"
106
+ }
107
+ ], ie = [
108
+ {
109
+ value: "CENTIMETER",
110
+ label: "Centimeters (cm)"
111
+ },
112
+ {
113
+ value: "INCH",
114
+ label: "Inches (in)"
115
+ },
116
+ {
117
+ value: "METER",
118
+ label: "Meters (m)"
119
+ }
120
+ ], S = [
90
121
  "name",
91
122
  "slug",
92
123
  "type",
@@ -94,18 +125,18 @@ var y = [
94
125
  "price",
95
126
  "currency",
96
127
  "stockQuantity"
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";
128
+ ], C = "\n query SellerMyPublisher {\n myPublisher {\n id\n }\n }\n", ae = "\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";
98
129
  function E(e) {
99
130
  return e.toLowerCase().replace(/[^a-z0-9]+/g, "-");
100
131
  }
101
132
  function D(e) {
102
- return x.every((t) => {
133
+ return S.every((t) => {
103
134
  let n = e[t];
104
135
  return typeof n == "boolean" ? !0 : n.trim() !== "";
105
136
  });
106
137
  }
107
138
  var O = () => {
108
- let { navigate: x, basePath: O, apiGatewayUrl: k, authToken: A } = e(), { organization: j, loading: M, error: N } = c(), [P, F] = d({
139
+ let { navigate: S, basePath: O, apiGatewayUrl: k, authToken: A, workspacesGatewayUrl: j, workspaceId: M, getWorkspaceToken: oe } = e(), { organization: N, loading: P, error: F } = l(), [I, L] = f({
109
140
  name: "",
110
141
  slug: "",
111
142
  type: "",
@@ -118,46 +149,78 @@ var O = () => {
118
149
  stockQuantity: "1",
119
150
  sku: "",
120
151
  trackInventory: !0,
152
+ allowBackorder: !1,
153
+ lowStockThreshold: "",
121
154
  requiresShipping: !0,
122
155
  weightKg: "",
156
+ weightUnit: "KILOGRAM",
157
+ length: "",
158
+ width: "",
159
+ height: "",
160
+ dimensionUnit: "CENTIMETER",
123
161
  brand: "",
162
+ manufacturer: "",
124
163
  countryOfOrigin: "",
125
164
  warrantyInfo: "",
126
165
  returnPolicy: ""
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) => ({
166
+ }), [R, z] = f([]), [B, V] = f(!1), H = d(null), { upload: U } = c(j, A, M, oe, "/DevPortal/Assets"), [W, G] = f(!1), [K, q] = f(null), [se, ce] = f(!1), le = R.some((e) => e.uploading), J = D(I) && !!N && !le, ue = `${k || ""}/global/graphql`, Y = (e, t) => {
167
+ L((n) => ({
129
168
  ...n,
130
169
  [e]: t
131
170
  }));
132
- }, X = (e) => {
171
+ }, de = (e) => {
133
172
  let t = e.target.value;
134
- F((e) => ({
173
+ L((e) => ({
135
174
  ...e,
136
175
  name: t,
137
176
  slug: E(t)
138
177
  }));
139
- }, Z = (e) => (t) => {
178
+ }, X = (e) => (t) => {
140
179
  Y(e, t.target.checked);
141
- }, Q = l((e) => {
180
+ }, Z = u((e, t) => {
181
+ U(t).then((t) => {
182
+ z((n) => n.map((n) => n.id === e ? {
183
+ ...n,
184
+ uploading: !1,
185
+ downloadUrl: t.downloadUrl,
186
+ error: void 0
187
+ } : n));
188
+ }).catch((t) => {
189
+ z((n) => n.map((n) => n.id === e ? {
190
+ ...n,
191
+ uploading: !1,
192
+ error: t instanceof Error ? t.message : "Upload failed"
193
+ } : n));
194
+ });
195
+ }, [U]), Q = u((e) => {
142
196
  let t = Array.from(e).filter((e) => e.type.startsWith("image/")).map((e) => ({
197
+ id: crypto.randomUUID(),
143
198
  file: e,
144
- url: URL.createObjectURL(e)
199
+ url: URL.createObjectURL(e),
200
+ uploading: !0
145
201
  }));
146
- L((e) => [...e, ...t]);
147
- }, []), te = (e) => {
202
+ z((e) => [...e, ...t]), t.forEach((e) => Z(e.id, e.file));
203
+ }, [Z]), fe = (e) => {
148
204
  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) => {
155
- let n = [...t];
156
- return URL.revokeObjectURL(n[e].url), n.splice(e, 1), n;
205
+ }, pe = (e) => {
206
+ e.preventDefault(), V(!1), e.dataTransfer.files && Q(e.dataTransfer.files);
207
+ }, me = (e) => {
208
+ e.preventDefault(), V(!0);
209
+ }, he = () => V(!1), ge = (e) => {
210
+ z((t) => {
211
+ let n = t.find((t) => t.id === e);
212
+ return n && URL.revokeObjectURL(n.url), t.filter((t) => t.id !== e);
157
213
  });
214
+ }, _e = (e) => {
215
+ let t = R.find((t) => t.id === e);
216
+ t && (z((t) => t.map((t) => t.id === e ? {
217
+ ...t,
218
+ uploading: !0,
219
+ error: void 0
220
+ } : t)), Z(e, t.file));
158
221
  };
159
222
  async function $(e, t) {
160
- let n = await (await fetch(J, {
223
+ let n = await (await fetch(ue, {
161
224
  method: "POST",
162
225
  headers: {
163
226
  "Content-Type": "application/json",
@@ -172,76 +235,76 @@ var O = () => {
172
235
  if (n.errors?.length) throw Error(n.errors.map((e) => e.message).join("; "));
173
236
  return n.data;
174
237
  }
175
- return /* @__PURE__ */ _(n, {
238
+ return /* @__PURE__ */ v(n, {
176
239
  title: "List a Physical Item",
177
240
  description: "Fill in all required details. Your listing will be reviewed before it appears in the store.",
178
241
  backLink: "/seller/items",
179
242
  backLabel: "Back to My Items",
180
- children: /* @__PURE__ */ v("div", {
243
+ children: /* @__PURE__ */ y("div", {
181
244
  className: "space-y-8 max-w-3xl",
182
245
  children: [
183
- G && /* @__PURE__ */ _("div", {
246
+ se && /* @__PURE__ */ v("div", {
184
247
  className: "rounded-card border border-status-success-text/30 bg-status-success-bg-subtle px-4 py-3 text-sm text-status-success-text",
185
248
  children: "Your listing has been submitted for review! Redirecting..."
186
249
  }),
187
- U && /* @__PURE__ */ _("div", {
250
+ K && /* @__PURE__ */ v("div", {
188
251
  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
252
+ children: K
190
253
  }),
191
- N && /* @__PURE__ */ v("div", {
254
+ F && /* @__PURE__ */ y("div", {
192
255
  className: "rounded-card border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text",
193
- children: ["Couldn't set up your seller organization: ", N]
256
+ children: ["Couldn't set up your seller organization: ", F]
194
257
  }),
195
- /* @__PURE__ */ _(r, {
258
+ /* @__PURE__ */ v(r, {
196
259
  title: "Basic Information",
197
260
  description: "Core details shown in the store listing.",
198
- children: /* @__PURE__ */ v("div", {
261
+ children: /* @__PURE__ */ y("div", {
199
262
  className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
200
263
  children: [
201
- /* @__PURE__ */ _(a, {
264
+ /* @__PURE__ */ v(a, {
202
265
  label: "Name",
203
266
  required: !0,
204
- value: P.name,
205
- onChange: X,
267
+ value: I.name,
268
+ onChange: de,
206
269
  placeholder: "e.g. Wireless Ergonomic Keyboard",
207
270
  maxLength: 120
208
271
  }),
209
- /* @__PURE__ */ _(a, {
272
+ /* @__PURE__ */ v(a, {
210
273
  label: "Slug",
211
274
  required: !0,
212
- value: P.slug,
275
+ value: I.slug,
213
276
  onChange: (e) => Y("slug", e.target.value),
214
277
  placeholder: "auto-derived-from-name",
215
278
  hint: "URL-friendly identifier. Auto-derived from name; you can edit it."
216
279
  }),
217
- /* @__PURE__ */ _(o, {
280
+ /* @__PURE__ */ v(o, {
218
281
  label: "Product Type",
219
282
  required: !0,
220
- value: P.type,
283
+ value: I.type,
221
284
  onChange: (e) => Y("type", e.target.value),
222
- options: y,
285
+ options: b,
223
286
  placeholder: "Select a type"
224
287
  }),
225
- /* @__PURE__ */ _(o, {
288
+ /* @__PURE__ */ v(o, {
226
289
  label: "Store Category",
227
- value: P.category,
290
+ value: I.category,
228
291
  onChange: (e) => Y("category", e.target.value),
229
- options: b,
292
+ options: ne,
230
293
  placeholder: "General / uncategorised",
231
294
  hint: "Pick an Agri-Inputs category to list this item in the HealthyBowl Agri-Inputs Store. Leave blank for a general store listing."
232
295
  }),
233
- /* @__PURE__ */ _(a, {
296
+ /* @__PURE__ */ v(a, {
234
297
  label: "Short Description",
235
298
  required: !0,
236
- value: P.shortDescription,
299
+ value: I.shortDescription,
237
300
  onChange: (e) => Y("shortDescription", e.target.value),
238
301
  placeholder: "One-line summary shown on the store card",
239
302
  maxLength: 160,
240
- hint: `${P.shortDescription.length}/160`
303
+ hint: `${I.shortDescription.length}/160`
241
304
  }),
242
- /* @__PURE__ */ _(s, {
305
+ /* @__PURE__ */ v(s, {
243
306
  label: "Long Description",
244
- value: P.longDescription,
307
+ value: I.longDescription,
245
308
  onChange: (e) => Y("longDescription", e.target.value),
246
309
  rows: 5,
247
310
  placeholder: "Detailed product description, features, specs…"
@@ -249,164 +312,251 @@ var O = () => {
249
312
  ]
250
313
  })
251
314
  }),
252
- /* @__PURE__ */ _(r, {
315
+ /* @__PURE__ */ v(r, {
253
316
  title: "Product Images",
254
317
  description: "The first image is used as the main icon.",
255
- children: /* @__PURE__ */ v("div", {
318
+ children: /* @__PURE__ */ y("div", {
256
319
  className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-4",
257
320
  children: [
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"),
321
+ /* @__PURE__ */ y("div", {
322
+ onDrop: pe,
323
+ onDragOver: me,
324
+ onDragLeave: he,
325
+ onClick: () => H.current?.click(),
326
+ 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", B ? "border-action-primary-bg bg-action-primary-bg/5" : "border-border-subtle hover:border-border-strong"),
264
327
  children: [
265
- /* @__PURE__ */ _(m, {
328
+ /* @__PURE__ */ v(g, {
266
329
  size: 28,
267
- className: R ? "text-action-primary-bg" : "text-text-muted"
330
+ className: B ? "text-action-primary-bg" : "text-text-muted"
268
331
  }),
269
- /* @__PURE__ */ v("div", {
332
+ /* @__PURE__ */ y("div", {
270
333
  className: "text-center space-y-1",
271
- children: [/* @__PURE__ */ _("p", {
334
+ children: [/* @__PURE__ */ v("p", {
272
335
  className: "text-sm font-medium text-text-primary",
273
336
  children: "Drag and drop images here"
274
- }), /* @__PURE__ */ _("p", {
337
+ }), /* @__PURE__ */ v("p", {
275
338
  className: "text-xs text-text-muted",
276
339
  children: "or click to browse — accepts any image format, multiple files"
277
340
  })]
278
341
  }),
279
- /* @__PURE__ */ _("input", {
280
- ref: B,
342
+ /* @__PURE__ */ v("input", {
343
+ ref: H,
281
344
  type: "file",
282
345
  accept: "image/*",
283
346
  multiple: !0,
284
347
  className: "sr-only",
285
- onChange: te
348
+ onChange: fe
286
349
  })
287
350
  ]
288
351
  }),
289
- I.length > 0 && /* @__PURE__ */ _("div", {
352
+ R.length > 0 && /* @__PURE__ */ v("div", {
290
353
  className: "flex flex-wrap gap-3",
291
- children: I.map((e, t) => /* @__PURE__ */ v("div", {
292
- className: "relative group",
293
- children: [
294
- /* @__PURE__ */ _("img", {
295
- src: e.url,
296
- alt: `Product image ${t + 1}`,
297
- className: "h-20 w-20 rounded-input object-cover border border-border-subtle"
298
- }),
299
- t === 0 && /* @__PURE__ */ _("span", {
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",
301
- children: "Main"
302
- }),
303
- /* @__PURE__ */ _("button", {
304
- type: "button",
305
- onClick: (e) => {
306
- e.stopPropagation(), ae(t);
307
- },
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",
309
- "aria-label": "Remove image",
310
- children: /* @__PURE__ */ _(h, { size: 11 })
311
- })
312
- ]
313
- }, e.url))
354
+ children: (() => {
355
+ let e = R.find((e) => e.downloadUrl)?.id;
356
+ return R.map((n, r) => /* @__PURE__ */ y("div", {
357
+ className: "relative group",
358
+ children: [
359
+ /* @__PURE__ */ v("img", {
360
+ src: n.url,
361
+ alt: `Product image ${r + 1}`,
362
+ className: t("h-20 w-20 rounded-input object-cover border", n.error ? "border-status-error-text/50" : "border-border-subtle")
363
+ }),
364
+ n.uploading && /* @__PURE__ */ v("div", {
365
+ className: "absolute inset-0 flex items-center justify-center rounded-input bg-bg-overlay",
366
+ children: /* @__PURE__ */ v(h, {
367
+ size: 16,
368
+ className: "animate-spin text-white"
369
+ })
370
+ }),
371
+ n.error && /* @__PURE__ */ y("button", {
372
+ type: "button",
373
+ onClick: (e) => {
374
+ e.stopPropagation(), _e(n.id);
375
+ },
376
+ title: `${n.error} — click to retry`,
377
+ 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",
378
+ children: [/* @__PURE__ */ v(p, { size: 14 }), /* @__PURE__ */ v(ee, { size: 11 })]
379
+ }),
380
+ n.id === e && /* @__PURE__ */ v("span", {
381
+ 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",
382
+ children: "Main"
383
+ }),
384
+ /* @__PURE__ */ v("button", {
385
+ type: "button",
386
+ onClick: (e) => {
387
+ e.stopPropagation(), ge(n.id);
388
+ },
389
+ 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",
390
+ "aria-label": "Remove image",
391
+ children: /* @__PURE__ */ v(te, { size: 11 })
392
+ })
393
+ ]
394
+ }, n.id));
395
+ })()
314
396
  }),
315
- /* @__PURE__ */ v("p", {
397
+ /* @__PURE__ */ y("p", {
316
398
  className: "flex items-start gap-2 rounded-input border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
317
- children: [/* @__PURE__ */ _(f, {
399
+ children: [/* @__PURE__ */ v(m, {
318
400
  size: 13,
319
401
  className: "mt-0.5 shrink-0 text-text-muted"
320
- }), "At least 1 image helps buyers — high quality photos increase conversions."]
402
+ }), "At least 1 image helps buyers — high quality photos increase conversions. The first image becomes the main icon."]
321
403
  })
322
404
  ]
323
405
  })
324
406
  }),
325
- /* @__PURE__ */ _(r, {
407
+ /* @__PURE__ */ v(r, {
326
408
  title: "Pricing",
327
- children: /* @__PURE__ */ v("div", {
409
+ children: /* @__PURE__ */ y("div", {
328
410
  className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
329
- children: [/* @__PURE__ */ v("div", {
411
+ children: [/* @__PURE__ */ y("div", {
330
412
  className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
331
- children: [/* @__PURE__ */ _(a, {
413
+ children: [/* @__PURE__ */ v(a, {
332
414
  label: "Price",
333
415
  required: !0,
334
416
  type: "number",
335
- value: P.price,
417
+ value: I.price,
336
418
  onChange: (e) => Y("price", e.target.value),
337
419
  placeholder: "0.00",
338
420
  min: .01,
339
421
  step: "0.01"
340
- }), /* @__PURE__ */ _(o, {
422
+ }), /* @__PURE__ */ v(o, {
341
423
  label: "Currency",
342
424
  required: !0,
343
- value: P.currency,
425
+ value: I.currency,
344
426
  onChange: (e) => Y("currency", e.target.value),
345
- options: ee,
427
+ options: x,
346
428
  placeholder: "Select currency"
347
429
  })]
348
- }), /* @__PURE__ */ _(a, {
430
+ }), /* @__PURE__ */ v(a, {
349
431
  label: "Tags",
350
- value: P.tags,
432
+ value: I.tags,
351
433
  onChange: (e) => Y("tags", e.target.value),
352
434
  placeholder: "mechanical, wireless, ergonomic",
353
435
  hint: "Comma-separated keywords to help buyers find your item."
354
436
  })]
355
437
  })
356
438
  }),
357
- /* @__PURE__ */ _(r, {
439
+ /* @__PURE__ */ v(r, {
358
440
  title: "Inventory",
359
- children: /* @__PURE__ */ v("div", {
441
+ children: /* @__PURE__ */ y("div", {
360
442
  className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
361
- children: [/* @__PURE__ */ v("div", {
362
- className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
363
- children: [/* @__PURE__ */ _(a, {
364
- label: "Stock Quantity",
365
- required: !0,
443
+ children: [
444
+ /* @__PURE__ */ y("div", {
445
+ className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
446
+ children: [/* @__PURE__ */ v(a, {
447
+ label: "Stock Quantity",
448
+ required: !0,
449
+ type: "number",
450
+ value: I.stockQuantity,
451
+ onChange: (e) => Y("stockQuantity", e.target.value),
452
+ min: 0,
453
+ step: 1
454
+ }), /* @__PURE__ */ v(a, {
455
+ label: "SKU",
456
+ value: I.sku,
457
+ onChange: (e) => Y("sku", e.target.value),
458
+ placeholder: "e.g. KB-WL-001",
459
+ hint: "Your internal stock-keeping unit reference."
460
+ })]
461
+ }),
462
+ /* @__PURE__ */ v(a, {
463
+ label: "Low Stock Threshold",
366
464
  type: "number",
367
- value: P.stockQuantity,
368
- onChange: (e) => Y("stockQuantity", e.target.value),
465
+ value: I.lowStockThreshold,
466
+ onChange: (e) => Y("lowStockThreshold", e.target.value),
467
+ placeholder: "e.g. 5",
369
468
  min: 0,
370
- step: 1
371
- }), /* @__PURE__ */ _(a, {
372
- label: "SKU",
373
- value: P.sku,
374
- onChange: (e) => Y("sku", e.target.value),
375
- placeholder: "e.g. KB-WL-001",
376
- hint: "Your internal stock-keeping unit reference."
377
- })]
378
- }), /* @__PURE__ */ _(i, {
379
- label: "Track Inventory",
380
- description: "Automatically reduce stock when orders are placed.",
381
- checked: P.trackInventory,
382
- onChange: Z("trackInventory")
383
- })]
469
+ step: 1,
470
+ hint: "Get flagged when stock falls to or below this number."
471
+ }),
472
+ /* @__PURE__ */ v(i, {
473
+ label: "Track Inventory",
474
+ description: "Automatically reduce stock when orders are placed.",
475
+ checked: I.trackInventory,
476
+ onChange: X("trackInventory")
477
+ }),
478
+ /* @__PURE__ */ v(i, {
479
+ label: "Allow Backorder",
480
+ description: "Let buyers order even when stock quantity is zero.",
481
+ checked: I.allowBackorder,
482
+ onChange: X("allowBackorder")
483
+ })
484
+ ]
384
485
  })
385
486
  }),
386
- /* @__PURE__ */ _(r, {
487
+ /* @__PURE__ */ v(r, {
387
488
  title: "Shipping",
388
- children: /* @__PURE__ */ v("div", {
489
+ children: /* @__PURE__ */ y("div", {
389
490
  className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
390
491
  children: [
391
- /* @__PURE__ */ _(i, {
492
+ /* @__PURE__ */ v(i, {
392
493
  label: "Requires Shipping",
393
494
  description: "This item will be physically shipped to the buyer.",
394
- checked: P.requiresShipping,
395
- onChange: Z("requiresShipping")
396
- }),
397
- P.requiresShipping && /* @__PURE__ */ _(a, {
398
- label: "Weight (kg)",
399
- type: "number",
400
- value: P.weightKg,
401
- onChange: (e) => Y("weightKg", e.target.value),
402
- placeholder: "0.0",
403
- min: 0,
404
- step: "0.01",
405
- hint: "Used to calculate shipping costs."
495
+ checked: I.requiresShipping,
496
+ onChange: X("requiresShipping")
406
497
  }),
407
- /* @__PURE__ */ v("p", {
498
+ I.requiresShipping && /* @__PURE__ */ y(_, { children: [
499
+ /* @__PURE__ */ y("div", {
500
+ className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
501
+ children: [/* @__PURE__ */ v(a, {
502
+ label: "Weight",
503
+ type: "number",
504
+ value: I.weightKg,
505
+ onChange: (e) => Y("weightKg", e.target.value),
506
+ placeholder: "0.0",
507
+ min: 0,
508
+ step: "0.01",
509
+ hint: "Used to calculate shipping costs."
510
+ }), /* @__PURE__ */ v(o, {
511
+ label: "Weight Unit",
512
+ value: I.weightUnit,
513
+ onChange: (e) => Y("weightUnit", e.target.value),
514
+ options: re
515
+ })]
516
+ }),
517
+ /* @__PURE__ */ y("div", {
518
+ className: "grid grid-cols-1 gap-5 sm:grid-cols-3",
519
+ children: [
520
+ /* @__PURE__ */ v(a, {
521
+ label: "Length",
522
+ type: "number",
523
+ value: I.length,
524
+ onChange: (e) => Y("length", e.target.value),
525
+ placeholder: "0.0",
526
+ min: 0,
527
+ step: "0.01"
528
+ }),
529
+ /* @__PURE__ */ v(a, {
530
+ label: "Width",
531
+ type: "number",
532
+ value: I.width,
533
+ onChange: (e) => Y("width", e.target.value),
534
+ placeholder: "0.0",
535
+ min: 0,
536
+ step: "0.01"
537
+ }),
538
+ /* @__PURE__ */ v(a, {
539
+ label: "Height",
540
+ type: "number",
541
+ value: I.height,
542
+ onChange: (e) => Y("height", e.target.value),
543
+ placeholder: "0.0",
544
+ min: 0,
545
+ step: "0.01"
546
+ })
547
+ ]
548
+ }),
549
+ /* @__PURE__ */ v(o, {
550
+ label: "Dimension Unit",
551
+ value: I.dimensionUnit,
552
+ onChange: (e) => Y("dimensionUnit", e.target.value),
553
+ options: ie,
554
+ hint: "Applies to length, width, and height above."
555
+ })
556
+ ] }),
557
+ /* @__PURE__ */ y("p", {
408
558
  className: "flex items-start gap-2 rounded-input border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
409
- children: [/* @__PURE__ */ _(f, {
559
+ children: [/* @__PURE__ */ v(m, {
410
560
  size: 13,
411
561
  className: "mt-0.5 shrink-0 text-text-muted"
412
562
  }), "Delivery fees are configured at the organization level in store settings."]
@@ -414,35 +564,41 @@ var O = () => {
414
564
  ]
415
565
  })
416
566
  }),
417
- /* @__PURE__ */ _(r, {
567
+ /* @__PURE__ */ v(r, {
418
568
  title: "Product Details",
419
569
  description: "Optional supplemental information for buyers.",
420
- children: /* @__PURE__ */ v("div", {
570
+ children: /* @__PURE__ */ y("div", {
421
571
  className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
422
572
  children: [
423
- /* @__PURE__ */ v("div", {
573
+ /* @__PURE__ */ y("div", {
424
574
  className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
425
- children: [/* @__PURE__ */ _(a, {
575
+ children: [/* @__PURE__ */ v(a, {
426
576
  label: "Brand",
427
- value: P.brand,
577
+ value: I.brand,
428
578
  onChange: (e) => Y("brand", e.target.value),
429
579
  placeholder: "e.g. Logitech"
430
- }), /* @__PURE__ */ _(a, {
431
- label: "Country of Origin",
432
- value: P.countryOfOrigin,
433
- onChange: (e) => Y("countryOfOrigin", e.target.value),
434
- placeholder: "e.g. China"
580
+ }), /* @__PURE__ */ v(a, {
581
+ label: "Manufacturer",
582
+ value: I.manufacturer,
583
+ onChange: (e) => Y("manufacturer", e.target.value),
584
+ placeholder: "e.g. Logitech Manufacturing Ltd."
435
585
  })]
436
586
  }),
437
- /* @__PURE__ */ _(a, {
587
+ /* @__PURE__ */ v(a, {
588
+ label: "Country of Origin",
589
+ value: I.countryOfOrigin,
590
+ onChange: (e) => Y("countryOfOrigin", e.target.value),
591
+ placeholder: "e.g. China"
592
+ }),
593
+ /* @__PURE__ */ v(a, {
438
594
  label: "Warranty Info",
439
- value: P.warrantyInfo,
595
+ value: I.warrantyInfo,
440
596
  onChange: (e) => Y("warrantyInfo", e.target.value),
441
597
  placeholder: "e.g. 1-year limited manufacturer warranty"
442
598
  }),
443
- /* @__PURE__ */ _(s, {
599
+ /* @__PURE__ */ v(s, {
444
600
  label: "Return Policy",
445
- value: P.returnPolicy,
601
+ value: I.returnPolicy,
446
602
  onChange: (e) => Y("returnPolicy", e.target.value),
447
603
  rows: 3,
448
604
  placeholder: "e.g. 30-day returns accepted"
@@ -450,72 +606,82 @@ var O = () => {
450
606
  ]
451
607
  })
452
608
  }),
453
- /* @__PURE__ */ v("div", {
609
+ /* @__PURE__ */ y("div", {
454
610
  className: "flex items-center gap-3 pb-8",
455
- children: [/* @__PURE__ */ _("button", {
611
+ children: [/* @__PURE__ */ v("button", {
456
612
  type: "button",
457
- onClick: () => x?.(`${O}/seller/items`),
613
+ onClick: () => S?.(`${O}/seller/items`),
458
614
  className: "rounded-button border border-border-strong px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
459
615
  children: "Cancel"
460
- }), /* @__PURE__ */ _("div", {
616
+ }), /* @__PURE__ */ v("div", {
461
617
  className: "relative",
462
- children: /* @__PURE__ */ _("button", {
618
+ children: /* @__PURE__ */ v("button", {
463
619
  type: "button",
464
620
  onClick: async () => {
465
- if (!(!q || V || !j)) {
466
- H(!0), W(null);
621
+ if (!(!J || W || !N)) {
622
+ G(!0), q(null);
467
623
  try {
468
- let e = (await $(S)).myPublisher?.id ?? null;
469
- e ||= (await $(C, { input: {
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
624
+ let e = (await $(C)).myPublisher?.id ?? null;
625
+ e ||= (await $(ae, { input: {
626
+ name: N.legalEntityName ?? N.name,
627
+ email: N.contactEmail ?? "seller@burdenoff.com",
628
+ websiteUrl: N.websiteUrl ?? null,
629
+ legalName: N.legalEntityName ?? N.name,
630
+ country: N.taxCountry ?? null,
631
+ contactEmail: N.contactEmail ?? null
476
632
  } })).registerPublisher.id;
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,
633
+ let t = I.tags.split(",").map((e) => e.trim()).filter(Boolean), n = R.map((e) => e.downloadUrl).filter((e) => !!e), r = I.length.trim() || I.width.trim() || I.height.trim(), i = (await $(w, { input: {
634
+ name: I.name.trim(),
635
+ slug: I.slug.trim(),
636
+ type: I.type,
637
+ category: I.category.trim() || null,
638
+ description: I.shortDescription.trim(),
639
+ longDescription: I.longDescription.trim() || null,
640
+ price: parseFloat(I.price),
641
+ currency: I.currency,
486
642
  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
643
+ stockQuantity: parseInt(I.stockQuantity, 10),
644
+ sku: I.sku.trim() || null,
645
+ trackInventory: I.trackInventory,
646
+ allowBackorder: I.allowBackorder,
647
+ lowStockThreshold: I.lowStockThreshold.trim() ? parseInt(I.lowStockThreshold, 10) : null,
648
+ requiresShipping: I.requiresShipping,
649
+ weight: I.requiresShipping && I.weightKg.trim() ? parseFloat(I.weightKg) : null,
650
+ weightUnit: I.requiresShipping && I.weightKg.trim() ? I.weightUnit : null,
651
+ length: I.requiresShipping && I.length.trim() ? parseFloat(I.length) : null,
652
+ width: I.requiresShipping && I.width.trim() ? parseFloat(I.width) : null,
653
+ height: I.requiresShipping && I.height.trim() ? parseFloat(I.height) : null,
654
+ dimensionUnit: I.requiresShipping && r ? I.dimensionUnit : null,
655
+ brand: I.brand.trim() || null,
656
+ manufacturer: I.manufacturer.trim() || null,
657
+ countryOfOrigin: I.countryOfOrigin.trim() || null,
658
+ warrantyInfo: I.warrantyInfo.trim() || null,
659
+ returnPolicy: I.returnPolicy.trim() || null,
660
+ icon: n[0] ?? null,
661
+ screenshots: n.length > 1 ? n.slice(1) : null,
662
+ organizationId: N.id
497
663
  } })).createPhysicalProduct.id;
498
664
  await $(T, {
499
- id: n,
665
+ id: i,
500
666
  notes: "Submitted from seller portal"
501
- }), K(!0), setTimeout(() => {
502
- x?.(`${O}/seller/items`);
667
+ }), ce(!0), setTimeout(() => {
668
+ S?.(`${O}/seller/items`);
503
669
  }, 2e3);
504
670
  } catch (e) {
505
- W(e instanceof Error ? e.message : "Submission failed. Please try again.");
671
+ q(e instanceof Error ? e.message : "Submission failed. Please try again.");
506
672
  } finally {
507
- H(!1);
673
+ G(!1);
508
674
  }
509
675
  }
510
676
  },
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",
677
+ disabled: !J || W,
678
+ "aria-disabled": !J || W,
679
+ title: P ? "Setting up your seller organization..." : J ? void 0 : "Fill in all required fields to continue",
514
680
  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"),
515
- children: V ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(p, {
681
+ children: W ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(h, {
516
682
  size: 15,
517
683
  className: "animate-spin"
518
- }), "Submitting..."] }) : M ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(p, {
684
+ }), "Submitting..."] }) : P ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(h, {
519
685
  size: 15,
520
686
  className: "animate-spin"
521
687
  }), "Setting up your store..."] }) : "Create & Submit for Review"