Dashboard 1.0 Release
This commit is contained in:
1 parent
69371ae619
commit
004b638dbf
47 files changed
+2566
-1166
No files matched your search
+124
-7
@@ -598,6 +598,34 @@ h1{font-size:1.25rem}a{color:#a78bfa}</style></head><body>
|
||||
}
|
||||
});
|
||||
|
||||
app.post('/setup/reset', p('settings.update'), (req, res) => {
|
||||
try {
|
||||
const apiPath = path.join(__dirname, '../Configs/api.yml');
|
||||
if (fs.existsSync(apiPath)) {
|
||||
const raw = fs.readFileSync(apiPath, 'utf8');
|
||||
const parsed = yaml.load(raw) || {};
|
||||
if (parsed.API && parsed.API.OAuth) {
|
||||
parsed.API.OAuth.Enabled = false;
|
||||
parsed.API.OAuth.ClientId = 'YOUR_CLIENT_ID';
|
||||
parsed.API.OAuth.ClientSecret = 'YOUR_CLIENT_SECRET';
|
||||
parsed.API.OAuth.OwnerUserIds = [];
|
||||
const doc = new YAML.Document(parsed);
|
||||
fs.writeFileSync(apiPath, doc.toString(), 'utf8');
|
||||
configStore.reloadFile('api');
|
||||
}
|
||||
}
|
||||
res.json({
|
||||
success: true,
|
||||
message: 'Dashboard reset to setup mode. Restarting...',
|
||||
restartRequired: true
|
||||
});
|
||||
|
||||
setTimeout(() => restartDiscordBot(), 500);
|
||||
} catch (err) {
|
||||
res.status(400).json({ success: false, error: err.message });
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/dashboard-users', p('users.view'), (req, res) => {
|
||||
try {
|
||||
res.json({
|
||||
@@ -817,7 +845,7 @@ h1{font-size:1.25rem}a{color:#a78bfa}</style></head><body>
|
||||
});
|
||||
|
||||
app.get('/configs/:file', cv('view'), (req, res) => {
|
||||
const validFiles = ['supportbot', 'ticket-panel', 'commands', 'messages', 'supportbot-ai'];
|
||||
const validFiles = ['supportbot', 'ticket-panel', 'commands', 'messages', 'supportbot-ai', 'api'];
|
||||
const file = req.params.file;
|
||||
if (!validFiles.includes(file)) return res.status(400).json({ success: false, error: 'Invalid file' });
|
||||
try {
|
||||
@@ -829,7 +857,7 @@ h1{font-size:1.25rem}a{color:#a78bfa}</style></head><body>
|
||||
});
|
||||
|
||||
app.put('/configs/raw', cv('edit'), async (req, res) => {
|
||||
const validFiles = ['supportbot', 'ticket-panel', 'commands', 'messages', 'supportbot-ai'];
|
||||
const validFiles = ['supportbot', 'ticket-panel', 'commands', 'messages', 'supportbot-ai', 'api'];
|
||||
const file = req.body.filename;
|
||||
let content = req.body.content;
|
||||
if (!validFiles.includes(file)) return res.status(400).json({ success: false, error: 'Invalid file' });
|
||||
@@ -869,7 +897,7 @@ h1{font-size:1.25rem}a{color:#a78bfa}</style></head><body>
|
||||
});
|
||||
|
||||
app.get('/configs/json/:file', cv('view'), (req, res) => {
|
||||
const validFiles = ['supportbot', 'ticket-panel', 'commands', 'messages', 'supportbot-ai'];
|
||||
const validFiles = ['supportbot', 'ticket-panel', 'commands', 'messages', 'supportbot-ai', 'api'];
|
||||
const file = req.params.file;
|
||||
if (!validFiles.includes(file)) return res.status(400).json({ success: false, error: 'Invalid file' });
|
||||
try {
|
||||
@@ -1053,7 +1081,7 @@ h1{font-size:1.25rem}a{color:#a78bfa}</style></head><body>
|
||||
res.json({
|
||||
success: true,
|
||||
data: {
|
||||
repository: `https://github.com/Emerald-Services/Addons`,
|
||||
repository: `https://emeraldsrv.dev`,
|
||||
addons: catalog.map((addon) => ({
|
||||
...addon,
|
||||
installed: installedIds.has(addon.id),
|
||||
@@ -1064,7 +1092,7 @@ h1{font-size:1.25rem}a{color:#a78bfa}</style></head><body>
|
||||
console.error('[API] Addon catalog failed:', err);
|
||||
res.status(500).json({
|
||||
success: false,
|
||||
error: err.message || 'Could not load addon catalog from GitHub',
|
||||
error: err.message || 'Could not load addon catalog from Emerald API',
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -1113,6 +1141,65 @@ h1{font-size:1.25rem}a{color:#a78bfa}</style></head><body>
|
||||
}
|
||||
});
|
||||
|
||||
app.post('/addons/build', p('settings.update'), async (req, res) => {
|
||||
try {
|
||||
const { name, description, permission, embed } = req.body;
|
||||
if (!name || !name.match(/^[a-z0-9_-]+$/i)) {
|
||||
return res.status(400).json({ success: false, error: "Invalid addon name" });
|
||||
}
|
||||
|
||||
const safeName = name.toLowerCase();
|
||||
const addonPath = path.join(process.cwd(), 'Addons', `${safeName}.js`);
|
||||
|
||||
if (fs.existsSync(addonPath)) {
|
||||
return res.status(400).json({ success: false, error: "An addon with this name already exists" });
|
||||
}
|
||||
|
||||
const jsContent = `const Discord = require("discord.js");
|
||||
const { Command } = require('../Structures/Addon.js');
|
||||
const supportbot = require("../Structures/ConfigStore").supportbot;
|
||||
|
||||
module.exports = new Command({
|
||||
name: "${safeName}",
|
||||
description: ${JSON.stringify(description || "Custom command")},
|
||||
options: [],
|
||||
permissions: ${permission && permission !== "none" ? `["${permission}"]` : "[]"},
|
||||
|
||||
async run(interaction) {
|
||||
const CustomEmbed = new Discord.EmbedBuilder()
|
||||
${embed?.title ? `.setTitle(${JSON.stringify(embed.title)})` : ""}
|
||||
.setDescription(${JSON.stringify(embed?.description || "Hello!")})
|
||||
.setColor(supportbot.Embed.Colours.${embed?.color || "General"});
|
||||
|
||||
interaction.reply({
|
||||
embeds: [CustomEmbed],
|
||||
});
|
||||
},
|
||||
});
|
||||
`;
|
||||
if (!fs.existsSync(path.join(process.cwd(), 'Addons'))) {
|
||||
fs.mkdirSync(path.join(process.cwd(), 'Addons'), { recursive: true });
|
||||
}
|
||||
|
||||
fs.writeFileSync(addonPath, jsContent);
|
||||
|
||||
let botRestart = { success: false, error: 'Bot client not available' };
|
||||
if (this.client) {
|
||||
botRestart = await this.restartBotAfterConfigSave();
|
||||
notifyBotRestart(botRestart.success, botRestart.error);
|
||||
}
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
message: botRestart.success ? "Bot restarted automatically to load your new addon." : "Restart the bot to load your new command.",
|
||||
botRestart
|
||||
});
|
||||
} catch (err) {
|
||||
console.error("[API] Addon build failed:", err);
|
||||
res.status(500).json({ success: false, error: "Failed to build addon" });
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/addons/configs', p('settings.view'), (req, res) => {
|
||||
try {
|
||||
const files = listLocalAddonConfigs();
|
||||
@@ -1253,11 +1340,20 @@ h1{font-size:1.25rem}a{color:#a78bfa}</style></head><body>
|
||||
});
|
||||
|
||||
// 5. Update package.json (version only)
|
||||
const newPkgPath = path.join(sourcePath, 'package.json');
|
||||
const reqRepoId = req.body.repoId;
|
||||
let newPkgPath = path.join(sourcePath, 'package.json');
|
||||
if (reqRepoId === 'dashboard') {
|
||||
newPkgPath = path.join(sourcePath, 'dashboard', 'package.json');
|
||||
}
|
||||
|
||||
if (fs.existsSync(newPkgPath)) {
|
||||
const currentPkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
|
||||
const newPkg = JSON.parse(fs.readFileSync(newPkgPath, 'utf8'));
|
||||
currentPkg.version = newPkg.version;
|
||||
if (reqRepoId === 'dashboard') {
|
||||
currentPkg.dashboardVersion = newPkg.version;
|
||||
} else {
|
||||
currentPkg.version = newPkg.version;
|
||||
}
|
||||
fs.writeFileSync('./package.json', JSON.stringify(currentPkg, null, 2));
|
||||
}
|
||||
|
||||
@@ -1472,6 +1568,27 @@ h1{font-size:1.25rem}a{color:#a78bfa}</style></head><body>
|
||||
res.status(500).json({ success: false, error: 'Failed to download transcript' });
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/system/tickets/open', p('overview'), (req, res) => {
|
||||
try {
|
||||
const db = require('../Structures/Database.js');
|
||||
const configStore = require('../Structures/ConfigStore.js');
|
||||
const guildId = configStore.supportbot.General.GuildId;
|
||||
|
||||
const openTickets = db.getAllTickets().filter(t => t.status === 'open');
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
data: {
|
||||
guildId,
|
||||
tickets: openTickets
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
console.error("Open tickets API error:", err);
|
||||
res.status(500).json({ success: false, error: 'Failed to fetch open tickets' });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
Command:
|
||||
Name: "applicationsetup"
|
||||
Description: "Posts the application panel"
|
||||
Permission:
|
||||
- "ManageGuild"
|
||||
|
||||
Application:
|
||||
ReviewChannelId: "1481380207305691287"
|
||||
CooldownHours: 24
|
||||
OneOpenApplicationPerUserPerType: true
|
||||
|
||||
Panel:
|
||||
Title: "Applications"
|
||||
Description: "Choose an application type from the dropdown below."
|
||||
Placeholder: "Select an application type"
|
||||
|
||||
Review:
|
||||
Title: "New Application"
|
||||
AcceptLabel: "Accept"
|
||||
RejectLabel: "Reject"
|
||||
|
||||
Applications:
|
||||
staff:
|
||||
Name: "Staff Team"
|
||||
Description: "Apply for the staff team"
|
||||
AcceptedRoleId: "" # Leave "" blank to disable
|
||||
Questions:
|
||||
Username:
|
||||
Label: "What is your Discord username?"
|
||||
Placeholder: "ExampleUser"
|
||||
Required: true
|
||||
Style: "Short"
|
||||
MinLength: 2
|
||||
MaxLength: 50
|
||||
|
||||
Age:
|
||||
Label: "How old are you?"
|
||||
Placeholder: "18"
|
||||
Required: true
|
||||
Style: "Short"
|
||||
MinLength: 1
|
||||
MaxLength: 3
|
||||
|
||||
Timezone:
|
||||
Label: "What is your timezone?"
|
||||
Placeholder: "GMT / BST / EST"
|
||||
Required: true
|
||||
Style: "Short"
|
||||
MinLength: 2
|
||||
MaxLength: 30
|
||||
|
||||
Experience:
|
||||
Label: "What experience do you have?"
|
||||
Placeholder: "Tell us about your experience"
|
||||
Required: true
|
||||
Style: "Paragraph"
|
||||
MinLength: 10
|
||||
MaxLength: 1000
|
||||
|
||||
Reason:
|
||||
Label: "Why should we accept you?"
|
||||
Placeholder: "Tell us why"
|
||||
Required: true
|
||||
Style: "Paragraph"
|
||||
MinLength: 10
|
||||
MaxLength: 1000
|
||||
|
||||
developer:
|
||||
Name: "Developer"
|
||||
Description: "Apply for the development team"
|
||||
AcceptedRoleId: ""
|
||||
Questions:
|
||||
Username:
|
||||
Label: "What is your Discord username?"
|
||||
Placeholder: "ExampleUser"
|
||||
Required: true
|
||||
Style: "Short"
|
||||
MinLength: 2
|
||||
MaxLength: 50
|
||||
|
||||
Languages:
|
||||
Label: "What languages do you know?"
|
||||
Placeholder: "JavaScript, Python, Lua"
|
||||
Required: true
|
||||
Style: "Paragraph"
|
||||
MinLength: 3
|
||||
MaxLength: 500
|
||||
|
||||
Projects:
|
||||
Label: "What projects have you worked on?"
|
||||
Placeholder: "Describe your work"
|
||||
Required: true
|
||||
Style: "Paragraph"
|
||||
MinLength: 10
|
||||
MaxLength: 1000
|
||||
|
||||
Availability:
|
||||
Label: "How active can you be?"
|
||||
Placeholder: "How much time can you commit?"
|
||||
Required: true
|
||||
Style: "Paragraph"
|
||||
MinLength: 5
|
||||
MaxLength: 500
|
||||
|
||||
Reason:
|
||||
Label: "Why do you want this role?"
|
||||
Placeholder: "Tell us why"
|
||||
Required: true
|
||||
Style: "Paragraph"
|
||||
MinLength: 10
|
||||
MaxLength: 1000
|
||||
@@ -0,0 +1,16 @@
|
||||
# Minecraft Server Configuration
|
||||
|
||||
Java:
|
||||
IP: "play.sapling.gg"
|
||||
Port: 25565
|
||||
DisplayName: "Java Edition"
|
||||
Bedrock:
|
||||
IP: "play.sapling.gg"
|
||||
Port: 19132
|
||||
DisplayName: "Bedrock Edition"
|
||||
|
||||
Embed:
|
||||
Color: "#57F287"
|
||||
OfflineColor: "#ED4245"
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
# SupportBot Temporary Voice Channels Configuration
|
||||
# Addon Version 1.0
|
||||
|
||||
Enabled: true
|
||||
|
||||
# The ID of the voice channel that users join to create a new one
|
||||
JoinToCreateChannelID: "CHANNEL_ID"
|
||||
|
||||
# The category ID where new channels should be created (Optional)
|
||||
# If left blank, it will create it in the same category as the JoinToCreate channel
|
||||
CategoryID: "CATEGORY_ID"
|
||||
|
||||
# The name pattern for new channels
|
||||
|
||||
# Placeholders:
|
||||
# {user}: Username
|
||||
ChannelNamePattern: "🔊 {user}'s Channel"
|
||||
|
||||
# Should the channel be deleted when the last person leaves?
|
||||
AutoDelete: true
|
||||
|
||||
# Voice Channel Hub (Control Panel)
|
||||
Hub:
|
||||
Enabled: true
|
||||
SendOnCreate: true
|
||||
LayoutStyle: "classic" # classic | modern
|
||||
|
||||
# Classic Layout Settings (Standard Embed + Buttons)
|
||||
Classic:
|
||||
Title: "Voice Channel Hub"
|
||||
Description: "Manage your voice channel using the buttons below."
|
||||
Color: "#57F287"
|
||||
|
||||
# Modern Layout Settings (V2 Containers)
|
||||
Modern:
|
||||
Title: "Voice Channel Controller"
|
||||
Body: "Control temporary voice channel using this control panel."
|
||||
Color: "#57F287"
|
||||
@@ -0,0 +1,28 @@
|
||||
# +==================================================================================+
|
||||
# | |
|
||||
# | __ __ _ _ _ _ _ |
|
||||
# | \ \ / /__ _ _ ___| |__ | | ___ _ _ / \ __| | __| | ___ _ __ |
|
||||
# | \ \ / / _ \| | | |/ __| '_ \| |/ _ \ | | | / _ \ / _` |/ _` |/ _ \| '_ \ |
|
||||
# | \ V / (_) | |_| | (__| | | | | __/ |_| | / ___ \ (_| | (_| | (_) | | | | |
|
||||
# | \_/ \___/ \__,_|\___|_| |_|_|\___|\__, | /_/ \_\__,_|\__,_|\___/|_| |_| |
|
||||
# | |___/ |
|
||||
# | |
|
||||
# | Vouchley Addon for SupportBot |
|
||||
# | Created by Emerald Services |
|
||||
# | |
|
||||
# +==================================================================================+
|
||||
|
||||
Vouchley:
|
||||
API_Key: "REQUEST_API_KEY_BELOW"
|
||||
|
||||
# Vouchley API Documentation: https://www.vouchley.com/docs/api/getting-started
|
||||
# To use the API you will need an API key. To get this create a ticket in https://discord.gg/buzz
|
||||
|
||||
Embed:
|
||||
Colour: 0x6063fc # 0x<hexcode> without the #
|
||||
Ephermal: true # Make the profile searches hidden so only the interacting user can see them.
|
||||
|
||||
Command:
|
||||
Name: "vouchley" # The name of the command (/vouchley)
|
||||
Description: "Search a Vouchley Profile." # The description of the command (/vouchley)
|
||||
Permissions: ["SendMessages"]
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"applications": []
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
const Discord = require("discord.js");
|
||||
const { Command } = require("../Structures/Addon.js");
|
||||
const fs = require("fs");
|
||||
const yaml = require("js-yaml");
|
||||
const axios = require("axios");
|
||||
|
||||
// Load configs
|
||||
const supportbot = yaml.load(fs.readFileSync("./Configs/supportbot.yml", "utf8"));
|
||||
const minecraftConfig = yaml.load(fs.readFileSync("./Addons/Configs/minecraft.yml", "utf8"));
|
||||
|
||||
module.exports = new Command({
|
||||
name: "serverip",
|
||||
description: "Display the Minecraft server IP and status",
|
||||
options: [
|
||||
{
|
||||
name: "type",
|
||||
description: "The edition of Minecraft (Java or Bedrock)",
|
||||
type: Discord.ApplicationCommandOptionType.String,
|
||||
required: true,
|
||||
choices: [
|
||||
{ name: "Java", value: "java" },
|
||||
{ name: "Bedrock", value: "bedrock" },
|
||||
],
|
||||
},
|
||||
],
|
||||
permissions: ["SendMessages"],
|
||||
|
||||
async run(interaction) {
|
||||
const type = interaction.options.getString("type");
|
||||
const config = type === "java" ? minecraftConfig.Java : minecraftConfig.Bedrock;
|
||||
|
||||
await interaction.deferReply();
|
||||
|
||||
try {
|
||||
const response = await axios.get(`https://api.mcstatus.io/v2/status/${type}/${config.IP}:${config.Port}`);
|
||||
const data = response.data;
|
||||
|
||||
if (!data.online) {
|
||||
throw new Error("Server is offline");
|
||||
}
|
||||
|
||||
const embed = new Discord.EmbedBuilder()
|
||||
.setTitle(`${config.DisplayName} Status`)
|
||||
.setTimestamp();
|
||||
|
||||
embed.setColor(minecraftConfig.Embed.Color || supportbot.Embed.Colours.General)
|
||||
.setDescription(`The server is currently **Online**!`)
|
||||
.addFields(
|
||||
{ name: "IP Address", value: `\`${config.IP}\``, inline: true },
|
||||
{ name: "Port", value: `\`${config.Port}\``, inline: true },
|
||||
{ name: "Players", value: `\`${data.players.online}/${data.players.max}\``, inline: true },
|
||||
{ name: "Version", value: `\`${type === "java" ? data.version.name_clean : data.version.name || "Unknown"}\``, inline: true }
|
||||
);
|
||||
|
||||
if (data.motd && data.motd.clean) {
|
||||
embed.addFields({ name: "MOTD", value: `\`\`\`${data.motd.clean}\`\`\`` });
|
||||
}
|
||||
|
||||
await interaction.editReply({ embeds: [embed] });
|
||||
} catch (error) {
|
||||
console.error("Error fetching Minecraft status:", error);
|
||||
|
||||
const config = interaction.options.getString("type") === "java" ? minecraftConfig.Java : minecraftConfig.Bedrock;
|
||||
|
||||
const embed = new Discord.EmbedBuilder()
|
||||
.setTitle(`${config.DisplayName} Status`)
|
||||
.setTimestamp()
|
||||
.setColor(minecraftConfig.Embed.OfflineColor || "#FF0000")
|
||||
.setDescription(`The server is currently **Offline**.`)
|
||||
.addFields(
|
||||
{ name: "IP Address", value: `\`${config.IP}\``, inline: true },
|
||||
{ name: "Port", value: `\`${config.Port}\``, inline: true }
|
||||
);
|
||||
|
||||
await interaction.editReply({ embeds: [embed] });
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
# SupportBot Sanction Addon
|
||||
# Created by ItsNyoty
|
||||
|
||||
LogChannel: "1275426007980965908"
|
||||
# The ID of the channel where the logs will be sent.
|
||||
@@ -0,0 +1,157 @@
|
||||
const Discord = require('discord.js');
|
||||
const fs = require('fs');
|
||||
const yaml = require('js-yaml');
|
||||
const { Command } = require('../Structures/Addon.js');
|
||||
const supportbot = yaml.load(fs.readFileSync('./Configs/supportbot.yml', 'utf8'));
|
||||
const sactionaddon = yaml.load(fs.readFileSync('./Addons/Configs/sactionaddon.yml', 'utf8'));
|
||||
|
||||
module.exports = new Command({
|
||||
name: 'sanction',
|
||||
description: 'Sanction a user (kick, ban, or timeout).',
|
||||
options: [
|
||||
{
|
||||
name: 'action',
|
||||
type: 3,
|
||||
description: 'The action to perform (kick, ban, timeout)',
|
||||
required: true,
|
||||
choices: [
|
||||
{ name: 'Kick', value: 'kick' },
|
||||
{ name: 'Ban', value: 'ban' },
|
||||
{ name: 'Timeout', value: 'timeout' }
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'user',
|
||||
type: 6,
|
||||
description: 'The user to sanction',
|
||||
required: true
|
||||
},
|
||||
{
|
||||
name: 'reason',
|
||||
type: 3,
|
||||
description: 'Reason for the sanction',
|
||||
required: false
|
||||
},
|
||||
{
|
||||
name: 'duration',
|
||||
type: 3,
|
||||
description: 'Duration of the timeout (e.g., "10m", "2h", "1d")',
|
||||
required: false
|
||||
}
|
||||
],
|
||||
permissions: [],
|
||||
|
||||
async run(interaction) {
|
||||
const action = interaction.options.getString('action');
|
||||
const user = interaction.options.getUser('user');
|
||||
const reason = interaction.options.getString('reason') || 'No reason provided';
|
||||
const duration = interaction.options.getString('duration');
|
||||
const staffRoleId = supportbot.Roles.StaffMember.Staff;
|
||||
|
||||
const member = interaction.guild.members.cache.get(interaction.user.id);
|
||||
if (!member || !member.roles.cache.has(staffRoleId)) {
|
||||
return interaction.reply({ content: 'You do not have permission to use this command.', ephemeral: true });
|
||||
}
|
||||
|
||||
const targetMember = interaction.guild.members.cache.get(user.id);
|
||||
if (!targetMember) {
|
||||
return interaction.reply({ content: 'The user is not a member of this guild.', ephemeral: true });
|
||||
}
|
||||
|
||||
try {
|
||||
let actionMessage = '';
|
||||
let logEmbed = new Discord.EmbedBuilder().setColor(supportbot.Embed.Colours.General);
|
||||
|
||||
switch (action) {
|
||||
case 'kick':
|
||||
if (!targetMember.kickable) return interaction.reply({ content: 'I cannot kick this user.', ephemeral: true });
|
||||
await targetMember.kick(reason);
|
||||
actionMessage = `Successfully kicked ${user.tag} for: ${reason}`;
|
||||
logEmbed
|
||||
.setTitle('User Kicked')
|
||||
.setDescription(`**User:** ${user.tag}\n**Reason:** ${reason}`)
|
||||
.addFields(
|
||||
{ name: 'Action By', value: interaction.user.tag, inline: true },
|
||||
{ name: 'Action', value: 'Kick', inline: true },
|
||||
{ name: 'Timestamp', value: new Date().toISOString(), inline: true }
|
||||
);
|
||||
break;
|
||||
|
||||
case 'ban':
|
||||
if (!targetMember.bannable) return interaction.reply({ content: 'I cannot ban this user.', ephemeral: true });
|
||||
await targetMember.ban({ reason });
|
||||
actionMessage = `Successfully banned ${user.tag} for: ${reason}`;
|
||||
logEmbed
|
||||
.setTitle('User Banned')
|
||||
.setDescription(`**User:** ${user.tag}\n**Reason:** ${reason}`)
|
||||
.addFields(
|
||||
{ name: 'Action By', value: interaction.user.tag, inline: true },
|
||||
{ name: 'Action', value: 'Ban', inline: true },
|
||||
{ name: 'Timestamp', value: new Date().toISOString(), inline: true }
|
||||
);
|
||||
break;
|
||||
|
||||
case 'timeout':
|
||||
// Ensure a valid duration is provided
|
||||
if (!duration) return interaction.reply({ content: 'You must specify a duration for the timeout.', ephemeral: true });
|
||||
|
||||
// Convert duration to milliseconds
|
||||
const parsedDuration = ms(duration);
|
||||
if (!parsedDuration) return interaction.reply({ content: 'Invalid duration format. Use "1s", "5m", "2h", or "1d".', ephemeral: true });
|
||||
|
||||
// Apply the timeout
|
||||
await targetMember.timeout(parsedDuration, reason);
|
||||
actionMessage = `Successfully timed out ${user.tag} for ${duration} with reason: ${reason}`;
|
||||
logEmbed
|
||||
.setTitle('User Timed Out')
|
||||
.setDescription(`**User:** ${user.tag}\n**Duration:** ${duration}\n**Reason:** ${reason}`)
|
||||
.addFields(
|
||||
{ name: 'Action By', value: interaction.user.tag, inline: true },
|
||||
{ name: 'Action', value: 'Timeout', inline: true },
|
||||
{ name: 'Timestamp', value: new Date().toISOString(), inline: true }
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
return interaction.reply({ content: 'Invalid action specified.', ephemeral: true });
|
||||
}
|
||||
|
||||
// Send the action message
|
||||
interaction.reply({ content: actionMessage, ephemeral: true });
|
||||
|
||||
// Log the action to the logging channel
|
||||
const logChannel = interaction.guild.channels.cache.get(sactionaddon.LogChannel);
|
||||
if (logChannel) {
|
||||
logChannel.send({ embeds: [logEmbed] });
|
||||
} else {
|
||||
console.error('Logging channel not found.');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error executing sanction command:', error);
|
||||
interaction.reply({ content: 'An error occurred while executing the command.', ephemeral: true });
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* Converts a time duration string to milliseconds.
|
||||
* @param {string} duration - The duration string (e.g., "10m", "2h", "1d").
|
||||
* @returns {number} - The duration in milliseconds.
|
||||
*/
|
||||
function ms(duration) {
|
||||
const regex = /^(\d+)([smhd])$/;
|
||||
const match = regex.exec(duration);
|
||||
|
||||
if (!match) return null;
|
||||
|
||||
const value = parseInt(match[1], 10);
|
||||
const unit = match[2];
|
||||
|
||||
switch (unit) {
|
||||
case 's': return value * 1000; // seconds
|
||||
case 'm': return value * 60 * 1000; // minutes
|
||||
case 'h': return value * 60 * 60 * 1000; // hours
|
||||
case 'd': return value * 24 * 60 * 60 * 1000; // days
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
const Discord = require("discord.js");
|
||||
const fs = require("fs");
|
||||
const yaml = require("js-yaml");
|
||||
const { Command } = require('../Structures/Addon.js'); // Adjust the path as needed
|
||||
const supportbot = yaml.load(fs.readFileSync("./Configs/supportbot.yml", "utf8"));
|
||||
|
||||
module.exports = new Command({
|
||||
name: "tags",
|
||||
description: "Retrieve a saved tag.",
|
||||
options: [
|
||||
{
|
||||
name: 'name',
|
||||
type: Discord.ApplicationCommandOptionType.String,
|
||||
description: 'The name of the tag',
|
||||
required: true,
|
||||
autocomplete: true
|
||||
},
|
||||
],
|
||||
permissions: ["SendMessages"],
|
||||
|
||||
async autocomplete(interaction) {
|
||||
const tagsPath = './Addons/Data/tags.json';
|
||||
const focusedValue = interaction.options.getFocused().toLowerCase();
|
||||
|
||||
if (!fs.existsSync(tagsPath)) {
|
||||
return interaction.respond([]);
|
||||
}
|
||||
|
||||
const tags = JSON.parse(fs.readFileSync(tagsPath, 'utf8'));
|
||||
const choices = Object.keys(tags)
|
||||
.filter(tag => tag.toLowerCase().includes(focusedValue))
|
||||
.slice(0, 25) // Discord has a limit of 25 choices
|
||||
.map(tag => ({ name: tag, value: tag }));
|
||||
|
||||
return interaction.respond(choices);
|
||||
},
|
||||
|
||||
async run(interaction) {
|
||||
const tagsPath = './Addons/Data/tags.json';
|
||||
const tagName = interaction.options.getString('name').toLowerCase();
|
||||
|
||||
if (!fs.existsSync(tagsPath)) {
|
||||
const embed = new Discord.EmbedBuilder()
|
||||
.setDescription('No tags have been created yet.')
|
||||
.setColor(supportbot.Embed.Colours.General);
|
||||
return interaction.reply({ embeds: [embed], ephemeral: true });
|
||||
}
|
||||
|
||||
const tags = JSON.parse(fs.readFileSync(tagsPath, 'utf8'));
|
||||
|
||||
if (tags[tagName]) {
|
||||
const tag = tags[tagName];
|
||||
|
||||
if (tag.embed) {
|
||||
// For embeds, Discord automatically handles line breaks correctly
|
||||
const embed = new Discord.EmbedBuilder()
|
||||
.setDescription(tag.content)
|
||||
.setColor(supportbot.Embed.Colours.General);
|
||||
|
||||
if (tag.image) {
|
||||
embed.setImage(tag.image);
|
||||
}
|
||||
|
||||
return interaction.reply({ embeds: [embed], ephemeral: tag.ephemeral || false });
|
||||
} else {
|
||||
// For plain text, we need to keep the line breaks
|
||||
const response = {
|
||||
content: tag.content,
|
||||
ephemeral: tag.ephemeral || false
|
||||
};
|
||||
|
||||
if (tag.image) {
|
||||
response.files = [tag.image];
|
||||
}
|
||||
|
||||
return interaction.reply(response);
|
||||
}
|
||||
} else {
|
||||
const embed = new Discord.EmbedBuilder()
|
||||
.setDescription(`Tag "${tagName}" not found.`)
|
||||
.setColor(supportbot.Embed.Colours.General);
|
||||
return interaction.reply({ embeds: [embed], ephemeral: true });
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,76 @@
|
||||
const Discord = require("discord.js");
|
||||
const fs = require("fs");
|
||||
const yaml = require("js-yaml");
|
||||
const { Command } = require('../Structures/Addon.js'); // Adjust the path as needed
|
||||
const supportbot = yaml.load(fs.readFileSync("./Configs/supportbot.yml", "utf8"));
|
||||
|
||||
module.exports = new Command({
|
||||
name: "tagscreate",
|
||||
description: "Create a new tag.",
|
||||
options: [
|
||||
{
|
||||
name: 'name',
|
||||
type: Discord.ApplicationCommandOptionType.String,
|
||||
description: 'The name of the tag',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'content',
|
||||
type: Discord.ApplicationCommandOptionType.String,
|
||||
description: 'The content of the tag (use ; or /n for new lines)',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'image',
|
||||
type: Discord.ApplicationCommandOptionType.Attachment,
|
||||
description: 'The image URL of the tag',
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
name: 'embed',
|
||||
type: Discord.ApplicationCommandOptionType.Boolean,
|
||||
description: 'Do you want this tag to send as an embed',
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
name: 'ephemeral',
|
||||
type: Discord.ApplicationCommandOptionType.Boolean,
|
||||
description: 'Do you want this tag to send as ephemeral',
|
||||
required: false,
|
||||
},
|
||||
],
|
||||
permissions: ["SendMessages"],
|
||||
|
||||
async run(interaction) {
|
||||
const tagName = interaction.options.getString('name').toLowerCase();
|
||||
let tagContent = interaction.options.getString('content');
|
||||
const tagImage = interaction.options.getAttachment('image');
|
||||
const isEmbed = interaction.options.getBoolean('embed');
|
||||
const isEphemeral = interaction.options.getBoolean('ephemeral');
|
||||
const tagsPath = './Addons/Data/tags.json';
|
||||
|
||||
// Process line breaks in content - support both ; and /n notations
|
||||
tagContent = tagContent.replace(/;/g, '\n').replace(/\/n/g, '\n');
|
||||
|
||||
let tags = {};
|
||||
|
||||
if (fs.existsSync(tagsPath)) {
|
||||
tags = JSON.parse(fs.readFileSync(tagsPath, 'utf8'));
|
||||
}
|
||||
|
||||
tags[tagName] = {
|
||||
content: tagContent,
|
||||
image: tagImage ? tagImage.url : null,
|
||||
embed: isEmbed || false,
|
||||
ephemeral: isEphemeral || false,
|
||||
};
|
||||
|
||||
fs.writeFileSync(tagsPath, JSON.stringify(tags, null, 4));
|
||||
|
||||
const embed = new Discord.EmbedBuilder()
|
||||
.setDescription(`Tag "${tagName}" created successfully.`)
|
||||
.setColor(supportbot.Embed.Colours.General);
|
||||
|
||||
return interaction.reply({ embeds: [embed], ephemeral: true });
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,68 @@
|
||||
const Discord = require("discord.js");
|
||||
const fs = require("fs");
|
||||
const yaml = require("js-yaml");
|
||||
const { Command } = require('../Structures/Addon.js'); // Adjust the path as needed
|
||||
const supportbot = yaml.load(fs.readFileSync("./Configs/supportbot.yml", "utf8"));
|
||||
|
||||
module.exports = new Command({
|
||||
name: "tagsdelete",
|
||||
description: "Delete an existing tag.",
|
||||
options: [
|
||||
{
|
||||
name: 'name',
|
||||
type: Discord.ApplicationCommandOptionType.String,
|
||||
description: 'The name of the tag to delete',
|
||||
required: true,
|
||||
autocomplete: true
|
||||
},
|
||||
],
|
||||
permissions: ["SendMessages"],
|
||||
|
||||
async autocomplete(interaction) {
|
||||
const tagsPath = './Addons/Data/tags.json';
|
||||
const focusedValue = interaction.options.getFocused().toLowerCase();
|
||||
|
||||
if (!fs.existsSync(tagsPath)) {
|
||||
return interaction.respond([]);
|
||||
}
|
||||
|
||||
const tags = JSON.parse(fs.readFileSync(tagsPath, 'utf8'));
|
||||
const choices = Object.keys(tags)
|
||||
.filter(tag => tag.toLowerCase().includes(focusedValue))
|
||||
.slice(0, 25) // Discord has a limit of 25 choices
|
||||
.map(tag => ({ name: tag, value: tag }));
|
||||
|
||||
return interaction.respond(choices);
|
||||
},
|
||||
|
||||
async run(interaction) {
|
||||
const tagsPath = './Addons/Data/tags.json';
|
||||
const tagName = interaction.options.getString('name').toLowerCase();
|
||||
|
||||
if (!fs.existsSync(tagsPath)) {
|
||||
const embed = new Discord.EmbedBuilder()
|
||||
.setDescription('No tags have been created yet.')
|
||||
.setColor(supportbot.Embed.Colours.General);
|
||||
return interaction.reply({ embeds: [embed], ephemeral: true });
|
||||
}
|
||||
|
||||
let tags = JSON.parse(fs.readFileSync(tagsPath, 'utf8'));
|
||||
|
||||
if (!tags[tagName]) {
|
||||
const embed = new Discord.EmbedBuilder()
|
||||
.setDescription(`Tag "${tagName}" not found.`)
|
||||
.setColor(supportbot.Embed.Colours.General);
|
||||
return interaction.reply({ embeds: [embed], ephemeral: true });
|
||||
}
|
||||
|
||||
delete tags[tagName];
|
||||
|
||||
fs.writeFileSync(tagsPath, JSON.stringify(tags, null, 4));
|
||||
|
||||
const embed = new Discord.EmbedBuilder()
|
||||
.setDescription(`Tag "${tagName}" deleted successfully.`)
|
||||
.setColor(supportbot.Embed.Colours.General);
|
||||
|
||||
return interaction.reply({ embeds: [embed], ephemeral: true });
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
PayPal:
|
||||
ClientID: "clientID_Here"
|
||||
ClientSecret: "ClientSecret_Here"
|
||||
Mode: "live" # or "live"
|
||||
Email: "Email_Here" # Add your PayPal email here
|
||||
Embed:
|
||||
Colours:
|
||||
General: "#0099ff"
|
||||
Success: "#00ff00" # Add more colors if needed
|
||||
Error: "#ff0000" # Add more colors if needed
|
||||
Footer: "PayPal Invoice" # Add footer text here
|
||||
Logo: "https://your-logo-url.com/logo.png" # Add logo URL if used in invoice
|
||||
Note: "Thank you for your business!" # Add a note if used in invoice
|
||||
TOS: "Please review our terms and conditions. https://domain.com/tos" # Add terms of service if used in invoice
|
||||
@@ -0,0 +1,146 @@
|
||||
const { EmbedBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, ApplicationCommandOptionType } = require('discord.js');
|
||||
const fs = require('fs');
|
||||
const yaml = require('js-yaml');
|
||||
const paypal = require('paypal-rest-sdk');
|
||||
const { Command } = require('../Structures/Addon.js'); // Adjust the path as needed
|
||||
|
||||
// Load the PayPal configuration
|
||||
const config = yaml.load(fs.readFileSync("./Addons/Configs/paypal.yml", "utf8"));
|
||||
const supportbot = config;
|
||||
|
||||
// Configure PayPal SDK
|
||||
paypal.configure({
|
||||
mode: supportbot.PayPal.Mode, // sandbox or live
|
||||
client_id: supportbot.PayPal.ClientID,
|
||||
client_secret: supportbot.PayPal.ClientSecret
|
||||
});
|
||||
|
||||
module.exports = new Command({
|
||||
name: "invoice",
|
||||
description: "Generate a PayPal invoice for a user.",
|
||||
options: [
|
||||
{
|
||||
name: "user",
|
||||
description: "The user to notify.",
|
||||
type: ApplicationCommandOptionType.User,
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "price",
|
||||
description: "The amount to invoice.",
|
||||
type: ApplicationCommandOptionType.String,
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "service",
|
||||
description: "The service provided.",
|
||||
type: ApplicationCommandOptionType.String,
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "email",
|
||||
description: "The email to invoice.",
|
||||
type: ApplicationCommandOptionType.String,
|
||||
required: true,
|
||||
}
|
||||
],
|
||||
permissions: ["Administrator"],
|
||||
|
||||
async run(interaction) {
|
||||
const user = interaction.options.getUser("user");
|
||||
const price = interaction.options.getString("price");
|
||||
const service = interaction.options.getString("service");
|
||||
const email = interaction.options.getString("email");
|
||||
|
||||
// Validate the price format
|
||||
if (isNaN(price) || parseFloat(price) <= 0) {
|
||||
const errorEmbed = new EmbedBuilder()
|
||||
.setDescription(`The price provided is invalid.`)
|
||||
.setColor(supportbot.Embed.Colours.Error)
|
||||
.setFooter({ text: supportbot.Embed.Footer });
|
||||
return interaction.reply({ embeds: [errorEmbed], ephemeral: true });
|
||||
}
|
||||
|
||||
const invoiceData = {
|
||||
"merchant_info": {
|
||||
"email": supportbot.PayPal.Email,
|
||||
"business_name": interaction.guild.name
|
||||
},
|
||||
"billing_info": [{
|
||||
"email": email
|
||||
}],
|
||||
"items": [{
|
||||
"name": service,
|
||||
"quantity": 1,
|
||||
"unit_price": {
|
||||
"currency": "USD",
|
||||
"value": price
|
||||
}
|
||||
}],
|
||||
"logo_url": supportbot.PayPal.Logo,
|
||||
"note": supportbot.PayPal.Note,
|
||||
"terms": supportbot.PayPal.TOS,
|
||||
"payment_term": {
|
||||
"term_type": "NET_45"
|
||||
},
|
||||
"tax_inclusive": false,
|
||||
"total_amount": {
|
||||
"currency": "USD",
|
||||
"value": price
|
||||
}
|
||||
};
|
||||
|
||||
paypal.invoice.create(invoiceData, function (error, invoice) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
const errorEmbed = new EmbedBuilder()
|
||||
.setTitle(`PayPal Error`)
|
||||
.setDescription(`There was an error creating the invoice. Please check your configuration and try again.`)
|
||||
.setColor(supportbot.Embed.Colours.Error)
|
||||
.setFooter({ text: supportbot.Embed.Footer });
|
||||
return interaction.reply({ embeds: [errorEmbed], ephemeral: true });
|
||||
}
|
||||
|
||||
const invoiceId = invoice.id;
|
||||
paypal.invoice.send(invoiceId, function (error) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
const errorEmbed = new EmbedBuilder()
|
||||
.setTitle(`PayPal Error`)
|
||||
.setDescription(`There was an error sending the invoice. Please check your configuration and try again.`)
|
||||
.setColor(supportbot.Embed.Colours.Error)
|
||||
.setFooter({ text: supportbot.Embed.Footer });
|
||||
return interaction.reply({ embeds: [errorEmbed], ephemeral: true });
|
||||
}
|
||||
|
||||
const invoiceEmbed = new EmbedBuilder()
|
||||
.setTitle(`Payment System | ${interaction.guild.name}`)
|
||||
.addFields(
|
||||
{ name: 'Service', value: service, inline: true },
|
||||
{ name: 'Amount Due', value: `$${price}`, inline: true },
|
||||
{ name: 'Currency', value: 'USD', inline: true },
|
||||
{ name: 'Invoice ID', value: `\`${invoiceId}\``, inline: false }
|
||||
)
|
||||
.setColor(supportbot.Embed.Colours.General)
|
||||
.setFooter({ text: supportbot.Embed.Footer })
|
||||
.setTimestamp();
|
||||
|
||||
// Create a button with a link to the invoice
|
||||
const invoiceButton = new ButtonBuilder()
|
||||
.setLabel('View Invoice')
|
||||
.setStyle(ButtonStyle.Link)
|
||||
.setURL(`https://www.paypal.com/invoice/payerView/details/${invoiceId}`);
|
||||
|
||||
// Create the action row
|
||||
const actionRow = new ActionRowBuilder()
|
||||
.addComponents(invoiceButton);
|
||||
|
||||
// Send the embed with the button
|
||||
interaction.reply({
|
||||
embeds: [invoiceEmbed],
|
||||
components: [actionRow]
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,227 @@
|
||||
const Discord = require("discord.js");
|
||||
const { Event } = require("../Structures/Addon.js");
|
||||
const fs = require("fs");
|
||||
const yaml = require("js-yaml");
|
||||
|
||||
const tempVCConfig = yaml.load(fs.readFileSync("./Addons/Configs/tempvc.yml", "utf8"));
|
||||
|
||||
const tempChannels = new Map();
|
||||
|
||||
const voiceStateUpdate = new Event("voiceStateUpdate", async (client, oldState, newState) => {
|
||||
if (!tempVCConfig.Enabled) return;
|
||||
|
||||
const member = newState.member;
|
||||
const guild = newState.guild;
|
||||
|
||||
if (newState.channelId === tempVCConfig.JoinToCreateChannelID) {
|
||||
console.log(`[TempVC] ${member.user.tag} joined the Join-to-Create channel.`);
|
||||
}
|
||||
|
||||
if (newState.channelId === tempVCConfig.JoinToCreateChannelID) {
|
||||
try {
|
||||
const parentCategory = tempVCConfig.CategoryID || newState.channel.parentId;
|
||||
const channelName = tempVCConfig.ChannelNamePattern.replace("{user}", member.user.username);
|
||||
|
||||
const newChannel = await guild.channels.create({
|
||||
name: channelName,
|
||||
type: Discord.ChannelType.GuildVoice,
|
||||
parent: parentCategory,
|
||||
permissionOverwrites: [
|
||||
{
|
||||
id: member.id,
|
||||
allow: [Discord.PermissionFlagsBits.ManageChannels, Discord.PermissionFlagsBits.MoveMembers],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
tempChannels.set(newChannel.id, member.id);
|
||||
await member.voice.setChannel(newChannel);
|
||||
|
||||
console.log(`[TempVC] Created channel "${channelName}" for ${member.user.tag}`);
|
||||
|
||||
if (tempVCConfig.Hub.Enabled && tempVCConfig.Hub.SendOnCreate) {
|
||||
try {
|
||||
const { ActionRowBuilder, ButtonBuilder, EmbedBuilder, MessageFlags, ButtonStyle } = Discord;
|
||||
const layoutStyle = tempVCConfig.Hub.LayoutStyle || "classic";
|
||||
|
||||
if (layoutStyle === "classic") {
|
||||
const config = tempVCConfig.Hub.Classic;
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle(config.Title)
|
||||
.setDescription(config.Description)
|
||||
.setColor(config.Color);
|
||||
|
||||
const buttons = new ActionRowBuilder().addComponents(
|
||||
new ButtonBuilder().setCustomId("tempvc_lock").setLabel("Lock").setEmoji("🔒").setStyle(ButtonStyle.Secondary),
|
||||
new ButtonBuilder().setCustomId("tempvc_unlock").setLabel("Unlock").setEmoji("🔓").setStyle(ButtonStyle.Secondary),
|
||||
new ButtonBuilder().setCustomId("tempvc_rename").setLabel("Rename").setEmoji("✏️").setStyle(ButtonStyle.Secondary),
|
||||
new ButtonBuilder().setCustomId("tempvc_limit").setLabel("Limit").setEmoji("👥").setStyle(ButtonStyle.Secondary),
|
||||
new ButtonBuilder().setCustomId("tempvc_claim").setLabel("Claim Ownership").setEmoji("👑").setStyle(ButtonStyle.Primary)
|
||||
);
|
||||
|
||||
await newChannel.send({ embeds: [embed], components: [buttons] });
|
||||
} else {
|
||||
const config = tempVCConfig.Hub.Modern;
|
||||
const colorInt = parseInt(config.Color.replace("#", ""), 16);
|
||||
|
||||
const container = {
|
||||
type: 11,
|
||||
accent_color: colorInt,
|
||||
children: [
|
||||
{
|
||||
type: 12,
|
||||
children: [
|
||||
{ type: 13, content: `## ${config.Title}` },
|
||||
{ type: 13, content: config.Body }
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 15,
|
||||
divider: true
|
||||
},
|
||||
{
|
||||
type: 1,
|
||||
components: [
|
||||
{ type: 2, custom_id: "tempvc_lock", label: "Lock", emoji: { name: "🔒" }, style: 2 },
|
||||
{ type: 2, custom_id: "tempvc_unlock", label: "Unlock", emoji: { name: "🔓" }, style: 2 },
|
||||
{ type: 2, custom_id: "tempvc_rename", label: "Rename", emoji: { name: "✏️" }, style: 2 },
|
||||
{ type: 2, custom_id: "tempvc_limit", label: "Limit", emoji: { name: "👥" }, style: 2 }
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 1,
|
||||
components: [
|
||||
{ type: 2, custom_id: "tempvc_claim", label: "Claim Ownership", emoji: { name: "👑" }, style: 1 }
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
await newChannel.send({
|
||||
flags: MessageFlags.IsComponentsV2,
|
||||
components: [container]
|
||||
});
|
||||
}
|
||||
} catch (hubError) {
|
||||
console.error("[TempVC] Error sending Hub:", hubError);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("[TempVC] Error creating temporary channel:", error);
|
||||
}
|
||||
}
|
||||
|
||||
if (oldState.channelId && tempChannels.has(oldState.channelId)) {
|
||||
const oldChannel = oldState.channel;
|
||||
|
||||
if (oldChannel && oldChannel.members.size === 0) {
|
||||
try {
|
||||
await oldChannel.delete();
|
||||
tempChannels.delete(oldState.channelId);
|
||||
console.log(`[TempVC] Deleted empty temporary channel "${oldChannel.name}"`);
|
||||
} catch (error) {
|
||||
if (error.code !== 10003) {
|
||||
console.error("[TempVC] Error deleting temporary channel:", error);
|
||||
}
|
||||
tempChannels.delete(oldState.channelId);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const interactionEvent = new Event("interactionCreate", async (client, interaction) => {
|
||||
if (!interaction.isButton() && !interaction.isModalSubmit()) return;
|
||||
if (!interaction.customId.startsWith("tempvc_")) return;
|
||||
|
||||
const channel = interaction.channel;
|
||||
if (!tempChannels.has(channel.id)) {
|
||||
return interaction.reply({ content: "This channel is no longer a temporary voice channel.", flags: Discord.MessageFlags.Ephemeral });
|
||||
}
|
||||
|
||||
const ownerId = tempChannels.get(channel.id);
|
||||
const isOwner = interaction.user.id === ownerId || interaction.member.permissions.has(Discord.PermissionFlagsBits.Administrator);
|
||||
|
||||
if (interaction.customId === "tempvc_claim") {
|
||||
const currentOwnerInVC = channel.members.has(ownerId);
|
||||
if (currentOwnerInVC && interaction.user.id !== ownerId) {
|
||||
return interaction.reply({ content: "The owner is still in the voice channel!", flags: Discord.MessageFlags.Ephemeral });
|
||||
}
|
||||
|
||||
tempChannels.set(channel.id, interaction.user.id);
|
||||
await channel.permissionOverwrites.edit(interaction.user.id, {
|
||||
ManageChannels: true,
|
||||
MoveMembers: true,
|
||||
});
|
||||
|
||||
return interaction.reply({ content: "You are now the owner of this voice channel!", flags: Discord.MessageFlags.Ephemeral });
|
||||
}
|
||||
|
||||
if (!isOwner) {
|
||||
return interaction.reply({ content: "Only the channel owner can use these controls.", flags: Discord.MessageFlags.Ephemeral });
|
||||
}
|
||||
|
||||
try {
|
||||
switch (interaction.customId) {
|
||||
case "tempvc_lock":
|
||||
await channel.permissionOverwrites.edit(interaction.guild.id, { Connect: false });
|
||||
await interaction.reply({ content: "Channel locked! 🔒", flags: Discord.MessageFlags.Ephemeral });
|
||||
break;
|
||||
case "tempvc_unlock":
|
||||
await channel.permissionOverwrites.edit(interaction.guild.id, { Connect: null });
|
||||
await interaction.reply({ content: "Channel unlocked! 🔓", flags: Discord.MessageFlags.Ephemeral });
|
||||
break;
|
||||
case "tempvc_rename":
|
||||
const modal = new Discord.ModalBuilder()
|
||||
.setCustomId("tempvc_modal_rename")
|
||||
.setTitle("Rename Channel")
|
||||
.addComponents(
|
||||
new Discord.ActionRowBuilder().addComponents(
|
||||
new Discord.TextInputBuilder()
|
||||
.setCustomId("name")
|
||||
.setLabel("New Name")
|
||||
.setStyle(Discord.TextInputStyle.Short)
|
||||
.setPlaceholder(channel.name)
|
||||
.setRequired(true)
|
||||
)
|
||||
);
|
||||
await interaction.showModal(modal);
|
||||
break;
|
||||
case "tempvc_limit":
|
||||
const limitModal = new Discord.ModalBuilder()
|
||||
.setCustomId("tempvc_modal_limit")
|
||||
.setTitle("Set User Limit")
|
||||
.addComponents(
|
||||
new Discord.ActionRowBuilder().addComponents(
|
||||
new Discord.TextInputBuilder()
|
||||
.setCustomId("limit")
|
||||
.setLabel("Limit (0-99)")
|
||||
.setStyle(Discord.TextInputStyle.Short)
|
||||
.setPlaceholder("0 for no limit")
|
||||
.setRequired(true)
|
||||
)
|
||||
);
|
||||
await interaction.showModal(limitModal);
|
||||
break;
|
||||
}
|
||||
|
||||
if (interaction.isModalSubmit()) {
|
||||
if (interaction.customId === "tempvc_modal_rename") {
|
||||
const newName = interaction.fields.getTextInputValue("name");
|
||||
await channel.setName(newName);
|
||||
await interaction.reply({ content: `Channel renamed to **${newName}**!`, flags: Discord.MessageFlags.Ephemeral });
|
||||
} else if (interaction.customId === "tempvc_modal_limit") {
|
||||
const limit = parseInt(interaction.fields.getTextInputValue("limit"));
|
||||
if (isNaN(limit) || limit < 0 || limit > 99) {
|
||||
return interaction.reply({ content: "Please enter a valid number between 0 and 99.", flags: Discord.MessageFlags.Ephemeral });
|
||||
}
|
||||
await channel.setUserLimit(limit);
|
||||
await interaction.reply({ content: `User limit set to **${limit === 0 ? "Unlimited" : limit}**!`, flags: Discord.MessageFlags.Ephemeral });
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("[TempVC] Error handling interaction:", error);
|
||||
if (!interaction.replied) await interaction.reply({ content: "An error occurred.", flags: Discord.MessageFlags.Ephemeral });
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = [voiceStateUpdate, interactionEvent];
|
||||
@@ -0,0 +1,652 @@
|
||||
const Discord = require("discord.js");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const yaml = require("js-yaml");
|
||||
|
||||
const { Command } = require("../Structures/Addon.js");
|
||||
|
||||
// Main bot config
|
||||
const supportbot = yaml.load(
|
||||
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||
);
|
||||
|
||||
// Addon config
|
||||
const addonConfig = yaml.load(
|
||||
fs.readFileSync("./Addons/Configs/applicationsystem.yml", "utf8")
|
||||
);
|
||||
|
||||
// Data file
|
||||
const dataPath = path.join(__dirname, "Data/applicationsystem.json");
|
||||
|
||||
function ensureDataFile() {
|
||||
const dir = path.dirname(dataPath);
|
||||
|
||||
if (!fs.existsSync(dir)) {
|
||||
fs.mkdirSync(dir, { recursive: true });
|
||||
}
|
||||
|
||||
if (!fs.existsSync(dataPath)) {
|
||||
fs.writeFileSync(
|
||||
dataPath,
|
||||
JSON.stringify({ applications: [] }, null, 2),
|
||||
"utf8"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function readData() {
|
||||
ensureDataFile();
|
||||
|
||||
try {
|
||||
const raw = fs.readFileSync(dataPath, "utf8");
|
||||
const parsed = JSON.parse(raw);
|
||||
|
||||
if (!parsed || !Array.isArray(parsed.applications)) {
|
||||
return { applications: [] };
|
||||
}
|
||||
|
||||
return parsed;
|
||||
} catch (error) {
|
||||
console.error("[ApplicationSystem] Failed to read data file:", error);
|
||||
return { applications: [] };
|
||||
}
|
||||
}
|
||||
|
||||
function writeData(data) {
|
||||
ensureDataFile();
|
||||
fs.writeFileSync(dataPath, JSON.stringify(data, null, 2), "utf8");
|
||||
}
|
||||
|
||||
function now() {
|
||||
return Date.now();
|
||||
}
|
||||
|
||||
function createId() {
|
||||
return `app_${Date.now()}_${Math.floor(Math.random() * 100000)}`;
|
||||
}
|
||||
|
||||
function parseColor(value, fallback = 0x2b2d31) {
|
||||
if (typeof value === "number") return value;
|
||||
|
||||
if (typeof value === "string") {
|
||||
const cleaned = value.trim().replace("#", "");
|
||||
if (/^[0-9A-Fa-f]{6}$/.test(cleaned)) {
|
||||
return parseInt(cleaned, 16);
|
||||
}
|
||||
}
|
||||
|
||||
return fallback;
|
||||
}
|
||||
|
||||
function getGeneralColour() {
|
||||
return parseColor(supportbot?.Embed?.Colours?.General, 0x2b2d31);
|
||||
}
|
||||
|
||||
function buildNoticeContainer(title, description, colour = 0x5865f2) {
|
||||
return new Discord.ContainerBuilder()
|
||||
.setAccentColor(colour)
|
||||
.addTextDisplayComponents(
|
||||
new Discord.TextDisplayBuilder().setContent(`## ${title}`)
|
||||
)
|
||||
.addSeparatorComponents(new Discord.SeparatorBuilder())
|
||||
.addTextDisplayComponents(
|
||||
new Discord.TextDisplayBuilder().setContent(description)
|
||||
);
|
||||
}
|
||||
|
||||
function buildPanelContainer() {
|
||||
const options = Object.entries(addonConfig.Applications || {})
|
||||
.slice(0, 25)
|
||||
.map(([key, app]) =>
|
||||
new Discord.StringSelectMenuOptionBuilder()
|
||||
.setLabel(String(app.Name || key).slice(0, 100))
|
||||
.setDescription(
|
||||
String(app.Description || "Apply for this position").slice(0, 100)
|
||||
)
|
||||
.setValue(key)
|
||||
);
|
||||
|
||||
return new Discord.ContainerBuilder()
|
||||
.setAccentColor(getGeneralColour())
|
||||
.addTextDisplayComponents(
|
||||
new Discord.TextDisplayBuilder().setContent(
|
||||
`## ${addonConfig.Panel?.Title || "Applications"}`
|
||||
)
|
||||
)
|
||||
.addSeparatorComponents(new Discord.SeparatorBuilder())
|
||||
.addTextDisplayComponents(
|
||||
new Discord.TextDisplayBuilder().setContent(
|
||||
addonConfig.Panel?.Description ||
|
||||
"Choose an application from the dropdown below."
|
||||
)
|
||||
)
|
||||
.addActionRowComponents(
|
||||
new Discord.ActionRowBuilder().addComponents(
|
||||
new Discord.StringSelectMenuBuilder()
|
||||
.setCustomId("appsystem_select")
|
||||
.setPlaceholder(
|
||||
addonConfig.Panel?.Placeholder || "Select an application type"
|
||||
)
|
||||
.addOptions(options)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function textInputStyle(style) {
|
||||
return style === "Paragraph"
|
||||
? Discord.TextInputStyle.Paragraph
|
||||
: Discord.TextInputStyle.Short;
|
||||
}
|
||||
|
||||
function sanitizeQuestionKey(key) {
|
||||
return String(key).toLowerCase().replace(/[^a-z0-9_]/g, "_");
|
||||
}
|
||||
|
||||
function formatQuestionTitle(key) {
|
||||
return String(key)
|
||||
.replace(/_/g, " ")
|
||||
.replace(/\b\w/g, (char) => char.toUpperCase());
|
||||
}
|
||||
|
||||
function buildApplicationModal(typeKey) {
|
||||
const applicationType = addonConfig.Applications?.[typeKey];
|
||||
if (!applicationType) return null;
|
||||
|
||||
const modal = new Discord.ModalBuilder()
|
||||
.setCustomId(`appsystem_modal_${typeKey}`)
|
||||
.setTitle(String(applicationType.Name || typeKey).slice(0, 45));
|
||||
|
||||
const questionEntries = Object.entries(applicationType.Questions || {}).slice(0, 5);
|
||||
|
||||
for (const [key, question] of questionEntries) {
|
||||
const input = new Discord.TextInputBuilder()
|
||||
.setCustomId(sanitizeQuestionKey(key))
|
||||
.setLabel(String(question.Label || key).slice(0, 45))
|
||||
.setPlaceholder(String(question.Placeholder || "Enter your answer").slice(0, 100))
|
||||
.setRequired(Boolean(question.Required))
|
||||
.setStyle(textInputStyle(question.Style))
|
||||
.setMinLength(Number(question.MinLength || 1))
|
||||
.setMaxLength(Number(question.MaxLength || 1000));
|
||||
|
||||
modal.addComponents(
|
||||
new Discord.ActionRowBuilder().addComponents(input)
|
||||
);
|
||||
}
|
||||
|
||||
return modal;
|
||||
}
|
||||
|
||||
function buildReviewContainer(application, reviewerText = null, locked = false) {
|
||||
const statusText =
|
||||
application.status === "accepted"
|
||||
? "Accepted"
|
||||
: application.status === "rejected"
|
||||
? "Rejected"
|
||||
: "Pending";
|
||||
|
||||
const answerLines = Object.entries(application.answers || {})
|
||||
.map(([key, value]) => `### ${formatQuestionTitle(key)}\n${value}`)
|
||||
.join("\n\n");
|
||||
|
||||
const body = [
|
||||
`**Applicant:** <@${application.userId}>`,
|
||||
`**Tag:** ${application.userTag}`,
|
||||
`**Application Type:** ${application.typeName}`,
|
||||
`**Application ID:** \`${application.id}\``,
|
||||
`**Status:** ${statusText}`,
|
||||
"",
|
||||
answerLines || "*No answers provided.*",
|
||||
].join("\n");
|
||||
|
||||
const container = new Discord.ContainerBuilder()
|
||||
.setAccentColor(getGeneralColour())
|
||||
.addTextDisplayComponents(
|
||||
new Discord.TextDisplayBuilder().setContent(
|
||||
`## ${addonConfig.Review?.Title || "New Application"}`
|
||||
)
|
||||
)
|
||||
.addSeparatorComponents(new Discord.SeparatorBuilder())
|
||||
.addTextDisplayComponents(
|
||||
new Discord.TextDisplayBuilder().setContent(body)
|
||||
);
|
||||
|
||||
if (reviewerText) {
|
||||
container
|
||||
.addSeparatorComponents(new Discord.SeparatorBuilder())
|
||||
.addTextDisplayComponents(
|
||||
new Discord.TextDisplayBuilder().setContent(reviewerText)
|
||||
);
|
||||
}
|
||||
|
||||
container.addActionRowComponents(
|
||||
new Discord.ActionRowBuilder().addComponents(
|
||||
new Discord.ButtonBuilder()
|
||||
.setCustomId(`appsystem_accept_${application.id}`)
|
||||
.setLabel(addonConfig.Review?.AcceptLabel || "Accept")
|
||||
.setStyle(Discord.ButtonStyle.Success)
|
||||
.setDisabled(locked),
|
||||
new Discord.ButtonBuilder()
|
||||
.setCustomId(`appsystem_reject_${application.id}`)
|
||||
.setLabel(addonConfig.Review?.RejectLabel || "Reject")
|
||||
.setStyle(Discord.ButtonStyle.Danger)
|
||||
.setDisabled(locked)
|
||||
)
|
||||
);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
function getPendingApplication(data, guildId, userId, type) {
|
||||
return data.applications.find(
|
||||
(app) =>
|
||||
app.guildId === guildId &&
|
||||
app.userId === userId &&
|
||||
app.type === type &&
|
||||
app.status === "pending"
|
||||
);
|
||||
}
|
||||
|
||||
function getCooldownApplication(data, guildId, userId, type) {
|
||||
const cooldownMs =
|
||||
Number(addonConfig.Application?.CooldownHours || 24) * 60 * 60 * 1000;
|
||||
|
||||
return data.applications.find(
|
||||
(app) =>
|
||||
app.guildId === guildId &&
|
||||
app.userId === userId &&
|
||||
app.type === type &&
|
||||
now() - Number(app.createdAt || 0) < cooldownMs
|
||||
);
|
||||
}
|
||||
|
||||
function memberCanReview(member) {
|
||||
if (!member) return false;
|
||||
|
||||
if (member.permissions?.has(Discord.PermissionFlagsBits.ManageGuild)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function registerAddonInteractions(client) {
|
||||
if (client.__applicationSystemRegistered) return;
|
||||
client.__applicationSystemRegistered = true;
|
||||
|
||||
client.on("interactionCreate", async (interaction) => {
|
||||
try {
|
||||
if (!interaction.guild) return;
|
||||
|
||||
// Application dropdown select
|
||||
if (
|
||||
interaction.isStringSelectMenu() &&
|
||||
interaction.customId === "appsystem_select"
|
||||
) {
|
||||
const typeKey = interaction.values[0];
|
||||
const applicationType = addonConfig.Applications?.[typeKey];
|
||||
|
||||
if (!applicationType) {
|
||||
return interaction.reply({
|
||||
flags:
|
||||
Discord.MessageFlags.Ephemeral |
|
||||
Discord.MessageFlags.IsComponentsV2,
|
||||
components: [
|
||||
buildNoticeContainer(
|
||||
"Invalid Application",
|
||||
"That application type does not exist.",
|
||||
0xed4245
|
||||
),
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
const data = readData();
|
||||
|
||||
if (addonConfig.Application?.OneOpenApplicationPerUserPerType) {
|
||||
const existing = getPendingApplication(
|
||||
data,
|
||||
interaction.guild.id,
|
||||
interaction.user.id,
|
||||
typeKey
|
||||
);
|
||||
|
||||
if (existing) {
|
||||
return interaction.reply({
|
||||
flags:
|
||||
Discord.MessageFlags.Ephemeral |
|
||||
Discord.MessageFlags.IsComponentsV2,
|
||||
components: [
|
||||
buildNoticeContainer(
|
||||
"Application Already Open",
|
||||
`You already have a pending ${applicationType.Name} application.`,
|
||||
0xed4245
|
||||
),
|
||||
],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const cooldownHit = getCooldownApplication(
|
||||
data,
|
||||
interaction.guild.id,
|
||||
interaction.user.id,
|
||||
typeKey
|
||||
);
|
||||
|
||||
if (cooldownHit && cooldownHit.status !== "pending") {
|
||||
return interaction.reply({
|
||||
flags:
|
||||
Discord.MessageFlags.Ephemeral |
|
||||
Discord.MessageFlags.IsComponentsV2,
|
||||
components: [
|
||||
buildNoticeContainer(
|
||||
"Please Wait",
|
||||
`You must wait ${addonConfig.Application?.CooldownHours || 24} hours before applying again for ${applicationType.Name}.`,
|
||||
0xfee75c
|
||||
),
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
const modal = buildApplicationModal(typeKey);
|
||||
|
||||
if (!modal) {
|
||||
return interaction.reply({
|
||||
flags:
|
||||
Discord.MessageFlags.Ephemeral |
|
||||
Discord.MessageFlags.IsComponentsV2,
|
||||
components: [
|
||||
buildNoticeContainer(
|
||||
"Modal Error",
|
||||
"The application form could not be created.",
|
||||
0xed4245
|
||||
),
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
return interaction.showModal(modal);
|
||||
}
|
||||
|
||||
// Application modal submit
|
||||
if (
|
||||
interaction.isModalSubmit() &&
|
||||
interaction.customId.startsWith("appsystem_modal_")
|
||||
) {
|
||||
const typeKey = interaction.customId.replace("appsystem_modal_", "");
|
||||
const applicationType = addonConfig.Applications?.[typeKey];
|
||||
|
||||
if (!applicationType) {
|
||||
return interaction.reply({
|
||||
flags:
|
||||
Discord.MessageFlags.Ephemeral |
|
||||
Discord.MessageFlags.IsComponentsV2,
|
||||
components: [
|
||||
buildNoticeContainer(
|
||||
"Invalid Application",
|
||||
"That application type no longer exists.",
|
||||
0xed4245
|
||||
),
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
const reviewChannel = interaction.guild.channels.cache.get(
|
||||
addonConfig.Application?.ReviewChannelId
|
||||
);
|
||||
|
||||
if (!reviewChannel) {
|
||||
return interaction.reply({
|
||||
flags:
|
||||
Discord.MessageFlags.Ephemeral |
|
||||
Discord.MessageFlags.IsComponentsV2,
|
||||
components: [
|
||||
buildNoticeContainer(
|
||||
"Configuration Error",
|
||||
"The review channel was not found. Please contact staff.",
|
||||
0xed4245
|
||||
),
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
const data = readData();
|
||||
|
||||
if (addonConfig.Application?.OneOpenApplicationPerUserPerType) {
|
||||
const existing = getPendingApplication(
|
||||
data,
|
||||
interaction.guild.id,
|
||||
interaction.user.id,
|
||||
typeKey
|
||||
);
|
||||
|
||||
if (existing) {
|
||||
return interaction.reply({
|
||||
flags:
|
||||
Discord.MessageFlags.Ephemeral |
|
||||
Discord.MessageFlags.IsComponentsV2,
|
||||
components: [
|
||||
buildNoticeContainer(
|
||||
"Application Already Open",
|
||||
`You already have a pending ${applicationType.Name} application.`,
|
||||
0xed4245
|
||||
),
|
||||
],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const answers = {};
|
||||
const questionEntries = Object.entries(applicationType.Questions || {}).slice(0, 5);
|
||||
|
||||
for (const [key] of questionEntries) {
|
||||
const inputKey = sanitizeQuestionKey(key);
|
||||
answers[inputKey] = interaction.fields.getTextInputValue(inputKey);
|
||||
}
|
||||
|
||||
const application = {
|
||||
id: createId(),
|
||||
type: typeKey,
|
||||
typeName: applicationType.Name || typeKey,
|
||||
guildId: interaction.guild.id,
|
||||
userId: interaction.user.id,
|
||||
userTag: interaction.user.tag || interaction.user.username,
|
||||
status: "pending",
|
||||
createdAt: now(),
|
||||
reviewerId: null,
|
||||
reviewedAt: null,
|
||||
reviewMessageId: null,
|
||||
answers,
|
||||
};
|
||||
|
||||
const reviewMessage = await reviewChannel.send({
|
||||
flags: Discord.MessageFlags.IsComponentsV2,
|
||||
components: [buildReviewContainer(application, null, false)],
|
||||
});
|
||||
|
||||
application.reviewMessageId = reviewMessage.id;
|
||||
data.applications.push(application);
|
||||
writeData(data);
|
||||
|
||||
return interaction.reply({
|
||||
flags:
|
||||
Discord.MessageFlags.Ephemeral |
|
||||
Discord.MessageFlags.IsComponentsV2,
|
||||
components: [
|
||||
buildNoticeContainer(
|
||||
"Application Sent",
|
||||
`Your ${applicationType.Name} application has been submitted successfully.`,
|
||||
0x57f287
|
||||
),
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
// Review buttons
|
||||
if (
|
||||
interaction.isButton() &&
|
||||
(interaction.customId.startsWith("appsystem_accept_") ||
|
||||
interaction.customId.startsWith("appsystem_reject_"))
|
||||
) {
|
||||
if (!memberCanReview(interaction.member)) {
|
||||
return interaction.reply({
|
||||
flags:
|
||||
Discord.MessageFlags.Ephemeral |
|
||||
Discord.MessageFlags.IsComponentsV2,
|
||||
components: [
|
||||
buildNoticeContainer(
|
||||
"No Permission",
|
||||
"You do not have permission to review applications.",
|
||||
0xed4245
|
||||
),
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
const isAccept = interaction.customId.startsWith("appsystem_accept_");
|
||||
const applicationId = interaction.customId.replace(
|
||||
isAccept ? "appsystem_accept_" : "appsystem_reject_",
|
||||
""
|
||||
);
|
||||
|
||||
const data = readData();
|
||||
const application = data.applications.find((app) => app.id === applicationId);
|
||||
|
||||
if (!application) {
|
||||
return interaction.reply({
|
||||
flags:
|
||||
Discord.MessageFlags.Ephemeral |
|
||||
Discord.MessageFlags.IsComponentsV2,
|
||||
components: [
|
||||
buildNoticeContainer(
|
||||
"Not Found",
|
||||
"This application no longer exists in storage.",
|
||||
0xed4245
|
||||
),
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
if (application.status !== "pending") {
|
||||
return interaction.reply({
|
||||
flags:
|
||||
Discord.MessageFlags.Ephemeral |
|
||||
Discord.MessageFlags.IsComponentsV2,
|
||||
components: [
|
||||
buildNoticeContainer(
|
||||
"Already Reviewed",
|
||||
`This application has already been ${application.status}.`,
|
||||
0xfee75c
|
||||
),
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
application.status = isAccept ? "accepted" : "rejected";
|
||||
application.reviewerId = interaction.user.id;
|
||||
application.reviewedAt = now();
|
||||
writeData(data);
|
||||
|
||||
const reviewerText = [
|
||||
`### Review Result`,
|
||||
`**Decision:** ${isAccept ? "Accepted" : "Rejected"}`,
|
||||
`**Reviewer:** <@${interaction.user.id}>`,
|
||||
`**Reviewed At:** <t:${Math.floor(application.reviewedAt / 1000)}:F>`,
|
||||
].join("\n");
|
||||
|
||||
await interaction.update({
|
||||
flags: Discord.MessageFlags.IsComponentsV2,
|
||||
components: [
|
||||
buildReviewContainer(application, reviewerText, true),
|
||||
],
|
||||
});
|
||||
|
||||
const applicationType = addonConfig.Applications?.[application.type];
|
||||
|
||||
if (isAccept && applicationType?.AcceptedRoleId) {
|
||||
const member = await interaction.guild.members
|
||||
.fetch(application.userId)
|
||||
.catch(() => null);
|
||||
|
||||
if (member) {
|
||||
await member.roles.add(applicationType.AcceptedRoleId).catch(() => null);
|
||||
}
|
||||
}
|
||||
|
||||
const applicantUser = await interaction.client.users
|
||||
.fetch(application.userId)
|
||||
.catch(() => null);
|
||||
|
||||
if (applicantUser) {
|
||||
await applicantUser
|
||||
.send({
|
||||
flags: Discord.MessageFlags.IsComponentsV2,
|
||||
components: [
|
||||
buildNoticeContainer(
|
||||
isAccept ? "Application Accepted" : "Application Rejected",
|
||||
isAccept
|
||||
? `Congratulations! Your ${application.typeName} application in **${interaction.guild.name}** has been accepted.`
|
||||
: `Your ${application.typeName} application in **${interaction.guild.name}** has been rejected.`,
|
||||
isAccept ? 0x57f287 : 0xed4245
|
||||
),
|
||||
],
|
||||
})
|
||||
.catch(() => null);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("[ApplicationSystem] Interaction error:", error);
|
||||
|
||||
if (interaction.deferred || interaction.replied) {
|
||||
return;
|
||||
}
|
||||
|
||||
return interaction
|
||||
.reply({
|
||||
flags:
|
||||
Discord.MessageFlags.Ephemeral |
|
||||
Discord.MessageFlags.IsComponentsV2,
|
||||
components: [
|
||||
buildNoticeContainer(
|
||||
"Error",
|
||||
"Something went wrong while handling that application interaction.",
|
||||
0xed4245
|
||||
),
|
||||
],
|
||||
})
|
||||
.catch(() => null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = new Command({
|
||||
name: addonConfig.Command?.Name || "applicationsetup",
|
||||
description:
|
||||
addonConfig.Command?.Description || "Posts the application panel",
|
||||
options: [],
|
||||
permissions: addonConfig.Command?.Permission || ["ManageGuild"],
|
||||
|
||||
async run(interaction) {
|
||||
registerAddonInteractions(interaction.client);
|
||||
|
||||
await interaction.channel.send({
|
||||
flags: Discord.MessageFlags.IsComponentsV2,
|
||||
components: [buildPanelContainer()],
|
||||
});
|
||||
|
||||
return interaction.reply({
|
||||
flags:
|
||||
Discord.MessageFlags.Ephemeral |
|
||||
Discord.MessageFlags.IsComponentsV2,
|
||||
components: [
|
||||
buildNoticeContainer(
|
||||
"Application Panel Posted",
|
||||
"The application panel has been posted in this channel.",
|
||||
0x57f287
|
||||
),
|
||||
],
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,83 @@
|
||||
const Discord = require("discord.js");
|
||||
const fs = require("fs");
|
||||
const yaml = require("js-yaml");
|
||||
const { Command } = require('../Structures/Addon.js'); // Adjust the path as needed
|
||||
const supportbot = yaml.load(fs.readFileSync("./Configs/supportbot.yml", "utf8"));
|
||||
|
||||
module.exports = new Command({
|
||||
name: "calculator",
|
||||
description: "Use a calculator to solve your math problems.",
|
||||
options: [],
|
||||
permissions: ["SendMessages"],
|
||||
|
||||
async run(interaction) {
|
||||
let expression = "";
|
||||
let history = "";
|
||||
|
||||
const createButton = (label, customId) => {
|
||||
return new Discord.ButtonBuilder()
|
||||
.setLabel(label)
|
||||
.setCustomId(customId)
|
||||
.setStyle(Discord.ButtonStyle.Secondary);
|
||||
};
|
||||
|
||||
const createRow = (buttons) => {
|
||||
return new Discord.ActionRowBuilder().addComponents(buttons);
|
||||
};
|
||||
|
||||
const rows = [
|
||||
createRow([createButton('7', '7'), createButton('8', '8'), createButton('9', '9'), createButton('/', '/')]),
|
||||
createRow([createButton('4', '4'), createButton('5', '5'), createButton('6', '6'), createButton('*', '*')]),
|
||||
createRow([createButton('1', '1'), createButton('2', '2'), createButton('3', '3'), createButton('-', '-')]),
|
||||
createRow([createButton('0', '0'), createButton('.', '.'), createButton('=', '='), createButton('+', '+')]),
|
||||
createRow([createButton('Clear', 'clear')])
|
||||
];
|
||||
|
||||
const embed = new Discord.EmbedBuilder()
|
||||
.setTitle('Calculator')
|
||||
.setDescription('Calculator')
|
||||
.setColor(supportbot.Embed.Colours.General);
|
||||
|
||||
const message = await interaction.reply({
|
||||
embeds: [embed],
|
||||
components: rows,
|
||||
fetchReply: true
|
||||
});
|
||||
|
||||
const filter = i => i.user.id === interaction.user.id;
|
||||
const collector = message.createMessageComponentCollector({ filter, time: 60000 });
|
||||
|
||||
collector.on('collect', async i => {
|
||||
if (i.customId === 'clear') {
|
||||
expression = "";
|
||||
history = "";
|
||||
} else if (i.customId === '=') {
|
||||
try {
|
||||
const result = eval(expression).toString();
|
||||
history += `${expression} = ${result}\n`;
|
||||
expression = result;
|
||||
} catch {
|
||||
expression = "Error";
|
||||
}
|
||||
} else {
|
||||
if (history.endsWith(`${expression} = ${expression}\n`)) {
|
||||
history += `\n`;
|
||||
expression = i.customId;
|
||||
} else {
|
||||
expression += i.customId;
|
||||
}
|
||||
}
|
||||
|
||||
await i.update({
|
||||
embeds: [new Discord.EmbedBuilder().setTitle('Calculator').setDescription(`\`\`\`${history}${expression}\`\`\``).setColor(supportbot.Embed.Colours.General)],
|
||||
components: rows
|
||||
});
|
||||
});
|
||||
|
||||
collector.on('end', collected => {
|
||||
message.edit({
|
||||
components: []
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,292 @@
|
||||
const Discord = require("discord.js");
|
||||
const fs = require("fs");
|
||||
const yaml = require("js-yaml");
|
||||
const fetch = require("node-fetch");
|
||||
const { Command } = require('../Structures/Addon.js');
|
||||
|
||||
const supportbot = yaml.load(fs.readFileSync("./Configs/supportbot.yml", "utf8"));
|
||||
const vouchleyaddon = yaml.load(fs.readFileSync("./Addons/Configs/vouchley.yml", "utf8"));
|
||||
|
||||
function formatURL(url) {
|
||||
if (!url) return 'https://www.vouchley.com';
|
||||
if (!url.startsWith('http://') && !url.startsWith('https://')) {
|
||||
return `https://${url}`;
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
function formatDate(timestamp) {
|
||||
return `<t:${Math.floor(new Date(timestamp).getTime() / 1000)}:D>`;
|
||||
}
|
||||
|
||||
function createReviewEmbed(review, username, currentPage, totalReviews) {
|
||||
const embed = new Discord.EmbedBuilder()
|
||||
.setTitle(`Review for ${username}`)
|
||||
.setColor(vouchleyaddon.Embed.Colour);
|
||||
|
||||
const fields = [
|
||||
{
|
||||
name: "Rating",
|
||||
value: "⭐".repeat(Math.min(Math.max(review.rating, 1), 5)) || "No rating",
|
||||
inline: false
|
||||
},
|
||||
{
|
||||
name: "Platform",
|
||||
value: review.platform?.toString() || "Not specified",
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: "Date",
|
||||
value: formatDate(review.time_sent),
|
||||
inline: true
|
||||
}
|
||||
];
|
||||
|
||||
if (review.message && review.message.trim()) {
|
||||
fields.push({
|
||||
name: "Review",
|
||||
value: `\`\`\`${review.message.substring(0, 1024)}\`\`\``,
|
||||
inline: false
|
||||
});
|
||||
}
|
||||
|
||||
embed.addFields(fields);
|
||||
embed.setFooter({ text: `Review ${currentPage + 1} of ${totalReviews}` });
|
||||
|
||||
return embed;
|
||||
}
|
||||
|
||||
function createReviewNavigation(currentPage, totalReviews) {
|
||||
return new Discord.ActionRowBuilder()
|
||||
.addComponents(
|
||||
new Discord.ButtonBuilder()
|
||||
.setCustomId('prev_review')
|
||||
.setLabel('Previous')
|
||||
.setStyle(Discord.ButtonStyle.Primary)
|
||||
.setDisabled(currentPage === 0),
|
||||
new Discord.ButtonBuilder()
|
||||
.setCustomId('next_review')
|
||||
.setLabel('Next')
|
||||
.setStyle(Discord.ButtonStyle.Primary)
|
||||
.setDisabled(currentPage === totalReviews - 1),
|
||||
new Discord.ButtonBuilder()
|
||||
.setCustomId('back_to_profile')
|
||||
.setLabel('Back to Profile')
|
||||
.setStyle(Discord.ButtonStyle.Secondary)
|
||||
);
|
||||
}
|
||||
|
||||
const activeReviews = new Map();
|
||||
|
||||
module.exports = new Command({
|
||||
name: vouchleyaddon.Command.Name,
|
||||
description: vouchleyaddon.Command.Description,
|
||||
options: [
|
||||
{
|
||||
name: "search_type",
|
||||
description: "How do you want to search for the user?",
|
||||
type: 3,
|
||||
required: true,
|
||||
choices: [
|
||||
{ name: "Vouchley ID", value: "id" },
|
||||
{ name: "Vouchley Username", value: "username" },
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "query",
|
||||
description: "Enter the ID, username, or Discord ID to search",
|
||||
type: 3,
|
||||
required: true
|
||||
}
|
||||
],
|
||||
permissions: vouchleyaddon.Command.Permissions,
|
||||
|
||||
async run(interaction) {
|
||||
const searchType = interaction.options.getString("search_type");
|
||||
const query = interaction.options.getString("query");
|
||||
|
||||
try {
|
||||
let apiUrl;
|
||||
switch (searchType) {
|
||||
case "id":
|
||||
apiUrl = `https://www.vouchley.com/api/v1/user?id=${query}`;
|
||||
break;
|
||||
case "username":
|
||||
apiUrl = `https://www.vouchley.com/api/v1/user?username=${query}`;
|
||||
break;
|
||||
}
|
||||
|
||||
const response = await fetch(apiUrl, {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${vouchleyaddon.Vouchley.API_Key}`,
|
||||
'Content-Type': 'application/json',
|
||||
}
|
||||
});
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
if (!response.ok || (data.error && data.error.code !== 200)) {
|
||||
return interaction.reply({
|
||||
content: `Error: ${data.error?.message || 'Failed to fetch user data'}`,
|
||||
ephemeral: vouchleyaddon.Embed.Ephemeral
|
||||
});
|
||||
}
|
||||
|
||||
const user = data.user;
|
||||
|
||||
const profileEmbed = new Discord.EmbedBuilder()
|
||||
.setTitle(`${user.username} - ${String(user.title || "N/A")}`)
|
||||
.setColor(vouchleyaddon.Embed.Colour)
|
||||
.setThumbnail(user.avatar_url)
|
||||
.addFields([
|
||||
{
|
||||
name: "Discord",
|
||||
value: `<@${String(user.discord_id)}> (\`${String(user.discord_id)}\`)`,
|
||||
inline: false
|
||||
},
|
||||
{
|
||||
name: "Average Rating",
|
||||
value: `${String(user.average_rating)} (\`${String(user.reviews.length)} Reviews\`)`,
|
||||
inline: false
|
||||
}
|
||||
]);
|
||||
|
||||
const profileButtons = [
|
||||
new Discord.ButtonBuilder()
|
||||
.setLabel(`Review ${user.username}`)
|
||||
.setURL(`https://www.vouchley.com/review?user=${user.username}`)
|
||||
.setStyle(Discord.ButtonStyle.Link)
|
||||
];
|
||||
|
||||
if (user.website) {
|
||||
profileButtons.push(
|
||||
new Discord.ButtonBuilder()
|
||||
.setLabel('Visit Website')
|
||||
.setURL(formatURL(user.website))
|
||||
.setStyle(Discord.ButtonStyle.Link)
|
||||
);
|
||||
}
|
||||
|
||||
if (user.reviews && user.reviews.length > 0) {
|
||||
profileButtons.push(
|
||||
new Discord.ButtonBuilder()
|
||||
.setCustomId('seereviews')
|
||||
.setLabel('See Reviews')
|
||||
.setEmoji("⭐")
|
||||
.setStyle(Discord.ButtonStyle.Secondary)
|
||||
);
|
||||
}
|
||||
|
||||
const profileRow = new Discord.ActionRowBuilder()
|
||||
.addComponents(profileButtons);
|
||||
|
||||
const message = await interaction.reply({
|
||||
embeds: [profileEmbed],
|
||||
components: [profileRow],
|
||||
fetchReply: true,
|
||||
ephemeral: vouchleyaddon.Embed.Ephemeral
|
||||
});
|
||||
|
||||
if (user.reviews && user.reviews.length > 0) {
|
||||
activeReviews.set(message.id, {
|
||||
reviews: user.reviews,
|
||||
currentPage: 0,
|
||||
username: user.username,
|
||||
profileEmbed,
|
||||
profileRow
|
||||
});
|
||||
|
||||
const collector = message.createMessageComponentCollector({
|
||||
time: 600000
|
||||
});
|
||||
|
||||
collector.on('collect', async i => {
|
||||
const reviewData = activeReviews.get(message.id);
|
||||
if (!reviewData) return;
|
||||
|
||||
switch (i.customId) {
|
||||
case 'seereviews': {
|
||||
const review = reviewData.reviews[reviewData.currentPage];
|
||||
const reviewEmbed = createReviewEmbed(
|
||||
review,
|
||||
reviewData.username,
|
||||
reviewData.currentPage,
|
||||
reviewData.reviews.length
|
||||
);
|
||||
const reviewNav = createReviewNavigation(
|
||||
reviewData.currentPage,
|
||||
reviewData.reviews.length
|
||||
);
|
||||
await i.update({
|
||||
embeds: [reviewEmbed],
|
||||
components: [reviewNav],
|
||||
ephemeral: vouchleyaddon.Embed.Ephemeral
|
||||
});
|
||||
break;
|
||||
}
|
||||
case 'prev_review': {
|
||||
if (reviewData.currentPage > 0) {
|
||||
reviewData.currentPage--;
|
||||
const review = reviewData.reviews[reviewData.currentPage];
|
||||
const reviewEmbed = createReviewEmbed(
|
||||
review,
|
||||
reviewData.username,
|
||||
reviewData.currentPage,
|
||||
reviewData.reviews.length
|
||||
);
|
||||
const reviewNav = createReviewNavigation(
|
||||
reviewData.currentPage,
|
||||
reviewData.reviews.length
|
||||
);
|
||||
await i.update({
|
||||
embeds: [reviewEmbed],
|
||||
components: [reviewNav],
|
||||
ephemeral: vouchleyaddon.Embed.Ephemeral
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'next_review': {
|
||||
if (reviewData.currentPage < reviewData.reviews.length - 1) {
|
||||
reviewData.currentPage++;
|
||||
const review = reviewData.reviews[reviewData.currentPage];
|
||||
const reviewEmbed = createReviewEmbed(
|
||||
review,
|
||||
reviewData.username,
|
||||
reviewData.currentPage,
|
||||
reviewData.reviews.length
|
||||
);
|
||||
const reviewNav = createReviewNavigation(
|
||||
reviewData.currentPage,
|
||||
reviewData.reviews.length
|
||||
);
|
||||
await i.update({ embeds: [reviewEmbed], components: [reviewNav] });
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'back_to_profile': {
|
||||
await i.update({
|
||||
embeds: [reviewData.profileEmbed],
|
||||
components: [reviewData.profileRow]
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
collector.on('end', () => {
|
||||
activeReviews.delete(message.id);
|
||||
});
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
if (!interaction.replied) {
|
||||
await interaction.reply({
|
||||
content: "There was an error fetching Vouchley user data.",
|
||||
ephemeral: vouchleyaddon.Embed.Ephemeral
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
+7
-5
@@ -7,16 +7,18 @@ API:
|
||||
Enabled: true
|
||||
Port: 3000
|
||||
|
||||
SecretKey: "CHANGE_ME"
|
||||
SecretKey: "SECRET_KEY"
|
||||
# Set to 1 when the dashboard is behind nginx, Cloudflare, Pterodactyl proxy, etc.
|
||||
# so http/https is detected from X-Forwarded-Proto.
|
||||
|
||||
|
||||
TrustProxy: false
|
||||
|
||||
EmeraldAPIKey: "EMERALDSRV_API_KEY"
|
||||
|
||||
OAuth:
|
||||
Enabled: true
|
||||
ClientId: "DISCORD_CLIENT_ID"
|
||||
ClientSecret: "DISCORD_CLIENT_SECRET"
|
||||
ClientId: "1530910674551574580"
|
||||
ClientSecret: "GIWdonM3bdFILhkg_1XWWeVQRlGf_npu"
|
||||
# Canonical callback URL (host + path). Protocol (http/https) can follow the
|
||||
# browser when UseRequestOrigin is true (default).
|
||||
|
||||
@@ -28,5 +30,5 @@ API:
|
||||
# CookieSecure: false
|
||||
|
||||
OwnerUserIds:
|
||||
- "YOUR_DISCORD_USER_ID"
|
||||
- "OWNER_ID"
|
||||
AllowedUserIds: []
|
||||
@@ -12,25 +12,25 @@
|
||||
#
|
||||
# SupportBot Configuration (supportbot.yml)
|
||||
|
||||
SupportBot_Version: "v26.3.0"
|
||||
SupportBot_Version: "v26.2-pre1"
|
||||
|
||||
# -------------------------
|
||||
# General
|
||||
# -------------------------
|
||||
|
||||
General:
|
||||
Name: "SupportBo"
|
||||
Name: "SupportBot"
|
||||
Token: "BOT_TOKEN"
|
||||
Addons:
|
||||
Enabled: true
|
||||
GuildId: ""
|
||||
GuildId: "GUILD_ID"
|
||||
|
||||
# -------------------------
|
||||
# Activity
|
||||
# -------------------------
|
||||
|
||||
Activity:
|
||||
Status: "Char"
|
||||
Status: "SupportBot"
|
||||
Type: "Watching"
|
||||
StreamingURL: "https://www.twitch.tv/YOUR_TWITCH_NAME"
|
||||
# Available Types:
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"blacklistedUsers": []
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,29 +0,0 @@
|
||||
{
|
||||
"version": 1,
|
||||
"users": {
|
||||
"829112572816130058": {
|
||||
"id": "829112572816130058",
|
||||
"username": "ch_ar.",
|
||||
"globalName": "Char",
|
||||
"avatar": "823630e777efe85c7fe71402f00ab0c1",
|
||||
"role": "owner",
|
||||
"permissions": null,
|
||||
"enabled": true,
|
||||
"createdAt": 1779820911269,
|
||||
"updatedAt": 1779822114501,
|
||||
"createdBy": "system"
|
||||
},
|
||||
"YOUR_DISCORD_USER_ID": {
|
||||
"id": "YOUR_DISCORD_USER_ID",
|
||||
"username": null,
|
||||
"globalName": null,
|
||||
"avatar": null,
|
||||
"role": "owner",
|
||||
"permissions": null,
|
||||
"enabled": true,
|
||||
"createdAt": 1779822020405,
|
||||
"updatedAt": 1779822020405,
|
||||
"createdBy": "system"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"autoDelete": {
|
||||
"enabled": false,
|
||||
"afterDays": 30
|
||||
},
|
||||
"publicAccess": {
|
||||
"enabled": false
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
[2026-05-20T12:58:22.767Z] (node:15252) Warning: Accessing non-existent property 'getIntrinsicHookSteps' of module exports inside circular dependency
|
||||
(Use `node --trace-warnings ...` to show where the warning was created)
|
||||
@@ -1,4 +0,0 @@
|
||||
[2026-05-26T18:08:20.799Z] Unhandled Rejection: DiscordjsError [TokenInvalid]: An invalid token was provided.
|
||||
[2026-05-26T18:30:31.132Z] Unhandled Rejection: DiscordjsError [TokenInvalid]: An invalid token was provided.
|
||||
[2026-05-26T18:34:34.094Z] Unhandled Rejection: DiscordjsError [TokenInvalid]: An invalid token was provided.
|
||||
[2026-05-26T19:00:20.833Z] Unhandled Rejection: DiscordjsError [TokenInvalid]: An invalid token was provided.
|
||||
@@ -1,29 +0,0 @@
|
||||
[2026-05-19T22:25:25.691Z] [API] Server running on port 3000
|
||||
[2026-05-19T22:25:26.507Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-19T22:25:26.508Z] [1m[32mSupportBot[0m
|
||||
[2026-05-19T22:25:26.508Z] [90mEmerald Services[0m
|
||||
[2026-05-19T22:25:26.509Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-19T22:25:26.509Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-19T22:25:26.519Z] [90m------[0m
|
||||
[2026-05-19T22:25:26.520Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-19T22:25:26.520Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-19T22:25:26.520Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-19T22:25:26.521Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-19T22:25:26.521Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-19T22:25:26.522Z] [90mGuilds [0m 1
|
||||
[2026-05-19T22:25:26.522Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-19T22:25:26.523Z] [90m-----[0m
|
||||
[2026-05-19T22:25:26.523Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-19T22:25:26.524Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-19T22:25:26.525Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-19T22:25:26.525Z]
|
||||
[2026-05-19T22:25:26.526Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-19T22:25:26.527Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-19T22:25:26.528Z] [90m------------[0m
|
||||
[2026-05-19T22:25:26.530Z] [32m✓[0m All configurations validated successfully
|
||||
[2026-05-19T22:25:26.531Z]
|
||||
[2026-05-19T22:25:26.702Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
@@ -1,292 +0,0 @@
|
||||
[2026-05-20T12:19:19.626Z] [API] Server running on port 3000
|
||||
[2026-05-20T12:19:20.498Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-20T12:19:20.499Z] [1m[32mSupportBot[0m
|
||||
[2026-05-20T12:19:20.499Z] [90mEmerald Services[0m
|
||||
[2026-05-20T12:19:20.500Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-20T12:19:20.500Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-20T12:19:20.667Z] [90m------[0m
|
||||
[2026-05-20T12:19:20.667Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-20T12:19:20.668Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-20T12:19:20.668Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-20T12:19:20.668Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-20T12:19:20.669Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-20T12:19:20.669Z] [90mGuilds [0m 1
|
||||
[2026-05-20T12:19:20.669Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-20T12:19:20.670Z] [90m-----[0m
|
||||
[2026-05-20T12:19:20.670Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-20T12:19:20.670Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-20T12:19:20.671Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-20T12:19:20.671Z]
|
||||
[2026-05-20T12:19:20.672Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-20T12:19:20.675Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-20T12:19:20.676Z] [90m------------[0m
|
||||
[2026-05-20T12:19:20.678Z] [32m✓[0m All configurations validated successfully
|
||||
[2026-05-20T12:19:20.678Z]
|
||||
[2026-05-20T12:19:20.887Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-20T12:24:38.643Z] [API] Server running on port 3000
|
||||
[2026-05-20T12:24:39.659Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-20T12:24:39.660Z] [1m[32mSupportBot[0m
|
||||
[2026-05-20T12:24:39.660Z] [90mEmerald Services[0m
|
||||
[2026-05-20T12:24:39.660Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-20T12:24:39.661Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-20T12:24:39.661Z] [90m------[0m
|
||||
[2026-05-20T12:24:39.662Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-20T12:24:39.662Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-20T12:24:39.663Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-20T12:24:39.663Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-20T12:24:39.663Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-20T12:24:39.664Z] [90mGuilds [0m 1
|
||||
[2026-05-20T12:24:39.664Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-20T12:24:39.665Z] [90m-----[0m
|
||||
[2026-05-20T12:24:39.665Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-20T12:24:39.666Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-20T12:24:39.666Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-20T12:24:39.667Z]
|
||||
[2026-05-20T12:24:39.667Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-20T12:24:39.670Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-20T12:24:39.671Z] [90m------------[0m
|
||||
[2026-05-20T12:24:39.674Z] [32m✓[0m All configurations validated successfully
|
||||
[2026-05-20T12:24:39.674Z]
|
||||
[2026-05-20T12:24:39.875Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-20T12:26:52.985Z] [API] Server running on port 3000
|
||||
[2026-05-20T12:26:54.033Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-20T12:26:54.034Z] [1m[32mSupportBot[0m
|
||||
[2026-05-20T12:26:54.034Z] [90mEmerald Services[0m
|
||||
[2026-05-20T12:26:54.035Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-20T12:26:54.035Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-20T12:26:54.035Z] [90m------[0m
|
||||
[2026-05-20T12:26:54.036Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-20T12:26:54.036Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-20T12:26:54.037Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-20T12:26:54.037Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-20T12:26:54.037Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-20T12:26:54.038Z] [90mGuilds [0m 1
|
||||
[2026-05-20T12:26:54.038Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-20T12:26:54.039Z] [90m-----[0m
|
||||
[2026-05-20T12:26:54.039Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-20T12:26:54.040Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-20T12:26:54.040Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-20T12:26:54.041Z]
|
||||
[2026-05-20T12:26:54.042Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-20T12:26:54.044Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-20T12:26:54.045Z] [90m------------[0m
|
||||
[2026-05-20T12:26:54.047Z] [32m✓[0m All configurations validated successfully
|
||||
[2026-05-20T12:26:54.048Z]
|
||||
[2026-05-20T12:26:54.256Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-20T12:27:29.337Z] [BotReload] Restarting Discord bot after config change…
|
||||
[2026-05-20T12:27:30.140Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-20T12:27:30.141Z] [1m[32mSupportBot[0m
|
||||
[2026-05-20T12:27:30.141Z] [90mEmerald Services[0m
|
||||
[2026-05-20T12:27:30.141Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-20T12:27:30.142Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-20T12:27:30.142Z] [90m------[0m
|
||||
[2026-05-20T12:27:30.143Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-20T12:27:30.144Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-20T12:27:30.144Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-20T12:27:30.144Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-20T12:27:30.145Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-20T12:27:30.145Z] [90mGuilds [0m 1
|
||||
[2026-05-20T12:27:30.146Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-20T12:27:30.146Z] [90m-----[0m
|
||||
[2026-05-20T12:27:30.147Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-20T12:27:30.147Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-20T12:27:30.147Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-20T12:27:30.148Z]
|
||||
[2026-05-20T12:27:30.149Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-20T12:27:30.149Z] [90m------------[0m
|
||||
[2026-05-20T12:27:30.150Z] [32m✓[0m All configurations validated successfully
|
||||
[2026-05-20T12:27:30.150Z]
|
||||
[2026-05-20T12:27:30.433Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-20T12:27:30.434Z] [BotReload] Bot restarted successfully
|
||||
[2026-05-20T12:27:34.617Z] [32m [Executed] [37;1m ch_ar. has executed ticketpanel
|
||||
[2026-05-20T12:27:34.856Z] [TICKET PANEL] Previous panel message not found, creating a new one.
|
||||
[2026-05-20T12:39:22.918Z] [API] Server running on port 3000
|
||||
[2026-05-20T12:39:23.738Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-20T12:39:23.739Z] [1m[32mSupportBot[0m
|
||||
[2026-05-20T12:39:23.739Z] [90mEmerald Services[0m
|
||||
[2026-05-20T12:39:23.739Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-20T12:39:23.740Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-20T12:39:23.740Z] [90m------[0m
|
||||
[2026-05-20T12:39:23.741Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-20T12:39:23.741Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-20T12:39:23.741Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-20T12:39:23.741Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-20T12:39:23.742Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-20T12:39:23.742Z] [90mGuilds [0m 1
|
||||
[2026-05-20T12:39:23.743Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-20T12:39:23.743Z] [90m-----[0m
|
||||
[2026-05-20T12:39:23.743Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-20T12:39:23.744Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-20T12:39:23.745Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-20T12:39:23.745Z]
|
||||
[2026-05-20T12:39:23.746Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-20T12:39:23.748Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-20T12:39:23.750Z] [90m------------[0m
|
||||
[2026-05-20T12:39:23.752Z] [32m✓[0m All configurations validated successfully
|
||||
[2026-05-20T12:39:23.752Z]
|
||||
[2026-05-20T12:39:23.966Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-20T12:46:34.090Z] [API] Server running on port 3000
|
||||
[2026-05-20T12:46:34.880Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-20T12:46:34.880Z] [1m[32mSupportBot[0m
|
||||
[2026-05-20T12:46:34.881Z] [90mEmerald Services[0m
|
||||
[2026-05-20T12:46:34.881Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-20T12:46:34.882Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-20T12:46:34.882Z] [90m------[0m
|
||||
[2026-05-20T12:46:34.882Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-20T12:46:34.883Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-20T12:46:34.883Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-20T12:46:34.884Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-20T12:46:34.884Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-20T12:46:34.885Z] [90mGuilds [0m 1
|
||||
[2026-05-20T12:46:34.885Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-20T12:46:34.886Z] [90m-----[0m
|
||||
[2026-05-20T12:46:34.887Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-20T12:46:34.887Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-20T12:46:34.888Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-20T12:46:34.888Z]
|
||||
[2026-05-20T12:46:34.889Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-20T12:46:34.890Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-20T12:46:34.891Z] [90m------------[0m
|
||||
[2026-05-20T12:46:34.893Z] [32m✓[0m All configurations validated successfully
|
||||
[2026-05-20T12:46:34.894Z]
|
||||
[2026-05-20T12:46:35.096Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-20T12:52:39.673Z] [API] Server running on port 3000
|
||||
[2026-05-20T12:52:40.422Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-20T12:52:40.423Z] [1m[32mSupportBot[0m
|
||||
[2026-05-20T12:52:40.423Z] [90mEmerald Services[0m
|
||||
[2026-05-20T12:52:40.423Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-20T12:52:40.424Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-20T12:52:40.424Z] [90m------[0m
|
||||
[2026-05-20T12:52:40.424Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-20T12:52:40.425Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-20T12:52:40.425Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-20T12:52:40.425Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-20T12:52:40.426Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-20T12:52:40.426Z] [90mGuilds [0m 1
|
||||
[2026-05-20T12:52:40.426Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-20T12:52:40.427Z] [90m-----[0m
|
||||
[2026-05-20T12:52:40.427Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-20T12:52:40.428Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-20T12:52:40.428Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-20T12:52:40.429Z]
|
||||
[2026-05-20T12:52:40.429Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-20T12:52:40.431Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-20T12:52:40.431Z] [90m------------[0m
|
||||
[2026-05-20T12:52:40.435Z] [32m✓[0m All configurations validated successfully
|
||||
[2026-05-20T12:52:40.436Z]
|
||||
[2026-05-20T12:52:40.672Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-20T12:58:22.768Z] [API] Server running on port 3000
|
||||
[2026-05-20T12:58:23.534Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-20T12:58:23.534Z] [1m[32mSupportBot[0m
|
||||
[2026-05-20T12:58:23.534Z] [90mEmerald Services[0m
|
||||
[2026-05-20T12:58:23.535Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-20T12:58:23.535Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-20T12:58:23.536Z] [90m------[0m
|
||||
[2026-05-20T12:58:23.536Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-20T12:58:23.536Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-20T12:58:23.537Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-20T12:58:23.537Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-20T12:58:23.538Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-20T12:58:23.538Z] [90mGuilds [0m 1
|
||||
[2026-05-20T12:58:23.539Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-20T12:58:23.539Z] [90m-----[0m
|
||||
[2026-05-20T12:58:23.540Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-20T12:58:23.540Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-20T12:58:23.541Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-20T12:58:23.541Z]
|
||||
[2026-05-20T12:58:23.542Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-20T12:58:23.543Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-20T12:58:23.544Z] [90m------------[0m
|
||||
[2026-05-20T12:58:23.546Z] [32m✓[0m All configurations validated successfully
|
||||
[2026-05-20T12:58:23.549Z]
|
||||
[2026-05-20T12:58:23.750Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-20T13:00:24.932Z] [API] Server running on port 3000
|
||||
[2026-05-20T13:00:25.900Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-20T13:00:25.901Z] [1m[32mSupportBot[0m
|
||||
[2026-05-20T13:00:25.901Z] [90mEmerald Services[0m
|
||||
[2026-05-20T13:00:25.901Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-20T13:00:25.902Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-20T13:00:25.902Z] [90m------[0m
|
||||
[2026-05-20T13:00:25.903Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-20T13:00:25.903Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-20T13:00:25.903Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-20T13:00:25.904Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-20T13:00:25.904Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-20T13:00:25.905Z] [90mGuilds [0m 1
|
||||
[2026-05-20T13:00:25.905Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-20T13:00:25.906Z] [90m-----[0m
|
||||
[2026-05-20T13:00:25.906Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-20T13:00:25.907Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-20T13:00:25.907Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-20T13:00:25.907Z]
|
||||
[2026-05-20T13:00:25.908Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-20T13:00:25.909Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-20T13:00:25.910Z] [90m------------[0m
|
||||
[2026-05-20T13:00:25.912Z] [32m✓[0m All configurations validated successfully
|
||||
[2026-05-20T13:00:25.913Z]
|
||||
[2026-05-20T13:00:26.169Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-20T13:06:04.723Z] [API] Server running on port 3000
|
||||
[2026-05-20T13:06:05.516Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-20T13:06:05.517Z] [1m[32mSupportBot[0m
|
||||
[2026-05-20T13:06:05.517Z] [90mEmerald Services[0m
|
||||
[2026-05-20T13:06:05.518Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-20T13:06:05.518Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-20T13:06:05.519Z] [90m------[0m
|
||||
[2026-05-20T13:06:05.519Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-20T13:06:05.519Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-20T13:06:05.520Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-20T13:06:05.520Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-20T13:06:05.521Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-20T13:06:05.521Z] [90mGuilds [0m 1
|
||||
[2026-05-20T13:06:05.522Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-20T13:06:05.522Z] [90m-----[0m
|
||||
[2026-05-20T13:06:05.523Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-20T13:06:05.524Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-20T13:06:05.525Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-20T13:06:05.525Z]
|
||||
[2026-05-20T13:06:05.526Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-20T13:06:05.527Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-20T13:06:05.528Z] [90m------------[0m
|
||||
[2026-05-20T13:06:05.530Z] [32m✓[0m All configurations validated successfully
|
||||
[2026-05-20T13:06:05.531Z]
|
||||
[2026-05-20T13:06:05.724Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
@@ -1,416 +0,0 @@
|
||||
[2026-05-26T18:08:20.392Z] [API] Server running on port 3000
|
||||
[2026-05-26T18:09:50.058Z] [API] Server running on port 3000
|
||||
[2026-05-26T18:09:50.812Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T18:09:50.812Z] [1m[32mSupportBot[0m
|
||||
[2026-05-26T18:09:50.813Z] [90mEmerald Services[0m
|
||||
[2026-05-26T18:09:50.813Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T18:09:50.814Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-26T18:09:50.814Z] [90m------[0m
|
||||
[2026-05-26T18:09:50.815Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-26T18:09:50.815Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-26T18:09:50.815Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-26T18:09:50.816Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-26T18:09:50.816Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-26T18:09:50.817Z] [90mGuilds [0m 1
|
||||
[2026-05-26T18:09:50.817Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-26T18:09:50.818Z] [90m-----[0m
|
||||
[2026-05-26T18:09:50.818Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-26T18:09:50.819Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-26T18:09:50.819Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-26T18:09:50.820Z]
|
||||
[2026-05-26T18:09:50.820Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-26T18:09:50.822Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-26T18:09:50.822Z] [90m------------[0m
|
||||
[2026-05-26T18:09:50.824Z] [32m✓[0m All configurations validated successfully
|
||||
[2026-05-26T18:09:50.825Z]
|
||||
[2026-05-26T18:09:51.093Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-26T18:18:05.034Z] [API] Server running on port 3000
|
||||
[2026-05-26T18:18:05.886Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T18:18:05.886Z] [1m[32mSupportBot[0m
|
||||
[2026-05-26T18:18:05.887Z] [90mEmerald Services[0m
|
||||
[2026-05-26T18:18:05.887Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T18:18:05.887Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-26T18:18:05.888Z] [90m------[0m
|
||||
[2026-05-26T18:18:05.888Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-26T18:18:05.889Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-26T18:18:05.889Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-26T18:18:05.889Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-26T18:18:05.890Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-26T18:18:05.890Z] [90mGuilds [0m 1
|
||||
[2026-05-26T18:18:05.891Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-26T18:18:05.892Z] [90m-----[0m
|
||||
[2026-05-26T18:18:05.893Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-26T18:18:05.894Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-26T18:18:05.895Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-26T18:18:05.901Z]
|
||||
[2026-05-26T18:18:05.903Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-26T18:18:05.907Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-26T18:18:05.908Z] [90m------------[0m
|
||||
[2026-05-26T18:18:05.910Z] [32m✓[0m All configurations validated successfully
|
||||
[2026-05-26T18:18:05.911Z]
|
||||
[2026-05-26T18:18:06.116Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-26T18:24:36.850Z] [API] Server running on port 3000
|
||||
[2026-05-26T18:24:37.648Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T18:24:37.648Z] [1m[32mSupportBot[0m
|
||||
[2026-05-26T18:24:37.649Z] [90mEmerald Services[0m
|
||||
[2026-05-26T18:24:37.649Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T18:24:37.649Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-26T18:24:37.650Z] [90m------[0m
|
||||
[2026-05-26T18:24:37.650Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-26T18:24:37.650Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-26T18:24:37.651Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-26T18:24:37.651Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-26T18:24:37.652Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-26T18:24:37.652Z] [90mGuilds [0m 1
|
||||
[2026-05-26T18:24:37.653Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-26T18:24:37.653Z] [90m-----[0m
|
||||
[2026-05-26T18:24:37.654Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-26T18:24:37.654Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-26T18:24:37.656Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-26T18:24:37.659Z]
|
||||
[2026-05-26T18:24:37.659Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-26T18:24:37.661Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-26T18:24:37.662Z] [90m------------[0m
|
||||
[2026-05-26T18:24:37.664Z] [32m✓[0m All configurations validated successfully
|
||||
[2026-05-26T18:24:37.664Z]
|
||||
[2026-05-26T18:24:37.857Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-26T18:27:00.991Z] [API] Server running on port 3000
|
||||
[2026-05-26T18:27:01.875Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T18:27:01.876Z] [1m[32mSupportBot[0m
|
||||
[2026-05-26T18:27:01.876Z] [90mEmerald Services[0m
|
||||
[2026-05-26T18:27:01.877Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T18:27:01.877Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-26T18:27:01.878Z] [90m------[0m
|
||||
[2026-05-26T18:27:01.878Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-26T18:27:01.879Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-26T18:27:01.879Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-26T18:27:01.879Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-26T18:27:01.880Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-26T18:27:01.880Z] [90mGuilds [0m 1
|
||||
[2026-05-26T18:27:01.881Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-26T18:27:01.881Z] [90m-----[0m
|
||||
[2026-05-26T18:27:01.882Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-26T18:27:01.883Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-26T18:27:01.883Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-26T18:27:01.884Z]
|
||||
[2026-05-26T18:27:01.885Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-26T18:27:01.886Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-26T18:27:01.888Z] [90m------------[0m
|
||||
[2026-05-26T18:27:01.890Z] [32m✓[0m All configurations validated successfully
|
||||
[2026-05-26T18:27:01.891Z]
|
||||
[2026-05-26T18:27:02.152Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-26T18:29:06.705Z] [API] Server running on port 3000
|
||||
[2026-05-26T18:29:07.459Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T18:29:07.459Z] [1m[32mSupportBot[0m
|
||||
[2026-05-26T18:29:07.460Z] [90mEmerald Services[0m
|
||||
[2026-05-26T18:29:07.460Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T18:29:07.461Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-26T18:29:07.461Z] [90m------[0m
|
||||
[2026-05-26T18:29:07.462Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-26T18:29:07.462Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-26T18:29:07.462Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-26T18:29:07.462Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-26T18:29:07.463Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-26T18:29:07.463Z] [90mGuilds [0m 1
|
||||
[2026-05-26T18:29:07.465Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-26T18:29:07.466Z] [90m-----[0m
|
||||
[2026-05-26T18:29:07.466Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-26T18:29:07.467Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-26T18:29:07.467Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-26T18:29:07.468Z]
|
||||
[2026-05-26T18:29:07.469Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-26T18:29:07.470Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-26T18:29:07.471Z] [90m------------[0m
|
||||
[2026-05-26T18:29:07.473Z] [32m✓[0m All configurations validated successfully
|
||||
[2026-05-26T18:29:07.474Z]
|
||||
[2026-05-26T18:29:07.656Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-26T18:30:31.130Z] [API] Server running on port 3000
|
||||
[2026-05-26T18:31:30.298Z] [BotReload] Restarting Discord bot after config change…
|
||||
[2026-05-26T18:31:31.048Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T18:31:31.050Z] [1m[32mSupportBot[0m
|
||||
[2026-05-26T18:31:31.054Z] [90mEmerald Services[0m
|
||||
[2026-05-26T18:31:31.058Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T18:31:31.061Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-26T18:31:31.066Z] [90m------[0m
|
||||
[2026-05-26T18:31:31.069Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-26T18:31:31.071Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-26T18:31:31.075Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-26T18:31:31.078Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-26T18:31:31.082Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-26T18:31:31.085Z] [90mGuilds [0m 1
|
||||
[2026-05-26T18:31:31.091Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-26T18:31:31.097Z] [90m-----[0m
|
||||
[2026-05-26T18:31:31.101Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-26T18:31:31.106Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-26T18:31:31.113Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-26T18:31:31.118Z]
|
||||
[2026-05-26T18:31:31.123Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-26T18:31:31.127Z] [90m------------[0m
|
||||
[2026-05-26T18:31:31.134Z] [33m![0m Missing roles (1198295676128329799, 1198299671576195213, 1491881628065337404)
|
||||
[2026-05-26T18:31:31.139Z] [33m![0m Missing channels (1290752269880660079)
|
||||
[2026-05-26T18:31:31.142Z]
|
||||
[2026-05-26T18:31:31.183Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-26T18:31:31.412Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-26T18:31:31.413Z] [BotReload] Bot restarted successfully
|
||||
[2026-05-26T18:31:31.682Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-26T18:31:46.891Z] [API] Server running on port 3000
|
||||
[2026-05-26T18:31:47.594Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T18:31:47.594Z] [1m[32mSupportBot[0m
|
||||
[2026-05-26T18:31:47.595Z] [90mEmerald Services[0m
|
||||
[2026-05-26T18:31:47.595Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T18:31:47.596Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-26T18:31:47.597Z] [90m------[0m
|
||||
[2026-05-26T18:31:47.597Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-26T18:31:47.598Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-26T18:31:47.598Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-26T18:31:47.599Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-26T18:31:47.600Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-26T18:31:47.600Z] [90mGuilds [0m 1
|
||||
[2026-05-26T18:31:47.601Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-26T18:31:47.602Z] [90m-----[0m
|
||||
[2026-05-26T18:31:47.602Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-26T18:31:47.603Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-26T18:31:47.604Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-26T18:31:47.604Z]
|
||||
[2026-05-26T18:31:47.605Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-26T18:31:47.607Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-26T18:31:47.608Z] [90m------------[0m
|
||||
[2026-05-26T18:31:47.610Z] [32m✓[0m All configurations validated successfully
|
||||
[2026-05-26T18:31:47.611Z]
|
||||
[2026-05-26T18:32:31.812Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-26T18:34:34.091Z] [API] Server running on port 3000
|
||||
[2026-05-26T18:35:12.583Z] [BotReload] Restarting Discord bot after config change…
|
||||
[2026-05-26T18:35:13.391Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T18:35:13.391Z] [1m[32mSupportBot[0m
|
||||
[2026-05-26T18:35:13.392Z] [90mEmerald Services[0m
|
||||
[2026-05-26T18:35:13.392Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T18:35:13.393Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-26T18:35:13.393Z] [90m------[0m
|
||||
[2026-05-26T18:35:13.394Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-26T18:35:13.394Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-26T18:35:13.395Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-26T18:35:13.395Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-26T18:35:13.395Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-26T18:35:13.396Z] [90mGuilds [0m 1
|
||||
[2026-05-26T18:35:13.396Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-26T18:35:13.397Z] [90m-----[0m
|
||||
[2026-05-26T18:35:13.398Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-26T18:35:13.399Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-26T18:35:13.400Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-26T18:35:13.400Z]
|
||||
[2026-05-26T18:35:13.401Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-26T18:35:13.402Z] [90m------------[0m
|
||||
[2026-05-26T18:35:13.403Z] [33m![0m Missing roles (1198295676128329799, 1198299671576195213, 1491881628065337404)
|
||||
[2026-05-26T18:35:13.404Z] [33m![0m Missing channels (1290752269880660079)
|
||||
[2026-05-26T18:35:13.404Z]
|
||||
[2026-05-26T18:35:13.429Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-26T18:35:13.621Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-26T18:35:13.621Z] [BotReload] Bot restarted successfully
|
||||
[2026-05-26T18:35:13.853Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-26T18:35:27.209Z] [API] Server running on port 3000
|
||||
[2026-05-26T18:35:27.933Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T18:35:27.933Z] [1m[32mSupportBot[0m
|
||||
[2026-05-26T18:35:27.933Z] [90mEmerald Services[0m
|
||||
[2026-05-26T18:35:27.934Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T18:35:27.934Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-26T18:35:27.935Z] [90m------[0m
|
||||
[2026-05-26T18:35:27.935Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-26T18:35:27.936Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-26T18:35:27.936Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-26T18:35:27.937Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-26T18:35:27.937Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-26T18:35:27.938Z] [90mGuilds [0m 1
|
||||
[2026-05-26T18:35:27.938Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-26T18:35:27.938Z] [90m-----[0m
|
||||
[2026-05-26T18:35:27.939Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-26T18:35:27.940Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-26T18:35:27.940Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-26T18:35:27.941Z]
|
||||
[2026-05-26T18:35:27.941Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-26T18:35:27.943Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-26T18:35:27.943Z] [90m------------[0m
|
||||
[2026-05-26T18:35:27.945Z] [32m✓[0m All configurations validated successfully
|
||||
[2026-05-26T18:35:27.946Z]
|
||||
[2026-05-26T18:36:14.082Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-26T19:00:20.564Z] [API] Server running on port 3000
|
||||
[2026-05-26T19:01:08.704Z] [BotReload] Restarting Discord bot after config change…
|
||||
[2026-05-26T19:01:09.362Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-26T19:01:09.365Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T19:01:09.366Z] [1m[32mSupportBot[0m
|
||||
[2026-05-26T19:01:09.366Z] [90mEmerald Services[0m
|
||||
[2026-05-26T19:01:09.366Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T19:01:09.367Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-26T19:01:09.367Z] [90m------[0m
|
||||
[2026-05-26T19:01:09.367Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-26T19:01:09.368Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-26T19:01:09.368Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-26T19:01:09.368Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-26T19:01:09.369Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-26T19:01:09.369Z] [90mGuilds [0m 1
|
||||
[2026-05-26T19:01:09.370Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-26T19:01:09.371Z] [90m-----[0m
|
||||
[2026-05-26T19:01:09.371Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-26T19:01:09.372Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-26T19:01:09.373Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-26T19:01:09.373Z]
|
||||
[2026-05-26T19:01:09.375Z]
|
||||
[32mGuild[0m
|
||||
[2026-05-26T19:01:09.376Z] [90m-----[0m
|
||||
[2026-05-26T19:01:09.377Z] [33m![0m Guild setup (No guild ID is set. Add your Discord server ID under Bot config → General.)
|
||||
[2026-05-26T19:01:09.377Z]
|
||||
[2026-05-26T19:01:09.378Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-26T19:01:09.378Z] [90m------------[0m
|
||||
[2026-05-26T19:01:09.379Z] [33m![0m Missing roles (ROLE_ID, ROLE_ID, ROLE_ID)
|
||||
[2026-05-26T19:01:09.380Z] [33m![0m Missing channels (CHANNEL_ID)
|
||||
[2026-05-26T19:01:09.381Z]
|
||||
[2026-05-26T19:01:09.547Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-26T19:01:09.923Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-26T19:01:09.923Z] [BotReload] Bot restarted successfully
|
||||
[2026-05-26T19:01:44.692Z] [API] Server running on port 3000
|
||||
[2026-05-26T19:01:45.455Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T19:01:45.455Z] [1m[32mSupportBot[0m
|
||||
[2026-05-26T19:01:45.456Z] [90mEmerald Services[0m
|
||||
[2026-05-26T19:01:45.456Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T19:01:45.457Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-26T19:01:45.457Z] [90m------[0m
|
||||
[2026-05-26T19:01:45.458Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-26T19:01:45.458Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-26T19:01:45.458Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-26T19:01:45.459Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-26T19:01:45.459Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-26T19:01:45.460Z] [90mGuilds [0m 1
|
||||
[2026-05-26T19:01:45.462Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-26T19:01:45.462Z] [90m-----[0m
|
||||
[2026-05-26T19:01:45.463Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-26T19:01:45.464Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-26T19:01:45.466Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-26T19:01:45.467Z]
|
||||
[2026-05-26T19:01:45.468Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-26T19:01:45.469Z]
|
||||
[32mGuild[0m
|
||||
[2026-05-26T19:01:45.470Z] [90m-----[0m
|
||||
[2026-05-26T19:01:45.471Z] [33m![0m Guild setup (No guild ID is set. Add your Discord server ID under Bot config → General.)
|
||||
[2026-05-26T19:01:45.471Z]
|
||||
[2026-05-26T19:01:45.471Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-26T19:01:45.472Z] [90m------------[0m
|
||||
[2026-05-26T19:01:45.473Z] [33m![0m Missing roles (ROLE_ID, ROLE_ID, ROLE_ID)
|
||||
[2026-05-26T19:01:45.474Z] [33m![0m Missing channels (CHANNEL_ID)
|
||||
[2026-05-26T19:01:45.474Z]
|
||||
[2026-05-26T19:01:45.807Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-26T19:05:40.700Z] [API] Server running on port 3000
|
||||
[2026-05-26T19:05:41.522Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T19:05:41.522Z] [1m[32mSupportBot[0m
|
||||
[2026-05-26T19:05:41.523Z] [90mEmerald Services[0m
|
||||
[2026-05-26T19:05:41.523Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T19:05:41.524Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-26T19:05:41.524Z] [90m------[0m
|
||||
[2026-05-26T19:05:41.524Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-26T19:05:41.525Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-26T19:05:41.525Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-26T19:05:41.525Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-26T19:05:41.526Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-26T19:05:41.526Z] [90mGuilds [0m 1
|
||||
[2026-05-26T19:05:41.527Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-26T19:05:41.527Z] [90m-----[0m
|
||||
[2026-05-26T19:05:41.528Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-26T19:05:41.528Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-26T19:05:41.529Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-26T19:05:41.530Z]
|
||||
[2026-05-26T19:05:41.534Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-26T19:05:41.537Z]
|
||||
[32mGuild[0m
|
||||
[2026-05-26T19:05:41.537Z] [90m-----[0m
|
||||
[2026-05-26T19:05:41.538Z] [33m![0m Guild setup (No guild ID is set. Add your Discord server ID under Bot config → General.)
|
||||
[2026-05-26T19:05:41.539Z]
|
||||
[2026-05-26T19:05:41.539Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-26T19:05:41.540Z] [90m------------[0m
|
||||
[2026-05-26T19:05:41.542Z] [33m![0m Missing roles (ROLE_ID, ROLE_ID, ROLE_ID)
|
||||
[2026-05-26T19:05:41.543Z] [33m![0m Missing channels (CHANNEL_ID)
|
||||
[2026-05-26T19:05:41.543Z]
|
||||
[2026-05-26T19:05:41.761Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
[2026-05-26T19:07:41.900Z] [API] Server running on port 3000
|
||||
[2026-05-26T19:07:42.738Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T19:07:42.739Z] [1m[32mSupportBot[0m
|
||||
[2026-05-26T19:07:42.739Z] [90mEmerald Services[0m
|
||||
[2026-05-26T19:07:42.739Z] [90m────────────────────────────────────────────────────────[0m
|
||||
[2026-05-26T19:07:42.740Z]
|
||||
[32mSystem[0m
|
||||
[2026-05-26T19:07:42.740Z] [90m------[0m
|
||||
[2026-05-26T19:07:42.741Z] [90mBot Name [0m SupportBo
|
||||
[2026-05-26T19:07:42.741Z] [90mVersion [0m v26.3.0
|
||||
[2026-05-26T19:07:42.741Z] [90mNode.js [0m v24.14.1
|
||||
[2026-05-26T19:07:42.742Z] [90mDiscord.js [0m v14.26.4
|
||||
[2026-05-26T19:07:42.742Z] [90mLogged in as [0m BLITZ#7183
|
||||
[2026-05-26T19:07:42.743Z] [90mGuilds [0m 1
|
||||
[2026-05-26T19:07:42.743Z]
|
||||
[32mLinks[0m
|
||||
[2026-05-26T19:07:42.744Z] [90m-----[0m
|
||||
[2026-05-26T19:07:42.745Z] [90mDocs [0m https://emerald-services.gitbook.io/
|
||||
[2026-05-26T19:07:42.745Z] [90mDiscord [0m https://dsc.gg/emerald-dev
|
||||
[2026-05-26T19:07:42.746Z] [90mInvite [0m https://discord.com/api/oauth2/authorize?client_id=1289713673123922032&permissions=8&scope=bot%20applications.commands
|
||||
[2026-05-26T19:07:42.746Z]
|
||||
[2026-05-26T19:07:42.747Z] [Dashboard] Discord bot is ready — full stats and guild tools are available
|
||||
[2026-05-26T19:07:42.748Z]
|
||||
[32mGuild[0m
|
||||
[2026-05-26T19:07:42.751Z] [90m-----[0m
|
||||
[2026-05-26T19:07:42.752Z] [33m![0m Guild setup (No guild ID is set. Add your Discord server ID under Bot config → General.)
|
||||
[2026-05-26T19:07:42.752Z]
|
||||
[2026-05-26T19:07:42.753Z]
|
||||
[32mConfig Check[0m
|
||||
[2026-05-26T19:07:42.753Z] [90m------------[0m
|
||||
[2026-05-26T19:07:42.756Z] [33m![0m Missing roles (ROLE_ID, ROLE_ID, ROLE_ID)
|
||||
[2026-05-26T19:07:42.756Z] [33m![0m Missing channels (CHANNEL_ID)
|
||||
[2026-05-26T19:07:42.757Z]
|
||||
[2026-05-26T19:07:42.952Z]
|
||||
[32m✓[0m [37mSlash Commands Registered[0m [90mfor Char's Test Server[0m
|
||||
+62
-147
@@ -2,13 +2,22 @@ const fs = require("fs");
|
||||
const path = require("path");
|
||||
const axios = require("axios");
|
||||
const { withTimeout } = require("./asyncTimeout.js");
|
||||
const AdmZip = require("adm-zip");
|
||||
const yaml = require("js-yaml");
|
||||
|
||||
const ADDONS_REPO = "Emerald-Services/Addons";
|
||||
const ADDONS_BRANCH = "main";
|
||||
const GITHUB_API = `https://api.github.com/repos/${ADDONS_REPO}/contents`;
|
||||
const GITHUB_RAW = `https://raw.githubusercontent.com/${ADDONS_REPO}/${ADDONS_BRANCH}`;
|
||||
const EMERALD_API = "https://emeraldsrv.dev/api/v1";
|
||||
|
||||
const README_PATTERN = /^readme\.md$/i;
|
||||
function getApiKey() {
|
||||
try {
|
||||
if (fs.existsSync("./Configs/api.yml")) {
|
||||
const config = yaml.load(fs.readFileSync("./Configs/api.yml", "utf8"));
|
||||
return config?.API?.EmeraldAPIKey || "";
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Failed to read api.yml:", e);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
function ensureAddonDirs() {
|
||||
if (!fs.existsSync("./Addons")) {
|
||||
@@ -19,104 +28,45 @@ function ensureAddonDirs() {
|
||||
}
|
||||
}
|
||||
|
||||
async function githubList(dirPath = "") {
|
||||
const url = dirPath
|
||||
? `${GITHUB_API}/${encodeURIComponent(dirPath)}?ref=${ADDONS_BRANCH}`
|
||||
: `${GITHUB_API}?ref=${ADDONS_BRANCH}`;
|
||||
async function listCatalogAddons() {
|
||||
const key = getApiKey();
|
||||
if (!key) throw new Error("EmeraldAPIKey not configured in api.yml");
|
||||
|
||||
const res = await withTimeout(
|
||||
axios.get(url, {
|
||||
headers: { Accept: "application/vnd.github+json" },
|
||||
axios.get(`${EMERALD_API}/resources`, {
|
||||
headers: { Authorization: `Bearer ${key}` },
|
||||
timeout: 15_000,
|
||||
}),
|
||||
18_000,
|
||||
"GitHub API request timed out",
|
||||
"Emerald API request timed out",
|
||||
);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
async function listCatalogAddons() {
|
||||
const root = await githubList("");
|
||||
const dirs = root.filter((entry) => entry.type === "dir");
|
||||
|
||||
const addons = [];
|
||||
for (const dir of dirs) {
|
||||
const summary = await summarizeAddon(dir.name);
|
||||
if (summary) addons.push(summary);
|
||||
if (res.data.status !== "success") {
|
||||
throw new Error(res.data.message || "Failed to fetch catalog");
|
||||
}
|
||||
|
||||
return addons.sort((a, b) => a.name.localeCompare(b.name));
|
||||
return res.data.data.map(item => ({
|
||||
id: item.id.toString(),
|
||||
name: item.title,
|
||||
slug: item.slug,
|
||||
description: `Emerald Services Resource - ${item.slug}`,
|
||||
price: item.price,
|
||||
is_external: item.is_external,
|
||||
external_store: item.external_store,
|
||||
repositoryUrl: item.external_url || `https://emeraldsrv.dev`,
|
||||
jsFiles: [],
|
||||
configFiles: []
|
||||
})).sort((a, b) => a.name.localeCompare(b.name));
|
||||
}
|
||||
|
||||
async function summarizeAddon(name) {
|
||||
const files = await listAddonRepoFiles(name);
|
||||
const jsFiles = files.filter((f) => f.name.endsWith(".js"));
|
||||
if (jsFiles.length === 0) return null;
|
||||
|
||||
const configFiles = files
|
||||
.filter((f) => f.relativePath.startsWith("Configs/"))
|
||||
.map((f) => f.name);
|
||||
|
||||
const readme = files.find((f) => README_PATTERN.test(f.name));
|
||||
|
||||
return {
|
||||
id: name,
|
||||
name,
|
||||
description: readme
|
||||
? `Community addon from Emerald-Services/Addons`
|
||||
: `Addon from ${name}`,
|
||||
repositoryUrl: `https://github.com/${ADDONS_REPO}/tree/${ADDONS_BRANCH}/${name}`,
|
||||
jsFiles: jsFiles.map((f) => f.name),
|
||||
configFiles,
|
||||
fileCount: files.length,
|
||||
};
|
||||
}
|
||||
|
||||
async function listAddonRepoFiles(addonName) {
|
||||
const files = [];
|
||||
const queue = [addonName];
|
||||
|
||||
while (queue.length) {
|
||||
const dir = queue.shift();
|
||||
const entries = await githubList(dir);
|
||||
|
||||
for (const entry of entries) {
|
||||
if (entry.type === "dir") {
|
||||
queue.push(entry.path);
|
||||
continue;
|
||||
}
|
||||
if (entry.type !== "file") continue;
|
||||
if (README_PATTERN.test(entry.name)) continue;
|
||||
|
||||
const relativePath = entry.path.slice(`${addonName}/`.length);
|
||||
files.push({
|
||||
name: entry.name,
|
||||
path: entry.path,
|
||||
relativePath,
|
||||
downloadUrl: entry.download_url,
|
||||
size: entry.size,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return files;
|
||||
}
|
||||
|
||||
function mapRepoFileToLocal(addonName, relativePath) {
|
||||
const parts = relativePath.split("/").filter(Boolean);
|
||||
if (parts[0] === "Configs") {
|
||||
return path.join("Addons", "Configs", ...parts.slice(1));
|
||||
}
|
||||
if (parts.length === 1 && parts[0].endsWith(".js")) {
|
||||
return path.join("Addons", parts[0]);
|
||||
}
|
||||
return path.join("Addons", ...parts);
|
||||
}
|
||||
|
||||
async function downloadFile(url) {
|
||||
async function downloadFile(id) {
|
||||
const key = getApiKey();
|
||||
const res = await withTimeout(
|
||||
axios.get(url, { responseType: "arraybuffer", timeout: 30_000 }),
|
||||
axios.get(`${EMERALD_API}/download?id=${id}`, {
|
||||
headers: { Authorization: `Bearer ${key}` },
|
||||
responseType: "arraybuffer",
|
||||
timeout: 30_000
|
||||
}),
|
||||
35_000,
|
||||
"Addon file download timed out",
|
||||
);
|
||||
@@ -141,78 +91,45 @@ function listLocalAddonConfigs() {
|
||||
|
||||
function isAddonInstalled(catalogEntry) {
|
||||
const localJs = listLocalAddonJs();
|
||||
return catalogEntry.jsFiles.every((file) => localJs.includes(file));
|
||||
return localJs.some(f => f.includes(catalogEntry.slug) || f.includes(catalogEntry.id.toString()) || f.includes(catalogEntry.name.replace(/ /g, '')));
|
||||
}
|
||||
|
||||
async function listInstalledAddons(catalog) {
|
||||
const localJs = listLocalAddonJs();
|
||||
const installed = [];
|
||||
|
||||
for (const entry of catalog) {
|
||||
const allPresent = entry.jsFiles.every((file) => localJs.includes(file));
|
||||
if (allPresent) {
|
||||
installed.push({
|
||||
id: entry.id,
|
||||
name: entry.name,
|
||||
jsFiles: entry.jsFiles,
|
||||
configFiles: entry.configFiles.filter((f) => {
|
||||
const local = listLocalAddonConfigs();
|
||||
return local.includes(f);
|
||||
}),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const orphanJs = localJs.filter(
|
||||
(file) => !installed.some((a) => a.jsFiles.includes(file)),
|
||||
);
|
||||
for (const file of orphanJs) {
|
||||
for (const file of localJs) {
|
||||
const name = file.replace(/\.js$/, "");
|
||||
const match = catalog.find(c => c.slug === name || c.id.toString() === name || c.name.replace(/ /g, '') === name);
|
||||
|
||||
installed.push({
|
||||
id: file.replace(/\.js$/, ""),
|
||||
name: file.replace(/\.js$/, ""),
|
||||
id: match ? match.id : name,
|
||||
name: match ? match.name : name,
|
||||
jsFiles: [file],
|
||||
configFiles: [],
|
||||
custom: true,
|
||||
configFiles: listLocalAddonConfigs().filter(f => f.startsWith(name)),
|
||||
custom: !match
|
||||
});
|
||||
}
|
||||
|
||||
return installed;
|
||||
}
|
||||
|
||||
async function installAddonFromCatalog(addonName) {
|
||||
const safeName = String(addonName).replace(/[^a-zA-Z0-9_-]/g, "");
|
||||
if (!safeName) {
|
||||
throw new Error("Invalid addon name");
|
||||
}
|
||||
|
||||
const summary = await summarizeAddon(safeName);
|
||||
if (!summary) {
|
||||
throw new Error(`Addon "${safeName}" was not found in the catalog`);
|
||||
}
|
||||
|
||||
const files = await listAddonRepoFiles(safeName);
|
||||
if (files.length === 0) {
|
||||
throw new Error(`Addon "${safeName}" has no installable files`);
|
||||
async function installAddonFromCatalog(addonId) {
|
||||
const catalog = await listCatalogAddons();
|
||||
const addon = catalog.find(c => c.id === addonId.toString());
|
||||
|
||||
if (!addon) {
|
||||
throw new Error(`Addon not found in catalog`);
|
||||
}
|
||||
|
||||
ensureAddonDirs();
|
||||
const written = [];
|
||||
|
||||
for (const file of files) {
|
||||
const localPath = mapRepoFileToLocal(safeName, file.relativePath);
|
||||
const dir = path.dirname(localPath);
|
||||
if (!fs.existsSync(dir)) {
|
||||
fs.mkdirSync(dir, { recursive: true });
|
||||
}
|
||||
|
||||
const content = await downloadFile(file.downloadUrl);
|
||||
fs.writeFileSync(localPath, content);
|
||||
written.push(localPath.replace(/\\/g, "/"));
|
||||
}
|
||||
const content = await downloadFile(addon.id);
|
||||
|
||||
const zip = new AdmZip(content);
|
||||
zip.extractAllTo("./Addons", true);
|
||||
|
||||
return {
|
||||
addon: summary,
|
||||
filesWritten: written,
|
||||
addon: addon,
|
||||
filesWritten: [],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -258,7 +175,6 @@ function writeAddonConfig(filename, data) {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
ADDONS_REPO,
|
||||
listCatalogAddons,
|
||||
listInstalledAddons,
|
||||
isAddonInstalled,
|
||||
@@ -266,5 +182,4 @@ module.exports = {
|
||||
listLocalAddonConfigs,
|
||||
readAddonConfig,
|
||||
writeAddonConfig,
|
||||
mapRepoFileToLocal,
|
||||
};
|
||||
@@ -91,6 +91,12 @@ async function logStartup(client, options = {}) {
|
||||
section("Links");
|
||||
info("Docs", "https://emerald-services.gitbook.io/");
|
||||
info("Discord", "https://dsc.gg/emerald-dev");
|
||||
|
||||
if (configStore.api?.API?.Enabled) {
|
||||
const port = configStore.api?.API?.Port || 3000;
|
||||
info("Dashboard", `http://localhost:${port}`);
|
||||
}
|
||||
|
||||
info("Invite", inviteUrl);
|
||||
|
||||
console.log("");
|
||||
|
||||
@@ -4,6 +4,7 @@ const CONFIG_FILES = [
|
||||
"commands",
|
||||
"messages",
|
||||
"supportbot-ai",
|
||||
"api",
|
||||
];
|
||||
|
||||
const ROLES = ["owner", "admin", "moderator", "editor", "viewer", "custom"];
|
||||
|
||||
@@ -119,6 +119,12 @@ function buildSteps(apiRoot, supportbot) {
|
||||
description: "Discord user IDs that can sign in and manage the dashboard (at least one).",
|
||||
complete: getOwnerIds(oauth).length > 0 && getOwnerIds(oauth).every(isDiscordSnowflake),
|
||||
},
|
||||
{
|
||||
id: "emeraldApi",
|
||||
title: "Emerald API",
|
||||
description: "Optional. Used for the one-click addon installer.",
|
||||
complete: true,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@@ -350,6 +356,16 @@ async function validateSetupPayload(payload) {
|
||||
if (payload.ownerUserIds != null) {
|
||||
results.owners = await validateOwnerUserIds(payload.ownerUserIds, payload.botToken);
|
||||
}
|
||||
if (payload.emeraldApiKey != null) {
|
||||
const key = String(payload.emeraldApiKey).trim();
|
||||
if (key === "") {
|
||||
results.emeraldApi = { ok: true };
|
||||
} else if (key.length < 10) {
|
||||
results.emeraldApi = { ok: false, error: "Invalid API key." };
|
||||
} else {
|
||||
results.emeraldApi = { ok: true };
|
||||
}
|
||||
}
|
||||
|
||||
const allOk = Object.values(results).every((r) => r?.ok);
|
||||
return { ok: allOk, results };
|
||||
@@ -381,6 +397,9 @@ function applySetup(payload) {
|
||||
|
||||
apiDoc.setIn(["API", "Enabled"], true);
|
||||
apiDoc.setIn(["API", "SecretKey"], String(payload.secretKey).trim());
|
||||
if (payload.emeraldApiKey != null) {
|
||||
apiDoc.setIn(["API", "EmeraldAPIKey"], String(payload.emeraldApiKey).trim());
|
||||
}
|
||||
if (payload.port != null && payload.port !== "") {
|
||||
apiDoc.setIn(["API", "Port"], Number(payload.port) || 3000);
|
||||
}
|
||||
|
||||
+40
-22
@@ -1,8 +1,10 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const UPDATE_REPO = "C-h-a-r/SupportBot-Dashboard";
|
||||
const UPDATE_BRANCH = "release";
|
||||
const REPOSITORIES = [
|
||||
{ id: "bot", name: "SupportBot", repo: "Emerald-Services/SupportBot", branch: "release" },
|
||||
{ id: "dashboard", name: "SupportBot Dashboard", repo: "Emerald-Services/SupportBot-Dashboard", branch: "release" }
|
||||
];
|
||||
|
||||
function compareVersions(a, b) {
|
||||
const pa = String(a)
|
||||
@@ -24,32 +26,48 @@ async function fetchUpdateInfo() {
|
||||
const axios = require("axios");
|
||||
const pkgPath = path.join(__dirname, "../package.json");
|
||||
const currentPkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
||||
const current = currentPkg.version;
|
||||
const currentVersion = currentPkg.version;
|
||||
|
||||
const remoteRes = await axios.get(
|
||||
`https://raw.githubusercontent.com/${UPDATE_REPO}/${UPDATE_BRANCH}/package.json`,
|
||||
{
|
||||
timeout: 15000,
|
||||
headers: { "User-Agent": "SupportBot-Dashboard" },
|
||||
},
|
||||
);
|
||||
const checks = [];
|
||||
|
||||
const latest = remoteRes.data?.version || current;
|
||||
const updateAvailable = compareVersions(latest, current) > 0;
|
||||
for (const target of REPOSITORIES) {
|
||||
let installedVersion = target.id === "bot" ? currentPkg.version : (currentPkg.dashboardVersion || "1.0.0");
|
||||
let latest = installedVersion;
|
||||
try {
|
||||
const pkgUrl = target.id === 'dashboard'
|
||||
? `https://raw.githubusercontent.com/${target.repo}/${target.branch}/dashboard/package.json`
|
||||
: `https://raw.githubusercontent.com/${target.repo}/${target.branch}/package.json`;
|
||||
|
||||
const remoteRes = await axios.get(pkgUrl, {
|
||||
timeout: 15000,
|
||||
headers: { "User-Agent": "SupportBot-Updater" },
|
||||
});
|
||||
if (remoteRes.data && remoteRes.data.version) {
|
||||
latest = remoteRes.data.version;
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn(`[Updater] Failed to check ${target.repo} for updates.`);
|
||||
}
|
||||
|
||||
return {
|
||||
current,
|
||||
latest,
|
||||
updateAvailable,
|
||||
repository: `https://github.com/${UPDATE_REPO}`,
|
||||
branch: UPDATE_BRANCH,
|
||||
zipUrl: `https://github.com/${UPDATE_REPO}/archive/refs/heads/${UPDATE_BRANCH}.zip`,
|
||||
};
|
||||
const updateAvailable = compareVersions(latest, installedVersion) > 0;
|
||||
|
||||
checks.push({
|
||||
id: target.id,
|
||||
name: target.name,
|
||||
current: installedVersion,
|
||||
latest,
|
||||
updateAvailable,
|
||||
repository: `https://github.com/${target.repo}`,
|
||||
branch: target.branch,
|
||||
zipUrl: `https://github.com/${target.repo}/archive/refs/heads/${target.branch}.zip`,
|
||||
});
|
||||
}
|
||||
|
||||
return checks;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
compareVersions,
|
||||
fetchUpdateInfo,
|
||||
UPDATE_REPO,
|
||||
UPDATE_BRANCH,
|
||||
REPOSITORIES,
|
||||
};
|
||||
Generated
+10
@@ -10,6 +10,7 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vitalets/google-translate-api": "^9.2.1",
|
||||
"adm-zip": "^0.6.0",
|
||||
"axios": "^1.7.2",
|
||||
"better-sqlite3": "^12.2.0",
|
||||
"cookie-parser": "^1.4.7",
|
||||
@@ -290,6 +291,15 @@
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/adm-zip": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.6.0.tgz",
|
||||
"integrity": "sha512-XleryMhbuksdKtofnWZ9Sk+4CUTbms4Mb/EU32SZwToAyZ5RgVos/ki8n+yr0LWHOGKuakbXTuuYNHLQjhddgg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=14.0"
|
||||
}
|
||||
},
|
||||
"node_modules/agent-base": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
||||
|
||||
+3
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "supportbot",
|
||||
"version": "26.3.0",
|
||||
"version": "26.2",
|
||||
"description": "SupportBot is an open-sourced support system for discord. It's completely free to use with high amounts of customization to match your own brand.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
@@ -20,6 +20,7 @@
|
||||
"homepage": "https://community.emeraldsrv.dev",
|
||||
"dependencies": {
|
||||
"@vitalets/google-translate-api": "^9.2.1",
|
||||
"adm-zip": "^0.6.0",
|
||||
"axios": "^1.7.2",
|
||||
"better-sqlite3": "^12.2.0",
|
||||
"cookie-parser": "^1.4.7",
|
||||
@@ -37,4 +38,4 @@
|
||||
"systeminformation": "^5.31.5",
|
||||
"yaml": "^2.8.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
var i3=Object.defineProperty;var l3=(e,n,a)=>n in e?i3(e,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[n]=a;var Mx=(e,n,a)=>l3(e,typeof n!="symbol"?n+"":n,a);function c3(e,n){for(var a=0;a<n.length;a++){const o=n[a];if(typeof o!="string"&&!Array.isArray(o)){for(const i in o)if(i!=="default"&&!(i in e)){const c=Object.getOwnPropertyDescriptor(o,i);c&&Object.defineProperty(e,i,c.get?c:{enumerable:!0,get:()=>o[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const c of i)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function a(i){const c={};return i.integrity&&(c.integrity=i.integrity),i.referrerPolicy&&(c.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?c.credentials="include":i.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(i){if(i.ep)return;i.ep=!0;const c=a(i);fetch(i.href,c)}})();function w0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fm={exports:{}},Li={};/**
|
||||
* @license React
|
||||
* react-jsx-runtime.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var _x;function u3(){if(_x)return Li;_x=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(o,i,c){var d=null;if(c!==void 0&&(d=""+c),i.key!==void 0&&(d=""+i.key),"key"in i){c={};for(var m in i)m!=="key"&&(c[m]=i[m])}else c=i;return i=c.ref,{$$typeof:e,type:o,key:d,ref:i!==void 0?i:null,props:c}}return Li.Fragment=n,Li.jsx=a,Li.jsxs=a,Li}var Ox;function d3(){return Ox||(Ox=1,Fm.exports=u3()),Fm.exports}var l=d3(),Ym={exports:{}},Me={};/**
|
||||
* @license React
|
||||
* react.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Dx;function f3(){if(Dx)return Me;Dx=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),x=Symbol.iterator;function S(M){return M===null||typeof M!="object"?null:(M=x&&M[x]||M["@@iterator"],typeof M=="function"?M:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,N={};function E(M,_,U){this.props=M,this.context=_,this.refs=N,this.updater=U||j}E.prototype.isReactComponent={},E.prototype.setState=function(M,_){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,_,"setState")},E.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function k(){}k.prototype=E.prototype;function T(M,_,U){this.props=M,this.context=_,this.refs=N,this.updater=U||j}var R=T.prototype=new k;R.constructor=T,C(R,E.prototype),R.isPureReactComponent=!0;var D=Array.isArray;function P(){}var z={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function H(M,_,U){var V=U.ref;return{$$typeof:e,type:M,key:_,ref:V!==void 0?V:null,props:U}}function Y(M,_){return H(M.type,_,M.props)}function Q(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function fe(M){var _={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(U){return _[U]})}var de=/\/+/g;function he(M,_){return typeof M=="object"&&M!==null&&M.key!=null?fe(""+M.key):_.toString(36)}function se(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(P,P):(M.status="pending",M.then(function(_){M.status==="pending"&&(M.status="fulfilled",M.value=_)},function(_){M.status==="pending"&&(M.status="rejected",M.reason=_)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function O(M,_,U,V,F){var ae=typeof M;(ae==="undefined"||ae==="boolean")&&(M=null);var ne=!1;if(M===null)ne=!0;else switch(ae){case"bigint":case"string":case"number":ne=!0;break;case"object":switch(M.$$typeof){case e:case n:ne=!0;break;case y:return ne=M._init,O(ne(M._payload),_,U,V,F)}}if(ne)return F=F(M),ne=V===""?"."+he(M,0):V,D(F)?(U="",ne!=null&&(U=ne.replace(de,"$&/")+"/"),O(F,_,U,"",function(W){return W})):F!=null&&(Q(F)&&(F=Y(F,U+(F.key==null||M&&M.key===F.key?"":(""+F.key).replace(de,"$&/")+"/")+ne)),_.push(F)),1;ne=0;var me=V===""?".":V+":";if(D(M))for(var pe=0;pe<M.length;pe++)V=M[pe],ae=me+he(V,pe),ne+=O(V,_,U,ae,F);else if(pe=S(M),typeof pe=="function")for(M=pe.call(M),pe=0;!(V=M.next()).done;)V=V.value,ae=me+he(V,pe++),ne+=O(V,_,U,ae,F);else if(ae==="object"){if(typeof M.then=="function")return O(se(M),_,U,V,F);throw _=String(M),Error("Objects are not valid as a React child (found: "+(_==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":_)+"). If you meant to render a collection of children, use an array instead.")}return ne}function $(M,_,U){if(M==null)return M;var V=[],F=0;return O(M,V,"","",function(ae){return _.call(U,ae,F++)}),V}function Z(M){if(M._status===-1){var _=M._result;_=_(),_.then(function(U){(M._status===0||M._status===-1)&&(M._status=1,M._result=U)},function(U){(M._status===0||M._status===-1)&&(M._status=2,M._result=U)}),M._status===-1&&(M._status=0,M._result=_)}if(M._status===1)return M._result.default;throw M._result}var J=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var _=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(_))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},te={map:$,forEach:function(M,_,U){$(M,function(){_.apply(this,arguments)},U)},count:function(M){var _=0;return $(M,function(){_++}),_},toArray:function(M){return $(M,function(_){return _})||[]},only:function(M){if(!Q(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return Me.Activity=v,Me.Children=te,Me.Component=E,Me.Fragment=a,Me.Profiler=i,Me.PureComponent=T,Me.StrictMode=o,Me.Suspense=p,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,Me.__COMPILER_RUNTIME={__proto__:null,c:function(M){return z.H.useMemoCache(M)}},Me.cache=function(M){return function(){return M.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(M,_,U){if(M==null)throw Error("The argument must be a ReaLine truncated
|
||||
* @license React
|
||||
* scheduler.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var zx;function m3(){return zx||(zx=1,(function(e){function n(O,$){var Z=O.length;O.push($);e:for(;0<Z;){var J=Z-1>>>1,te=O[J];if(0<i(te,$))O[J]=$,O[Z]=te,Z=J;else break e}}function a(O){return O.length===0?null:O[0]}function o(O){if(O.length===0)return null;var $=O[0],Z=O.pop();if(Z!==$){O[0]=Z;e:for(var J=0,te=O.length,M=te>>>1;J<M;){var _=2*(J+1)-1,U=O[_],V=_+1,F=O[V];if(0>i(U,Z))V<te&&0>i(F,U)?(O[J]=F,O[V]=Z,J=V):(O[J]=U,O[_]=Z,J=_);else if(V<te&&0>i(F,Z))O[J]=F,O[V]=Z,J=V;else break e}}return $}function i(O,$){var Z=O.sortIndex-$.sortIndex;return Z!==0?Z:O.id-$.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,m=d.now();e.unstable_now=function(){return d.now()-m}}var p=[],h=[],y=1,v=null,x=3,S=!1,j=!1,C=!1,N=!1,E=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function R(O){for(var $=a(h);$!==null;){if($.callback===null)o(h);else if($.startTime<=O)o(h),$.sortIndex=$.expirationTime,n(p,$);else break;$=a(h)}}function D(O){if(C=!1,R(O),!j)if(a(p)!==null)j=!0,P||(P=!0,fe());else{var $=a(h);$!==null&&se(D,$.startTime-O)}}var P=!1,z=-1,B=5,H=-1;function Y(){return N?!0:!(e.unstable_now()-H<B)}function Q(){if(N=!1,P){var O=e.unstable_now();H=O;var $=!0;try{e:{j=!1,C&&(C=!1,k(z),z=-1),S=!0;var Z=x;try{t:{for(R(O),v=a(p);v!==null&&!(v.expirationTime>O&&Y());){var J=v.callback;if(typeof J=="function"){v.callback=null,x=v.priorityLevel;var te=J(v.expirationTime<=O);if(O=e.unstable_now(),typeof te=="function"){v.callback=te,R(O),$=!0;break t}v===a(p)&&o(p),R(O)}else o(p);v=a(p)}if(v!==null)$=!0;else{var M=a(h);M!==null&&se(D,M.startTime-O),$=!1}}break e}finally{v=null,x=Z,S=!1}$=void 0}}finally{$?fe():P=!1}}}var fe;if(typeof T=="function")fe=function(){T(Q)};else if(typeof MessageChannel<"u"){var de=new MessageChannel,he=de.port2;de.port1.onmessage=Q,fe=function(){he.postMessage(null)}}else fe=function(){E(Q,0)};function se(O,$){z=E(function(){O(e.unstable_now())},$)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(O){switch(x){case 1:case 2:case 3:var $=3;break;default:$=x}var Z=x;x=$;try{return O()}finally{x=Z}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(O,$){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var Z=x;x=O;try{return $()}finally{x=Z}},e.unstable_scheduleCallback=function(O,$,Z){var J=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?J+Z:J):Z=J,O){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=Z+te,O={id:y++,callback:$,priorityLevel:O,startTime:Z,expirationTime:te,sortIndex:-1},Z>J?(O.sortIndex=Z,n(h,O),a(p)===null&&O===a(h)&&(C?(k(z),z=-1):C=!0,se(D,Z-J))):(O.sortIndex=te,n(p,O),j||S||(j=!0,P||(P=!0,fe()))),O},e.unstable_shouldYield=Y,e.unstable_wrapCallback=function(O){var $=x;return function(){var Z=x;x=$;try{return O.apply(this,arguments)}finally{x=Z}}}})(Km)),Km}var Px;function p3(){return Px||(Px=1,qm.exports=m3()),qm.exports}var Xm={exports:{}},Ft={};/**
|
||||
* @license React
|
||||
* react-dom.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Ix;function h3(){if(Ix)return Ft;Ix=1;var e=Lu();function n(p){var h="https://react.dev/errors/"+p;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var o={d:{f:a,r:function(){throw Error(n(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},i=Symbol.for("react.portal");function c(p,h,y){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:v==null?null:""+v,children:p,containerInfo:h,implementation:y}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(p,h){if(p==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Ft.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Ft.createPortal=function(p,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(n(299));return c(p,h,null,y)},Ft.flushSync=function(p){var h=d.T,y=o.p;try{if(d.T=null,o.p=2,p)return p()}finally{d.T=h,o.p=y,o.d.f()}},Ft.preconnect=function(p,h){typeof p=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(p,h))},Ft.prefetchDNS=function(p){typeof p=="string"&&o.d.D(p)},Ft.preinit=function(p,h){if(typeof p=="string"&&h&&typeof h.as=="string"){var y=h.as,v=m(y,h.crossOrigin),x=typeof h.integrity=="string"?h.integrity:void 0,S=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?o.d.S(p,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:v,integrity:x,fetchPriority:S}):y==="script"&&o.d.X(p,{crossOrigin:v,integrity:x,fetchPriority:S,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Ft.preinitModule=function(p,h){if(typeof p=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=m(h.as,h.crossOrigin);o.d.M(p,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(p)},Ft.preload=function(p,h){if(typeof p=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,v=m(y,h.crossOrigin);o.d.L(p,y,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Ft.preloadModule=function(p,h){if(typeof p=="string")if(h){var y=m(h.as,h.crossOrigin);o.d.m(p,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(p)},Ft.requestFormReset=function(p){o.d.r(p)},Ft.unstable_batchedUpdates=function(p,h){return p(h)},Ft.useFormState=function(p,h,y){return d.H.useFormState(p,h,y)},Ft.useFormStatus=function(){return d.H.useHostTransitionStatus()},Ft.version="19.2.6",Ft}var $x;function C0(){if($x)return Xm.exports;$x=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Xm.exports=h3(),Xm.exports}/**
|
||||
* @license React
|
||||
* react-dom-client.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Bx;function g3(){if(Bx)return zi;Bx=1;var e=p3(),n=Lu(),a=C0();function o(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)r+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var r=t,s=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(s=r.return),t=r.return;while(t)}return r.tag===3?s:null}function d(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function m(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function p(t){if(c(t)!==t)throw Error(o(188))}function h(t){var r=t.alternate;if(!r){if(r=c(t),r===null)throw Error(o(188));return r!==t?null:t}for(var s=t,u=r;;){var g=s.return;if(g===null)break;var b=g.alternate;if(b===null){if(u=g.return,u!==null){s=u;continue}break}if(g.child===b.child){for(b=g.child;b;){if(b===s)return p(g),t;if(b===u)return p(g),r;b=b.sibling}throw Error(o(188))}if(s.return!==u.return)s=g,u=b;else{for(var w=!1,A=g.child;A;){if(A===s){w=!0,s=g,u=b;break}if(A===u){w=!0,u=g,s=b;break}A=A.sibling}if(!w){for(A=b.child;A;){if(A===s){w=!0,s=b,u=g;break}if(A===u){w=!0,u=b,s=g;break}A=A.sibling}if(!w)throw Error(o(189))}}if(s.alternate!==u)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?t:r}function y(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=y(t),r!==null)return r;t=t.sibling}return null}var v=Object.assign,x=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),T=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),Y=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function fe(t){return t===null||typeof t!="object"?null:(t=Q&&t[Q]||t["@@iterator"],typeof t=="function"?t:null)}var de=Symbol.for("react.client.reference");function he(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===de?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case C:return"Fragment";case E:return"Profiler";case N:return"StrictMode";case D:return"Suspense";case P:return"SuspenseList";case H:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case j:return"Portal";case T:return t.displayName||"Context";case k:return(t._context.displayName||"Context")+".Consumer";case R:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case z:return r=t.displayName||null,r!==null?r:he(t.type)||"Memo";case B:r=t._payload,t=t._init;try{return he(t(r))}catch{}}return null}var se=Array.isArray,O=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},J=[],te=-1;function M(t){return{current:t}}function _(t){0>te||(t.current=J[te],J[te]=null,te--)}function U(t,r){te++,J[te]=t.current,t.current=r}var V=M(null),F=M(null),ae=M(null),ne=M(null);function me(t,r){switch(U(ae,r),U(F,t),U(V,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?ex(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=ex(r),t=tx(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}_(V),U(V,t)}function pe(){_(V),_(F),_(ae)}function W(t){t.memoizedState!==null&&U(ne,t);var r=V.current,s=tx(r,t.type);r!==s&&(U(F,t),U(V,s))}function ie(t){F.current===t&&(_(V),_(F)),ne.current===t&&(_(ne),Mi._currentValue=Z)}var ge,je;function Ae(t){if(ge===void 0)try{throw Error()}catch(s){var r=s.stack.trim().match(/\n( *(at )?)/);ge=r&&r[1]||"",je=-1<s.stack.indexOf(`
|
||||
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||||
`+ge+t+je}var tt=!1;function ct(t,r){if(!t||tt)return"";tt=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(r){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(ee){var X=ee}Reflect.construct(t,[],le)}else{try{le.call()}catch(ee){X=ee}t.call(le.prototype)}}else{try{throw Error()}catch(ee){X=ee}(le=t())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(ee){if(ee&&X&&typeof ee.stack=="string")return[ee.stack,X.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=u.DetermineComponentFrameRoot(),w=b[0],A=b[1];if(w&&A){var L=w.split(`
|
||||
`),K=A.split(`
|
||||
`);for(g=u=0;u<L.length&&!L[u].includes("DetermineComponentFrameRoot");)u++;for(;g<K.length&&!K[g].includes("DetermineComponentFrameRoot");)g++;if(u===L.length||g===K.length)for(u=L.length-1,g=K.length-1;1<=u&&0<=g&&L[u]!==K[g];)g--;for(;1<=u&&0<=g;u--,g--)if(L[u]!==K[g]){if(u!==1||g!==1)do if(u--,g--,0>g||L[u]!==K[g]){var re=`
|
||||
`+L[u].replace(" at new "," at ");return t.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",t.displayName)),re}while(1<=u&&0<=g);break}}}finally{tt=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Ae(s):""}function kt(t,r){switch(t.tag){case 26:case 27:case 5:return Ae(t.type);case 16:return Ae("Lazy");case 13:return t.child!==r&&r!==null?Ae("Suspense Fallback"):Ae("Suspense");case 19:return Ae("SuspenseList");case 0:case 15:return ct(t.type,!1);case 11:return ct(t.type.render,!1);case 1:return ct(t.type,!0);case 31:return Ae("Activity");default:return""}}function Ra(t){try{var r="",s=null;do r+=kt(t,s),s=t,t=t.return;while(t);return r}catch(u){return`
|
||||
Error generating stack: `+u.message+`
|
||||
`+u.stack}}var Tt=Object.prototype.hasOwnProperty,Hs=e.unstable_scheduleCallback,Vs=e.unstable_cancelCallback,Wt=e.unstable_shouldYield,Vr=e.unstable_requestPaint,qt=e.unstable_now,_d=e.unstable_getCurrentPriorityLevel,Aa=e.unstable_ImmediatePriority,Tl=e.unstable_UserBlockingPriority,Ma=e.unstable_NormalPriority,Gs=e.unstable_LowPriority,mr=e.unstable_IdlePriority,Rl=e.log,Gr=e.unstable_setDisableYieldValue,_a=null,Kt=null;function Un(t){if(typeof Rl=="function"&&Gr(t),Kt&&typeof Kt.setStrictMode=="function")try{Kt.setStrictMode(_a,t)}catch{}}var Vt=Math.clz32?Math.clz32:Qn,Od=Math.log,Fs=Math.LN2;function Qn(t){return t>>>=0,t===0?32:31-(Od(t)/Fs|0)|0}var yo=256,xo=262144,Oa=4194304;function Jn(t){var r=t&42;if(r!==0)return r;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Re(t,r,s){var u=t.pendingLanes;if(u===0)return 0;var g=0,b=t.suspendedLanes,w=t.pingedLanes;t=t.warmLanes;var A=u&134217727;return A!==0?(u=A&~b,u!==0?g=Jn(u):(w&=A,w!==0?g=Jn(w):s||(s=A&~t,s!==0&&(g=Jn(s))))):(A=u&~b,A!==0?g=Jn(A):w!==0?g=Jn(w):s||(s=u&~t,s!==0&&(g=Jn(s)))),g===0?0:r!==0&&r!==g&&(r&b)===0&&(b=g&-g,s=r&-r,b>=s||b===32&&(s&4194048)!==0)?r:g}function ut(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function Rt(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Gt(){var t=Oa;return Oa<<=1,(Oa&62914560)===0&&(Oa=4194304),t}function Fr(t){for(var r=[],s=0;31>s;s++)r.push(t);return r}function mt(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Jt(t,r,s,u,g,b){var w=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var A=t.entanglements,L=t.expirationTimes,K=t.hiddenUpdates;for(s=w&~s;0<s;){var re=31-Vt(s),le=1<<re;A[re]=0,L[re]=-1;var X=K[re];if(X!==null)for(K[re]=null,re=0;re<X.length;re++){var ee=X[re];ee!==null&&(ee.lane&=-536870913)}s&=~le}u!==0&&Da(t,u,0),b!==0&&g===0&&t.tag!==0&&(t.suspendedLanes|=b&~(w&~r))}function Da(t,r,s){t.pendingLanes|=r,t.suspendedLanes&=~r;var u=31-Vt(r);t.entangledLanes|=r,t.entanglements[u]=t.entanglements[u]|1073741824|s&261930}function en(t,r){var s=t.entangledLanes|=r;for(t=t.entanglements;s;){var u=31-Vt(s),g=1<<u;g&r|t[u]&r&&(t[u]|=r),s&=~g}}function tn(t,r){var s=r&-r;return s=(s&42)!==0?1:So(s),(s&(t.suspendedLanes|r))!==0?0:s}function So(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Hn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Dd(){var t=$.p;return t!==0?t:(t=window.event,t===void 0?32:jx(t.type))}function Bg(t,r){var s=$.p;try{return $.p=t,r()}finally{$.p=s}}var Yr=Math.random().toString(36).slice(2),zt="__reactFiber$"+Yr,nn="__reactProps$"+Yr,wo="__reactContainer$"+Yr,Ld="__reactEvents$"+Yr,X5="__reactListeners$"+Yr,Z5="__reactHandles$"+Yr,Ug="__reactResources$"+Yr,Ys="__reactMarker$"+Yr;function zd(t){delete t[zt],delete t[nn],delete t[Ld],delete t[X5],delete t[Z5]}function Co(t){var r=t[zt];if(r)return r;for(var s=t.parentNode;s;){if(r=s[wo]||s[zt]){if(s=r.alternate,r.child!==null||s!==null&&s.child!==null)for(t=lx(t);t!==null;){if(s=t[zt])return s;t=lx(t)}return r}t=s,s=t.parentNode}return null}function jo(t){if(t=t[zt]||t[wo]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function Ws(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(o(33))}function Eo(t){var r=t[Ug];return r||(r=t[Ug]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function At(t){t[Ys]=!0}var Hg=new Set,Vg={};function La(t,r){No(t,r),No(t+"Capture",r)}function No(t,r){for(Vg[t]=r,t=0;t<r.length;t++)Hg.add(r[t])}var Q5=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u20
Line truncated
|
||||
`).replace(RN,"")}function Qy(t,r){return r=Zy(r),Zy(t)===r}function rt(t,r,s,u,g,b){switch(s){case"children":typeof u=="string"?r==="body"||r==="textarea"&&u===""||To(t,u):(typeof u=="number"||typeof u=="bigint")&&r!=="body"&&To(t,""+u);break;case"className":Ml(t,"class",u);break;case"tabIndex":Ml(t,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Ml(t,s,u);break;case"style":Qg(t,u,b);break;case"data":if(r!=="object"){Ml(t,"data",u);break}case"src":case"href":if(u===""&&(r!=="a"||s!=="href")){t.removeAttribute(s);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(s);break}u=Ol(""+u),t.setAttribute(s,u);break;case"action":case"formAction":if(typeof u=="function"){t.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof b=="function"&&(s==="formAction"?(r!=="input"&&rt(t,r,"name",g.name,g,null),rt(t,r,"formEncType",g.formEncType,g,null),rt(t,r,"formMethod",g.formMethod,g,null),rt(t,r,"formTarget",g.formTarget,g,null)):(rt(t,r,"encType",g.encType,g,null),rt(t,r,"method",g.method,g,null),rt(t,r,"target",g.target,g,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(s);break}u=Ol(""+u),t.setAttribute(s,u);break;case"onClick":u!=null&&(t.onclick=hr);break;case"onScroll":u!=null&&Ie("scroll",t);break;case"onScrollEnd":u!=null&&Ie("scrollend",t);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(s=u.__html,s!=null){if(g.children!=null)throw Error(o(60));t.innerHTML=s}}break;case"multiple":t.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":t.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){t.removeAttribute("xlink:href");break}s=Ol(""+u),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(s,""+u):t.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":u===!0?t.setAttribute(s,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(s,u):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?t.setAttribute(s,u):t.removeAttribute(s);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?t.removeAttribute(s):t.setAttribute(s,u);break;case"popover":Ie("beforetoggle",t),Ie("toggle",t),Al(t,"popover",u);break;case"xlinkActuate":pr(t,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":pr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":pr(t,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":pr(t,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":pr(t,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":pr(t,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":pr(t,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":pr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":pr(t,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Al(t,"is",u);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=rE.get(s)||s,Al(t,s,u))}}function km(t,r,s,u,g,b){switch(s){case"style":Qg(t,u,b);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(s=u.__html,s!=null){if(g.children!=null)throw Error(o(60));t.innerHTML=s}}break;case"children":typeof u=="string"?To(t,u):(typeof u=="number"||typeof u=="bigint")&&To(t,""+u);break;case"onScroll":u!=null&&Ie("scroll",t);break;case"onScrollEnd":u!=null&&Ie("scrollend",t);break;case"onClick":u!=null&&(t.onclick=hr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"inne
Line truncated
|
||||
* react-router v7.15.1
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/var Hx="popstate";function Vx(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function y3(e={}){function n(o,i){var h;let c=(h=i.state)==null?void 0:h.masked,{pathname:d,search:m,hash:p}=c||o.location;return Op("",{pathname:d,search:m,hash:p},i.state&&i.state.usr||null,i.state&&i.state.key||"default",c?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function a(o,i){return typeof i=="string"?i:Xi(i)}return S3(n,a,null,e)}function ft(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function $n(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function x3(){return Math.random().toString(36).substring(2,10)}function Gx(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Op(e,n,a=null,o,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?Rs(n):n,state:a,key:n&&n.key||o||x3(),mask:i}}function Xi({pathname:e="/",search:n="",hash:a=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function Rs(e){let n={};if(e){let a=e.indexOf("#");a>=0&&(n.hash=e.substring(a),e=e.substring(0,a));let o=e.indexOf("?");o>=0&&(n.search=e.substring(o),e=e.substring(0,o)),e&&(n.pathname=e)}return n}function S3(e,n,a,o={}){let{window:i=document.defaultView,v5Compat:c=!1}=o,d=i.history,m="POP",p=null,h=y();h==null&&(h=0,d.replaceState({...d.state,idx:h},""));function y(){return(d.state||{idx:null}).idx}function v(){m="POP";let N=y(),E=N==null?null:N-h;h=N,p&&p({action:m,location:C.location,delta:E})}function x(N,E){m="PUSH";let k=Vx(N)?N:Op(C.location,N,E);h=y()+1;let T=Gx(k,h),R=C.createHref(k.mask||k);try{d.pushState(T,"",R)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;i.location.assign(R)}c&&p&&p({action:m,location:C.location,delta:1})}function S(N,E){m="REPLACE";let k=Vx(N)?N:Op(C.location,N,E);h=y();let T=Gx(k,h),R=C.createHref(k.mask||k);d.replaceState(T,"",R),c&&p&&p({action:m,location:C.location,delta:0})}function j(N){return w3(N)}let C={get action(){return m},get location(){return e(i,d)},listen(N){if(p)throw new Error("A history only accepts one active listener");return i.addEventListener(Hx,v),p=N,()=>{i.removeEventListener(Hx,v),p=null}},createHref(N){return n(i,N)},createURL:j,encodeLocation(N){let E=j(N);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:x,replace:S,go(N){return d.go(N)}};return C}function w3(e,n=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),ft(a,"No window.location.(origin|href) available to create URL");let o=typeof e=="string"?e:Xi(e);return o=o.replace(/ $/,"%20"),!n&&o.startsWith("//")&&(o=a+o),new URL(o,a)}function j0(e,n,a="/"){return C3(e,n,a,!1)}function C3(e,n,a,o,i){let c=typeof n=="string"?Rs(n):n,d=zr(c.pathname||"/",a);if(d==null)return null;let m=j3(e),p=null,h=z3(d);for(let y=0;p==null&&y<m.length;++y)p=D3(m[y],h,o);return p}function j3(e){let n=E0(e);return E3(n),n}function E0(e,n=[],a=[],o="",i=!1){let c=(d,m,p=i,h)=>{let y={relativePath:h===void 0?d.path||"":h,caseSensitive:d.caseSensitive===!0,childrenIndex:m,route:d};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(o)&&p)return;ft(y.relativePath.startsWith(o),`Absolute route path "${y.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(o.length)}let v=Wn([o,y.relativePath]),x=a.concat(y);d.children&&d.children.length>0&&(ft(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),E0(d.children,n,x,v,p)),!(d.path==null&&!d.index)&&n.push({path:v,score:_3(v,d.index),routesMeta:x})};return e.forEach((d,m)=>{var p;if(d.path===""||!((p=d.path)!=null&&p.includes("?")))c(d,m);else for(let h of N0(d.path))c(d,m,!0,h)}),n}function N0(e){let n=e.split("/");if(n.length===0)return[];let[a,...o]=n,i=a.endsWith("?"),c=a.replace(/\?$/,"");if(o.length===0)return i?[c,""]:[c];let d=N0(o.join("/")),m=[];return m.push(...d.map(p=>p===""?c:[c,p].join("/"))),i&&m.push(...d),m.map(p=>e.startsWith("/")&&p===""?"/":p)}function E3(e){e.sort((n,a)=>n.score!==a.score?a.score-n.score:O3(n.routesMeta.map(o=>o.childrenIndex),a.routesMeta.map(o=>o.childrenIndex)))}var N3=/^:[\w-]+$/,k3=3,T3=2,R3=1,A3=10,M3=-2,Fx=e=>e==="*";function _3(e,n){let a=e.split("/"),o=a.length;return a.some(Fx)&&(o+=M3),n&&(o+=T3),a.filter(i=>!Fx(i)).reduce((i,c)=>i+(N3.test(c)?k3:c===""?R3:A3),o)}function O3(e,n){return e.length===n.length&&e.slice(0,-1).every((o,i)=>o===n[i])?e[e.length-1]-n[n.length-1]:0}function D3(e,n,a=!1){let{routesMeta:o}=e,i={},c="/",d=[];for(let m=0;m<o.length;++m){let p=o[m],h=m===o.length-1,y=c==="/"?n:n.slice(c.length)||"/",v=pu({path:p.relativePath,caseSensit
Line truncated
|
||||
|
||||
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let y=jn(),v;if(n){let E=typeof n=="string"?Rs(n):n;ft(p==="/"||((N=E.pathname)==null?void 0:N.startsWith(p)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${E.pathname}" was given in the \`location\` prop.`),v=E}else v=y;let x=v.pathname||"/",S=x;if(p!=="/"){let E=p.replace(/^\//,"").split("/");S="/"+x.replace(/^\//,"").split("/").slice(E.length).join("/")}let j=a&&a.state.matches.length?a.state.matches.map(E=>Object.assign(E,{route:a.manifest[E.route.id]||E.route})):j0(e,{pathname:S});$n(h||j!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),$n(j==null||j[j.length-1].route.element!==void 0||j[j.length-1].route.Component!==void 0||j[j.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let C=c4(j&&j.map(E=>Object.assign({},E,{params:Object.assign({},d,E.params),pathname:Wn([p,o.encodeLocation?o.encodeLocation(E.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?p:Wn([p,o.encodeLocation?o.encodeLocation(E.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),i,a);return n&&C?f.createElement(cl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...v},navigationType:"POP"}},C):C}function o4(){let e=p4(),n=G3(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:o},c={padding:"2px 4px",backgroundColor:o},d=null;return console.error("Error handled by React Router default ErrorBoundary:",e),d=f.createElement(f.Fragment,null,f.createElement("p",null,"💿 Hey developer 👋"),f.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",f.createElement("code",{style:c},"ErrorBoundary")," or"," ",f.createElement("code",{style:c},"errorElement")," prop on your route.")),f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},n),a?f.createElement("pre",{style:i},a):null,d)}var s4=f.createElement(o4,null),P0=class extends f.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const a=J3(e.digest);a&&(e=a)}let n=e!==void 0?f.createElement(Xn.Provider,{value:this.props.routeContext},f.createElement(jh.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?f.createElement(i4,{error:e},n):n}};P0.contextType=M0;var Qm=new WeakMap;function i4({children:e,error:n}){let{basename:a}=f.useContext(Cn);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let o=Q3(n.digest);if(o){let i=Qm.get(n);if(i)throw i;let c=R0(o.location,a);if(T0&&!Qm.get(n))if(c.isExternal||o.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:o.replace}));throw Qm.set(n,d),d}return f.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return e}function l4({routeContext:e,match:n,children:a}){let o=f.useContext(As);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(Xn.Provider,{value:e},a)}function c4(e,n=[],a){let o=a==null?void 0:a.state;if(e==null){if(!o)return null;if(o.errors)e=o.matches;else if(n.length===0&&!o.initialized&&o.matches.length>0)e=o.matches;else return null}let i=e,c=o==null?void 0:o.errors;if(c!=null){let y=i.findIndex(v=>v.route.id&&(c==null?void 0:c[v.route.id])!==void 0);ft(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),i=i.slice(0,Math.min(i.length,y+1))}let d=!1,m=-1;if(a&&o){d=o.renderFallback;for(let y=0;y<i.length;y++){let v=i[y];if((v.route.HyLine truncated
|
||||
.`.concat(U9,` {
|
||||
overflow: hidden `).concat(o,`;
|
||||
padding-right: `).concat(m,"px ").concat(o,`;
|
||||
}
|
||||
body[`).concat(hs,`] {
|
||||
overflow: hidden `).concat(o,`;
|
||||
overscroll-behavior: contain;
|
||||
`).concat([n&&"position: relative ".concat(o,";"),a==="margin"&&`
|
||||
padding-left: `.concat(i,`px;
|
||||
padding-top: `).concat(c,`px;
|
||||
padding-right: `).concat(d,`px;
|
||||
margin-left:0;
|
||||
margin-top:0;
|
||||
margin-right: `).concat(m,"px ").concat(o,`;
|
||||
`),a==="padding"&&"padding-right: ".concat(m,"px ").concat(o,";")].filter(Boolean).join(""),`
|
||||
}
|
||||
|
||||
.`).concat(lu,` {
|
||||
right: `).concat(m,"px ").concat(o,`;
|
||||
}
|
||||
|
||||
.`).concat(cu,` {
|
||||
margin-right: `).concat(m,"px ").concat(o,`;
|
||||
}
|
||||
|
||||
.`).concat(lu," .").concat(lu,` {
|
||||
right: 0 `).concat(o,`;
|
||||
}
|
||||
|
||||
.`).concat(cu," .").concat(cu,` {
|
||||
margin-right: 0 `).concat(o,`;
|
||||
}
|
||||
|
||||
body[`).concat(hs,`] {
|
||||
`).concat(H9,": ").concat(m,`px;
|
||||
}
|
||||
`)},T1=function(){var e=parseInt(document.body.getAttribute(hs)||"0",10);return isFinite(e)?e:0},iR=function(){f.useEffect(function(){return document.body.setAttribute(hs,(T1()+1).toString()),function(){var e=T1()-1;e<=0?document.body.removeAttribute(hs):document.body.setAttribute(hs,e.toString())}},[])},lR=function(e){var n=e.noRelative,a=e.noImportant,o=e.gapMode,i=o===void 0?"margin":o;iR();var c=f.useMemo(function(){return aR(i)},[i]);return f.createElement(oR,{styles:sR(c,!n,i,a?"":"!important")})},Fp=!1;if(typeof window<"u")try{var Kc=Object.defineProperty({},"passive",{get:function(){return Fp=!0,!0}});window.addEventListener("test",Kc,Kc),window.removeEventListener("test",Kc,Kc)}catch{Fp=!1}var is=Fp?{passive:!1}:!1,cR=function(e){return e.tagName==="TEXTAREA"},cS=function(e,n){if(!(e instanceof Element))return!1;var a=window.getComputedStyle(e);return a[n]!=="hidden"&&!(a.overflowY===a.overflowX&&!cR(e)&&a[n]==="visible")},uR=function(e){return cS(e,"overflowY")},dR=function(e){return cS(e,"overflowX")},R1=function(e,n){var a=n.ownerDocument,o=n;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var i=uS(e,o);if(i){var c=dS(e,o),d=c[1],m=c[2];if(d>m)return!0}o=o.parentNode}while(o&&o!==a.body);return!1},fR=function(e){var n=e.scrollTop,a=e.scrollHeight,o=e.clientHeight;return[n,a,o]},mR=function(e){var n=e.scrollLeft,a=e.scrollWidth,o=e.clientWidth;return[n,a,o]},uS=function(e,n){return e==="v"?uR(n):dR(n)},dS=function(e,n){return e==="v"?fR(n):mR(n)},pR=function(e,n){return e==="h"&&n==="rtl"?-1:1},hR=function(e,n,a,o,i){var c=pR(e,window.getComputedStyle(n).direction),d=c*o,m=a.target,p=n.contains(m),h=!1,y=d>0,v=0,x=0;do{if(!m)break;var S=dS(e,m),j=S[0],C=S[1],N=S[2],E=C-N-c*j;(j||E)&&uS(e,m)&&(v+=E,x+=j);var k=m.parentNode;m=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!p&&m!==document.body||p&&(n.contains(m)||n===m));return(y&&Math.abs(v)<1||!y&&Math.abs(x)<1)&&(h=!0),h},Xc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},A1=function(e){return[e.deltaX,e.deltaY]},M1=function(e){return e&&"current"in e?e.current:e},gR=function(e,n){return e[0]===n[0]&&e[1]===n[1]},vR=function(e){return`
|
||||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||||
`)},bR=0,ls=[];function yR(e){var n=f.useRef([]),a=f.useRef([0,0]),o=f.useRef(),i=f.useState(bR++)[0],c=f.useState(lS)[0],d=f.useRef(e);f.useEffect(function(){d.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var C=B9([e.lockRef.current],(e.shards||[]).map(M1),!0).filter(Boolean);return C.forEach(function(N){return N.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),C.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var m=f.useCallback(function(C,N){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!d.current.allowPinchZoom;var E=Xc(C),k=a.current,T="deltaX"in C?C.deltaX:k[0]-E[0],R="deltaY"in C?C.deltaY:k[1]-E[1],D,P=C.target,z=Math.abs(T)>Math.abs(R)?"h":"v";if("touches"in C&&z==="h"&&P.type==="range")return!1;var B=window.getSelection(),H=B&&B.anchorNode,Y=H?H===P||H.contains(P):!1;if(Y)return!1;var Q=R1(z,P);if(!Q)return!0;if(Q?D=z:(D=z==="v"?"h":"v",Q=R1(z,P)),!Q)return!1;if(!o.current&&"changedTouches"in C&&(T||R)&&(o.current=D),!D)return!0;var fe=o.current||D;return hR(fe,N,C,fe==="h"?T:R)},[]),p=f.useCallback(function(C){var N=C;if(!(!ls.length||ls[ls.length-1]!==c)){var E="deltaY"in N?A1(N):Xc(N),k=n.current.filter(function(D){return D.name===N.type&&(D.target===N.target||N.target===D.shadowParent)&&gR(D.delta,E)})[0];if(k&&k.should){N.cancelable&&N.preventDefault();return}if(!k){var T=(d.current.shards||[]).map(M1).filter(Boolean).filter(function(D){return D.contains(N.target)}),R=T.length>0?m(N,T[0]):!d.current.noIsolation;R&&N.cancelable&&N.preventDefault()}}},[]),h=f.useCallback(function(C,N,E,k){var T={name:C,delta:N,target:E,should:k,shadowParent:xR(E)};n.current.push(T),setTimeout(function(){n.current=n.current.filter(function(R){return R!==T})},1)},[]),y=f.useCallback(function(C){a.current=Xc(C),o.current=void 0},[]),v=f.useCallback(function(C){h(C.type,A1(C),C.target,m(C,e.lockRef.current))},[]),x=f.useCallback(function(C){h(C.type,Xc(C),C.target,m(C,e.lockRef.current))},[]);f.useEffect(function(){return ls.push(c),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:x}),document.addEventListener("wheel",p,is),document.addEventListener("touchmove",p,is),document.addEventListener("touchstart",y,is),function(){ls=ls.filter(function(C){return C!==c}),document.removeEventListener("wheel",p,is),document.removeEventListener("touchmove",p,is),document.removeEventListener("touchstart",y,is)}},[]);var S=e.removeScrollBar,j=e.inert;return f.createElement(f.Fragment,null,j?f.createElement(c,{styles:vR(i)}):null,S?f.createElement(lR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function xR(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const SR=K9(iS,yR);var vl=f.forwardRef(function(e,n){return f.createElement(rd,ir({},e,{ref:n,sideCar:SR}))});vl.classNames=rd.classNames;var Yp=["Enter"," "],wR=["ArrowDown","PageUp","Home"],fS=["ArrowUp","PageDown","End"],CR=[...wR,...fS],jR={ltr:[...Yp,"ArrowRight"],rtl:[...Yp,"ArrowLeft"]},ER={ltr:["ArrowLeft"],rtl:["ArrowRight"]},bl="Menu",[tl,NR,kR]=Vh(bl),[go,mS]=Hk(bl,[kR,Ea,td]),ad=Ea(),pS=td(),[TR,vo]=go(bl),[RR,yl]=go(bl),hS=e=>{const{__scopeMenu:n,open:a=!1,children:o,dir:i,onOpenChange:c,modal:d=!0}=e,m=ad(n),[p,h]=f.useState(null),y=f.useRef(!1),v=Ot(c),x=dl(i);return f.useEffect(()=>{const S=()=>{y.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>y.current=!1;return document.addEventListener("keydown",S,{capture:!0}),()=>{document.removeEventListener("keydown",S,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),l.jsx(Qu,{...m,children:l.jsx(TR,{scope:n,open:a,onOpenChange:v,content:p,onContentChange:h,children:l.jsx(RR,{scope:n,onClose:f.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:y,dir:x,modal:d,children:o})})})};hS.displayName=bl;var AR="MenuAnchor",Qh=f.forwardRef((e,n)=>{const{__scopeMenu:a,...o}=e,i=ad(a);return l.jsx(pl,{...i,...o,ref:n})});Qh.displayName=AR;var Jh="MenuPortal",[MR,gS]=go(Jh,{forceMount:void 0}),vS=e=>{const{__scopeMenu:n,forceMount:a,children:o,container:i}=e,c=vo(Jh,n);return l.jsx(MR,{scope:n,forceMount:a,children:l.jsx(Ht,{present:a||c.open,children:l.jsx(Is,{asChild:!0,container:i,children:o})})})};vS.displayName=Jh;var In="MenuContent",[_R,eg]=go(In),bS=f.forwardRef((e,n)=>{const a=gS(In,e.__scopeMenu),{forceMount:o=a.forceMount,...i}=e,c=vo(In,e.__scopeMenu),d=yl(In,e.__scopeMenu);return l.jsx(tl.Provider,{scope:e.__scopeMenu,children:l.jsx(Ht,{present:o||c.open,children:l.jsx(tl.Slot,{scope:e.__scopeMenu,children:d.modal?l.jsx(OR,{...i,ref:n}):l.jsx(DR,{...i,ref:n})})})})}),OR=f.forwardRef((e,n)=>{const a=vo(In,e.__scopeMenu),o=f.useRe
Line truncated
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const ow=(...e)=>e.filter((n,a,o)=>!!n&&n.trim()!==""&&o.indexOf(n)===a).join(" ").trim();/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const MA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const _A=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,a,o)=>o?o.toUpperCase():a.toLowerCase());/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const O1=e=>{const n=_A(e);return n.charAt(0).toUpperCase()+n.slice(1)};/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/var pp={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const OA=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},DA=f.createContext({}),LA=()=>f.useContext(DA),zA=f.forwardRef(({color:e,size:n,strokeWidth:a,absoluteStrokeWidth:o,className:i="",children:c,iconNode:d,...m},p)=>{const{size:h=24,strokeWidth:y=2,absoluteStrokeWidth:v=!1,color:x="currentColor",className:S=""}=LA()??{},j=o??v?Number(a??y)*24/Number(n??h):a??y;return f.createElement("svg",{ref:p,...pp,width:n??h??pp.width,height:n??h??pp.height,stroke:e??x,strokeWidth:j,className:ow("lucide",S,i),...!c&&!OA(m)&&{"aria-hidden":"true"},...m},[...d.map(([C,N])=>f.createElement(C,N)),...Array.isArray(c)?c:[c]])});/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Ur=(e,n)=>{const a=f.forwardRef(({className:o,...i},c)=>f.createElement(zA,{ref:c,iconNode:n,className:ow(`lucide-${MA(O1(e))}`,`lucide-${e}`,o),...i}));return a.displayName=O1(e),a};/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const PA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],sw=Ur("check",PA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const IA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],iw=Ur("chevron-down",IA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const $A=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],BA=Ur("chevron-right",$A);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const UA=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],HA=Ur("chevron-up",UA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const VA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],D1=Ur("circle-check",VA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const GA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],FA=Ur("circle",GA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const YA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],WA=Ur("panel-left",YA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const qA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],KA=Ur("search",qA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const XA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],lw=Ur("x",XA),og=TA,sg=RA,ZA=f.forwardRef(({className:e,inset:n,children:a,...o},i)=>l.jsxs(rw,{ref:i,className:ce("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...o,children:[a,l.jsx(BA,{className:"ml-auto"})]}));ZA.displayName=rw.displayName;const QA=f.forwardRef(({className:e,...n},a)=>l.jsx(aw,{ref:a,className:ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...n}));QA.displayName=aw.displayName;const id=f.forwardRef(({className:e,sideOffset:n=4,...a},o)=>l.jsx(AA,{children:l.jsx(XS,{ref:o,sideOffset:n,className:ce("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...a})}));id.displayName=XS.displayName;const rl=f.forwardRef(({className:e,inset:n,...a},o)=>l.jsx(QS,{ref:o,className:ce("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",n&&"pl-8",e),...a}));rl.displayName=QS.displayName;const JA=f.forwardRef(({className:e,children:n,checked:a,...o},i)=>l.jsxs(JS,{ref:i,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...o,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(tw,{children:l.jsx(sw,{className:"h-4 w-4"})})}),n]}));JA.displayName=JS.displayName;const e7=f.forwardRef(({className:e,children:n,...a},o)=>l.jsxs(ew,{ref:o,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(tw,{children:l.jsx(FA,{className:"h-2 w-2 fill-current"})})}),n]}));e7.displayName=ew.displayName;const ig=f.forwardRef(({className:e,inset:n,...a},o)=>l.jsx(ZS,{ref:o,className:ce("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...a}));ig.displayName=ZS.displayName;const Nu=f.forwardRef(({className:e,...n},a)=>l.jsx(nw,{ref:a,className:ce("-mx-1 my-1 h-px bg-muted",e),...n}));Nu.displayName=nw.displayName;const hp=768;function t7(){const[e,n]=f.useState(void 0);return f.useEffect(()=>{const a=window.matchMedia(`(max-width: ${hp-1}px)`),o=()=>{n(window.innerWidth<hp)};return a.addEventListener("change",o),n(window.innerWidth<hp),()=>a.removeEventListener("change",o)},[]),!!e}const Ue=f.forwardRef(({className:e,type:n,...a},o)=>l.jsx("input",{type:n,className:ce("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...a}));Ue.displayName="Input";var n7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],En=n7.reduce((e,n)=>{const a=S2(`Primitive.${n}`),o=f.forwardRef((i,c)=>{const{asChild:d,...m}=i,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(p,{...m,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{}),r7="Separator",L1="horizontal",a7=["horizontal","vertical"],cw=f.forwardRef((e,n)=>{const{decorative:a,orientation:o=L1,...i}=e,c=o7(o)?o:L1,m=a?{role:"none"}:{"aria-orientation":c==="vertical"?c:void 0,role:"separator"};returnLine truncated
|
||||
|
||||
If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||||
|
||||
For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(a))},[a,e]),null},w7="DialogDescriptionWarning",C7=({contentRef:e,descriptionId:n})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Tw(w7).contentName}}.`;return f.useEffect(()=>{var c;const i=(c=e.current)==null?void 0:c.getAttribute("aria-describedby");n&&i&&(document.getElementById(n)||console.warn(o))},[o,e,n]),null},dg=pw,j7=gw,fg=bw,Sl=yw,wl=xw,cd=ww,ud=jw,Rw=Nw;const E7=dg,N7=fg,Aw=f.forwardRef(({className:e,...n},a)=>l.jsx(Sl,{className:ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n,ref:a}));Aw.displayName=Sl.displayName;const k7=Ds("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Mw=f.forwardRef(({side:e="right",className:n,children:a,...o},i)=>l.jsxs(N7,{children:[l.jsx(Aw,{}),l.jsxs(wl,{ref:i,className:ce(k7({side:e}),n),...o,children:[l.jsxs(Rw,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[l.jsx(lw,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]}),a]})]}));Mw.displayName=wl.displayName;const _w=({className:e,...n})=>l.jsx("div",{className:ce("flex flex-col space-y-2 text-center sm:text-left",e),...n});_w.displayName="SheetHeader";const Ow=f.forwardRef(({className:e,...n},a)=>l.jsx(cd,{ref:a,className:ce("text-lg font-semibold text-foreground",e),...n}));Ow.displayName=cd.displayName;const Dw=f.forwardRef(({className:e,...n},a)=>l.jsx(ud,{ref:a,className:ce("text-sm text-muted-foreground",e),...n}));Dw.displayName=ud.displayName;function Ve({className:e,...n}){return l.jsx("div",{className:ce("animate-pulse rounded-md bg-primary/10",e),...n})}function T7(e,n=[]){let a=[];function o(c,d){const m=f.createContext(d),p=a.length;a=[...a,d];const h=v=>{var E;const{scope:x,children:S,...j}=v,C=((E=x==null?void 0:x[e])==null?void 0:E[p])||m,N=f.useMemo(()=>j,Object.values(j));return l.jsx(C.Provider,{value:N,children:S})};h.displayName=c+"Provider";function y(v,x){var C;const S=((C=x==null?void 0:x[e])==null?void 0:C[p])||m,j=f.useContext(S);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${v}\` must be used within \`${c}\``)}return[h,y]}const i=()=>{const c=a.map(d=>f.createContext(d));return function(m){const p=(m==null?void 0:m[e])||c;return f.useMemo(()=>({[`__scope${e}`]:{...m,[e]:p}}),[m,p])}};return i.scopeName=e,[o,R7(i,...n)]}function R7(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const o=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(c){const d=o.reduce((m,{useScope:p,scopeName:h})=>{const v=p(c)[`__scope${h}`];return{...m,...v}},{});return f.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return a.scopeName=n.scopeName,a}function A7(e){const n=M7(e),a=f.forwardRef((o,i)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(O7);if(p){const h=p.props.children,y=m.map(v=>v===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:v);return l.jsx(n,{...d,ref:i,children:f.isValidElement(h)?f.cloneElement(h,void 0,y):null})}return l.jsx(n,{...d,ref:i,children:c})});return a.displayName=`${e}.Slot`,a}function M7(e){const n=f.forwardRef((a,o)=>{const{children:i,...c}=a;if(f.isValidElement(i)){const d=L7(i),m=D7(c,i.props);return i.type!==f.Fragment&&(m.ref=o?st(o,d):d),f.cloneElement(i,m)}return f.Children.count(i)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var Lw=Symbol("radix.slottable");function _7(e){const n=({children:a})=>l.jsx(l.Fragment,{children:a});return n.displayName=`${e}.Slottable`,n.__radixId=Lw,n}function O7(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Lw}function D7(e,n){const a={...n};for(const o in n){const i=e[o],c=n[o];/^on[A-Z]/.test(o)?i&&c?a[o]=(...m)=>{const p=c(...m);return i(...m),p}:i&&(a[o]=i):o==="style"?a[o]={...i,...c}:o==="className"&&(a[o]=[i,c].filter(Boolean).join(" "))}return{...e,...a}
Line truncated
|
||||
* @license React
|
||||
* use-sync-external-store-shim.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var B1;function P_(){if(B1)return xp;B1=1;var e=Lu();function n(v,x){return v===x&&(v!==0||1/v===1/x)||v!==v&&x!==x}var a=typeof Object.is=="function"?Object.is:n,o=e.useState,i=e.useEffect,c=e.useLayoutEffect,d=e.useDebugValue;function m(v,x){var S=x(),j=o({inst:{value:S,getSnapshot:x}}),C=j[0].inst,N=j[1];return c(function(){C.value=S,C.getSnapshot=x,p(C)&&N({inst:C})},[v,S,x]),i(function(){return p(C)&&N({inst:C}),v(function(){p(C)&&N({inst:C})})},[v]),d(S),S}function p(v){var x=v.getSnapshot;v=v.value;try{var S=x();return!a(v,S)}catch{return!0}}function h(v,x){return x()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:m;return xp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,xp}var U1;function I_(){return U1||(U1=1,yp.exports=P_()),yp.exports}var $_=I_();function B_(){return $_.useSyncExternalStore(U_,()=>!0,()=>!1)}function U_(){return()=>{}}var bg="Avatar",[H_]=L_(bg),[V_,bC]=H_(bg),yC=f.forwardRef((e,n)=>{const{__scopeAvatar:a,...o}=e,[i,c]=f.useState("idle");return l.jsx(V_,{scope:a,imageLoadingStatus:i,onImageLoadingStatusChange:c,children:l.jsx(En.span,{...o,ref:n})})});yC.displayName=bg;var xC="AvatarImage",SC=f.forwardRef((e,n)=>{const{__scopeAvatar:a,src:o,onLoadingStatusChange:i=()=>{},...c}=e,d=bC(xC,a),m=G_(o,c),p=Ot(h=>{i(h),d.onImageLoadingStatusChange(h)});return jt(()=>{m!=="idle"&&p(m)},[m,p]),m==="loaded"?l.jsx(En.img,{...c,ref:n,src:o}):null});SC.displayName=xC;var wC="AvatarFallback",CC=f.forwardRef((e,n)=>{const{__scopeAvatar:a,delayMs:o,...i}=e,c=bC(wC,a),[d,m]=f.useState(o===void 0);return f.useEffect(()=>{if(o!==void 0){const p=window.setTimeout(()=>m(!0),o);return()=>window.clearTimeout(p)}},[o]),d&&c.imageLoadingStatus!=="loaded"?l.jsx(En.span,{...i,ref:n}):null});CC.displayName=wC;function H1(e,n){return e?n?(e.src!==n&&(e.src=n),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function G_(e,{referrerPolicy:n,crossOrigin:a}){const o=B_(),i=f.useRef(null),c=o?(i.current||(i.current=new window.Image),i.current):null,[d,m]=f.useState(()=>H1(c,e));return jt(()=>{m(H1(c,e))},[c,e]),jt(()=>{const p=v=>()=>{m(v)};if(!c)return;const h=p("loaded"),y=p("error");return c.addEventListener("load",h),c.addEventListener("error",y),n&&(c.referrerPolicy=n),typeof a=="string"&&(c.crossOrigin=a),()=>{c.removeEventListener("load",h),c.removeEventListener("error",y)}},[c,a,n]),d}var jC=yC,EC=SC,NC=CC;const Ss=f.forwardRef(({className:e,...n},a)=>l.jsx(jC,{ref:a,className:ce("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...n}));Ss.displayName=jC.displayName;const ws=f.forwardRef(({className:e,...n},a)=>l.jsx(EC,{ref:a,className:ce("aspect-square h-full w-full",e),...n}));ws.displayName=EC.displayName;const Cs=f.forwardRef(({className:e,...n},a)=>l.jsx(NC,{ref:a,className:ce("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...n}));Cs.displayName=NC.displayName;const kC=f.createContext(null);function F_({children:e}){const[n,a]=f.useState([]),[o,i]=f.useState(0),[c,d]=f.useState(!0),m=f.useCallback(async()=>{try{const v=await Ne.getNotifications();v.data&&(a(v.data.items),i(v.data.unreadCount))}catch{}finally{d(!1)}},[]),p=f.useCallback(async()=>{var v;try{const x=await Ne.markNotificationsRead("all");a(S=>S.map(j=>({...j,read:!0}))),i(((v=x.data)==null?void 0:v.unreadCount)??0)}catch{}},[]),h=f.useCallback(async v=>{var x;try{const S=await Ne.dismissNotification(v);a(j=>j.filter(C=>C.id!==v)),i(((x=S.data)==null?void 0:x.unreadCount)??0)}catch{}},[]);f.useEffect(()=>{m();const v=setInterval(m,3e4);return()=>clearInterval(v)},[m]);const y=f.useMemo(()=>({items:n,unreadCount:o,loading:c,refresh:m,markAllRead:p,dismiss:h}),[n,o,c,m,p,h]);return l.jsx(kC.Provider,{value:y,children:e})}function Y_(){const e=f.useContext(kC);if(!e)throw new Error("useNotifications must be used within NotificationsProvider");return e}const W_=Ds("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function gs({className:e,variant:n,...a}){return l.jsx("div",{className:ce(W_({variant:n}),e),...a})}function q_(e){const n=K_(e),a=f.forwardRef((o,i)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(Z_);if(p){const h=p.props.children,y=m.map(v=>v===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:v);return l.jsx(n,{...d,ref:i,children:f.isValidElement(h)?f.cloneElement(h,void 0,y):null})}return l.jsx(n,{...d,ref:i,children:c})});return a.displayName=`${e}.SLine truncated
|
||||
--num-groups: ${c.groups.length};
|
||||
--indicator-opacity: ${c.searchMode?0:1};
|
||||
--num-skintones: ${Q1};`}),d(()=>{c.customEmoji&&c.database&&z()}),d(()=>{c.customEmoji&&c.customEmoji.length?c.groups!==vh&&(c.groups=vh):c.groups!==Cp&&(c.currentGroupIndex&&c.currentGroupIndex--,c.groups=Cp)}),d(()=>{async function W(){c.databaseLoaded&&(c.currentSkinTone=await c.database.getPreferredSkinTone())}W()}),d(()=>{c.skinTones=Array(Q1).fill().map((W,ie)=>Pz(c.skinToneEmoji,ie))}),d(()=>{c.skinToneButtonText=c.skinTones[c.currentSkinTone]}),d(()=>{c.skinToneButtonLabel=c.i18n.skinToneLabel.replace("{skinTone}",c.i18n.skinTones[c.currentSkinTone])}),d(()=>{async function W(){const{database:ie}=c,ge=(await Promise.all(kz.map(je=>ie.getEmojiByUnicodeOrName(je)))).filter(Boolean);c.defaultFavoriteEmojis=ge}c.databaseLoaded&&W()});function z(){const{customEmoji:W,database:ie}=c,ge=W||Rp;ie.customEmoji!==ge&&(ie.customEmoji=ge)}d(()=>{async function W(){z();const{database:ie,defaultFavoriteEmojis:ge,numColumns:je}=c,Ae=await ie.getTopFavoriteEmoji(je),tt=await he(D5([...Ae,...ge],ct=>ct.unicode||ct.name).slice(0,je));c.currentFavorites=tt}c.databaseLoaded&&c.defaultFavoriteEmojis&&W()});function B(W){Bz(W,i,()=>{{const ie=getComputedStyle(a.rootElement),ge=parseInt(ie.getPropertyValue("--num-columns"),10),je=ie.getPropertyValue("direction")==="rtl";c.numColumns=ge,c.isRtl=je}})}function H(W){sP(W,i,ie=>{for(const{target:ge,isIntersecting:je}of ie)ge.classList.toggle("onscreen",je)})}d(()=>{async function W(){const{searchText:ie,currentGroup:ge,databaseLoaded:je,customEmoji:Ae}=c;if(!je)c.currentEmojis=[],c.searchMode=!1;else if(ie.length>=wz){const tt=await O(ie);c.searchText===ie&&(S(tt),j(!0))}else{const{id:tt}=ge;if(tt!==-1||Ae&&Ae.length){const ct=await se(tt);c.currentGroup.id===tt&&(S(ct),j(!1))}}}W()});const Y=()=>{du(()=>Gz(a.tabpanelElement))};d(()=>{const{currentEmojis:W,emojiVersion:ie}=c,ge=W.filter(je=>je.unicode).filter(je=>J1(je)&&!bh.has(je.unicode));if(!ie&&ge.length)S(W),du(()=>Q(ge));else{const je=ie?W:W.filter(fe);S(je),Y()}});function Q(W){Hz(W,a.baselineEmoji,h)?Y():c.currentEmojis=[...c.currentEmojis]}function fe(W){return!W.unicode||!J1(W)||bh.get(W.unicode)}async function de(W){const ie=c.emojiVersion||await Ep();return W.filter(({version:ge})=>!ge||ge<=ie)}async function he(W){return Iz(W,c.emojiVersion||await Ep())}async function se(W){const ie=W===-1?c.customEmoji:await c.database.getEmojiByGroup(W);return he(await de(ie))}async function O(W){return he(await de(await c.database.getEmojiBySearchQuery(W)))}d(()=>{}),d(()=>{function W(){const{searchMode:ge,currentEmojis:je}=c;if(ge)return[{category:"",emojis:je}];const Ae=new Map;for(const tt of je){const ct=tt.category||"";let kt=Ae.get(ct);kt||(kt=[],Ae.set(ct,kt)),kt.push(tt)}return[...Ae.entries()].map(([tt,ct])=>({category:tt,emojis:ct})).sort((tt,ct)=>c.customCategorySorting(tt.category,ct.category))}const ie=W();C(ie)}),d(()=>{c.activeSearchItemId=c.activeSearchItem!==-1&&c.currentEmojis[c.activeSearchItem].id}),d(()=>{const{rawSearchText:W}=c;_5(()=>{c.searchText=(W||"").trim(),c.activeSearchItem=-1})});function $(W){if(!c.searchMode||!c.currentEmojis.length)return;const ie=ge=>{or(W),c.activeSearchItem=Np(ge,c.activeSearchItem,c.currentEmojis)};switch(W.key){case"ArrowDown":return ie(!1);case"ArrowUp":return ie(!0);case"Enter":if(c.activeSearchItem===-1)c.activeSearchItem=0;else return or(W),M(c.currentEmojis[c.activeSearchItem].id)}}function Z(W){const{target:ie}=W,ge=ie.closest(".nav-button");if(!ge)return;const je=parseInt(ge.dataset.groupId,10);a.searchElement.value="",c.rawSearchText="",c.searchText="",c.activeSearchItem=-1,c.currentGroupIndex=c.groups.findIndex(Ae=>Ae.id===je)}function J(W){const{target:ie,key:ge}=W,je=Ae=>{Ae&&(or(W),Ae.focus())};switch(ge){case"ArrowLeft":return je(ie.previousElementSibling);case"ArrowRight":return je(ie.nextElementSibling);case"Home":return je(ie.parentElement.firstElementChild);case"End":return je(ie.parentElement.lastElementChild)}}async function te(W){const ie=await c.database.getEmojiByUnicodeOrName(W),ge=[...c.currentEmojis,...c.currentFavorites].find(Ae=>Ae.id===W),je=ge.unicode&&N(ge,c.currentSkinTone);return await c.database.incrementFavoriteEmojiCount(W),{emoji:ie,skinTone:c.currentSkinTone,...je&&{unicode:je},...ge.name&&{name:ge.name}}}async function M(W){const ie=te(W);y("emoji-click-sync",ie),y("emoji-click",await ie)}function _(W){const{target:ie}=W;if(!ie.classList.contains("emoji"))return;or(W);const ge=ie.id.substring(4);M(ge)}function U(W){c.currentSkinTone=W,c.skinTonePickerExpanded=!1,p("skintone-button"),y("skin-tone-change",{skinTone:W}),c.database.setPreferredSkinTone(W)}function V(W){const{target:{id:ie}}=W,ge=ie&&ie.match(/^skintone-(\d)/);if(!ge)return;or(W);const je=parseInt(ge[1],10);U(je)}function F(W){c.skinTonePickerExpanded=!c.skinTonePickerExpanded,c.activeSkinTone=c.currentSkinTone,c.skinTonePickerExpanded&&(or(W),du(()=>p("skintone-list")))}d(()=>{c.skinTonePickerExpanded?a.skinToneDropdown.addEventListener("transitionend",()=>{c.ski
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f0(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),a.push.apply(a,o)}return a}function m0(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?f0(Object(a),!0).forEach(function(o){QP(e,o,a[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):f0(Object(a)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(a,o))})}return e}function tI(e,n){if(e==null)return{};var a,o,i=nI(e,n);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o<c.length;o++)a=c[o],n.indexOf(a)===-1&&{}.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function nI(e,n){if(e==null)return{};var a={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(n.indexOf(o)!==-1)continue;a[o]=e[o]}return a}function rI(e,n){return ZP(e)||JP(e,n)||sI(e,n)||eI()}function aI(e,n){if(typeof e!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var o=a.call(e,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function oI(e){var n=aI(e,"string");return typeof n=="symbol"?n:n+""}function sI(e,n){if(e){if(typeof e=="string")return d0(e,n);var a={}.toString.call(e).slice(8,-1);return a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set"?Array.from(e):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?d0(e,n):void 0}}function iI(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function p0(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),a.push.apply(a,o)}return a}function h0(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?p0(Object(a),!0).forEach(function(o){iI(e,o,a[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):p0(Object(a)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(a,o))})}return e}function lI(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];return function(o){return n.reduceRight(function(i,c){return c(i)},o)}}function Vi(e){return function n(){for(var a=this,o=arguments.length,i=new Array(o),c=0;c<o;c++)i[c]=arguments[c];return i.length>=e.length?e.apply(this,i):function(){for(var d=arguments.length,m=new Array(d),p=0;p<d;p++)m[p]=arguments[p];return n.apply(a,[].concat(i,m))}}}function Du(e){return{}.toString.call(e).includes("Object")}function cI(e){return!Object.keys(e).length}function ll(e){return typeof e=="function"}function uI(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function dI(e,n){return Du(n)||ya("changeType"),Object.keys(n).some(function(a){return!uI(e,a)})&&ya("changeField"),n}function fI(e){ll(e)||ya("selectorType")}function mI(e){ll(e)||Du(e)||ya("handlerType"),Du(e)&&Object.values(e).some(function(n){return!ll(n)})&&ya("handlersType")}function pI(e){e||ya("initialIsRequired"),Du(e)||ya("initialType"),cI(e)&&ya("initialContent")}function hI(e,n){throw new Error(e[n]||e.default)}var gI={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},ya=Vi(hI)(gI),nu={changes:dI,selector:fI,handler:mI,initial:pI};function vI(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};nu.initial(e),nu.handler(n);var a={current:e},o=Vi(xI)(a,n),i=Vi(yI)(a),c=Vi(nu.changes)(e),d=Vi(bI)(a);function m(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(y){return y};return nu.selector(h),h(a.current)}function p(h){lI(o,i,c,d)(h)}return[m,p]}function bI(e,n){return ll(n)?n(e.current):n}function yI(e,n){return e.current=h0(h0({},e.current),n),n}function xI(e,n,a){return ll(n)?n(e.current):Object.keys(a).forEach(function(o){var i;return(i=n[o])===null||i===void 0?void 0:i.call(n,e.current[o])}),a}var SI={create:vI},wI={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function CI(e){return function n(){for(var a=this,o=arguments.length,i=new Array(o),c=0;c<o;c++)i[c]=arguments[c];return i.length>=e.length?e.apply(this,i):function(){for(var d=arguments.length,m=new Array(d),p=0;p<d;p++)m[p]=arguments[p];
Line truncated
|
||||
You are using deprecated way of configuration.
|
||||
|
||||
Instead of using
|
||||
monaco.config({ urls: { monacoBase: '...' } })
|
||||
use
|
||||
monaco.config({ paths: { vs: '...' } })
|
||||
|
||||
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
||||
`},g0=CI(kI)($5),TI={config:EI},RI=function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return function(i){return a.reduceRight(function(c,d){return d(c)},i)}};function B5(e,n){return Object.keys(n).forEach(function(a){n[a]instanceof Object&&e[a]&&Object.assign(n[a],B5(e[a],n[a]))}),m0(m0({},e),n)}var AI={type:"cancelation",msg:"operation is manually canceled"};function Ap(e){var n=!1,a=new Promise(function(o,i){e.then(function(c){return n?i(AI):o(c)}),e.catch(i)});return a.cancel=function(){return n=!0},a}var MI=["monaco"],_I=SI.create({config:wI,isInitialized:!1,resolve:null,reject:null,monaco:null}),U5=rI(_I,2),kl=U5[0],Md=U5[1];function OI(e){var n=TI.config(e),a=n.monaco,o=tI(n,MI);Md(function(i){return{config:B5(i.config,o),monaco:a}})}function DI(){var e=kl(function(n){var a=n.monaco,o=n.isInitialized,i=n.resolve;return{monaco:a,isInitialized:o,resolve:i}});if(!e.isInitialized){if(Md({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Ap(Mp);if(window.monaco&&window.monaco.editor)return H5(window.monaco),e.resolve(window.monaco),Ap(Mp);RI(LI,PI)(II)}return Ap(Mp)}function LI(e){return document.body.appendChild(e)}function zI(e){var n=document.createElement("script");return e&&(n.src=e),n}function PI(e){var n=kl(function(o){var i=o.config,c=o.reject;return{config:i,reject:c}}),a=zI("".concat(n.config.paths.vs,"/loader.js"));return a.onload=function(){return e()},a.onerror=n.reject,a}function II(){var e=kl(function(a){var o=a.config,i=a.resolve,c=a.reject;return{config:o,resolve:i,reject:c}}),n=window.require;n.config(e.config),n(["vs/editor/editor.main"],function(a){var o=a.m||a;H5(o),e.resolve(o)},function(a){e.reject(a)})}function H5(e){kl().monaco||Md({monaco:e})}function $I(){return kl(function(e){var n=e.monaco;return n})}var Mp=new Promise(function(e,n){return Md({resolve:e,reject:n})}),V5={config:OI,init:DI,__getMonacoInstance:$I},BI={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},_p=BI,UI={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},HI=UI;function VI({children:e}){return ue.createElement("div",{style:HI.container},e)}var GI=VI,FI=GI;function YI({width:e,height:n,isEditorReady:a,loading:o,_ref:i,className:c,wrapperProps:d}){return ue.createElement("section",{style:{..._p.wrapper,width:e,height:n},...d},!a&&ue.createElement(FI,null,o),ue.createElement("div",{ref:i,style:{..._p.fullWidth,...!a&&_p.hide},className:c}))}var WI=YI,G5=f.memo(WI);function qI(e){f.useEffect(e,[])}var F5=qI;function KI(e,n,a=!0){let o=f.useRef(!0);f.useEffect(o.current||!a?()=>{o.current=!1}:e,n)}var xn=KI;function qi(){}function ms(e,n,a,o){return XI(e,o)||ZI(e,n,a,o)}function XI(e,n){return e.editor.getModel(Y5(e,n))}function ZI(e,n,a,o){return e.editor.createModel(n,a,o?Y5(e,o):void 0)}function Y5(e,n){return e.Uri.parse(n)}function QI({original:e,modified:n,language:a,originalLanguage:o,modifiedLanguage:i,originalModelPath:c,modifiedModelPath:d,keepCurrentOriginalModel:m=!1,keepCurrentModifiedModel:p=!1,theme:h="light",loading:y="Loading...",options:v={},height:x="100%",width:S="100%",className:j,wrapperProps:C={},beforeMount:N=qi,onMount:E=qi}){let[k,T]=f.useState(!1),[R,D]=f.useState(!0),P=f.useRef(null),z=f.useRef(null),B=f.useRef(null),H=f.useRef(E),Y=f.useRef(N),Q=f.useRef(!1);F5(()=>{let se=V5.init();return se.then(O=>(z.current=O)&&D(!1)).catch(O=>(O==null?void 0:O.type)!=="cancelation"&&console.error("Monaco initialization: error:",O)),()=>P.current?he():se.cancel()}),xn(()=>{if(P.current&&z.current){let se=P.current.getOriginalEditor(),O=ms(z.current,e||"",o||a||"text",c||"");O!==se.getModel()&&se.setModel(O)}},[c],k),xn(()=>{if(P.current&&z.current){let se=P.current.getModifiedEditor(),O=ms(z.current,n||"",i||a||"text",d||"");O!==se.getModel()&&se.setModel(O)}},[d],k),xn(()=>{let se=P.current.getModifiedEditor();se.getOption(z.current.editor.EditorOption.readOnly)?se.setValue(n||""):n!==se.getValue()&&(se.executeEdits("",[{range:se.getModel().getFullModelRange(),text:n||"",forceMoveMarkers:!0}]),se.pushUndoStop())},[n],k),xn(()=>{var se,O;(O=(se=P.current)==null?void 0:se.getModel())==null||O.original.setValue(e||"")},[e],k),xn(()=>{let{original:se,modified:O}=P.current.getModel();z.current.editor.setModelLanguage(se,o||a||"text"),z.current.editor.setModelLanguage(O,i||a||"text")},[a,o,i],k),xn(()=>{var se;(se=z.current)==null||se.editor.setTheme(h)},[h],k),xn(()=>{var se;(se=P.current)==null||se.updateOptions(v)},[v],k);let fe=f.useCallback(()=>{var $;if(!z.current)return;Y.current(z.current);let se=ms(z.current,e||"",o||a||"text",c||""),O=ms(z.current,n||"",i||a||"text",d||"");($=P.current)==null||$.setModel({original:se,modified:O})},[a,n,i,e,o,c,d]),de=f.useCallback(()=>{var se;!Q.current&&B.current&&(P.current=z.current.editor.createDiffEditor(B.current,{automaticLayout:!0,...v}),fe(),(se=z.current)==null||se.editor.setTheme(h),T(!0),Q.current=!0
Line truncated
|
||||
987654321098765432`,className:"min-h-[120px] font-mono text-sm"})]}),l.jsx(Us,{result:a.owners}),l.jsx("div",{className:"mt-auto",children:l.jsx(ve,{type:"button",variant:"secondary",disabled:o||!e.ownerUserIds.trim(),onClick:i,children:o?"Checking with Discord…":"Verify owner IDs"})})]})}function k$({onContinue:e}){return l.jsx("div",{className:"mx-auto flex w-full max-w-lg flex-1 flex-col justify-center py-8",children:l.jsxs("div",{className:"rounded-2xl border border-border bg-card px-6 py-10 text-center md:px-10",children:[l.jsx("div",{className:"mx-auto mb-6 flex size-16 items-center justify-center rounded-2xl bg-primary/10 text-primary",children:l.jsx(ye,{icon:Bu,size:40})}),l.jsx("h2",{className:"text-2xl font-semibold tracking-tight",children:"Setup complete"}),l.jsxs("p",{className:"mx-auto mt-3 max-w-sm text-sm leading-relaxed text-muted-foreground",children:["Your configuration has been saved. Restart the server for changes to take effect — stop the running process, then start it again (for example"," ",l.jsx("code",{className:"rounded-md bg-muted px-1.5 py-0.5 font-mono text-xs",children:"npm start"}),")."]}),l.jsx(Ye,{className:"mt-6 text-left",children:l.jsx(We,{children:"After restarting, sign in with Discord to open the dashboard."})}),l.jsx(ve,{type:"button",size:"lg",className:"mt-8 min-w-[220px]",onClick:e,children:"Continue to sign in"})]})})}function T$({currentIndex:e,validating:n,saving:a,onBack:o,onNext:i,onFinish:c}){const d=e===bs.length-1;return l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[l.jsxs(ve,{type:"button",variant:"ghost",disabled:e===0||a,onClick:o,children:[l.jsx(ye,{icon:G0,size:18,className:"mr-1"}),"Back"]}),l.jsx("div",{className:"flex flex-1 justify-end gap-2",children:d?l.jsx(ve,{type:"button",size:"lg",disabled:a||n,onClick:c,className:"min-w-[200px]",children:a?"Saving…":"Finish setup"}):l.jsxs(ve,{type:"button",size:"lg",disabled:n||a,onClick:i,children:["Continue",l.jsx(ye,{icon:Oh,size:18,className:"ml-1"})]})})]})}function R$({values:e,setValues:n,validation:a,validating:o,onValidate:i}){return l.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[l.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["An Emerald Services API key is optional, but required to use the one-click addon installer in the dashboard. You can get yours from the"," ",l.jsx("a",{href:"https://emeraldsrv.dev",target:"_blank",rel:"noreferrer",className:"font-medium text-primary hover:underline",children:"Emerald Services Marketplace"}),"."]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(De,{htmlFor:"emeraldApiKey",children:"Emerald API key (Optional)"}),l.jsx(Ue,{id:"emeraldApiKey",type:"password",autoComplete:"off",value:e.emeraldApiKey,onChange:c=>n({...e,emeraldApiKey:c.target.value}),placeholder:"em_...",className:"h-11 font-mono text-sm"})]}),l.jsx(Us,{result:a.emeraldApi}),l.jsx("div",{className:"mt-auto",children:l.jsx(ve,{type:"button",variant:"secondary",disabled:o,onClick:i,children:o?"Checking…":e.emeraldApiKey?"Verify key":"Skip step"})})]})}function A$(){const e=crypto.randomUUID().replace(/-/g,""),n=crypto.randomUUID().replace(/-/g,"");return e+n}function M$(e){return e.split(/[\s,]+/).map(n=>n.trim()).filter(Boolean)}function v0(e){return e==="oauth"?"oauth":e==="owners"?"owners":e==="emeraldApi"?"emeraldApi":e}function _$(){const e=mo(),{branding:n}=Fu(),{loading:a,error:o,refresh:i,status:c}=GC(),[d,m]=f.useState(0),[p,h]=f.useState({botToken:"",secretKey:"",clientId:"",clientSecret:"",redirectUri:"",ownerUserIds:"",emeraldApiKey:""}),[y,v]=f.useState({}),[x,S]=f.useState(!1),[j,C]=f.useState(!1),[N,E]=f.useState(""),[k,T]=f.useState(!1),R=bs[d];f.useEffect(()=>{c!=null&&c.suggestedRedirectUri&&!p.redirectUri&&h(Q=>({...Q,redirectUri:c.suggestedRedirectUri}))},[c==null?void 0:c.suggestedRedirectUri,p.redirectUri]);const D=f.useMemo(()=>({botToken:p.botToken,secretKey:p.secretKey,clientId:p.clientId,clientSecret:p.clientSecret,redirectUri:p.redirectUri,ownerUserIds:M$(p.ownerUserIds),emeraldApiKey:p.emeraldApiKey}),[p]);async function P(){S(!0),E("");try{const Q=await Ne.validateSetup(D);return v(fe=>{var de;return{...fe,...(de=Q.data)==null?void 0:de.results}}),Q.data}catch(Q){return E(Q instanceof Error?Q.message:"Validation failed"),null}finally{S(!1)}}async function z(){var de,he;const Q=v0(R.id),fe=await P();return!!((he=(de=fe==null?void 0:fe.results)==null?void 0:de[Q])!=null&&he.ok)}async function B(){const Q=v0(R.id),fe=y[Q];!(fe!=null&&fe.ok)&&!await z()||m(de=>Math.min(de+1,bs.length-1))}async function H(){C(!0),E("");try{const Q=await P();if(!(Q!=null&&Q.ok)){E("Fix the steps marked with errors before finishing.");return}await Ne.completeSetup(D),T(!0)}catch(Q){E(Q instanceof Error?Q.message:"Could not save setup")}finally{C(!1)}}function Y(){const Q={values:p,setValues:h,validation:y,validating:x};switch(R.id){case"botToken":return l.jsx(w$,{...Q,onValidate:()=>void z()}
Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Poppins,system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 240 10% 4%;--foreground: 0 0% 98%;--card: 240 7% 11%;--card-foreground: 0 0% 98%;--popover: 240 8% 10%;--popover-foreground: 0 0% 98%;--primary: 141 45% 49%;--primary-foreground: 0 0% 100%;--secondary: 240 6% 14%;--secondary-foreground: 0 0% 90%;--muted: 240 6% 14%;--muted-foreground: 240 5%Line truncated
|
||||
@@ -1,191 +0,0 @@
|
||||
var RN=Object.defineProperty;var AN=(e,n,a)=>n in e?RN(e,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[n]=a;var m1=(e,n,a)=>AN(e,typeof n!="symbol"?n+"":n,a);function _N(e,n){for(var a=0;a<n.length;a++){const o=n[a];if(typeof o!="string"&&!Array.isArray(o)){for(const l in o)if(l!=="default"&&!(l in e)){const i=Object.getOwnPropertyDescriptor(o,l);i&&Object.defineProperty(e,l,i.get?i:{enumerable:!0,get:()=>o[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const d of i.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function a(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(l){if(l.ep)return;l.ep=!0;const i=a(l);fetch(l.href,i)}})();function Xx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rm={exports:{}},Nl={};/**
|
||||
* @license React
|
||||
* react-jsx-runtime.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var p1;function MN(){if(p1)return Nl;p1=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(o,l,i){var d=null;if(i!==void 0&&(d=""+i),l.key!==void 0&&(d=""+l.key),"key"in l){i={};for(var m in l)m!=="key"&&(i[m]=l[m])}else i=l;return l=i.ref,{$$typeof:e,type:o,key:d,ref:l!==void 0?l:null,props:i}}return Nl.Fragment=n,Nl.jsx=a,Nl.jsxs=a,Nl}var h1;function ON(){return h1||(h1=1,Rm.exports=MN()),Rm.exports}var c=ON(),Am={exports:{}},_e={};/**
|
||||
* @license React
|
||||
* react.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var g1;function DN(){if(g1)return _e;g1=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),x=Symbol.iterator;function S(_){return _===null||typeof _!="object"?null:(_=x&&_[x]||_["@@iterator"],typeof _=="function"?_:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,N={};function E(_,O,H){this.props=_,this.context=O,this.refs=N,this.updater=H||j}E.prototype.isReactComponent={},E.prototype.setState=function(_,O){if(typeof _!="object"&&typeof _!="function"&&_!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,_,O,"setState")},E.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function k(){}k.prototype=E.prototype;function A(_,O,H){this.props=_,this.context=O,this.refs=N,this.updater=H||j}var R=A.prototype=new k;R.constructor=A,C(R,E.prototype),R.isPureReactComponent=!0;var L=Array.isArray;function z(){}var B={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function q(_,O,H){var I=H.ref;return{$$typeof:e,type:_,key:O,ref:I!==void 0?I:null,props:H}}function Z(_,O){return q(_.type,O,_.props)}function Q(_){return typeof _=="object"&&_!==null&&_.$$typeof===e}function fe(_){var O={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(H){return O[H]})}var de=/\/+/g;function ce(_,O){return typeof _=="object"&&_!==null&&_.key!=null?fe(""+_.key):O.toString(36)}function he(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(z,z):(_.status="pending",_.then(function(O){_.status==="pending"&&(_.status="fulfilled",_.value=O)},function(O){_.status==="pending"&&(_.status="rejected",_.reason=O)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function M(_,O,H,I,V){var ne=typeof _;(ne==="undefined"||ne==="boolean")&&(_=null);var J=!1;if(_===null)J=!0;else switch(ne){case"bigint":case"string":case"number":J=!0;break;case"object":switch(_.$$typeof){case e:case n:J=!0;break;case y:return J=_._init,M(J(_._payload),O,H,I,V)}}if(J)return V=V(_),J=I===""?"."+ce(_,0):I,L(V)?(H="",J!=null&&(H=J.replace(de,"$&/")+"/"),M(V,O,H,"",function(G){return G})):V!=null&&(Q(V)&&(V=Z(V,H+(V.key==null||_&&_.key===V.key?"":(""+V.key).replace(de,"$&/")+"/")+J)),O.push(V)),1;J=0;var me=I===""?".":I+":";if(L(_))for(var pe=0;pe<_.length;pe++)I=_[pe],ne=me+ce(I,pe),J+=M(I,O,H,ne,V);else if(pe=S(_),typeof pe=="function")for(_=pe.call(_),pe=0;!(I=_.next()).done;)I=I.value,ne=me+ce(I,pe++),J+=M(I,O,H,ne,V);else if(ne==="object"){if(typeof _.then=="function")return M(he(_),O,H,I,V);throw O=String(_),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}return J}function K(_,O,H){if(_==null)return _;var I=[],V=0;return M(_,I,"","",function(ne){return O.call(H,ne,V++)}),I}function re(_){if(_._status===-1){var O=_._result;O=O(),O.then(function(H){(_._status===0||_._status===-1)&&(_._status=1,_._result=H)},function(H){(_._status===0||_._status===-1)&&(_._status=2,_._result=H)}),_._status===-1&&(_._status=0,_._result=O)}if(_._status===1)return _._result.default;throw _._result}var oe=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var O=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(O))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},ee={map:K,forEach:function(_,O,H){K(_,function(){O.apply(this,arguments)},H)},count:function(_){var O=0;return K(_,function(){O++}),O},toArray:function(_){return K(_,function(O){return O})||[]},only:function(_){if(!Q(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return _e.Activity=v,_e.Children=ee,_e.Component=E,_e.Fragment=a,_e.Profiler=l,_e.PureComponent=A,_e.StrictMode=o,_e.Suspense=h,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,_e.__COMPILER_RUNTIME={__proto__:null,c:function(_){return B.H.useMemoCache(_)}},_e.cache=function(_){return function(){return _.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(_,O,H){if(_==null)throw Error("The argument must be a React element, bLine truncated
|
||||
* @license React
|
||||
* scheduler.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var b1;function LN(){return b1||(b1=1,(function(e){function n(M,K){var re=M.length;M.push(K);e:for(;0<re;){var oe=re-1>>>1,ee=M[oe];if(0<l(ee,K))M[oe]=K,M[re]=ee,re=oe;else break e}}function a(M){return M.length===0?null:M[0]}function o(M){if(M.length===0)return null;var K=M[0],re=M.pop();if(re!==K){M[0]=re;e:for(var oe=0,ee=M.length,_=ee>>>1;oe<_;){var O=2*(oe+1)-1,H=M[O],I=O+1,V=M[I];if(0>l(H,re))I<ee&&0>l(V,H)?(M[oe]=V,M[I]=re,oe=I):(M[oe]=H,M[O]=re,oe=O);else if(I<ee&&0>l(V,re))M[oe]=V,M[I]=re,oe=I;else break e}}return K}function l(M,K){var re=M.sortIndex-K.sortIndex;return re!==0?re:M.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var d=Date,m=d.now();e.unstable_now=function(){return d.now()-m}}var h=[],p=[],y=1,v=null,x=3,S=!1,j=!1,C=!1,N=!1,E=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function R(M){for(var K=a(p);K!==null;){if(K.callback===null)o(p);else if(K.startTime<=M)o(p),K.sortIndex=K.expirationTime,n(h,K);else break;K=a(p)}}function L(M){if(C=!1,R(M),!j)if(a(h)!==null)j=!0,z||(z=!0,fe());else{var K=a(p);K!==null&&he(L,K.startTime-M)}}var z=!1,B=-1,U=5,q=-1;function Z(){return N?!0:!(e.unstable_now()-q<U)}function Q(){if(N=!1,z){var M=e.unstable_now();q=M;var K=!0;try{e:{j=!1,C&&(C=!1,k(B),B=-1),S=!0;var re=x;try{t:{for(R(M),v=a(h);v!==null&&!(v.expirationTime>M&&Z());){var oe=v.callback;if(typeof oe=="function"){v.callback=null,x=v.priorityLevel;var ee=oe(v.expirationTime<=M);if(M=e.unstable_now(),typeof ee=="function"){v.callback=ee,R(M),K=!0;break t}v===a(h)&&o(h),R(M)}else o(h);v=a(h)}if(v!==null)K=!0;else{var _=a(p);_!==null&&he(L,_.startTime-M),K=!1}}break e}finally{v=null,x=re,S=!1}K=void 0}}finally{K?fe():z=!1}}}var fe;if(typeof A=="function")fe=function(){A(Q)};else if(typeof MessageChannel<"u"){var de=new MessageChannel,ce=de.port2;de.port1.onmessage=Q,fe=function(){ce.postMessage(null)}}else fe=function(){E(Q,0)};function he(M,K){B=E(function(){M(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(M){switch(x){case 1:case 2:case 3:var K=3;break;default:K=x}var re=x;x=K;try{return M()}finally{x=re}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(M,K){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var re=x;x=M;try{return K()}finally{x=re}},e.unstable_scheduleCallback=function(M,K,re){var oe=e.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?oe+re:oe):re=oe,M){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=re+ee,M={id:y++,callback:K,priorityLevel:M,startTime:re,expirationTime:ee,sortIndex:-1},re>oe?(M.sortIndex=re,n(p,M),a(h)===null&&M===a(p)&&(C?(k(B),B=-1):C=!0,he(L,re-oe))):(M.sortIndex=ee,n(h,M),j||S||(j=!0,z||(z=!0,fe()))),M},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function(M){var K=x;return function(){var re=x;x=K;try{return M.apply(this,arguments)}finally{x=re}}}})(Om)),Om}var y1;function zN(){return y1||(y1=1,Mm.exports=LN()),Mm.exports}var Dm={exports:{}},Gt={};/**
|
||||
* @license React
|
||||
* react-dom.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var x1;function PN(){if(x1)return Gt;x1=1;var e=Cu();function n(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)p+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var o={d:{f:a,r:function(){throw Error(n(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},l=Symbol.for("react.portal");function i(h,p,y){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:v==null?null:""+v,children:h,containerInfo:p,implementation:y}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Gt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Gt.createPortal=function(h,p){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(n(299));return i(h,p,null,y)},Gt.flushSync=function(h){var p=d.T,y=o.p;try{if(d.T=null,o.p=2,h)return h()}finally{d.T=p,o.p=y,o.d.f()}},Gt.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,o.d.C(h,p))},Gt.prefetchDNS=function(h){typeof h=="string"&&o.d.D(h)},Gt.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var y=p.as,v=m(y,p.crossOrigin),x=typeof p.integrity=="string"?p.integrity:void 0,S=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;y==="style"?o.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:v,integrity:x,fetchPriority:S}):y==="script"&&o.d.X(h,{crossOrigin:v,integrity:x,fetchPriority:S,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Gt.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var y=m(p.as,p.crossOrigin);o.d.M(h,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&o.d.M(h)},Gt.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var y=p.as,v=m(y,p.crossOrigin);o.d.L(h,y,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Gt.preloadModule=function(h,p){if(typeof h=="string")if(p){var y=m(p.as,p.crossOrigin);o.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else o.d.m(h)},Gt.requestFormReset=function(h){o.d.r(h)},Gt.unstable_batchedUpdates=function(h,p){return h(p)},Gt.useFormState=function(h,p,y){return d.H.useFormState(h,p,y)},Gt.useFormStatus=function(){return d.H.useHostTransitionStatus()},Gt.version="19.2.6",Gt}var S1;function Zx(){if(S1)return Dm.exports;S1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Dm.exports=PN(),Dm.exports}/**
|
||||
* @license React
|
||||
* react-dom-client.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var w1;function BN(){if(w1)return kl;w1=1;var e=zN(),n=Cu(),a=Zx();function o(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)r+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function i(t){var r=t,s=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(s=r.return),t=r.return;while(t)}return r.tag===3?s:null}function d(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function m(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function h(t){if(i(t)!==t)throw Error(o(188))}function p(t){var r=t.alternate;if(!r){if(r=i(t),r===null)throw Error(o(188));return r!==t?null:t}for(var s=t,u=r;;){var g=s.return;if(g===null)break;var b=g.alternate;if(b===null){if(u=g.return,u!==null){s=u;continue}break}if(g.child===b.child){for(b=g.child;b;){if(b===s)return h(g),t;if(b===u)return h(g),r;b=b.sibling}throw Error(o(188))}if(s.return!==u.return)s=g,u=b;else{for(var w=!1,T=g.child;T;){if(T===s){w=!0,s=g,u=b;break}if(T===u){w=!0,u=g,s=b;break}T=T.sibling}if(!w){for(T=b.child;T;){if(T===s){w=!0,s=b,u=g;break}if(T===u){w=!0,u=b,s=g;break}T=T.sibling}if(!w)throw Error(o(189))}}if(s.alternate!==u)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?t:r}function y(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=y(t),r!==null)return r;t=t.sibling}return null}var v=Object.assign,x=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),A=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),Z=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function fe(t){return t===null||typeof t!="object"?null:(t=Q&&t[Q]||t["@@iterator"],typeof t=="function"?t:null)}var de=Symbol.for("react.client.reference");function ce(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===de?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case C:return"Fragment";case E:return"Profiler";case N:return"StrictMode";case L:return"Suspense";case z:return"SuspenseList";case q:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case j:return"Portal";case A:return t.displayName||"Context";case k:return(t._context.displayName||"Context")+".Consumer";case R:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case B:return r=t.displayName||null,r!==null?r:ce(t.type)||"Memo";case U:r=t._payload,t=t._init;try{return ce(t(r))}catch{}}return null}var he=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},oe=[],ee=-1;function _(t){return{current:t}}function O(t){0>ee||(t.current=oe[ee],oe[ee]=null,ee--)}function H(t,r){ee++,oe[ee]=t.current,t.current=r}var I=_(null),V=_(null),ne=_(null),J=_(null);function me(t,r){switch(H(ne,r),H(V,t),H(I,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?zy(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=zy(r),t=Py(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}O(I),H(I,t)}function pe(){O(I),O(V),O(ne)}function G(t){t.memoizedState!==null&&H(J,t);var r=I.current,s=Py(r,t.type);r!==s&&(H(V,t),H(I,s))}function se(t){V.current===t&&(O(I),O(V)),J.current===t&&(O(J),wl._currentValue=re)}var ge,je;function Ae(t){if(ge===void 0)try{throw Error()}catch(s){var r=s.stack.trim().match(/\n( *(at )?)/);ge=r&&r[1]||"",je=-1<s.stack.indexOf(`
|
||||
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||||
`+ge+t+je}var Qe=!1;function ct(t,r){if(!t||Qe)return"";Qe=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(r){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(X){var W=X}Reflect.construct(t,[],le)}else{try{le.call()}catch(X){W=X}t.call(le.prototype)}}else{try{throw Error()}catch(X){W=X}(le=t())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(X){if(X&&W&&typeof X.stack=="string")return[X.stack,W.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=u.DetermineComponentFrameRoot(),w=b[0],T=b[1];if(w&&T){var D=w.split(`
|
||||
`),Y=T.split(`
|
||||
`);for(g=u=0;u<D.length&&!D[u].includes("DetermineComponentFrameRoot");)u++;for(;g<Y.length&&!Y[g].includes("DetermineComponentFrameRoot");)g++;if(u===D.length||g===Y.length)for(u=D.length-1,g=Y.length-1;1<=u&&0<=g&&D[u]!==Y[g];)g--;for(;1<=u&&0<=g;u--,g--)if(D[u]!==Y[g]){if(u!==1||g!==1)do if(u--,g--,0>g||D[u]!==Y[g]){var te=`
|
||||
`+D[u].replace(" at new "," at ");return t.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",t.displayName)),te}while(1<=u&&0<=g);break}}}finally{Qe=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Ae(s):""}function Tt(t,r){switch(t.tag){case 26:case 27:case 5:return Ae(t.type);case 16:return Ae("Lazy");case 13:return t.child!==r&&r!==null?Ae("Suspense Fallback"):Ae("Suspense");case 19:return Ae("SuspenseList");case 0:case 15:return ct(t.type,!1);case 11:return ct(t.type.render,!1);case 1:return ct(t.type,!0);case 31:return Ae("Activity");default:return""}}function Ca(t){try{var r="",s=null;do r+=Tt(t,s),s=t,t=t.return;while(t);return r}catch(u){return`
|
||||
Error generating stack: `+u.message+`
|
||||
`+u.stack}}var Rt=Object.prototype.hasOwnProperty,Os=e.unstable_scheduleCallback,Ds=e.unstable_cancelCallback,Yt=e.unstable_shouldYield,$r=e.unstable_requestPaint,Wt=e.unstable_now,gd=e.unstable_getCurrentPriorityLevel,ja=e.unstable_ImmediatePriority,xi=e.unstable_UserBlockingPriority,Ea=e.unstable_NormalPriority,Ls=e.unstable_LowPriority,dr=e.unstable_IdlePriority,Si=e.log,Ir=e.unstable_setDisableYieldValue,Na=null,qt=null;function $n(t){if(typeof Si=="function"&&Ir(t),qt&&typeof qt.setStrictMode=="function")try{qt.setStrictMode(Na,t)}catch{}}var Ht=Math.clz32?Math.clz32:Xn,vd=Math.log,zs=Math.LN2;function Xn(t){return t>>>=0,t===0?32:31-(vd(t)/zs|0)|0}var fo=256,mo=262144,ka=4194304;function Zn(t){var r=t&42;if(r!==0)return r;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Te(t,r,s){var u=t.pendingLanes;if(u===0)return 0;var g=0,b=t.suspendedLanes,w=t.pingedLanes;t=t.warmLanes;var T=u&134217727;return T!==0?(u=T&~b,u!==0?g=Zn(u):(w&=T,w!==0?g=Zn(w):s||(s=T&~t,s!==0&&(g=Zn(s))))):(T=u&~b,T!==0?g=Zn(T):w!==0?g=Zn(w):s||(s=u&~t,s!==0&&(g=Zn(s)))),g===0?0:r!==0&&r!==g&&(r&b)===0&&(b=g&-g,s=r&-r,b>=s||b===32&&(s&4194048)!==0)?r:g}function ut(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function At(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Vt(){var t=ka;return ka<<=1,(ka&62914560)===0&&(ka=4194304),t}function Ur(t){for(var r=[],s=0;31>s;s++)r.push(t);return r}function mt(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Zt(t,r,s,u,g,b){var w=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var T=t.entanglements,D=t.expirationTimes,Y=t.hiddenUpdates;for(s=w&~s;0<s;){var te=31-Ht(s),le=1<<te;T[te]=0,D[te]=-1;var W=Y[te];if(W!==null)for(Y[te]=null,te=0;te<W.length;te++){var X=W[te];X!==null&&(X.lane&=-536870913)}s&=~le}u!==0&&Ta(t,u,0),b!==0&&g===0&&t.tag!==0&&(t.suspendedLanes|=b&~(w&~r))}function Ta(t,r,s){t.pendingLanes|=r,t.suspendedLanes&=~r;var u=31-Ht(r);t.entangledLanes|=r,t.entanglements[u]=t.entanglements[u]|1073741824|s&261930}function Qt(t,r){var s=t.entangledLanes|=r;for(t=t.entanglements;s;){var u=31-Ht(s),g=1<<u;g&r|t[u]&r&&(t[u]|=r),s&=~g}}function Jt(t,r){var s=r&-r;return s=(s&42)!==0?1:po(s),(s&(t.suspendedLanes|r))!==0?0:s}function po(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function In(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function bd(){var t=K.p;return t!==0?t:(t=window.event,t===void 0?32:s1(t.type))}function wg(t,r){var s=K.p;try{return K.p=t,r()}finally{K.p=s}}var Hr=Math.random().toString(36).slice(2),Lt="__reactFiber$"+Hr,en="__reactProps$"+Hr,ho="__reactContainer$"+Hr,yd="__reactEvents$"+Hr,b5="__reactListeners$"+Hr,y5="__reactHandles$"+Hr,Cg="__reactResources$"+Hr,Ps="__reactMarker$"+Hr;function xd(t){delete t[Lt],delete t[en],delete t[yd],delete t[b5],delete t[y5]}function go(t){var r=t[Lt];if(r)return r;for(var s=t.parentNode;s;){if(r=s[ho]||s[Lt]){if(s=r.alternate,r.child!==null||s!==null&&s.child!==null)for(t=Gy(t);t!==null;){if(s=t[Lt])return s;t=Gy(t)}return r}t=s,s=t.parentNode}return null}function vo(t){if(t=t[Lt]||t[ho]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function Bs(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(o(33))}function bo(t){var r=t[Cg];return r||(r=t[Cg]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function _t(t){t[Ps]=!0}var jg=new Set,Eg={};function Ra(t,r){yo(t,r),yo(t+"Capture",r)}function yo(t,r){for(Eg[t]=r,t=0;t<r.length;t++)jg.add(r[t])}var x5=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\
Line truncated
|
||||
`).replace(ZE,"")}function Dy(t,r){return r=Oy(r),Oy(t)===r}function et(t,r,s,u,g,b){switch(s){case"children":typeof u=="string"?r==="body"||r==="textarea"&&u===""||So(t,u):(typeof u=="number"||typeof u=="bigint")&&r!=="body"&&So(t,""+u);break;case"className":Ci(t,"class",u);break;case"tabIndex":Ci(t,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Ci(t,s,u);break;case"style":Dg(t,u,b);break;case"data":if(r!=="object"){Ci(t,"data",u);break}case"src":case"href":if(u===""&&(r!=="a"||s!=="href")){t.removeAttribute(s);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(s);break}u=Ei(""+u),t.setAttribute(s,u);break;case"action":case"formAction":if(typeof u=="function"){t.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof b=="function"&&(s==="formAction"?(r!=="input"&&et(t,r,"name",g.name,g,null),et(t,r,"formEncType",g.formEncType,g,null),et(t,r,"formMethod",g.formMethod,g,null),et(t,r,"formTarget",g.formTarget,g,null)):(et(t,r,"encType",g.encType,g,null),et(t,r,"method",g.method,g,null),et(t,r,"target",g.target,g,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(s);break}u=Ei(""+u),t.setAttribute(s,u);break;case"onClick":u!=null&&(t.onclick=mr);break;case"onScroll":u!=null&&Pe("scroll",t);break;case"onScrollEnd":u!=null&&Pe("scrollend",t);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(s=u.__html,s!=null){if(g.children!=null)throw Error(o(60));t.innerHTML=s}}break;case"multiple":t.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":t.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){t.removeAttribute("xlink:href");break}s=Ei(""+u),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(s,""+u):t.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":u===!0?t.setAttribute(s,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(s,u):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?t.setAttribute(s,u):t.removeAttribute(s);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?t.removeAttribute(s):t.setAttribute(s,u);break;case"popover":Pe("beforetoggle",t),Pe("toggle",t),wi(t,"popover",u);break;case"xlinkActuate":fr(t,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":fr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":fr(t,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":fr(t,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":fr(t,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":fr(t,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":fr(t,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":fr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":fr(t,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":wi(t,"is",u);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=E5.get(s)||s,wi(t,s,u))}}function dm(t,r,s,u,g,b){switch(s){case"style":Dg(t,u,b);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(s=u.__html,s!=null){if(g.children!=null)throw Error(o(60));t.innerHTML=s}}break;case"children":typeof u=="string"?So(t,u):(typeof u=="number"||typeof u=="bigint")&&So(t,""+u);break;case"onScroll":u!=null&&Pe("scroll",t);break;case"onScrollEnd":u!=null&&Pe("scrollend",t);break;case"onClick":u!=null&&(t.onclick=mr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"inne
Line truncated
|
||||
* react-router v7.15.1
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/var j1="popstate";function E1(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function UN(e={}){function n(o,l){var p;let i=(p=l.state)==null?void 0:p.masked,{pathname:d,search:m,hash:h}=i||o.location;return pp("",{pathname:d,search:m,hash:h},l.state&&l.state.usr||null,l.state&&l.state.key||"default",i?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function a(o,l){return typeof l=="string"?l:Il(l)}return VN(n,a,null,e)}function ft(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Pn(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function HN(){return Math.random().toString(36).substring(2,10)}function N1(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function pp(e,n,a=null,o,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?ws(n):n,state:a,key:n&&n.key||o||HN(),mask:l}}function Il({pathname:e="/",search:n="",hash:a=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function ws(e){let n={};if(e){let a=e.indexOf("#");a>=0&&(n.hash=e.substring(a),e=e.substring(0,a));let o=e.indexOf("?");o>=0&&(n.search=e.substring(o),e=e.substring(0,o)),e&&(n.pathname=e)}return n}function VN(e,n,a,o={}){let{window:l=document.defaultView,v5Compat:i=!1}=o,d=l.history,m="POP",h=null,p=y();p==null&&(p=0,d.replaceState({...d.state,idx:p},""));function y(){return(d.state||{idx:null}).idx}function v(){m="POP";let N=y(),E=N==null?null:N-p;p=N,h&&h({action:m,location:C.location,delta:E})}function x(N,E){m="PUSH";let k=E1(N)?N:pp(C.location,N,E);p=y()+1;let A=N1(k,p),R=C.createHref(k.mask||k);try{d.pushState(A,"",R)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;l.location.assign(R)}i&&h&&h({action:m,location:C.location,delta:1})}function S(N,E){m="REPLACE";let k=E1(N)?N:pp(C.location,N,E);p=y();let A=N1(k,p),R=C.createHref(k.mask||k);d.replaceState(A,"",R),i&&h&&h({action:m,location:C.location,delta:0})}function j(N){return GN(N)}let C={get action(){return m},get location(){return e(l,d)},listen(N){if(h)throw new Error("A history only accepts one active listener");return l.addEventListener(j1,v),h=N,()=>{l.removeEventListener(j1,v),h=null}},createHref(N){return n(l,N)},createURL:j,encodeLocation(N){let E=j(N);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:x,replace:S,go(N){return d.go(N)}};return C}function GN(e,n=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),ft(a,"No window.location.(origin|href) available to create URL");let o=typeof e=="string"?e:Il(e);return o=o.replace(/ $/,"%20"),!n&&o.startsWith("//")&&(o=a+o),new URL(o,a)}function Qx(e,n,a="/"){return FN(e,n,a,!1)}function FN(e,n,a,o,l){let i=typeof n=="string"?ws(n):n,d=Or(i.pathname||"/",a);if(d==null)return null;let m=YN(e),h=null,p=a3(d);for(let y=0;h==null&&y<m.length;++y)h=n3(m[y],p,o);return h}function YN(e){let n=Jx(e);return WN(n),n}function Jx(e,n=[],a=[],o="",l=!1){let i=(d,m,h=l,p)=>{let y={relativePath:p===void 0?d.path||"":p,caseSensitive:d.caseSensitive===!0,childrenIndex:m,route:d};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(o)&&h)return;ft(y.relativePath.startsWith(o),`Absolute route path "${y.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(o.length)}let v=Fn([o,y.relativePath]),x=a.concat(y);d.children&&d.children.length>0&&(ft(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),Jx(d.children,n,x,v,h)),!(d.path==null&&!d.index)&&n.push({path:v,score:e3(v,d.index),routesMeta:x})};return e.forEach((d,m)=>{var h;if(d.path===""||!((h=d.path)!=null&&h.includes("?")))i(d,m);else for(let p of e0(d.path))i(d,m,!0,p)}),n}function e0(e){let n=e.split("/");if(n.length===0)return[];let[a,...o]=n,l=a.endsWith("?"),i=a.replace(/\?$/,"");if(o.length===0)return l?[i,""]:[i];let d=e0(o.join("/")),m=[];return m.push(...d.map(h=>h===""?i:[i,h].join("/"))),l&&m.push(...d),m.map(h=>e.startsWith("/")&&h===""?"/":h)}function WN(e){e.sort((n,a)=>n.score!==a.score?a.score-n.score:t3(n.routesMeta.map(o=>o.childrenIndex),a.routesMeta.map(o=>o.childrenIndex)))}var qN=/^:[\w-]+$/,KN=3,XN=2,ZN=1,QN=10,JN=-2,k1=e=>e==="*";function e3(e,n){let a=e.split("/"),o=a.length;return a.some(k1)&&(o+=JN),n&&(o+=XN),a.filter(l=>!k1(l)).reduce((l,i)=>l+(qN.test(i)?KN:i===""?ZN:QN),o)}function t3(e,n){return e.length===n.length&&e.slice(0,-1).every((o,l)=>o===n[l])?e[e.length-1]-n[n.length-1]:0}function n3(e,n,a=!1){let{routesMeta:o}=e,l={},i="/",d=[];for(let m=0;m<o.length;++m){let h=o[m],p=m===o.length-1,y=i==="/"?n:n.slice(i.length)||"/",v=au({path:h.relativePath,caseSensit
Line truncated
|
||||
|
||||
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let y=Sn(),v;if(n){let E=typeof n=="string"?ws(n):n;ft(h==="/"||((N=E.pathname)==null?void 0:N.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${E.pathname}" was given in the \`location\` prop.`),v=E}else v=y;let x=v.pathname||"/",S=x;if(h!=="/"){let E=h.replace(/^\//,"").split("/");S="/"+x.replace(/^\//,"").split("/").slice(E.length).join("/")}let j=a&&a.state.matches.length?a.state.matches.map(E=>Object.assign(E,{route:a.manifest[E.route.id]||E.route})):Qx(e,{pathname:S});Pn(p||j!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Pn(j==null||j[j.length-1].route.element!==void 0||j[j.length-1].route.Component!==void 0||j[j.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let C=_3(j&&j.map(E=>Object.assign({},E,{params:Object.assign({},d,E.params),pathname:Fn([h,o.encodeLocation?o.encodeLocation(E.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?h:Fn([h,o.encodeLocation?o.encodeLocation(E.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),l,a);return n&&C?f.createElement(Zl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...v},navigationType:"POP"}},C):C}function k3(){let e=z3(),n=f3(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:o},i={padding:"2px 4px",backgroundColor:o},d=null;return console.error("Error handled by React Router default ErrorBoundary:",e),d=f.createElement(f.Fragment,null,f.createElement("p",null,"💿 Hey developer 👋"),f.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",f.createElement("code",{style:i},"ErrorBoundary")," or"," ",f.createElement("code",{style:i},"errorElement")," prop on your route.")),f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},n),a?f.createElement("pre",{style:l},a):null,d)}var T3=f.createElement(k3,null),d0=class extends f.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const a=S3(e.digest);a&&(e=a)}let n=e!==void 0?f.createElement(qn.Provider,{value:this.props.routeContext},f.createElement(ah.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?f.createElement(R3,{error:e},n):n}};d0.contextType=o0;var zm=new WeakMap;function R3({children:e,error:n}){let{basename:a}=f.useContext(xn);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let o=x3(n.digest);if(o){let l=zm.get(n);if(l)throw l;let i=r0(o.location,a);if(n0&&!zm.get(n))if(i.isExternal||o.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:o.replace}));throw zm.set(n,d),d}return f.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function A3({routeContext:e,match:n,children:a}){let o=f.useContext(Cs);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(qn.Provider,{value:e},a)}function _3(e,n=[],a){let o=a==null?void 0:a.state;if(e==null){if(!o)return null;if(o.errors)e=o.matches;else if(n.length===0&&!o.initialized&&o.matches.length>0)e=o.matches;else return null}let l=e,i=o==null?void 0:o.errors;if(i!=null){let y=l.findIndex(v=>v.route.id&&(i==null?void 0:i[v.route.id])!==void 0);ft(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),l=l.slice(0,Math.min(l.length,y+1))}let d=!1,m=-1;if(a&&o){d=o.renderFallback;for(let y=0;y<l.length;y++){let v=l[y];if((v.route.HyLine truncated
|
||||
.`.concat(c6,` {
|
||||
overflow: hidden `).concat(o,`;
|
||||
padding-right: `).concat(m,"px ").concat(o,`;
|
||||
}
|
||||
body[`).concat(us,`] {
|
||||
overflow: hidden `).concat(o,`;
|
||||
overscroll-behavior: contain;
|
||||
`).concat([n&&"position: relative ".concat(o,";"),a==="margin"&&`
|
||||
padding-left: `.concat(l,`px;
|
||||
padding-top: `).concat(i,`px;
|
||||
padding-right: `).concat(d,`px;
|
||||
margin-left:0;
|
||||
margin-top:0;
|
||||
margin-right: `).concat(m,"px ").concat(o,`;
|
||||
`),a==="padding"&&"padding-right: ".concat(m,"px ").concat(o,";")].filter(Boolean).join(""),`
|
||||
}
|
||||
|
||||
.`).concat(Qc,` {
|
||||
right: `).concat(m,"px ").concat(o,`;
|
||||
}
|
||||
|
||||
.`).concat(Jc,` {
|
||||
margin-right: `).concat(m,"px ").concat(o,`;
|
||||
}
|
||||
|
||||
.`).concat(Qc," .").concat(Qc,` {
|
||||
right: 0 `).concat(o,`;
|
||||
}
|
||||
|
||||
.`).concat(Jc," .").concat(Jc,` {
|
||||
margin-right: 0 `).concat(o,`;
|
||||
}
|
||||
|
||||
body[`).concat(us,`] {
|
||||
`).concat(u6,": ").concat(m,`px;
|
||||
}
|
||||
`)},cx=function(){var e=parseInt(document.body.getAttribute(us)||"0",10);return isFinite(e)?e:0},R6=function(){f.useEffect(function(){return document.body.setAttribute(us,(cx()+1).toString()),function(){var e=cx()-1;e<=0?document.body.removeAttribute(us):document.body.setAttribute(us,e.toString())}},[])},A6=function(e){var n=e.noRelative,a=e.noImportant,o=e.gapMode,l=o===void 0?"margin":o;R6();var i=f.useMemo(function(){return N6(l)},[l]);return f.createElement(k6,{styles:T6(i,!n,l,a?"":"!important")})},Ep=!1;if(typeof window<"u")try{var Uc=Object.defineProperty({},"passive",{get:function(){return Ep=!0,!0}});window.addEventListener("test",Uc,Uc),window.removeEventListener("test",Uc,Uc)}catch{Ep=!1}var es=Ep?{passive:!1}:!1,_6=function(e){return e.tagName==="TEXTAREA"},P2=function(e,n){if(!(e instanceof Element))return!1;var a=window.getComputedStyle(e);return a[n]!=="hidden"&&!(a.overflowY===a.overflowX&&!_6(e)&&a[n]==="visible")},M6=function(e){return P2(e,"overflowY")},O6=function(e){return P2(e,"overflowX")},ux=function(e,n){var a=n.ownerDocument,o=n;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var l=B2(e,o);if(l){var i=$2(e,o),d=i[1],m=i[2];if(d>m)return!0}o=o.parentNode}while(o&&o!==a.body);return!1},D6=function(e){var n=e.scrollTop,a=e.scrollHeight,o=e.clientHeight;return[n,a,o]},L6=function(e){var n=e.scrollLeft,a=e.scrollWidth,o=e.clientWidth;return[n,a,o]},B2=function(e,n){return e==="v"?M6(n):O6(n)},$2=function(e,n){return e==="v"?D6(n):L6(n)},z6=function(e,n){return e==="h"&&n==="rtl"?-1:1},P6=function(e,n,a,o,l){var i=z6(e,window.getComputedStyle(n).direction),d=i*o,m=a.target,h=n.contains(m),p=!1,y=d>0,v=0,x=0;do{if(!m)break;var S=$2(e,m),j=S[0],C=S[1],N=S[2],E=C-N-i*j;(j||E)&&B2(e,m)&&(v+=E,x+=j);var k=m.parentNode;m=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!h&&m!==document.body||h&&(n.contains(m)||n===m));return(y&&Math.abs(v)<1||!y&&Math.abs(x)<1)&&(p=!0),p},Hc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},dx=function(e){return[e.deltaX,e.deltaY]},fx=function(e){return e&&"current"in e?e.current:e},B6=function(e,n){return e[0]===n[0]&&e[1]===n[1]},$6=function(e){return`
|
||||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||||
`)},I6=0,ts=[];function U6(e){var n=f.useRef([]),a=f.useRef([0,0]),o=f.useRef(),l=f.useState(I6++)[0],i=f.useState(z2)[0],d=f.useRef(e);f.useEffect(function(){d.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var C=i6([e.lockRef.current],(e.shards||[]).map(fx),!0).filter(Boolean);return C.forEach(function(N){return N.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),C.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var m=f.useCallback(function(C,N){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!d.current.allowPinchZoom;var E=Hc(C),k=a.current,A="deltaX"in C?C.deltaX:k[0]-E[0],R="deltaY"in C?C.deltaY:k[1]-E[1],L,z=C.target,B=Math.abs(A)>Math.abs(R)?"h":"v";if("touches"in C&&B==="h"&&z.type==="range")return!1;var U=window.getSelection(),q=U&&U.anchorNode,Z=q?q===z||q.contains(z):!1;if(Z)return!1;var Q=ux(B,z);if(!Q)return!0;if(Q?L=B:(L=B==="v"?"h":"v",Q=ux(B,z)),!Q)return!1;if(!o.current&&"changedTouches"in C&&(A||R)&&(o.current=L),!L)return!0;var fe=o.current||L;return P6(fe,N,C,fe==="h"?A:R)},[]),h=f.useCallback(function(C){var N=C;if(!(!ts.length||ts[ts.length-1]!==i)){var E="deltaY"in N?dx(N):Hc(N),k=n.current.filter(function(L){return L.name===N.type&&(L.target===N.target||N.target===L.shadowParent)&&B6(L.delta,E)})[0];if(k&&k.should){N.cancelable&&N.preventDefault();return}if(!k){var A=(d.current.shards||[]).map(fx).filter(Boolean).filter(function(L){return L.contains(N.target)}),R=A.length>0?m(N,A[0]):!d.current.noIsolation;R&&N.cancelable&&N.preventDefault()}}},[]),p=f.useCallback(function(C,N,E,k){var A={name:C,delta:N,target:E,should:k,shadowParent:H6(E)};n.current.push(A),setTimeout(function(){n.current=n.current.filter(function(R){return R!==A})},1)},[]),y=f.useCallback(function(C){a.current=Hc(C),o.current=void 0},[]),v=f.useCallback(function(C){p(C.type,dx(C),C.target,m(C,e.lockRef.current))},[]),x=f.useCallback(function(C){p(C.type,Hc(C),C.target,m(C,e.lockRef.current))},[]);f.useEffect(function(){return ts.push(i),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:x}),document.addEventListener("wheel",h,es),document.addEventListener("touchmove",h,es),document.addEventListener("touchstart",y,es),function(){ts=ts.filter(function(C){return C!==i}),document.removeEventListener("wheel",h,es),document.removeEventListener("touchmove",h,es),document.removeEventListener("touchstart",y,es)}},[]);var S=e.removeScrollBar,j=e.inert;return f.createElement(f.Fragment,null,j?f.createElement(i,{styles:$6(l)}):null,S?f.createElement(A6,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function H6(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const V6=v6(L2,U6);var si=f.forwardRef(function(e,n){return f.createElement(Fu,or({},e,{ref:n,sideCar:V6}))});si.classNames=Fu.classNames;var Np=["Enter"," "],G6=["ArrowDown","PageUp","Home"],I2=["ArrowUp","PageDown","End"],F6=[...G6,...I2],Y6={ltr:[...Np,"ArrowRight"],rtl:[...Np,"ArrowLeft"]},W6={ltr:["ArrowLeft"],rtl:["ArrowRight"]},li="Menu",[Gl,q6,K6]=jh(li),[io,U2]=u8(li,[K6,ba,Vu]),Yu=ba(),H2=Vu(),[X6,co]=io(li),[Z6,ii]=io(li),V2=e=>{const{__scopeMenu:n,open:a=!1,children:o,dir:l,onOpenChange:i,modal:d=!0}=e,m=Yu(n),[h,p]=f.useState(null),y=f.useRef(!1),v=Ot(i),x=ei(l);return f.useEffect(()=>{const S=()=>{y.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>y.current=!1;return document.addEventListener("keydown",S,{capture:!0}),()=>{document.removeEventListener("keydown",S,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),c.jsx(Iu,{...m,children:c.jsx(X6,{scope:n,open:a,onOpenChange:v,content:h,onContentChange:p,children:c.jsx(Z6,{scope:n,onClose:f.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:y,dir:x,modal:d,children:o})})})};V2.displayName=li;var Q6="MenuAnchor",Oh=f.forwardRef((e,n)=>{const{__scopeMenu:a,...o}=e,l=Yu(a);return c.jsx(ri,{...l,...o,ref:n})});Oh.displayName=Q6;var Dh="MenuPortal",[J6,G2]=io(Dh,{forceMount:void 0}),F2=e=>{const{__scopeMenu:n,forceMount:a,children:o,container:l}=e,i=co(Dh,n);return c.jsx(J6,{scope:n,forceMount:a,children:c.jsx(Ut,{present:a||i.open,children:c.jsx(As,{asChild:!0,container:l,children:o})})})};F2.displayName=Dh;var zn="MenuContent",[eR,Lh]=io(zn),Y2=f.forwardRef((e,n)=>{const a=G2(zn,e.__scopeMenu),{forceMount:o=a.forceMount,...l}=e,i=co(zn,e.__scopeMenu),d=ii(zn,e.__scopeMenu);return c.jsx(Gl.Provider,{scope:e.__scopeMenu,children:c.jsx(Ut,{present:o||i.open,children:c.jsx(Gl.Slot,{scope:e.__scopeMenu,children:d.modal?c.jsx(tR,{...l,ref:n}):c.jsx(nR,{...l,ref:n})})})})}),tR=f.forwardRef((e,n)=>{const a=co(zn,e.__scopeMenu),o=f.useRe
Line truncated
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const OS=(...e)=>e.filter((n,a,o)=>!!n&&n.trim()!==""&&o.indexOf(n)===a).join(" ").trim();/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const JR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const eA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,a,o)=>o?o.toUpperCase():a.toLowerCase());/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const px=e=>{const n=eA(e);return n.charAt(0).toUpperCase()+n.slice(1)};/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/var Qm={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const tA=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},nA=f.createContext({}),rA=()=>f.useContext(nA),aA=f.forwardRef(({color:e,size:n,strokeWidth:a,absoluteStrokeWidth:o,className:l="",children:i,iconNode:d,...m},h)=>{const{size:p=24,strokeWidth:y=2,absoluteStrokeWidth:v=!1,color:x="currentColor",className:S=""}=rA()??{},j=o??v?Number(a??y)*24/Number(n??p):a??y;return f.createElement("svg",{ref:h,...Qm,width:n??p??Qm.width,height:n??p??Qm.height,stroke:e??x,strokeWidth:j,className:OS("lucide",S,l),...!i&&!tA(m)&&{"aria-hidden":"true"},...m},[...d.map(([C,N])=>f.createElement(C,N)),...Array.isArray(i)?i:[i]])});/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const ya=(e,n)=>{const a=f.forwardRef(({className:o,...l},i)=>f.createElement(aA,{ref:i,iconNode:n,className:OS(`lucide-${JR(px(e))}`,`lucide-${e}`,o),...l}));return a.displayName=px(e),a};/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const oA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],DS=ya("check",oA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const sA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],LS=ya("chevron-down",sA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const lA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],iA=ya("chevron-right",lA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const cA=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],uA=ya("chevron-up",cA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const dA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],fA=ya("circle",dA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const mA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],pA=ya("panel-left",mA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const hA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],gA=ya("search",hA);/**
|
||||
* @license lucide-react v1.16.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const vA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],zS=ya("x",vA),Ih=XR,Uh=ZR,bA=f.forwardRef(({className:e,inset:n,children:a,...o},l)=>c.jsxs(_S,{ref:l,className:ie("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...o,children:[a,c.jsx(iA,{className:"ml-auto"})]}));bA.displayName=_S.displayName;const yA=f.forwardRef(({className:e,...n},a)=>c.jsx(MS,{ref:a,className:ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...n}));yA.displayName=MS.displayName;const Ku=f.forwardRef(({className:e,sideOffset:n=4,...a},o)=>c.jsx(QR,{children:c.jsx(jS,{ref:o,sideOffset:n,className:ie("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...a})}));Ku.displayName=jS.displayName;const Yl=f.forwardRef(({className:e,inset:n,...a},o)=>c.jsx(NS,{ref:o,className:ie("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",n&&"pl-8",e),...a}));Yl.displayName=NS.displayName;const xA=f.forwardRef(({className:e,children:n,checked:a,...o},l)=>c.jsxs(kS,{ref:l,className:ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...o,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(RS,{children:c.jsx(DS,{className:"h-4 w-4"})})}),n]}));xA.displayName=kS.displayName;const SA=f.forwardRef(({className:e,children:n,...a},o)=>c.jsxs(TS,{ref:o,className:ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(RS,{children:c.jsx(fA,{className:"h-2 w-2 fill-current"})})}),n]}));SA.displayName=TS.displayName;const Hh=f.forwardRef(({className:e,inset:n,...a},o)=>c.jsx(ES,{ref:o,className:ie("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...a}));Hh.displayName=ES.displayName;const hu=f.forwardRef(({className:e,...n},a)=>c.jsx(AS,{ref:a,className:ie("-mx-1 my-1 h-px bg-muted",e),...n}));hu.displayName=AS.displayName;const Jm=768;function wA(){const[e,n]=f.useState(void 0);return f.useEffect(()=>{const a=window.matchMedia(`(max-width: ${Jm-1}px)`),o=()=>{n(window.innerWidth<Jm)};return a.addEventListener("change",o),n(window.innerWidth<Jm),()=>a.removeEventListener("change",o)},[]),!!e}const rt=f.forwardRef(({className:e,type:n,...a},o)=>c.jsx("input",{type:n,className:ie("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...a}));rt.displayName="Input";var CA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wn=CA.reduce((e,n)=>{const a=K0(`Primitive.${n}`),o=f.forwardRef((l,i)=>{const{asChild:d,...m}=l,h=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(h,{...m,ref:i})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{}),jA="Separator",hx="horizontal",EA=["horizontal","vertical"],PS=f.forwardRef((e,n)=>{const{decorative:a,orientation:o=hx,...l}=e,i=NA(o)?o:hx,m=a?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};returnLine truncated
|
||||
|
||||
If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||||
|
||||
For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(a))},[a,e]),null},GA="DialogDescriptionWarning",FA=({contentRef:e,descriptionId:n})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${tw(GA).contentName}}.`;return f.useEffect(()=>{var i;const l=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");n&&l&&(document.getElementById(n)||console.warn(o))},[o,e,n]),null},Yh=HS,Wh=FS,ui=YS,di=WS,Zu=KS,Qu=ZS,nw=JS;const YA=Yh,WA=Wh,rw=f.forwardRef(({className:e,...n},a)=>c.jsx(ui,{className:ie("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n,ref:a}));rw.displayName=ui.displayName;const qA=Ns("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),aw=f.forwardRef(({side:e="right",className:n,children:a,...o},l)=>c.jsxs(WA,{children:[c.jsx(rw,{}),c.jsxs(di,{ref:l,className:ie(qA({side:e}),n),...o,children:[c.jsxs(nw,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[c.jsx(zS,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]}),a]})]}));aw.displayName=di.displayName;const ow=({className:e,...n})=>c.jsx("div",{className:ie("flex flex-col space-y-2 text-center sm:text-left",e),...n});ow.displayName="SheetHeader";const sw=f.forwardRef(({className:e,...n},a)=>c.jsx(Zu,{ref:a,className:ie("text-lg font-semibold text-foreground",e),...n}));sw.displayName=Zu.displayName;const lw=f.forwardRef(({className:e,...n},a)=>c.jsx(Qu,{ref:a,className:ie("text-sm text-muted-foreground",e),...n}));lw.displayName=Qu.displayName;function Fe({className:e,...n}){return c.jsx("div",{className:ie("animate-pulse rounded-md bg-primary/10",e),...n})}function KA(e,n=[]){let a=[];function o(i,d){const m=f.createContext(d),h=a.length;a=[...a,d];const p=v=>{var E;const{scope:x,children:S,...j}=v,C=((E=x==null?void 0:x[e])==null?void 0:E[h])||m,N=f.useMemo(()=>j,Object.values(j));return c.jsx(C.Provider,{value:N,children:S})};p.displayName=i+"Provider";function y(v,x){var C;const S=((C=x==null?void 0:x[e])==null?void 0:C[h])||m,j=f.useContext(S);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${v}\` must be used within \`${i}\``)}return[p,y]}const l=()=>{const i=a.map(d=>f.createContext(d));return function(m){const h=(m==null?void 0:m[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...m,[e]:h}}),[m,h])}};return l.scopeName=e,[o,XA(l,...n)]}function XA(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const o=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(i){const d=o.reduce((m,{useScope:h,scopeName:p})=>{const v=h(i)[`__scope${p}`];return{...m,...v}},{});return f.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return a.scopeName=n.scopeName,a}function ZA(e){const n=QA(e),a=f.forwardRef((o,l)=>{const{children:i,...d}=o,m=f.Children.toArray(i),h=m.find(e_);if(h){const p=h.props.children,y=m.map(v=>v===h?f.Children.count(p)>1?f.Children.only(null):f.isValidElement(p)?p.props.children:null:v);return c.jsx(n,{...d,ref:l,children:f.isValidElement(p)?f.cloneElement(p,void 0,y):null})}return c.jsx(n,{...d,ref:l,children:i})});return a.displayName=`${e}.Slot`,a}function QA(e){const n=f.forwardRef((a,o)=>{const{children:l,...i}=a;if(f.isValidElement(l)){const d=n_(l),m=t_(i,l.props);return l.type!==f.Fragment&&(m.ref=o?st(o,d):d),f.cloneElement(l,m)}return f.Children.count(l)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var iw=Symbol("radix.slottable");function JA(e){const n=({children:a})=>c.jsx(c.Fragment,{children:a});return n.displayName=`${e}.Slottable`,n.__radixId=iw,n}function e_(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===iw}function t_(e,n){const a={...n};for(const o in n){const l=e[o],i=n[o];/^on[A-Z]/.test(o)?l&&i?a[o]=(...m)=>{const h=i(...m);return l(...m),h}:l&&(a[o]=l):o==="style"?a[o]={...l,...i}:o==="className"&&(a[o]=[l,i].filter(Boolean).join(" "))}return{...e,...a}}funct
Line truncated
|
||||
* @license React
|
||||
* use-sync-external-store-shim.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var xx;function rM(){if(xx)return ap;xx=1;var e=Cu();function n(v,x){return v===x&&(v!==0||1/v===1/x)||v!==v&&x!==x}var a=typeof Object.is=="function"?Object.is:n,o=e.useState,l=e.useEffect,i=e.useLayoutEffect,d=e.useDebugValue;function m(v,x){var S=x(),j=o({inst:{value:S,getSnapshot:x}}),C=j[0].inst,N=j[1];return i(function(){C.value=S,C.getSnapshot=x,h(C)&&N({inst:C})},[v,S,x]),l(function(){return h(C)&&N({inst:C}),v(function(){h(C)&&N({inst:C})})},[v]),d(S),S}function h(v){var x=v.getSnapshot;v=v.value;try{var S=x();return!a(v,S)}catch{return!0}}function p(v,x){return x()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:m;return ap.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,ap}var Sx;function aM(){return Sx||(Sx=1,rp.exports=rM()),rp.exports}var oM=aM();function sM(){return oM.useSyncExternalStore(lM,()=>!0,()=>!1)}function lM(){return()=>{}}var tg="Avatar",[iM]=tM(tg),[cM,Ww]=iM(tg),qw=f.forwardRef((e,n)=>{const{__scopeAvatar:a,...o}=e,[l,i]=f.useState("idle");return c.jsx(cM,{scope:a,imageLoadingStatus:l,onImageLoadingStatusChange:i,children:c.jsx(wn.span,{...o,ref:n})})});qw.displayName=tg;var Kw="AvatarImage",Xw=f.forwardRef((e,n)=>{const{__scopeAvatar:a,src:o,onLoadingStatusChange:l=()=>{},...i}=e,d=Ww(Kw,a),m=uM(o,i),h=Ot(p=>{l(p),d.onImageLoadingStatusChange(p)});return Ct(()=>{m!=="idle"&&h(m)},[m,h]),m==="loaded"?c.jsx(wn.img,{...i,ref:n,src:o}):null});Xw.displayName=Kw;var Zw="AvatarFallback",Qw=f.forwardRef((e,n)=>{const{__scopeAvatar:a,delayMs:o,...l}=e,i=Ww(Zw,a),[d,m]=f.useState(o===void 0);return f.useEffect(()=>{if(o!==void 0){const h=window.setTimeout(()=>m(!0),o);return()=>window.clearTimeout(h)}},[o]),d&&i.imageLoadingStatus!=="loaded"?c.jsx(wn.span,{...l,ref:n}):null});Qw.displayName=Zw;function wx(e,n){return e?n?(e.src!==n&&(e.src=n),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function uM(e,{referrerPolicy:n,crossOrigin:a}){const o=sM(),l=f.useRef(null),i=o?(l.current||(l.current=new window.Image),l.current):null,[d,m]=f.useState(()=>wx(i,e));return Ct(()=>{m(wx(i,e))},[i,e]),Ct(()=>{const h=v=>()=>{m(v)};if(!i)return;const p=h("loaded"),y=h("error");return i.addEventListener("load",p),i.addEventListener("error",y),n&&(i.referrerPolicy=n),typeof a=="string"&&(i.crossOrigin=a),()=>{i.removeEventListener("load",p),i.removeEventListener("error",y)}},[i,a,n]),d}var Jw=qw,eC=Xw,tC=Qw;const gs=f.forwardRef(({className:e,...n},a)=>c.jsx(Jw,{ref:a,className:ie("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...n}));gs.displayName=Jw.displayName;const vs=f.forwardRef(({className:e,...n},a)=>c.jsx(eC,{ref:a,className:ie("aspect-square h-full w-full",e),...n}));vs.displayName=eC.displayName;const bs=f.forwardRef(({className:e,...n},a)=>c.jsx(tC,{ref:a,className:ie("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...n}));bs.displayName=tC.displayName;const nC=f.createContext(null);function dM({children:e}){const[n,a]=f.useState([]),[o,l]=f.useState(0),[i,d]=f.useState(!0),m=f.useCallback(async()=>{try{const v=await ke.getNotifications();v.data&&(a(v.data.items),l(v.data.unreadCount))}catch{}finally{d(!1)}},[]),h=f.useCallback(async()=>{var v;try{const x=await ke.markNotificationsRead("all");a(S=>S.map(j=>({...j,read:!0}))),l(((v=x.data)==null?void 0:v.unreadCount)??0)}catch{}},[]),p=f.useCallback(async v=>{var x;try{const S=await ke.dismissNotification(v);a(j=>j.filter(C=>C.id!==v)),l(((x=S.data)==null?void 0:x.unreadCount)??0)}catch{}},[]);f.useEffect(()=>{m();const v=setInterval(m,3e4);return()=>clearInterval(v)},[m]);const y=f.useMemo(()=>({items:n,unreadCount:o,loading:i,refresh:m,markAllRead:h,dismiss:p}),[n,o,i,m,h,p]);return c.jsx(nC.Provider,{value:y,children:e})}function fM(){const e=f.useContext(nC);if(!e)throw new Error("useNotifications must be used within NotificationsProvider");return e}const mM=Ns("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ll({className:e,variant:n,...a}){return c.jsx("div",{className:ie(mM({variant:n}),e),...a})}function pM(e){const n=hM(e),a=f.forwardRef((o,l)=>{const{children:i,...d}=o,m=f.Children.toArray(i),h=m.find(vM);if(h){const p=h.props.children,y=m.map(v=>v===h?f.Children.count(p)>1?f.Children.only(null):f.isValidElement(p)?p.props.children:null:v);return c.jsx(n,{...d,ref:l,children:f.isValidElement(p)?f.cloneElement(p,void 0,y):null})}return c.jsx(n,{...d,ref:l,children:i})});return a.displayName=`${e}.SLine truncated
|
||||
--num-groups: ${i.groups.length};
|
||||
--indicator-opacity: ${i.searchMode?0:1};
|
||||
--num-skintones: ${Mx};`}),d(()=>{i.customEmoji&&i.database&&B()}),d(()=>{i.customEmoji&&i.customEmoji.length?i.groups!==Zp&&(i.groups=Zp):i.groups!==lp&&(i.currentGroupIndex&&i.currentGroupIndex--,i.groups=lp)}),d(()=>{async function G(){i.databaseLoaded&&(i.currentSkinTone=await i.database.getPreferredSkinTone())}G()}),d(()=>{i.skinTones=Array(Mx).fill().map((G,se)=>rz(i.skinToneEmoji,se))}),d(()=>{i.skinToneButtonText=i.skinTones[i.currentSkinTone]}),d(()=>{i.skinToneButtonLabel=i.i18n.skinToneLabel.replace("{skinTone}",i.i18n.skinTones[i.currentSkinTone])}),d(()=>{async function G(){const{database:se}=i,ge=(await Promise.all(WL.map(je=>se.getEmojiByUnicodeOrName(je)))).filter(Boolean);i.defaultFavoriteEmojis=ge}i.databaseLoaded&&G()});function B(){const{customEmoji:G,database:se}=i,ge=G||mp;se.customEmoji!==ge&&(se.customEmoji=ge)}d(()=>{async function G(){B();const{database:se,defaultFavoriteEmojis:ge,numColumns:je}=i,Ae=await se.getTopFavoriteEmoji(je),Qe=await ce(c5([...Ae,...ge],ct=>ct.unicode||ct.name).slice(0,je));i.currentFavorites=Qe}i.databaseLoaded&&i.defaultFavoriteEmojis&&G()});function U(G){sz(G,l,()=>{{const se=getComputedStyle(a.rootElement),ge=parseInt(se.getPropertyValue("--num-columns"),10),je=se.getPropertyValue("direction")==="rtl";i.numColumns=ge,i.isRtl=je}})}function q(G){Nz(G,l,se=>{for(const{target:ge,isIntersecting:je}of se)ge.classList.toggle("onscreen",je)})}d(()=>{async function G(){const{searchText:se,currentGroup:ge,databaseLoaded:je,customEmoji:Ae}=i;if(!je)i.currentEmojis=[],i.searchMode=!1;else if(se.length>=HL){const Qe=await M(se);i.searchText===se&&(S(Qe),j(!0))}else{const{id:Qe}=ge;if(Qe!==-1||Ae&&Ae.length){const ct=await he(Qe);i.currentGroup.id===Qe&&(S(ct),j(!1))}}}G()});const Z=()=>{tu(()=>uz(a.tabpanelElement))};d(()=>{const{currentEmojis:G,emojiVersion:se}=i,ge=G.filter(je=>je.unicode).filter(je=>Ox(je)&&!Qp.has(je.unicode));if(!se&&ge.length)S(G),tu(()=>Q(ge));else{const je=se?G:G.filter(fe);S(je),Z()}});function Q(G){iz(G,a.baselineEmoji,p)?Z():i.currentEmojis=[...i.currentEmojis]}function fe(G){return!G.unicode||!Ox(G)||Qp.get(G.unicode)}async function de(G){const se=i.emojiVersion||await cp();return G.filter(({version:ge})=>!ge||ge<=se)}async function ce(G){return az(G,i.emojiVersion||await cp())}async function he(G){const se=G===-1?i.customEmoji:await i.database.getEmojiByGroup(G);return ce(await de(se))}async function M(G){return ce(await de(await i.database.getEmojiBySearchQuery(G)))}d(()=>{}),d(()=>{function G(){const{searchMode:ge,currentEmojis:je}=i;if(ge)return[{category:"",emojis:je}];const Ae=new Map;for(const Qe of je){const ct=Qe.category||"";let Tt=Ae.get(ct);Tt||(Tt=[],Ae.set(ct,Tt)),Tt.push(Qe)}return[...Ae.entries()].map(([Qe,ct])=>({category:Qe,emojis:ct})).sort((Qe,ct)=>i.customCategorySorting(Qe.category,ct.category))}const se=G();C(se)}),d(()=>{i.activeSearchItemId=i.activeSearchItem!==-1&&i.currentEmojis[i.activeSearchItem].id}),d(()=>{const{rawSearchText:G}=i;l5(()=>{i.searchText=(G||"").trim(),i.activeSearchItem=-1})});function K(G){if(!i.searchMode||!i.currentEmojis.length)return;const se=ge=>{rr(G),i.activeSearchItem=up(ge,i.activeSearchItem,i.currentEmojis)};switch(G.key){case"ArrowDown":return se(!1);case"ArrowUp":return se(!0);case"Enter":if(i.activeSearchItem===-1)i.activeSearchItem=0;else return rr(G),_(i.currentEmojis[i.activeSearchItem].id)}}function re(G){const{target:se}=G,ge=se.closest(".nav-button");if(!ge)return;const je=parseInt(ge.dataset.groupId,10);a.searchElement.value="",i.rawSearchText="",i.searchText="",i.activeSearchItem=-1,i.currentGroupIndex=i.groups.findIndex(Ae=>Ae.id===je)}function oe(G){const{target:se,key:ge}=G,je=Ae=>{Ae&&(rr(G),Ae.focus())};switch(ge){case"ArrowLeft":return je(se.previousElementSibling);case"ArrowRight":return je(se.nextElementSibling);case"Home":return je(se.parentElement.firstElementChild);case"End":return je(se.parentElement.lastElementChild)}}async function ee(G){const se=await i.database.getEmojiByUnicodeOrName(G),ge=[...i.currentEmojis,...i.currentFavorites].find(Ae=>Ae.id===G),je=ge.unicode&&N(ge,i.currentSkinTone);return await i.database.incrementFavoriteEmojiCount(G),{emoji:se,skinTone:i.currentSkinTone,...je&&{unicode:je},...ge.name&&{name:ge.name}}}async function _(G){const se=ee(G);y("emoji-click-sync",se),y("emoji-click",await se)}function O(G){const{target:se}=G;if(!se.classList.contains("emoji"))return;rr(G);const ge=se.id.substring(4);_(ge)}function H(G){i.currentSkinTone=G,i.skinTonePickerExpanded=!1,h("skintone-button"),y("skin-tone-change",{skinTone:G}),i.database.setPreferredSkinTone(G)}function I(G){const{target:{id:se}}=G,ge=se&&se.match(/^skintone-(\d)/);if(!ge)return;rr(G);const je=parseInt(ge[1],10);H(je)}function V(G){i.skinTonePickerExpanded=!i.skinTonePickerExpanded,i.activeSkinTone=i.currentSkinTone,i.skinTonePickerExpanded&&(rr(G),tu(()=>h("skintone-list")))}d(()=>{i.skinTonePickerExpanded?a.skinToneDropdown.addEventListener("transitionend",()=>{i.s
Line truncated
|
||||
987654321098765432`,className:"min-h-[120px] font-mono text-sm"})]}),c.jsx(yi,{result:a.owners}),c.jsx("div",{className:"mt-auto",children:c.jsx(be,{type:"button",variant:"secondary",disabled:o||!e.ownerUserIds.trim(),onClick:l,children:o?"Checking with Discord…":"Verify owner IDs"})})]})}function BP({onContinue:e}){return c.jsx("div",{className:"mx-auto flex w-full max-w-lg flex-1 flex-col justify-center py-8",children:c.jsxs("div",{className:"rounded-2xl border border-border bg-card px-6 py-10 text-center md:px-10",children:[c.jsx("div",{className:"mx-auto mb-6 flex size-16 items-center justify-center rounded-2xl bg-primary/10 text-primary",children:c.jsx(ye,{icon:Tu,size:40})}),c.jsx("h2",{className:"text-2xl font-semibold tracking-tight",children:"Setup complete"}),c.jsxs("p",{className:"mx-auto mt-3 max-w-sm text-sm leading-relaxed text-muted-foreground",children:["Your configuration has been saved. Restart the server for changes to take effect — stop the running process, then start it again (for example"," ",c.jsx("code",{className:"rounded-md bg-muted px-1.5 py-0.5 font-mono text-xs",children:"npm start"}),")."]}),c.jsx(Ue,{className:"mt-6 text-left",children:c.jsx(He,{children:"After restarting, sign in with Discord to open the dashboard."})}),c.jsx(be,{type:"button",size:"lg",className:"mt-8 min-w-[220px]",onClick:e,children:"Continue to sign in"})]})})}function $P({currentIndex:e,validating:n,saving:a,onBack:o,onNext:l,onFinish:i}){const d=e===fs.length-1;return c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs(be,{type:"button",variant:"ghost",disabled:e===0||a,onClick:o,children:[c.jsx(ye,{icon:b0,size:18,className:"mr-1"}),"Back"]}),c.jsx("div",{className:"flex flex-1 justify-end gap-2",children:d?c.jsx(be,{type:"button",size:"lg",disabled:a||n,onClick:i,className:"min-w-[200px]",children:a?"Saving…":"Finish setup"}):c.jsxs(be,{type:"button",size:"lg",disabled:n||a,onClick:l,children:["Continue",c.jsx(ye,{icon:ph,size:18,className:"ml-1"})]})})]})}function IP(){const e=crypto.randomUUID().replace(/-/g,""),n=crypto.randomUUID().replace(/-/g,"");return e+n}function UP(e){return e.split(/[\s,]+/).map(n=>n.trim()).filter(Boolean)}function Fx(e){return e==="oauth"?"oauth":e==="owners"?"owners":e}function HP(){const e=oo(),{branding:n}=Ou(),{loading:a,error:o,refresh:l,status:i}=yC(),[d,m]=f.useState(0),[h,p]=f.useState({botToken:"",secretKey:"",clientId:"",clientSecret:"",redirectUri:"",ownerUserIds:""}),[y,v]=f.useState({}),[x,S]=f.useState(!1),[j,C]=f.useState(!1),[N,E]=f.useState(""),[k,A]=f.useState(!1),R=fs[d];f.useEffect(()=>{i!=null&&i.suggestedRedirectUri&&!h.redirectUri&&p(Q=>({...Q,redirectUri:i.suggestedRedirectUri}))},[i==null?void 0:i.suggestedRedirectUri,h.redirectUri]);const L=f.useMemo(()=>({botToken:h.botToken,secretKey:h.secretKey,clientId:h.clientId,clientSecret:h.clientSecret,redirectUri:h.redirectUri,ownerUserIds:UP(h.ownerUserIds)}),[h]);async function z(){S(!0),E("");try{const Q=await ke.validateSetup(L);return v(fe=>{var de;return{...fe,...(de=Q.data)==null?void 0:de.results}}),Q.data}catch(Q){return E(Q instanceof Error?Q.message:"Validation failed"),null}finally{S(!1)}}async function B(){var de,ce;const Q=Fx(R.id),fe=await z();return!!((ce=(de=fe==null?void 0:fe.results)==null?void 0:de[Q])!=null&&ce.ok)}async function U(){const Q=Fx(R.id),fe=y[Q];!(fe!=null&&fe.ok)&&!await B()||m(de=>Math.min(de+1,fs.length-1))}async function q(){C(!0),E("");try{const Q=await z();if(!(Q!=null&&Q.ok)){E("Fix the steps marked with errors before finishing.");return}await ke.completeSetup(L),A(!0)}catch(Q){E(Q instanceof Error?Q.message:"Could not save setup")}finally{C(!1)}}function Z(){const Q={values:h,setValues:p,validation:y,validating:x};switch(R.id){case"botToken":return c.jsx(OP,{...Q,onValidate:()=>void B()});case"secretKey":return c.jsx(DP,{...Q,onGenerate:()=>p(fe=>({...fe,secretKey:IP()})),onValidate:()=>void B()});case"oauth":return c.jsx(LP,{...Q,onValidate:()=>void B()});case"redirectUri":return c.jsx(zP,{values:h,setValues:p,validation:y});case"owners":return c.jsx(PP,{...Q,onValidate:()=>void B()})}}return a?c.jsx("div",{className:"min-h-svh bg-background px-4 py-10",children:c.jsxs("div",{className:"mx-auto max-w-6xl space-y-8",children:[c.jsx(Fe,{className:"h-14 w-64"}),c.jsxs("div",{className:"grid gap-8 lg:grid-cols-[280px_1fr]",children:[c.jsx(Fe,{className:"hidden h-80 lg:block"}),c.jsx(Fe,{className:"h-[520px] rounded-2xl"})]})]})}):c.jsxs(AP,{brandingTitle:n.title,faviconUrl:n.faviconUrl,faviconVersion:n.updatedAt,hasFavicon:n.hasFavicon,children:[o?c.jsx(Ue,{variant:"destructive",className:"mb-6",children:c.jsx(He,{children:o})}):null,N?c.jsx(Ue,{variant:"destructive",className:"mb-6",children:c.jsx(He,{children:N})}):null,k?c.jsx(BP,{onContinue:async()=>{await l(),e("/login",{replace:!0})}}):c.jsxs("div",{className:"grid flex-1 gap-8 lg:grid-cols-[minmax(0,280px)_1fr]",children:[c.jsx(_P,{currentIndex:d,validation:y})
Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Poppins,system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 240 10% 4%;--foreground: 0 0% 98%;--card: 240 7% 11%;--card-foreground: 0 0% 98%;--popover: 240 8% 10%;--popover-foreground: 0 0% 98%;--primary: 141 45% 49%;--primary-foreground: 0 0% 100%;--secondary: 240 6% 14%;--secondary-foreground: 0 0% 90%;--muted: 240 6% 14%;--muted-foreground: 240 5%Line truncated
|
||||
@@ -10,8 +10,8 @@
|
||||
href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<script type="module" crossorigin src="/assets/index-D6vuEh1I.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-C_d968Vp.css">
|
||||
<script type="module" crossorigin src="/assets/index-BOdhXLlb.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-DoxvJPsp.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>␍
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 81 KiB |
Reference in new issue
Block a user