@burdenoff/microfe-devportal 2026.915.1 → 2026.915.3

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.
@@ -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, capitalizeCarrierName, 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;AAIzD,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,+BAA+B,GACrC,MAAM,6BAA6B,CAAC;AAGrC,cAAc,mCAAmC,CAAC"}
@@ -2,3 +2,4 @@ import "../../generated/global-operations.js";
2
2
  import "./useGraphQL.js";
3
3
  import "./DevPortalProvider.js";
4
4
  import "./usePermission.js";
5
+ import "./useCarrierPickupLocations.js";
@@ -0,0 +1,28 @@
1
+ /**
2
+ * One of a shipping carrier's own registered pickup/warehouse addresses.
3
+ * Not organization-scoped — a pickup location belongs to whichever carrier
4
+ * account it's registered with (Shiprocket today; more carriers may be
5
+ * added later, each contributing their own locations).
6
+ *
7
+ * Backs the "Pickup Pincode" selector on the org creation form and the
8
+ * Fulfillment settings tab — sellers pick one of these instead of typing an
9
+ * arbitrary pincode that checkout would later refuse to ship (see
10
+ * global-store-svc's CarrierPickupUnavailableError / BOFF-7192).
11
+ */
12
+ export interface CarrierPickupLocation {
13
+ label: string;
14
+ postalCode: string;
15
+ /** Which carrier this address is registered with, e.g. "shiprocket". */
16
+ carrier: string;
17
+ }
18
+ /** "shiprocket" -> "Shiprocket" — for display in the pickup-location dropdown. */
19
+ export declare function capitalizeCarrierName(carrier: string): string;
20
+ export interface UseCarrierPickupLocationsResult {
21
+ /** Registered pickup locations, or [] when Shiprocket isn't configured, the
22
+ * lookup fails, or the actor isn't authenticated yet — callers should fall
23
+ * back to a free-text pincode field in that case, never block on it. */
24
+ locations: CarrierPickupLocation[];
25
+ loading: boolean;
26
+ }
27
+ export declare function useCarrierPickupLocations(): UseCarrierPickupLocationsResult;
28
+ //# 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;;;;;;;;;;GAUG;AACH,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,OAAO,EAAE,MAAM,CAAC;CACjB;AAYD,kFAAkF;AAClF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAI7D;AAED,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,32 @@
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 carrier\n }\n }\n";
5
+ function i(e) {
6
+ return e.length > 0 ? e[0].toUpperCase() + e.slice(1) : e;
7
+ }
8
+ function a() {
9
+ let [i, a] = t([]), [o, s] = t(!0);
10
+ return e(() => {
11
+ let e = !1;
12
+ return n({
13
+ gateway: "global",
14
+ query: r
15
+ }).then((t) => {
16
+ e || a(t.data?.carrierPickupLocations ?? []);
17
+ }).catch(() => {
18
+ e || a([]);
19
+ }).finally(() => {
20
+ e || s(!1);
21
+ }), () => {
22
+ e = !0;
23
+ };
24
+ }, []), {
25
+ locations: i,
26
+ loading: o
27
+ };
28
+ }
29
+ //#endregion
30
+ export { i as capitalizeCarrierName, a as useCarrierPickupLocations };
31
+
32
+ //# 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 a shipping carrier's own registered pickup/warehouse addresses.\n * Not organization-scoped — a pickup location belongs to whichever carrier\n * account it's registered with (Shiprocket today; more carriers may be\n * added later, each contributing their own locations).\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 /** Which carrier this address is registered with, e.g. \"shiprocket\". */\n carrier: string;\n}\n\nconst CARRIER_PICKUP_LOCATIONS_QUERY = `\n query DevportalCarrierPickupLocations {\n carrierPickupLocations {\n label\n postalCode\n carrier\n }\n }\n`;\n\n/** \"shiprocket\" -> \"Shiprocket\" — for display in the pickup-location dropdown. */\nexport function capitalizeCarrierName(carrier: string): string {\n return carrier.length > 0\n ? carrier[0].toUpperCase() + carrier.slice(1)\n : carrier;\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":";;;AAqBA,IAAM,IAAiC;AAWvC,SAAgB,EAAsB,GAAyB;AAC7D,QAAO,EAAQ,SAAS,IACpB,EAAQ,GAAG,aAAa,GAAG,EAAQ,MAAM,EAAE,GAC3C;;AAWN,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;AA+ChC;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,EA4kBpC,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;AAuDhC;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,EAqmBpC,CAAC"}
@@ -3,36 +3,37 @@ import { useTr as t } from "../utils/i18n.js";
3
3
  import { cn as n } from "../utils/cn.js";
4
4
  import { useDevportalEventBus as r } from "../events/index.js";
5
5
  import { orgSectionPath as i, useIsSellerSection as a } from "../hooks/useIsSellerSection.js";
6
- import { useCreateBillingAccountMutation as o, useCreateOrganizationMutation as s, useCreateSellerOrganizationMutation as c, useGetBillingAccountsByOrgQuery as l, useLinkDevOrgBillingAccountMutation as u } from "../../generated/global-operations.js";
7
- import { PageLayout as d, PageSection as f } from "../components/PageLayout.js";
8
- import { InputField as p, TextareaField as m } from "../components/FormField.js";
9
- import { PermissionGuard as h } from "../components/PermissionGuard.js";
6
+ import { useCreateBillingAccountMutation as ee, useCreateOrganizationMutation as te, useCreateSellerOrganizationMutation as o, useGetBillingAccountsByOrgQuery as s, useLinkDevOrgBillingAccountMutation as c } from "../../generated/global-operations.js";
7
+ import { PageLayout as l, PageSection as u } from "../components/PageLayout.js";
8
+ import { InputField as d, SelectField as f, TextareaField as p } from "../components/FormField.js";
9
+ import { PermissionGuard as m } from "../components/PermissionGuard.js";
10
10
  import "../components/index.js";
11
+ import { capitalizeCarrierName as h, useCarrierPickupLocations as g } from "../hooks/useCarrierPickupLocations.js";
11
12
  import "../hooks/index.js";
12
- import { useEffect as g, useMemo as _, useState as v } from "react";
13
- import { Building2 as y, Check as b, Link2 as x, Loader2 as S, X as ee } from "lucide-react";
13
+ import { useEffect as _, useMemo as v, useState as y } from "react";
14
+ import { Building2 as ne, Check as b, Link2 as re, Loader2 as x, X as S } from "lucide-react";
14
15
  import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
15
16
  //#region src/devportal/pages/CreateOrganizationPage.tsx
16
17
  var E = () => {
17
- let { navigate: E, basePath: D, currentUser: O, tenantId: k, setActiveOrgId: A, setActivePhysicalOrgId: te } = e(), j = a(), M = t(), [N, P] = v({}), [F] = s(), [I] = c(), [L] = o(), [R] = u(), z = r(), [B, V] = v("idle"), H = B !== "idle", [U, W] = v("auto"), [G, K] = v(null), { data: q, loading: J } = l({
18
+ let { navigate: E, basePath: D, currentUser: O, tenantId: ie, setActiveOrgId: ae, setActivePhysicalOrgId: k } = e(), A = a(), j = t(), [M, N] = y({}), [P] = te(), [F] = o(), [I] = ee(), [L] = c(), R = r(), [z, B] = y("idle"), V = z !== "idle", [H, U] = y("auto"), [W, G] = y(null), { data: K, loading: q } = s({
18
19
  fetchPolicy: "cache-and-network",
19
- context: { headers: { "x-org-id": k ?? "" } }
20
- }), Y = _(() => q?.getBillingAccountsByOrg ?? [], [q]);
21
- g(() => {
22
- if (!(U !== "existing" || J)) {
23
- if (Y.length === 0) {
24
- W("auto");
20
+ context: { headers: { "x-org-id": ie ?? "" } }
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
- G || K(Y.find((e) => e.isDefault)?.id ?? Y[0]?.id ?? null);
28
+ W || G(J.find((e) => e.isDefault)?.id ?? J[0]?.id ?? null);
28
29
  }
29
30
  }, [
30
- U,
31
+ H,
32
+ q,
31
33
  J,
32
- Y,
33
- G
34
+ W
34
35
  ]);
35
- let [X, Z] = v({
36
+ let [Y, X] = y({
36
37
  name: "",
37
38
  slug: "",
38
39
  description: "",
@@ -40,208 +41,219 @@ var E = () => {
40
41
  contactEmail: "",
41
42
  supportEmail: "",
42
43
  pickupPostalCode: ""
43
- }), Q = (e) => {
44
+ }), { locations: Z } = g(), Q = (e) => {
44
45
  E?.(`${D}${e}`);
45
- }, ne = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, ""), re = (e) => {
46
+ }, oe = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, ""), se = (e) => {
46
47
  let t = e.target.value;
47
- Z((e) => ({
48
+ X((e) => ({
48
49
  ...e,
49
50
  name: t,
50
- slug: e.slug || ne(t)
51
- })), N.name && P((e) => ({
51
+ slug: e.slug || oe(t)
52
+ })), M.name && N((e) => ({
52
53
  ...e,
53
54
  name: void 0
54
55
  }));
55
56
  }, $ = (e, t) => {
56
- Z((n) => ({
57
+ X((n) => ({
57
58
  ...n,
58
59
  [e]: t
59
- })), N[e] && P((t) => ({
60
+ })), M[e] && N((t) => ({
60
61
  ...t,
61
62
  [e]: void 0
62
63
  }));
63
- }, ie = () => {
64
+ }, ce = () => {
64
65
  let e = {};
65
- return X.name.trim() ? X.name.length < 2 ? e.name = M("devportal.orgNameTooShort", "Name must be at least 2 characters") : X.name.length > 100 && (e.name = M("devportal.nameTooLong", "Name must be less than 100 characters")) : e.name = M("devportal.orgNameRequired", "Organization name is required"), X.slug.trim() ? /^[a-z0-9-]+$/.test(X.slug) || (e.slug = M("devportal.slugInvalid", "Slug can only contain lowercase letters, numbers, and hyphens")) : e.slug = M("devportal.slugRequired", "Slug is required"), X.contactEmail && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(X.contactEmail) && (e.contactEmail = M("devportal.invalidEmailAddress", "Invalid email address")), X.supportEmail && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(X.supportEmail) && (e.supportEmail = M("devportal.invalidEmailAddress", "Invalid email address")), P(e), Object.keys(e).length === 0;
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__ */ w(h, {
68
+ return /* @__PURE__ */ w(m, {
68
69
  authOnly: !0,
69
- children: /* @__PURE__ */ w(d, {
70
- title: M("devportal.createOrganization", "Create Organization"),
71
- description: j ? M("devportal.createSellerOrganizationDescription", "Set up a seller organization to start selling physical products") : M("devportal.createOrganizationDescription", "Set up a developer organization to collaborate with your team"),
72
- purpose: j ? M("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.") : M("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."),
73
- backLink: `${D}${i(j)}`,
74
- backLabel: M("devportal.backToOrganizations", "Back to Organizations"),
70
+ children: /* @__PURE__ */ w(l, {
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: `${D}${i(A)}`,
75
+ backLabel: j("devportal.backToOrganizations", "Back to Organizations"),
75
76
  children: /* @__PURE__ */ T("form", {
76
77
  onSubmit: async (e) => {
77
- if (e.preventDefault(), ie()) {
78
- V("creating-org");
78
+ if (e.preventDefault(), ce()) {
79
+ B("creating-org");
79
80
  try {
80
81
  let e = {
81
- name: X.name,
82
- slug: X.slug || void 0,
83
- description: X.description || void 0,
84
- websiteUrl: X.websiteUrl || void 0,
85
- contactEmail: X.contactEmail || void 0,
86
- supportEmail: X.supportEmail || void 0,
87
- pickupPostalCode: j && X.pickupPostalCode.trim() || void 0
88
- }, t = j ? (await I({ variables: { input: e } })).data?.createSellerOrganization?.id : (await F({ variables: { input: e } })).data?.createDeveloperOrganization?.id;
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
- V("idle");
91
+ B("idle");
91
92
  return;
92
93
  }
93
- if (z.emit("devportal.org.created", {
94
+ if (R.emit("devportal.org.created", {
94
95
  organizationId: t,
95
- name: X.name
96
- }), j ? te(t) : A(t), U === "existing" && G) {
97
- V("linking-billing");
96
+ name: Y.name
97
+ }), A ? k(t) : ae(t), H === "existing" && W) {
98
+ B("linking-billing");
98
99
  try {
99
- await R({ variables: {
100
+ await L({ variables: {
100
101
  organizationId: t,
101
- billingAccountId: G
102
+ billingAccountId: W
102
103
  } });
103
104
  } catch {}
104
105
  } else {
105
- V("setting-up-billing");
106
+ B("setting-up-billing");
106
107
  try {
107
- let e = (await L({ variables: { input: {
108
- name: X.name,
108
+ let e = (await I({ variables: { input: {
109
+ name: Y.name,
109
110
  email: O?.email ?? ""
110
111
  } } })).data?.createBillingAccount?.id;
111
- e && await R({ variables: {
112
+ e && await L({ variables: {
112
113
  organizationId: t,
113
114
  billingAccountId: e
114
115
  } });
115
116
  } catch {}
116
117
  }
117
- V("redirecting"), Q(i(j, t));
118
+ B("redirecting"), Q(i(A, t));
118
119
  } catch (e) {
119
- console.error("Failed to create organization:", e), V("idle");
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__ */ w(f, {
126
- title: M("devportal.organizationDetails", "Organization Details"),
127
- description: M("devportal.organizationDetailsDescription", "Basic information about your organization"),
126
+ /* @__PURE__ */ w(u, {
127
+ title: j("devportal.organizationDetails", "Organization Details"),
128
+ description: j("devportal.organizationDetailsDescription", "Basic information about your organization"),
128
129
  children: /* @__PURE__ */ T("div", {
129
130
  className: "space-y-4",
130
131
  children: [
131
- /* @__PURE__ */ w(p, {
132
- label: M("devportal.organizationName", "Organization Name"),
133
- value: X.name,
134
- onChange: re,
135
- placeholder: M("devportal.organizationNamePlaceholder", "Acme Development"),
132
+ /* @__PURE__ */ w(d, {
133
+ label: j("devportal.organizationName", "Organization Name"),
134
+ value: Y.name,
135
+ onChange: se,
136
+ placeholder: j("devportal.organizationNamePlaceholder", "Acme Development"),
136
137
  required: !0,
137
- error: N.name,
138
- hint: M("devportal.organizationNameHint", "Your organization's display name")
138
+ error: M.name,
139
+ hint: j("devportal.organizationNameHint", "Your organization's display name")
139
140
  }),
140
- /* @__PURE__ */ w(p, {
141
- label: M("devportal.slug", "Slug"),
142
- value: X.slug,
141
+ /* @__PURE__ */ w(d, {
142
+ label: j("devportal.slug", "Slug"),
143
+ value: Y.slug,
143
144
  onChange: (e) => $("slug", e.target.value.toLowerCase()),
144
- placeholder: M("devportal.orgSlugPlaceholder", "acme-dev"),
145
+ placeholder: j("devportal.orgSlugPlaceholder", "acme-dev"),
145
146
  required: !0,
146
- error: N.slug,
147
- hint: M("devportal.slugHint", "URL-friendly identifier (auto-generated from name)")
147
+ error: M.slug,
148
+ hint: j("devportal.slugHint", "URL-friendly identifier (auto-generated from name)")
148
149
  }),
149
- /* @__PURE__ */ w(m, {
150
- label: M("devportal.description", "Description"),
151
- value: X.description,
150
+ /* @__PURE__ */ w(p, {
151
+ label: j("devportal.description", "Description"),
152
+ value: Y.description,
152
153
  onChange: (e) => $("description", e.target.value),
153
- placeholder: M("devportal.orgDescriptionPlaceholder", "Tell us about your organization..."),
154
+ placeholder: j("devportal.orgDescriptionPlaceholder", "Tell us about your organization..."),
154
155
  rows: 3
155
156
  }),
156
- /* @__PURE__ */ w(p, {
157
- label: M("devportal.websiteUrl", "Website URL"),
157
+ /* @__PURE__ */ w(d, {
158
+ label: j("devportal.websiteUrl", "Website URL"),
158
159
  type: "url",
159
- value: X.websiteUrl,
160
+ value: Y.websiteUrl,
160
161
  onChange: (e) => $("websiteUrl", e.target.value),
161
162
  placeholder: "https://example.com"
162
163
  }),
163
- j && /* @__PURE__ */ w(p, {
164
- label: M("devportal.pickupPostalCode", "Pickup Pincode (optional)"),
165
- value: X.pickupPostalCode,
164
+ A && Z.length > 0 && /* @__PURE__ */ w(f, {
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} · ${h(e.carrier)}`
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__ */ w(d, {
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: M("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.")
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
182
  /* @__PURE__ */ T("div", {
171
183
  className: "grid gap-4 sm:grid-cols-2",
172
- children: [/* @__PURE__ */ w(p, {
173
- label: M("devportal.contactEmail", "Contact Email"),
184
+ children: [/* @__PURE__ */ w(d, {
185
+ label: j("devportal.contactEmail", "Contact Email"),
174
186
  type: "email",
175
- value: X.contactEmail,
187
+ value: Y.contactEmail,
176
188
  onChange: (e) => $("contactEmail", e.target.value),
177
189
  placeholder: "contact@example.com",
178
- error: N.contactEmail
179
- }), /* @__PURE__ */ w(p, {
180
- label: M("devportal.supportEmail", "Support Email"),
190
+ error: M.contactEmail
191
+ }), /* @__PURE__ */ w(d, {
192
+ label: j("devportal.supportEmail", "Support Email"),
181
193
  type: "email",
182
- value: X.supportEmail,
194
+ value: Y.supportEmail,
183
195
  onChange: (e) => $("supportEmail", e.target.value),
184
196
  placeholder: "support@example.com",
185
- error: N.supportEmail
197
+ error: M.supportEmail
186
198
  })]
187
199
  })
188
200
  ]
189
201
  })
190
202
  }),
191
- /* @__PURE__ */ w(f, {
192
- title: M("devportal.billingAccount", "Billing Account"),
193
- description: M("devportal.billingAccountSectionDescription", "Revenue from sales will be credited here. You can change this anytime from the Revenue page."),
203
+ /* @__PURE__ */ w(u, {
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."),
194
206
  children: /* @__PURE__ */ T("div", {
195
207
  className: "space-y-3",
196
208
  children: [
197
209
  /* @__PURE__ */ T("button", {
198
210
  type: "button",
199
- onClick: () => W("auto"),
200
- disabled: H,
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", U === "auto" ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:bg-bg-sunken"),
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"),
202
214
  children: [/* @__PURE__ */ w(b, {
203
215
  size: 16,
204
- className: n("mt-0.5 flex-shrink-0", U === "auto" ? "opacity-100 text-primary" : "opacity-0")
216
+ className: n("mt-0.5 flex-shrink-0", H === "auto" ? "opacity-100 text-primary" : "opacity-0")
205
217
  }), /* @__PURE__ */ T("div", {
206
218
  className: "flex-1 min-w-0",
207
219
  children: [/* @__PURE__ */ w("p", {
208
220
  className: "text-sm font-medium",
209
- children: M("devportal.billingAutoCreate", "Create a new billing account automatically")
221
+ children: j("devportal.billingAutoCreate", "Create a new billing account automatically")
210
222
  }), /* @__PURE__ */ w("p", {
211
223
  className: "mt-0.5 text-xs text-text-secondary",
212
- children: M("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.")
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
228
  /* @__PURE__ */ T("button", {
217
229
  type: "button",
218
- onClick: () => W("existing"),
219
- disabled: H || !J && Y.length === 0,
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", U === "existing" ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:bg-bg-sunken"),
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"),
221
233
  children: [/* @__PURE__ */ w(b, {
222
234
  size: 16,
223
- className: n("mt-0.5 flex-shrink-0", U === "existing" ? "opacity-100 text-primary" : "opacity-0")
235
+ className: n("mt-0.5 flex-shrink-0", H === "existing" ? "opacity-100 text-primary" : "opacity-0")
224
236
  }), /* @__PURE__ */ T("div", {
225
237
  className: "flex-1 min-w-0",
226
238
  children: [/* @__PURE__ */ T("p", {
227
239
  className: "flex items-center gap-1.5 text-sm font-medium",
228
- children: [/* @__PURE__ */ w(x, { size: 14 }), M("devportal.billingLinkExisting", "Link an existing billing account")]
240
+ children: [/* @__PURE__ */ w(re, { size: 14 }), j("devportal.billingLinkExisting", "Link an existing billing account")]
229
241
  }), /* @__PURE__ */ w("p", {
230
242
  className: "mt-0.5 text-xs text-text-secondary",
231
- children: J ? M("devportal.billingAccountsLoading", "Loading your billing accounts...") : Y.length === 0 ? M("devportal.noBillingAccountsYet", "You don't have any billing accounts yet — create one from account billing settings first.") : M("devportal.billingAccountsAvailable", "{{count}} billing account(s) available to link", { count: Y.length })
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
- U === "existing" && Y.length > 0 && /* @__PURE__ */ w("div", {
247
+ H === "existing" && J.length > 0 && /* @__PURE__ */ w("div", {
236
248
  className: "ml-8 space-y-2",
237
- children: Y.map((e) => /* @__PURE__ */ T("button", {
249
+ children: J.map((e) => /* @__PURE__ */ T("button", {
238
250
  type: "button",
239
- disabled: H,
240
- onClick: () => K(e.id ?? null),
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", G === e.id ? "border-primary bg-action-primary-bg/5" : "border-border-subtle hover:bg-bg-sunken"),
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"),
242
254
  children: [/* @__PURE__ */ w(b, {
243
255
  size: 14,
244
- className: n("flex-shrink-0", G === e.id ? "opacity-100 text-primary" : "opacity-0")
256
+ className: n("flex-shrink-0", W === e.id ? "opacity-100 text-primary" : "opacity-0")
245
257
  }), /* @__PURE__ */ T("div", {
246
258
  className: "min-w-0 flex-1",
247
259
  children: [/* @__PURE__ */ w("p", {
@@ -249,7 +261,7 @@ var E = () => {
249
261
  children: e.name
250
262
  }), e.isDefault && /* @__PURE__ */ w("p", {
251
263
  className: "text-xs text-text-secondary",
252
- children: M("devportal.revenue.defaultAccount", "Default")
264
+ children: j("devportal.revenue.defaultAccount", "Default")
253
265
  })]
254
266
  })]
255
267
  }, e.id))
@@ -257,17 +269,17 @@ var E = () => {
257
269
  ]
258
270
  })
259
271
  }),
260
- H && /* @__PURE__ */ T("div", {
272
+ V && /* @__PURE__ */ T("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__ */ w(S, {
275
+ /* @__PURE__ */ w(x, {
264
276
  size: 16,
265
277
  className: "flex-shrink-0 animate-spin text-primary"
266
278
  }),
267
- B === "creating-org" && M("devportal.creatingOrgStatus", "Creating your organization..."),
268
- B === "setting-up-billing" && M("devportal.settingUpBillingStatus", "Setting up your billing account..."),
269
- B === "linking-billing" && M("devportal.linkingBillingStatus", "Linking your billing account..."),
270
- B === "redirecting" && M("devportal.redirectingStatus", "All set — redirecting...")
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
285
  /* @__PURE__ */ T("div", {
@@ -275,21 +287,21 @@ var E = () => {
275
287
  children: [/* @__PURE__ */ T("button", {
276
288
  type: "button",
277
289
  onClick: () => {
278
- Q(i(j));
290
+ Q(i(A));
279
291
  },
280
- disabled: H,
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(ee, { size: 16 }), M("devportal.cancel", "Cancel")]
294
+ children: [/* @__PURE__ */ w(S, { size: 16 }), j("devportal.cancel", "Cancel")]
283
295
  }), /* @__PURE__ */ w("button", {
284
296
  type: "submit",
285
- disabled: H,
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: H ? /* @__PURE__ */ T(C, { children: [
299
+ children: V ? /* @__PURE__ */ T(C, { children: [
288
300
  /* @__PURE__ */ w("span", { className: "h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
289
- B === "setting-up-billing" && M("devportal.settingUpBilling", "Setting up billing..."),
290
- B === "linking-billing" && M("devportal.linkingBilling", "Linking billing..."),
291
- (B === "creating-org" || B === "redirecting") && M("devportal.creating", "Creating...")
292
- ] }) : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(y, { size: 16 }), M("devportal.createOrganization", "Create Organization")] })
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__ */ T(C, { children: [/* @__PURE__ */ w(ne, { size: 16 }), j("devportal.createOrganization", "Create Organization")] })
293
305
  })]
294
306
  })
295
307
  ]