@open-mercato/core 0.6.1-develop.3260.1.dc719cac84 → 0.6.1-develop.3278.1.a4d26475e4

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 (212) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/dist/generated/entities/domain_mapping/index.js +31 -0
  3. package/dist/generated/entities/domain_mapping/index.js.map +7 -0
  4. package/dist/generated/entities.ids.generated.js +2 -1
  5. package/dist/generated/entities.ids.generated.js.map +2 -2
  6. package/dist/generated/entity-fields-registry.js +16 -0
  7. package/dist/generated/entity-fields-registry.js.map +2 -2
  8. package/dist/helpers/integration/salesUi.js +18 -17
  9. package/dist/helpers/integration/salesUi.js.map +2 -2
  10. package/dist/modules/customer_accounts/acl.js +2 -1
  11. package/dist/modules/customer_accounts/acl.js.map +2 -2
  12. package/dist/modules/customer_accounts/api/admin/domain-mappings/[id]/health-check.js +110 -0
  13. package/dist/modules/customer_accounts/api/admin/domain-mappings/[id]/health-check.js.map +7 -0
  14. package/dist/modules/customer_accounts/api/admin/domain-mappings/[id]/verify.js +114 -0
  15. package/dist/modules/customer_accounts/api/admin/domain-mappings/[id]/verify.js.map +7 -0
  16. package/dist/modules/customer_accounts/api/admin/domain-mappings.js +271 -0
  17. package/dist/modules/customer_accounts/api/admin/domain-mappings.js.map +7 -0
  18. package/dist/modules/customer_accounts/api/domain-check.js +70 -0
  19. package/dist/modules/customer_accounts/api/domain-check.js.map +7 -0
  20. package/dist/modules/customer_accounts/api/domain-resolve/all.js +128 -0
  21. package/dist/modules/customer_accounts/api/domain-resolve/all.js.map +7 -0
  22. package/dist/modules/customer_accounts/api/domain-resolve.js +84 -0
  23. package/dist/modules/customer_accounts/api/domain-resolve.js.map +7 -0
  24. package/dist/modules/customer_accounts/api/login.js +14 -3
  25. package/dist/modules/customer_accounts/api/login.js.map +2 -2
  26. package/dist/modules/customer_accounts/api/magic-link/request.js +14 -3
  27. package/dist/modules/customer_accounts/api/magic-link/request.js.map +2 -2
  28. package/dist/modules/customer_accounts/api/password/reset-request.js +14 -3
  29. package/dist/modules/customer_accounts/api/password/reset-request.js.map +2 -2
  30. package/dist/modules/customer_accounts/api/signup.js +32 -5
  31. package/dist/modules/customer_accounts/api/signup.js.map +2 -2
  32. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/components/Actions.js +48 -0
  33. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/components/Actions.js.map +7 -0
  34. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/components/Diagnostics.js +43 -0
  35. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/components/Diagnostics.js.map +7 -0
  36. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/components/DnsConfig.js +53 -0
  37. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/components/DnsConfig.js.map +7 -0
  38. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/components/DomainPanel.js +69 -0
  39. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/components/DomainPanel.js.map +7 -0
  40. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/components/OrgSwitcher.js +31 -0
  41. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/components/OrgSwitcher.js.map +7 -0
  42. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/components/RegisterDialog.js +147 -0
  43. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/components/RegisterDialog.js.map +7 -0
  44. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/components/StatusBadgeSection.js +39 -0
  45. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/components/StatusBadgeSection.js.map +7 -0
  46. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/components/Stepper.js +60 -0
  47. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/components/Stepper.js.map +7 -0
  48. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/components/domainStatusMap.js +11 -0
  49. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/components/domainStatusMap.js.map +7 -0
  50. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/components/types.js +1 -0
  51. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/components/types.js.map +7 -0
  52. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/page.js +361 -0
  53. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/page.js.map +7 -0
  54. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/page.meta.js +28 -0
  55. package/dist/modules/customer_accounts/backend/customer_accounts/settings/domain/page.meta.js.map +7 -0
  56. package/dist/modules/customer_accounts/data/enrichers.js +78 -12
  57. package/dist/modules/customer_accounts/data/enrichers.js.map +2 -2
  58. package/dist/modules/customer_accounts/data/entities.js +85 -2
  59. package/dist/modules/customer_accounts/data/entities.js.map +2 -2
  60. package/dist/modules/customer_accounts/data/guards.js +130 -0
  61. package/dist/modules/customer_accounts/data/guards.js.map +7 -0
  62. package/dist/modules/customer_accounts/data/validators.js +19 -0
  63. package/dist/modules/customer_accounts/data/validators.js.map +2 -2
  64. package/dist/modules/customer_accounts/di.js +23 -1
  65. package/dist/modules/customer_accounts/di.js.map +2 -2
  66. package/dist/modules/customer_accounts/events.js +9 -2
  67. package/dist/modules/customer_accounts/events.js.map +2 -2
  68. package/dist/modules/customer_accounts/lib/customerAuthServer.js +27 -7
  69. package/dist/modules/customer_accounts/lib/customerAuthServer.js.map +2 -2
  70. package/dist/modules/customer_accounts/lib/customerUrl.js +48 -0
  71. package/dist/modules/customer_accounts/lib/customerUrl.js.map +7 -0
  72. package/dist/modules/customer_accounts/lib/hostname.js +55 -0
  73. package/dist/modules/customer_accounts/lib/hostname.js.map +7 -0
  74. package/dist/modules/customer_accounts/lib/platformDomains.js +7 -0
  75. package/dist/modules/customer_accounts/lib/platformDomains.js.map +7 -0
  76. package/dist/modules/customer_accounts/lib/proxyRanges.js +71 -0
  77. package/dist/modules/customer_accounts/lib/proxyRanges.js.map +7 -0
  78. package/dist/modules/customer_accounts/lib/rateLimiter.js +7 -0
  79. package/dist/modules/customer_accounts/lib/rateLimiter.js.map +2 -2
  80. package/dist/modules/customer_accounts/lib/resolveTenantContext.js +63 -0
  81. package/dist/modules/customer_accounts/lib/resolveTenantContext.js.map +7 -0
  82. package/dist/modules/customer_accounts/lib/secretCompare.js +13 -0
  83. package/dist/modules/customer_accounts/lib/secretCompare.js.map +7 -0
  84. package/dist/modules/customer_accounts/migrations/Migration20260430120000_customer_accounts.js +37 -0
  85. package/dist/modules/customer_accounts/migrations/Migration20260430120000_customer_accounts.js.map +7 -0
  86. package/dist/modules/customer_accounts/notifications.client.js +76 -0
  87. package/dist/modules/customer_accounts/notifications.client.js.map +2 -2
  88. package/dist/modules/customer_accounts/notifications.js +76 -0
  89. package/dist/modules/customer_accounts/notifications.js.map +2 -2
  90. package/dist/modules/customer_accounts/services/domainMappingService.js +497 -0
  91. package/dist/modules/customer_accounts/services/domainMappingService.js.map +7 -0
  92. package/dist/modules/customer_accounts/setup.js +48 -1
  93. package/dist/modules/customer_accounts/setup.js.map +2 -2
  94. package/dist/modules/customer_accounts/subscribers/invalidateDomainCache.js +29 -0
  95. package/dist/modules/customer_accounts/subscribers/invalidateDomainCache.js.map +7 -0
  96. package/dist/modules/customer_accounts/subscribers/notifyDomainActivated.js +29 -0
  97. package/dist/modules/customer_accounts/subscribers/notifyDomainActivated.js.map +7 -0
  98. package/dist/modules/customer_accounts/subscribers/notifyDomainDnsFailed.js +30 -0
  99. package/dist/modules/customer_accounts/subscribers/notifyDomainDnsFailed.js.map +7 -0
  100. package/dist/modules/customer_accounts/subscribers/notifyDomainTlsFailed.js +31 -0
  101. package/dist/modules/customer_accounts/subscribers/notifyDomainTlsFailed.js.map +7 -0
  102. package/dist/modules/customer_accounts/subscribers/notifyDomainVerified.js +29 -0
  103. package/dist/modules/customer_accounts/subscribers/notifyDomainVerified.js.map +7 -0
  104. package/dist/modules/customer_accounts/workers/domainTlsRetryWorker.js +67 -0
  105. package/dist/modules/customer_accounts/workers/domainTlsRetryWorker.js.map +7 -0
  106. package/dist/modules/customer_accounts/workers/domainVerificationWorker.js +34 -0
  107. package/dist/modules/customer_accounts/workers/domainVerificationWorker.js.map +7 -0
  108. package/dist/modules/customers/api/companies/route.js +4 -9
  109. package/dist/modules/customers/api/companies/route.js.map +2 -2
  110. package/dist/modules/customers/api/deals/route.js +4 -9
  111. package/dist/modules/customers/api/deals/route.js.map +2 -2
  112. package/dist/modules/customers/api/people/route.js +4 -9
  113. package/dist/modules/customers/api/people/route.js.map +2 -2
  114. package/dist/modules/customers/api/utils.js +0 -12
  115. package/dist/modules/customers/api/utils.js.map +2 -2
  116. package/dist/modules/customers/backend/customers/companies/page.js +361 -284
  117. package/dist/modules/customers/backend/customers/companies/page.js.map +2 -2
  118. package/dist/modules/customers/backend/customers/deals/page.js +378 -473
  119. package/dist/modules/customers/backend/customers/deals/page.js.map +2 -2
  120. package/dist/modules/customers/backend/customers/people/page.js +368 -286
  121. package/dist/modules/customers/backend/customers/people/page.js.map +2 -2
  122. package/dist/modules/customers/components/detail/assignableStaff.js +15 -1
  123. package/dist/modules/customers/components/detail/assignableStaff.js.map +2 -2
  124. package/dist/modules/customers/widgets/injection/ai-assistant-trigger/widget.client.js +188 -36
  125. package/dist/modules/customers/widgets/injection/ai-assistant-trigger/widget.client.js.map +2 -2
  126. package/dist/modules/customers/widgets/injection/ai-assistant-trigger/widget.js +2 -2
  127. package/dist/modules/customers/widgets/injection/ai-assistant-trigger/widget.js.map +2 -2
  128. package/dist/modules/customers/widgets/injection-table.js +6 -0
  129. package/dist/modules/customers/widgets/injection-table.js.map +2 -2
  130. package/dist/modules/perspectives/services/perspectiveService.js +16 -2
  131. package/dist/modules/perspectives/services/perspectiveService.js.map +2 -2
  132. package/dist/modules/portal/frontend/[orgSlug]/portal/login/page.js +1 -0
  133. package/dist/modules/portal/frontend/[orgSlug]/portal/login/page.js.map +2 -2
  134. package/dist/modules/query_index/lib/engine.js +31 -8
  135. package/dist/modules/query_index/lib/engine.js.map +2 -2
  136. package/generated/entities/domain_mapping/index.ts +14 -0
  137. package/generated/entities.ids.generated.ts +2 -1
  138. package/generated/entity-fields-registry.ts +16 -0
  139. package/package.json +5 -5
  140. package/src/helpers/integration/salesUi.ts +27 -23
  141. package/src/modules/customer_accounts/acl.ts +1 -0
  142. package/src/modules/customer_accounts/api/admin/domain-mappings/[id]/health-check.ts +119 -0
  143. package/src/modules/customer_accounts/api/admin/domain-mappings/[id]/verify.ts +123 -0
  144. package/src/modules/customer_accounts/api/admin/domain-mappings.ts +303 -0
  145. package/src/modules/customer_accounts/api/domain-check.ts +83 -0
  146. package/src/modules/customer_accounts/api/domain-resolve/all.ts +139 -0
  147. package/src/modules/customer_accounts/api/domain-resolve.ts +91 -0
  148. package/src/modules/customer_accounts/api/login.ts +14 -3
  149. package/src/modules/customer_accounts/api/magic-link/request.ts +14 -3
  150. package/src/modules/customer_accounts/api/password/reset-request.ts +15 -3
  151. package/src/modules/customer_accounts/api/signup.ts +36 -5
  152. package/src/modules/customer_accounts/backend/customer_accounts/settings/domain/components/Actions.tsx +70 -0
  153. package/src/modules/customer_accounts/backend/customer_accounts/settings/domain/components/Diagnostics.tsx +66 -0
  154. package/src/modules/customer_accounts/backend/customer_accounts/settings/domain/components/DnsConfig.tsx +78 -0
  155. package/src/modules/customer_accounts/backend/customer_accounts/settings/domain/components/DomainPanel.tsx +90 -0
  156. package/src/modules/customer_accounts/backend/customer_accounts/settings/domain/components/OrgSwitcher.tsx +43 -0
  157. package/src/modules/customer_accounts/backend/customer_accounts/settings/domain/components/RegisterDialog.tsx +178 -0
  158. package/src/modules/customer_accounts/backend/customer_accounts/settings/domain/components/StatusBadgeSection.tsx +56 -0
  159. package/src/modules/customer_accounts/backend/customer_accounts/settings/domain/components/Stepper.tsx +69 -0
  160. package/src/modules/customer_accounts/backend/customer_accounts/settings/domain/components/domainStatusMap.ts +10 -0
  161. package/src/modules/customer_accounts/backend/customer_accounts/settings/domain/components/types.ts +31 -0
  162. package/src/modules/customer_accounts/backend/customer_accounts/settings/domain/page.meta.ts +26 -0
  163. package/src/modules/customer_accounts/backend/customer_accounts/settings/domain/page.tsx +411 -0
  164. package/src/modules/customer_accounts/data/enrichers.ts +95 -12
  165. package/src/modules/customer_accounts/data/entities.ts +80 -1
  166. package/src/modules/customer_accounts/data/guards.ts +155 -0
  167. package/src/modules/customer_accounts/data/validators.ts +26 -0
  168. package/src/modules/customer_accounts/di.ts +35 -1
  169. package/src/modules/customer_accounts/events.ts +8 -1
  170. package/src/modules/customer_accounts/i18n/de.json +78 -0
  171. package/src/modules/customer_accounts/i18n/en.json +78 -0
  172. package/src/modules/customer_accounts/i18n/es.json +78 -0
  173. package/src/modules/customer_accounts/i18n/pl.json +78 -0
  174. package/src/modules/customer_accounts/lib/customerAuthServer.ts +44 -8
  175. package/src/modules/customer_accounts/lib/customerUrl.ts +72 -0
  176. package/src/modules/customer_accounts/lib/hostname.ts +76 -0
  177. package/src/modules/customer_accounts/lib/platformDomains.ts +14 -0
  178. package/src/modules/customer_accounts/lib/proxyRanges.ts +85 -0
  179. package/src/modules/customer_accounts/lib/rateLimiter.ts +10 -0
  180. package/src/modules/customer_accounts/lib/resolveTenantContext.ts +96 -0
  181. package/src/modules/customer_accounts/lib/secretCompare.ts +20 -0
  182. package/src/modules/customer_accounts/migrations/.snapshot-open-mercato.json +341 -0
  183. package/src/modules/customer_accounts/migrations/Migration20260430120000_customer_accounts.ts +38 -0
  184. package/src/modules/customer_accounts/notifications.client.ts +76 -0
  185. package/src/modules/customer_accounts/notifications.ts +76 -0
  186. package/src/modules/customer_accounts/services/domainMappingService.ts +632 -0
  187. package/src/modules/customer_accounts/setup.ts +81 -1
  188. package/src/modules/customer_accounts/subscribers/invalidateDomainCache.ts +35 -0
  189. package/src/modules/customer_accounts/subscribers/notifyDomainActivated.ts +32 -0
  190. package/src/modules/customer_accounts/subscribers/notifyDomainDnsFailed.ts +33 -0
  191. package/src/modules/customer_accounts/subscribers/notifyDomainTlsFailed.ts +34 -0
  192. package/src/modules/customer_accounts/subscribers/notifyDomainVerified.ts +32 -0
  193. package/src/modules/customer_accounts/workers/domainTlsRetryWorker.ts +84 -0
  194. package/src/modules/customer_accounts/workers/domainVerificationWorker.ts +45 -0
  195. package/src/modules/customers/api/companies/route.ts +4 -9
  196. package/src/modules/customers/api/deals/route.ts +4 -9
  197. package/src/modules/customers/api/people/route.ts +4 -9
  198. package/src/modules/customers/api/utils.ts +0 -14
  199. package/src/modules/customers/backend/customers/companies/page.tsx +321 -237
  200. package/src/modules/customers/backend/customers/deals/page.tsx +321 -455
  201. package/src/modules/customers/backend/customers/people/page.tsx +331 -240
  202. package/src/modules/customers/components/detail/assignableStaff.ts +21 -0
  203. package/src/modules/customers/i18n/de.json +31 -0
  204. package/src/modules/customers/i18n/en.json +31 -0
  205. package/src/modules/customers/i18n/es.json +31 -0
  206. package/src/modules/customers/i18n/pl.json +31 -0
  207. package/src/modules/customers/widgets/injection/ai-assistant-trigger/widget.client.tsx +197 -40
  208. package/src/modules/customers/widgets/injection/ai-assistant-trigger/widget.ts +13 -7
  209. package/src/modules/customers/widgets/injection-table.ts +6 -0
  210. package/src/modules/perspectives/services/perspectiveService.ts +30 -2
  211. package/src/modules/portal/frontend/[orgSlug]/portal/login/page.tsx +1 -0
  212. package/src/modules/query_index/lib/engine.ts +46 -8
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { StatusBadge } from "@open-mercato/ui/primitives/status-badge";
4
+ import { useT } from "@open-mercato/shared/lib/i18n/context";
5
+ import { domainStatusMap } from "./domainStatusMap.js";
6
+ function formatTime(value, fallback) {
7
+ if (!value) return fallback;
8
+ const date = new Date(value);
9
+ if (Number.isNaN(date.getTime())) return fallback;
10
+ return date.toLocaleString();
11
+ }
12
+ function DefaultStatusBadge({ mapping }) {
13
+ const t = useT();
14
+ const variant = domainStatusMap[mapping.status];
15
+ const label = t(
16
+ `customer_accounts.domainMapping.status.${mapping.status}`,
17
+ mapping.status
18
+ );
19
+ const lastChecked = formatTime(
20
+ mapping.lastDnsCheckAt,
21
+ t("customer_accounts.domainMapping.autoVerify.checking", "Automatically checking every 5 minutes")
22
+ );
23
+ const showAutoCheck = mapping.status === "pending" || mapping.status === "dns_failed";
24
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
25
+ /* @__PURE__ */ jsx(StatusBadge, { variant, dot: true, children: label }),
26
+ mapping.lastDnsCheckAt ? /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: t("customer_accounts.domainMapping.autoVerify.lastChecked", "Last checked: {time}", {
27
+ time: lastChecked
28
+ }) }) : null,
29
+ showAutoCheck ? /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: t("customer_accounts.domainMapping.autoVerify.nextCheck", "Next check in ~{minutes} minutes", {
30
+ minutes: "5"
31
+ }) }) : null
32
+ ] });
33
+ }
34
+ var StatusBadgeSection_default = DefaultStatusBadge;
35
+ export {
36
+ DefaultStatusBadge,
37
+ StatusBadgeSection_default as default
38
+ };
39
+ //# sourceMappingURL=StatusBadgeSection.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../src/modules/customer_accounts/backend/customer_accounts/settings/domain/components/StatusBadgeSection.tsx"],
4
+ "sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { StatusBadge } from '@open-mercato/ui/primitives/status-badge'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { domainStatusMap } from './domainStatusMap'\nimport type { DomainMappingRow } from './types'\n\nexport type StatusBadgeSectionProps = {\n mapping: DomainMappingRow\n}\n\nfunction formatTime(value: string | null, fallback: string): string {\n if (!value) return fallback\n const date = new Date(value)\n if (Number.isNaN(date.getTime())) return fallback\n return date.toLocaleString()\n}\n\nexport function DefaultStatusBadge({ mapping }: StatusBadgeSectionProps) {\n const t = useT()\n const variant = domainStatusMap[mapping.status]\n const label = t(\n `customer_accounts.domainMapping.status.${mapping.status}`,\n mapping.status,\n )\n const lastChecked = formatTime(\n mapping.lastDnsCheckAt,\n t('customer_accounts.domainMapping.autoVerify.checking', 'Automatically checking every 5 minutes'),\n )\n const showAutoCheck = mapping.status === 'pending' || mapping.status === 'dns_failed'\n\n return (\n <div className=\"flex flex-wrap items-center gap-3\">\n <StatusBadge variant={variant} dot>\n {label}\n </StatusBadge>\n {mapping.lastDnsCheckAt ? (\n <span className=\"text-xs text-muted-foreground\">\n {t('customer_accounts.domainMapping.autoVerify.lastChecked', 'Last checked: {time}', {\n time: lastChecked,\n })}\n </span>\n ) : null}\n {showAutoCheck ? (\n <span className=\"text-xs text-muted-foreground\">\n {t('customer_accounts.domainMapping.autoVerify.nextCheck', 'Next check in ~{minutes} minutes', {\n minutes: '5',\n })}\n </span>\n ) : null}\n </div>\n )\n}\n\nexport default DefaultStatusBadge\n"],
5
+ "mappings": ";AAiCI,SACE,KADF;AA9BJ,SAAS,mBAAmB;AAC5B,SAAS,YAAY;AACrB,SAAS,uBAAuB;AAOhC,SAAS,WAAW,OAAsB,UAA0B;AAClE,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,OAAO,IAAI,KAAK,KAAK;AAC3B,MAAI,OAAO,MAAM,KAAK,QAAQ,CAAC,EAAG,QAAO;AACzC,SAAO,KAAK,eAAe;AAC7B;AAEO,SAAS,mBAAmB,EAAE,QAAQ,GAA4B;AACvE,QAAM,IAAI,KAAK;AACf,QAAM,UAAU,gBAAgB,QAAQ,MAAM;AAC9C,QAAM,QAAQ;AAAA,IACZ,0CAA0C,QAAQ,MAAM;AAAA,IACxD,QAAQ;AAAA,EACV;AACA,QAAM,cAAc;AAAA,IAClB,QAAQ;AAAA,IACR,EAAE,uDAAuD,wCAAwC;AAAA,EACnG;AACA,QAAM,gBAAgB,QAAQ,WAAW,aAAa,QAAQ,WAAW;AAEzE,SACE,qBAAC,SAAI,WAAU,qCACb;AAAA,wBAAC,eAAY,SAAkB,KAAG,MAC/B,iBACH;AAAA,IACC,QAAQ,iBACP,oBAAC,UAAK,WAAU,iCACb,YAAE,0DAA0D,wBAAwB;AAAA,MACnF,MAAM;AAAA,IACR,CAAC,GACH,IACE;AAAA,IACH,gBACC,oBAAC,UAAK,WAAU,iCACb,YAAE,wDAAwD,oCAAoC;AAAA,MAC7F,SAAS;AAAA,IACX,CAAC,GACH,IACE;AAAA,KACN;AAEJ;AAEA,IAAO,6BAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,60 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { Check } from "lucide-react";
4
+ import { cn } from "@open-mercato/shared/lib/utils";
5
+ import { useT } from "@open-mercato/shared/lib/i18n/context";
6
+ function activeStep(status) {
7
+ if (!status) return 1;
8
+ if (status === "pending" || status === "dns_failed") return 2;
9
+ if (status === "verified" || status === "tls_failed") return 3;
10
+ if (status === "active") return 4;
11
+ return 1;
12
+ }
13
+ function DefaultStepper({ status }) {
14
+ const t = useT();
15
+ const current = activeStep(status);
16
+ const steps = [
17
+ { idx: 1, label: t("customer_accounts.domainMapping.stepper.step1", "Register Domain") },
18
+ { idx: 2, label: t("customer_accounts.domainMapping.stepper.step2", "Configure DNS") },
19
+ { idx: 3, label: t("customer_accounts.domainMapping.stepper.step3", "SSL Certificate") },
20
+ { idx: 4, label: t("customer_accounts.domainMapping.stepper.step4", "Live") }
21
+ ];
22
+ return /* @__PURE__ */ jsx("ol", { className: "flex flex-wrap items-center gap-3 text-sm", children: steps.map((step, index) => {
23
+ const isDone = step.idx < current;
24
+ const isCurrent = step.idx === current;
25
+ return /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-3", children: [
26
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
27
+ /* @__PURE__ */ jsx(
28
+ "span",
29
+ {
30
+ className: cn(
31
+ "flex h-7 w-7 items-center justify-center rounded-full border text-xs font-medium",
32
+ isDone && "border-status-success-icon bg-status-success-icon text-status-success-foreground",
33
+ isCurrent && "border-primary bg-primary/10 text-primary",
34
+ !isDone && !isCurrent && "border-border bg-background text-muted-foreground"
35
+ ),
36
+ "aria-current": isCurrent ? "step" : void 0,
37
+ children: isDone ? /* @__PURE__ */ jsx(Check, { className: "h-4 w-4", "aria-hidden": true }) : step.idx
38
+ }
39
+ ),
40
+ /* @__PURE__ */ jsx(
41
+ "span",
42
+ {
43
+ className: cn(
44
+ "whitespace-nowrap",
45
+ isCurrent ? "font-medium text-foreground" : "text-muted-foreground"
46
+ ),
47
+ children: step.label
48
+ }
49
+ )
50
+ ] }),
51
+ index < steps.length - 1 ? /* @__PURE__ */ jsx("span", { className: "hidden h-px w-8 bg-border sm:block", "aria-hidden": true }) : null
52
+ ] }, step.idx);
53
+ }) });
54
+ }
55
+ var Stepper_default = DefaultStepper;
56
+ export {
57
+ DefaultStepper,
58
+ Stepper_default as default
59
+ };
60
+ //# sourceMappingURL=Stepper.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../src/modules/customer_accounts/backend/customer_accounts/settings/domain/components/Stepper.tsx"],
4
+ "sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { Check } from 'lucide-react'\nimport { cn } from '@open-mercato/shared/lib/utils'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport type { DomainStatus } from '@open-mercato/core/modules/customer_accounts/data/entities'\n\nexport type StepperProps = {\n status: DomainStatus | null\n}\n\nfunction activeStep(status: DomainStatus | null): number {\n if (!status) return 1\n if (status === 'pending' || status === 'dns_failed') return 2\n if (status === 'verified' || status === 'tls_failed') return 3\n if (status === 'active') return 4\n return 1\n}\n\nexport function DefaultStepper({ status }: StepperProps) {\n const t = useT()\n const current = activeStep(status)\n const steps: Array<{ idx: number; label: string }> = [\n { idx: 1, label: t('customer_accounts.domainMapping.stepper.step1', 'Register Domain') },\n { idx: 2, label: t('customer_accounts.domainMapping.stepper.step2', 'Configure DNS') },\n { idx: 3, label: t('customer_accounts.domainMapping.stepper.step3', 'SSL Certificate') },\n { idx: 4, label: t('customer_accounts.domainMapping.stepper.step4', 'Live') },\n ]\n\n return (\n <ol className=\"flex flex-wrap items-center gap-3 text-sm\">\n {steps.map((step, index) => {\n const isDone = step.idx < current\n const isCurrent = step.idx === current\n return (\n <li key={step.idx} className=\"flex items-center gap-3\">\n <div className=\"flex items-center gap-2\">\n <span\n className={cn(\n 'flex h-7 w-7 items-center justify-center rounded-full border text-xs font-medium',\n isDone && 'border-status-success-icon bg-status-success-icon text-status-success-foreground',\n isCurrent && 'border-primary bg-primary/10 text-primary',\n !isDone && !isCurrent && 'border-border bg-background text-muted-foreground',\n )}\n aria-current={isCurrent ? 'step' : undefined}\n >\n {isDone ? <Check className=\"h-4 w-4\" aria-hidden /> : step.idx}\n </span>\n <span\n className={cn(\n 'whitespace-nowrap',\n isCurrent ? 'font-medium text-foreground' : 'text-muted-foreground',\n )}\n >\n {step.label}\n </span>\n </div>\n {index < steps.length - 1 ? (\n <span className=\"hidden h-px w-8 bg-border sm:block\" aria-hidden />\n ) : null}\n </li>\n )\n })}\n </ol>\n )\n}\n\nexport default DefaultStepper\n"],
5
+ "mappings": ";AAqCY,SAUc,KAVd;AAlCZ,SAAS,aAAa;AACtB,SAAS,UAAU;AACnB,SAAS,YAAY;AAOrB,SAAS,WAAW,QAAqC;AACvD,MAAI,CAAC,OAAQ,QAAO;AACpB,MAAI,WAAW,aAAa,WAAW,aAAc,QAAO;AAC5D,MAAI,WAAW,cAAc,WAAW,aAAc,QAAO;AAC7D,MAAI,WAAW,SAAU,QAAO;AAChC,SAAO;AACT;AAEO,SAAS,eAAe,EAAE,OAAO,GAAiB;AACvD,QAAM,IAAI,KAAK;AACf,QAAM,UAAU,WAAW,MAAM;AACjC,QAAM,QAA+C;AAAA,IACnD,EAAE,KAAK,GAAG,OAAO,EAAE,iDAAiD,iBAAiB,EAAE;AAAA,IACvF,EAAE,KAAK,GAAG,OAAO,EAAE,iDAAiD,eAAe,EAAE;AAAA,IACrF,EAAE,KAAK,GAAG,OAAO,EAAE,iDAAiD,iBAAiB,EAAE;AAAA,IACvF,EAAE,KAAK,GAAG,OAAO,EAAE,iDAAiD,MAAM,EAAE;AAAA,EAC9E;AAEA,SACE,oBAAC,QAAG,WAAU,6CACX,gBAAM,IAAI,CAAC,MAAM,UAAU;AAC1B,UAAM,SAAS,KAAK,MAAM;AAC1B,UAAM,YAAY,KAAK,QAAQ;AAC/B,WACE,qBAAC,QAAkB,WAAU,2BAC3B;AAAA,2BAAC,SAAI,WAAU,2BACb;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,WAAW;AAAA,cACT;AAAA,cACA,UAAU;AAAA,cACV,aAAa;AAAA,cACb,CAAC,UAAU,CAAC,aAAa;AAAA,YAC3B;AAAA,YACA,gBAAc,YAAY,SAAS;AAAA,YAElC,mBAAS,oBAAC,SAAM,WAAU,WAAU,eAAW,MAAC,IAAK,KAAK;AAAA;AAAA,QAC7D;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,WAAW;AAAA,cACT;AAAA,cACA,YAAY,gCAAgC;AAAA,YAC9C;AAAA,YAEC,eAAK;AAAA;AAAA,QACR;AAAA,SACF;AAAA,MACC,QAAQ,MAAM,SAAS,IACtB,oBAAC,UAAK,WAAU,sCAAqC,eAAW,MAAC,IAC/D;AAAA,SAxBG,KAAK,GAyBd;AAAA,EAEJ,CAAC,GACH;AAEJ;AAEA,IAAO,kBAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,11 @@
1
+ const domainStatusMap = {
2
+ pending: "info",
3
+ verified: "info",
4
+ active: "success",
5
+ dns_failed: "error",
6
+ tls_failed: "warning"
7
+ };
8
+ export {
9
+ domainStatusMap
10
+ };
11
+ //# sourceMappingURL=domainStatusMap.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../src/modules/customer_accounts/backend/customer_accounts/settings/domain/components/domainStatusMap.ts"],
4
+ "sourcesContent": ["import type { StatusMap } from '@open-mercato/ui/primitives/status-badge'\nimport type { DomainStatus } from '@open-mercato/core/modules/customer_accounts/data/entities'\n\nexport const domainStatusMap: StatusMap<DomainStatus> = {\n pending: 'info',\n verified: 'info',\n active: 'success',\n dns_failed: 'error',\n tls_failed: 'warning',\n}\n"],
5
+ "mappings": "AAGO,MAAM,kBAA2C;AAAA,EACtD,SAAS;AAAA,EACT,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,YAAY;AACd;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,361 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { useRouter, useSearchParams } from "next/navigation";
5
+ import { Globe } from "lucide-react";
6
+ import { Page, PageBody } from "@open-mercato/ui/backend/Page";
7
+ import { FormHeader } from "@open-mercato/ui/backend/forms";
8
+ import { EmptyState } from "@open-mercato/ui/backend/EmptyState";
9
+ import { LoadingMessage, ErrorMessage } from "@open-mercato/ui/backend/detail";
10
+ import { Button } from "@open-mercato/ui/primitives/button";
11
+ import { apiCall } from "@open-mercato/ui/backend/utils/apiCall";
12
+ import { flash } from "@open-mercato/ui/backend/FlashMessages";
13
+ import { useT } from "@open-mercato/shared/lib/i18n/context";
14
+ import { useConfirmDialog } from "@open-mercato/ui/backend/confirm-dialog";
15
+ import { useGuardedMutation } from "@open-mercato/ui/backend/injection/useGuardedMutation";
16
+ import { useAppEvent } from "@open-mercato/ui/backend/injection/useAppEvent";
17
+ import { OrgSwitcher } from "./components/OrgSwitcher.js";
18
+ import { DomainPanel } from "./components/DomainPanel.js";
19
+ import { RegisterDialog } from "./components/RegisterDialog.js";
20
+ const STATE_LOADING = "loading";
21
+ const STATE_LOADED = "loaded";
22
+ const STATE_ERROR = "error";
23
+ function flattenOrgNodes(nodes, acc = [], depth = 0) {
24
+ if (!nodes) return acc;
25
+ for (const node of nodes) {
26
+ if (node.selectable) {
27
+ acc.push({ id: node.id, label: node.name, depth });
28
+ }
29
+ flattenOrgNodes(node.children, acc, depth + 1);
30
+ }
31
+ return acc;
32
+ }
33
+ function CustomerDomainSettingsPage() {
34
+ const t = useT();
35
+ const router = useRouter();
36
+ const searchParams = useSearchParams();
37
+ const [orgOptions, setOrgOptions] = React.useState([]);
38
+ const [defaultOrgId, setDefaultOrgId] = React.useState(null);
39
+ const [orgsLoaded, setOrgsLoaded] = React.useState(false);
40
+ const urlOrgId = searchParams?.get("org") ?? null;
41
+ const selectedOrgId = urlOrgId ?? defaultOrgId;
42
+ const [mappings, setMappings] = React.useState([]);
43
+ const [config, setConfig] = React.useState({ cnameTarget: null, aRecordTarget: null });
44
+ const [loadState, setLoadState] = React.useState(STATE_LOADING);
45
+ const [reloadToken, setReloadToken] = React.useState(0);
46
+ const [registerOpen, setRegisterOpen] = React.useState(false);
47
+ const [registerMode, setRegisterMode] = React.useState("register");
48
+ const [replaceTargetId, setReplaceTargetId] = React.useState(null);
49
+ const [isMutating, setIsMutating] = React.useState(false);
50
+ const { confirm, ConfirmDialogElement } = useConfirmDialog();
51
+ const { runMutation } = useGuardedMutation({
52
+ contextId: "customer_accounts:domain-settings"
53
+ });
54
+ const runMutationWithContext = React.useCallback(
55
+ async (operation, mutationPayload) => {
56
+ return runMutation({
57
+ operation,
58
+ mutationPayload,
59
+ context: { entityType: "customer_accounts:domain_mapping" }
60
+ });
61
+ },
62
+ [runMutation]
63
+ );
64
+ const refresh = React.useCallback(() => {
65
+ setReloadToken((token) => token + 1);
66
+ }, []);
67
+ React.useEffect(() => {
68
+ let cancelled = false;
69
+ async function loadOrgs() {
70
+ try {
71
+ const call = await apiCall("/api/directory/organization-switcher");
72
+ if (cancelled) return;
73
+ if (!call.ok || !call.result) {
74
+ setOrgOptions([]);
75
+ setDefaultOrgId(null);
76
+ return;
77
+ }
78
+ const flat = flattenOrgNodes(call.result.items, [], 0);
79
+ setOrgOptions(flat);
80
+ const fallback = call.result.selectedId ?? (flat[0]?.id ?? null);
81
+ setDefaultOrgId(fallback);
82
+ } catch {
83
+ if (!cancelled) {
84
+ setOrgOptions([]);
85
+ setDefaultOrgId(null);
86
+ }
87
+ } finally {
88
+ if (!cancelled) setOrgsLoaded(true);
89
+ }
90
+ }
91
+ loadOrgs();
92
+ return () => {
93
+ cancelled = true;
94
+ };
95
+ }, []);
96
+ React.useEffect(() => {
97
+ if (!orgsLoaded) return;
98
+ if (!selectedOrgId) {
99
+ setMappings([]);
100
+ setConfig({ cnameTarget: null, aRecordTarget: null });
101
+ setLoadState(STATE_LOADED);
102
+ return;
103
+ }
104
+ let cancelled = false;
105
+ async function load() {
106
+ setLoadState(STATE_LOADING);
107
+ try {
108
+ const call = await apiCall(
109
+ `/api/customer_accounts/admin/domain-mappings?organizationId=${encodeURIComponent(selectedOrgId)}`
110
+ );
111
+ if (cancelled) return;
112
+ if (!call.ok || !call.result?.ok) {
113
+ setLoadState(STATE_ERROR);
114
+ return;
115
+ }
116
+ setMappings(Array.isArray(call.result.domainMappings) ? call.result.domainMappings : []);
117
+ setConfig(call.result.config ?? { cnameTarget: null, aRecordTarget: null });
118
+ setLoadState(STATE_LOADED);
119
+ } catch {
120
+ if (!cancelled) setLoadState(STATE_ERROR);
121
+ }
122
+ }
123
+ load();
124
+ return () => {
125
+ cancelled = true;
126
+ };
127
+ }, [orgsLoaded, selectedOrgId, reloadToken]);
128
+ useAppEvent("customer_accounts.domain_mapping.*", () => {
129
+ refresh();
130
+ }, [refresh]);
131
+ const orderedMappings = React.useMemo(() => {
132
+ if (mappings.length === 0) return [];
133
+ const sorted = [...mappings].sort((a, b) => {
134
+ const aActive = a.status === "active" ? 0 : 1;
135
+ const bActive = b.status === "active" ? 0 : 1;
136
+ if (aActive !== bActive) return aActive - bActive;
137
+ return new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime();
138
+ });
139
+ return sorted;
140
+ }, [mappings]);
141
+ const primaryActiveId = React.useMemo(() => {
142
+ const active = orderedMappings.find((m) => m.status === "active");
143
+ if (active) return active.id;
144
+ return orderedMappings[0]?.id ?? null;
145
+ }, [orderedMappings]);
146
+ const handleOrgChange = React.useCallback(
147
+ (next) => {
148
+ const params = new URLSearchParams(searchParams?.toString() ?? "");
149
+ if (next) params.set("org", next);
150
+ else params.delete("org");
151
+ const qs = params.toString();
152
+ router.replace(qs ? `?${qs}` : "?", { scroll: false });
153
+ },
154
+ [router, searchParams]
155
+ );
156
+ const handleOpenRegister = React.useCallback(() => {
157
+ setRegisterMode("register");
158
+ setReplaceTargetId(null);
159
+ setRegisterOpen(true);
160
+ }, []);
161
+ const handleOpenChange = React.useCallback((mappingId) => {
162
+ setRegisterMode("change");
163
+ setReplaceTargetId(mappingId);
164
+ setRegisterOpen(true);
165
+ }, []);
166
+ const handleSubmitRegister = React.useCallback(
167
+ async (hostname) => {
168
+ if (!selectedOrgId) {
169
+ throw new Error(t("customer_accounts.domainMapping.error.load", "Could not load custom-domain configuration"));
170
+ }
171
+ setIsMutating(true);
172
+ try {
173
+ await runMutationWithContext(async () => {
174
+ const body = {
175
+ hostname,
176
+ organizationId: selectedOrgId
177
+ };
178
+ if (registerMode === "change" && replaceTargetId) {
179
+ body.replacesDomainId = replaceTargetId;
180
+ }
181
+ const call = await apiCall(
182
+ "/api/customer_accounts/admin/domain-mappings",
183
+ {
184
+ method: "POST",
185
+ headers: { "content-type": "application/json" },
186
+ body: JSON.stringify(body)
187
+ }
188
+ );
189
+ if (!call.ok || !call.result?.ok) {
190
+ const message = call.result?.error || t("customer_accounts.domainMapping.alreadyClaimed", "This domain is not available. Please choose a different hostname.");
191
+ throw new Error(message);
192
+ }
193
+ flash(t("customer_accounts.domainMapping.registered", "Domain registered successfully"), "success");
194
+ setRegisterOpen(false);
195
+ refresh();
196
+ });
197
+ } finally {
198
+ setIsMutating(false);
199
+ }
200
+ },
201
+ [refresh, registerMode, replaceTargetId, runMutationWithContext, selectedOrgId, t]
202
+ );
203
+ const handleCheckNow = React.useCallback(
204
+ async (mapping) => {
205
+ setIsMutating(true);
206
+ try {
207
+ await runMutationWithContext(async () => {
208
+ const call = await apiCall(
209
+ `/api/customer_accounts/admin/domain-mappings/${encodeURIComponent(mapping.id)}/verify`,
210
+ { method: "POST" }
211
+ );
212
+ if (!call.ok || !call.result?.ok) {
213
+ const message = call.result?.error || t("customer_accounts.domainMapping.error.load", "Could not load custom-domain configuration");
214
+ flash(message, "error");
215
+ return;
216
+ }
217
+ refresh();
218
+ });
219
+ } finally {
220
+ setIsMutating(false);
221
+ }
222
+ },
223
+ [refresh, runMutationWithContext, t]
224
+ );
225
+ const handleRetryTls = React.useCallback(
226
+ async (mapping) => {
227
+ setIsMutating(true);
228
+ try {
229
+ await runMutationWithContext(async () => {
230
+ const call = await apiCall(
231
+ `/api/customer_accounts/admin/domain-mappings/${encodeURIComponent(mapping.id)}/health-check`,
232
+ { method: "POST" }
233
+ );
234
+ if (!call.ok || !call.result?.ok) {
235
+ const message = call.result?.error || t("customer_accounts.domainMapping.error.load", "Could not load custom-domain configuration");
236
+ flash(message, "error");
237
+ return;
238
+ }
239
+ refresh();
240
+ });
241
+ } finally {
242
+ setIsMutating(false);
243
+ }
244
+ },
245
+ [refresh, runMutationWithContext, t]
246
+ );
247
+ const handleRemove = React.useCallback(
248
+ async (mapping) => {
249
+ const replacement = orderedMappings.find(
250
+ (m) => m.id !== mapping.id && m.status !== "active"
251
+ );
252
+ const text = replacement ? t("customer_accounts.domainMapping.removeConfirm.hasReplacement", "This will also cancel the pending replacement domain ({hostname}).", { hostname: replacement.hostname }) : t("customer_accounts.domainMapping.removeConfirm", "Are you sure? Customers using this domain will no longer be able to reach your portal.");
253
+ const confirmed = await confirm({
254
+ title: t("customer_accounts.domainMapping.removeConfirm.title", "Remove custom domain?"),
255
+ text,
256
+ variant: "destructive",
257
+ confirmText: t("customer_accounts.domainMapping.removeDomain", "Remove Domain")
258
+ });
259
+ if (!confirmed) return;
260
+ setIsMutating(true);
261
+ try {
262
+ await runMutationWithContext(async () => {
263
+ const call = await apiCall(
264
+ `/api/customer_accounts/admin/domain-mappings?id=${encodeURIComponent(mapping.id)}`,
265
+ { method: "DELETE" }
266
+ );
267
+ if (!call.ok || !call.result?.ok) {
268
+ const message = call.result?.error || t("customer_accounts.domainMapping.error.load", "Could not load custom-domain configuration");
269
+ flash(message, "error");
270
+ return;
271
+ }
272
+ flash(t("customer_accounts.domainMapping.removed", "Domain removed"), "success");
273
+ refresh();
274
+ });
275
+ } finally {
276
+ setIsMutating(false);
277
+ }
278
+ },
279
+ [confirm, orderedMappings, refresh, runMutationWithContext, t]
280
+ );
281
+ const replaceTargetHostname = React.useMemo(() => {
282
+ if (registerMode !== "change" || !replaceTargetId) return null;
283
+ return orderedMappings.find((m) => m.id === replaceTargetId)?.hostname ?? null;
284
+ }, [orderedMappings, registerMode, replaceTargetId]);
285
+ return /* @__PURE__ */ jsxs(Page, { children: [
286
+ /* @__PURE__ */ jsx("div", { className: "px-3 py-3 md:px-6 md:py-4", children: /* @__PURE__ */ jsx(
287
+ FormHeader,
288
+ {
289
+ mode: "detail",
290
+ title: t("customer_accounts.domainMapping.title", "Custom Domain"),
291
+ subtitle: t("customer_accounts.domainMapping.description", "Map your own domain to the customer portal"),
292
+ backHref: "/backend/customer_accounts/settings",
293
+ backLabel: t("customer_accounts.settings.title", "Portal Settings")
294
+ }
295
+ ) }),
296
+ /* @__PURE__ */ jsxs(PageBody, { className: "space-y-6", children: [
297
+ orgOptions.length > 1 ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center justify-between gap-3 rounded-lg border bg-card px-4 py-3", children: /* @__PURE__ */ jsx(
298
+ OrgSwitcher,
299
+ {
300
+ options: orgOptions,
301
+ selectedId: selectedOrgId,
302
+ onChange: handleOrgChange
303
+ }
304
+ ) }) : null,
305
+ loadState === STATE_LOADING ? /* @__PURE__ */ jsx(LoadingMessage, { label: t("customer_accounts.domainMapping.loading", "Loading domain configuration\u2026") }) : null,
306
+ loadState === STATE_ERROR ? /* @__PURE__ */ jsx(
307
+ ErrorMessage,
308
+ {
309
+ label: t("customer_accounts.domainMapping.error.load", "Could not load custom-domain configuration"),
310
+ action: /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: refresh, children: t("customer_accounts.domainMapping.verifyNow", "Check Now") })
311
+ }
312
+ ) : null,
313
+ loadState === STATE_LOADED && orderedMappings.length === 0 && selectedOrgId ? /* @__PURE__ */ jsx(
314
+ EmptyState,
315
+ {
316
+ icon: /* @__PURE__ */ jsx(Globe, { className: "h-8 w-8", "aria-hidden": true }),
317
+ title: t("customer_accounts.domainMapping.empty.title", "No custom domain yet"),
318
+ description: t("customer_accounts.domainMapping.empty.description", "Connect your own domain so customers can reach the portal at a branded URL."),
319
+ action: {
320
+ label: t("customer_accounts.domainMapping.empty.cta", "Register Domain"),
321
+ onClick: handleOpenRegister,
322
+ icon: /* @__PURE__ */ jsx(Globe, { className: "h-4 w-4", "aria-hidden": true })
323
+ }
324
+ }
325
+ ) : null,
326
+ loadState === STATE_LOADED && orderedMappings.length > 0 ? /* @__PURE__ */ jsx("div", { className: "space-y-4", children: orderedMappings.map((mapping) => {
327
+ const isReplacement = mapping.id !== primaryActiveId && mapping.status !== "active";
328
+ return /* @__PURE__ */ jsx(
329
+ DomainPanel,
330
+ {
331
+ mapping,
332
+ isReplacement,
333
+ cnameTarget: config.cnameTarget,
334
+ aRecordTarget: config.aRecordTarget,
335
+ busy: isMutating,
336
+ onCheckNow: () => handleCheckNow(mapping),
337
+ onRetryTls: () => handleRetryTls(mapping),
338
+ onChangeDomain: () => handleOpenChange(mapping.id),
339
+ onRemove: () => handleRemove(mapping)
340
+ },
341
+ mapping.id
342
+ );
343
+ }) }) : null
344
+ ] }),
345
+ /* @__PURE__ */ jsx(
346
+ RegisterDialog,
347
+ {
348
+ open: registerOpen,
349
+ onOpenChange: setRegisterOpen,
350
+ mode: registerMode,
351
+ currentHostname: replaceTargetHostname,
352
+ onSubmit: handleSubmitRegister
353
+ }
354
+ ),
355
+ ConfirmDialogElement
356
+ ] });
357
+ }
358
+ export {
359
+ CustomerDomainSettingsPage as default
360
+ };
361
+ //# sourceMappingURL=page.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../src/modules/customer_accounts/backend/customer_accounts/settings/domain/page.tsx"],
4
+ "sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { useRouter, useSearchParams } from 'next/navigation'\nimport { Globe } from 'lucide-react'\nimport { Page, PageBody } from '@open-mercato/ui/backend/Page'\nimport { FormHeader } from '@open-mercato/ui/backend/forms'\nimport { EmptyState } from '@open-mercato/ui/backend/EmptyState'\nimport { LoadingMessage, ErrorMessage } from '@open-mercato/ui/backend/detail'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { apiCall } from '@open-mercato/ui/backend/utils/apiCall'\nimport { flash } from '@open-mercato/ui/backend/FlashMessages'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { useConfirmDialog } from '@open-mercato/ui/backend/confirm-dialog'\nimport { useGuardedMutation } from '@open-mercato/ui/backend/injection/useGuardedMutation'\nimport { useAppEvent } from '@open-mercato/ui/backend/injection/useAppEvent'\nimport { OrgSwitcher, type OrgOption } from './components/OrgSwitcher'\nimport { DomainPanel } from './components/DomainPanel'\nimport { RegisterDialog } from './components/RegisterDialog'\nimport type { DomainListResponse, DomainMappingRow, DomainConfig } from './components/types'\n\nconst STATE_LOADING = 'loading'\nconst STATE_LOADED = 'loaded'\nconst STATE_ERROR = 'error'\ntype LoadState = typeof STATE_LOADING | typeof STATE_LOADED | typeof STATE_ERROR\n\ntype OrgSwitcherNode = {\n id: string\n name: string\n depth: number\n selectable: boolean\n children: OrgSwitcherNode[]\n}\n\ntype OrgSwitcherResponse = {\n items?: OrgSwitcherNode[]\n selectedId?: string | null\n}\n\nfunction flattenOrgNodes(nodes: OrgSwitcherNode[] | undefined, acc: OrgOption[] = [], depth = 0): OrgOption[] {\n if (!nodes) return acc\n for (const node of nodes) {\n if (node.selectable) {\n acc.push({ id: node.id, label: node.name, depth })\n }\n flattenOrgNodes(node.children, acc, depth + 1)\n }\n return acc\n}\n\nexport default function CustomerDomainSettingsPage() {\n const t = useT()\n const router = useRouter()\n const searchParams = useSearchParams()\n\n const [orgOptions, setOrgOptions] = React.useState<OrgOption[]>([])\n const [defaultOrgId, setDefaultOrgId] = React.useState<string | null>(null)\n const [orgsLoaded, setOrgsLoaded] = React.useState(false)\n\n const urlOrgId = searchParams?.get('org') ?? null\n const selectedOrgId = urlOrgId ?? defaultOrgId\n\n const [mappings, setMappings] = React.useState<DomainMappingRow[]>([])\n const [config, setConfig] = React.useState<DomainConfig>({ cnameTarget: null, aRecordTarget: null })\n const [loadState, setLoadState] = React.useState<LoadState>(STATE_LOADING)\n const [reloadToken, setReloadToken] = React.useState(0)\n const [registerOpen, setRegisterOpen] = React.useState(false)\n const [registerMode, setRegisterMode] = React.useState<'register' | 'change'>('register')\n const [replaceTargetId, setReplaceTargetId] = React.useState<string | null>(null)\n const [isMutating, setIsMutating] = React.useState(false)\n\n const { confirm, ConfirmDialogElement } = useConfirmDialog()\n const { runMutation } = useGuardedMutation<{ entityType: string; entityId?: string }>({\n contextId: 'customer_accounts:domain-settings',\n })\n\n const runMutationWithContext = React.useCallback(\n async <T,>(operation: () => Promise<T>, mutationPayload?: Record<string, unknown>): Promise<T> => {\n return runMutation({\n operation,\n mutationPayload,\n context: { entityType: 'customer_accounts:domain_mapping' },\n })\n },\n [runMutation],\n )\n\n const refresh = React.useCallback(() => {\n setReloadToken((token) => token + 1)\n }, [])\n\n React.useEffect(() => {\n let cancelled = false\n async function loadOrgs() {\n try {\n const call = await apiCall<OrgSwitcherResponse>('/api/directory/organization-switcher')\n if (cancelled) return\n if (!call.ok || !call.result) {\n setOrgOptions([])\n setDefaultOrgId(null)\n return\n }\n const flat = flattenOrgNodes(call.result.items, [], 0)\n setOrgOptions(flat)\n const fallback = call.result.selectedId ?? (flat[0]?.id ?? null)\n setDefaultOrgId(fallback)\n } catch {\n if (!cancelled) {\n setOrgOptions([])\n setDefaultOrgId(null)\n }\n } finally {\n if (!cancelled) setOrgsLoaded(true)\n }\n }\n loadOrgs()\n return () => {\n cancelled = true\n }\n }, [])\n\n React.useEffect(() => {\n if (!orgsLoaded) return\n if (!selectedOrgId) {\n setMappings([])\n setConfig({ cnameTarget: null, aRecordTarget: null })\n setLoadState(STATE_LOADED)\n return\n }\n let cancelled = false\n async function load() {\n setLoadState(STATE_LOADING)\n try {\n const call = await apiCall<DomainListResponse>(\n `/api/customer_accounts/admin/domain-mappings?organizationId=${encodeURIComponent(selectedOrgId!)}`,\n )\n if (cancelled) return\n if (!call.ok || !call.result?.ok) {\n setLoadState(STATE_ERROR)\n return\n }\n setMappings(Array.isArray(call.result.domainMappings) ? call.result.domainMappings : [])\n setConfig(call.result.config ?? { cnameTarget: null, aRecordTarget: null })\n setLoadState(STATE_LOADED)\n } catch {\n if (!cancelled) setLoadState(STATE_ERROR)\n }\n }\n load()\n return () => {\n cancelled = true\n }\n }, [orgsLoaded, selectedOrgId, reloadToken])\n\n useAppEvent('customer_accounts.domain_mapping.*', () => {\n refresh()\n }, [refresh])\n\n const orderedMappings = React.useMemo(() => {\n if (mappings.length === 0) return []\n const sorted = [...mappings].sort((a, b) => {\n const aActive = a.status === 'active' ? 0 : 1\n const bActive = b.status === 'active' ? 0 : 1\n if (aActive !== bActive) return aActive - bActive\n return new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime()\n })\n return sorted\n }, [mappings])\n\n const primaryActiveId = React.useMemo(() => {\n const active = orderedMappings.find((m) => m.status === 'active')\n if (active) return active.id\n return orderedMappings[0]?.id ?? null\n }, [orderedMappings])\n\n const handleOrgChange = React.useCallback(\n (next: string) => {\n const params = new URLSearchParams(searchParams?.toString() ?? '')\n if (next) params.set('org', next)\n else params.delete('org')\n const qs = params.toString()\n router.replace(qs ? `?${qs}` : '?', { scroll: false })\n },\n [router, searchParams],\n )\n\n const handleOpenRegister = React.useCallback(() => {\n setRegisterMode('register')\n setReplaceTargetId(null)\n setRegisterOpen(true)\n }, [])\n\n const handleOpenChange = React.useCallback((mappingId: string) => {\n setRegisterMode('change')\n setReplaceTargetId(mappingId)\n setRegisterOpen(true)\n }, [])\n\n const handleSubmitRegister = React.useCallback(\n async (hostname: string) => {\n if (!selectedOrgId) {\n throw new Error(t('customer_accounts.domainMapping.error.load', 'Could not load custom-domain configuration'))\n }\n setIsMutating(true)\n try {\n await runMutationWithContext(async () => {\n const body: Record<string, unknown> = {\n hostname,\n organizationId: selectedOrgId,\n }\n if (registerMode === 'change' && replaceTargetId) {\n body.replacesDomainId = replaceTargetId\n }\n const call = await apiCall<{ ok: boolean; error?: string; domainMapping?: DomainMappingRow }>(\n '/api/customer_accounts/admin/domain-mappings',\n {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(body),\n },\n )\n if (!call.ok || !call.result?.ok) {\n const message = call.result?.error\n || t('customer_accounts.domainMapping.alreadyClaimed', 'This domain is not available. Please choose a different hostname.')\n throw new Error(message)\n }\n flash(t('customer_accounts.domainMapping.registered', 'Domain registered successfully'), 'success')\n setRegisterOpen(false)\n refresh()\n })\n } finally {\n setIsMutating(false)\n }\n },\n [refresh, registerMode, replaceTargetId, runMutationWithContext, selectedOrgId, t],\n )\n\n const handleCheckNow = React.useCallback(\n async (mapping: DomainMappingRow) => {\n setIsMutating(true)\n try {\n await runMutationWithContext(async () => {\n const call = await apiCall<{ ok: boolean; error?: string }>(\n `/api/customer_accounts/admin/domain-mappings/${encodeURIComponent(mapping.id)}/verify`,\n { method: 'POST' },\n )\n if (!call.ok || !call.result?.ok) {\n const message = call.result?.error || t('customer_accounts.domainMapping.error.load', 'Could not load custom-domain configuration')\n flash(message, 'error')\n return\n }\n refresh()\n })\n } finally {\n setIsMutating(false)\n }\n },\n [refresh, runMutationWithContext, t],\n )\n\n const handleRetryTls = React.useCallback(\n async (mapping: DomainMappingRow) => {\n setIsMutating(true)\n try {\n await runMutationWithContext(async () => {\n const call = await apiCall<{ ok: boolean; error?: string }>(\n `/api/customer_accounts/admin/domain-mappings/${encodeURIComponent(mapping.id)}/health-check`,\n { method: 'POST' },\n )\n if (!call.ok || !call.result?.ok) {\n const message = call.result?.error || t('customer_accounts.domainMapping.error.load', 'Could not load custom-domain configuration')\n flash(message, 'error')\n return\n }\n refresh()\n })\n } finally {\n setIsMutating(false)\n }\n },\n [refresh, runMutationWithContext, t],\n )\n\n const handleRemove = React.useCallback(\n async (mapping: DomainMappingRow) => {\n const replacement = orderedMappings.find(\n (m) => m.id !== mapping.id && m.status !== 'active',\n )\n const text = replacement\n ? t('customer_accounts.domainMapping.removeConfirm.hasReplacement', 'This will also cancel the pending replacement domain ({hostname}).', { hostname: replacement.hostname })\n : t('customer_accounts.domainMapping.removeConfirm', 'Are you sure? Customers using this domain will no longer be able to reach your portal.')\n const confirmed = await confirm({\n title: t('customer_accounts.domainMapping.removeConfirm.title', 'Remove custom domain?'),\n text,\n variant: 'destructive',\n confirmText: t('customer_accounts.domainMapping.removeDomain', 'Remove Domain'),\n })\n if (!confirmed) return\n setIsMutating(true)\n try {\n await runMutationWithContext(async () => {\n const call = await apiCall<{ ok: boolean; error?: string }>(\n `/api/customer_accounts/admin/domain-mappings?id=${encodeURIComponent(mapping.id)}`,\n { method: 'DELETE' },\n )\n if (!call.ok || !call.result?.ok) {\n const message = call.result?.error || t('customer_accounts.domainMapping.error.load', 'Could not load custom-domain configuration')\n flash(message, 'error')\n return\n }\n flash(t('customer_accounts.domainMapping.removed', 'Domain removed'), 'success')\n refresh()\n })\n } finally {\n setIsMutating(false)\n }\n },\n [confirm, orderedMappings, refresh, runMutationWithContext, t],\n )\n\n const replaceTargetHostname = React.useMemo(() => {\n if (registerMode !== 'change' || !replaceTargetId) return null\n return orderedMappings.find((m) => m.id === replaceTargetId)?.hostname ?? null\n }, [orderedMappings, registerMode, replaceTargetId])\n\n return (\n <Page>\n <div className=\"px-3 py-3 md:px-6 md:py-4\">\n <FormHeader\n mode=\"detail\"\n title={t('customer_accounts.domainMapping.title', 'Custom Domain')}\n subtitle={t('customer_accounts.domainMapping.description', 'Map your own domain to the customer portal')}\n backHref=\"/backend/customer_accounts/settings\"\n backLabel={t('customer_accounts.settings.title', 'Portal Settings')}\n />\n </div>\n\n <PageBody className=\"space-y-6\">\n {orgOptions.length > 1 ? (\n <div className=\"flex flex-wrap items-center justify-between gap-3 rounded-lg border bg-card px-4 py-3\">\n <OrgSwitcher\n options={orgOptions}\n selectedId={selectedOrgId}\n onChange={handleOrgChange}\n />\n </div>\n ) : null}\n\n {loadState === STATE_LOADING ? (\n <LoadingMessage label={t('customer_accounts.domainMapping.loading', 'Loading domain configuration\u2026')} />\n ) : null}\n\n {loadState === STATE_ERROR ? (\n <ErrorMessage\n label={t('customer_accounts.domainMapping.error.load', 'Could not load custom-domain configuration')}\n action={\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={refresh}>\n {t('customer_accounts.domainMapping.verifyNow', 'Check Now')}\n </Button>\n }\n />\n ) : null}\n\n {loadState === STATE_LOADED && orderedMappings.length === 0 && selectedOrgId ? (\n <EmptyState\n icon={<Globe className=\"h-8 w-8\" aria-hidden />}\n title={t('customer_accounts.domainMapping.empty.title', 'No custom domain yet')}\n description={t('customer_accounts.domainMapping.empty.description', 'Connect your own domain so customers can reach the portal at a branded URL.')}\n action={{\n label: t('customer_accounts.domainMapping.empty.cta', 'Register Domain'),\n onClick: handleOpenRegister,\n icon: <Globe className=\"h-4 w-4\" aria-hidden />,\n }}\n />\n ) : null}\n\n {loadState === STATE_LOADED && orderedMappings.length > 0 ? (\n <div className=\"space-y-4\">\n {orderedMappings.map((mapping) => {\n const isReplacement = mapping.id !== primaryActiveId && mapping.status !== 'active'\n return (\n <DomainPanel\n key={mapping.id}\n mapping={mapping}\n isReplacement={isReplacement}\n cnameTarget={config.cnameTarget}\n aRecordTarget={config.aRecordTarget}\n busy={isMutating}\n onCheckNow={() => handleCheckNow(mapping)}\n onRetryTls={() => handleRetryTls(mapping)}\n onChangeDomain={() => handleOpenChange(mapping.id)}\n onRemove={() => handleRemove(mapping)}\n />\n )\n })}\n </div>\n ) : null}\n </PageBody>\n\n <RegisterDialog\n open={registerOpen}\n onOpenChange={setRegisterOpen}\n mode={registerMode}\n currentHostname={replaceTargetHostname}\n onSubmit={handleSubmitRegister}\n />\n\n {ConfirmDialogElement}\n </Page>\n )\n}\n"],
5
+ "mappings": ";AAwUQ,cASF,YATE;AAtUR,YAAY,WAAW;AACvB,SAAS,WAAW,uBAAuB;AAC3C,SAAS,aAAa;AACtB,SAAS,MAAM,gBAAgB;AAC/B,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB,oBAAoB;AAC7C,SAAS,cAAc;AACvB,SAAS,eAAe;AACxB,SAAS,aAAa;AACtB,SAAS,YAAY;AACrB,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,mBAAmB;AAC5B,SAAS,mBAAmC;AAC5C,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAG/B,MAAM,gBAAgB;AACtB,MAAM,eAAe;AACrB,MAAM,cAAc;AAgBpB,SAAS,gBAAgB,OAAsC,MAAmB,CAAC,GAAG,QAAQ,GAAgB;AAC5G,MAAI,CAAC,MAAO,QAAO;AACnB,aAAW,QAAQ,OAAO;AACxB,QAAI,KAAK,YAAY;AACnB,UAAI,KAAK,EAAE,IAAI,KAAK,IAAI,OAAO,KAAK,MAAM,MAAM,CAAC;AAAA,IACnD;AACA,oBAAgB,KAAK,UAAU,KAAK,QAAQ,CAAC;AAAA,EAC/C;AACA,SAAO;AACT;AAEe,SAAR,6BAA8C;AACnD,QAAM,IAAI,KAAK;AACf,QAAM,SAAS,UAAU;AACzB,QAAM,eAAe,gBAAgB;AAErC,QAAM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A,OACN;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,MAAM;AAAA,QACN,cAAc;AAAA,QACd,MAAM;AAAA,QACN,iBAAiB;AAAA,QACjB,UAAU;AAAA;AAAA,IACZ;AAAA,IAEC;AAAA,KACH;AAEJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
1
+ import React from "react";
2
+ const globeIcon = React.createElement(
3
+ "svg",
4
+ { width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" },
5
+ React.createElement("circle", { cx: 12, cy: 12, r: 10 }),
6
+ React.createElement("path", { d: "M2 12h20" }),
7
+ React.createElement("path", { d: "M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" })
8
+ );
9
+ const metadata = {
10
+ requireAuth: true,
11
+ requireFeatures: ["customer_accounts.domain.manage"],
12
+ pageTitle: "Custom Domain",
13
+ pageTitleKey: "customer_accounts.domainMapping.title",
14
+ pageGroup: "Module Configs",
15
+ pageGroupKey: "settings.sections.moduleConfigs",
16
+ pageOrder: 60,
17
+ icon: globeIcon,
18
+ pageContext: "settings",
19
+ breadcrumb: [
20
+ { label: "Custom Domain", labelKey: "customer_accounts.domainMapping.title" }
21
+ ]
22
+ };
23
+ var page_meta_default = metadata;
24
+ export {
25
+ page_meta_default as default,
26
+ metadata
27
+ };
28
+ //# sourceMappingURL=page.meta.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../src/modules/customer_accounts/backend/customer_accounts/settings/domain/page.meta.ts"],
4
+ "sourcesContent": ["import React from 'react'\n\nconst globeIcon = React.createElement(\n 'svg',\n { width: 16, height: 16, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: 2, strokeLinecap: 'round', strokeLinejoin: 'round' },\n React.createElement('circle', { cx: 12, cy: 12, r: 10 }),\n React.createElement('path', { d: 'M2 12h20' }),\n React.createElement('path', { d: 'M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z' }),\n)\n\nexport const metadata = {\n requireAuth: true,\n requireFeatures: ['customer_accounts.domain.manage'],\n pageTitle: 'Custom Domain',\n pageTitleKey: 'customer_accounts.domainMapping.title',\n pageGroup: 'Module Configs',\n pageGroupKey: 'settings.sections.moduleConfigs',\n pageOrder: 60,\n icon: globeIcon,\n pageContext: 'settings' as const,\n breadcrumb: [\n { label: 'Custom Domain', labelKey: 'customer_accounts.domainMapping.title' },\n ],\n}\n\nexport default metadata\n"],
5
+ "mappings": "AAAA,OAAO,WAAW;AAElB,MAAM,YAAY,MAAM;AAAA,EACtB;AAAA,EACA,EAAE,OAAO,IAAI,QAAQ,IAAI,SAAS,aAAa,MAAM,QAAQ,QAAQ,gBAAgB,aAAa,GAAG,eAAe,SAAS,gBAAgB,QAAQ;AAAA,EACrJ,MAAM,cAAc,UAAU,EAAE,IAAI,IAAI,IAAI,IAAI,GAAG,GAAG,CAAC;AAAA,EACvD,MAAM,cAAc,QAAQ,EAAE,GAAG,WAAW,CAAC;AAAA,EAC7C,MAAM,cAAc,QAAQ,EAAE,GAAG,6FAA6F,CAAC;AACjI;AAEO,MAAM,WAAW;AAAA,EACtB,aAAa;AAAA,EACb,iBAAiB,CAAC,iCAAiC;AAAA,EACnD,WAAW;AAAA,EACX,cAAc;AAAA,EACd,WAAW;AAAA,EACX,cAAc;AAAA,EACd,WAAW;AAAA,EACX,MAAM;AAAA,EACN,aAAa;AAAA,EACb,YAAY;AAAA,IACV,EAAE,OAAO,iBAAiB,UAAU,wCAAwC;AAAA,EAC9E;AACF;AAEA,IAAO,oBAAQ;",
6
+ "names": []
7
+ }