@burdenoff/microfe-devportal 2026.915.1 → 2026.915.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/index.d.ts +1 -0
- package/dist/devportal/hooks/index.d.ts.map +1 -1
- package/dist/devportal/hooks/index.js +1 -0
- package/dist/devportal/hooks/useCarrierPickupLocations.d.ts +21 -0
- package/dist/devportal/hooks/useCarrierPickupLocations.d.ts.map +1 -0
- package/dist/devportal/hooks/useCarrierPickupLocations.js +29 -0
- package/dist/devportal/hooks/useCarrierPickupLocations.js.map +1 -0
- package/dist/devportal/pages/CreateOrganizationPage.d.ts.map +1 -1
- package/dist/devportal/pages/CreateOrganizationPage.js +165 -153
- package/dist/devportal/pages/CreateOrganizationPage.js.map +1 -1
- package/dist/devportal/pages/OrganizationDetailPage.d.ts.map +1 -1
- package/dist/devportal/pages/OrganizationDetailPage.js +310 -297
- package/dist/devportal/pages/OrganizationDetailPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,5 +6,6 @@
|
|
|
6
6
|
export { apolloClient, parseGraphQLError, getErrorMessage, isAuthError, isValidationError, clearApolloCache, resetApolloStore, type GraphQLErrorInfo, } from './useGraphQL';
|
|
7
7
|
export { DevPortalProvider } from './DevPortalProvider';
|
|
8
8
|
export { useDevportalPermission } from './usePermission';
|
|
9
|
+
export { useCarrierPickupLocations, type CarrierPickupLocation, type UseCarrierPickupLocationsResult, } from './useCarrierPickupLocations';
|
|
9
10
|
export * from '../../generated/global-operations';
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/devportal/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,gBAAgB,GACtB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,cAAc,mCAAmC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/devportal/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,gBAAgB,GACtB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,OAAO,EACL,yBAAyB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,+BAA+B,GACrC,MAAM,6BAA6B,CAAC;AAGrC,cAAc,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One of the platform's registered Shiprocket pickup/warehouse addresses.
|
|
3
|
+
*
|
|
4
|
+
* Backs the "Pickup Pincode" selector on the org creation form and the
|
|
5
|
+
* Fulfillment settings tab — sellers pick one of these instead of typing an
|
|
6
|
+
* arbitrary pincode that checkout would later refuse to ship (see
|
|
7
|
+
* global-store-svc's CarrierPickupUnavailableError / BOFF-7192).
|
|
8
|
+
*/
|
|
9
|
+
export interface CarrierPickupLocation {
|
|
10
|
+
label: string;
|
|
11
|
+
postalCode: string;
|
|
12
|
+
}
|
|
13
|
+
export interface UseCarrierPickupLocationsResult {
|
|
14
|
+
/** Registered pickup locations, or [] when Shiprocket isn't configured, the
|
|
15
|
+
* lookup fails, or the actor isn't authenticated yet — callers should fall
|
|
16
|
+
* back to a free-text pincode field in that case, never block on it. */
|
|
17
|
+
locations: CarrierPickupLocation[];
|
|
18
|
+
loading: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare function useCarrierPickupLocations(): UseCarrierPickupLocationsResult;
|
|
21
|
+
//# sourceMappingURL=useCarrierPickupLocations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCarrierPickupLocations.d.ts","sourceRoot":"","sources":["../../../src/devportal/hooks/useCarrierPickupLocations.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAWD,MAAM,WAAW,+BAA+B;IAC9C;;4EAEwE;IACxE,SAAS,EAAE,qBAAqB,EAAE,CAAC;IACnC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,yBAAyB,IAAI,+BAA+B,CA4B3E"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useEffect as e, useState as t } from "react";
|
|
2
|
+
import { graphqlFetch as n } from "@burdenoff/fe-libs/shared/graphql";
|
|
3
|
+
//#region src/devportal/hooks/useCarrierPickupLocations.ts
|
|
4
|
+
var r = "\n query DevportalCarrierPickupLocations {\n carrierPickupLocations {\n label\n postalCode\n }\n }\n";
|
|
5
|
+
function i() {
|
|
6
|
+
let [i, a] = t([]), [o, s] = t(!0);
|
|
7
|
+
return e(() => {
|
|
8
|
+
let e = !1;
|
|
9
|
+
return n({
|
|
10
|
+
gateway: "global",
|
|
11
|
+
query: r
|
|
12
|
+
}).then((t) => {
|
|
13
|
+
e || a(t.data?.carrierPickupLocations ?? []);
|
|
14
|
+
}).catch(() => {
|
|
15
|
+
e || a([]);
|
|
16
|
+
}).finally(() => {
|
|
17
|
+
e || s(!1);
|
|
18
|
+
}), () => {
|
|
19
|
+
e = !0;
|
|
20
|
+
};
|
|
21
|
+
}, []), {
|
|
22
|
+
locations: i,
|
|
23
|
+
loading: o
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { i as useCarrierPickupLocations };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=useCarrierPickupLocations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCarrierPickupLocations.js","names":[],"sources":["../../../src/devportal/hooks/useCarrierPickupLocations.ts"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { graphqlFetch } from \"@burdenoff/fe-libs/shared/graphql\";\n\n/**\n * One of the platform's registered Shiprocket pickup/warehouse addresses.\n *\n * Backs the \"Pickup Pincode\" selector on the org creation form and the\n * Fulfillment settings tab — sellers pick one of these instead of typing an\n * arbitrary pincode that checkout would later refuse to ship (see\n * global-store-svc's CarrierPickupUnavailableError / BOFF-7192).\n */\nexport interface CarrierPickupLocation {\n label: string;\n postalCode: string;\n}\n\nconst CARRIER_PICKUP_LOCATIONS_QUERY = `\n query DevportalCarrierPickupLocations {\n carrierPickupLocations {\n label\n postalCode\n }\n }\n`;\n\nexport interface UseCarrierPickupLocationsResult {\n /** Registered pickup locations, or [] when Shiprocket isn't configured, the\n * lookup fails, or the actor isn't authenticated yet — callers should fall\n * back to a free-text pincode field in that case, never block on it. */\n locations: CarrierPickupLocation[];\n loading: boolean;\n}\n\nexport function useCarrierPickupLocations(): UseCarrierPickupLocationsResult {\n const [locations, setLocations] = useState<CarrierPickupLocation[]>([]);\n const [loading, setLoading] = useState(true);\n\n useEffect(() => {\n let cancelled = false;\n\n graphqlFetch<{ carrierPickupLocations: CarrierPickupLocation[] }>({\n gateway: \"global\",\n query: CARRIER_PICKUP_LOCATIONS_QUERY,\n })\n .then((result) => {\n if (cancelled) return;\n setLocations(result.data?.carrierPickupLocations ?? []);\n })\n .catch(() => {\n if (!cancelled) setLocations([]);\n })\n .finally(() => {\n if (!cancelled) setLoading(false);\n });\n\n return () => {\n cancelled = true;\n };\n }, []);\n\n return { locations, loading };\n}\n"],"mappings":";;;AAgBA,IAAM,IAAiC;AAiBvC,SAAgB,IAA6D;CAC3E,IAAM,CAAC,GAAW,KAAgB,EAAkC,EAAE,CAAC,EACjE,CAAC,GAAS,KAAc,EAAS,GAAK;AAyB5C,QAvBA,QAAgB;EACd,IAAI,IAAY;AAiBhB,SAfA,EAAkE;GAChE,SAAS;GACT,OAAO;GACR,CAAC,CACC,MAAM,MAAW;AACZ,QACJ,EAAa,EAAO,MAAM,0BAA0B,EAAE,CAAC;IACvD,CACD,YAAY;AACX,GAAK,KAAW,EAAa,EAAE,CAAC;IAChC,CACD,cAAc;AACb,GAAK,KAAW,EAAW,GAAM;IACjC,QAES;AACX,OAAY;;IAEb,EAAE,CAAC,EAEC;EAAE;EAAW;EAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateOrganizationPage.d.ts","sourceRoot":"","sources":["../../../src/devportal/pages/CreateOrganizationPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CreateOrganizationPage.d.ts","sourceRoot":"","sources":["../../../src/devportal/pages/CreateOrganizationPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAoDhC;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,EAqmBpC,CAAC"}
|
|
@@ -5,34 +5,35 @@ import { useDevportalEventBus as r } from "../events/index.js";
|
|
|
5
5
|
import { orgSectionPath as i, useIsSellerSection as a } from "../hooks/useIsSellerSection.js";
|
|
6
6
|
import { useCreateBillingAccountMutation as o, useCreateOrganizationMutation as s, useCreateSellerOrganizationMutation as c, useGetBillingAccountsByOrgQuery as l, useLinkDevOrgBillingAccountMutation as u } from "../../generated/global-operations.js";
|
|
7
7
|
import { PageLayout as d, PageSection as f } from "../components/PageLayout.js";
|
|
8
|
-
import { InputField as p, TextareaField as m } from "../components/FormField.js";
|
|
8
|
+
import { InputField as p, SelectField as ee, TextareaField as m } from "../components/FormField.js";
|
|
9
9
|
import { PermissionGuard as h } from "../components/PermissionGuard.js";
|
|
10
10
|
import "../components/index.js";
|
|
11
|
+
import { useCarrierPickupLocations as g } from "../hooks/useCarrierPickupLocations.js";
|
|
11
12
|
import "../hooks/index.js";
|
|
12
|
-
import { useEffect as
|
|
13
|
-
import { Building2 as
|
|
14
|
-
import { Fragment as
|
|
13
|
+
import { useEffect as _, useMemo as v, useState as y } from "react";
|
|
14
|
+
import { Building2 as b, Check as x, Link2 as S, Loader2 as C, X as w } from "lucide-react";
|
|
15
|
+
import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
15
16
|
//#region src/devportal/pages/CreateOrganizationPage.tsx
|
|
16
|
-
var
|
|
17
|
-
let { navigate:
|
|
17
|
+
var O = () => {
|
|
18
|
+
let { navigate: O, basePath: k, currentUser: te, tenantId: ne, setActiveOrgId: re, setActivePhysicalOrgId: ie } = e(), A = a(), j = t(), [M, N] = y({}), [P] = s(), [F] = c(), [I] = o(), [L] = u(), R = r(), [z, B] = y("idle"), V = z !== "idle", [H, U] = y("auto"), [W, G] = y(null), { data: K, loading: q } = l({
|
|
18
19
|
fetchPolicy: "cache-and-network",
|
|
19
|
-
context: { headers: { "x-org-id":
|
|
20
|
-
}),
|
|
21
|
-
|
|
22
|
-
if (!(
|
|
23
|
-
if (
|
|
24
|
-
|
|
20
|
+
context: { headers: { "x-org-id": ne ?? "" } }
|
|
21
|
+
}), J = v(() => K?.getBillingAccountsByOrg ?? [], [K]);
|
|
22
|
+
_(() => {
|
|
23
|
+
if (!(H !== "existing" || q)) {
|
|
24
|
+
if (J.length === 0) {
|
|
25
|
+
U("auto");
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
+
W || G(J.find((e) => e.isDefault)?.id ?? J[0]?.id ?? null);
|
|
28
29
|
}
|
|
29
30
|
}, [
|
|
30
|
-
|
|
31
|
+
H,
|
|
32
|
+
q,
|
|
31
33
|
J,
|
|
32
|
-
|
|
33
|
-
G
|
|
34
|
+
W
|
|
34
35
|
]);
|
|
35
|
-
let [
|
|
36
|
+
let [Y, X] = y({
|
|
36
37
|
name: "",
|
|
37
38
|
slug: "",
|
|
38
39
|
description: "",
|
|
@@ -40,216 +41,227 @@ var E = () => {
|
|
|
40
41
|
contactEmail: "",
|
|
41
42
|
supportEmail: "",
|
|
42
43
|
pickupPostalCode: ""
|
|
43
|
-
}), Q = (e) => {
|
|
44
|
-
|
|
45
|
-
},
|
|
44
|
+
}), { locations: Z } = g(), Q = (e) => {
|
|
45
|
+
O?.(`${k}${e}`);
|
|
46
|
+
}, ae = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, ""), oe = (e) => {
|
|
46
47
|
let t = e.target.value;
|
|
47
|
-
|
|
48
|
+
X((e) => ({
|
|
48
49
|
...e,
|
|
49
50
|
name: t,
|
|
50
|
-
slug: e.slug ||
|
|
51
|
-
})),
|
|
51
|
+
slug: e.slug || ae(t)
|
|
52
|
+
})), M.name && N((e) => ({
|
|
52
53
|
...e,
|
|
53
54
|
name: void 0
|
|
54
55
|
}));
|
|
55
56
|
}, $ = (e, t) => {
|
|
56
|
-
|
|
57
|
+
X((n) => ({
|
|
57
58
|
...n,
|
|
58
59
|
[e]: t
|
|
59
|
-
})),
|
|
60
|
+
})), M[e] && N((t) => ({
|
|
60
61
|
...t,
|
|
61
62
|
[e]: void 0
|
|
62
63
|
}));
|
|
63
|
-
},
|
|
64
|
+
}, se = () => {
|
|
64
65
|
let e = {};
|
|
65
|
-
return
|
|
66
|
+
return Y.name.trim() ? Y.name.length < 2 ? e.name = j("devportal.orgNameTooShort", "Name must be at least 2 characters") : Y.name.length > 100 && (e.name = j("devportal.nameTooLong", "Name must be less than 100 characters")) : e.name = j("devportal.orgNameRequired", "Organization name is required"), Y.slug.trim() ? /^[a-z0-9-]+$/.test(Y.slug) || (e.slug = j("devportal.slugInvalid", "Slug can only contain lowercase letters, numbers, and hyphens")) : e.slug = j("devportal.slugRequired", "Slug is required"), Y.contactEmail && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(Y.contactEmail) && (e.contactEmail = j("devportal.invalidEmailAddress", "Invalid email address")), Y.supportEmail && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(Y.supportEmail) && (e.supportEmail = j("devportal.invalidEmailAddress", "Invalid email address")), N(e), Object.keys(e).length === 0;
|
|
66
67
|
};
|
|
67
|
-
return /* @__PURE__ */
|
|
68
|
+
return /* @__PURE__ */ E(h, {
|
|
68
69
|
authOnly: !0,
|
|
69
|
-
children: /* @__PURE__ */
|
|
70
|
-
title:
|
|
71
|
-
description:
|
|
72
|
-
purpose:
|
|
73
|
-
backLink: `${
|
|
74
|
-
backLabel:
|
|
75
|
-
children: /* @__PURE__ */
|
|
70
|
+
children: /* @__PURE__ */ E(d, {
|
|
71
|
+
title: j("devportal.createOrganization", "Create Organization"),
|
|
72
|
+
description: A ? j("devportal.createSellerOrganizationDescription", "Set up a seller organization to start selling physical products") : j("devportal.createOrganizationDescription", "Set up a developer organization to collaborate with your team"),
|
|
73
|
+
purpose: A ? j("devportal.createSellerOrganizationPurpose", "A seller organization is the shared owner of your physical listings, orders, and revenue. Create one here — you can invite members and complete legal/tax details afterwards.") : j("devportal.createOrganizationPurpose", "An organization is the shared owner of your apps, members, and revenue. Create one here so your team works under a single identity — pick a name and tier now; you can invite members and verify it afterwards."),
|
|
74
|
+
backLink: `${k}${i(A)}`,
|
|
75
|
+
backLabel: j("devportal.backToOrganizations", "Back to Organizations"),
|
|
76
|
+
children: /* @__PURE__ */ D("form", {
|
|
76
77
|
onSubmit: async (e) => {
|
|
77
|
-
if (e.preventDefault(),
|
|
78
|
-
|
|
78
|
+
if (e.preventDefault(), se()) {
|
|
79
|
+
B("creating-org");
|
|
79
80
|
try {
|
|
80
81
|
let e = {
|
|
81
|
-
name:
|
|
82
|
-
slug:
|
|
83
|
-
description:
|
|
84
|
-
websiteUrl:
|
|
85
|
-
contactEmail:
|
|
86
|
-
supportEmail:
|
|
87
|
-
pickupPostalCode:
|
|
88
|
-
}, t =
|
|
82
|
+
name: Y.name,
|
|
83
|
+
slug: Y.slug || void 0,
|
|
84
|
+
description: Y.description || void 0,
|
|
85
|
+
websiteUrl: Y.websiteUrl || void 0,
|
|
86
|
+
contactEmail: Y.contactEmail || void 0,
|
|
87
|
+
supportEmail: Y.supportEmail || void 0,
|
|
88
|
+
pickupPostalCode: A && Y.pickupPostalCode.trim() || void 0
|
|
89
|
+
}, t = A ? (await F({ variables: { input: e } })).data?.createSellerOrganization?.id : (await P({ variables: { input: e } })).data?.createDeveloperOrganization?.id;
|
|
89
90
|
if (!t) {
|
|
90
|
-
|
|
91
|
+
B("idle");
|
|
91
92
|
return;
|
|
92
93
|
}
|
|
93
|
-
if (
|
|
94
|
+
if (R.emit("devportal.org.created", {
|
|
94
95
|
organizationId: t,
|
|
95
|
-
name:
|
|
96
|
-
}),
|
|
97
|
-
|
|
96
|
+
name: Y.name
|
|
97
|
+
}), A ? ie(t) : re(t), H === "existing" && W) {
|
|
98
|
+
B("linking-billing");
|
|
98
99
|
try {
|
|
99
|
-
await
|
|
100
|
+
await L({ variables: {
|
|
100
101
|
organizationId: t,
|
|
101
|
-
billingAccountId:
|
|
102
|
+
billingAccountId: W
|
|
102
103
|
} });
|
|
103
104
|
} catch {}
|
|
104
105
|
} else {
|
|
105
|
-
|
|
106
|
+
B("setting-up-billing");
|
|
106
107
|
try {
|
|
107
|
-
let e = (await
|
|
108
|
-
name:
|
|
109
|
-
email:
|
|
108
|
+
let e = (await I({ variables: { input: {
|
|
109
|
+
name: Y.name,
|
|
110
|
+
email: te?.email ?? ""
|
|
110
111
|
} } })).data?.createBillingAccount?.id;
|
|
111
|
-
e && await
|
|
112
|
+
e && await L({ variables: {
|
|
112
113
|
organizationId: t,
|
|
113
114
|
billingAccountId: e
|
|
114
115
|
} });
|
|
115
116
|
} catch {}
|
|
116
117
|
}
|
|
117
|
-
|
|
118
|
+
B("redirecting"), Q(i(A, t));
|
|
118
119
|
} catch (e) {
|
|
119
|
-
console.error("Failed to create organization:", e),
|
|
120
|
+
console.error("Failed to create organization:", e), B("idle");
|
|
120
121
|
}
|
|
121
122
|
}
|
|
122
123
|
},
|
|
123
124
|
className: "space-y-8 max-w-3xl",
|
|
124
125
|
children: [
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
title:
|
|
127
|
-
description:
|
|
128
|
-
children: /* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ E(f, {
|
|
127
|
+
title: j("devportal.organizationDetails", "Organization Details"),
|
|
128
|
+
description: j("devportal.organizationDetailsDescription", "Basic information about your organization"),
|
|
129
|
+
children: /* @__PURE__ */ D("div", {
|
|
129
130
|
className: "space-y-4",
|
|
130
131
|
children: [
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
label:
|
|
133
|
-
value:
|
|
134
|
-
onChange:
|
|
135
|
-
placeholder:
|
|
132
|
+
/* @__PURE__ */ E(p, {
|
|
133
|
+
label: j("devportal.organizationName", "Organization Name"),
|
|
134
|
+
value: Y.name,
|
|
135
|
+
onChange: oe,
|
|
136
|
+
placeholder: j("devportal.organizationNamePlaceholder", "Acme Development"),
|
|
136
137
|
required: !0,
|
|
137
|
-
error:
|
|
138
|
-
hint:
|
|
138
|
+
error: M.name,
|
|
139
|
+
hint: j("devportal.organizationNameHint", "Your organization's display name")
|
|
139
140
|
}),
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
label:
|
|
142
|
-
value:
|
|
141
|
+
/* @__PURE__ */ E(p, {
|
|
142
|
+
label: j("devportal.slug", "Slug"),
|
|
143
|
+
value: Y.slug,
|
|
143
144
|
onChange: (e) => $("slug", e.target.value.toLowerCase()),
|
|
144
|
-
placeholder:
|
|
145
|
+
placeholder: j("devportal.orgSlugPlaceholder", "acme-dev"),
|
|
145
146
|
required: !0,
|
|
146
|
-
error:
|
|
147
|
-
hint:
|
|
147
|
+
error: M.slug,
|
|
148
|
+
hint: j("devportal.slugHint", "URL-friendly identifier (auto-generated from name)")
|
|
148
149
|
}),
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
label:
|
|
151
|
-
value:
|
|
150
|
+
/* @__PURE__ */ E(m, {
|
|
151
|
+
label: j("devportal.description", "Description"),
|
|
152
|
+
value: Y.description,
|
|
152
153
|
onChange: (e) => $("description", e.target.value),
|
|
153
|
-
placeholder:
|
|
154
|
+
placeholder: j("devportal.orgDescriptionPlaceholder", "Tell us about your organization..."),
|
|
154
155
|
rows: 3
|
|
155
156
|
}),
|
|
156
|
-
/* @__PURE__ */
|
|
157
|
-
label:
|
|
157
|
+
/* @__PURE__ */ E(p, {
|
|
158
|
+
label: j("devportal.websiteUrl", "Website URL"),
|
|
158
159
|
type: "url",
|
|
159
|
-
value:
|
|
160
|
+
value: Y.websiteUrl,
|
|
160
161
|
onChange: (e) => $("websiteUrl", e.target.value),
|
|
161
162
|
placeholder: "https://example.com"
|
|
162
163
|
}),
|
|
163
|
-
|
|
164
|
-
label:
|
|
165
|
-
value:
|
|
164
|
+
A && Z.length > 0 && /* @__PURE__ */ E(ee, {
|
|
165
|
+
label: j("devportal.pickupPostalCode", "Pickup Pincode (optional)"),
|
|
166
|
+
value: Y.pickupPostalCode,
|
|
167
|
+
onChange: (e) => $("pickupPostalCode", e.target.value),
|
|
168
|
+
placeholder: j("devportal.pickupPostalCodeUseBilling", "Use billing account address"),
|
|
169
|
+
options: Z.map((e) => ({
|
|
170
|
+
value: e.postalCode,
|
|
171
|
+
label: `${e.label} — ${e.postalCode}`
|
|
172
|
+
})),
|
|
173
|
+
hint: j("devportal.pickupPostalCodeHint", "The postal code your physical orders actually ship from — used to quote real carrier shipping rates. You can skip this now and set it later from organization settings.")
|
|
174
|
+
}),
|
|
175
|
+
A && Z.length === 0 && /* @__PURE__ */ E(p, {
|
|
176
|
+
label: j("devportal.pickupPostalCode", "Pickup Pincode (optional)"),
|
|
177
|
+
value: Y.pickupPostalCode,
|
|
166
178
|
onChange: (e) => $("pickupPostalCode", e.target.value),
|
|
167
179
|
placeholder: "560001",
|
|
168
|
-
hint:
|
|
180
|
+
hint: j("devportal.pickupPostalCodeHintFallback", "The postal code your physical orders actually ship from — used to quote real carrier shipping rates. You can skip this now and set it later from organization settings. (Live pickup-location list unavailable — enter your pincode manually.)")
|
|
169
181
|
}),
|
|
170
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ D("div", {
|
|
171
183
|
className: "grid gap-4 sm:grid-cols-2",
|
|
172
|
-
children: [/* @__PURE__ */
|
|
173
|
-
label:
|
|
184
|
+
children: [/* @__PURE__ */ E(p, {
|
|
185
|
+
label: j("devportal.contactEmail", "Contact Email"),
|
|
174
186
|
type: "email",
|
|
175
|
-
value:
|
|
187
|
+
value: Y.contactEmail,
|
|
176
188
|
onChange: (e) => $("contactEmail", e.target.value),
|
|
177
189
|
placeholder: "contact@example.com",
|
|
178
|
-
error:
|
|
179
|
-
}), /* @__PURE__ */
|
|
180
|
-
label:
|
|
190
|
+
error: M.contactEmail
|
|
191
|
+
}), /* @__PURE__ */ E(p, {
|
|
192
|
+
label: j("devportal.supportEmail", "Support Email"),
|
|
181
193
|
type: "email",
|
|
182
|
-
value:
|
|
194
|
+
value: Y.supportEmail,
|
|
183
195
|
onChange: (e) => $("supportEmail", e.target.value),
|
|
184
196
|
placeholder: "support@example.com",
|
|
185
|
-
error:
|
|
197
|
+
error: M.supportEmail
|
|
186
198
|
})]
|
|
187
199
|
})
|
|
188
200
|
]
|
|
189
201
|
})
|
|
190
202
|
}),
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
title:
|
|
193
|
-
description:
|
|
194
|
-
children: /* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ E(f, {
|
|
204
|
+
title: j("devportal.billingAccount", "Billing Account"),
|
|
205
|
+
description: j("devportal.billingAccountSectionDescription", "Revenue from sales will be credited here. You can change this anytime from the Revenue page."),
|
|
206
|
+
children: /* @__PURE__ */ D("div", {
|
|
195
207
|
className: "space-y-3",
|
|
196
208
|
children: [
|
|
197
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ D("button", {
|
|
198
210
|
type: "button",
|
|
199
|
-
onClick: () =>
|
|
200
|
-
disabled:
|
|
201
|
-
className: n("flex w-full items-start gap-3 rounded-lg border px-4 py-3 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-50",
|
|
202
|
-
children: [/* @__PURE__ */
|
|
211
|
+
onClick: () => U("auto"),
|
|
212
|
+
disabled: V,
|
|
213
|
+
className: n("flex w-full items-start gap-3 rounded-lg border px-4 py-3 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-50", H === "auto" ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:bg-bg-sunken"),
|
|
214
|
+
children: [/* @__PURE__ */ E(x, {
|
|
203
215
|
size: 16,
|
|
204
|
-
className: n("mt-0.5 flex-shrink-0",
|
|
205
|
-
}), /* @__PURE__ */
|
|
216
|
+
className: n("mt-0.5 flex-shrink-0", H === "auto" ? "opacity-100 text-primary" : "opacity-0")
|
|
217
|
+
}), /* @__PURE__ */ D("div", {
|
|
206
218
|
className: "flex-1 min-w-0",
|
|
207
|
-
children: [/* @__PURE__ */
|
|
219
|
+
children: [/* @__PURE__ */ E("p", {
|
|
208
220
|
className: "text-sm font-medium",
|
|
209
|
-
children:
|
|
210
|
-
}), /* @__PURE__ */
|
|
221
|
+
children: j("devportal.billingAutoCreate", "Create a new billing account automatically")
|
|
222
|
+
}), /* @__PURE__ */ E("p", {
|
|
211
223
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
212
|
-
children:
|
|
224
|
+
children: j("devportal.billingAutoCreateHint", "We'll set one up using your organization name and account email. You can complete legal and tax details for payouts later in Organization Settings.")
|
|
213
225
|
})]
|
|
214
226
|
})]
|
|
215
227
|
}),
|
|
216
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ D("button", {
|
|
217
229
|
type: "button",
|
|
218
|
-
onClick: () =>
|
|
219
|
-
disabled:
|
|
220
|
-
className: n("flex w-full items-start gap-3 rounded-lg border px-4 py-3 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-50",
|
|
221
|
-
children: [/* @__PURE__ */
|
|
230
|
+
onClick: () => U("existing"),
|
|
231
|
+
disabled: V || !q && J.length === 0,
|
|
232
|
+
className: n("flex w-full items-start gap-3 rounded-lg border px-4 py-3 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-50", H === "existing" ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:bg-bg-sunken"),
|
|
233
|
+
children: [/* @__PURE__ */ E(x, {
|
|
222
234
|
size: 16,
|
|
223
|
-
className: n("mt-0.5 flex-shrink-0",
|
|
224
|
-
}), /* @__PURE__ */
|
|
235
|
+
className: n("mt-0.5 flex-shrink-0", H === "existing" ? "opacity-100 text-primary" : "opacity-0")
|
|
236
|
+
}), /* @__PURE__ */ D("div", {
|
|
225
237
|
className: "flex-1 min-w-0",
|
|
226
|
-
children: [/* @__PURE__ */
|
|
238
|
+
children: [/* @__PURE__ */ D("p", {
|
|
227
239
|
className: "flex items-center gap-1.5 text-sm font-medium",
|
|
228
|
-
children: [/* @__PURE__ */
|
|
229
|
-
}), /* @__PURE__ */
|
|
240
|
+
children: [/* @__PURE__ */ E(S, { size: 14 }), j("devportal.billingLinkExisting", "Link an existing billing account")]
|
|
241
|
+
}), /* @__PURE__ */ E("p", {
|
|
230
242
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
231
|
-
children:
|
|
243
|
+
children: q ? j("devportal.billingAccountsLoading", "Loading your billing accounts...") : J.length === 0 ? j("devportal.noBillingAccountsYet", "You don't have any billing accounts yet — create one from account billing settings first.") : j("devportal.billingAccountsAvailable", "{{count}} billing account(s) available to link", { count: J.length })
|
|
232
244
|
})]
|
|
233
245
|
})]
|
|
234
246
|
}),
|
|
235
|
-
|
|
247
|
+
H === "existing" && J.length > 0 && /* @__PURE__ */ E("div", {
|
|
236
248
|
className: "ml-8 space-y-2",
|
|
237
|
-
children:
|
|
249
|
+
children: J.map((e) => /* @__PURE__ */ D("button", {
|
|
238
250
|
type: "button",
|
|
239
|
-
disabled:
|
|
240
|
-
onClick: () =>
|
|
241
|
-
className: n("flex w-full items-center gap-3 rounded-md border px-3 py-2 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50",
|
|
242
|
-
children: [/* @__PURE__ */
|
|
251
|
+
disabled: V,
|
|
252
|
+
onClick: () => G(e.id ?? null),
|
|
253
|
+
className: n("flex w-full items-center gap-3 rounded-md border px-3 py-2 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50", W === e.id ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:bg-bg-sunken"),
|
|
254
|
+
children: [/* @__PURE__ */ E(x, {
|
|
243
255
|
size: 14,
|
|
244
|
-
className: n("flex-shrink-0",
|
|
245
|
-
}), /* @__PURE__ */
|
|
256
|
+
className: n("flex-shrink-0", W === e.id ? "opacity-100 text-primary" : "opacity-0")
|
|
257
|
+
}), /* @__PURE__ */ D("div", {
|
|
246
258
|
className: "min-w-0 flex-1",
|
|
247
|
-
children: [/* @__PURE__ */
|
|
259
|
+
children: [/* @__PURE__ */ E("p", {
|
|
248
260
|
className: "truncate font-medium",
|
|
249
261
|
children: e.name
|
|
250
|
-
}), e.isDefault && /* @__PURE__ */
|
|
262
|
+
}), e.isDefault && /* @__PURE__ */ E("p", {
|
|
251
263
|
className: "text-xs text-text-secondary",
|
|
252
|
-
children:
|
|
264
|
+
children: j("devportal.revenue.defaultAccount", "Default")
|
|
253
265
|
})]
|
|
254
266
|
})]
|
|
255
267
|
}, e.id))
|
|
@@ -257,39 +269,39 @@ var E = () => {
|
|
|
257
269
|
]
|
|
258
270
|
})
|
|
259
271
|
}),
|
|
260
|
-
|
|
272
|
+
V && /* @__PURE__ */ D("div", {
|
|
261
273
|
className: "flex items-center gap-2 rounded-lg border border-border-subtle bg-bg-sunken px-4 py-3 text-sm text-text-secondary",
|
|
262
274
|
children: [
|
|
263
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ E(C, {
|
|
264
276
|
size: 16,
|
|
265
277
|
className: "flex-shrink-0 animate-spin text-primary"
|
|
266
278
|
}),
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
279
|
+
z === "creating-org" && j("devportal.creatingOrgStatus", "Creating your organization..."),
|
|
280
|
+
z === "setting-up-billing" && j("devportal.settingUpBillingStatus", "Setting up your billing account..."),
|
|
281
|
+
z === "linking-billing" && j("devportal.linkingBillingStatus", "Linking your billing account..."),
|
|
282
|
+
z === "redirecting" && j("devportal.redirectingStatus", "All set — redirecting...")
|
|
271
283
|
]
|
|
272
284
|
}),
|
|
273
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ D("div", {
|
|
274
286
|
className: "flex items-center justify-end gap-3 border-t pt-6",
|
|
275
|
-
children: [/* @__PURE__ */
|
|
287
|
+
children: [/* @__PURE__ */ D("button", {
|
|
276
288
|
type: "button",
|
|
277
289
|
onClick: () => {
|
|
278
|
-
Q(i(
|
|
290
|
+
Q(i(A));
|
|
279
291
|
},
|
|
280
|
-
disabled:
|
|
292
|
+
disabled: V,
|
|
281
293
|
className: "inline-flex items-center gap-2 rounded-md border px-4 py-2 text-sm font-medium hover:bg-bg-sunken transition-colors disabled:opacity-50",
|
|
282
|
-
children: [/* @__PURE__ */ w
|
|
283
|
-
}), /* @__PURE__ */
|
|
294
|
+
children: [/* @__PURE__ */ E(w, { size: 16 }), j("devportal.cancel", "Cancel")]
|
|
295
|
+
}), /* @__PURE__ */ E("button", {
|
|
284
296
|
type: "submit",
|
|
285
|
-
disabled:
|
|
297
|
+
disabled: V,
|
|
286
298
|
className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50",
|
|
287
|
-
children:
|
|
288
|
-
/* @__PURE__ */
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
(
|
|
292
|
-
] }) : /* @__PURE__ */ T
|
|
299
|
+
children: V ? /* @__PURE__ */ D(T, { children: [
|
|
300
|
+
/* @__PURE__ */ E("span", { className: "h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
301
|
+
z === "setting-up-billing" && j("devportal.settingUpBilling", "Setting up billing..."),
|
|
302
|
+
z === "linking-billing" && j("devportal.linkingBilling", "Linking billing..."),
|
|
303
|
+
(z === "creating-org" || z === "redirecting") && j("devportal.creating", "Creating...")
|
|
304
|
+
] }) : /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(b, { size: 16 }), j("devportal.createOrganization", "Create Organization")] })
|
|
293
305
|
})]
|
|
294
306
|
})
|
|
295
307
|
]
|
|
@@ -298,6 +310,6 @@ var E = () => {
|
|
|
298
310
|
});
|
|
299
311
|
};
|
|
300
312
|
//#endregion
|
|
301
|
-
export {
|
|
313
|
+
export { O as CreateOrganizationPage };
|
|
302
314
|
|
|
303
315
|
//# sourceMappingURL=CreateOrganizationPage.js.map
|