@cedros/login-react 0.0.40 → 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.
- package/dist/{AuthenticationSettings-DUXpyiJ5.js → AuthenticationSettings-CSoFp-_2.js} +1 -1
- package/dist/{AuthenticationSettings-DUXpyiJ5.js.map → AuthenticationSettings-CSoFp-_2.js.map} +1 -1
- package/dist/{AuthenticationSettings-Dk1LX0CK.cjs → AuthenticationSettings-Cu5Z2mTC.cjs} +1 -1
- package/dist/{AuthenticationSettings-Dk1LX0CK.cjs.map → AuthenticationSettings-Cu5Z2mTC.cjs.map} +1 -1
- package/dist/{AuthenticationSettings-BF_7Ea6Z.js → AuthenticationSettings-D4ExU-2a.js} +1 -1
- package/dist/{AuthenticationSettings-BF_7Ea6Z.js.map → AuthenticationSettings-D4ExU-2a.js.map} +1 -1
- package/dist/{AuthenticationSettings-BMDrCVSf.cjs → AuthenticationSettings-DABzZHuI.cjs} +1 -1
- package/dist/{AuthenticationSettings-BMDrCVSf.cjs.map → AuthenticationSettings-DABzZHuI.cjs.map} +1 -1
- package/dist/AutosaveStatus-B1A1zORa.cjs +1 -0
- package/dist/AutosaveStatus-B1A1zORa.cjs.map +1 -0
- package/dist/{AutosaveStatus-CSZsp6w7.js → AutosaveStatus-DMjvXzP2.js} +526 -341
- package/dist/AutosaveStatus-DMjvXzP2.js.map +1 -0
- package/dist/CreditSystemSettings-BWuiRTtA.cjs +1 -0
- package/dist/CreditSystemSettings-BWuiRTtA.cjs.map +1 -0
- package/dist/{CreditSystemSettings-Cj21_Ug8.js → CreditSystemSettings-BjQdysRS.js} +1 -1
- package/dist/{CreditSystemSettings-Cj21_Ug8.js.map → CreditSystemSettings-BjQdysRS.js.map} +1 -1
- package/dist/{CreditSystemSettings-CLImarX-.cjs → CreditSystemSettings-DfSfQVE8.cjs} +1 -1
- package/dist/{CreditSystemSettings-CLImarX-.cjs.map → CreditSystemSettings-DfSfQVE8.cjs.map} +1 -1
- package/dist/{CreditSystemSettings-Buu7Y-7I.js → CreditSystemSettings-Du3ac0ID.js} +12 -7
- package/dist/CreditSystemSettings-Du3ac0ID.js.map +1 -0
- package/dist/EmailRegisterForm-CMXsa-_r.js +750 -0
- package/dist/EmailRegisterForm-CMXsa-_r.js.map +1 -0
- package/dist/EmailRegisterForm-i7f4St2N.cjs +1 -0
- package/dist/EmailRegisterForm-i7f4St2N.cjs.map +1 -0
- package/dist/EmailSettings-ASDHfI0K.js +86 -0
- package/dist/EmailSettings-ASDHfI0K.js.map +1 -0
- package/dist/EmailSettings-BcHo0cqk.cjs +1 -0
- package/dist/EmailSettings-BcHo0cqk.cjs.map +1 -0
- package/dist/{EmailSettings-CmxxnrA9.js → EmailSettings-CjngJwDS.js} +1 -1
- package/dist/{EmailSettings-CmxxnrA9.js.map → EmailSettings-CjngJwDS.js.map} +1 -1
- package/dist/{EmailSettings-9sdEAONl.cjs → EmailSettings-CswtKXhb.cjs} +1 -1
- package/dist/{EmailSettings-9sdEAONl.cjs.map → EmailSettings-CswtKXhb.cjs.map} +1 -1
- package/dist/{EmbeddedWalletSettings-BuLN_Uqc.cjs → EmbeddedWalletSettings-BXlboZ9-.cjs} +1 -1
- package/dist/{EmbeddedWalletSettings-BuLN_Uqc.cjs.map → EmbeddedWalletSettings-BXlboZ9-.cjs.map} +1 -1
- package/dist/{EmbeddedWalletSettings-DGq-kXbw.cjs → EmbeddedWalletSettings-BkwIbTkL.cjs} +1 -1
- package/dist/{EmbeddedWalletSettings-DGq-kXbw.cjs.map → EmbeddedWalletSettings-BkwIbTkL.cjs.map} +1 -1
- package/dist/{EmbeddedWalletSettings-CHkkCjyR.js → EmbeddedWalletSettings-CPLbqlxJ.js} +1 -1
- package/dist/{EmbeddedWalletSettings-CHkkCjyR.js.map → EmbeddedWalletSettings-CPLbqlxJ.js.map} +1 -1
- package/dist/{EmbeddedWalletSettings-M-D5N0eY.js → EmbeddedWalletSettings-CUY_X7Vj.js} +1 -1
- package/dist/{EmbeddedWalletSettings-M-D5N0eY.js.map → EmbeddedWalletSettings-CUY_X7Vj.js.map} +1 -1
- package/dist/{PermissionsSection-DEMVp7X3.cjs → PermissionsSection-B-6DJnN8.cjs} +1 -1
- package/dist/{PermissionsSection-DEMVp7X3.cjs.map → PermissionsSection-B-6DJnN8.cjs.map} +1 -1
- package/dist/{PermissionsSection-DNzOL1xW.js → PermissionsSection-BeFhIgQy.js} +22 -18
- package/dist/{PermissionsSection-DNzOL1xW.js.map → PermissionsSection-BeFhIgQy.js.map} +1 -1
- package/dist/{ServerSettings-DQemMrNv.js → ServerSettings-B9PNMse1.js} +1 -1
- package/dist/{ServerSettings-DQemMrNv.js.map → ServerSettings-B9PNMse1.js.map} +1 -1
- package/dist/{ServerSettings-qxi8aZO7.js → ServerSettings-BLoWX7KG.js} +1 -1
- package/dist/{ServerSettings-qxi8aZO7.js.map → ServerSettings-BLoWX7KG.js.map} +1 -1
- package/dist/{ServerSettings-CMmH5pZv.cjs → ServerSettings-BygCxOTY.cjs} +1 -1
- package/dist/{ServerSettings-CMmH5pZv.cjs.map → ServerSettings-BygCxOTY.cjs.map} +1 -1
- package/dist/{ServerSettings-DfimU7ay.cjs → ServerSettings-CgBdYspU.cjs} +1 -1
- package/dist/{ServerSettings-DfimU7ay.cjs.map → ServerSettings-CgBdYspU.cjs.map} +1 -1
- package/dist/{TeamSection-DopbZClq.cjs → TeamSection-B1t1tU-_.cjs} +1 -1
- package/dist/{TeamSection-DopbZClq.cjs.map → TeamSection-B1t1tU-_.cjs.map} +1 -1
- package/dist/{TeamSection-CoMXyFtz.js → TeamSection-DbSYDRdI.js} +1 -1
- package/dist/{TeamSection-CoMXyFtz.js.map → TeamSection-DbSYDRdI.js.map} +1 -1
- package/dist/{WebhookSettings-B8hAwhZ2.js → WebhookSettings-C-7Yxueu.js} +1 -1
- package/dist/{WebhookSettings-B8hAwhZ2.js.map → WebhookSettings-C-7Yxueu.js.map} +1 -1
- package/dist/{WebhookSettings-8QAqvkkO.js → WebhookSettings-C923ZSKa.js} +1 -1
- package/dist/{WebhookSettings-8QAqvkkO.js.map → WebhookSettings-C923ZSKa.js.map} +1 -1
- package/dist/{WebhookSettings-0sgWRI3U.cjs → WebhookSettings-CbU3cfTJ.cjs} +1 -1
- package/dist/{WebhookSettings-0sgWRI3U.cjs.map → WebhookSettings-CbU3cfTJ.cjs.map} +1 -1
- package/dist/{WebhookSettings-B6Y3Tnjv.cjs → WebhookSettings-D19u9Uok.cjs} +1 -1
- package/dist/{WebhookSettings-B6Y3Tnjv.cjs.map → WebhookSettings-D19u9Uok.cjs.map} +1 -1
- package/dist/admin-only.cjs +1 -1
- package/dist/admin-only.js +1 -1
- package/dist/email-only.cjs +1 -1
- package/dist/email-only.d.ts +1 -1
- package/dist/email-only.js +1 -1
- package/dist/index.cjs +13 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3766 -3624
- package/dist/index.js.map +1 -1
- package/dist/login-react.css +1 -1
- package/dist/{plugin-C_NDZ2-D.js → plugin-BiftIhZe.js} +1 -1
- package/dist/{plugin-C_NDZ2-D.js.map → plugin-BiftIhZe.js.map} +1 -1
- package/dist/{plugin-CUxpAjL-.cjs → plugin-BtQdI_Ay.cjs} +1 -1
- package/dist/{plugin-CUxpAjL-.cjs.map → plugin-BtQdI_Ay.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/AutosaveStatus-BKsCIvPj.cjs +0 -1
- package/dist/AutosaveStatus-BKsCIvPj.cjs.map +0 -1
- package/dist/AutosaveStatus-CSZsp6w7.js.map +0 -1
- package/dist/CreditSystemSettings-Buu7Y-7I.js.map +0 -1
- package/dist/CreditSystemSettings-C2HkyMXy.cjs +0 -1
- package/dist/CreditSystemSettings-C2HkyMXy.cjs.map +0 -1
- package/dist/EmailRegisterForm-CNjYrqU6.cjs +0 -1
- package/dist/EmailRegisterForm-CNjYrqU6.cjs.map +0 -1
- package/dist/EmailRegisterForm-D2VaJouj.js +0 -750
- package/dist/EmailRegisterForm-D2VaJouj.js.map +0 -1
- package/dist/EmailSettings-DRfOF0Sf.js +0 -78
- package/dist/EmailSettings-DRfOF0Sf.js.map +0 -1
- package/dist/EmailSettings-eLlzzI5D.cjs +0 -1
- package/dist/EmailSettings-eLlzzI5D.cjs.map +0 -1
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { u as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
|
9
|
-
const { days:
|
|
10
|
-
return
|
|
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
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
|
1050
|
-
const
|
|
1051
|
-
return
|
|
1052
|
-
const
|
|
1053
|
-
return
|
|
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
|
|
1057
|
-
settings:
|
|
1058
|
-
edits:
|
|
1169
|
+
function se({
|
|
1170
|
+
settings: t,
|
|
1171
|
+
edits: s,
|
|
1059
1172
|
onChange: a,
|
|
1060
|
-
externalWarnings:
|
|
1173
|
+
externalWarnings: r
|
|
1061
1174
|
}) {
|
|
1062
|
-
return /* @__PURE__ */
|
|
1063
|
-
|
|
1175
|
+
return /* @__PURE__ */ e("div", { className: "cedros-settings-grid", children: t.map((i) => /* @__PURE__ */ e(
|
|
1176
|
+
F,
|
|
1064
1177
|
{
|
|
1065
|
-
setting:
|
|
1066
|
-
editValue:
|
|
1178
|
+
setting: i,
|
|
1179
|
+
editValue: s[i.key],
|
|
1067
1180
|
onChange: a,
|
|
1068
|
-
externalWarning:
|
|
1181
|
+
externalWarning: r?.[i.key]
|
|
1069
1182
|
},
|
|
1070
|
-
|
|
1183
|
+
i.key
|
|
1071
1184
|
)) });
|
|
1072
1185
|
}
|
|
1073
|
-
function
|
|
1074
|
-
const
|
|
1075
|
-
if (
|
|
1076
|
-
if (!
|
|
1077
|
-
const c = parseInt(
|
|
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:
|
|
1080
|
-
return
|
|
1081
|
-
}, [
|
|
1082
|
-
return
|
|
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 ${
|
|
1086
|
-
children:
|
|
1087
|
-
/* @__PURE__ */
|
|
1088
|
-
/* @__PURE__ */
|
|
1089
|
-
|
|
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:
|
|
1092
|
-
value:
|
|
1093
|
-
onChange: (c) => a(
|
|
1204
|
+
meta: i,
|
|
1205
|
+
value: l,
|
|
1206
|
+
onChange: (c) => a(t.key, c)
|
|
1094
1207
|
}
|
|
1095
1208
|
),
|
|
1096
|
-
|
|
1209
|
+
o && /* @__PURE__ */ e("div", { className: "cedros-setting-warning", children: o })
|
|
1097
1210
|
] }),
|
|
1098
|
-
/* @__PURE__ */
|
|
1099
|
-
/* @__PURE__ */
|
|
1100
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1103
|
-
/* @__PURE__ */
|
|
1104
|
-
/* @__PURE__ */
|
|
1105
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1108
|
-
/* @__PURE__ */
|
|
1109
|
-
|
|
1220
|
+
/* @__PURE__ */ p("div", { className: "cedros-setting-control", children: [
|
|
1221
|
+
/* @__PURE__ */ e(
|
|
1222
|
+
D,
|
|
1110
1223
|
{
|
|
1111
|
-
meta:
|
|
1112
|
-
value:
|
|
1113
|
-
onChange: (c) => a(
|
|
1224
|
+
meta: i,
|
|
1225
|
+
value: l,
|
|
1226
|
+
onChange: (c) => a(t.key, c)
|
|
1114
1227
|
}
|
|
1115
1228
|
),
|
|
1116
|
-
|
|
1229
|
+
o && /* @__PURE__ */ e("div", { className: "cedros-setting-warning", children: o })
|
|
1117
1230
|
] })
|
|
1118
1231
|
] })
|
|
1119
1232
|
}
|
|
1120
|
-
) : /* @__PURE__ */
|
|
1121
|
-
/* @__PURE__ */
|
|
1122
|
-
/* @__PURE__ */
|
|
1123
|
-
|
|
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__ */
|
|
1238
|
+
/* @__PURE__ */ e("div", { className: "cedros-setting-input-wrapper", children: /* @__PURE__ */ e(
|
|
1126
1239
|
"input",
|
|
1127
1240
|
{
|
|
1128
1241
|
type: "text",
|
|
1129
|
-
value:
|
|
1130
|
-
onChange: (c) => a(
|
|
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
|
|
1137
|
-
switch (
|
|
1249
|
+
function D({ meta: t, value: s, onChange: a }) {
|
|
1250
|
+
switch (t.inputType) {
|
|
1138
1251
|
case "duration":
|
|
1139
|
-
return /* @__PURE__ */
|
|
1252
|
+
return /* @__PURE__ */ e(q, { value: s, onChange: a, presets: t.presets, min: t.min });
|
|
1140
1253
|
case "percentage":
|
|
1141
|
-
return /* @__PURE__ */
|
|
1142
|
-
|
|
1254
|
+
return /* @__PURE__ */ e(
|
|
1255
|
+
$,
|
|
1143
1256
|
{
|
|
1144
|
-
value:
|
|
1257
|
+
value: s,
|
|
1145
1258
|
onChange: a,
|
|
1146
|
-
min:
|
|
1147
|
-
max:
|
|
1148
|
-
step:
|
|
1149
|
-
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__ */
|
|
1154
|
-
|
|
1266
|
+
return /* @__PURE__ */ e(
|
|
1267
|
+
B,
|
|
1155
1268
|
{
|
|
1156
|
-
value:
|
|
1269
|
+
value: s,
|
|
1157
1270
|
onChange: a,
|
|
1158
|
-
presets:
|
|
1159
|
-
unit:
|
|
1271
|
+
presets: t.presets ?? [],
|
|
1272
|
+
unit: t.unit
|
|
1160
1273
|
}
|
|
1161
1274
|
);
|
|
1162
1275
|
case "number":
|
|
1163
|
-
return /* @__PURE__ */
|
|
1164
|
-
|
|
1276
|
+
return /* @__PURE__ */ e(
|
|
1277
|
+
J,
|
|
1165
1278
|
{
|
|
1166
|
-
value:
|
|
1279
|
+
value: s,
|
|
1167
1280
|
onChange: a,
|
|
1168
|
-
min:
|
|
1169
|
-
max:
|
|
1170
|
-
unit:
|
|
1281
|
+
min: t.min,
|
|
1282
|
+
max: t.max,
|
|
1283
|
+
unit: t.unit
|
|
1171
1284
|
}
|
|
1172
1285
|
);
|
|
1173
1286
|
case "tokenList":
|
|
1174
|
-
return /* @__PURE__ */
|
|
1287
|
+
return /* @__PURE__ */ e(K, { value: s, onChange: a });
|
|
1175
1288
|
case "text":
|
|
1176
|
-
return /* @__PURE__ */
|
|
1289
|
+
return /* @__PURE__ */ e(
|
|
1177
1290
|
"input",
|
|
1178
1291
|
{
|
|
1179
1292
|
type: "text",
|
|
1180
|
-
value:
|
|
1181
|
-
onChange: (
|
|
1293
|
+
value: s,
|
|
1294
|
+
onChange: (r) => a(r.target.value),
|
|
1182
1295
|
className: "cedros-setting-input",
|
|
1183
|
-
placeholder:
|
|
1296
|
+
placeholder: t.label
|
|
1184
1297
|
}
|
|
1185
1298
|
);
|
|
1186
1299
|
case "boolean":
|
|
1187
|
-
return /* @__PURE__ */
|
|
1300
|
+
return /* @__PURE__ */ e(V, { value: s, onChange: a });
|
|
1188
1301
|
case "secret":
|
|
1189
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
1306
|
+
return /* @__PURE__ */ e(z, { value: s, onChange: a });
|
|
1192
1307
|
default:
|
|
1193
|
-
return /* @__PURE__ */
|
|
1308
|
+
return /* @__PURE__ */ e(
|
|
1194
1309
|
"input",
|
|
1195
1310
|
{
|
|
1196
1311
|
type: "text",
|
|
1197
|
-
value:
|
|
1198
|
-
onChange: (
|
|
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
|
|
1205
|
-
const
|
|
1206
|
-
(
|
|
1207
|
-
|
|
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
|
-
[
|
|
1210
|
-
),
|
|
1211
|
-
(
|
|
1212
|
-
const c = Math.max(
|
|
1213
|
-
|
|
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
|
-
[
|
|
1330
|
+
[s, r]
|
|
1216
1331
|
);
|
|
1217
|
-
return /* @__PURE__ */
|
|
1218
|
-
a && a.length > 0 && /* @__PURE__ */
|
|
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((
|
|
1222
|
-
onChange:
|
|
1336
|
+
value: a.find((o) => o.value === t)?.value ?? "",
|
|
1337
|
+
onChange: u,
|
|
1223
1338
|
className: "cedros-setting-select",
|
|
1224
1339
|
children: [
|
|
1225
|
-
/* @__PURE__ */
|
|
1226
|
-
a.map((
|
|
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__ */
|
|
1231
|
-
/* @__PURE__ */
|
|
1345
|
+
/* @__PURE__ */ p("div", { className: "cedros-duration-custom", children: [
|
|
1346
|
+
/* @__PURE__ */ e(
|
|
1232
1347
|
"input",
|
|
1233
1348
|
{
|
|
1234
1349
|
type: "number",
|
|
1235
|
-
value:
|
|
1236
|
-
onChange:
|
|
1237
|
-
min:
|
|
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__ */
|
|
1242
|
-
/* @__PURE__ */
|
|
1356
|
+
/* @__PURE__ */ e("span", { className: "cedros-setting-unit", children: "seconds" }),
|
|
1357
|
+
/* @__PURE__ */ p("span", { className: "cedros-duration-display", children: [
|
|
1243
1358
|
"= ",
|
|
1244
|
-
|
|
1359
|
+
l
|
|
1245
1360
|
] })
|
|
1246
1361
|
] })
|
|
1247
1362
|
] });
|
|
1248
1363
|
}
|
|
1249
|
-
function
|
|
1250
|
-
value:
|
|
1251
|
-
onChange:
|
|
1364
|
+
function $({
|
|
1365
|
+
value: t,
|
|
1366
|
+
onChange: s,
|
|
1252
1367
|
min: a,
|
|
1253
|
-
max:
|
|
1254
|
-
step:
|
|
1255
|
-
presets:
|
|
1368
|
+
max: r,
|
|
1369
|
+
step: i,
|
|
1370
|
+
presets: l
|
|
1256
1371
|
}) {
|
|
1257
|
-
const
|
|
1372
|
+
const u = parseInt(t, 10) || a, n = m(
|
|
1258
1373
|
(c) => {
|
|
1259
|
-
|
|
1374
|
+
s(c.target.value);
|
|
1260
1375
|
},
|
|
1261
|
-
[
|
|
1262
|
-
),
|
|
1376
|
+
[s]
|
|
1377
|
+
), o = m(
|
|
1263
1378
|
(c) => {
|
|
1264
|
-
|
|
1379
|
+
s(c);
|
|
1265
1380
|
},
|
|
1266
|
-
[
|
|
1381
|
+
[s]
|
|
1267
1382
|
);
|
|
1268
|
-
return /* @__PURE__ */
|
|
1269
|
-
/* @__PURE__ */
|
|
1270
|
-
/* @__PURE__ */
|
|
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:
|
|
1275
|
-
onChange:
|
|
1389
|
+
value: u,
|
|
1390
|
+
onChange: n,
|
|
1276
1391
|
min: a,
|
|
1277
|
-
max:
|
|
1278
|
-
step:
|
|
1392
|
+
max: r,
|
|
1393
|
+
step: i,
|
|
1279
1394
|
className: "cedros-percentage-slider"
|
|
1280
1395
|
}
|
|
1281
1396
|
),
|
|
1282
|
-
/* @__PURE__ */
|
|
1283
|
-
|
|
1397
|
+
/* @__PURE__ */ p("span", { className: "cedros-percentage-value", children: [
|
|
1398
|
+
u,
|
|
1284
1399
|
"%"
|
|
1285
1400
|
] })
|
|
1286
1401
|
] }),
|
|
1287
|
-
|
|
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 ===
|
|
1292
|
-
onClick: () =>
|
|
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
|
|
1300
|
-
const
|
|
1301
|
-
(
|
|
1302
|
-
|
|
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
|
-
[
|
|
1305
|
-
),
|
|
1306
|
-
(
|
|
1307
|
-
|
|
1419
|
+
[s]
|
|
1420
|
+
), u = m(
|
|
1421
|
+
(n) => {
|
|
1422
|
+
s(n.target.value);
|
|
1308
1423
|
},
|
|
1309
|
-
[
|
|
1424
|
+
[s]
|
|
1310
1425
|
);
|
|
1311
|
-
return /* @__PURE__ */
|
|
1312
|
-
/* @__PURE__ */
|
|
1426
|
+
return /* @__PURE__ */ p("div", { className: "cedros-select-input", children: [
|
|
1427
|
+
/* @__PURE__ */ p(
|
|
1313
1428
|
"select",
|
|
1314
1429
|
{
|
|
1315
|
-
value:
|
|
1316
|
-
onChange:
|
|
1430
|
+
value: i ? "__custom__" : t,
|
|
1431
|
+
onChange: l,
|
|
1317
1432
|
className: "cedros-setting-select",
|
|
1318
1433
|
children: [
|
|
1319
|
-
a.map((
|
|
1320
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
1325
|
-
/* @__PURE__ */
|
|
1439
|
+
i && /* @__PURE__ */ p("div", { className: "cedros-select-custom", children: [
|
|
1440
|
+
/* @__PURE__ */ e(
|
|
1326
1441
|
"input",
|
|
1327
1442
|
{
|
|
1328
1443
|
type: "number",
|
|
1329
|
-
value:
|
|
1330
|
-
onChange:
|
|
1444
|
+
value: t,
|
|
1445
|
+
onChange: u,
|
|
1331
1446
|
className: "cedros-setting-input cedros-setting-input-sm"
|
|
1332
1447
|
}
|
|
1333
1448
|
),
|
|
1334
|
-
|
|
1449
|
+
r && /* @__PURE__ */ e("span", { className: "cedros-setting-unit", children: r })
|
|
1335
1450
|
] })
|
|
1336
1451
|
] });
|
|
1337
1452
|
}
|
|
1338
|
-
function
|
|
1339
|
-
const
|
|
1340
|
-
(
|
|
1341
|
-
|
|
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
|
-
[
|
|
1458
|
+
[s]
|
|
1344
1459
|
);
|
|
1345
|
-
return /* @__PURE__ */
|
|
1346
|
-
/* @__PURE__ */
|
|
1460
|
+
return /* @__PURE__ */ p("div", { className: "cedros-number-input", children: [
|
|
1461
|
+
/* @__PURE__ */ e(
|
|
1347
1462
|
"input",
|
|
1348
1463
|
{
|
|
1349
1464
|
type: "number",
|
|
1350
|
-
value:
|
|
1351
|
-
onChange:
|
|
1465
|
+
value: t,
|
|
1466
|
+
onChange: l,
|
|
1352
1467
|
min: a,
|
|
1353
|
-
max:
|
|
1468
|
+
max: r,
|
|
1354
1469
|
className: "cedros-setting-input"
|
|
1355
1470
|
}
|
|
1356
1471
|
),
|
|
1357
|
-
|
|
1472
|
+
i && /* @__PURE__ */ e("span", { className: "cedros-setting-unit", children: i })
|
|
1358
1473
|
] });
|
|
1359
1474
|
}
|
|
1360
|
-
function
|
|
1361
|
-
const a =
|
|
1362
|
-
|
|
1363
|
-
}, [a,
|
|
1364
|
-
return /* @__PURE__ */
|
|
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:
|
|
1486
|
+
onClick: r,
|
|
1372
1487
|
children: [
|
|
1373
|
-
/* @__PURE__ */
|
|
1374
|
-
/* @__PURE__ */
|
|
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
|
|
1380
|
-
const [
|
|
1381
|
-
|
|
1382
|
-
}, []), c =
|
|
1383
|
-
|
|
1384
|
-
}, []),
|
|
1385
|
-
(
|
|
1386
|
-
|
|
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
|
-
[
|
|
1503
|
+
[s]
|
|
1389
1504
|
);
|
|
1390
|
-
return !
|
|
1391
|
-
/* @__PURE__ */
|
|
1392
|
-
/* @__PURE__ */
|
|
1393
|
-
] }) : /* @__PURE__ */
|
|
1394
|
-
a ? /* @__PURE__ */
|
|
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:
|
|
1398
|
-
onChange:
|
|
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__ */
|
|
1518
|
+
) : /* @__PURE__ */ e(
|
|
1404
1519
|
"input",
|
|
1405
1520
|
{
|
|
1406
|
-
type:
|
|
1407
|
-
value:
|
|
1408
|
-
onChange:
|
|
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__ */
|
|
1414
|
-
!a && /* @__PURE__ */
|
|
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: () =>
|
|
1420
|
-
children:
|
|
1534
|
+
onClick: () => u(!l),
|
|
1535
|
+
children: l ? "Hide" : "Show"
|
|
1421
1536
|
}
|
|
1422
1537
|
),
|
|
1423
|
-
|
|
1538
|
+
r && /* @__PURE__ */ e("button", { type: "button", className: "cedros-secret-done-btn", onClick: c, children: "Done" })
|
|
1424
1539
|
] })
|
|
1425
1540
|
] });
|
|
1426
1541
|
}
|
|
1427
|
-
function
|
|
1428
|
-
const a =
|
|
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(
|
|
1615
|
+
return JSON.parse(t || "[]");
|
|
1431
1616
|
} catch {
|
|
1432
1617
|
return [];
|
|
1433
1618
|
}
|
|
1434
|
-
}, [
|
|
1435
|
-
(
|
|
1436
|
-
|
|
1619
|
+
}, [t]), r = m(
|
|
1620
|
+
(n) => {
|
|
1621
|
+
s(JSON.stringify(n));
|
|
1437
1622
|
},
|
|
1438
|
-
[
|
|
1439
|
-
),
|
|
1440
|
-
|
|
1441
|
-
}, [a,
|
|
1442
|
-
(
|
|
1443
|
-
const
|
|
1444
|
-
|
|
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,
|
|
1447
|
-
),
|
|
1448
|
-
(
|
|
1449
|
-
|
|
1631
|
+
[a, r]
|
|
1632
|
+
), u = m(
|
|
1633
|
+
(n) => {
|
|
1634
|
+
r(a.filter((o, c) => c !== n));
|
|
1450
1635
|
},
|
|
1451
|
-
[a,
|
|
1636
|
+
[a, r]
|
|
1452
1637
|
);
|
|
1453
|
-
return /* @__PURE__ */
|
|
1454
|
-
/* @__PURE__ */
|
|
1455
|
-
/* @__PURE__ */
|
|
1456
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1459
|
-
a.map((
|
|
1460
|
-
/* @__PURE__ */
|
|
1461
|
-
/* @__PURE__ */
|
|
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:
|
|
1467
|
-
onChange: (c) =>
|
|
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__ */
|
|
1657
|
+
/* @__PURE__ */ e(
|
|
1473
1658
|
"input",
|
|
1474
1659
|
{
|
|
1475
1660
|
type: "text",
|
|
1476
1661
|
placeholder: "Mint address",
|
|
1477
|
-
value:
|
|
1478
|
-
onChange: (c) =>
|
|
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__ */
|
|
1667
|
+
/* @__PURE__ */ e(
|
|
1483
1668
|
"input",
|
|
1484
1669
|
{
|
|
1485
1670
|
type: "number",
|
|
1486
1671
|
placeholder: "Decimals",
|
|
1487
|
-
value:
|
|
1488
|
-
onChange: (c) =>
|
|
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__ */
|
|
1679
|
+
/* @__PURE__ */ e(
|
|
1495
1680
|
"input",
|
|
1496
1681
|
{
|
|
1497
1682
|
type: "text",
|
|
1498
1683
|
placeholder: "Logo URL (optional)",
|
|
1499
|
-
value:
|
|
1500
|
-
onChange: (c) =>
|
|
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__ */
|
|
1690
|
+
/* @__PURE__ */ e(
|
|
1506
1691
|
"button",
|
|
1507
1692
|
{
|
|
1508
1693
|
type: "button",
|
|
1509
1694
|
className: "cedros-token-remove-btn",
|
|
1510
|
-
onClick: () =>
|
|
1695
|
+
onClick: () => u(o),
|
|
1511
1696
|
title: "Remove token",
|
|
1512
1697
|
children: "×"
|
|
1513
1698
|
}
|
|
1514
1699
|
)
|
|
1515
|
-
] },
|
|
1516
|
-
/* @__PURE__ */
|
|
1700
|
+
] }, o)),
|
|
1701
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cedros-token-add-btn", onClick: i, children: "+ Add Token" })
|
|
1517
1702
|
] });
|
|
1518
1703
|
}
|
|
1519
|
-
function
|
|
1520
|
-
const a =
|
|
1521
|
-
(
|
|
1522
|
-
if (!
|
|
1523
|
-
const
|
|
1524
|
-
|
|
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,
|
|
1527
|
-
),
|
|
1528
|
-
(
|
|
1529
|
-
const
|
|
1530
|
-
|
|
1711
|
+
[a, s]
|
|
1712
|
+
), i = m(
|
|
1713
|
+
(l) => {
|
|
1714
|
+
const u = a.filter((n) => n !== l).join(", ");
|
|
1715
|
+
s(u);
|
|
1531
1716
|
},
|
|
1532
|
-
[a,
|
|
1717
|
+
[a, s]
|
|
1533
1718
|
);
|
|
1534
|
-
return /* @__PURE__ */
|
|
1535
|
-
/* @__PURE__ */
|
|
1536
|
-
/* @__PURE__ */
|
|
1537
|
-
/* @__PURE__ */
|
|
1538
|
-
const
|
|
1539
|
-
return /* @__PURE__ */
|
|
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 ${
|
|
1544
|
-
onClick: () =>
|
|
1545
|
-
title:
|
|
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
|
-
|
|
1548
|
-
|
|
1732
|
+
l,
|
|
1733
|
+
u && /* @__PURE__ */ e("span", { className: "cedros-token-chip-check", children: "✓" })
|
|
1549
1734
|
]
|
|
1550
1735
|
},
|
|
1551
|
-
|
|
1736
|
+
l
|
|
1552
1737
|
);
|
|
1553
1738
|
}) })
|
|
1554
1739
|
] }),
|
|
1555
|
-
/* @__PURE__ */
|
|
1740
|
+
/* @__PURE__ */ e(
|
|
1556
1741
|
"input",
|
|
1557
1742
|
{
|
|
1558
1743
|
type: "text",
|
|
1559
|
-
value:
|
|
1560
|
-
onChange: (
|
|
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
|
|
1568
|
-
function
|
|
1569
|
-
const { settings:
|
|
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
|
-
|
|
1756
|
+
h.current && clearTimeout(h.current), _.current && clearTimeout(_.current);
|
|
1572
1757
|
}, []);
|
|
1573
|
-
const
|
|
1574
|
-
const
|
|
1575
|
-
if (Object.keys(
|
|
1576
|
-
|
|
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
|
-
|
|
1580
|
-
const
|
|
1581
|
-
key:
|
|
1582
|
-
value:
|
|
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
|
|
1586
|
-
const
|
|
1587
|
-
for (const
|
|
1588
|
-
delete
|
|
1589
|
-
return
|
|
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
|
|
1592
|
-
delete k.current[
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
},
|
|
1596
|
-
} catch (
|
|
1597
|
-
|
|
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
|
-
}, [
|
|
1600
|
-
(
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
},
|
|
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
|
-
[
|
|
1606
|
-
),
|
|
1607
|
-
(
|
|
1608
|
-
if (
|
|
1609
|
-
for (const
|
|
1610
|
-
const
|
|
1611
|
-
if (
|
|
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
|
-
[
|
|
1800
|
+
[l, t]
|
|
1616
1801
|
);
|
|
1617
1802
|
return {
|
|
1618
|
-
settings:
|
|
1619
|
-
edits:
|
|
1620
|
-
isLoading:
|
|
1621
|
-
autosaveStatus:
|
|
1803
|
+
settings: t,
|
|
1804
|
+
edits: l,
|
|
1805
|
+
isLoading: s,
|
|
1806
|
+
autosaveStatus: n,
|
|
1622
1807
|
autosaveError: c,
|
|
1623
1808
|
error: a,
|
|
1624
|
-
fetchSettings:
|
|
1625
|
-
handleChange:
|
|
1626
|
-
getEffectiveValue:
|
|
1809
|
+
fetchSettings: r,
|
|
1810
|
+
handleChange: N,
|
|
1811
|
+
getEffectiveValue: C
|
|
1627
1812
|
};
|
|
1628
1813
|
}
|
|
1629
|
-
function
|
|
1630
|
-
return
|
|
1631
|
-
|
|
1632
|
-
/* @__PURE__ */
|
|
1633
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
1636
|
-
/* @__PURE__ */
|
|
1637
|
-
/* @__PURE__ */
|
|
1820
|
+
t === "saving" && /* @__PURE__ */ p(T, { children: [
|
|
1821
|
+
/* @__PURE__ */ e("span", { className: "cedros-autosave-spinner" }),
|
|
1822
|
+
/* @__PURE__ */ e("span", { children: "Saving..." })
|
|
1638
1823
|
] }),
|
|
1639
|
-
|
|
1640
|
-
/* @__PURE__ */
|
|
1641
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
1644
|
-
/* @__PURE__ */
|
|
1645
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1835
|
+
le as A,
|
|
1836
|
+
ae as C,
|
|
1837
|
+
se as S,
|
|
1838
|
+
W as a,
|
|
1839
|
+
ie as u
|
|
1655
1840
|
};
|