@cedros/login-react 0.0.39 → 0.0.41

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 (94) hide show
  1. package/dist/{AuthenticationSettings-DUXpyiJ5.js → AuthenticationSettings-CSoFp-_2.js} +1 -1
  2. package/dist/{AuthenticationSettings-DUXpyiJ5.js.map → AuthenticationSettings-CSoFp-_2.js.map} +1 -1
  3. package/dist/{AuthenticationSettings-Dk1LX0CK.cjs → AuthenticationSettings-Cu5Z2mTC.cjs} +1 -1
  4. package/dist/{AuthenticationSettings-Dk1LX0CK.cjs.map → AuthenticationSettings-Cu5Z2mTC.cjs.map} +1 -1
  5. package/dist/{AuthenticationSettings-BF_7Ea6Z.js → AuthenticationSettings-D4ExU-2a.js} +1 -1
  6. package/dist/{AuthenticationSettings-BF_7Ea6Z.js.map → AuthenticationSettings-D4ExU-2a.js.map} +1 -1
  7. package/dist/{AuthenticationSettings-BMDrCVSf.cjs → AuthenticationSettings-DABzZHuI.cjs} +1 -1
  8. package/dist/{AuthenticationSettings-BMDrCVSf.cjs.map → AuthenticationSettings-DABzZHuI.cjs.map} +1 -1
  9. package/dist/AutosaveStatus-B1A1zORa.cjs +1 -0
  10. package/dist/AutosaveStatus-B1A1zORa.cjs.map +1 -0
  11. package/dist/{AutosaveStatus-CSZsp6w7.js → AutosaveStatus-DMjvXzP2.js} +526 -341
  12. package/dist/AutosaveStatus-DMjvXzP2.js.map +1 -0
  13. package/dist/CreditSystemSettings-BWuiRTtA.cjs +1 -0
  14. package/dist/CreditSystemSettings-BWuiRTtA.cjs.map +1 -0
  15. package/dist/{CreditSystemSettings-Cj21_Ug8.js → CreditSystemSettings-BjQdysRS.js} +1 -1
  16. package/dist/{CreditSystemSettings-Cj21_Ug8.js.map → CreditSystemSettings-BjQdysRS.js.map} +1 -1
  17. package/dist/{CreditSystemSettings-CLImarX-.cjs → CreditSystemSettings-DfSfQVE8.cjs} +1 -1
  18. package/dist/{CreditSystemSettings-CLImarX-.cjs.map → CreditSystemSettings-DfSfQVE8.cjs.map} +1 -1
  19. package/dist/{CreditSystemSettings-Buu7Y-7I.js → CreditSystemSettings-Du3ac0ID.js} +12 -7
  20. package/dist/CreditSystemSettings-Du3ac0ID.js.map +1 -0
  21. package/dist/EmailRegisterForm-CMXsa-_r.js +750 -0
  22. package/dist/EmailRegisterForm-CMXsa-_r.js.map +1 -0
  23. package/dist/EmailRegisterForm-i7f4St2N.cjs +1 -0
  24. package/dist/EmailRegisterForm-i7f4St2N.cjs.map +1 -0
  25. package/dist/EmailSettings-ASDHfI0K.js +86 -0
  26. package/dist/EmailSettings-ASDHfI0K.js.map +1 -0
  27. package/dist/EmailSettings-BcHo0cqk.cjs +1 -0
  28. package/dist/EmailSettings-BcHo0cqk.cjs.map +1 -0
  29. package/dist/{EmailSettings-CmxxnrA9.js → EmailSettings-CjngJwDS.js} +1 -1
  30. package/dist/{EmailSettings-CmxxnrA9.js.map → EmailSettings-CjngJwDS.js.map} +1 -1
  31. package/dist/{EmailSettings-9sdEAONl.cjs → EmailSettings-CswtKXhb.cjs} +1 -1
  32. package/dist/{EmailSettings-9sdEAONl.cjs.map → EmailSettings-CswtKXhb.cjs.map} +1 -1
  33. package/dist/{EmbeddedWalletSettings-BuLN_Uqc.cjs → EmbeddedWalletSettings-BXlboZ9-.cjs} +1 -1
  34. package/dist/{EmbeddedWalletSettings-BuLN_Uqc.cjs.map → EmbeddedWalletSettings-BXlboZ9-.cjs.map} +1 -1
  35. package/dist/{EmbeddedWalletSettings-DGq-kXbw.cjs → EmbeddedWalletSettings-BkwIbTkL.cjs} +1 -1
  36. package/dist/{EmbeddedWalletSettings-DGq-kXbw.cjs.map → EmbeddedWalletSettings-BkwIbTkL.cjs.map} +1 -1
  37. package/dist/{EmbeddedWalletSettings-CHkkCjyR.js → EmbeddedWalletSettings-CPLbqlxJ.js} +1 -1
  38. package/dist/{EmbeddedWalletSettings-CHkkCjyR.js.map → EmbeddedWalletSettings-CPLbqlxJ.js.map} +1 -1
  39. package/dist/{EmbeddedWalletSettings-M-D5N0eY.js → EmbeddedWalletSettings-CUY_X7Vj.js} +1 -1
  40. package/dist/{EmbeddedWalletSettings-M-D5N0eY.js.map → EmbeddedWalletSettings-CUY_X7Vj.js.map} +1 -1
  41. package/dist/{PermissionsSection-DEMVp7X3.cjs → PermissionsSection-B-6DJnN8.cjs} +1 -1
  42. package/dist/{PermissionsSection-DEMVp7X3.cjs.map → PermissionsSection-B-6DJnN8.cjs.map} +1 -1
  43. package/dist/{PermissionsSection-DNzOL1xW.js → PermissionsSection-BeFhIgQy.js} +22 -18
  44. package/dist/{PermissionsSection-DNzOL1xW.js.map → PermissionsSection-BeFhIgQy.js.map} +1 -1
  45. package/dist/{ServerSettings-DQemMrNv.js → ServerSettings-B9PNMse1.js} +1 -1
  46. package/dist/{ServerSettings-DQemMrNv.js.map → ServerSettings-B9PNMse1.js.map} +1 -1
  47. package/dist/{ServerSettings-qxi8aZO7.js → ServerSettings-BLoWX7KG.js} +1 -1
  48. package/dist/{ServerSettings-qxi8aZO7.js.map → ServerSettings-BLoWX7KG.js.map} +1 -1
  49. package/dist/{ServerSettings-CMmH5pZv.cjs → ServerSettings-BygCxOTY.cjs} +1 -1
  50. package/dist/{ServerSettings-CMmH5pZv.cjs.map → ServerSettings-BygCxOTY.cjs.map} +1 -1
  51. package/dist/{ServerSettings-DfimU7ay.cjs → ServerSettings-CgBdYspU.cjs} +1 -1
  52. package/dist/{ServerSettings-DfimU7ay.cjs.map → ServerSettings-CgBdYspU.cjs.map} +1 -1
  53. package/dist/{TeamSection-DopbZClq.cjs → TeamSection-B1t1tU-_.cjs} +1 -1
  54. package/dist/{TeamSection-DopbZClq.cjs.map → TeamSection-B1t1tU-_.cjs.map} +1 -1
  55. package/dist/{TeamSection-CoMXyFtz.js → TeamSection-DbSYDRdI.js} +1 -1
  56. package/dist/{TeamSection-CoMXyFtz.js.map → TeamSection-DbSYDRdI.js.map} +1 -1
  57. package/dist/{WebhookSettings-B8hAwhZ2.js → WebhookSettings-C-7Yxueu.js} +1 -1
  58. package/dist/{WebhookSettings-B8hAwhZ2.js.map → WebhookSettings-C-7Yxueu.js.map} +1 -1
  59. package/dist/{WebhookSettings-8QAqvkkO.js → WebhookSettings-C923ZSKa.js} +1 -1
  60. package/dist/{WebhookSettings-8QAqvkkO.js.map → WebhookSettings-C923ZSKa.js.map} +1 -1
  61. package/dist/{WebhookSettings-0sgWRI3U.cjs → WebhookSettings-CbU3cfTJ.cjs} +1 -1
  62. package/dist/{WebhookSettings-0sgWRI3U.cjs.map → WebhookSettings-CbU3cfTJ.cjs.map} +1 -1
  63. package/dist/{WebhookSettings-B6Y3Tnjv.cjs → WebhookSettings-D19u9Uok.cjs} +1 -1
  64. package/dist/{WebhookSettings-B6Y3Tnjv.cjs.map → WebhookSettings-D19u9Uok.cjs.map} +1 -1
  65. package/dist/admin-only.cjs +1 -1
  66. package/dist/admin-only.js +1 -1
  67. package/dist/email-only.cjs +1 -1
  68. package/dist/email-only.d.ts +1 -1
  69. package/dist/email-only.js +1 -1
  70. package/dist/index.cjs +13 -13
  71. package/dist/index.cjs.map +1 -1
  72. package/dist/index.d.ts +5 -8
  73. package/dist/index.js +4639 -4480
  74. package/dist/index.js.map +1 -1
  75. package/dist/login-react.css +1 -1
  76. package/dist/{plugin-C_NDZ2-D.js → plugin-BiftIhZe.js} +1 -1
  77. package/dist/{plugin-C_NDZ2-D.js.map → plugin-BiftIhZe.js.map} +1 -1
  78. package/dist/{plugin-CUxpAjL-.cjs → plugin-BtQdI_Ay.cjs} +1 -1
  79. package/dist/{plugin-CUxpAjL-.cjs.map → plugin-BtQdI_Ay.cjs.map} +1 -1
  80. package/package.json +1 -1
  81. package/dist/AutosaveStatus-BKsCIvPj.cjs +0 -1
  82. package/dist/AutosaveStatus-BKsCIvPj.cjs.map +0 -1
  83. package/dist/AutosaveStatus-CSZsp6w7.js.map +0 -1
  84. package/dist/CreditSystemSettings-Buu7Y-7I.js.map +0 -1
  85. package/dist/CreditSystemSettings-C2HkyMXy.cjs +0 -1
  86. package/dist/CreditSystemSettings-C2HkyMXy.cjs.map +0 -1
  87. package/dist/EmailRegisterForm-CNjYrqU6.cjs +0 -1
  88. package/dist/EmailRegisterForm-CNjYrqU6.cjs.map +0 -1
  89. package/dist/EmailRegisterForm-D2VaJouj.js +0 -750
  90. package/dist/EmailRegisterForm-D2VaJouj.js.map +0 -1
  91. package/dist/EmailSettings-DRfOF0Sf.js +0 -78
  92. package/dist/EmailSettings-DRfOF0Sf.js.map +0 -1
  93. package/dist/EmailSettings-eLlzzI5D.cjs +0 -1
  94. package/dist/EmailSettings-eLlzzI5D.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 p, Fragment as T } from "react/jsx-runtime";
2
+ import { useMemo as x, useCallback as m, useState as v, useRef as P, useEffect as O } from "react";
3
+ import { u as I } from "./useCedrosLogin-CFfID-0i.js";
4
+ import { u as U } from "./useSystemSettings-rgskaDqP.js";
5
+ function M(t) {
6
+ const s = Math.floor(t / 86400), a = Math.floor(t % 86400 / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
7
+ return { days: s, hours: a, minutes: r, seconds: i };
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 j(t) {
10
+ const { days: s, hours: a, minutes: r } = M(t), i = [];
11
+ return s > 0 && i.push(`${s}d`), a > 0 && i.push(`${a}h`), r > 0 && i.push(`${r}m`), i.length === 0 && i.push(`${t}s`), i.join(" ");
11
12
  }
12
- const U = {
13
+ const W = {
13
14
  // ============= Authentication Providers =============
14
15
  // Email auth
15
16
  auth_email_enabled: {
@@ -313,6 +314,42 @@ const U = {
313
314
  inputType: "text",
314
315
  placeholder: "My App"
315
316
  },
317
+ // ============= Email Subject Customization =============
318
+ email_subject_verification: {
319
+ key: "email_subject_verification",
320
+ label: "Verification Email Subject",
321
+ description: 'Custom subject for email verification messages. Leave empty for the default: "Verify your email address".',
322
+ inputType: "text",
323
+ placeholder: "Verify your email address"
324
+ },
325
+ email_subject_password_reset: {
326
+ key: "email_subject_password_reset",
327
+ label: "Password Reset Subject",
328
+ description: 'Custom subject for password reset emails. Leave empty for the default: "Reset your password".',
329
+ inputType: "text",
330
+ placeholder: "Reset your password"
331
+ },
332
+ email_subject_instant_link: {
333
+ key: "email_subject_instant_link",
334
+ label: "Instant Link Subject",
335
+ description: 'Custom subject for instant link sign-in emails. Leave empty for the default: "Your sign-in link".',
336
+ inputType: "text",
337
+ placeholder: "Your sign-in link"
338
+ },
339
+ email_subject_invite: {
340
+ key: "email_subject_invite",
341
+ label: "Invite Email Subject",
342
+ description: "Custom subject for organization invite emails. Leave empty for the default which includes the org name.",
343
+ inputType: "text",
344
+ placeholder: "You've been invited to join..."
345
+ },
346
+ email_subject_security_alert: {
347
+ key: "email_subject_security_alert",
348
+ label: "Security Alert Subject",
349
+ description: 'Custom subject for new device sign-in alerts. Leave empty for the default: "New sign-in to your account".',
350
+ inputType: "text",
351
+ placeholder: "New sign-in to your account"
352
+ },
316
353
  // ============= Webhook Settings =============
317
354
  webhook_enabled: {
318
355
  key: "webhook_enabled",
@@ -875,6 +912,19 @@ const U = {
875
912
  message: "Very small withdrawals may lose significant value to fees."
876
913
  }
877
914
  },
915
+ // ============= Sidecar Shared Secrets =============
916
+ sidecar_api_key: {
917
+ key: "sidecar_api_key",
918
+ label: "Sidecar API Key",
919
+ 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.",
920
+ inputType: "readonlySecret"
921
+ },
922
+ note_encryption_key: {
923
+ key: "note_encryption_key",
924
+ label: "Note Encryption Key",
925
+ 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.",
926
+ inputType: "readonlySecret"
927
+ },
878
928
  // ============= Post-Login Flow =============
879
929
  postlogin_redirect_url: {
880
930
  key: "postlogin_redirect_url",
@@ -926,8 +976,66 @@ const U = {
926
976
  label: "Show Recovery Info",
927
977
  description: "Show wallet recovery information screen after account creation. Displays recovery phrase based on the configured recovery mode.",
928
978
  inputType: "boolean"
979
+ },
980
+ // ============= Image Storage Settings =============
981
+ image_storage_enabled: {
982
+ key: "image_storage_enabled",
983
+ label: "Enable Image Storage",
984
+ description: "Enable S3-compatible object storage for user avatar uploads. When disabled, users cannot upload profile pictures.",
985
+ inputType: "boolean"
986
+ },
987
+ image_storage_provider: {
988
+ key: "image_storage_provider",
989
+ label: "Storage Provider",
990
+ description: "Select your S3-compatible storage provider to auto-fill endpoint and region hints.",
991
+ inputType: "select",
992
+ presets: [
993
+ { label: "DigitalOcean Spaces", value: "digitalocean" },
994
+ { label: "AWS S3", value: "s3" },
995
+ { label: "Custom S3-Compatible", value: "custom" }
996
+ ]
997
+ },
998
+ image_storage_bucket: {
999
+ key: "image_storage_bucket",
1000
+ label: "Bucket Name",
1001
+ description: "The name of your S3 bucket or DigitalOcean Space.",
1002
+ inputType: "text",
1003
+ placeholder: "my-app-avatars"
1004
+ },
1005
+ image_storage_region: {
1006
+ key: "image_storage_region",
1007
+ label: "Region",
1008
+ description: "AWS region or DigitalOcean datacenter (e.g., us-east-1, nyc3, ams3).",
1009
+ inputType: "text",
1010
+ placeholder: "us-east-1"
1011
+ },
1012
+ image_storage_endpoint: {
1013
+ key: "image_storage_endpoint",
1014
+ label: "Endpoint URL",
1015
+ description: "S3-compatible endpoint URL. For DigitalOcean Spaces: https://{region}.digitaloceanspaces.com. Leave empty for AWS S3.",
1016
+ inputType: "text",
1017
+ placeholder: "https://nyc3.digitaloceanspaces.com"
1018
+ },
1019
+ image_storage_access_key: {
1020
+ key: "image_storage_access_key",
1021
+ label: "Access Key",
1022
+ description: "S3 access key ID or DigitalOcean Spaces access key.",
1023
+ inputType: "secret"
1024
+ },
1025
+ image_storage_secret_key: {
1026
+ key: "image_storage_secret_key",
1027
+ label: "Secret Key",
1028
+ description: "S3 secret access key or DigitalOcean Spaces secret key.",
1029
+ inputType: "secret"
1030
+ },
1031
+ image_storage_cdn_url: {
1032
+ key: "image_storage_cdn_url",
1033
+ label: "CDN URL (optional)",
1034
+ description: "Custom CDN URL prefix for serving images (e.g., https://cdn.example.com). If empty, images are served directly from the bucket URL.",
1035
+ inputType: "text",
1036
+ placeholder: "https://cdn.example.com"
929
1037
  }
930
- }, X = {
1038
+ }, ae = {
931
1039
  // Auth providers (sorted alphabetically by subcategory)
932
1040
  "auth.apple": {
933
1041
  label: "Apple Sign-In",
@@ -1033,8 +1141,13 @@ const U = {
1033
1141
  label: "Withdrawal Worker",
1034
1142
  description: "Configure how the automated withdrawal processor handles pending withdrawals. These settings affect throughput and privacy.",
1035
1143
  icon: ""
1144
+ },
1145
+ image_storage: {
1146
+ label: "Image Storage",
1147
+ description: "Configure S3-compatible object storage for user avatars and images.",
1148
+ icon: ""
1036
1149
  }
1037
- }, A = [
1150
+ }, R = [
1038
1151
  "SOL",
1039
1152
  "USDC",
1040
1153
  "USDT",
@@ -1046,610 +1159,682 @@ const U = {
1046
1159
  "BONK",
1047
1160
  "ORE"
1048
1161
  ];
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;
1162
+ function L(t) {
1163
+ const s = t.split(/(<a\s[^>]*>.*?<\/a>)/g);
1164
+ return s.length === 1 ? t : s.map((a, r) => {
1165
+ const i = a.match(/^<a\s+href="([^"]+)"[^>]*>([^<]+)<\/a>$/);
1166
+ return i ? /* @__PURE__ */ e("a", { href: i[1], target: "_blank", rel: "noopener noreferrer", children: i[2] }, r) : a;
1054
1167
  });
1055
1168
  }
1056
- function Q({
1057
- settings: e,
1058
- edits: l,
1169
+ function se({
1170
+ settings: t,
1171
+ edits: s,
1059
1172
  onChange: a,
1060
- externalWarnings: n
1173
+ externalWarnings: r
1061
1174
  }) {
1062
- return /* @__PURE__ */ t("div", { className: "cedros-settings-grid", children: e.map((s) => /* @__PURE__ */ t(
1063
- M,
1175
+ return /* @__PURE__ */ e("div", { className: "cedros-settings-grid", children: t.map((i) => /* @__PURE__ */ e(
1176
+ F,
1064
1177
  {
1065
- setting: s,
1066
- editValue: l[s.key],
1178
+ setting: i,
1179
+ editValue: s[i.key],
1067
1180
  onChange: a,
1068
- externalWarning: n?.[s.key]
1181
+ externalWarning: r?.[i.key]
1069
1182
  },
1070
- s.key
1183
+ i.key
1071
1184
  )) });
1072
1185
  }
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(() => {
1075
- if (n) return n;
1076
- if (!s?.warningThreshold) return null;
1077
- const c = parseInt(i, 10);
1186
+ function F({ setting: t, editValue: s, onChange: a, externalWarning: r }) {
1187
+ const i = W[t.key], l = s ?? t.value, u = s !== void 0 && s !== t.value, n = i?.inputType === "boolean", o = x(() => {
1188
+ if (r) return r;
1189
+ if (!i?.warningThreshold) return null;
1190
+ const c = parseInt(l, 10);
1078
1191
  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(
1192
+ const { above: b, below: h, message: _ } = i.warningThreshold;
1193
+ return b !== void 0 && c > b || h !== void 0 && c < h ? _ : null;
1194
+ }, [l, i?.warningThreshold, r]);
1195
+ return i ? /* @__PURE__ */ e(
1083
1196
  "div",
1084
1197
  {
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,
1198
+ className: `cedros-setting-row ${u ? "cedros-setting-row-changed" : ""} ${o ? "cedros-setting-row-warning" : ""} ${n ? "cedros-setting-row-toggle" : ""}`,
1199
+ children: n ? /* @__PURE__ */ p(T, { children: [
1200
+ /* @__PURE__ */ p("div", { className: "cedros-setting-control cedros-setting-control-toggle", children: [
1201
+ /* @__PURE__ */ e(
1202
+ D,
1090
1203
  {
1091
- meta: s,
1092
- value: i,
1093
- onChange: (c) => a(e.key, c)
1204
+ meta: i,
1205
+ value: l,
1206
+ onChange: (c) => a(t.key, c)
1094
1207
  }
1095
1208
  ),
1096
- r && /* @__PURE__ */ t("div", { className: "cedros-setting-warning", children: r })
1209
+ o && /* @__PURE__ */ e("div", { className: "cedros-setting-warning", children: o })
1097
1210
  ] }),
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) })
1211
+ /* @__PURE__ */ p("div", { className: "cedros-setting-label", children: [
1212
+ /* @__PURE__ */ e("span", { className: "cedros-setting-name", children: i.label }),
1213
+ /* @__PURE__ */ e("span", { className: "cedros-setting-description", children: L(i.description) })
1101
1214
  ] })
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) })
1215
+ ] }) : /* @__PURE__ */ p(T, { children: [
1216
+ /* @__PURE__ */ p("div", { className: "cedros-setting-label", children: [
1217
+ /* @__PURE__ */ e("span", { className: "cedros-setting-name", children: i.label }),
1218
+ /* @__PURE__ */ e("span", { className: "cedros-setting-description", children: L(i.description) })
1106
1219
  ] }),
1107
- /* @__PURE__ */ u("div", { className: "cedros-setting-control", children: [
1108
- /* @__PURE__ */ t(
1109
- x,
1220
+ /* @__PURE__ */ p("div", { className: "cedros-setting-control", children: [
1221
+ /* @__PURE__ */ e(
1222
+ D,
1110
1223
  {
1111
- meta: s,
1112
- value: i,
1113
- onChange: (c) => a(e.key, c)
1224
+ meta: i,
1225
+ value: l,
1226
+ onChange: (c) => a(t.key, c)
1114
1227
  }
1115
1228
  ),
1116
- r && /* @__PURE__ */ t("div", { className: "cedros-setting-warning", children: r })
1229
+ o && /* @__PURE__ */ e("div", { className: "cedros-setting-warning", children: o })
1117
1230
  ] })
1118
1231
  ] })
1119
1232
  }
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 })
1233
+ ) : /* @__PURE__ */ p("div", { className: `cedros-setting-row ${u ? "cedros-setting-row-changed" : ""}`, children: [
1234
+ /* @__PURE__ */ p("div", { className: "cedros-setting-label", children: [
1235
+ /* @__PURE__ */ e("span", { className: "cedros-setting-name", children: t.key }),
1236
+ t.description && /* @__PURE__ */ e("span", { className: "cedros-setting-description", children: t.description })
1124
1237
  ] }),
1125
- /* @__PURE__ */ t("div", { className: "cedros-setting-input-wrapper", children: /* @__PURE__ */ t(
1238
+ /* @__PURE__ */ e("div", { className: "cedros-setting-input-wrapper", children: /* @__PURE__ */ e(
1126
1239
  "input",
1127
1240
  {
1128
1241
  type: "text",
1129
- value: i,
1130
- onChange: (c) => a(e.key, c.target.value),
1242
+ value: l,
1243
+ onChange: (c) => a(t.key, c.target.value),
1131
1244
  className: "cedros-setting-input"
1132
1245
  }
1133
1246
  ) })
1134
1247
  ] });
1135
1248
  }
1136
- function x({ meta: e, value: l, onChange: a }) {
1137
- switch (e.inputType) {
1249
+ function D({ meta: t, value: s, onChange: a }) {
1250
+ switch (t.inputType) {
1138
1251
  case "duration":
1139
- return /* @__PURE__ */ t(W, { value: l, onChange: a, presets: e.presets, min: e.min });
1252
+ return /* @__PURE__ */ e(q, { value: s, onChange: a, presets: t.presets, min: t.min });
1140
1253
  case "percentage":
1141
- return /* @__PURE__ */ t(
1142
- q,
1254
+ return /* @__PURE__ */ e(
1255
+ $,
1143
1256
  {
1144
- value: l,
1257
+ value: s,
1145
1258
  onChange: a,
1146
- min: e.min ?? 1,
1147
- max: e.max ?? 100,
1148
- step: e.step ?? 5,
1149
- presets: e.presets
1259
+ min: t.min ?? 1,
1260
+ max: t.max ?? 100,
1261
+ step: t.step ?? 5,
1262
+ presets: t.presets
1150
1263
  }
1151
1264
  );
1152
1265
  case "select":
1153
- return /* @__PURE__ */ t(
1154
- F,
1266
+ return /* @__PURE__ */ e(
1267
+ B,
1155
1268
  {
1156
- value: l,
1269
+ value: s,
1157
1270
  onChange: a,
1158
- presets: e.presets ?? [],
1159
- unit: e.unit
1271
+ presets: t.presets ?? [],
1272
+ unit: t.unit
1160
1273
  }
1161
1274
  );
1162
1275
  case "number":
1163
- return /* @__PURE__ */ t(
1164
- $,
1276
+ return /* @__PURE__ */ e(
1277
+ J,
1165
1278
  {
1166
- value: l,
1279
+ value: s,
1167
1280
  onChange: a,
1168
- min: e.min,
1169
- max: e.max,
1170
- unit: e.unit
1281
+ min: t.min,
1282
+ max: t.max,
1283
+ unit: t.unit
1171
1284
  }
1172
1285
  );
1173
1286
  case "tokenList":
1174
- return /* @__PURE__ */ t(B, { value: l, onChange: a });
1287
+ return /* @__PURE__ */ e(K, { value: s, onChange: a });
1175
1288
  case "text":
1176
- return /* @__PURE__ */ t(
1289
+ return /* @__PURE__ */ e(
1177
1290
  "input",
1178
1291
  {
1179
1292
  type: "text",
1180
- value: l,
1181
- onChange: (n) => a(n.target.value),
1293
+ value: s,
1294
+ onChange: (r) => a(r.target.value),
1182
1295
  className: "cedros-setting-input",
1183
- placeholder: e.label
1296
+ placeholder: t.label
1184
1297
  }
1185
1298
  );
1186
1299
  case "boolean":
1187
- return /* @__PURE__ */ t(j, { value: l, onChange: a });
1300
+ return /* @__PURE__ */ e(V, { value: s, onChange: a });
1188
1301
  case "secret":
1189
- return /* @__PURE__ */ t(J, { value: l, onChange: a, multiline: e.multiline });
1302
+ return /* @__PURE__ */ e(G, { value: s, onChange: a, multiline: t.multiline });
1303
+ case "readonlySecret":
1304
+ return /* @__PURE__ */ e(H, { settingKey: t.key, value: s });
1190
1305
  case "tokenSymbolList":
1191
- return /* @__PURE__ */ t(G, { value: l, onChange: a });
1306
+ return /* @__PURE__ */ e(z, { value: s, onChange: a });
1192
1307
  default:
1193
- return /* @__PURE__ */ t(
1308
+ return /* @__PURE__ */ e(
1194
1309
  "input",
1195
1310
  {
1196
1311
  type: "text",
1197
- value: l,
1198
- onChange: (n) => a(n.target.value),
1312
+ value: s,
1313
+ onChange: (r) => a(r.target.value),
1199
1314
  className: "cedros-setting-input"
1200
1315
  }
1201
1316
  );
1202
1317
  }
1203
1318
  }
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);
1319
+ function q({ value: t, onChange: s, presets: a, min: r = 0 }) {
1320
+ const i = parseInt(t, 10) || 0, l = j(i), u = m(
1321
+ (o) => {
1322
+ o.target.value && s(o.target.value);
1208
1323
  },
1209
- [l]
1210
- ), o = d(
1211
- (r) => {
1212
- const c = Math.max(n, parseInt(r.target.value, 10) || 0);
1213
- l(String(c));
1324
+ [s]
1325
+ ), n = m(
1326
+ (o) => {
1327
+ const c = Math.max(r, parseInt(o.target.value, 10) || 0);
1328
+ s(String(c));
1214
1329
  },
1215
- [l, n]
1330
+ [s, r]
1216
1331
  );
1217
- return /* @__PURE__ */ u("div", { className: "cedros-duration-input", children: [
1218
- a && a.length > 0 && /* @__PURE__ */ u(
1332
+ return /* @__PURE__ */ p("div", { className: "cedros-duration-input", children: [
1333
+ a && a.length > 0 && /* @__PURE__ */ p(
1219
1334
  "select",
1220
1335
  {
1221
- value: a.find((r) => r.value === e)?.value ?? "",
1222
- onChange: p,
1336
+ value: a.find((o) => o.value === t)?.value ?? "",
1337
+ onChange: u,
1223
1338
  className: "cedros-setting-select",
1224
1339
  children: [
1225
- /* @__PURE__ */ t("option", { value: "", children: "Custom..." }),
1226
- a.map((r) => /* @__PURE__ */ t("option", { value: r.value, children: r.label }, r.value))
1340
+ /* @__PURE__ */ e("option", { value: "", children: "Custom..." }),
1341
+ a.map((o) => /* @__PURE__ */ e("option", { value: o.value, children: o.label }, o.value))
1227
1342
  ]
1228
1343
  }
1229
1344
  ),
1230
- /* @__PURE__ */ u("div", { className: "cedros-duration-custom", children: [
1231
- /* @__PURE__ */ t(
1345
+ /* @__PURE__ */ p("div", { className: "cedros-duration-custom", children: [
1346
+ /* @__PURE__ */ e(
1232
1347
  "input",
1233
1348
  {
1234
1349
  type: "number",
1235
- value: s,
1236
- onChange: o,
1237
- min: n,
1350
+ value: i,
1351
+ onChange: n,
1352
+ min: r,
1238
1353
  className: "cedros-setting-input cedros-setting-input-sm"
1239
1354
  }
1240
1355
  ),
1241
- /* @__PURE__ */ t("span", { className: "cedros-setting-unit", children: "seconds" }),
1242
- /* @__PURE__ */ u("span", { className: "cedros-duration-display", children: [
1356
+ /* @__PURE__ */ e("span", { className: "cedros-setting-unit", children: "seconds" }),
1357
+ /* @__PURE__ */ p("span", { className: "cedros-duration-display", children: [
1243
1358
  "= ",
1244
- i
1359
+ l
1245
1360
  ] })
1246
1361
  ] })
1247
1362
  ] });
1248
1363
  }
1249
- function q({
1250
- value: e,
1251
- onChange: l,
1364
+ function $({
1365
+ value: t,
1366
+ onChange: s,
1252
1367
  min: a,
1253
- max: n,
1254
- step: s,
1255
- presets: i
1368
+ max: r,
1369
+ step: i,
1370
+ presets: l
1256
1371
  }) {
1257
- const p = parseInt(e, 10) || a, o = d(
1372
+ const u = parseInt(t, 10) || a, n = m(
1258
1373
  (c) => {
1259
- l(c.target.value);
1374
+ s(c.target.value);
1260
1375
  },
1261
- [l]
1262
- ), r = d(
1376
+ [s]
1377
+ ), o = m(
1263
1378
  (c) => {
1264
- l(c);
1379
+ s(c);
1265
1380
  },
1266
- [l]
1381
+ [s]
1267
1382
  );
1268
- return /* @__PURE__ */ u("div", { className: "cedros-percentage-input", children: [
1269
- /* @__PURE__ */ u("div", { className: "cedros-percentage-slider-row", children: [
1270
- /* @__PURE__ */ t(
1383
+ return /* @__PURE__ */ p("div", { className: "cedros-percentage-input", children: [
1384
+ /* @__PURE__ */ p("div", { className: "cedros-percentage-slider-row", children: [
1385
+ /* @__PURE__ */ e(
1271
1386
  "input",
1272
1387
  {
1273
1388
  type: "range",
1274
- value: p,
1275
- onChange: o,
1389
+ value: u,
1390
+ onChange: n,
1276
1391
  min: a,
1277
- max: n,
1278
- step: s,
1392
+ max: r,
1393
+ step: i,
1279
1394
  className: "cedros-percentage-slider"
1280
1395
  }
1281
1396
  ),
1282
- /* @__PURE__ */ u("span", { className: "cedros-percentage-value", children: [
1283
- p,
1397
+ /* @__PURE__ */ p("span", { className: "cedros-percentage-value", children: [
1398
+ u,
1284
1399
  "%"
1285
1400
  ] })
1286
1401
  ] }),
1287
- i && i.length > 0 && /* @__PURE__ */ t("div", { className: "cedros-preset-buttons", children: i.map((c) => /* @__PURE__ */ t(
1402
+ l && l.length > 0 && /* @__PURE__ */ e("div", { className: "cedros-preset-buttons", children: l.map((c) => /* @__PURE__ */ e(
1288
1403
  "button",
1289
1404
  {
1290
1405
  type: "button",
1291
- className: `cedros-preset-button ${c.value === e ? "cedros-preset-button-active" : ""}`,
1292
- onClick: () => r(c.value),
1406
+ className: `cedros-preset-button ${c.value === t ? "cedros-preset-button-active" : ""}`,
1407
+ onClick: () => o(c.value),
1293
1408
  children: c.label
1294
1409
  },
1295
1410
  c.value
1296
1411
  )) })
1297
1412
  ] });
1298
1413
  }
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);
1414
+ function B({ value: t, onChange: s, presets: a, unit: r }) {
1415
+ const i = !a.some((n) => n.value === t), l = m(
1416
+ (n) => {
1417
+ n.target.value !== "__custom__" && s(n.target.value);
1303
1418
  },
1304
- [l]
1305
- ), p = d(
1306
- (o) => {
1307
- l(o.target.value);
1419
+ [s]
1420
+ ), u = m(
1421
+ (n) => {
1422
+ s(n.target.value);
1308
1423
  },
1309
- [l]
1424
+ [s]
1310
1425
  );
1311
- return /* @__PURE__ */ u("div", { className: "cedros-select-input", children: [
1312
- /* @__PURE__ */ u(
1426
+ return /* @__PURE__ */ p("div", { className: "cedros-select-input", children: [
1427
+ /* @__PURE__ */ p(
1313
1428
  "select",
1314
1429
  {
1315
- value: s ? "__custom__" : e,
1316
- onChange: i,
1430
+ value: i ? "__custom__" : t,
1431
+ onChange: l,
1317
1432
  className: "cedros-setting-select",
1318
1433
  children: [
1319
- a.map((o) => /* @__PURE__ */ t("option", { value: o.value, children: o.label }, o.value)),
1320
- /* @__PURE__ */ t("option", { value: "__custom__", children: "Custom..." })
1434
+ a.map((n) => /* @__PURE__ */ e("option", { value: n.value, children: n.label }, n.value)),
1435
+ /* @__PURE__ */ e("option", { value: "__custom__", children: "Custom..." })
1321
1436
  ]
1322
1437
  }
1323
1438
  ),
1324
- s && /* @__PURE__ */ u("div", { className: "cedros-select-custom", children: [
1325
- /* @__PURE__ */ t(
1439
+ i && /* @__PURE__ */ p("div", { className: "cedros-select-custom", children: [
1440
+ /* @__PURE__ */ e(
1326
1441
  "input",
1327
1442
  {
1328
1443
  type: "number",
1329
- value: e,
1330
- onChange: p,
1444
+ value: t,
1445
+ onChange: u,
1331
1446
  className: "cedros-setting-input cedros-setting-input-sm"
1332
1447
  }
1333
1448
  ),
1334
- n && /* @__PURE__ */ t("span", { className: "cedros-setting-unit", children: n })
1449
+ r && /* @__PURE__ */ e("span", { className: "cedros-setting-unit", children: r })
1335
1450
  ] })
1336
1451
  ] });
1337
1452
  }
1338
- function $({ value: e, onChange: l, min: a, max: n, unit: s }) {
1339
- const i = d(
1340
- (p) => {
1341
- l(p.target.value);
1453
+ function J({ value: t, onChange: s, min: a, max: r, unit: i }) {
1454
+ const l = m(
1455
+ (u) => {
1456
+ s(u.target.value);
1342
1457
  },
1343
- [l]
1458
+ [s]
1344
1459
  );
1345
- return /* @__PURE__ */ u("div", { className: "cedros-number-input", children: [
1346
- /* @__PURE__ */ t(
1460
+ return /* @__PURE__ */ p("div", { className: "cedros-number-input", children: [
1461
+ /* @__PURE__ */ e(
1347
1462
  "input",
1348
1463
  {
1349
1464
  type: "number",
1350
- value: e,
1351
- onChange: i,
1465
+ value: t,
1466
+ onChange: l,
1352
1467
  min: a,
1353
- max: n,
1468
+ max: r,
1354
1469
  className: "cedros-setting-input"
1355
1470
  }
1356
1471
  ),
1357
- s && /* @__PURE__ */ t("span", { className: "cedros-setting-unit", children: s })
1472
+ i && /* @__PURE__ */ e("span", { className: "cedros-setting-unit", children: i })
1358
1473
  ] });
1359
1474
  }
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(
1475
+ function V({ value: t, onChange: s }) {
1476
+ const a = t === "true", r = m(() => {
1477
+ s(a ? "false" : "true");
1478
+ }, [a, s]);
1479
+ return /* @__PURE__ */ p(
1365
1480
  "button",
1366
1481
  {
1367
1482
  type: "button",
1368
1483
  role: "switch",
1369
1484
  "aria-checked": a,
1370
1485
  className: `cedros-toggle ${a ? "cedros-toggle-on" : "cedros-toggle-off"}`,
1371
- onClick: n,
1486
+ onClick: r,
1372
1487
  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" })
1488
+ /* @__PURE__ */ e("span", { className: "cedros-toggle-track", children: /* @__PURE__ */ e("span", { className: "cedros-toggle-thumb" }) }),
1489
+ /* @__PURE__ */ e("span", { className: "cedros-toggle-label", children: a ? "Enabled" : "Disabled" })
1375
1490
  ]
1376
1491
  }
1377
1492
  );
1378
1493
  }
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);
1494
+ function G({ value: t, onChange: s, multiline: a }) {
1495
+ const [r, i] = v(!1), [l, u] = v(!1), n = t && t.length > 0, o = m(() => {
1496
+ i(!0), u(!0);
1497
+ }, []), c = m(() => {
1498
+ i(!1), u(!1);
1499
+ }, []), b = m(
1500
+ (h) => {
1501
+ s(h.target.value);
1387
1502
  },
1388
- [l]
1503
+ [s]
1389
1504
  );
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(
1505
+ return !r && n ? /* @__PURE__ */ p("div", { className: "cedros-secret-input cedros-secret-input-masked", children: [
1506
+ /* @__PURE__ */ e("span", { className: "cedros-secret-masked", children: "•".repeat(Math.min(t.length, 20)) }),
1507
+ /* @__PURE__ */ e("button", { type: "button", className: "cedros-secret-edit-btn", onClick: o, children: "Edit" })
1508
+ ] }) : /* @__PURE__ */ p("div", { className: "cedros-secret-input", children: [
1509
+ a ? /* @__PURE__ */ e(
1395
1510
  "textarea",
1396
1511
  {
1397
- value: e,
1398
- onChange: m,
1512
+ value: t,
1513
+ onChange: b,
1399
1514
  className: "cedros-setting-input cedros-setting-textarea",
1400
1515
  placeholder: "Enter secret value...",
1401
1516
  rows: 4
1402
1517
  }
1403
- ) : /* @__PURE__ */ t(
1518
+ ) : /* @__PURE__ */ e(
1404
1519
  "input",
1405
1520
  {
1406
- type: i ? "text" : "password",
1407
- value: e,
1408
- onChange: m,
1521
+ type: l ? "text" : "password",
1522
+ value: t,
1523
+ onChange: b,
1409
1524
  className: "cedros-setting-input",
1410
1525
  placeholder: "Enter secret value..."
1411
1526
  }
1412
1527
  ),
1413
- /* @__PURE__ */ u("div", { className: "cedros-secret-actions", children: [
1414
- !a && /* @__PURE__ */ t(
1528
+ /* @__PURE__ */ p("div", { className: "cedros-secret-actions", children: [
1529
+ !a && /* @__PURE__ */ e(
1415
1530
  "button",
1416
1531
  {
1417
1532
  type: "button",
1418
1533
  className: "cedros-secret-toggle-btn",
1419
- onClick: () => p(!i),
1420
- children: i ? "Hide" : "Show"
1534
+ onClick: () => u(!l),
1535
+ children: l ? "Hide" : "Show"
1421
1536
  }
1422
1537
  ),
1423
- n && /* @__PURE__ */ t("button", { type: "button", className: "cedros-secret-done-btn", onClick: c, children: "Done" })
1538
+ r && /* @__PURE__ */ e("button", { type: "button", className: "cedros-secret-done-btn", onClick: c, children: "Done" })
1424
1539
  ] })
1425
1540
  ] });
1426
1541
  }
1427
- function B({ value: e, onChange: l }) {
1428
- const a = S(() => {
1542
+ function H({ settingKey: t, value: s }) {
1543
+ const [a, r] = v(null), [i, l] = v(!1), [u, n] = v(!1), [o, c] = v(null), [b, h] = v(!1), { config: _, _internal: k } = I(), g = a ?? s, N = g && g.length > 0, C = N && !a, y = m(async () => {
1544
+ if (g)
1545
+ try {
1546
+ await navigator.clipboard.writeText(g), l(!0), setTimeout(() => l(!1), 2e3);
1547
+ } catch {
1548
+ const d = document.createElement("textarea");
1549
+ d.value = g, document.body.appendChild(d), d.select(), document.execCommand("copy"), document.body.removeChild(d), l(!0), setTimeout(() => l(!1), 2e3);
1550
+ }
1551
+ }, [g]), w = m(async () => {
1552
+ n(!0), c(null);
1553
+ try {
1554
+ const d = k?.getAccessToken?.(), f = { "Content-Type": "application/json" };
1555
+ d && (f.Authorization = `Bearer ${d}`);
1556
+ const S = await fetch(
1557
+ `${_.serverUrl}/auth/admin/settings/regenerate/${t}`,
1558
+ { method: "POST", headers: f, credentials: "include" }
1559
+ );
1560
+ if (!S.ok) {
1561
+ const A = await S.json().catch(() => null);
1562
+ throw new Error(A?.message || A?.error || `Regenerate failed (${S.status})`);
1563
+ }
1564
+ const E = await S.json();
1565
+ r(E.value), h(!1);
1566
+ } catch (d) {
1567
+ c(d instanceof Error ? d.message : "Failed to regenerate");
1568
+ } finally {
1569
+ n(!1);
1570
+ }
1571
+ }, [_.serverUrl, k, t]);
1572
+ return /* @__PURE__ */ p("div", { className: "cedros-readonly-secret", children: [
1573
+ /* @__PURE__ */ e("div", { className: "cedros-readonly-secret-value", children: C ? /* @__PURE__ */ e("span", { className: "cedros-secret-masked", children: "•".repeat(20) }) : N ? /* @__PURE__ */ e("code", { className: "cedros-readonly-secret-code", children: g }) : /* @__PURE__ */ e("span", { className: "cedros-readonly-secret-empty", children: "Not generated yet" }) }),
1574
+ /* @__PURE__ */ p("div", { className: "cedros-readonly-secret-actions", children: [
1575
+ N && /* @__PURE__ */ e("button", { type: "button", className: "cedros-secret-action-btn", onClick: y, children: i ? "Copied!" : "Copy" }),
1576
+ b ? /* @__PURE__ */ p("span", { className: "cedros-readonly-secret-confirm", children: [
1577
+ /* @__PURE__ */ e("span", { className: "cedros-readonly-secret-confirm-text", children: "Update deploy secret too?" }),
1578
+ /* @__PURE__ */ e(
1579
+ "button",
1580
+ {
1581
+ type: "button",
1582
+ className: "cedros-secret-action-btn cedros-secret-action-btn--danger",
1583
+ onClick: w,
1584
+ disabled: u,
1585
+ children: u ? "Regenerating..." : "Confirm"
1586
+ }
1587
+ ),
1588
+ /* @__PURE__ */ e(
1589
+ "button",
1590
+ {
1591
+ type: "button",
1592
+ className: "cedros-secret-action-btn",
1593
+ onClick: () => h(!1),
1594
+ disabled: u,
1595
+ children: "Cancel"
1596
+ }
1597
+ )
1598
+ ] }) : /* @__PURE__ */ e(
1599
+ "button",
1600
+ {
1601
+ type: "button",
1602
+ className: "cedros-secret-action-btn cedros-secret-action-btn--danger",
1603
+ onClick: () => h(!0),
1604
+ disabled: u,
1605
+ children: "Regenerate"
1606
+ }
1607
+ )
1608
+ ] }),
1609
+ o && /* @__PURE__ */ e("p", { className: "cedros-readonly-secret-error", children: o })
1610
+ ] });
1611
+ }
1612
+ function K({ value: t, onChange: s }) {
1613
+ const a = x(() => {
1429
1614
  try {
1430
- return JSON.parse(e || "[]");
1615
+ return JSON.parse(t || "[]");
1431
1616
  } catch {
1432
1617
  return [];
1433
1618
  }
1434
- }, [e]), n = d(
1435
- (o) => {
1436
- l(JSON.stringify(o));
1619
+ }, [t]), r = m(
1620
+ (n) => {
1621
+ s(JSON.stringify(n));
1437
1622
  },
1438
- [l]
1439
- ), s = d(() => {
1440
- 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);
1623
+ [s]
1624
+ ), i = m(() => {
1625
+ r([...a, { symbol: "", mint: "", decimals: 6 }]);
1626
+ }, [a, r]), l = m(
1627
+ (n, o, c) => {
1628
+ const b = [...a];
1629
+ b[n] = { ...b[n], [o]: c }, r(b);
1445
1630
  },
1446
- [a, n]
1447
- ), p = d(
1448
- (o) => {
1449
- n(a.filter((r, c) => c !== o));
1631
+ [a, r]
1632
+ ), u = m(
1633
+ (n) => {
1634
+ r(a.filter((o, c) => c !== n));
1450
1635
  },
1451
- [a, n]
1636
+ [a, r]
1452
1637
  );
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)) })
1638
+ return /* @__PURE__ */ p("div", { className: "cedros-token-list-input", children: [
1639
+ /* @__PURE__ */ p("div", { className: "cedros-token-presets", children: [
1640
+ /* @__PURE__ */ e("span", { className: "cedros-token-presets-label", children: "Built-in tokens:" }),
1641
+ /* @__PURE__ */ e("div", { className: "cedros-token-presets-list", children: R.map((n) => /* @__PURE__ */ e("span", { className: "cedros-token-preset-chip", children: n }, n)) })
1457
1642
  ] }),
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(
1643
+ 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." }),
1644
+ a.map((n, o) => /* @__PURE__ */ p("div", { className: "cedros-token-row", children: [
1645
+ /* @__PURE__ */ p("div", { className: "cedros-token-row-fields", children: [
1646
+ /* @__PURE__ */ e(
1462
1647
  "input",
1463
1648
  {
1464
1649
  type: "text",
1465
1650
  placeholder: "Symbol",
1466
- value: o.symbol,
1467
- onChange: (c) => i(r, "symbol", c.target.value.toUpperCase()),
1651
+ value: n.symbol,
1652
+ onChange: (c) => l(o, "symbol", c.target.value.toUpperCase()),
1468
1653
  className: "cedros-setting-input cedros-token-input-symbol",
1469
1654
  maxLength: 10
1470
1655
  }
1471
1656
  ),
1472
- /* @__PURE__ */ t(
1657
+ /* @__PURE__ */ e(
1473
1658
  "input",
1474
1659
  {
1475
1660
  type: "text",
1476
1661
  placeholder: "Mint address",
1477
- value: o.mint,
1478
- onChange: (c) => i(r, "mint", c.target.value),
1662
+ value: n.mint,
1663
+ onChange: (c) => l(o, "mint", c.target.value),
1479
1664
  className: "cedros-setting-input cedros-token-input-mint"
1480
1665
  }
1481
1666
  ),
1482
- /* @__PURE__ */ t(
1667
+ /* @__PURE__ */ e(
1483
1668
  "input",
1484
1669
  {
1485
1670
  type: "number",
1486
1671
  placeholder: "Decimals",
1487
- value: o.decimals,
1488
- onChange: (c) => i(r, "decimals", parseInt(c.target.value, 10) || 0),
1672
+ value: n.decimals,
1673
+ onChange: (c) => l(o, "decimals", parseInt(c.target.value, 10) || 0),
1489
1674
  className: "cedros-setting-input cedros-token-input-decimals",
1490
1675
  min: 0,
1491
1676
  max: 18
1492
1677
  }
1493
1678
  ),
1494
- /* @__PURE__ */ t(
1679
+ /* @__PURE__ */ e(
1495
1680
  "input",
1496
1681
  {
1497
1682
  type: "text",
1498
1683
  placeholder: "Logo URL (optional)",
1499
- value: o.logoUrl || "",
1500
- onChange: (c) => i(r, "logoUrl", c.target.value || void 0),
1684
+ value: n.logoUrl || "",
1685
+ onChange: (c) => l(o, "logoUrl", c.target.value || void 0),
1501
1686
  className: "cedros-setting-input cedros-token-input-logo"
1502
1687
  }
1503
1688
  )
1504
1689
  ] }),
1505
- /* @__PURE__ */ t(
1690
+ /* @__PURE__ */ e(
1506
1691
  "button",
1507
1692
  {
1508
1693
  type: "button",
1509
1694
  className: "cedros-token-remove-btn",
1510
- onClick: () => p(r),
1695
+ onClick: () => u(o),
1511
1696
  title: "Remove token",
1512
1697
  children: "×"
1513
1698
  }
1514
1699
  )
1515
- ] }, r)),
1516
- /* @__PURE__ */ t("button", { type: "button", className: "cedros-token-add-btn", onClick: s, children: "+ Add Token" })
1700
+ ] }, o)),
1701
+ /* @__PURE__ */ e("button", { type: "button", className: "cedros-token-add-btn", onClick: i, children: "+ Add Token" })
1517
1702
  ] });
1518
1703
  }
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);
1704
+ function z({ value: t, onChange: s }) {
1705
+ const a = x(() => t.split(",").map((l) => l.trim()).filter(Boolean), [t]), r = m(
1706
+ (l) => {
1707
+ if (!l || a.includes(l)) return;
1708
+ const u = [...a, l].join(", ");
1709
+ s(u);
1525
1710
  },
1526
- [a, l]
1527
- ), s = d(
1528
- (i) => {
1529
- const p = a.filter((o) => o !== i).join(", ");
1530
- l(p);
1711
+ [a, s]
1712
+ ), i = m(
1713
+ (l) => {
1714
+ const u = a.filter((n) => n !== l).join(", ");
1715
+ s(u);
1531
1716
  },
1532
- [a, l]
1717
+ [a, s]
1533
1718
  );
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(
1719
+ return /* @__PURE__ */ p("div", { className: "cedros-token-symbol-list-input", children: [
1720
+ /* @__PURE__ */ p("div", { className: "cedros-token-presets", children: [
1721
+ /* @__PURE__ */ e("span", { className: "cedros-token-presets-label", children: "Click to add:" }),
1722
+ /* @__PURE__ */ e("div", { className: "cedros-token-presets-list", children: R.map((l) => {
1723
+ const u = a.includes(l);
1724
+ return /* @__PURE__ */ p(
1540
1725
  "button",
1541
1726
  {
1542
1727
  type: "button",
1543
- 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}`,
1728
+ className: `cedros-token-preset-chip ${u ? "cedros-token-preset-chip-selected" : ""}`,
1729
+ onClick: () => u ? i(l) : r(l),
1730
+ title: u ? `Remove ${l}` : `Add ${l}`,
1546
1731
  children: [
1547
- i,
1548
- p && /* @__PURE__ */ t("span", { className: "cedros-token-chip-check", children: "✓" })
1732
+ l,
1733
+ u && /* @__PURE__ */ e("span", { className: "cedros-token-chip-check", children: "✓" })
1549
1734
  ]
1550
1735
  },
1551
- i
1736
+ l
1552
1737
  );
1553
1738
  }) })
1554
1739
  ] }),
1555
- /* @__PURE__ */ t(
1740
+ /* @__PURE__ */ e(
1556
1741
  "input",
1557
1742
  {
1558
1743
  type: "text",
1559
- value: e,
1560
- onChange: (i) => l(i.target.value),
1744
+ value: t,
1745
+ onChange: (l) => s(l.target.value),
1561
1746
  className: "cedros-setting-input",
1562
1747
  placeholder: "USDC, SOL, BONK..."
1563
1748
  }
1564
1749
  )
1565
1750
  ] });
1566
1751
  }
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({});
1752
+ const Y = 800, X = 2e3;
1753
+ function ie() {
1754
+ const { settings: t, isLoading: s, error: a, fetchSettings: r, updateSettings: i } = U(), [l, u] = v({}), [n, o] = v("idle"), [c, b] = v(null), h = P(null), _ = P(null), k = P({});
1570
1755
  O(() => () => {
1571
- y.current && clearTimeout(y.current), _.current && clearTimeout(_.current);
1756
+ h.current && clearTimeout(h.current), _.current && clearTimeout(_.current);
1572
1757
  }, []);
1573
- const P = d(async () => {
1574
- const h = { ...k.current };
1575
- if (Object.keys(h).length === 0) {
1576
- r("idle");
1758
+ const g = m(async () => {
1759
+ const y = { ...k.current };
1760
+ if (Object.keys(y).length === 0) {
1761
+ o("idle");
1577
1762
  return;
1578
1763
  }
1579
- r("saving"), m(null);
1580
- const v = Object.entries(h).map(([b, g]) => ({
1581
- key: b,
1582
- value: g
1764
+ o("saving"), b(null);
1765
+ const w = Object.entries(y).map(([d, f]) => ({
1766
+ key: d,
1767
+ value: f
1583
1768
  }));
1584
1769
  try {
1585
- await s(v), p((b) => {
1586
- const g = { ...b };
1587
- for (const D of Object.keys(h))
1588
- delete g[D];
1589
- return g;
1770
+ await i(w), u((d) => {
1771
+ const f = { ...d };
1772
+ for (const S of Object.keys(y))
1773
+ delete f[S];
1774
+ return f;
1590
1775
  });
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");
1776
+ for (const d of Object.keys(y))
1777
+ delete k.current[d];
1778
+ o("saved"), _.current && clearTimeout(_.current), _.current = setTimeout(() => {
1779
+ o("idle");
1780
+ }, X);
1781
+ } catch (d) {
1782
+ o("error"), b(d instanceof Error ? d.message : "Failed to save");
1598
1783
  }
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);
1784
+ }, [i]), N = m(
1785
+ (y, w) => {
1786
+ u((d) => ({ ...d, [y]: w })), k.current[y] = w, b(null), o("pending"), h.current && clearTimeout(h.current), h.current = setTimeout(() => {
1787
+ g();
1788
+ }, Y);
1604
1789
  },
1605
- [P]
1606
- ), L = d(
1607
- (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;
1790
+ [g]
1791
+ ), C = m(
1792
+ (y) => {
1793
+ if (l[y] !== void 0) return l[y];
1794
+ for (const w of Object.values(t)) {
1795
+ const d = w.find((f) => f.key === y);
1796
+ if (d) return d.value;
1612
1797
  }
1613
1798
  return "";
1614
1799
  },
1615
- [i, e]
1800
+ [l, t]
1616
1801
  );
1617
1802
  return {
1618
- settings: e,
1619
- edits: i,
1620
- isLoading: l,
1621
- autosaveStatus: o,
1803
+ settings: t,
1804
+ edits: l,
1805
+ isLoading: s,
1806
+ autosaveStatus: n,
1622
1807
  autosaveError: c,
1623
1808
  error: a,
1624
- fetchSettings: n,
1625
- handleChange: C,
1626
- getEffectiveValue: L
1809
+ fetchSettings: r,
1810
+ handleChange: N,
1811
+ getEffectiveValue: C
1627
1812
  };
1628
1813
  }
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" })
1814
+ function le({ status: t, error: s }) {
1815
+ return t === "idle" ? null : /* @__PURE__ */ p("div", { className: `cedros-autosave-status cedros-autosave-status--${t}`, children: [
1816
+ t === "pending" && /* @__PURE__ */ p(T, { children: [
1817
+ /* @__PURE__ */ e("span", { className: "cedros-autosave-dot" }),
1818
+ /* @__PURE__ */ e("span", { children: "Unsaved changes" })
1634
1819
  ] }),
1635
- e === "saving" && /* @__PURE__ */ u(f, { children: [
1636
- /* @__PURE__ */ t("span", { className: "cedros-autosave-spinner" }),
1637
- /* @__PURE__ */ t("span", { children: "Saving..." })
1820
+ t === "saving" && /* @__PURE__ */ p(T, { children: [
1821
+ /* @__PURE__ */ e("span", { className: "cedros-autosave-spinner" }),
1822
+ /* @__PURE__ */ e("span", { children: "Saving..." })
1638
1823
  ] }),
1639
- e === "saved" && /* @__PURE__ */ u(f, { children: [
1640
- /* @__PURE__ */ t("span", { className: "cedros-autosave-check", children: "✓" }),
1641
- /* @__PURE__ */ t("span", { children: "Saved" })
1824
+ t === "saved" && /* @__PURE__ */ p(T, { children: [
1825
+ /* @__PURE__ */ e("span", { className: "cedros-autosave-check", children: "✓" }),
1826
+ /* @__PURE__ */ e("span", { children: "Saved" })
1642
1827
  ] }),
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" })
1828
+ t === "error" && /* @__PURE__ */ p(T, { children: [
1829
+ /* @__PURE__ */ e("span", { className: "cedros-autosave-error-icon", children: "!" }),
1830
+ /* @__PURE__ */ e("span", { children: s || "Save failed" })
1646
1831
  ] })
1647
1832
  ] });
1648
1833
  }
1649
1834
  export {
1650
- ee as A,
1651
- X as C,
1652
- Q as S,
1653
- U as a,
1654
- Z as u
1835
+ le as A,
1836
+ ae as C,
1837
+ se as S,
1838
+ W as a,
1839
+ ie as u
1655
1840
  };