@cedros/pay-react 1.1.29 → 1.1.30

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 (99) hide show
  1. package/README.md +8 -0
  2. package/dist/{AISettingsSection-DtAgMsDw.mjs → AISettingsSection-BMh3hAb5.mjs} +4 -4
  3. package/dist/{AISettingsSection-B7qrycfY.js → AISettingsSection-C0zqPbd6.js} +1 -1
  4. package/dist/{AutosaveIndicator-BEvABoKU.mjs → AutosaveIndicator-3ctAnz8Y.mjs} +1 -1
  5. package/dist/AutosaveIndicator-DXRPr4P7.js +1 -0
  6. package/dist/{CedrosPayAdminDashboard-CBuvNAtB.mjs → CedrosPayAdminDashboard-DaJ9JoGn.mjs} +20 -20
  7. package/dist/CedrosPayAdminDashboard-Uvyh9p7A.js +1 -0
  8. package/dist/{ChatLogsSection-Ber5o8hF.mjs → ChatLogsSection-BtJixYAp.mjs} +2 -2
  9. package/dist/ChatLogsSection-FC3O536G.js +1 -0
  10. package/dist/{ComplianceSection-ZCr0wsvw.mjs → ComplianceSection-BMnb1p4w.mjs} +3 -3
  11. package/dist/ComplianceSection-BioTKm7k.js +1 -0
  12. package/dist/{CustomersSection-D9UknSKC.mjs → CustomersSection-dmwoBhcf.mjs} +2 -2
  13. package/dist/CustomersSection-z6ARxuex.js +1 -0
  14. package/dist/DisputesSection-BjHHQAi7.js +1 -0
  15. package/dist/{DisputesSection-C_eySK-W.mjs → DisputesSection-CHyLne76.mjs} +2 -2
  16. package/dist/{Dropdown-B90Zabxr.mjs → Dropdown-BRSZlhik.mjs} +1 -1
  17. package/dist/Dropdown-j8o0OO5L.js +1 -0
  18. package/dist/ErrorBanner-CAgPnj62.js +1 -0
  19. package/dist/{ErrorBanner-CZXsHi3H.mjs → ErrorBanner-lZJhCmDX.mjs} +1 -1
  20. package/dist/{FAQSection-Bv_Hdt8B.mjs → FAQSection-Di2xE9Sm.mjs} +3 -3
  21. package/dist/FAQSection-b34DMzgV.js +1 -0
  22. package/dist/{ImagesSection-DpdXQ6qu.mjs → ImagesSection-D63PEjR6.mjs} +2 -2
  23. package/dist/ImagesSection-DGBA7iKY.js +1 -0
  24. package/dist/{InventorySection-DZMu9DMw.mjs → InventorySection-Dp5Yu4TA.mjs} +2 -2
  25. package/dist/InventorySection-bVCECzX5.js +1 -0
  26. package/dist/LazyCedrosPayAdminDashboard-BqJDNrDI.mjs +9 -0
  27. package/dist/LazyCedrosPayAdminDashboard-CpfTtOBc.js +1 -0
  28. package/dist/{MessagingSection-D_cOBfFt.mjs → MessagingSection-BLCnCpEv.mjs} +3 -3
  29. package/dist/MessagingSection-DU0dYNMy.js +1 -0
  30. package/dist/{OrdersSection-wfPavit9.mjs → OrdersSection-Bd56F3cj.mjs} +2 -2
  31. package/dist/OrdersSection-FOFEAgs1.js +1 -0
  32. package/dist/{PaymentSettingsSection-DunzBo9n.mjs → PaymentSettingsSection-52iw47Su.mjs} +3 -3
  33. package/dist/{PaymentSettingsSection-BdBDgaRg.js → PaymentSettingsSection-B5J56VAk.js} +1 -1
  34. package/dist/ReturnsSection-BjpIVFfN.js +1 -0
  35. package/dist/{ReturnsSection-B4FL7bUv.mjs → ReturnsSection-DUVeKrCd.mjs} +2 -2
  36. package/dist/{SettingsSection-Cz2Yjdhr.js → SettingsSection-DKkHykaC.js} +1 -1
  37. package/dist/{SettingsSection-DoeNDbqd.mjs → SettingsSection-vK9WIwXE.mjs} +1 -1
  38. package/dist/ShippingSection-B5lk7zpS.js +1 -0
  39. package/dist/{ShippingSection-BlVsYC6B.mjs → ShippingSection-CZRrXrlh.mjs} +2 -2
  40. package/dist/{SingleCategorySettings-B406nnF-.mjs → SingleCategorySettings-C8xJ47_T.mjs} +4 -4
  41. package/dist/SingleCategorySettings-g7D-9lG1.js +3 -0
  42. package/dist/StatsBar-CWXw2ZT3.js +1 -0
  43. package/dist/{StatsBar-D4v-I_Dj.mjs → StatsBar-D4cOKG2e.mjs} +1 -1
  44. package/dist/StorefrontSection-BWnMB9k-.js +1 -0
  45. package/dist/{StorefrontSection-BK_rhrAi.mjs → StorefrontSection-uXSVbEAa.mjs} +4 -4
  46. package/dist/{SubscriptionsSection-D8V9RBv-.mjs → SubscriptionsSection-Ci_AZrWA.mjs} +3 -3
  47. package/dist/SubscriptionsSection-DQfXkuDv.js +1 -0
  48. package/dist/{TaxSection-Cj6TXL6x.mjs → TaxSection-BTukS_cU.mjs} +2 -2
  49. package/dist/TaxSection-cuPQISxZ.js +1 -0
  50. package/dist/Token22Section-CCfkDm8W.js +1 -0
  51. package/dist/{Token22Section-DtYAcT54.mjs → Token22Section-DRsPJuTq.mjs} +2 -2
  52. package/dist/{WebhooksSection-DBAIxtBy.mjs → WebhooksSection-A8Y4ZGcj.mjs} +2 -2
  53. package/dist/WebhooksSection-CnEmaGH1.js +1 -0
  54. package/dist/admin.js +1 -1
  55. package/dist/admin.mjs +4 -5
  56. package/dist/crypto-only.js +1 -1
  57. package/dist/crypto-only.mjs +4 -3
  58. package/dist/{sectionIds-DBavltrL.mjs → icons-C3yDMnKE.mjs} +129 -253
  59. package/dist/icons-Cjgd9YVo.js +1 -0
  60. package/dist/index.js +1 -1
  61. package/dist/index.mjs +24 -23
  62. package/dist/sectionIds-D46-_-h-.js +1 -0
  63. package/dist/sectionIds-YktNxmRt.mjs +124 -0
  64. package/dist/{sections-C2zEJr5G.js → sections-511_XBh4.js} +1 -1
  65. package/dist/{sections-BHph7CYj.mjs → sections-CRaMa8ZB.mjs} +2 -2
  66. package/dist/sections-more-Cgw2qJlA.js +1 -0
  67. package/dist/{sections-more-CMFgfU4d.mjs → sections-more-Ixw6mM6R.mjs} +5 -5
  68. package/dist/src/admin.d.ts +4 -4
  69. package/dist/src/admin.d.ts.map +1 -1
  70. package/dist/src/standalone-admin.d.ts +8 -0
  71. package/dist/src/standalone-admin.d.ts.map +1 -0
  72. package/dist/standalone-admin.d.ts +2 -0
  73. package/dist/standalone-admin.js +1 -0
  74. package/dist/standalone-admin.mjs +4 -0
  75. package/package.json +7 -1
  76. package/dist/AutosaveIndicator-DiyeAg93.js +0 -1
  77. package/dist/CedrosPayAdminDashboard-CAwEvn66.js +0 -1
  78. package/dist/ChatLogsSection-DLxMMi9I.js +0 -1
  79. package/dist/ComplianceSection-Buu0zTiL.js +0 -1
  80. package/dist/CustomersSection-BywmMLur.js +0 -1
  81. package/dist/DisputesSection-DwkHGv2a.js +0 -1
  82. package/dist/Dropdown-CtY91emj.js +0 -1
  83. package/dist/ErrorBanner-Cx2dUhps.js +0 -1
  84. package/dist/FAQSection-DlPLnIJD.js +0 -1
  85. package/dist/ImagesSection-B4Jzet79.js +0 -1
  86. package/dist/InventorySection-BgRdpn1l.js +0 -1
  87. package/dist/MessagingSection-CxV-pf-f.js +0 -1
  88. package/dist/OrdersSection-BbAX79Ff.js +0 -1
  89. package/dist/ReturnsSection-7k4LZ8yp.js +0 -1
  90. package/dist/ShippingSection-C-HI8rOb.js +0 -1
  91. package/dist/SingleCategorySettings-BqC2UXt3.js +0 -3
  92. package/dist/StatsBar-m6GSRNxs.js +0 -1
  93. package/dist/StorefrontSection-Axvh_KeS.js +0 -1
  94. package/dist/SubscriptionsSection-EeULMWIB.js +0 -1
  95. package/dist/TaxSection-CzHPhaHl.js +0 -1
  96. package/dist/Token22Section-DqRKVG_G.js +0 -1
  97. package/dist/WebhooksSection-D--iPZuM.js +0 -1
  98. package/dist/sectionIds-B_tFiNvF.js +0 -1
  99. package/dist/sections-more-C1VNVwkp.js +0 -1
@@ -1,69 +1,147 @@
1
- import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
- import { lazy as w, Suspense as P, useMemo as A } from "react";
3
- import { b as T } from "./index-BFt38o8Q.mjs";
4
- import { g as m, b as x, f as v } from "./fetchWithTimeout-DmMOwL0Q.mjs";
5
- const j = w(async () => ({ default: (await import("./CedrosPayAdminDashboard-CBuvNAtB.mjs")).CedrosPayAdminDashboard }));
6
- function D(o) {
7
- return /* @__PURE__ */ e(P, { fallback: null, children: /* @__PURE__ */ e(j, { ...o }) });
1
+ import { b as M } from "./index-BFt38o8Q.mjs";
2
+ import { g as c, b as L, f as u } from "./fetchWithTimeout-DmMOwL0Q.mjs";
3
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
4
+ class C {
5
+ serverUrl;
6
+ walletSigner = null;
7
+ jwtToken = null;
8
+ isAdminUser = !1;
9
+ constructor(r) {
10
+ this.serverUrl = r;
11
+ }
12
+ getAuthMethod() {
13
+ return this.walletSigner?.publicKey && this.walletSigner.signMessage ? "wallet" : this.jwtToken && this.isAdminUser ? "cedros-login" : "none";
14
+ }
15
+ isAuthenticated() {
16
+ return this.getAuthMethod() !== "none";
17
+ }
18
+ setWalletSigner(r) {
19
+ this.walletSigner = r, c().debug("[AdminAuthManager] Wallet signer updated:", !!r?.publicKey);
20
+ }
21
+ setCedrosLoginAuth(r, o) {
22
+ this.jwtToken = r, this.isAdminUser = o ?? !1, c().debug("[AdminAuthManager] Cedros-login auth updated:", { hasToken: !!r, isAdmin: this.isAdminUser });
23
+ }
24
+ async createAuthHeaders(r) {
25
+ const o = this.getAuthMethod();
26
+ if (o === "wallet")
27
+ return this.createWalletAuthHeaders(r);
28
+ if (o === "cedros-login")
29
+ return this.createJwtAuthHeaders();
30
+ throw new Error("No admin authentication configured. Connect a wallet or sign in as admin.");
31
+ }
32
+ async createWalletAuthHeaders(r) {
33
+ if (!this.walletSigner?.publicKey || !this.walletSigner.signMessage)
34
+ throw new Error("Wallet not connected or does not support message signing");
35
+ const o = await this.fetchNonce(r), s = new TextEncoder().encode(o.nonce), n = await this.walletSigner.signMessage(s), h = M.encode(this.walletSigner.publicKey.toBytes()), d = L.fromUint8Array(n);
36
+ return {
37
+ "X-Signer": h,
38
+ "X-Message": o.nonce,
39
+ "X-Signature": d
40
+ };
41
+ }
42
+ createJwtAuthHeaders() {
43
+ if (!this.jwtToken)
44
+ throw new Error("No JWT token available");
45
+ return {
46
+ Authorization: `Bearer ${this.jwtToken}`
47
+ };
48
+ }
49
+ async fetchNonce(r) {
50
+ const o = `${this.serverUrl}/paywall/v1/nonce`, s = typeof r == "string" ? { purpose: r } : { path: r.path, method: r.method.toUpperCase() };
51
+ c().debug("[AdminAuthManager] Fetching nonce:", s);
52
+ const n = await u(o, {
53
+ method: "POST",
54
+ headers: { "Content-Type": "application/json" },
55
+ body: JSON.stringify(s)
56
+ });
57
+ if (!n.ok) {
58
+ const h = await n.text();
59
+ throw new Error(`Failed to fetch nonce: ${n.status} ${h}`);
60
+ }
61
+ return await n.json();
62
+ }
63
+ async fetchWithAuth(r, o = {}) {
64
+ if (this.getAuthMethod() === "none")
65
+ throw new Error("No admin authentication configured");
66
+ const n = (o.method || "GET").toUpperCase(), h = await this.createAuthHeaders({ path: r, method: n }), d = {
67
+ // Only set Content-Type for methods that typically carry a body
68
+ ...n !== "GET" && n !== "HEAD" ? { "Content-Type": "application/json" } : {},
69
+ ...o.headers || {},
70
+ ...h
71
+ }, a = await u(`${this.serverUrl}${r}`, {
72
+ ...o,
73
+ headers: d
74
+ });
75
+ if (!a.ok) {
76
+ let l = `Admin API error ${a.status}`;
77
+ try {
78
+ const i = await a.json();
79
+ i && typeof i.error == "string" ? l = i.error : i && typeof i.message == "string" && (l = i.message);
80
+ } catch {
81
+ }
82
+ throw new Error(l);
83
+ }
84
+ return await a.json();
85
+ }
8
86
  }
9
- function y() {
10
- return /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
87
+ function k() {
88
+ return /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
11
89
  /* @__PURE__ */ e("path", { d: "M20 7.5v9l-4 2.25M4 7.5v9l4 2.25" }),
12
90
  /* @__PURE__ */ e("path", { d: "m20 7.5-8-4.5-8 4.5" }),
13
91
  /* @__PURE__ */ e("path", { d: "m12 12 8-4.5M12 12v9.5M12 12 4 7.5" })
14
92
  ] });
15
93
  }
16
- function L() {
94
+ function p() {
17
95
  return /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6" }) });
18
96
  }
19
- function S() {
20
- return /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
97
+ function g() {
98
+ return /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
21
99
  /* @__PURE__ */ e("path", { d: "M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z" }),
22
100
  /* @__PURE__ */ e("path", { d: "M13 5v2M13 17v2M13 11v2" })
23
101
  ] });
24
102
  }
25
- function M() {
26
- return /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
103
+ function w() {
104
+ return /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
27
105
  /* @__PURE__ */ e("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
28
106
  /* @__PURE__ */ e("path", { d: "M3 3v5h5" }),
29
107
  /* @__PURE__ */ e("path", { d: "M12 7v5l4 2" })
30
108
  ] });
31
109
  }
32
- function C() {
33
- return /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
110
+ function v() {
111
+ return /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
34
112
  /* @__PURE__ */ e("path", { d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" }),
35
113
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3" })
36
114
  ] });
37
115
  }
38
- function b() {
39
- return /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
116
+ function f() {
117
+ return /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
40
118
  /* @__PURE__ */ e("path", { d: "M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1" }),
41
119
  /* @__PURE__ */ e("path", { d: "M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4" })
42
120
  ] });
43
121
  }
44
- const d = {
45
- products: () => /* @__PURE__ */ e(y, {}),
46
- transactions: () => /* @__PURE__ */ e(L, {}),
47
- coupons: () => /* @__PURE__ */ e(S, {}),
48
- refunds: () => /* @__PURE__ */ e(M, {}),
49
- settings: () => /* @__PURE__ */ e(C, {}),
50
- wallet: () => /* @__PURE__ */ e(b, {})
51
- }, V = {
52
- products: /* @__PURE__ */ e(y, {}),
53
- transactions: /* @__PURE__ */ e(L, {}),
54
- coupons: /* @__PURE__ */ e(S, {}),
55
- refunds: /* @__PURE__ */ e(M, {}),
56
- settings: /* @__PURE__ */ e(C, {}),
57
- wallet: /* @__PURE__ */ e(b, {}),
122
+ const W = {
123
+ products: () => /* @__PURE__ */ e(k, {}),
124
+ transactions: () => /* @__PURE__ */ e(p, {}),
125
+ coupons: () => /* @__PURE__ */ e(g, {}),
126
+ refunds: () => /* @__PURE__ */ e(w, {}),
127
+ settings: () => /* @__PURE__ */ e(v, {}),
128
+ wallet: () => /* @__PURE__ */ e(f, {})
129
+ }, A = {
130
+ products: /* @__PURE__ */ e(k, {}),
131
+ transactions: /* @__PURE__ */ e(p, {}),
132
+ coupons: /* @__PURE__ */ e(g, {}),
133
+ refunds: /* @__PURE__ */ e(w, {}),
134
+ settings: /* @__PURE__ */ e(v, {}),
135
+ wallet: /* @__PURE__ */ e(f, {}),
58
136
  chevronRight: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "m9 18 6-6-6-6" }) }),
59
137
  loading: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "cedros-admin__spinner", children: /* @__PURE__ */ e("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }),
60
- refresh: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
138
+ refresh: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
61
139
  /* @__PURE__ */ e("path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
62
140
  /* @__PURE__ */ e("path", { d: "M21 3v5h-5" }),
63
141
  /* @__PURE__ */ e("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }),
64
142
  /* @__PURE__ */ e("path", { d: "M8 16H3v5" })
65
143
  ] }),
66
- user: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
144
+ user: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
67
145
  /* @__PURE__ */ e("circle", { cx: "12", cy: "8", r: "5" }),
68
146
  /* @__PURE__ */ e("path", { d: "M20 21a8 8 0 0 0-16 0" })
69
147
  ] }),
@@ -72,64 +150,64 @@ const d = {
72
150
  plus: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "M12 5v14M5 12h14" }) }),
73
151
  chevronDown: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "m6 9 6 6 6-6" }) }),
74
152
  chevronUp: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "m18 15-6-6-6 6" }) }),
75
- storefront: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
153
+ storefront: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
76
154
  /* @__PURE__ */ e("path", { d: "M3 9h18v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9Z" }),
77
155
  /* @__PURE__ */ e("path", { d: "m3 9 2.45-4.9A2 2 0 0 1 7.24 3h9.52a2 2 0 0 1 1.8 1.1L21 9" }),
78
156
  /* @__PURE__ */ e("path", { d: "M12 3v6" })
79
157
  ] }),
80
- arrowUp: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
158
+ arrowUp: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
81
159
  /* @__PURE__ */ e("path", { d: "m5 12 7-7 7 7" }),
82
160
  /* @__PURE__ */ e("path", { d: "M12 19V5" })
83
161
  ] }),
84
- arrowDown: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
162
+ arrowDown: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
85
163
  /* @__PURE__ */ e("path", { d: "m5 12 7 7 7-7" }),
86
164
  /* @__PURE__ */ e("path", { d: "M12 5v14" })
87
165
  ] }),
88
- delete: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
166
+ delete: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
89
167
  /* @__PURE__ */ e("path", { d: "M3 6h18M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" }),
90
168
  /* @__PURE__ */ e("path", { d: "M10 11v6M14 11v6" })
91
169
  ] }),
92
170
  close: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "M18 6 6 18M6 6l12 12" }) }),
93
- edit: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
171
+ edit: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
94
172
  /* @__PURE__ */ e("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }),
95
173
  /* @__PURE__ */ e("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })
96
174
  ] }),
97
- faq: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
175
+ faq: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
98
176
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
99
177
  /* @__PURE__ */ e("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
100
178
  /* @__PURE__ */ e("path", { d: "M12 17h.01" })
101
179
  ] }),
102
180
  chat: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "m3 21 1.9-5.7a8.5 8.5 0 1 1 3.8 3.8z" }) }),
103
- globe: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
181
+ globe: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
104
182
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
105
183
  /* @__PURE__ */ e("path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" }),
106
184
  /* @__PURE__ */ e("path", { d: "M2 12h20" })
107
185
  ] }),
108
- eye: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
186
+ eye: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
109
187
  /* @__PURE__ */ e("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }),
110
188
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3" })
111
189
  ] }),
112
- eyeOff: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
190
+ eyeOff: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
113
191
  /* @__PURE__ */ e("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }),
114
192
  /* @__PURE__ */ e("path", { d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }),
115
193
  /* @__PURE__ */ e("path", { d: "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }),
116
194
  /* @__PURE__ */ e("line", { x1: "2", x2: "22", y1: "2", y2: "22" })
117
195
  ] }),
118
- creditCard: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
196
+ creditCard: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
119
197
  /* @__PURE__ */ e("rect", { width: "20", height: "14", x: "2", y: "5", rx: "2" }),
120
198
  /* @__PURE__ */ e("line", { x1: "2", x2: "22", y1: "10", y2: "10" })
121
199
  ] }),
122
- mail: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
200
+ mail: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
123
201
  /* @__PURE__ */ e("rect", { width: "20", height: "16", x: "2", y: "4", rx: "2" }),
124
202
  /* @__PURE__ */ e("path", { d: "m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" })
125
203
  ] }),
126
- server: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
204
+ server: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
127
205
  /* @__PURE__ */ e("rect", { width: "20", height: "8", x: "2", y: "2", rx: "2", ry: "2" }),
128
206
  /* @__PURE__ */ e("rect", { width: "20", height: "8", x: "2", y: "14", rx: "2", ry: "2" }),
129
207
  /* @__PURE__ */ e("line", { x1: "6", x2: "6.01", y1: "6", y2: "6" }),
130
208
  /* @__PURE__ */ e("line", { x1: "6", x2: "6.01", y1: "18", y2: "18" })
131
209
  ] }),
132
- calendarRepeat: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
210
+ calendarRepeat: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
133
211
  /* @__PURE__ */ e("rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", ry: "2" }),
134
212
  /* @__PURE__ */ e("line", { x1: "16", x2: "16", y1: "2", y2: "6" }),
135
213
  /* @__PURE__ */ e("line", { x1: "8", x2: "8", y1: "2", y2: "6" }),
@@ -138,7 +216,7 @@ const d = {
138
216
  /* @__PURE__ */ e("path", { d: "M16 14v3a1 1 0 0 0 1 1h1" })
139
217
  ] }),
140
218
  shield: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" }) }),
141
- brain: /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
219
+ brain: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
142
220
  /* @__PURE__ */ e("path", { d: "M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z" }),
143
221
  /* @__PURE__ */ e("path", { d: "M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z" }),
144
222
  /* @__PURE__ */ e("path", { d: "M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4" }),
@@ -150,210 +228,8 @@ const d = {
150
228
  /* @__PURE__ */ e("path", { d: "M19.967 17.484A4 4 0 0 1 18 18" })
151
229
  ] })
152
230
  };
153
- class B {
154
- serverUrl;
155
- walletSigner = null;
156
- jwtToken = null;
157
- isAdminUser = !1;
158
- constructor(r) {
159
- this.serverUrl = r;
160
- }
161
- getAuthMethod() {
162
- return this.walletSigner?.publicKey && this.walletSigner.signMessage ? "wallet" : this.jwtToken && this.isAdminUser ? "cedros-login" : "none";
163
- }
164
- isAuthenticated() {
165
- return this.getAuthMethod() !== "none";
166
- }
167
- setWalletSigner(r) {
168
- this.walletSigner = r, m().debug("[AdminAuthManager] Wallet signer updated:", !!r?.publicKey);
169
- }
170
- setCedrosLoginAuth(r, n) {
171
- this.jwtToken = r, this.isAdminUser = n ?? !1, m().debug("[AdminAuthManager] Cedros-login auth updated:", { hasToken: !!r, isAdmin: this.isAdminUser });
172
- }
173
- async createAuthHeaders(r) {
174
- const n = this.getAuthMethod();
175
- if (n === "wallet")
176
- return this.createWalletAuthHeaders(r);
177
- if (n === "cedros-login")
178
- return this.createJwtAuthHeaders();
179
- throw new Error("No admin authentication configured. Connect a wallet or sign in as admin.");
180
- }
181
- async createWalletAuthHeaders(r) {
182
- if (!this.walletSigner?.publicKey || !this.walletSigner.signMessage)
183
- throw new Error("Wallet not connected or does not support message signing");
184
- const n = await this.fetchNonce(r), l = new TextEncoder().encode(n.nonce), a = await this.walletSigner.signMessage(l), s = T.encode(this.walletSigner.publicKey.toBytes()), p = x.fromUint8Array(a);
185
- return {
186
- "X-Signer": s,
187
- "X-Message": n.nonce,
188
- "X-Signature": p
189
- };
190
- }
191
- createJwtAuthHeaders() {
192
- if (!this.jwtToken)
193
- throw new Error("No JWT token available");
194
- return {
195
- Authorization: `Bearer ${this.jwtToken}`
196
- };
197
- }
198
- async fetchNonce(r) {
199
- const n = `${this.serverUrl}/paywall/v1/nonce`, l = typeof r == "string" ? { purpose: r } : { path: r.path, method: r.method.toUpperCase() };
200
- m().debug("[AdminAuthManager] Fetching nonce:", l);
201
- const a = await v(n, {
202
- method: "POST",
203
- headers: { "Content-Type": "application/json" },
204
- body: JSON.stringify(l)
205
- });
206
- if (!a.ok) {
207
- const s = await a.text();
208
- throw new Error(`Failed to fetch nonce: ${a.status} ${s}`);
209
- }
210
- return await a.json();
211
- }
212
- async fetchWithAuth(r, n = {}) {
213
- if (this.getAuthMethod() === "none")
214
- throw new Error("No admin authentication configured");
215
- const a = (n.method || "GET").toUpperCase(), s = await this.createAuthHeaders({ path: r, method: a }), p = {
216
- // Only set Content-Type for methods that typically carry a body
217
- ...a !== "GET" && a !== "HEAD" ? { "Content-Type": "application/json" } : {},
218
- ...n.headers || {},
219
- ...s
220
- }, u = await v(`${this.serverUrl}${r}`, {
221
- ...n,
222
- headers: p
223
- });
224
- if (!u.ok) {
225
- let g = `Admin API error ${u.status}`;
226
- try {
227
- const h = await u.json();
228
- h && typeof h.error == "string" ? g = h.error : h && typeof h.message == "string" && (g = h.message);
229
- } catch {
230
- }
231
- throw new Error(g);
232
- }
233
- return await u.json();
234
- }
235
- }
236
- const t = {
237
- adminProfile: "admin-profile",
238
- adminSectionAccess: "admin-section-access",
239
- cedrosLogin: "cedros-login",
240
- cedrosPay: "cedros-pay",
241
- org: "org",
242
- dashboardPermissions: "dashboard-permissions"
243
- };
244
- function W(o = {}) {
245
- return { ...o };
246
- }
247
- function E(o) {
248
- const r = W(o.services);
249
- return !(t.adminProfile in r) && o.cedrosLogin?.user && (r[t.adminProfile] = {
250
- user: o.cedrosLogin.user
251
- }), !(t.adminSectionAccess in r) && o.dashboardPermissions && (r[t.adminSectionAccess] = o.dashboardPermissions), !(t.cedrosLogin in r) && o.cedrosLogin && (r[t.cedrosLogin] = o.cedrosLogin), !(t.cedrosPay in r) && o.cedrosPay && (r[t.cedrosPay] = o.cedrosPay), !(t.org in r) && o.org && (r[t.org] = o.org), !(t.dashboardPermissions in r) && o.dashboardPermissions && (r[t.dashboardPermissions] = o.dashboardPermissions), r;
252
- }
253
- function f(o, r) {
254
- return U(E(o), r);
255
- }
256
- function U(o, r) {
257
- return o[r];
258
- }
259
- const c = (o) => w(async () => {
260
- const l = (await o()).default;
261
- return { default: ({ pluginContext: s }) => {
262
- const p = s.getAccessToken(), u = s.hasPermission("cedros-pay:admin") || s.hasPermission("admin"), g = A(() => {
263
- const k = new B(s.serverUrl);
264
- return k.setCedrosLoginAuth(p ?? null, u), k;
265
- }, [u, s.serverUrl, p]), h = {
266
- serverUrl: s.serverUrl,
267
- authManager: g
268
- };
269
- return /* @__PURE__ */ e(l, { ...h });
270
- } };
271
- }), _ = {
272
- id: "cedros-pay",
273
- name: "Cedros Pay",
274
- version: "1.0.0",
275
- sections: [
276
- // Store group (main cedros-pay sections)
277
- { id: "transactions", label: "Transactions", icon: d.transactions, group: "Store", order: 0 },
278
- { id: "products", label: "Products", icon: d.products, group: "Store", order: 1 },
279
- { id: "subscriptions", label: "Subscriptions", icon: d.products, group: "Store", order: 2 },
280
- { id: "coupons", label: "Coupons", icon: d.coupons, group: "Store", order: 3 },
281
- { id: "refunds", label: "Refunds", icon: d.refunds, group: "Store", order: 4 },
282
- { id: "compliance", label: "Compliance", icon: d.settings, group: "Store", order: 5 },
283
- // Configuration group
284
- { id: "storefront", label: "Storefront", icon: d.products, group: "Configuration", order: 10 },
285
- { id: "ai-settings", label: "Store AI", icon: d.settings, group: "Configuration", order: 11 },
286
- { id: "faqs", label: "Knowledge Base", icon: d.settings, group: "Configuration", order: 12 },
287
- { id: "payment-settings", label: "Payment Options", icon: d.wallet, group: "Configuration", order: 13 },
288
- { id: "messaging", label: "Store Messages", icon: d.settings, group: "Configuration", order: 14 },
289
- { id: "settings", label: "Store Server", icon: d.settings, group: "Configuration", order: 15 }
290
- ],
291
- groups: [
292
- { id: "Store", label: "Store", order: 1 },
293
- { id: "Configuration", label: "Configuration", order: 2, defaultCollapsed: !0 }
294
- ],
295
- components: {
296
- products: c(() => import("./sections-BHph7CYj.mjs").then((o) => ({ default: o.ProductsSection }))),
297
- subscriptions: c(() => import("./SubscriptionsSection-D8V9RBv-.mjs").then((o) => ({ default: o.SubscriptionsSection }))),
298
- transactions: c(() => import("./sections-BHph7CYj.mjs").then((o) => ({ default: o.TransactionsSection }))),
299
- coupons: c(() => import("./sections-BHph7CYj.mjs").then((o) => ({ default: o.CouponsSection }))),
300
- refunds: c(() => import("./sections-BHph7CYj.mjs").then((o) => ({ default: o.RefundsSection }))),
301
- compliance: c(() => import("./ComplianceSection-ZCr0wsvw.mjs").then((o) => ({ default: o.ComplianceSection }))),
302
- storefront: c(() => import("./StorefrontSection-BK_rhrAi.mjs").then((o) => ({ default: o.StorefrontSection }))),
303
- "ai-settings": c(() => import("./AISettingsSection-DtAgMsDw.mjs").then((o) => ({ default: o.AISettingsSection }))),
304
- faqs: c(() => import("./FAQSection-Bv_Hdt8B.mjs").then((o) => ({ default: o.FAQSection }))),
305
- "payment-settings": c(() => import("./PaymentSettingsSection-DunzBo9n.mjs").then((o) => ({ default: o.PaymentSettingsSection }))),
306
- messaging: c(() => import("./MessagingSection-D_cOBfFt.mjs").then((o) => ({ default: o.MessagingSection }))),
307
- settings: c(() => import("./SettingsSection-DoeNDbqd.mjs").then((o) => ({ default: o.SettingsSection })))
308
- },
309
- createPluginContext(o) {
310
- const r = f(
311
- o,
312
- t.cedrosPay
313
- ), n = f(
314
- o,
315
- t.cedrosLogin
316
- ), l = f(o, t.org);
317
- return {
318
- serverUrl: r?.serverUrl || n?.serverUrl || "",
319
- userId: n?.user?.id,
320
- getAccessToken: () => n?.getAccessToken?.() || r?.jwtToken || null,
321
- hasPermission: (s) => this.checkPermission(s, o),
322
- orgId: l?.orgId,
323
- pluginData: {
324
- walletAddress: r?.walletAddress
325
- }
326
- };
327
- },
328
- checkPermission(o, r) {
329
- const n = f(r, t.org);
330
- return n?.permissions ? n.permissions.includes(o) : !1;
331
- },
332
- cssNamespace: "cedros-dashboard"
333
- }, I = [
334
- // ── Store group ──
335
- { id: "transactions", qualifiedId: "cedros-pay:transactions", label: "Transactions", group: "Store", order: 0, endpoints: ["GET /admin/transactions"] },
336
- { id: "products", qualifiedId: "cedros-pay:products", label: "Products", group: "Store", order: 1, endpoints: ["GET /admin/products", "POST /admin/products", "PUT /admin/products/{id}", "DELETE /admin/products/{id}"] },
337
- { id: "subscriptions", qualifiedId: "cedros-pay:subscriptions", label: "Subscriptions", group: "Store", order: 2, endpoints: ["GET /admin/subscriptions", "POST /admin/subscriptions", "PUT /admin/subscriptions/{id}"] },
338
- { id: "coupons", qualifiedId: "cedros-pay:coupons", label: "Coupons", group: "Store", order: 3, endpoints: ["GET /admin/coupons", "POST /admin/coupons", "PUT /admin/coupons/{id}", "DELETE /admin/coupons/{id}"] },
339
- { id: "refunds", qualifiedId: "cedros-pay:refunds", label: "Refunds", group: "Store", order: 4, endpoints: ["GET /admin/refunds", "POST /admin/refunds/{id}/approve", "POST /admin/refunds/{id}/deny"] },
340
- // ── Configuration group ──
341
- { id: "storefront", qualifiedId: "cedros-pay:storefront", label: "Storefront", group: "Configuration", order: 10, endpoints: ["GET /admin/config/shop", "PUT /admin/config/shop"] },
342
- { id: "ai-settings", qualifiedId: "cedros-pay:ai-settings", label: "Store AI", group: "Configuration", order: 11, endpoints: ["GET /admin/config/ai", "PUT /admin/config/ai/api-key", "PUT /admin/config/ai/assignment", "PUT /admin/config/ai/prompt"] },
343
- { id: "faqs", qualifiedId: "cedros-pay:faqs", label: "Knowledge Base", group: "Configuration", order: 12, endpoints: ["GET /admin/faqs", "POST /admin/faqs", "PUT /admin/faqs/{id}", "DELETE /admin/faqs/{id}"] },
344
- { id: "payment-settings", qualifiedId: "cedros-pay:payment-settings", label: "Payment Options", group: "Configuration", order: 13, endpoints: ["GET /admin/config/stripe", "PUT /admin/config/stripe", "GET /admin/config/x402", "PUT /admin/config/x402", "GET /admin/config/cedros_login", "PUT /admin/config/cedros_login"] },
345
- { id: "messaging", qualifiedId: "cedros-pay:messaging", label: "Store Messages", group: "Configuration", order: 14, endpoints: ["GET /admin/config/messaging", "PUT /admin/config/messaging"] },
346
- { id: "settings", qualifiedId: "cedros-pay:settings", label: "Store Server", group: "Configuration", order: 15, endpoints: ["GET /admin/config/server", "PUT /admin/config/server"] }
347
- ], R = I.map((o) => o.qualifiedId), N = [
348
- { id: "Store", label: "Store", order: 1, defaultCollapsed: !1 },
349
- { id: "Configuration", label: "Configuration", order: 2, defaultCollapsed: !0 }
350
- ];
351
231
  export {
352
- B as A,
353
- N as C,
354
- V as I,
355
- I as a,
356
- R as b,
357
- D as c,
358
- _ as d
232
+ W as A,
233
+ A as I,
234
+ C as a
359
235
  };
@@ -0,0 +1 @@
1
+ "use strict";const p=require("./index-WcOlBYZJ.js"),s=require("./fetchWithTimeout-CG0EKbhf.js"),e=require("react/jsx-runtime");class w{serverUrl;walletSigner=null;jwtToken=null;isAdminUser=!1;constructor(t){this.serverUrl=t}getAuthMethod(){return this.walletSigner?.publicKey&&this.walletSigner.signMessage?"wallet":this.jwtToken&&this.isAdminUser?"cedros-login":"none"}isAuthenticated(){return this.getAuthMethod()!=="none"}setWalletSigner(t){this.walletSigner=t,s.getLogger().debug("[AdminAuthManager] Wallet signer updated:",!!t?.publicKey)}setCedrosLoginAuth(t,r){this.jwtToken=t,this.isAdminUser=r??!1,s.getLogger().debug("[AdminAuthManager] Cedros-login auth updated:",{hasToken:!!t,isAdmin:this.isAdminUser})}async createAuthHeaders(t){const r=this.getAuthMethod();if(r==="wallet")return this.createWalletAuthHeaders(t);if(r==="cedros-login")return this.createJwtAuthHeaders();throw new Error("No admin authentication configured. Connect a wallet or sign in as admin.")}async createWalletAuthHeaders(t){if(!this.walletSigner?.publicKey||!this.walletSigner.signMessage)throw new Error("Wallet not connected or does not support message signing");const r=await this.fetchNonce(t),i=new TextEncoder().encode(r.nonce),o=await this.walletSigner.signMessage(i),h=p.bs58.encode(this.walletSigner.publicKey.toBytes()),d=s.gBase64.fromUint8Array(o);return{"X-Signer":h,"X-Message":r.nonce,"X-Signature":d}}createJwtAuthHeaders(){if(!this.jwtToken)throw new Error("No JWT token available");return{Authorization:`Bearer ${this.jwtToken}`}}async fetchNonce(t){const r=`${this.serverUrl}/paywall/v1/nonce`,i=typeof t=="string"?{purpose:t}:{path:t.path,method:t.method.toUpperCase()};s.getLogger().debug("[AdminAuthManager] Fetching nonce:",i);const o=await s.fetchWithTimeout(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!o.ok){const h=await o.text();throw new Error(`Failed to fetch nonce: ${o.status} ${h}`)}return await o.json()}async fetchWithAuth(t,r={}){if(this.getAuthMethod()==="none")throw new Error("No admin authentication configured");const o=(r.method||"GET").toUpperCase(),h=await this.createAuthHeaders({path:t,method:o}),d={...o!=="GET"&&o!=="HEAD"?{"Content-Type":"application/json"}:{},...r.headers||{},...h},a=await s.fetchWithTimeout(`${this.serverUrl}${t}`,{...r,headers:d});if(!a.ok){let c=`Admin API error ${a.status}`;try{const n=await a.json();n&&typeof n.error=="string"?c=n.error:n&&typeof n.message=="string"&&(c=n.message)}catch{}throw new Error(c)}return await a.json()}}function l(){return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M20 7.5v9l-4 2.25M4 7.5v9l4 2.25"}),e.jsx("path",{d:"m20 7.5-8-4.5-8 4.5"}),e.jsx("path",{d:"m12 12 8-4.5M12 12v9.5M12 12 4 7.5"})]})}function u(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"})})}function x(){return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"}),e.jsx("path",{d:"M13 5v2M13 17v2M13 11v2"})]})}function j(){return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),e.jsx("path",{d:"M3 3v5h5"}),e.jsx("path",{d:"M12 7v5l4 2"})]})}function k(){return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function g(){return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1"}),e.jsx("path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4"})]})}const v={products:()=>e.jsx(l,{}),transactions:()=>e.jsx(u,{}),coupons:()=>e.jsx(x,{}),refunds:()=>e.jsx(j,{}),settings:()=>e.jsx(k,{}),wallet:()=>e.jsx(g,{})},M={products:e.jsx(l,{}),transactions:e.jsx(u,{}),coupons:e.jsx(x,{}),refunds:e.jsx(j,{}),settings:e.jsx(k,{}),wallet:e.jsx(g,{}),chevronRight:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m9 18 6-6-6-6"})}),loading:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"cedros-admin__spinner",children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),refresh:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),e.jsx("path",{d:"M21 3v5h-5"}),e.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),e.jsx("path",{d:"M8 16H3v5"})]}),user:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"8",r:"5"}),e.jsx("path",{d:"M20 21a8 8 0 0 0-16 0"})]}),check:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})}),trash:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M3 6h18M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})}),plus:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 5v14M5 12h14"})}),chevronDown:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m6 9 6 6 6-6"})}),chevronUp:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m18 15-6-6-6 6"})}),storefront:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M3 9h18v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9Z"}),e.jsx("path",{d:"m3 9 2.45-4.9A2 2 0 0 1 7.24 3h9.52a2 2 0 0 1 1.8 1.1L21 9"}),e.jsx("path",{d:"M12 3v6"})]}),arrowUp:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"m5 12 7-7 7 7"}),e.jsx("path",{d:"M12 19V5"})]}),arrowDown:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"m5 12 7 7 7-7"}),e.jsx("path",{d:"M12 5v14"})]}),delete:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M3 6h18M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}),e.jsx("path",{d:"M10 11v6M14 11v6"})]}),close:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),edit:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),e.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]}),faq:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),e.jsx("path",{d:"M12 17h.01"})]}),chat:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m3 21 1.9-5.7a8.5 8.5 0 1 1 3.8 3.8z"})}),globe:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}),e.jsx("path",{d:"M2 12h20"})]}),eye:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),eyeOff:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),e.jsx("path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"}),e.jsx("path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"}),e.jsx("line",{x1:"2",x2:"22",y1:"2",y2:"22"})]}),creditCard:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"20",height:"14",x:"2",y:"5",rx:"2"}),e.jsx("line",{x1:"2",x2:"22",y1:"10",y2:"10"})]}),mail:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),e.jsx("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})]}),server:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2"}),e.jsx("rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2"}),e.jsx("line",{x1:"6",x2:"6.01",y1:"6",y2:"6"}),e.jsx("line",{x1:"6",x2:"6.01",y1:"18",y2:"18"})]}),calendarRepeat:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2"}),e.jsx("line",{x1:"16",x2:"16",y1:"2",y2:"6"}),e.jsx("line",{x1:"8",x2:"8",y1:"2",y2:"6"}),e.jsx("line",{x1:"3",x2:"21",y1:"10",y2:"10"}),e.jsx("path",{d:"M11 14h1.5a1.5 1.5 0 0 1 0 3H11v2"}),e.jsx("path",{d:"M16 14v3a1 1 0 0 0 1 1h1"})]}),shield:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"})}),brain:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"}),e.jsx("path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"}),e.jsx("path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"}),e.jsx("path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375"}),e.jsx("path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5"}),e.jsx("path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396"}),e.jsx("path",{d:"M19.938 10.5a4 4 0 0 1 .585.396"}),e.jsx("path",{d:"M6 18a4 4 0 0 1-1.967-.516"}),e.jsx("path",{d:"M19.967 17.484A4 4 0 0 1 18 18"})]})};exports.AdminAuthManager=w;exports.AdminPluginIcons=v;exports.Icons=M;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./styles--fxb3lCl.js"),r=require("./index-Cq9ya93W.js"),t=require("./CedrosContext-CCakH2SZ.js"),o=require("./fetchWithTimeout-CG0EKbhf.js"),a=require("./sectionIds-B_tFiNvF.js"),i=require("./ThemeContext-CFXyYx7A.js");exports.CEDROS_EVENTS=e.CEDROS_EVENTS;exports.CSP_PRESETS=e.CSP_PRESETS;exports.CedrosPay=e.CedrosPay;exports.CreditsButton=e.CreditsButton;exports.CreditsSubscribeButton=e.CreditsSubscribeButton;exports.PaymentMethodBadge=e.PaymentMethodBadge;exports.PaymentModal=e.PaymentModal;exports.ProductPrice=e.ProductPrice;exports.PurchaseButton=e.PurchaseButton;exports.RPC_PROVIDERS=e.RPC_PROVIDERS;exports.SECURITY_RECOMMENDATIONS=e.SECURITY_RECOMMENDATIONS;exports.StripeButton=e.StripeButton;exports.SubscribeButton=e.SubscribeButton;exports.SubscriptionManagementPanel=e.SubscriptionManagementPanel;exports.calculateDiscountPercentage=e.calculateDiscountPercentage;exports.createTranslator=e.createTranslator;exports.detectLocale=e.detectLocale;exports.emitPaymentError=e.emitPaymentError;exports.emitPaymentProcessing=e.emitPaymentProcessing;exports.emitPaymentStart=e.emitPaymentStart;exports.emitPaymentSuccess=e.emitPaymentSuccess;exports.emitWalletConnect=e.emitWalletConnect;exports.emitWalletConnected=e.emitWalletConnected;exports.emitWalletError=e.emitWalletError;exports.formatCSP=e.formatCSP;exports.formatCouponCodes=e.formatCouponCodes;exports.generateCSP=e.generateCSP;exports.generateCSPDirectives=e.generateCSPDirectives;exports.getAvailableLocales=e.getAvailableLocales;exports.getLocalizedError=e.getLocalizedError;exports.getUserErrorMessage=e.getUserErrorMessage;exports.isRetryableError=e.isRetryableError;exports.loadLocale=e.loadLocale;exports.logSecurityReport=e.logSecurityReport;exports.parseCouponCodes=e.parseCouponCodes;exports.stackCheckoutCoupons=e.stackCheckoutCoupons;exports.useCreditsPayment=e.useCreditsPayment;exports.useCreditsSubscription=e.useCreditsSubscription;exports.useLocalizedError=e.useLocalizedError;exports.usePaymentMode=e.usePaymentMode;exports.useStripeCheckout=e.useStripeCheckout;exports.useSubscription=e.useSubscription;exports.useSubscriptionManagement=e.useSubscriptionManagement;exports.useTranslation=e.useTranslation;exports.validateSecurity=e.validateSecurity;exports.ComplianceGatePage=r.ComplianceGatePage;exports.CreditsBalance=r.CreditsBalance;exports.ecommerce=r.index;exports.useComplianceCheck=r.useComplianceCheck;exports.useCreditsBalance=r.useCreditsBalance;exports.CIRCUIT_BREAKER_PRESETS=t.CIRCUIT_BREAKER_PRESETS;exports.CedrosProvider=t.CedrosProvider;exports.CircuitBreakerOpenError=t.CircuitBreakerOpenError;exports.CircuitState=t.CircuitState;exports.ERROR_CATEGORIES=t.ERROR_CATEGORIES;exports.FEATURE_FLAG_NAMES=t.FEATURE_FLAG_NAMES;exports.FEATURE_FLAG_REGISTRY=t.FEATURE_FLAG_REGISTRY;exports.RATE_LIMITER_PRESETS=t.RATE_LIMITER_PRESETS;exports.RETRY_PRESETS=t.RETRY_PRESETS;exports.createCircuitBreaker=t.createCircuitBreaker;exports.createRateLimiter=t.createRateLimiter;exports.getFeatureFlagDefinition=t.getFeatureFlagDefinition;exports.getFeatureFlagDefinitions=t.getFeatureFlagDefinitions;exports.isFeatureEnabled=t.isFeatureEnabled;exports.parseFeatureFlagBoolean=t.parseFeatureFlagBoolean;exports.resolveFeatureFlags=t.resolveFeatureFlags;exports.retryWithBackoff=t.retryWithBackoff;exports.useCedrosContext=t.useCedrosContext;exports.validateConfig=t.validateConfig;exports.LogLevel=o.LogLevel;exports.Logger=o.Logger;exports.createLogger=o.createLogger;exports.getLogger=o.getLogger;exports.CEDROS_PAY_GROUPS=a.CEDROS_PAY_GROUPS;exports.CEDROS_PAY_SECTIONS=a.CEDROS_PAY_SECTIONS;exports.CEDROS_PAY_SECTION_IDS=a.CEDROS_PAY_SECTION_IDS;exports.CedrosPayAdminDashboard=a.CedrosPayAdminDashboard;exports.cedrosPayPlugin=a.cedrosPayPlugin;exports.useCedrosTheme=i.useCedrosTheme;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./styles--fxb3lCl.js"),r=require("./index-Cq9ya93W.js"),t=require("./CedrosContext-CCakH2SZ.js"),a=require("./fetchWithTimeout-CG0EKbhf.js"),o=require("./sectionIds-D46-_-h-.js"),i=require("./LazyCedrosPayAdminDashboard-CpfTtOBc.js"),s=require("./ThemeContext-CFXyYx7A.js");exports.CEDROS_EVENTS=e.CEDROS_EVENTS;exports.CSP_PRESETS=e.CSP_PRESETS;exports.CedrosPay=e.CedrosPay;exports.CreditsButton=e.CreditsButton;exports.CreditsSubscribeButton=e.CreditsSubscribeButton;exports.PaymentMethodBadge=e.PaymentMethodBadge;exports.PaymentModal=e.PaymentModal;exports.ProductPrice=e.ProductPrice;exports.PurchaseButton=e.PurchaseButton;exports.RPC_PROVIDERS=e.RPC_PROVIDERS;exports.SECURITY_RECOMMENDATIONS=e.SECURITY_RECOMMENDATIONS;exports.StripeButton=e.StripeButton;exports.SubscribeButton=e.SubscribeButton;exports.SubscriptionManagementPanel=e.SubscriptionManagementPanel;exports.calculateDiscountPercentage=e.calculateDiscountPercentage;exports.createTranslator=e.createTranslator;exports.detectLocale=e.detectLocale;exports.emitPaymentError=e.emitPaymentError;exports.emitPaymentProcessing=e.emitPaymentProcessing;exports.emitPaymentStart=e.emitPaymentStart;exports.emitPaymentSuccess=e.emitPaymentSuccess;exports.emitWalletConnect=e.emitWalletConnect;exports.emitWalletConnected=e.emitWalletConnected;exports.emitWalletError=e.emitWalletError;exports.formatCSP=e.formatCSP;exports.formatCouponCodes=e.formatCouponCodes;exports.generateCSP=e.generateCSP;exports.generateCSPDirectives=e.generateCSPDirectives;exports.getAvailableLocales=e.getAvailableLocales;exports.getLocalizedError=e.getLocalizedError;exports.getUserErrorMessage=e.getUserErrorMessage;exports.isRetryableError=e.isRetryableError;exports.loadLocale=e.loadLocale;exports.logSecurityReport=e.logSecurityReport;exports.parseCouponCodes=e.parseCouponCodes;exports.stackCheckoutCoupons=e.stackCheckoutCoupons;exports.useCreditsPayment=e.useCreditsPayment;exports.useCreditsSubscription=e.useCreditsSubscription;exports.useLocalizedError=e.useLocalizedError;exports.usePaymentMode=e.usePaymentMode;exports.useStripeCheckout=e.useStripeCheckout;exports.useSubscription=e.useSubscription;exports.useSubscriptionManagement=e.useSubscriptionManagement;exports.useTranslation=e.useTranslation;exports.validateSecurity=e.validateSecurity;exports.ComplianceGatePage=r.ComplianceGatePage;exports.CreditsBalance=r.CreditsBalance;exports.ecommerce=r.index;exports.useComplianceCheck=r.useComplianceCheck;exports.useCreditsBalance=r.useCreditsBalance;exports.CIRCUIT_BREAKER_PRESETS=t.CIRCUIT_BREAKER_PRESETS;exports.CedrosProvider=t.CedrosProvider;exports.CircuitBreakerOpenError=t.CircuitBreakerOpenError;exports.CircuitState=t.CircuitState;exports.ERROR_CATEGORIES=t.ERROR_CATEGORIES;exports.FEATURE_FLAG_NAMES=t.FEATURE_FLAG_NAMES;exports.FEATURE_FLAG_REGISTRY=t.FEATURE_FLAG_REGISTRY;exports.RATE_LIMITER_PRESETS=t.RATE_LIMITER_PRESETS;exports.RETRY_PRESETS=t.RETRY_PRESETS;exports.createCircuitBreaker=t.createCircuitBreaker;exports.createRateLimiter=t.createRateLimiter;exports.getFeatureFlagDefinition=t.getFeatureFlagDefinition;exports.getFeatureFlagDefinitions=t.getFeatureFlagDefinitions;exports.isFeatureEnabled=t.isFeatureEnabled;exports.parseFeatureFlagBoolean=t.parseFeatureFlagBoolean;exports.resolveFeatureFlags=t.resolveFeatureFlags;exports.retryWithBackoff=t.retryWithBackoff;exports.useCedrosContext=t.useCedrosContext;exports.validateConfig=t.validateConfig;exports.LogLevel=a.LogLevel;exports.Logger=a.Logger;exports.createLogger=a.createLogger;exports.getLogger=a.getLogger;exports.CEDROS_PAY_GROUPS=o.CEDROS_PAY_GROUPS;exports.CEDROS_PAY_SECTIONS=o.CEDROS_PAY_SECTIONS;exports.CEDROS_PAY_SECTION_IDS=o.CEDROS_PAY_SECTION_IDS;exports.cedrosPayPlugin=o.cedrosPayPlugin;exports.CedrosPayAdminDashboard=i.CedrosPayAdminDashboard;exports.useCedrosTheme=s.useCedrosTheme;