@cedros/login-react 0.0.40 → 0.0.42

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 (137) hide show
  1. package/dist/{AuthenticationSettings-BF_7Ea6Z.js → AuthenticationSettings-CheE3j7w.js} +1 -1
  2. package/dist/{AuthenticationSettings-BF_7Ea6Z.js.map → AuthenticationSettings-CheE3j7w.js.map} +1 -1
  3. package/dist/{AuthenticationSettings-Dk1LX0CK.cjs → AuthenticationSettings-Dl41GbJL.cjs} +1 -1
  4. package/dist/{AuthenticationSettings-Dk1LX0CK.cjs.map → AuthenticationSettings-Dl41GbJL.cjs.map} +1 -1
  5. package/dist/{AuthenticationSettings-DUXpyiJ5.js → AuthenticationSettings-DwSxgjbH.js} +1 -1
  6. package/dist/{AuthenticationSettings-DUXpyiJ5.js.map → AuthenticationSettings-DwSxgjbH.js.map} +1 -1
  7. package/dist/{AuthenticationSettings-BMDrCVSf.cjs → AuthenticationSettings-JxHsBst9.cjs} +1 -1
  8. package/dist/{AuthenticationSettings-BMDrCVSf.cjs.map → AuthenticationSettings-JxHsBst9.cjs.map} +1 -1
  9. package/dist/AutosaveStatus-BMXjH1XN.cjs +1 -0
  10. package/dist/AutosaveStatus-BMXjH1XN.cjs.map +1 -0
  11. package/dist/{AutosaveStatus-CSZsp6w7.js → AutosaveStatus-DNuCl59W.js} +798 -319
  12. package/dist/AutosaveStatus-DNuCl59W.js.map +1 -0
  13. package/dist/{CreditSystemSettings-CLImarX-.cjs → CreditSystemSettings-BVgl6uUg.cjs} +1 -1
  14. package/dist/{CreditSystemSettings-CLImarX-.cjs.map → CreditSystemSettings-BVgl6uUg.cjs.map} +1 -1
  15. package/dist/{CreditSystemSettings-Buu7Y-7I.js → CreditSystemSettings-C-ksysSx.js} +12 -7
  16. package/dist/CreditSystemSettings-C-ksysSx.js.map +1 -0
  17. package/dist/{CreditSystemSettings-Cj21_Ug8.js → CreditSystemSettings-HSdF2_CY.js} +1 -1
  18. package/dist/{CreditSystemSettings-Cj21_Ug8.js.map → CreditSystemSettings-HSdF2_CY.js.map} +1 -1
  19. package/dist/CreditSystemSettings-LvA8rb17.cjs +1 -0
  20. package/dist/CreditSystemSettings-LvA8rb17.cjs.map +1 -0
  21. package/dist/EmailRegisterForm-p2X5QP58.js +750 -0
  22. package/dist/EmailRegisterForm-p2X5QP58.js.map +1 -0
  23. package/dist/EmailRegisterForm-xFb6MaVA.cjs +1 -0
  24. package/dist/EmailRegisterForm-xFb6MaVA.cjs.map +1 -0
  25. package/dist/{EmailSettings-CmxxnrA9.js → EmailSettings-Cy1cuVUq.js} +1 -1
  26. package/dist/{EmailSettings-CmxxnrA9.js.map → EmailSettings-Cy1cuVUq.js.map} +1 -1
  27. package/dist/EmailSettings-DC_zT4nI.cjs +1 -0
  28. package/dist/EmailSettings-DC_zT4nI.cjs.map +1 -0
  29. package/dist/{EmailSettings-9sdEAONl.cjs → EmailSettings-QBMzpbxv.cjs} +1 -1
  30. package/dist/{EmailSettings-9sdEAONl.cjs.map → EmailSettings-QBMzpbxv.cjs.map} +1 -1
  31. package/dist/EmailSettings-hIhJzux0.js +86 -0
  32. package/dist/EmailSettings-hIhJzux0.js.map +1 -0
  33. package/dist/{EmbeddedWalletSettings-DGq-kXbw.cjs → EmbeddedWalletSettings-4qC9KBwh.cjs} +1 -1
  34. package/dist/{EmbeddedWalletSettings-DGq-kXbw.cjs.map → EmbeddedWalletSettings-4qC9KBwh.cjs.map} +1 -1
  35. package/dist/{EmbeddedWalletSettings-BuLN_Uqc.cjs → EmbeddedWalletSettings-C81QQMWz.cjs} +1 -1
  36. package/dist/{EmbeddedWalletSettings-BuLN_Uqc.cjs.map → EmbeddedWalletSettings-C81QQMWz.cjs.map} +1 -1
  37. package/dist/{EmbeddedWalletSettings-CHkkCjyR.js → EmbeddedWalletSettings-CvvTnRvt.js} +1 -1
  38. package/dist/{EmbeddedWalletSettings-CHkkCjyR.js.map → EmbeddedWalletSettings-CvvTnRvt.js.map} +1 -1
  39. package/dist/{EmbeddedWalletSettings-M-D5N0eY.js → EmbeddedWalletSettings-Cwiug0vR.js} +1 -1
  40. package/dist/{EmbeddedWalletSettings-M-D5N0eY.js.map → EmbeddedWalletSettings-Cwiug0vR.js.map} +1 -1
  41. package/dist/GoogleLoginButton-2zNTIKMm.cjs +1 -0
  42. package/dist/GoogleLoginButton-2zNTIKMm.cjs.map +1 -0
  43. package/dist/{GoogleLoginButton-qf4A_A3G.js → GoogleLoginButton-C1WNu7W3.js} +41 -40
  44. package/dist/GoogleLoginButton-C1WNu7W3.js.map +1 -0
  45. package/dist/LoadingSpinner-6vml-zwr.js.map +1 -1
  46. package/dist/LoadingSpinner-d6sSxgQN.cjs.map +1 -1
  47. package/dist/{PermissionsSection-DNzOL1xW.js → PermissionsSection-BDDiEfho.js} +69 -61
  48. package/dist/{PermissionsSection-DNzOL1xW.js.map → PermissionsSection-BDDiEfho.js.map} +1 -1
  49. package/dist/PermissionsSection-CSB_Ikj9.cjs +1 -0
  50. package/dist/{PermissionsSection-DEMVp7X3.cjs.map → PermissionsSection-CSB_Ikj9.cjs.map} +1 -1
  51. package/dist/{ServerSettings-CMmH5pZv.cjs → ServerSettings-BV0SipW1.cjs} +1 -1
  52. package/dist/{ServerSettings-CMmH5pZv.cjs.map → ServerSettings-BV0SipW1.cjs.map} +1 -1
  53. package/dist/{ServerSettings-DfimU7ay.cjs → ServerSettings-Bf7gFE8r.cjs} +1 -1
  54. package/dist/{ServerSettings-DfimU7ay.cjs.map → ServerSettings-Bf7gFE8r.cjs.map} +1 -1
  55. package/dist/{ServerSettings-qxi8aZO7.js → ServerSettings-DPqHtsgV.js} +1 -1
  56. package/dist/{ServerSettings-qxi8aZO7.js.map → ServerSettings-DPqHtsgV.js.map} +1 -1
  57. package/dist/{ServerSettings-DQemMrNv.js → ServerSettings-Sfr0CG6K.js} +1 -1
  58. package/dist/{ServerSettings-DQemMrNv.js.map → ServerSettings-Sfr0CG6K.js.map} +1 -1
  59. package/dist/SolanaLoginButton-CqdzSSeJ.cjs +1 -0
  60. package/dist/SolanaLoginButton-CqdzSSeJ.cjs.map +1 -0
  61. package/dist/{SolanaLoginButton-B04dib6X.js → SolanaLoginButton-CyeX35eU.js} +41 -40
  62. package/dist/SolanaLoginButton-CyeX35eU.js.map +1 -0
  63. package/dist/{TeamSection-CoMXyFtz.js → TeamSection-BhsBEckR.js} +1 -1
  64. package/dist/{TeamSection-CoMXyFtz.js.map → TeamSection-BhsBEckR.js.map} +1 -1
  65. package/dist/{TeamSection-DopbZClq.cjs → TeamSection-DLxtRmta.cjs} +1 -1
  66. package/dist/{TeamSection-DopbZClq.cjs.map → TeamSection-DLxtRmta.cjs.map} +1 -1
  67. package/dist/{UsersSection-C7aRNkK2.cjs → UsersSection-BEKfbhQ4.cjs} +1 -1
  68. package/dist/{UsersSection-C7aRNkK2.cjs.map → UsersSection-BEKfbhQ4.cjs.map} +1 -1
  69. package/dist/{UsersSection--PAE1XRh.js → UsersSection-DbGkmxty.js} +1 -1
  70. package/dist/{UsersSection--PAE1XRh.js.map → UsersSection-DbGkmxty.js.map} +1 -1
  71. package/dist/{WebhookSettings-B6Y3Tnjv.cjs → WebhookSettings-BPCKv5Or.cjs} +1 -1
  72. package/dist/{WebhookSettings-B6Y3Tnjv.cjs.map → WebhookSettings-BPCKv5Or.cjs.map} +1 -1
  73. package/dist/{WebhookSettings-8QAqvkkO.js → WebhookSettings-CMROMCFT.js} +1 -1
  74. package/dist/{WebhookSettings-8QAqvkkO.js.map → WebhookSettings-CMROMCFT.js.map} +1 -1
  75. package/dist/{WebhookSettings-0sgWRI3U.cjs → WebhookSettings-Cj-iELGa.cjs} +1 -1
  76. package/dist/{WebhookSettings-0sgWRI3U.cjs.map → WebhookSettings-Cj-iELGa.cjs.map} +1 -1
  77. package/dist/{WebhookSettings-B8hAwhZ2.js → WebhookSettings-D4mKAWAg.js} +1 -1
  78. package/dist/{WebhookSettings-B8hAwhZ2.js.map → WebhookSettings-D4mKAWAg.js.map} +1 -1
  79. package/dist/admin-only.cjs +1 -1
  80. package/dist/admin-only.js +1 -1
  81. package/dist/email-only.cjs +1 -1
  82. package/dist/email-only.d.ts +7 -1
  83. package/dist/email-only.js +2 -2
  84. package/dist/google-only.cjs +1 -1
  85. package/dist/google-only.d.ts +6 -0
  86. package/dist/google-only.js +2 -2
  87. package/dist/index.cjs +13 -13
  88. package/dist/index.cjs.map +1 -1
  89. package/dist/index.d.ts +414 -4
  90. package/dist/index.js +6070 -4807
  91. package/dist/index.js.map +1 -1
  92. package/dist/login-react.css +1 -1
  93. package/dist/plugin-BHGg7ius.cjs +1 -0
  94. package/dist/plugin-BHGg7ius.cjs.map +1 -0
  95. package/dist/{plugin-C_NDZ2-D.js → plugin-CK2d7aP5.js} +3 -2
  96. package/dist/plugin-CK2d7aP5.js.map +1 -0
  97. package/dist/solana-only.cjs +1 -1
  98. package/dist/solana-only.d.ts +6 -0
  99. package/dist/solana-only.js +2 -2
  100. package/dist/useAuth-B1yS_YiD.cjs +1 -0
  101. package/dist/{useAuth-U5CYsHEU.cjs.map → useAuth-B1yS_YiD.cjs.map} +1 -1
  102. package/dist/{useAuth-C-Vw-ggy.js → useAuth-l-itM5am.js} +440 -433
  103. package/dist/{useAuth-C-Vw-ggy.js.map → useAuth-l-itM5am.js.map} +1 -1
  104. package/dist/useUsersStatsSummary-9HQDKBU5.js +1879 -0
  105. package/dist/useUsersStatsSummary-9HQDKBU5.js.map +1 -0
  106. package/dist/useUsersStatsSummary-DiRC8sGs.cjs +1 -0
  107. package/dist/useUsersStatsSummary-DiRC8sGs.cjs.map +1 -0
  108. package/package.json +1 -1
  109. package/dist/AutosaveStatus-BKsCIvPj.cjs +0 -1
  110. package/dist/AutosaveStatus-BKsCIvPj.cjs.map +0 -1
  111. package/dist/AutosaveStatus-CSZsp6w7.js.map +0 -1
  112. package/dist/CreditSystemSettings-Buu7Y-7I.js.map +0 -1
  113. package/dist/CreditSystemSettings-C2HkyMXy.cjs +0 -1
  114. package/dist/CreditSystemSettings-C2HkyMXy.cjs.map +0 -1
  115. package/dist/EmailRegisterForm-CNjYrqU6.cjs +0 -1
  116. package/dist/EmailRegisterForm-CNjYrqU6.cjs.map +0 -1
  117. package/dist/EmailRegisterForm-D2VaJouj.js +0 -750
  118. package/dist/EmailRegisterForm-D2VaJouj.js.map +0 -1
  119. package/dist/EmailSettings-DRfOF0Sf.js +0 -78
  120. package/dist/EmailSettings-DRfOF0Sf.js.map +0 -1
  121. package/dist/EmailSettings-eLlzzI5D.cjs +0 -1
  122. package/dist/EmailSettings-eLlzzI5D.cjs.map +0 -1
  123. package/dist/GoogleLoginButton-JtRViYWS.cjs +0 -1
  124. package/dist/GoogleLoginButton-JtRViYWS.cjs.map +0 -1
  125. package/dist/GoogleLoginButton-qf4A_A3G.js.map +0 -1
  126. package/dist/PermissionsSection-DEMVp7X3.cjs +0 -1
  127. package/dist/SolanaLoginButton-B04dib6X.js.map +0 -1
  128. package/dist/SolanaLoginButton-nSJHVFpZ.cjs +0 -1
  129. package/dist/SolanaLoginButton-nSJHVFpZ.cjs.map +0 -1
  130. package/dist/plugin-CUxpAjL-.cjs +0 -1
  131. package/dist/plugin-CUxpAjL-.cjs.map +0 -1
  132. package/dist/plugin-C_NDZ2-D.js.map +0 -1
  133. package/dist/useAuth-U5CYsHEU.cjs +0 -1
  134. package/dist/useUsersStatsSummary-5DJwzntC.js +0 -1246
  135. package/dist/useUsersStatsSummary-5DJwzntC.js.map +0 -1
  136. package/dist/useUsersStatsSummary-DgKaUIfs.cjs +0 -1
  137. package/dist/useUsersStatsSummary-DgKaUIfs.cjs.map +0 -1
@@ -1,15 +1,16 @@
1
- import { jsx as t, jsxs as u, Fragment as f } from "react/jsx-runtime";
2
- import { useMemo as S, useCallback as d, useState as w, useRef as T, useEffect as O } from "react";
3
- import { u as E } from "./useSystemSettings-rgskaDqP.js";
4
- function R(e) {
5
- const l = Math.floor(e / 86400), a = Math.floor(e % 86400 / 3600), n = Math.floor(e % 3600 / 60), s = e % 60;
6
- return { days: l, hours: a, minutes: n, seconds: s };
1
+ import { jsx as e, jsxs as d, Fragment as T } from "react/jsx-runtime";
2
+ import { useMemo as N, useCallback as m, useState as f, useRef as P, useEffect as I } from "react";
3
+ import { u as U } from "./useCedrosLogin-CFfID-0i.js";
4
+ import { u as O } from "./useSystemSettings-rgskaDqP.js";
5
+ function M(t) {
6
+ const i = Math.floor(t / 86400), a = Math.floor(t % 86400 / 3600), n = Math.floor(t % 3600 / 60), r = t % 60;
7
+ return { days: i, hours: a, minutes: n, seconds: r };
7
8
  }
8
- function I(e) {
9
- const { days: l, hours: a, minutes: n } = R(e), s = [];
10
- return l > 0 && s.push(`${l}d`), a > 0 && s.push(`${a}h`), n > 0 && s.push(`${n}m`), s.length === 0 && s.push(`${e}s`), s.join(" ");
9
+ function q(t) {
10
+ const { days: i, hours: a, minutes: n } = M(t), r = [];
11
+ return i > 0 && r.push(`${i}d`), a > 0 && r.push(`${a}h`), n > 0 && r.push(`${n}m`), r.length === 0 && r.push(`${t}s`), r.join(" ");
11
12
  }
12
- const U = {
13
+ const W = {
13
14
  // ============= Authentication Providers =============
14
15
  // Email auth
15
16
  auth_email_enabled: {
@@ -187,6 +188,65 @@ const U = {
187
188
  description: "Allow users to initiate withdrawals from their embedded wallet to external addresses. This is separate from the automated privacy withdrawal worker, which moves funds from the privacy pool to the treasury.",
188
189
  inputType: "boolean"
189
190
  },
191
+ feature_referrals_enabled: {
192
+ key: "feature_referrals_enabled",
193
+ label: "Referral System",
194
+ description: "Enable the referral system. Each user gets a unique referral code they can share. New users can register with a referral code to track who invited them.",
195
+ inputType: "boolean"
196
+ },
197
+ referral_reward_lamports: {
198
+ key: "referral_reward_lamports",
199
+ label: "Referral Reward Amount (lamports)",
200
+ description: "Amount of credits to reward the referrer (in smallest unit: lamports for SOL, micros for USD). Set to 0 to disable referral rewards. For example, 1000000000 = 1 SOL.",
201
+ inputType: "text"
202
+ },
203
+ referral_reward_max_per_referrer: {
204
+ key: "referral_reward_max_per_referrer",
205
+ label: "Max Reward Per Referrer",
206
+ description: "Maximum total reward amount a single referrer can earn (in smallest unit). Set to 0 for unlimited. Applies to direct payout mode only.",
207
+ inputType: "text"
208
+ },
209
+ referral_reward_type: {
210
+ key: "referral_reward_type",
211
+ label: "Referral Reward Type",
212
+ description: `How referral rewards are issued. "Credits" adds balance to the referrer's in-app credit account. "Direct payout" queues an on-chain transfer to the referrer's configured payout wallet address.`,
213
+ inputType: "select",
214
+ presets: [
215
+ { label: "Credits", value: "credits" },
216
+ { label: "Direct payout (on-chain)", value: "direct_payout" }
217
+ ]
218
+ },
219
+ referral_reward_trigger: {
220
+ key: "referral_reward_trigger",
221
+ label: "Referral Reward Trigger",
222
+ description: 'When to issue the referral reward to the referrer. "On signup" rewards immediately when the referred user registers. "On first purchase" rewards only after the referred user makes their first spend. "On every purchase" rewards the referrer on each spend by the referred user.',
223
+ inputType: "select",
224
+ presets: [
225
+ { label: "On signup", value: "on_signup" },
226
+ { label: "On first purchase", value: "on_first_spend" },
227
+ { label: "On every purchase", value: "on_every_spend" }
228
+ ]
229
+ },
230
+ // ============= Payout Worker Settings =============
231
+ payout_auto_enabled: {
232
+ key: "payout_auto_enabled",
233
+ label: "Auto-Process Payouts",
234
+ description: "Enable the automated payout worker that periodically processes pending referral payouts on-chain. When disabled, payouts must be processed manually from the admin dashboard.",
235
+ inputType: "boolean"
236
+ },
237
+ payout_poll_interval_secs: {
238
+ key: "payout_poll_interval_secs",
239
+ label: "Payout Poll Interval",
240
+ description: "How often the payout worker checks for pending payouts (in seconds). Default: 3600 (1 hour). Lower values mean faster payouts but more frequent treasury key decryption.",
241
+ inputType: "duration",
242
+ unit: "seconds"
243
+ },
244
+ payout_batch_size: {
245
+ key: "payout_batch_size",
246
+ label: "Payout Batch Size",
247
+ description: "Maximum number of referrer groups to process per worker cycle. Default: 50. Each referrer group aggregates all pending payouts for that referrer into a single transfer.",
248
+ inputType: "text"
249
+ },
190
250
  // ============= Security Settings =============
191
251
  security_require_mfa: {
192
252
  key: "security_require_mfa",
@@ -313,6 +373,42 @@ const U = {
313
373
  inputType: "text",
314
374
  placeholder: "My App"
315
375
  },
376
+ // ============= Email Subject Customization =============
377
+ email_subject_verification: {
378
+ key: "email_subject_verification",
379
+ label: "Verification Email Subject",
380
+ description: 'Custom subject for email verification messages. Leave empty for the default: "Verify your email address".',
381
+ inputType: "text",
382
+ placeholder: "Verify your email address"
383
+ },
384
+ email_subject_password_reset: {
385
+ key: "email_subject_password_reset",
386
+ label: "Password Reset Subject",
387
+ description: 'Custom subject for password reset emails. Leave empty for the default: "Reset your password".',
388
+ inputType: "text",
389
+ placeholder: "Reset your password"
390
+ },
391
+ email_subject_instant_link: {
392
+ key: "email_subject_instant_link",
393
+ label: "Instant Link Subject",
394
+ description: 'Custom subject for instant link sign-in emails. Leave empty for the default: "Your sign-in link".',
395
+ inputType: "text",
396
+ placeholder: "Your sign-in link"
397
+ },
398
+ email_subject_invite: {
399
+ key: "email_subject_invite",
400
+ label: "Invite Email Subject",
401
+ description: "Custom subject for organization invite emails. Leave empty for the default which includes the org name.",
402
+ inputType: "text",
403
+ placeholder: "You've been invited to join..."
404
+ },
405
+ email_subject_security_alert: {
406
+ key: "email_subject_security_alert",
407
+ label: "Security Alert Subject",
408
+ description: 'Custom subject for new device sign-in alerts. Leave empty for the default: "New sign-in to your account".',
409
+ inputType: "text",
410
+ placeholder: "New sign-in to your account"
411
+ },
316
412
  // ============= Webhook Settings =============
317
413
  webhook_enabled: {
318
414
  key: "webhook_enabled",
@@ -875,6 +971,19 @@ const U = {
875
971
  message: "Very small withdrawals may lose significant value to fees."
876
972
  }
877
973
  },
974
+ // ============= Sidecar Shared Secrets =============
975
+ sidecar_api_key: {
976
+ key: "sidecar_api_key",
977
+ label: "Sidecar API Key",
978
+ description: "Authenticates requests from cedros-login to the login-sidecar. This value must also be set as the SIDECAR_API_KEY environment variable on the sidecar container.",
979
+ inputType: "readonlySecret"
980
+ },
981
+ note_encryption_key: {
982
+ key: "note_encryption_key",
983
+ label: "Note Encryption Key",
984
+ description: "AES-256 key for encrypting privacy cash notes (base64). This value must also be set as the NOTE_ENCRYPTION_KEY environment variable on the sidecar container.",
985
+ inputType: "readonlySecret"
986
+ },
878
987
  // ============= Post-Login Flow =============
879
988
  postlogin_redirect_url: {
880
989
  key: "postlogin_redirect_url",
@@ -926,8 +1035,281 @@ const U = {
926
1035
  label: "Show Recovery Info",
927
1036
  description: "Show wallet recovery information screen after account creation. Displays recovery phrase based on the configured recovery mode.",
928
1037
  inputType: "boolean"
1038
+ },
1039
+ // ============= Image Storage Settings =============
1040
+ image_storage_enabled: {
1041
+ key: "image_storage_enabled",
1042
+ label: "Enable Image Storage",
1043
+ description: "Enable S3-compatible object storage for user avatar uploads. When disabled, users cannot upload profile pictures.",
1044
+ inputType: "boolean"
1045
+ },
1046
+ image_storage_provider: {
1047
+ key: "image_storage_provider",
1048
+ label: "Storage Provider",
1049
+ description: "Select your S3-compatible storage provider to auto-fill endpoint and region hints.",
1050
+ inputType: "select",
1051
+ presets: [
1052
+ { label: "DigitalOcean Spaces", value: "digitalocean" },
1053
+ { label: "AWS S3", value: "s3" },
1054
+ { label: "Custom S3-Compatible", value: "custom" }
1055
+ ]
1056
+ },
1057
+ image_storage_bucket: {
1058
+ key: "image_storage_bucket",
1059
+ label: "Bucket Name",
1060
+ description: "The name of your S3 bucket or DigitalOcean Space.",
1061
+ inputType: "text",
1062
+ placeholder: "my-app-avatars"
1063
+ },
1064
+ image_storage_region: {
1065
+ key: "image_storage_region",
1066
+ label: "Region",
1067
+ description: "AWS region or DigitalOcean datacenter (e.g., us-east-1, nyc3, ams3).",
1068
+ inputType: "text",
1069
+ placeholder: "us-east-1"
1070
+ },
1071
+ image_storage_endpoint: {
1072
+ key: "image_storage_endpoint",
1073
+ label: "Endpoint URL",
1074
+ description: "S3-compatible endpoint URL. For DigitalOcean Spaces: https://{region}.digitaloceanspaces.com. Leave empty for AWS S3.",
1075
+ inputType: "text",
1076
+ placeholder: "https://nyc3.digitaloceanspaces.com"
1077
+ },
1078
+ image_storage_access_key: {
1079
+ key: "image_storage_access_key",
1080
+ label: "Access Key",
1081
+ description: "S3 access key ID or DigitalOcean Spaces access key.",
1082
+ inputType: "secret"
1083
+ },
1084
+ image_storage_secret_key: {
1085
+ key: "image_storage_secret_key",
1086
+ label: "Secret Key",
1087
+ description: "S3 secret access key or DigitalOcean Spaces secret key.",
1088
+ inputType: "secret"
1089
+ },
1090
+ image_storage_cdn_url: {
1091
+ key: "image_storage_cdn_url",
1092
+ label: "CDN URL (optional)",
1093
+ description: "Custom CDN URL prefix for serving images (e.g., https://cdn.example.com). If empty, images are served directly from the bucket URL.",
1094
+ inputType: "text",
1095
+ placeholder: "https://cdn.example.com"
1096
+ },
1097
+ // ============= KYC / Identity Verification =============
1098
+ kyc_enabled: {
1099
+ key: "kyc_enabled",
1100
+ label: "Enable KYC Verification",
1101
+ description: "Enable identity verification for users via Stripe Identity.",
1102
+ inputType: "boolean"
1103
+ },
1104
+ kyc_provider: {
1105
+ key: "kyc_provider",
1106
+ label: "KYC Provider",
1107
+ description: "Identity verification provider.",
1108
+ inputType: "select",
1109
+ presets: [{ label: "Stripe Identity", value: "stripe" }]
1110
+ },
1111
+ kyc_api_secret_key: {
1112
+ key: "kyc_api_secret_key",
1113
+ label: "Stripe Secret Key",
1114
+ description: "Stripe API secret key for Identity API calls (sk_live_... or sk_test_...).",
1115
+ inputType: "secret",
1116
+ placeholder: "sk_..."
1117
+ },
1118
+ kyc_webhook_secret: {
1119
+ key: "kyc_webhook_secret",
1120
+ label: "Webhook Signing Secret",
1121
+ description: "Stripe webhook endpoint secret for verifying webhook signatures (whsec_...).",
1122
+ inputType: "secret",
1123
+ placeholder: "whsec_..."
1124
+ },
1125
+ kyc_enforcement_mode: {
1126
+ key: "kyc_enforcement_mode",
1127
+ label: "Enforcement Mode",
1128
+ description: 'When to require KYC verification. "None" disables enforcement. "Optional" lets users verify voluntarily.',
1129
+ inputType: "select",
1130
+ presets: [
1131
+ { label: "None (disabled)", value: "none" },
1132
+ { label: "Withdrawals only", value: "withdrawals" },
1133
+ { label: "Deposits only", value: "deposits" },
1134
+ { label: "All financial operations", value: "all" },
1135
+ { label: "Optional (user choice)", value: "optional" }
1136
+ ]
1137
+ },
1138
+ kyc_expiry_days: {
1139
+ key: "kyc_expiry_days",
1140
+ label: "Verification Expiry",
1141
+ description: "How long a verification remains valid. Set to 0 for no expiry.",
1142
+ inputType: "select",
1143
+ presets: [
1144
+ { label: "Never expires", value: "0" },
1145
+ { label: "90 days", value: "90" },
1146
+ { label: "365 days", value: "365" }
1147
+ ]
1148
+ },
1149
+ kyc_redirect_url: {
1150
+ key: "kyc_redirect_url",
1151
+ label: "Return URL",
1152
+ description: "URL where users are redirected after completing Stripe Identity verification.",
1153
+ inputType: "text",
1154
+ placeholder: "https://app.example.com/kyc/callback"
1155
+ },
1156
+ kyc_document_types: {
1157
+ key: "kyc_document_types",
1158
+ label: "Accepted Document Types",
1159
+ description: "Comma-separated list of accepted document types: driving_license, id_card, passport.",
1160
+ inputType: "text",
1161
+ placeholder: "driving_license,id_card,passport"
1162
+ },
1163
+ kyc_require_selfie: {
1164
+ key: "kyc_require_selfie",
1165
+ label: "Require Selfie",
1166
+ description: "Require a selfie photo that matches the document photo for identity verification.",
1167
+ inputType: "boolean"
1168
+ },
1169
+ kyc_cumulative_deposit_usd: {
1170
+ key: "kyc_cumulative_deposit_usd",
1171
+ label: "Cumulative Deposit Threshold (USD)",
1172
+ description: "Require KYC when a user's total deposits exceed this USD amount. Set to 0 to disable. Works independently of enforcement mode.",
1173
+ inputType: "text",
1174
+ placeholder: "0",
1175
+ unit: "USD"
1176
+ },
1177
+ kyc_single_deposit_usd: {
1178
+ key: "kyc_single_deposit_usd",
1179
+ label: "Single Deposit Threshold (USD)",
1180
+ description: "Require KYC when any individual deposit exceeds this USD amount. Set to 0 to disable. Works independently of enforcement mode.",
1181
+ inputType: "text",
1182
+ placeholder: "0",
1183
+ unit: "USD"
1184
+ },
1185
+ kyc_single_purchase_usd: {
1186
+ key: "kyc_single_purchase_usd",
1187
+ label: "Single Purchase Threshold (USD)",
1188
+ description: "Require KYC when any individual credit spend/purchase exceeds this USD amount. Set to 0 to disable. Works independently of enforcement mode.",
1189
+ inputType: "text",
1190
+ placeholder: "0",
1191
+ unit: "USD"
1192
+ },
1193
+ // ============= Sanctions Screening =============
1194
+ sanctions_enabled: {
1195
+ key: "sanctions_enabled",
1196
+ label: "Enable Sanctions Screening",
1197
+ description: "Block transactions to or from wallet addresses that appear on the sanctions list fetched from the configured API URL.",
1198
+ inputType: "boolean"
1199
+ },
1200
+ sanctions_api_url: {
1201
+ key: "sanctions_api_url",
1202
+ label: "Sanctions API URL",
1203
+ description: "Base URL for the sanctions list API (e.g. <code>https://sunscreen.cedros.io</code>). The service calls <code>GET {url}/v1/lists</code>.",
1204
+ inputType: "text",
1205
+ placeholder: "https://sunscreen.cedros.io"
1206
+ },
1207
+ sanctions_refresh_interval_secs: {
1208
+ key: "sanctions_refresh_interval_secs",
1209
+ label: "Refresh Interval",
1210
+ description: "How often to re-fetch the sanctions list. Minimum 60 seconds.",
1211
+ inputType: "text",
1212
+ unit: "seconds",
1213
+ placeholder: "3600"
1214
+ },
1215
+ sanctions_geoip_header: {
1216
+ key: "sanctions_geoip_header",
1217
+ label: "GeoIP Country Header",
1218
+ description: "HTTP header containing the client's ISO country code. Common values: <code>CF-IPCountry</code> (Cloudflare), <code>X-Vercel-IP-Country</code> (Vercel). Leave empty to disable country screening.",
1219
+ inputType: "text",
1220
+ placeholder: "CF-IPCountry"
1221
+ },
1222
+ // ============= Accredited Investor Verification =============
1223
+ accreditation_enabled: {
1224
+ key: "accreditation_enabled",
1225
+ label: "Enable Accreditation Verification",
1226
+ description: "Enable accredited investor self-service verification.",
1227
+ inputType: "boolean"
1228
+ },
1229
+ accreditation_enforcement_mode: {
1230
+ key: "accreditation_enforcement_mode",
1231
+ label: "Enforcement Mode",
1232
+ description: "When to require accreditation.",
1233
+ inputType: "select",
1234
+ presets: [
1235
+ { label: "None (disabled)", value: "none" },
1236
+ { label: "Optional (user choice)", value: "optional" },
1237
+ { label: "Required", value: "required" }
1238
+ ]
1239
+ },
1240
+ accreditation_default_expiry_days_income: {
1241
+ key: "accreditation_default_expiry_days_income",
1242
+ label: "Income/Net Worth Expiry",
1243
+ description: "Default validity for income and net worth verifications.",
1244
+ inputType: "text",
1245
+ unit: "days",
1246
+ placeholder: "365"
1247
+ },
1248
+ accreditation_default_expiry_days_letter: {
1249
+ key: "accreditation_default_expiry_days_letter",
1250
+ label: "Letter Expiry",
1251
+ description: "Default validity for third-party verification letters.",
1252
+ inputType: "text",
1253
+ unit: "days",
1254
+ placeholder: "90"
1255
+ },
1256
+ accreditation_default_expiry_days_credential: {
1257
+ key: "accreditation_default_expiry_days_credential",
1258
+ label: "Credential Expiry",
1259
+ description: "Default validity for FINRA credential verifications.",
1260
+ inputType: "text",
1261
+ unit: "days",
1262
+ placeholder: "365"
1263
+ },
1264
+ accreditation_max_upload_size_mb: {
1265
+ key: "accreditation_max_upload_size_mb",
1266
+ label: "Max Upload Size",
1267
+ description: "Maximum file size per document upload.",
1268
+ inputType: "text",
1269
+ unit: "MB",
1270
+ placeholder: "10"
1271
+ },
1272
+ accreditation_income_threshold_individual: {
1273
+ key: "accreditation_income_threshold_individual",
1274
+ label: "Income Threshold (Individual)",
1275
+ description: "Annual income threshold for individual accreditation (USD).",
1276
+ inputType: "text",
1277
+ unit: "USD",
1278
+ placeholder: "200000"
1279
+ },
1280
+ accreditation_income_threshold_joint: {
1281
+ key: "accreditation_income_threshold_joint",
1282
+ label: "Income Threshold (Joint)",
1283
+ description: "Annual income threshold for joint accreditation (USD).",
1284
+ inputType: "text",
1285
+ unit: "USD",
1286
+ placeholder: "300000"
1287
+ },
1288
+ accreditation_net_worth_threshold: {
1289
+ key: "accreditation_net_worth_threshold",
1290
+ label: "Net Worth Threshold",
1291
+ description: "Net worth threshold excluding primary residence (USD).",
1292
+ inputType: "text",
1293
+ unit: "USD",
1294
+ placeholder: "1000000"
1295
+ },
1296
+ accreditation_investment_threshold_individual: {
1297
+ key: "accreditation_investment_threshold_individual",
1298
+ label: "Investment Threshold (Individual)",
1299
+ description: "Minimum investment commitment for individual simplified verification (USD).",
1300
+ inputType: "text",
1301
+ unit: "USD",
1302
+ placeholder: "200000"
1303
+ },
1304
+ accreditation_investment_threshold_entity: {
1305
+ key: "accreditation_investment_threshold_entity",
1306
+ label: "Investment Threshold (Entity)",
1307
+ description: "Minimum investment commitment for entity simplified verification (USD).",
1308
+ inputType: "text",
1309
+ unit: "USD",
1310
+ placeholder: "1000000"
929
1311
  }
930
- }, X = {
1312
+ }, ae = {
931
1313
  // Auth providers (sorted alphabetically by subcategory)
932
1314
  "auth.apple": {
933
1315
  label: "Apple Sign-In",
@@ -1009,6 +1391,11 @@ const U = {
1009
1391
  description: "Control the privacy period for deposits. Longer periods provide better timing privacy but delay fund availability.",
1010
1392
  icon: ""
1011
1393
  },
1394
+ referral: {
1395
+ label: "Referral & Payouts",
1396
+ description: "Configure referral rewards, payout triggers, and the automated payout worker.",
1397
+ icon: ""
1398
+ },
1012
1399
  rate_limit: {
1013
1400
  label: "Rate Limiting",
1014
1401
  description: "Protect the system from abuse by limiting request rates. Balance security with user experience.",
@@ -1033,8 +1420,28 @@ const U = {
1033
1420
  label: "Withdrawal Worker",
1034
1421
  description: "Configure how the automated withdrawal processor handles pending withdrawals. These settings affect throughput and privacy.",
1035
1422
  icon: ""
1423
+ },
1424
+ image_storage: {
1425
+ label: "Image Storage",
1426
+ description: "Configure S3-compatible object storage for user avatars and images.",
1427
+ icon: ""
1428
+ },
1429
+ kyc: {
1430
+ label: "KYC / Identity Verification",
1431
+ description: "Configure identity verification requirements using Stripe Identity.",
1432
+ icon: ""
1433
+ },
1434
+ sanctions: {
1435
+ label: "Sanctions Screening",
1436
+ description: "Block transactions involving wallet addresses on OFAC or custom sanctions lists.",
1437
+ icon: ""
1438
+ },
1439
+ accreditation: {
1440
+ label: "Accredited Investor Verification",
1441
+ description: "Configure accredited investor verification requirements and thresholds per SEC Regulation D.",
1442
+ icon: ""
1036
1443
  }
1037
- }, A = [
1444
+ }, R = [
1038
1445
  "SOL",
1039
1446
  "USDC",
1040
1447
  "USDT",
@@ -1046,322 +1453,324 @@ const U = {
1046
1453
  "BONK",
1047
1454
  "ORE"
1048
1455
  ];
1049
- function N(e) {
1050
- const l = e.split(/(<a\s[^>]*>.*?<\/a>)/g);
1051
- return l.length === 1 ? e : l.map((a, n) => {
1052
- const s = a.match(/^<a\s+href="([^"]+)"[^>]*>([^<]+)<\/a>$/);
1053
- return s ? /* @__PURE__ */ t("a", { href: s[1], target: "_blank", rel: "noopener noreferrer", children: s[2] }, n) : a;
1456
+ function A(t) {
1457
+ const i = t.split(/(<a\s[^>]*>.*?<\/a>)/g);
1458
+ return i.length === 1 ? t : i.map((a, n) => {
1459
+ const r = a.match(/^<a\s+href="([^"]+)"[^>]*>([^<]+)<\/a>$/);
1460
+ return r ? /* @__PURE__ */ e("a", { href: r[1], target: "_blank", rel: "noopener noreferrer", children: r[2] }, n) : a;
1054
1461
  });
1055
1462
  }
1056
- function Q({
1057
- settings: e,
1058
- edits: l,
1463
+ function ie({
1464
+ settings: t,
1465
+ edits: i,
1059
1466
  onChange: a,
1060
1467
  externalWarnings: n
1061
1468
  }) {
1062
- return /* @__PURE__ */ t("div", { className: "cedros-settings-grid", children: e.map((s) => /* @__PURE__ */ t(
1063
- M,
1469
+ return /* @__PURE__ */ e("div", { className: "cedros-settings-grid", children: t.map((r) => /* @__PURE__ */ e(
1470
+ j,
1064
1471
  {
1065
- setting: s,
1066
- editValue: l[s.key],
1472
+ setting: r,
1473
+ editValue: i[r.key],
1067
1474
  onChange: a,
1068
- externalWarning: n?.[s.key]
1475
+ externalWarning: n?.[r.key]
1069
1476
  },
1070
- s.key
1477
+ r.key
1071
1478
  )) });
1072
1479
  }
1073
- function M({ setting: e, editValue: l, onChange: a, externalWarning: n }) {
1074
- const s = U[e.key], i = l ?? e.value, p = l !== void 0 && l !== e.value, o = s?.inputType === "boolean", r = S(() => {
1480
+ function j({ setting: t, editValue: i, onChange: a, externalWarning: n }) {
1481
+ const r = W[t.key], s = i ?? t.value, p = i !== void 0 && i !== t.value, l = r?.inputType === "boolean", o = N(() => {
1075
1482
  if (n) return n;
1076
- if (!s?.warningThreshold) return null;
1077
- const c = parseInt(i, 10);
1483
+ if (!r?.warningThreshold) return null;
1484
+ const c = parseInt(s, 10);
1078
1485
  if (isNaN(c)) return null;
1079
- const { above: m, below: y, message: _ } = s.warningThreshold;
1080
- return m !== void 0 && c > m || y !== void 0 && c < y ? _ : null;
1081
- }, [i, s?.warningThreshold, n]);
1082
- return s ? /* @__PURE__ */ t(
1486
+ const { above: y, below: b, message: _ } = r.warningThreshold;
1487
+ return y !== void 0 && c > y || b !== void 0 && c < b ? _ : null;
1488
+ }, [s, r?.warningThreshold, n]);
1489
+ return r ? /* @__PURE__ */ e(
1083
1490
  "div",
1084
1491
  {
1085
- className: `cedros-setting-row ${p ? "cedros-setting-row-changed" : ""} ${r ? "cedros-setting-row-warning" : ""} ${o ? "cedros-setting-row-toggle" : ""}`,
1086
- children: o ? /* @__PURE__ */ u(f, { children: [
1087
- /* @__PURE__ */ u("div", { className: "cedros-setting-control cedros-setting-control-toggle", children: [
1088
- /* @__PURE__ */ t(
1089
- x,
1492
+ className: `cedros-setting-row ${p ? "cedros-setting-row-changed" : ""} ${o ? "cedros-setting-row-warning" : ""} ${l ? "cedros-setting-row-toggle" : ""}`,
1493
+ children: l ? /* @__PURE__ */ d(T, { children: [
1494
+ /* @__PURE__ */ d("div", { className: "cedros-setting-control cedros-setting-control-toggle", children: [
1495
+ /* @__PURE__ */ e(
1496
+ L,
1090
1497
  {
1091
- meta: s,
1092
- value: i,
1093
- onChange: (c) => a(e.key, c)
1498
+ meta: r,
1499
+ value: s,
1500
+ onChange: (c) => a(t.key, c)
1094
1501
  }
1095
1502
  ),
1096
- r && /* @__PURE__ */ t("div", { className: "cedros-setting-warning", children: r })
1503
+ o && /* @__PURE__ */ e("div", { className: "cedros-setting-warning", children: o })
1097
1504
  ] }),
1098
- /* @__PURE__ */ u("div", { className: "cedros-setting-label", children: [
1099
- /* @__PURE__ */ t("span", { className: "cedros-setting-name", children: s.label }),
1100
- /* @__PURE__ */ t("span", { className: "cedros-setting-description", children: N(s.description) })
1505
+ /* @__PURE__ */ d("div", { className: "cedros-setting-label", children: [
1506
+ /* @__PURE__ */ e("span", { className: "cedros-setting-name", children: r.label }),
1507
+ /* @__PURE__ */ e("span", { className: "cedros-setting-description", children: A(r.description) })
1101
1508
  ] })
1102
- ] }) : /* @__PURE__ */ u(f, { children: [
1103
- /* @__PURE__ */ u("div", { className: "cedros-setting-label", children: [
1104
- /* @__PURE__ */ t("span", { className: "cedros-setting-name", children: s.label }),
1105
- /* @__PURE__ */ t("span", { className: "cedros-setting-description", children: N(s.description) })
1509
+ ] }) : /* @__PURE__ */ d(T, { children: [
1510
+ /* @__PURE__ */ d("div", { className: "cedros-setting-label", children: [
1511
+ /* @__PURE__ */ e("span", { className: "cedros-setting-name", children: r.label }),
1512
+ /* @__PURE__ */ e("span", { className: "cedros-setting-description", children: A(r.description) })
1106
1513
  ] }),
1107
- /* @__PURE__ */ u("div", { className: "cedros-setting-control", children: [
1108
- /* @__PURE__ */ t(
1109
- x,
1514
+ /* @__PURE__ */ d("div", { className: "cedros-setting-control", children: [
1515
+ /* @__PURE__ */ e(
1516
+ L,
1110
1517
  {
1111
- meta: s,
1112
- value: i,
1113
- onChange: (c) => a(e.key, c)
1518
+ meta: r,
1519
+ value: s,
1520
+ onChange: (c) => a(t.key, c)
1114
1521
  }
1115
1522
  ),
1116
- r && /* @__PURE__ */ t("div", { className: "cedros-setting-warning", children: r })
1523
+ o && /* @__PURE__ */ e("div", { className: "cedros-setting-warning", children: o })
1117
1524
  ] })
1118
1525
  ] })
1119
1526
  }
1120
- ) : /* @__PURE__ */ u("div", { className: `cedros-setting-row ${p ? "cedros-setting-row-changed" : ""}`, children: [
1121
- /* @__PURE__ */ u("div", { className: "cedros-setting-label", children: [
1122
- /* @__PURE__ */ t("span", { className: "cedros-setting-name", children: e.key }),
1123
- e.description && /* @__PURE__ */ t("span", { className: "cedros-setting-description", children: e.description })
1527
+ ) : /* @__PURE__ */ d("div", { className: `cedros-setting-row ${p ? "cedros-setting-row-changed" : ""}`, children: [
1528
+ /* @__PURE__ */ d("div", { className: "cedros-setting-label", children: [
1529
+ /* @__PURE__ */ e("span", { className: "cedros-setting-name", children: t.key }),
1530
+ t.description && /* @__PURE__ */ e("span", { className: "cedros-setting-description", children: t.description })
1124
1531
  ] }),
1125
- /* @__PURE__ */ t("div", { className: "cedros-setting-input-wrapper", children: /* @__PURE__ */ t(
1532
+ /* @__PURE__ */ e("div", { className: "cedros-setting-input-wrapper", children: /* @__PURE__ */ e(
1126
1533
  "input",
1127
1534
  {
1128
1535
  type: "text",
1129
- value: i,
1130
- onChange: (c) => a(e.key, c.target.value),
1536
+ value: s,
1537
+ onChange: (c) => a(t.key, c.target.value),
1131
1538
  className: "cedros-setting-input"
1132
1539
  }
1133
1540
  ) })
1134
1541
  ] });
1135
1542
  }
1136
- function x({ meta: e, value: l, onChange: a }) {
1137
- switch (e.inputType) {
1543
+ function L({ meta: t, value: i, onChange: a }) {
1544
+ switch (t.inputType) {
1138
1545
  case "duration":
1139
- return /* @__PURE__ */ t(W, { value: l, onChange: a, presets: e.presets, min: e.min });
1546
+ return /* @__PURE__ */ e(F, { value: i, onChange: a, presets: t.presets, min: t.min });
1140
1547
  case "percentage":
1141
- return /* @__PURE__ */ t(
1142
- q,
1548
+ return /* @__PURE__ */ e(
1549
+ $,
1143
1550
  {
1144
- value: l,
1551
+ value: i,
1145
1552
  onChange: a,
1146
- min: e.min ?? 1,
1147
- max: e.max ?? 100,
1148
- step: e.step ?? 5,
1149
- presets: e.presets
1553
+ min: t.min ?? 1,
1554
+ max: t.max ?? 100,
1555
+ step: t.step ?? 5,
1556
+ presets: t.presets
1150
1557
  }
1151
1558
  );
1152
1559
  case "select":
1153
- return /* @__PURE__ */ t(
1154
- F,
1560
+ return /* @__PURE__ */ e(
1561
+ V,
1155
1562
  {
1156
- value: l,
1563
+ value: i,
1157
1564
  onChange: a,
1158
- presets: e.presets ?? [],
1159
- unit: e.unit
1565
+ presets: t.presets ?? [],
1566
+ unit: t.unit
1160
1567
  }
1161
1568
  );
1162
1569
  case "number":
1163
- return /* @__PURE__ */ t(
1164
- $,
1570
+ return /* @__PURE__ */ e(
1571
+ B,
1165
1572
  {
1166
- value: l,
1573
+ value: i,
1167
1574
  onChange: a,
1168
- min: e.min,
1169
- max: e.max,
1170
- unit: e.unit
1575
+ min: t.min,
1576
+ max: t.max,
1577
+ unit: t.unit
1171
1578
  }
1172
1579
  );
1173
1580
  case "tokenList":
1174
- return /* @__PURE__ */ t(B, { value: l, onChange: a });
1581
+ return /* @__PURE__ */ e(J, { value: i, onChange: a });
1175
1582
  case "text":
1176
- return /* @__PURE__ */ t(
1583
+ return /* @__PURE__ */ e(
1177
1584
  "input",
1178
1585
  {
1179
1586
  type: "text",
1180
- value: l,
1587
+ value: i,
1181
1588
  onChange: (n) => a(n.target.value),
1182
1589
  className: "cedros-setting-input",
1183
- placeholder: e.label
1590
+ placeholder: t.label
1184
1591
  }
1185
1592
  );
1186
1593
  case "boolean":
1187
- return /* @__PURE__ */ t(j, { value: l, onChange: a });
1594
+ return /* @__PURE__ */ e(H, { value: i, onChange: a });
1188
1595
  case "secret":
1189
- return /* @__PURE__ */ t(J, { value: l, onChange: a, multiline: e.multiline });
1596
+ return /* @__PURE__ */ e(K, { value: i, onChange: a, multiline: t.multiline });
1597
+ case "readonlySecret":
1598
+ return /* @__PURE__ */ e(G, { settingKey: t.key, value: i });
1190
1599
  case "tokenSymbolList":
1191
- return /* @__PURE__ */ t(G, { value: l, onChange: a });
1600
+ return /* @__PURE__ */ e(z, { value: i, onChange: a });
1192
1601
  default:
1193
- return /* @__PURE__ */ t(
1602
+ return /* @__PURE__ */ e(
1194
1603
  "input",
1195
1604
  {
1196
1605
  type: "text",
1197
- value: l,
1606
+ value: i,
1198
1607
  onChange: (n) => a(n.target.value),
1199
1608
  className: "cedros-setting-input"
1200
1609
  }
1201
1610
  );
1202
1611
  }
1203
1612
  }
1204
- function W({ value: e, onChange: l, presets: a, min: n = 0 }) {
1205
- const s = parseInt(e, 10) || 0, i = I(s), p = d(
1206
- (r) => {
1207
- r.target.value && l(r.target.value);
1613
+ function F({ value: t, onChange: i, presets: a, min: n = 0 }) {
1614
+ const r = parseInt(t, 10) || 0, s = q(r), p = m(
1615
+ (o) => {
1616
+ o.target.value && i(o.target.value);
1208
1617
  },
1209
- [l]
1210
- ), o = d(
1211
- (r) => {
1212
- const c = Math.max(n, parseInt(r.target.value, 10) || 0);
1213
- l(String(c));
1618
+ [i]
1619
+ ), l = m(
1620
+ (o) => {
1621
+ const c = Math.max(n, parseInt(o.target.value, 10) || 0);
1622
+ i(String(c));
1214
1623
  },
1215
- [l, n]
1624
+ [i, n]
1216
1625
  );
1217
- return /* @__PURE__ */ u("div", { className: "cedros-duration-input", children: [
1218
- a && a.length > 0 && /* @__PURE__ */ u(
1626
+ return /* @__PURE__ */ d("div", { className: "cedros-duration-input", children: [
1627
+ a && a.length > 0 && /* @__PURE__ */ d(
1219
1628
  "select",
1220
1629
  {
1221
- value: a.find((r) => r.value === e)?.value ?? "",
1630
+ value: a.find((o) => o.value === t)?.value ?? "",
1222
1631
  onChange: p,
1223
1632
  className: "cedros-setting-select",
1224
1633
  children: [
1225
- /* @__PURE__ */ t("option", { value: "", children: "Custom..." }),
1226
- a.map((r) => /* @__PURE__ */ t("option", { value: r.value, children: r.label }, r.value))
1634
+ /* @__PURE__ */ e("option", { value: "", children: "Custom..." }),
1635
+ a.map((o) => /* @__PURE__ */ e("option", { value: o.value, children: o.label }, o.value))
1227
1636
  ]
1228
1637
  }
1229
1638
  ),
1230
- /* @__PURE__ */ u("div", { className: "cedros-duration-custom", children: [
1231
- /* @__PURE__ */ t(
1639
+ /* @__PURE__ */ d("div", { className: "cedros-duration-custom", children: [
1640
+ /* @__PURE__ */ e(
1232
1641
  "input",
1233
1642
  {
1234
1643
  type: "number",
1235
- value: s,
1236
- onChange: o,
1644
+ value: r,
1645
+ onChange: l,
1237
1646
  min: n,
1238
1647
  className: "cedros-setting-input cedros-setting-input-sm"
1239
1648
  }
1240
1649
  ),
1241
- /* @__PURE__ */ t("span", { className: "cedros-setting-unit", children: "seconds" }),
1242
- /* @__PURE__ */ u("span", { className: "cedros-duration-display", children: [
1650
+ /* @__PURE__ */ e("span", { className: "cedros-setting-unit", children: "seconds" }),
1651
+ /* @__PURE__ */ d("span", { className: "cedros-duration-display", children: [
1243
1652
  "= ",
1244
- i
1653
+ s
1245
1654
  ] })
1246
1655
  ] })
1247
1656
  ] });
1248
1657
  }
1249
- function q({
1250
- value: e,
1251
- onChange: l,
1658
+ function $({
1659
+ value: t,
1660
+ onChange: i,
1252
1661
  min: a,
1253
1662
  max: n,
1254
- step: s,
1255
- presets: i
1663
+ step: r,
1664
+ presets: s
1256
1665
  }) {
1257
- const p = parseInt(e, 10) || a, o = d(
1666
+ const p = parseInt(t, 10) || a, l = m(
1258
1667
  (c) => {
1259
- l(c.target.value);
1668
+ i(c.target.value);
1260
1669
  },
1261
- [l]
1262
- ), r = d(
1670
+ [i]
1671
+ ), o = m(
1263
1672
  (c) => {
1264
- l(c);
1673
+ i(c);
1265
1674
  },
1266
- [l]
1675
+ [i]
1267
1676
  );
1268
- return /* @__PURE__ */ u("div", { className: "cedros-percentage-input", children: [
1269
- /* @__PURE__ */ u("div", { className: "cedros-percentage-slider-row", children: [
1270
- /* @__PURE__ */ t(
1677
+ return /* @__PURE__ */ d("div", { className: "cedros-percentage-input", children: [
1678
+ /* @__PURE__ */ d("div", { className: "cedros-percentage-slider-row", children: [
1679
+ /* @__PURE__ */ e(
1271
1680
  "input",
1272
1681
  {
1273
1682
  type: "range",
1274
1683
  value: p,
1275
- onChange: o,
1684
+ onChange: l,
1276
1685
  min: a,
1277
1686
  max: n,
1278
- step: s,
1687
+ step: r,
1279
1688
  className: "cedros-percentage-slider"
1280
1689
  }
1281
1690
  ),
1282
- /* @__PURE__ */ u("span", { className: "cedros-percentage-value", children: [
1691
+ /* @__PURE__ */ d("span", { className: "cedros-percentage-value", children: [
1283
1692
  p,
1284
1693
  "%"
1285
1694
  ] })
1286
1695
  ] }),
1287
- i && i.length > 0 && /* @__PURE__ */ t("div", { className: "cedros-preset-buttons", children: i.map((c) => /* @__PURE__ */ t(
1696
+ s && s.length > 0 && /* @__PURE__ */ e("div", { className: "cedros-preset-buttons", children: s.map((c) => /* @__PURE__ */ e(
1288
1697
  "button",
1289
1698
  {
1290
1699
  type: "button",
1291
- className: `cedros-preset-button ${c.value === e ? "cedros-preset-button-active" : ""}`,
1292
- onClick: () => r(c.value),
1700
+ className: `cedros-preset-button ${c.value === t ? "cedros-preset-button-active" : ""}`,
1701
+ onClick: () => o(c.value),
1293
1702
  children: c.label
1294
1703
  },
1295
1704
  c.value
1296
1705
  )) })
1297
1706
  ] });
1298
1707
  }
1299
- function F({ value: e, onChange: l, presets: a, unit: n }) {
1300
- const s = !a.some((o) => o.value === e), i = d(
1301
- (o) => {
1302
- o.target.value !== "__custom__" && l(o.target.value);
1708
+ function V({ value: t, onChange: i, presets: a, unit: n }) {
1709
+ const r = !a.some((l) => l.value === t), s = m(
1710
+ (l) => {
1711
+ l.target.value !== "__custom__" && i(l.target.value);
1303
1712
  },
1304
- [l]
1305
- ), p = d(
1306
- (o) => {
1307
- l(o.target.value);
1713
+ [i]
1714
+ ), p = m(
1715
+ (l) => {
1716
+ i(l.target.value);
1308
1717
  },
1309
- [l]
1718
+ [i]
1310
1719
  );
1311
- return /* @__PURE__ */ u("div", { className: "cedros-select-input", children: [
1312
- /* @__PURE__ */ u(
1720
+ return /* @__PURE__ */ d("div", { className: "cedros-select-input", children: [
1721
+ /* @__PURE__ */ d(
1313
1722
  "select",
1314
1723
  {
1315
- value: s ? "__custom__" : e,
1316
- onChange: i,
1724
+ value: r ? "__custom__" : t,
1725
+ onChange: s,
1317
1726
  className: "cedros-setting-select",
1318
1727
  children: [
1319
- a.map((o) => /* @__PURE__ */ t("option", { value: o.value, children: o.label }, o.value)),
1320
- /* @__PURE__ */ t("option", { value: "__custom__", children: "Custom..." })
1728
+ a.map((l) => /* @__PURE__ */ e("option", { value: l.value, children: l.label }, l.value)),
1729
+ /* @__PURE__ */ e("option", { value: "__custom__", children: "Custom..." })
1321
1730
  ]
1322
1731
  }
1323
1732
  ),
1324
- s && /* @__PURE__ */ u("div", { className: "cedros-select-custom", children: [
1325
- /* @__PURE__ */ t(
1733
+ r && /* @__PURE__ */ d("div", { className: "cedros-select-custom", children: [
1734
+ /* @__PURE__ */ e(
1326
1735
  "input",
1327
1736
  {
1328
1737
  type: "number",
1329
- value: e,
1738
+ value: t,
1330
1739
  onChange: p,
1331
1740
  className: "cedros-setting-input cedros-setting-input-sm"
1332
1741
  }
1333
1742
  ),
1334
- n && /* @__PURE__ */ t("span", { className: "cedros-setting-unit", children: n })
1743
+ n && /* @__PURE__ */ e("span", { className: "cedros-setting-unit", children: n })
1335
1744
  ] })
1336
1745
  ] });
1337
1746
  }
1338
- function $({ value: e, onChange: l, min: a, max: n, unit: s }) {
1339
- const i = d(
1747
+ function B({ value: t, onChange: i, min: a, max: n, unit: r }) {
1748
+ const s = m(
1340
1749
  (p) => {
1341
- l(p.target.value);
1750
+ i(p.target.value);
1342
1751
  },
1343
- [l]
1752
+ [i]
1344
1753
  );
1345
- return /* @__PURE__ */ u("div", { className: "cedros-number-input", children: [
1346
- /* @__PURE__ */ t(
1754
+ return /* @__PURE__ */ d("div", { className: "cedros-number-input", children: [
1755
+ /* @__PURE__ */ e(
1347
1756
  "input",
1348
1757
  {
1349
1758
  type: "number",
1350
- value: e,
1351
- onChange: i,
1759
+ value: t,
1760
+ onChange: s,
1352
1761
  min: a,
1353
1762
  max: n,
1354
1763
  className: "cedros-setting-input"
1355
1764
  }
1356
1765
  ),
1357
- s && /* @__PURE__ */ t("span", { className: "cedros-setting-unit", children: s })
1766
+ r && /* @__PURE__ */ e("span", { className: "cedros-setting-unit", children: r })
1358
1767
  ] });
1359
1768
  }
1360
- function j({ value: e, onChange: l }) {
1361
- const a = e === "true", n = d(() => {
1362
- l(a ? "false" : "true");
1363
- }, [a, l]);
1364
- return /* @__PURE__ */ u(
1769
+ function H({ value: t, onChange: i }) {
1770
+ const a = t === "true", n = m(() => {
1771
+ i(a ? "false" : "true");
1772
+ }, [a, i]);
1773
+ return /* @__PURE__ */ d(
1365
1774
  "button",
1366
1775
  {
1367
1776
  type: "button",
@@ -1370,286 +1779,356 @@ function j({ value: e, onChange: l }) {
1370
1779
  className: `cedros-toggle ${a ? "cedros-toggle-on" : "cedros-toggle-off"}`,
1371
1780
  onClick: n,
1372
1781
  children: [
1373
- /* @__PURE__ */ t("span", { className: "cedros-toggle-track", children: /* @__PURE__ */ t("span", { className: "cedros-toggle-thumb" }) }),
1374
- /* @__PURE__ */ t("span", { className: "cedros-toggle-label", children: a ? "Enabled" : "Disabled" })
1782
+ /* @__PURE__ */ e("span", { className: "cedros-toggle-track", children: /* @__PURE__ */ e("span", { className: "cedros-toggle-thumb" }) }),
1783
+ /* @__PURE__ */ e("span", { className: "cedros-toggle-label", children: a ? "Enabled" : "Disabled" })
1375
1784
  ]
1376
1785
  }
1377
1786
  );
1378
1787
  }
1379
- function J({ value: e, onChange: l, multiline: a }) {
1380
- const [n, s] = w(!1), [i, p] = w(!1), o = e && e.length > 0, r = d(() => {
1381
- s(!0), p(!0);
1382
- }, []), c = d(() => {
1383
- s(!1), p(!1);
1384
- }, []), m = d(
1385
- (y) => {
1386
- l(y.target.value);
1788
+ function K({ value: t, onChange: i, multiline: a }) {
1789
+ const [n, r] = f(!1), [s, p] = f(!1), l = t && t.length > 0, o = m(() => {
1790
+ r(!0), p(!0);
1791
+ }, []), c = m(() => {
1792
+ r(!1), p(!1);
1793
+ }, []), y = m(
1794
+ (b) => {
1795
+ i(b.target.value);
1387
1796
  },
1388
- [l]
1797
+ [i]
1389
1798
  );
1390
- return !n && o ? /* @__PURE__ */ u("div", { className: "cedros-secret-input cedros-secret-input-masked", children: [
1391
- /* @__PURE__ */ t("span", { className: "cedros-secret-masked", children: "•".repeat(Math.min(e.length, 20)) }),
1392
- /* @__PURE__ */ t("button", { type: "button", className: "cedros-secret-edit-btn", onClick: r, children: "Edit" })
1393
- ] }) : /* @__PURE__ */ u("div", { className: "cedros-secret-input", children: [
1394
- a ? /* @__PURE__ */ t(
1799
+ return !n && l ? /* @__PURE__ */ d("div", { className: "cedros-secret-input cedros-secret-input-masked", children: [
1800
+ /* @__PURE__ */ e("span", { className: "cedros-secret-masked", children: "•".repeat(Math.min(t.length, 20)) }),
1801
+ /* @__PURE__ */ e("button", { type: "button", className: "cedros-secret-edit-btn", onClick: o, children: "Edit" })
1802
+ ] }) : /* @__PURE__ */ d("div", { className: "cedros-secret-input", children: [
1803
+ a ? /* @__PURE__ */ e(
1395
1804
  "textarea",
1396
1805
  {
1397
- value: e,
1398
- onChange: m,
1806
+ value: t,
1807
+ onChange: y,
1399
1808
  className: "cedros-setting-input cedros-setting-textarea",
1400
1809
  placeholder: "Enter secret value...",
1401
1810
  rows: 4
1402
1811
  }
1403
- ) : /* @__PURE__ */ t(
1812
+ ) : /* @__PURE__ */ e(
1404
1813
  "input",
1405
1814
  {
1406
- type: i ? "text" : "password",
1407
- value: e,
1408
- onChange: m,
1815
+ type: s ? "text" : "password",
1816
+ value: t,
1817
+ onChange: y,
1409
1818
  className: "cedros-setting-input",
1410
1819
  placeholder: "Enter secret value..."
1411
1820
  }
1412
1821
  ),
1413
- /* @__PURE__ */ u("div", { className: "cedros-secret-actions", children: [
1414
- !a && /* @__PURE__ */ t(
1822
+ /* @__PURE__ */ d("div", { className: "cedros-secret-actions", children: [
1823
+ !a && /* @__PURE__ */ e(
1415
1824
  "button",
1416
1825
  {
1417
1826
  type: "button",
1418
1827
  className: "cedros-secret-toggle-btn",
1419
- onClick: () => p(!i),
1420
- children: i ? "Hide" : "Show"
1828
+ onClick: () => p(!s),
1829
+ children: s ? "Hide" : "Show"
1421
1830
  }
1422
1831
  ),
1423
- n && /* @__PURE__ */ t("button", { type: "button", className: "cedros-secret-done-btn", onClick: c, children: "Done" })
1832
+ n && /* @__PURE__ */ e("button", { type: "button", className: "cedros-secret-done-btn", onClick: c, children: "Done" })
1424
1833
  ] })
1425
1834
  ] });
1426
1835
  }
1427
- function B({ value: e, onChange: l }) {
1428
- const a = S(() => {
1836
+ function G({ settingKey: t, value: i }) {
1837
+ const [a, n] = f(null), [r, s] = f(!1), [p, l] = f(!1), [o, c] = f(null), [y, b] = f(!1), { config: _, _internal: w } = U(), v = a ?? i, x = v && v.length > 0, C = x && !a, h = m(async () => {
1838
+ if (v)
1839
+ try {
1840
+ await navigator.clipboard.writeText(v), s(!0), setTimeout(() => s(!1), 2e3);
1841
+ } catch {
1842
+ const u = document.createElement("textarea");
1843
+ u.value = v, document.body.appendChild(u), u.select(), document.execCommand("copy"), document.body.removeChild(u), s(!0), setTimeout(() => s(!1), 2e3);
1844
+ }
1845
+ }, [v]), k = m(async () => {
1846
+ l(!0), c(null);
1429
1847
  try {
1430
- return JSON.parse(e || "[]");
1848
+ const u = w?.getAccessToken?.(), g = { "Content-Type": "application/json" };
1849
+ u && (g.Authorization = `Bearer ${u}`);
1850
+ const S = await fetch(
1851
+ `${_.serverUrl}/auth/admin/settings/regenerate/${t}`,
1852
+ { method: "POST", headers: g, credentials: "include" }
1853
+ );
1854
+ if (!S.ok) {
1855
+ const D = await S.json().catch(() => null);
1856
+ throw new Error(D?.message || D?.error || `Regenerate failed (${S.status})`);
1857
+ }
1858
+ const E = await S.json();
1859
+ n(E.value), b(!1);
1860
+ } catch (u) {
1861
+ c(u instanceof Error ? u.message : "Failed to regenerate");
1862
+ } finally {
1863
+ l(!1);
1864
+ }
1865
+ }, [_.serverUrl, w, t]);
1866
+ return /* @__PURE__ */ d("div", { className: "cedros-readonly-secret", children: [
1867
+ /* @__PURE__ */ e("div", { className: "cedros-readonly-secret-value", children: C ? /* @__PURE__ */ e("span", { className: "cedros-secret-masked", children: "•".repeat(20) }) : x ? /* @__PURE__ */ e("code", { className: "cedros-readonly-secret-code", children: v }) : /* @__PURE__ */ e("span", { className: "cedros-readonly-secret-empty", children: "Not generated yet" }) }),
1868
+ /* @__PURE__ */ d("div", { className: "cedros-readonly-secret-actions", children: [
1869
+ x && /* @__PURE__ */ e("button", { type: "button", className: "cedros-secret-action-btn", onClick: h, children: r ? "Copied!" : "Copy" }),
1870
+ y ? /* @__PURE__ */ d("span", { className: "cedros-readonly-secret-confirm", children: [
1871
+ /* @__PURE__ */ e("span", { className: "cedros-readonly-secret-confirm-text", children: "Update deploy secret too?" }),
1872
+ /* @__PURE__ */ e(
1873
+ "button",
1874
+ {
1875
+ type: "button",
1876
+ className: "cedros-secret-action-btn cedros-secret-action-btn--danger",
1877
+ onClick: k,
1878
+ disabled: p,
1879
+ children: p ? "Regenerating..." : "Confirm"
1880
+ }
1881
+ ),
1882
+ /* @__PURE__ */ e(
1883
+ "button",
1884
+ {
1885
+ type: "button",
1886
+ className: "cedros-secret-action-btn",
1887
+ onClick: () => b(!1),
1888
+ disabled: p,
1889
+ children: "Cancel"
1890
+ }
1891
+ )
1892
+ ] }) : /* @__PURE__ */ e(
1893
+ "button",
1894
+ {
1895
+ type: "button",
1896
+ className: "cedros-secret-action-btn cedros-secret-action-btn--danger",
1897
+ onClick: () => b(!0),
1898
+ disabled: p,
1899
+ children: "Regenerate"
1900
+ }
1901
+ )
1902
+ ] }),
1903
+ o && /* @__PURE__ */ e("p", { className: "cedros-readonly-secret-error", children: o })
1904
+ ] });
1905
+ }
1906
+ function J({ value: t, onChange: i }) {
1907
+ const a = N(() => {
1908
+ try {
1909
+ return JSON.parse(t || "[]");
1431
1910
  } catch {
1432
1911
  return [];
1433
1912
  }
1434
- }, [e]), n = d(
1435
- (o) => {
1436
- l(JSON.stringify(o));
1913
+ }, [t]), n = m(
1914
+ (l) => {
1915
+ i(JSON.stringify(l));
1437
1916
  },
1438
- [l]
1439
- ), s = d(() => {
1917
+ [i]
1918
+ ), r = m(() => {
1440
1919
  n([...a, { symbol: "", mint: "", decimals: 6 }]);
1441
- }, [a, n]), i = d(
1442
- (o, r, c) => {
1443
- const m = [...a];
1444
- m[o] = { ...m[o], [r]: c }, n(m);
1920
+ }, [a, n]), s = m(
1921
+ (l, o, c) => {
1922
+ const y = [...a];
1923
+ y[l] = { ...y[l], [o]: c }, n(y);
1445
1924
  },
1446
1925
  [a, n]
1447
- ), p = d(
1448
- (o) => {
1449
- n(a.filter((r, c) => c !== o));
1926
+ ), p = m(
1927
+ (l) => {
1928
+ n(a.filter((o, c) => c !== l));
1450
1929
  },
1451
1930
  [a, n]
1452
1931
  );
1453
- return /* @__PURE__ */ u("div", { className: "cedros-token-list-input", children: [
1454
- /* @__PURE__ */ u("div", { className: "cedros-token-presets", children: [
1455
- /* @__PURE__ */ t("span", { className: "cedros-token-presets-label", children: "Built-in tokens:" }),
1456
- /* @__PURE__ */ t("div", { className: "cedros-token-presets-list", children: A.map((o) => /* @__PURE__ */ t("span", { className: "cedros-token-preset-chip", children: o }, o)) })
1932
+ return /* @__PURE__ */ d("div", { className: "cedros-token-list-input", children: [
1933
+ /* @__PURE__ */ d("div", { className: "cedros-token-presets", children: [
1934
+ /* @__PURE__ */ e("span", { className: "cedros-token-presets-label", children: "Built-in tokens:" }),
1935
+ /* @__PURE__ */ e("div", { className: "cedros-token-presets-list", children: R.map((l) => /* @__PURE__ */ e("span", { className: "cedros-token-preset-chip", children: l }, l)) })
1457
1936
  ] }),
1458
- a.length === 0 && /* @__PURE__ */ t("p", { className: "cedros-token-list-empty", children: "No custom tokens added. Use the built-in tokens above or add your own." }),
1459
- a.map((o, r) => /* @__PURE__ */ u("div", { className: "cedros-token-row", children: [
1460
- /* @__PURE__ */ u("div", { className: "cedros-token-row-fields", children: [
1461
- /* @__PURE__ */ t(
1937
+ a.length === 0 && /* @__PURE__ */ e("p", { className: "cedros-token-list-empty", children: "No custom tokens added. Use the built-in tokens above or add your own." }),
1938
+ a.map((l, o) => /* @__PURE__ */ d("div", { className: "cedros-token-row", children: [
1939
+ /* @__PURE__ */ d("div", { className: "cedros-token-row-fields", children: [
1940
+ /* @__PURE__ */ e(
1462
1941
  "input",
1463
1942
  {
1464
1943
  type: "text",
1465
1944
  placeholder: "Symbol",
1466
- value: o.symbol,
1467
- onChange: (c) => i(r, "symbol", c.target.value.toUpperCase()),
1945
+ value: l.symbol,
1946
+ onChange: (c) => s(o, "symbol", c.target.value.toUpperCase()),
1468
1947
  className: "cedros-setting-input cedros-token-input-symbol",
1469
1948
  maxLength: 10
1470
1949
  }
1471
1950
  ),
1472
- /* @__PURE__ */ t(
1951
+ /* @__PURE__ */ e(
1473
1952
  "input",
1474
1953
  {
1475
1954
  type: "text",
1476
1955
  placeholder: "Mint address",
1477
- value: o.mint,
1478
- onChange: (c) => i(r, "mint", c.target.value),
1956
+ value: l.mint,
1957
+ onChange: (c) => s(o, "mint", c.target.value),
1479
1958
  className: "cedros-setting-input cedros-token-input-mint"
1480
1959
  }
1481
1960
  ),
1482
- /* @__PURE__ */ t(
1961
+ /* @__PURE__ */ e(
1483
1962
  "input",
1484
1963
  {
1485
1964
  type: "number",
1486
1965
  placeholder: "Decimals",
1487
- value: o.decimals,
1488
- onChange: (c) => i(r, "decimals", parseInt(c.target.value, 10) || 0),
1966
+ value: l.decimals,
1967
+ onChange: (c) => s(o, "decimals", parseInt(c.target.value, 10) || 0),
1489
1968
  className: "cedros-setting-input cedros-token-input-decimals",
1490
1969
  min: 0,
1491
1970
  max: 18
1492
1971
  }
1493
1972
  ),
1494
- /* @__PURE__ */ t(
1973
+ /* @__PURE__ */ e(
1495
1974
  "input",
1496
1975
  {
1497
1976
  type: "text",
1498
1977
  placeholder: "Logo URL (optional)",
1499
- value: o.logoUrl || "",
1500
- onChange: (c) => i(r, "logoUrl", c.target.value || void 0),
1978
+ value: l.logoUrl || "",
1979
+ onChange: (c) => s(o, "logoUrl", c.target.value || void 0),
1501
1980
  className: "cedros-setting-input cedros-token-input-logo"
1502
1981
  }
1503
1982
  )
1504
1983
  ] }),
1505
- /* @__PURE__ */ t(
1984
+ /* @__PURE__ */ e(
1506
1985
  "button",
1507
1986
  {
1508
1987
  type: "button",
1509
1988
  className: "cedros-token-remove-btn",
1510
- onClick: () => p(r),
1989
+ onClick: () => p(o),
1511
1990
  title: "Remove token",
1512
1991
  children: "×"
1513
1992
  }
1514
1993
  )
1515
- ] }, r)),
1516
- /* @__PURE__ */ t("button", { type: "button", className: "cedros-token-add-btn", onClick: s, children: "+ Add Token" })
1994
+ ] }, o)),
1995
+ /* @__PURE__ */ e("button", { type: "button", className: "cedros-token-add-btn", onClick: r, children: "+ Add Token" })
1517
1996
  ] });
1518
1997
  }
1519
- function G({ value: e, onChange: l }) {
1520
- const a = S(() => e.split(",").map((i) => i.trim()).filter(Boolean), [e]), n = d(
1521
- (i) => {
1522
- if (!i || a.includes(i)) return;
1523
- const p = [...a, i].join(", ");
1524
- l(p);
1998
+ function z({ value: t, onChange: i }) {
1999
+ const a = N(() => t.split(",").map((s) => s.trim()).filter(Boolean), [t]), n = m(
2000
+ (s) => {
2001
+ if (!s || a.includes(s)) return;
2002
+ const p = [...a, s].join(", ");
2003
+ i(p);
1525
2004
  },
1526
- [a, l]
1527
- ), s = d(
1528
- (i) => {
1529
- const p = a.filter((o) => o !== i).join(", ");
1530
- l(p);
2005
+ [a, i]
2006
+ ), r = m(
2007
+ (s) => {
2008
+ const p = a.filter((l) => l !== s).join(", ");
2009
+ i(p);
1531
2010
  },
1532
- [a, l]
2011
+ [a, i]
1533
2012
  );
1534
- return /* @__PURE__ */ u("div", { className: "cedros-token-symbol-list-input", children: [
1535
- /* @__PURE__ */ u("div", { className: "cedros-token-presets", children: [
1536
- /* @__PURE__ */ t("span", { className: "cedros-token-presets-label", children: "Click to add:" }),
1537
- /* @__PURE__ */ t("div", { className: "cedros-token-presets-list", children: A.map((i) => {
1538
- const p = a.includes(i);
1539
- return /* @__PURE__ */ u(
2013
+ return /* @__PURE__ */ d("div", { className: "cedros-token-symbol-list-input", children: [
2014
+ /* @__PURE__ */ d("div", { className: "cedros-token-presets", children: [
2015
+ /* @__PURE__ */ e("span", { className: "cedros-token-presets-label", children: "Click to add:" }),
2016
+ /* @__PURE__ */ e("div", { className: "cedros-token-presets-list", children: R.map((s) => {
2017
+ const p = a.includes(s);
2018
+ return /* @__PURE__ */ d(
1540
2019
  "button",
1541
2020
  {
1542
2021
  type: "button",
1543
2022
  className: `cedros-token-preset-chip ${p ? "cedros-token-preset-chip-selected" : ""}`,
1544
- onClick: () => p ? s(i) : n(i),
1545
- title: p ? `Remove ${i}` : `Add ${i}`,
2023
+ onClick: () => p ? r(s) : n(s),
2024
+ title: p ? `Remove ${s}` : `Add ${s}`,
1546
2025
  children: [
1547
- i,
1548
- p && /* @__PURE__ */ t("span", { className: "cedros-token-chip-check", children: "✓" })
2026
+ s,
2027
+ p && /* @__PURE__ */ e("span", { className: "cedros-token-chip-check", children: "✓" })
1549
2028
  ]
1550
2029
  },
1551
- i
2030
+ s
1552
2031
  );
1553
2032
  }) })
1554
2033
  ] }),
1555
- /* @__PURE__ */ t(
2034
+ /* @__PURE__ */ e(
1556
2035
  "input",
1557
2036
  {
1558
2037
  type: "text",
1559
- value: e,
1560
- onChange: (i) => l(i.target.value),
2038
+ value: t,
2039
+ onChange: (s) => i(s.target.value),
1561
2040
  className: "cedros-setting-input",
1562
2041
  placeholder: "USDC, SOL, BONK..."
1563
2042
  }
1564
2043
  )
1565
2044
  ] });
1566
2045
  }
1567
- const H = 800, V = 2e3;
1568
- function Z() {
1569
- const { settings: e, isLoading: l, error: a, fetchSettings: n, updateSettings: s } = E(), [i, p] = w({}), [o, r] = w("idle"), [c, m] = w(null), y = T(null), _ = T(null), k = T({});
1570
- O(() => () => {
1571
- y.current && clearTimeout(y.current), _.current && clearTimeout(_.current);
2046
+ const Y = 800, X = 2e3;
2047
+ function re() {
2048
+ const { settings: t, isLoading: i, error: a, fetchSettings: n, updateSettings: r } = O(), [s, p] = f({}), [l, o] = f("idle"), [c, y] = f(null), b = P(null), _ = P(null), w = P({});
2049
+ I(() => () => {
2050
+ b.current && clearTimeout(b.current), _.current && clearTimeout(_.current);
1572
2051
  }, []);
1573
- const P = d(async () => {
1574
- const h = { ...k.current };
2052
+ const v = m(async () => {
2053
+ const h = { ...w.current };
1575
2054
  if (Object.keys(h).length === 0) {
1576
- r("idle");
2055
+ o("idle");
1577
2056
  return;
1578
2057
  }
1579
- r("saving"), m(null);
1580
- const v = Object.entries(h).map(([b, g]) => ({
1581
- key: b,
2058
+ o("saving"), y(null);
2059
+ const k = Object.entries(h).map(([u, g]) => ({
2060
+ key: u,
1582
2061
  value: g
1583
2062
  }));
1584
2063
  try {
1585
- await s(v), p((b) => {
1586
- const g = { ...b };
1587
- for (const D of Object.keys(h))
1588
- delete g[D];
2064
+ await r(k), p((u) => {
2065
+ const g = { ...u };
2066
+ for (const S of Object.keys(h))
2067
+ delete g[S];
1589
2068
  return g;
1590
2069
  });
1591
- for (const b of Object.keys(h))
1592
- delete k.current[b];
1593
- r("saved"), _.current && clearTimeout(_.current), _.current = setTimeout(() => {
1594
- r("idle");
1595
- }, V);
1596
- } catch (b) {
1597
- r("error"), m(b instanceof Error ? b.message : "Failed to save");
2070
+ for (const u of Object.keys(h))
2071
+ delete w.current[u];
2072
+ o("saved"), _.current && clearTimeout(_.current), _.current = setTimeout(() => {
2073
+ o("idle");
2074
+ }, X);
2075
+ } catch (u) {
2076
+ o("error"), y(u instanceof Error ? u.message : "Failed to save");
1598
2077
  }
1599
- }, [s]), C = d(
1600
- (h, v) => {
1601
- p((b) => ({ ...b, [h]: v })), k.current[h] = v, m(null), r("pending"), y.current && clearTimeout(y.current), y.current = setTimeout(() => {
1602
- P();
1603
- }, H);
2078
+ }, [r]), x = m(
2079
+ (h, k) => {
2080
+ p((u) => ({ ...u, [h]: k })), w.current[h] = k, y(null), o("pending"), b.current && clearTimeout(b.current), b.current = setTimeout(() => {
2081
+ v();
2082
+ }, Y);
1604
2083
  },
1605
- [P]
1606
- ), L = d(
2084
+ [v]
2085
+ ), C = m(
1607
2086
  (h) => {
1608
- if (i[h] !== void 0) return i[h];
1609
- for (const v of Object.values(e)) {
1610
- const b = v.find((g) => g.key === h);
1611
- if (b) return b.value;
2087
+ if (s[h] !== void 0) return s[h];
2088
+ for (const k of Object.values(t)) {
2089
+ const u = k.find((g) => g.key === h);
2090
+ if (u) return u.value;
1612
2091
  }
1613
2092
  return "";
1614
2093
  },
1615
- [i, e]
2094
+ [s, t]
1616
2095
  );
1617
2096
  return {
1618
- settings: e,
1619
- edits: i,
1620
- isLoading: l,
1621
- autosaveStatus: o,
2097
+ settings: t,
2098
+ edits: s,
2099
+ isLoading: i,
2100
+ autosaveStatus: l,
1622
2101
  autosaveError: c,
1623
2102
  error: a,
1624
2103
  fetchSettings: n,
1625
- handleChange: C,
1626
- getEffectiveValue: L
2104
+ handleChange: x,
2105
+ getEffectiveValue: C
1627
2106
  };
1628
2107
  }
1629
- function ee({ status: e, error: l }) {
1630
- return e === "idle" ? null : /* @__PURE__ */ u("div", { className: `cedros-autosave-status cedros-autosave-status--${e}`, children: [
1631
- e === "pending" && /* @__PURE__ */ u(f, { children: [
1632
- /* @__PURE__ */ t("span", { className: "cedros-autosave-dot" }),
1633
- /* @__PURE__ */ t("span", { children: "Unsaved changes" })
2108
+ function se({ status: t, error: i }) {
2109
+ return t === "idle" ? null : /* @__PURE__ */ d("div", { className: `cedros-autosave-status cedros-autosave-status--${t}`, children: [
2110
+ t === "pending" && /* @__PURE__ */ d(T, { children: [
2111
+ /* @__PURE__ */ e("span", { className: "cedros-autosave-dot" }),
2112
+ /* @__PURE__ */ e("span", { children: "Unsaved changes" })
1634
2113
  ] }),
1635
- e === "saving" && /* @__PURE__ */ u(f, { children: [
1636
- /* @__PURE__ */ t("span", { className: "cedros-autosave-spinner" }),
1637
- /* @__PURE__ */ t("span", { children: "Saving..." })
2114
+ t === "saving" && /* @__PURE__ */ d(T, { children: [
2115
+ /* @__PURE__ */ e("span", { className: "cedros-autosave-spinner" }),
2116
+ /* @__PURE__ */ e("span", { children: "Saving..." })
1638
2117
  ] }),
1639
- e === "saved" && /* @__PURE__ */ u(f, { children: [
1640
- /* @__PURE__ */ t("span", { className: "cedros-autosave-check", children: "✓" }),
1641
- /* @__PURE__ */ t("span", { children: "Saved" })
2118
+ t === "saved" && /* @__PURE__ */ d(T, { children: [
2119
+ /* @__PURE__ */ e("span", { className: "cedros-autosave-check", children: "✓" }),
2120
+ /* @__PURE__ */ e("span", { children: "Saved" })
1642
2121
  ] }),
1643
- e === "error" && /* @__PURE__ */ u(f, { children: [
1644
- /* @__PURE__ */ t("span", { className: "cedros-autosave-error-icon", children: "!" }),
1645
- /* @__PURE__ */ t("span", { children: l || "Save failed" })
2122
+ t === "error" && /* @__PURE__ */ d(T, { children: [
2123
+ /* @__PURE__ */ e("span", { className: "cedros-autosave-error-icon", children: "!" }),
2124
+ /* @__PURE__ */ e("span", { children: i || "Save failed" })
1646
2125
  ] })
1647
2126
  ] });
1648
2127
  }
1649
2128
  export {
1650
- ee as A,
1651
- X as C,
1652
- Q as S,
1653
- U as a,
1654
- Z as u
2129
+ se as A,
2130
+ ae as C,
2131
+ ie as S,
2132
+ W as a,
2133
+ re as u
1655
2134
  };