From 4bbfa111d57c72dffdac872278e4ac4bc6c6603d Mon Sep 17 00:00:00 2001 From: askiiart Date: Wed, 17 Apr 2024 21:41:22 -0500 Subject: [PATCH] Add void support, misc other changes --- arch-sway.sh | 2 +- backup.sh | 1 + claws-mail/clawsrc | 20 +- claws-mail/matcherrc | 8 +- fish/conf.d/custom.fish | 6 +- fish/fish_variables | 50 +++- other-files/.xinitrc | 2 +- restore.sh | 1 + universal-shellrc.txt | 7 +- vesktop/settings/settings.json | 50 +++- vesktop/state.json | 4 +- vesktop/vencordDist/vencordDesktopMain.js | 22 -- .../vencordDesktopMain.js.LEGAL.txt | 24 -- vesktop/vencordDist/vencordDesktopMain.js.map | 7 - vesktop/vencordDist/vencordDesktopPreload.js | 7 - .../vencordDist/vencordDesktopPreload.js.map | 7 - .../vencordDist/vencordDesktopRenderer.css | 1 - .../vencordDesktopRenderer.css.map | 7 - vesktop/vencordDist/vencordDesktopRenderer.js | 225 ------------------ .../vencordDesktopRenderer.js.LEGAL.txt | 46 ---- .../vencordDist/vencordDesktopRenderer.js.map | 7 - void-sway.sh | 16 ++ vscode/extensions.txt | 2 + vscode/settings.json | 7 +- waybar/config | 2 +- 25 files changed, 136 insertions(+), 395 deletions(-) delete mode 100644 vesktop/vencordDist/vencordDesktopMain.js delete mode 100644 vesktop/vencordDist/vencordDesktopMain.js.LEGAL.txt delete mode 100644 vesktop/vencordDist/vencordDesktopMain.js.map delete mode 100644 vesktop/vencordDist/vencordDesktopPreload.js delete mode 100644 vesktop/vencordDist/vencordDesktopPreload.js.map delete mode 100644 vesktop/vencordDist/vencordDesktopRenderer.css delete mode 100644 vesktop/vencordDist/vencordDesktopRenderer.css.map delete mode 100644 vesktop/vencordDist/vencordDesktopRenderer.js delete mode 100644 vesktop/vencordDist/vencordDesktopRenderer.js.LEGAL.txt delete mode 100644 vesktop/vencordDist/vencordDesktopRenderer.js.map create mode 100644 void-sway.sh diff --git a/arch-sway.sh b/arch-sway.sh index 42a9635..f67542c 100755 --- a/arch-sway.sh +++ b/arch-sway.sh @@ -10,7 +10,7 @@ yay -S gnome-keyring lxqt-policykit --noconfirm --needed yay -S waybar j4-dmenu-desktop swaylock swaybg swaync clipman --noconfirm --needed yay -S pipewire-pulse pavucontrol blueman bluetooth-support qpwgraph --noconfirm --needed yay -S brightnessctl --noconfirm --needed -yay -S nemo gnome-calculator --noconfirm --needed +yay -S eog nemo gnome-calculator --noconfirm --needed # for screenshots and color picker yay -S slurp grim zenity imagemagick --noconfirm --needed diff --git a/backup.sh b/backup.sh index b82ed79..e274615 100755 --- a/backup.sh +++ b/backup.sh @@ -32,6 +32,7 @@ rm -rf $GIT_DIR/vesktop cp -r $HOME/.config/vesktop/ $GIT_DIR rm -rf $GIT_DIR/vesktop/sessionData rm -rf $GIT_DIR/vesktop/Crashpad +rm -rf $GIT_DIR/vesktop/vencordDist rm -f $GIT_DIR/vesktop/Singleton* # VS code diff --git a/claws-mail/clawsrc b/claws-mail/clawsrc index e8fe524..a7ba5b6 100644 --- a/claws-mail/clawsrc +++ b/claws-mail/clawsrc @@ -18,7 +18,7 @@ close_receive_dialog=1 save_message=1 confirm_send_queued_messages=0 send_dialog_mode=0 -sendwin_width=705 +sendwin_width=764 sendwin_height=1032 outgoing_charset=AUTO encoding_method=0 @@ -165,7 +165,7 @@ summary_col_size_tags=150 folderwin_x=16 folderwin_y=16 folderview_width=284 -folderview_height=896 +folderview_height=1010 folderview_visible=1 folder_col_show_folder=1 folder_col_show_new=1 @@ -185,30 +185,30 @@ folder_default_hide_read_threads=0 folder_default_hide_read_msgs=0 folder_default_hide_del_msgs=0 summaryview_width=1627 -summaryview_height=468 +summaryview_height=523 main_messagewin_x=256 main_messagewin_y=210 messageview_width=1627 -messageview_height=427 +messageview_height=486 messageview_visible=1 mainview_x=0 mainview_y=0 mainview_width=1627 -mainview_height=1028 +mainview_height=1142 mainwin_x=0 mainwin_y=0 mainwin_maximised=0 mainwin_fullscreen=0 mainwin_menubar=1 mainwin_width=1916 -mainwin_height=1028 +mainwin_height=1142 messagewin_width=636 messagewin_height=1028 mimeview_tree_height=60 sourcewin_width=956 -sourcewin_height=1032 +sourcewin_height=1142 compose_width=956 -compose_height=1028 +compose_height=1142 compose_notebook_height=166 compose_x=0 compose_y=0 @@ -368,9 +368,9 @@ zero_replacement_char=0 editaccountwin_width=600 editaccountwin_height=440 accountswin_width=500 -accountswin_height=-1 +accountswin_height=402 logwin_width=520 -logwin_height=-1 +logwin_height=400 filtering_debugwin_width=600 filtering_debugwin_height=-1 folderselwin_width=300 diff --git a/claws-mail/matcherrc b/claws-mail/matcherrc index 7677ed4..1391fa2 100644 --- a/claws-mail/matcherrc +++ b/claws-mail/matcherrc @@ -3,7 +3,7 @@ [postglobal] [filtering] -enabled rulename "Move new sign-ins to low-priority" subject matchcase "Security alert" | subject matchcase "New device" | subject matchcase "New sign-in" move "#mh/Mailbox/Low-priority" +enabled rulename "Move new sign-ins to low-priority" subject matchcase "Security alert" | subject matchcase "New device" | subject matchcase "New sign-in" | subject matchcase "[pixiv] New login notification" move "#mh/Mailbox/Low-priority" enabled rulename "Move Southwest marketing to spam and mark as read" from matchcase "SouthwestAirlines@iluv.southwest.com" mark_as_read move "#mh/Mailbox/Spam" enabled rulename "Move Micro Center marketing to spam and mark as read" from matchcase "microcenter@microcenterinsider.com" mark_as_read move "#mh/Mailbox/Spam" enabled rulename "Move TCC/BN marketing to spam and mark as read" from matchcase "sm8240@email.bncollege.com" mark_as_read move "#mh/Mailbox/Spam" @@ -13,7 +13,7 @@ enabled rulename "Move Newegg marketing to spam and mark as read" from matchcase enabled rulename "Move Tumblr to spam and mark as read" from matchcase "no-reply@tumblr.com" mark_as_read move "#mh/Mailbox/Spam" enabled rulename "Move Sonic to spam and mark as read" from matchcase "no-reply@sonicdrivein.com" mark_as_read move "#mh/Mailbox/Spam" enabled rulename "Move ngrok to spam and mark as read" from matchcase "team@m.ngrok.com" mark_as_read move "#mh/Mailbox/Spam" -enabled rulename "Move LinkedIn to spam and mark as read" from regexpcase ".*@linkedin.com" mark_as_read move "#mh/Mailbox/Spam" +enabled rulename "Move LinkedIn to spam and mark as read" from regexpcase ".*linkedin.com" mark_as_read move "#mh/Mailbox/Spam" enabled rulename "Move YouTube comments to low-priority" subject matchcase "New reply to a comment" & subject matchcase "replied to you" & from matchcase "noreply@youtube.com" move "#mh/Mailbox/Low-priority" enabled rulename "Move Pomerium to spam and mark as read" from regexpcase ".*@pomerium.com" mark_as_read move "#mh/Mailbox/Spam" enabled rulename "Move Cults3d download notifications to spam and mark as read" subject matchcase "Download notification" & from matchcase "hello@cults3d.com" mark_as_read move "#mh/Mailbox/Spam" @@ -48,7 +48,9 @@ enabled rulename "Move more YouTube comments to low-priority" subject matchcase enabled rulename "Move Windscribe to spam and mark as read" from matchcase "noreply@windscribe.com" mark_as_read move "#mh/Mailbox/Spam" enabled rulename "Move GeeksforGeeks to spam and mark as read" from matchcase "no-reply@geeksforgeeks.org" mark_as_read move "#mh/Mailbox/Spam" enabled rulename "Move Tallo to spam and mark as read" from regexp ".*@tallo.com" mark_as_read move "#mh/Mailbox/Spam" -disabled rulename "Run gpg-email-helper" test "grep -- \"-----BEGIN PGP SIGNATURE-----\" %F" execute "python3 /home/askiiart/gpg-email-helper/gpg-email-helper.py %F" +enabled rulename "Run gpg-email-helper" test "grep -- \"-----BEGIN PGP SIGNATURE-----\" %F" execute "python3 /home/askiiart/gpg-email-helper/gpg-email-helper.py %F" enabled rulename "Move Microsoft sign-ins to low-priority" from matchcase "account-security-noreply@accountprotection.microsoft.com" & subject matchcase "New sign-in detected" move "#mh/Mailbox/Low-priority" enabled rulename "Move GasBuddy to spam and mark as read" from regexpcase ".*@email.gasbuddy.com" mark_as_read move "#mh/Mailbox/Spam" +enabled rulename "Move ScholarshipOwl to spam and mark as read" from regexpcase ".*@scholarshipowl.com" mark_as_read move "#mh/Mailbox/Spam" +enabled rulename "Move St. John's U to spam and mark as read" from regexpcase ".*@stjohns.edu" mark_as_read move "#mh/Mailbox/Spam" diff --git a/fish/conf.d/custom.fish b/fish/conf.d/custom.fish index c1cf7ce..ee924fe 100644 --- a/fish/conf.d/custom.fish +++ b/fish/conf.d/custom.fish @@ -1,6 +1,6 @@ if status is-interactive - fish_add_path .cargo/bin/ - fish_add_path /opt/clang-format-static + set -gx PATH $PATH ~/.cargo/bin/ + set -gx PATH $PATH /opt/clang-format-static set -x GPG_TTY (tty) set -x SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket) set -x EDITOR nvim @@ -8,7 +8,7 @@ if status is-interactive gpgconf --launch gpg-agent gpg-connect-agent updatestartuptty /bye # ctrl+backspace (^H in kitty) - # for ctrl+delete: kill-word (unsure about its code in kitty) + # for ctrl+delete: kill-word ([3;5~ in kitty) bind \cH backward-kill-path-component bind '[3;5~' kill-word set -x NIXPKGS_ALLOW_UNFREE 1 diff --git a/fish/fish_variables b/fish/fish_variables index 22d2f23..6bb728b 100644 --- a/fish/fish_variables +++ b/fish/fish_variables @@ -12,30 +12,62 @@ SETUVAR _tide_prompt_10568:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x SETUVAR _tide_prompt_10640:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a26\x3a24\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_10656:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b31m\x1b\x5b40m\x20\u2718\x201\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2018\x3a59\x3a39\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m SETUVAR _tide_prompt_1071:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b33m\x1b\x5b40m\x20\u2714\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2011\x3a56\x3a39\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m +SETUVAR _tide_prompt_10715:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x201m\x2018s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_10782:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x201m\x2015s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_10846:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x201m\x2012s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_10898:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2012\x3a48\x3a32\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_10908:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x201m\x2010s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_109687:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2024s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2018\x3a23\x3a57\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_10974:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x201m\x208s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_10994:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2010s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a27\x3a17\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_11016:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a17\x3a27\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_11042:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x201m\x207s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_110778:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2018\x3a28\x3a27\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_11107:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x201m\x205s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_11175:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x201m\x203s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_11249:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x201m\x202s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_11319:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x201m\x200s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_11394:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2058s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_11466:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2055s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_11549:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2054s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_11628:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2052s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_11632:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmain\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x2b57\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x212\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x3f1\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2017\x3a49\x3a16\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_1165:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x209s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2021\x3a24\x3a33\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_11716:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2049s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_1176:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2014\x3a10\x3a24\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_11801:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2048s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_11881:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2046s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_11974:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2045s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_12150:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2042s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_12198:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b33m\x1b\x5b40m\x20\u2714\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2020\x3a54\x3a12\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m +SETUVAR _tide_prompt_12249:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2040s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_12345:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2038s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_12450:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2037s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_1249:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2021\x3a23\x3a48\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_12551:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2035s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_12657:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2034s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_12666:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmain\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x212\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2027s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a32\x3a39\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_1267:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2014\x3a08\x3a40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_12767:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2032s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_12871:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2031s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_12991:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2029s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_13107:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2027s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_13220:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2026s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_13289:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b31m\x1b\x5b40m\x20\u2718\x2066\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2012\x3a16\x3a35\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m +SETUVAR _tide_prompt_13354:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2017s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_1372:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b33m\x1b\x5b40m\x20\u2714\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x20\uf252\x2013s\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2021\x3a19\x3a00\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m SETUVAR _tide_prompt_1386:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmain\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x211\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2051s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2014\x3a25\x3a33\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_13889:\x1d SETUVAR _tide_prompt_1406:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmain\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x211\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a30\x3a29\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_14088:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20TERM\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x208s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a21\x3a50\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_1439:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2020\x3a49\x3a11\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_1488:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2014\x3a15\x3a02\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_16359:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2010s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2011\x3a22\x3a19\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_16705:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmain\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x20\x2a1\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x212\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2009\x3a54\x3a32\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_1693:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b33m\x1b\x5b40m\x20\u2714\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x20\uf252\x2021s\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2011\x3a40\x3a09\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m SETUVAR _tide_prompt_174972:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2012s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2018\x3a13\x3a29\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m -SETUVAR _tide_prompt_1829:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b33m\x1b\x5b40m\x20\u2714\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x20\uf252\x2011s\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2021\x3a15\x3a48\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m +SETUVAR _tide_prompt_18294:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmain\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x20\x2a1\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x2120\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x3f1\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2021\x3a36\x3a34\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_18900:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x201\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2021\x3a36\x3a18\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_19365:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20INT\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x208s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2020\x3a18\x3a56\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_19618:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x208s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2020\x3a42\x3a28\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_19724:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmain\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x20\x2a2\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x211\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2015\x3a00\x3a57\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m @@ -87,9 +119,11 @@ SETUVAR _tide_prompt_5820:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3 SETUVAR _tide_prompt_5971:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x205s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2021\x3a46\x3a35\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_6012:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x40\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m348a76c\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x212\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2017\x3a09\x3a30\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_6415:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x201\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2010s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2021\x3a49\x3a45\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_65008:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmain\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x213\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x3f1\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2020\x3a51\x3a20\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_65309:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2020m\x208s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2023\x3a26\x3a55\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_66148:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmain\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x2b2773\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2020\x3a15\x3a57\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_686:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b31m\x1b\x5b40m\x20\u2718\x20INT\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x20\uf252\x2024s\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2011\x3a52\x3a48\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m +SETUVAR _tide_prompt_68767:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30a\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmain\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x214\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2018\x3a39\x3a42\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_694:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2011s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2021\x3a13\x3a08\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_72071:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b37m\x40\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mbdb22ac\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x211\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x206s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2017\x3a39\x3a42\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_727:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b33m\x1b\x5b40m\x20\u2714\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2011\x3a50\x3a14\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m @@ -103,6 +137,7 @@ SETUVAR _tide_prompt_8167:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3 SETUVAR _tide_prompt_833:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a54\x3a00\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_8476:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20INT\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x203s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2019\x3a12\x3a03\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_851:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b31m\x1b\x5b40m\x20\u2718\x20127\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2018\x3a18\x3a20\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m +SETUVAR _tide_prompt_8878:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x201m\x2024s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2012\x3a10\x3a20\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_9039:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2023\x3a40\x3a22\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_932:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b33m\x1b\x5b40m\x20\u2714\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2011\x3a31\x3a26\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m SETUVAR _tide_prompt_9347:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2020\x3a22\x3a41\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m @@ -111,7 +146,7 @@ SETUVAR _tide_prompt_9628:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3 SETUVAR _tide_prompt_964:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b37m\x1b\x5b40m\x20\uf303\x20\x1b\x5b90m\u2502\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b31m\x1b\x5b40m\x20\u2718\x201\x20\x1b\x5b90m\u2502\x1b\x5b90m\x1b\x5b40m\x2001\x3a34\x3a05\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m SETUVAR _tide_prompt_973:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b215\x3b0\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2718\x20255\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf252\x2051s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2011\x3a34\x3a07\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_9971:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf303\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\u2502\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2013\x3a15\x3a26\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m -SETUVAR _tide_right_items:status\x1ecmd_duration\x1econtext\x1ejobs\x1epython\x1erustc\x1enix_shell\x1etime +SETUVAR _tide_right_items:status\x1ecmd_duration\x1econtext\x1ejobs\x1epython\x1erustc\x1ejava\x1etime SETUVAR fish_color_autosuggestion:555\x1ebrblack SETUVAR fish_color_cancel:\x2dr SETUVAR fish_color_command:blue @@ -226,7 +261,7 @@ SETUVAR tide_node_color:44883E SETUVAR tide_node_icon:\ue24f SETUVAR tide_os_bg_color:303030 SETUVAR tide_os_color:EEEEEE -SETUVAR tide_os_icon:\uf303 +SETUVAR tide_os_icon:\uf30a SETUVAR tide_php_bg_color:303030 SETUVAR tide_php_color:617CBE SETUVAR tide_php_icon:\ue608 @@ -250,12 +285,12 @@ SETUVAR tide_pwd_color_truncated_dirs:8787AF SETUVAR tide_pwd_icon:\uf07c SETUVAR tide_pwd_icon_home:\uf015 SETUVAR tide_pwd_icon_unwritable:\uf023 -SETUVAR tide_pwd_markers:\x2ebzr\x1e\x2ecitc\x1e\x2egit\x1e\x2ehg\x1e\x2enode\x2dversion\x1e\x2epython\x2dversion\x1e\x2eruby\x2dversion\x1e\x2eshorten_folder_marker\x1e\x2esvn\x1e\x2eterraform\x1eCargo\x2etoml\x1ecomposer\x2ejson\x1eCVS\x1ego\x2emod\x1epackage\x2ejson +SETUVAR tide_pwd_markers:\x2ebzr\x1e\x2ecitc\x1e\x2egit\x1e\x2ehg\x1e\x2enode\x2dversion\x1e\x2epython\x2dversion\x1e\x2eruby\x2dversion\x1e\x2eshorten_folder_marker\x1e\x2esvn\x1e\x2eterraform\x1eCargo\x2etoml\x1ecomposer\x2ejson\x1eCVS\x1ego\x2emod\x1epackage\x2ejson\x1ebuild\x2ezig SETUVAR tide_python_bg_color:303030 SETUVAR tide_python_color:00AFAF SETUVAR tide_python_icon:\U000f0320 SETUVAR tide_right_prompt_frame_enabled:false -SETUVAR tide_right_prompt_items:status\x1ecmd_duration\x1econtext\x1ejobs\x1edirenv\x1enode\x1epython\x1erustc\x1ejava\x1ephp\x1epulumi\x1eruby\x1ego\x1egcloud\x1ekubectl\x1edistrobox\x1etoolbox\x1eterraform\x1eaws\x1enix_shell\x1ecrystal\x1eelixir\x1etime +SETUVAR tide_right_prompt_items:status\x1ecmd_duration\x1econtext\x1ejobs\x1edirenv\x1enode\x1epython\x1erustc\x1ejava\x1ephp\x1epulumi\x1eruby\x1ego\x1egcloud\x1ekubectl\x1edistrobox\x1etoolbox\x1eterraform\x1eaws\x1enix_shell\x1ecrystal\x1eelixir\x1ezig\x1etime SETUVAR tide_right_prompt_prefix:\ue0b2 SETUVAR tide_right_prompt_separator_diff_color:\ue0b2 SETUVAR tide_right_prompt_separator_same_color:\u2502 @@ -278,7 +313,7 @@ SETUVAR tide_status_icon:\u2714 SETUVAR tide_status_icon_failure:\u2718 SETUVAR tide_terraform_bg_color:303030 SETUVAR tide_terraform_color:844FBA -SETUVAR tide_terraform_icon:\x1d +SETUVAR tide_terraform_icon:\U000f1062 SETUVAR tide_time_bg_color:303030 SETUVAR tide_time_color:5F8787 SETUVAR tide_time_format:\x25T @@ -300,3 +335,6 @@ SETUVAR tide_vi_mode_icon_visual:V SETUVAR tide_virtual_env_bg_color:303030 SETUVAR tide_virtual_env_color:00AFAF SETUVAR tide_virtual_env_icon:\ue73c +SETUVAR tide_zig_bg_color:303030 +SETUVAR tide_zig_color:F7A41D +SETUVAR tide_zig_icon:\ue6a9 diff --git a/other-files/.xinitrc b/other-files/.xinitrc index 1336dc9..a4bb425 100644 --- a/other-files/.xinitrc +++ b/other-files/.xinitrc @@ -1 +1 @@ -exec /usr/bin/budgie-desktop +exec sway diff --git a/restore.sh b/restore.sh index dae552a..1effd4a 100755 --- a/restore.sh +++ b/restore.sh @@ -16,6 +16,7 @@ else fi cp $GIT_DIR/universal-shellrc.txt $HOME/.config/fish/conf.d/universal.fish fish -c 'fisher update' +fish -c "tide configure --auto --style=Classic --prompt_colors='True color' --classic_prompt_color=Dark --show_time='24-hour format' --classic_prompt_separators=Vertical --powerline_prompt_heads=Sharp --powerline_prompt_tails=Flat --powerline_prompt_style='One line' --prompt_spacing=Compact --icons='Many icons' --transient=No" # kitty rm -rf $HOME/.config/kitty/ diff --git a/universal-shellrc.txt b/universal-shellrc.txt index fc926c7..bfa4c50 100644 --- a/universal-shellrc.txt +++ b/universal-shellrc.txt @@ -11,6 +11,11 @@ alias ls="ls --color=auto -CF" alias ll="ls -l" alias la="ls -a" +# lol +alias please="sudo" +alias pwease="please" +alias pls="please" + # kitty stuff alias icat="kitten icat" alias s="kitten ssh" @@ -44,4 +49,4 @@ else: new_url = new_url.replace(':', '/') new_url = f'https://{new_url}' -exit(subprocess.getstatusoutput(f'git remote set-url {remote} {new_url}')[0])\"" \ No newline at end of file +exit(subprocess.getstatusoutput(f'git remote set-url {remote} {new_url}')[0])\"" diff --git a/vesktop/settings/settings.json b/vesktop/settings/settings.json index 385c91e..cef40c6 100644 --- a/vesktop/settings/settings.json +++ b/vesktop/settings/settings.json @@ -62,7 +62,9 @@ "enabled": false }, "AlwaysTrust": { - "enabled": true + "enabled": true, + "domain": true, + "file": true }, "AnonymiseFileNames": { "enabled": false @@ -141,8 +143,11 @@ "enableStreamQualityBypass": true, "transformStickers": true, "transformEmojis": true, - "transformCompoundSentence": false, - "emojiSize": 48 + "transformCompoundSentence": true, + "emojiSize": 48, + "hyperLinkText": "{{NAME}}", + "useHyperLinks": true, + "stickerSize": 160 }, "FakeProfileThemes": { "enabled": false @@ -187,7 +192,8 @@ "zoom": 2, "nearestNeighbour": false, "square": false, - "saveZoomValues": true + "saveZoomValues": true, + "zoomSpeed": 0.5 }, "InvisibleChat": { "enabled": false, @@ -204,7 +210,9 @@ "replaceEvents": true }, "MemberCount": { - "enabled": true + "enabled": true, + "memberList": true, + "toolTip": true }, "MessageClickActions": { "enabled": false @@ -344,7 +352,9 @@ "enabled": true }, "PinDMs": { - "enabled": true + "enabled": true, + "dmSectioncollapsed": false, + "pinOrder": 0 }, "PlainFolderIcon": { "enabled": false @@ -364,7 +374,8 @@ "showInMessages": true, "showSelf": true, "pronounSource": 0, - "showInProfile": true + "showInProfile": true, + "pronounsFormat": "LOWERCASE" }, "QuickMention": { "enabled": false @@ -400,7 +411,8 @@ "enabled": false }, "SendTimestamps": { - "enabled": true + "enabled": true, + "replaceMessageContents": true }, "ServerListIndicators": { "enabled": false @@ -425,7 +437,7 @@ "enabled": false }, "ShowMeYourName": { - "enabled": true, + "enabled": false, "displayNames": false, "mode": "user-nick", "inReplies": false @@ -564,6 +576,24 @@ }, "NewGuildSettings": { "enabled": false + }, + "BetterRoleContext": { + "enabled": false + }, + "BetterSettings": { + "enabled": false + }, + "FriendsSince": { + "enabled": false + }, + "OverrideForumDefaults": { + "enabled": false + }, + "ResurrectHome": { + "enabled": false + }, + "UnlockedAvatarZoom": { + "enabled": false } }, "notifications": { @@ -576,6 +606,6 @@ "authenticated": true, "url": "https://api.vencord.dev/", "settingsSync": true, - "settingsSyncVersion": 1709943427384 + "settingsSyncVersion": 1713151376792 } } \ No newline at end of file diff --git a/vesktop/state.json b/vesktop/state.json index e2cb554..d21461c 100644 --- a/vesktop/state.json +++ b/vesktop/state.json @@ -4,8 +4,8 @@ "minimized": false, "windowBounds": { "x": 962, - "y": 57, + "y": 56, "width": 956, - "height": 1141 + "height": 1142 } } \ No newline at end of file diff --git a/vesktop/vencordDist/vencordDesktopMain.js b/vesktop/vencordDist/vencordDesktopMain.js deleted file mode 100644 index 339bf3f..0000000 --- a/vesktop/vencordDist/vencordDesktopMain.js +++ /dev/null @@ -1,22 +0,0 @@ -// Vencord ca18b6e -// Standalone: true -// Platform: Universal -// Updater disabled: false -"use strict";var rr=Object.create;var Ee=Object.defineProperty;var nr=Object.getOwnPropertyDescriptor;var ir=Object.getOwnPropertyNames;var or=Object.getPrototypeOf,ar=Object.prototype.hasOwnProperty;var L=(e,t)=>()=>(e&&(t=e(e=0)),t);var De=(e,t)=>{for(var r in t)Ee(e,r,{get:t[r],enumerable:!0})},sr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ir(t))!ar.call(e,i)&&i!==r&&Ee(e,i,{get:()=>t[i],enumerable:!(n=nr(t,i))||n.enumerable});return e};var cr=(e,t,r)=>(r=e!=null?rr(or(e)):{},sr(t||!e||!e.__esModule?Ee(r,"default",{value:e,enumerable:!0}):r,e));var l=L(()=>{"use strict"});var ie=L(()=>{"use strict";l()});var oe,Re=L(()=>{l();oe="ca18b6e"});var H,Pe=L(()=>{l();H="Vendicated/Vencord"});var et,tt=L(()=>{"use strict";l();Re();Pe();et=`Vencord/${oe}${H?` (https://github.com/${H})`:""}`});function K(e,t={}){return new Promise((r,n)=>{rt.default.get(e,t,i=>{let{statusCode:a,statusMessage:o,headers:s}=i;if(a>=400)return void n(`${a}: ${o} - ${e}`);if(a>=300)return void r(K(s.location,t));let c=[];i.on("error",n),i.on("data",f=>c.push(f)),i.once("end",()=>r(Buffer.concat(c)))})})}var rt,Ge=L(()=>{"use strict";l();rt=cr(require("https"))});function ae(e){return async function(){try{return{ok:!0,value:await e(...arguments)}}catch(t){return{ok:!1,error:t instanceof Error?{...t}:t}}}}var nt,it=L(()=>{"use strict";l();nt=["vencordDesktopMain.js","vencordDesktopPreload.js","vencordDesktopRenderer.js","vencordDesktopRenderer.css"]});var hr={};async function st(e){return K(lr+e,{headers:{Accept:"application/vnd.github+json","User-Agent":et}})}async function fr(){if(!await ct())return[];let t=await st(`/compare/${oe}...HEAD`);return JSON.parse(t.toString("utf-8")).commits.map(n=>({hash:n.sha.slice(0,7),author:n.author.login,message:n.commit.message.substring(n.commit.message.indexOf(` -`)+1)}))}async function ct(){let e=await st("/releases/latest"),t=JSON.parse(e.toString());return t.name.slice(t.name.lastIndexOf(" ")+1)===oe?!1:(t.assets.forEach(({name:n,browser_download_url:i})=>{nt.some(a=>n.startsWith(a))&&Oe.push([n,i])}),!0)}async function ur(){return await Promise.all(Oe.map(async([e,t])=>(0,ot.writeFile)((0,at.join)(__dirname,e),await K(t)))),Oe=[],!0}var se,ot,at,lr,Oe,lt=L(()=>{"use strict";l();ie();tt();se=require("electron"),ot=require("fs/promises"),at=require("path");Re();Pe();Ge();it();lr=`https://api.github.com/repos/${H}`,Oe=[];se.ipcMain.handle("VencordGetRepo",ae(()=>`https://github.com/${H}`));se.ipcMain.handle("VencordGetUpdates",ae(fr));se.ipcMain.handle("VencordUpdate",ae(ct));se.ipcMain.handle("VencordBuild",ae(ur))});l();var F=require("electron"),qt=require("path");l();l();Promise.resolve().then(()=>lt());l();ie();var _e=require("electron");l();var vt={};l();l();ie();l();var ce=class{pathListeners=new Map;globalListeners=new Set;constructor(t,r={}){this.plain=t,this.store=this.makeProxy(t),Object.assign(this,r)}makeProxy(t,r=t,n=""){let i=this;return new Proxy(t,{get(a,o){let s=a[o];return!(o in a)&&i.getDefaultValue&&(s=i.getDefaultValue({target:a,key:o,root:r,path:n})),typeof s=="object"&&s!==null&&!Array.isArray(s)?i.makeProxy(s,r,`${n}${n&&"."}${o}`):s},set(a,o,s){if(a[o]===s)return!0;Reflect.set(a,o,s);let c=`${n}${n&&"."}${o}`;return i.globalListeners.forEach(f=>f(s,c)),i.pathListeners.get(c)?.forEach(f=>f(s)),!0}})}setData(t,r){if(this.readOnly)throw new Error("SettingsStore is read-only");if(this.plain=t,this.store=this.makeProxy(t),r){let n=t,i=r.split(".");for(let a of i){if(!n){console.warn(`Settings#setData: Path ${r} does not exist in new data. Not dispatching update`);return}n=n[a]}this.pathListeners.get(r)?.forEach(a=>a(n))}this.markAsChanged()}addGlobalChangeListener(t){this.globalListeners.add(t)}addChangeListener(t,r){let n=this.pathListeners.get(t)??new Set;n.add(r),this.pathListeners.set(t,n)}removeGlobalChangeListener(t){this.globalListeners.delete(t)}removeChangeListener(t,r){let n=this.pathListeners.get(t);!n||(n.delete(r),n.size||this.pathListeners.delete(t))}markAsChanged(){this.globalListeners.forEach(t=>t(this.plain,""))}};var me=require("electron"),Z=require("fs");l();var ft=require("electron"),k=require("path"),pe=process.env.VENCORD_USER_DATA_DIR??(process.env.DISCORD_USER_DATA_DIR?(0,k.join)(process.env.DISCORD_USER_DATA_DIR,"..","VencordData"):(0,k.join)(ft.app.getPath("userData"),"..","Vencord")),Y=(0,k.join)(pe,"settings"),N=(0,k.join)(pe,"themes"),ve=(0,k.join)(Y,"quickCss.css"),Ve=(0,k.join)(Y,"settings.json"),Le=(0,k.join)(Y,"native-settings.json"),ut=["https:","http:","steam:","spotify:","com.epicgames.launcher:"];(0,Z.mkdirSync)(Y,{recursive:!0});function gt(e,t){try{return JSON.parse((0,Z.readFileSync)(t,"utf-8"))}catch(r){return r?.code!=="ENOENT"&&console.error(`Failed to read ${e} settings`,r),{}}}var x=new ce(gt("renderer",Ve));x.addGlobalChangeListener(()=>{try{(0,Z.writeFileSync)(Ve,JSON.stringify(x.plain,null,4))}catch(e){console.error("Failed to write renderer settings",e)}});me.ipcMain.handle("VencordGetSettingsDir",()=>Y);me.ipcMain.on("VencordGetSettings",e=>e.returnValue=x.plain);me.ipcMain.handle("VencordSetSettings",(e,t,r)=>{x.setData(t,r)});var ht=new ce(gt("native",Le));ht.addGlobalChangeListener(()=>{try{(0,Z.writeFileSync)(Le,JSON.stringify(ht.plain,null,4))}catch(e){console.error("Failed to write native settings",e)}});var pt=require("electron");pt.app.on("browser-window-created",(e,t)=>{t.webContents.on("frame-created",(r,{frame:n})=>{n.once("dom-ready",()=>{if(n.url.startsWith("https://open.spotify.com/embed/")){let i=x.store.plugins?.FixSpotifyEmbeds;if(!i?.enabled)return;n.executeJavaScript(` - const original = Audio.prototype.play; - Audio.prototype.play = function() { - this.volume = ${i.volume/100||.1}; - return original.apply(this, arguments); - } - `)}})})});var It={};l();var mt=require("electron");mt.app.on("browser-window-created",(e,t)=>{t.webContents.on("frame-created",(r,{frame:n})=>{n.once("dom-ready",()=>{if(n.url.startsWith("https://www.youtube.com/")){if(!x.store.plugins?.FixYoutubeEmbeds?.enabled)return;n.executeJavaScript(` - new MutationObserver(() => { - if( - document.querySelector('div.ytp-error-content-wrap-subreason a[href*="www.youtube.com/watch?v="]') - ) location.reload() - }).observe(document.body, { childList: true, subtree:true }); - `)}})})});var ke={};De(ke,{resolveRedirect:()=>pr});l();var Ct=require("https"),gr=/^https:\/\/(spotify\.link|s\.team)\/.+$/;function At(e){return new Promise((t,r)=>{let n=(0,Ct.request)(new URL(e),{method:"HEAD"},i=>{t(i.headers.location?At(i.headers.location):e)});n.on("error",r),n.end()})}async function pr(e,t){return gr.test(t)?At(t):t}var ze={};De(ze,{readRecording:()=>vr});l();var dt=require("electron"),yt=require("fs/promises"),le=require("path");async function vr(e,t){t=(0,le.normalize)(t);let r=(0,le.basename)(t),n=(0,le.normalize)(dt.app.getPath("userData")+"/");if(console.log(r,n,t),r!=="recording.ogg"||!t.startsWith(n))return null;try{let i=await(0,yt.readFile)(t);return new Uint8Array(i.buffer)}catch{return null}}var Me={};De(Me,{sendToOverlay:()=>mr});l();var St=require("dgram"),wt;function mr(e,t){t.icon=Buffer.from(t.icon).toString("base64");let r=JSON.stringify(t);wt??=(0,St.createSocket)("udp4"),wt.send(r,42069,"127.0.0.1")}var Tt={FixSpotifyEmbeds:vt,FixYoutubeEmbeds:It,OpenInApp:ke,VoiceMessages:ze,XsOverlay:Me};var xt={};for(let[e,t]of Object.entries(Tt)){let r=Object.entries(t);if(!r.length)continue;let n=xt[e]={};for(let[i,a]of r){let o=`VencordPluginNative_${e}_${i}`;_e.ipcMain.handle(o,a),n[i]=o}}_e.ipcMain.on("VencordGetPluginIpcMethodMap",e=>{e.returnValue=xt});l();ie();var v=require("electron"),fe=require("fs"),X=require("fs/promises"),J=require("path");l();var Et="PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KICAgIDxoZWFkPgogICAgICAgIDxtZXRhIGNoYXJzZXQ9InV0Zi04IiAvPgogICAgICAgIDx0aXRsZT5WZW5jb3JkIFF1aWNrQ1NTIEVkaXRvcjwvdGl0bGU+CiAgICAgICAgPGxpbmsKICAgICAgICAgICAgcmVsPSJzdHlsZXNoZWV0IgogICAgICAgICAgICBocmVmPSJodHRwczovL2NkbmpzLmNsb3VkZmxhcmUuY29tL2FqYXgvbGlicy9tb25hY28tZWRpdG9yLzAuNDAuMC9taW4vdnMvZWRpdG9yL2VkaXRvci5tYWluLm1pbi5jc3MiCiAgICAgICAgICAgIGludGVncml0eT0ic2hhNTEyLU1Pb1EwMmg4MGhrbGNjZkxyWEZZa0N6RytXVmpPUmZsT3A5WnA4ZGx0aWFSUCszNUxZbk80TEtPa2xSNjRvTUdmR2dKRExPOFdKcGtNMW81Z1pYWVpRPT0iCiAgICAgICAgICAgIGNyb3Nzb3JpZ2luPSJhbm9ueW1vdXMiCiAgICAgICAgICAgIHJlZmVycmVycG9saWN5PSJuby1yZWZlcnJlciIKICAgICAgICAvPgogICAgICAgIDxzdHlsZT4KICAgICAgICAgICAgaHRtbCwKICAgICAgICAgICAgYm9keSwKICAgICAgICAgICAgI2NvbnRhaW5lciB7CiAgICAgICAgICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7CiAgICAgICAgICAgICAgICBsZWZ0OiAwOwogICAgICAgICAgICAgICAgdG9wOiAwOwogICAgICAgICAgICAgICAgd2lkdGg6IDEwMCU7CiAgICAgICAgICAgICAgICBoZWlnaHQ6IDEwMCU7CiAgICAgICAgICAgICAgICBtYXJnaW46IDA7CiAgICAgICAgICAgICAgICBwYWRkaW5nOiAwOwogICAgICAgICAgICAgICAgb3ZlcmZsb3c6IGhpZGRlbjsKICAgICAgICAgICAgfQogICAgICAgIDwvc3R5bGU+CiAgICA8L2hlYWQ+CgogICAgPGJvZHk+CiAgICAgICAgPGRpdiBpZD0iY29udGFpbmVyIj48L2Rpdj4KICAgICAgICA8c2NyaXB0CiAgICAgICAgICAgIHNyYz0iaHR0cHM6Ly9jZG5qcy5jbG91ZGZsYXJlLmNvbS9hamF4L2xpYnMvbW9uYWNvLWVkaXRvci8wLjQwLjAvbWluL3ZzL2xvYWRlci5taW4uanMiCiAgICAgICAgICAgIGludGVncml0eT0ic2hhNTEyLVF6TXBYZUNQY2lBSFA0d2JZbFYyUFlnclFjYUVrRFFVanprUFU0eG5qeVZTRDlUMzYvdWRhbXh0TkJxYjRxSzQvYk1RTVBaOGF5ckJlOWhyR2RCRmpRPT0iCiAgICAgICAgICAgIGNyb3Nzb3JpZ2luPSJhbm9ueW1vdXMiCiAgICAgICAgICAgIHJlZmVycmVycG9saWN5PSJuby1yZWZlcnJlciIKICAgICAgICA+PC9zY3JpcHQ+CgogICAgICAgIDxzY3JpcHQ+CiAgICAgICAgICAgIHJlcXVpcmUuY29uZmlnKHsKICAgICAgICAgICAgICAgIHBhdGhzOiB7CiAgICAgICAgICAgICAgICAgICAgdnM6ICJodHRwczovL2NkbmpzLmNsb3VkZmxhcmUuY29tL2FqYXgvbGlicy9tb25hY28tZWRpdG9yLzAuNDAuMC9taW4vdnMiLAogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgfSk7CgogICAgICAgICAgICByZXF1aXJlKFsidnMvZWRpdG9yL2VkaXRvci5tYWluIl0sICgpID0+IHsKICAgICAgICAgICAgICAgIGdldEN1cnJlbnRDc3MoKS50aGVuKChjc3MpID0+IHsKICAgICAgICAgICAgICAgICAgICB2YXIgZWRpdG9yID0gbW9uYWNvLmVkaXRvci5jcmVhdGUoCiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJjb250YWluZXIiKSwKICAgICAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IGNzcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhbmd1YWdlOiAiY3NzIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZW1lOiBnZXRUaGVtZSgpLAogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgKTsKICAgICAgICAgICAgICAgICAgICBlZGl0b3Iub25EaWRDaGFuZ2VNb2RlbENvbnRlbnQoKCkgPT4KICAgICAgICAgICAgICAgICAgICAgICAgc2V0Q3NzKGVkaXRvci5nZXRWYWx1ZSgpKQogICAgICAgICAgICAgICAgICAgICk7CiAgICAgICAgICAgICAgICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoInJlc2l6ZSIsICgpID0+IHsKICAgICAgICAgICAgICAgICAgICAgICAgLy8gbWFrZSBtb25hY28gcmUtbGF5b3V0CiAgICAgICAgICAgICAgICAgICAgICAgIGVkaXRvci5sYXlvdXQoKTsKICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9KTsKICAgICAgICA8L3NjcmlwdD4KICAgIDwvYm9keT4KPC9odG1sPgo=";l();var Ir=/[^\S\r\n]*?\r?(?:\r\n|\n)[^\S\r\n]*?\*[^\S\r\n]?/,Cr=/^\\@/;function Ne(e,t={}){return{fileName:e,name:t.name??e.replace(/\.css$/i,""),author:t.author??"Unknown Author",description:t.description??"A Discord Theme.",version:t.version,license:t.license,source:t.source,website:t.website,invite:t.invite}}function Dt(e){return e.charCodeAt(0)===65279&&(e=e.slice(1)),e}function Rt(e,t){if(!e)return Ne(t);let r=e.split("/**",2)?.[1]?.split("*/",1)?.[0];if(!r)return Ne(t);let n={},i="",a="";for(let o of r.split(Ir))if(o.length!==0)if(o.charAt(0)==="@"&&o.charAt(1)!==" "){n[i]=a.trim();let s=o.indexOf(" ");i=o.substring(1,s),a=o.substring(s+1)}else a+=" "+o.replace("\\n",` -`).replace(Cr,"@");return n[i]=a.trim(),delete n[""],Ne(t,n)}l();var Pt=require("electron");function Gt(e){e.webContents.setWindowOpenHandler(({url:t})=>{switch(t){case"about:blank":case"https://discord.com/popout":case"https://ptb.discord.com/popout":case"https://canary.discord.com/popout":return{action:"allow"}}try{var{protocol:r}=new URL(t)}catch{return{action:"deny"}}switch(r){case"http:":case"https:":case"mailto:":case"steam:":case"spotify:":Pt.shell.openExternal(t)}return{action:"deny"}})}(0,fe.mkdirSync)(N,{recursive:!0});function Ze(e,t){let r=(0,J.normalize)(e),n=(0,J.join)(e,t),i=(0,J.normalize)(n);return i.startsWith(r)?i:null}function Ar(){return(0,X.readFile)(ve,"utf-8").catch(()=>"")}async function dr(){let e=await(0,X.readdir)(N).catch(()=>[]),t=[];for(let r of e){if(!r.endsWith(".css"))continue;let n=await Ot(r).then(Dt).catch(()=>null);n!=null&&t.push(Rt(n,r))}return t}function Ot(e){e=e.replace(/\?v=\d+$/,"");let t=Ze(N,e);return t?(0,X.readFile)(t,"utf-8"):Promise.reject(`Unsafe path ${e}`)}v.ipcMain.handle("VencordOpenQuickCss",()=>v.shell.openPath(ve));v.ipcMain.handle("VencordOpenExternal",(e,t)=>{try{var{protocol:r}=new URL(t)}catch{throw"Malformed URL"}if(!ut.includes(r))throw"Disallowed protocol.";v.shell.openExternal(t)});v.ipcMain.handle("VencordGetQuickCss",()=>Ar());v.ipcMain.handle("VencordSetQuickCss",(e,t)=>(0,fe.writeFileSync)(ve,t));v.ipcMain.handle("VencordGetThemesDir",()=>N);v.ipcMain.handle("VencordGetThemesList",()=>dr());v.ipcMain.handle("VencordGetThemeData",(e,t)=>Ot(t));v.ipcMain.handle("VencordGetThemeSystemValues",()=>({"os-accent-color":`#${v.systemPreferences.getAccentColor?.()||""}`}));v.ipcMain.handle("VencordOpenMonacoEditor",async()=>{let e="Vencord QuickCSS Editor",t=v.BrowserWindow.getAllWindows().find(n=>n.title===e);if(t&&!t.isDestroyed()){t.focus();return}let r=new v.BrowserWindow({title:e,autoHideMenuBar:!0,darkTheme:!0,webPreferences:{preload:(0,J.join)(__dirname,"vencordDesktopPreload.js"),contextIsolation:!0,nodeIntegration:!1,sandbox:!1}});Gt(r),await r.loadURL(`data:text/html;base64,${Et}`)});l();var Xt=require("electron");l();var Lt=require("module"),yr=(0,Lt.createRequire)("/"),Ce,wr=";var __w=require('worker_threads');__w.parentPort.on('message',function(m){onmessage({data:m})}),postMessage=function(m,t){__w.parentPort.postMessage(m,t)},close=process.exit;self=global";try{Ce=yr("worker_threads").Worker}catch{}var Sr=Ce?function(e,t,r,n,i){var a=!1,o=new Ce(e+wr,{eval:!0}).on("error",function(s){return i(s,null)}).on("message",function(s){return i(null,s)}).on("exit",function(s){s&&!a&&i(new Error("exited with code "+s),null)});return o.postMessage(r,n),o.terminate=function(){return a=!0,Ce.prototype.terminate.call(o)},o}:function(e,t,r,n,i){setImmediate(function(){return i(new Error("async operations unsupported - update to Node 12+ (or Node 10-11 with the --experimental-worker CLI flag)"),null)});var a=function(){};return{terminate:a,postMessage:a}},A=Uint8Array,z=Uint16Array,be=Uint32Array,je=new A([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Be=new A([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),kt=new A([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),zt=function(e,t){for(var r=new z(31),n=0;n<31;++n)r[n]=t+=1<>>1|(u&21845)<<1,P=(P&52428)>>>2|(P&13107)<<2,P=(P&61680)>>>4|(P&3855)<<4,ye[u]=((P&65280)>>>8|(P&255)<<8)>>>1;var P,u,$=function(e,t,r){for(var n=e.length,i=0,a=new z(t);i>>c]=f}else for(s=new z(n),i=0;i>>15-e[i]);return s},ue=new A(288);for(u=0;u<144;++u)ue[u]=8;var u;for(u=144;u<256;++u)ue[u]=9;var u;for(u=256;u<280;++u)ue[u]=7;var u;for(u=280;u<288;++u)ue[u]=8;var u,Zt=new A(32);for(u=0;u<32;++u)Zt[u]=5;var u;var Ft=$(ue,9,1);var Wt=$(Zt,5,1),Ae=function(e){for(var t=e[0],r=1;rt&&(t=e[r]);return t},w=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},de=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},bt=function(e){return(e+7)/8|0},we=function(e,t,r){(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length);var n=new(e.BYTES_PER_ELEMENT==2?z:e.BYTES_PER_ELEMENT==4?be:A)(r-t);return n.set(e.subarray(t,r)),n};var jt=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],d=function(e,t,r){var n=new Error(t||jt[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,d),!r)throw n;return n},Bt=function(e,t,r){var n=e.length;if(!n||r&&r.f&&!r.l)return t||new A(0);var i=!t||r,a=!r||r.i;r||(r={}),t||(t=new A(n*3));var o=function($e){var Qe=t.length;if($e>Qe){var qe=new A(Math.max(Qe*2,$e));qe.set(t),t=qe}},s=r.f||0,c=r.p||0,f=r.b||0,h=r.l,m=r.d,S=r.m,G=r.n,q=n*8;do{if(!h){s=w(e,c,1);var M=w(e,c+1,3);if(c+=3,M)if(M==1)h=Ft,m=Wt,S=9,G=5;else if(M==2){var U=w(e,c,31)+257,W=w(e,c+10,15)+4,ee=U+w(e,c+5,31)+1;c+=14;for(var _=new A(ee),te=new A(19),C=0;C>>4;if(I<16)_[C++]=I;else{var j=0,ge=0;for(I==16?(ge=3+w(e,c,3),c+=2,j=_[C-1]):I==17?(ge=3+w(e,c,7),c+=3):I==18&&(ge=11+w(e,c,127),c+=7);ge--;)_[C++]=j}}var Ye=_.subarray(0,U),V=_.subarray(U);S=Ae(Ye),G=Ae(V),h=$(Ye,S,1),m=$(V,G,1)}else d(1);else{var I=bt(c)+4,y=e[I-4]|e[I-3]<<8,O=I+y;if(O>n){a&&d(0);break}i&&o(f+y),t.set(e.subarray(I,O),f),r.b=f+=y,r.p=c=O*8,r.f=s;continue}if(c>q){a&&d(0);break}}i&&o(f+131072);for(var er=(1<>>4;if(c+=j&15,c>q){a&&d(0);break}if(j||d(2),B<256)t[f++]=B;else if(B==256){Se=c,h=null;break}else{var Je=B-254;if(B>264){var C=B-257,ne=je[C];Je=w(e,c,(1<>>4;Te||d(3),c+=Te&15;var V=Nt[xe];if(xe>3){var ne=Be[xe];V+=de(e,c)&(1<q){a&&d(0);break}i&&o(f+131072);for(var Xe=f+Je;f>>0},Fe=function(e,t){return T(e,t)+T(e,t+4)*4294967296};function Or(e,t,r){return r||(r=t,t={}),typeof r!="function"&&d(7),Gr(e,t,[Pr],function(n){return Ht(Ke(n.data[0],Kt(n.data[1])))},1,r)}function Ke(e,t){return Bt(e,t)}var We=typeof TextDecoder<"u"&&new TextDecoder,Ur=0;try{We.decode(xr,{stream:!0}),Ur=1}catch{}var Vr=function(e){for(var t="",r=0;;){var n=e[r++],i=(n>127)+(n>223)+(n>239);if(r+i>e.length)return[t,we(e,r-1)];i?i==3?(n=((n&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023)):i&1?t+=String.fromCharCode((n&31)<<6|e[r++]&63):t+=String.fromCharCode((n&15)<<12|(e[r++]&63)<<6|e[r++]&63):t+=String.fromCharCode(n)}};function Lr(e,t){if(t){for(var r="",n=0;n65558)return o(d(13,0,1),null),i;var c=E(e,s+8);if(c){var f=c,h=T(e,s+16),m=h==4294967295||f==65535;if(m){var S=T(e,s-12);m=T(e,S)==101075792,m&&(f=c=T(e,S+32),h=T(e,S+48))}for(var G=t&&t.filter,q=function(I){var y=zr(e,h,m),O=y[0],U=y[1],W=y[2],ee=y[3],_=y[4],te=y[5],C=kr(e,te);h=_;var R=function(b,re){b?(i(),o(b,null)):(re&&(a[ee]=re),--c||o(null,a))};if(!G||G({name:ee,size:U,originalSize:W,compression:O}))if(!O)R(null,we(e,C,C+U));else if(O==8){var he=e.subarray(C,C+U);if(U<32e4)try{R(null,Ke(he,new A(W)))}catch(b){R(b,null)}else n.push(Or(he,{size:W},R))}else R(d(14,"unknown compression type "+O,1),null);else R(null,null)},M=0;M>>0,h}if(e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4)return e;if(e[0]!==67||e[1]!==114||e[2]!==50||e[3]!==52)throw new Error("Invalid header: Does not start with Cr24");let r=e[4]===3,n=e[4]===2;if(!n&&!r||e[5]||e[6]||e[7])throw new Error("Unexpected crx format version number.");if(n){let o=t(e[8],e[9],e[10],e[11]),s=t(e[12],e[13],e[14],e[15]),c=16+o+s;return e.subarray(c,e.length)}let a=12+t(e[8],e[9],e[10],e[11]);return e.subarray(a,e.length)}Ge();var _r=(0,Q.join)(pe,"ExtensionCache");async function Nr(e,t){return await(0,D.mkdir)(t,{recursive:!0}),new Promise((r,n)=>{Yt(e,(i,a)=>{if(i)return void n(i);Promise.all(Object.keys(a).map(async o=>{if(o.startsWith("_metadata/"))return;if(o.endsWith("/"))return void(0,D.mkdir)((0,Q.join)(t,o),{recursive:!0});let s=o.split("/"),c=s.pop(),f=s.join("/"),h=(0,Q.join)(t,f);f&&await(0,D.mkdir)(h,{recursive:!0}),await(0,D.writeFile)((0,Q.join)(h,c),a[o])})).then(()=>r()).catch(o=>{(0,D.rm)(t,{recursive:!0,force:!0}),n(o)})})})}async function Qt(e){let t=(0,Q.join)(_r,`${e}`);try{await(0,D.access)(t,$t.constants.F_OK)}catch{let n=e==="fmkadmapgofadopljbjfkapdkoienihi"?"https://raw.githubusercontent.com/Vendicated/random-files/f6f550e4c58ac5f2012095a130406c2ab25b984d/fmkadmapgofadopljbjfkapdkoienihi.zip":`https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&x=id%3D${e}%26uc&prodversion=32`,i=await K(n,{headers:{"User-Agent":"Vencord (https://github.com/Vendicated/Vencord)"}});await Nr(Jt(i),t).catch(console.error)}Xt.session.defaultSession.loadExtension(t)}F.app.whenReady().then(()=>{F.protocol.registerFileProtocol("vencord",({url:i},a)=>{let o=i.slice(10);if(o.endsWith("/")&&(o=o.slice(0,-1)),o.startsWith("/themes/")){let s=o.slice(8),c=Ze(N,s);if(!c){a({statusCode:403});return}a(c.replace(/\?v=\d+$/,""));return}switch(o){case"renderer.js.map":case"vencordDesktopRenderer.js.map":case"preload.js.map":case"vencordDesktopPreload.js.map":case"patcher.js.map":case"vencordDesktopMain.js.map":a((0,qt.join)(__dirname,o));break;default:a({statusCode:403})}});try{x.store.enableReactDevtools&&Qt("fmkadmapgofadopljbjfkapdkoienihi").then(()=>console.info("[Vencord] Installed React Developer Tools")).catch(i=>console.error("[Vencord] Failed to install React Developer Tools",i))}catch{}let e=(i,a)=>Object.keys(i).find(o=>o.toLowerCase()===a),t=i=>{let a={};return i.split(";").forEach(o=>{let[s,...c]=o.trim().split(/\s+/g);s&&!Object.prototype.hasOwnProperty.call(a,s)&&(a[s]=c)}),a},r=i=>Object.entries(i).filter(([,a])=>a?.length).map(a=>a.flat().join(" ")).join("; "),n=i=>{let a=e(i,"content-security-policy");if(a){let o=t(i[a][0]);for(let s of["style-src","connect-src","img-src","font-src","media-src","worker-src"])o[s]??=[],o[s].push("*","blob:","data:","vencord:","'unsafe-inline'");o["script-src"]??=[],o["script-src"].push("'unsafe-eval'","https://unpkg.com","https://cdnjs.cloudflare.com"),i[a]=[r(o)]}};F.session.defaultSession.webRequest.onHeadersReceived(({responseHeaders:i,resourceType:a},o)=>{if(i&&(a==="mainFrame"&&n(i),a==="stylesheet")){let s=e(i,"content-type");s&&(i[s]=["text/css"])}o({cancel:!1,responseHeaders:i})}),F.session.defaultSession.webRequest.onHeadersReceived=()=>{}}); -//# sourceURL=VencordDesktopMain -//# sourceMappingURL=vencord://vencordDesktopMain.js.map -/*! For license information please see vencordDesktopMain.js.LEGAL.txt */ diff --git a/vesktop/vencordDist/vencordDesktopMain.js.LEGAL.txt b/vesktop/vencordDist/vencordDesktopMain.js.LEGAL.txt deleted file mode 100644 index 37badf0..0000000 --- a/vesktop/vencordDist/vencordDesktopMain.js.LEGAL.txt +++ /dev/null @@ -1,24 +0,0 @@ -/*! - * BetterDiscord addon meta parser - * Copyright 2023 BetterDiscord contributors - * Copyright 2023 Vendicated and Vencord contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/*! - * crxToZip - * Copyright (c) 2013 Rob Wu - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ diff --git a/vesktop/vencordDist/vencordDesktopMain.js.map b/vesktop/vencordDist/vencordDesktopMain.js.map deleted file mode 100644 index e489015..0000000 --- a/vesktop/vencordDist/vencordDesktopMain.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../scripts/build/inject/react.mjs", "../src/shared/IpcEvents.ts", "git-hash:~git-hash", "git-remote:~git-remote", "../src/shared/vencordUserAgent.ts", "../src/main/utils/simpleGet.ts", "../src/main/updater/common.ts", "../src/main/updater/http.ts", "../src/main/index.ts", "../src/main/ipcMain.ts", "../src/main/updater/index.ts", "../src/main/ipcPlugins.ts", "import-natives:~pluginNatives", "../src/plugins/fixSpotifyEmbeds.desktop/native.ts", "../src/main/settings.ts", "../src/shared/SettingsStore.ts", "../src/main/utils/constants.ts", "../src/plugins/fixYoutubeEmbeds.desktop/native.ts", "../src/plugins/openInApp/native.ts", "../src/plugins/voiceMessages/native.ts", "../src/plugins/xsOverlay.desktop/native.ts", "../src/shared/debounce.ts", "include-file:~fileContent/monacoWin.html;base64", "../src/main/themes/index.ts", "../src/main/utils/externalLinks.ts", "../src/main/utils/extensions.ts", "../node_modules/.pnpm/fflate@0.7.4/node_modules/fflate/esm/index.mjs", "../src/main/utils/crxToZip.ts"], - "sourcesContent": ["/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport const VencordFragment = /* #__PURE__*/ Symbol.for(\"react.fragment\");\nexport let VencordCreateElement =\n (...args) => (VencordCreateElement = Vencord.Webpack.Common.React.createElement)(...args);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport const enum IpcEvents {\n QUICK_CSS_UPDATE = \"VencordQuickCssUpdate\",\n THEME_UPDATE = \"VencordThemeUpdate\",\n GET_QUICK_CSS = \"VencordGetQuickCss\",\n SET_QUICK_CSS = \"VencordSetQuickCss\",\n UPLOAD_THEME = \"VencordUploadTheme\",\n DELETE_THEME = \"VencordDeleteTheme\",\n GET_THEMES_DIR = \"VencordGetThemesDir\",\n GET_THEMES_LIST = \"VencordGetThemesList\",\n GET_THEME_DATA = \"VencordGetThemeData\",\n GET_THEME_SYSTEM_VALUES = \"VencordGetThemeSystemValues\",\n GET_SETTINGS_DIR = \"VencordGetSettingsDir\",\n GET_SETTINGS = \"VencordGetSettings\",\n SET_SETTINGS = \"VencordSetSettings\",\n OPEN_EXTERNAL = \"VencordOpenExternal\",\n OPEN_QUICKCSS = \"VencordOpenQuickCss\",\n GET_UPDATES = \"VencordGetUpdates\",\n GET_REPO = \"VencordGetRepo\",\n UPDATE = \"VencordUpdate\",\n BUILD = \"VencordBuild\",\n OPEN_MONACO_EDITOR = \"VencordOpenMonacoEditor\",\n\n GET_PLUGIN_IPC_METHOD_MAP = \"VencordGetPluginIpcMethodMap\",\n\n OPEN_IN_APP__RESOLVE_REDIRECT = \"VencordOIAResolveRedirect\",\n VOICE_MESSAGES_READ_RECORDING = \"VencordVMReadRecording\",\n}\n", "export default \"ca18b6e\"", "export default \"Vendicated/Vencord\"", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2024 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport gitHash from \"~git-hash\";\nimport gitRemote from \"~git-remote\";\n\nexport { gitHash, gitRemote };\n\nexport const VENCORD_USER_AGENT = `Vencord/${gitHash}${gitRemote ? ` (https://github.com/${gitRemote})` : \"\"}`;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport https from \"https\";\n\nexport function get(url: string, options: https.RequestOptions = {}) {\n return new Promise((resolve, reject) => {\n https.get(url, options, res => {\n const { statusCode, statusMessage, headers } = res;\n if (statusCode! >= 400)\n return void reject(`${statusCode}: ${statusMessage} - ${url}`);\n if (statusCode! >= 300)\n return void resolve(get(headers.location!, options));\n\n const chunks = [] as Buffer[];\n res.on(\"error\", reject);\n\n res.on(\"data\", chunk => chunks.push(chunk));\n res.once(\"end\", () => resolve(Buffer.concat(chunks)));\n });\n });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport const VENCORD_FILES = [\n IS_DISCORD_DESKTOP ? \"patcher.js\" : \"vencordDesktopMain.js\",\n IS_DISCORD_DESKTOP ? \"preload.js\" : \"vencordDesktopPreload.js\",\n IS_DISCORD_DESKTOP ? \"renderer.js\" : \"vencordDesktopRenderer.js\",\n IS_DISCORD_DESKTOP ? \"renderer.css\" : \"vencordDesktopRenderer.css\",\n];\n\nexport function serializeErrors(func: (...args: any[]) => any) {\n return async function () {\n try {\n return {\n ok: true,\n value: await func(...arguments)\n };\n } catch (e: any) {\n return {\n ok: false,\n error: e instanceof Error ? {\n // prototypes get lost, so turn error into plain object\n ...e\n } : e\n };\n }\n };\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { IpcEvents } from \"@shared/IpcEvents\";\nimport { VENCORD_USER_AGENT } from \"@shared/vencordUserAgent\";\nimport { ipcMain } from \"electron\";\nimport { writeFile } from \"fs/promises\";\nimport { join } from \"path\";\n\nimport gitHash from \"~git-hash\";\nimport gitRemote from \"~git-remote\";\n\nimport { get } from \"../utils/simpleGet\";\nimport { serializeErrors, VENCORD_FILES } from \"./common\";\n\nconst API_BASE = `https://api.github.com/repos/${gitRemote}`;\nlet PendingUpdates = [] as [string, string][];\n\nasync function githubGet(endpoint: string) {\n return get(API_BASE + endpoint, {\n headers: {\n Accept: \"application/vnd.github+json\",\n // \"All API requests MUST include a valid User-Agent header.\n // Requests with no User-Agent header will be rejected.\"\n \"User-Agent\": VENCORD_USER_AGENT\n }\n });\n}\n\nasync function calculateGitChanges() {\n const isOutdated = await fetchUpdates();\n if (!isOutdated) return [];\n\n const res = await githubGet(`/compare/${gitHash}...HEAD`);\n\n const data = JSON.parse(res.toString(\"utf-8\"));\n return data.commits.map((c: any) => ({\n // github api only sends the long sha\n hash: c.sha.slice(0, 7),\n author: c.author.login,\n message: c.commit.message.substring(c.commit.message.indexOf(\"\\n\") + 1)\n }));\n}\n\nasync function fetchUpdates() {\n const release = await githubGet(\"/releases/latest\");\n\n const data = JSON.parse(release.toString());\n const hash = data.name.slice(data.name.lastIndexOf(\" \") + 1);\n if (hash === gitHash)\n return false;\n\n data.assets.forEach(({ name, browser_download_url }) => {\n if (VENCORD_FILES.some(s => name.startsWith(s))) {\n PendingUpdates.push([name, browser_download_url]);\n }\n });\n return true;\n}\n\nasync function applyUpdates() {\n await Promise.all(PendingUpdates.map(\n async ([name, data]) => writeFile(\n join(__dirname, name),\n await get(data)\n )\n ));\n PendingUpdates = [];\n return true;\n}\n\nipcMain.handle(IpcEvents.GET_REPO, serializeErrors(() => `https://github.com/${gitRemote}`));\nipcMain.handle(IpcEvents.GET_UPDATES, serializeErrors(calculateGitChanges));\nipcMain.handle(IpcEvents.UPDATE, serializeErrors(fetchUpdates));\nipcMain.handle(IpcEvents.BUILD, serializeErrors(applyUpdates));\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { app, protocol, session } from \"electron\";\nimport { join } from \"path\";\n\nimport { ensureSafePath } from \"./ipcMain\";\nimport { RendererSettings } from \"./settings\";\nimport { IS_VANILLA, THEMES_DIR } from \"./utils/constants\";\nimport { installExt } from \"./utils/extensions\";\n\nif (IS_VESKTOP || !IS_VANILLA) {\n app.whenReady().then(() => {\n // Source Maps! Maybe there's a better way but since the renderer is executed\n // from a string I don't think any other form of sourcemaps would work\n protocol.registerFileProtocol(\"vencord\", ({ url: unsafeUrl }, cb) => {\n let url = unsafeUrl.slice(\"vencord://\".length);\n if (url.endsWith(\"/\")) url = url.slice(0, -1);\n if (url.startsWith(\"/themes/\")) {\n const theme = url.slice(\"/themes/\".length);\n const safeUrl = ensureSafePath(THEMES_DIR, theme);\n if (!safeUrl) {\n cb({ statusCode: 403 });\n return;\n }\n cb(safeUrl.replace(/\\?v=\\d+$/, \"\"));\n return;\n }\n switch (url) {\n case \"renderer.js.map\":\n case \"vencordDesktopRenderer.js.map\":\n case \"preload.js.map\":\n case \"vencordDesktopPreload.js.map\":\n case \"patcher.js.map\":\n case \"vencordDesktopMain.js.map\":\n cb(join(__dirname, url));\n break;\n default:\n cb({ statusCode: 403 });\n }\n });\n\n try {\n if (RendererSettings.store.enableReactDevtools)\n installExt(\"fmkadmapgofadopljbjfkapdkoienihi\")\n .then(() => console.info(\"[Vencord] Installed React Developer Tools\"))\n .catch(err => console.error(\"[Vencord] Failed to install React Developer Tools\", err));\n } catch { }\n\n\n const findHeader = (headers: Record, headerName: Lowercase) => {\n return Object.keys(headers).find(h => h.toLowerCase() === headerName);\n };\n\n // Remove CSP\n type PolicyResult = Record;\n\n const parsePolicy = (policy: string): PolicyResult => {\n const result: PolicyResult = {};\n policy.split(\";\").forEach(directive => {\n const [directiveKey, ...directiveValue] = directive.trim().split(/\\s+/g);\n if (directiveKey && !Object.prototype.hasOwnProperty.call(result, directiveKey)) {\n result[directiveKey] = directiveValue;\n }\n });\n\n return result;\n };\n const stringifyPolicy = (policy: PolicyResult): string =>\n Object.entries(policy)\n .filter(([, values]) => values?.length)\n .map(directive => directive.flat().join(\" \"))\n .join(\"; \");\n\n const patchCsp = (headers: Record) => {\n const header = findHeader(headers, \"content-security-policy\");\n\n if (header) {\n const csp = parsePolicy(headers[header][0]);\n\n for (const directive of [\"style-src\", \"connect-src\", \"img-src\", \"font-src\", \"media-src\", \"worker-src\"]) {\n csp[directive] ??= [];\n csp[directive].push(\"*\", \"blob:\", \"data:\", \"vencord:\", \"'unsafe-inline'\");\n }\n\n // TODO: Restrict this to only imported packages with fixed version.\n // Perhaps auto generate with esbuild\n csp[\"script-src\"] ??= [];\n csp[\"script-src\"].push(\"'unsafe-eval'\", \"https://unpkg.com\", \"https://cdnjs.cloudflare.com\");\n headers[header] = [stringifyPolicy(csp)];\n }\n };\n\n session.defaultSession.webRequest.onHeadersReceived(({ responseHeaders, resourceType }, cb) => {\n if (responseHeaders) {\n if (resourceType === \"mainFrame\")\n patchCsp(responseHeaders);\n\n // Fix hosts that don't properly set the css content type, such as\n // raw.githubusercontent.com\n if (resourceType === \"stylesheet\") {\n const header = findHeader(responseHeaders, \"content-type\");\n if (header)\n responseHeaders[header] = [\"text/css\"];\n }\n }\n\n cb({ cancel: false, responseHeaders });\n });\n\n // assign a noop to onHeadersReceived to prevent other mods from adding their own incompatible ones.\n // For instance, OpenAsar adds their own that doesn't fix content-type for stylesheets which makes it\n // impossible to load css from github raw despite our fix above\n session.defaultSession.webRequest.onHeadersReceived = () => { };\n });\n}\n\nif (IS_DISCORD_DESKTOP) {\n require(\"./patcher\");\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./updater\";\nimport \"./ipcPlugins\";\nimport \"./settings\";\n\nimport { debounce } from \"@shared/debounce\";\nimport { IpcEvents } from \"@shared/IpcEvents\";\nimport { BrowserWindow, ipcMain, shell, systemPreferences } from \"electron\";\nimport { FSWatcher, mkdirSync, watch, writeFileSync } from \"fs\";\nimport { open, readdir, readFile } from \"fs/promises\";\nimport { join, normalize } from \"path\";\n\nimport monacoHtml from \"~fileContent/monacoWin.html;base64\";\n\nimport { getThemeInfo, stripBOM, UserThemeHeader } from \"./themes\";\nimport { ALLOWED_PROTOCOLS, QUICKCSS_PATH, THEMES_DIR } from \"./utils/constants\";\nimport { makeLinksOpenExternally } from \"./utils/externalLinks\";\n\nmkdirSync(THEMES_DIR, { recursive: true });\n\nexport function ensureSafePath(basePath: string, path: string) {\n const normalizedBasePath = normalize(basePath);\n const newPath = join(basePath, path);\n const normalizedPath = normalize(newPath);\n return normalizedPath.startsWith(normalizedBasePath) ? normalizedPath : null;\n}\n\nfunction readCss() {\n return readFile(QUICKCSS_PATH, \"utf-8\").catch(() => \"\");\n}\n\nasync function listThemes(): Promise {\n const files = await readdir(THEMES_DIR).catch(() => []);\n\n const themeInfo: UserThemeHeader[] = [];\n\n for (const fileName of files) {\n if (!fileName.endsWith(\".css\")) continue;\n\n const data = await getThemeData(fileName).then(stripBOM).catch(() => null);\n if (data == null) continue;\n\n themeInfo.push(getThemeInfo(data, fileName));\n }\n\n return themeInfo;\n}\n\nfunction getThemeData(fileName: string) {\n fileName = fileName.replace(/\\?v=\\d+$/, \"\");\n const safePath = ensureSafePath(THEMES_DIR, fileName);\n if (!safePath) return Promise.reject(`Unsafe path ${fileName}`);\n return readFile(safePath, \"utf-8\");\n}\n\nipcMain.handle(IpcEvents.OPEN_QUICKCSS, () => shell.openPath(QUICKCSS_PATH));\n\nipcMain.handle(IpcEvents.OPEN_EXTERNAL, (_, url) => {\n try {\n var { protocol } = new URL(url);\n } catch {\n throw \"Malformed URL\";\n }\n if (!ALLOWED_PROTOCOLS.includes(protocol))\n throw \"Disallowed protocol.\";\n\n shell.openExternal(url);\n});\n\n\nipcMain.handle(IpcEvents.GET_QUICK_CSS, () => readCss());\nipcMain.handle(IpcEvents.SET_QUICK_CSS, (_, css) =>\n writeFileSync(QUICKCSS_PATH, css)\n);\n\nipcMain.handle(IpcEvents.GET_THEMES_DIR, () => THEMES_DIR);\nipcMain.handle(IpcEvents.GET_THEMES_LIST, () => listThemes());\nipcMain.handle(IpcEvents.GET_THEME_DATA, (_, fileName) => getThemeData(fileName));\nipcMain.handle(IpcEvents.GET_THEME_SYSTEM_VALUES, () => ({\n // win & mac only\n \"os-accent-color\": `#${systemPreferences.getAccentColor?.() || \"\"}`\n}));\n\n\nexport function initIpc(mainWindow: BrowserWindow) {\n let quickCssWatcher: FSWatcher | undefined;\n\n open(QUICKCSS_PATH, \"a+\").then(fd => {\n fd.close();\n quickCssWatcher = watch(QUICKCSS_PATH, { persistent: false }, debounce(async () => {\n mainWindow.webContents.postMessage(IpcEvents.QUICK_CSS_UPDATE, await readCss());\n }, 50));\n }).catch(() => { });\n\n const themesWatcher = watch(THEMES_DIR, { persistent: false }, debounce(() => {\n mainWindow.webContents.postMessage(IpcEvents.THEME_UPDATE, void 0);\n }));\n\n mainWindow.once(\"closed\", () => {\n quickCssWatcher?.close();\n themesWatcher.close();\n });\n}\n\nipcMain.handle(IpcEvents.OPEN_MONACO_EDITOR, async () => {\n const title = \"Vencord QuickCSS Editor\";\n const existingWindow = BrowserWindow.getAllWindows().find(w => w.title === title);\n if (existingWindow && !existingWindow.isDestroyed()) {\n existingWindow.focus();\n return;\n }\n\n const win = new BrowserWindow({\n title,\n autoHideMenuBar: true,\n darkTheme: true,\n webPreferences: {\n preload: join(__dirname, IS_DISCORD_DESKTOP ? \"preload.js\" : \"vencordDesktopPreload.js\"),\n contextIsolation: true,\n nodeIntegration: false,\n sandbox: false\n }\n });\n\n makeLinksOpenExternally(win);\n\n await win.loadURL(`data:text/html;base64,${monacoHtml}`);\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nif (!IS_UPDATER_DISABLED)\n import(IS_STANDALONE ? \"./http\" : \"./git\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { IpcEvents } from \"@shared/IpcEvents\";\nimport { ipcMain } from \"electron\";\n\nimport PluginNatives from \"~pluginNatives\";\n\nconst PluginIpcMappings = {} as Record>;\nexport type PluginIpcMappings = typeof PluginIpcMappings;\n\nfor (const [plugin, methods] of Object.entries(PluginNatives)) {\n const entries = Object.entries(methods);\n if (!entries.length) continue;\n\n const mappings = PluginIpcMappings[plugin] = {};\n\n for (const [methodName, method] of entries) {\n const key = `VencordPluginNative_${plugin}_${methodName}`;\n ipcMain.handle(key, method);\n mappings[methodName] = key;\n }\n}\n\nipcMain.on(IpcEvents.GET_PLUGIN_IPC_METHOD_MAP, e => {\n e.returnValue = PluginIpcMappings;\n});\n", "import * as p0 from \"./plugins/fixSpotifyEmbeds.desktop/native\";\nimport * as p1 from \"./plugins/fixYoutubeEmbeds.desktop/native\";\nimport * as p2 from \"./plugins/openInApp/native\";\nimport * as p3 from \"./plugins/voiceMessages/native\";\nimport * as p4 from \"./plugins/xsOverlay.desktop/native\";\nexport default {\n\"FixSpotifyEmbeds\":p0,\n\"FixYoutubeEmbeds\":p1,\n\"OpenInApp\":p2,\n\"VoiceMessages\":p3,\n\"XsOverlay\":p4,\n};", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { RendererSettings } from \"@main/settings\";\nimport { app } from \"electron\";\n\napp.on(\"browser-window-created\", (_, win) => {\n win.webContents.on(\"frame-created\", (_, { frame }) => {\n frame.once(\"dom-ready\", () => {\n if (frame.url.startsWith(\"https://open.spotify.com/embed/\")) {\n const settings = RendererSettings.store.plugins?.FixSpotifyEmbeds;\n if (!settings?.enabled) return;\n\n frame.executeJavaScript(`\n const original = Audio.prototype.play;\n Audio.prototype.play = function() {\n this.volume = ${(settings.volume / 100) || 0.1};\n return original.apply(this, arguments);\n }\n `);\n }\n });\n });\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2024 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport type { Settings } from \"@api/Settings\";\nimport { IpcEvents } from \"@shared/IpcEvents\";\nimport { SettingsStore } from \"@shared/SettingsStore\";\nimport { ipcMain } from \"electron\";\nimport { mkdirSync, readFileSync, writeFileSync } from \"fs\";\n\nimport { NATIVE_SETTINGS_FILE, SETTINGS_DIR, SETTINGS_FILE } from \"./utils/constants\";\n\nmkdirSync(SETTINGS_DIR, { recursive: true });\n\nfunction readSettings(name: string, file: string): Partial {\n try {\n return JSON.parse(readFileSync(file, \"utf-8\"));\n } catch (err: any) {\n if (err?.code !== \"ENOENT\")\n console.error(`Failed to read ${name} settings`, err);\n\n return {};\n }\n}\n\nexport const RendererSettings = new SettingsStore(readSettings(\"renderer\", SETTINGS_FILE));\n\nRendererSettings.addGlobalChangeListener(() => {\n try {\n writeFileSync(SETTINGS_FILE, JSON.stringify(RendererSettings.plain, null, 4));\n } catch (e) {\n console.error(\"Failed to write renderer settings\", e);\n }\n});\n\nipcMain.handle(IpcEvents.GET_SETTINGS_DIR, () => SETTINGS_DIR);\nipcMain.on(IpcEvents.GET_SETTINGS, e => e.returnValue = RendererSettings.plain);\n\nipcMain.handle(IpcEvents.SET_SETTINGS, (_, data: Settings, pathToNotify?: string) => {\n RendererSettings.setData(data, pathToNotify);\n});\n\nexport const NativeSettings = new SettingsStore(readSettings(\"native\", NATIVE_SETTINGS_FILE));\n\nNativeSettings.addGlobalChangeListener(() => {\n try {\n writeFileSync(NATIVE_SETTINGS_FILE, JSON.stringify(NativeSettings.plain, null, 4));\n } catch (e) {\n console.error(\"Failed to write native settings\", e);\n }\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2024 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { LiteralUnion } from \"type-fest\";\n\n// Resolves a possibly nested prop in the form of \"some.nested.prop\" to type of T.some.nested.prop\ntype ResolvePropDeep = P extends `${infer Pre}.${infer Suf}`\n ? Pre extends keyof T\n ? ResolvePropDeep\n : any\n : P extends keyof T\n ? T[P]\n : any;\n\ninterface SettingsStoreOptions {\n readOnly?: boolean;\n getDefaultValue?: (data: {\n target: any;\n key: string;\n root: any;\n path: string;\n }) => any;\n}\n\n// merges the SettingsStoreOptions type into the class\nexport interface SettingsStore extends SettingsStoreOptions { }\n\n/**\n * The SettingsStore allows you to easily create a mutable store that\n * has support for global and path-based change listeners.\n */\nexport class SettingsStore {\n private pathListeners = new Map void>>();\n private globalListeners = new Set<(newData: T, path: string) => void>();\n\n /**\n * The store object. Making changes to this object will trigger the applicable change listeners\n */\n public declare store: T;\n /**\n * The plain data. Changes to this object will not trigger any change listeners\n */\n public declare plain: T;\n\n public constructor(plain: T, options: SettingsStoreOptions = {}) {\n this.plain = plain;\n this.store = this.makeProxy(plain);\n Object.assign(this, options);\n }\n\n private makeProxy(object: any, root: T = object, path: string = \"\") {\n const self = this;\n\n return new Proxy(object, {\n get(target, key: string) {\n let v = target[key];\n\n if (!(key in target) && self.getDefaultValue) {\n v = self.getDefaultValue({\n target,\n key,\n root,\n path\n });\n }\n\n if (typeof v === \"object\" && v !== null && !Array.isArray(v))\n return self.makeProxy(v, root, `${path}${path && \".\"}${key}`);\n\n return v;\n },\n set(target, key: string, value) {\n if (target[key] === value) return true;\n\n Reflect.set(target, key, value);\n const setPath = `${path}${path && \".\"}${key}`;\n\n self.globalListeners.forEach(cb => cb(value, setPath));\n self.pathListeners.get(setPath)?.forEach(cb => cb(value));\n\n return true;\n }\n });\n }\n\n /**\n * Set the data of the store.\n * This will update this.store and this.plain (and old references to them will be stale! Avoid storing them in variables)\n *\n * Additionally, all global listeners (and those for pathToNotify, if specified) will be called with the new data\n * @param value New data\n * @param pathToNotify Optional path to notify instead of globally. Used to transfer path via ipc\n */\n public setData(value: T, pathToNotify?: string) {\n if (this.readOnly) throw new Error(\"SettingsStore is read-only\");\n\n this.plain = value;\n this.store = this.makeProxy(value);\n\n if (pathToNotify) {\n let v = value;\n\n const path = pathToNotify.split(\".\");\n for (const p of path) {\n if (!v) {\n console.warn(\n `Settings#setData: Path ${pathToNotify} does not exist in new data. Not dispatching update`\n );\n return;\n }\n v = v[p];\n }\n\n this.pathListeners.get(pathToNotify)?.forEach(cb => cb(v));\n }\n\n this.markAsChanged();\n }\n\n /**\n * Add a global change listener, that will fire whenever any setting is changed\n *\n * @param data The new data. This is either the new value set on the path, or the new root object if it was changed\n * @param path The path of the setting that was changed. Empty string if the root object was changed\n */\n public addGlobalChangeListener(cb: (data: any, path: string) => void) {\n this.globalListeners.add(cb);\n }\n\n /**\n * Add a scoped change listener that will fire whenever a setting matching the specified path is changed.\n *\n * For example if path is `\"foo.bar\"`, the listener will fire on\n * ```js\n * Setting.store.foo.bar = \"hi\"\n * ```\n * but not on\n * ```js\n * Setting.store.foo.baz = \"hi\"\n * ```\n * @param path\n * @param cb\n */\n public addChangeListener

>(\n path: P,\n cb: (data: ResolvePropDeep) => void\n ) {\n const listeners = this.pathListeners.get(path as string) ?? new Set();\n listeners.add(cb);\n this.pathListeners.set(path as string, listeners);\n }\n\n /**\n * Remove a global listener\n * @see {@link addGlobalChangeListener}\n */\n public removeGlobalChangeListener(cb: (data: any, path: string) => void) {\n this.globalListeners.delete(cb);\n }\n\n /**\n * Remove a scoped listener\n * @see {@link addChangeListener}\n */\n public removeChangeListener(path: LiteralUnion, cb: (data: any) => void) {\n const listeners = this.pathListeners.get(path as string);\n if (!listeners) return;\n\n listeners.delete(cb);\n if (!listeners.size) this.pathListeners.delete(path as string);\n }\n\n /**\n * Call all global change listeners\n */\n public markAsChanged() {\n this.globalListeners.forEach(cb => cb(this.plain, \"\"));\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { app } from \"electron\";\nimport { join } from \"path\";\n\nexport const DATA_DIR = process.env.VENCORD_USER_DATA_DIR ?? (\n process.env.DISCORD_USER_DATA_DIR\n ? join(process.env.DISCORD_USER_DATA_DIR, \"..\", \"VencordData\")\n : join(app.getPath(\"userData\"), \"..\", \"Vencord\")\n);\nexport const SETTINGS_DIR = join(DATA_DIR, \"settings\");\nexport const THEMES_DIR = join(DATA_DIR, \"themes\");\nexport const QUICKCSS_PATH = join(SETTINGS_DIR, \"quickCss.css\");\nexport const SETTINGS_FILE = join(SETTINGS_DIR, \"settings.json\");\nexport const NATIVE_SETTINGS_FILE = join(SETTINGS_DIR, \"native-settings.json\");\nexport const ALLOWED_PROTOCOLS = [\n \"https:\",\n \"http:\",\n \"steam:\",\n \"spotify:\",\n \"com.epicgames.launcher:\",\n];\n\nexport const IS_VANILLA = /* @__PURE__ */ process.argv.includes(\"--vanilla\");\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { RendererSettings } from \"@main/settings\";\nimport { app } from \"electron\";\n\napp.on(\"browser-window-created\", (_, win) => {\n win.webContents.on(\"frame-created\", (_, { frame }) => {\n frame.once(\"dom-ready\", () => {\n if (frame.url.startsWith(\"https://www.youtube.com/\")) {\n const settings = RendererSettings.store.plugins?.FixYoutubeEmbeds;\n if (!settings?.enabled) return;\n\n frame.executeJavaScript(`\n new MutationObserver(() => {\n if(\n document.querySelector('div.ytp-error-content-wrap-subreason a[href*=\"www.youtube.com/watch?v=\"]')\n ) location.reload()\n }).observe(document.body, { childList: true, subtree:true });\n `);\n }\n });\n });\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { IpcMainInvokeEvent } from \"electron\";\nimport { request } from \"https\";\n\n// These links don't support CORS, so this has to be native\nconst validRedirectUrls = /^https:\\/\\/(spotify\\.link|s\\.team)\\/.+$/;\n\nfunction getRedirect(url: string) {\n return new Promise((resolve, reject) => {\n const req = request(new URL(url), { method: \"HEAD\" }, res => {\n resolve(\n res.headers.location\n ? getRedirect(res.headers.location)\n : url\n );\n });\n req.on(\"error\", reject);\n req.end();\n });\n}\n\nexport async function resolveRedirect(_: IpcMainInvokeEvent, url: string) {\n if (!validRedirectUrls.test(url)) return url;\n\n return getRedirect(url);\n}\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { app } from \"electron\";\nimport { readFile } from \"fs/promises\";\nimport { basename, normalize } from \"path\";\n\nexport async function readRecording(_, filePath: string) {\n filePath = normalize(filePath);\n const filename = basename(filePath);\n const discordBaseDirWithTrailingSlash = normalize(app.getPath(\"userData\") + \"/\");\n console.log(filename, discordBaseDirWithTrailingSlash, filePath);\n if (filename !== \"recording.ogg\" || !filePath.startsWith(discordBaseDirWithTrailingSlash)) return null;\n\n try {\n const buf = await readFile(filePath);\n return new Uint8Array(buf.buffer);\n } catch {\n return null;\n }\n}\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { createSocket, Socket } from \"dgram\";\n\nlet xsoSocket: Socket;\n\nexport function sendToOverlay(_, data: any) {\n data.icon = Buffer.from(data.icon).toString(\"base64\");\n const json = JSON.stringify(data);\n xsoSocket ??= createSocket(\"udp4\");\n xsoSocket.send(json, 42069, \"127.0.0.1\");\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n/**\n * Returns a new function that will call the wrapped function\n * after the specified delay. If the function is called again\n * within the delay, the timer will be reset.\n * @param func The function to wrap\n * @param delay The delay in milliseconds\n */\nexport function debounce(func: T, delay = 300): T {\n let timeout: NodeJS.Timeout;\n return function (...args: any[]) {\n clearTimeout(timeout);\n timeout = setTimeout(() => { func(...args); }, delay);\n } as any;\n}\n", "export default \"PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KICAgIDxoZWFkPgogICAgICAgIDxtZXRhIGNoYXJzZXQ9InV0Zi04IiAvPgogICAgICAgIDx0aXRsZT5WZW5jb3JkIFF1aWNrQ1NTIEVkaXRvcjwvdGl0bGU+CiAgICAgICAgPGxpbmsKICAgICAgICAgICAgcmVsPSJzdHlsZXNoZWV0IgogICAgICAgICAgICBocmVmPSJodHRwczovL2NkbmpzLmNsb3VkZmxhcmUuY29tL2FqYXgvbGlicy9tb25hY28tZWRpdG9yLzAuNDAuMC9taW4vdnMvZWRpdG9yL2VkaXRvci5tYWluLm1pbi5jc3MiCiAgICAgICAgICAgIGludGVncml0eT0ic2hhNTEyLU1Pb1EwMmg4MGhrbGNjZkxyWEZZa0N6RytXVmpPUmZsT3A5WnA4ZGx0aWFSUCszNUxZbk80TEtPa2xSNjRvTUdmR2dKRExPOFdKcGtNMW81Z1pYWVpRPT0iCiAgICAgICAgICAgIGNyb3Nzb3JpZ2luPSJhbm9ueW1vdXMiCiAgICAgICAgICAgIHJlZmVycmVycG9saWN5PSJuby1yZWZlcnJlciIKICAgICAgICAvPgogICAgICAgIDxzdHlsZT4KICAgICAgICAgICAgaHRtbCwKICAgICAgICAgICAgYm9keSwKICAgICAgICAgICAgI2NvbnRhaW5lciB7CiAgICAgICAgICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7CiAgICAgICAgICAgICAgICBsZWZ0OiAwOwogICAgICAgICAgICAgICAgdG9wOiAwOwogICAgICAgICAgICAgICAgd2lkdGg6IDEwMCU7CiAgICAgICAgICAgICAgICBoZWlnaHQ6IDEwMCU7CiAgICAgICAgICAgICAgICBtYXJnaW46IDA7CiAgICAgICAgICAgICAgICBwYWRkaW5nOiAwOwogICAgICAgICAgICAgICAgb3ZlcmZsb3c6IGhpZGRlbjsKICAgICAgICAgICAgfQogICAgICAgIDwvc3R5bGU+CiAgICA8L2hlYWQ+CgogICAgPGJvZHk+CiAgICAgICAgPGRpdiBpZD0iY29udGFpbmVyIj48L2Rpdj4KICAgICAgICA8c2NyaXB0CiAgICAgICAgICAgIHNyYz0iaHR0cHM6Ly9jZG5qcy5jbG91ZGZsYXJlLmNvbS9hamF4L2xpYnMvbW9uYWNvLWVkaXRvci8wLjQwLjAvbWluL3ZzL2xvYWRlci5taW4uanMiCiAgICAgICAgICAgIGludGVncml0eT0ic2hhNTEyLVF6TXBYZUNQY2lBSFA0d2JZbFYyUFlnclFjYUVrRFFVanprUFU0eG5qeVZTRDlUMzYvdWRhbXh0TkJxYjRxSzQvYk1RTVBaOGF5ckJlOWhyR2RCRmpRPT0iCiAgICAgICAgICAgIGNyb3Nzb3JpZ2luPSJhbm9ueW1vdXMiCiAgICAgICAgICAgIHJlZmVycmVycG9saWN5PSJuby1yZWZlcnJlciIKICAgICAgICA+PC9zY3JpcHQ+CgogICAgICAgIDxzY3JpcHQ+CiAgICAgICAgICAgIHJlcXVpcmUuY29uZmlnKHsKICAgICAgICAgICAgICAgIHBhdGhzOiB7CiAgICAgICAgICAgICAgICAgICAgdnM6ICJodHRwczovL2NkbmpzLmNsb3VkZmxhcmUuY29tL2FqYXgvbGlicy9tb25hY28tZWRpdG9yLzAuNDAuMC9taW4vdnMiLAogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgfSk7CgogICAgICAgICAgICByZXF1aXJlKFsidnMvZWRpdG9yL2VkaXRvci5tYWluIl0sICgpID0+IHsKICAgICAgICAgICAgICAgIGdldEN1cnJlbnRDc3MoKS50aGVuKChjc3MpID0+IHsKICAgICAgICAgICAgICAgICAgICB2YXIgZWRpdG9yID0gbW9uYWNvLmVkaXRvci5jcmVhdGUoCiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJjb250YWluZXIiKSwKICAgICAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IGNzcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhbmd1YWdlOiAiY3NzIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZW1lOiBnZXRUaGVtZSgpLAogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgKTsKICAgICAgICAgICAgICAgICAgICBlZGl0b3Iub25EaWRDaGFuZ2VNb2RlbENvbnRlbnQoKCkgPT4KICAgICAgICAgICAgICAgICAgICAgICAgc2V0Q3NzKGVkaXRvci5nZXRWYWx1ZSgpKQogICAgICAgICAgICAgICAgICAgICk7CiAgICAgICAgICAgICAgICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoInJlc2l6ZSIsICgpID0+IHsKICAgICAgICAgICAgICAgICAgICAgICAgLy8gbWFrZSBtb25hY28gcmUtbGF5b3V0CiAgICAgICAgICAgICAgICAgICAgICAgIGVkaXRvci5sYXlvdXQoKTsKICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9KTsKICAgICAgICA8L3NjcmlwdD4KICAgIDwvYm9keT4KPC9odG1sPgo=\"", "/* eslint-disable simple-header/header */\n\n/*!\n * BetterDiscord addon meta parser\n * Copyright 2023 BetterDiscord contributors\n * Copyright 2023 Vendicated and Vencord contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst splitRegex = /[^\\S\\r\\n]*?\\r?(?:\\r\\n|\\n)[^\\S\\r\\n]*?\\*[^\\S\\r\\n]?/;\nconst escapedAtRegex = /^\\\\@/;\n\nexport interface UserThemeHeader {\n fileName: string;\n name: string;\n author: string;\n description: string;\n version?: string;\n license?: string;\n source?: string;\n website?: string;\n invite?: string;\n}\n\nfunction makeHeader(fileName: string, opts: Partial = {}): UserThemeHeader {\n return {\n fileName,\n name: opts.name ?? fileName.replace(/\\.css$/i, \"\"),\n author: opts.author ?? \"Unknown Author\",\n description: opts.description ?? \"A Discord Theme.\",\n version: opts.version,\n license: opts.license,\n source: opts.source,\n website: opts.website,\n invite: opts.invite\n };\n}\n\nexport function stripBOM(fileContent: string) {\n if (fileContent.charCodeAt(0) === 0xFEFF) {\n fileContent = fileContent.slice(1);\n }\n return fileContent;\n}\n\nexport function getThemeInfo(css: string, fileName: string): UserThemeHeader {\n if (!css) return makeHeader(fileName);\n\n const block = css.split(\"/**\", 2)?.[1]?.split(\"*/\", 1)?.[0];\n if (!block) return makeHeader(fileName);\n\n const header: Partial = {};\n let field = \"\";\n let accum = \"\";\n for (const line of block.split(splitRegex)) {\n if (line.length === 0) continue;\n if (line.charAt(0) === \"@\" && line.charAt(1) !== \" \") {\n header[field] = accum.trim();\n const l = line.indexOf(\" \");\n field = line.substring(1, l);\n accum = line.substring(l + 1);\n }\n else {\n accum += \" \" + line.replace(\"\\\\n\", \"\\n\").replace(escapedAtRegex, \"@\");\n }\n }\n header[field] = accum.trim();\n delete header[\"\"];\n return makeHeader(fileName, header);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { type BrowserWindow, shell } from \"electron\";\n\nexport function makeLinksOpenExternally(win: BrowserWindow) {\n win.webContents.setWindowOpenHandler(({ url }) => {\n switch (url) {\n case \"about:blank\":\n case \"https://discord.com/popout\":\n case \"https://ptb.discord.com/popout\":\n case \"https://canary.discord.com/popout\":\n return { action: \"allow\" };\n }\n\n try {\n var { protocol } = new URL(url);\n } catch {\n return { action: \"deny\" };\n }\n\n switch (protocol) {\n case \"http:\":\n case \"https:\":\n case \"mailto:\":\n case \"steam:\":\n case \"spotify:\":\n shell.openExternal(url);\n }\n\n return { action: \"deny\" };\n });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { session } from \"electron\";\nimport { unzip } from \"fflate\";\nimport { constants as fsConstants } from \"fs\";\nimport { access, mkdir, rm, writeFile } from \"fs/promises\";\nimport { join } from \"path\";\n\nimport { DATA_DIR } from \"./constants\";\nimport { crxToZip } from \"./crxToZip\";\nimport { get } from \"./simpleGet\";\n\nconst extensionCacheDir = join(DATA_DIR, \"ExtensionCache\");\n\nasync function extract(data: Buffer, outDir: string) {\n await mkdir(outDir, { recursive: true });\n return new Promise((resolve, reject) => {\n unzip(data, (err, files) => {\n if (err) return void reject(err);\n Promise.all(Object.keys(files).map(async f => {\n // Signature stuff\n // 'Cannot load extension with file or directory name\n // _metadata. Filenames starting with \"_\" are reserved for use by the system.';\n if (f.startsWith(\"_metadata/\")) return;\n\n if (f.endsWith(\"/\")) return void mkdir(join(outDir, f), { recursive: true });\n\n const pathElements = f.split(\"/\");\n const name = pathElements.pop()!;\n const directories = pathElements.join(\"/\");\n const dir = join(outDir, directories);\n\n if (directories) {\n await mkdir(dir, { recursive: true });\n }\n\n await writeFile(join(dir, name), files[f]);\n }))\n .then(() => resolve())\n .catch(err => {\n rm(outDir, { recursive: true, force: true });\n reject(err);\n });\n });\n });\n}\n\nexport async function installExt(id: string) {\n const extDir = join(extensionCacheDir, `${id}`);\n\n try {\n await access(extDir, fsConstants.F_OK);\n } catch (err) {\n const url = id === \"fmkadmapgofadopljbjfkapdkoienihi\"\n // React Devtools v4.25\n // v4.27 is broken in Electron, see https://github.com/facebook/react/issues/25843\n // Unfortunately, Google does not serve old versions, so this is the only way\n ? \"https://raw.githubusercontent.com/Vendicated/random-files/f6f550e4c58ac5f2012095a130406c2ab25b984d/fmkadmapgofadopljbjfkapdkoienihi.zip\"\n : `https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&x=id%3D${id}%26uc&prodversion=32`;\n const buf = await get(url, {\n headers: {\n \"User-Agent\": \"Vencord (https://github.com/Vendicated/Vencord)\"\n }\n });\n await extract(crxToZip(buf), extDir).catch(console.error);\n }\n\n session.defaultSession.loadExtension(extDir);\n}\n", "import { createRequire } from 'module';\nvar require = createRequire('/');\n// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\n// Mediocre shim\nvar Worker;\nvar workerAdd = \";var __w=require('worker_threads');__w.parentPort.on('message',function(m){onmessage({data:m})}),postMessage=function(m,t){__w.parentPort.postMessage(m,t)},close=process.exit;self=global\";\ntry {\n Worker = require('worker_threads').Worker;\n}\ncatch (e) {\n}\nvar wk = Worker ? function (c, _, msg, transfer, cb) {\n var done = false;\n var w = new Worker(c + workerAdd, { eval: true })\n .on('error', function (e) { return cb(e, null); })\n .on('message', function (m) { return cb(null, m); })\n .on('exit', function (c) {\n if (c && !done)\n cb(new Error('exited with code ' + c), null);\n });\n w.postMessage(msg, transfer);\n w.terminate = function () {\n done = true;\n return Worker.prototype.terminate.call(w);\n };\n return w;\n} : function (_, __, ___, ____, cb) {\n setImmediate(function () { return cb(new Error('async operations unsupported - update to Node 12+ (or Node 10-11 with the --experimental-worker CLI flag)'), null); });\n var NOP = function () { };\n return {\n terminate: NOP,\n postMessage: NOP\n };\n};\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, u32 = Uint32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\n// see fleb note\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new u32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = ((j - b[i]) << 5) | i;\n }\n }\n return [b, r];\n};\nvar _a = freb(fleb, 2), fl = _a[0], revfl = _a[1];\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b[0], revfd = _b[1];\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n // reverse table algorithm from SO\n var x = ((i & 0xAAAA) >>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i) {\n if (cd[i])\n ++l[cd[i] - 1];\n }\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v.BYTES_PER_ELEMENT == 2 ? u16 : v.BYTES_PER_ELEMENT == 4 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n if (!sl || (st && st.f && !st.l))\n return buf || new u8(0);\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [et, 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e >= s) {\n // write final block\n w[pos >> 3] = lst;\n }\n pos = wfblk(w, pos + 1, dat.subarray(i, e));\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n // deopt when i > s - 3 - at end, deopt acceptable\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst && pos & 7)\n pos = wfblk(w, pos + 1, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/\\s+/g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k].buffer) {\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += d[10] | (d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if (d[1] & 32)\n err(6, 'invalid zlib data: preset dictionaries not supported');\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.d = final;\n this.p(chunk, final || false);\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n var s = this.p.length > 3 ? gzs(this.p) : 4;\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n err(6, 'invalid gzip data');\n this.p = this.p.subarray(0, -8);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k, op = o;\n if (Array.isArray(val))\n op = mrg(o, val[1]), val = val[0];\n if (val instanceof u8)\n t[n] = [val, op];\n else {\n t[n += '/'] = [new u8(0), op];\n fltn(val, n, t, o);\n }\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return [r, slc(d, i - 1)];\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), ch = _a[0], np = _a[1];\n if (final) {\n if (np.length)\n err(8);\n this.p = null;\n }\n else\n this.p = np;\n this.ondata(ch, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td)\n return td.decode(dat);\n else {\n var _a = dutf8(dat), out = _a[0], ext = _a[1];\n if (ext.length)\n err(8);\n return out;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c < 0 && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;\n if (c != -1) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c < 0 ? -c - 2 : c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this_1 = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u, -1);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this_1.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this_1.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this_1.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this_1.ondata(err, dat, final);\n _this_1.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this_1 = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this_1.d & 1))\n return;\n _this_1.u.splice(-1, 1);\n _this_1.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this_1 = this;\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this_1 = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this_1 = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this_1.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this_1.k[0] == chks_3 && _this_1.c)\n _this_1.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = lft = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, new u8(su)));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n", "/* eslint-disable simple-header/header */\n\n/*!\n * crxToZip\n * Copyright (c) 2013 Rob Wu \n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/.\n */\n\nexport function crxToZip(buf: Buffer) {\n function calcLength(a: number, b: number, c: number, d: number) {\n let length = 0;\n\n length += a << 0;\n length += b << 8;\n length += c << 16;\n length += d << 24 >>> 0;\n return length;\n }\n\n // 50 4b 03 04\n // This is actually a zip file\n if (buf[0] === 80 && buf[1] === 75 && buf[2] === 3 && buf[3] === 4) {\n return buf;\n }\n\n // 43 72 32 34 (Cr24)\n if (buf[0] !== 67 || buf[1] !== 114 || buf[2] !== 50 || buf[3] !== 52) {\n throw new Error(\"Invalid header: Does not start with Cr24\");\n }\n\n // 02 00 00 00\n // or\n // 03 00 00 00\n const isV3 = buf[4] === 3;\n const isV2 = buf[4] === 2;\n\n if ((!isV2 && !isV3) || buf[5] || buf[6] || buf[7]) {\n throw new Error(\"Unexpected crx format version number.\");\n }\n\n if (isV2) {\n const publicKeyLength = calcLength(buf[8], buf[9], buf[10], buf[11]);\n const signatureLength = calcLength(buf[12], buf[13], buf[14], buf[15]);\n\n // 16 = Magic number (4), CRX format version (4), lengths (2x4)\n const zipStartOffset = 16 + publicKeyLength + signatureLength;\n\n return buf.subarray(zipStartOffset, buf.length);\n }\n // v3 format has header size and then header\n const headerSize = calcLength(buf[8], buf[9], buf[10], buf[11]);\n const zipStartOffset = 12 + headerSize;\n\n return buf.subarray(zipStartOffset, buf.length);\n}\n"], - "mappings": ";;;;ukBAAA,IAAAA,EAAAC,EAAA,oBCAA,IAAAC,GAAAC,EAAA,kBAAAC,MCAA,IAAOC,GAAPC,GAAAC,EAAA,KAAAC,IAAOH,GAAQ,YCAf,IAAOI,EAAPC,GAAAC,EAAA,KAAAC,IAAOH,EAAQ,uBCAf,IAWaI,GAXbC,GAAAC,EAAA,kBAAAC,IAMAC,KACAC,KAIaL,GAAqB,WAAWM,KAAUC,EAAY,wBAAwBA,KAAe,OCSnG,SAASC,EAAIC,EAAaC,EAAgC,CAAC,EAAG,CACjE,OAAO,IAAI,QAAgB,CAACC,EAASC,IAAW,CAC5C,GAAAC,QAAM,IAAIJ,EAAKC,EAASI,GAAO,CAC3B,GAAM,CAAE,WAAAC,EAAY,cAAAC,EAAe,QAAAC,CAAQ,EAAIH,EAC/C,GAAIC,GAAe,IACf,OAAO,KAAKH,EAAO,GAAGG,MAAeC,OAAmBP,GAAK,EACjE,GAAIM,GAAe,IACf,OAAO,KAAKJ,EAAQH,EAAIS,EAAQ,SAAWP,CAAO,CAAC,EAEvD,IAAMQ,EAAS,CAAC,EAChBJ,EAAI,GAAG,QAASF,CAAM,EAEtBE,EAAI,GAAG,OAAQK,GAASD,EAAO,KAAKC,CAAK,CAAC,EAC1CL,EAAI,KAAK,MAAO,IAAMH,EAAQ,OAAO,OAAOO,CAAM,CAAC,CAAC,CACxD,CAAC,CACL,CAAC,CACL,CApCA,IAkBAE,GAlBAC,GAAAC,EAAA,kBAAAC,IAkBAH,GAAkB,uBCOX,SAASI,GAAgBC,EAA+B,CAC3D,OAAO,gBAAkB,CACrB,GAAI,CACA,MAAO,CACH,GAAI,GACJ,MAAO,MAAMA,EAAK,GAAG,SAAS,CAClC,CACJ,OAASC,EAAP,CACE,MAAO,CACH,GAAI,GACJ,MAAOA,aAAa,MAAQ,CAExB,GAAGA,CACP,EAAIA,CACR,CACJ,CACJ,CACJ,CA1CA,IAkBaC,GAlBbC,GAAAC,EAAA,kBAAAC,IAkBaH,GAAgB,CACW,wBACA,2BACC,4BACC,4BAC1C,ICvBA,IAAAI,GAAA,GAiCA,eAAeC,GAAUC,EAAkB,CACvC,OAAOC,EAAIC,GAAWF,EAAU,CAC5B,QAAS,CACL,OAAQ,8BAGR,aAAcG,EAClB,CACJ,CAAC,CACL,CAEA,eAAeC,IAAsB,CAEjC,GAAI,CADe,MAAMC,GAAa,EACrB,MAAO,CAAC,EAEzB,IAAMC,EAAM,MAAMP,GAAU,YAAYQ,WAAgB,EAGxD,OADa,KAAK,MAAMD,EAAI,SAAS,OAAO,CAAC,EACjC,QAAQ,IAAKE,IAAY,CAEjC,KAAMA,EAAE,IAAI,MAAM,EAAG,CAAC,EACtB,OAAQA,EAAE,OAAO,MACjB,QAASA,EAAE,OAAO,QAAQ,UAAUA,EAAE,OAAO,QAAQ,QAAQ;AAAA,CAAI,EAAI,CAAC,CAC1E,EAAE,CACN,CAEA,eAAeH,IAAe,CAC1B,IAAMI,EAAU,MAAMV,GAAU,kBAAkB,EAE5CW,EAAO,KAAK,MAAMD,EAAQ,SAAS,CAAC,EAE1C,OADaC,EAAK,KAAK,MAAMA,EAAK,KAAK,YAAY,GAAG,EAAI,CAAC,IAC9CH,GACF,IAEXG,EAAK,OAAO,QAAQ,CAAC,CAAE,KAAAC,EAAM,qBAAAC,CAAqB,IAAM,CAChDC,GAAc,KAAKC,GAAKH,EAAK,WAAWG,CAAC,CAAC,GAC1CC,GAAe,KAAK,CAACJ,EAAMC,CAAoB,CAAC,CAExD,CAAC,EACM,GACX,CAEA,eAAeI,IAAe,CAC1B,aAAM,QAAQ,IAAID,GAAe,IAC7B,MAAO,CAACJ,EAAMD,CAAI,OAAM,iBACpB,SAAK,UAAWC,CAAI,EACpB,MAAMV,EAAIS,CAAI,CAClB,CACJ,CAAC,EACDK,GAAiB,CAAC,EACX,EACX,CApFA,IAoBAE,GACAC,GACAC,GAQMjB,GACFa,GA/BJK,GAAAC,EAAA,kBAAAC,IAkBAC,KACAC,KACAP,GAAwB,oBACxBC,GAA0B,uBAC1BC,GAAqB,gBAErBM,KACAC,KAEAC,KACAC,KAEM1B,GAAW,gCAAgC2B,IAC7Cd,GAAiB,CAAC,EAuDtB,WAAQ,wBAA2Be,GAAgB,IAAM,sBAAsBD,GAAW,CAAC,EAC3F,WAAQ,2BAA8BC,GAAgB1B,EAAmB,CAAC,EAC1E,WAAQ,uBAAyB0B,GAAgBzB,EAAY,CAAC,EAC9D,WAAQ,sBAAwByB,GAAgBd,EAAY,CAAC,ICzF7De,IAkBA,IAAAC,EAAuC,oBACvCC,GAAqB,gBCnBrBC,ICAAC,IAmBI,iCCnBJC,IAkBAC,KACA,IAAAC,GAAwB,oBCnBxBC,ICAA,IAAAC,GAAA,GAAAC,ICAAC,IAOAC,KCPAC,IAkCO,IAAMC,GAAN,KAAsC,CACjC,cAAgB,IAAI,IACpB,gBAAkB,IAAI,IAWvB,YAAYC,EAAUC,EAAgC,CAAC,EAAG,CAC7D,KAAK,MAAQD,EACb,KAAK,MAAQ,KAAK,UAAUA,CAAK,EACjC,OAAO,OAAO,KAAMC,CAAO,CAC/B,CAEQ,UAAUC,EAAaC,EAAUD,EAAQE,EAAe,GAAI,CAChE,IAAMC,EAAO,KAEb,OAAO,IAAI,MAAMH,EAAQ,CACrB,IAAII,EAAQC,EAAa,CACrB,IAAIC,EAAIF,EAAOC,GAWf,MATI,EAAEA,KAAOD,IAAWD,EAAK,kBACzBG,EAAIH,EAAK,gBAAgB,CACrB,OAAAC,EACA,IAAAC,EACA,KAAAJ,EACA,KAAAC,CACJ,CAAC,GAGD,OAAOI,GAAM,UAAYA,IAAM,MAAQ,CAAC,MAAM,QAAQA,CAAC,EAChDH,EAAK,UAAUG,EAAGL,EAAM,GAAGC,IAAOA,GAAQ,MAAMG,GAAK,EAEzDC,CACX,EACA,IAAIF,EAAQC,EAAaE,EAAO,CAC5B,GAAIH,EAAOC,KAASE,EAAO,MAAO,GAElC,QAAQ,IAAIH,EAAQC,EAAKE,CAAK,EAC9B,IAAMC,EAAU,GAAGN,IAAOA,GAAQ,MAAMG,IAExC,OAAAF,EAAK,gBAAgB,QAAQM,GAAMA,EAAGF,EAAOC,CAAO,CAAC,EACrDL,EAAK,cAAc,IAAIK,CAAO,GAAG,QAAQC,GAAMA,EAAGF,CAAK,CAAC,EAEjD,EACX,CACJ,CAAC,CACL,CAUO,QAAQA,EAAUG,EAAuB,CAC5C,GAAI,KAAK,SAAU,MAAM,IAAI,MAAM,4BAA4B,EAK/D,GAHA,KAAK,MAAQH,EACb,KAAK,MAAQ,KAAK,UAAUA,CAAK,EAE7BG,EAAc,CACd,IAAIJ,EAAIC,EAEFL,EAAOQ,EAAa,MAAM,GAAG,EACnC,QAAWC,KAAKT,EAAM,CAClB,GAAI,CAACI,EAAG,CACJ,QAAQ,KACJ,0BAA0BI,sDAC9B,EACA,MACJ,CACAJ,EAAIA,EAAEK,EACV,CAEA,KAAK,cAAc,IAAID,CAAY,GAAG,QAAQD,GAAMA,EAAGH,CAAC,CAAC,CAC7D,CAEA,KAAK,cAAc,CACvB,CAQO,wBAAwBG,EAAuC,CAClE,KAAK,gBAAgB,IAAIA,CAAE,CAC/B,CAgBO,kBACHP,EACAO,EACF,CACE,IAAMG,EAAY,KAAK,cAAc,IAAIV,CAAc,GAAK,IAAI,IAChEU,EAAU,IAAIH,CAAE,EAChB,KAAK,cAAc,IAAIP,EAAgBU,CAAS,CACpD,CAMO,2BAA2BH,EAAuC,CACrE,KAAK,gBAAgB,OAAOA,CAAE,CAClC,CAMO,qBAAqBP,EAAqCO,EAAyB,CACtF,IAAMG,EAAY,KAAK,cAAc,IAAIV,CAAc,EACnD,CAACU,IAELA,EAAU,OAAOH,CAAE,EACdG,EAAU,MAAM,KAAK,cAAc,OAAOV,CAAc,EACjE,CAKO,eAAgB,CACnB,KAAK,gBAAgB,QAAQO,GAAMA,EAAG,KAAK,MAAO,EAAE,CAAC,CACzD,CACJ,ED5KA,IAAAI,GAAwB,oBACxBC,EAAuD,cEVvDC,IAkBA,IAAAC,GAAoB,oBACpBC,EAAqB,gBAERC,GAAW,QAAQ,IAAI,wBAChC,QAAQ,IAAI,yBACN,QAAK,QAAQ,IAAI,sBAAuB,KAAM,aAAa,KAC3D,QAAK,OAAI,QAAQ,UAAU,EAAG,KAAM,SAAS,GAE1CC,KAAe,QAAKD,GAAU,UAAU,EACxCE,KAAa,QAAKF,GAAU,QAAQ,EACpCG,MAAgB,QAAKF,EAAc,cAAc,EACjDG,MAAgB,QAAKH,EAAc,eAAe,EAClDI,MAAuB,QAAKJ,EAAc,sBAAsB,EAChEK,GAAoB,CAC7B,SACA,QACA,SACA,WACA,yBACJ,KFvBA,aAAUC,EAAc,CAAE,UAAW,EAAK,CAAC,EAE3C,SAASC,GAAyBC,EAAcC,EAA0B,CACtE,GAAI,CACA,OAAO,KAAK,SAAM,gBAAaA,EAAM,OAAO,CAAC,CACjD,OAASC,EAAP,CACE,OAAIA,GAAK,OAAS,UACd,QAAQ,MAAM,kBAAkBF,aAAiBE,CAAG,EAEjD,CAAC,CACZ,CACJ,CAEO,IAAMC,EAAmB,IAAIC,GAAcL,GAAuB,WAAYM,EAAa,CAAC,EAEnGF,EAAiB,wBAAwB,IAAM,CAC3C,GAAI,IACA,iBAAcE,GAAe,KAAK,UAAUF,EAAiB,MAAO,KAAM,CAAC,CAAC,CAChF,OAAS,EAAP,CACE,QAAQ,MAAM,oCAAqC,CAAC,CACxD,CACJ,CAAC,EAED,WAAQ,+BAAmC,IAAML,CAAY,EAC7D,WAAQ,wBAA2B,GAAK,EAAE,YAAcK,EAAiB,KAAK,EAE9E,WAAQ,4BAA+B,CAACG,EAAGC,EAAgBC,IAA0B,CACjFL,EAAiB,QAAQI,EAAMC,CAAY,CAC/C,CAAC,EAEM,IAAMC,GAAiB,IAAIL,GAAcL,GAAa,SAAUW,EAAoB,CAAC,EAE5FD,GAAe,wBAAwB,IAAM,CACzC,GAAI,IACA,iBAAcC,GAAsB,KAAK,UAAUD,GAAe,MAAO,KAAM,CAAC,CAAC,CACrF,OAAS,EAAP,CACE,QAAQ,MAAM,kCAAmC,CAAC,CACtD,CACJ,CAAC,ED7CD,IAAAE,GAAoB,oBAEpB,OAAI,GAAG,yBAA0B,CAACC,EAAGC,IAAQ,CACzCA,EAAI,YAAY,GAAG,gBAAiB,CAACD,EAAG,CAAE,MAAAE,CAAM,IAAM,CAClDA,EAAM,KAAK,YAAa,IAAM,CAC1B,GAAIA,EAAM,IAAI,WAAW,iCAAiC,EAAG,CACzD,IAAMC,EAAWC,EAAiB,MAAM,SAAS,iBACjD,GAAI,CAACD,GAAU,QAAS,OAExBD,EAAM,kBAAkB;AAAA;AAAA;AAAA,wCAGCC,EAAS,OAAS,KAAQ;AAAA;AAAA;AAAA,iBAGlD,CACL,CACJ,CAAC,CACL,CAAC,CACL,CAAC,EI1BD,IAAAE,GAAA,GAAAC,IAOA,IAAAC,GAAoB,oBAEpB,OAAI,GAAG,yBAA0B,CAACC,EAAGC,IAAQ,CACzCA,EAAI,YAAY,GAAG,gBAAiB,CAACD,EAAG,CAAE,MAAAE,CAAM,IAAM,CAClDA,EAAM,KAAK,YAAa,IAAM,CAC1B,GAAIA,EAAM,IAAI,WAAW,0BAA0B,EAAG,CAElD,GAAI,CADaC,EAAiB,MAAM,SAAS,kBAClC,QAAS,OAExBD,EAAM,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAMvB,CACL,CACJ,CAAC,CACL,CAAC,CACL,CAAC,EC1BD,IAAAE,GAAA,GAAAC,GAAAD,GAAA,qBAAAE,KAAAC,IAOA,IAAAC,GAAwB,iBAGlBC,GAAoB,0CAE1B,SAASC,GAAYC,EAAa,CAC9B,OAAO,IAAI,QAAgB,CAACC,EAASC,IAAW,CAC5C,IAAMC,KAAM,YAAQ,IAAI,IAAIH,CAAG,EAAG,CAAE,OAAQ,MAAO,EAAGI,GAAO,CACzDH,EACIG,EAAI,QAAQ,SACNL,GAAYK,EAAI,QAAQ,QAAQ,EAChCJ,CACV,CACJ,CAAC,EACDG,EAAI,GAAG,QAASD,CAAM,EACtBC,EAAI,IAAI,CACZ,CAAC,CACL,CAEA,eAAsBR,GAAgBU,EAAuBL,EAAa,CACtE,OAAKF,GAAkB,KAAKE,CAAG,EAExBD,GAAYC,CAAG,EAFmBA,CAG7C,CC9BA,IAAAM,GAAA,GAAAC,GAAAD,GAAA,mBAAAE,KAAAC,IAMA,IAAAC,GAAoB,oBACpBC,GAAyB,uBACzBC,GAAoC,gBAEpC,eAAsBJ,GAAcK,EAAGC,EAAkB,CACrDA,KAAW,cAAUA,CAAQ,EAC7B,IAAMC,KAAW,aAASD,CAAQ,EAC5BE,KAAkC,cAAU,OAAI,QAAQ,UAAU,EAAI,GAAG,EAE/E,GADA,QAAQ,IAAID,EAAUC,EAAiCF,CAAQ,EAC3DC,IAAa,iBAAmB,CAACD,EAAS,WAAWE,CAA+B,EAAG,OAAO,KAElG,GAAI,CACA,IAAMC,EAAM,QAAM,aAASH,CAAQ,EACnC,OAAO,IAAI,WAAWG,EAAI,MAAM,CACpC,MAAE,CACE,OAAO,IACX,CACJ,CCvBA,IAAAC,GAAA,GAAAC,GAAAD,GAAA,mBAAAE,KAAAC,IAMA,IAAAC,GAAqC,iBAEjCC,GAEG,SAASH,GAAcI,EAAGC,EAAW,CACxCA,EAAK,KAAO,OAAO,KAAKA,EAAK,IAAI,EAAE,SAAS,QAAQ,EACpD,IAAMC,EAAO,KAAK,UAAUD,CAAI,EAChCF,QAAc,iBAAa,MAAM,EACjCA,GAAU,KAAKG,EAAM,MAAO,WAAW,CAC3C,CRVA,IAAOC,GAAQ,CACf,iBAAmBC,GACnB,iBAAmBA,GACnB,UAAYA,GACZ,cAAgBA,GAChB,UAAYA,EACZ,EDYA,IAAMC,GAAoB,CAAC,EAG3B,OAAW,CAACC,EAAQC,CAAO,IAAK,OAAO,QAAQC,EAAa,EAAG,CAC3D,IAAMC,EAAU,OAAO,QAAQF,CAAO,EACtC,GAAI,CAACE,EAAQ,OAAQ,SAErB,IAAMC,EAAWL,GAAkBC,GAAU,CAAC,EAE9C,OAAW,CAACK,EAAYC,CAAM,IAAKH,EAAS,CACxC,IAAMI,EAAM,uBAAuBP,KAAUK,IAC7C,WAAQ,OAAOE,EAAKD,CAAM,EAC1BF,EAASC,GAAcE,CAC3B,CACJ,CAEA,WAAQ,kCAAwC,GAAK,CACjD,EAAE,YAAcR,EACpB,CAAC,EUzCDS,IZuBAC,KACA,IAAAC,EAAiE,oBACjEC,GAA2D,cAC3DC,EAAwC,uBACxCC,EAAgC,gBa3BhCC,IAAA,IAAOC,GAAQ,+5FCAfC,IAoBA,IAAMC,GAAa,mDACbC,GAAiB,OAcvB,SAASC,GAAWC,EAAkBC,EAAiC,CAAC,EAAoB,CACxF,MAAO,CACH,SAAAD,EACA,KAAMC,EAAK,MAAQD,EAAS,QAAQ,UAAW,EAAE,EACjD,OAAQC,EAAK,QAAU,iBACvB,YAAaA,EAAK,aAAe,mBACjC,QAASA,EAAK,QACd,QAASA,EAAK,QACd,OAAQA,EAAK,OACb,QAASA,EAAK,QACd,OAAQA,EAAK,MACjB,CACJ,CAEO,SAASC,GAASC,EAAqB,CAC1C,OAAIA,EAAY,WAAW,CAAC,IAAM,QAC9BA,EAAcA,EAAY,MAAM,CAAC,GAE9BA,CACX,CAEO,SAASC,GAAaC,EAAaL,EAAmC,CACzE,GAAI,CAACK,EAAK,OAAON,GAAWC,CAAQ,EAEpC,IAAMM,EAAQD,EAAI,MAAM,MAAO,CAAC,IAAI,IAAI,MAAM,KAAM,CAAC,IAAI,GACzD,GAAI,CAACC,EAAO,OAAOP,GAAWC,CAAQ,EAEtC,IAAMO,EAAmC,CAAC,EACtCC,EAAQ,GACRC,EAAQ,GACZ,QAAWC,KAAQJ,EAAM,MAAMT,EAAU,EACrC,GAAIa,EAAK,SAAW,EACpB,GAAIA,EAAK,OAAO,CAAC,IAAM,KAAOA,EAAK,OAAO,CAAC,IAAM,IAAK,CAClDH,EAAOC,GAASC,EAAM,KAAK,EAC3B,IAAME,EAAID,EAAK,QAAQ,GAAG,EAC1BF,EAAQE,EAAK,UAAU,EAAGC,CAAC,EAC3BF,EAAQC,EAAK,UAAUC,EAAI,CAAC,CAChC,MAEIF,GAAS,IAAMC,EAAK,QAAQ,MAAO;AAAA,CAAI,EAAE,QAAQZ,GAAgB,GAAG,EAG5E,OAAAS,EAAOC,GAASC,EAAM,KAAK,EAC3B,OAAOF,EAAO,IACPR,GAAWC,EAAUO,CAAM,CACtC,CChFAK,IAkBA,IAAAC,GAA0C,oBAEnC,SAASC,GAAwBC,EAAoB,CACxDA,EAAI,YAAY,qBAAqB,CAAC,CAAE,IAAAC,CAAI,IAAM,CAC9C,OAAQA,EAAK,CACT,IAAK,cACL,IAAK,6BACL,IAAK,iCACL,IAAK,oCACD,MAAO,CAAE,OAAQ,OAAQ,CACjC,CAEA,GAAI,CACA,GAAI,CAAE,SAAAC,CAAS,EAAI,IAAI,IAAID,CAAG,CAClC,MAAE,CACE,MAAO,CAAE,OAAQ,MAAO,CAC5B,CAEA,OAAQC,EAAU,CACd,IAAK,QACL,IAAK,SACL,IAAK,UACL,IAAK,SACL,IAAK,WACD,SAAM,aAAaD,CAAG,CAC9B,CAEA,MAAO,CAAE,OAAQ,MAAO,CAC5B,CAAC,CACL,IfZA,cAAUE,EAAY,CAAE,UAAW,EAAK,CAAC,EAElC,SAASC,GAAeC,EAAkBC,EAAc,CAC3D,IAAMC,KAAqB,aAAUF,CAAQ,EACvCG,KAAU,QAAKH,EAAUC,CAAI,EAC7BG,KAAiB,aAAUD,CAAO,EACxC,OAAOC,EAAe,WAAWF,CAAkB,EAAIE,EAAiB,IAC5E,CAEA,SAASC,IAAU,CACf,SAAO,YAASC,GAAe,OAAO,EAAE,MAAM,IAAM,EAAE,CAC1D,CAEA,eAAeC,IAAyC,CACpD,IAAMC,EAAQ,QAAM,WAAQV,CAAU,EAAE,MAAM,IAAM,CAAC,CAAC,EAEhDW,EAA+B,CAAC,EAEtC,QAAWC,KAAYF,EAAO,CAC1B,GAAI,CAACE,EAAS,SAAS,MAAM,EAAG,SAEhC,IAAMC,EAAO,MAAMC,GAAaF,CAAQ,EAAE,KAAKG,EAAQ,EAAE,MAAM,IAAM,IAAI,EACrEF,GAAQ,MAEZF,EAAU,KAAKK,GAAaH,EAAMD,CAAQ,CAAC,CAC/C,CAEA,OAAOD,CACX,CAEA,SAASG,GAAaF,EAAkB,CACpCA,EAAWA,EAAS,QAAQ,WAAY,EAAE,EAC1C,IAAMK,EAAWhB,GAAeD,EAAYY,CAAQ,EACpD,OAAKK,KACE,YAASA,EAAU,OAAO,EADX,QAAQ,OAAO,eAAeL,GAAU,CAElE,CAEA,UAAQ,6BAAgC,IAAM,QAAM,SAASJ,EAAa,CAAC,EAE3E,UAAQ,6BAAgC,CAACU,EAAGC,IAAQ,CAChD,GAAI,CACA,GAAI,CAAE,SAAAC,CAAS,EAAI,IAAI,IAAID,CAAG,CAClC,MAAE,CACE,KAAM,eACV,CACA,GAAI,CAACE,GAAkB,SAASD,CAAQ,EACpC,KAAM,uBAEV,QAAM,aAAaD,CAAG,CAC1B,CAAC,EAGD,UAAQ,4BAAgC,IAAMZ,GAAQ,CAAC,EACvD,UAAQ,4BAAgC,CAACW,EAAGI,OACxC,kBAAcd,GAAec,CAAG,CACpC,EAEA,UAAQ,6BAAiC,IAAMtB,CAAU,EACzD,UAAQ,8BAAkC,IAAMS,GAAW,CAAC,EAC5D,UAAQ,6BAAiC,CAACS,EAAGN,IAAaE,GAAaF,CAAQ,CAAC,EAChF,UAAQ,qCAA0C,KAAO,CAErD,kBAAmB,IAAI,oBAAkB,iBAAiB,GAAK,IACnE,EAAE,EAuBF,UAAQ,iCAAqC,SAAY,CACrD,IAAMW,EAAQ,0BACRC,EAAiB,gBAAc,cAAc,EAAE,KAAKC,GAAKA,EAAE,QAAUF,CAAK,EAChF,GAAIC,GAAkB,CAACA,EAAe,YAAY,EAAG,CACjDA,EAAe,MAAM,EACrB,MACJ,CAEA,IAAME,EAAM,IAAI,gBAAc,CAC1B,MAAAH,EACA,gBAAiB,GACjB,UAAW,GACX,eAAgB,CACZ,WAAS,QAAK,UAA+C,0BAA0B,EACvF,iBAAkB,GAClB,gBAAiB,GACjB,QAAS,EACb,CACJ,CAAC,EAEDI,GAAwBD,CAAG,EAE3B,MAAMA,EAAI,QAAQ,yBAAyBE,IAAY,CAC3D,CAAC,EgBhJDC,IAkBA,IAAAC,GAAwB,oBClBxBC,IAAA,IAAAC,GAA8B,kBAC1BC,MAAU,kBAAc,GAAG,EAW3BC,GACAC,GAAY,6LAChB,GAAI,CACAD,GAASD,GAAQ,gBAAgB,EAAE,MACvC,MACA,CACA,CACA,IAAIG,GAAKF,GAAS,SAAUG,EAAGC,EAAGC,EAAKC,EAAUC,EAAI,CACjD,IAAIC,EAAO,GACPC,EAAI,IAAIT,GAAOG,EAAIF,GAAW,CAAE,KAAM,EAAK,CAAC,EAC3C,GAAG,QAAS,SAAUS,EAAG,CAAE,OAAOH,EAAGG,EAAG,IAAI,CAAG,CAAC,EAChD,GAAG,UAAW,SAAUC,EAAG,CAAE,OAAOJ,EAAG,KAAMI,CAAC,CAAG,CAAC,EAClD,GAAG,OAAQ,SAAUR,EAAG,CACrBA,GAAK,CAACK,GACND,EAAG,IAAI,MAAM,oBAAsBJ,CAAC,EAAG,IAAI,CACnD,CAAC,EACD,OAAAM,EAAE,YAAYJ,EAAKC,CAAQ,EAC3BG,EAAE,UAAY,UAAY,CACtB,OAAAD,EAAO,GACAR,GAAO,UAAU,UAAU,KAAKS,CAAC,CAC5C,EACOA,CACX,EAAI,SAAUL,EAAGQ,EAAIC,EAAKC,EAAMP,EAAI,CAChC,aAAa,UAAY,CAAE,OAAOA,EAAG,IAAI,MAAM,2GAA2G,EAAG,IAAI,CAAG,CAAC,EACrK,IAAIQ,EAAM,UAAY,CAAE,EACxB,MAAO,CACH,UAAWA,EACX,YAAaA,CACjB,CACJ,EAGIC,EAAK,WAAYC,EAAM,YAAaC,GAAM,YAE1CC,GAAO,IAAIH,EAAG,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAgB,EAAG,EAAoB,CAAC,CAAC,EAG5II,GAAO,IAAIJ,EAAG,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAiB,EAAG,CAAC,CAAC,EAEnIK,GAAO,IAAIL,EAAG,CAAC,GAAI,GAAI,GAAI,EAAG,EAAG,EAAG,EAAG,EAAG,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,EAAE,CAAC,EAEhFM,GAAO,SAAUC,EAAIC,EAAO,CAE5B,QADIC,EAAI,IAAIR,EAAI,EAAE,EACTS,EAAI,EAAGA,EAAI,GAAI,EAAEA,EACtBD,EAAEC,GAAKF,GAAS,GAAKD,EAAGG,EAAI,GAIhC,QADIC,EAAI,IAAIT,GAAIO,EAAE,GAAG,EACZC,EAAI,EAAGA,EAAI,GAAI,EAAEA,EACtB,QAASE,EAAIH,EAAEC,GAAIE,EAAIH,EAAEC,EAAI,GAAI,EAAEE,EAC/BD,EAAEC,GAAOA,EAAIH,EAAEC,IAAO,EAAKA,EAGnC,MAAO,CAACD,EAAGE,CAAC,CAChB,EACIE,GAAKP,GAAKH,GAAM,CAAC,EAAGW,GAAKD,GAAG,GAAIE,GAAQF,GAAG,GAE/CC,GAAG,IAAM,IAAKC,GAAM,KAAO,GAC3B,IAAIC,GAAKV,GAAKF,GAAM,CAAC,EAAGa,GAAKD,GAAG,GAAIE,GAAQF,GAAG,GAE3CG,GAAM,IAAIlB,EAAI,KAAK,EACvB,IAASS,EAAI,EAAGA,EAAI,MAAO,EAAEA,EAErBU,GAAMV,EAAI,SAAY,GAAOA,EAAI,QAAW,EAChDU,GAAMA,EAAI,SAAY,GAAOA,EAAI,QAAW,EAC5CA,GAAMA,EAAI,SAAY,GAAOA,EAAI,OAAW,EAC5CD,GAAIT,KAAQU,EAAI,SAAY,GAAOA,EAAI,MAAW,KAAQ,EAHtD,IAAAA,EAFCV,EAULW,EAAQ,SAAUC,EAAIC,EAAI,EAAG,CAO7B,QANIC,EAAIF,EAAG,OAEP,EAAI,EAEJG,EAAI,IAAIxB,EAAIsB,CAAE,EAEX,EAAIC,EAAG,EAAE,EACRF,EAAG,IACH,EAAEG,EAAEH,EAAG,GAAK,GAGpB,IAAII,EAAK,IAAIzB,EAAIsB,CAAE,EACnB,IAAK,EAAI,EAAG,EAAIA,EAAI,EAAE,EAClBG,EAAG,GAAMA,EAAG,EAAI,GAAKD,EAAE,EAAI,IAAO,EAEtC,IAAIE,EACJ,GAAI,EAAG,CAEHA,EAAK,IAAI1B,EAAI,GAAKsB,CAAE,EAEpB,IAAIK,EAAM,GAAKL,EACf,IAAK,EAAI,EAAG,EAAIC,EAAG,EAAE,EAEjB,GAAIF,EAAG,GAQH,QANIO,EAAM,GAAK,EAAKP,EAAG,GAEnBQ,EAAMP,EAAKD,EAAG,GAEdS,EAAIL,EAAGJ,EAAG,GAAK,MAAQQ,EAElBnC,EAAIoC,GAAM,GAAKD,GAAO,EAAIC,GAAKpC,EAAG,EAAEoC,EAEzCJ,EAAGR,GAAIY,KAAOH,GAAOC,CAIrC,KAGI,KADAF,EAAK,IAAI1B,EAAIuB,CAAC,EACT,EAAI,EAAG,EAAIA,EAAG,EAAE,EACbF,EAAG,KACHK,EAAG,GAAKR,GAAIO,EAAGJ,EAAG,GAAK,QAAW,GAAKA,EAAG,IAItD,OAAOK,CACX,EAEIK,GAAM,IAAIhC,EAAG,GAAG,EACpB,IAASU,EAAI,EAAGA,EAAI,IAAK,EAAEA,EACvBsB,GAAItB,GAAK,EADJ,IAAAA,EAET,IAASA,EAAI,IAAKA,EAAI,IAAK,EAAEA,EACzBsB,GAAItB,GAAK,EADJ,IAAAA,EAET,IAASA,EAAI,IAAKA,EAAI,IAAK,EAAEA,EACzBsB,GAAItB,GAAK,EADJ,IAAAA,EAET,IAASA,EAAI,IAAKA,EAAI,IAAK,EAAEA,EACzBsB,GAAItB,GAAK,EADJ,IAAAA,EAGLuB,GAAM,IAAIjC,EAAG,EAAE,EACnB,IAASU,EAAI,EAAGA,EAAI,GAAI,EAAEA,EACtBuB,GAAIvB,GAAK,EADJ,IAAAA,EAGT,IAAyCwB,GAAqBC,EAAKC,GAAK,EAAG,CAAC,EAE5E,IAAyCC,GAAqBC,EAAKC,GAAK,EAAG,CAAC,EAExEC,GAAM,SAAUC,EAAG,CAEnB,QADIC,EAAID,EAAE,GACDE,EAAI,EAAGA,EAAIF,EAAE,OAAQ,EAAEE,EACxBF,EAAEE,GAAKD,IACPA,EAAID,EAAEE,IAEd,OAAOD,CACX,EAEIE,EAAO,SAAUC,EAAGC,EAAGJ,EAAG,CAC1B,IAAIK,EAAKD,EAAI,EAAK,EAClB,OAASD,EAAEE,GAAMF,EAAEE,EAAI,IAAM,KAAQD,EAAI,GAAMJ,CACnD,EAEIM,GAAS,SAAUH,EAAGC,EAAG,CACzB,IAAIC,EAAKD,EAAI,EAAK,EAClB,OAASD,EAAEE,GAAMF,EAAEE,EAAI,IAAM,EAAMF,EAAEE,EAAI,IAAM,MAASD,EAAI,EAChE,EAEIG,GAAO,SAAUH,EAAG,CAAE,OAASA,EAAI,GAAK,EAAK,CAAG,EAGhDI,GAAM,SAAUC,EAAGC,EAAGC,EAAG,EACrBD,GAAK,MAAQA,EAAI,KACjBA,EAAI,IACJC,GAAK,MAAQA,EAAIF,EAAE,UACnBE,EAAIF,EAAE,QAEV,IAAI,EAAI,IAAKA,EAAE,mBAAqB,EAAIG,EAAMH,EAAE,mBAAqB,EAAII,GAAMC,GAAIH,EAAID,CAAC,EACxF,SAAE,IAAID,EAAE,SAASC,EAAGC,CAAC,CAAC,EACf,CACX,EAsBA,IAAII,GAAK,CACL,iBACA,qBACA,yBACA,mBACA,kBACA,oBACA,CACA,cACA,qBACA,uBACA,8BACA,oBACA,mBACA,kBAEJ,EAEIC,EAAM,SAAUC,EAAKC,EAAKC,EAAI,CAC9B,IAAIC,EAAI,IAAI,MAAMF,GAAOH,GAAGE,EAAI,EAIhC,GAHAG,EAAE,KAAOH,EACL,MAAM,mBACN,MAAM,kBAAkBG,EAAGJ,CAAG,EAC9B,CAACG,EACD,MAAMC,EACV,OAAOA,CACX,EAEIC,GAAQ,SAAUC,EAAKC,EAAKC,EAAI,CAEhC,IAAIC,EAAKH,EAAI,OACb,GAAI,CAACG,GAAOD,GAAMA,EAAG,GAAK,CAACA,EAAG,EAC1B,OAAOD,GAAO,IAAIG,EAAG,CAAC,EAE1B,IAAIC,EAAQ,CAACJ,GAAOC,EAEhBI,EAAO,CAACJ,GAAMA,EAAG,EAChBA,IACDA,EAAK,CAAC,GAELD,IACDA,EAAM,IAAIG,EAAGD,EAAK,CAAC,GAEvB,IAAII,EAAO,SAAUC,GAAG,CACpB,IAAIC,GAAKR,EAAI,OAEb,GAAIO,GAAIC,GAAI,CAER,IAAIC,GAAO,IAAIN,EAAG,KAAK,IAAIK,GAAK,EAAGD,EAAC,CAAC,EACrCE,GAAK,IAAIT,CAAG,EACZA,EAAMS,EACV,CACJ,EAEIC,EAAQT,EAAG,GAAK,EAAGU,EAAMV,EAAG,GAAK,EAAGW,EAAKX,EAAG,GAAK,EAAGY,EAAKZ,EAAG,EAAGa,EAAKb,EAAG,EAAGc,EAAMd,EAAG,EAAGe,EAAMf,EAAG,EAE/FgB,EAAOf,EAAK,EAChB,EAAG,CACC,GAAI,CAACW,EAAI,CAELH,EAAQQ,EAAKnB,EAAKY,EAAK,CAAC,EAExB,IAAIQ,EAAOD,EAAKnB,EAAKY,EAAM,EAAG,CAAC,EAE/B,GADAA,GAAO,EACFQ,EAiBA,GAAIA,GAAQ,EACbN,EAAKO,GAAMN,EAAKO,GAAMN,EAAM,EAAGC,EAAM,UAChCG,GAAQ,EAAG,CAEhB,IAAIG,EAAOJ,EAAKnB,EAAKY,EAAK,EAAE,EAAI,IAAKY,EAAQL,EAAKnB,EAAKY,EAAM,GAAI,EAAE,EAAI,EACnEa,GAAKF,EAAOJ,EAAKnB,EAAKY,EAAM,EAAG,EAAE,EAAI,EACzCA,GAAO,GAKP,QAHIc,EAAM,IAAItB,EAAGqB,EAAE,EAEfE,GAAM,IAAIvB,EAAG,EAAE,EACVwB,EAAI,EAAGA,EAAIJ,EAAO,EAAEI,EAEzBD,GAAIE,GAAKD,IAAMT,EAAKnB,EAAKY,EAAMgB,EAAI,EAAG,CAAC,EAE3ChB,GAAOY,EAAQ,EAKf,QAHIM,EAAMC,GAAIJ,EAAG,EAAGK,IAAU,GAAKF,GAAO,EAEtCG,EAAMC,EAAKP,GAAKG,EAAK,CAAC,EACjBF,EAAI,EAAGA,EAAIH,IAAK,CACrB,IAAIU,GAAIF,EAAId,EAAKnB,EAAKY,EAAKoB,EAAM,GAEjCpB,GAAOuB,GAAI,GAEX,IAAIC,EAAID,KAAM,EAEd,GAAIC,EAAI,GACJV,EAAIE,KAAOQ,MAEV,CAED,IAAIC,EAAI,EAAGC,GAAI,EAOf,IANIF,GAAK,IACLE,GAAI,EAAInB,EAAKnB,EAAKY,EAAK,CAAC,EAAGA,GAAO,EAAGyB,EAAIX,EAAIE,EAAI,IAC5CQ,GAAK,IACVE,GAAI,EAAInB,EAAKnB,EAAKY,EAAK,CAAC,EAAGA,GAAO,GAC7BwB,GAAK,KACVE,GAAI,GAAKnB,EAAKnB,EAAKY,EAAK,GAAG,EAAGA,GAAO,GAClC0B,MACHZ,EAAIE,KAAOS,CACnB,CACJ,CAEA,IAAIE,GAAKb,EAAI,SAAS,EAAGH,CAAI,EAAGiB,EAAKd,EAAI,SAASH,CAAI,EAEtDP,EAAMe,GAAIQ,EAAE,EAEZtB,EAAMc,GAAIS,CAAE,EACZ1B,EAAKoB,EAAKK,GAAIvB,EAAK,CAAC,EACpBD,EAAKmB,EAAKM,EAAIvB,EAAK,CAAC,CACxB,MAEIvB,EAAI,CAAC,MAtEE,CAEP,IAAI0C,EAAIK,GAAK7B,CAAG,EAAI,EAAGJ,EAAIR,EAAIoC,EAAI,GAAMpC,EAAIoC,EAAI,IAAM,EAAIM,EAAIN,EAAI5B,EACnE,GAAIkC,EAAIvC,EAAI,CACJG,GACAZ,EAAI,CAAC,EACT,KACJ,CAEIW,GACAE,EAAKM,EAAKL,CAAC,EAEfP,EAAI,IAAID,EAAI,SAASoC,EAAGM,CAAC,EAAG7B,CAAE,EAE9BX,EAAG,EAAIW,GAAML,EAAGN,EAAG,EAAIU,EAAM8B,EAAI,EAAGxC,EAAG,EAAIS,EAC3C,QACJ,CAuDA,GAAIC,EAAMM,EAAM,CACRZ,GACAZ,EAAI,CAAC,EACT,KACJ,CACJ,CAGIW,GACAE,EAAKM,EAAK,MAAM,EAGpB,QAFI8B,IAAO,GAAK3B,GAAO,EAAG4B,IAAO,GAAK3B,GAAO,EACzC4B,GAAOjC,GACHiC,GAAOjC,EAAK,CAEhB,IAAIyB,EAAIvB,EAAGgC,GAAO9C,EAAKY,CAAG,EAAI+B,IAAMI,EAAMV,IAAM,EAEhD,GADAzB,GAAOyB,EAAI,GACPzB,EAAMM,EAAM,CACRZ,GACAZ,EAAI,CAAC,EACT,KACJ,CAGA,GAFK2C,GACD3C,EAAI,CAAC,EACLqD,EAAM,IACN9C,EAAIY,KAAQkC,UACPA,GAAO,IAAK,CACjBF,GAAOjC,EAAKE,EAAK,KACjB,KACJ,KACK,CACD,IAAIkC,GAAMD,EAAM,IAEhB,GAAIA,EAAM,IAAK,CAEX,IAAInB,EAAImB,EAAM,IAAKE,GAAIC,GAAKtB,GAC5BoB,GAAM7B,EAAKnB,EAAKY,GAAM,GAAKqC,IAAK,CAAC,EAAIE,GAAGvB,GACxChB,GAAOqC,EACX,CAEA,IAAIG,GAAIrC,EAAG+B,GAAO9C,EAAKY,CAAG,EAAIgC,IAAMS,GAAOD,KAAM,EAC5CA,IACD1D,EAAI,CAAC,EACTkB,GAAOwC,GAAI,GACX,IAAIZ,EAAKc,GAAGD,IACZ,GAAIA,GAAO,EAAG,CACV,IAAIJ,GAAIM,GAAKF,IACbb,GAAMM,GAAO9C,EAAKY,CAAG,GAAM,GAAKqC,IAAK,EAAIrC,GAAOqC,EACpD,CACA,GAAIrC,EAAMM,EAAM,CACRZ,GACAZ,EAAI,CAAC,EACT,KACJ,CACIW,GACAE,EAAKM,EAAK,MAAM,EAEpB,QADI2C,GAAM3C,EAAKmC,GACRnC,EAAK2C,GAAK3C,GAAM,EACnBZ,EAAIY,GAAMZ,EAAIY,EAAK2B,GACnBvC,EAAIY,EAAK,GAAKZ,EAAIY,EAAK,EAAI2B,GAC3BvC,EAAIY,EAAK,GAAKZ,EAAIY,EAAK,EAAI2B,GAC3BvC,EAAIY,EAAK,GAAKZ,EAAIY,EAAK,EAAI2B,GAE/B3B,EAAK2C,EACT,CACJ,CACAtD,EAAG,EAAIY,EAAIZ,EAAG,EAAI2C,GAAM3C,EAAG,EAAIW,EAAIX,EAAG,EAAIS,EACtCG,IACAH,EAAQ,EAAGT,EAAG,EAAIc,EAAKd,EAAG,EAAIa,EAAIb,EAAG,EAAIe,EACjD,OAAS,CAACN,GACV,OAAOE,GAAMZ,EAAI,OAASA,EAAMwD,GAAIxD,EAAK,EAAGY,CAAE,CAClD,EAmOA,IAAI6C,GAAmB,IAAIC,EAAG,CAAC,EA0K/B,IAAIC,GAAM,SAAUC,EAAGC,EAAG,CACtB,IAAIC,EAAI,CAAC,EACT,QAASC,KAAKH,EACVE,EAAEC,GAAKH,EAAEG,GACb,QAASA,KAAKF,EACVC,EAAEC,GAAKF,EAAEE,GACb,OAAOD,CACX,EAQIE,GAAO,SAAUC,EAAIC,EAAOC,EAAI,CAIhC,QAHIC,EAAKH,EAAG,EACRI,EAAKJ,EAAG,SAAS,EACjBK,EAAKD,EAAG,MAAMA,EAAG,QAAQ,GAAG,EAAI,EAAGA,EAAG,YAAY,GAAG,CAAC,EAAE,QAAQ,OAAQ,EAAE,EAAE,MAAM,GAAG,EAChFE,EAAI,EAAGA,EAAIH,EAAG,OAAQ,EAAEG,EAAG,CAChC,IAAIC,EAAIJ,EAAGG,GAAIR,EAAIO,EAAGC,GACtB,GAAI,OAAOC,GAAK,WAAY,CACxBN,GAAS,IAAMH,EAAI,IACnB,IAAIU,EAAOD,EAAE,SAAS,EACtB,GAAIA,EAAE,UAEF,GAAIC,EAAK,QAAQ,eAAe,GAAK,GAAI,CACrC,IAAIC,EAAQD,EAAK,QAAQ,IAAK,CAAC,EAAI,EACnCP,GAASO,EAAK,MAAMC,EAAOD,EAAK,QAAQ,IAAKC,CAAK,CAAC,CACvD,KACK,CACDR,GAASO,EACT,QAASE,KAAKH,EAAE,UACZN,GAAS,IAAMH,EAAI,cAAgBY,EAAI,IAAMH,EAAE,UAAUG,GAAG,SAAS,CAC7E,MAGAT,GAASO,CACjB,MAEIN,EAAGJ,GAAKS,CAChB,CACA,MAAO,CAACN,EAAOC,CAAE,CACrB,EACIS,GAAK,CAAC,EAENC,GAAO,SAAUL,EAAG,CACpB,IAAIM,EAAK,CAAC,EACV,QAASf,KAAKS,EACNA,EAAET,GAAG,QACLe,EAAG,MAAMN,EAAET,GAAK,IAAIS,EAAET,GAAG,YAAYS,EAAET,EAAE,GAAG,MAAM,EAG1D,OAAOe,CACX,EAEIC,GAAO,SAAUC,EAAKC,EAAMC,EAAIC,EAAI,CACpC,IAAIC,EACJ,GAAI,CAACR,GAAGM,GAAK,CAET,QADIhB,EAAQ,GAAImB,EAAO,CAAC,EAAGC,EAAIN,EAAI,OAAS,EACnCT,EAAI,EAAGA,EAAIe,EAAG,EAAEf,EACrBa,EAAKpB,GAAKgB,EAAIT,GAAIL,EAAOmB,CAAI,EAAGnB,EAAQkB,EAAG,GAAIC,EAAOD,EAAG,GAC7DR,GAAGM,GAAMlB,GAAKgB,EAAIM,GAAIpB,EAAOmB,CAAI,CACrC,CACA,IAAIlB,EAAKR,GAAI,CAAC,EAAGiB,GAAGM,GAAI,EAAE,EAC1B,OAAOK,GAAGX,GAAGM,GAAI,GAAK,0EAA4ED,EAAK,SAAS,EAAI,IAAKC,EAAIf,EAAIU,GAAKV,CAAE,EAAGgB,CAAE,CACjJ,EAEIK,GAAS,UAAY,CAAE,MAAO,CAACC,EAAIC,EAAKC,GAAKC,GAAMC,GAAMC,GAAMC,GAAIC,GAAIC,GAAMC,GAAMC,GAAKC,GAAIC,EAAMC,GAAKC,EAAMC,GAAQC,GAAMC,GAAKC,EAAKC,GAAOC,GAAaC,GAAKC,EAAG,CAAG,EAWxK,IAAIC,GAAM,SAAUC,EAAK,CAAE,OAAO,YAAYA,EAAK,CAACA,EAAI,MAAM,CAAC,CAAG,EAE9DC,GAAM,SAAUC,EAAG,CAAE,OAAOA,GAAKA,EAAE,MAAQ,IAAIC,EAAGD,EAAE,IAAI,CAAG,EAE3DE,GAAQ,SAAUC,EAAKC,EAAMC,EAAKC,EAAMC,EAAIC,EAAI,CAChD,IAAIC,EAAIC,GAAKL,EAAKC,EAAMC,EAAI,SAAUI,EAAKR,EAAK,CAC5CM,EAAE,UAAU,EACZD,EAAGG,EAAKR,CAAG,CACf,CAAC,EACD,OAAAM,EAAE,YAAY,CAACN,EAAKC,CAAI,EAAGA,EAAK,QAAU,CAACD,EAAI,MAAM,EAAI,CAAC,CAAC,EACpD,UAAY,CAAEM,EAAE,UAAU,CAAG,CACxC,EA6BA,IAAIG,EAAK,SAAUC,EAAGC,EAAG,CAAE,OAAOD,EAAEC,GAAMD,EAAEC,EAAI,IAAM,CAAI,EAEtDC,EAAK,SAAUF,EAAGC,EAAG,CAAE,OAAQD,EAAEC,GAAMD,EAAEC,EAAI,IAAM,EAAMD,EAAEC,EAAI,IAAM,GAAOD,EAAEC,EAAI,IAAM,MAAS,CAAG,EACpGE,GAAK,SAAUH,EAAGC,EAAG,CAAE,OAAOC,EAAGF,EAAGC,CAAC,EAAKC,EAAGF,EAAGC,EAAI,CAAC,EAAI,UAAa,EAsLnE,SAASG,GAAQC,EAAMC,EAAMC,EAAI,CACpC,OAAKA,IACDA,EAAKD,EAAMA,EAAO,CAAC,GACnB,OAAOC,GAAM,YACbC,EAAI,CAAC,EACFC,GAAMJ,EAAMC,EAAM,CACrBI,EACJ,EAAG,SAAUC,EAAI,CAAE,OAAOC,GAAIC,GAAYF,EAAG,KAAK,GAAIG,GAAIH,EAAG,KAAK,EAAE,CAAC,CAAC,CAAG,EAAG,EAAGJ,CAAE,CACrF,CAOO,SAASM,GAAYR,EAAMU,EAAK,CACnC,OAAOC,GAAMX,EAAMU,CAAG,CAC1B,CAoaA,IAAIE,GAAK,OAAO,YAAe,KAA6B,IAAI,YAE5DC,GAAM,EACV,GAAI,CACAD,GAAG,OAAOE,GAAI,CAAE,OAAQ,EAAK,CAAC,EAC9BD,GAAM,CACV,MACA,CAAY,CAEZ,IAAIE,GAAQ,SAAUC,EAAG,CACrB,QAASC,EAAI,GAAIC,EAAI,IAAK,CACtB,IAAIC,EAAIH,EAAEE,KACNE,GAAMD,EAAI,MAAQA,EAAI,MAAQA,EAAI,KACtC,GAAID,EAAIE,EAAKJ,EAAE,OACX,MAAO,CAACC,EAAGI,GAAIL,EAAGE,EAAI,CAAC,CAAC,EACvBE,EAEIA,GAAM,GACXD,IAAMA,EAAI,KAAO,IAAMH,EAAEE,KAAO,KAAO,IAAMF,EAAEE,KAAO,KAAO,EAAKF,EAAEE,KAAO,IAAO,MAC9ED,GAAK,OAAO,aAAa,MAASE,GAAK,GAAK,MAASA,EAAI,IAAK,GAE7DC,EAAK,EACVH,GAAK,OAAO,cAAcE,EAAI,KAAO,EAAKH,EAAEE,KAAO,EAAG,EAEtDD,GAAK,OAAO,cAAcE,EAAI,KAAO,IAAMH,EAAEE,KAAO,KAAO,EAAKF,EAAEE,KAAO,EAAG,EAR5ED,GAAK,OAAO,aAAaE,CAAC,CASlC,CACJ,EA4HO,SAASG,GAAUC,EAAKC,EAAQ,CACnC,GAAIA,EAAQ,CAER,QADI,EAAI,GACCC,EAAI,EAAGA,EAAIF,EAAI,OAAQE,GAAK,MACjC,GAAK,OAAO,aAAa,MAAM,KAAMF,EAAI,SAASE,EAAGA,EAAI,KAAK,CAAC,EACnE,OAAO,CACX,KACK,IAAIC,GACL,OAAOA,GAAG,OAAOH,CAAG,EAEpB,IAAII,EAAKC,GAAML,CAAG,EAAGM,EAAMF,EAAG,GAAIG,EAAMH,EAAG,GAC3C,OAAIG,EAAI,QACJC,EAAI,CAAC,EACFF,EAEf,CAKA,IAAIG,GAAO,SAAUC,EAAGC,EAAG,CAAE,OAAOA,EAAI,GAAKC,EAAGF,EAAGC,EAAI,EAAE,EAAIC,EAAGF,EAAGC,EAAI,EAAE,CAAG,EAExEE,GAAK,SAAUH,EAAGC,EAAGG,EAAG,CACxB,IAAIC,EAAMH,EAAGF,EAAGC,EAAI,EAAE,EAAGK,EAAKC,GAAUP,EAAE,SAASC,EAAI,GAAIA,EAAI,GAAKI,CAAG,EAAG,EAAEH,EAAGF,EAAGC,EAAI,CAAC,EAAI,KAAK,EAAGO,EAAKP,EAAI,GAAKI,EAAKI,EAAKC,EAAGV,EAAGC,EAAI,EAAE,EACnIU,EAAKP,GAAKK,GAAM,WAAaG,GAAKZ,EAAGQ,CAAE,EAAI,CAACC,EAAIC,EAAGV,EAAGC,EAAI,EAAE,EAAGS,EAAGV,EAAGC,EAAI,EAAE,CAAC,EAAGY,EAAKF,EAAG,GAAIG,EAAKH,EAAG,GAAII,EAAMJ,EAAG,GACpH,MAAO,CAACT,EAAGF,EAAGC,EAAI,EAAE,EAAGY,EAAIC,EAAIR,EAAIE,EAAKN,EAAGF,EAAGC,EAAI,EAAE,EAAIC,EAAGF,EAAGC,EAAI,EAAE,EAAGc,CAAG,CAC9E,EAEIH,GAAO,SAAUZ,EAAGC,EAAG,CACvB,KAAOC,EAAGF,EAAGC,CAAC,GAAK,EAAGA,GAAK,EAAIC,EAAGF,EAAGC,EAAI,CAAC,EACtC,CACJ,MAAO,CAACe,GAAGhB,EAAGC,EAAI,EAAE,EAAGe,GAAGhB,EAAGC,EAAI,CAAC,EAAGe,GAAGhB,EAAGC,EAAI,EAAE,CAAC,CACtD,EAwrBA,IAAIgB,GAAK,OAAO,gBAAkB,WAAa,eAAiB,OAAO,YAAc,WAAa,WAAa,SAAUC,EAAI,CAAEA,EAAG,CAAG,EAC9H,SAASC,GAAMC,EAAMC,EAAMC,EAAI,CAC7BA,IACDA,EAAKD,EAAMA,EAAO,CAAC,GACnB,OAAOC,GAAM,YACbC,EAAI,CAAC,EACT,IAAIC,EAAO,CAAC,EACRC,EAAO,UAAY,CACnB,QAASC,EAAI,EAAGA,EAAIF,EAAK,OAAQ,EAAEE,EAC/BF,EAAKE,GAAG,CAChB,EACIC,EAAQ,CAAC,EACTC,EAAM,SAAUC,EAAGC,EAAG,CACtBb,GAAG,UAAY,CAAEK,EAAGO,EAAGC,CAAC,CAAG,CAAC,CAChC,EACAb,GAAG,UAAY,CAAEW,EAAMN,CAAI,CAAC,EAE5B,QADIS,EAAIX,EAAK,OAAS,GACfY,EAAGZ,EAAMW,CAAC,GAAK,UAAW,EAAEA,EAC/B,GAAI,CAACA,GAAKX,EAAK,OAASW,EAAI,MACxB,OAAAH,EAAIL,EAAI,GAAI,EAAG,CAAC,EAAG,IAAI,EAChBE,EAIf,IAAIQ,EAAMC,EAAGd,EAAMW,EAAI,CAAC,EACxB,GAAIE,EAAK,CACL,IAAIE,EAAIF,EACJG,EAAIJ,EAAGZ,EAAMW,EAAI,EAAE,EACnBM,EAAID,GAAK,YAAcD,GAAK,MAChC,GAAIE,EAAG,CACH,IAAIC,EAAKN,EAAGZ,EAAMW,EAAI,EAAE,EACxBM,EAAIL,EAAGZ,EAAMkB,CAAE,GAAK,UAChBD,IACAF,EAAIF,EAAMD,EAAGZ,EAAMkB,EAAK,EAAE,EAC1BF,EAAIJ,EAAGZ,EAAMkB,EAAK,EAAE,EAE5B,CA4CA,QA3CIC,EAAOlB,GAAQA,EAAK,OACpBmB,EAAU,SAAUd,EAAG,CACvB,IAAIe,EAAKC,GAAGtB,EAAMgB,EAAGC,CAAC,EAAGM,EAAMF,EAAG,GAAIG,EAAKH,EAAG,GAAII,EAAKJ,EAAG,GAAIvB,GAAKuB,EAAG,GAAIK,EAAKL,EAAG,GAAIM,GAAMN,EAAG,GAAIX,EAAIkB,GAAK5B,EAAM2B,EAAG,EACrHX,EAAIU,EACJ,IAAIG,EAAM,SAAUlB,EAAGmB,GAAG,CAClBnB,GACAN,EAAK,EACLG,EAAIG,EAAG,IAAI,IAGPmB,KACAvB,EAAMT,IAAMgC,IACX,EAAEjB,GACHL,EAAI,KAAMD,CAAK,EAE3B,EACA,GAAI,CAACY,GAAQA,EAAK,CACd,KAAMrB,GACN,KAAM0B,EACN,aAAcC,EACd,YAAaF,CACjB,CAAC,EACG,GAAI,CAACA,EACDM,EAAI,KAAME,GAAI/B,EAAMU,EAAGA,EAAIc,CAAE,CAAC,UACzBD,GAAO,EAAG,CACf,IAAIS,GAAOhC,EAAK,SAASU,EAAGA,EAAIc,CAAE,EAClC,GAAIA,EAAK,KACL,GAAI,CACAK,EAAI,KAAMI,GAAYD,GAAM,IAAIE,EAAGT,CAAE,CAAC,CAAC,CAC3C,OACOd,EAAP,CACIkB,EAAIlB,EAAG,IAAI,CACf,MAGAP,EAAK,KAAK+B,GAAQH,GAAM,CAAE,KAAMP,CAAG,EAAGI,CAAG,CAAC,CAClD,MAEIA,EAAI1B,EAAI,GAAI,4BAA8BoB,EAAK,CAAC,EAAG,IAAI,OAG3DM,EAAI,KAAM,IAAI,CACtB,EACSvB,EAAI,EAAGA,EAAIS,EAAG,EAAET,EACrBc,EAAQd,CAAC,CAEjB,MAEIE,EAAI,KAAM,CAAC,CAAC,EAChB,OAAOH,CACX,CD57EA,IAAA+B,GAAyC,cACzCC,EAA6C,uBAC7CC,EAAqB,gBEtBrBC,IAUO,SAASC,GAASC,EAAa,CAClC,SAASC,EAAWC,EAAWC,EAAW,EAAWC,EAAW,CAC5D,IAAIC,EAAS,EAEb,OAAAA,GAAUH,GAAK,EACfG,GAAUF,GAAK,EACfE,GAAU,GAAK,GACfA,GAAUD,GAAK,KAAO,EACfC,CACX,CAIA,GAAIL,EAAI,KAAO,IAAMA,EAAI,KAAO,IAAMA,EAAI,KAAO,GAAKA,EAAI,KAAO,EAC7D,OAAOA,EAIX,GAAIA,EAAI,KAAO,IAAMA,EAAI,KAAO,KAAOA,EAAI,KAAO,IAAMA,EAAI,KAAO,GAC/D,MAAM,IAAI,MAAM,0CAA0C,EAM9D,IAAMM,EAAON,EAAI,KAAO,EAClBO,EAAOP,EAAI,KAAO,EAExB,GAAK,CAACO,GAAQ,CAACD,GAASN,EAAI,IAAMA,EAAI,IAAMA,EAAI,GAC5C,MAAM,IAAI,MAAM,uCAAuC,EAG3D,GAAIO,EAAM,CACN,IAAMC,EAAkBP,EAAWD,EAAI,GAAIA,EAAI,GAAIA,EAAI,IAAKA,EAAI,GAAG,EAC7DS,EAAkBR,EAAWD,EAAI,IAAKA,EAAI,IAAKA,EAAI,IAAKA,EAAI,GAAG,EAG/DU,EAAiB,GAAKF,EAAkBC,EAE9C,OAAOT,EAAI,SAASU,EAAgBV,EAAI,MAAM,CAClD,CAGA,IAAMU,EAAiB,GADJT,EAAWD,EAAI,GAAIA,EAAI,GAAIA,EAAI,IAAKA,EAAI,GAAG,EAG9D,OAAOA,EAAI,SAASU,EAAgBV,EAAI,MAAM,CAClD,CF9BAW,KAEA,IAAMC,MAAoB,QAAKC,GAAU,gBAAgB,EAEzD,eAAeC,GAAQC,EAAcC,EAAgB,CACjD,eAAM,SAAMA,EAAQ,CAAE,UAAW,EAAK,CAAC,EAChC,IAAI,QAAc,CAACC,EAASC,IAAW,CAC1CC,GAAMJ,EAAM,CAACK,EAAKC,IAAU,CACxB,GAAID,EAAK,OAAO,KAAKF,EAAOE,CAAG,EAC/B,QAAQ,IAAI,OAAO,KAAKC,CAAK,EAAE,IAAI,MAAMC,GAAK,CAI1C,GAAIA,EAAE,WAAW,YAAY,EAAG,OAEhC,GAAIA,EAAE,SAAS,GAAG,EAAG,OAAO,OAAK,YAAM,QAAKN,EAAQM,CAAC,EAAG,CAAE,UAAW,EAAK,CAAC,EAE3E,IAAMC,EAAeD,EAAE,MAAM,GAAG,EAC1BE,EAAOD,EAAa,IAAI,EACxBE,EAAcF,EAAa,KAAK,GAAG,EACnCG,KAAM,QAAKV,EAAQS,CAAW,EAEhCA,GACA,QAAM,SAAMC,EAAK,CAAE,UAAW,EAAK,CAAC,EAGxC,QAAM,gBAAU,QAAKA,EAAKF,CAAI,EAAGH,EAAMC,EAAE,CAC7C,CAAC,CAAC,EACG,KAAK,IAAML,EAAQ,CAAC,EACpB,MAAMG,GAAO,IACV,MAAGJ,EAAQ,CAAE,UAAW,GAAM,MAAO,EAAK,CAAC,EAC3CE,EAAOE,CAAG,CACd,CAAC,CACT,CAAC,CACL,CAAC,CACL,CAEA,eAAsBO,GAAWC,EAAY,CACzC,IAAMC,KAAS,QAAKjB,GAAmB,GAAGgB,GAAI,EAE9C,GAAI,CACA,QAAM,UAAOC,EAAQ,GAAAC,UAAY,IAAI,CACzC,MAAE,CACE,IAAMC,EAAMH,IAAO,mCAIb,0IACA,mGAAmGA,wBACnGI,EAAM,MAAMC,EAAIF,EAAK,CACvB,QAAS,CACL,aAAc,iDAClB,CACJ,CAAC,EACD,MAAMjB,GAAQoB,GAASF,CAAG,EAAGH,CAAM,EAAE,MAAM,QAAQ,KAAK,CAC5D,CAEA,WAAQ,eAAe,cAAcA,CAAM,CAC/C,CjBzDI,MAAI,UAAU,EAAE,KAAK,IAAM,CAGvB,WAAS,qBAAqB,UAAW,CAAC,CAAE,IAAKM,CAAU,EAAGC,IAAO,CACjE,IAAIC,EAAMF,EAAU,MAAM,EAAmB,EAE7C,GADIE,EAAI,SAAS,GAAG,IAAGA,EAAMA,EAAI,MAAM,EAAG,EAAE,GACxCA,EAAI,WAAW,UAAU,EAAG,CAC5B,IAAMC,EAAQD,EAAI,MAAM,CAAiB,EACnCE,EAAUC,GAAeC,EAAYH,CAAK,EAChD,GAAI,CAACC,EAAS,CACVH,EAAG,CAAE,WAAY,GAAI,CAAC,EACtB,MACJ,CACAA,EAAGG,EAAQ,QAAQ,WAAY,EAAE,CAAC,EAClC,MACJ,CACA,OAAQF,EAAK,CACT,IAAK,kBACL,IAAK,gCACL,IAAK,iBACL,IAAK,+BACL,IAAK,iBACL,IAAK,4BACDD,KAAG,SAAK,UAAWC,CAAG,CAAC,EACvB,MACJ,QACID,EAAG,CAAE,WAAY,GAAI,CAAC,CAC9B,CACJ,CAAC,EAED,GAAI,CACIM,EAAiB,MAAM,qBACvBC,GAAW,kCAAkC,EACxC,KAAK,IAAM,QAAQ,KAAK,2CAA2C,CAAC,EACpE,MAAMC,GAAO,QAAQ,MAAM,oDAAqDA,CAAG,CAAC,CACjG,MAAE,CAAQ,CAGV,IAAMC,EAAa,CAACC,EAAmCC,IAC5C,OAAO,KAAKD,CAAO,EAAE,KAAKE,GAAKA,EAAE,YAAY,IAAMD,CAAU,EAMlEE,EAAeC,GAAiC,CAClD,IAAMC,EAAuB,CAAC,EAC9B,OAAAD,EAAO,MAAM,GAAG,EAAE,QAAQE,GAAa,CACnC,GAAM,CAACC,KAAiBC,CAAc,EAAIF,EAAU,KAAK,EAAE,MAAM,MAAM,EACnEC,GAAgB,CAAC,OAAO,UAAU,eAAe,KAAKF,EAAQE,CAAY,IAC1EF,EAAOE,GAAgBC,EAE/B,CAAC,EAEMH,CACX,EACMI,EAAmBL,GACrB,OAAO,QAAQA,CAAM,EAChB,OAAO,CAAC,CAAC,CAAEM,CAAM,IAAMA,GAAQ,MAAM,EACrC,IAAIJ,GAAaA,EAAU,KAAK,EAAE,KAAK,GAAG,CAAC,EAC3C,KAAK,IAAI,EAEZK,EAAYX,GAAsC,CACpD,IAAMY,EAASb,EAAWC,EAAS,yBAAyB,EAE5D,GAAIY,EAAQ,CACR,IAAMC,EAAMV,EAAYH,EAAQY,GAAQ,EAAE,EAE1C,QAAWN,IAAa,CAAC,YAAa,cAAe,UAAW,WAAY,YAAa,YAAY,EACjGO,EAAIP,KAAe,CAAC,EACpBO,EAAIP,GAAW,KAAK,IAAK,QAAS,QAAS,WAAY,iBAAiB,EAK5EO,EAAI,gBAAkB,CAAC,EACvBA,EAAI,cAAc,KAAK,gBAAiB,oBAAqB,8BAA8B,EAC3Fb,EAAQY,GAAU,CAACH,EAAgBI,CAAG,CAAC,CAC3C,CACJ,EAEA,UAAQ,eAAe,WAAW,kBAAkB,CAAC,CAAE,gBAAAC,EAAiB,aAAAC,CAAa,EAAGzB,IAAO,CAC3F,GAAIwB,IACIC,IAAiB,aACjBJ,EAASG,CAAe,EAIxBC,IAAiB,cAAc,CAC/B,IAAMH,EAASb,EAAWe,EAAiB,cAAc,EACrDF,IACAE,EAAgBF,GAAU,CAAC,UAAU,EAC7C,CAGJtB,EAAG,CAAE,OAAQ,GAAO,gBAAAwB,CAAgB,CAAC,CACzC,CAAC,EAKD,UAAQ,eAAe,WAAW,kBAAoB,IAAM,CAAE,CAClE,CAAC", - "names": ["init_react", "__esmMin", "init_IpcEvents", "__esmMin", "init_react", "git_hash_default", "init_git_hash", "__esmMin", "init_react", "git_remote_default", "init_git_remote", "__esmMin", "init_react", "VENCORD_USER_AGENT", "init_vencordUserAgent", "__esmMin", "init_react", "init_git_hash", "init_git_remote", "git_hash_default", "git_remote_default", "get", "url", "options", "resolve", "reject", "https", "res", "statusCode", "statusMessage", "headers", "chunks", "chunk", "import_https", "init_simpleGet", "__esmMin", "init_react", "serializeErrors", "func", "e", "VENCORD_FILES", "init_common", "__esmMin", "init_react", "http_exports", "githubGet", "endpoint", "get", "API_BASE", "VENCORD_USER_AGENT", "calculateGitChanges", "fetchUpdates", "res", "git_hash_default", "c", "release", "data", "name", "browser_download_url", "VENCORD_FILES", "s", "PendingUpdates", "applyUpdates", "import_electron", "import_promises", "import_path", "init_http", "__esmMin", "init_react", "init_IpcEvents", "init_vencordUserAgent", "init_git_hash", "init_git_remote", "init_simpleGet", "init_common", "git_remote_default", "serializeErrors", "init_react", "import_electron", "import_path", "init_react", "init_react", "init_react", "init_IpcEvents", "import_electron", "init_react", "native_exports", "init_react", "init_react", "init_IpcEvents", "init_react", "SettingsStore", "plain", "options", "object", "root", "path", "self", "target", "key", "v", "value", "setPath", "cb", "pathToNotify", "p", "listeners", "import_electron", "import_fs", "init_react", "import_electron", "import_path", "DATA_DIR", "SETTINGS_DIR", "THEMES_DIR", "QUICKCSS_PATH", "SETTINGS_FILE", "NATIVE_SETTINGS_FILE", "ALLOWED_PROTOCOLS", "SETTINGS_DIR", "readSettings", "name", "file", "err", "RendererSettings", "SettingsStore", "SETTINGS_FILE", "_", "data", "pathToNotify", "NativeSettings", "NATIVE_SETTINGS_FILE", "import_electron", "_", "win", "frame", "settings", "RendererSettings", "native_exports", "init_react", "import_electron", "_", "win", "frame", "RendererSettings", "native_exports", "__export", "resolveRedirect", "init_react", "import_https", "validRedirectUrls", "getRedirect", "url", "resolve", "reject", "req", "res", "_", "native_exports", "__export", "readRecording", "init_react", "import_electron", "import_promises", "import_path", "_", "filePath", "filename", "discordBaseDirWithTrailingSlash", "buf", "native_exports", "__export", "sendToOverlay", "init_react", "import_dgram", "xsoSocket", "_", "data", "json", "pluginNatives_default", "native_exports", "PluginIpcMappings", "plugin", "methods", "pluginNatives_default", "entries", "mappings", "methodName", "method", "key", "init_react", "init_IpcEvents", "import_electron", "import_fs", "import_promises", "import_path", "init_react", "monacoWin_default", "init_react", "splitRegex", "escapedAtRegex", "makeHeader", "fileName", "opts", "stripBOM", "fileContent", "getThemeInfo", "css", "block", "header", "field", "accum", "line", "l", "init_react", "import_electron", "makeLinksOpenExternally", "win", "url", "protocol", "THEMES_DIR", "ensureSafePath", "basePath", "path", "normalizedBasePath", "newPath", "normalizedPath", "readCss", "QUICKCSS_PATH", "listThemes", "files", "themeInfo", "fileName", "data", "getThemeData", "stripBOM", "getThemeInfo", "safePath", "_", "url", "protocol", "ALLOWED_PROTOCOLS", "css", "title", "existingWindow", "w", "win", "makeLinksOpenExternally", "monacoWin_default", "init_react", "import_electron", "init_react", "import_module", "require", "Worker", "workerAdd", "wk", "c", "_", "msg", "transfer", "cb", "done", "w", "e", "m", "__", "___", "____", "NOP", "u8", "u16", "u32", "fleb", "fdeb", "clim", "freb", "eb", "start", "b", "i", "r", "j", "_a", "fl", "revfl", "_b", "fd", "revfd", "rev", "x", "hMap", "cd", "mb", "s", "l", "le", "co", "rvb", "sv", "r_1", "v", "flt", "fdt", "flrm", "hMap", "flt", "fdrm", "hMap", "fdt", "max", "a", "m", "i", "bits", "d", "p", "o", "bits16", "shft", "slc", "v", "s", "e", "u16", "u32", "u8", "ec", "err", "ind", "msg", "nt", "e", "inflt", "dat", "buf", "st", "sl", "u8", "noBuf", "noSt", "cbuf", "l", "bl", "nbuf", "final", "pos", "bt", "lm", "dm", "lbt", "dbt", "tbts", "bits", "type", "flrm", "fdrm", "hLit", "hcLen", "tl", "ldt", "clt", "i", "clim", "clb", "max", "clbmsk", "clm", "hMap", "r", "s", "c", "n", "lt", "dt", "shft", "t", "lms", "dms", "lpos", "bits16", "sym", "add", "b", "fleb", "fl", "d", "dsym", "fd", "fdeb", "end", "slc", "et", "u8", "mrg", "a", "b", "o", "k", "wcln", "fn", "fnStr", "td", "dt", "st", "ks", "i", "v", "st_1", "spInd", "t", "ch", "cbfs", "tl", "wrkr", "fns", "init", "id", "cb", "_a", "td_1", "m", "wk", "bInflt", "u8", "u16", "u32", "fleb", "fdeb", "clim", "fl", "fd", "flrm", "fdrm", "rev", "ec", "hMap", "max", "bits", "bits16", "shft", "slc", "err", "inflt", "inflateSync", "pbf", "gu8", "pbf", "msg", "gu8", "o", "u8", "cbify", "dat", "opts", "fns", "init", "id", "cb", "w", "wrkr", "err", "b2", "d", "b", "b4", "b8", "inflate", "data", "opts", "cb", "err", "cbify", "bInflt", "ev", "pbf", "inflateSync", "gu8", "out", "inflt", "td", "tds", "et", "dutf8", "d", "r", "i", "c", "eb", "slc", "strFromU8", "dat", "latin1", "i", "td", "_a", "dutf8", "out", "ext", "err", "slzh", "d", "b", "b2", "zh", "z", "fnl", "fn", "strFromU8", "es", "bs", "b4", "_a", "z64e", "sc", "su", "off", "b8", "mt", "fn", "unzip", "data", "opts", "cb", "err", "term", "tAll", "i", "files", "cbd", "a", "b", "e", "b4", "lft", "b2", "c", "o", "z", "ze", "fltr", "_loop_3", "_a", "zh", "c_1", "sc", "su", "no", "off", "slzh", "cbl", "d", "slc", "infl", "inflateSync", "u8", "inflate", "import_fs", "import_promises", "import_path", "init_react", "crxToZip", "buf", "calcLength", "a", "b", "d", "length", "isV3", "isV2", "publicKeyLength", "signatureLength", "zipStartOffset", "init_simpleGet", "extensionCacheDir", "DATA_DIR", "extract", "data", "outDir", "resolve", "reject", "unzip", "err", "files", "f", "pathElements", "name", "directories", "dir", "installExt", "id", "extDir", "fsConstants", "url", "buf", "get", "crxToZip", "unsafeUrl", "cb", "url", "theme", "safeUrl", "ensureSafePath", "THEMES_DIR", "RendererSettings", "installExt", "err", "findHeader", "headers", "headerName", "h", "parsePolicy", "policy", "result", "directive", "directiveKey", "directiveValue", "stringifyPolicy", "values", "patchCsp", "header", "csp", "responseHeaders", "resourceType"] -} diff --git a/vesktop/vencordDist/vencordDesktopPreload.js b/vesktop/vencordDist/vencordDesktopPreload.js deleted file mode 100644 index 6c44a80..0000000 --- a/vesktop/vencordDist/vencordDesktopPreload.js +++ /dev/null @@ -1,7 +0,0 @@ -// Vencord ca18b6e -// Standalone: true -// Platform: Universal -// Updater disabled: false -"use strict";function a(e,r=300){let n;return function(...d){clearTimeout(n),n=setTimeout(()=>{e(...d)},r)}}var s=require("electron"),m=require("fs"),S=require("path");var o=require("electron");function t(e,...r){return o.ipcRenderer.invoke(e,...r)}function c(e,...r){return o.ipcRenderer.sendSync(e,...r)}var _={},u=c("VencordGetPluginIpcMethodMap");for(let[e,r]of Object.entries(u)){let n=_[e]={};for(let[d,g]of Object.entries(r))n[d]=(...p)=>t(g,...p)}var i={themes:{uploadTheme:(e,r)=>t("VencordUploadTheme",e,r),deleteTheme:e=>t("VencordDeleteTheme",e),getThemesDir:()=>t("VencordGetThemesDir"),getThemesList:()=>t("VencordGetThemesList"),getThemeData:e=>t("VencordGetThemeData",e),getSystemValues:()=>t("VencordGetThemeSystemValues")},updater:{getUpdates:()=>t("VencordGetUpdates"),update:()=>t("VencordUpdate"),rebuild:()=>t("VencordBuild"),getRepo:()=>t("VencordGetRepo")},settings:{get:()=>c("VencordGetSettings"),set:(e,r)=>t("VencordSetSettings",e,r),getSettingsDir:()=>t("VencordGetSettingsDir")},quickCss:{get:()=>t("VencordGetQuickCss"),set:e=>t("VencordSetQuickCss",e),addChangeListener(e){o.ipcRenderer.on("VencordQuickCssUpdate",(r,n)=>e(n))},addThemeChangeListener(e){o.ipcRenderer.on("VencordThemeUpdate",()=>e())},openFile:()=>t("VencordOpenQuickCss"),openEditor:()=>t("VencordOpenMonacoEditor")},native:{getVersions:()=>process.versions,openExternal:e=>t("VencordOpenExternal",e)},pluginHelpers:_};s.contextBridge.exposeInMainWorld("VencordNative",i);if(location.protocol!=="data:"){let e=(0,S.join)(__dirname,"vencordDesktopRenderer.css"),r=document.createElement("style");r.id="vencord-css-core",r.textContent=(0,m.readFileSync)(e,"utf-8"),document.readyState==="complete"?document.documentElement.appendChild(r):document.addEventListener("DOMContentLoaded",()=>document.documentElement.appendChild(r),{once:!0})}else s.contextBridge.exposeInMainWorld("setCss",a(i.quickCss.set)),s.contextBridge.exposeInMainWorld("getCurrentCss",i.quickCss.get),s.contextBridge.exposeInMainWorld("getTheme",()=>"vs-dark"); -//# sourceURL=VencordPreload -//# sourceMappingURL=vencord://vencordDesktopPreload.js.map diff --git a/vesktop/vencordDist/vencordDesktopPreload.js.map b/vesktop/vencordDist/vencordDesktopPreload.js.map deleted file mode 100644 index edb579b..0000000 --- a/vesktop/vencordDist/vencordDesktopPreload.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../src/shared/debounce.ts", "../src/preload.ts", "../src/VencordNative.ts"], - "sourcesContent": ["/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n/**\n * Returns a new function that will call the wrapped function\n * after the specified delay. If the function is called again\n * within the delay, the timer will be reset.\n * @param func The function to wrap\n * @param delay The delay in milliseconds\n */\nexport function debounce(func: T, delay = 300): T {\n let timeout: NodeJS.Timeout;\n return function (...args: any[]) {\n clearTimeout(timeout);\n timeout = setTimeout(() => { func(...args); }, delay);\n } as any;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { debounce } from \"@shared/debounce\";\nimport { contextBridge, webFrame } from \"electron\";\nimport { readFileSync, watch } from \"fs\";\nimport { join } from \"path\";\n\nimport VencordNative from \"./VencordNative\";\n\ncontextBridge.exposeInMainWorld(\"VencordNative\", VencordNative);\n\n// Discord\nif (location.protocol !== \"data:\") {\n // #region cssInsert\n const rendererCss = join(__dirname, IS_VESKTOP ? \"vencordDesktopRenderer.css\" : \"renderer.css\");\n\n const style = document.createElement(\"style\");\n style.id = \"vencord-css-core\";\n style.textContent = readFileSync(rendererCss, \"utf-8\");\n\n if (document.readyState === \"complete\") {\n document.documentElement.appendChild(style);\n } else {\n document.addEventListener(\"DOMContentLoaded\", () => document.documentElement.appendChild(style), {\n once: true\n });\n }\n\n if (IS_DEV) {\n // persistent means keep process running if watcher is the only thing still running\n // which we obviously don't want\n watch(rendererCss, { persistent: false }, () => {\n document.getElementById(\"vencord-css-core\")!.textContent = readFileSync(rendererCss, \"utf-8\");\n });\n }\n // #endregion\n\n if (IS_DISCORD_DESKTOP) {\n webFrame.executeJavaScript(readFileSync(join(__dirname, \"renderer.js\"), \"utf-8\"));\n require(process.env.DISCORD_PRELOAD!);\n }\n} // Monaco popout\nelse {\n contextBridge.exposeInMainWorld(\"setCss\", debounce(VencordNative.quickCss.set));\n contextBridge.exposeInMainWorld(\"getCurrentCss\", VencordNative.quickCss.get);\n // shrug\n contextBridge.exposeInMainWorld(\"getTheme\", () => \"vs-dark\");\n}\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { PluginIpcMappings } from \"@main/ipcPlugins\";\nimport type { UserThemeHeader } from \"@main/themes\";\nimport { IpcEvents } from \"@shared/IpcEvents\";\nimport { IpcRes } from \"@utils/types\";\nimport type { Settings } from \"api/Settings\";\nimport { ipcRenderer } from \"electron\";\n\nfunction invoke(event: IpcEvents, ...args: any[]) {\n return ipcRenderer.invoke(event, ...args) as Promise;\n}\n\nexport function sendSync(event: IpcEvents, ...args: any[]) {\n return ipcRenderer.sendSync(event, ...args) as T;\n}\n\nconst PluginHelpers = {} as Record Promise>>;\nconst pluginIpcMap = sendSync(IpcEvents.GET_PLUGIN_IPC_METHOD_MAP);\n\nfor (const [plugin, methods] of Object.entries(pluginIpcMap)) {\n const map = PluginHelpers[plugin] = {};\n for (const [methodName, method] of Object.entries(methods)) {\n map[methodName] = (...args: any[]) => invoke(method as IpcEvents, ...args);\n }\n}\n\nexport default {\n themes: {\n uploadTheme: (fileName: string, fileData: string) => invoke(IpcEvents.UPLOAD_THEME, fileName, fileData),\n deleteTheme: (fileName: string) => invoke(IpcEvents.DELETE_THEME, fileName),\n getThemesDir: () => invoke(IpcEvents.GET_THEMES_DIR),\n getThemesList: () => invoke>(IpcEvents.GET_THEMES_LIST),\n getThemeData: (fileName: string) => invoke(IpcEvents.GET_THEME_DATA, fileName),\n getSystemValues: () => invoke>(IpcEvents.GET_THEME_SYSTEM_VALUES),\n },\n\n updater: {\n getUpdates: () => invoke[]>>(IpcEvents.GET_UPDATES),\n update: () => invoke>(IpcEvents.UPDATE),\n rebuild: () => invoke>(IpcEvents.BUILD),\n getRepo: () => invoke>(IpcEvents.GET_REPO),\n },\n\n settings: {\n get: () => sendSync(IpcEvents.GET_SETTINGS),\n set: (settings: Settings, pathToNotify?: string) => invoke(IpcEvents.SET_SETTINGS, settings, pathToNotify),\n getSettingsDir: () => invoke(IpcEvents.GET_SETTINGS_DIR),\n },\n\n quickCss: {\n get: () => invoke(IpcEvents.GET_QUICK_CSS),\n set: (css: string) => invoke(IpcEvents.SET_QUICK_CSS, css),\n\n addChangeListener(cb: (newCss: string) => void) {\n ipcRenderer.on(IpcEvents.QUICK_CSS_UPDATE, (_, css) => cb(css));\n },\n\n addThemeChangeListener(cb: () => void) {\n ipcRenderer.on(IpcEvents.THEME_UPDATE, () => cb());\n },\n\n openFile: () => invoke(IpcEvents.OPEN_QUICKCSS),\n openEditor: () => invoke(IpcEvents.OPEN_MONACO_EDITOR),\n },\n\n native: {\n getVersions: () => process.versions as Partial,\n openExternal: (url: string) => invoke(IpcEvents.OPEN_EXTERNAL, url)\n },\n\n pluginHelpers: PluginHelpers\n};\n"], - "mappings": ";;;;aAyBO,SAASA,EAA6BC,EAASC,EAAQ,IAAQ,CAClE,IAAIC,EACJ,OAAO,YAAaC,EAAa,CAC7B,aAAaD,CAAO,EACpBA,EAAU,WAAW,IAAM,CAAEF,EAAK,GAAGG,CAAI,CAAG,EAAGF,CAAK,CACxD,CACJ,CCZA,IAAAG,EAAwC,oBACxCC,EAAoC,cACpCC,EAAqB,gBCVrB,IAAAC,EAA4B,oBAE5B,SAASC,EAAgBC,KAAqBC,EAAa,CACvD,OAAO,cAAY,OAAOD,EAAO,GAAGC,CAAI,CAC5C,CAEO,SAASC,EAAkBF,KAAqBC,EAAa,CAChE,OAAO,cAAY,SAASD,EAAO,GAAGC,CAAI,CAC9C,CAEA,IAAME,EAAgB,CAAC,EACjBC,EAAeF,gCAA+D,EAEpF,OAAW,CAACG,EAAQC,CAAO,IAAK,OAAO,QAAQF,CAAY,EAAG,CAC1D,IAAMG,EAAMJ,EAAcE,GAAU,CAAC,EACrC,OAAW,CAACG,EAAYC,CAAM,IAAK,OAAO,QAAQH,CAAO,EACrDC,EAAIC,GAAc,IAAIP,IAAgBF,EAAOU,EAAqB,GAAGR,CAAI,CAEjF,CAEA,IAAOS,EAAQ,CACX,OAAQ,CACJ,YAAa,CAACC,EAAkBC,IAAqBb,uBAAqCY,EAAUC,CAAQ,EAC5G,YAAcD,GAAqBZ,uBAAqCY,CAAQ,EAChF,aAAc,IAAMZ,uBAAuC,EAC3D,cAAe,IAAMA,wBAAwD,EAC7E,aAAeY,GAAqBZ,wBAAqDY,CAAQ,EACjG,gBAAiB,IAAMZ,+BAAgE,CAC3F,EAEA,QAAS,CACL,WAAY,IAAMA,qBAAqF,EACvG,OAAQ,IAAMA,iBAAwC,EACtD,QAAS,IAAMA,gBAAuC,EACtD,QAAS,IAAMA,kBAAyC,CAC5D,EAEA,SAAU,CACN,IAAK,IAAMG,sBAAyC,EACpD,IAAK,CAACW,EAAoBC,IAA0Bf,uBAAqCc,EAAUC,CAAY,EAC/G,eAAgB,IAAMf,yBAAyC,CACnE,EAEA,SAAU,CACN,IAAK,IAAMA,sBAAsC,EACjD,IAAMgB,GAAgBhB,uBAAsCgB,CAAG,EAE/D,kBAAkBC,EAA8B,CAC5C,cAAY,2BAA+B,CAACC,EAAGF,IAAQC,EAAGD,CAAG,CAAC,CAClE,EAEA,uBAAuBC,EAAgB,CACnC,cAAY,wBAA2B,IAAMA,EAAG,CAAC,CACrD,EAEA,SAAU,IAAMjB,uBAAoC,EACpD,WAAY,IAAMA,2BAAyC,CAC/D,EAEA,OAAQ,CACJ,YAAa,IAAM,QAAQ,SAC3B,aAAemB,GAAgBnB,wBAAsCmB,CAAG,CAC5E,EAEA,cAAef,CACnB,EDnDA,gBAAc,kBAAkB,gBAAiBgB,CAAa,EAG9D,GAAI,SAAS,WAAa,QAAS,CAE/B,IAAMC,KAAc,QAAK,UAAwB,4BAA6C,EAExFC,EAAQ,SAAS,cAAc,OAAO,EAC5CA,EAAM,GAAK,mBACXA,EAAM,eAAc,gBAAaD,EAAa,OAAO,EAEjD,SAAS,aAAe,WACxB,SAAS,gBAAgB,YAAYC,CAAK,EAE1C,SAAS,iBAAiB,mBAAoB,IAAM,SAAS,gBAAgB,YAAYA,CAAK,EAAG,CAC7F,KAAM,EACV,CAAC,CAgBT,MAEI,gBAAc,kBAAkB,SAAUC,EAASH,EAAc,SAAS,GAAG,CAAC,EAC9E,gBAAc,kBAAkB,gBAAiBA,EAAc,SAAS,GAAG,EAE3E,gBAAc,kBAAkB,WAAY,IAAM,SAAS", - "names": ["debounce", "func", "delay", "timeout", "args", "import_electron", "import_fs", "import_path", "import_electron", "invoke", "event", "args", "sendSync", "PluginHelpers", "pluginIpcMap", "plugin", "methods", "map", "methodName", "method", "VencordNative_default", "fileName", "fileData", "settings", "pathToNotify", "css", "cb", "_", "url", "VencordNative_default", "rendererCss", "style", "debounce"] -} diff --git a/vesktop/vencordDist/vencordDesktopRenderer.css b/vesktop/vencordDist/vencordDesktopRenderer.css deleted file mode 100644 index c916f18..0000000 --- a/vesktop/vencordDist/vencordDesktopRenderer.css +++ /dev/null @@ -1 +0,0 @@ -.vc-error-card{padding:2em;background-color:#e7828430;border:1px solid #e78284;border-radius:5px;color:var(--text-normal, white)}.vc-notification-root{all:unset;display:flex;flex-direction:column;color:var(--text-normal);background-color:var(--background-secondary-alt);border-radius:6px;overflow:hidden;cursor:pointer;width:100%}.vc-notification-root:not(.vc-notification-log-wrapper > .vc-notification-root){position:absolute;z-index:2147483647;right:1rem;width:25vw;min-height:10vh}.vc-notification{display:flex;flex-direction:row;padding:1.25rem;gap:1.25rem}.vc-notification-content{width:100%}.vc-notification-header{display:flex;justify-content:space-between}.vc-notification-title{color:var(--header-primary);font-size:1rem;font-weight:600;line-height:1.25rem;text-transform:uppercase}.vc-notification-close-btn{all:unset;cursor:pointer;color:var(--interactive-normal);opacity:.5;transition:opacity .2s ease-in-out,color .2s ease-in-out}.vc-notification-close-btn:hover{color:var(--interactive-hover);opacity:1}.vc-notification-icon{height:4rem;width:4rem;border-radius:6px}.vc-notification-progressbar{height:.25rem;border-radius:5px;margin-top:auto}.vc-notification-p{margin:.5rem 0 0;line-height:140%}.vc-notification-img{width:100%}.vc-notification-log-empty{height:218px;background:url(/assets/b36de980b174d7b798c89f35c116e5c6.svg) center no-repeat;margin-bottom:40px}.vc-notification-log-container{display:flex;flex-direction:column;padding:1em;overflow:hidden}.vc-notification-log-wrapper{transition:.2s ease;transition-property:height,opacity}.vc-notification-log-wrapper:not(:last-child){margin-bottom:1em}.vc-notification-log-removing{height:0!important;opacity:0;margin-bottom:1em}.vc-notification-log-body{display:flex;flex-direction:column}.vc-notification-log-timestamp{margin-left:auto;font-size:.8em;font-weight:lighter}.vc-notification-log-danger-btn{color:var(--white-500);background-color:var(--button-danger-background)}.vc-settings-tab-bar{margin-top:20px;margin-bottom:10px;border-bottom:2px solid var(--background-modifier-accent)}.vc-settings-tab-bar-item{margin-right:32px;padding-bottom:16px;margin-bottom:-2px}.vc-settings-quick-actions-card{padding:1em;display:flex;gap:1em;align-items:center;justify-content:space-evenly;flex-grow:1;flex-flow:row wrap;margin-bottom:1em}.vc-settings-donate{display:flex;flex-direction:row}.vc-settings-card{padding:1em;margin-bottom:1em}.vc-backup-restore-card{background-color:var(--info-warning-background);border-color:var(--info-warning-foreground);color:var(--info-warning-text)}.vc-settings-theme-links{display:inline-block!important;color:var(--text-normal)!important;padding:.5em;border:1px solid var(--background-modifier-accent);max-height:unset}.vc-cloud-settings-sync-grid{display:grid;grid-template-columns:repeat(3,1fr);grid-gap:1em}.vc-cloud-erase-data-danger-btn{color:var(--white-500);background-color:var(--button-danger-background)}.vc-text-selectable,.vc-text-selectable :where([class*="text" i],[class*="title" i]){user-select:text;cursor:initial}.vc-settings-theme-grid{display:grid;grid-gap:16px;grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}.vc-settings-theme-card{display:flex;flex-direction:column;background-color:var(--background-secondary-alt);color:var(--interactive-active);border-radius:8px;padding:1em;width:100%;transition:.1s ease-out;transition-property:box-shadow,transform,background,opacity}.vc-settings-theme-card-text{text-overflow:ellipsis;height:1.2em;margin-bottom:2px;white-space:nowrap;overflow:hidden}.vc-settings-theme-author:before{content:"by "}.vc-plugins-grid{margin-top:16px;display:grid;grid-gap:16px;grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}.vc-plugins-info-button{height:24px;width:24px;padding:0;background:transparent;margin-right:8px}.vc-plugins-settings-button:hover{color:var(--interactive-hover)}.vc-plugins-filter-controls{display:grid;height:40px;gap:10px;grid-template-columns:1fr 150px}.vc-plugins-badge{padding:0 6px;font-family:var(--font-display);font-weight:500;border-radius:8px;height:16px;font-size:12px;line-height:16px;color:var(--white-500);text-align:center}.vc-plugins-dep-name{margin:0 auto}.vc-plugins-info-card{padding:1em;height:8em;display:flex;flex-direction:column}.vc-plugins-info-card div{line-height:32px}.vc-plugins-restart-card{padding:1em;background:var(--info-warning-background);border:1px solid var(--info-warning-foreground);color:var(--info-warning-text)}.vc-plugins-restart-card button{margin-top:.5em}.vc-plugins-info-button svg:not(:hover,:focus){color:var(--text-muted)}.vc-open-external-icon{transform:rotate(45deg)}.vc-owner-crown-icon{color:var(--text-warning)}.vc-author-modal-root{padding:1em}.vc-author-modal-header{display:flex;align-items:center;margin-bottom:1em}.vc-author-modal-name{text-transform:none;flex-grow:0;background:var(--background-tertiary);border-radius:0 9999px 9999px 0;padding:6px .8em 6px .5em;font-size:20px;height:20px;position:relative;text-wrap:nowrap}.vc-author-modal-name:before{content:"";display:block;position:absolute;height:100%;width:16px;background:var(--background-tertiary);z-index:-1;left:-16px;top:0}.vc-author-modal-avatar{height:32px;width:32px;border-radius:50%}.vc-author-modal-links{margin-left:auto;display:flex;gap:.2em}.vc-author-modal-links img{height:32px;width:32px;border-radius:50%;border:4px solid var(--background-tertiary);box-sizing:border-box}.vc-author-modal-plugins{display:grid;gap:.5em}.vc-addon-card{background-color:var(--background-secondary-alt);color:var(--interactive-active);border-radius:8px;display:block;height:100%;padding:12px;width:100%;transition:.1s ease-out;transition-property:box-shadow,transform,background,opacity;box-sizing:border-box}.vc-addon-card-disabled{opacity:.6}.vc-addon-card:hover{background-color:var(--background-tertiary);transform:translateY(-1px);box-shadow:var(--elevation-high)}.vc-addon-header{margin-top:auto;display:flex;width:100%;justify-content:flex-end;align-items:center;gap:8px;margin-bottom:.5em}.vc-addon-note{height:36px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;box-orient:vertical}.vc-addon-name-author{width:100%}.vc-addon-name{display:flex;width:100%;align-items:center;flex-grow:1;gap:8px}.vc-addon-author{font-size:.8em}.vc-addon-author:before{content:"by "}.vc-switch-slider{transition:.1s transform ease-in-out}.client-theme-settings{display:flex;flex-direction:column}.client-theme-container{display:flex;flex-direction:row;justify-content:space-between}.client-theme-settings-labels{display:flex;flex-direction:column;justify-content:flex-start}.client-theme-container>[class^=colorSwatch]>[class^=swatch]{border:thin solid var(--background-modifier-accent)!important}.client-theme-warning *{color:var(--text-danger)}.client-theme-contrast-warning{background-color:var(--background-primary);padding:.5rem;border-radius:.5rem;display:flex;flex-direction:row;justify-content:space-between;align-items:center}.vc-dearrow-toggle-off svg{filter:grayscale(1)}.vc-dearrow-toggle-on,.vc-dearrow-toggle-off{all:unset;display:inline;cursor:pointer;position:absolute;top:.75rem;right:.75rem}.vc-decor-danger-btn{color:var(--white-500);background-color:var(--button-danger-background)}.vc-decor-change-decoration-modal-content{position:relative;display:flex;border-radius:5px 5px 0 0;padding:0 16px;gap:4px}.vc-decor-change-decoration-modal-preview{display:flex;flex-direction:column;margin-top:24px;gap:8px;max-width:280px}.vc-decor-change-decoration-modal-decoration{width:80px;height:80px}.vc-decor-change-decoration-modal-footer{justify-content:space-between}.vc-decor-change-decoration-modal-footer-btn-container{display:flex;flex-direction:row-reverse}.vc-decor-create-decoration-modal-content{display:flex;flex-direction:column;gap:20px;padding:0 16px}.vc-decor-create-decoration-modal-form-preview-container{display:flex;gap:16px}.vc-decor-modal-header,.vc-decor-modal-footer{padding:16px}.vc-decor-create-decoration-modal-form{display:flex;flex-direction:column;flex-grow:1;gap:16px}.vc-decor-sectioned-grid-list-container{display:flex;flex-direction:column;overflow:hidden scroll;max-height:512px;width:352px;gap:12px}.vc-decor-sectioned-grid-list-grid{display:flex;flex-wrap:wrap;gap:8px}.vc-decor-section-remove-margin{margin-bottom:0}.vc-chatbar-button{display:flex;align-items:center}.vc-membercount-widget{display:flex;align-content:center;--color-online: var(--green-360);--color-total: var(--primary-400)}.vc-membercount-tooltip{margin-top:.25em;margin-left:2px}.vc-membercount-member-list{justify-content:center;margin-top:1em;padding-inline:1em}.vc-membercount-online{color:var(--color-online)}.vc-membercount-total{color:var(--color-total)}.vc-membercount-online-dot{background-color:var(--color-online);display:inline-block;width:12px;height:12px;border-radius:50%;margin-right:.5em}.vc-membercount-total-dot{display:inline-block;width:6px;height:6px;border-radius:50%;border:3px solid var(--color-total);margin:0 .5em 0 1em}.messagelogger-deleted [class^=buttons]{display:none}.messagelogger-deleted :is(video,.emoji,[data-type="sticker"],iframe,.messagelogger-deleted-attachment,[class|="inlineMediaEmbed"]){filter:grayscale(1)!important;transition:.15s filter ease-in-out}.messagelogger-deleted :is(video,.emoji,[data-type="sticker"],iframe,.messagelogger-deleted-attachment,[class|="inlineMediaEmbed"]):hover,.messagelogger-deleted{filter:grayscale(0)!important}.theme-dark .messagelogger-edited{filter:brightness(80%)}.theme-light .messagelogger-edited{opacity:.5}.vc-permviewer-userperms-title-container{display:flex;justify-content:space-between;align-items:center;margin-top:10px;margin-bottom:6px}.vc-permviewer-userperms-btns-container{display:flex;align-items:center}.vc-permviewer-userperms-sortorder-btn{all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px}.vc-permviewer-userperms-permdetails-btn,.vc-permviewer-userperms-toggleperms-btn{all:unset;cursor:pointer;display:flex;align-items:center}.vc-permviewer-perms-title{flex-grow:1}.vc-permviewer-perms-no-perms{width:100%;height:100%;display:flex;align-items:center;justify-content:center;text-align:center}.vc-permviewer-perms-container{display:grid;grid-template-columns:1fr 2fr;grid-template-areas:"list permissions";padding:16px 0}.vc-permviewer-perms-list{grid-area:list;display:flex;flex-direction:column;gap:2px;border-right:2px solid var(--background-modifier-active)}.vc-permviewer-perms-list-item-btn{all:unset;cursor:pointer}.vc-permviewer-perms-list-item{display:flex;align-items:center;padding:8px 5px;cursor:pointer;width:230px;border-radius:5px}.vc-permviewer-perms-list-item:hover{background-color:var(--background-modifier-hover)}.vc-permviewer-perms-list-item-active{background-color:var(--background-modifier-selected)}.vc-permviewer-perms-list-item>div{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.vc-permviewer-perms-role-circle{border-radius:50%;width:12px;height:12px;margin-left:3px;margin-right:11px;flex-shrink:0}.vc-permviewer-perms-user-img{border-radius:50%;width:20px;height:20px;margin-right:6px}.vc-permviewer-perms-perms{grid-area:permissions;display:flex;flex-direction:column;margin-left:5px}.vc-permviewer-perms-perms-item{position:relative;display:flex;align-items:center;padding:10px;border-bottom:2px solid var(--background-modifier-active)}.vc-permviewer-perms-perms-item:last-child{border:0}.vc-permviewer-perms-perms-item-icon{border:1px solid var(--background-modifier-selected);width:24px;height:24px;margin-right:5px}.vc-permviewer-perms-perms-item .vc-info-icon{color:var(--interactive-muted);cursor:pointer;position:absolute;right:0;scale:.9;transition:color ease-in .1s}.vc-permviewer-perms-perms-item .vc-info-icon:hover{color:var(--interactive-active)}.vc-expandableheader-center-flex{display:flex;justify-items:center;align-items:center}.vc-expandableheader-btn{all:unset;cursor:pointer;width:24px;height:24px}.vc-pip-button{color:var(--interactive-normal)}.vc-pip-button:hover{background-color:var(--background-modifier-hover);color:var(--interactive-hover)}.vc-pindms-section-container{box-sizing:border-box;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;text-transform:uppercase;font-size:12px;line-height:16px;letter-spacing:.02em;font-family:var(--font-display);font-weight:600;flex:1 1 auto;color:var(--channels-default);cursor:pointer}.vc-pindms-modal-content{display:grid;justify-content:center;padding:1rem;gap:1.5rem}.vc-pindms-modal-content [class^=defaultContainer]{display:none}.vc-pindms-collapse-icon{width:16px;height:16px;color:var(--interactive-normal);transform:rotate(90deg)}.vc-pindms-collapsed .vc-pindms-collapse-icon{transform:rotate(0)}.vc-pronoundb-compact{display:none}[class*=compact] .vc-pronoundb-compact{display:inline-block;margin-left:-2px;margin-right:.25rem}[class|=section]:not([class|="lastSection"])+.vc-rdb-view{margin-top:12px}.vc-rdb-badge{vertical-align:middle;margin-left:4px}.vc-rdb-input{margin-top:6px;margin-bottom:12px;resize:none;overflow:hidden;background:transparent;border:1px solid var(--profile-message-input-border-color)}.vc-rdb-modal-footer>div{width:100%;margin:6px 16px}.vc-rdb-input>div>div{padding-left:0!important}.vc-rdb-placeholder{margin-bottom:4px;font-weight:700;font-style:italic;color:var(--text-muted)}.vc-rdb-input *{font-size:14px}.vc-rdb-modal-footer{padding:0}.vc-rdb-modal-footer .vc-rdb-input{margin-bottom:0;background:var(--input-background)}.vc-rdb-modal-footer [class|=pageControlContainer]{margin-top:0}.vc-rdb-modal-header{flex-grow:1}.vc-rdb-modal-reviews{margin-top:16px}.vc-rdb-review{padding-top:8px!important;padding-bottom:8px!important;padding-right:32px!important}.vc-rdb-review:hover{background:var(--background-message-hover)!important;border-radius:8px}.vc-rdb-review-comment img{vertical-align:text-top}.vc-rdb-review-comment{overflow-y:hidden;margin-top:1px;margin-bottom:8px;color:var(--text-normal);font-size:15px}.vc-rdb-blocked-badge{cursor:pointer}.vc-rdb-block-modal-header{display:flex;justify-content:space-between;align-items:center}.vc-rdb-block-modal{padding:1em;display:grid;gap:.75em}.vc-rdb-button-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}@media (max-width: 600px){.vc-rdb-button-grid{grid-template-columns:1fr}}.vc-rdb-block-modal-row{display:flex;height:2em;gap:.5em;align-items:center}.vc-rdb-block-modal-row img{border-radius:50%;height:2em;width:2em}.vc-rdb-block-modal img:before{content:"";display:block;width:100%;height:100%;background-color:var(--background-modifier-accent)}.vc-rdb-block-modal-username{flex-grow:1}.vc-rdb-block-modal-unblock{cursor:pointer}.vc-st-modal-content input{background-color:var(--input-background);color:var(--text-normal);width:95%;padding:8px 8px 8px 12px;margin:1em 0;outline:none;border:1px solid var(--input-background);border-radius:4px;font-weight:500;font-style:inherit;font-size:100%}.vc-st-format-label,.vc-st-format-label span{background-color:transparent}.vc-st-modal-content [class|=select]{margin-bottom:1em}.vc-st-modal-content [class|=select] span{background-color:var(--input-background)}.vc-st-modal-header{justify-content:space-between;align-content:center}.vc-st-modal-header h1{margin:0}.vc-st-modal-header button{padding:0}.vc-st-preview-text{margin-bottom:1em}.vc-st-button svg{transform:scale(1.1) translateY(1px)}.vc-gp-root{height:100%;user-select:text}.vc-gp-banner{cursor:pointer;aspect-ratio:auto 240 / 135;height:334px;width:100%;object-fit:cover;overflow:clip;overflow-clip-margin:content-box}.vc-gp-header{display:flex;flex-direction:row;align-items:center;gap:.5em;margin:.5em}.vc-gp-header img{width:48px;height:48px;cursor:pointer}.vc-gp-name-and-description{display:flex;flex-direction:column;gap:.2em}.vc-gp-name{margin:0}.vc-gp-tab-bar{border-bottom:2px solid var(--background-modifier-accent);margin:20px 12px 0;display:flex;gap:40px;align-items:stretch;flex-direction:row}.vc-gp-tab{border-bottom:2px solid transparent;color:var(--interactive-normal);cursor:pointer;height:39px;line-height:14px}.vc-gp-tab-content{margin:1em}.vc-gp-tab:where(.vc-gp-selected,:hover,:focus){border-bottom-color:var(--interactive-active)}.vc-gp-info{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1em}.vc-gp-server-info-pair{color:var(--text-normal)}.vc-gp-server-info-pair [class^=timestamp]{margin-left:0}.vc-gp-owner{display:flex;align-items:center;gap:.2em}.vc-gp-owner img{height:20px;border-radius:50%;cursor:pointer}.vc-gp-scroller{width:100%;max-height:500px}.vc-gp-scroller [class^=listRow]{margin:1px 0}.vc-gp-scroller [class^=listRow]:hover{background-color:var(--background-modifier-hover)}.shiki-container{border:4px;background-color:var(--background-secondary)}.shiki-root{border-radius:4px}.shiki-root code{display:block;overflow-x:auto;padding:.5em;position:relative;font-size:.875rem;line-height:1.125rem;text-indent:0;white-space:pre-wrap;background:transparent;border:none}.shiki-devicon{margin-right:8px;user-select:none}.shiki-plain code{padding-top:8px}.shiki-btns{font-size:1em;position:absolute;right:0;bottom:0;opacity:0}.shiki-root:hover .shiki-btns{opacity:1}.shiki-btn{border-radius:4px 4px 0 0;padding:4px 8px;user-select:none}.shiki-btn~.shiki-btn{margin-left:4px}.shiki-btn:last-child{border-radius:4px 0}.shiki-spinner-container{align-items:center;background-color:#0009;display:flex;position:absolute;justify-content:center;inset:0}.shiki-preview{margin-bottom:2em}.shiki-lang{padding:0 5px;margin-bottom:6px;font-weight:700;text-transform:capitalize;display:flex;align-items:center}.shiki-table{border-collapse:collapse;width:100%}.shiki-table tr{height:19px;width:100%}.shiki-root td:first-child{border-right:1px solid transparent;padding-left:5px;padding-right:8px;user-select:none}.shiki-root td:last-child{padding-left:8px;word-break:break-word;width:100%}.vc-user-connection{all:unset;display:inline-block;cursor:pointer}.vc-sc-tooltip{display:inline-flex;gap:.25em;align-items:center}.shc-lock-screen-outer-container{overflow:hidden scroll;flex:1 1 auto;height:100%;width:100%}.shc-lock-screen-container{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:100%}.shc-lock-screen-container>*{margin:5px}.shc-lock-screen-logo{width:180px;height:180px}.shc-lock-screen-heading-container{display:flex;flex-direction:row;align-items:center}.shc-lock-screen-heading-container>*{margin:inherit}.shc-lock-screen-heading-nsfw-icon{color:var(--text-normal)}.shc-lock-screen-topic-container{color:var(--text-normal);background:var(--bg-overlay-3, var(--background-secondary));border-radius:5px;padding:10px;max-width:70vw}.shc-lock-screen-tags-container{background:var(--bg-overlay-3, var(--background-secondary));border-radius:5px;padding:10px;max-width:70vw}.shc-lock-screen-tags-container>*{margin:inherit}.shc-lock-screen-tags{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px}.shc-evenodd-fill-current-color{fill-rule:evenodd;fill:currentcolor}.shc-hidden-channel-icon{margin-left:6px;z-index:0;cursor:not-allowed}.shc-lock-screen-default-emoji-container{display:flex;flex-direction:row;align-items:center}.shc-lock-screen-default-emoji-container>[class^=emojiContainer]{background:var(--bg-overlay-3, var(--background-secondary));border-radius:8px;padding:5px 6px;margin-left:5px}.shc-lock-screen-allowed-users-and-roles-container{display:flex;flex-direction:column;align-items:center;background:var(--bg-overlay-3, var(--background-secondary));border-radius:5px;padding:10px;max-width:70vw}.shc-lock-screen-allowed-users-and-roles-container-title{display:flex;flex-direction:row;align-items:center}.shc-lock-screen-allowed-users-and-roles-container-toggle-btn{all:unset;margin-left:5px;cursor:pointer;display:flex;align-items:center}.shc-lock-screen-allowed-users-and-roles-container-toggle-btn>svg{color:var(--text-normal)}.shc-lock-screen-allowed-users-and-roles-container-permdetails-btn{all:unset;margin-right:5px;cursor:pointer;display:flex;align-items:center}.shc-lock-screen-allowed-users-and-roles-container-permdetails-btn>svg{color:var(--text-normal)}.shc-lock-screen-allowed-users-and-roles-container>[class^=members]{margin-left:10px;flex-wrap:wrap;justify-content:center}.vc-smyn-suffix{color:var(--text-muted)}.vc-smyn-suffix:before{content:"("}.vc-smyn-suffix:after{content:")"}#vc-spotify-player{padding:.375rem .5rem;border-bottom:1px solid var(--background-modifier-accent);--vc-spotify-green: #1db954}.theme-light #vc-spotify-player{background:var(--bg-overlay-3, var(--background-secondary-alt))}.theme-dark #vc-spotify-player{background:var(--bg-overlay-1, var(--background-secondary-alt))}.vc-spotify-button{background:none;color:var(--interactive-normal);padding:0;width:32px;height:32px;border-radius:100%;display:flex;justify-content:center;align-items:center}.vc-spotify-button:hover{color:var(--interactive-hover);background-color:var(--background-modifier-selected)}.vc-spotify-button svg{height:24px;width:24px}[class*=vc-spotify-shuffle]>svg,[class*=vc-spotify-repeat]>svg{width:22px;height:22px}.vc-spotify-button svg path{width:100%;height:100%}.vc-spotify-shuffle-on,.vc-spotify-repeat-context,.vc-spotify-repeat-track,.vc-spotify-shuffle-on:hover,.vc-spotify-repeat-context:hover,.vc-spotify-repeat-track:hover{color:var(--vc-spotify-green)}.vc-spotify-tooltip-text{overflow:hidden;white-space:nowrap;padding-right:.2em;max-width:100%;margin:unset}.vc-spotify-repeat-1{font-size:70%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.vc-spotify-button-row{justify-content:center}#vc-spotify-info-wrapper{display:flex;flex-direction:row;align-items:center;height:3em;gap:.5em}#vc-spotify-info-wrapper img{height:90%;object-fit:contain}#vc-spotify-album-expanded-wrapper img{width:100%;object-fit:contain}#vc-spotify-titles{display:flex;flex-direction:column;padding:.2rem;justify-content:center;align-items:flex-start;align-content:flex-start;overflow:hidden}#vc-spotify-song-title{color:var(--header-primary);font-size:14px;font-weight:600}.vc-spotify-ellipoverflow{white-space:nowrap;overflow:hidden;width:100%;text-overflow:ellipsis}.vc-spotify-artist,.vc-spotify-album{font-size:12px;text-decoration:none;color:var(--header-secondary)}.vc-spotify-comma{color:var(--header-secondary)}.vc-spotify-artist[role=link]:hover,#vc-spotify-album-title[role=link]:hover,#vc-spotify-song-title[role=link]:hover{text-decoration:underline;cursor:pointer}#vc-spotify-album-image{border-radius:3px;transition:filter .2s}#vc-spotify-album-image:hover{filter:brightness(1.2);cursor:pointer}#vc-spotify-progress-bar{position:relative;color:var(--text-normal);width:100%;margin:.5em 0 5px}#vc-spotify-progress-bar>[class^=slider]{flex-grow:1;width:100%;padding:0!important}#vc-spotify-progress-bar>[class^=slider] [class^=bar-]{height:4px!important}#vc-spotify-progress-bar>[class^=slider] [class^=grabber]{height:10px!important;width:10px!important;margin-top:4px;background-color:var(--interactive-normal);border-color:var(--interactive-normal);color:var(--interactive-normal);opacity:0;transition:opacity .1s}#vc-spotify-progress-bar:hover>[class^=slider] [class^=grabber]{opacity:1}#vc-spotify-progress-text{margin:0}.vc-spotify-progress-time{font-size:12px;top:10px;position:absolute}.vc-spotify-time-left{left:0}.vc-spotify-time-right{right:0}.vc-spotify-fallback{padding:.5em;color:var(--text-normal)}.vc-trans-modal-content{padding:1em}.vc-trans-modal-header{justify-content:space-between;align-content:center}.vc-trans-modal-header h1{margin:0}.vc-trans-accessory{color:var(--text-muted);margin-top:.5em;font-style:italic;font-weight:400}.vc-trans-accessory svg{margin-right:.25em}.vc-trans-dismiss{all:unset;cursor:pointer;color:var(--text-link)}.vc-trans-dismiss:is(:hover,:focus){text-decoration:underline}.vc-trans-auto-translate{color:var(--green-360)}.vc-trans-chat-button{scale:1.085}.vc-uvs-button>div{white-space:normal!important}.vc-uvs-button{width:100%;margin:auto;height:unset}.vc-uvs-header{color:var(--header-primary);margin-bottom:6px}.vc-uvs-modal-margin{margin:0 12px}.vc-uvs-modal-margin div{margin-bottom:0!important}.vc-uvs-popout-margin-self>[class^=section]{padding-top:0;padding-bottom:12px}.vc-toolbox-btn,.vc-toolbox-btn>svg{-webkit-app-region:no-drag}.vc-toolbox-btn>svg{color:var(--interactive-normal)}.vc-toolbox-btn[class*=selected]>svg{color:var(--interactive-active)}.vc-toolbox-btn:hover>svg{color:var(--interactive-hover)}.vc-vmsg-modal{padding:1em}.vc-vmsg-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.5em;margin-bottom:1em}.vc-vmsg-modal audio{width:100%}.vc-vmsg-preview{color:var(--text-normal);border-radius:24px;background-color:var(--background-secondary);position:relative;display:flex;align-items:center;padding:0 16px;height:48px}.vc-vmsg-preview-indicator{background:var(--button-secondary-background);width:16px;height:16px;border-radius:50%;transition:background .2s ease-in-out}.vc-vmsg-preview-recording .vc-vmsg-preview-indicator{background:var(--status-danger)}.vc-vmsg-preview-time{opacity:.8;margin:0 .5em;font-size:80%;font-family:var(--font-code)}.vc-vmsg-preview-label{opacity:.5;letter-spacing:.125em;font-weight:600;flex:1;text-align:center} diff --git a/vesktop/vencordDist/vencordDesktopRenderer.css.map b/vesktop/vencordDist/vencordDesktopRenderer.css.map deleted file mode 100644 index 706ccfc..0000000 --- a/vesktop/vencordDist/vencordDesktopRenderer.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../src/components/ErrorCard.css", "../src/api/Notifications/styles.css", "../src/components/VencordSettings/settingsStyles.css", "../src/components/VencordSettings/themesStyles.css", "../src/components/PluginSettings/styles.css", "../src/components/iconStyles.css", "../src/components/PluginSettings/contributorModal.css", "../src/components/VencordSettings/addonCard.css", "../src/components/Switch.css", "../src/plugins/clientTheme/clientTheme.css", "../src/plugins/dearrow/styles.css", "../src/plugins/decor/ui/styles.css", "../src/api/ChatButton.css", "../src/plugins/memberCount/style.css", "../src/plugins/messageLogger/messageLogger.css", "../src/plugins/permissionsViewer/styles.css", "../src/components/ExpandableHeader.css", "../src/plugins/pictureInPicture/styles.css", "../src/plugins/pinDms/styles.css", "../src/plugins/pronoundb/styles.css", "../src/plugins/reviewDB/style.css", "../src/plugins/sendTimestamps/styles.css", "../src/plugins/serverProfile/styles.css", "../src/plugins/shikiCodeblocks.desktop/shiki.css", "../src/plugins/showConnections/styles.css", "../src/plugins/showHiddenChannels/style.css", "../src/plugins/showMeYourName/styles.css", "../src/plugins/spotifyControls/spotifyStyles.css", "../src/plugins/translate/styles.css", "../src/plugins/userVoiceShow/components/VoiceChannelSection.css", "../src/plugins/vencordToolbox/index.css", "../src/plugins/voiceMessages/styles.css"], - "sourcesContent": [".vc-error-card {\n padding: 2em;\n background-color: #e7828430;\n border: 1px solid #e78284;\n border-radius: 5px;\n color: var(--text-normal, white);\n}\n", ".vc-notification-root {\n /* clear default button styles */\n all: unset;\n display: flex;\n flex-direction: column;\n color: var(--text-normal);\n background-color: var(--background-secondary-alt);\n border-radius: 6px;\n overflow: hidden;\n cursor: pointer;\n width: 100%;\n}\n\n.vc-notification-root:not(.vc-notification-log-wrapper > .vc-notification-root) {\n position: absolute;\n z-index: 2147483647;\n right: 1rem;\n width: 25vw;\n min-height: 10vh;\n}\n\n.vc-notification {\n display: flex;\n flex-direction: row;\n padding: 1.25rem;\n gap: 1.25rem;\n}\n\n.vc-notification-content {\n width: 100%;\n}\n\n.vc-notification-header {\n display: flex;\n justify-content: space-between;\n}\n\n.vc-notification-title {\n color: var(--header-primary);\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.25rem;\n text-transform: uppercase;\n}\n\n.vc-notification-close-btn {\n all: unset;\n cursor: pointer;\n color: var(--interactive-normal);\n opacity: 0.5;\n transition: opacity 0.2s ease-in-out, color 0.2s ease-in-out;\n}\n\n.vc-notification-close-btn:hover {\n color: var(--interactive-hover);\n opacity: 1;\n}\n\n.vc-notification-icon {\n height: 4rem;\n width: 4rem;\n border-radius: 6px;\n}\n\n.vc-notification-progressbar {\n height: 0.25rem;\n border-radius: 5px;\n margin-top: auto;\n}\n\n.vc-notification-p {\n margin: 0.5rem 0 0;\n line-height: 140%;\n}\n\n.vc-notification-img {\n width: 100%;\n}\n\n.vc-notification-log-empty {\n height: 218px;\n background: url(\"/assets/b36de980b174d7b798c89f35c116e5c6.svg\") center no-repeat;\n margin-bottom: 40px;\n}\n\n.vc-notification-log-container {\n display: flex;\n flex-direction: column;\n padding: 1em;\n overflow: hidden;\n}\n\n.vc-notification-log-wrapper {\n transition: 200ms ease;\n transition-property: height, opacity;\n}\n\n.vc-notification-log-wrapper:not(:last-child) {\n margin-bottom: 1em;\n}\n\n.vc-notification-log-removing {\n height: 0 !important;\n opacity: 0;\n margin-bottom: 1em;\n}\n\n.vc-notification-log-body {\n display: flex;\n flex-direction: column;\n}\n\n.vc-notification-log-timestamp {\n margin-left: auto;\n font-size: 0.8em;\n font-weight: lighter;\n}\n\n.vc-notification-log-danger-btn {\n color: var(--white-500);\n background-color: var(--button-danger-background);\n}\n", ".vc-settings-tab-bar {\n margin-top: 20px;\n margin-bottom: 10px;\n border-bottom: 2px solid var(--background-modifier-accent);\n}\n\n.vc-settings-tab-bar-item {\n margin-right: 32px;\n padding-bottom: 16px;\n margin-bottom: -2px;\n}\n\n.vc-settings-quick-actions-card {\n padding: 1em;\n display: flex;\n gap: 1em;\n align-items: center;\n justify-content: space-evenly;\n flex-grow: 1;\n flex-flow: row wrap;\n margin-bottom: 1em;\n}\n\n.vc-settings-donate {\n display: flex;\n flex-direction: row;\n}\n\n.vc-settings-card {\n padding: 1em;\n margin-bottom: 1em;\n}\n\n.vc-backup-restore-card {\n background-color: var(--info-warning-background);\n border-color: var(--info-warning-foreground);\n color: var(--info-warning-text);\n}\n\n.vc-settings-theme-links {\n /* Needed to fix bad themes that hide certain textarea elements for whatever eldritch reason */\n display: inline-block !important;\n color: var(--text-normal) !important;\n padding: 0.5em;\n border: 1px solid var(--background-modifier-accent);\n max-height: unset;\n}\n\n.vc-cloud-settings-sync-grid {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-gap: 1em;\n}\n\n.vc-cloud-erase-data-danger-btn {\n color: var(--white-500);\n background-color: var(--button-danger-background);\n}\n\n.vc-text-selectable,\n.vc-text-selectable :where([class*=\"text\" i], [class*=\"title\" i]) {\n /* make text selectable, silly discord makes the entirety of settings not selectable */\n user-select: text;\n\n /* discord also sets cursor: default which prevents the cursor from showing as text */\n cursor: initial;\n}\n", ".vc-settings-theme-grid {\n display: grid;\n grid-gap: 16px;\n grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));\n}\n\n.vc-settings-theme-card {\n display: flex;\n flex-direction: column;\n background-color: var(--background-secondary-alt);\n color: var(--interactive-active);\n border-radius: 8px;\n padding: 1em;\n width: 100%;\n transition: 0.1s ease-out;\n transition-property: box-shadow, transform, background, opacity;\n}\n\n.vc-settings-theme-card-text {\n text-overflow: ellipsis;\n height: 1.2em;\n margin-bottom: 2px;\n white-space: nowrap;\n overflow: hidden;\n}\n\n.vc-settings-theme-author::before {\n content: \"by \";\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n.vc-plugins-grid {\n margin-top: 16px;\n display: grid;\n grid-gap: 16px;\n grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));\n}\n\n.vc-plugins-info-button {\n height: 24px;\n width: 24px;\n padding: 0;\n background: transparent;\n margin-right: 8px;\n}\n\n.vc-plugins-settings-button:hover {\n color: var(--interactive-hover);\n}\n\n.vc-plugins-filter-controls {\n display: grid;\n height: 40px;\n gap: 10px;\n grid-template-columns: 1fr 150px;\n}\n\n.vc-plugins-badge {\n padding: 0 6px;\n font-family: var(--font-display);\n font-weight: 500;\n border-radius: 8px;\n height: 16px;\n font-size: 12px;\n line-height: 16px;\n color: var(--white-500);\n text-align: center;\n}\n\n.vc-plugins-dep-name {\n margin: 0 auto;\n}\n\n.vc-plugins-info-card {\n padding: 1em;\n height: 8em;\n display: flex;\n flex-direction: column;\n}\n\n.vc-plugins-info-card div {\n line-height: 32px;\n}\n\n.vc-plugins-restart-card {\n padding: 1em;\n background: var(--info-warning-background);\n border: 1px solid var(--info-warning-foreground);\n color: var(--info-warning-text);\n}\n\n.vc-plugins-restart-card button {\n margin-top: 0.5em;\n}\n\n.vc-plugins-info-button svg:not(:hover, :focus) {\n color: var(--text-muted);\n}\n", ".vc-open-external-icon {\n transform: rotate(45deg);\n}\n\n.vc-owner-crown-icon {\n color: var(--text-warning);\n}\n", ".vc-author-modal-root {\n padding: 1em;\n}\n\n.vc-author-modal-header {\n display: flex;\n align-items: center;\n margin-bottom: 1em;\n}\n\n.vc-author-modal-name {\n text-transform: none;\n flex-grow: 0;\n background: var(--background-tertiary);\n border-radius: 0 9999px 9999px 0;\n padding: 6px 0.8em 6px 0.5em;\n font-size: 20px;\n height: 20px;\n position: relative;\n text-wrap: nowrap;\n}\n\n.vc-author-modal-name::before {\n content: \"\";\n display: block;\n position: absolute;\n height: 100%;\n width: 16px;\n background: var(--background-tertiary);\n z-index: -1;\n left: -16px;\n top: 0;\n}\n\n.vc-author-modal-avatar {\n height: 32px;\n width: 32px;\n border-radius: 50%;\n}\n\n.vc-author-modal-links {\n margin-left: auto;\n display: flex;\n gap: 0.2em;\n}\n\n.vc-author-modal-links img {\n height: 32px;\n width: 32px;\n border-radius: 50%;\n border: 4px solid var(--background-tertiary);\n box-sizing: border-box\n}\n\n.vc-author-modal-plugins {\n display: grid;\n gap: 0.5em;\n}\n", ".vc-addon-card {\n background-color: var(--background-secondary-alt);\n color: var(--interactive-active);\n border-radius: 8px;\n display: block;\n height: 100%;\n padding: 12px;\n width: 100%;\n transition: 0.1s ease-out;\n transition-property: box-shadow, transform, background, opacity;\n box-sizing: border-box;\n}\n\n.vc-addon-card-disabled {\n opacity: 0.6;\n}\n\n.vc-addon-card:hover {\n background-color: var(--background-tertiary);\n transform: translateY(-1px);\n box-shadow: var(--elevation-high);\n}\n\n.vc-addon-header {\n margin-top: auto;\n display: flex;\n width: 100%;\n justify-content: flex-end;\n align-items: center;\n gap: 8px;\n margin-bottom: 0.5em;\n}\n\n.vc-addon-note {\n height: 36px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n -webkit-box-orient: vertical;\n /* stylelint-disable-next-line property-no-unknown */\n box-orient: vertical;\n}\n\n.vc-addon-name-author {\n width: 100%;\n}\n\n.vc-addon-name {\n display: flex;\n width: 100%;\n align-items: center;\n flex-grow: 1;\n gap: 8px;\n}\n\n.vc-addon-author {\n font-size: 0.8em;\n}\n\n.vc-addon-author::before {\n content: \"by \";\n}\n", ".vc-switch-slider {\n transition: 100ms transform ease-in-out;\n}\n", ".client-theme-settings {\n display: flex;\n flex-direction: column;\n}\n\n.client-theme-container {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n}\n\n.client-theme-settings-labels {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n}\n\n.client-theme-container > [class^=\"colorSwatch\"] > [class^=\"swatch\"] {\n border: thin solid var(--background-modifier-accent) !important;\n}\n\n.client-theme-warning * {\n color: var(--text-danger);\n}\n\n.client-theme-contrast-warning {\n background-color: var(--background-primary);\n padding: 0.5rem;\n border-radius: .5rem;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n}\n", ".vc-dearrow-toggle-off svg {\n filter: grayscale(1);\n}\n\n.vc-dearrow-toggle-on, .vc-dearrow-toggle-off {\n all: unset;\n display: inline;\n cursor: pointer;\n position: absolute;\n top: 0.75rem;\n right: 0.75rem;\n}\n", ".vc-decor-danger-btn {\n color: var(--white-500);\n background-color: var(--button-danger-background);\n}\n\n.vc-decor-change-decoration-modal-content {\n position: relative;\n display: flex;\n border-radius: 5px 5px 0 0;\n padding: 0 16px;\n gap: 4px;\n}\n\n.vc-decor-change-decoration-modal-preview {\n display: flex;\n flex-direction: column;\n margin-top: 24px;\n gap: 8px;\n max-width: 280px;\n}\n\n.vc-decor-change-decoration-modal-decoration {\n width: 80px;\n height: 80px;\n}\n\n.vc-decor-change-decoration-modal-footer {\n justify-content: space-between;\n}\n\n.vc-decor-change-decoration-modal-footer-btn-container {\n display: flex;\n flex-direction: row-reverse;\n}\n\n.vc-decor-create-decoration-modal-content {\n display: flex;\n flex-direction: column;\n gap: 20px;\n padding: 0 16px;\n}\n\n.vc-decor-create-decoration-modal-form-preview-container {\n display: flex;\n gap: 16px;\n}\n\n.vc-decor-modal-header {\n padding: 16px;\n}\n\n.vc-decor-modal-footer {\n padding: 16px;\n}\n\n.vc-decor-create-decoration-modal-form {\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n gap: 16px;\n}\n\n.vc-decor-sectioned-grid-list-container {\n display: flex;\n flex-direction: column;\n overflow: hidden scroll;\n max-height: 512px;\n width: 352px; /* ((80 + 8 (grid gap)) * desired columns) (scrolled takes the extra 8 padding off conveniently) */\n gap: 12px;\n}\n\n.vc-decor-sectioned-grid-list-grid {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n\n.vc-decor-section-remove-margin {\n margin-bottom: 0;\n}\n", ".vc-chatbar-button {\n display: flex;\n align-items: center;\n}\n", ".vc-membercount-widget {\n display: flex;\n align-content: center;\n\n --color-online: var(--green-360);\n --color-total: var(--primary-400);\n}\n\n.vc-membercount-tooltip {\n margin-top: 0.25em;\n margin-left: 2px;\n}\n\n.vc-membercount-member-list {\n justify-content: center;\n margin-top: 1em;\n padding-inline: 1em;\n}\n\n.vc-membercount-online {\n color: var(--color-online);\n}\n\n.vc-membercount-total {\n color: var(--color-total);\n}\n\n.vc-membercount-online-dot {\n background-color: var(--color-online);\n display: inline-block;\n width: 12px;\n height: 12px;\n border-radius: 50%;\n margin-right: 0.5em;\n}\n\n.vc-membercount-total-dot {\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n border: 3px solid var(--color-total);\n margin: 0 0.5em 0 1em;\n}\n", ".messagelogger-deleted [class^=\"buttons\"] {\n display: none;\n}\n\n.messagelogger-deleted\n:is(\n video,\n .emoji,\n [data-type=\"sticker\"],\n iframe,\n .messagelogger-deleted-attachment,\n [class|=\"inlineMediaEmbed\"]\n) {\n filter: grayscale(1) !important;\n transition: 150ms filter ease-in-out;\n}\n\n.messagelogger-deleted\n:is(\n video,\n .emoji,\n [data-type=\"sticker\"],\n iframe,\n .messagelogger-deleted-attachment,\n [class|=\"inlineMediaEmbed\"]\n):hover,\n.messagelogger-deleted {\n filter: grayscale(0) !important;\n}\n\n.theme-dark .messagelogger-edited {\n filter: brightness(80%);\n}\n\n.theme-light .messagelogger-edited {\n opacity: 0.5;\n}\n", "/* User Permissions Component */\n\n.vc-permviewer-userperms-title-container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-top: 10px;\n margin-bottom: 6px;\n}\n\n.vc-permviewer-userperms-btns-container {\n display: flex;\n align-items: center;\n}\n\n.vc-permviewer-userperms-sortorder-btn {\n all: unset;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n}\n\n.vc-permviewer-userperms-permdetails-btn {\n all: unset;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n\n.vc-permviewer-userperms-toggleperms-btn {\n all: unset;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n\n/* RolesAndUsersPermissions Component */\n\n.vc-permviewer-perms-title {\n flex-grow: 1;\n}\n\n.vc-permviewer-perms-no-perms {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n}\n\n.vc-permviewer-perms-container {\n display: grid;\n grid-template-columns: 1fr 2fr;\n grid-template-areas: \"list permissions\";\n padding: 16px 0;\n}\n\n.vc-permviewer-perms-list {\n grid-area: list;\n display: flex;\n flex-direction: column;\n gap: 2px;\n border-right: 2px solid var(--background-modifier-active);\n}\n\n.vc-permviewer-perms-list-item-btn {\n all: unset;\n cursor: pointer;\n}\n\n.vc-permviewer-perms-list-item {\n display: flex;\n align-items: center;\n padding: 8px 5px;\n cursor: pointer;\n width: 230px;\n border-radius: 5px;\n}\n\n.vc-permviewer-perms-list-item:hover {\n background-color: var(--background-modifier-hover);\n}\n\n.vc-permviewer-perms-list-item-active {\n background-color: var(--background-modifier-selected);\n}\n\n.vc-permviewer-perms-list-item > div {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n\n.vc-permviewer-perms-role-circle {\n border-radius: 50%;\n width: 12px;\n height: 12px;\n margin-left: 3px;\n margin-right: 11px;\n flex-shrink: 0;\n}\n\n.vc-permviewer-perms-user-img {\n border-radius: 50%;\n width: 20px;\n height: 20px;\n margin-right: 6px;\n}\n\n.vc-permviewer-perms-perms {\n grid-area: permissions;\n display: flex;\n flex-direction: column;\n margin-left: 5px;\n}\n\n.vc-permviewer-perms-perms-item {\n position: relative;\n display: flex;\n align-items: center;\n padding: 10px;\n border-bottom: 2px solid var(--background-modifier-active);\n}\n\n.vc-permviewer-perms-perms-item:last-child {\n border: 0;\n}\n\n.vc-permviewer-perms-perms-item-icon {\n border: 1px solid var(--background-modifier-selected);\n width: 24px;\n height: 24px;\n margin-right: 5px;\n}\n\n.vc-permviewer-perms-perms-item .vc-info-icon {\n color: var(--interactive-muted);\n cursor: pointer;\n position: absolute;\n right: 0;\n scale: 0.9;\n transition: color ease-in 0.1s;\n}\n\n.vc-permviewer-perms-perms-item .vc-info-icon:hover {\n color: var(--interactive-active);\n}\n", ".vc-expandableheader-center-flex {\n display: flex;\n justify-items: center;\n align-items: center;\n}\n\n.vc-expandableheader-btn {\n all: unset;\n cursor: pointer;\n width: 24px;\n height: 24px;\n}\n", ".vc-pip-button {\n color: var(--interactive-normal);\n}\n\n.vc-pip-button:hover {\n background-color: var(--background-modifier-hover);\n color: var(--interactive-hover);\n}\n", ".vc-pindms-section-container {\n box-sizing: border-box;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n text-transform: uppercase;\n font-size: 12px;\n line-height: 16px;\n letter-spacing: .02em;\n font-family: var(--font-display);\n font-weight: 600;\n flex: 1 1 auto;\n color: var(--channels-default);\n cursor: pointer;\n}\n\n.vc-pindms-modal-content {\n display: grid;\n justify-content: center;\n padding: 1rem;\n gap: 1.5rem;\n}\n\n.vc-pindms-modal-content [class^=\"defaultContainer\"] {\n display: none;\n}\n\n.vc-pindms-collapse-icon {\n width: 16px;\n height: 16px;\n color: var(--interactive-normal);\n transform: rotate(90deg)\n}\n\n.vc-pindms-collapsed .vc-pindms-collapse-icon {\n transform: rotate(0deg);\n}\n", ".vc-pronoundb-compact {\n display: none;\n}\n\n[class*=\"compact\"] .vc-pronoundb-compact {\n display: inline-block;\n margin-left: -2px;\n margin-right: 0.25rem;\n}\n", "[class|=\"section\"]:not([class|=\"lastSection\"]) + .vc-rdb-view {\n margin-top: 12px;\n}\n\n.vc-rdb-badge {\n vertical-align: middle;\n margin-left: 4px;\n}\n\n.vc-rdb-input {\n margin-top: 6px;\n margin-bottom: 12px;\n resize: none;\n overflow: hidden;\n background: transparent;\n border: 1px solid var(--profile-message-input-border-color);\n}\n\n.vc-rdb-modal-footer > div {\n width: 100%;\n margin: 6px 16px;\n}\n\n/* When input becomes disabled(while sending review), input adds unneccesary padding to left, this prevents it */\n.vc-rdb-input > div > div {\n padding-left: 0 !important;\n}\n\n.vc-rdb-placeholder {\n margin-bottom: 4px;\n font-weight: bold;\n font-style: italic;\n color: var(--text-muted);\n}\n\n.vc-rdb-input * {\n font-size: 14px;\n}\n\n.vc-rdb-modal-footer {\n padding: 0;\n}\n\n.vc-rdb-modal-footer .vc-rdb-input {\n margin-bottom: 0;\n background: var(--input-background);\n}\n\n.vc-rdb-modal-footer [class|=\"pageControlContainer\"] {\n margin-top: 0;\n}\n\n.vc-rdb-modal-header {\n flex-grow: 1;\n}\n\n.vc-rdb-modal-reviews {\n margin-top: 16px;\n}\n\n.vc-rdb-review {\n padding-top: 8px !important;\n padding-bottom: 8px !important;\n padding-right: 32px !important;\n}\n\n.vc-rdb-review:hover {\n background: var(--background-message-hover) !important;\n border-radius: 8px;\n}\n\n.vc-rdb-review-comment img {\n vertical-align: text-top;\n}\n\n.vc-rdb-review-comment {\n overflow-y: hidden;\n margin-top: 1px;\n margin-bottom: 8px;\n color: var(--text-normal);\n font-size: 15px;\n}\n\n.vc-rdb-blocked-badge {\n cursor: pointer;\n}\n\n.vc-rdb-block-modal-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.vc-rdb-block-modal {\n padding: 1em;\n display: grid;\n gap: 0.75em;\n}\n\n.vc-rdb-button-grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 10px;\n}\n\n/* stylelint-disable-next-line media-feature-range-notation */\n@media (max-width: 600px) {\n .vc-rdb-button-grid {\n grid-template-columns: 1fr;\n }\n}\n\n.vc-rdb-block-modal-row {\n display: flex;\n height: 2em;\n gap: 0.5em;\n align-items: center;\n}\n\n.vc-rdb-block-modal-row img {\n border-radius: 50%;\n height: 2em;\n width: 2em;\n}\n\n.vc-rdb-block-modal img::before {\n content: \"\";\n display: block;\n width: 100%;\n height: 100%;\n background-color: var(--background-modifier-accent);\n}\n\n.vc-rdb-block-modal-username {\n flex-grow: 1;\n}\n\n.vc-rdb-block-modal-unblock {\n cursor: pointer;\n}\n", ".vc-st-modal-content input {\n background-color: var(--input-background);\n color: var(--text-normal);\n width: 95%;\n padding: 8px 8px 8px 12px;\n margin: 1em 0;\n outline: none;\n border: 1px solid var(--input-background);\n border-radius: 4px;\n font-weight: 500;\n font-style: inherit;\n font-size: 100%;\n}\n\n.vc-st-format-label,\n.vc-st-format-label span {\n background-color: transparent;\n}\n\n.vc-st-modal-content [class|=\"select\"] {\n margin-bottom: 1em;\n}\n\n.vc-st-modal-content [class|=\"select\"] span {\n background-color: var(--input-background);\n}\n\n.vc-st-modal-header {\n justify-content: space-between;\n align-content: center;\n}\n\n.vc-st-modal-header h1 {\n margin: 0;\n}\n\n.vc-st-modal-header button {\n padding: 0;\n}\n\n.vc-st-preview-text {\n margin-bottom: 1em;\n}\n\n.vc-st-button svg {\n transform: scale(1.1) translateY(1px);\n}\n", ".vc-gp-root {\n height: 100%;\n user-select: text;\n}\n\n.vc-gp-banner {\n cursor: pointer;\n aspect-ratio: auto 240 / 135;\n height: 334px;\n width: 100%;\n object-fit: cover;\n overflow: clip;\n overflow-clip-margin: content-box;\n}\n\n.vc-gp-header {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 0.5em;\n margin: 0.5em;\n}\n\n.vc-gp-header img {\n width: 48px;\n height: 48px;\n cursor: pointer;\n}\n\n.vc-gp-name-and-description {\n display: flex;\n flex-direction: column;\n gap: 0.2em;\n}\n\n.vc-gp-name {\n margin: 0;\n}\n\n.vc-gp-tab-bar {\n border-bottom: 2px solid var(--background-modifier-accent);\n margin: 20px 12px 0;\n display: flex;\n gap: 40px;\n align-items: stretch;\n flex-direction: row;\n}\n\n.vc-gp-tab {\n border-bottom: 2px solid transparent;\n color: var(--interactive-normal);\n cursor: pointer;\n height: 39px;\n line-height: 14px;\n}\n\n.vc-gp-tab-content {\n margin: 1em;\n}\n\n.vc-gp-tab:where(.vc-gp-selected, :hover, :focus) {\n border-bottom-color: var(--interactive-active);\n}\n\n.vc-gp-info {\n display: grid;\n grid-template-columns: repeat(3, minmax(0, 1fr));\n gap: 1em;\n}\n\n.vc-gp-server-info-pair {\n color: var(--text-normal);\n}\n\n.vc-gp-server-info-pair [class^=\"timestamp\"] {\n margin-left: 0;\n}\n\n.vc-gp-owner {\n display: flex;\n align-items: center;\n gap: 0.2em;\n}\n\n.vc-gp-owner img {\n height: 20px;\n border-radius: 50%;\n cursor: pointer;\n}\n\n.vc-gp-scroller {\n width: 100%;\n max-height: 500px;\n}\n\n.vc-gp-scroller [class^=\"listRow\"] {\n margin: 1px 0;\n}\n\n.vc-gp-scroller [class^=\"listRow\"]:hover {\n background-color: var(--background-modifier-hover);\n}\n", ".shiki-container {\n border: 4px;\n background-color: var(--background-secondary);\n}\n\n.shiki-root {\n border-radius: 4px;\n}\n\n.shiki-root code {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n position: relative;\n font-size: 0.875rem;\n line-height: 1.125rem;\n text-indent: 0;\n white-space: pre-wrap;\n background: transparent;\n border: none;\n}\n\n.shiki-devicon {\n margin-right: 8px;\n user-select: none;\n}\n\n.shiki-plain code {\n padding-top: 8px;\n}\n\n.shiki-btns {\n font-size: 1em;\n position: absolute;\n right: 0;\n bottom: 0;\n opacity: 0;\n}\n\n.shiki-root:hover .shiki-btns {\n opacity: 1;\n}\n\n.shiki-btn {\n border-radius: 4px 4px 0 0;\n padding: 4px 8px;\n user-select: none;\n}\n\n.shiki-btn ~ .shiki-btn {\n margin-left: 4px;\n}\n\n.shiki-btn:last-child {\n border-radius: 4px 0;\n}\n\n.shiki-spinner-container {\n align-items: center;\n background-color: rgb(0 0 0 / 60%);\n display: flex;\n position: absolute;\n justify-content: center;\n inset: 0;\n}\n\n.shiki-preview {\n margin-bottom: 2em;\n}\n\n.shiki-lang {\n padding: 0 5px;\n margin-bottom: 6px;\n font-weight: bold;\n text-transform: capitalize;\n display: flex;\n align-items: center;\n}\n\n.shiki-table {\n border-collapse: collapse;\n width: 100%;\n}\n\n.shiki-table tr {\n height: 19px;\n width: 100%;\n}\n\n.shiki-root td:first-child {\n border-right: 1px solid transparent;\n padding-left: 5px;\n padding-right: 8px;\n user-select: none;\n}\n\n.shiki-root td:last-child {\n padding-left: 8px;\n word-break: break-word;\n width: 100%;\n}\n", ".vc-user-connection {\n all: unset;\n display: inline-block;\n cursor: pointer;\n}\n\n.vc-sc-tooltip {\n display: inline-flex;\n gap: 0.25em;\n align-items: center;\n}\n", ".shc-lock-screen-outer-container {\n overflow: hidden scroll;\n flex: 1 1 auto;\n height: 100%;\n width: 100%;\n}\n\n.shc-lock-screen-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n min-height: 100%;\n}\n\n.shc-lock-screen-container > * {\n margin: 5px;\n}\n\n.shc-lock-screen-logo {\n width: 180px;\n height: 180px;\n}\n\n.shc-lock-screen-heading-container {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.shc-lock-screen-heading-container > * {\n margin: inherit;\n}\n\n.shc-lock-screen-heading-nsfw-icon {\n color: var(--text-normal);\n}\n\n.shc-lock-screen-topic-container {\n color: var(--text-normal);\n background: var(--bg-overlay-3, var(--background-secondary));\n border-radius: 5px;\n padding: 10px;\n max-width: 70vw;\n}\n\n.shc-lock-screen-tags-container {\n background: var(--bg-overlay-3, var(--background-secondary));\n border-radius: 5px;\n padding: 10px;\n max-width: 70vw;\n}\n\n.shc-lock-screen-tags-container > * {\n margin: inherit;\n}\n\n.shc-lock-screen-tags {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n gap: 8px;\n}\n\n.shc-evenodd-fill-current-color {\n fill-rule: evenodd;\n fill: currentcolor;\n}\n\n.shc-hidden-channel-icon {\n margin-left: 6px;\n z-index: 0;\n cursor: not-allowed;\n}\n\n.shc-lock-screen-default-emoji-container {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.shc-lock-screen-default-emoji-container > [class^=\"emojiContainer\"] {\n background: var(--bg-overlay-3, var(--background-secondary));\n border-radius: 8px;\n padding: 5px 6px;\n margin-left: 5px;\n}\n\n.shc-lock-screen-allowed-users-and-roles-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n background: var(--bg-overlay-3, var(--background-secondary));\n border-radius: 5px;\n padding: 10px;\n max-width: 70vw;\n}\n\n.shc-lock-screen-allowed-users-and-roles-container-title {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.shc-lock-screen-allowed-users-and-roles-container-toggle-btn {\n all: unset;\n margin-left: 5px;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n\n.shc-lock-screen-allowed-users-and-roles-container-toggle-btn > svg {\n color: var(--text-normal);\n}\n\n.shc-lock-screen-allowed-users-and-roles-container-permdetails-btn {\n all: unset;\n margin-right: 5px;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n\n.shc-lock-screen-allowed-users-and-roles-container-permdetails-btn > svg {\n color: var(--text-normal);\n}\n\n.shc-lock-screen-allowed-users-and-roles-container > [class^=\"members\"] {\n margin-left: 10px;\n flex-wrap: wrap;\n justify-content: center;\n}\n", ".vc-smyn-suffix {\n color: var(--text-muted);\n}\n\n.vc-smyn-suffix::before {\n content: \"(\";\n}\n\n.vc-smyn-suffix::after {\n content: \")\";\n}\n", "#vc-spotify-player {\n padding: 0.375rem 0.5rem;\n border-bottom: 1px solid var(--background-modifier-accent);\n\n --vc-spotify-green: #1db954; /* so custom themes can easily change it */\n}\n\n.theme-light #vc-spotify-player {\n background: var(--bg-overlay-3, var(--background-secondary-alt));\n}\n\n.theme-dark #vc-spotify-player {\n background: var(--bg-overlay-1, var(--background-secondary-alt));\n}\n\n.vc-spotify-button {\n background: none;\n color: var(--interactive-normal);\n padding: 0;\n width: 32px;\n height: 32px;\n border-radius: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.vc-spotify-button:hover {\n color: var(--interactive-hover);\n background-color: var(--background-modifier-selected);\n}\n\n.vc-spotify-button svg {\n height: 24px;\n width: 24px;\n}\n\n[class*=\"vc-spotify-shuffle\"] > svg,\n[class*=\"vc-spotify-repeat\"] > svg {\n width: 22px;\n height: 22px;\n}\n\n.vc-spotify-button svg path {\n width: 100%;\n height: 100%;\n}\n\n/* .vc-spotify-button:hover {\n filter: brightness(1.3);\n} */\n\n.vc-spotify-shuffle-on,\n.vc-spotify-repeat-context,\n.vc-spotify-repeat-track,\n.vc-spotify-shuffle-on:hover,\n.vc-spotify-repeat-context:hover,\n.vc-spotify-repeat-track:hover {\n color: var(--vc-spotify-green);\n}\n\n.vc-spotify-tooltip-text {\n overflow: hidden;\n white-space: nowrap;\n padding-right: 0.2em;\n max-width: 100%;\n margin: unset;\n}\n\n.vc-spotify-repeat-1 {\n font-size: 70%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n\n.vc-spotify-button-row {\n justify-content: center;\n}\n\n#vc-spotify-info-wrapper {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 3em;\n gap: 0.5em;\n}\n\n#vc-spotify-info-wrapper img {\n height: 90%;\n object-fit: contain;\n}\n\n#vc-spotify-album-expanded-wrapper img {\n width: 100%;\n object-fit: contain;\n}\n\n#vc-spotify-titles {\n display: flex;\n flex-direction: column;\n padding: 0.2rem;\n justify-content: center;\n align-items: flex-start;\n align-content: flex-start;\n overflow: hidden;\n}\n\n#vc-spotify-song-title {\n color: var(--header-primary);\n font-size: 14px;\n font-weight: 600;\n}\n\n.vc-spotify-ellipoverflow {\n white-space: nowrap;\n overflow: hidden;\n width: 100%;\n text-overflow: ellipsis;\n}\n\n.vc-spotify-artist,\n.vc-spotify-album {\n font-size: 12px;\n text-decoration: none;\n color: var(--header-secondary);\n}\n\n.vc-spotify-comma {\n color: var(--header-secondary);\n}\n\n.vc-spotify-artist[role=\"link\"]:hover,\n#vc-spotify-album-title[role=\"link\"]:hover,\n#vc-spotify-song-title[role=\"link\"]:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n\n#vc-spotify-album-image {\n border-radius: 3px;\n transition: filter 0.2s;\n}\n\n#vc-spotify-album-image:hover {\n filter: brightness(1.2);\n cursor: pointer;\n}\n\n#vc-spotify-progress-bar {\n position: relative;\n color: var(--text-normal);\n width: 100%;\n margin: 0.5em 0;\n margin-bottom: 5px;\n}\n\n#vc-spotify-progress-bar > [class^=\"slider\"] {\n flex-grow: 1;\n width: 100%;\n padding: 0 !important;\n}\n\n#vc-spotify-progress-bar > [class^=\"slider\"] [class^=\"bar-\"] {\n height: 4px !important;\n}\n\n#vc-spotify-progress-bar > [class^=\"slider\"] [class^=\"grabber\"] {\n /* these importants are necessary, it applies a width and height through inline styles */\n height: 10px !important;\n width: 10px !important;\n margin-top: 4px;\n background-color: var(--interactive-normal);\n border-color: var(--interactive-normal);\n color: var(--interactive-normal);\n opacity: 0;\n transition: opacity 0.1s;\n}\n\n#vc-spotify-progress-bar:hover > [class^=\"slider\"] [class^=\"grabber\"] {\n opacity: 1;\n}\n\n#vc-spotify-progress-text {\n margin: 0;\n}\n\n.vc-spotify-progress-time {\n font-size: 12px;\n top: 10px;\n position: absolute;\n}\n\n.vc-spotify-time-left {\n left: 0;\n}\n\n.vc-spotify-time-right {\n right: 0;\n}\n\n.vc-spotify-fallback {\n padding: 0.5em;\n color: var(--text-normal);\n}\n", ".vc-trans-modal-content {\n padding: 1em;\n}\n\n.vc-trans-modal-header {\n justify-content: space-between;\n align-content: center;\n}\n\n.vc-trans-modal-header h1 {\n margin: 0;\n}\n\n.vc-trans-accessory {\n color: var(--text-muted);\n margin-top: 0.5em;\n font-style: italic;\n font-weight: 400;\n}\n\n.vc-trans-accessory svg {\n margin-right: 0.25em;\n}\n\n.vc-trans-dismiss {\n all: unset;\n cursor: pointer;\n color: var(--text-link);\n}\n\n.vc-trans-dismiss:is(:hover, :focus) {\n text-decoration: underline;\n}\n\n.vc-trans-auto-translate {\n color: var(--green-360);\n}\n\n.vc-trans-chat-button {\n scale: 1.085;\n}\n", ".vc-uvs-button>div {\n white-space: normal !important;\n}\n\n.vc-uvs-button {\n width: 100%;\n margin: auto;\n height: unset;\n}\n\n.vc-uvs-header {\n color: var(--header-primary);\n margin-bottom: 6px;\n}\n\n.vc-uvs-modal-margin {\n margin: 0 12px;\n}\n\n.vc-uvs-modal-margin div {\n margin-bottom: 0 !important;\n}\n\n.vc-uvs-popout-margin-self>[class^=\"section\"] {\n padding-top: 0;\n padding-bottom: 12px;\n}\n", ".vc-toolbox-btn,\n.vc-toolbox-btn>svg {\n -webkit-app-region: no-drag;\n}\n\n.vc-toolbox-btn>svg {\n color: var(--interactive-normal);\n}\n\n.vc-toolbox-btn[class*=\"selected\"]>svg {\n color: var(--interactive-active);\n}\n\n.vc-toolbox-btn:hover>svg {\n color: var(--interactive-hover);\n}\n", ".vc-vmsg-modal {\n padding: 1em;\n}\n\n.vc-vmsg-buttons {\n display: grid;\n grid-template-columns: repeat(3, minmax(0, 1fr));\n gap: 0.5em;\n margin-bottom: 1em;\n}\n\n.vc-vmsg-modal audio {\n width: 100%;\n}\n\n.vc-vmsg-preview {\n color: var(--text-normal);\n border-radius: 24px;\n background-color: var(--background-secondary);\n position: relative;\n display: flex;\n align-items: center;\n padding: 0 16px;\n height: 48px;\n}\n\n.vc-vmsg-preview-indicator {\n background: var(--button-secondary-background);\n width: 16px;\n height: 16px;\n border-radius: 50%;\n transition: background 0.2s ease-in-out;\n}\n\n.vc-vmsg-preview-recording .vc-vmsg-preview-indicator {\n background: var(--status-danger);\n}\n\n.vc-vmsg-preview-time {\n opacity: 0.8;\n margin: 0 0.5em;\n font-size: 80%;\n\n /* monospace so different digits have same size */\n font-family: var(--font-code);\n}\n\n.vc-vmsg-preview-label {\n opacity: 0.5;\n letter-spacing: 0.125em;\n font-weight: 600;\n flex: 1;\n text-align: center;\n}\n"], - "mappings": "AAAA,2BAEI,2BACA,yBAHJ,kBAKI,gCCLJ,sBAEI,UACA,aACA,sBACA,yBACA,iDANJ,kBAQI,gBACA,eACA,WAGJ,gFACI,kBACA,mBACA,WACA,WACA,gBAGJ,iBACI,aACA,mBAvBJ,gBAyBI,YAGJ,yBACI,WAGJ,wBACI,aACA,8BAGJ,uBACI,4BACA,eACA,gBACA,oBACA,yBAGJ,2BACI,UACA,eACA,gCACA,WACA,yDAGJ,iCACI,+BACA,UAGJ,sBACI,YACA,WA5DJ,kBAgEA,6BACI,cAjEJ,kBAmEI,gBAGJ,mBAtEA,iBAwEI,iBAGJ,qBACI,WAGJ,2BACI,aACA,8EACA,mBAGJ,+BACI,aACA,sBAvFJ,YAyFI,gBAGJ,6BACI,oBACA,mCAGJ,8CACI,kBAGJ,8BACI,mBACA,UACA,kBAGJ,0BACI,aACA,sBAGJ,+BACI,iBACA,eACA,oBAGJ,gCACI,uBACA,iDCxHJ,qBACI,gBACA,mBACA,0DAGJ,0BACI,kBACA,oBACA,mBAGJ,gCAZA,YAcI,aACA,QACA,mBACA,6BACA,YACA,mBACA,kBAGJ,oBACI,aACA,mBAGJ,kBA5BA,YA8BI,kBAGJ,wBACI,gDACA,4CACA,+BAGJ,yBAEI,+BACA,mCA1CJ,aA4CI,mDACA,iBAGJ,6BACI,aACA,oCACA,aAGJ,gCACI,uBACA,iDAGJ,qFAGI,iBAGA,eCjEJ,wBACI,aACA,cACA,0DAGJ,wBACI,aACA,sBACA,iDACA,gCAVJ,8BAaI,WACA,wBACA,4DAGJ,6BACI,uBACA,aACA,kBACA,mBACA,gBAGJ,iCACI,cCTJ,iBACI,gBACA,aACA,cACA,0DAGJ,wBACI,YACA,WA3BJ,UA6BI,uBACA,iBAGJ,kCACI,+BAGJ,4BACI,aACA,YACA,SACA,gCAGJ,kBA5CA,cA8CI,gCACA,gBA/CJ,kBAiDI,YACA,eACA,iBACA,uBACA,kBAGJ,qBAxDA,cA4DA,sBA5DA,YA8DI,WACA,aACA,sBAGJ,0BACI,iBAGJ,yBAvEA,YAyEI,0CACA,gDACA,+BAGJ,gCACI,gBAGJ,+CACI,wBCnFJ,uBACI,wBAGJ,qBACI,0BCLJ,kCAIA,wBACI,aACA,mBACA,kBAGJ,sBACI,oBACA,YACA,sCAbJ,0DAgBI,eACA,YACA,kBACA,iBAGJ,6BACI,WACA,cACA,kBACA,YACA,WACA,sCACA,WACA,WACA,MAGJ,wBACI,YACA,WApCJ,kBAwCA,uBACI,iBACA,aACA,SAGJ,2BACI,YACA,WAhDJ,kBAkDI,4CACA,sBAGJ,yBACI,aACA,SCxDJ,eACI,iDACA,gCAFJ,kBAII,cACA,YALJ,aAOI,WACA,wBACA,4DACA,sBAGJ,wBACI,WAGJ,qBACI,4CACA,2BACA,iCAGJ,iBACI,gBACA,aACA,WACA,yBACA,mBACA,QACA,mBAGJ,eACI,YACA,gBACA,uBACA,oBACA,qBACA,aACA,4BAEA,oBAGJ,sBACI,WAGJ,eACI,aACA,WACA,mBACA,YACA,QAGJ,iBACI,eAGJ,wBACI,cC9DJ,kBACI,qCCDJ,uBACI,aACA,sBAGJ,wBACI,aACA,mBACA,8BAGJ,8BACI,aACA,sBACA,2BAGJ,6DACI,8DAGJ,wBACI,yBAGJ,+BACI,2CA1BJ,kCA6BI,aACA,mBACA,8BACA,mBChCJ,2BACI,oBAGJ,6CACI,UACA,eACA,eACA,kBACA,WACA,aCVJ,qBACI,uBACA,iDAGJ,0CACI,kBACA,aAPJ,yCAUI,QAGJ,0CACI,aACA,sBACA,gBACA,QACA,gBAGJ,6CACI,WACA,YAGJ,yCACI,8BAGJ,uDACI,aACA,2BAGJ,0CACI,aACA,sBACA,SAtCJ,eA0CA,yDACI,aACA,SAGJ,8CA/CA,aAuDA,uCACI,aACA,sBACA,YACA,SAGJ,wCACI,aACA,sBACA,uBACA,iBACA,YACA,SAGJ,mCACI,aACA,eACA,QAGJ,gCACI,gBC9EJ,mBACI,aACA,mBCFJ,uBACI,aACA,qBAEA,iCACA,kCAGJ,wBACI,iBACA,gBAGJ,4BACI,uBACA,eACA,mBAGJ,uBACI,0BAGJ,sBACI,yBAGJ,2BACI,qCACA,qBACA,WACA,YA/BJ,kBAiCI,kBAGJ,0BACI,qBACA,UACA,WAvCJ,kBAyCI,oCAzCJ,oBCAA,wCACI,aAGJ,oIASI,8BACA,mCAGJ,iKAUI,8BAGJ,kCACI,uBAGJ,mCACI,WCjCJ,yCACI,aACA,8BACA,mBACA,gBACA,kBAGJ,wCACI,aACA,mBAGJ,uCACI,UACA,eACA,aACA,mBACA,uBACA,WACA,YAGJ,kFACI,UACA,eACA,aACA,mBAYJ,2BACI,YAGJ,8BACI,WACA,YACA,aACA,mBACA,uBACA,kBAGJ,+BACI,aACA,8BACA,uCAzDJ,eA6DA,0BACI,eACA,aACA,sBACA,QACA,yDAGJ,mCACI,UACA,eAGJ,+BACI,aACA,mBA5EJ,gBA8EI,eACA,YA/EJ,kBAmFA,qCACI,kDAGJ,sCACI,qDAGJ,mCACI,uBACA,mBACA,gBAGJ,iCAjGA,kBAmGI,WACA,YACA,gBACA,kBACA,cAGJ,8BA1GA,kBA4GI,WACA,YACA,iBAGJ,2BACI,sBACA,aACA,sBACA,gBAGJ,gCACI,kBACA,aACA,mBA3HJ,aA6HI,0DAGJ,2CACI,SAGJ,qCACI,qDACA,WACA,YACA,iBAGJ,8CACI,+BACA,eACA,kBACA,QACA,SACA,6BAGJ,oDACI,gCCrJJ,iCACI,aACA,qBACA,mBAGJ,yBACI,UACA,eACA,WACA,YCVJ,eACI,gCAGJ,qBACI,kDACA,+BCNJ,6BACI,sBACA,uBACA,mBACA,gBACA,yBACA,eACA,iBACA,qBACA,gCACA,gBACA,cACA,8BACA,eAGJ,yBACI,aACA,uBAlBJ,aAoBI,WAGJ,mDACI,aAGJ,yBACI,WACA,YACA,gCACA,wBAGJ,8CACI,oBCnCJ,sBACI,aAGJ,uCACI,qBACA,iBACA,oBCPJ,0DACI,gBAGJ,cACI,sBACA,gBAGJ,cACI,eACA,mBACA,YACA,gBACA,uBACA,2DAGJ,yBACI,WAnBJ,gBAwBA,sBACI,yBAGJ,oBACI,kBACA,gBACA,kBACA,wBAGJ,gBACI,eAGJ,qBAvCA,UA2CA,mCACI,gBACA,mCAGJ,mDACI,aAGJ,qBACI,YAGJ,sBACI,gBAGJ,eACI,0BACA,6BACA,6BAGJ,qBACI,qDAnEJ,kBAuEA,2BACI,wBAGJ,uBACI,kBACA,eACA,kBACA,yBACA,eAGJ,sBACI,eAGJ,2BACI,aACA,8BACA,mBAGJ,oBA7FA,YA+FI,aACA,UAGJ,oBACI,aACA,8BACA,SAIJ,0BACI,oBACI,2BAIR,wBACI,aACA,WACA,SACA,mBAGJ,4BAvHA,kBAyHI,WACA,UAGJ,+BACI,WACA,cACA,WACA,YACA,mDAGJ,6BACI,YAGJ,4BACI,eC1IJ,2BACI,yCACA,yBACA,UAHJ,sCAMI,aACA,yCAPJ,kBASI,gBACA,mBACA,eAGJ,6CAEI,6BAGJ,qCACI,kBAGJ,0CACI,yCAGJ,oBACI,8BACA,qBAGJ,uBAhCA,SAoCA,2BApCA,UAwCA,oBACI,kBAGJ,kBACI,qCC7CJ,YACI,YACA,iBAGJ,cACI,eACA,4BACA,aACA,WACA,iBACA,cACA,iCAGJ,cACI,aACA,mBACA,mBACA,SAnBJ,YAuBA,kBACI,WACA,YACA,eAGJ,4BACI,aACA,sBACA,SAGJ,YAnCA,SAuCA,eACI,0DAxCJ,mBA0CI,aACA,SACA,oBACA,mBAGJ,WACI,oCACA,gCACA,eACA,YACA,iBAGJ,mBAxDA,WA4DA,gDACI,8CAGJ,YACI,aACA,8CACA,QAGJ,wBACI,yBAGJ,2CACI,cAGJ,aACI,aACA,mBACA,SAGJ,iBACI,YArFJ,kBAuFI,eAGJ,gBACI,WACA,iBAGJ,iCA/FA,aAmGA,uCACI,kDCpGJ,iBACI,WACA,6CAGJ,YALA,kBASA,iBACI,cACA,gBAXJ,aAaI,kBACA,kBACA,qBACA,cACA,qBACA,uBACA,YAGJ,eACI,iBACA,iBAGJ,kBACI,gBAGJ,YACI,cACA,kBACA,QACA,SACA,UAGJ,8BACI,UAGJ,WA3CA,0CA8CI,iBAGJ,sBACI,gBAGJ,sBArDA,oBAyDA,yBACI,mBACA,uBACA,aACA,kBACA,uBA9DJ,QAkEA,eACI,kBAGJ,YAtEA,cAwEI,kBACA,gBACA,0BACA,aACA,mBAGJ,aACI,yBACA,WAGJ,gBACI,YACA,WAGJ,2BACI,mCACA,iBACA,kBACA,iBAGJ,0BACI,iBACA,sBACA,WCnGJ,oBACI,UACA,qBACA,eAGJ,eACI,oBACA,UACA,mBCTJ,iCACI,uBACA,cACA,YACA,WAGJ,2BACI,aACA,sBACA,mBACA,uBACA,kBACA,gBAGJ,6BAhBA,WAoBA,sBACI,YACA,aAGJ,mCACI,aACA,mBACA,mBAGJ,qCACI,eAGJ,mCACI,yBAGJ,iCACI,yBACA,4DAzCJ,+BA4CI,eAGJ,gCACI,4DAhDJ,+BAmDI,eAGJ,kCACI,eAGJ,sBACI,aACA,mBACA,uBACA,eACA,QAGJ,gCACI,kBACA,kBAGJ,yBACI,gBACA,UACA,mBAGJ,yCACI,aACA,mBACA,mBAGJ,iEACI,4DApFJ,kCAuFI,gBAGJ,mDACI,aACA,sBACA,mBACA,4DA9FJ,+BAiGI,eAGJ,yDACI,aACA,mBACA,mBAGJ,8DACI,UACA,gBACA,eACA,aACA,mBAGJ,kEACI,yBAGJ,mEACI,UACA,iBACA,eACA,aACA,mBAGJ,uEACI,yBAGJ,oEACI,iBACA,eACA,uBCrIJ,gBACI,wBAGJ,uBACI,YAGJ,sBACI,YCTJ,yCAEI,0DAEA,4BAGJ,gCACI,gEAGJ,+BACI,gEAGJ,mBACI,gBACA,gCAjBJ,UAmBI,WACA,YApBJ,mBAsBI,aACA,uBACA,mBAGJ,yBACI,+BACA,qDAGJ,uBACI,YACA,WAGJ,+DAEI,WACA,YAGJ,4BACI,WACA,YAOJ,wKAMI,8BAGJ,yBACI,gBACA,mBACA,mBACA,eACA,aAGJ,qBACI,cACA,kBACA,QACA,SACA,+BAGJ,uBACI,uBAGJ,yBACI,aACA,mBACA,mBACA,WACA,SAGJ,6BACI,WACA,mBAGJ,uCACI,WACA,mBAGJ,mBACI,aACA,sBArGJ,cAuGI,uBACA,uBACA,yBACA,gBAGJ,uBACI,4BACA,eACA,gBAGJ,0BACI,mBACA,gBACA,WACA,uBAGJ,qCAEI,eACA,qBACA,8BAGJ,kBACI,8BAGJ,qHAGI,0BACA,eAGJ,wBA5IA,kBA8II,sBAGJ,8BACI,uBACA,eAGJ,yBACI,kBACA,yBACA,WAzJJ,kBA8JA,yCACI,YACA,WAhKJ,oBAoKA,uDACI,qBAGJ,0DAEI,sBACA,qBACA,eACA,2CACA,uCACA,gCACA,UACA,uBAGJ,gEACI,UAGJ,0BAxLA,SA4LA,0BACI,eACA,SACA,kBAGJ,sBACI,OAGJ,uBACI,QAGJ,qBA1MA,aA4MI,yBC5MJ,oCAIA,uBACI,8BACA,qBAGJ,0BATA,SAaA,oBACI,wBACA,gBACA,kBACA,gBAGJ,wBACI,mBAGJ,kBACI,UACA,eACA,uBAGJ,oCACI,0BAGJ,yBACI,uBAGJ,sBACI,YCvCJ,mBACI,6BAGJ,eACI,WALJ,YAOI,aAGJ,eACI,4BACA,kBAGJ,qBAfA,cAmBA,yBACI,0BAGJ,4CACI,cACA,oBCzBJ,oCAEI,2BAGJ,oBACI,gCAGJ,qCACI,gCAGJ,0BACI,+BCdJ,2BAIA,iBACI,aACA,8CACA,SACA,kBAGJ,qBACI,WAGJ,iBACI,yBAhBJ,mBAkBI,6CACA,kBACA,aACA,mBArBJ,eAuBI,YAGJ,2BACI,8CACA,WACA,YA7BJ,kBA+BI,sCAGJ,sDACI,gCAGJ,sBACI,WAvCJ,cAyCI,cAGA,6BAGJ,uBACI,WACA,sBACA,gBACA,OACA", - "names": [] -} diff --git a/vesktop/vencordDist/vencordDesktopRenderer.js b/vesktop/vencordDist/vencordDesktopRenderer.js deleted file mode 100644 index acc2fc0..0000000 --- a/vesktop/vencordDist/vencordDesktopRenderer.js +++ /dev/null @@ -1,225 +0,0 @@ -// Vencord ca18b6e -// Standalone: true -// Platform: Universal -// Updater disabled: false -"use strict";var Vencord=(()=>{var kP=Object.create;var qa=Object.defineProperty;var NP=Object.getOwnPropertyDescriptor;var DP=Object.getOwnPropertyNames;var LP=Object.getPrototypeOf,EP=Object.prototype.hasOwnProperty;var fi=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var g=(e,t)=>()=>(e&&(t=e(e=0)),t);var kr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),qe=(e,t)=>{for(var o in t)qa(e,o,{get:t[o],enumerable:!0})},a1=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of DP(t))!EP.call(e,i)&&i!==o&&qa(e,i,{get:()=>t[i],enumerable:!(r=NP(t,i))||r.enumerable});return e};var Ka=(e,t,o)=>(o=e!=null?kP(LP(e)):{},a1(t||!e||!e.__esModule?qa(o,"default",{value:e,enumerable:!0}):o,e)),Xn=e=>a1(qa({},"__esModule",{value:!0}),e);var f,n,a=g(()=>{"use strict";f=Symbol.for("react.fragment"),n=(...e)=>(n=Vencord.Webpack.Common.React.createElement)(...e)});var oe,Ke=g(()=>{"use strict";a();oe=class{constructor(t,o="white"){this.name=t;this.color=o}static makeTitle(t,o){return["%c %c %s ","",`background: ${t}; color: black; font-weight: bold; border-radius: 5px;`,o]}_log(t,o,r,i=""){console[t](`%c Vencord %c %c ${this.name} ${i}`,`background: ${o}; color: black; font-weight: bold; border-radius: 5px;`,"",`background: ${this.color}; color: black; font-weight: bold; border-radius: 5px;`,...r)}log(...t){this._log("log","#a6d189",t)}info(...t){this._log("info","#a6d189",t)}error(...t){this._log("error","#e78284",t)}errorCustomFmt(t,...o){this._log("error","#e78284",o,t)}warn(...t){this._log("warn","#e5c890",t)}debug(...t){this._log("debug","#eebebe",t)}}});var l1,j,ot=g(()=>{"use strict";a();l1="",j={};for(let e of["top","bottom","left","right"])for(let t of[8,16,20]){let o=`vc-m-${e}-${t}`;j[`${e}${t}`]=o,l1+=`.${o}{margin-${e}:${t}px;}`}document.addEventListener("DOMContentLoaded",()=>document.head.append(Object.assign(document.createElement("style"),{textContent:l1,id:"vencord-margins"})),{once:!0})});function Jn(e,t=5){let o=0,r;return()=>(!r&&t>o++&&(r=e(),!r&&t===o&&console.error("Lazy factory failed:",e)),r)}function Ot(e,t=5,o=!1){let r=!0;o||setTimeout(()=>r=!1,0);let i=0,s=Object.assign(function(){},{[hs]:void 0,[gi](){return!s[hs]&&t>i++&&(s[hs]=e(),!s[hs]&&t===i&&console.error("Lazy factory failed:",e)),s[hs]}});return new Proxy(s,{...Ya,get(l,c,u){return!o&&r?Ot(()=>Reflect.get(l[gi](),c,u),t,!0):Reflect.get(l[gi](),c,u)}})}var c1,Ya,gi,hs,Uo=g(()=>{"use strict";a();c1=["arguments","caller","prototype"],Ya={},gi=Symbol.for("vencord.lazy.get"),hs=Symbol.for("vencord.lazy.cached");for(let e of["apply","construct","defineProperty","deleteProperty","getOwnPropertyDescriptor","getPrototypeOf","has","isExtensible","ownKeys","preventExtensions","set","setPrototypeOf"])Ya[e]=(t,...o)=>Reflect[e](t[gi](),...o);Ya.ownKeys=e=>{let t=e[gi](),o=Reflect.ownKeys(t);for(let r of c1)o.includes(r)||o.push(r);return o};Ya.getOwnPropertyDescriptor=(e,t)=>{if(typeof t=="string"&&c1.includes(t))return Reflect.getOwnPropertyDescriptor(e,t);let o=Reflect.getOwnPropertyDescriptor(e[gi](),t);return o&&Object.defineProperty(e,t,o),o}});function bt(e,t=5){let o=Jn(e,t),r=i=>{let s=o()??OP;return n(s,{...i})};return r.$$vencordInternal=o,r}var OP,Cu=g(()=>{"use strict";a();Uo();OP=()=>null});function bn(e){if(typeof e=="string")return e;let t=e.source.replaceAll("\\i","[A-Za-z_$][\\w$]*");return new RegExp(t,e.flags)}function Za(e,t){let o=`Vencord.Plugins.plugins[${JSON.stringify(t)}]`;return typeof e!="function"?e.replaceAll("$self",o):(...r)=>e(...r).replaceAll("$self",o)}function Ru(e,t){if(e.get){let o=e.get;e.get=function(){return t(o.call(this))}}else e.value&&(e.value=t(e.value));return e}function ys(e,t){let o=Object.getOwnPropertyDescriptors(e);o.match=Ru(o.match,bn),o.replace=Ru(o.replace,r=>Za(r,t)),Object.defineProperties(e,o)}var hi=g(()=>{"use strict";a()});var _P,an,Xa=g(()=>{"use strict";a();Ke();_P=(e,t,o)=>t,an=_P});function Qa(e){if(ln!==void 0)throw"no.";return e.push([[Symbol("Vencord")],{},t=>io=t]),e.pop(),io?(ln=io.c,!0):!1}function Qn(e,...t){let o=new Error(`webpack.${e} found no module`);yi.error(o,"Filter:",t)}function Nr(e){if(typeof e!="function")throw new Error("Invalid filter. Expected a function got "+typeof e);let t=[];for(let o in ln){let r=ln[o];!r?.exports||(e(r.exports)&&t.push(r.exports),r.exports.default&&e(r.exports.default)&&t.push(r.exports.default))}return t}function p1(...e){let t=Va(...e);return t?io.m[t]:null}function go(e,t){return Ot(e,t)}function Du(e,t){return bt(e,t)}function so(e){return Ot(()=>$o(e))}function Lr(...e){let t=$o(Ce.byProps(...e),{isIndirect:!0});return t||Qn("findByProps",...e),t}function x(...e){return Ot(()=>Lr(...e))}function d1(...e){let t=$o(Ce.byCode(...e),{isIndirect:!0});return t||Qn("findByCode",...e),t}function Go(...e){return Ot(()=>d1(...e))}function m1(e){let t=$o(Ce.byStoreName(e),{isIndirect:!0});return t||Qn("findStore",e),t}function Re(e){return Ot(()=>m1(e))}function Lu(...e){let t=$o(Ce.componentByCode(...e),{isIndirect:!0});return t||Qn("findComponentByCode",...e),t}function Eu(e){return bt(()=>{let t=$o(e,{isIndirect:!0});return t||Qn("findComponent",e),t})}function Ne(...e){return bt(()=>{let t=$o(Ce.componentByCode(...e),{isIndirect:!0});return t||Qn("findComponentByCode",...e),t})}function Tn(...e){return bt(()=>{let t=$o(Ce.byProps(...e),{isIndirect:!0});return t||Qn("findExportedComponent",...e),t[e[0]]})}async function f1(e,t=/\.el\("(.+?)"\)(?<=(\i)\.el.+?)\.then\(\2\.bind\(\2,"\1"\)\)/){let o=p1(...e);if(!o){let s=new Error("extractAndLoadChunks: Couldn't find module factory");yi.warn(s,"Code:",e,"Matcher:",t);return}let r=o.toString().match(bn(t));if(!r){let s=new Error("extractAndLoadChunks: Couldn't find entry point id in module factory code");yi.warn(s,"Code:",e,"Matcher:",t);return}let[,i]=r;if(!i||!Number(i)){let s=new Error("extractAndLoadChunks: Matcher didn't return a capturing group with the entry point, or the entry point returned wasn't a number");yi.warn(s,"Code:",e,"Matcher:",t);return}return await io.el(i),io(i)}function vi(e,t=/\.el\("(.+?)"\)(?<=(\i)\.el.+?)\.then\(\2\.bind\(\2,"\1"\)\)/){return()=>f1(e,t)}function gt(e,t,{isIndirect:o=!1}={}){if(typeof e=="string")e=Ce.byProps(e);else if(Array.isArray(e))e=Ce.byProps(...e);else if(typeof e!="function")throw new Error("filter must be a string, string[] or function, got "+typeof e);if(ln!=null){let[r,i]=$o(e,{isIndirect:!0,isWaitFor:!0});if(r)return void t(r,i)}u1.set(e,t)}function FP(e){Nu.add(e)}function UP(e){Nu.delete(e)}function Ou(...e){let t={},o=io.m;e:for(let r in o){let i=o[r].original??o[r],s=i.toString();for(let l of e)if(typeof l=="string"&&!s.includes(l)||l instanceof RegExp&&!l.test(s))continue e;t[r]=i}return t}function el(e){let t=io.m[e];if(!t)return null;let o=` -// [EXTRACTED] WebpackModule${e} -// WARNING: This module was extracted to be more easily readable. -// This module is NOT ACTUALLY USED! This means putting breakpoints will have NO EFFECT!! - -0,${t.toString()} -//# sourceURL=ExtractedWebpackModule${e} -`;return(0,eval)(o)}var yi,Ja,ku,io,ln,Ce,u1,Nu,$o,Dr,Va,BP,H=g(()=>{"use strict";a();Uo();Cu();Ke();hi();Xa();yi=new oe("Webpack"),ku=new Promise(e=>Ja=e),Ce={byProps:(...e)=>e.length===1?t=>t[e[0]]!==void 0:t=>e.every(o=>t[o]!==void 0),byCode:(...e)=>t=>{if(typeof t!="function")return!1;let o=Function.prototype.toString.call(t);for(let r of e)if(!o.includes(r))return!1;return!0},byStoreName:e=>t=>t.constructor?.displayName===e,componentByCode:(...e)=>{let t=Ce.byCode(...e);return o=>t(o)?!0:o.$$typeof?o.type&&o.type.render?t(o.type.render):o.type?t(o.type):o.render?t(o.render):!1:!1}},u1=new Map,Nu=new Set;$o=an("find",function(t,{isIndirect:o=!1,isWaitFor:r=!1}={}){if(typeof t!="function")throw new Error("Invalid filter. Expected a function got "+typeof t);for(let i in ln){let s=ln[i];if(!!s?.exports){if(t(s.exports))return r?[s.exports,i]:s.exports;if(s.exports.default&&t(s.exports.default)){let l=s.exports.default;return r?[l,i]:l}}}return o||Qn("find",t),r?[null,null]:null});Dr=an("findBulk",function(...t){if(!Array.isArray(t))throw new Error("Invalid filters. Expected function[] got "+typeof t);let{length:o}=t;if(o===0)throw new Error("Expected at least two filters.");if(o===1)return $o(t[0]);let r=t,i=0,s=Array(o);e:for(let l in ln){let c=ln[l];if(!!c?.exports)for(let u=0;u{"use strict";a();H();tl=so(e=>e.image&&e.modal&&!e.applicationIcon),ol=x("buttonWrapper","buttonContent")});function nl(e,t){let o=function(){throw new Error(`Vencord could not find the ${e} Component`)},r=bt(()=>o);return gt(t,i=>{o=i,Object.assign(r,i)},{isIndirect:!0}),r}function $t(e,t){gt(Ce.byStoreName(e),t,{isIndirect:!0})}var _u=g(()=>{"use strict";a();lt();H()});var S,Tt,k,wt,ne,Je,rl,V,Io,il,Er,sl,vs,h1,Ho,al,Si,bi,Ti,ll,Ss,Vn,Po,GP,bs,y1=g(()=>{"use strict";a();H();_u();S={},Vn=nl("MaskedLink",Ce.componentByCode("MASKED_LINK)")),Po=nl("Timestamp",Ce.byCode(".Messages.MESSAGE_EDITED_TIMESTAMP_A11Y_LABEL.format")),GP=nl("Flex",["Justify","Align","Wrap"]),{OAuth2AuthorizeModal:bs}=x("OAuth2AuthorizeModal");gt(["FormItem","Button"],e=>{({useToken:Ss,Card:Tt,Button:k,FormSwitch:wt,Tooltip:ne,TextInput:Je,TextArea:rl,Text:V,Select:Io,SearchableSelect:il,Slider:Er,ButtonLooks:sl,TabBar:Ho,Popout:vs,Dialog:h1,Paginator:al,ScrollerThin:Si,Clickable:bi,Avatar:Ti,FocusLock:ll}=e),S=e})});var L,Yt,v1=g(()=>{"use strict";a();H();L={};gt(["MenuItem","MenuSliderControl"],e=>L=e);Yt=x("closeContextMenu","openContextMenu")});var U,W,se,Rt,xt,wi,cl,Or,S1=g(()=>{"use strict";a();H();Or=x("createPortal","render");gt("useState",e=>{U=e,{useEffect:se,useState:W,useMemo:Rt,useRef:xt,useReducer:wi,useCallback:cl}=U})});var Ts,xi,ws,b1=g(()=>{"use strict";a();H();Ts=x("MessageDisplayCompact"),xi=x("ShowCurrentGame"),ws=x("PreloadedUserSettingsActionCreators")});var xs,Bu,zo,Ms,_e,wn,_r,cn,HP,ae,E,ho,Ie,yo,ee,Ge,it,jo,Is,Ps,Be,T1=g(()=>{"use strict";a();H();_u();xs=x("connectStores"),Bu=(i=>(i[i.ChannelMessage=0]="ChannelMessage",i[i.ThreadSettings=1]="ThreadSettings",i[i.FirstThreadMessage=2]="FirstThreadMessage",i[i.ApplicationLauncherCommand=3]="ApplicationLauncherCommand",i))(Bu||{}),Ms=x("openPrivateChannel"),{useStateFromStores:Be}=x("useStateFromStores");$t("DraftStore",e=>Ps=e);$t("UserStore",e=>E=e);$t("UserProfileStore",e=>ho=e);$t("ChannelStore",e=>ee=e);$t("SelectedChannelStore",e=>Ie=e);$t("SelectedGuildStore",e=>yo=e);$t("GuildStore",e=>ae=e);$t("GuildMemberStore",e=>Ge=e);$t("RelationshipStore",e=>it=e);$t("PermissionStore",e=>_e=e);$t("PresenceStore",e=>cn=e);$t("ReadStateStore",e=>_r=e);$t("GuildChannelStore",e=>wn=e);$t("MessageStore",e=>zo=e);$t("WindowStore",e=>Is=e);$t("EmojiStore",e=>jo=e)});var w1={};var x1=g(()=>{"use strict";a()});var M1={};var I1=g(()=>{"use strict";a()});var P1={};var A1=g(()=>{"use strict";a()});function Mt(e,t=C1.MESSAGE){X.show({id:X.genId(),message:e,type:t})}var B,Wo,_t,Fu,Br,Fr,Ye,un,Pe,et,C1,zP,X,Bt,As,Ur,Ft,qo,$r,me,Gr,jP,Uu,ao,$u,Gu,Gt,R1=g(()=>{"use strict";a();H();gt(["dispatch","subscribe"],e=>{B=e;let t=()=>{e.unsubscribe("CONNECTION_OPEN",t),Ja()};e.subscribe("CONNECTION_OPEN",t)});gt(["ComponentDispatch","ComponentDispatcher"],e=>Wo=e.ComponentDispatch);_t=go(()=>{let e=Lr("getAPIBaseURL");return e.HTTP??e}),Fu=x("parseTwoDigitYear"),Br=x("highlight","registerLanguage"),Fr=x("debounce","cloneDeep"),Ye=so(e=>e.Messages?.["en-US"]);gt(["fromTimestamp","extractTimestamp"],e=>un=e);gt("parseTopic",e=>Pe=e);gt(["show","close"],e=>et=e);C1={MESSAGE:0,SUCCESS:1,FAILURE:2,CUSTOM:3},zP={TOP:0,BOTTOM:1},X={Type:C1,Position:zP,genId:()=>(Math.random()||Math.random()).toString(36).slice(2)};gt("showToast",e=>{X.show=e.showToast,X.pop=e.popToast});Bt=x("getUser","fetchCurrentUser"),As=x("showUploadFileSizeExceededError","promptToUpload"),Ur=x("fetchAssetIds","getAssetImage"),Ft=x("SUPPORTS_COPY","copy"),qo=x("transitionTo","replaceWith","transitionToGuild");gt(["open","saveAccountChanges"],e=>$r=e);({Permissions:me}=so(e=>typeof e.Permissions?.ADMINISTRATOR=="bigint")),Gr=Go("will be removed in v4"),jP=Ce.byCode("[zustand persist middleware]"),{persist:Uu}=so(e=>e.persist&&jP(e.persist)),ao=x("editMessage","sendMessage"),$u=x("openUserProfileModal","closeUserProfileModal"),Gu=x("resolveInvite"),Gt=x("getGuildBannerURL","getUserAvatarURL")});var Hu={};qe(Hu,{Alerts:()=>et,ApplicationAssetUtils:()=>Ur,Avatar:()=>Ti,Button:()=>k,ButtonLooks:()=>sl,ButtonWrapperClasses:()=>ol,Card:()=>Tt,ChannelStore:()=>ee,Clickable:()=>bi,Clipboard:()=>Ft,ComponentDispatch:()=>Wo,ComponentTypes:()=>w1,ContextMenuApi:()=>Yt,Dialog:()=>h1,DraftStore:()=>Ps,DraftType:()=>Bu,EmojiStore:()=>jo,Flex:()=>GP,Flux:()=>xs,FluxDispatcher:()=>B,FocusLock:()=>ll,Forms:()=>S,GuildChannelStore:()=>wn,GuildMemberStore:()=>Ge,GuildStore:()=>ae,IconUtils:()=>Gt,InviteActions:()=>Gu,MaskedLink:()=>Vn,Menu:()=>L,MenuTypes:()=>M1,MessageActions:()=>ao,MessageStore:()=>zo,ModalImageClasses:()=>tl,NavigationRouter:()=>qo,OAuth2AuthorizeModal:()=>bs,Paginator:()=>al,Parser:()=>Pe,PermissionStore:()=>_e,PermissionsBits:()=>me,PoggerModeSettingsStore:()=>HP,Popout:()=>vs,PresenceStore:()=>cn,PrivateChannelsStore:()=>Ms,React:()=>U,ReactDOM:()=>Or,ReadStateStore:()=>_r,RelationshipStore:()=>it,RestAPI:()=>_t,ScrollerThin:()=>Si,SearchableSelect:()=>il,Select:()=>Io,SelectedChannelStore:()=>Ie,SelectedGuildStore:()=>yo,SettingsRouter:()=>$r,Slider:()=>Er,SnowflakeUtils:()=>un,StatusSettingsStores:()=>xi,Switch:()=>wt,TabBar:()=>Ho,Text:()=>V,TextAndImagesSettingsStores:()=>Ts,TextArea:()=>rl,TextInput:()=>Je,Timestamp:()=>Po,Toasts:()=>X,Tooltip:()=>ne,UploadHandler:()=>As,UserProfileActions:()=>$u,UserProfileStore:()=>ho,UserSettingsActionCreators:()=>ws,UserStore:()=>E,UserUtils:()=>Bt,UtilTypes:()=>P1,WindowStore:()=>Is,hljs:()=>Br,i18n:()=>Ye,lodash:()=>Fr,moment:()=>Fu,showToast:()=>Mt,useCallback:()=>cl,useEffect:()=>se,useMemo:()=>Rt,useReducer:()=>wi,useRef:()=>xt,useState:()=>W,useStateFromStores:()=>Be,useToken:()=>Ss,zustandCreate:()=>Gr,zustandPersist:()=>Uu});var T=g(()=>{"use strict";a();g1();y1();v1();S1();b1();T1();x1();I1();A1();R1()});var pn,WP,ul,m,Mi,P=g(()=>{"use strict";a();pn="webpackChunkdiscord_app",WP="Vencord.Webpack.Common.React",ul="1026515880080842772",m=Object.freeze({Nobody:{name:"Nobody",id:0n},Ven:{name:"Vendicated",id:343383572805058560n},Arjix:{name:"ArjixWasTaken",id:674710789138939916n},Cyn:{name:"Cynosphere",id:150745989836308480n},Trwy:{name:"trey",id:354427199023218689n},Megu:{name:"Megumin",id:545581357812678656n},botato:{name:"botato",id:440990343899643943n},fawn:{name:"fawn",id:336678828233588736n},rushii:{name:"rushii",id:295190422244950017n},Glitch:{name:"Glitchy",id:269567451199569920n},Samu:{name:"Samu",id:702973430449832038n},Nyako:{name:"nyako",id:118437263754395652n},MaiKokain:{name:"Mai",id:722647978577363026n},echo:{name:"ECHO",id:712639419785412668n},katlyn:{name:"katlyn",id:250322741406859265n},nea:{name:"nea",id:310702108997320705n},Nuckyz:{name:"Nuckyz",id:235834946571337729n},D3SOX:{name:"D3SOX",id:201052085641281538n},Nickyux:{name:"Nickyux",id:427146305651998721n},mantikafasi:{name:"mantikafasi",id:287555395151593473n},Xinto:{name:"Xinto",id:423915768191647755n},JacobTm:{name:"Jacob.Tm",id:302872992097107991n},DustyAngel47:{name:"DustyAngel47",id:714583473804935238n},BanTheNons:{name:"BanTheNons",id:460478012794863637n},BigDuck:{name:"BigDuck",id:1024588272623681609n},AverageReactEnjoyer:{name:"Average React Enjoyer",id:1004904120056029256n},adryd:{name:"adryd",id:0n},Tyman:{name:"Tyman",id:487443883127472129n},afn:{name:"afn",id:420043923822608384n},KraXen72:{name:"KraXen72",id:379304073515499530n},kemo:{name:"kemo",id:299693897859465228n},dzshn:{name:"dzshn",id:310449948011528192n},Ducko:{name:"Ducko",id:506482395269169153n},jewdev:{name:"jewdev",id:222369866529636353n},Luna:{name:"Luny",id:821472922140803112n},Vap:{name:"Vap0r1ze",id:454072114492866560n},KingFish:{name:"King Fish",id:499400512559382538n},Commandtechno:{name:"Commandtechno",id:296776625432035328n},TheSun:{name:"ActuallyTheSun",id:406028027768733696n},axyie:{name:"'ax",id:273562710745284628n},pointy:{name:"pointy",id:99914384989519872n},SammCheese:{name:"Samm-Cheese",id:372148345894076416n},zt:{name:"zt",id:289556910426816513n},captain:{name:"Captain",id:347366054806159360n},nick:{name:"nick",id:347884694408265729n,badge:!1},whqwert:{name:"whqwert",id:586239091520176128n},lewisakura:{name:"lewisakura",id:96269247411400704n},RuiNtD:{name:"RuiNtD",id:157917665162297344n},hunt:{name:"hunt-g",id:222800179697287168n},cloudburst:{name:"cloudburst",id:892128204150685769n},Aria:{name:"Syncxv",id:549244932213309442n},TheKodeToad:{name:"TheKodeToad",id:706152404072267788n},LordElias:{name:"LordElias",id:319460781567639554n},juby:{name:"Juby210",id:324622488644616195n},Alyxia:{name:"Alyxia Sother",id:952185386350829688n},Remty:{name:"Remty",id:335055032204656642n},skyevg:{name:"skyevg",id:1090310844283363348n},Dziurwa:{name:"Dziurwa",id:1001086404203389018n},F53:{name:"F53",id:280411966126948353n},AutumnVN:{name:"AutumnVN",id:393694671383166998n},pylix:{name:"pylix",id:492949202121261067n},Tyler:{name:"\\\\GGTyler\\\\",id:143117463788191746n},RyanCaoDev:{name:"RyanCaoDev",id:952235800110694471n},FieryFlames:{name:"Fiery",id:890228870559698955n},KannaDev:{name:"Kanna",id:317728561106518019n},carince:{name:"carince",id:818323528755314698n},PandaNinjas:{name:"PandaNinjas",id:455128749071925248n},CatNoir:{name:"CatNoir",id:260371016348336128n},outfoxxed:{name:"outfoxxed",id:837425748435796060n},UwUDev:{name:"UwU",id:691413039156690994n},amia:{name:"amia",id:142007603549962240n},phil:{name:"phil",id:305288513941667851n},ImLvna:{name:"Luna <3",id:799319081723232267n},rad:{name:"rad",id:610945092504780823n},AndrewDLO:{name:"Andrew-DLO",id:434135504792059917n},HypedDomi:{name:"HypedDomi",id:354191516979429376n},Rini:{name:"Rini",id:1079479184478441643n},castdrian:{name:"castdrian",id:224617799434108928n},Arrow:{name:"arrow",id:958158495302176778n},bb010g:{name:"bb010g",id:72791153467990016n},Dolfies:{name:"Dolfies",id:852892297661906993n},RuukuLada:{name:"RuukuLada",id:119705748346241027n},blahajZip:{name:"blahaj.zip",id:683954422241427471n},archeruwu:{name:"archer_uwu",id:160068695383736320n},ProffDea:{name:"ProffDea",id:609329952180928513n},ant0n:{name:"ant0n",id:145224646868860928n},philipbry:{name:"philipbry",id:554994003318276106n},Korbo:{name:"Korbo",id:455856406420258827n},maisymoe:{name:"maisy",id:257109471589957632n},Mopi:{name:"Mopi",id:1022189106614243350n},Grzesiek11:{name:"Grzesiek11",id:368475654662127616n},Samwich:{name:"Samwich",id:976176454511509554n},coolelectronics:{name:"coolelectronics",id:696392247205298207n},Av32000:{name:"Av32000",id:593436735380127770n},Kyuuhachi:{name:"Kyuuhachi",id:236588665420251137n},Elvyra:{name:"Elvyra",id:708275751816003615n},Inbestigator:{name:"Inbestigator",id:761777382041714690n},newwares:{name:"newwares",id:421405303951851520n}}),Mi=(()=>Object.freeze(Object.fromEntries(Object.entries(m).filter(e=>e[1].id!==0n).map(([e,t])=>[t.id,t]))))()});function Ii(e,t){for(let o in t){let r=t[o];typeof r=="object"&&!Array.isArray(r)?(e[o]??={},Ii(e[o],r)):e[o]??=r}return e}function Q(...e){return e.filter(Boolean).join(" ")}function Ko(e){return new Promise(t=>setTimeout(t,e))}function Ao(e,t="Copied to clipboard!"){Ft.SUPPORTS_COPY?Ft.copy(e):t="Your browser does not support copying to clipboard",X.show({message:t,id:X.genId(),type:X.Type.SUCCESS})}function qP(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Cs(e){for(let t in e)if(Object.hasOwn(e,t))return!1;return!0}function zu(e){try{return new URL(e)}catch{return null}}function Rs(e){return e}var ju,KP,ks,we=g(()=>{"use strict";a();T();P();ju=e=>{let t=e.getBoundingClientRect(),o=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(t.bottom<0||t.top-o>=0)};KP=navigator.userAgent.includes("Mobi"),ks=e=>Object.hasOwn(Mi,e)});function st(e,t){let o=Object.assign({fallbackValue:null,deps:[],onError:null},t),[r,i]=W({value:o.fallbackValue,error:null,pending:!0});return se(()=>{let s=!0;return r.pending||i({...r,pending:!0}),e().then(l=>{!s||(i({value:l,error:null,pending:!1}),o.onSuccess?.(l))}).catch(l=>{!s||(i({value:null,error:l,pending:!1}),o.onError?.(l))}),()=>void(s=!1)},o.deps),[r.value,r.error,r.pending]}function Co(e){let t=wi(o=>o+1,0);return e?t:t[1]}function Ns({interval:e=1e3,deps:t=[]}){let[o,r]=W(0),i=Rt(()=>Date.now(),t);return se(()=>{let s=setInterval(()=>r(Date.now()-i),e);return()=>{r(0),clearInterval(s)}},t),o}var YP,Wu,lt=g(()=>{"use strict";a();T();we();Cu();YP=()=>null,Wu=(e=!1)=>{let t=U.useRef(null),[o,r]=W(!1);return[s=>{t.current?.disconnect(),t.current=null,s&&(ju(s)&&(r(!0),e)||(t.current=new IntersectionObserver(l=>{for(let c of l)c.target===s&&(c.isIntersecting&&e?(r(!0),t.current?.disconnect(),t.current=null):r(c.isIntersecting))}),t.current.observe(s)))},o]}});var k1=g(()=>{});function Ro(e){return n("div",{...e,className:Q(e.className,"vc-error-card")},e.children)}var Pi=g(()=>{"use strict";a();k1();we()});var ZP,N1,D1,qu,_,le=g(()=>{"use strict";a();Ke();ot();lt();T();Pi();ZP="#e78284",N1=new oe("React ErrorBoundary",ZP),D1={},qu=bt(()=>class extends U.PureComponent{state={error:D1,stack:"",message:""};static getDerivedStateFromError(t){let o=t?.stack??"",r=t?.message||String(t);if(t instanceof Error&&o){let i=o.indexOf(` -`);i!==-1&&(r=o.slice(0,i),o=o.slice(i+1).replace(/https:\/\/\S+\/assets\//g,""))}return{error:t,stack:o,message:r}}componentDidCatch(t,o){this.props.onError?.({error:t,errorInfo:o,props:this.props.wrappedProps}),N1.error(`A component threw an Error -`,t),N1.error("Component Stack",o.componentStack)}render(){if(this.state.error===D1)return this.props.children;if(this.props.noop)return null;if(this.props.fallback)return n(this.props.fallback,{children:this.props.children,...this.state});let t=this.props.message||"An error occurred while rendering this Component. More info can be found below and in your console.";return n(Ro,{style:{overflow:"hidden"}},n("h1",null,"Oh no!"),n("p",null,t),n("code",null,this.state.message,!!this.state.stack&&n("pre",{className:j.top8},this.state.stack)))}});qu.wrap=(e,t)=>o=>n(qu,{...t,wrappedProps:o},n(e,{...o}));_=qu});function pl(){return n("svg",{"aria-hidden":"true",height:"16",viewBox:"0 0 16 16",width:"16",style:{marginRight:"0.5em",transform:"translateY(2px)"}},n("path",{fill:"#db61a2","fill-rule":"evenodd",d:"M4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.565 20.565 0 008 13.393a20.561 20.561 0 003.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.75.75 0 01-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5zM8 14.25l-.345.666-.002-.001-.006-.003-.018-.01a7.643 7.643 0 01-.31-.17 22.075 22.075 0 01-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.08 22.08 0 01-3.744 2.584l-.018.01-.006.003h-.002L8 14.25zm0 0l.345.666a.752.752 0 01-.69 0L8 14.25z"}))}var Ku=g(()=>{"use strict";a()});function Ds(e){return n(k,{...e,look:k.Looks.LINK,color:k.Colors.TRANSPARENT,onClick:()=>VencordNative.native.openExternal("https://github.com/sponsors/Vendicated")},n(pl,null),"Donate")}var Yu=g(()=>{"use strict";a();T();Ku()});function fe(e){return e.style??={},e.style.display="flex",e.style.gap??="1em",e.style.flexDirection||=e.flexDirection,delete e.flexDirection,n("div",{...e},e.children)}var Ut=g(()=>{"use strict";a()});function Hr(e,t){return dl.openModalLazy(e,t)}function de(e,t,o){return dl.openModal(e,t,o)}function xn(e,t){return dl.closeModal(e,t)}function dn(){return dl.closeAllModals()}var ko,Yo,Zu,ye,Le,ke,ct,pt,dl,Ze=g(()=>{"use strict";a();H();lt();ko=(i=>(i.SMALL="small",i.MEDIUM="medium",i.LARGE="large",i.DYNAMIC="dynamic",i))(ko||{}),Yo=x("ModalRoot","ModalCloseButton"),Zu=Tn("ImageModal"),ye=bt(()=>Yo.ModalRoot),Le=bt(()=>Yo.ModalHeader),ke=bt(()=>Yo.ModalContent),ct=bt(()=>Yo.ModalFooter),pt=bt(()=>Yo.ModalCloseButton),dl=x("openModalLazy")});function y(e){return e}var I=g(()=>{"use strict";a()});async function L1(e=!1){Xu={};let t={};e&&(t.cache="no-cache"),Xu=await fetch("https://badges.vencord.dev/badges.json",t).then(o=>o.json())}var XP,JP,Xu,Ju,E1=g(()=>{"use strict";a();fl();Yu();le();Ut();Ku();P();ot();we();Ze();I();T();XP="https://vencord.dev/assets/favicon.png",JP={description:"Vencord Contributor",image:XP,position:0,props:{style:{borderRadius:"50%",transform:"scale(0.9)"}},shouldShow:({user:e})=>ks(e.id),link:"https://github.com/Vendicated/Vencord"},Xu={};Ju=y({name:"BadgeAPI",description:"API to add badges to users.",authors:[m.Megu,m.Ven,m.TheSun],required:!0,patches:[{find:"Messages.PROFILE_USER_BADGES,role:",replacement:[{match:/&&(\i)\.push\(\{id:"premium".+?\}\);/,replace:"$&$1.unshift(...Vencord.Api.Badges._getBadges(arguments[0]));"},{match:/alt:" ","aria-hidden":!0,src:(?=(\i)\.src)/,replace:"...$1.props,$& $1.image??"},{match:/(?<=text:(\i)\.description,spacing:12,)children:/,replace:"children:$1.component ? () => $self.renderBadgeComponent($1) :"},{match:/href:(\i)\.link/,replace:"...($1.onClick && { onClick: $1.onClick }),$&"}]}],toolboxActions:{async"Refetch Badges"(){await L1(!0),X.show({id:X.genId(),message:"Successfully refetched badges!",type:X.Type.SUCCESS})}},async start(){Vencord.Api.Badges.addBadge(JP),await L1()},renderBadgeComponent:_.wrap(e=>{let t=e.component;return n(t,{...e})},{noop:!0}),getDonorBadges(e){return Xu[e]?.map(t=>({image:t.badge,description:t.tooltip,position:0,props:{style:{borderRadius:"50%",transform:"scale(0.9)"}},onClick(){let o=de(r=>n(_,{noop:!0,onError:()=>{xn(o),VencordNative.native.openExternal("https://github.com/sponsors/Vendicated")}},n(Yo.ModalRoot,{...r},n(Yo.ModalHeader,null,n(fe,{style:{width:"100%",justifyContent:"center"}},n(S.FormTitle,{tag:"h2",style:{width:"100%",textAlign:"center",margin:0}},n(pl,null),"Vencord Donor"))),n(Yo.ModalContent,null,n(fe,null,n("img",{role:"presentation",src:"https://cdn.discordapp.com/emojis/1026533070955872337.png",alt:"",style:{margin:"auto"}}),n("img",{role:"presentation",src:"https://cdn.discordapp.com/emojis/1026533090627174460.png",alt:"",style:{margin:"auto"}})),n("div",{style:{padding:"1em"}},n(S.FormText,null,"This Badge is a special perk for Vencord Donors"),n(S.FormText,{className:j.top20},"Please consider supporting the development of Vencord by becoming a donor. It would mean a lot!!"))),n(Yo.ModalFooter,null,n(fe,{style:{width:"100%",justifyContent:"center"}},n(Ds,null))))))}}))}})});var Qu,O1=g(()=>{"use strict";a();P();I();Qu=y({name:"ChatInputButtonAPI",description:"API to add buttons to the chat input",authors:[m.Ven],patches:[{find:'location:"ChannelTextAreaButtons"',replacement:{match:/if\(!\i\.isMobile\)\{(?=.+?&&(\i)\.push\(.{0,50}"gift")/,replace:"$&Vencord.Api.ChatButtons._injectButtons($1,arguments[0]);"}}]})});var Vu,_1=g(()=>{"use strict";a();P();I();Vu=y({name:"CommandsAPI",authors:[m.Arjix],description:"Api required by anything that uses commands",patches:[{find:',"tenor"',replacement:[{match:/(?<=\w=)(\w)(\.filter\(.{0,60}tenor)/,replace:"Vencord.Api.Commands._init($1)$2"}]},{find:"Unexpected value for option",replacement:{match:/,(\i)\.execute\((\i),(\i)\)/,replace:(e,t,o,r)=>`,Vencord.Api.Commands._handleCommand(${t}, ${o}, ${r})`}},{find:".source,children",replacement:{match:/(?<=:(.{1,3})\.displayDescription\}.{0,200}\.source,children:)[^}]+/,replace:"$1.plugin||($&)"}}]})});var ep,B1=g(()=>{"use strict";a();P();I();ep=y({name:"ContextMenuAPI",description:"API for adding/removing items to/from context menus.",authors:[m.Nuckyz,m.Ven,m.Kyuuhachi],required:!0,patches:[{find:"\u266B (\u3064\uFF61\u25D5\u203F\u203F\u25D5\uFF61)\u3064 \u266A",replacement:{match:/(?=let{navId:)(?<=function \i\((\i)\).+?)/,replace:"$1=Vencord.Api.ContextMenu._usePatchContextMenu($1);"}},{find:".Menu,{",all:!0,replacement:{match:/Menu,{(?<=\.jsxs?\)\(\i\.Menu,{)/g,replace:"$&contextMenuApiArguments:typeof arguments!=='undefined'?arguments:[],"}}]})});var tp,F1=g(()=>{"use strict";a();P();I();tp=y({name:"MemberListDecoratorsAPI",description:"API to add decorators to member list (both in servers and DMs)",authors:[m.TheSun,m.Ven],patches:[{find:".lostPermission)",replacement:[{match:/let\{[^}]*lostPermissionTooltipText:\i[^}]*\}=(\i),/,replace:"$&vencordProps=$1,"},{match:/decorators:.{0,100}?children:\[/,replace:"$&...(typeof vencordProps=='undefined'?[]:Vencord.Api.MemberListDecorators.__getDecorators(vencordProps)),"}]},{find:"PrivateChannel.renderAvatar",replacement:{match:/decorators:(\i\.isSystemDM\(\))\?(.+?):null/,replace:"decorators:[...Vencord.Api.MemberListDecorators.__getDecorators(arguments[0]), $1?$2:null]"}}]})});var op,U1=g(()=>{"use strict";a();P();I();op=y({name:"MessageAccessoriesAPI",description:"API to add message accessories.",authors:[m.Cyn],patches:[{find:".Messages.REMOVE_ATTACHMENT_BODY",replacement:{match:/(?<=.container\)?,children:)(\[.+?\])/,replace:"Vencord.Api.MessageAccessories._modifyAccessories($1,this.props)"}}]})});var np,$1=g(()=>{"use strict";a();P();I();np=y({name:"MessageDecorationsAPI",description:"API to add decorations to messages",authors:[m.TheSun],patches:[{find:'"Message Username"',replacement:{match:/\.Messages\.GUILD_COMMUNICATION_DISABLED_BOTTOM_SHEET_TITLE.+?}\),\i(?=\])/,replace:"$&,...Vencord.Api.MessageDecorations.__addDecorationsToMessage(arguments[0])"}}]})});var rp,G1=g(()=>{"use strict";a();P();I();rp=y({name:"MessageEventsAPI",description:"Api required by anything using message events.",authors:[m.Arjix,m.hunt,m.Ven],patches:[{find:".Messages.EDIT_TEXTAREA_HELP",replacement:{match:/(?<=,channel:\i\}\)\.then\().+?(?=return \i\.content!==this\.props\.message\.content&&\i\((.+?)\))/,replace:(e,t)=>`async ${e}if(await Vencord.Api.MessageEvents._handlePreEdit(${t}))return Promise.resolve({shoudClear:true,shouldRefocus:true});`}},{find:".handleSendMessage=",replacement:{match:/(type:this\.props\.chatInputType.+?\.then\()(\i=>\{.+?let (\i)=\i\.\i\.parse\((\i),.+?let (\i)=\i\.\i\.getSendMessageOptionsForReply\(\i\);)(?<=\)\(({.+?})\)\.then.+?)/,replace:(e,t,o,r,i,s,l)=>`${t}async ${o}if(await Vencord.Api.MessageEvents._handlePreSend(${i}.id,${r},${l},${s}))return{shoudClear:true,shouldRefocus:true};`}},{find:'("interactionUsernameProfile',replacement:{match:/let\{id:\i}=(\i),{id:\i}=(\i);return \i\.useCallback\((\i)=>\{/,replace:(e,t,o,r)=>`const vcMsg=${t},vcChan=${o};${e}Vencord.Api.MessageEvents._handleClick(vcMsg, vcChan, ${r});`}}]})});var ip,H1=g(()=>{"use strict";a();P();I();ip=y({name:"MessagePopoverAPI",description:"API to add buttons to message popovers.",authors:[m.KingFish,m.Ven,m.Nuckyz],patches:[{find:"Messages.MESSAGE_UTILITIES_A11Y_LABEL",replacement:{match:/\i&&!\i\?\(0,\i\.jsxs?\)\(.{0,200}renderEmojiPicker:.{0,500}\?(\i)\(\{key:"reply-other"/,replace:(e,t)=>{let o=e.match(/message:(.{1,3}),/)?.[1];if(!o)throw new Error("Could not find message variable");return`...Vencord.Api.MessagePopover._buildPopoverElements(${o},${t}),${e}`}}}]})});var sp,z1=g(()=>{"use strict";a();P();I();sp=y({name:"NoticesAPI",description:"Fixes notices being automatically dismissed",authors:[m.Ven],required:!0,patches:[{find:'displayName="NoticeStore"',replacement:[{match:/\i=null;(?=.{0,80}getPremiumSubscription\(\))/g,replace:"if(Vencord.Api.Notices.currentNotice)return false;$&"},{match:/(?<=,NOTICE_DISMISS:function\(\i\){)return null!=(\i)/,replace:'if($1.id=="VencordNotice")return($1=null,Vencord.Api.Notices.nextNotice(),true);$&'}]}]})});var ap,j1=g(()=>{"use strict";a();P();I();ap=y({name:"ServerListAPI",authors:[m.kemo],description:"Api required for plugins that modify the server list",patches:[{find:"Messages.DISCODO_DISABLED",replacement:{match:/(?<=Messages\.DISCODO_DISABLED.+?return)(\(.{0,75}?tutorialContainer.+?}\))(?=}function)/,replace:"[$1].concat(Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.Above))"}},{find:"Messages.SERVERS,children",replacement:{match:/(?<=Messages\.SERVERS,children:).+?default:return null\}\}\)/,replace:"Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.In).concat($&)"}}]})});var lp,W1=g(()=>{"use strict";a();P();I();lp=y({name:"NoTrack",description:"Disable Discord's tracking ('science'), metrics and Sentry crash reporting",authors:[m.Cyn,m.Ven,m.Nuckyz,m.Arrow],required:!0,patches:[{find:"AnalyticsActionHandlers.handle",replacement:{match:/^.+$/,replace:"()=>{}"}},{find:"window.DiscordSentry=",replacement:{match:/^.+$/,replace:"()=>{}"}},{find:".METRICS,",replacement:[{match:/this\._intervalId=/,replace:"this._intervalId=undefined&&"},{match:/(increment\(\i\){)/,replace:"$1return;"}]},{find:".installedLogHooks)",replacement:{match:"getDebugLogging(){",replace:"getDebugLogging(){return false;"}}]})});function lo(e,t=300){let o;return function(...r){clearTimeout(o),o=setTimeout(()=>{e(...r)},t)}}var zr=g(()=>{"use strict";a()});var gl,q1=g(()=>{"use strict";a();gl=class{pathListeners=new Map;globalListeners=new Set;constructor(t,o={}){this.plain=t,this.store=this.makeProxy(t),Object.assign(this,o)}makeProxy(t,o=t,r=""){let i=this;return new Proxy(t,{get(s,l){let c=s[l];return!(l in s)&&i.getDefaultValue&&(c=i.getDefaultValue({target:s,key:l,root:o,path:r})),typeof c=="object"&&c!==null&&!Array.isArray(c)?i.makeProxy(c,o,`${r}${r&&"."}${l}`):c},set(s,l,c){if(s[l]===c)return!0;Reflect.set(s,l,c);let u=`${r}${r&&"."}${l}`;return i.globalListeners.forEach(p=>p(c,u)),i.pathListeners.get(u)?.forEach(p=>p(c)),!0}})}setData(t,o){if(this.readOnly)throw new Error("SettingsStore is read-only");if(this.plain=t,this.store=this.makeProxy(t),o){let r=t,i=o.split(".");for(let s of i){if(!r){console.warn(`Settings#setData: Path ${o} does not exist in new data. Not dispatching update`);return}r=r[s]}this.pathListeners.get(o)?.forEach(s=>s(r))}this.markAsChanged()}addGlobalChangeListener(t){this.globalListeners.add(t)}addChangeListener(t,o){let r=this.pathListeners.get(t)??new Set;r.add(o),this.pathListeners.set(t,r)}removeGlobalChangeListener(t){this.globalListeners.delete(t)}removeChangeListener(t,o){let r=this.pathListeners.get(t);!r||(r.delete(o),r.size||this.pathListeners.delete(t))}markAsChanged(){this.globalListeners.forEach(t=>t(this.plain,""))}}});var jr,hl=g(()=>{"use strict";a();({localStorage:jr}=window)});var vo,Wr=g(()=>{"use strict";a();vo=class{constructor(t=1/0){this.maxSize=t}queue=[];promise;next(){let t=this.queue.shift();t?this.promise=Promise.resolve().then(t).finally(()=>this.next()):this.promise=void 0}run(){this.promise||this.next()}push(t){this.size>=this.maxSize&&this.queue.shift(),this.queue.push(t),this.run()}unshift(t){this.size>=this.maxSize&&this.queue.pop(),this.queue.unshift(t),this.run()}get size(){return this.queue.length}}});var K1=g(()=>{});var yl,cp=g(()=>{"use strict";a();K1();$();le();we();T();yl=_.wrap(function({title:t,body:o,richBody:r,color:i,icon:s,onClick:l,onClose:c,image:u,permanent:p,className:d,dismissOnClick:h}){let{timeout:v,position:b}=St(["notifications.timeout","notifications.position"]).notifications,M=Be([Is],()=>Is.isFocused()),[w,C]=W(!1),[R,A]=W(0),F=Rt(()=>Date.now(),[v,w,M]);se(()=>{if(w||!M||v===0||p)return void A(0);let Y=setInterval(()=>{let J=Date.now()-F;J>=v?c():A(J)},10);return()=>clearInterval(Y)},[v,w,M]);let z=R/v;return n("button",{className:Q("vc-notification-root",d),style:b==="bottom-right"?{bottom:"1rem"}:{top:"3rem"},onClick:()=>{l?.(),h!==!1&&c()},onContextMenu:Y=>{Y.preventDefault(),Y.stopPropagation(),c()},onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1)},n("div",{className:"vc-notification"},s&&n("img",{className:"vc-notification-icon",src:s,alt:""}),n("div",{className:"vc-notification-content"},n("div",{className:"vc-notification-header"},n("h2",{className:"vc-notification-title"},t),n("button",{className:"vc-notification-close-btn",onClick:Y=>{Y.preventDefault(),Y.stopPropagation(),c()}},n("svg",{width:"24",height:"24",viewBox:"0 0 24 24",role:"img","aria-labelledby":"vc-notification-dismiss-title"},n("title",{id:"vc-notification-dismiss-title"},"Dismiss Notification"),n("path",{fill:"currentColor",d:"M18.4 4L12 10.4L5.6 4L4 5.6L10.4 12L4 18.4L5.6 20L12 13.6L18.4 20L20 18.4L13.6 12L20 5.6L18.4 4Z"})))),n("div",null,r??n("p",{className:"vc-notification-p"},o)))),u&&n("img",{className:"vc-notification-img",src:u,alt:""}),v!==0&&!p&&n("div",{className:"vc-notification-progressbar",style:{width:`${(1-z)*100}%`,backgroundColor:i||"var(--brand-experiment)"}}))},{onError:({props:e})=>e.onClose()})});var mn={};qe(mn,{clear:()=>tA,createStore:()=>Y1,del:()=>pp,delMany:()=>eA,entries:()=>rA,get:()=>dt,getMany:()=>VP,keys:()=>oA,promisifyRequest:()=>Zt,set:()=>kt,setMany:()=>QP,update:()=>qr,values:()=>nA});function Zt(e){return new Promise((t,o)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>o(e.error)})}function Y1(e,t){let o=indexedDB.open(e);o.onupgradeneeded=()=>o.result.createObjectStore(t);let r=Zt(o);return(i,s)=>r.then(l=>s(l.transaction(t,i).objectStore(t)))}function Zo(){return up||(up=Y1("VencordData","VencordStore")),up}function dt(e,t=Zo()){return t("readonly",o=>Zt(o.get(e)))}function kt(e,t,o=Zo()){return o("readwrite",r=>(r.put(t,e),Zt(r.transaction)))}function QP(e,t=Zo()){return t("readwrite",o=>(e.forEach(r=>o.put(r[1],r[0])),Zt(o.transaction)))}function VP(e,t=Zo()){return t("readonly",o=>Promise.all(e.map(r=>Zt(o.get(r)))))}function qr(e,t,o=Zo()){return o("readwrite",r=>new Promise((i,s)=>{r.get(e).onsuccess=function(){try{r.put(t(this.result),e),i(Zt(r.transaction))}catch(l){s(l)}}}))}function pp(e,t=Zo()){return t("readwrite",o=>(o.delete(e),Zt(o.transaction)))}function eA(e,t=Zo()){return t("readwrite",o=>(e.forEach(r=>o.delete(r)),Zt(o.transaction)))}function tA(e=Zo()){return e("readwrite",t=>(t.clear(),Zt(t.transaction)))}function dp(e,t){return e.openCursor().onsuccess=function(){!this.result||(t(this.result),this.result.continue())},Zt(e.transaction)}function oA(e=Zo()){return e("readonly",t=>{if(t.getAllKeys)return Zt(t.getAllKeys());let o=[];return dp(t,r=>o.push(r.key)).then(()=>o)})}function nA(e=Zo()){return e("readonly",t=>{if(t.getAll)return Zt(t.getAll());let o=[];return dp(t,r=>o.push(r.value)).then(()=>o)})}function rA(e=Zo()){return e("readonly",t=>{if(t.getAll&&t.getAllKeys)return Promise.all([Zt(t.getAllKeys()),Zt(t.getAll())]).then(([r,i])=>r.map((s,l)=>[s,i[l]]));let o=[];return e("readonly",r=>dp(r,i=>o.push([i.key,i.value])).then(()=>o))})}var up,Xo=g(()=>{"use strict";a();});var gp={};qe(gp,{classNameFactory:()=>ve,classNameToSelector:()=>X1,compileStyle:()=>fp,disableStyle:()=>Xt,enableStyle:()=>Nt,isStyleEnabled:()=>mp,requireStyle:()=>Ls,setStyleClassNames:()=>sA,styleMap:()=>Z1,toggleStyle:()=>iA});function Ls(e){let t=Z1.get(e);if(!t)throw new Error(`Style "${e}" does not exist`);return t}function Nt(e){let t=Ls(e);return t.dom?.isConnected?!1:(t.dom||(t.dom=document.createElement("style"),t.dom.dataset.vencordName=t.name),fp(t),document.head.appendChild(t.dom),!0)}function Xt(e){let t=Ls(e);return t.dom?.isConnected?(t.dom.remove(),t.dom=null,!0):!1}var Z1,iA,mp,sA,fp,X1,ve,Qe=g(()=>{"use strict";a();Z1=window.VencordStyles??=new Map;iA=e=>mp(e)?Xt(e):Nt(e),mp=e=>Ls(e).dom?.isConnected??!1,sA=(e,t,o=!0)=>{let r=Ls(e);r.classNames=t,o&&mp(r.name)&&fp(r)},fp=e=>{if(!e.dom)throw new Error("Style has no DOM element");e.dom.textContent=e.source.replace(/\[--(\w+)\]/g,(t,o)=>{let r=e.classNames[o];return r?X1(r):t})},X1=(e,t="")=>e.split(" ").map(o=>`.${t}${o}`).join(""),ve=(e="")=>(...t)=>{let o=new Set;for(let r of t)r&&typeof r=="string"?o.add(r):Array.isArray(r)?r.forEach(i=>o.add(i)):r&&typeof r=="object"&&Object.entries(r).forEach(([i,s])=>s&&o.add(i));return Array.from(o,r=>e+r).join(" ")}});var J1,Q1=g(()=>{a();J1=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,o)=>(o&=63,o<36?t+=o.toString(36):o<62?t+=(o-26).toString(36).toUpperCase():o>62?t+="-":t+="_",t),"")});async function ev(e){if(e.noPersist)return;let t=G.notifications.logLimit;t!==0&&(await qr(vl,o=>{let r=o??[],{onClick:i,onClose:s,richBody:l,permanent:c,noPersist:u,dismissOnClick:p,...d}=e;return r.unshift({...d,timestamp:Date.now(),id:J1()}),r.length>t&&t!==200&&(r.length=t),r}),Es.forEach(o=>o()))}async function aA(e){let t=await V1(),o=t.findIndex(r=>r.timestamp===e);o!==-1&&(t.splice(o,1),await kt(vl,t),Es.forEach(r=>r()))}function lA(){let[e,t]=wi(s=>s+1,0);se(()=>(Es.add(t),()=>void Es.delete(t)),[]);let[o,r,i]=st(V1,{fallbackValue:[],deps:[e]});return[o,i]}function cA({data:e}){let[t,o]=W(!1),r=U.useRef(null);return se(()=>{let i=r.current,s=()=>{if(i.clientHeight===0)return requestAnimationFrame(s);i.style.height=`${i.clientHeight}px`};s()},[]),n("div",{className:Ai("wrapper",{removing:t}),ref:r},n(yl,{...e,permanent:!0,dismissOnClick:!1,onClose:()=>{t||(o(!0),setTimeout(()=>aA(e.timestamp),200))},richBody:n("div",{className:Ai("body")},e.body,n(Po,{timestamp:new Date(e.timestamp),className:Ai("timestamp")}))}))}function uA({log:e,pending:t}){return!e.length&&!t?n("div",{className:Ai("container")},n("div",{className:Ai("empty")}),n(S.FormText,{style:{textAlign:"center"}},"No notifications yet")):n("div",{className:Ai("container")},e.map(o=>n(cA,{data:o,key:o.id})))}function pA({modalProps:e,close:t}){let[o,r]=lA();return n(ye,{...e,size:"large"},n(Le,null,n(V,{variant:"heading-lg/semibold",style:{flexGrow:1}},"Notification Log"),n(pt,{onClick:t})),n(ke,null,n(uA,{log:o,pending:r})),n(ct,null,n(k,{disabled:o.length===0,onClick:()=>{et.show({title:"Are you sure?",body:`This will permanently remove ${o.length} notification${o.length===1?"":"s"}. This action cannot be undone.`,async onConfirm(){await kt(vl,[]),Es.forEach(i=>i())},confirmText:"Do it!",confirmColor:"vc-notification-log-danger-btn",cancelText:"Nevermind"})}},"Clear Notification Log")))}function Sl(){let e=de(t=>n(pA,{modalProps:t,close:()=>xn(e)}))}var vl,V1,Ai,Es,bl=g(()=>{"use strict";a();Xo();$();Qe();Ze();lt();T();Q1();cp();vl="notification-log",V1=async()=>await dt(vl)??[],Ai=ve("vc-notification-log-"),Es=new Set});function fA(){if(!hp){let e=document.createElement("div");e.id="vc-notification-container",document.body.append(e),hp=Or.createRoot(e)}return hp}function gA(e,t){let o=fA();return new Promise(r=>{o.render(n(yl,{key:t,...e,onClose:()=>{e.onClose?.(),o.render(null),r()}}))})}function hA(){if(typeof Notification>"u")return!1;let{useNative:e}=G.notifications;return e==="always"?!0:e==="not-focused"?!document.hasFocus():!1}async function tv(){return Notification.permission==="granted"||Notification.permission!=="denied"&&await Notification.requestPermission()==="granted"}async function Fe(e){if(ev(e),hA()&&await tv()){let{title:t,body:o,icon:r,image:i,onClick:s=null,onClose:l=null}=e,c=new Notification(t,{body:o,icon:r,image:i});c.onclick=s,c.onclose=l}else dA.push(()=>gA(e,mA++))}var dA,hp,mA,ov=g(()=>{"use strict";a();$();Wr();T();cp();bl();dA=new vo,mA=42});var yp={};qe(yp,{requestPermission:()=>tv,showNotification:()=>Fe});var er=g(()=>{"use strict";a();ov()});function pv(e,t){return PA(e,t||{},0,0)}function dv(e,t){return xA(e,t)}var Jt,co,Tl,wl,xl,Tp,sv,av,lv,wp,cv,yA,nv,xp,Mn,He,fn,or,He,He,He,He,Bs,He,vA,SA,bA,TA,vp,Jo,Sp,Pp,uv,wA,tr,xA,In,Os,bp,Mp,rv,_s,Ip,iv,MA,Ap,IA,PA,AA,CA,mv=g(()=>{a();Jt=Uint8Array,co=Uint16Array,Tl=Uint32Array,wl=new Jt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),xl=new Jt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Tp=new Jt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),sv=function(e,t){for(var o=new co(31),r=0;r<31;++r)o[r]=t+=1<>>1|(He&21845)<<1,Mn=(Mn&52428)>>>2|(Mn&13107)<<2,Mn=(Mn&61680)>>>4|(Mn&3855)<<4,xp[He]=((Mn&65280)>>>8|(Mn&255)<<8)>>>1;fn=function(e,t,o){for(var r=e.length,i=0,s=new co(t);i>>u]=p}else for(c=new co(r),i=0;i>>15-e[i]);return c},or=new Jt(288);for(He=0;He<144;++He)or[He]=8;for(He=144;He<256;++He)or[He]=9;for(He=256;He<280;++He)or[He]=7;for(He=280;He<288;++He)or[He]=8;Bs=new Jt(32);for(He=0;He<32;++He)Bs[He]=5;vA=fn(or,9,0),SA=fn(or,9,1),bA=fn(Bs,5,0),TA=fn(Bs,5,1),vp=function(e){for(var t=e[0],o=1;ot&&(t=e[o]);return t},Jo=function(e,t,o){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&o},Sp=function(e,t){var o=t/8|0;return(e[o]|e[o+1]<<8|e[o+2]<<16)>>(t&7)},Pp=function(e){return(e+7)/8|0},uv=function(e,t,o){(t==null||t<0)&&(t=0),(o==null||o>e.length)&&(o=e.length);var r=new(e.BYTES_PER_ELEMENT==2?co:e.BYTES_PER_ELEMENT==4?Tl:Jt)(o-t);return r.set(e.subarray(t,o)),r},wA=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],tr=function(e,t,o){var r=new Error(t||wA[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,tr),!o)throw r;return r},xA=function(e,t,o){var r=e.length;if(!r||o&&o.f&&!o.l)return t||new Jt(0);var i=!t||o,s=!o||o.i;o||(o={}),t||(t=new Jt(r*3));var l=function(Pr){var Yn=t.length;if(Pr>Yn){var Zn=new Jt(Math.max(Yn*2,Pr));Zn.set(t),t=Zn}},c=o.f||0,u=o.p||0,p=o.b||0,d=o.l,h=o.d,v=o.m,b=o.n,M=r*8;do{if(!d){c=Jo(e,u,1);var w=Jo(e,u+1,3);if(u+=3,w)if(w==1)d=SA,h=TA,v=9,b=5;else if(w==2){var F=Jo(e,u,31)+257,z=Jo(e,u+10,15)+4,Y=F+Jo(e,u+5,31)+1;u+=14;for(var J=new Jt(Y),Z=new Jt(19),O=0;O>>4;if(C<16)J[O++]=C;else{var Ue=0,be=0;for(C==16?(be=3+Jo(e,u,3),u+=2,Ue=J[O-1]):C==17?(be=3+Jo(e,u,7),u+=3):C==18&&(be=11+Jo(e,u,127),u+=7);be--;)J[O++]=Ue}}var Me=J.subarray(0,F),De=J.subarray(F);v=vp(Me),b=vp(De),d=fn(Me,v,1),h=fn(De,b,1)}else tr(1);else{var C=Pp(u)+4,R=e[C-4]|e[C-3]<<8,A=C+R;if(A>r){s&&tr(0);break}i&&l(p+R),t.set(e.subarray(C,A),p),o.b=p+=R,o.p=u=A*8,o.f=c;continue}if(u>M){s&&tr(0);break}}i&&l(p+131072);for(var Oe=(1<>>4;if(u+=Ue&15,u>M){s&&tr(0);break}if(Ue||tr(2),At<256)t[p++]=At;else if(At==256){he=u,d=null;break}else{var at=At-254;if(At>264){var O=At-257,$e=wl[O];at=Jo(e,u,(1<<$e)-1)+lv[O],u+=$e}var ro=h[Sp(e,u)&Ae],Lt=ro>>>4;ro||tr(3),u+=ro&15;var De=yA[Lt];if(Lt>3){var $e=xl[Lt];De+=Sp(e,u)&(1<<$e)-1,u+=$e}if(u>M){s&&tr(0);break}i&&l(p+131072);for(var Ct=p+at;p>>8},Os=function(e,t,o){o<<=t&7;var r=t/8|0;e[r]|=o,e[r+1]|=o>>>8,e[r+2]|=o>>>16},bp=function(e,t){for(var o=[],r=0;rv&&(v=s[r].s);var b=new co(v+1),M=Mp(o[d-1],b,0);if(M>t){var r=0,w=0,C=M-t,R=1<t)w+=R-(1<>>=C;w>0;){var F=s[r].s;b[F]=0&&w;--r){var z=s[r].s;b[z]==t&&(--b[z],++w)}M=t}return[new Jt(b),M]},Mp=function(e,t,o){return e.s==-1?Math.max(Mp(e.l,t,o+1),Mp(e.r,t,o+1)):t[e.s]=o},rv=function(e){for(var t=e.length;t&&!e[--t];);for(var o=new co(++t),r=0,i=e[0],s=1,l=function(u){o[r++]=u},c=1;c<=t;++c)if(e[c]==i&&c!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)l(32754);s>2&&(l(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(l(i),--s;s>6;s-=6)l(8304);s>2&&(l(s-3<<5|8208),s=0)}for(;s--;)l(i);s=1,i=e[c]}return[o.subarray(0,r),t]},_s=function(e,t){for(var o=0,r=0;r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var s=0;s4&&!re[Tp[ue-1]];--ue);var Ue=p+5<<3,be=_s(i,or)+_s(s,Bs)+l,Me=_s(i,v)+_s(s,w)+l+14+3*ue+_s(Z,re)+(2*Z[16]+3*Z[17]+7*Z[18]);if(Ue<=be&&Ue<=Me)return Ip(t,d,e.subarray(u,u+p));var De,Oe,Ae,he;if(In(t,d,1+(Me15&&(In(t,d,ro[O]>>>5&127),d+=ro[O]>>>12)}}else De=vA,Oe=or,Ae=bA,he=Bs;for(var O=0;O255){var Lt=r[O]>>>18&31;Os(t,d,De[Lt+257]),d+=Oe[Lt+257],Lt>7&&(In(t,d,r[O]>>>23&31),d+=wl[Lt]);var Ct=r[O]&31;Os(t,d,Ae[Ct]),d+=he[Ct],Ct>3&&(Os(t,d,r[O]>>>5&8191),d+=xl[Ct])}else Os(t,d,De[r[O]]),d+=Oe[r[O]];return Os(t,d,De[256]),d+Oe[256]},MA=new Tl([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ap=new Jt(0),IA=function(e,t,o,r,i,s){var l=e.length,c=new Jt(r+l+5*(1+Math.ceil(l/7e3))+i),u=c.subarray(r,c.length-i),p=0;if(!t||l<8)for(var d=0;d<=l;d+=65535){var h=d+65535;h>=l&&(u[p>>3]=s),p=Ip(u,p+1,e.subarray(d,h))}else{for(var v=MA[t-1],b=v>>>13,M=v&8191,w=(1<7e3||re>24576)&&De>423){p=iv(e,u,0,Y,J,Z,te,re,ue,d-ue,p),re=O=te=0,ue=d;for(var Oe=0;Oe<286;++Oe)J[Oe]=0;for(var Oe=0;Oe<30;++Oe)Z[Oe]=0}var Ae=2,he=0,At=M,at=be-Me&32767;if(De>2&&Ue==z(d-at))for(var $e=Math.min(b,De)-1,ro=Math.min(32767,d),Lt=Math.min(258,De);at<=ro&&--At&&be!=Me;){if(e[d+Ae]==e[d+Ae-at]){for(var Ct=0;CtAe){if(Ae=Ct,he=at,Ct>$e)break;for(var Pr=Math.min(at,Ct-2),Yn=0,Oe=0;OeYn&&(Yn=zt,Me=Zn)}}}be=Me,Me=C[be],at+=be-Me+32768&32767}if(he){Y[re++]=268435456|wp[Ae]<<18|nv[he];var Cr=wp[Ae]&31,D=nv[he]&31;te+=wl[Cr]+xl[D],++J[257+Cr],++Z[D],Se=d+Ae,++O}else Y[re++]=e[d],++J[e[d]]}}p=iv(e,u,s,Y,J,Z,te,re,ue,d-ue,p),!s&&p&7&&(p=Ip(u,p+1,Ap))}return uv(c,0,r+Pp(p)+i)},PA=function(e,t,o,r,i){return IA(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,o,r,!i)};AA=typeof TextDecoder<"u"&&new TextDecoder,CA=0;try{AA.decode(Ap,{stream:!0}),CA=1}catch{}});async function fv(){let e=await dt("Vencord_cloudSecret")??{},t=Cp();return e[t]?(await qr("Vencord_cloudSecret",o=>(o??={},o[`${t}:${Fs()}`]=o[t],delete o[t],o)),e[t]):e[`${t}:${Fs()}`]}async function RA(e){await qr("Vencord_cloudSecret",t=>(t??={},t[`${Cp()}:${Fs()}`]=e,t))}async function Rp(){await qr("Vencord_cloudSecret",e=>(e??={},delete e[`${Cp()}:${Fs()}`],e))}async function gv(){if(await fv()!==void 0){G.cloud.authenticated=!0;return}try{let o=await fetch(new URL("/v1/oauth/settings",nr()));var{clientId:e,redirectUri:t}=await o.json()}catch{Fe({title:"Cloud Integration",body:"Setup failed (couldn't retrieve OAuth configuration)."}),G.cloud.authenticated=!1;return}de(o=>n(bs,{...o,scopes:["identify"],responseType:"code",redirectUri:t,permissions:0n,clientId:e,cancelCompletesFlow:!1,callback:async({location:r})=>{if(!r){G.cloud.authenticated=!1;return}try{let i=await fetch(r,{headers:{Accept:"application/json"}}),{secret:s}=await i.json();s?(Ml.info("Authorized with secret"),await RA(s),Fe({title:"Cloud Integration",body:"Cloud integrations enabled!"}),G.cloud.authenticated=!0):(Fe({title:"Cloud Integration",body:"Setup failed (no secret returned?)."}),G.cloud.authenticated=!1)}catch(i){Ml.error("Failed to authorize",i),Fe({title:"Cloud Integration",body:`Setup failed (${i.toString()}).`}),G.cloud.authenticated=!1}}}))}async function Ci(){let e=await fv();return window.btoa(`${e}:${Fs()}`)}var Ml,nr,Cp,Fs,kp=g(()=>{"use strict";a();Xo();er();$();T();Ke();Ze();Ml=new oe("Cloud","#39b7e0"),nr=()=>new URL(G.cloud.url),Cp=()=>nr().origin,Fs=()=>{let e=E.getCurrentUser()?.id;if(!e)throw new Error("User not yet logged in");return e}});function So(){window.VesktopNative.app.relaunch()}function Il(e){window.VesktopNative.fileManager.showItemInFolder(e)}var rr=g(()=>{"use strict";a()});function Pl(e){let t=document.createElement("a");t.href=URL.createObjectURL(e),t.download=e.name,document.body.appendChild(t),t.click(),setImmediate(()=>{URL.revokeObjectURL(t.href),document.body.removeChild(t)})}function Al(e){return new Promise(t=>{let o=document.createElement("input");o.type="file",o.style.display="none",o.accept=e,o.onchange=async()=>{t(o.files?.[0]??null)},document.body.appendChild(o),o.click(),setImmediate(()=>document.body.removeChild(o))})}var Cl=g(()=>{"use strict";a()});async function hv(e){try{var t=JSON.parse(e)}catch(o){throw console.log(e),new Error("Failed to parse JSON: "+String(o))}if("settings"in t&&"quickCss"in t)Object.assign(Pn,t.settings),await VencordNative.settings.set(t.settings),await VencordNative.quickCss.set(t.quickCss);else throw new Error("Invalid Settings. Is this even a Vencord Settings file?")}async function yv({minify:e}={}){let t=VencordNative.settings.get(),o=await VencordNative.quickCss.get();return JSON.stringify({settings:t,quickCss:o},null,e?void 0:4)}async function vv(){let e="vencord-settings-backup.json",t=await yv(),o=new TextEncoder().encode(t);Pl(new File([o],e,{type:"application/json"}))}async function bv(e=!0){if(!1){if(t)try{}catch(o){}}else{let t=await Al("application/json");if(!t)return;let o=new FileReader;o.onload=async()=>{try{await hv(o.result),e&&kA()}catch(r){new oe("SettingsSync").error(r),e&&NA(r)}},o.readAsText(t)}}async function Ri(e){let t=await yv({minify:!0});try{let o=await fetch(new URL("/v1/settings",nr()),{method:"PUT",headers:{Authorization:await Ci(),"Content-Type":"application/octet-stream"},body:pv(new TextEncoder().encode(t))});if(!o.ok){Qo.error(`Failed to sync up, API returned ${o.status}`),Fe({title:"Cloud Settings",body:`Could not synchronize settings to cloud (API returned ${o.status}).`,color:"var(--red-360)"});return}let{written:r}=await o.json();Pn.cloud.settingsSyncVersion=r,VencordNative.settings.set(Pn),Qo.info("Settings uploaded to cloud successfully"),e&&Fe({title:"Cloud Settings",body:"Synchronized settings to the cloud!",noPersist:!0})}catch(o){Qo.error("Failed to sync up",o),Fe({title:"Cloud Settings",body:`Could not synchronize settings to the cloud (${o.toString()}).`,color:"var(--red-360)"})}}async function Rl(e=!0,t=!1){try{let o=await fetch(new URL("/v1/settings",nr()),{method:"GET",headers:{Authorization:await Ci(),Accept:"application/octet-stream","If-None-Match":G.cloud.settingsSyncVersion.toString()}});if(o.status===404)return Qo.info("No settings on the cloud"),e&&Fe({title:"Cloud Settings",body:"There are no settings in the cloud.",noPersist:!0}),!1;if(o.status===304)return Qo.info("Settings up to date"),e&&Fe({title:"Cloud Settings",body:"Your settings are up to date.",noPersist:!0}),!1;if(!o.ok)return Qo.error(`Failed to sync down, API returned ${o.status}`),Fe({title:"Cloud Settings",body:`Could not synchronize settings from the cloud (API returned ${o.status}).`,color:"var(--red-360)"}),!1;let r=Number(o.headers.get("etag")),i=G.cloud.settingsSyncVersion;if(!t&&r{"use strict";a();er();$();T();mv();kp();Ke();rr();Cl();Sv=(e,t)=>X.show({type:e,message:t,id:X.genId()}),kA=()=>Sv(X.Type.SUCCESS,"Settings successfully imported. Restart to apply changes!"),NA=e=>Sv(X.Type.FAILURE,`Failed to import settings: ${String(e)}`);Qo=new oe("Cloud:Settings","#39b7e0")});var Dp={};qe(Dp,{PlainSettings:()=>Pn,Settings:()=>G,SettingsStore:()=>jt,definePluginSettings:()=>N,migratePluginSettings:()=>$s,useSettings:()=>St});function St(e){let[,t]=U.useReducer(()=>({}),{});return U.useEffect(()=>e?(e.forEach(o=>jt.addChangeListener(o,t)),()=>e.forEach(o=>jt.removeChangeListener(o,t))):(jt.addGlobalChangeListener(t),()=>jt.removeGlobalChangeListener(t)),[]),jt.store}function $s(e,...t){let{plugins:o}=jt.plain;if(!(e in o)){for(let r of t)if(r in o){DA.info(`Migrating settings from old name ${r} to ${e}`),o[e]=o[r],delete o[r],jt.markAsChanged();break}}}function N(e,t){let o={get store(){if(!o.pluginName)throw new Error("Cannot access settings before plugin is initialized");return G.plugins[o.pluginName]},use:r=>St(r?.map(i=>`plugins.${o.pluginName}.${i}`)).plugins[o.pluginName],def:e,checks:t??{},pluginName:"",withPrivateSettings(){return this}};return o}var DA,LA,Np,EA,jt,Pn,G,$=g(()=>{"use strict";a();zr();q1();hl();Ke();we();Us();I();T();Kr();DA=new oe("Settings"),LA={notifyAboutUpdates:!0,autoUpdate:!1,autoUpdateNotification:!0,useQuickCss:!0,themeLinks:[],enabledThemes:[],enableReactDevtools:!1,frameless:!1,transparent:!1,winCtrlQ:!1,macosVibrancyStyle:void 0,disableMinSize:!1,winNativeTitleBar:!1,plugins:{},notifications:{timeout:5e3,position:"bottom-right",useNative:"not-focused",logLimit:50},cloud:{authenticated:!1,url:"https://api.vencord.dev/",settingsSync:!1,settingsSyncVersion:0}},Np=VencordNative.settings.get();Ii(Np,LA);EA=lo(async()=>{G.cloud.settingsSync&&G.cloud.authenticated&&(await Ri(),delete jr.Vencord_settingsDirty)},6e4),jt=new gl(Np,{readOnly:!0,getDefaultValue({target:e,key:t,path:o}){let r=e[t];if(!ze)return r;if(o==="plugins"&&t in ze)return e[t]={enabled:ze[t].required??ze[t].enabledByDefault??!1};if(o.startsWith("plugins.")){let i=o.slice(8);if(i in ze){let s=ze[i].options?.[t];if(!s)return r;if("default"in s)return e[t]=s.default;if(s.type===4){let l=s.options.find(c=>c.default);return l&&(e[t]=l.value),l?.value}}}return r}});jt.addGlobalChangeListener((e,t)=>{jt.plain.cloud.settingsSyncVersion=Date.now(),jr.Vencord_settingsDirty=!0,EA(),VencordNative.settings.set(jt.plain,t)});Pn=Np,G=jt.store});var No,ki=g(()=>{a();No="ca18b6e"});var wv=g(()=>{});var xv=g(()=>{});var Ep={};qe(Ep,{UpdateLogger:()=>Yr,changes:()=>ir,checkForUpdates:()=>Di,getRepo:()=>Lp,isNewer:()=>Gs,isOutdated:()=>sr,maybePromptToUpdate:()=>Hs,update:()=>Li,updateError:()=>Ni});async function kl(e){let t=await e;if(t.ok)return t.value;throw Ni=t.error,t.error}async function Di(){return ir=await kl(VencordNative.updater.getUpdates()),ir.some(e=>e.hash===No)?(Gs=!0,sr=!1):sr=ir.length>0}async function Li(){if(!sr)return!0;let e=await kl(VencordNative.updater.update());if(e&&(sr=!1,!await kl(VencordNative.updater.rebuild())))throw new Error("The Build failed. Please try manually building the new update");return e}async function Hs(e,t=!1){try{if(await Di()){let r=confirm(e);if(r&&Gs)return alert("Your local copy has more recent commits. Please stash or reset them.");r&&(await Li(),So())}}catch(o){Yr.error(o),alert("That also failed :( Try updating or re-installing with the installer!")}}var Yr,sr,Gs,Ni,ir,Lp,Zr=g(()=>{"use strict";a();ki();Ke();rr();Yr=new oe("Updater","white"),sr=!1,Gs=!1;Lp=()=>kl(VencordNative.updater.getRepo())});function Mv(){Hs("Uh Oh! Failed to render this Page. However, there is an update available that might fix it. Would you like to update and restart now?")}var Iv=g(()=>{"use strict";a();Zr()});function Op(e){let t=!1,o;return function(){return t?o:(t=!0,o=e.apply(this,arguments))}}var _p=g(()=>{"use strict";a()});function Do({title:e,children:t}){return n(S.FormSection,null,n(V,{variant:"heading-lg/semibold",tag:"h2",className:j.bottom16},e),t)}function Lo(e,t){return _.wrap(e,{message:`Failed to render the ${t} tab. If this issue persists, try using the installer to reinstall!`,onError:OA})}var OA,ar=g(()=>{"use strict";a();wv();xv();le();Iv();ot();_p();T();OA=Op(Mv)});var Rv={};qe(Rv,{default:()=>UA});function _A(){let[e,,t]=st(VencordNative.settings.getSettingsDir,{fallbackValue:"Loading..."}),o=St(),r=U.useMemo(()=>Math.random()>.5?Av:Cv,[]),i=navigator.platform.toLowerCase().startsWith("win"),s=navigator.platform.toLowerCase().startsWith("mac"),l=!1,c=[{key:"useQuickCss",title:"Enable Custom CSS",note:"Loads your Custom CSS"},{key:"enableReactDevtools",title:"Enable React Developer Tools",note:"Requires a full restart"},{key:"frameless",title:"Disable the window frame",note:"Requires a full restart"},{key:"transparent",title:"Enable window transparency.",note:"You need a theme that supports transparency or this will do nothing. Will stop the window from being resizable. Requires a full restart"},i&&{key:"winCtrlQ",title:"Register Ctrl+Q as shortcut to close Discord (Alternative to Alt+F4)",note:"Requires a full restart"},!1];return n(Do,{title:"Vencord Settings"},n(FA,{image:r}),n(S.FormSection,{title:"Quick Actions"},n(Tt,{className:Pv("quick-actions-card")},n(U.Fragment,null,n(k,{onClick:So,size:k.Sizes.SMALL},"Restart Client"),n(k,{onClick:()=>VencordNative.quickCss.openEditor(),size:k.Sizes.SMALL,disabled:e==="Loading..."},"Open QuickCSS File"),n(k,{onClick:()=>Il(e),size:k.Sizes.SMALL,disabled:t},"Open Settings Folder"),n(k,{onClick:()=>VencordNative.native.openExternal("https://github.com/Vendicated/Vencord"),size:k.Sizes.SMALL,disabled:t},"Open in GitHub")))),n(S.FormDivider,null),n(S.FormSection,{className:j.top16,title:"Settings",tag:"h5"},n(S.FormText,{className:j.bottom20},'Hint: You can change the position of this settings section in the settings of the "Settings" plugin!'),c.map(u=>u&&n(wt,{key:u.key,value:o[u.key],onChange:p=>o[u.key]=p,note:u.note},u.title))),l&&n(f,null,n(S.FormTitle,{tag:"h5"},"Window vibrancy style (requires restart)"),n(Io,{className:j.bottom20,placeholder:"Window vibrancy style",options:[{label:"No vibrancy",value:void 0},{label:"Under Page (window tinting)",value:"under-page"},{label:"Content",value:"content"},{label:"Window",value:"window"},{label:"Selection",value:"selection"},{label:"Titlebar",value:"titlebar"},{label:"Header",value:"header"},{label:"Sidebar",value:"sidebar"},{label:"Tooltip",value:"tooltip"},{label:"Menu",value:"menu"},{label:"Popover",value:"popover"},{label:"Fullscreen UI (transparent but slightly muted)",value:"fullscreen-ui"},{label:"HUD (Most transparent)",value:"hud"}],select:u=>o.macosVibrancyStyle=u,isSelected:u=>o.macosVibrancyStyle===u,serialize:Rs})),typeof Notification<"u"&&n(BA,{settings:o.notifications}))}function BA({settings:e}){return n(f,null,n(S.FormTitle,{tag:"h5"},"Notification Style"),e.useNative!=="never"&&Notification?.permission==="denied"&&n(Ro,{style:{padding:"1em"},className:j.bottom8},n(S.FormTitle,{tag:"h5"},"Desktop Notification Permission denied"),n(S.FormText,null,"You have denied Notification Permissions. Thus, Desktop notifications will not work!")),n(S.FormText,{className:j.bottom8},"Some plugins may show you notifications. These come in two styles:",n("ul",null,n("li",null,n("strong",null,"Vencord Notifications"),": These are in-app notifications"),n("li",null,n("strong",null,"Desktop Notifications"),": Native Desktop notifications (like when you get a ping)"))),n(Io,{placeholder:"Notification Style",options:[{label:"Only use Desktop notifications when Discord is not focused",value:"not-focused",default:!0},{label:"Always use Desktop notifications",value:"always"},{label:"Always use Vencord notifications",value:"never"}],closeOnSelect:!0,select:t=>e.useNative=t,isSelected:t=>t===e.useNative,serialize:Rs}),n(S.FormTitle,{tag:"h5",className:j.top16+" "+j.bottom8},"Notification Position"),n(Io,{isDisabled:e.useNative==="always",placeholder:"Notification Position",options:[{label:"Bottom Right",value:"bottom-right",default:!0},{label:"Top Right",value:"top-right"}],select:t=>e.position=t,isSelected:t=>t===e.position,serialize:Rs}),n(S.FormTitle,{tag:"h5",className:j.top16+" "+j.bottom8},"Notification Timeout"),n(S.FormText,{className:j.bottom16},"Set to 0s to never automatically time out"),n(Er,{disabled:e.useNative==="always",markers:[0,1e3,2500,5e3,1e4,2e4],minValue:0,maxValue:2e4,initialValue:e.timeout,onValueChange:t=>e.timeout=t,onValueRender:t=>(t/1e3).toFixed(2)+"s",onMarkerRender:t=>t/1e3+"s",stickToMarkers:!1}),n(S.FormTitle,{tag:"h5",className:j.top16+" "+j.bottom8},"Notification Log Limit"),n(S.FormText,{className:j.bottom16},"The amount of notifications to save in the log until old ones are removed. Set to ",n("code",null,"0")," to disable Notification log and ",n("code",null,"\u221E")," to never automatically remove old Notifications"),n(Er,{markers:[0,25,50,75,100,200],minValue:0,maxValue:200,stickToMarkers:!0,initialValue:e.logLimit,onValueChange:t=>e.logLimit=t,onValueRender:t=>t===200?"\u221E":t,onMarkerRender:t=>t===200?"\u221E":t}),n(k,{onClick:Sl,disabled:e.logLimit===0},"Open Notification Log"))}function FA({image:e}){return n(Tt,{className:Pv("card","donate")},n("div",null,n(S.FormTitle,{tag:"h5"},"Support the Project"),n(S.FormText,null,"Please consider supporting the development of Vencord by donating!"),n(Ds,{style:{transform:"translateX(-1em)"}})),n("img",{role:"presentation",src:e,alt:"",height:128,style:{imageRendering:e===Cv?"pixelated":void 0,marginLeft:"auto",transform:e===Av?"rotate(10deg)":void 0}}))}var Pv,Av,Cv,UA,kv=g(()=>{"use strict";a();bl();$();Qe();Yu();Pi();ot();we();rr();lt();T();ar();Pv=ve("vc-settings-"),Av="https://cdn.discordapp.com/emojis/1026533090627174460.png",Cv="https://media.discordapp.net/stickers/1039992459209490513.png";UA=Lo(_A,"Vencord Settings")});var Nv=g(()=>{});var $p={};qe($p,{currentNotice:()=>zs,nextNotice:()=>Dv,noticesQueue:()=>Fp,popNotice:()=>Up,showNotice:()=>js});function Up(){Bp.dismiss()}function Dv(){zs=Fp.shift(),zs&&Bp.show(...zs,"VencordNotice")}function js(e,t,o){Fp.push(["GENERIC",e,t,o]),zs||Dv()}var Bp,Fp,zs,Nl=g(()=>{"use strict";a();H();gt(e=>e.show&&e.dismiss&&!e.suppressAll,e=>Bp=e);Fp=[],zs=null});var Lv=g(()=>{});function Qt({height:e=24,width:t=24,className:o,children:r,viewBox:i,...s}){return n("svg",{className:Q(o,"vc-icon"),role:"img",width:t,height:e,viewBox:i,...s},r)}function Ei({height:e=24,width:t=24,className:o}){return n(Qt,{height:e,width:t,className:Q(o,"vc-link-icon"),viewBox:"0 0 24 24"},n("g",{fill:"none","fill-rule":"evenodd"},n("path",{fill:"currentColor",d:"M10.59 13.41c.41.39.41 1.03 0 1.42-.39.39-1.03.39-1.42 0a5.003 5.003 0 0 1 0-7.07l3.54-3.54a5.003 5.003 0 0 1 7.07 0 5.003 5.003 0 0 1 0 7.07l-1.49 1.49c.01-.82-.12-1.64-.4-2.42l.47-.48a2.982 2.982 0 0 0 0-4.24 2.982 2.982 0 0 0-4.24 0l-3.53 3.53a2.982 2.982 0 0 0 0 4.24zm2.82-4.24c.39-.39 1.03-.39 1.42 0a5.003 5.003 0 0 1 0 7.07l-3.54 3.54a5.003 5.003 0 0 1-7.07 0 5.003 5.003 0 0 1 0-7.07l1.49-1.49c-.01.82.12 1.64.4 2.43l-.47.47a2.982 2.982 0 0 0 0 4.24 2.982 2.982 0 0 0 4.24 0l3.53-3.53a2.982 2.982 0 0 0 0-4.24.973.973 0 0 1 0-1.42z"}),n("rect",{width:t,height:e})))}function Dl(e){return n(Qt,{...e,className:Q(e.className,"vc-copy-icon"),viewBox:"0 0 24 24"},n("g",{fill:"currentColor"},n("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1z"}),n("path",{d:"M15 5H8c-1.1 0-1.99.9-1.99 2L6 21c0 1.1.89 2 1.99 2H19c1.1 0 2-.9 2-2V11l-6-6zM8 21V7h6v5h5v9H8z"})))}function Xr(e){return n(Qt,{...e,className:Q(e.className,"vc-open-external-icon"),viewBox:"0 0 24 24"},n("polygon",{fill:"currentColor",fillRule:"nonzero",points:"13 20 11 20 11 8 5.5 13.5 4.08 12.08 12 4.16 19.92 12.08 18.5 13.5 13 8"}))}function Jr(e){return n(Qt,{...e,className:Q(e.className,"vc-image-icon"),viewBox:"0 0 24 24"},n("path",{fill:"currentColor",d:"M21,19V5c0,-1.1 -0.9,-2 -2,-2H5c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2zM8.5,13.5l2.5,3.01L14.5,12l4.5,6H5l3.5,-4.5z"}))}function Ll(e){return n(Qt,{...e,className:Q(e.className,"vc-info-icon"),viewBox:"0 0 24 24"},n("path",{fill:"currentColor",transform:"translate(2 2)",d:"M9,7 L11,7 L11,5 L9,5 L9,7 Z M10,18 C5.59,18 2,14.41 2,10 C2,5.59 5.59,2 10,2 C14.41,2 18,5.59 18,10 C18,14.41 14.41,18 10,18 L10,18 Z M10,4.4408921e-16 C4.4771525,-1.77635684e-15 4.4408921e-16,4.4771525 0,10 C-1.33226763e-15,12.6521649 1.0535684,15.195704 2.92893219,17.0710678 C4.80429597,18.9464316 7.3478351,20 10,20 C12.6521649,20 15.195704,18.9464316 17.0710678,17.0710678 C18.9464316,15.195704 20,12.6521649 20,10 C20,7.3478351 18.9464316,4.80429597 17.0710678,2.92893219 C15.195704,1.0535684 12.6521649,2.22044605e-16 10,0 L10,4.4408921e-16 Z M9,15 L11,15 L11,9 L9,9 L9,15 L9,15 Z"}))}function Ev(e){return n(Qt,{"aria-label":Ye.Messages.GUILD_OWNER,...e,className:Q(e.className,"vc-owner-crown-icon"),role:"img",viewBox:"0 0 16 16"},n("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M13.6572 5.42868C13.8879 5.29002 14.1806 5.30402 14.3973 5.46468C14.6133 5.62602 14.7119 5.90068 14.6473 6.16202L13.3139 11.4954C13.2393 11.7927 12.9726 12.0007 12.6666 12.0007H3.33325C3.02725 12.0007 2.76058 11.792 2.68592 11.4954L1.35258 6.16202C1.28792 5.90068 1.38658 5.62602 1.60258 5.46468C1.81992 5.30468 2.11192 5.29068 2.34325 5.42868L5.13192 7.10202L7.44592 3.63068C7.46173 3.60697 7.48377 3.5913 7.50588 3.57559C7.5192 3.56612 7.53255 3.55663 7.54458 3.54535L6.90258 2.90268C6.77325 2.77335 6.77325 2.56068 6.90258 2.43135L7.76458 1.56935C7.89392 1.44002 8.10658 1.44002 8.23592 1.56935L9.09792 2.43135C9.22725 2.56068 9.22725 2.77335 9.09792 2.90268L8.45592 3.54535C8.46794 3.55686 8.48154 3.56651 8.49516 3.57618C8.51703 3.5917 8.53897 3.60727 8.55458 3.63068L10.8686 7.10202L13.6572 5.42868ZM2.66667 12.6673H13.3333V14.0007H2.66667V12.6673Z"}))}function Ov(e){return n(Qt,{...e,className:Q(e.className,"vc-screenshare-icon"),viewBox:"0 0 24 24"},n("path",{fill:"currentColor",d:"M2 4.5C2 3.397 2.897 2.5 4 2.5H20C21.103 2.5 22 3.397 22 4.5V15.5C22 16.604 21.103 17.5 20 17.5H13V19.5H17V21.5H7V19.5H11V17.5H4C2.897 17.5 2 16.604 2 15.5V4.5ZM13.2 14.3375V11.6C9.864 11.6 7.668 12.6625 6 15C6.672 11.6625 8.532 8.3375 13.2 7.6625V5L18 9.6625L13.2 14.3375Z"}))}function El(e){return n(Qt,{...e,className:Q(e.className,"vc-image-visible"),viewBox:"0 0 24 24"},n("path",{fill:"currentColor",d:"M5 21q-.825 0-1.413-.587Q3 19.825 3 19V5q0-.825.587-1.413Q4.175 3 5 3h14q.825 0 1.413.587Q21 4.175 21 5v14q0 .825-.587 1.413Q19.825 21 19 21Zm0-2h14V5H5v14Zm1-2h12l-3.75-5-3 4L9 13Zm-1 2V5v14Z"}))}function Ol(e){return n(Qt,{...e,className:Q(e.className,"vc-image-invisible"),viewBox:"0 0 24 24"},n("path",{fill:"currentColor",d:"m21 18.15-2-2V5H7.85l-2-2H19q.825 0 1.413.587Q21 4.175 21 5Zm-1.2 4.45L18.2 21H5q-.825 0-1.413-.587Q3 19.825 3 19V5.8L1.4 4.2l1.4-1.4 18.4 18.4ZM6 17l3-4 2.25 3 .825-1.1L5 7.825V19h11.175l-2-2Zm7.425-6.425ZM10.6 13.4Z"}))}function _v(e){return n(Qt,{...e,className:Q(e.className,"vc-microphone"),viewBox:"0 0 24 24"},n("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.99 11C14.99 12.66 13.66 14 12 14C10.34 14 9 12.66 9 11V5C9 3.34 10.34 2 12 2C13.66 2 15 3.34 15 5L14.99 11ZM12 16.1C14.76 16.1 17.3 14 17.3 11H19C19 14.42 16.28 17.24 13 17.72V21H11V17.72C7.72 17.23 5 14.41 5 11H6.7C6.7 14 9.24 16.1 12 16.1ZM12 4C11.2 4 11 4.66667 11 5V11C11 11.3333 11.2 12 12 12C12.8 12 13 11.3333 13 11V5C13 4.66667 12.8 4 12 4Z",fill:"currentColor"}),n("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.99 11C14.99 12.66 13.66 14 12 14C10.34 14 9 12.66 9 11V5C9 3.34 10.34 2 12 2C13.66 2 15 3.34 15 5L14.99 11ZM12 16.1C14.76 16.1 17.3 14 17.3 11H19C19 14.42 16.28 17.24 13 17.72V22H11V17.72C7.72 17.23 5 14.41 5 11H6.7C6.7 14 9.24 16.1 12 16.1Z",fill:"currentColor"}))}function Bv(e){return n(Qt,{...e,className:Q(e.className,"vc-cog-wheel"),viewBox:"0 0 24 24"},n("path",{clipRule:"evenodd",fill:"currentColor",d:"M19.738 10H22V14H19.739C19.498 14.931 19.1 15.798 18.565 16.564L20 18L18 20L16.565 18.564C15.797 19.099 14.932 19.498 14 19.738V22H10V19.738C9.069 19.498 8.203 19.099 7.436 18.564L6 20L4 18L5.436 16.564C4.901 15.799 4.502 14.932 4.262 14H2V10H4.262C4.502 9.068 4.9 8.202 5.436 7.436L4 6L6 4L7.436 5.436C8.202 4.9 9.068 4.502 10 4.262V2H14V4.261C14.932 4.502 15.797 4.9 16.565 5.435L18 3.999L20 5.999L18.564 7.436C19.099 8.202 19.498 9.069 19.738 10ZM12 16C14.2091 16 16 14.2091 16 12C16 9.79086 14.2091 8 12 8C9.79086 8 8 9.79086 8 12C8 14.2091 9.79086 16 12 16Z"}))}function Gp(e){return n(Qt,{...e,className:Q(e.className,"vc-reply-icon"),viewBox:"0 0 24 24"},n("path",{fill:"currentColor",d:"M10 8.26667V4L3 11.4667L10 18.9333V14.56C15 14.56 18.5 16.2667 21 20C20 14.6667 17 9.33333 10 8.26667Z"}))}function Oi(e){return n(Qt,{...e,className:Q(e.className,"vc-delete-icon"),viewBox:"0 0 24 24"},n("path",{fill:"currentColor",d:"M15 3.999V2H9V3.999H3V5.999H21V3.999H15Z"}),n("path",{fill:"currentColor",d:"M5 6.99902V18.999C5 20.101 5.897 20.999 7 20.999H17C18.103 20.999 19 20.101 19 18.999V6.99902H5ZM11 17H9V11H11V17ZM15 17H13V11H15V17Z"}))}function Fv(e){return n(Qt,{...e,className:Q(e.className,"vc-plus-icon"),viewBox:"0 0 18 18"},n("polygon",{"fill-rule":"nonzero",fill:"currentColor",points:"15 10 10 10 10 15 8 15 8 10 3 10 3 8 8 8 8 3 10 3 10 8 15 8"}))}function Uv(e){return n(Qt,{...e,className:Q(e.className,"vc-no-entry-sign-icon"),viewBox:"0 0 24 24"},n("path",{d:"M0 0h24v24H0z",fill:"none"}),n("path",{fill:"currentColor",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"}))}var It=g(()=>{"use strict";a();Lv();we();T()});function $v(e,t,o){return o===!1?t?e.slice(0,-1):e:e[0]}function Ws(e,t,o=!1){let r=Fu.duration(e,t),i=KA.map(u=>({amount:r[u](),unit:u})),s=0;e:for(let u=0;uu==="days");if(l!==-1){let u=i[l],p=u.amount%7;p===0?i.splice(l,1):u.amount=p}let c="";for(;i.length;){let{amount:u,unit:p}=i.shift();c.length&&(c+=i.length?", ":" and "),(u>0||c.length)&&(c+=`${u} ${$v(p,u===1,o)}`)}return c.length?c:`0 ${$v(t,!1,o)}`}function YA(e,t=o=>o){let{length:o}=e;if(o===0)return"";if(o===1)return t(e[0]);let r="";for(let i=0;i2?r+=", ":o-i>1&&(r+=" and ");return r}function qs(e,t){let o="```";return`${o}${t||""} -${e.replaceAll("```","\\`\\`\\`")} -${o}`}var Hp,$A,GA,zp,HA,zA,jA,WA,qA,An,KA,Cn=g(()=>{"use strict";a();T();Hp=e=>e.split(/(?=[A-Z])/).map(t=>t.toLowerCase()),$A=e=>e.toLowerCase().split("_"),GA=e=>e.toLowerCase().split("-"),zp=e=>e.split(/(?=[A-Z])/).map(t=>t.toLowerCase()),HA=e=>e.toLowerCase().split(" "),zA=e=>e.map((t,o)=>o?t[0].toUpperCase()+t.slice(1):t).join(""),jA=e=>e.join("_").toUpperCase(),WA=e=>e.join("-").toLowerCase(),qA=e=>e.map(t=>t[0].toUpperCase()+t.slice(1)).join(""),An=e=>e.map(t=>t[0].toUpperCase()+t.slice(1)).join(" "),KA=["years","months","weeks","days","hours","minutes","seconds"]});function Ks(){return`-${un.fromTimestamp(Date.now())}`}function ge(e,t){let o=ZA.createBotMessage({channelId:e,content:"",embeds:[]});return ao.receiveMessage(e,Ii(t,o)),t}function ht(e,t,o){return e.find(r=>r.name===t)?.value||o}var ZA,jp=g(()=>{"use strict";a();we();H();T();ZA=x("createBotMessage")});var Rn,Vo,Wp,_l=g(()=>{"use strict";a();Rn=(h=>(h[h.SUB_COMMAND=1]="SUB_COMMAND",h[h.SUB_COMMAND_GROUP=2]="SUB_COMMAND_GROUP",h[h.STRING=3]="STRING",h[h.INTEGER=4]="INTEGER",h[h.BOOLEAN=5]="BOOLEAN",h[h.USER=6]="USER",h[h.CHANNEL=7]="CHANNEL",h[h.ROLE=8]="ROLE",h[h.MENTIONABLE=9]="MENTIONABLE",h[h.NUMBER=10]="NUMBER",h[h.ATTACHMENT=11]="ATTACHMENT",h))(Rn||{}),Vo=(s=>(s[s.BUILT_IN=0]="BUILT_IN",s[s.BUILT_IN_TEXT=1]="BUILT_IN_TEXT",s[s.BUILT_IN_INTEGRATION=2]="BUILT_IN_INTEGRATION",s[s.BOT=3]="BOT",s[s.PLACEHOLDER=4]="PLACEHOLDER",s))(Vo||{}),Wp=(r=>(r[r.CHAT_INPUT=1]="CHAT_INPUT",r[r.USER=2]="USER",r[r.MESSAGE=3]="MESSAGE",r))(Wp||{})});var Yp={};qe(Yp,{ApplicationCommandInputType:()=>Vo,ApplicationCommandOptionType:()=>Rn,ApplicationCommandType:()=>Wp,BUILT_IN:()=>lr,OptionalMessageOption:()=>cr,RequiredMessageOption:()=>Ys,_handleCommand:()=>JA,_init:()=>XA,commands:()=>qp,findOption:()=>ht,generateId:()=>Ks,prepareOption:()=>Kp,registerCommand:()=>_i,sendBotMessage:()=>ge,unregisterCommand:()=>Zs});function Kp(e){return e.displayName||=e.name,e.displayDescription||=e.description,e.options?.forEach((t,o,r)=>{t===Gv?r[o]=cr:t===Hv&&(r[o]=Ys),t.choices?.forEach(i=>i.displayName||=i.name),Kp(r[o])}),e}function QA(e,t){e.options?.forEach(o=>{if(o.type!==1)throw new Error("When specifying sub-command options, all options must be sub-commands.");let r={...e,...o,type:1,name:`${e.name} ${o.name}`,id:`${o.name}-${e.id}`,displayName:`${e.name} ${o.name}`,subCommandPath:[{name:o.name,type:o.type,displayName:o.name}],rootCommand:e};_i(r,t)})}function _i(e,t){if(!lr){console.warn("[CommandsAPI]",`Not registering ${e.name} as the CommandsAPI hasn't been initialised.`,"Please restart to use commands");return}if(lr.some(o=>o.name===e.name))throw new Error(`Command '${e.name}' already exists.`);if(e.isVencordCommand=!0,e.id??=`-${lr.length+1}`,e.applicationId??="-1",e.type??=1,e.inputType??=1,e.plugin||=t,Kp(e),e.options?.[0]?.type===1){QA(e,t);return}qp[e.name]=e,lr.push(e)}function Zs(e){let t=lr.findIndex(o=>o.name===e);return t===-1?!1:(lr.splice(t,1),delete qp[e],!0)}var lr,qp,Gv,Hv,cr,Ys,XA,JA,uo=g(()=>{"use strict";a();Cn();jp();_l();jp();_l();qp={},Gv=Symbol("OptionalMessageOption"),Hv=Symbol("RequiredMessageOption"),cr=Gv,Ys=Hv,XA=function(e){try{lr=e,cr=e.find(t=>t.name==="shrug").options[0],Ys=e.find(t=>t.name==="me").options[0]}catch{console.error("Failed to load CommandsApi")}return e},JA=function(e,t,o){if(!e.isVencordCommand)return e.execute(t,o);let r=i=>{let s=`An Error occurred while executing command "${e.name}"`,l=i instanceof Error?i.stack||i.message:String(i);console.error(s,i),ge(o.channel.id,{content:`${s}: -${qs(l)}`,author:{username:"Vencord"}})};try{let i=e.execute(t,o);return i instanceof Promise?i.catch(r):i}catch(i){return r(i)}}});function zv({text:e,color:t}){return n("div",{className:"vc-plugins-badge",style:{backgroundColor:t,justifySelf:"flex-end",marginLeft:"auto"}},e)}var Zp=g(()=>{"use strict";a()});function jv({option:e,pluginSettings:t,definedSettings:o,id:r,onChange:i,onError:s}){let l=t[r]??e.default,[c,u]=U.useState(l??!1),[p,d]=U.useState(null);U.useEffect(()=>{s(p!==null)},[p]);function h(v){let b=e.isValid?.call(o,v)??!0;typeof b=="string"?d(b):b?(d(null),u(v),i(v)):d("Invalid input provided.")}return n(S.FormSection,null,n(wt,{value:c,onChange:h,note:e.description,disabled:e.disabled?.call(o)??!1,...e.componentProps,hideBorder:!0,style:{marginBottom:"0.5em"}},An(Hp(r))),p&&n(S.FormText,{style:{color:"var(--text-danger)"}},p))}var Wv=g(()=>{"use strict";a();Cn();T()});function qv({option:e,onChange:t,onError:o}){return e.component({setValue:t,setError:o,option:e})}var Kv=g(()=>{"use strict";a()});function Xp({option:e,pluginSettings:t,definedSettings:o,id:r,onChange:i,onError:s}){function l(v){return e.type===2?BigInt(v):Number(v)}let[c,u]=U.useState(`${t[r]??e.default??0}`),[p,d]=U.useState(null);U.useEffect(()=>{s(p!==null)},[p]);function h(v){let b=e.isValid?.call(o,v)??!0;d(null),typeof b=="string"?d(b):b||d("Invalid input provided."),e.type===1&&BigInt(v)>=VA?(u(`${Number.MAX_SAFE_INTEGER}`),i(l(v))):(u(v),i(l(v)))}return n(S.FormSection,null,n(S.FormTitle,null,e.description),n(Je,{type:"number",pattern:"-?[0-9]+",value:c,onChange:h,placeholder:e.placeholder??"Enter a number",disabled:e.disabled?.call(o)??!1,...e.componentProps}),p&&n(S.FormText,{style:{color:"var(--text-danger)"}},p))}var VA,Yv=g(()=>{"use strict";a();I();T();VA=BigInt(Number.MAX_SAFE_INTEGER)});function Zv({option:e,pluginSettings:t,definedSettings:o,onChange:r,onError:i,id:s}){let l=t[s]??e.options?.find(v=>v.default)?.value,[c,u]=U.useState(l??null),[p,d]=U.useState(null);U.useEffect(()=>{i(p!==null)},[p]);function h(v){let b=e.isValid?.call(o,v)??!0;typeof b=="string"?d(b):b?(d(null),u(v),r(v)):d("Invalid input provided.")}return n(S.FormSection,null,n(S.FormTitle,null,e.description),n(Io,{isDisabled:e.disabled?.call(o)??!1,options:e.options,placeholder:e.placeholder??"Select an option",maxVisibleItems:5,closeOnSelect:!0,select:h,isSelected:v=>v===c,serialize:v=>String(v),...e.componentProps}),p&&n(S.FormText,{style:{color:"var(--text-danger)"}},p))}var Xv=g(()=>{"use strict";a();T()});function en(e,t,o=1){let r=[];for(let i=e;i<=t;i+=o)r.push(Math.round(i*100)/100);return r}function Jv({option:e,pluginSettings:t,definedSettings:o,id:r,onChange:i,onError:s}){let l=t[r]??e.default,[c,u]=U.useState(null);U.useEffect(()=>{s(c!==null)},[c]);function p(d){let h=e.isValid?.call(o,d)??!0;typeof h=="string"?u(h):h?(u(null),i(d)):u("Invalid input provided.")}return n(S.FormSection,null,n(S.FormTitle,null,e.description),n(Er,{disabled:e.disabled?.call(o)??!1,markers:e.markers,minValue:e.markers[0],maxValue:e.markers[e.markers.length-1],initialValue:l,onValueChange:p,onValueRender:d=>String(d.toFixed(2)),stickToMarkers:e.stickToMarkers??!0,...e.componentProps}))}var Jp=g(()=>{"use strict";a();T()});function Qv({option:e,pluginSettings:t,definedSettings:o,id:r,onChange:i,onError:s}){let[l,c]=U.useState(t[r]??e.default??null),[u,p]=U.useState(null);U.useEffect(()=>{s(u!==null)},[u]);function d(h){let v=e.isValid?.call(o,h)??!0;p(typeof v=="string"?v:v?null:"Invalid input provided."),c(h),i(h)}return n(S.FormSection,null,n(S.FormTitle,null,e.description),n(Je,{type:"text",value:l,onChange:d,placeholder:e.placeholder??"Enter a value",disabled:e.disabled?.call(o)??!1,...e.componentProps}),u&&n(S.FormText,{style:{color:"var(--text-danger)"}},u))}var Vv=g(()=>{"use strict";a();T()});var Xs=g(()=>{"use strict";a();Zp();Wv();Kv();Yv();Xv();Jp();Vv()});var e0=g(()=>{});async function Qr(e){let{invite:t}=await Gu.resolveInvite(e,"Desktop Modal");if(!t)throw new Error("Invalid invite: "+e);return B.dispatch({type:"INVITE_MODAL_OPEN",invite:t,code:e,context:"APP"}),new Promise(o=>{let r,i,s=!1;B.subscribe("INVITE_ACCEPT",i=()=>{s=!0}),B.subscribe("INVITE_MODAL_CLOSE",r=()=>{B.unsubscribe("INVITE_MODAL_CLOSE",r),B.unsubscribe("INVITE_ACCEPT",i),o(s)})})}function Bi(){return ee.getChannel(Ie.getChannelId())}function Js(){return ae.getGuild(Bi()?.guild_id)}function eC(e){Ms.openPrivateChannel(e)}function Fi(){return ws.PreloadedUserSettingsActionCreators.getCurrentValue()?.appearance?.theme}function kn(e){Wo.dispatchToLastSubscribed("INSERT_TEXT",{rawText:e,plainText:e})}function tC(e,t,o,r){let i={content:"",invalidEmojis:[],tts:!1,validNonShortcutEmojis:[],...t};return ao.sendMessage(e,i,o,r)}function tn(e,t){return de(o=>n(ye,{...o,className:tl.modal,size:"dynamic"},n(Zu,{className:tl.image,original:e,placeholder:e,src:e,renderLinkComponent:r=>n(Vn,{...r}),shouldHideMediaOptions:!1,shouldAnimate:!0,...t})))}async function bo(e){if(!await Bt.getUser(e))throw new Error("No such user: "+e);let o=yo.getGuildId();$u.openUserProfileModal({userId:e,guildId:o,channelId:Ie.getChannelId(),analyticsLocation:{page:o?"Guild Channel":"DM Channel",section:"Profile Popout"}})}async function Qp(e,t){let o=ho.getUserProfile(e);if(o)return o;B.dispatch({type:"USER_PROFILE_FETCH_START",userId:e});let{body:r}=await _t.get({url:`/users/${e}/profile`,query:{with_mutual_guilds:!1,with_mutual_friends_count:!1,...t},oldFormErrors:!0});return B.dispatch({type:"USER_UPDATE",user:r.user}),await B.dispatch({type:"USER_PROFILE_FETCH_SUCCESS",...r}),t?.guild_id&&r.guild_member&&B.dispatch({type:"GUILD_MEMBER_PROFILE_UPDATE",guildId:t.guild_id,guildMember:r.guild_member}),ho.getUserProfile(e)}function Nn(e){return e.discriminator==="0"?e.username:e.tag}var Bl,mt=g(()=>{"use strict";a();T();Ze();Bl=(o=>(o[o.Dark=1]="Dark",o[o.Light=2]="Light",o))(Bl||{})});function t0(e){de(t=>n(ye,{...t},n(_,null,n(ke,{className:Ui("root")},n(lC,{user:e})))))}function sC(){let e=Fi()===2?rC:iC;return n("img",{src:e,alt:"GitHub"})}function aC(){let e=Fi()===2?nC:oC;return n("img",{src:e,alt:"Website"})}function lC({user:e}){St();let t=Be([ho],()=>ho.getUserProfile(e.id));se(()=>{!t&&!e.bot&&e.id&&Qp(e.id)},[e.id]);let o=t?.connectedAccounts?.find(s=>s.type==="github")?.name,r=t?.connectedAccounts?.find(s=>s.type==="domain")?.name,i=Rt(()=>{let s=Object.values(ze);return(Mi[e.id]?s.filter(c=>c.authors.includes(Mi[e.id])):s.filter(c=>c.authors.some(u=>u.name===e.username))).filter(c=>!c.name.endsWith("API")).sort((c,u)=>Number(c.required??!1)-Number(u.required??!1))},[e.id,e.username]);return n(f,null,n("div",{className:Ui("header")},n("img",{className:Ui("avatar"),src:e.getAvatarURL(void 0,512,!0),alt:""}),n(S.FormTitle,{tag:"h2",className:Ui("name")},e.username),n("div",{className:Ui("links")},r&&n(Vn,{href:"https://"+r},n(aC,null)),o&&n(Vn,{href:`https://github.com/${o}`},n(sC,null)))),n("div",{className:Ui("plugins")},i.map(s=>n(Fl,{key:s.name,plugin:s,disabled:s.required??!1,onRestartNeeded:()=>Mt("Restart to apply changes!")}))))}var oC,nC,rC,iC,Ui,o0=g(()=>{"use strict";a();e0();$();Qe();le();P();mt();Ze();T();Kr();Vp();oC="/assets/e1e96d89e192de1997f73730db26e94f.svg",nC="/assets/730f58bcfd5a57a5e22460c445a0c6cf.svg",rC="/assets/3ff98ad75ac94fa883af5ed62d17c459.svg",iC="/assets/6a853b4c87fce386cbfef4a2efbacb09.svg",Ui=ve("vc-author-modal-")});function n0(e){let t=new uC({username:e.username,id:e.id??Ks(),avatar:e.avatar,bot:!0});return B.dispatch({type:"USER_UPDATE",user:t}),t}function Qs({plugin:e,onRestartNeeded:t,onClose:o,transitionState:r}){let[i,s]=U.useState([]),l=St().plugins[e.name],[c,u]=U.useState({}),[p,d]=U.useState({}),[h,v]=U.useState(null),b=()=>Object.values(p).every(A=>!A),M=Boolean(l&&e.options&&!Cs(e.options));U.useEffect(()=>{(async()=>{for(let A of e.authors.slice(0,6)){let F=A.id?await Bt.getUser(`${A.id}`).catch(()=>n0({username:A.name})):n0({username:A.name});s(z=>[...z,F])}})()},[]);async function w(){if(!e.options){o();return}if(e.beforeSave){let F=await Promise.resolve(e.beforeSave(c));if(F!==!0){v(F);return}}let A=!1;for(let[F,z]of Object.entries(c)){let Y=e.options[F];l[F]=z,Y?.onChange?.(z),Y?.restartNeeded&&(A=!0)}A&&t(),o()}function C(){if(!M||!e.options)return n(S.FormText,null,"There are no settings for this plugin.");{let A=Object.entries(e.options).map(([F,z])=>{if(z.hidden)return null;function Y(O){u(te=>({...te,[F]:O}))}function J(O){d(te=>({...te,[F]:O}))}let Z=pC[z.type];return n(Z,{id:F,key:F,option:z,onChange:Y,onError:J,pluginSettings:l,definedSettings:e.settings})});return n(fe,{flexDirection:"column",style:{gap:12,marginBottom:16}},A)}}function R(A,F){let z=e.authors.length-F,Y=e.authors.length-z,J=Y+e.authors.length-F;return n(ne,{text:e.authors.slice(Y,J).map(Z=>Z.name).join(", ")},({onMouseEnter:Z,onMouseLeave:O})=>n("div",{className:ed.moreUsers,onMouseEnter:Z,onMouseLeave:O},"+",z))}return n(ye,{transitionState:r,size:"medium",className:"vc-text-selectable"},n(Le,{separator:!1},n(V,{variant:"heading-lg/semibold",style:{flexGrow:1}},e.name),n(pt,{onClick:o})),n(ke,null,n(S.FormSection,null,n(S.FormTitle,{tag:"h3"},"About ",e.name),n(S.FormText,null,e.description),n(S.FormTitle,{tag:"h3",style:{marginTop:8,marginBottom:0}},"Authors"),n("div",{style:{width:"fit-content",marginBottom:8}},n(cC,{users:i,count:e.authors.length,guildId:void 0,renderIcon:!1,max:6,showDefaultAvatarsForNullUsers:!0,showUserPopout:!0,renderMoreUsers:R,renderUser:A=>n(bi,{className:ed.clickableAvatar,onClick:()=>t0(A)},n("img",{className:ed.avatar,src:A.getAvatarURL(void 0,80,!0),alt:A.username,title:A.username}))}))),!!e.settingsAboutComponent&&n("div",{className:Q(j.bottom8,"vc-text-selectable")},n(S.FormSection,null,n(_,{message:"An error occurred while rendering this plugin's custom InfoComponent"},n(e.settingsAboutComponent,{tempSettings:c})))),n(S.FormSection,{className:j.bottom16},n(S.FormTitle,{tag:"h3"},"Settings"),C())),M&&n(ct,null,n(fe,{flexDirection:"column",style:{width:"100%"}},n(fe,{style:{marginLeft:"auto"}},n(k,{onClick:o,size:k.Sizes.SMALL,color:k.Colors.PRIMARY,look:k.Looks.LINK},"Cancel"),n(ne,{text:"You must fix all errors before saving",shouldShow:!b()},({onMouseEnter:A,onMouseLeave:F})=>n(k,{size:k.Sizes.SMALL,color:k.Colors.BRAND,onClick:w,onMouseEnter:A,onMouseLeave:F,disabled:!b()},"Save & Close"))),h&&n(V,{variant:"text-md/semibold",style:{color:"var(--text-danger)"}},"Error while saving: ",h))))}var cC,ed,uC,pC,td=g(()=>{"use strict";a();uo();$();le();Ut();Uo();ot();we();Ze();I();H();T();Xs();o0();cC=Ne("defaultRenderUser","showDefaultAvatarsForNullUsers"),ed=x("moreUsers","emptyUser","avatarContainer","clickableAvatar"),uC=Ot(()=>E.getCurrentUser().constructor);pC={[0]:Qv,[1]:Xp,[2]:Xp,[3]:jv,[4]:Zv,[5]:Jv,[6]:qv}});var r0=g(()=>{});var i0=g(()=>{});function s0({checked:e,onChange:t,disabled:o}){return n("div",null,n("div",{className:Q(Ul.container,"default-colors",e?Ul.checked:void 0),style:{backgroundColor:e?od:nd,opacity:o?.3:1}},n("svg",{className:Ul.slider+" vc-switch-slider",viewBox:"0 0 28 20",preserveAspectRatio:"xMinYMid meet","aria-hidden":"true",style:{transform:e?"translateX(12px)":"translateX(-3px)"}},n("rect",{fill:"white",x:"4",y:"0",height:"20",width:"20",rx:"10"}),n("svg",{viewBox:"0 0 20 20",fill:"none"},e?n(f,null,n("path",{fill:od,d:"M7.89561 14.8538L6.30462 13.2629L14.3099 5.25755L15.9009 6.84854L7.89561 14.8538Z"}),n("path",{fill:od,d:"M4.08643 11.0903L5.67742 9.49929L9.4485 13.2704L7.85751 14.8614L4.08643 11.0903Z"})):n(f,null,n("path",{fill:nd,d:"M5.13231 6.72963L6.7233 5.13864L14.855 13.2704L13.264 14.8614L5.13231 6.72963Z"}),n("path",{fill:nd,d:"M13.2704 5.13864L14.8614 6.72963L6.72963 14.8614L5.13864 13.2704L13.2704 5.13864Z"})))),n("input",{disabled:o,type:"checkbox",className:Ul.input,tabIndex:0,checked:e,onChange:r=>t(r.currentTarget.checked)})))}var od,nd,Ul,a0=g(()=>{"use strict";a();i0();we();H();od="var(--green-360)",nd="var(--primary-400)",Ul=x("slider","input","container")});function $l({disabled:e,isNew:t,name:o,infoButton:r,footer:i,author:s,enabled:l,setEnabled:c,description:u,onMouseEnter:p,onMouseLeave:d}){return n("div",{className:$i("card",{"card-disabled":e}),onMouseEnter:p,onMouseLeave:d},n("div",{className:$i("header")},n("div",{className:$i("name-author")},n(V,{variant:"text-md/bold",className:$i("name")},o,t&&n(zv,{text:"NEW",color:"#ED4245"})),!!s&&n(V,{variant:"text-md/normal",className:$i("author")},s)),r,n(s0,{checked:l,onChange:c,disabled:e})),n(V,{className:$i("note"),variant:"text-sm/normal"},u),i)}var $i,rd=g(()=>{"use strict";a();r0();Qe();Zp();a0();T();$i=ve("vc-addon-")});var Vs,id=g(()=>{"use strict";a();Vs=class{set=new Set;get changeCount(){return this.set.size}get hasChanges(){return this.changeCount>0}handleChange(t){this.set.delete(t)||this.set.add(t)}add(t){return this.set.add(t)}remove(t){return this.set.delete(t)}getChanges(){return this.set.values()}map(t){return[...this.getChanges()].map(t)}}});var cd={};qe(cd,{_usePatchContextMenu:()=>fC,addContextMenuPatch:()=>ad,addGlobalContextMenuPatch:()=>dC,findGroupChildrenByChildId:()=>ut,globalPatches:()=>Gl,navPatches:()=>ea,removeContextMenuPatch:()=>ld,removeGlobalContextMenuPatch:()=>mC});function ad(e,t){Array.isArray(e)||(e=[e]);for(let o of e){let r=ea.get(o);r||(r=new Set,ea.set(o,r)),r.add(t)}}function dC(e){Gl.add(e)}function ld(e,t){let r=(Array.isArray(e)?e:[e]).map(i=>ea.get(i)?.delete(t)??!1);return Array.isArray(e)?r:r[0]}function mC(e){return Gl.delete(e)}function ut(e,t){for(let o of t){if(o==null)continue;if(Array.isArray(o)){let i=ut(e,o);if(i!==null)return i}if(Array.isArray(e)&&e.some(i=>o.props?.id===i)||o.props?.id===e)return t;let r=o.props?.children;if(r){Array.isArray(r)||(r=[r],o.props.children=r);let i=ut(e,r);if(i!==null)return i}}return null}function fC(e){e={...e,children:sd(e.children)},e.contextMenuApiArguments??=[];let t=ea.get(e.navId);if(Array.isArray(e.children)||(e.children=[e.children]),t)for(let o of t)try{o(e.children,...e.contextMenuApiArguments)}catch(r){l0.error(`Patch for ${e.navId} errored,`,r)}for(let o of Gl)try{o(e.navId,e.children,...e.contextMenuApiArguments)}catch(r){l0.error("Global patch errored,",r)}return e}function sd(e){return Array.isArray(e)?e.map(sd):(U.isValidElement(e)&&(e=U.cloneElement(e),e?.props?.children&&(e.type!==L.MenuControlItem||e.type===L.MenuControlItem&&e.props.control!=null)&&(e.props.children=sd(e.props.children))),e)}var l0,ea,Gl,Eo=g(()=>{"use strict";a();Ke();T();l0=new oe("ContextMenu"),ea=new Map,Gl=new Set});var md={};qe(md,{PMLogger:()=>gC,isPluginEnabled:()=>pd,patches:()=>c0,plugins:()=>hC,startAllPlugins:()=>ta,startDependenciesRecursive:()=>zl,startPlugin:()=>oa,stopPlugin:()=>dd});function pd(e){return(ze[e]?.required||ze[e]?.isDependency||ud[e]?.enabled)??!1}function zl(e){let t=!1,o=[];return e.dependencies?.forEach(r=>{if(!G.plugins[r].enabled){if(zl(ze[r]),G.plugins[r].enabled=!0,ze[r].patches){po.warn(`Enabling dependency ${r} requires restart.`),t=!0;return}oa(ze[r])||o.push(r)}}),{restartNeeded:t,failures:o}}var po,gC,hC,c0,ud,u0,ta,oa,dd,jl=g(()=>{"use strict";a();uo();Eo();$();Ke();I();T();Kr();Xa();po=new oe("PluginManager","#a6d189"),gC=po,hC=ze,c0=[],ud=G.plugins;u0=Object.values(ze);for(let e of u0)ud[e.name]?.enabled&&e.dependencies?.forEach(t=>{let o=ze[t];if(o)ud[t].enabled=!0,o.isDependency=!0;else{let r=new Error(`Plugin ${e.name} has unresolved dependency ${t}`);po.warn(r)}});for(let e of u0){if(e.settings){e.settings.pluginName=e.name,e.options??={};for(let[t,o]of Object.entries(e.settings.def)){let r=e.settings.checks?.[t];e.options[t]={...o,...r}}}if(e.patches&&pd(e.name))for(let t of e.patches)t.plugin=e.name,Array.isArray(t.replacement)||(t.replacement=[t.replacement]),c0.push(t)}ta=an("startAllPlugins",function(t){po.info(`Starting plugins (stage ${t})`);for(let o in ze)if(pd(o)){if((ze[o].startAt??"WebpackReady")!==t)continue;oa(ze[o])}});oa=an("startPlugin",function(t){let{name:o,commands:r,flux:i,contextMenus:s}=t;if(t.start){if(po.info("Starting plugin",o),t.started)return po.warn(`${o} already started`),!1;try{t.start(),t.started=!0}catch(l){return po.error(`Failed to start ${o} -`,l),!1}}if(r?.length){po.info("Registering commands of plugin",o);for(let l of r)try{_i(l,o)}catch(c){return po.error(`Failed to register command ${l.name} -`,c),!1}}if(i)for(let l in i)B.subscribe(l,i[l]);if(s)for(let l in s)ad(l,s[l]);return!0},e=>`startPlugin ${e.name}`),dd=an("stopPlugin",function(t){let{name:o,commands:r,flux:i,contextMenus:s}=t;if(t.stop){if(po.info("Stopping plugin",o),!t.started)return po.warn(`${o} already stopped`),!1;try{t.stop(),t.started=!1}catch(l){return po.error(`Failed to stop ${o} -`,l),!1}}if(r?.length){po.info("Unregistering commands of plugin",o);for(let l of r)try{Zs(l.name)}catch(c){return po.error(`Failed to unregister command ${l.name} -`,c),!1}}if(i)for(let l in i)B.unsubscribe(l,i[l]);if(s)for(let l in s)ld(l,s[l]);return!0},e=>`stopPlugin ${e.name}`)});function vC(e){X.show({message:e,type:X.Type.FAILURE,id:X.genId(),options:{position:X.Position.BOTTOM}})}function SC({required:e}){return n(Tt,{className:Vr("info-card",{"restart-card":e})},e?n(f,null,n(S.FormTitle,{tag:"h5"},"Restart required!"),n(S.FormText,{className:Vr("dep-text")},"Restart now to apply new plugins and their settings"),n(k,{color:k.Colors.YELLOW,onClick:()=>location.reload()},"Restart")):n(f,null,n(S.FormTitle,{tag:"h5"},"Plugin Management"),n(S.FormText,null,"Press the cog wheel or info icon to get more info on a plugin"),n(S.FormText,null,"Plugins with a cog wheel have settings you can modify!")))}function Fl({plugin:e,disabled:t,onRestartNeeded:o,onMouseEnter:r,onMouseLeave:i,isNew:s}){let l=G.plugins[e.name],c=()=>l.enabled??!1;function u(){Hr(async()=>d=>n(Qs,{...d,plugin:e,onRestartNeeded:()=>o(e.name)}))}function p(){let d=c();if(!d){let{restartNeeded:v,failures:b}=zl(e);if(b.length){p0.error(`Failed to start dependencies for ${e.name}: ${b.join(", ")}`),js("Failed to start dependencies: "+b.join(", "),"Close",()=>null);return}else if(v){l.enabled=!0,o(e.name);return}}if(e.patches?.length){l.enabled=!d,o(e.name);return}if(d&&!e.started){l.enabled=!d;return}if(!(d?dd(e):oa(e))){l.enabled=!1;let v=`Error while ${d?"stopping":"starting"} plugin ${e.name}`;p0.error(v),vC(v);return}l.enabled=!d}return n($l,{name:e.name,description:e.description,isNew:s,enabled:c(),setEnabled:p,disabled:t,onMouseEnter:r,onMouseLeave:i,infoButton:n("button",{role:"switch",onClick:()=>u(),className:Q(yC.button,Vr("info-button"))},e.options&&!Cs(e.options)?n(Bv,null):n(Ll,null))})}function fd(){let e=St(),t=U.useMemo(()=>new Vs,[]);U.useEffect(()=>()=>void(t.hasChanges&&et.show({title:"Restart required",body:n(f,null,n("p",null,"The following plugins require a restart:"),n("div",null,t.map((v,b)=>n(f,null,b>0&&", ",Pe.parse("`"+v+"`"))))),confirmText:"Restart now",cancelText:"Later!",onConfirm:()=>location.reload()})),[]);let o=U.useMemo(()=>{let v={};for(let b in ze){let M=ze[b].dependencies;if(M)for(let w of M)v[w]??=[],v[w].push(b)}return v},[]),r=U.useMemo(()=>Object.values(ze).sort((v,b)=>v.name.localeCompare(b.name)),[]),[i,s]=U.useState({value:"",status:0}),l=v=>s(b=>({...b,value:v})),c=v=>s(b=>({...b,status:v})),u=v=>{let b=e.plugins[v.name]?.enabled;if(b&&i.status===2||!b&&i.status===1||i.status===3&&!p?.includes(v.name))return!1;if(!i.value.length)return!0;let M=i.value.toLowerCase();return v.name.toLowerCase().includes(M)||v.description.toLowerCase().includes(M)||v.tags?.some(w=>w.toLowerCase().includes(M))},[p]=st(()=>dt("Vencord_existingPlugins").then(v=>{let b=Date.now()/1e3,M={},w=Object.values(r).map(R=>R.name),C=[];for(let{name:R}of r)(M[R]=v?.[R]??b)+60*60*24*2>b&&C.push(R);return kt("Vencord_existingPlugins",M),Fr.isEqual(C,w)?[]:C})),d,h;if(r?.length){d=[],h=[];for(let v of r){if(!v.options&&v.name.endsWith("API")&&i.value!=="API"||!u(v))continue;if(v.required||o[v.name]?.some(M=>e.plugins[M].enabled)){let M=v.required?"This plugin is required for Vencord to function.":bC(o[v.name]?.filter(w=>e.plugins[w].enabled));h.push(n(ne,{text:M,key:v.name},({onMouseLeave:w,onMouseEnter:C})=>n(Fl,{onMouseLeave:w,onMouseEnter:C,onRestartNeeded:R=>t.handleChange(R),disabled:!0,plugin:v})))}else d.push(n(Fl,{onRestartNeeded:M=>t.handleChange(M),disabled:!1,plugin:v,isNew:p?.includes(v.name),key:v.name}))}}else d=h=n(V,{variant:"text-md/normal"},"No plugins meet search criteria.");return n(Do,{title:"Plugins"},n(SC,{required:t.hasChanges}),n(S.FormTitle,{tag:"h5",className:Q(j.top20,j.bottom8)},"Filters"),n("div",{className:Vr("filter-controls")},n(Je,{autoFocus:!0,value:i.value,placeholder:"Search for a plugin...",onChange:l,className:j.bottom20}),n("div",{className:d0.inputWrapper},n(Io,{className:d0.inputDefault,options:[{label:"Show All",value:0,default:!0},{label:"Show Enabled",value:1},{label:"Show Disabled",value:2},{label:"Show New",value:3}],serialize:String,select:c,isSelected:v=>v===i.status,closeOnSelect:!0}))),n(S.FormTitle,{className:j.top20},"Plugins"),n("div",{className:Vr("grid")},d),n(S.FormDivider,{className:j.top20}),n(S.FormTitle,{tag:"h5",className:Q(j.top20,j.bottom8)},"Required Plugins"),n("div",{className:Vr("grid")},h))}function bC(e){return n(U.Fragment,null,n(S.FormText,null,"This plugin is required by:"),e.map(t=>n(S.FormText,{className:Vr("dep-text")},t)))}var Vr,p0,d0,yC,Vp=g(()=>{"use strict";a();Nv();Xo();Nl();$();Qe();It();td();rd();ar();id();Ke();ot();we();Ze();lt();H();T();Kr();jl();Vr=ve("vc-plugins-"),p0=new oe("PluginSettings","#a6d189"),d0=x("inputDefault","inputWrapper"),yC=x("button","disabled","enabled")});var m0={};qe(m0,{default:()=>TC});var TC,f0=g(()=>{"use strict";a();Vp();ar();TC=Lo(fd,"Plugins")});function je(e){return e.disabled&&(e.style??={},e.style.pointerEvents="none",e["aria-disabled"]=!0),n("a",{role:"link",target:"_blank",...e},e.children)}var To=g(()=>{"use strict";a()});var g0={};qe(g0,{default:()=>CC});function MC({link:e}){let[t,o,r]=st(()=>fetch(e).then(s=>{if(s.status>300)throw`${s.status} ${s.statusText}`;let l=s.headers.get("Content-Type");if(!l?.startsWith("text/css")&&!l?.startsWith("text/plain"))throw"Not a CSS file. Remember to use the raw link!";return"Okay!"})),i=r?"Checking...":o?`Error: ${o instanceof Error?o.message:String(o)}`:"Valid!";return n(S.FormText,{style:{color:r?"var(--text-muted)":o?"var(--text-danger)":"var(--text-positive)"}},i)}function IC({themeLinks:e}){return e.length?n(f,null,n(S.FormTitle,{className:j.top20,tag:"h5"},"Validator"),n(S.FormText,null,"This section will tell you whether your themes can successfully be loaded"),n("div",null,e.map(t=>n(Tt,{style:{padding:".5em",marginBottom:".5em",marginTop:".5em"},key:t},n(S.FormTitle,{tag:"h5",style:{overflowWrap:"break-word"}},t),n(MC,{link:t}))))):null}function PC({theme:e,enabled:t,onChange:o,onDelete:r}){return n($l,{name:e.name,description:e.description,author:e.author,enabled:t,setEnabled:o,infoButton:!1,footer:n(fe,{flexDirection:"row",style:{gap:"0.2em"}},!!e.website&&n(je,{href:e.website},"Website"),!!(e.website&&e.invite)&&" \u2022 ",!!e.invite&&n(je,{href:`https://discord.gg/${e.invite}`,onClick:async i=>{i.preventDefault(),e.invite!=null&&Qr(e.invite).catch(()=>Mt("Invalid or expired invite"))}},"Discord Server"))})}function AC(){let e=St(["themeLinks","enabledThemes"]),t=xt(null),[o,r]=W(0),[i,s]=W(e.themeLinks.join(` -`)),[l,c]=W(null),[u,,p]=st(VencordNative.themes.getThemesDir);se(()=>{d()},[]);async function d(){let C=await VencordNative.themes.getThemesList();c(C)}function h(C,R){if(R){if(e.enabledThemes.includes(C))return;e.enabledThemes=[...e.enabledThemes,C]}else e.enabledThemes=e.enabledThemes.filter(A=>A!==C)}async function v(C){if(C.stopPropagation(),C.preventDefault(),!C.currentTarget?.files?.length)return;let{files:R}=C.currentTarget,A=Array.from(R,F=>{let{name:z}=F;if(!!z.endsWith(".css"))return new Promise((Y,J)=>{let Z=new FileReader;Z.onload=()=>{VencordNative.themes.uploadTheme(z,Z.result).then(Y).catch(J)},Z.readAsText(F)})});await Promise.all(A),d()}function b(){return n(f,null,n(Tt,{className:"vc-settings-card"},n(S.FormTitle,{tag:"h5"},"Find Themes:"),n("div",{style:{marginBottom:".5em",display:"flex",flexDirection:"column"}},n(je,{style:{marginRight:".5em"},href:"https://betterdiscord.app/themes"},"BetterDiscord Themes"),n(je,{href:"https://github.com/search?q=discord+theme"},"GitHub")),n(S.FormText,null,'If using the BD site, click on "Download" and place the downloaded .theme.css file into your themes folder.')),n(S.FormSection,{title:"Local Themes"},n(Tt,{className:"vc-settings-quick-actions-card"},n(f,null,n(k,{onClick:()=>Il(u),size:k.Sizes.SMALL,disabled:p},"Open Themes Folder"),n(k,{onClick:d,size:k.Sizes.SMALL},"Load missing Themes"),n(k,{onClick:()=>VencordNative.quickCss.openEditor(),size:k.Sizes.SMALL},"Edit QuickCSS"),Vencord.Settings.plugins.ClientTheme.enabled&&n(k,{onClick:()=>de(C=>n(Qs,{...C,plugin:Vencord.Plugins.plugins.ClientTheme,onRestartNeeded:()=>{}})),size:k.Sizes.SMALL},"Edit ClientTheme"))),n("div",{className:xC("grid")},l?.map(C=>n(PC,{key:C.fileName,enabled:e.enabledThemes.includes(C.fileName),onChange:R=>h(C.fileName,R),onDelete:async()=>{h(C.fileName,!1),await VencordNative.themes.deleteTheme(C.fileName),d()},theme:C})))))}function M(){e.themeLinks=[...new Set(i.trim().split(/\n+/).map(C=>C.trim()).filter(Boolean))]}function w(){return n(f,null,n(Tt,{className:"vc-settings-card vc-text-selectable"},n(S.FormTitle,{tag:"h5"},"Paste links to css files here"),n(S.FormText,null,"One link per line"),n(S.FormText,null,"Make sure to use direct links to files (raw or github.io)!")),n(S.FormSection,{title:"Online Themes",tag:"h5"},n(rl,{value:i,onChange:s,className:Q(wC.textarea,"vc-settings-theme-links"),placeholder:"Theme Links",spellCheck:!1,onBlur:M,rows:10}),n(IC,{themeLinks:e.themeLinks})))}return n(Do,{title:"Themes"},n(Ho,{type:"top",look:"brand",className:"vc-settings-tab-bar",selectedItem:o,onItemSelect:r},n(Ho.Item,{className:"vc-settings-tab-bar-item",id:0},"Local Themes"),n(Ho.Item,{className:"vc-settings-tab-bar-item",id:1},"Online Themes")),o===0&&b(),o===1&&w())}var xU,MU,wC,xC,CC,h0=g(()=>{"use strict";a();$();Qe();Ut();It();To();td();mt();ot();we();Ze();rr();lt();H();T();rd();ar();xU=x("resolveInvite"),MU=so(e=>e.prototype?.activateUploadDialogue&&e.prototype.setRef),wC=so(e=>typeof e.textarea=="string"),xC=ve("vc-settings-theme-");CC=Lo(AC,"Themes")});var b0={};qe(b0,{default:()=>DC});function y0(e,t){return async()=>{e(!0);try{await t()}catch(r){if(Yr.error("Failed to update",r),r)if(r.code&&r.cmd){let{code:i,path:s,cmd:l,stderr:c}=r;if(i==="ENOENT")var o=`Command \`${s}\` not found. -Please install it and try again`;else{var o=`An error occurred while running \`${l}\`: -`;o+=c||`Code \`${i}\`. See the console for more info`}}else var o="An unknown error occurred. See the console for more info.";else var o=`An unknown error occurred (error is undefined). -Please try again.`;et.show({title:"Oops!",body:n(Ro,null,o.split(` -`).map(i=>n("div",null,Pe.parse(i))))})}finally{e(!1)}}}function v0({repo:e,hash:t,disabled:o=!1}){return n(je,{href:`${e}/commit/${t}`,disabled:o},t)}function S0({updates:e,repo:t,repoPending:o}){return n(Tt,{style:{padding:"0 0.5em"}},e.map(({hash:r,author:i,message:s})=>n("div",{style:{marginTop:"0.5em",marginBottom:"0.5em"}},n("code",null,n(v0,{repo:t,hash:r,disabled:o})),n("span",{style:{marginLeft:"0.5em",color:"var(--text-normal)"}},s," - ",i))))}function RC(e){let[t,o]=U.useState(ir),[r,i]=U.useState(!1),[s,l]=U.useState(!1),c=(t?.length??0)>0;return n(f,null,!t&&Ni?n(f,null,n(S.FormText,null,"Failed to check updates. Check the console for more info"),n(Ro,{style:{padding:"1em"}},n("p",null,Ni.stderr||Ni.stdout||"An unknown error occurred"))):n(S.FormText,{className:j.bottom8},c?t.length===1?"There is 1 Update":`There are ${t.length} Updates`:"Up to Date!"),c&&n(S0,{updates:t,...e}),n(fe,{className:Q(j.bottom8,j.top8)},c&&n(k,{size:k.Sizes.SMALL,disabled:s||r,onClick:y0(l,async()=>{await Li()&&(o([]),await new Promise(u=>{et.show({title:"Update Success!",body:"Successfully updated. Restart now to apply the changes?",confirmText:"Restart",cancelText:"Not now!",onConfirm(){So(),u()},onCancel:u})}))})},"Update Now"),n(k,{size:k.Sizes.SMALL,disabled:s||r,onClick:y0(i,async()=>{await Di()?o(ir):(o([]),X.show({message:"No updates found!",id:X.genId(),type:X.Type.MESSAGE,options:{position:X.Position.BOTTOM}}))})},"Check for Updates")))}function kC(e){return n(f,null,n(S.FormText,{className:j.bottom8},"Your local copy has more recent commits. Please stash or reset them."),n(S0,{...e,updates:ir}))}function NC(){let e=St(["notifyAboutUpdates","autoUpdate","autoUpdateNotification"]),[t,o,r]=st(Lp,{fallbackValue:"Loading..."});U.useEffect(()=>{o&&Yr.error("Failed to retrieve repo",o)},[o]);let i={repo:t,repoPending:r};return n(Do,{title:"Vencord Updater"},n(S.FormTitle,{tag:"h5"},"Updater Settings"),n(wt,{value:e.notifyAboutUpdates,onChange:s=>e.notifyAboutUpdates=s,note:"Shows a notification on startup",disabled:e.autoUpdate},"Get notified about new updates"),n(wt,{value:e.autoUpdate,onChange:s=>e.autoUpdate=s,note:"Automatically update Vencord without confirmation prompt"},"Automatically update"),n(wt,{value:e.autoUpdateNotification,onChange:s=>e.autoUpdateNotification=s,note:"Shows a notification when Vencord automatically updates",disabled:!e.autoUpdate},"Get notified when an automatic update completes"),n(S.FormTitle,{tag:"h5"},"Repo"),n(S.FormText,{className:"vc-text-selectable"},r?t:o?"Failed to retrieve - check console":n(je,{href:t},t.split("/").slice(-2).join("/"))," ","(",n(v0,{hash:No,repo:t,disabled:r}),")"),n(S.FormDivider,{className:j.top8+" "+j.bottom8}),n(S.FormTitle,{tag:"h5"},"Updates"),Gs?n(kC,{...i}):n(RC,{...i}))}var DC,T0=g(()=>{"use strict";a();$();Pi();Ut();To();ot();we();rr();lt();Zr();T();ki();ar();DC=Lo(NC,"Updater")});function Wl({value:e,onChange:t,validate:o}){let[r,i]=U.useState(e),[s,l]=U.useState();function c(u){i(u);let p=o(u);p===!0?(l(void 0),t(u)):l(p)}return n(f,null,n(Je,{type:"text",value:r,onChange:c,error:s}))}var gd=g(()=>{"use strict";a();T()});var w0={};qe(w0,{default:()=>BC});function LC(e){try{return new URL(e),!0}catch{return"Invalid URL"}}async function EC(){let e=await fetch(new URL("/v1/",nr()),{method:"DELETE",headers:{Authorization:await Ci()}});if(!e.ok){Ml.error(`Failed to erase data, API returned ${e.status}`),Fe({title:"Cloud Integrations",body:`Could not erase all data (API returned ${e.status}), please contact support.`,color:"var(--red-360)"});return}G.cloud.authenticated=!1,await Rp(),Fe({title:"Cloud Integrations",body:"Successfully erased all data.",color:"var(--green-360)"})}function OC(){let{cloud:e}=St(["cloud.authenticated","cloud.settingsSync"]),t=e.authenticated&&e.settingsSync;return n(S.FormSection,{title:"Settings Sync",className:j.top16},n(S.FormText,{variant:"text-md/normal",className:j.bottom20},"Synchronize your settings to the cloud. This allows easy synchronization across multiple devices with minimal effort."),n(wt,{key:"cloud-sync",disabled:!e.authenticated,value:e.settingsSync,onChange:o=>{e.settingsSync=o}},"Settings Sync"),n("div",{className:"vc-cloud-settings-sync-grid"},n(k,{size:k.Sizes.SMALL,disabled:!t,onClick:()=>Ri(!0)},"Sync to Cloud"),n(ne,{text:"This will overwrite your local settings with the ones on the cloud. Use wisely!"},({onMouseLeave:o,onMouseEnter:r})=>n(k,{onMouseLeave:o,onMouseEnter:r,size:k.Sizes.SMALL,color:k.Colors.RED,disabled:!t,onClick:()=>Rl(!0,!0)},"Sync from Cloud")),n(k,{size:k.Sizes.SMALL,color:k.Colors.RED,disabled:!t,onClick:()=>Tv()},"Delete Cloud Settings")))}function _C(){let e=St(["cloud.authenticated","cloud.url"]);return n(Do,{title:"Vencord Cloud"},n(S.FormSection,{title:"Cloud Settings",className:j.top16},n(S.FormText,{variant:"text-md/normal",className:j.bottom20},"Vencord comes with a cloud integration that adds goodies like settings sync across devices. It ",n(je,{href:"https://vencord.dev/cloud/privacy"},"respects your privacy"),", and the ",n(je,{href:"https://github.com/Vencord/Backend"},"source code")," is AGPL 3.0 licensed so you can host it yourself."),n(wt,{key:"backend",value:e.cloud.authenticated,onChange:t=>{t&&gv(),t||(e.cloud.authenticated=t)},note:"This will request authorization if you have not yet set up cloud integrations."},"Enable Cloud Integrations"),n(S.FormTitle,{tag:"h5"},"Backend URL"),n(S.FormText,{className:j.bottom8},"Which backend to use when using cloud integrations."),n(Wl,{key:"backendUrl",value:e.cloud.url,onChange:t=>{e.cloud.url=t,e.cloud.authenticated=!1,Rp()},validate:LC}),n(k,{className:j.top8,size:k.Sizes.MEDIUM,color:k.Colors.RED,disabled:!e.cloud.authenticated,onClick:()=>et.show({title:"Are you sure?",body:"Once your data is erased, we cannot recover it. There's no going back!",onConfirm:EC,confirmText:"Erase it!",confirmColor:"vc-cloud-erase-data-danger-btn",cancelText:"Nevermind"})},"Erase All Data"),n(S.FormDivider,{className:j.top16})),n(OC,null))}var BC,x0=g(()=>{"use strict";a();er();$();gd();To();kp();ot();Us();T();ar();BC=Lo(_C,"Cloud")});var M0={};qe(M0,{default:()=>UC});function FC(){return n(Do,{title:"Backup & Restore"},n(Tt,{className:Q("vc-settings-card","vc-backup-restore-card")},n(fe,{flexDirection:"column"},n("strong",null,"Warning"),n("span",null,"Importing a settings file will overwrite your current settings."))),n(V,{variant:"text-md/normal",className:j.bottom8},"You can import and export your Vencord settings as a JSON file. This allows you to easily transfer your settings to another device, or recover your settings after reinstalling Vencord or Discord."),n(V,{variant:"text-md/normal",className:j.bottom8},"Settings Export contains:",n("ul",null,n("li",null,"\u2014 Custom QuickCSS"),n("li",null,"\u2014 Theme Links"),n("li",null,"\u2014 Plugin Settings"))),n(fe,null,n(k,{onClick:()=>bv(),size:k.Sizes.SMALL},"Import Settings"),n(k,{onClick:vv,size:k.Sizes.SMALL},"Export Settings")))}var UC,I0=g(()=>{"use strict";a();Ut();ot();we();Us();T();ar();UC=Lo(FC,"Backup & Restore")});var na,hd=g(()=>{"use strict";a();$();P();I();ki();na=y({name:"Settings",description:"Adds Settings UI and debug info",authors:[m.Ven,m.Megu],required:!0,patches:[{find:".versionHash",replacement:[{match:/\[\(0,.{1,3}\.jsxs?\)\((.{1,10}),(\{[^{}}]+\{.{0,20}.versionHash,.+?\})\)," "/,replace:(e,t,o)=>(o=o.replace(/children:\[.+\]/,""),`${e},Vencord.Plugins.plugins.Settings.makeInfoElements(${t}, ${o})`)}]},{find:"Messages.ACTIVITY_SETTINGS",replacement:{get match(){switch(G.plugins.Settings.settingsLocation){case"top":return/\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.USER_SETTINGS\}/;case"aboveNitro":return/\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.BILLING_SETTINGS\}/;case"belowNitro":return/\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.APP_SETTINGS\}/;case"belowActivity":return/(?<=\{section:(\i\.\i)\.DIVIDER},)\{section:"changelog"/;case"bottom":return/\{section:(\i\.\i)\.CUSTOM,\s*element:.+?}/;case"aboveActivity":default:return/\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.ACTIVITY_SETTINGS\}/}},replace:"...$self.makeSettingsCategories($1),$&"}},{find:"Messages.USER_SETTINGS_ACTIONS_MENU_LABEL",replacement:{match:/(?<=function\((\i),\i\)\{)(?=let \i=Object.values\(\i.UserSettingsSections\).*?(\i)\.default\.open\()/,replace:"$2.default.open($1);return;"}}],customSections:[],makeSettingsCategories(e){return[{section:e.HEADER,label:"Vencord",className:"vc-settings-header"},{section:"VencordSettings",label:"Vencord",element:(kv(),Xn(Rv)).default,className:"vc-settings"},{section:"VencordPlugins",label:"Plugins",element:(f0(),Xn(m0)).default,className:"vc-plugins"},{section:"VencordThemes",label:"Themes",element:(h0(),Xn(g0)).default,className:"vc-themes"},{section:"VencordUpdater",label:"Updater",element:(T0(),Xn(b0)).default,className:"vc-updater"},{section:"VencordCloud",label:"Cloud",element:(x0(),Xn(w0)).default,className:"vc-cloud"},{section:"VencordSettingsSync",label:"Backup & Restore",element:(I0(),Xn(M0)).default,className:"vc-backup-restore"},!1,...this.customSections.map(t=>t(e)),{section:e.DIVIDER}].filter(Boolean)},options:{settingsLocation:{type:4,description:"Where to put the Vencord settings section",options:[{label:"At the very top",value:"top"},{label:"Above the Nitro section",value:"aboveNitro"},{label:"Below the Nitro section",value:"belowNitro"},{label:"Above Activity Settings",value:"aboveActivity",default:!0},{label:"Below Activity Settings",value:"belowActivity"},{label:"At the very bottom",value:"bottom"}],restartNeeded:!0}},get electronVersion(){return VencordNative.native.getVersions().electron||window.armcord?.electron||null},get chromiumVersion(){try{return VencordNative.native.getVersions().chrome||navigator.userAgentData?.brands?.find(e=>e.brand==="Chromium"||e.brand==="Google Chrome")?.version||null}catch{return null}},get additionalInfo(){return` (Vesktop v${VesktopNative.app.getVersion()})`},makeInfoElements(e,t){let{electronVersion:o,chromiumVersion:r,additionalInfo:i}=this;return n(f,null,n(e,{...t},"Vencord ",No,i),o&&n(e,{...t},"Electron ",o),r&&n(e,{...t},"Chromium ",r))}})});var P0,$C,yd,A0=g(()=>{"use strict";a();ei();P();we();Cn();I();Zr();T();ki();Kr();hd();P0="Vencord-SupportHelper-Dismiss",$C=[ul,"1024286218801926184","1033680203433660458"],yd=y({name:"SupportHelper",required:!0,description:"Helps us provide support to you",authors:[m.Ven],dependencies:["CommandsAPI"],commands:[{name:"vencord-debug",description:"Send Vencord Debug info",predicate:e=>$C.includes(e.channel.id),async execute(){let{RELEASE_CHANNEL:e}=window.GLOBAL_ENV,t=(()=>`Vesktop v${VesktopNative.app.getVersion()}`)(),o=c=>c.endsWith("API")||ze[c].required,r=Object.keys(ze).filter(c=>Vencord.Plugins.isPluginEnabled(c)&&!o(c)),i=Object.keys(ze).filter(c=>Vencord.Plugins.isPluginEnabled(c)&&o(c)),s={Vencord:`v1.7.3 \u2022 ${No}${na.additionalInfo} - ${Intl.DateTimeFormat("en-GB",{dateStyle:"medium"}).format(1711076914215)}`,"Discord Branch":e,Client:t,Platform:window.navigator.platform,Outdated:sr,OpenAsar:"openasar"in window};return{content:` -**Vencord Debug Info** ->>> ${Object.entries(s).map(([c,u])=>`${c}: ${u}`).join(` -`)} - -Enabled Plugins (${r.length+i.length}): -${qs(r.join(", ")+` - -`+i.join(", "))} -`.trim().replaceAll("```\n","```")}}}],flux:{async CHANNEL_SELECT({channelId:e}){if(e===ul&&!ks(E.getCurrentUser().id)&&sr&&No!==await yt.get(P0)){let t=()=>yt.set(P0,No);et.show({title:"Hold on!",body:n("div",null,n(S.FormText,null,"You are using an outdated version of Vencord! Chances are, your issue is already fixed."),n(S.FormText,null,"Please first update using the Updater Page in Settings, or use the VencordInstaller (Update Vencord Button) to do so, in case you can't access the Updater page.")),onCancel:t,onConfirm:t})}}}})});var vd,C0=g(()=>{"use strict";a();P();I();vd=y({name:"AlwaysAnimate",description:"Animates anything that can be animated",authors:[m.FieryFlames],patches:[{find:"canAnimate:",all:!0,noWarn:!0,replacement:{match:/canAnimate:.+?(?=([,}].*?\)))/g,replace:(e,t)=>t.match(/}=.+/)==null?"canAnimate:!0":e}},{find:".Messages.GUILD_OWNER,",replacement:{match:/(?<=\.activityEmoji,.+?animate:)\i/,replace:"!0"}},{find:".animatedBannerHoverLayer,onMouseEnter:",replacement:{match:/(?<=guildBanner:\i,animate:)\i(?=}\))/,replace:"!0"}}]})});var Sd,bd,R0=g(()=>{"use strict";a();$();P();I();Sd=N({domain:{type:3,default:!0,description:"Remove the untrusted domain popup when opening links",restartNeeded:!0},file:{type:3,default:!0,description:"Remove the 'Potentially Dangerous Download' popup when opening links",restartNeeded:!0}}),bd=y({name:"AlwaysTrust",description:"Removes the annoying untrusted domain and suspicious file popup",authors:[m.zt,m.Trwy],patches:[{find:'.displayName="MaskedLinkStore"',replacement:{match:/(?<=isTrustedDomain\(\i\){)return \i\(\i\)/,replace:"return true"},predicate:()=>Sd.store.domain},{find:"isSuspiciousDownload:",replacement:{match:/function \i\(\i\){(?=.{0,60}\.parse\(\i\))/,replace:"$&return null;"},predicate:()=>Sd.store.file}],settings:Sd})});var GC,HC,zC,ur,Td,k0=g(()=>{"use strict";a();$();le();P();I();H();GC=Go(".actionBarIcon)"),HC=x("popFirstFile","update"),zC=/\.tar\.\w+$/,ur=N({anonymiseByDefault:{description:"Whether to anonymise file names by default",type:3,default:!0},method:{description:"Anonymising method",type:4,options:[{label:"Random Characters",value:0,default:!0},{label:"Consistent",value:1},{label:"Timestamp",value:2}]},randomisedLength:{description:"Random characters length",type:1,default:7,disabled:()=>ur.store.method!==0},consistent:{description:"Consistent filename",type:0,default:"image",disabled:()=>ur.store.method!==1}}),Td=y({name:"AnonymiseFileNames",authors:[m.fawn],description:"Anonymise uploaded file names",patches:[{find:"instantBatchUpload:function",replacement:{match:/uploadFiles:(.{1,2}),/,replace:"uploadFiles:(...args)=>(args[0].uploads.forEach(f=>f.filename=$self.anonymise(f)),$1(...args)),"}},{find:"message.attachments",replacement:{match:/(\i.uploadFiles\((\i),)/,replace:"$2.forEach(f=>f.filename=$self.anonymise(f)),$1"}},{find:".Messages.ATTACHMENT_UTILITIES_SPOILER",replacement:{match:/(?<=children:\[)(?=.{10,80}tooltip:.{0,100}\i\.\i\.Messages\.ATTACHMENT_UTILITIES_SPOILER)/,replace:"arguments[0].canEdit!==false?$self.renderIcon(arguments[0]):null,"}}],settings:ur,renderIcon:_.wrap(({upload:e,channelId:t,draftType:o})=>{let r=e.anonymise??ur.store.anonymiseByDefault;return n(GC,{tooltip:r?"Using anonymous file name":"Using normal file name",onClick:()=>{e.anonymise=!r,HC.update(t,e.id,o,{})}},r?n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},n("path",{fill:"currentColor",d:"M17.06 13C15.2 13 13.64 14.33 13.24 16.1C12.29 15.69 11.42 15.8 10.76 16.09C10.35 14.31 8.79 13 6.94 13C4.77 13 3 14.79 3 17C3 19.21 4.77 21 6.94 21C9 21 10.68 19.38 10.84 17.32C11.18 17.08 12.07 16.63 13.16 17.34C13.34 19.39 15 21 17.06 21C19.23 21 21 19.21 21 17C21 14.79 19.23 13 17.06 13M6.94 19.86C5.38 19.86 4.13 18.58 4.13 17S5.39 14.14 6.94 14.14C8.5 14.14 9.75 15.42 9.75 17S8.5 19.86 6.94 19.86M17.06 19.86C15.5 19.86 14.25 18.58 14.25 17S15.5 14.14 17.06 14.14C18.62 14.14 19.88 15.42 19.88 17S18.61 19.86 17.06 19.86M22 10.5H2V12H22V10.5M15.53 2.63C15.31 2.14 14.75 1.88 14.22 2.05L12 2.79L9.77 2.05L9.72 2.04C9.19 1.89 8.63 2.17 8.43 2.68L6 9H18L15.56 2.68L15.53 2.63Z"})):n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{transform:"scale(-1,1)"}},n("path",{fill:"currentColor",d:"M22.11 21.46L2.39 1.73L1.11 3L6.31 8.2L6 9H7.11L8.61 10.5H2V12H10.11L13.5 15.37C13.38 15.61 13.3 15.85 13.24 16.1C12.29 15.69 11.41 15.8 10.76 16.09C10.35 14.31 8.79 13 6.94 13C4.77 13 3 14.79 3 17C3 19.21 4.77 21 6.94 21C9 21 10.68 19.38 10.84 17.32C11.18 17.08 12.07 16.63 13.16 17.34C13.34 19.39 15 21 17.06 21C17.66 21 18.22 20.86 18.72 20.61L20.84 22.73L22.11 21.46M6.94 19.86C5.38 19.86 4.13 18.58 4.13 17C4.13 15.42 5.39 14.14 6.94 14.14C8.5 14.14 9.75 15.42 9.75 17C9.75 18.58 8.5 19.86 6.94 19.86M17.06 19.86C15.5 19.86 14.25 18.58 14.25 17C14.25 16.74 14.29 16.5 14.36 16.25L17.84 19.73C17.59 19.81 17.34 19.86 17.06 19.86M22 12H15.2L13.7 10.5H22V12M17.06 13C19.23 13 21 14.79 21 17C21 17.25 20.97 17.5 20.93 17.73L19.84 16.64C19.68 15.34 18.66 14.32 17.38 14.17L16.29 13.09C16.54 13.03 16.8 13 17.06 13M12.2 9L7.72 4.5L8.43 2.68C8.63 2.17 9.19 1.89 9.72 2.04L9.77 2.05L12 2.79L14.22 2.05C14.75 1.88 15.32 2.14 15.54 2.63L15.56 2.68L18 9H12.2Z"})))},{noop:!0}),anonymise(e){if((e.anonymise??ur.store.anonymiseByDefault)===!1)return e.filename;let t=e.filename,r=zC.exec(t)?.index??t.lastIndexOf("."),i=r!==-1?t.slice(r):"";switch(ur.store.method){case 0:let s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";return Array.from({length:ur.store.randomisedLength},()=>s[Math.floor(Math.random()*s.length)]).join("")+i;case 1:return ur.store.consistent+i;case 2:return Date.now()+i}}})});async function N0(e,t){return(await Ur.fetchAssetIds(e,[t]))[0]}async function WC(e){let t={};return await jC.fetchApplicationsRPC(t,e),t.application}var jC,D0,Gi,wd,L0=g(()=>{"use strict";a();Nl();To();P();I();H();T();jC=x("fetchApplicationsRPC","getRemoteIconURL");D0={};wd=y({name:"WebRichPresence (arRPC)",description:"Client plugin for arRPC to enable RPC on Discord Web (experimental)",authors:[m.Ducko],settingsAboutComponent:()=>n(f,null,n(S.FormTitle,{tag:"h3"},"How to use arRPC"),n(S.FormText,null,n(je,{href:"https://github.com/OpenAsar/arrpc/tree/main#server"},"Follow the instructions in the GitHub repo")," to get the server running, and then enable the plugin.")),async handleEvent(e){let t=JSON.parse(e.data),{activity:o}=t,r=o?.assets;if(r?.large_image&&(r.large_image=await N0(o.application_id,r.large_image)),r?.small_image&&(r.small_image=await N0(o.application_id,r.small_image)),o){let i=o.application_id;D0[i]||=await WC(i);let s=D0[i];o.name||=s.name}B.dispatch({type:"LOCAL_ACTIVITY_UPDATE",...t})},async start(){if("armcord"in window)return;if(Gi&&Gi.close(),Gi=new WebSocket("ws://127.0.0.1:1337"),Gi.onmessage=this.handleEvent,!await new Promise(t=>setTimeout(()=>t(Gi.readyState===WebSocket.OPEN),1e3))){js("Failed to connect to arRPC, is it running?","Retry",()=>{Up(),this.start()});return}X.show({message:"Connected to arRPC",type:X.Type.SUCCESS,id:X.genId(),options:{duration:1e3,position:X.Position.BOTTOM}})},stop(){B.dispatch({type:"LOCAL_ACTIVITY_UPDATE",activity:null}),Gi?.close()}})});var xd,E0=g(()=>{"use strict";a();P();I();xd=y({name:"BANger",description:"Replaces the GIF in the ban dialogue with a custom one.",authors:[m.Xinto,m.Glitch],patches:[{find:"BAN_CONFIRM_TITLE.",replacement:{match:/src:\i\("\d+"\)/g,replace:"src: Vencord.Settings.plugins.BANger.source"}}],options:{source:{description:"Source to replace ban GIF with (Video or Gif)",type:0,default:"https://i.imgur.com/wp5q52C.mp4",restartNeeded:!0}}})});var O0,_0,qC,B0,F0=g(()=>{"use strict";a();le();H();T();Md();O0=Re("ChannelRTCStore"),_0=x("a","animated","useTransition"),qC=Ne('("guildsnav")'),B0=_.wrap(e=>{let t=Be([Hi],()=>Hi.getExpandedFolders()),o=Be([O0],()=>O0.isFullscreenInContext()),r=n(qC,{...e,isBetterFolders:!0,betterFoldersExpandedIds:t}),i=!!t.size,s=document.querySelector(e.className.split(" ").map(c=>`.${c}`).join("")),l={display:o?"none":"flex"};return!s||!Pt.store.sidebarAnim?i?n("div",{style:l},r):null:n(_0.Transition,{items:i,from:{width:0},enter:{width:s.getBoundingClientRect().width},leave:{width:0},config:{duration:200}},(c,u)=>u&&n(_0.animated.div,{style:{...c,...l}},r))},{noop:!0})});function ZC(e){return YC.getGuildFolders().find(t=>t.guildIds.includes(e))}function $0(){for(let e of Hi.getExpandedFolders())Pd.toggleGuildFolderExpand(e)}var KC,YC,Hi,Pd,U0,Id,Pt,Ad,Md=g(()=>{"use strict";a();$();P();I();H();T();F0();({GuildsTree:KC}=x("GuildsTree")),YC=Re("SortedGuildStore"),Hi=Re("ExpandedGuildFolderStore"),Pd=x("move","toggleGuildFolderExpand"),U0=null,Id=!1;Pt=N({sidebar:{type:3,description:"Display servers from folder on dedicated sidebar",restartNeeded:!0,default:!0},sidebarAnim:{type:3,description:"Animate opening the folder sidebar",default:!0},closeAllFolders:{type:3,description:"Close all folders when selecting a server not in a folder",default:!1},closeAllHomeButton:{type:3,description:"Close all folders when clicking on the home button",restartNeeded:!0,default:!1},closeOthers:{type:3,description:"Close other folders when opening a folder",default:!1},forceOpen:{type:3,description:"Force a folder to open when switching to a server of that folder",default:!1},keepIcons:{type:3,description:"Keep showing guild icons in the primary guild bar folder when it's open in the BetterFolders sidebar",restartNeeded:!0,default:!1},showFolderIcon:{type:4,description:"Show the folder icon above the folder guilds in the BetterFolders sidebar",options:[{label:"Never",value:0},{label:"Always",value:1,default:!0},{label:"When more than one folder is expanded",value:2}],restartNeeded:!0}}),Ad=y({name:"BetterFolders",description:"Shows server folders on dedicated sidebar and adds folder related improvements",authors:[m.juby,m.AutumnVN,m.Nuckyz],settings:Pt,patches:[{find:'("guildsnav")',predicate:()=>Pt.store.sidebar,replacement:[{match:/(?<=let{disableAppDownload:\i=\i\.isPlatformEmbedded,isOverlay:.+?)(?=}=\i,)/,replace:",isBetterFolders"},{match:/(useStateFromStoresArray\).{0,25}let \i)=(\i\.\i.getGuildsTree\(\))/,replace:(e,t,o)=>`${t}=$self.getGuildTree(!!arguments[0].isBetterFolders,${o},arguments[0].betterFoldersExpandedIds)`},{match:/lastTargetNode:\i\[\i\.length-1\].+?Fragment.+?\]}\)\]/,replace:"$&.filter($self.makeGuildsBarGuildListFilter(!!arguments[0].isBetterFolders))"},{match:/unreadMentionsIndicatorBottom,barClassName.+?}\)\]/,replace:"$&.filter($self.makeGuildsBarTreeFilter(!!arguments[0].isBetterFolders))"},{match:/(?<=\.Messages\.SERVERS.+?switch\((\i)\.type\){case \i\.\i\.FOLDER:.+?folderNode:\i,)/,replace:'isBetterFolders:typeof isBetterFolders!=="undefined"?isBetterFolders:false,'}]},{find:".MAX_GUILD_FOLDER_NAME_LENGTH,",predicate:()=>Pt.store.sidebar&&Pt.store.showFolderIcon!==1,replacement:[{match:/(useStateFromStores\).{0,20}=>)(\i\.\i)\.isFolderExpanded\(\i\)/,replace:(e,t,o)=>`${t}${o}.getExpandedFolders()`},{match:/(?<=folderNode:(\i),expanded:)\i(?=,)/,replace:(e,t)=>`typeof ${e}==="boolean"?${e}:${e}.has(${t}.id),betterFoldersExpandedIds:${e} instanceof Set?${e}:void 0`}]},{find:".FOLDER_ITEM_GUILD_ICON_MARGIN);",predicate:()=>Pt.store.sidebar,replacement:[{predicate:()=>Pt.store.keepIcons,match:/(?<=let{folderNode:\i,setNodeRef:\i,.+?expanded:(\i),.+?;)(?=let)/,replace:(e,t)=>`${t}=!!arguments[0].isBetterFolders&&${t};`},{predicate:()=>!Pt.store.keepIcons,match:/(?<=\.Messages\.SERVER_FOLDER_PLACEHOLDER.+?useTransition\)\()/,replace:"!!arguments[0].isBetterFolders&&"},{predicate:()=>!Pt.store.keepIcons,match:/expandedFolderBackground,.+?,(?=\i\(\(\i,\i,\i\)=>{let{key.{0,45}ul)(?<=selected:\i,expanded:(\i),.+?)/,replace:(e,t)=>`${e}!arguments[0].isBetterFolders&&${t}?null:`},{predicate:()=>Pt.store.showFolderIcon!==1,match:/(?<=\.wrapper,children:\[)/,replace:"$self.shouldShowFolderIconAndBackground(!!arguments[0].isBetterFolders,arguments[0].betterFoldersExpandedIds)&&"},{predicate:()=>Pt.store.showFolderIcon!==1,match:/(?<=\.expandedFolderBackground.+?}\),)(?=\i,)/,replace:"!$self.shouldShowFolderIconAndBackground(!!arguments[0].isBetterFolders,arguments[0].betterFoldersExpandedIds)?null:"}]},{find:"APPLICATION_LIBRARY,render",predicate:()=>Pt.store.sidebar,replacement:{match:/(?<=({className:\i\.guilds,themeOverride:\i})\))/,replace:",$self.FolderSideBar($1)"}},{find:".Messages.DISCODO_DISABLED",predicate:()=>Pt.store.closeAllHomeButton,replacement:{match:/(?<=onClick:\(\)=>{)(?=.{0,200}"discodo")/,replace:"$self.closeFolders();"}}],flux:{CHANNEL_SELECT(e){if(!(!Pt.store.closeAllFolders&&!Pt.store.forceOpen)&&U0!==e.guildId){U0=e.guildId;let t=ZC(e.guildId);t?.folderId?Pt.store.forceOpen&&!Hi.isFolderExpanded(t.folderId)&&Pd.toggleGuildFolderExpand(t.folderId):Pt.store.closeAllFolders&&$0()}},TOGGLE_GUILD_FOLDER_EXPAND(e){Pt.store.closeOthers&&!Id&&(Id=!0,B.wait(()=>{let t=Hi.getExpandedFolders();if(t.size>1)for(let o of t)o!==e.folderId&&Pd.toggleGuildFolderExpand(o);Id=!1}))}},getGuildTree(e,t,o){if(!e||o==null)return t;let r=new KC;return r.root.children=t.root.children.filter(i=>o.has(i.id)),r.nodes=Object.fromEntries(Object.entries(t.nodes).filter(([i,s])=>o.has(s.id)||o.has(s.parentId))),r},makeGuildsBarGuildListFilter(e){return t=>e?t?.props?.["aria-label"]===Ye.Messages.SERVERS:!0},makeGuildsBarTreeFilter(e){return t=>e?"onScroll"in t.props:!0},shouldShowFolderIconAndBackground(e,t){if(!e)return!0;switch(Pt.store.showFolderIcon){case 0:return!1;case 1:return!0;case 2:return(t?.size??0)>1;default:return!0}},FolderSideBar:e=>n(B0,{...e}),closeFolders:$0})});var Cd,G0=g(()=>{"use strict";a();P();I();Cd=y({name:"BetterGifAltText",authors:[m.Ven],description:"Change GIF alt text from simply being 'GIF' to containing the gif tags / filename",patches:[{find:"onCloseImage=",replacement:{match:/(return.{0,10}\.jsx.{0,50}isWindowFocused)/,replace:"$self.altify(e);$1"}},{find:".Messages.GIF,",replacement:{match:/alt:(\i)=(\i\.default\.Messages\.GIF)(?=,[^}]*\}=(\i))/,replace:"alt_$$:$1=$self.altify($3)||$2"}}],altify(e){if(e.alt??="GIF",e.alt!=="GIF")return e.alt;let t=e.original||e.src;try{t=decodeURI(t)}catch{}let o=t.slice(t.lastIndexOf("/")+1).replace(/\d/g,"").replace(/.gif$/,"").split(/[,\-_ ]+/g).slice(0,20).join(" ");return o.length>300&&(o=o.slice(0,300)+"..."),o&&(e.alt+=` - ${o}`),e.alt}})});var Rd,H0=g(()=>{"use strict";a();P();I();Rd=y({name:"BetterGifPicker",description:"Makes the gif picker open the favourite category by default",authors:[m.Samwich],patches:[{find:".GIFPickerResultTypes.SEARCH",replacement:[{match:"this.state={resultType:null}",replace:'this.state={resultType:"Favorites"}'}]}]})});var XC,kd,z0=g(()=>{"use strict";a();$();P();I();H();XC=x("section","lastSection"),kd=y({name:"BetterNotesBox",description:"Hide notes or disable spellcheck (Configure in settings!!)",authors:[m.Ven],patches:[{find:"hideNote:",all:!0,noWarn:!0,predicate:()=>Vencord.Settings.plugins.BetterNotesBox.hide,replacement:{match:/hideNote:.+?(?=([,}].*?\)))/g,replace:(e,t)=>t.match(/}=.+/)==null?"hideNote:!0":e}},{find:"Messages.NOTE_PLACEHOLDER",replacement:{match:/\.NOTE_PLACEHOLDER,/,replace:"$&spellCheck:!Vencord.Settings.plugins.BetterNotesBox.noSpellCheck,"}},{find:".Messages.NOTE}",replacement:{match:/(?<=return \i\?)null(?=:\(0,\i\.jsxs)/,replace:"$self.patchPadding(arguments[0])"}}],options:{hide:{type:3,description:"Hide notes",default:!1,restartNeeded:!0},noSpellCheck:{type:3,description:"Disable spellcheck in notes",disabled:()=>G.plugins.BetterNotesBox.hide,default:!1}},patchPadding(e){if(!!e.lastSection)return n("div",{className:XC.lastSection})}})});function JC(){return n("svg",{role:"img",width:"18",height:"18",fill:"none",viewBox:"0 0 24 24"},n("path",{fill:"currentColor",d:"m13.96 5.46 4.58 4.58a1 1 0 0 0 1.42 0l1.38-1.38a2 2 0 0 0 0-2.82l-3.18-3.18a2 2 0 0 0-2.82 0l-1.38 1.38a1 1 0 0 0 0 1.42ZM2.11 20.16l.73-4.22a3 3 0 0 1 .83-1.61l7.87-7.87a1 1 0 0 1 1.42 0l4.58 4.58a1 1 0 0 1 0 1.42l-7.87 7.87a3 3 0 0 1-1.6.83l-4.23.73a1.5 1.5 0 0 1-1.73-1.73Z"}))}function QC(){return n("svg",{width:"18",height:"18",viewBox:"0 0 24 24"},n("path",{fill:"currentColor",d:"M 12,0 C 5.3733333,0 0,5.3733333 0,12 c 0,6.626667 5.3733333,12 12,12 1.106667,0 2,-0.893333 2,-2 0,-0.52 -0.2,-0.986667 -0.52,-1.346667 -0.306667,-0.346666 -0.506667,-0.813333 -0.506667,-1.32 0,-1.106666 0.893334,-2 2,-2 h 2.36 C 21.013333,17.333333 24,14.346667 24,10.666667 24,4.7733333 18.626667,0 12,0 Z M 4.6666667,12 c -1.1066667,0 -2,-0.893333 -2,-2 0,-1.1066667 0.8933333,-2 2,-2 1.1066666,0 2,0.8933333 2,2 0,1.106667 -0.8933334,2 -2,2 z M 8.666667,6.6666667 c -1.106667,0 -2.0000003,-0.8933334 -2.0000003,-2 0,-1.1066667 0.8933333,-2 2.0000003,-2 1.106666,0 2,0.8933333 2,2 0,1.1066666 -0.893334,2 -2,2 z m 6.666666,0 c -1.106666,0 -2,-0.8933334 -2,-2 0,-1.1066667 0.893334,-2 2,-2 1.106667,0 2,0.8933333 2,2 0,1.1066666 -0.893333,2 -2,2 z m 4,5.3333333 c -1.106666,0 -2,-0.893333 -2,-2 0,-1.1066667 0.893334,-2 2,-2 1.106667,0 2,0.8933333 2,2 0,1.106667 -0.893333,2 -2,2 z"}))}var j0,Nd,W0=g(()=>{"use strict";a();P();mt();I();H();T();j0=x("open","selectRole","updateGuild");Nd=y({name:"BetterRoleContext",description:"Adds options to copy role color / edit role when right clicking roles in the user profile",authors:[m.Ven],start(){Ts.DeveloperMode.updateSetting(!0)},contextMenus:{"dev-context"(e,{id:t}){let o=Js();if(!o)return;let r=ae.getRole(o.id,t);!r||(r.colorString&&e.push(n(L.MenuItem,{id:"vc-copy-role-color",label:"Copy Role Color",action:()=>Ft.copy(r.colorString),icon:QC})),_e.getGuildPermissionProps(o).canManageRoles&&e.push(n(L.MenuItem,{id:"vc-edit-role",label:"Edit Role",action:async()=>{await j0.open(o.id,"ROLES"),j0.selectRole(t)},icon:JC})))}}})});var Dd,q0=g(()=>{"use strict";a();$();P();I();T();Dd=y({name:"BetterRoleDot",authors:[m.Ven,m.AutumnVN],description:"Copy role colour on RoleDot (accessibility setting) click. Also allows using both RoleDot and coloured names simultaneously",patches:[{find:".dotBorderBase",replacement:{match:/,viewBox:"0 0 20 20"/,replace:"$&,onClick:()=>$self.copyToClipBoard(arguments[0].color),style:{cursor:'pointer'}"}},{find:'"dot"===',all:!0,noWarn:!0,predicate:()=>G.plugins.BetterRoleDot.bothStyles,replacement:{match:/"(?:username|dot)"===\i(?!\.\i)/g,replace:"true"}},{find:".ADD_ROLE_A11Y_LABEL",predicate:()=>G.plugins.BetterRoleDot.copyRoleColorInProfilePopout&&!G.plugins.BetterRoleDot.bothStyles,noWarn:!0,replacement:{match:/"dot"===\i/,replace:"true"}},{find:".roleVerifiedIcon",predicate:()=>G.plugins.BetterRoleDot.copyRoleColorInProfilePopout&&!G.plugins.BetterRoleDot.bothStyles,noWarn:!0,replacement:{match:/"dot"===\i/,replace:"true"}}],options:{bothStyles:{type:3,description:"Show both role dot and coloured names",restartNeeded:!0,default:!1},copyRoleColorInProfilePopout:{type:3,description:"Allow click on role dot in profile popout to copy role color",restartNeeded:!0,default:!1}},copyToClipBoard(e){Ft.copy(e),X.show({message:"Copied to Clipboard!",type:X.Type.SUCCESS,id:X.genId(),options:{duration:1e3,position:X.Position.BOTTOM}})}})});function eR({mode:e,baseLayer:t=!1,...o}){let r=e==="HIDDEN",i=xt(null);se(()=>()=>{Wo.dispatch("LAYER_POP_START"),Wo.dispatch("LAYER_POP_COMPLETE")},[]);let s=n("div",{ref:i,"aria-hidden":r,className:VC({[K0.layer]:!0,[K0.baseLayer]:t,"stop-animations":r}),style:{opacity:r?0:void 0},...o});return t?s:n(ll,{containerRef:i},s)}var VC,K0,zi,Ld,Y0=g(()=>{"use strict";a();$();Qe();le();P();I();H();T();VC=ve(""),K0=x("animating","baseLayer","bg","layer","layers"),zi=N({disableFade:{description:"Disable the crossfade animation",type:3,default:!0,restartNeeded:!0},organizeMenu:{description:"Organizes the settings cog context menu into categories",type:3,default:!0},eagerLoad:{description:"Removes the loading delay when opening the menu for the first time",type:3,default:!0,restartNeeded:!0}});Ld=y({name:"BetterSettings",description:"Enhances your settings-menu-opening experience",authors:[m.Kyuuhachi],settings:zi,patches:[{find:"this.renderArtisanalHack()",replacement:[{match:/(?<=(\i)\.contextType=\i\.AccessibilityPreferencesContext;)/,replace:"$1=$self.Layer;",predicate:()=>zi.store.disableFade},{match:/createPromise:\(\)=>([^:}]*?),webpackId:"\d+",name:(?!="CollectiblesShop")"[^"]+"/g,replace:"$&,_:$1",predicate:()=>zi.store.eagerLoad}]},{find:"DefaultCustomContentScroller:function()",replacement:[{match:/\(0,\i\.useTransition\)\((\i)/,replace:"(_cb=>_cb(void 0,$1))||$&"},{match:/\i\.animated\.div/,replace:'"div"'}],predicate:()=>zi.store.disableFade},{find:"Messages.USER_SETTINGS_WITH_BUILD_OVERRIDE.format",replacement:{match:/(?<=handleOpenSettingsContextMenu.{0,250}?\i\.el\(("[^"]+")\)\.then\([^;]*?("\d+").*?Messages\.USER_SETTINGS,)(?=onClick:)/,replace:"onMouseEnter(){Vencord.Webpack.wreq.el($1).then(()=>Vencord.Webpack.wreq($2));},"},predicate:()=>zi.store.eagerLoad},{find:"Messages.USER_SETTINGS_ACTIONS_MENU_LABEL",replacement:{match:/\(0,\i.default\)\(\)(?=\.filter\(\i=>\{let\{section:\i\}=)/,replace:"$self.wrapMenu($&)"}}],Layer(e){return n(_,{fallback:()=>e.children},n(eR,{...e}))},wrapMenu(e){if(!zi.store.organizeMenu)return e;let t=[{label:null,items:[]}];for(let o of e)o.section==="HEADER"?t.push({label:o.label,items:[]}):o.section==="DIVIDER"?t.push({label:Ye.Messages.OTHER_OPTIONS,items:[]}):t.at(-1).items.push(o);return{filter(o){for(let r of t)r.items=r.items.filter(o);return this},map(o){return t.filter(r=>r.items.length>0).map(({label:r,items:i})=>{let s=i.map(o);return r?n(L.MenuItem,{id:r.replace(/\W/,"_"),label:r,children:s,action:s[0].props.action}):s})}}}})});var Ed,Z0=g(()=>{"use strict";a();P();I();Ed=y({name:"BetterUploadButton",authors:[m.fawn,m.Ven],description:"Upload with a single click, open menu with right click",patches:[{find:"Messages.CHAT_ATTACH_UPLOAD_OR_INVITE",replacement:{match:/CHAT_ATTACH_UPLOAD_OR_INVITE,onDoubleClick:(.+?:void 0),\.\.\.(\i),/,replace:"$&onClick:$1,onContextMenu:$2.onClick,"}}]})});var X0,J0,Q0=g(()=>{"use strict";a();H();X0=Re("ApplicationStreamPreviewStore"),J0=Re("ApplicationStreamingStore")});var tR,V0,oR,nR,Od,eS=g(()=>{"use strict";a();It();P();mt();I();T();Q0();tR=async({guildId:e,channelId:t,ownerId:o})=>{let r=await X0.getPreviewURL(e,t,o);!r||tn(r)},V0=(e,{userId:t})=>{let o=J0.getAnyStreamForUser(t);if(!o)return;let r=n(L.MenuItem,{label:"View Stream Preview",id:"view-stream-preview",icon:Ov,action:()=>o&&tR(o),disabled:!o});e.push(n(L.MenuSeparator,null),r)},oR=(e,{stream:t})=>V0(e,{userId:t.ownerId}),nR=(e,{user:t})=>{if(t)return V0(e,{userId:t.id})},Od=y({name:"BiggerStreamPreview",description:"This plugin allows you to enlarge stream previews",authors:[m.phil],contextMenus:{"user-context":nR,"stream-context":oR}})});function tS(){ra.textContent=` - .vc-nsfw-img [class^=imageWrapper] img, - .vc-nsfw-img [class^=wrapperPaused] video { - filter: blur(${G.plugins.BlurNSFW.blurAmount}px); - transition: filter 0.2s; - } - .vc-nsfw-img [class^=imageWrapper]:hover img, - .vc-nsfw-img [class^=wrapperPaused]:hover video { - filter: unset; - } - `}var ra,_d,oS=g(()=>{"use strict";a();$();P();I();_d=y({name:"BlurNSFW",description:"Blur attachments in NSFW channels until hovered",authors:[m.Ven],patches:[{find:".embedWrapper,embed",replacement:[{match:/\.embedWrapper(?=.+?channel_id:(\i)\.id)/g,replace:"$&+($1.nsfw?' vc-nsfw-img':'')"}]}],options:{blurAmount:{type:1,description:"Blur Amount",default:10,onChange:tS}},start(){ra=document.createElement("style"),ra.id="VcBlurNsfw",document.head.appendChild(ra),tS()},stop(){ra?.remove()}})});function rR(e){let t=G.plugins.CallTimer.format==="human",o=d=>t?d:d.toString().padStart(2,"0"),r=d=>t?d:"",i=t?" ":":",s=Math.floor(e/864e5),l=Math.floor(e%864e5/36e5),c=Math.floor(e%864e5%36e5/6e4),u=Math.floor(e%864e5%36e5%6e4/1e3),p="";return s&&(p+=`${s}d `),(l||p)&&(p+=`${o(l)}${r("h")}${i}`),(c||p||!t)&&(p+=`${o(c)}${r("m")}${i}`),p+=`${o(u)}${r("s")}`,p}var Bd,nS=g(()=>{"use strict";a();$();le();P();lt();I();Bd=y({name:"CallTimer",description:"Adds a timer to vcs",authors:[m.Ven],startTime:0,interval:void 0,options:{format:{type:4,description:"The timer format. This can be any valid moment.js format",options:[{label:"30d 23:00:42",value:"stopwatch",default:!0},{label:"30d 23h 00m 42s",value:"human"}]}},patches:[{find:"renderConnectionStatus(){",replacement:{match:/(?<=renderConnectionStatus\(\)\{.+\.channel,children:)\i/,replace:"[$&, $self.renderTimer(this.props.channel.id)]"}}],renderTimer(e){return n(_,{noop:!0},n(this.Timer,{channelId:e}))},Timer({channelId:e}){let t=Ns({deps:[e]});return n("p",{style:{margin:0}},"Connected for ",n("span",{style:{fontFamily:"var(--font-code)"}},rR(t)))}})});var jd={};qe(jd,{_handleClick:()=>aR,_handlePreEdit:()=>sR,_handlePreSend:()=>iR,addClickListener:()=>Hd,addPreEditListener:()=>ti,addPreSendListener:()=>Vt,removeClickListener:()=>zd,removePreEditListener:()=>oi,removePreSendListener:()=>eo});async function iR(e,t,o,r){o.replyOptions=r;for(let i of Ud)try{if((await i(e,t,o))?.cancel)return!0}catch(s){Fd.error(`MessageSendHandler: Listener encountered an unknown error -`,s)}return!1}async function sR(e,t,o){for(let r of $d)try{if((await r(e,t,o))?.cancel)return!0}catch(i){Fd.error(`MessageEditHandler: Listener encountered an unknown error -`,i)}return!1}function Vt(e){return Ud.add(e),e}function ti(e){return $d.add(e),e}function eo(e){return Ud.delete(e)}function oi(e){return $d.delete(e)}function aR(e,t,o){e=zo.getMessage(t.id,e.id)??e;for(let r of Gd)try{r(e,t,o)}catch(i){Fd.error(`MessageClickHandler: Listener encountered an unknown error -`,i)}}function Hd(e){return Gd.add(e),e}function zd(e){return Gd.delete(e)}var Fd,Ud,$d,Gd,gn=g(()=>{"use strict";a();Ke();T();Fd=new oe("MessageEvents","#e5c890"),Ud=new Set,$d=new Set;Gd=new Set});var rS,iS=g(()=>{"use strict";a();rS=["action_object_map","action_type_map","action_ref_map","spm@*.aliexpress.com","scm@*.aliexpress.com","aff_platform","aff_trace_key","algo_expid@*.aliexpress.*","algo_pvid@*.aliexpress.*","btsid","ws_ab_test","pd_rd_*@amazon.*","_encoding@amazon.*","psc@amazon.*","tag@amazon.*","ref_@amazon.*","pf_rd_*@amazon.*","pf@amazon.*","crid@amazon.*","keywords@amazon.*","sprefix@amazon.*","sr@amazon.*","ie@amazon.*","node@amazon.*","qid@amazon.*","callback@bilibili.com","cvid@bing.com","form@bing.com","sk@bing.com","sp@bing.com","sc@bing.com","qs@bing.com","pq@bing.com","sc_cid","mkt_tok","trk","trkCampaign","ga_*","gclid","gclsrc","hmb_campaign","hmb_medium","hmb_source","spReportId","spJobID","spUserID","spMailingID","itm_*","s_cid","elqTrackId","elqTrack","assetType","assetId","recipientId","campaignId","siteId","mc_cid","mc_eid","pk_*","sc_campaign","sc_channel","sc_content","sc_medium","sc_outcome","sc_geo","sc_country","nr_email_referer","vero_conv","vero_id","yclid","_openstat","mbid","cmpid","cid","c_id","campaign_id","Campaign","hash@ebay.*","fb_action_ids","fb_action_types","fb_ref","fb_source","fbclid","refsrc@facebook.com","hrc@facebook.com","gs_l","gs_lcp@google.*","ved@google.*","ei@google.*","sei@google.*","gws_rd@google.*","gs_gbg@google.*","gs_mss@google.*","gs_rn@google.*","_hsenc","_hsmi","__hssc","__hstc","hsCtaTracking","source@sourceforge.net","position@sourceforge.net","t@*.twitter.com","s@*.twitter.com","ref_*@*.twitter.com","t@*.x.com","s@*.x.com","ref_*@*.x.com","t@*.fixupx.com","s@*.fixupx.com","ref_*@*.fixupx.com","t@*.fxtwitter.com","s@*.fxtwitter.com","ref_*@*.fxtwitter.com","t@*.twittpr.com","s@*.twittpr.com","ref_*@*.twittpr.com","t@*.fixvx.com","s@*.fixvx.com","ref_*@*.fixvx.com","tt_medium","tt_content","lr@yandex.*","redircnt@yandex.*","feature@*.youtube.com","kw@*.youtube.com","si@*.youtube.com","pp@*.youtube.com","si@*.youtu.be","wt_zmc","utm_source","utm_content","utm_medium","utm_campaign","utm_term","si@open.spotify.com","igshid","igsh","share_id@reddit.com"]});var sS,lR,Wd,aS=g(()=>{"use strict";a();gn();P();I();iS();sS=/[\\^$.*+?()[\]{}|]/g,lR=RegExp(sS.source),Wd=y({name:"ClearURLs",description:"Removes tracking garbage from URLs",authors:[m.adryd],dependencies:["MessageEventsAPI"],escapeRegExp(e){return e&&lR.test(e)?e.replace(sS,"\\$&"):e||""},createRules(){let e=rS;this.universalRules=new Set,this.rulesByHost=new Map,this.hostRules=new Map;for(let t of e){let o=t.split("@"),r=new RegExp("^"+this.escapeRegExp(o[0]).replace(/\\\*/,".+?")+"$");if(!o[1]){this.universalRules.add(r);continue}let i=new RegExp("^(www\\.)?"+this.escapeRegExp(o[1]).replace(/\\\./,"\\.").replace(/^\\\*\\\./,"(.+?\\.)?").replace(/\\\*/,".+?")+"$"),s=i.toString();this.hostRules.set(s,i),this.rulesByHost.get(s)==null&&this.rulesByHost.set(s,new Set),this.rulesByHost.get(s).add(r)}},removeParam(e,t,o){(t===e||e instanceof RegExp&&e.test(t))&&o.delete(t)},replacer(e){try{var t=new URL(e)}catch{return e}return t.searchParams.entries().next().done?e:(this.universalRules.forEach(o=>{t.searchParams.forEach((r,i,s)=>{this.removeParam(o,i,s)})}),this.hostRules.forEach((o,r)=>{!o.test(t.hostname)||this.rulesByHost.get(r).forEach(i=>{t.searchParams.forEach((s,l,c)=>{this.removeParam(i,l,c)})})}),t.toString())},onSend(e){e.content.match(/http(s)?:\/\//)&&(e.content=e.content.replace(/(https?:\/\/[^\s<]+[^<.,:;"'>)|\]\s])/g,t=>this.replacer(t)))},start(){this.createRules(),this.preSend=Vt((e,t)=>this.onSend(t)),this.preEdit=ti((e,t,o)=>this.onSend(o))},stop(){eo(this.preSend),oi(this.preEdit)}})});var lS=g(()=>{});function fS(e){let t=e.toString(16).padStart(6,"0");ia.store.color=t,gS(t)}function cS(e){pR({theme:e})}function dR(){let e=Be([uS],()=>uS.theme),t=e==="light",o=t?"dark":"light",i=Be([pS],()=>pS.gradientPreset)!==void 0,s=SR(ia.store.color),l=!1,c=!0;return(t&&s<.26||!t&&s>.12)&&(l=!0),s<.26&&s>.12&&(c=!1),t&&s>.65&&(l=!0,c=!1),n("div",{className:"client-theme-settings"},n("div",{className:"client-theme-container"},n("div",{className:"client-theme-settings-labels"},n(S.FormTitle,{tag:"h3"},"Theme Color"),n(S.FormText,null,"Add a color to your Discord client theme")),n(cR,{color:parseInt(ia.store.color,16),onChange:fS,showEyeDropper:!1,suggestedColors:uR})),(l||i)&&n(f,null,n(S.FormDivider,{className:Q(j.top8,j.bottom8)}),n("div",{className:`client-theme-contrast-warning ${l?t?"theme-dark":"theme-light":""}`},n("div",{className:"client-theme-warning"},n(S.FormText,null,"Warning, your theme won't look good:"),l&&n(S.FormText,null,"Selected color won't contrast well with text"),i&&n(S.FormText,null,"Nitro themes aren't supported")),l&&c&&n(k,{onClick:()=>cS(o),color:k.Colors.RED},"Switch to ",o," mode"),i&&n(k,{onClick:()=>cS(e),color:k.Colors.RED},"Disable Nitro Theme"))))}function mS(e,t,o){return Object.entries(e).filter(([r])=>r.search(t)>-1).map(([r,i])=>{let s=i-e[o],l=s>=0?"+":"-";return`${r}: var(--theme-h) var(--theme-s) calc(var(--theme-l) ${l} ${Math.abs(s).toFixed(2)}%);`}).join(` -`)}function gR(e){let t={},o=dS.exec(e);for(;o!==null;){let[,r,i]=o;t[r]=parseFloat(i),o=dS.exec(e)}Kd("clientThemeOffsets",[`.theme-light { - ${mS(t,mR,"--primary-345-hsl")} -}`,`.theme-dark { - ${mS(t,fR,"--primary-600-hsl")} -}`].join(` - -`))}function hR(e){let t=/\.theme-light[^{]*\{[^}]*var\(--white-500\)[^}]*}/gm,o=[...e.matchAll(t)].flat(),r=/^([^{]*)\{background:var\(--white-500\)/m,i=/^([^{]*)\{background-color:var\(--white-500\)/m,s=Kl(o,M=>ql(M,r)).join(`, -`),l=Kl(o,M=>ql(M,i)).join(`, -`),c=`${s} { - background: var(--primary-100) -}`,u=`${l} { - background-color: var(--primary-100) -}`,p=/\.theme-light\{([^}]*--[^:}]*(?:background|bg)[^:}]*:var\(--white-500\)[^}]*)\}/m,d=/^(--[^:]*(?:background|bg)[^:]*):var\(--white-500\)/m,h=Kl(o,M=>ql(M,p)).map(M=>M.split(";")).flat(),b=`.theme-light { - ${Kl(h,M=>ql(M,d)).map(M=>`${M}: var(--primary-100);`).join(` -`)} -}`;Kd("clientThemeLightModeFixes",[c,u,b].join(` - -`))}function ql(e,t){let o=e.match(t);return o===null?null:o[1]}function Kl(e,t){return e.map(t).filter(Boolean)}function gS(e){let{hue:t,saturation:o,lightness:r}=vR(e),i=document.getElementById("clientThemeVars");i||(i=Kd("clientThemeVars")),i.textContent=`:root { - --theme-h: ${t}; - --theme-s: ${o}%; - --theme-l: ${r}%; - }`}function Kd(e,t=""){let o=document.createElement("style");return o.setAttribute("id",e),o.textContent=t.split(` -`).map(r=>r.trim()).join(` -`),document.body.appendChild(o),o}async function yR(){let e="",t=document.querySelectorAll('link[rel="stylesheet"]');for(let o of t){let r=o.getAttribute("href");if(!r)continue;let i=await fetch(r);e+=await i.text()}return e}function vR(e){let t=parseInt(e.substring(0,2),16)/255,o=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,i=Math.max(t,o,r),s=Math.min(t,o,r),l=i-s,c,u,p;return p=(i+s)/2,l===0?(c=0,u=0):(u=l/(1-Math.abs(2*p-1)),i===t?c=(o-r)/l%6:i===o?c=(r-t)/l+2:c=(t-o)/l+4,c*=60,c<0&&(c+=360)),u*=100,p*=100,{hue:c,saturation:u,lightness:p}}function SR(e){let t=s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4,o=t(parseInt(e.substring(0,2),16)/255),r=t(parseInt(e.substring(2,4),16)/255),i=t(parseInt(e.substring(4,6),16)/255);return o*.2126+r*.7152+i*.0722}var cR,uR,pR,uS,pS,ia,qd,dS,mR,fR,hS=g(()=>{"use strict";a();lS();$();P();ot();we();I();H();T();cR=Ne(".Messages.USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR",".BACKGROUND_PRIMARY)"),uR=["#1E1514","#172019","#13171B","#1C1C28","#402D2D","#3A483D","#344242","#313D4B","#2D2F47","#322B42","#3C2E42","#422938","#b6908f","#bfa088","#d3c77d","#86ac86","#88aab3","#8693b5","#8a89ba","#ad94bb"];({saveClientTheme:pR}=x("saveClientTheme"));uS=Re("ThemeStore"),pS=Re("ClientThemesBackgroundStore");ia=N({color:{description:"Color your Discord client theme will be based around. Light mode isn't supported",type:6,default:"313338",component:()=>n(dR,null)},resetColor:{description:"Reset Theme Color",type:6,default:"313338",component:()=>n(k,{onClick:()=>fS(3224376)},"Reset Theme Color")}}),qd=y({name:"ClientTheme",authors:[m.F53,m.Nuckyz],description:"Recreation of the old client theme experiment. Add a color to your Discord client theme",settings:ia,startAt:"DOMContentLoaded",async start(){gS(ia.store.color);let e=await yR();gR(e),hR(e)},stop(){document.getElementById("clientThemeVars")?.remove(),document.getElementById("clientThemeOffsets")?.remove()}}),dS=/(--primary-\d{3}-hsl):.*?(\S*)%;/g,mR=/^--primary-[1-5]\d{2}-hsl/g,fR=/^--primary-[5-9]\d{2}-hsl/g});var Yd,yS=g(()=>{"use strict";a();P();I();Yd=y({name:"ColorSighted",description:"Removes the colorblind-friendly icons from statuses, just like 2015-2017 Discord",authors:[m.lewisakura],patches:[{find:"Masks.STATUS_ONLINE",replacement:{match:/Masks\.STATUS_(?:IDLE|DND|STREAMING|OFFLINE)/g,replace:"Masks.STATUS_ONLINE"}},{find:".AVATAR_STATUS_MOBILE_16;",replacement:{match:/(?<=fromIsMobile:\i=!0,.+?)status:(\i)/,replace:'status_$:$1="online"'}}]})});var Zd,vS=g(()=>{"use strict";a();P();rr();hi();I();H();H();T();Zd=y({name:"ConsoleShortcuts",description:"Adds shorter Aliases for many things on the window. Run `shortcutList` for a list.",authors:[m.Ven],getShortcuts(){function e(i){let s=new Map;return function(...l){let c=String(l);if(s.has(c))return s.get(c);let u=Nr(i(...l)),p=(()=>{switch(u.length){case 0:return null;case 1:return u[0];default:let d=[...new Set(u)];return d.length>1&&console.warn(`Warning: This filter matches ${u.length} modules. Make it more specific! -`,d),u[0]}})();return p&&c&&s.set(c,p),p}}let t,o=e(i=>i),r=e(Ce.byProps);return{...Vencord.Webpack.Common,wp:Vencord.Webpack,wpc:io.c,wreq:io,wpsearch:Ou,wpex:el,wpexs:i=>el(Va(i)),find:o,findAll:Nr,findByProps:r,findAllByProps:(...i)=>Nr(Ce.byProps(...i)),findByCode:e(Ce.byCode),findAllByCode:i=>Nr(Ce.byCode(i)),findComponentByCode:e(Ce.componentByCode),findAllComponentsByCode:(...i)=>Nr(Ce.componentByCode(...i)),findExportedComponent:(...i)=>r(...i)[i[0]],findStore:e(Ce.byStoreName),PluginsApi:Vencord.Plugins,plugins:Vencord.Plugins.plugins,Settings:Vencord.Settings,Api:Vencord.Api,reload:()=>location.reload(),restart:So,canonicalizeMatch:bn,canonicalizeReplace:Za,canonicalizeReplacement:ys,fakeRender:(i,s)=>{let l=t?.deref(),c=l?.closed===!1?l:window.open("about:blank","Fake Render","popup,width=500,height=500");t=new WeakRef(c),c.focus();let u=c.document;u.body.style.margin="1em",c.prepared||(c.prepared=!0,[...document.querySelectorAll("style"),...document.querySelectorAll("link[rel=stylesheet]")].forEach(p=>{let d=p.cloneNode(!0);p.parentElement?.tagName==="HEAD"?u.head.append(d):d.id?.startsWith("vencord-")||d.id?.startsWith("vcd-")?u.documentElement.append(d):u.body.append(d)})),Or.render(U.createElement(i,s),u.body.appendChild(document.createElement("div")))}}},start(){let e=this.getShortcuts();window.shortcutList=e;for(let[t,o]of Object.entries(e))window[t]=o},stop(){delete window.shortcutList;for(let e in this.getShortcuts())delete window[e]}})});var bR,Xd,SS=g(()=>{"use strict";a();It();P();I();T();bR=(e,{user:t})=>{!t||e.push(n(L.MenuItem,{id:"vc-copy-user-url",label:"Copy User URL",action:()=>Ft.copy(``),icon:Ei}))},Xd=y({name:"CopyUserURLs",authors:[m.castdrian],description:"Adds a 'Copy User URL' option to the user context menu.",contextMenus:{"user-context":bR}})});var hn,TR,bS,TS,wR,Jd,wS,Qd,Vd,em,xS=g(()=>{"use strict";a();er();$();P();Ke();Ze();I();Zr();H();T();hn=new oe("CrashHandler"),{ModalStack:TR,DraftManager:bS,DraftType:TS,closeExpressionPicker:wR}=go(()=>{let e=Dr(Ce.byProps("pushLazy","popAll"),Ce.byProps("clearDraft","saveDraft"),Ce.byProps("DraftType"),Ce.byProps("closeExpressionPicker","openExpressionPicker"));return{ModalStack:e[0],DraftManager:e[1],DraftType:e[2]?.DraftType,closeExpressionPicker:e[3]?.closeExpressionPicker}}),Jd=N({attemptToPreventCrashes:{type:3,description:"Whether to attempt to prevent Discord crashes.",default:!0},attemptToNavigateToHome:{type:3,description:"Whether to attempt to navigate to the home when preventing Discord crashes.",default:!1}}),wS=!1,Qd=!1,Vd=!0,em=y({name:"CrashHandler",description:"Utility plugin for handling and possibly recovering from crashes without a restart",authors:[m.Nuckyz],enabledByDefault:!0,settings:Jd,patches:[{find:".Messages.ERRORS_UNEXPECTED_CRASH",replacement:{match:/this\.setState\((.+?)\)/,replace:"$self.handleCrash(this,$1);"}}],handleCrash(e,t){e.setState(t),!Qd&&(Qd=!0,setTimeout(()=>{try{if(!Vd){try{Fe({color:"#eed202",title:"Discord has crashed!",body:"Awn :( Discord has crashed two times rapidly, not attempting to recover.",noPersist:!0})}catch{}return}Vd=!1,setTimeout(()=>Vd=!0,500)}catch{}try{wS||(wS=!0,Hs("Uh oh, Discord has just crashed... but good news, there is a Vencord update available that might fix this issue! Would you like to update now?",!0))}catch{}try{Jd.store.attemptToPreventCrashes&&this.handlePreventCrash(e)}catch(o){hn.error("Failed to handle crash",o)}},1))},handlePreventCrash(e){try{Fe({color:"#eed202",title:"Discord has crashed!",body:"Attempting to recover...",noPersist:!0})}catch{}try{let t=Ie.getChannelId();bS.clearDraft(t,TS.ChannelMessage),bS.clearDraft(t,TS.FirstThreadMessage)}catch(t){hn.debug("Failed to clear drafts.",t)}try{wR()}catch(t){hn.debug("Failed to close expression picker.",t)}try{B.dispatch({type:"CONTEXT_MENU_CLOSE"})}catch(t){hn.debug("Failed to close open context menu.",t)}try{TR.popAll()}catch(t){hn.debug("Failed to close old modals.",t)}try{dn()}catch(t){hn.debug("Failed to close all open modals.",t)}try{B.dispatch({type:"USER_PROFILE_MODAL_CLOSE"})}catch(t){hn.debug("Failed to close user popout.",t)}try{B.dispatch({type:"LAYER_POP_ALL"})}catch(t){hn.debug("Failed to pop all layers.",t)}if(Jd.store.attemptToNavigateToHome)try{qo.transitionTo("/channels/@me")}catch(t){hn.debug("Failed to navigate to home",t)}setImmediate(()=>Qd=!1);try{e.setState({error:null,info:null})}catch(t){hn.debug("Failed to update crash handler component.",t)}}})});function Yl(e){return Boolean(e)}function tm(e){return e!=null}var Zl=g(()=>{"use strict";a()});async function MS(e){return/https?:\/\/(cdn|media)\.discordapp\.(com|net)\/attachments\//.test(e)?"mp:"+e.replace(/https?:\/\/(cdn|media)\.discordapp\.(com|net)\//,""):(await Ur.fetchAssetIds(ni.store.appID,[e]))[0]}function Ht(){Xl(!0),G.plugins.CustomRPC.enabled&&Xl()}function AS(){return ni.store.type!==1}function PR(e){return!AS()&&!/https?:\/\/(www\.)?(twitch\.tv|youtube\.com)\/\w+/.test(e)?"Streaming link must be a valid URL.":!0}function IS(){return ni.store.timestampMode!==3}function PS(e){return/https?:\/\/(?!i\.)?imgur\.com\//.test(e)?"Imgur link must be a direct link to the image. (e.g. https://i.imgur.com/...)":/https?:\/\/(?!media\.)?tenor\.com\//.test(e)?"Tenor link must be a direct link to the image. (e.g. https://media.tenor.com/...)":!0}async function CS(){let{appID:e,appName:t,details:o,state:r,type:i,streamLink:s,startTime:l,endTime:c,imageBig:u,imageBigTooltip:p,imageSmall:d,imageSmallTooltip:h,buttonOneText:v,buttonOneURL:b,buttonTwoText:M,buttonTwoURL:w}=ni.store;if(!t)return;let C={application_id:e||"0",name:t,state:r,details:o,type:i,flags:1<<0};switch(i===1&&(C.url=s),ni.store.timestampMode){case 1:C.timestamps={start:Date.now()};break;case 2:C.timestamps={start:Date.now()-(new Date().getHours()*3600+new Date().getMinutes()*60+new Date().getSeconds())*1e3};break;case 3:(l||c)&&(C.timestamps={},l&&(C.timestamps.start=l),c&&(C.timestamps.end=c));break;case 0:default:break}v&&(C.buttons=[v,M].filter(Yl),C.metadata={button_urls:[b,w].filter(Yl)}),u&&(C.assets={large_image:await MS(u),large_text:p||void 0}),d&&(C.assets={...C.assets,small_image:await MS(d),small_text:h||void 0});for(let R in C){if(R==="type")continue;let A=C[R];(!A||A.length===0)&&delete C[R]}return C}async function Xl(e){let t=await CS();B.dispatch({type:"LOCAL_ACTIVITY_UPDATE",activity:e?null:t,socketId:"CustomRPC"})}var xR,MR,IR,ni,om,RS=g(()=>{"use strict";a();$();To();P();Zl();lt();I();H();T();xR=Ne("onOpenGameProfile"),MR=x("activity","buttonColor"),IR=x("profileColors");ni=N({appID:{type:0,description:"Application ID (required)",onChange:Ht,isValid:e=>e?e&&!/^\d+$/.test(e)?"Application ID must be a number.":!0:"Application ID is required."},appName:{type:0,description:"Application name (required)",onChange:Ht,isValid:e=>e?e.length>128?"Application name must be not longer than 128 characters.":!0:"Application name is required."},details:{type:0,description:"Details (line 1)",onChange:Ht,isValid:e=>e&&e.length>128?"Details (line 1) must be not longer than 128 characters.":!0},state:{type:0,description:"State (line 2)",onChange:Ht,isValid:e=>e&&e.length>128?"State (line 2) must be not longer than 128 characters.":!0},type:{type:4,description:"Activity type",onChange:Ht,options:[{label:"Playing",value:0,default:!0},{label:"Streaming",value:1},{label:"Listening",value:2},{label:"Watching",value:3},{label:"Competing",value:5}]},streamLink:{type:0,description:"Twitch.tv or Youtube.com link (only for Streaming activity type)",onChange:Ht,disabled:AS,isValid:PR},timestampMode:{type:4,description:"Timestamp mode",onChange:Ht,options:[{label:"None",value:0,default:!0},{label:"Since discord open",value:1},{label:"Same as your current time",value:2},{label:"Custom",value:3}]},startTime:{type:1,description:"Start timestamp in milisecond (only for custom timestamp mode)",onChange:Ht,disabled:IS,isValid:e=>e&&e<0?"Start timestamp must be greater than 0.":!0},endTime:{type:1,description:"End timestamp in milisecond (only for custom timestamp mode)",onChange:Ht,disabled:IS,isValid:e=>e&&e<0?"End timestamp must be greater than 0.":!0},imageBig:{type:0,description:"Big image key/link",onChange:Ht,isValid:PS},imageBigTooltip:{type:0,description:"Big image tooltip",onChange:Ht,isValid:e=>e&&e.length>128?"Big image tooltip must be not longer than 128 characters.":!0},imageSmall:{type:0,description:"Small image key/link",onChange:Ht,isValid:PS},imageSmallTooltip:{type:0,description:"Small image tooltip",onChange:Ht,isValid:e=>e&&e.length>128?"Small image tooltip must be not longer than 128 characters.":!0},buttonOneText:{type:0,description:"Button 1 text",onChange:Ht,isValid:e=>e&&e.length>31?"Button 1 text must be not longer than 31 characters.":!0},buttonOneURL:{type:0,description:"Button 1 URL",onChange:Ht},buttonTwoText:{type:0,description:"Button 2 text",onChange:Ht,isValid:e=>e&&e.length>31?"Button 2 text must be not longer than 31 characters.":!0},buttonTwoURL:{type:0,description:"Button 2 URL",onChange:Ht}});om=y({name:"CustomRPC",description:"Allows you to set a custom rich presence.",authors:[m.captain,m.AutumnVN],start:Xl,stop:()=>Xl(!0),settings:ni,settingsAboutComponent:()=>{let e=st(CS);return n(f,null,n(S.FormText,null,"Go to ",n(je,{href:"https://discord.com/developers/applications"},"Discord Developer Portal")," to create an application and get the application ID."),n(S.FormText,null,"Upload images in the Rich Presence tab to get the image keys."),n(S.FormText,null,"If you want to use image link, download your image and reupload the image to ",n(je,{href:"https://imgur.com"},"Imgur"),' and get the image link by right-clicking the image and select "Copy image address".'),n(S.FormDivider,null),n("div",{style:{width:"284px"},className:IR.profileColors},e[0]&&n(xR,{activity:e[0],className:MR.activity,channelId:Ie.getChannelId(),guild:ae.getGuild(yo.getLastSelectedGuildId()),application:{id:ni.store.appID},user:E.getCurrentUser()})))}})});var kS=g(()=>{});async function CR(){try{let{embed:e}=this.props;if(!e||e.dearrow||e.provider?.name!=="YouTube"||!e.video?.url)return;let t=AR.exec(e.video.url)?.[1];if(!t)return;let o=await fetch(`https://sponsor.ajay.app/api/branding?videoID=${t}`);if(!o.ok)return;let{titles:r,thumbnails:i}=await o.json(),s=r[0]?.votes>=0,l=i[0]?.votes>=0&&!i[0].original;if(!s&&!l)return;e.dearrow={enabled:!0},s&&(e.dearrow.oldTitle=e.rawTitle,e.rawTitle=r[0].title.replace(/ >(\S)/g," $1")),l&&(e.dearrow.oldThumb=e.thumbnail.proxyURL,e.thumbnail.proxyURL=`https://dearrow-thumb.ajay.app/api/v1/getThumbnail?videoID=${t}&time=${i[0].timestamp}`),this.forceUpdate()}catch(e){new oe("Dearrow").error("Failed to dearrow embed",e)}}function RR({component:e}){let{embed:t}=e.props;return t?.dearrow?n(ne,{text:t.dearrow.enabled?"This embed has been dearrowed, click to restore":"Click to dearrow"},({onMouseEnter:o,onMouseLeave:r})=>n("button",{onMouseEnter:o,onMouseLeave:r,className:"vc-dearrow-toggle-"+(t.dearrow.enabled?"on":"off"),onClick:()=>{let{enabled:i,oldThumb:s,oldTitle:l}=t.dearrow;t.dearrow.enabled=!i,l&&(t.dearrow.oldTitle=t.rawTitle,t.rawTitle=l),s&&(t.dearrow.oldThumb=t.thumbnail.proxyURL,t.thumbnail.proxyURL=s),e.forceUpdate()}},n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24px",height:"24px",viewBox:"0 0 36 36","aria-label":"Toggle Dearrow"},n("path",{fill:"#1213BD",d:"M36 18.302c0 4.981-2.46 9.198-5.655 12.462s-7.323 5.152-12.199 5.152s-9.764-1.112-12.959-4.376S0 23.283 0 18.302s2.574-9.38 5.769-12.644S13.271 0 18.146 0s9.394 2.178 12.589 5.442C33.931 8.706 36 13.322 36 18.302z"}),n("path",{fill:"#88c9f9",d:"m 30.394282,18.410186 c 0,3.468849 -1.143025,6.865475 -3.416513,9.137917 -2.273489,2.272442 -5.670115,2.92874 -9.137918,2.92874 -3.467803,0 -6.373515,-1.147212 -8.6470033,-3.419654 -2.2734888,-2.272442 -3.5871299,-5.178154 -3.5871299,-8.647003 0,-3.46885 0.9420533,-6.746149 3.2144954,-9.0196379 2.2724418,-2.2734888 5.5507878,-3.9513905 9.0196378,-3.9513905 3.46885,0 6.492841,1.9322561 8.76633,4.204698 2.273489,2.2724424 3.788101,5.2974804 3.788101,8.7663304 z"}),n("path",{fill:"#0a62a5",d:"m 23.95823,17.818306 c 0,3.153748 -2.644888,5.808102 -5.798635,5.808102 -3.153748,0 -5.599825,-2.654354 -5.599825,-5.808102 0,-3.153747 2.446077,-5.721714 5.599825,-5.721714 3.153747,0 5.798635,2.567967 5.798635,5.721714 z"})))):null}var AR,nm,NS=g(()=>{"use strict";a();kS();le();P();Ke();I();T();AR=/https:\/\/www\.youtube\.com\/embed\/([a-zA-Z0-9_-]{11})/;nm=y({name:"Dearrow",description:"Makes YouTube embed titles and thumbnails less sensationalist, powered by Dearrow",authors:[m.Ven],embedDidMount:CR,renderButton(e){return n(_,{noop:!0},n(RR,{component:e}))},patches:[{find:"this.renderInlineMediaEmbed",replacement:[{match:/render\(\)\{.{0,30}let\{embed:/,replace:"componentDidMount=$self.embedDidMount;$&"},{match:/children:\[(?=null!=\i\?\i\.renderSuppressButton)/,replace:"children:[$self.renderButton(this),"}]}]})});var DS=g(()=>{});var kR,pr,LS,ES,OS,ri,Jl,ji,sa,rm,dr=g(()=>{"use strict";a();kR="https://decor.fieryflames.dev",pr=kR+"/api",LS=pr+"/authorize",ES="https://ugc.decor.fieryflames.dev",OS="1096966363416899624",ri="100101099111114",Jl="11497119",ji="1096357702931841148",sa="dXp2SdxDcP",rm=1e3*60*60*4});var NR,mr,aa=g(()=>{"use strict";a();ei();Uo();Ke();Ze();T();dr();NR={async getItem(e){return yt.get(e).then(t=>t??null)},async setItem(e,t){await yt.set(e,t)},async removeItem(e){await yt.del(e)}},mr=Ot(()=>Gr(Uu((e,t)=>({token:null,tokens:{},init:()=>{e({token:t().tokens[E.getCurrentUser().id]??null})},setToken:o=>e({token:o,tokens:{...t().tokens,[E.getCurrentUser().id]:o}}),remove:o=>{let{tokens:r,init:i}=t(),s={...r};delete s[o],e({tokens:s}),i()},async authorize(){return new Promise((o,r)=>de(i=>n(bs,{...i,scopes:["identify"],responseType:"code",redirectUri:LS,permissions:0n,clientId:OS,cancelCompletesFlow:!1,callback:async s=>{try{let l=new URL(s.location);l.searchParams.append("client","vencord");let c=await fetch(l);if(c?.ok){let u=await c.text();t().setToken(u)}else throw new Error("Request not OK");o(void 0)}catch(l){l instanceof Error&&(Mt(`Failed to authorize: ${l.message}`,X.Type.FAILURE),new oe("Decor").error("Failed to authorize",l),r(l))}}}),{onCloseCallback(){r(new Error("Authorization cancelled"))}}))},isAuthorized:()=>!!t().token}),{name:"decor-auth",getStorage:()=>NR,partialize:e=>({tokens:e.tokens}),onRehydrateStorage:()=>e=>e?.init()})))});async function Ql(e,t){let o=await fetch(e,{...t,headers:{...t?.headers,Authorization:`Bearer ${mr.getState().token}`}});if(o.ok)return o;throw new Error(await o.text())}var _S,BS,FS,im,US,$S,Vl=g(()=>{"use strict";a();dr();aa();_S=async e=>{if(e?.length===0)return{};let t=new URL(pr+"/users");return e&&e.length!==0&&t.searchParams.set("ids",JSON.stringify(e)),await fetch(t).then(o=>o.json())},BS=async(e="@me")=>Ql(pr+`/users/${e}/decorations`).then(t=>t.json()),FS=async(e="@me")=>Ql(pr+`/users/${e}/decoration`).then(t=>t.json()),im=async(e,t="@me")=>{let o=new FormData;return e?"hash"in e?o.append("hash",e.hash):"file"in e&&(o.append("image",e.file),o.append("alt",e.alt??"null")):o.append("hash","null"),Ql(pr+`/users/${t}/decoration`,{method:"PUT",body:o}).then(r=>e&&"file"in e?r.json():r.text())},US=async e=>{await Ql(pr+`/decorations/${e}`,{method:"DELETE"})},$S=async()=>fetch(pr+"/decorations/presets").then(e=>e.json())});function sm(e){return`${e.animated?"a_":""}${e.hash}`}function ec(e){return{asset:sm(e),skuId:ri}}var tc=g(()=>{"use strict";a();dr()});function GS(e){let[t,o]=W(e?Dn.getState().getAsset(e.id)??null:null);return se(()=>{let r=Dn.subscribe(i=>{if(!e)return;let s=i.getAsset(e.id);!s||t!==s&&o(s)});if(e){let{fetch:i}=Dn.getState();i(e.id)}return r},[]),t?{asset:t,skuId:ri}:null}var Dn,am=g(()=>{"use strict";a();zr();Uo();T();Vl();dr();Dn=Ot(()=>Gr((e,t)=>({usersDecorations:new Map,fetchQueue:new Set,bulkFetch:lo(async()=>{let{fetchQueue:o,usersDecorations:r}=t();if(o.size===0)return;e({fetchQueue:new Set});let i=Array.from(o),s=await _S(i),l=new Map(r),c=new Date;for(let u of i){let p=s[u]??null;l.set(u,{asset:p,fetchedAt:c})}e({usersDecorations:l})}),async fetch(o,r=!1){let{usersDecorations:i,fetchQueue:s,bulkFetch:l}=t(),{fetchedAt:c}=i.get(o)??{};c&&!r&&Date.now()-c.getTime(){"use strict";a();Uo();T();Vl();tc();am();yn=Ot(()=>Gr((e,t)=>({decorations:[],selectedDecoration:null,async fetch(){let o=await BS(),r=await FS();e({decorations:o,selectedDecoration:r})},async create(o){let r=await im(o);e({decorations:[...t().decorations,r]})},async delete(o){let r=typeof o=="object"?o.hash:o;await US(r);let{selectedDecoration:i,decorations:s}=t(),l={decorations:s.filter(c=>c.hash!==r),selectedDecoration:i?.hash===r?null:i};e(l)},async select(o){t().selectedDecoration!==o&&(e({selectedDecoration:o}),im(o),Dn.getState().set(E.getCurrentUser().id,o?sm(o):null))},clear:()=>e({decorations:[],selectedDecoration:null})})))});var Ee,qi,Ki,HS,fr=g(()=>{"use strict";a();Qe();H();Ee=ve("vc-decor-"),qi=x("modalFooterShopButton"),Ki=vi(["openAvatarDecorationModal:"]),HS=vi(["stickerInspected]:"])});var la,zS,oc,lm,jS,ii=g(()=>{"use strict";a();H();T();zS=e=>la=e,oc=Du(()=>{let e=Lu(".shopPreviewBanner");return U.memo(e)}),jS=e=>lm=e});function cm(e){return n(la,{...e,isSelected:!1},n(Fv,null),n(V,{variant:"text-xs/normal",color:"header-primary"},Ye.Messages.CREATE))}var WS=g(()=>{"use strict";a();It();T();ii()});function um(e){return n(la,{...e},n(Uv,null),n(V,{variant:"text-xs/normal",color:"header-primary"},Ye.Messages.NONE))}var qS=g(()=>{"use strict";a();It();T();ii()});function pm({decoration:e}){let{delete:t}=yn();return n(L.Menu,{navId:Ee("decoration-context-menu"),onClose:Yt.closeContextMenu,"aria-label":"Decoration Options"},n(L.MenuItem,{id:Ee("decoration-context-menu-copy-hash"),label:"Copy Decoration Hash",icon:Dl,action:()=>Ft.copy(e.hash)}),e.authorId===E.getCurrentUser().id&&n(L.MenuItem,{id:Ee("decoration-context-menu-delete"),label:"Delete Decoration",color:"danger",icon:Oi,action:()=>et.show({title:"Delete Decoration",body:`Are you sure you want to delete ${e.alt}?`,confirmText:"Delete",confirmColor:Ee("danger-btn"),cancelText:"Cancel",onConfirm(){t(e)}})}))}var KS=g(()=>{"use strict";a();It();T();Wi();fr()});function dm(e){let{decoration:t}=e;return n(lm,{...e,onContextMenu:o=>{Yt.openContextMenu(o,()=>n(pm,{decoration:t}))},avatarDecoration:ec(t)})}var YS=g(()=>{"use strict";a();T();tc();ii();KS()});function mm({renderItem:e,getItemKey:t,itemKeyPrefix:o,items:r}){return n("div",{className:Ee("sectioned-grid-list-grid")},r.map(i=>n(U.Fragment,{key:`${o?`${o}-`:""}${t(i)}`},e(i))))}var ZS=g(()=>{"use strict";a();T();fr()});function fm(e){return n("div",{className:Q(Ee("sectioned-grid-list-container"),DR.thin)},e.sections.map(t=>n("div",{key:e.getSectionKey(t),className:Ee("sectioned-grid-list-section")},e.renderSectionHeader(t),n(mm,{renderItem:e.renderItem,getItemKey:e.getItemKey,itemKeyPrefix:e.getSectionKey(t),items:t.items}))))}var DR,XS=g(()=>{"use strict";a();we();H();fr();ZS();DR=x("managedReactiveScroller")});function _R(e){let[t,o]=W(null);return se(()=>{if(!e)return;let r=URL.createObjectURL(e);return o(r),()=>{URL.revokeObjectURL(r),o(null)}},[e]),t}function BR(e){let[t,o]=W(""),[r,i]=W(null),[s,l]=W(!1),[c,u]=W(null);se(()=>{c&&u(null)},[r]);let{create:p}=yn(),d=_R(r),h=Rt(()=>d?{asset:d,skuId:Jl}:null,[d]);return n(ye,{...e,size:"medium",className:qi.modal},n(Le,{separator:!1,className:Ee("modal-header")},n(V,{color:"header-primary",variant:"heading-lg/semibold",tag:"h1",style:{flexGrow:1}},"Create Decoration"),n(pt,{onClick:e.onClose})),n(ke,{className:Ee("create-decoration-modal-content"),scrollbarType:"none"},n(_,null,n(ER,{messageType:OR.WARNING},"Make sure your decoration does not violate ",n(je,{href:"https://github.com/decor-discord/.github/blob/main/GUIDELINES.md"},"the guidelines")," before submitting it."),n("div",{className:Ee("create-decoration-modal-form-preview-container")},n("div",{className:Ee("create-decoration-modal-form")},c!==null&&n(V,{color:"text-danger",variant:"text-xs/normal"},c.message),n(S.FormSection,{title:"File"},n(LR,{filename:r?.name,placeholder:"Choose a file",buttonText:"Browse",filters:[{name:"Decoration file",extensions:["png","apng"]}],onFileSelect:i}),n(S.FormText,{type:"description",className:j.top8},"File should be APNG or PNG.")),n(S.FormSection,{title:"Name"},n(Je,{placeholder:"Companion Cube",value:t,onChange:o}),n(S.FormText,{type:"description",className:j.top8},"This name will be used when referring to this decoration."))),n("div",null,n(oc,{avatarDecorationOverride:h,user:E.getCurrentUser()}))),n(S.FormText,{type:"description",className:j.bottom16},n("br",null),"You can receive updates on your decoration's review by joining ",n(je,{href:`https://discord.gg/${sa}`,onClick:async v=>{v.preventDefault(),ae.getGuild(ji)?(dn(),B.dispatch({type:"LAYER_POP_ALL"}),qo.transitionToGuild(ji)):await Qr(sa)&&(dn(),B.dispatch({type:"LAYER_POP_ALL"}))}},"Decor's Discord server"),"."))),n(ct,{className:Ee("modal-footer")},n(k,{onClick:()=>{l(!0),p({alt:t,file:r}).then(e.onClose).catch(v=>{l(!1),u(v)})},disabled:!r||!t,submitting:s},"Submit for Review"),n(k,{onClick:e.onClose,color:k.Colors.PRIMARY,look:k.Looks.LINK},"Cancel")))}var LR,ER,OR,nc,gm=g(()=>{"use strict";a();le();To();mt();ot();Ze();H();T();dr();Wi();fr();ii();LR=Ne("fileUploadInput,"),{default:ER,HelpMessageTypes:OR}=x("HelpMessageTypes");nc=()=>Promise.all([Ki(),HS()]).then(()=>de(e=>n(BR,{...e})))});function FR(e){return n(ye,{...e,size:"small",className:qi.modal},n(Le,{separator:!1,className:Ee("modal-header")},n(V,{color:"header-primary",variant:"heading-lg/semibold",tag:"h1",style:{flexGrow:1}},"Hold on"),n(pt,{onClick:e.onClose})),n(ke,{scrollbarType:"none"},n(S.FormText,null,"By submitting a decoration, you agree to ",n(je,{href:"https://github.com/decor-discord/.github/blob/main/GUIDELINES.md"},"the guidelines"),". Not reading these guidelines may get your account suspended from creating more decorations in the future.")),n(ct,{className:Ee("modal-footer")},n(k,{onClick:()=>{Yi.store.agreedToGuidelines=!0,e.onClose(),nc()}},"Continue"),n(k,{onClick:e.onClose,color:k.Colors.PRIMARY,look:k.Looks.LINK},"Go Back")))}var JS,QS=g(()=>{"use strict";a();To();Ze();T();rc();fr();gm();JS=()=>Ki().then(()=>de(e=>n(FR,{...e})))});function $R(){let[e,t]=W([]);return se(()=>{$S().then(t)},[]),e}function GR({section:e}){let t=typeof e.subtitle<"u",o=typeof e.authorIds<"u",[r,i]=W([]);return se(()=>{(async()=>{if(!!e.authorIds)for(let s of e.authorIds){let l=E.getUser(s)??await Bt.getUser(s);i(c=>[...c,l])}})()},[e.authorIds]),n("div",null,n(fe,null,n(S.FormTitle,{style:{flexGrow:1}},e.title),o&&n(UR,{users:r,guildId:void 0,renderIcon:!1,max:5,showDefaultAvatarsForNullUsers:!0,size:16,showUserPopout:!0,className:j.bottom8})),t&&n(S.FormText,{type:"description",className:j.bottom8},e.subtitle))}function HR(e){let[t,o]=W(void 0),r=typeof t<"u",i=t!=null?ec(t):t,{decorations:s,selectedDecoration:l,fetch:c,select:u}=yn();se(()=>{c()},[]);let p=r?t:l,d=typeof p?.authorId<"u",h=s.some(A=>A.reviewed===!1),v=$R(),b=v.flatMap(A=>A.decorations),M=v.find(A=>A.id===p?.presetId),w=typeof M<"u",R=[{title:"Your Decorations",subtitle:"You can delete your own decorations by right clicking on them.",sectionKey:"ownDecorations",items:["none",...s.filter(A=>!b.some(F=>F.hash===A.hash)),"create"]},...v.map(A=>({title:A.name,subtitle:A.description||void 0,sectionKey:`preset-${A.id}`,items:A.decorations,authorIds:A.authorIds}))];return n(ye,{...e,size:"dynamic",className:qi.modal},n(Le,{separator:!1,className:Ee("modal-header")},n(V,{color:"header-primary",variant:"heading-lg/semibold",tag:"h1",style:{flexGrow:1}},"Change Decoration"),n(pt,{onClick:e.onClose})),n(ke,{className:Ee("change-decoration-modal-content"),scrollbarType:"none"},n(_,null,n(fm,{renderItem:A=>{if(typeof A=="string")switch(A){case"none":return n(um,{className:Ee("change-decoration-modal-decoration"),isSelected:p===null,onSelect:()=>o(null)});case"create":return n(ne,{text:"You already have a decoration pending review",shouldShow:h},F=>n(cm,{className:Ee("change-decoration-modal-decoration"),...F,onSelect:h?()=>{}:Yi.store.agreedToGuidelines?nc:JS}))}else return n(ne,{text:"Pending review",shouldShow:A.reviewed===!1},F=>n(dm,{...F,className:Ee("change-decoration-modal-decoration"),onSelect:A.reviewed!==!1?()=>o(A):()=>{},isSelected:p?.hash===A.hash,decoration:A}))},getItemKey:A=>typeof A=="string"?A:A.hash,getSectionKey:A=>A.sectionKey,renderSectionHeader:A=>n(GR,{section:A}),sections:R}),n("div",{className:Ee("change-decoration-modal-preview")},n(oc,{avatarDecorationOverride:i,user:E.getCurrentUser()}),w&&n(S.FormTitle,{className:""},"Part of the ",M.name," Preset"),typeof p=="object"&&n(V,{variant:"text-sm/semibold",color:"header-primary"},p?.alt),d&&n(V,{key:`createdBy-${p.authorId}`},"Created by ",Pe.parse(`<@${p.authorId}>`))))),n(ct,{className:Q(Ee("change-decoration-modal-footer",Ee("modal-footer")))},n("div",{className:Ee("change-decoration-modal-footer-btn-container")},n(k,{onClick:()=>{u(t).then(e.onClose)},disabled:!r},"Apply"),n(k,{onClick:e.onClose,color:k.Colors.PRIMARY,look:k.Looks.LINK},"Cancel")),n("div",{className:Ee("change-decoration-modal-footer-btn-container")},n(k,{onClick:()=>et.show({title:"Log Out",body:"Are you sure you want to log out of Decor?",confirmText:"Log Out",confirmColor:Ee("danger-btn"),cancelText:"Cancel",onConfirm(){mr.getState().remove(E.getCurrentUser().id),e.onClose()}}),color:k.Colors.PRIMARY,look:k.Looks.LINK},"Log Out"),n(ne,{text:"Join Decor's Discord Server for notifications on your decoration's review, and when new presets are released"},A=>n(k,{...A,onClick:async()=>{ae.getGuild(ji)?(e.onClose(),B.dispatch({type:"LAYER_POP_ALL"}),qo.transitionToGuild(ji)):await Qr(sa)&&(dn(),B.dispatch({type:"LAYER_POP_ALL"}))},color:k.Colors.PRIMARY,look:k.Looks.LINK},"Discord Server")))))}var UR,hm,VS=g(()=>{"use strict";a();le();Ut();mt();ot();we();Ze();H();T();Vl();dr();aa();Wi();tc();rc();fr();ii();WS();qS();YS();XS();gm();QS();UR=Ne("defaultRenderUser","showDefaultAvatarsForNullUsers");hm=()=>Ki().then(()=>de(e=>n(HR,{...e})))});function ca({hideTitle:e=!1,hideDivider:t=!1,noMargin:o=!1}){let r=mr(),{selectedDecoration:i,select:s,fetch:l}=yn();return se(()=>{r.isAuthorized()&&l()},[r.token]),n(zR,{title:!e&&"Decor",hasBackground:!0,hideDivider:t,className:o&&Ee("section-remove-margin")},n(fe,null,n(k,{onClick:()=>{r.isAuthorized()?hm():r.authorize().then(hm).catch(()=>{})},size:k.Sizes.SMALL},"Change Decoration"),i&&r.isAuthorized()&&n(k,{onClick:()=>s(null),color:k.Colors.PRIMARY,size:k.Sizes.SMALL,look:k.Looks.LINK},"Remove Decoration")))}var zR,ym=g(()=>{"use strict";a();Ut();H();T();aa();Wi();fr();VS();zR=Go(".customizationSectionBackground")});var Yi,rc=g(()=>{"use strict";a();$();To();ot();we();Ze();I();T();ym();Yi=N({changeDecoration:{type:6,description:"Change your avatar decoration",component(){return Vencord.Plugins.plugins.Decor.started?n("div",null,n(ca,{hideTitle:!0,hideDivider:!0,noMargin:!0}),n(S.FormText,{type:"description",className:Q(j.top8,j.bottom8)},"You can also access Decor decorations from the ",n(je,{href:"/settings/profile-customization",onClick:e=>{e.preventDefault(),dn(),B.dispatch({type:"USER_SETTINGS_MODAL_SET_SECTION",section:"Profile Customization"})}},"Profiles")," page.")):n(S.FormText,null,"Enable Decor and restart your client to change your avatar decoration.")}},agreedToGuidelines:{type:3,description:"Agreed to guidelines",hidden:!0,default:!1}})});var jR,vm,eb=g(()=>{"use strict";a();DS();le();P();I();H();T();dr();aa();Wi();am();rc();ii();ym();({isAnimatedAvatarDecoration:jR}=x("isAnimatedAvatarDecoration")),vm=y({name:"Decor",description:"Create and use your own custom avatar decorations, or pick your favorite from the presets.",authors:[m.FieryFlames],patches:[{find:"getAvatarDecorationURL:",replacement:{match:/(?<=function \i\(\i\){)(?=let{avatarDecoration)/,replace:"const vcDecorDecoration=$self.getDecorAvatarDecorationURL(arguments[0]);if(vcDecorDecoration)return vcDecorDecoration;"}},{find:"DefaultCustomizationSections",replacement:{match:/(?<=USER_SETTINGS_AVATAR_DECORATION},"decoration"\),)/,replace:"$self.DecorSection(),"}},{find:".decorationGridItem",replacement:[{match:/(?<==)\i=>{let{children.{20,100}decorationGridItem/,replace:"$self.DecorationGridItem=$&"},{match:/(?<==)\i=>{let{user:\i,avatarDecoration.{300,600}decorationGridItemChurned/,replace:"$self.DecorationGridDecoration=$&"},{match:/(?<=\.Section\.PREMIUM_PURCHASE&&\i;if\()(?<=avatarDecoration:(\i).+?)/,replace:"$1.skuId===$self.SKU_ID||"}]},{find:"isAvatarDecorationAnimating:",group:!0,replacement:[{match:/(?<=TryItOut:\i,guildId:\i}\),)(?<=user:(\i).+?)/,replace:"vcDecorAvatarDecoration=$self.useUserDecorAvatarDecoration($1),"},{match:/(?<={avatarDecoration:).{1,20}?(?=,)(?<=avatarDecorationOverride:(\i).+?)/,replace:"$1??vcDecorAvatarDecoration??($&)"},{match:/(?<=size:\i}\),\[)/,replace:"vcDecorAvatarDecoration,"}]},{find:"renderAvatarWithPopout(){",replacement:[{match:/(?<=getAvatarDecorationURL\)\({avatarDecoration:)(\i).avatarDecoration(?=,)/,replace:"$self.useUserDecorAvatarDecoration($1)??$&"}]}],settings:Yi,flux:{CONNECTION_OPEN:()=>{mr.getState().init(),yn.getState().clear(),Dn.getState().fetch(E.getCurrentUser().id,!0)},USER_PROFILE_MODAL_OPEN:e=>{Dn.getState().fetch(e.userId,!0)}},set DecorationGridItem(e){zS(e)},set DecorationGridDecoration(e){jS(e)},SKU_ID:ri,useUserDecorAvatarDecoration:GS,async start(){Dn.getState().fetch(E.getCurrentUser().id,!0)},getDecorAvatarDecorationURL({avatarDecoration:e,canAnimate:t}){if(e?.skuId===ri){let o=e.asset.split("_");return jR(e.asset)&&!t&&o.shift(),`${ES}/${o.join("_")}.png`}else if(e?.skuId===Jl)return e.asset},DecorSection:_.wrap(ca)})});var Sm,tb=g(()=>{"use strict";a();$();P();I();$s("DisableCallIdle","DisableDMCallIdle");Sm=y({name:"DisableCallIdle",description:"Disables automatically getting kicked from a DM voice call after 3 minutes and being moved to an AFK voice channel.",authors:[m.Nuckyz],patches:[{find:".Messages.BOT_CALL_IDLE_DISCONNECT",replacement:{match:/,?(?=this\.idleTimeout=new \i\.Timeout)/,replace:";return;"}},{find:"handleIdleUpdate(){",replacement:{match:/(?<=_initialize\(\){)/,replace:"return;"}}]})});function bm(e){return e.t==="Emoji"?`${location.protocol}//${window.GLOBAL_ENV.CDN_HOST}/emojis/${e.id}.${e.isAnimated?"gif":"png"}`:`${window.GLOBAL_ENV.MEDIA_PROXY_ENDPOINT}/stickers/${e.id}.${KR[e.format_type]}`}async function ob(e){let t=WR.getStickerById(e);if(t)return t;let{body:o}=await _t.get({url:`/stickers/${e}`});return B.dispatch({type:"STICKER_FETCH_SUCCESS",sticker:o}),o}async function YR(e,t){let o=new FormData;o.append("name",t.name),o.append("tags",t.tags),o.append("description",t.description),o.append("file",await nb(bm(t)));let{body:r}=await _t.post({url:`/guilds/${e}/stickers`,body:o});B.dispatch({type:"GUILD_STICKERS_CREATE_SUCCESS",guildId:e,sticker:{...r,user:E.getCurrentUser()}})}async function ZR(e,t){let o=await nb(bm(t)),r=await new Promise(i=>{let s=new FileReader;s.onload=()=>i(s.result),s.readAsDataURL(o)});return qR.uploadEmoji({guildId:e,name:t.name.split("~")[0],image:r})}function XR(e){let t=E.getCurrentUser().id;return Object.values(ae.getGuilds()).filter(o=>{if(!(o.ownerId===t||(_e.getGuildPermissions({id:o.id})&me.CREATE_GUILD_EXPRESSIONS)===me.CREATE_GUILD_EXPRESSIONS))return!1;if(e.t==="Sticker")return!0;let{isAnimated:i}=e,s=o.getMaxEmojiSlots(),{emojis:l}=jo.getGuilds()[o.id],c=0;for(let u of l)u.animated===i&&c++;return co.name.localeCompare(r.name))}async function nb(e){let t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch ${e} - ${t.status}`);return t.blob()}async function JR(e,t){try{t.t==="Sticker"?await YR(e,t):await ZR(e,t),X.show({message:`Successfully cloned ${t.name} to ${ae.getGuild(e)?.name??"your server"}!`,type:X.Type.SUCCESS,id:X.genId()})}catch(o){let r="Something went wrong (check console!)";try{r=JSON.parse(o.text).message}catch{}new oe("EmoteCloner").error("Failed to clone",t.name,"to",e,o),X.show({message:"Failed to clone: "+r,type:X.Type.FAILURE,id:X.genId()})}}function ek({data:e}){let[t,o]=U.useState(!1),[r,i]=U.useState(e.name),[s,l]=U.useReducer(u=>u+1,0),c=U.useMemo(()=>XR(e),[e.id,s]);return n(f,null,n(S.FormTitle,{className:j.top20},"Custom Name"),n(Wl,{value:r,onChange:u=>{e.name=u,i(u)},validate:u=>e.t==="Emoji"&&u.length>2&&u.length<32&&VR.test(u)||e.t==="Sticker"&&u.length>2&&u.length<30||"Name must be between 2 and 32 characters and only contain alphanumeric characters"}),n("div",{style:{display:"flex",flexWrap:"wrap",gap:"1em",padding:"1em 0.5em",justifyContent:"center",alignItems:"center"}},c.map(u=>n(ne,{text:u.name},({onMouseLeave:p,onMouseEnter:d})=>n("div",{onMouseLeave:p,onMouseEnter:d,role:"button","aria-label":"Clone to "+u.name,"aria-disabled":t,style:{borderRadius:"50%",backgroundColor:"var(--background-secondary)",display:"inline-flex",justifyContent:"center",alignItems:"center",width:"4em",height:"4em",cursor:t?"not-allowed":"pointer",filter:t?"brightness(50%)":"none"},onClick:t?void 0:async()=>{o(!0),JR(u.id,e).finally(()=>{l(),o(!1)})}},u.icon?n("img",{"aria-hidden":!0,style:{borderRadius:"50%",width:"100%",height:"100%"},src:u.getIconURL(512,!0),alt:u.name}):n(S.FormText,{style:{fontSize:QR(u.acronym),width:"100%",overflow:"hidden",whiteSpace:"nowrap",textAlign:"center",cursor:t?"not-allowed":"pointer"}},u.acronym))))))}function ic(e,t){return n(L.MenuItem,{id:"emote-cloner",key:"emote-cloner",label:`Clone ${e}`,action:()=>Hr(async()=>{let o=await t(),r={t:e,...o},i=bm(r);return s=>n(ye,{...s},n(Le,null,n("img",{role:"presentation","aria-hidden":!0,src:i,alt:"",height:24,width:24,style:{marginRight:"0.5em"}}),n(S.FormText,null,"Clone ",r.name)),n(ke,null,n(ek,{data:r})))})})}function rb(e){return new URL(e).pathname.endsWith(".gif")}var WR,qR,KR,QR,VR,tk,ok,Tm,ib=g(()=>{"use strict";a();Eo();gd();P();Ke();ot();Ze();I();H();T();WR=Re("StickersStore"),qR=x("fetchEmoji","uploadEmoji","deleteEmoji"),KR=[,"png","png","json","gif"];QR=e=>[20,20,18,18,16,14,12][e.length]??4,VR=/^\w+$/i;tk=(e,t)=>{let{favoriteableId:o,itemHref:r,itemSrc:i,favoriteableType:s}=t??{};if(!o)return;let l=(()=>{switch(s){case"emoji":let c=t.message.content.match(RegExp(`|https://cdn\\.discordapp\\.com/emojis/${o}\\.`));if(!c)return;let u=c[1]??"FakeNitroEmoji";return ic("Emoji",()=>({id:o,name:u,isAnimated:rb(r??i)}));case"sticker":return t.message.stickerItems.find(d=>d.id===o)?.format_type===3?void 0:ic("Sticker",()=>ob(o))}})();l&&ut("copy-link",e)?.push(l)},ok=(e,t)=>{let{id:o,name:r,type:i}=t?.target?.dataset??{};if(!!o)if(i==="emoji"&&r){let s=t.target.firstChild;e.push(ic("Emoji",()=>({id:o,name:r,isAnimated:s&&rb(s.src)})))}else i==="sticker"&&!t.target.className?.includes("lottieCanvas")&&e.push(ic("Sticker",()=>ob(o)))},Tm=y({name:"EmoteCloner",description:"Allows you to clone Emotes & Stickers to your own server (right click them)",tags:["StickerCloner"],authors:[m.Ven,m.Nuckyz],contextMenus:{message:tk,"expression-picker":ok}})});var wm,sb,xm,ab=g(()=>{"use strict";a();$();le();Pi();P();ot();I();H();T();wm=x("key","removeBuildOverride"),sb=N({enableIsStaff:{description:"Enable isStaff",type:3,default:!1,restartNeeded:!0}}),xm=y({name:"Experiments",description:"Enable Access to Experiments in Discord!",authors:[m.Megu,m.Ven,m.Nickyux,m.BanTheNons,m.Nuckyz],settings:sb,patches:[{find:"Object.defineProperties(this,{isDeveloper",replacement:{match:/(?<={isDeveloper:\{[^}]+?,get:\(\)=>)\i/,replace:"true"}},{find:'type:"user",revision',replacement:{match:/!(\i)&&"CONNECTION_OPEN".+?;/g,replace:"$1=!0;"}},{find:".isStaff=()",predicate:()=>sb.store.enableIsStaff,replacement:[{match:/=>*?(\i)\.hasFlag\((\i\.\i)\.STAFF\)}/,replace:(e,t,o)=>`=>Vencord.Webpack.Common.UserStore.getCurrentUser()?.id===${t}.id||${t}.hasFlag(${o}.STAFF)}`},{match:/hasFreePremium\(\){return this.isStaff\(\)\s*?\|\|/,replace:"hasFreePremium(){return "}]},{find:'H1,title:"Experiments"',replacement:{match:'title:"Experiments",children:[',replace:"$&$self.WarningCard(),"}}],settingsAboutComponent:()=>{let e=navigator.platform.includes("Mac"),t=e?"cmd":"ctrl",o=e?"opt":"alt";return n(U.Fragment,null,n(S.FormTitle,{tag:"h3"},"More Information"),n(S.FormText,{variant:"text-md/normal"},"You can enable client DevTools"," ",n("kbd",{className:wm.key},t)," +"," ",n("kbd",{className:wm.key},o)," +"," ",n("kbd",{className:wm.key},"O")," ","after enabling ",n("code",null,"isStaff")," below"),n(S.FormText,null,"and then toggling ",n("code",null,"Enable DevTools")," in the ",n("code",null,"Developer Options")," tab in settings."))},WarningCard:_.wrap(()=>n(Ro,{id:"vc-experiments-warning-card",className:j.bottom16},n(S.FormTitle,{tag:"h2"},"Hold on!!"),n(S.FormText,null,"Experiments are unreleased Discord features. They might not work, or even break your client or get your account disabled."),n(S.FormText,{className:j.top8},"Only use experiments if you know what you're doing. Vencord is not responsible for any damage caused by enabling experiments.")),{noop:!0})})});var Mm,lb=g(()=>{"use strict";a();P();I();Mm=y({name:"F8Break",description:"Pause the client when you press F8 with DevTools (+ breakpoints) open.",authors:[m.lewisakura],start(){window.addEventListener("keydown",this.event)},stop(){window.removeEventListener("keydown",this.event)},event(e){if(e.code==="F8")debugger}})});var cb=g(()=>{"use strict";a()});var pb=kr((SW,ub)=>{"use strict";a();var Ln=ub.exports;(function e(t,o,r){function i(c,u){if(!o[c]){if(!t[c]){var p=typeof fi=="function"&&fi;if(!u&&p)return p(c,!0);if(s)return s(c,!0);throw new Error("Cannot find module '"+c+"'")}var d=o[c]={exports:{}};t[c][0].call(d.exports,function(h){var v=t[c][1][h];return i(v||h)},d,d.exports,e,t,o,r)}return o[c].exports}for(var s=typeof fi=="function"&&fi,l=0;l"u"&&r!==void 0&&{}.toString.call(r)==="[object process]",R=typeof Uint8ClampedArray<"u"&&typeof importScripts<"u"&&typeof MessageChannel<"u";function A(){var D=setTimeout;return function(){return D(z,1)}}var F=new Array(1e3);function z(){for(var D=0;Di+r.playTime;)i+=r.playTime;i+=M.delay}else u=!(c=!1)}}},{}],4:[function(e,t,o){"use strict";for(var r=new Uint32Array(256),i=0;i<256;i++){for(var s=i,l=0;l<8;l++)s=1&s?3988292384^s>>>1:s>>>1;r[i]=s}t.exports=function(c,u,p){for(var d=-1,h=u=u||0,v=u+(p=p||c.length-u);h>>8^r[255&(d^c[h])];return-1^d}},{}],5:[function(e,t,o){(function(r){"use strict";var i=e("./support-test"),s=e("./parser"),l=e("./loader"),c=r.APNG={};c.checkNativeFeatures=i.checkNativeFeatures,c.ifNeeded=i.ifNeeded,c.parseBuffer=function(p){return s(p)};var u={};c.parseURL=function(p){return p in u||(u[p]=l(p).then(s)),u[p]},c.animateContext=function(p,d){return c.parseURL(p).then(function(h){return h.addContext(d),h.play(),h})},c.animateImage=function(p){return p.setAttribute("data-is-apng","progress"),c.parseURL(p.src).then(function(d){p.setAttribute("data-is-apng","yes");var h=document.createElement("canvas");h.width=d.width,h.height=d.height,Array.prototype.slice.call(p.attributes).forEach(function(R){["alt","src","usemap","ismap","data-is-apng","width","height"].indexOf(R.nodeName)==-1&&h.setAttributeNode(R.cloneNode(!1))}),h.setAttribute("data-apng-src",p.src),p.alt!=""&&h.appendChild(document.createTextNode(p.alt));var v="",b="",M=0,w="";p.style.width!=""&&p.style.width!="auto"?v=p.style.width:p.hasAttribute("width")&&(v=p.getAttribute("width")+"px"),p.style.height!=""&&p.style.height!="auto"?b=p.style.height:p.hasAttribute("height")&&(b=p.getAttribute("height")+"px"),v!=""&&b==""&&(M=parseFloat(v),w=v.match(/\D+$/)[0],b=Math.round(h.height*M/h.width)+w),b!=""&&v==""&&(M=parseFloat(b),w=b.match(/\D+$/)[0],v=Math.round(h.width*M/h.height)+w),h.style.width=v,h.style.height=b;var C=p.parentNode;C.insertBefore(h,p),C.removeChild(p),d.addContext(h.getContext("2d")),d.play()},function(){p.setAttribute("data-is-apng","no")})},c.releaseCanvas=function(p){var d=p.getContext("2d");"_apng_animation"in d&&d._apng_animation.removeContext(d)}}).call(this,typeof Ln<"u"?Ln:typeof window<"u"?window:{})},{"./loader":6,"./parser":7,"./support-test":8}],6:[function(e,t,o){"use strict";var r=r||e("es6-promise").Promise;t.exports=function(i){return new r(function(s,l){var c=new XMLHttpRequest;c.open("GET",i),c.responseType="arraybuffer",c.onload=function(){this.status==200?s(this.response):l(this)},c.send()})}},{"es6-promise":1}],7:[function(e,t,o){"use strict";var r=r||e("es6-promise").Promise,i=e("./animation"),s=e("./crc32"),l=new Uint8Array([137,80,78,71,13,10,26,10]);t.exports=function(w){var C=new Uint8Array(w);return new r(function(R,A){for(var F=0;F>>0;for(var A=1;A<4;A++)R+=w[A+C]<<8*(3-A);return R},p=function(w,C){for(var R=0,A=0;A<2;A++)R+=w[A+C]<<8*(1-A);return R},d=function(w,C){return w[C]},h=function(w,C,R){var A=new Uint8Array(R);return A.set(w.subarray(C,C+R)),A},v=function(w,C,R){var A=Array.prototype.slice.call(w.subarray(C,C+R));return String.fromCharCode.apply(String,A)},b=function(w){return[w>>>24&255,w>>>16&255,w>>>8&255,255&w]},M=function(w,C){var R=w.length+C.length,A=new Uint8Array(new ArrayBuffer(R+8));A.set(b(C.length),0),A.set(function(z){for(var Y=[],J=0;J{"use strict";a();Uo();cb();db=Jn(()=>pb().APNG),nk="https://unpkg.com/@sapphi-red/web-noise-suppressor@0.3.3/dist",IW=`${nk}/rnnoise/workletProcessor.js`,mb="https://unpkg.com/@vap/shiki-worker@0.0.8/dist/index.min.js",fb="https://unpkg.com/@vap/shiki@0.10.3/dist/onig.wasm",gb=Jn(()=>import("https://unpkg.com/stegcloak-dist@1.0.0/index.js"))});var Rm=kr(Cm=>{a();var Sb=Object.defineProperty,rk=e=>Sb(e,"__esModule",{value:!0}),ik=(e,t)=>{for(var o in t)Sb(e,o,{get:t[o],enumerable:!0})};rk(Cm);ik(Cm,{GIFEncoder:()=>Pb,applyPalette:()=>fk,default:()=>Mk,nearestColor:()=>vk,nearestColorIndex:()=>Mb,nearestColorIndexWithDistance:()=>Ib,prequantize:()=>mk,quantize:()=>pk,snapColorsToPalette:()=>yk});var sk={signature:"GIF",version:"89a",trailer:59,extensionIntroducer:33,applicationExtensionLabel:255,graphicControlExtensionLabel:249,imageSeparator:44,signatureSize:3,versionSize:3,globalColorTableFlagMask:128,colorResolutionMask:112,sortFlagMask:8,globalColorTableSizeMask:7,applicationIdentifierSize:8,applicationAuthCodeSize:3,disposalMethodMask:28,userInputFlagMask:2,transparentColorFlagMask:1,localColorTableFlagMask:128,interlaceFlagMask:64,idSortFlagMask:32,localColorTableSizeMask:7};function bb(e=256){let t=0,o=new Uint8Array(e);return{get buffer(){return o.buffer},reset(){t=0},bytesView(){return o.subarray(0,t)},bytes(){return o.slice(0,t)},writeByte(i){r(t+1),o[t]=i,t++},writeBytes(i,s=0,l=i.length){r(t+l);for(let c=0;c=i)return;var l=1024*1024;i=Math.max(i,s*(s>>0),s!=0&&(i=Math.max(i,256));let c=o;o=new Uint8Array(i),t>0&&o.set(c.subarray(0,t),0)}}var Im=12,hb=5003,ak=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function lk(e,t,o,r,i=bb(512),s=new Uint8Array(256),l=new Int32Array(hb),c=new Int32Array(hb)){let u=l.length,p=Math.max(2,r);s.fill(0),c.fill(0),l.fill(-1);let d=0,h=0,v=p+1,b=v,M=!1,w=b,C=(1<=0;)if(ue-=Ue,ue<0&&(ue+=u),l[ue]===Se){Y=c[ue];break e}O(Y),Y=re,F<1<0?d|=te<=8;)s[z++]=d&255,z>=254&&(i.writeByte(z),i.writeBytesView(s,0,z),z=0),d>>=8,h-=8;if((F>C||M)&&(M?(w=b,C=(1<0;)s[z++]=d&255,z>=254&&(i.writeByte(z),i.writeBytesView(s,0,z),z=0),d>>=8,h-=8;z>0&&(i.writeByte(z),i.writeBytesView(s,0,z),z=0)}}}var ck=lk;function Tb(e,t,o){return e<<8&63488|t<<2&992|o>>3}function wb(e,t,o,r){return e>>4|t&240|(o&240)<<4|(r&240)<<8}function xb(e,t,o){return e>>4<<8|t&240|o>>4}function ac(e,t,o){return eo?o:e}function ua(e){return e*e}function yb(e,t,o){var r=0,i=1e100;let s=e[t],l=s.cnt,c=s.ac,u=s.rc,p=s.gc,d=s.bc;for(var h=s.fw;h!=0;h=e[h].fw){let b=e[h],M=b.cnt,w=l*M/(l+M);if(!(w>=i)){var v=0;o&&(v+=w*ua(b.ac-c),v>=i)||(v+=w*ua(b.rc-u),!(v>=i)&&(v+=w*ua(b.gc-p),!(v>=i)&&(v+=w*ua(b.bc-d),!(v>=i)&&(i=v,r=h))))}}s.err=i,s.nn=r}function Pm(){return{ac:0,rc:0,gc:0,bc:0,cnt:0,nn:0,fw:0,bk:0,tm:0,mtm:0,err:0}}function uk(e,t){let o=t==="rgb444"?4096:65536,r=new Array(o),i=e.length;if(t==="rgba4444")for(let s=0;s>24&255,u=l>>16&255,p=l>>8&255,d=l&255,h=wb(d,p,u,c),v=h in r?r[h]:r[h]=Pm();v.rc+=d,v.gc+=p,v.bc+=u,v.ac+=c,v.cnt++}else if(t==="rgb444")for(let s=0;s>16&255,u=l>>8&255,p=l&255,d=xb(p,u,c),h=d in r?r[d]:r[d]=Pm();h.rc+=p,h.gc+=u,h.bc+=c,h.cnt++}else for(let s=0;s>16&255,u=l>>8&255,p=l&255,d=Tb(p,u,c),h=d in r?r[d]:r[d]=Pm();h.rc+=p,h.gc+=u,h.bc+=c,h.cnt++}return r}function pk(e,t,o={}){let{format:r="rgb565",clearAlpha:i=!0,clearAlphaColor:s=0,clearAlphaThreshold:l=0,oneBitAlpha:c=!1}=o;if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array)&&!(e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");let u=new Uint32Array(e.buffer),p=o.useSqrt!==!1,d=r==="rgba4444",h=uk(u,r),v=h.length,b=v-1,M=new Uint32Array(v+1);for(var w=0,R=0;R1&&(z=F>>1,!(h[A=M[z]].err<=Y));F=z)M[F]=A;M[F]=R}var J=w-t;for(R=0;R=Z.mtm&&h[Z.nn].mtm<=Z.tm)break;Z.mtm==b?O=M[1]=M[M[0]--]:(yb(h,O,!1),Z.tm=R);var Y=h[O].err;for(F=1;(z=F+F)<=M[0]&&(zh[M[z+1]].err&&z++,!(Y<=h[A=M[z]].err));F=z)M[F]=A;M[F]=O}var te=h[Z.nn],re=Z.cnt,Se=te.cnt,C=1/(re+Se);d&&(Z.ac=C*(re*Z.ac+Se*te.ac)),Z.rc=C*(re*Z.rc+Se*te.rc),Z.gc=C*(re*Z.gc+Se*te.gc),Z.bc=C*(re*Z.bc+Se*te.bc),Z.cnt+=te.cnt,Z.mtm=++R,h[te.bk].fw=te.fw,h[te.fw].bk=te.bk,te.mtm=b}let ue=[];var Ue=0;for(R=0;;++Ue){let be=ac(Math.round(h[R].rc),0,255),Me=ac(Math.round(h[R].gc),0,255),De=ac(Math.round(h[R].bc),0,255),Oe=255;d&&(Oe=ac(Math.round(h[R].ac),0,255),c&&(Oe=Oe<=(typeof c=="number"?c:127)?0:255),i&&Oe<=l&&(be=Me=De=s,Oe=0));let Ae=d?[be,Me,De,Oe]:[be,Me,De];if(dk(ue,Ae)||ue.push(Ae),(R=h[R].fw)==0)break}return ue}function dk(e,t){for(let o=0;o=4&&t.length>=4?r[3]===t[3]:!0;if(i&&s)return!0}return!1}function cc(e,t){var o=0,r;for(r=0;r1?Math.round(e/t)*t:e}function mk(e,{roundRGB:t=5,roundAlpha:o=10,oneBitAlpha:r=null}={}){let i=new Uint32Array(e.buffer);for(let s=0;s>24&255,u=l>>16&255,p=l>>8&255,d=l&255;c=lc(c,o),r&&(c=c<=(typeof r=="number"?r:127)?0:255),d=lc(d,t),p=lc(p,t),u=lc(u,t),i[s]=c<<24|u<<16|p<<8|d<<0}}function fk(e,t,o="rgb565"){if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array)&&!(e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");if(t.length>256)throw new Error("applyPalette() only works with 256 colors or less");let r=new Uint32Array(e.buffer),i=r.length,s=o==="rgb444"?4096:65536,l=new Uint8Array(i),c=new Array(s),u=o==="rgba4444";if(o==="rgba4444")for(let p=0;p>24&255,v=d>>16&255,b=d>>8&255,M=d&255,w=wb(M,b,v,h),C=w in c?c[w]:c[w]=gk(M,b,v,h,t);l[p]=C}else{let p=o==="rgb444"?xb:Tb;for(let d=0;d>16&255,b=h>>8&255,M=h&255,w=p(M,b,v),C=w in c?c[w]:c[w]=hk(M,b,v,t);l[d]=C}}return l}function gk(e,t,o,r,i){let s=0,l=1e100;for(let c=0;cl)continue;let h=u[0];if(d+=si(h-e),d>l)continue;let v=u[1];if(d+=si(v-t),d>l)continue;let b=u[2];d+=si(b-o),!(d>l)&&(l=d,s=c)}return s}function hk(e,t,o,r){let i=0,s=1e100;for(let l=0;ls)continue;let d=c[1];if(p+=si(d-t),p>s)continue;let h=c[2];p+=si(h-o),!(p>s)&&(s=p,i=l)}return i}function yk(e,t,o=5){if(!e.length||!t.length)return;let r=e.map(l=>l.slice(0,3)),i=o*o,s=e[0].length;for(let l=0;ls?c=c.slice(0,3):c=c.slice();let u=Ib(r,c.slice(0,3),cc),p=u[0],d=u[1];d>0&&d<=i&&(e[p]=c)}}function si(e){return e*e}function Mb(e,t,o=cc){let r=1/0,i=-1;for(let s=0;s=0&&Tk(r,A)}let J=Math.round(C/10);Sk(r,z,J,M,w);let Z=Boolean(R)&&!Y;wk(r,h,v,Z?R:null),Z&&vb(r,R),xk(r,d,h,v,F,s,l,c)}};function p(){Ab(r,"GIF89a")}}function Sk(e,t,o,r,i){e.writeByte(33),e.writeByte(249),e.writeByte(4),i<0&&(i=0,r=!1);var s,l;r?(s=1,l=2):(s=0,l=0),t>=0&&(l=t&7),l<<=2;let c=0;e.writeByte(0|l|c|s),gr(e,o),e.writeByte(i||0),e.writeByte(0)}function bk(e,t,o,r,i=8){let c=Am(r.length)-1,u=1<<7|i-1<<4|0<<3|c,p=0,d=0;gr(e,t),gr(e,o),e.writeBytes([u,p,d])}function Tk(e,t){e.writeByte(33),e.writeByte(255),e.writeByte(11),Ab(e,"NETSCAPE2.0"),e.writeByte(3),e.writeByte(1),gr(e,t),e.writeByte(0)}function vb(e,t){let o=1<>8&255)}function Ab(e,t){for(var o=0;oi.localName===e);return o?Object.values(o).find(i=>typeof i=="function")?.():void 0}function dc(e,t){let o=ee.getChannel(e);return!o||o.isPrivate()?!0:_e.can(t,o)}var Zi,Ik,ai,pa,Cb,da,hr,uc,km,Nm,pc,Rb,Xe,kb,Pk,Nb,Ak,Dm,Lb=g(()=>{"use strict";a();gn();$();P();sc();mt();Ke();I();H();T();Zi=Ka(Rm()),Ik=0,ai=Re("StickersStore"),pa=Re("UserSettingsProtoStore"),Cb=x("BINARY_READ_OPTIONS");da=go(()=>ws.PreloadedUserSettingsActionCreators),hr=go(()=>Db("appearance",da.ProtoClass)),uc=go(()=>Db("clientThemeSettings",hr)),km=/\/emojis\/(\d+?)\.(png|webp|gif)/,Nm=/\/stickers\/(\d+?)\./,pc=/\/attachments\/\d+?\/\d+?\/(\d+?)\.gif/,Rb=/\[.+?\]\((https?:\/\/.+?)\)/,Xe=N({enableEmojiBypass:{description:"Allow sending fake emojis",type:3,default:!0,restartNeeded:!0},emojiSize:{description:"Size of the emojis when sending",type:5,default:48,markers:[32,48,64,128,160,256,512]},transformEmojis:{description:"Whether to transform fake emojis into real ones",type:3,default:!0,restartNeeded:!0},enableStickerBypass:{description:"Allow sending fake stickers",type:3,default:!0,restartNeeded:!0},stickerSize:{description:"Size of the stickers when sending",type:5,default:160,markers:[32,64,128,160,256,512]},transformStickers:{description:"Whether to transform fake stickers into real ones",type:3,default:!0,restartNeeded:!0},transformCompoundSentence:{description:"Whether to transform fake stickers and emojis in compound sentences (sentences with more content than just the fake emoji or sticker link)",type:3,default:!1},enableStreamQualityBypass:{description:"Allow streaming in nitro quality",type:3,default:!0,restartNeeded:!0},useHyperLinks:{description:"Whether to use hyperlinks when sending fake emojis and stickers",type:3,default:!0},hyperLinkText:{description:"What text the hyperlink should use. {{NAME}} will be replaced with the emoji/sticker name.",type:0,default:"{{NAME}}"}}).withPrivateSettings();kb=e=>dc(e,me.USE_EXTERNAL_EMOJIS),Pk=e=>dc(e,me.USE_EXTERNAL_STICKERS),Nb=e=>dc(e,me.EMBED_LINKS),Ak=e=>dc(e,me.ATTACH_FILES),Dm=y({name:"FakeNitro",authors:[m.Arjix,m.D3SOX,m.Ven,m.fawn,m.captain,m.Nuckyz,m.AutumnVN],description:"Allows you to stream in nitro quality, send fake emojis/stickers and use client themes.",dependencies:["MessageEventsAPI"],settings:Xe,patches:[{find:".PREMIUM_LOCKED;",predicate:()=>Xe.store.enableEmojiBypass,replacement:[{match:/(?<=,intention:(\i).+?;)/,replace:(e,t)=>`let fakeNitroIntention=${t};`},{match:/\.(?:canUseEmojisEverywhere|canUseAnimatedEmojis)\(\i(?=\))/g,replace:'$&,typeof fakeNitroIntention!=="undefined"?fakeNitroIntention:void 0'},{match:/(&&!\i&&)!(\i)(?=\)return \i\.\i\.DISALLOW_EXTERNAL;)/,replace:(e,t,o)=>`${t}(!${o}&&(typeof fakeNitroIntention==="undefined"||![${3},${4}].includes(fakeNitroIntention)))`},{match:/if\(!\i\.available/,replace:e=>`${e}&&(typeof fakeNitroIntention==="undefined"||![${3},${4}].includes(fakeNitroIntention))`}]},{find:"canUseAnimatedEmojis:function",predicate:()=>Xe.store.enableEmojiBypass,replacement:{match:/((?:canUseEmojisEverywhere|canUseAnimatedEmojis):function\(\i)\){(.+?\))(?=})/g,replace:(e,t,o)=>`${t},fakeNitroIntention){${o}||fakeNitroIntention==null||[${3},${4}].includes(fakeNitroIntention)`}},{find:"canUseCustomStickersEverywhere:function",predicate:()=>Xe.store.enableStickerBypass,replacement:{match:/canUseCustomStickersEverywhere:function\(\i\){/,replace:"$&return true;"}},{find:'"SENDABLE"',predicate:()=>Xe.store.enableStickerBypass,replacement:{match:/(\w+)\.available\?/,replace:"true?"}},{find:"canUseHighVideoUploadQuality:function",predicate:()=>Xe.store.enableStreamQualityBypass,replacement:["canUseHighVideoUploadQuality","canStreamQuality"].map(e=>({match:new RegExp(`${e}:function\\(\\i(?:,\\i)?\\){`,"g"),replace:"$&return true;"}))},{find:"STREAM_FPS_OPTION.format",predicate:()=>Xe.store.enableStreamQualityBypass,replacement:{match:/guildPremiumTier:\i\.\i\.TIER_\d,?/g,replace:""}},{find:"canUseClientThemes:function",replacement:{match:/canUseClientThemes:function\(\i\){/,replace:"$&return true;"}},{find:'.displayName="UserSettingsProtoStore"',replacement:[{match:/CONNECTION_OPEN:function\((\i)\){/,replace:(e,t)=>`${e}$self.handleProtoChange(${t}.userSettingsProto,${t}.user);`},{match:/let{settings:/,replace:"arguments[0].local||$self.handleProtoChange(arguments[0].settings.proto);$&"}]},{find:",updateTheme(",replacement:{match:/(function \i\(\i\){let{backgroundGradientPresetId:(\i).+?)(\i\.\i\.updateAsync.+?theme=(.+?),.+?},\i\))/,replace:(e,t,o,r,i)=>`${t}$self.handleGradientThemeSelect(${o},${i},()=>${r});`}},{find:'["strong","em","u","text","inlineCode","s","spoiler"]',replacement:[{predicate:()=>Xe.store.transformEmojis,match:/1!==(\i)\.length\|\|1!==\i\.length/,replace:(e,t)=>`${e}||$self.shouldKeepEmojiLink(${t}[0])`},{predicate:()=>Xe.store.transformEmojis||Xe.store.transformStickers,match:/(?=return{hasSpoilerEmbeds:\i,content:(\i)})/,replace:(e,t)=>`${t}=$self.patchFakeNitroEmojisOrRemoveStickersLinks(${t},arguments[2]?.formatInline);`}]},{find:"renderEmbeds(",replacement:[{predicate:()=>Xe.store.transformEmojis||Xe.store.transformStickers,match:/(renderEmbeds\((\i)\){)(.+?embeds\.map\((\i)=>{)/,replace:(e,t,o,r,i)=>`${t}const fakeNitroMessage=${o};${r}if($self.shouldIgnoreEmbed(${i},fakeNitroMessage))return null;`},{predicate:()=>Xe.store.transformStickers,match:/(?<=renderStickersAccessories\((\i)\){let (\i)=\(0,\i\.\i\)\(\i\).+?;)/,replace:(e,t,o)=>`${o}=$self.patchFakeNitroStickers(${o},${t});`},{predicate:()=>Xe.store.transformStickers,match:/renderAttachments\(\i\){let{attachments:(\i).+?;/,replace:(e,t)=>`${e}${t}=$self.filterAttachments(${t});`}]},{find:".Messages.STICKER_POPOUT_UNJOINED_PRIVATE_GUILD_DESCRIPTION.format",predicate:()=>Xe.store.transformStickers,replacement:[{match:/let{renderableSticker:(\i).{0,250}isGuildSticker.+?channel:\i,/,replace:(e,t)=>`${e}fakeNitroRenderableSticker:${t},`},{match:/(let \i,{sticker:\i,channel:\i,closePopout:\i.+?}=(\i).+?;)(.+?description:)(\i)(?=,sticker:\i)/,replace:(e,t,o,r,i)=>`${t}let{fakeNitroRenderableSticker}=${o};${r}$self.addFakeNotice(${0},${i},!!fakeNitroRenderableSticker?.fake)`}]},{find:".EMOJI_UPSELL_POPOUT_MORE_EMOJIS_OPENED,",predicate:()=>Xe.store.transformEmojis,replacement:{match:/isDiscoverable:\i,shouldHideRoleSubscriptionCTA:\i,(?<={node:(\i),.+?)/,replace:(e,t)=>`${e}fakeNitroNode:${t},`}},{find:".Messages.EMOJI_POPOUT_UNJOINED_DISCOVERABLE_GUILD_DESCRIPTION",predicate:()=>Xe.store.transformEmojis,replacement:{match:/(?<=emojiDescription:)(\i)(?<=\1=\i\((\i)\).+?)/,replace:(e,t,o)=>`$self.addFakeNotice(${1},${t},!!${o}?.fakeNitroNode?.fake)`}},{find:"canUsePremiumAppIcons:function",replacement:{match:/canUsePremiumAppIcons:function\(\i\){/,replace:"$&return true;"}},{find:".FreemiumAppIconIds.DEFAULT&&(",replacement:{match:/\i\.\i\.isPremium\(\i\.\i\.getCurrentUser\(\)\)/,replace:"true"}}],get guildId(){return Js()?.id},get canUseEmotes(){return(E.getCurrentUser().premiumType??0)>0},get canUseStickers(){return(E.getCurrentUser().premiumType??0)>1},handleProtoChange(e,t){if(e==null||typeof e=="string"||!pa||!da||!hr||!uc)return;if((t?.premium_type??E?.getCurrentUser()?.premiumType??0)!==2){if(e.appearance??=hr.create(),pa.settings.appearance?.theme!=null){let r=hr.create({theme:pa.settings.appearance.theme});e.appearance.theme=r.theme}if(pa.settings.appearance?.clientThemeSettings?.backgroundGradientPresetId?.value!=null){let r=uc.create({backgroundGradientPresetId:{value:pa.settings.appearance.clientThemeSettings.backgroundGradientPresetId.value}});e.appearance.clientThemeSettings??=r,e.appearance.clientThemeSettings.backgroundGradientPresetId=r.backgroundGradientPresetId}}},handleGradientThemeSelect(e,t,o){if((E?.getCurrentUser()?.premiumType??0)===2||e==null)return o();if(!da||!hr||!uc||!Cb)return;let i=da.getCurrentValue().appearance,s=i!=null?hr.fromBinary(hr.toBinary(i),Cb.BINARY_READ_OPTIONS):hr.create();s.theme=t;let l=uc.create({backgroundGradientPresetId:{value:e}});s.clientThemeSettings??=l,s.clientThemeSettings.backgroundGradientPresetId=l.backgroundGradientPresetId;let c=da.ProtoClass.create();c.appearance=s,B.dispatch({type:"USER_SETTINGS_PROTO_UPDATE",local:!0,partial:!0,settings:{type:1,proto:c}})},trimContent(e){let t=e[0];typeof t=="string"?(e[0]=t.trimStart(),e[0]||e.shift()):typeof t?.props?.children=="string"&&(t.props.children=t.props.children.trimStart(),t.props.children||e.shift());let o=e.length-1,r=e[o];typeof r=="string"?(e[o]=r.trimEnd(),e[o]||e.pop()):typeof r?.props?.children=="string"&&(r.props.children=r.props.children.trimEnd(),r.props.children||e.pop())},clearEmptyArrayItems(e){return e.filter(t=>t!=null)},ensureChildrenIsArray(e){Array.isArray(e.props.children)||(e.props.children=[e.props.children])},patchFakeNitroEmojisOrRemoveStickersLinks(e,t){if((e.length>1||typeof e[0]?.type=="string")&&!Xe.store.transformCompoundSentence)return e;let o=e.length,r=c=>{if(Xe.store.transformEmojis){let u=c.props.href.match(km);if(u){let p=null;try{p=new URL(c.props.href)}catch{}let d=jo.getCustomEmojiById(u[1])?.name??p?.searchParams.get("name")??"FakeNitroEmoji";return Pe.defaultRules.customEmoji.react({jumboable:!t&&e.length===1&&typeof e[0].type!="string",animated:u[2]==="gif",emojiId:u[1],name:d,fake:!0},void 0,{key:String(o++)})}}if(Xe.store.transformStickers){if(Nm.test(c.props.href))return null;let u=c.props.href.match(pc);if(u&&ai.getStickerById(u[1]))return null}return c},i=c=>c?.props?.trusted!=null?r(c):c?.props?.children!=null?Array.isArray(c.props.children)?(c.props.children=l(c.props.children),c.props.children.length===0?null:c):(c.props.children=s(c.props.children),c):c,s=c=>{let u=i(c);if(u?.type==="ul"||u?.type==="ol"){if(this.ensureChildrenIsArray(u),u.props.children.length===0)return null;let p=!1;for(let[d,h]of u.props.children.entries()){if(h==null){delete u.props.children[d];continue}this.ensureChildrenIsArray(h),h.props.children.length>0?p=!0:delete u.props.children[d]}if(!p)return null;u.props.children=this.clearEmptyArrayItems(u.props.children)}return u},l=c=>{for(let[u,p]of c.entries())c[u]=s(p);return c=this.clearEmptyArrayItems(c),c};try{let c=l(Fr.cloneDeep(e));return this.trimContent(c),c}catch(c){return new oe("FakeNitro").error(c),e}},patchFakeNitroStickers(e,t){let o=[],r=t.content.split(/\s/);Xe.store.transformCompoundSentence?o.push(...r):r.length===1&&o.push(r[0]),o.push(...t.attachments.filter(i=>i.content_type==="image/gif").map(i=>i.url));for(let i of o){if(!Xe.store.transformCompoundSentence&&!i.startsWith("http")&&!Rb.test(i))continue;let s=i.match(Nm);if(s){let c=null;try{c=new URL(i)}catch{}let u=ai.getStickerById(s[1])?.name??c?.searchParams.get("name")??"FakeNitroSticker";e.push({format_type:1,id:s[1],name:u,fake:!0});continue}let l=i.match(pc);if(l){if(!ai.getStickerById(l[1]))continue;let c=ai.getStickerById(l[1])?.name??"FakeNitroSticker";e.push({format_type:2,id:l[1],name:c,fake:!0})}}return e},shouldIgnoreEmbed(e,t){let o=t.content.split(/\s/);if(o.length>1&&!Xe.store.transformCompoundSentence)return!1;switch(e.type){case"image":{if(!Xe.store.transformCompoundSentence&&!o.some(r=>r===e.url||r.match(Rb)?.[1]===e.url))return!1;if(Xe.store.transformEmojis&&km.test(e.url))return!0;if(Xe.store.transformStickers){if(Nm.test(e.url))return!0;let r=e.url.match(pc);if(r&&ai.getStickerById(r[1]))return!0}break}}return!1},filterAttachments(e){return e.filter(t=>{if(t.content_type!=="image/gif")return!0;let o=t.url.match(pc);return!(o&&ai.getStickerById(o[1]))})},shouldKeepEmojiLink(e){return e.target&&km.test(e.target)},addFakeNotice(e,t,o){if(!o)return t;switch(t=Array.isArray(t)?t:[t],e){case 0:return t.push(" This is a FakeNitro sticker and renders like a real sticker only for you. Appears as a link to non-plugin users."),t;case 1:return t.push(" This is a FakeNitro emoji and renders like a real emoji only for you. Appears as a link to non-plugin users."),t}},getStickerLink(e){return`https://media.discordapp.net/stickers/${e}.png?size=${Xe.store.stickerSize}`},async sendAnimatedSticker(e,t,o){let{parseURL:r}=db(),{frames:i,width:s,height:l}=await r(e),c=(0,Zi.GIFEncoder)(),u=Xe.store.stickerSize,p=document.createElement("canvas");p.width=u,p.height=u;let d=p.getContext("2d",{willReadFrequently:!0}),h=u/Math.max(s,l);d.scale(h,h);let v;for(let M of i){let{left:w,top:C,width:R,height:A,img:F,delay:z,blendOp:Y,disposeOp:J}=M;v=d.getImageData(w,C,R,A),Y===0&&d.clearRect(w,C,R,A),d.drawImage(F,w,C,R,A);let{data:Z}=d.getImageData(0,0,u,u),O=(0,Zi.quantize)(Z,256),te=(0,Zi.applyPalette)(Z,O);c.writeFrame(te,u,u,{transparent:!0,palette:O,delay:z}),J===1?d.clearRect(w,C,R,A):J===2&&d.putImageData(v,w,C)}c.finish();let b=new File([c.bytesView()],`${t}.gif`,{type:"image/gif"});As.promptToUpload([b],ee.getChannel(o),Ik)},start(){let e=Xe.store;if(!e.enableEmojiBypass&&!e.enableStickerBypass)return;function t(r,i){return!r[i]||/\s/.test(r[i])?"":" "}function o(){return new Promise(r=>{et.show({title:"Hold on!",body:n("div",null,n(S.FormText,null,"You are trying to send/edit a message that contains a FakeNitro emoji or sticker, however you do not have permissions to embed links in the current channel. Are you sure you want to send this message? Your FakeNitro items will appear as a link only."),n(S.FormText,{type:S.FormText.Types.DESCRIPTION},"You can disable this notice in the plugin settings.")),confirmText:"Send Anyway",cancelText:"Cancel",secondaryConfirmText:"Do not show again",onConfirm:()=>r(!0),onCloseCallback:()=>setImmediate(()=>r(!1)),onConfirmSecondary(){Xe.store.disableEmbedPermissionCheck=!0,r(!0)}})})}this.preSend=Vt(async(r,i,s)=>{let{guildId:l}=this,c=!1;e:{if(!e.enableStickerBypass)break e;let u=ai.getStickerById(s.stickers?.[0]);if(!u||"pack_id"in u)break e;let p=this.canUseStickers&&Pk(r);if(u.available!==!1&&(p||u.guild_id===l))break e;let d=this.getStickerLink(u.id);if(u.format_type===4&&d.includes(".png")&&(d=d.replace(".png",".gif")),u.format_type===2)return Ak(r)?this.sendAnimatedSticker(d,u.id,r):et.show({title:"Hold on!",body:n("div",null,n(S.FormText,null,"You cannot send this message because it contains an animated FakeNitro sticker, and you do not have permissions to attach files in the current channel. Please remove the sticker to proceed."))}),{cancel:!0};{c=!0;let h=new URL(d);h.searchParams.set("name",u.name);let v=e.hyperLinkText.replaceAll("{{NAME}}",u.name);i.content+=`${t(i.content,i.content.length-1)}${e.useHyperLinks?`[${v}](${h})`:h}`,s.stickers.length=0}}if(e.enableEmojiBypass){let u=this.canUseEmotes&&kb(r);for(let p of i.validNonShortcutEmojis){if(!p.require_colons||p.available!==!1&&u||p.guildId===l&&!p.animated)continue;c=!0;let d=`<${p.animated?"a":""}:${p.originalName||p.name}:${p.id}>`,h=new URL(p.url);h.searchParams.set("size",e.emojiSize.toString()),h.searchParams.set("name",p.name);let v=e.hyperLinkText.replaceAll("{{NAME}}",p.name);i.content=i.content.replace(d,(b,M,w)=>`${t(w,M-1)}${e.useHyperLinks?`[${v}](${h})`:h}${t(w,M+b.length)}`)}}return c&&!e.disableEmbedPermissionCheck&&!Nb(r)&&!await o()?{cancel:!0}:{cancel:!1}}),this.preEdit=ti(async(r,i,s)=>{if(!e.enableEmojiBypass)return;let{guildId:l}=this,c=!1,u=this.canUseEmotes&&kb(r);return s.content=s.content.replace(/(?/ig,(p,d,h,v)=>{let b=jo.getCustomEmojiById(d);if(b==null||!b.require_colons||b.available!==!1&&u||b.guildId===l&&!b.animated)return p;c=!0;let M=new URL(b.url);M.searchParams.set("size",e.emojiSize.toString()),M.searchParams.set("name",b.name);let w=e.hyperLinkText.replaceAll("{{NAME}}",b.name);return`${t(v,h-1)}${e.useHyperLinks?`[${w}](${M})`:M}${t(v,h+p.length)}`}),c&&!e.disableEmbedPermissionCheck&&!Nb(r)&&!await o()?{cancel:!0}:{cancel:!1}})},stop(){eo(this.preSend),oi(this.preEdit)}})});function Eb(...e){let t={};function o(i){for(let s=e.length-1;s>=0;s--)if(i in e[s])return e[s];return t}let r={ownKeys(){return e.reduce((i,s)=>(i.push(...Reflect.ownKeys(s)),i),Reflect.ownKeys(t))}};for(let i of["defineProperty","deleteProperty","get","getOwnPropertyDescriptor","has","set"])r[i]=function(s,...l){return Reflect[i](o(l[0]),...l)};return new Proxy(t,r)}var Ob,_b=g(()=>{"use strict";a();Ob=Eb;typeof module<"u"&&(module.exports=Eb)});function Ck(e,t){let o=`[#${e.toString(16).padStart(6,"0")},#${t.toString(16).padStart(6,"0")}]`,r="",i=Array.from(o).map(s=>s.codePointAt(0)).filter(s=>s>=32&&s<=127).map(s=>String.fromCodePoint(s+917504)).join("");return(r||"")+" "+i}function Rk(e){if(e==null)return null;let t=e.match(/\u{e005b}\u{e0023}([\u{e0061}-\u{e0066}\u{e0041}-\u{e0046}\u{e0030}-\u{e0039}]+?)\u{e002c}\u{e0023}([\u{e0061}-\u{e0066}\u{e0041}-\u{e0046}\u{e0030}-\u{e0039}]+?)\u{e005d}/u);if(t!=null){let o=[...t[0]].map(i=>String.fromCodePoint(i.codePointAt(0)-917504)).join("");return o.substring(1,o.length-1).split(",").map(i=>parseInt(i.replace("#","0x"),16))}else return null}var Bb,Lm,Fb=g(()=>{"use strict";a();$();le();P();ot();we();I();T();_b();Bb=N({nitroFirst:{description:"Default color source if both are present",type:4,options:[{label:"Nitro colors",value:!0,default:!0},{label:"Fake colors",value:!1}]}}),Lm=y({name:"FakeProfileThemes",description:"Allows profile theming by hiding the colors in your bio thanks to invisible 3y3 encoding",authors:[m.Alyxia,m.Remty],patches:[{find:"UserProfileStore",replacement:{match:/(?<=getUserProfile\(\i\){return )(\i\[\i\])/,replace:"$self.colorDecodeHook($1)"}},{find:".USER_SETTINGS_PROFILE_THEME_ACCENT",replacement:{match:/RESET_PROFILE_THEME}\)(?<=color:(\i),.{0,500}?color:(\i),.{0,500}?)/,replace:"$&,$self.addCopy3y3Button({primary:$1,accent:$2})"}}],settingsAboutComponent:()=>n(S.FormSection,null,n(S.FormTitle,{tag:"h3"},"Usage"),n(S.FormText,null,"After enabling this plugin, you will see custom colors in the profiles of other people using compatible plugins. ",n("br",null),"To set your own colors:",n("ul",null,n("li",null,"\u2022 go to your profile settings"),n("li",null,"\u2022 choose your own colors in the Nitro preview"),n("li",null,'\u2022 click the "Copy 3y3" button'),n("li",null,"\u2022 paste the invisible text anywhere in your bio")),n("br",null),n("b",null,"Please note:")," if you are using a theme which hides nitro ads, you should disable it temporarily to set colors.")),settings:Bb,colorDecodeHook(e){if(e){if(Bb.store.nitroFirst&&e.themeColors)return e;let t=Rk(e.bio);if(t)return Ob(e,{premiumType:2,themeColors:t})}return e},addCopy3y3Button:_.wrap(function({primary:e,accent:t}){return n(k,{onClick:()=>{let o=Ck(e,t);Ao(o)},color:k.Colors.PRIMARY,size:k.Sizes.XLARGE,className:j.left16},"Copy 3y3")},{noop:!0})})});var Em,Ub=g(()=>{"use strict";a();P();I();T();Em=y({name:"FavoriteEmojiFirst",authors:[m.Aria,m.Ven],description:"Puts your favorite emoji first in the emoji autocomplete.",patches:[{find:"renderResults({results:",replacement:[{match:/let \i=.{1,100}renderResults\({results:(\i)\.query\.results,/,replace:"$self.sortEmojis($1);$&"}]},{find:"MAX_AUTOCOMPLETE_RESULTS+",replacement:[{match:/,maxCount:(\i)(.{1,500}\i)=(\i)\.slice\(0,(\i-\i\.length)\)/,replace:",maxCount:Infinity$2=($3.sliceTo = $4, $3)"}]}],sortEmojis({query:e}){if(e?.type!=="EMOJIS_AND_STICKERS"||e.typeInfo?.sentinel!==":"||!e.results?.emojis?.length)return;let t=jo.getDisambiguatedEmojiContext();e.results.emojis=e.results.emojis.sort((o,r)=>{let i=t.isFavoriteEmojiWithoutFetchingLatest(o),s=t.isFavoriteEmojiWithoutFetchingLatest(r);return i&&!s?-1:!i&&s?1:0}).slice(0,e.results.emojis.sliceTo??10)}})});function Nk({instance:e,SearchBarComponent:t}){let[o,r]=W(""),i=xt(null),s=cl(l=>{r(l);let{props:c}=e;if(l===""){c.favorites=c.favCopy,e.forceUpdate();return}i.current?.containerRef?.current.closest("#gif-picker-tab-panel")?.querySelector('[class|="content"]')?.firstElementChild?.scrollTo(0,0);let u=c.favCopy.map(p=>({score:Dk(l.toLowerCase(),Gb(p.url??p.src).replace(/(%20|[_-])/g," ").toLowerCase()),gif:p})).filter(p=>p.score!=null);u.sort((p,d)=>d.score-p.score),c.favorites=u.map(p=>p.gif),e.forceUpdate()},[e.state]);return se(()=>()=>{e.dead=!0},[]),n(t,{ref:i,autoFocus:!0,className:kk.searchBar,size:t.Sizes.MEDIUM,onChange:s,onClear:()=>{r(""),e.props.favCopy!=null&&(e.props.favorites=e.props.favCopy,e.forceUpdate())},query:o,placeholder:"Search Favorite Gifs"})}function Gb(e){let t;try{t=new URL(e)}catch{return e}switch($b.store.searchOption){case"url":return t.href;case"path":return t.host==="media.discordapp.net"||t.host==="tenor.com"?t.pathname.split("/").at(-1)??t.pathname:t.pathname;case"hostandpath":return t.host==="media.discordapp.net"||t.host==="tenor.com"?`${t.host} ${t.pathname.split("/").at(-1)??t.pathname}`:`${t.host} ${t.pathname}`;default:return""}}function Dk(e,t){let o=0,r=0;for(let i=0;i{"use strict";a();$();le();P();I();H();T();kk=x("searchBar","searchBarFullRow"),$b=N({searchOption:{type:4,description:"The part of the url you want to search",options:[{label:"Entire Url",value:"url"},{label:"Path Only (/somegif.gif)",value:"path"},{label:"Host & Path (tenor.com somgif.gif)",value:"hostandpath",default:!0}]}}),Om=y({name:"FavoriteGifSearch",authors:[m.Aria],description:"Adds a search bar to favorite gifs.",patches:[{find:"renderHeaderContent()",replacement:[{match:/(renderHeaderContent\(\).{1,150}FAVORITES:return)(.{1,150});(case.{1,200}default:return\(0,\i\.jsx\)\((?\i\..{1,10}),)/,replace:"$1 this.state.resultType === 'Favorites' ? $self.renderSearchBar(this, $) : $2;$3"},{match:/(,suggestions:\i,favorites:)(\i),/,replace:"$1$self.getFav($2),favCopy:$2,"}]}],settings:$b,getTargetString:Gb,instance:null,renderSearchBar(e,t){return this.instance=e,n(_,{noop:!0},n(Nk,{instance:e,SearchBarComponent:t}))},getFav(e){if(!this.instance||this.instance.dead)return e;let{favorites:t}=this.instance.props;return t!=null&&t?.length!==e.length?t:e}})});var _m,zb=g(()=>{"use strict";a();P();I();_m=y({name:"FixCodeblockGap",description:"Removes the gap between codeblocks and text below it",authors:[m.Grzesiek11],patches:[{find:".default.Messages.DELETED_ROLE_PLACEHOLDER",replacement:{match:String.raw`/^${"```"}(?:([a-z0-9_+\-.#]+?)\n)?\n*([^\n][^]*?)\n*${"```"}`,replace:"$&\\n?"}}]})});var Bm,jb=g(()=>{"use strict";a();$();Xs();P();I();Bm=y({name:"FixSpotifyEmbeds",description:"Fixes spotify embeds being incredibly loud by letting you customise the volume",authors:[m.Ven],settings:N({volume:{type:5,description:"The volume % to set for spotify embeds. Anything above 10% is veeeery loud",markers:en(0,100,10),stickToMarkers:!1,default:10}})})});var Fm,Wb=g(()=>{"use strict";a();P();I();Fm=y({name:"FixYoutubeEmbeds",description:"Bypasses youtube videos being blocked from display on Discord (for example by UMG)",authors:[m.coolelectronics]})});var Um,qb=g(()=>{"use strict";a();P();I();T();Um=y({name:"ForceOwnerCrown",description:"Force the owner crown next to usernames even if the server is large.",authors:[m.D3SOX,m.Nickyux],patches:[{find:"AVATAR_DECORATION_PADDING:",replacement:{match:/,isOwner:(\i),/,replace:",_isOwner:$1=$self.isGuildOwner(e),"}}],isGuildOwner(e){if(!e?.user?.id||e.channel?.type===3)return e.isOwner;let t=e.guildId??e.channel?.guild_id,o=e.user.id;return ae.getGuild(t)?.ownerId===o}})});var mc,Lk,$m,Kb=g(()=>{"use strict";a();uo();P();I();H();T();mc=x("createFriendInvite"),{uuid4:Lk}=x("uuid4"),$m=y({name:"FriendInvites",description:"Create and manage friend invite links via slash commands (/create friend invite, /view friend invites, /revoke friend invites).",authors:[m.afn,m.Dziurwa],dependencies:["CommandsAPI"],commands:[{name:"create friend invite",description:"Generates a friend invite link.",inputType:3,options:[{name:"Uses",description:"How many uses?",choices:[{label:"1",name:"1",value:"1"},{label:"5",name:"5",value:"5"}],required:!1,type:4}],execute:async(e,t)=>{let o=ht(e,"Uses",5);if(o===1&&!E.getCurrentUser().phone)return ge(t.channel.id,{content:"You need to have a phone number connected to your account to create a friend invite with 1 use!"});let r;if(o===1){let i=Lk(),{body:{invite_suggestions:s}}=await _t.post({url:"/friend-finder/find-friends",body:{modified_contacts:{[i]:[1,"",""]},phone_contact_methods_count:1}});r=await mc.createFriendInvite({code:s[0][3],recipient_phone_number_or_email:i,contact_visibility:1,filter_visibilities:[],filtered_invite_suggestions_index:1})}else r=await mc.createFriendInvite();ge(t.channel.id,{content:` - discord.gg/${r.code} \xB7 - Expires: \xB7 - Max uses: \`${r.max_uses}\` - `.trim().replace(/\s+/g," ")})}},{name:"view friend invites",description:"View a list of all generated friend invites.",inputType:3,execute:async(e,t)=>{let r=(await mc.getAllFriendInvites()).map(i=>` - _discord.gg/${i.code}_ \xB7 - Expires: \xB7 - Times used: \`${i.uses}/${i.max_uses}\` - `.trim().replace(/\s+/g," "));ge(t.channel.id,{content:r.join(` -`)||"You have no active friend invites!"})}},{name:"revoke friend invites",description:"Revokes all generated friend invites.",inputType:3,execute:async(e,t)=>{await mc.revokeFriendInvites(),ge(t.channel.id,{content:"All friend invites have been revoked."})}}]})});var Ek,Ok,_k,Bk,Yb,Fk,Uk,Gm,Zb=g(()=>{"use strict";a();le();P();I();H();T();({Heading:Ek,Text:Ok}=x("Heading","Text")),_k=x("memberSinceContainer"),{getCreatedAtDate:Bk}=x("getCreatedAtDate"),Yb=x("clydeMoreInfo"),Fk=x("getLocale"),Uk=x("lastSection"),Gm=y({name:"FriendsSince",description:"Shows when you became friends with someone in the user popout",authors:[m.Elvyra],patches:[{find:".AnalyticsSections.USER_PROFILE}",replacement:{match:/\i.default,\{userId:(\i.id).{0,30}}\)/,replace:"$&,$self.friendsSince({ userId: $1 })"}},{find:".UserPopoutUpsellSource.PROFILE_PANEL,",replacement:{match:/\i.default,\{userId:(\i)}\)/,replace:"$&,$self.friendsSince({ userId: $1 })"}}],friendsSince:_.wrap(({userId:e})=>{let t=it.getSince(e);return t?n("div",{className:Uk.section},n(Ek,{variant:"eyebrow",className:Yb.title},"Friends Since"),n("div",{className:_k.memberSinceContainer},n(Ok,{variant:"text-sm/normal",className:Yb.body},Bk(t,Fk.getLocale())))):null},{noop:!0})})});var Hm,Xb=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/gameActivityToggle/style.css",{name:"src/plugins/gameActivityToggle/style.css",source:`[class*="withTagAsButton"] { - min-width: 88px !important; -} -`,classNames:{},dom:null});Hm="src/plugins/gameActivityToggle/style.css"});function Gk(e){let{oldIcon:t}=Jb.use(["oldIcon"]),o=t?"M23 2.27 21.73 1 1 21.73 2.27 23 23 2.27Z":"M22.7 2.7a1 1 0 0 0-1.4-1.4l-20 20a1 1 0 1 0 1.4 1.4Z",r=t?"M23.27 4.54 19.46.73 .73 19.46 4.54 23.27 23.27 4.54Z":"M23.27 4.73 19.27 .73 -.27 20.27 3.73 24.27Z";return function(){return n("svg",{width:"20",height:"20",viewBox:"0 0 24 24"},n("path",{fill:!e&&!t?"var(--status-danger)":"currentColor",mask:e?void 0:"url(#gameActivityMask)",d:"M3.06 20.4q-1.53 0-2.37-1.065T.06 16.74l1.26-9q.27-1.8 1.605-2.97T6.06 3.6h11.88q1.8 0 3.135 1.17t1.605 2.97l1.26 9q.21 1.53-.63 2.595T20.94 20.4q-.63 0-1.17-.225T18.78 19.5l-2.7-2.7H7.92l-2.7 2.7q-.45.45-.99.675t-1.17.225Zm14.94-7.2q.51 0 .855-.345T19.2 12q0-.51-.345-.855T18 10.8q-.51 0-.855.345T16.8 12q0 .51.345 .855T18 13.2Zm-2.4-3.6q.51 0 .855-.345T16.8 8.4q0-.51-.345-.855T15.6 7.2q-.51 0-.855.345T14.4 8.4q0 .51.345 .855T15.6 9.6ZM6.9 13.2h1.8v-2.1h2.1v-1.8h-2.1v-2.1h-1.8v2.1h-2.1v1.8h2.1v2.1Z"}),!e&&n(f,null,n("path",{fill:"var(--status-danger)",d:o}),n("mask",{id:"gameActivityMask"},n("rect",{fill:"white",x:"0",y:"0",width:"24",height:"24"}),n("path",{fill:"black",d:r}))))}}function Hk(){let e=xi.ShowCurrentGame.useSetting();return n($k,{tooltipText:e?"Disable Game Activity":"Enable Game Activity",icon:Gk(e),role:"switch","aria-checked":!e,onClick:()=>xi.ShowCurrentGame.updateSetting(t=>!t)})}var $k,Jb,zm,Qb=g(()=>{"use strict";a();$();Qe();le();P();I();H();T();Xb();$k=Ne("Button.Sizes.NONE,disabled:");Jb=N({oldIcon:{type:3,description:"Use the old icon style before Discord icon redesign",default:!1}}),zm=y({name:"GameActivityToggle",description:"Adds a button next to the mic and deafen button to toggle game activity.",authors:[m.Nuckyz,m.RuukuLada],settings:Jb,patches:[{find:".Messages.ACCOUNT_SPEAKING_WHILE_MUTED",replacement:{match:/this\.renderNameZone\(\).+?children:\[/,replace:"$&$self.GameActivityToggleButton(),"}}],GameActivityToggleButton:_.wrap(Hk,{noop:!0}),start(){Nt(Hm)},stop(){Xt(Hm)}})});var zk,jm,Vb=g(()=>{"use strict";a();P();mt();I();H();({closeExpressionPicker:zk}=x("closeExpressionPicker")),jm=y({name:"GifPaste",description:"Makes picking a gif in the gif picker insert a link into the chatbox instead of instantly sending it",authors:[m.Ven],patches:[{find:".handleSelectGIF=",replacement:{match:/\.handleSelectGIF=(\i)=>\{/,replace:".handleSelectGIF=$1=>{if (!this.props.className) return $self.handleSelect($1);"}}],handleSelect(e){e&&(kn(e.url+" "),zk())}})});function tT(e,t,o){let r=ao.getSendMessageOptionsForReply({channel:e,message:t,shouldMention:!0,showMentionToggle:!0});if(fc.store.greetMode==="Message"||o.length>1){r.stickerIds=o;let i={content:"",tts:!1,invalidEmojis:[],validNonShortcutEmojis:[]};ao._sendMessage(e.id,i,r)}else ao.sendGreetMessage(e.id,o[0],r)}function jk({channel:e,message:t}){let o=fc.use(["greetMode","multiGreetChoices"]),{greetMode:r,multiGreetChoices:i=[]}=o;return n(L.Menu,{navId:"greet-sticker-picker",onClose:()=>B.dispatch({type:"CONTEXT_MENU_CLOSE"}),"aria-label":"Greet Sticker Picker"},n(L.MenuGroup,{label:"Greet Mode"},Object.values(oT).map(s=>n(L.MenuRadioItem,{key:s,group:"greet-mode",id:"greet-mode-"+s,label:s,checked:s===r,action:()=>o.greetMode=s}))),n(L.MenuSeparator,null),n(L.MenuGroup,{label:"Greet Stickers"},eT.map(s=>n(L.MenuItem,{key:s.id,id:"greet-"+s.id,label:s.description.split(" ")[0],action:()=>tT(e,t,[s.id])}))),fc.store.unholyMultiGreetEnabled?n(f,null,n(L.MenuSeparator,null),n(L.MenuItem,{label:"Unholy Multi-Greet",id:"unholy-multi-greet"},eT.map(s=>{let l=i.some(c=>c===s.id);return n(L.MenuCheckboxItem,{key:s.id,id:"multi-greet-"+s.id,label:s.description.split(" ")[0],checked:l,disabled:!l&&i.length>=3,action:()=>{o.multiGreetChoices=l?i.filter(c=>c!==s.id):[...i,s.id]}})}),n(L.MenuSeparator,null),n(L.MenuItem,{id:"multi-greet-submit",label:"Send Greets",action:()=>tT(e,t,i),disabled:i.length===0}))):null)}var oT,fc,eT,Wm,nT=g(()=>{"use strict";a();$();P();I();H();T();oT=(o=>(o.Greet="Greet",o.NormalMessage="Message",o))(oT||{}),fc=N({greetMode:{type:4,options:[{label:"Greet (you can only greet 3 times)",value:"Greet",default:!0},{label:"Normal Message (you can greet spam)",value:"Message"}],description:"Choose the greet mode"}}).withPrivateSettings(),{WELCOME_STICKERS:eT}=x("WELCOME_STICKERS");Wm=y({name:"GreetStickerPicker",description:"Allows you to use any greet sticker instead of only the random one by right-clicking the 'Wave to say hi!' button",authors:[m.Ven],settings:fc,patches:[{find:"Messages.WELCOME_CTA_LABEL",replacement:{match:/innerClassName:\i\.welcomeCTAButton,(?<={channel:\i,message:\i}=(\i).{0,400}?)/,replace:"$&onContextMenu:(vcEvent)=>$self.pickSticker(vcEvent, $1),"}}],pickSticker(e,t){t.message.deleted||Yt.openContextMenu(e,()=>n(jk,{...t}))}})});var qm={};qe(qm,{_buildPopoverElements:()=>qk,addButton:()=>on,buttons:()=>gc,removeButton:()=>Oo});function on(e,t){gc.set(e,t)}function Oo(e){gc.delete(e)}function qk(e,t){let o=[];for(let[r,i]of gc.entries())try{let s=i(e);s&&(s.key??=r,o.push(t(s)))}catch(s){Wk.error(`[${r}]`,s)}return o}var Wk,gc,li=g(()=>{"use strict";a();Ke();Wk=new oe("MessagePopover"),gc=new Map});var ma,iT,fa,rT,Kk,Km,sT=g(()=>{"use strict";a();Xo();li();It();P();I();T();iT="HideAttachments_HiddenIds",fa=new Set,rT=()=>dt(iT).then(e=>(fa=e??new Set,fa)),Kk=e=>kt(iT,e),Km=y({name:"HideAttachments",description:"Hide attachments and Embeds for individual messages via hover button",authors:[m.Ven],dependencies:["MessagePopoverAPI"],async start(){ma=document.createElement("style"),ma.id="VencordHideAttachments",document.head.appendChild(ma),await rT(),await this.buildCss(),on("HideAttachments",e=>{if(!e.attachments.length&&!e.embeds.length&&!e.stickerItems.length)return null;let t=fa.has(e.id);return{label:t?"Show Attachments":"Hide Attachments",icon:t?El:Ol,message:e,channel:ee.getChannel(e.channel_id),onClick:()=>this.toggleHide(e.id)}})},stop(){ma.remove(),fa.clear(),Oo("HideAttachments")},async buildCss(){let e=[...fa].map(t=>`#message-accessories-${t}`).join(",");ma.textContent=` - :is(${e}) :is([class*="embedWrapper"], [class*="clickableSticker"]) { - /* important is not necessary, but add it to make sure bad themes won't break it */ - display: none !important; - } - :is(${e})::after { - content: "Attachments hidden"; - color: var(--text-muted); - font-size: 80%; - } - `},async toggleHide(e){let t=await rT();t.delete(e)||t.add(e),await Kk(t),await this.buildCss()}})});var Ym,aT=g(()=>{"use strict";a();P();I();Ym=y({name:"iLoveSpam",description:"Do not hide messages from 'likely spammers'",authors:[m.botato,m.Nyako],patches:[{find:"hasFlag:{writable",replacement:{match:/if\((\i)<=(?:1<<30|1073741824)\)return/,replace:"if($1===(1<<20))return false;$&"}}]})});function uT(e,t,o,r){return n(ne,{text:t},i=>n("button",{...i,onClick:s=>Xk(s,e),style:{all:"unset",cursor:"pointer",display:"flex",justifyContent:"center",alignItems:"center"}},n("svg",{width:"24",height:"24",viewBox:"0 -960 960 960"},n("path",{fill:r,d:o}))))}function cT(e,t=!1){let o=to.use(["ignoredActivities"]),{ignoredActivities:r=[]}=o;return r.some(i=>i.id===e.id)?Zk(e,"var(--status-danger)"):Yk(e,t?"var(--green-300)":"var(--primary-400)")}function Xk(e,t){e.stopPropagation();let o=yr().findIndex(r=>r.id===t.id);o===-1?to.store.ignoredActivities=yr().concat(t):to.store.ignoredActivities=yr().filter((r,i)=>i!==o),xi.ShowCurrentGame.updateSetting(r=>r)}function Jk(){return n(fe,{flexDirection:"column"},n(S.FormText,{type:S.FormText.Types.DESCRIPTION},"Import the application id of the CustomRPC plugin to the allowed list"),n("div",null,n(k,{onClick:()=>{let e=G.plugins.CustomRPC?.appID;if(!e)return Mt("CustomRPC application ID is not set.",X.Type.FAILURE);Zm?.(e)&&Mt("CustomRPC application ID is already added.",X.Type.FAILURE)}},"Import CustomRPC ID")))}function Qk(e){let[t,o]=W(to.store.allowedIds??"");Zm=i=>{let s=new Set(t.split(",").map(u=>u.trim()).filter(Boolean)),l=s.has(i)||(s.add(i),!1),c=Array.from(s).join(", ");return o(c),e.setValue(c),l},se(()=>()=>{Zm=null},[]);function r(i){o(i),e.setValue(i)}return n(S.FormSection,null,n(S.FormTitle,{tag:"h3"},"Allowed List"),n(S.FormText,{className:j.bottom8,type:S.FormText.Types.DESCRIPTION},"Comma separated list of activity IDs to allow (Useful for allowing RPC activities and CustomRPC)"),n(Je,{type:"text",value:t,onChange:r,placeholder:"235834946571337729, 343383572805058560"}))}function yr(){return to.store.ignoredActivities??=[]}function Vk(e,t){if(t&&to.store.allowedIds.includes(t))return!1;switch(e){case 0:return to.store.ignorePlaying;case 1:return to.store.ignoreStreaming;case 2:return to.store.ignoreListening;case 3:return to.store.ignoreWatching;case 5:return to.store.ignoreCompeting}return!1}var lT,Yk,Zk,Zm,to,Xm,pT=g(()=>{"use strict";a();Xo();$();le();Ut();P();ot();I();H();T();lT=Re("RunningGameStore");Yk=(e,t)=>uT(e,"Disable Activity","M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Zm0-300Zm0 220q113 0 207.5-59.5T832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280Z",t),Zk=(e,t)=>uT(e,"Enable Activity","m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z",t);Zm=null;to=N({importCustomRPC:{type:6,description:"",component:()=>n(Jk,null)},allowedIds:{type:6,description:"",default:"",onChange(e){let t=new Set(e.split(",").map(o=>o.trim()).filter(Boolean));to.store.allowedIds=Array.from(t).join(", ")},component:e=>n(Qk,{setValue:e.setValue})},ignorePlaying:{type:3,description:"Ignore all playing activities (These are usually game and RPC activities)",default:!1},ignoreStreaming:{type:3,description:"Ignore all streaming activities",default:!1},ignoreListening:{type:3,description:"Ignore all listening activities (These are usually spotify activities)",default:!1},ignoreWatching:{type:3,description:"Ignore all watching activities",default:!1},ignoreCompeting:{type:3,description:"Ignore all competing activities (These are normally special game activities)",default:!1}}).withPrivateSettings();Xm=y({name:"IgnoreActivities",authors:[m.Nuckyz],description:"Ignore activities from showing up on your status ONLY. You can configure which ones are specifically ignored from the Registered Games and Activities tabs, or use the general settings below.",settings:to,patches:[{find:'.displayName="LocalActivityStore"',replacement:[{match:/HANG_STATUS.+?(?=!\i\(\i,\i\)&&)(?<=(\i)\.push.+?)/,replace:(e,t)=>`${e}${t}=${t}.filter($self.isActivityNotIgnored);`}]},{find:".Messages.SETTINGS_GAMES_TOGGLE_OVERLAY",replacement:{match:/\.Messages\.SETTINGS_GAMES_TOGGLE_OVERLAY.+?}\(\),(?<={overlay:\i,.+?=(\i),.+?)(?=!(\i))/,replace:(e,t,o)=>`${e}$self.renderToggleGameActivityButton(${t},${o}),`}},{find:".activityTitleText,variant",replacement:{match:/(?<=\i\.activityTitleText.+?children:(\i)\.name.*?}\),)/,replace:(e,t)=>`$self.renderToggleActivityButton(${t}),`}},{find:".activityCardDetails,children",replacement:{match:/(?<=\i\.activityCardDetails.+?children:(\i\.application)\.name.*?}\),)/,replace:(e,t)=>`$self.renderToggleActivityButton(${t}),`}}],async start(){let e=await dt("IgnoreActivities_ignoredActivities");if(e!=null&&(to.store.ignoredActivities=Array.from(e.values()).map(t=>({...t,name:"Unknown Name"})),pp("IgnoreActivities_ignoredActivities")),yr().length!==0){let t=lT.getGamesSeen();for(let[o,r]of yr().entries())r.type===0&&(t.some(i=>i.id===r.id||i.exePath===r.id)||yr().splice(o,1))}},isActivityNotIgnored(e){if(Vk(e.type,e.application_id))return!1;if(e.application_id!=null)return!yr().some(t=>t.id===e.application_id)||to.store.allowedIds.includes(e.application_id);{let t=lT.getRunningGames().find(o=>o.name===e.name)?.exePath;if(t)return!yr().some(o=>o.id===t)}return!0},renderToggleGameActivityButton(e,t){return n(_,{noop:!0},n("div",{style:{marginLeft:12,zIndex:0}},cT({id:e.id??e.exePath,name:e.name,type:0},t)))},renderToggleActivityButton(e){return n(_,{noop:!0},cT({id:e.id,name:e.name,type:1}))}})});var ga,Jm=g(()=>{"use strict";a();ga="vc-imgzoom-magnify-modal"});function Qm(e,t){e()?t():requestAnimationFrame(()=>Qm(e,t))}var dT=g(()=>{"use strict";a()});var eN,Vm,mT=g(()=>{"use strict";a();Qe();T();Jm();ef();dT();eN=ve("vc-imgzoom-"),Vm=({instance:e,size:t,zoom:o})=>{let[r,i]=W(!1),[s,l]=W({x:0,y:0}),[c,u]=W({x:0,y:0}),[p,d]=W(0),h=xt(!1),v=xt(o),b=xt(t),M=xt(null),w=xt(null),C=xt(null),R=xt(null);if(U.useLayoutEffect(()=>{let F=re=>{re.key==="Shift"&&(h.current=!0)},z=re=>{re.key==="Shift"&&(h.current=!1)},Y=()=>{w.current.currentTime=C.current.currentTime},J=re=>{if(e.state.mouseOver&&e.state.mouseDown){let Se=b.current/2,ue={x:re.pageX,y:re.pageY},Ue=-((ue.x-M.current.getBoundingClientRect().left)*v.current-Se),be=-((ue.y-M.current.getBoundingClientRect().top)*v.current-Se);l({x:re.x-Se,y:re.y-Se}),u({x:Ue,y:be}),d(1)}else d(0)},Z=re=>{e.state.mouseOver&&re.button===0&&(v.current=nt.store.zoom,b.current=nt.store.size,document.getElementById("image-context")&&B.dispatch({type:"CONTEXT_MENU_CLOSE"}),J(re),d(1))},O=()=>{d(0),nt.store.saveZoomValues&&(nt.store.zoom=v.current,nt.store.size=b.current)},te=async re=>{if(e.state.mouseOver&&e.state.mouseDown&&!h.current){let Se=v.current+re.deltaY/100*(nt.store.invertScroll?-1:1)*nt.store.zoomSpeed;v.current=Se<=1?1:Se,J(re)}if(e.state.mouseOver&&e.state.mouseDown&&h.current){let Se=b.current+re.deltaY*(nt.store.invertScroll?-1:1)*nt.store.zoomSpeed;b.current=Se<=50?50:Se,J(re)}};return Qm(()=>e.state.readyState==="READY",()=>{let re=document.getElementById(ga);M.current=re,re.querySelector("img,video")?.setAttribute("draggable","false"),e.props.animated&&(C.current=re.querySelector("video"),C.current.addEventListener("timeupdate",Y)),i(!0)}),document.addEventListener("keydown",F),document.addEventListener("keyup",z),document.addEventListener("mousemove",J),document.addEventListener("mousedown",Z),document.addEventListener("mouseup",O),document.addEventListener("wheel",te),()=>{document.removeEventListener("keydown",F),document.removeEventListener("keyup",z),document.removeEventListener("mousemove",J),document.removeEventListener("mousedown",Z),document.removeEventListener("mouseup",O),document.removeEventListener("wheel",te),nt.store.saveZoomValues&&(nt.store.zoom=v.current,nt.store.size=b.current)}},[]),!r)return null;let A=M.current?.getBoundingClientRect();return A?n("div",{className:eN("lens",{"nearest-neighbor":nt.store.nearestNeighbour,square:nt.store.square}),style:{opacity:p,width:b.current+"px",height:b.current+"px",transform:`translate(${s.x}px, ${s.y}px)`}},e.props.animated?n("video",{ref:w,style:{position:"absolute",left:`${c.x}px`,top:`${c.y}px`},width:`${A.width*v.current}px`,height:`${A.height*v.current}px`,poster:e.props.src,src:C.current?.src??e.props.src,autoPlay:!0,loop:!0}):n("img",{ref:R,style:{position:"absolute",transform:`translate(${c.x}px, ${c.y}px)`},width:`${A.width*v.current}px`,height:`${A.height*v.current}px`,src:e.props.src,alt:""})):null}});var tf,fT=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/imageZoom/styles.css",{name:"src/plugins/imageZoom/styles.css",source:`.vc-imgzoom-lens { - position: absolute; - inset: 0; - z-index: 9999; - border: 2px solid grey; - border-radius: 50%; - overflow: hidden; - cursor: none; - box-shadow: inset 0 0 10px 2px grey; - filter: drop-shadow(0 0 2px grey); - pointer-events: none; - - /* negate the border offsetting the lens */ - margin: -2px; -} - -.vc-imgzoom-square { - border-radius: 0; -} - -.vc-imgzoom-nearest-neighbor>img { - image-rendering: pixelated; - - /* https://googlechrome.github.io/samples/image-rendering-pixelated/index.html */ -} - -/* make the carousel take up less space so we can click the backdrop and exit out of it */ -[class*="modalCarouselWrapper_"] { - top: 0 !important; -} - -[class*="carouselModal_"] { - height: 0 !important; -} -`,classNames:{},dom:null});tf="src/plugins/imageZoom/styles.css"});var nt,tN,of,ef=g(()=>{"use strict";a();$();Qe();Xs();zr();P();I();T();mT();Jm();fT();nt=N({saveZoomValues:{type:3,description:"Whether to save zoom and lens size values",default:!0},invertScroll:{type:3,description:"Invert scroll",default:!0},nearestNeighbour:{type:3,description:"Use Nearest Neighbour Interpolation when scaling images",default:!1},square:{type:3,description:"Make the lens square",default:!1},zoom:{description:"Zoom of the lens",type:5,markers:en(1,50,4),default:2,stickToMarkers:!1},size:{description:"Radius / Size of the lens",type:5,markers:en(50,1e3,50),default:100,stickToMarkers:!1},zoomSpeed:{description:"How fast the zoom / lens size changes",type:5,markers:en(.1,5,.2),default:.5,stickToMarkers:!1}}),tN=e=>{let{square:t,nearestNeighbour:o}=nt.use(["square","nearestNeighbour"]);e.push(n(L.MenuGroup,{id:"image-zoom"},n(L.MenuCheckboxItem,{id:"vc-square",label:"Square Lens",checked:t,action:()=>{nt.store.square=!t}}),n(L.MenuCheckboxItem,{id:"vc-nearest-neighbour",label:"Nearest Neighbour",checked:o,action:()=>{nt.store.nearestNeighbour=!o}}),n(L.MenuControlItem,{id:"vc-zoom",label:"Zoom",control:(r,i)=>n(L.MenuSliderControl,{ref:i,...r,minValue:1,maxValue:50,value:nt.store.zoom,onChange:lo(s=>nt.store.zoom=s,100)})}),n(L.MenuControlItem,{id:"vc-size",label:"Lens Size",control:(r,i)=>n(L.MenuSliderControl,{ref:i,...r,minValue:50,maxValue:1e3,value:nt.store.size,onChange:lo(s=>nt.store.size=s,100)})}),n(L.MenuControlItem,{id:"vc-zoom-speed",label:"Zoom Speed",control:(r,i)=>n(L.MenuSliderControl,{ref:i,...r,minValue:.1,maxValue:5,value:nt.store.zoomSpeed,onChange:lo(s=>nt.store.zoomSpeed=s,100),renderValue:s=>`${s.toFixed(3)}x`})})))},of=y({name:"ImageZoom",description:"Lets you zoom in to images and gifs. Use scroll wheel to zoom in and shift + scroll wheel to increase lens radius / size",authors:[m.Aria],tags:["ImageUtilities"],patches:[{find:"Messages.OPEN_IN_BROWSER",replacement:{match:/return.{1,200}\.wrapper.{1,200}src:\i,/g,replace:`$&id: '${ga}',`}},{find:"handleImageLoad=",replacement:[{match:/placeholderVersion:\i,/,replace:"...$self.makeProps(this),$&"},{match:/componentDidMount\(\){/,replace:"$&$self.renderMagnifier(this);"},{match:/componentWillUnmount\(\){/,replace:"$&$self.unMountMagnifier();"}]},{find:".carouselModal",replacement:{match:/(?<=\.carouselModal.{0,100}onClick:)\i,/,replace:"()=>{},"}}],settings:nt,contextMenus:{"image-context":tN},currentMagnifierElement:null,element:null,Magnifier:Vm,root:null,makeProps(e){return{onMouseOver:()=>this.onMouseOver(e),onMouseOut:()=>this.onMouseOut(e),onMouseDown:t=>this.onMouseDown(t,e),onMouseUp:()=>this.onMouseUp(e),id:e.props.id}},renderMagnifier(e){e.props.id===ga&&(this.currentMagnifierElement||(this.currentMagnifierElement=n(Vm,{size:nt.store.size,zoom:nt.store.zoom,instance:e}),this.root=Or.createRoot(this.element),this.root.render(this.currentMagnifierElement)))},unMountMagnifier(){this.root?.unmount(),this.currentMagnifierElement=null,this.root=null},onMouseOver(e){e.setState(t=>({...t,mouseOver:!0}))},onMouseOut(e){e.setState(t=>({...t,mouseOver:!1}))},onMouseDown(e,t){e.button===0&&t.setState(o=>({...o,mouseDown:!0}))},onMouseUp(e){e.setState(t=>({...t,mouseDown:!1}))},start(){Nt(tf),this.element=document.createElement("div"),this.element.classList.add("MagnifierContainer"),document.body.appendChild(this.element)},stop(){Xt(tf),this.root&&this.root.unmount(),this.element?.remove()}})});var gT=g(()=>{});var sf={};qe(sf,{ChatBarButton:()=>xo,_injectButtons:()=>nN,addChatBarButton:()=>wo,removeChatBarButton:()=>nn});function nN(e,t){if(!t.disabled)for(let[o,r]of rf)e.push(n(_,{noop:!0,key:o,onError:i=>oN.error(`Failed to render ${o}`,i.error)},n(r,{...t,isMainChat:t.type.analyticsName==="normal"})))}var nf,rf,oN,wo,nn,xo,En=g(()=>{"use strict";a();gT();le();Ke();H();T();gt(["buttonContainer","channelTextArea"],e=>nf=e);rf=new Map,oN=new oe("ChatButtons");wo=(e,t)=>rf.set(e,t),nn=e=>rf.delete(e),xo=_.wrap(e=>n(ne,{text:e.tooltip},({onMouseEnter:t,onMouseLeave:o})=>n("div",{className:`expression-picker-chat-input-button ${nf?.buttonContainer??""} vc-chatbar-button`},n(k,{"aria-label":e.tooltip,size:"",look:sl.BLANK,onMouseEnter:t,onMouseLeave:o,innerClassName:`${ol.button} ${nf?.button}`,onClick:e.onClick,onContextMenu:e.onContextMenu,...e.buttonProps},n("div",{className:ol.buttonWrapper},e.children)))),{noop:!0})});function rN(e){let t=e?.message?.content,[o,r]=U.useState("password");return n(ye,{...e},n(Le,null,n(S.FormTitle,{tag:"h4"},"Decrypt Message")),n(ke,null,n(S.FormTitle,{tag:"h5",style:{marginTop:"10px"}},"Message with Encryption"),n(Je,{defaultValue:t,disabled:!0}),n(S.FormTitle,{tag:"h5",style:{marginTop:"10px"}},"Password"),n(Je,{style:{marginBottom:"20px"},onChange:r})),n(ct,null,n(k,{color:k.Colors.GREEN,onClick:()=>{let i=af(t,o,!0);!i||!e?.message||(Vencord.Plugins.plugins.InvisibleChat.buildEmbed(e?.message,i),e.onClose())}},"Decrypt"),n(k,{color:k.Colors.TRANSPARENT,look:k.Looks.LINK,style:{left:15,position:"absolute"},onClick:e.onClose},"Cancel")))}function hT(e){de(t=>n(rN,{...t,...e}))}var yT=g(()=>{"use strict";a();Ze();T();hc()});function iN(e){let[t,o]=U.useState(""),[r,i]=U.useState(""),[s,l]=U.useState("password"),[c,u]=U.useState(!1),p=t&&(c||r&&r.trim().split(" ").length>1);return n(ye,{...e},n(Le,null,n(S.FormTitle,{tag:"h4"},"Encrypt Message")),n(ke,null,n(S.FormTitle,{tag:"h5",style:{marginTop:"10px"}},"Secret"),n(Je,{onChange:d=>{o(d)}}),n(S.FormTitle,{tag:"h5",style:{marginTop:"10px"}},"Cover (2 or more Words!!)"),n(Je,{disabled:c,onChange:d=>{i(d)}}),n(S.FormTitle,{tag:"h5",style:{marginTop:"10px"}},"Password"),n(Je,{style:{marginBottom:"20px"},defaultValue:"password",onChange:d=>{l(d)}}),n(wt,{value:c,onChange:d=>{u(d)}},"Don't use a Cover")),n(ct,null,n(k,{color:k.Colors.GREEN,disabled:!p,onClick:()=>{if(!p)return;let d=bT(t,s,c?"d d":r),h=c?d.replaceAll("d",""):d;!h||(kn(h),e.onClose())}},"Send"),n(k,{color:k.Colors.TRANSPARENT,look:k.Looks.LINK,style:{left:15,position:"absolute"},onClick:()=>{e.onClose()}},"Cancel")))}function vT(){de(e=>n(iN,{...e}))}var ST=g(()=>{"use strict";a();mt();Ze();T();hc()});function sN(){return n("svg",{fill:"var(--header-secondary)",width:24,height:24,viewBox:"0 0 64 64"},n("path",{d:"M 32 9 C 24.832 9 19 14.832 19 22 L 19 27.347656 C 16.670659 28.171862 15 30.388126 15 33 L 15 49 C 15 52.314 17.686 55 21 55 L 43 55 C 46.314 55 49 52.314 49 49 L 49 33 C 49 30.388126 47.329341 28.171862 45 27.347656 L 45 22 C 45 14.832 39.168 9 32 9 z M 32 13 C 36.963 13 41 17.038 41 22 L 41 27 L 23 27 L 23 22 C 23 17.038 27.037 13 32 13 z"}))}function aN(){return n(ne,{text:"This message has a hidden message! (InvisibleChat)"},({onMouseEnter:e,onMouseLeave:t})=>n("img",{"aria-label":"Hidden Message Indicator (InvisibleChat)",onMouseEnter:e,onMouseLeave:t,src:"https://github.com/SammCheese/invisible-chat/raw/NewReplugged/src/assets/lock.png",width:20,height:20,style:{transform:"translateY(4p)",paddingInline:4}}))}function bT(e,t,o){return lf.hide(e+"\u200B",t,o)}function af(e,t,o){let r=lf.reveal(e,t);return o?r.replace("\u200B",""):r}function cN(e){return e.endsWith("\u200B")}async function uN(e){let t=TT.store.savedPasswords.split(",").map(r=>r.trim());if(!e?.content||!t?.length)return!1;let{content:o}=e;/^\W/.test(e.content)&&(o=`d ${e.content}d`);for(let r=0;r{"use strict";a();En();li();$();le();P();sc();I();T();yT();ST();lN=({isMainChat:e})=>e?n(xo,{tooltip:"Encrypt Message",onClick:()=>vT(),buttonProps:{"aria-haspopup":"dialog"}},n("svg",{"aria-hidden":!0,role:"img",width:"24",height:"24",viewBox:"0 0 64 64",style:{scale:"1.39",translate:"0 -1px"}},n("path",{fill:"currentColor",d:"M 32 9 C 24.832 9 19 14.832 19 22 L 19 27.347656 C 16.670659 28.171862 15 30.388126 15 33 L 15 49 C 15 52.314 17.686 55 21 55 L 43 55 C 46.314 55 49 52.314 49 49 L 49 33 C 49 30.388126 47.329341 28.171862 45 27.347656 L 45 22 C 45 14.832 39.168 9 32 9 z M 32 13 C 36.963 13 41 17.038 41 22 L 41 27 L 23 27 L 23 22 C 23 17.038 27.037 13 32 13 z"}))):null,TT=N({savedPasswords:{type:0,default:"password, Password",description:"Saved Passwords (Seperated with a , )"}}),cf=y({name:"InvisibleChat",description:"Encrypt your Messages in a non-suspicious way!",authors:[m.SammCheese],dependencies:["MessagePopoverAPI","ChatInputButtonAPI"],patches:[{find:".Messages.MESSAGE_EDITED,",replacement:{match:/let\{className:\i,message:\i[^}]*\}=(\i)/,replace:"try {$1 && $self.INV_REGEX.test($1.message.content) ? $1.content.push($self.indicator()) : null } catch {};$&"}}],EMBED_API_URL:"https://embed.sammcheese.net",INV_REGEX:new RegExp(/( \u200c|\u200d |[\u2060-\u2064])[^\u200b]/),URL_REGEX:new RegExp(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/),settings:TT,async start(){on("InvisibleChat",t=>this.INV_REGEX.test(t?.content)?{label:"Decrypt Message",icon:this.popOverIcon,message:t,channel:ee.getChannel(t.channel_id),onClick:async()=>{await uN(t).then(o=>o?void this.buildEmbed(t,o):void hT({message:t}))}}:null),wo("InvisibleChat",lN);let{default:e}=await gb();lf=new e(!0,!1)},stop(){Oo("InvisibleChat"),Oo("InvisibleChat")},async getEmbed(e){let{body:t}=await _t.post({url:"/unfurler/embed-urls",body:{urls:[e]}});return await t.embeds[0]},async buildEmbed(e,t){let o=t.match(this.URL_REGEX);if(e.embeds.push({type:"rich",title:"Decrypted Message",color:"0x45f5f5",description:t,footer:{text:"Made with \u2764\uFE0F by c0dine and Sammy!"}}),o?.length){let r=await this.getEmbed(new URL(o[0]));r&&e.embeds.push(r)}this.updateMessage(e)},updateMessage:e=>{B.dispatch({type:"MESSAGE_UPDATE",message:e})},popOverIcon:()=>n(sN,null),indicator:_.wrap(aN,{noop:!0})})});function wT(e,t){!ee.hasChannel(t)||qo.transitionTo(`/channels/${e??"@me"}/${t}`)}var yc,_o,uf,xT=g(()=>{"use strict";a();Xo();P();I();T();yc=!1;uf=y({name:"KeepCurrentChannel",description:"Attempt to navigate to the channel you were in before switching accounts or loading Discord.",authors:[m.Nuckyz],flux:{LOGOUT(e){({isSwitchingAccount:yc}=e)},CONNECTION_OPEN(){!yc||(yc=!1,_o?.channelId&&wT(_o.guildId,_o.channelId))},async CHANNEL_SELECT({guildId:e,channelId:t}){yc||(_o={guildId:e,channelId:t},await kt("KeepCurrentChannel_previousData",_o))}},async start(){_o=await dt("KeepCurrentChannel_previousData"),_o?_o.channelId&&wT(_o.guildId,_o.channelId):(_o={guildId:yo.getGuildId(),channelId:Ie.getChannelId()??null},await kt("KeepCurrentChannel_previousData",_o))}})});async function pf(e){return(await Ur.fetchAssetIds(df,[e]))[0]}function mN(e){B.dispatch({type:"LOCAL_ACTIVITY_UPDATE",activity:e,socketId:"LastFM"})}var df,pN,MT,dN,Mo,mf,IT=g(()=>{"use strict";a();$();To();P();Ke();I();H();T();df="1108588077900898414",pN="2a96cbd8b46e442fc41c2b86b821562f",MT=new oe("LastFMRichPresence"),dN=x("getLocalPresence");Mo=N({username:{description:"last.fm username",type:0},apiKey:{description:"last.fm api key",type:0},shareUsername:{description:"show link to last.fm profile",type:3,default:!1},hideWithSpotify:{description:"hide last.fm presence if spotify is running",type:3,default:!0},statusName:{description:"custom status text",type:0,default:"some music"},nameFormat:{description:"Show name of song and artist in status name",type:4,options:[{label:"Use custom status name",value:"status-name",default:!0},{label:"Use format 'artist - song'",value:"artist-first"},{label:"Use format 'song - artist'",value:"song-first"},{label:"Use artist name only",value:"artist"},{label:"Use song name only",value:"song"}]},useListeningStatus:{description:'show "Listening to" status instead of "Playing"',type:3,default:!1},missingArt:{description:"When album or album art is missing",type:4,options:[{label:"Use large Last.fm logo",value:"lastfmLogo",default:!0},{label:"Use generic placeholder",value:"placeholder"}]},showLastFmLogo:{description:"show the Last.fm logo by the album cover",type:3,default:!0}}),mf=y({name:"LastFMRichPresence",description:"Little plugin for Last.fm rich presence",authors:[m.dzshn,m.RuiNtD,m.blahajZip,m.archeruwu],settingsAboutComponent:()=>n(f,null,n(S.FormTitle,{tag:"h3"},"How to get an API key"),n(S.FormText,null,"An API key is required to fetch your current track. To get one, you can visit ",n(je,{href:"https://www.last.fm/api/account/create"},"this page")," and fill in the following information: ",n("br",null)," ",n("br",null),"Application name: Discord Rich Presence ",n("br",null),"Application description: (personal use) ",n("br",null)," ",n("br",null),"And copy the API key (not the shared secret!)")),settings:Mo,start(){this.updatePresence(),this.updateInterval=setInterval(()=>{this.updatePresence()},16e3)},stop(){clearInterval(this.updateInterval)},async fetchTrackData(){if(!Mo.store.username||!Mo.store.apiKey)return null;try{let e=new URLSearchParams({method:"user.getrecenttracks",api_key:Mo.store.apiKey,user:Mo.store.username,limit:"1",format:"json"}),t=await fetch(`https://ws.audioscrobbler.com/2.0/?${e}`);if(!t.ok)throw`${t.status} ${t.statusText}`;let o=await t.json();if(o.error)return MT.error("Error from Last.fm API",`${o.error}: ${o.message}`),null;let r=o.recenttracks?.track[0];return r?.["@attr"]?.nowplaying?{name:r.name||"Unknown",album:r.album["#text"],artist:r.artist["#text"]||"Unknown",url:r.url,imageUrl:r.image?.find(i=>i.size==="large")?.["#text"]}:null}catch(e){return MT.error("Failed to query Last.fm API",e),null}},async updatePresence(){mN(await this.getActivity())},getLargeImage(e){if(e.imageUrl&&!e.imageUrl.includes(pN))return e.imageUrl;if(Mo.store.missingArt==="placeholder")return"placeholder"},async getActivity(){if(Mo.store.hideWithSpotify){for(let s of dN.getActivities())if(s.type===2&&s.application_id!==df)return null}let e=await this.fetchTrackData();if(!e)return null;let t=this.getLargeImage(e),o=t?{large_image:await pf(t),large_text:e.album||void 0,...Mo.store.showLastFmLogo&&{small_image:await pf("lastfm-small"),small_text:"Last.fm"}}:{large_image:await pf("lastfm-large"),large_text:e.album||void 0},r=[{label:"View Song",url:e.url}];Mo.store.shareUsername&&r.push({label:"Last.fm Profile",url:`https://www.last.fm/user/${Mo.store.username}`});let i=(()=>{switch(Mo.store.nameFormat){case"artist-first":return e.artist+" - "+e.name;case"song-first":return e.name+" - "+e.artist;case"artist":return e.artist;case"song":return e.name;default:return Mo.store.statusName}})();return{application_id:df,name:i,details:e.name,state:e.artist,assets:o,buttons:r.map(s=>s.label),metadata:{button_urls:r.map(s=>s.url)},type:Mo.store.useListeningStatus?2:0,flags:1}}})});var PT,AT,ff,CT=g(()=>{"use strict";a();$();P();I();PT=["Eyrokac","Rdcg$l`'k|~n",'H`tf$d&iajo+d`{"',"Sucqplh`(Eclhualva()&","Lncgmka'8KNMDC,shpanf'`x./,","Ioqweijnfn*IeuvfvAotkfxo./,","Hd{#cp\x7Ft$)nbd!{lq%mig~*\x7Fh`v#mk&sm{gx nd#idjb(a\x7Ffao\"bja&amdkge!Rlo\xECkhf)hyedfjjb*'^hzdrdmm$lu'|ao+mnqw$fijxh~bbmg#Tjm\xEEefd+fnp#lpkffz5","h",`sijklm&cam*rot"hjjq'|ak\x7F xmv#wc'ep*mawmvvlrb(|ynr>"Aqq&cgg-\x7F ugoh%rom)e\x7Fhdpp%$`,'Tnfb}"u\'~`nno!kp$vvhfzeyee"a}%Tfam*Xh`fls%Jboldos-"lj`&hn)~ce!`jcbct|)gdbhnf$wikm$zgaxkmc%afely+og"144?\'ign+iu%p$qisiefr gpfa$',"Ndtfv%ahfgk+ghtf$|ir(|z' Oguaw&`ggdj mgw$|ir(me|n","(!\u0363\xB3$\u0359\u0290'\u0369\xB9#","(\uFF88\u25D7\u30ED\u25D1,\uFF8F-2\uFF6C\uFF95\u272C","Ynw#hjil(ze+psgwp|&sgmkr!","Tikmolh`(fl+a!dvjk\x7F'y|e\x7Fe/,-","3/3750?5><9>885:7","mdmt","Wdn`khc+(oxbeof","Ig\"zkp*'g{*xolglj`&~g|*gowg/$mgt(Eclm`.#ticf{l*xed\"wl`&Kangj igbhqn'd`dn `v#lqrw{3%$bhv-h|)kangj_imwhlhb","Tscmw%Tnoa~x",'I\u2018f#npus(ec`e!vl$lhsm{`ncu"ekw&f(defeov-$Rnf|)sdu\u2018pf$wcam{ceg!vl$du\'D`d~x-"jw%oi(okht-"DJP)Kag\x7Fs,!mq$du\'A\u2010|n sg`akrkq)~jkdl#pj&diefbnf"jp)&@F\\*{ltq#Hlhrp\'',"Ynw$v`&cg`dl fml`%rhlhs*","Dnl$p%qhz{s' hv$w%hh|aceg!;#gpvt(fl+cndea`&dg|fon&v#wjjqm(","\uD83D)pft`gs(ec`e!13$qojmz#",`a!njcmr'ide~nu"lb%rheoedldpz$lu'gbkr`,'dn"zkp&kg\x7Fo4',"hnpqkw",'sn"fau\x7F','Sn"tmqnh}}*musvkaw&flf&+ldv$w%lr{}*aulr#vlao|)cetn"jp$',"Dxkmc%ot(hhxomwwai\x7F'{hln",`hd{#}js&(pe~'sg#gprb(3#"`,"hd{b${","<;vqkijbq33271:56<3799?24944:",`Thof$lu'ofdn,!qsefc'az*bnrcma+&Om{o+iu"\`khct$)bnrd"bcdoi&`,"snofplkb{)c\x7F'r\"lod\x7F'|f*aurv#cpno`abchijklmno","Wdn`khc'|f*eghl{%"],AT=N({replaceEvents:{description:"Replace Event Quotes too",type:3,default:!0}}),ff=y({name:"LoadingQuotes",description:"Replace Discords loading quotes",authors:[m.Ven,m.KraXen72],settings:AT,patches:[{find:".LOADING_DID_YOU_KNOW}",replacement:[{match:/\._loadingText=function\(\)\{/,replace:"$&return $self.quote;"},{match:/\._eventLoadingText=function\(\)\{/,replace:"$&return $self.quote;",predicate:()=>AT.store.replaceEvents}]}],xor(e){let t="read if cute",o=Array.from(e,(r,i)=>r.charCodeAt(0)^i%t.length);return String.fromCharCode(...o)},get quote(){return this.xor(PT[Math.floor(Math.random()*PT.length)])}})});var RT=g(()=>{});var vc,kT=g(()=>{"use strict";a();Uo();we();Wr();T();vc=Ot(()=>{let e=new vo,t=new Map;class o extends xs.Store{getCount(i){return t.get(i)}async _ensureCount(i){t.has(i)||await Ms.preload(i,wn.getDefaultChannel(i).id)}ensureCount(i){t.has(i)||e.push(()=>this._ensureCount(i).then(()=>Ko(200),()=>Ko(200)))}}return new o(B,{GUILD_MEMBER_LIST_UPDATE({guildId:r,groups:i}){t.set(r,i.reduce((s,l)=>s+(l.id==="offline"?0:l.count),0))},ONLINE_GUILD_MEMBER_COUNT_UPDATE({guildId:r,count:i}){t.set(r,i)}})})});function yf({isTooltip:e,tooltipGuildId:t}){let o=Be([Ie],()=>Bi()),r=e?t:o.guild_id,i=Be([gf],()=>gf.getMemberCount(r)),s=Be([vc],()=>vc.getCount(r)),{groups:l}=Be([hf],()=>hf.getProps(r,o?.id));if(!e&&(l.length>=1||l[0].id!=="unknown")&&(s=l.reduce((u,p)=>u+(p.id==="offline"?0:p.count),0)),se(()=>{vc.ensureCount(r)},[r]),i==null)return null;let c=s!=null?Sc(s):"?";return n("div",{className:Xi("widget",{tooltip:e,"member-list":!e})},n(ne,{text:`${c} online in this channel`,position:"bottom"},u=>n("div",{...u},n("span",{className:Xi("online-dot")}),n("span",{className:Xi("online")},c))),n(ne,{text:`${Sc(i)} total server members`,position:"bottom"},u=>n("div",{...u},n("span",{className:Xi("total-dot")}),n("span",{className:Xi("total")},Sc(i)))))}var NT=g(()=>{"use strict";a();mt();T();vf();kT()});var gf,hf,Sf,fN,Sc,Xi,bf,vf=g(()=>{"use strict";a();RT();$();Qe();le();P();I();H();NT();gf=Re("GuildMemberCountStore"),hf=Re("ChannelMemberStore"),Sf=N({toolTip:{type:3,description:"If the member count should be displayed on the server tooltip",default:!0,restartNeeded:!0},memberList:{type:3,description:"If the member count should be displayed on the member list",default:!0,restartNeeded:!0}}),fN=new Intl.NumberFormat,Sc=e=>fN.format(e),Xi=ve("vc-membercount-"),bf=y({name:"MemberCount",description:"Shows the amount of online & total members in the server member list and tooltip",authors:[m.Ven,m.Commandtechno],settings:Sf,patches:[{find:"{isSidebarVisible:",replacement:{match:/(?<=let\{className:(\i),.+?children):\[(\i\.useMemo[^}]+"aria-multiselectable")/,replace:":[$1?.startsWith('members')?$self.render():null,$2"},predicate:()=>Sf.store.memberList},{find:".invitesDisabledTooltip",replacement:{match:/(?<=\.VIEW_AS_ROLES_MENTIONS_WARNING.{0,100})]/,replace:",$self.renderTooltip(arguments[0].guild)]"},predicate:()=>Sf.store.toolTip}],render:_.wrap(yf,{noop:!0}),renderTooltip:_.wrap(e=>n(yf,{isTooltip:!0,tooltipGuildId:e.id}),{noop:!0})})});var Tf,DT,LT,ha,wf,ET=g(()=>{"use strict";a();gn();$();P();I();H();T();Tf=!1,DT=e=>e.key==="Backspace"&&(Tf=!0),LT=e=>e.key==="Backspace"&&(Tf=!1),ha=N({enableDeleteOnClick:{type:3,description:"Enable delete on click while holding backspace",default:!0},enableDoubleClickToEdit:{type:3,description:"Enable double click to edit",default:!0},enableDoubleClickToReply:{type:3,description:"Enable double click to reply",default:!0},requireModifier:{type:3,description:"Only do double click actions when shift/ctrl is held",default:!1}}),wf=y({name:"MessageClickActions",description:"Hold Backspace and click to delete, double click to edit/reply",authors:[m.Ven],dependencies:["MessageEventsAPI"],settings:ha,start(){let e=x("deleteMessage","startEditMessage"),t=x("isEditing","isEditingAny");document.addEventListener("keydown",DT),document.addEventListener("keyup",LT),this.onClick=Hd((o,r,i)=>{let s=o.author.id===E.getCurrentUser().id;if(Tf)ha.store.enableDeleteOnClick&&(s||_e.can(me.MANAGE_MESSAGES,r))&&(o.deleted?B.dispatch({type:"MESSAGE_DELETE",channelId:r.id,id:o.id,mlDeleted:!0}):e.deleteMessage(r.id,o.id),i.preventDefault());else{if(i.detail<2||ha.store.requireModifier&&!i.ctrlKey&&!i.shiftKey||r.guild_id&&!_e.can(me.SEND_MESSAGES,r)||o.deleted===!0)return;if(s){if(!ha.store.enableDoubleClickToEdit||t.isEditing(r.id,o.id))return;e.startEditMessage(r.id,o.id,o.content),i.preventDefault()}else{if(!ha.store.enableDoubleClickToReply)return;let l=64;if(o.hasFlag(l))return;B.dispatch({type:"CREATE_PENDING_REPLY",channel:r,message:o,shouldMention:!G.plugins.NoReplyMention.enabled,showMentionToggle:r.guild_id!==null})}}})},stop(){zd(this.onClick),document.removeEventListener("keydown",DT),document.removeEventListener("keyup",LT)}})});var Mf={};qe(Mf,{_modifyAccessories:()=>gN,accessories:()=>bc,addAccessory:()=>ya,removeAccessory:()=>xf});function ya(e,t,o){bc.set(e,{callback:t,position:o})}function xf(e){bc.delete(e)}function gN(e,t){for(let o of bc.values()){let r=o.callback(t);if(r!=null){if(!Array.isArray(r))r=[r];else if(r.length===0)continue;e.splice(o.position!=null?o.position<0?e.length+o.position:o.position:e.length,0,...r.filter(i=>i!=null))}}return e}var bc,Tc=g(()=>{"use strict";a();bc=new Map});async function bN(e,t){let o=Ji.get(t);if(o)return o.message;Ji.set(t,{fetched:!1});let i=(await _t.get({url:`/channels/${e}/messages`,query:{limit:1,around:t},retries:2}).catch(()=>null))?.body?.[0];if(!i)return;let s=zo.getMessages(i.channel_id).receiveMessage(i).get(i.id);return Ji.set(s.id,{message:s,fetched:!0}),s}function TN(e){let t=[];for(let{content_type:o,height:r,width:i,url:s,proxy_url:l}of e.attachments??[])o?.startsWith("image/")&&t.push({height:r,width:i,url:s,proxyURL:l});for(let{type:o,image:r,thumbnail:i,url:s}of e.embeds??[])o==="image"?t.push({...r??i}):s&&o==="gifv"&&!_T.test(s)&&t.push({height:i.height,width:i.width,url:s});return t}function wN(e,t){return!e&&!t?"":e?t?`[no content, ${e} attachment${e!==1?"s":""} and ${t} embed${t!==1?"s":""}]`:`[no content, ${e} attachment${e!==1?"s":""}]`:`[no content, ${t} embed${t!==1?"s":""}]`}function xN(e){return!!(e.components.length||e.attachments.some(t=>!t.content_type?.startsWith("image/"))||e.embeds.some(t=>t.type!=="image"&&(t.type!=="gifv"||_T.test(t.url))))}function MN(e,t){if(e>t){let s=Math.min(e,400);return{width:s,height:Math.round(t/(e/s))}}let i=Math.min(t,300);return{width:Math.round(e/(t/i)),height:i}}function IN(e,t){return new Proxy(e,{get(o,r){return r==="vencordEmbeddedBy"?t:Reflect.get(...arguments)}})}function PN({message:e}){let t=e.vencordEmbeddedBy??[],o=[],r=null;for(;(r=Pf.exec(e.content))!==null;){let[i,s,l]=r;if(t.includes(l))continue;let c=ee.getChannel(s);if(!c||!c.isPrivate()&&!_e.can(me.VIEW_CHANNEL,c))continue;let{listMode:u,idList:p}=wc.store,d=[c.guild_id,s,e.author.id].some(M=>M&&p.includes(M));if(u==="blacklist"&&d||u==="whitelist"&&!d)continue;let h=Ji.get(l)?.message;if(!h)if(h??=zo.getMessage(s,l),h)Ji.set(l,{message:h,fetched:!0});else{let M={...e};delete M.embeds,delete M.interaction,SN.unshift(()=>bN(s,l).then(w=>w&&B.dispatch({type:"MESSAGE_UPDATE",message:M})));continue}let v={message:IN(h,[...t,e.id]),channel:c},b=wc.store.automodEmbeds;o.push(b==="always"||b==="prefer"&&!xN(h)?n(CN,{...v}):n(AN,{...v}))}return o.length?n(f,null,o):null}function BT(e){return e.isDM()?["Direct Message",Gt.getUserAvatarURL(E.getUser(e.recipients[0]))]:e.isGroupDM()?["Group DM",Gt.getChannelIconURL(e)]:["Server",Gt.getGuildIconURL(ae.getGuild(e.guild_id))]}function AN({message:e,channel:t}){let o=E.getUser(ee.getChannel(t.id).recipients?.[0]),[r,i]=BT(t);return n(hN,{embed:{rawDescription:"",color:"var(--background-secondary)",author:{name:n(V,{variant:"text-xs/medium",tag:"span"},n("span",null,r," - "),Pe.parse(t.isDM()?`<@${o.id}>`:`<#${t.id}>`)),iconProxyURL:i}},renderDescription:()=>n("div",{key:e.id,className:Q(OT.message,wc.store.messageBackgroundColor&&OT.searchResult)},n(vN,{id:`message-link-embeds-${e.id}`,message:e,channel:t,subscribeToComponentDispatch:!1}))})}function CN(e){let{message:t,channel:o}=e,r=Ts.MessageDisplayCompact.useSetting(),i=TN(t),{parse:s}=Pe,[l,c]=BT(o);return n(yN,{channel:o,childrenAccessories:n(V,{color:"text-muted",variant:"text-xs/medium",tag:"span",className:`${If.embedAuthor} ${If.embedMargin}`},c&&n("img",{src:c,className:If.embedAuthorIcon,alt:""}),n("span",null,n("span",null,l," - "),o.isDM()?Pe.parse(`<@${ee.getChannel(o.id).recipients[0]}>`):Pe.parse(`<#${o.id}>`))),compact:r,content:n(f,null,t.content||t.attachments.length<=i.length?s(t.content):[wN(t.attachments.length,t.embeds.length)],i.map(u=>{let{width:p,height:d}=MN(u.width,u.height);return n("div",null,n("img",{src:u.url,width:p,height:d}))})),hideTimestamp:!1,message:t,_messageEmbed:"automod"})}var Ji,hN,yN,vN,OT,If,Pf,_T,SN,wc,Af,FT=g(()=>{"use strict";a();Tc();$();le();P();we();Wr();I();H();T();Ji=new Map,hN=Ne(".inlineMediaEmbed"),yN=Ne(".withFooter]:","childrenMessageContent:"),vN=Ne("renderSimpleAccessories)"),OT=x("message","searchResult"),If=x("embedAuthorIcon","embedAuthor","embedAuthor"),Pf=/(?n(k,{onClick:()=>Ji.clear()},"Clear the linked message cache")}});Af=y({name:"MessageLinkEmbeds",description:"Adds a preview to messages that link another message",authors:[m.TheSun,m.Ven,m.RyanCaoDev],dependencies:["MessageAccessoriesAPI"],settings:wc,start(){ya("messageLinkEmbed",e=>Pf.test(e.message.content)?(Pf.lastIndex=0,n(_,null,n(PN,{message:e.message}))):null,4)}})});var UT=g(()=>{});var Cf,$T=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/messageLogger/deleteStyleOverlay.css",{name:"src/plugins/messageLogger/deleteStyleOverlay.css",source:`.messagelogger-deleted { - background-color: rgba(240 71 71 / 15%) !important; -} -`,classNames:{},dom:null});Cf="src/plugins/messageLogger/deleteStyleOverlay.css"});var Rf,GT=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/messageLogger/deleteStyleText.css",{name:"src/plugins/messageLogger/deleteStyleText.css",source:`/* Message content highlighting */ -.messagelogger-deleted [class*="contents"] > :is(div, h1, h2, h3, p) { - color: #f04747 !important; -} - -/* Bot "thinking" text highlighting */ -.messagelogger-deleted [class*="colorStandard"] { - color: #f04747 !important; -} - -/* Embed highlighting */ -.messagelogger-deleted article :is(div, span, h1, h2, h3, p) { - color: #f04747 !important; -} - -.messagelogger-deleted a { - color: #be3535 !important; - text-decoration: underline; -} -`,classNames:{},dom:null});Rf="src/plugins/messageLogger/deleteStyleText.css"});function HT(){G.plugins.MessageLogger.deleteStyle==="text"?(Nt(Rf),Xt(Cf)):(Xt(Rf),Nt(Cf))}var RN,zT,jT,kN,kf,WT=g(()=>{"use strict";a();UT();$();Qe();le();P();Ke();I();H();T();$T();GT();RN=x("edited","communicationDisabled","isSystemMessage");zT="ml-remove-history",jT="ml-toggle-style",kN=(e,t)=>{let{message:o}=t,{deleted:r,editHistory:i,id:s,channel_id:l}=o;if(!r&&!i?.length)return;e:{if(!r)break e;let c=document.getElementById(`chat-messages-${l}-${s}`);if(!c)break e;e.push(n(L.MenuItem,{id:jT,key:jT,label:"Toggle Deleted Highlight",action:()=>c.classList.toggle("messagelogger-deleted")}))}e.push(n(L.MenuItem,{id:zT,key:zT,label:"Remove Message History",color:"danger",action:()=>{r?B.dispatch({type:"MESSAGE_DELETE",channelId:l,id:s,mlDeleted:!0}):o.editHistory=[]}}))},kf=y({name:"MessageLogger",description:"Temporarily logs deleted and edited messages.",authors:[m.rushii,m.Ven,m.AutumnVN],contextMenus:{message:kN},start(){HT()},renderEdit(e){return n(_,{noop:!0},n("div",{className:"messagelogger-edited"},Pe.parse(e.content),n(Po,{timestamp:e.timestamp,isEdited:!0,isInline:!1},n("span",{className:RN.edited}," ","(",Ye.Messages.MESSAGE_EDITED,")"))))},makeEdit(e,t){return{timestamp:new Date(e.edited_timestamp),content:t.content}},options:{deleteStyle:{type:4,description:"The style of deleted messages",default:"text",options:[{label:"Red text",value:"text",default:!0},{label:"Red overlay",value:"overlay"}],onChange:()=>HT()},logDeletes:{type:3,description:"Whether to log deleted messages",default:!0},logEdits:{type:3,description:"Whether to log edited messages",default:!0},ignoreBots:{type:3,description:"Whether to ignore messages by bots",default:!1},ignoreSelf:{type:3,description:"Whether to ignore messages by yourself",default:!1},ignoreUsers:{type:0,description:"Comma-separated list of user IDs to ignore",default:""},ignoreChannels:{type:0,description:"Comma-separated list of channel IDs to ignore",default:""},ignoreGuilds:{type:0,description:"Comma-separated list of guild IDs to ignore",default:""}},handleDelete(e,t,o){try{if(e==null||!o&&!e.has(t.id))return e;let r=i=>{let s=e.get(i);if(!s)return;let l=64;t.mlDeleted||(s.flags&l)===l||this.shouldIgnore(s)?e=e.remove(i):e=e.update(i,u=>u.set("deleted",!0).set("attachments",u.attachments.map(p=>(p.deleted=!0,p))))};o?t.ids.forEach(r):r(t.id)}catch(r){new oe("MessageLogger").error("Error during handleDelete",r)}return e},shouldIgnore(e,t=!1){let{ignoreBots:o,ignoreSelf:r,ignoreUsers:i,ignoreChannels:s,ignoreGuilds:l,logEdits:c,logDeletes:u}=G.plugins.MessageLogger,p=E.getCurrentUser().id;return o&&e.author?.bot||r&&e.author?.id===p||i.includes(e.author?.id)||s.includes(e.channel_id)||s.includes(ee.getChannel(e.channel_id)?.parent_id)||(t?!c:!u)||l.includes(ee.getChannel(e.channel_id)?.guild_id)},patches:[{find:'displayName="MessageStore"',replacement:[{match:/MESSAGE_DELETE:function\((\i)\){let.+?((?:\i\.){2})getOrCreate.+?},/,replace:"MESSAGE_DELETE:function($1){ var cache = $2getOrCreate($1.channelId); cache = $self.handleDelete(cache, $1, false); $2commit(cache);},"},{match:/MESSAGE_DELETE_BULK:function\((\i)\){let.+?((?:\i\.){2})getOrCreate.+?},/,replace:"MESSAGE_DELETE_BULK:function($1){ var cache = $2getOrCreate($1.channelId); cache = $self.handleDelete(cache, $1, true); $2commit(cache);},"},{match:/(MESSAGE_UPDATE:function\((\i)\).+?)\.update\((\i)/,replace:"$1.update($3,m => (($2.message.flags & 64) === 64 || $self.shouldIgnore($2.message, true)) ? m : $2.message.content !== m.editHistory?.[0]?.content && $2.message.content !== m.content ? m.set('editHistory',[...(m.editHistory || []), $self.makeEdit($2.message, m)]) : m).update($3"},{match:/(?<=getLastEditableMessage\(\i\)\{.{0,200}\.find\((\i)=>)/,replace:"!$1.deleted &&"}]},{find:"}addReaction(",replacement:[{match:/this\.customRenderedContent=(\i)\.customRenderedContent,/,replace:"this.customRenderedContent = $1.customRenderedContent,this.deleted = $1.deleted || false,this.editHistory = $1.editHistory || [],"}]},{find:"THREAD_STARTER_MESSAGE?null===",replacement:[{match:/interactionData:(\i)\.interactionData/,replace:"interactionData:$1.interactionData,deleted:$1.deleted,editHistory:$1.editHistory,attachments:$1.attachments"},{match:/attachments:(\i)\((\i)\)/,replace:"attachments: $1((() => { if ($self.shouldIgnore($2)) return $2; let old = arguments[1]?.attachments; if (!old) return $2; let new_ = $2.attachments?.map(a => a.id) ?? []; let diff = old.filter(a => !new_.includes(a.id)); old.forEach(a => a.deleted = true); $2.attachments = [...diff, ...$2.attachments]; return $2;})()),deleted: arguments[1]?.deleted,editHistory: arguments[1]?.editHistory"},{match:/(\((\i)\){return null==\2\.attachments.+?)spoiler:/,replace:"$1deleted: arguments[0]?.deleted,spoiler:"}]},{find:".removeAttachmentHoverButton",group:!0,replacement:[{match:/(className:\i,attachment:\i),/,replace:"$1,attachment: {deleted},"},{match:/\[\i\.obscured\]:.+?,/,replace:"$& 'messagelogger-deleted-attachment': deleted,"}]},{find:"Message must not be a thread starter message",replacement:[{match:/\)\("li",\{(.+?),className:/,replace:')("li",{$1,className:(arguments[0].message.deleted ? "messagelogger-deleted " : "")+'}]},{find:'Messages.MESSAGE_EDITED,")"',replacement:[{match:/(\)\("div",\{id:.+?children:\[)/,replace:"$1 (arguments[0].message.editHistory?.length > 0 ? arguments[0].message.editHistory.map(edit => $self.renderEdit(edit)) : null), "}]},{find:'displayName="ReferencedMessageStore"',replacement:[{match:/MESSAGE_DELETE:function\((\i)\).+?},/,replace:"MESSAGE_DELETE:function($1){},"},{match:/MESSAGE_DELETE_BULK:function\((\i)\).+?},/,replace:"MESSAGE_DELETE_BULK:function($1){},"}]},{find:"useMessageMenu:",replacement:[{match:/children:(\[""===.+?\])/,replace:"children:arguments[0].message.deleted?[]:$1"}]}]})});function qT(e){_i({name:e.name,description:e.name,inputType:1,execute:async(t,o)=>await xc(e.name)?(G.plugins.MessageTags.clyde&&ge(o.channel.id,{content:`${vr} The tag **${e.name}** has been sent!`}),{content:e.message.replaceAll("\\n",` -`)}):(ge(o.channel.id,{content:`${vr} The tag **${e.name}** does not exist anymore! Please reload ur Discord to fix :)`}),{content:`/${e.name}`}),[NN]:!0},"CustomTags")}var vr,Ic,NN,Mc,xc,DN,LN,Nf,KT=g(()=>{"use strict";a();uo();Xo();$();P();I();vr="<:luna:1035316192220553236>",Ic="MessageTags_TAGS",NN=Symbol("MessageTags"),Mc=()=>dt(Ic).then(e=>e??[]),xc=e=>dt(Ic).then(t=>(t??[]).find(o=>o.name===e)??null),DN=async e=>{let t=await Mc();return t.push(e),kt(Ic,t),t},LN=async e=>{let t=await Mc();return t=await t.filter(o=>o.name!==e),kt(Ic,t),t};Nf=y({name:"MessageTags",description:"Allows you to save messages and to use them with a simple command.",authors:[m.Luna],options:{clyde:{name:"Clyde message on send",description:"If enabled, clyde will send you an ephemeral message when a tag was used.",type:3,default:!0}},dependencies:["CommandsAPI"],async start(){for(let e of await Mc())qT(e)},commands:[{name:"tags",description:"Manage all the tags for yourself",inputType:0,options:[{name:"create",description:"Create a new tag",type:1,options:[{name:"tag-name",description:"The name of the tag to trigger the response",type:3,required:!0},{name:"message",description:"The message that you will send when using this tag",type:3,required:!0}]},{name:"list",description:"List all tags from yourself",type:1,options:[]},{name:"delete",description:"Remove a tag from your yourself",type:1,options:[{name:"tag-name",description:"The name of the tag to trigger the response",type:3,required:!0}]},{name:"preview",description:"Preview a tag without sending it publicly",type:1,options:[{name:"tag-name",description:"The name of the tag to trigger the response",type:3,required:!0}]}],async execute(e,t){switch(e[0].name){case"create":{let o=ht(e[0].options,"tag-name",""),r=ht(e[0].options,"message","");if(await xc(o))return ge(t.channel.id,{content:`${vr} A Tag with the name **${o}** already exists!`});let i={name:o,enabled:!0,message:r};qT(i),await DN(i),ge(t.channel.id,{content:`${vr} Successfully created the tag **${o}**!`});break}case"delete":{let o=ht(e[0].options,"tag-name","");if(!await xc(o))return ge(t.channel.id,{content:`${vr} A Tag with the name **${o}** does not exist!`});Zs(o),await LN(o),ge(t.channel.id,{content:`${vr} Successfully deleted the tag **${o}**!`});break}case"list":{ge(t.channel.id,{embeds:[{title:"All Tags:",description:(await Mc()).map(o=>`\`${o.name}\`: ${o.message.slice(0,72).replaceAll("\\n"," ")}${o.message.length>72?"...":""}`).join(` -`)||`${vr} Woops! There are no tags yet, use \`/tags create\` to create one!`,color:14122879,type:"rich"}]});break}case"preview":{let o=ht(e[0].options,"tag-name",""),r=await xc(o);if(!r)return ge(t.channel.id,{content:`${vr} A Tag with the name **${o}** does not exist!`});ge(t.channel.id,{content:r.message.replaceAll("\\n",` -`)});break}default:{ge(t.channel.id,{content:"Invalid sub-command"});break}}}}]})});function EN(e){let t="";for(let o=0;o{"use strict";a();uo();P();I();Df=y({name:"MoreCommands",description:"echo, lenny, mock",authors:[m.Arjix,m.echo,m.Samu],dependencies:["CommandsAPI"],commands:[{name:"echo",description:"Sends a message as Clyde (locally)",options:[cr],inputType:3,execute:(e,t)=>{let o=ht(e,"message","");ge(t.channel.id,{content:o})}},{name:"lenny",description:"Sends a lenny face",options:[cr],execute:e=>({content:ht(e,"message","")+" ( \u0361\xB0 \u035C\u0296 \u0361\xB0)"})},{name:"mock",description:"mOcK PeOpLe",options:[Ys],execute:e=>({content:EN(ht(e,"message",""))})}]})});var Lf,ZT=g(()=>{"use strict";a();uo();P();I();Lf=y({name:"MoreKaomoji",description:"Adds more Kaomoji to discord. \u30FD(\xB4\u25BD`)/",authors:[m.JacobTm],dependencies:["CommandsAPI"],commands:[{name:"dissatisfaction",description:" \uFF1E\uFE4F\uFF1C"},{name:"smug",description:" \u0CA0_\u0CA0"},{name:"happy",description:" \u30FD(\xB4\u25BD`)/"},{name:"crying",description:" \u0CA5_\u0CA5"},{name:"angry",description:" \u30FD(\uFF40\u0414\xB4)\uFF89"},{name:"anger",description:" \u30FD(\uFF4F`\u76BF\u2032\uFF4F)\uFF89"},{name:"joy",description:" <(\uFFE3\uFE36\uFFE3)>"},{name:"blush",description:"\u0AEE \u02F6\u1D54 \u1D55 \u1D54\u02F6 \u10D0"},{name:"confused",description:"(\u2022\u0E34_\u2022\u0E34)?"},{name:"sleeping",description:"(\u1D17_\u1D17)"},{name:"laughing",description:"o(\u2267\u25BD\u2266)o"}].map(e=>({...e,options:[cr],execute:t=>({content:ht(t,"message","")+e.description})}))})});function _N(e){Sr.store.tagSettings??=Ef;let[t,o]=W(Sr.store.tagSettings),r=i=>{o(i),e.setValue(i)};return n(fe,{flexDirection:"column"},Qi.map(i=>n(Tt,{style:{padding:"1em 1em 0"}},n(S.FormTitle,{style:{width:"fit-content"}},n(ne,{text:i.description},({onMouseEnter:s,onMouseLeave:l})=>n("div",{onMouseEnter:s,onMouseLeave:l},i.displayName," Tag ",n(On,{type:On.Types[i.name]})))),n(Je,{type:"text",value:t[i.name]?.text??i.displayName,placeholder:`Text on tag (default: ${i.displayName})`,onChange:s=>{t[i.name].text=s,r(t)},className:j.bottom16}),n(wt,{value:t[i.name]?.showInChat??!0,onChange:s=>{t[i.name].showInChat=s,r(t)},hideBorder:!0},"Show in messages"),n(wt,{value:t[i.name]?.showInNotChat??!0,onChange:s=>{t[i.name].showInNotChat=s,r(t)},hideBorder:!0},"Show in member list and profiles"))))}var ON,On,XT,Qi,Ef,Sr,Of,JT=g(()=>{"use strict";a();$();Ut();P();ot();I();H();T();ON=x("computePermissions","canEveryoneRole"),On=so(e=>e.Types?.[0]==="BOT"),XT=(e,t)=>!!e?.webhookId&&t.isNonUserBot(),Qi=[{name:"WEBHOOK",displayName:"Webhook",description:"Messages sent by webhooks",condition:XT},{name:"OWNER",displayName:"Owner",description:"Owns the server",condition:(e,t,o)=>ae.getGuild(o?.guild_id)?.ownerId===t.id},{name:"ADMINISTRATOR",displayName:"Admin",description:"Has the administrator permission",permissions:["ADMINISTRATOR"]},{name:"MODERATOR_STAFF",displayName:"Staff",description:"Can manage the server, channels or roles",permissions:["MANAGE_GUILD","MANAGE_CHANNELS","MANAGE_ROLES"]},{name:"MODERATOR",displayName:"Mod",description:"Can manage messages or kick/ban people",permissions:["MANAGE_MESSAGES","KICK_MEMBERS","BAN_MEMBERS"]},{name:"VOICE_MODERATOR",displayName:"VC Mod",description:"Can manage voice chats",permissions:["MOVE_MEMBERS","MUTE_MEMBERS","DEAFEN_MEMBERS"]}],Ef=Object.fromEntries(Qi.map(({name:e,displayName:t})=>[e,{text:t,showInChat:!0,showInNotChat:!0}]));Sr=N({dontShowForBots:{description:"Don't show extra tags for bots (excluding webhooks)",type:3},dontShowBotTag:{description:"Only show extra tags for bots / Hide [BOT] text",type:3},tagSettings:{type:6,component:_N,description:"fill me"}}),Of=y({name:"MoreUserTags",description:"Adds tags for webhooks and moderative roles (owner, admin, etc.)",authors:[m.Cyn,m.TheSun,m.RyanCaoDev,m.LordElias,m.AutumnVN],settings:Sr,patches:[{find:"BotTagTypes:",replacement:{match:/\((\i)=\{\}\)\)\[(\i)\.BOT/,replace:"($1=$self.getTagTypes()))[$2.BOT"}},{find:".DISCORD_SYSTEM_MESSAGE_BOT_TAG_TOOLTIP,",replacement:[{match:/(switch\((\i)\){.+?)case (\i(?:\.\i)?)\.BOT:default:(\i)=.{0,40}(\i\.\i\.Messages)\.BOT_TAG_BOT/,replace:(e,t,o,r,i,s)=>`${t}default:{${i} = $self.getTagText(${r}[${o}], ${s})}`},{match:/(\i)=(\i)===\i(?:\.\i)?\.ORIGINAL_POSTER/,replace:"$1=$self.isOPTag($2)"},{match:/.botText,children:(\i)}\)]/,replace:"$&,'data-tag':$1.toLowerCase()"}]},{find:"renderSystemTag:",replacement:{match:/;return\((\(null==\i\?void 0:\i\.isSystemDM\(\).+?.Types.ORIGINAL_POSTER\)),null==(\i)\)/,replace:";$1;$2=$self.getTag({...arguments[0],origType:$2,location:'chat'});return $2 == null"}},{find:".Messages.GUILD_OWNER,",replacement:{match:/(?\i)=\(null==.{0,100}\.BOT;return null!=(?\i)&&\i\.bot/,replace:"$ = $self.getTag({user: $, channel: arguments[0].channel, origType: $.bot ? 0 : null, location: 'not-chat' }); return typeof $ === 'number'"}},{find:".hasAvatarForGuild(null==",replacement:{match:/(?=usernameIcon:)/,replace:"moreTags_channelId:arguments[0].channelId,"}},{find:'copyMetaData:"User Tag"',replacement:{match:/(?=,botClass:)/,replace:",moreTags_channelId:arguments[0].moreTags_channelId"}},{find:",overrideDiscriminator:",replacement:[{match:/user:\i,nick:\i,/,replace:"$&moreTags_channelId,"},{match:/,botType:(\i\((\i)\)),/g,replace:",botType:$self.getTag({user:$2,channelId:moreTags_channelId,origType:$1,location:'not-chat'}),"}]}],start(){if(!Sr.store.tagSettings)if(!Sr.store.visibility_WEBHOOK)Sr.store.tagSettings=Ef;else{let e={...Ef};Object.entries(Vencord.PlainSettings.plugins.MoreUserTags).forEach(([t,o])=>{let[r,i]=t.split("_");if(r==="visibility")switch(o){case"always":break;case"chat":e[i].showInNotChat=!1;break;case"not-chat":e[i].showInChat=!1;break;case"never":e[i].showInChat=!1,e[i].showInNotChat=!1;break}Sr.store.tagSettings=e,delete Vencord.Settings.plugins.MoreUserTags[t]})}},getPermissions(e,t){let o=ae.getGuild(t?.guild_id);if(!o)return[];let r=ON.computePermissions({user:e,context:o,overwrites:t.permissionOverwrites});return Object.entries(me).map(([i,s])=>r&s?i:"").filter(Boolean)},getTagTypes(){let e={},t=100;return Qi.forEach(({name:o})=>{e[o]=++t,e[t]=o,e[`${o}-BOT`]=++t,e[t]=`${o}-BOT`,e[`${o}-OP`]=++t,e[t]=`${o}-OP`}),e},isOPTag:e=>e===On.Types.ORIGINAL_POSTER||Qi.some(t=>e===On.Types[`${t.name}-OP`]),getTagText(e,t){if(!e)return t.BOT_TAG_BOT;let[o,r]=e.split("-"),i=Qi.find(({name:l})=>o===l);if(!i||r==="BOT"&&o!=="WEBHOOK"&&this.settings.store.dontShowForBots)return t.BOT_TAG_BOT;let s=Sr.store.tagSettings?.[i.name]?.text||i.displayName;switch(r){case"OP":return`${t.BOT_TAG_FORUM_ORIGINAL_POSTER} \u2022 ${s}`;case"BOT":return`${t.BOT_TAG_BOT} \u2022 ${s}`;default:return s}},getTag({message:e,user:t,channelId:o,origType:r,location:i,channel:s}){if(!t)return null;if(i==="chat"&&t.id==="1")return On.Types.OFFICIAL;if(t.isClyde())return On.Types.AI;let l=typeof r=="number"?r:null;if(s??=ee.getChannel(o),!s)return l;let c=this.settings.store,u=this.getPermissions(t,s);for(let p of Qi)if(!(i==="chat"&&!c.tagSettings[p.name].showInChat)&&!(i==="not-chat"&&!c.tagSettings[p.name].showInNotChat)&&(p.permissions?.some(d=>u.includes(d))||p.condition?.(e,t,s))){s.isForumPost()&&s.ownerId===t.id?l=On.Types[`${p.name}-OP`]:t.bot&&!XT(e,t)&&!c.dontShowBotTag?l=On.Types[`${p.name}-BOT`]:l=On.Types[p.name];break}return l}})});function UN(e,t){let o=0,r=0;for(;(r=e.indexOf(t,r)+1)!==0;)o++;return o}function $N(e,t){if(!t.global)throw new Error("pattern must be global");let o=0;for(;t.test(e);)o++;return o}function HN(e){let t=UN(e,Bf)+$N(e,GN);return Math.min(t,10)}function _f(){if(!br.store.triggerWhenUnfocused&&!document.hasFocus())return;let e=document.createElement("audio");e.src=br.store.quality==="HD"?FN:BN,e.volume=br.store.volume,e.play()}var Bf,BN,FN,br,Ff,GN,QT=g(()=>{"use strict";a();$();Jp();P();we();I();T();Bf="\u{1F5FF}",BN="https://raw.githubusercontent.com/MeguminSama/VencordPlugins/main/plugins/moyai/moyai.mp3",FN="https://raw.githubusercontent.com/MeguminSama/VencordPlugins/main/plugins/moyai/moyai_hd.wav",br=N({volume:{description:"Volume of the \u{1F5FF}\u{1F5FF}\u{1F5FF}",type:5,markers:en(0,1,.1),default:.5,stickToMarkers:!1},quality:{description:"Quality of the \u{1F5FF}\u{1F5FF}\u{1F5FF}",type:4,options:[{label:"Normal",value:"Normal",default:!0},{label:"HD",value:"HD"}]},triggerWhenUnfocused:{description:"Trigger the \u{1F5FF} even when the window is unfocused",type:3,default:!0},ignoreBots:{description:"Ignore bots",type:3,default:!0},ignoreBlocked:{description:"Ignore blocked users",type:3,default:!0}}),Ff=y({name:"Moyai",authors:[m.Megu,m.Nuckyz],description:"\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}",settings:br,flux:{async MESSAGE_CREATE({optimistic:e,type:t,message:o,channelId:r}){if(e||t!=="MESSAGE_CREATE"||o.state==="SENDING"||br.store.ignoreBots&&o.author?.bot||br.store.ignoreBlocked&&it.isBlocked(o.author?.id)||!o.content||r!==Ie.getChannelId())return;let i=HN(o.content);for(let s=0;s/gi});function qN(e){return e.name||e.recipients.map(E.getUser).filter(tm).map(t=>it.getNickname(t.id)||jN.getName(t)).join(", ")}var zN,jN,Tr,WN,Uf,VT=g(()=>{"use strict";a();P();Zl();I();H();T();zN=x("selectPrivateChannel"),jN=x("getGlobalName"),Tr=x("emptyIconFriends","emptyIconGuilds"),WN=x("guildNick","guildAvatarWithoutIcon");Uf=y({name:"MutualGroupDMs",description:"Shows mutual group dms in profiles",authors:[m.amia],patches:[{find:".Messages.USER_PROFILE_MODAL",replacement:{match:/(?<=\.tabBarItem.{0,50}MUTUAL_GUILDS.+?}\),)(?=.+?(\(0,\i\.jsxs?\)\(.{0,100}id:))/,replace:'(arguments[0].user.bot||arguments[0].isCurrentUser)?null:$1"MUTUAL_GDMS",children:"Mutual Groups"}),'}},{find:".UserProfileSections.USER_INFO_CONNECTIONS:",replacement:{match:/(?<={user:(\i),onClose:(\i)}\);)(?=case \i\.\i\.MUTUAL_FRIENDS)/,replace:'case "MUTUAL_GDMS":return $self.renderMutualGDMs($1,$2);'}}],renderMutualGDMs(e,t){let o=ee.getSortedPrivateChannels().filter(r=>r.isGroupDM()&&r.recipients.includes(e.id)).map(r=>n(bi,{className:Tr.listRow,onClick:()=>{t(),zN.selectPrivateChannel(r.id)}},n(Ti,{src:Gt.getChannelIconURL({id:r.id,icon:r.icon,size:32}),size:"SIZE_40",className:Tr.listAvatar}),n("div",{className:Tr.listRowContent},n("div",{className:Tr.listName},qN(r)),n("div",{className:WN.guildNick},r.recipients.length+1," Members"))));return n(Si,{className:Tr.listScroller,fade:!0,onClose:t},o.length>0?o:n("div",{className:Tr.empty},n("div",{className:Tr.emptyIconFriends}),n("div",{className:Tr.emptyText},"No group dms in common")))}})});var KN,YN,ZN,va,$f,ew=g(()=>{"use strict";a();$();P();I();H();({updateGuildNotificationSettings:KN}=x("updateGuildNotificationSettings")),{toggleShowAllChannels:YN}=x("toggleShowAllChannels"),{isOptInEnabledForGuild:ZN}=x("isOptInEnabledForGuild"),va=N({guild:{description:"Mute Guild automatically",type:3,default:!0},everyone:{description:"Suppress @everyone and @here",type:3,default:!0},role:{description:"Suppress All Role @mentions",type:3,default:!0},showAllChannels:{description:"Show all channels automatically",type:3,default:!0}});$s("NewGuildSettings","MuteNewGuild");$f=y({name:"NewGuildSettings",description:"Automatically mute new servers and change various other settings upon joining",tags:["MuteNewGuild","mute","server"],authors:[m.Glitch,m.Nuckyz,m.carince,m.Mopi],patches:[{find:",acceptInvite(",replacement:{match:/INVITE_ACCEPT_SUCCESS.+?,(\i)=null!==.+?;/,replace:(e,t)=>`${e}$self.handleMute(${t});`}},{find:"{joinGuild:",replacement:{match:/guildId:(\i),lurker:(\i).{0,20}}\)\);/,replace:(e,t,o)=>`${e}if(!${o})$self.handleMute(${t});`}}],settings:va,handleMute(e){e==="@me"||e==="null"||e==null||(KN(e,{muted:va.store.guild,suppress_everyone:va.store.everyone,suppress_roles:va.store.role}),va.store.showAllChannels&&ZN(e)&&YN(e))}})});var XN,Gf,tw=g(()=>{"use strict";a();$();P();I();H();XN=x("getRelationships","isBlocked"),Gf=y({name:"NoBlockedMessages",description:"Hides all blocked messages from chat completely.",authors:[m.rushii,m.Samu],patches:[{find:"Messages.BLOCKED_MESSAGES_HIDE",replacement:[{match:/let\{[^}]*collapsedReason[^}]*\}/,replace:"return null;$&"}]},...['displayName="MessageStore"','displayName="ReadStateStore"'].map(e=>({find:e,predicate:()=>G.plugins.NoBlockedMessages.ignoreBlockedMessages===!0,replacement:[{match:/(?<=MESSAGE_CREATE:function\((\i)\){)/,replace:(t,o)=>`if($self.isBlocked(${o}.message))return;`}]}))],options:{ignoreBlockedMessages:{description:"Completely ignores (recent) incoming messages from blocked users (locally).",type:3,default:!1,restartNeeded:!0}},isBlocked:e=>XN.isBlocked(e.author.id)})});var Hf,ow=g(()=>{"use strict";a();P();I();Hf=y({name:"NoDevtoolsWarning",description:"Disables the 'HOLD UP' banner in the console. As a side effect, also prevents Discord from hiding your token, which prevents random logouts.",authors:[m.Ven],patches:[{find:"setDevtoolsCallbacks",replacement:{match:/if\(null!=\i&&"0.0.0"===\i\.remoteApp\.getVersion\(\)\)/,replace:"if(true)"}}]})});var zf,nw=g(()=>{"use strict";a();P();I();zf=y({name:"NoF1",description:"Disables F1 help bind.",authors:[m.Cyn],patches:[{find:',"f1"],comboKeysBindGlobal:',replacement:{match:',"f1"],comboKeysBindGlobal:',replace:"],comboKeysBindGlobal:"}}]})});var jf,rw=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/noMosaic/styles.css",{name:"src/plugins/noMosaic/styles.css",source:`[class^="nonMediaAttachmentsContainer_"] [class*="messageAttachment_"] { - position: relative; -} -`,classNames:{},dom:null});jf="src/plugins/noMosaic/styles.css"});var Wf,qf,iw=g(()=>{"use strict";a();$();Qe();P();I();rw();Wf=N({inlineVideo:{description:"Play videos without carousel modal",type:3,default:!0,restartNeeded:!0},mediaLayoutType:{description:"Choose media layout type",type:4,restartNeeded:!0,options:[{label:"STATIC, render loading image but image isn't resposive, no problem unless discord window width is too small",value:"STATIC",default:!0},{label:"RESPONSIVE, image is responsive but not render loading image, cause messages shift when loaded",value:"RESPONSIVE"}]}}),qf=y({name:"NoMosaic",authors:[m.AutumnVN],description:"Removes Discord new image mosaic",tags:["image","mosaic","media"],settings:Wf,patches:[{find:".oneByTwoLayoutThreeGrid",replacement:[{match:/mediaLayoutType:\i\.\i\.MOSAIC/,replace:"mediaLayoutType:$self.mediaLayoutType()"},{match:/null!==\(\i=\i\.get\(\i\)\)&&void 0!==\i\?\i:"INVALID"/,replace:'"INVALID"'}]},{find:"renderAttachments(",predicate:()=>Wf.store.inlineVideo,replacement:{match:/url:(\i)\.url\}\);return /,replace:"$&$1.content_type?.startsWith('image/')&&"}},{find:"Messages.REMOVE_ATTACHMENT_TOOLTIP_TEXT",replacement:{match:/\i===\i\.\i\.MOSAIC/,replace:"true"}}],mediaLayoutType(){return Wf.store.mediaLayoutType},start(){Nt(jf)},stop(){Xt(jf)}})});var JN,Sa,Kf,sw=g(()=>{"use strict";a();$();P();I();H();JN=x("getMessageRequestsCount"),Sa=N({hideFriendRequestsCount:{type:3,description:"Hide incoming friend requests count",default:!0,restartNeeded:!0},hideMessageRequestsCount:{type:3,description:"Hide message requests count",default:!0,restartNeeded:!0},hidePremiumOffersCount:{type:3,description:"Hide nitro offers count",default:!0,restartNeeded:!0}}),Kf=y({name:"NoPendingCount",description:"Removes the ping count of incoming friend requests, message requests, and nitro offers.",authors:[m.amia],settings:Sa,patches:[{find:"getPendingCount(){",predicate:()=>Sa.store.hideFriendRequestsCount,replacement:{match:/(?<=getPendingCount\(\)\{)/,replace:"return 0;"}},{find:"getMessageRequestsCount(){",predicate:()=>Sa.store.hideMessageRequestsCount,replacement:{match:/(?<=getMessageRequestsCount\(\)\{)/,replace:"return 0;"}},{find:".getSpamChannelsCount(),",predicate:()=>Sa.store.hideMessageRequestsCount,replacement:{match:/(?<=getSpamChannelsCount\(\),\i=)\i\.getMessageRequestsCount\(\)/,replace:"$self.getRealMessageRequestCount()"}},{find:"showProgressBadge:",predicate:()=>Sa.store.hidePremiumOffersCount,replacement:{match:/(?<=\{unviewedTrialCount:(\i),unviewedDiscountCount:(\i)\}.{0,200}\i=)\1\+\2/,replace:"0"}}],getRealMessageRequestCount(){return JN.getMessageRequestChannelIds().size}})});var Yf,aw=g(()=>{"use strict";a();P();I();Yf=y({name:"NoProfileThemes",description:"Completely removes Nitro profile themes",authors:[m.TheKodeToad],patches:[{find:".NITRO_BANNER,",replacement:{match:/=(?=\i\.\i\.isPremiumAtLeast\(null==(\i))/,replace:"=(arguments[0]?.bannerSrc||$1?.banner)&&"}},{find:".avatarPositionPremiumNoBanner,default:",replacement:{match:/\.avatarPositionPremiumNoBanner(?=,default:\i\.(\i))/,replace:".$1"}},{find:"hasThemeColors(){",replacement:{match:/get canUsePremiumProfileCustomization\(\){return /,replace:"$&false &&"}}]})});var Pc,Zf,lw=g(()=>{"use strict";a();$();P();I();Pc=N({userList:{description:"List of users to allow or exempt pings for (separated by commas or spaces)",type:0,default:"1234567890123445,1234567890123445"},shouldPingListed:{description:"Behaviour",type:4,options:[{label:"Do not ping the listed users",value:!1},{label:"Only ping the listed users",value:!0,default:!0}]},inverseShiftReply:{description:"Invert Discord's shift replying behaviour (enable to make shift reply mention user)",type:3,default:!1}}),Zf=y({name:"NoReplyMention",description:"Disables reply pings by default",authors:[m.DustyAngel47,m.axyie,m.pylix,m.outfoxxed],settings:Pc,shouldMention(e,t){let o=Pc.store.userList.includes(e.author.id),r=Pc.store.shouldPingListed?o:!o;return Pc.store.inverseShiftReply?t!==r:!t&&r},patches:[{find:',"Message")}function',replacement:{match:/:(\i),shouldMention:!(\i)\.shiftKey/,replace:":$1,shouldMention:$self.shouldMention($1,$2.shiftKey)"}}]})});var Xf,cw=g(()=>{"use strict";a();P();I();Xf=y({name:"NoScreensharePreview",description:"Disables screenshare previews from being sent.",authors:[m.Nuckyz],patches:[{find:'"ApplicationStreamPreviewUploadManager"',replacement:{match:/await \i\.\i\.(makeChunkedRequest\(|post\(\{url:)\i\.\i\.STREAM_PREVIEW.+?\}\)/g,replace:"0"}}]})});var Jf,uw=g(()=>{"use strict";a();P();I();Jf=y({name:"NoTypingAnimation",authors:[m.AutumnVN],description:"Disables the CPU-intensive typing dots animation",patches:[{find:"dotCycle",replacement:{match:/document.hasFocus\(\)/,replace:"false"}}]})});var Qf,pw=g(()=>{"use strict";a();P();I();Qf=y({name:"NoUnblockToJump",description:"Allows you to jump to messages of blocked users without unblocking them",authors:[m.dzshn],patches:[{find:'.id,"Search Results"',replacement:{match:/if\(.{1,10}\)(.{1,10}\.show\({.{1,50}UNBLOCK_TO_JUMP_TITLE)/,replace:"if(false)$1"}},{find:"renderJumpButton()",replacement:{match:/if\(.{1,10}\)(.{1,10}\.show\({.{1,50}UNBLOCK_TO_JUMP_TITLE)/,replace:"if(false)$1"}},{find:"flash:!0,returnMessageId",replacement:{match:/.\?(.{1,10}\.show\({.{1,50}UNBLOCK_TO_JUMP_TITLE)/,replace:"false?$1"}}]})});var Vf,dw=g(()=>{"use strict";a();P();I();Vf=y({name:"NormalizeMessageLinks",description:"Strip canary/ptb from message links",authors:[m.bb010g],patches:[{find:".Messages.COPY_MESSAGE_LINK,",replacement:{match:/\.concat\(location\.host\)/,replace:".concat($self.normalizeHost(location.host))"}}],normalizeHost(e){return e.replace(/(^|\b)(canary\.|ptb\.)(discord.com)$/,"$1$3")}})});var QN,eg,mw=g(()=>{"use strict";a();$();P();I();QN=N({notificationVolume:{type:5,description:"Notification volume",markers:[0,25,50,75,100],default:100,stickToMarkers:!1}}),eg=y({name:"NotificationVolume",description:"Save your ears and set a separate volume for notifications and in-app sounds",authors:[m.philipbry],settings:QN,patches:[{find:"_ensureAudio(){",replacement:{match:/(?=Math\.min\(\i\.\i\.getOutputVolume\(\)\/100)/,replace:"$self.settings.store.notificationVolume/100*"}}]})});var tg,fw=g(()=>{"use strict";a();P();I();tg=y({name:"NSFWGateBypass",description:"Allows you to access NSFW channels without setting/verifying your age",authors:[m.Commandtechno],patches:[{find:".nsfwAllowed=null",replacement:{match:/(?<=\.nsfwAllowed=)null!==.+?(?=[,;])/,replace:"!0"}}]})});var ba,og,gw=g(()=>{"use strict";a();$();P();I();T();ba=N({channelToAffect:{type:4,description:"Select the type of DM for the plugin to affect",options:[{label:"Both",value:"both_dms",default:!0},{label:"User DMs",value:"user_dm"},{label:"Group DMs",value:"group_dm"}]},allowMentions:{type:3,description:"Receive audio pings for @mentions",default:!1},allowEveryone:{type:3,description:"Receive audio pings for @everyone and @here in group DMs",default:!1}}),og=y({name:"OnePingPerDM",description:"If unread messages are sent by a user in DMs multiple times, you'll only receive one audio ping. Read the messages to reset the limit",authors:[m.ProffDea],settings:ba,patches:[{find:".getDesktopType()===",replacement:[{match:/(\i\.\i\.getDesktopType\(\)===\i\.\i\.NEVER)\)/,replace:"$&if(!$self.isPrivateChannelRead(arguments[0]?.message))return;else "},{match:/sound:(\i\?\i:void 0,volume:\i,onClick)/,replace:"sound:!$self.isPrivateChannelRead(arguments[0]?.message)?undefined:$1"}]}],isPrivateChannelRead(e){let t=ee.getChannel(e.channel_id)?.type;return t!==1&&t!==3||t===1&&ba.store.channelToAffect==="group_dm"||t===3&&ba.store.channelToAffect==="user_dm"||ba.store.allowMentions&&e.mentions.some(o=>o.id===E.getCurrentUser().id)||ba.store.allowEveryone&&e.mention_everyone?!0:_r.getOldestUnreadMessageId(e.channel_id)===e.id}})});var ng,hw=g(()=>{"use strict";a();P();I();ng=y({name:"oneko",description:"cat follow mouse (real)",authors:[m.Ven,m.adryd],start(){fetch("https://raw.githubusercontent.com/adryd325/oneko.js/8fa8a1864aa71cd7a794d58bc139e755e96a236c/oneko.js").then(e=>e.text()).then(e=>e.replace("./oneko.gif","https://raw.githubusercontent.com/adryd325/oneko.js/14bab15a755d0e35cd4ae19c931d96d306f99f42/oneko.gif").replace("(isReducedMotion)","(false)")).then(eval)},stop(){document.getElementById("oneko")?.remove()}})});var VN,eD,tD,oD,ci,nD,rg,yw=g(()=>{"use strict";a();$();P();I();T();VN=/^https:\/\/(spotify\.link|s\.team)\/.+$/,eD=/^https:\/\/open\.spotify\.com\/(track|album|artist|playlist|user|episode)\/(.+)(?:\?.+?)?$/,tD=/^https:\/\/(steamcommunity\.com|(?:help|store)\.steampowered\.com)\/.+$/,oD=/^https:\/\/store\.epicgames\.com\/(.+)$/,ci=N({spotify:{type:3,description:"Open Spotify links in the Spotify app",default:!0},steam:{type:3,description:"Open Steam links in the Steam app",default:!0},epic:{type:3,description:"Open Epic Games links in the Epic Games Launcher",default:!0}}),nD=VencordNative.pluginHelpers.OpenInApp,rg=y({name:"OpenInApp",description:"Open Spotify, Steam and Epic Games URLs in their respective apps instead of your browser",authors:[m.Ven],settings:ci,patches:[{find:"trackAnnouncementMessageLinkClicked({",replacement:{match:/(?<=handleClick:function\(\)\{return (\i)\}.+?)function \1\(.+?\)\{/,replace:"async $& if(await $self.handleLink(...arguments)) return;"}},{find:"WEB_OPEN(",predicate:()=>ci.store.spotify,replacement:{match:/\i\.\i\.isProtocolRegistered\(\)(.{0,100})window.open/g,replace:"true$1VencordNative.native.openExternal"}},{find:".CONNECTED_ACCOUNT_VIEWED,",replacement:{match:/(?<=href:\i,onClick:\i=>\{)(?=.{0,10}\i=(\i)\.type,.{0,100}CONNECTED_ACCOUNT_VIEWED)/,replace:"$self.handleAccountView(arguments[0],$1.type,$1.id);"}}],async handleLink(e,t){if(!e)return!1;let o=e.href;VN.test(o)&&(t?.preventDefault(),o=await nD.resolveRedirect(o));e:{if(!ci.store.spotify)break e;let r=eD.exec(o);if(!r)break e;let[,i,s]=r;return VencordNative.native.openExternal(`spotify:${i}:${s}`),t?.preventDefault(),!0}e:{if(!ci.store.steam||!tD.test(o))break e;return VencordNative.native.openExternal(`steam://openurl/${o}`),t?.preventDefault(),Mt("Opened link in Steam",X.Type.SUCCESS),!0}e:{if(!ci.store.epic)break e;let r=oD.exec(o);if(!r)break e;return VencordNative.native.openExternal(`com.epicgames.launcher://store/${r[1]}`),t?.preventDefault(),!0}return t?.defaultPrevented?(window.open(o,"_blank"),!0):!1},handleAccountView(e,t,o){t==="spotify"&&ci.store.spotify?(VencordNative.native.openExternal(`spotify:user:${o}`),e.preventDefault()):t==="steam"&&ci.store.steam&&(VencordNative.native.openExternal(`steam://openurl/https://steamcommunity.com/profiles/${o}`),Mt("Opened link in Steam",X.Type.SUCCESS),e.preventDefault())}})});var ig,sg,vw=g(()=>{"use strict";a();$();P();I();ig=N({defaultLayout:{type:4,options:[{label:"List",value:1,default:!0},{label:"Gallery",value:2}],description:"Which layout to use as default"},defaultSortOrder:{type:4,options:[{label:"Recently Active",value:0,default:!0},{label:"Date Posted",value:1}],description:"Which sort order to use as default"}}),sg=y({name:"OverrideForumDefaults",description:"Allows you to override default forum layout/sort order. you can still change it on a per-channel basis",authors:[m.Inbestigator],patches:[{find:"getDefaultLayout(){",replacement:[{match:/getDefaultLayout\(\){/,replace:"$&return $self.getLayout();"},{match:/getDefaultSortOrder\(\){/,replace:"$&return $self.getSortOrder();"}]}],getLayout:()=>ig.store.defaultLayout,getSortOrder:()=>ig.store.defaultSortOrder,settings:ig})});function bw(e){B.dispatch({type:"POGGERMODE_SETTINGS_UPDATE",settings:{enabled:e,settingsVisible:e}})}function Tw(e){let t={screenshakeEnabledLocations:{0:!0,1:!0,2:!0},shakeIntensity:1,confettiSize:16,confettiCount:5,combosRequiredCount:1};switch(e){case 0:{Object.assign(t,{screenshakeEnabledLocations:{0:!0,1:!1,2:!1},combosRequiredCount:5});break}case 1:{Object.assign(t,{confettiSize:12,confettiCount:8});break}case 2:{Object.assign(t,{shakeIntensity:20,confettiSize:25,confettiCount:15});break}}B.dispatch({type:"POGGERMODE_SETTINGS_UPDATE",settings:t})}var Sw,ag,ww=g(()=>{"use strict";a();$();P();I();T();Sw=N({superIntensePartyMode:{description:"Party intensity",type:4,options:[{label:"Normal",value:0,default:!0},{label:"Better",value:1},{label:"Project X",value:2}],restartNeeded:!1,onChange:Tw}}),ag=y({name:"Party mode \u{1F389}",description:"Allows you to use party mode cause the party never ends \u2728",authors:[m.UwUDev],settings:Sw,start(){bw(!0),Tw(Sw.store.superIntensePartyMode)},stop(){bw(!1)}})});var lg,cg,xw=g(()=>{"use strict";a();$();P();I();lg=N({lockout:{type:3,default:!0,description:`Bypass the permission lockout prevention ("Pretty sure you don't want to do this")`,restartNeeded:!0},onboarding:{type:3,default:!0,description:'Bypass the onboarding requirements ("Making this change will make your server incompatible [...]")',restartNeeded:!0}}),cg=y({name:"PermissionFreeWill",description:"Disables the client-side restrictions for channel permission management.",authors:[m.lewisakura],patches:[{find:".showPermissionLockoutModal(",replacement:[{match:/case"DENY":.{0,50}if\((?=\i\.\i\.can)/,replace:"$&true||"}],predicate:()=>lg.store.lockout},{find:".ONBOARDING_CHANNEL_THRESHOLD_WARNING",replacement:[{match:/(?<=(?:isDefaultChannelThresholdMetAfterDelete|checkDefaultChannelThresholdMetAfterChannelPermissionDeny):function\(\)\{)return \i(?=\})/g,replace:"return () => true"}],predicate:()=>lg.store.onboarding}],settings:lg})});var Mw=g(()=>{});function rD(e){return An(e.toLowerCase().split("_"))}function Ac(e){return e=Iw[e]||e,Ye.Messages[e]||rD(e)}function Pw(e){e==="USE_APPLICATION_COMMANDS"?e="USE_APPLICATION_COMMANDS_GUILD":e==="SEND_VOICE_MESSAGES"?e="SEND_VOICE_MESSAGE_GUILD":e!=="STREAM"&&(e=Iw[e]||e);let t=Ye.Messages[`ROLE_PERMISSIONS_${e}_DESCRIPTION`];return t?.hasMarkdown?Pe.parse(t.message):typeof t=="string"?t:""}function Cc({id:e},t){let o=ae.getRoles(e);return[...t.roles,e].map(r=>o[r]).sort((r,i)=>i.position-r.position)}function Aw(e){switch(_n.store.permissionsSortOrder){case 0:return e.sort((t,o)=>o.position-t.position);case 1:return e.sort((t,o)=>t.position-o.position);default:return e}}function Rc(e,t){let o=ae.getRoles(t);return e.sort((r,i)=>{if(r.type!==0||i.type!==0)return 0;let s=o[r.id];return o[i.id].position-s.position})}var oo,Iw,Ta=g(()=>{"use strict";a();Qe();Cn();T();xa();wa();oo=ve("vc-permviewer-");Iw={MANAGE_GUILD:"MANAGE_SERVER",MANAGE_GUILD_EXPRESSIONS:"MANAGE_EXPRESSIONS",CREATE_GUILD_EXPRESSIONS:"CREATE_EXPRESSIONS",MODERATE_MEMBERS:"MODERATE_MEMBER",STREAM:"VIDEO",SEND_VOICE_MESSAGES:"ROLE_PERMISSIONS_SEND_VOICE_MESSAGE"}});function ug(){return n("svg",{height:"24",width:"24",viewBox:"0 0 24 24"},n("title",null,"Denied"),n("path",{fill:"var(--status-danger)",d:"M18.4 4L12 10.4L5.6 4L4 5.6L10.4 12L4 18.4L5.6 20L12 13.6L18.4 20L20 18.4L13.6 12L20 5.6L18.4 4Z"}))}function pg(){return n("svg",{height:"24",width:"24",viewBox:"0 0 24 24"},n("title",null,"Allowed"),n("path",{fill:"var(--text-positive)",d:"M8.99991 16.17L4.82991 12L3.40991 13.41L8.99991 19L20.9999 7.00003L19.5899 5.59003L8.99991 16.17ZZ"}))}function Rw(){return n("svg",{height:"24",width:"24",viewBox:"0 0 16 16"},n("g",null,n("title",null,"Not overwritten"),n("polygon",{fill:"var(--text-normal)",points:"12 2.32 10.513 2 4 13.68 5.487 14"})))}var kw=g(()=>{"use strict";a()});function sD(e,t,o){return de(r=>n(cD,{modalProps:r,permissions:e,guild:t,header:o}))}function aD({permissions:e,guild:t,modalProps:o,header:r}){e.sort((u,p)=>u.type-p.type),Be([Ge],()=>Ge.getMemberIds(t.id),null,(u,p)=>u.length===p.length),se(()=>{let u=e.filter(p=>p.type===1&&!Ge.isMember(t.id,p.id)).map(({id:p})=>p);B.dispatch({type:"GUILD_MEMBERS_REQUEST",guildIds:[t.id],userIds:u})},[]);let[i,s]=W(0),l=e[i],c=ae.getRoles(t.id);return n(ye,{...o,size:"large"},n(Le,null,n(V,{className:oo("perms-title"),variant:"heading-lg/semibold"},r," permissions:"),n(pt,{onClick:o.onClose})),n(ke,null,!l&&n("div",{className:oo("perms-no-perms")},n(V,{variant:"heading-lg/normal"},"No permissions to display!")),l&&n("div",{className:oo("perms-container")},n("div",{className:oo("perms-list")},e.map((u,p)=>{let d=E.getUser(u.id??""),h=c[u.id??""];return n("button",{className:oo("perms-list-item-btn"),onClick:()=>s(p)},n("div",{className:oo("perms-list-item",{"perms-list-item-active":i===p}),onContextMenu:v=>{_n.store.unsafeViewAsRole&&u.type===0&&Yt.openContextMenu(v,()=>n(lD,{guild:t,roleId:u.id,onClose:o.onClose}))}},(u.type===0||u.type===2)&&n("span",{className:oo("perms-role-circle"),style:{backgroundColor:h?.colorString??"var(--primary-300)"}}),u.type===1&&d!==void 0&&n("img",{className:oo("perms-user-img"),src:d.getAvatarURL(void 0,void 0,!1)}),n(V,{variant:"text-md/normal"},u.type===0?h?.name??"Unknown Role":u.type===1?(d&&Nn(d))??"Unknown User":n(fe,{style:{gap:"0.2em",justifyItems:"center"}},"@owner",n(Ev,{height:18,width:18,"aria-hidden":"true"})))))})),n("div",{className:oo("perms-perms")},Object.entries(me).map(([u,p])=>n("div",{className:oo("perms-perms-item")},n("div",{className:oo("perms-perms-item-icon")},(()=>{let{permissions:d,overwriteAllow:h,overwriteDeny:v}=l;return d?(d&p)===p?pg():ug():h&&(h&p)===p?pg():v&&(v&p)===p?ug():Rw()})()),n(V,{variant:"text-md/normal"},Ac(u)),n(ne,{text:Pw(u)||"No Description"},d=>n(Ll,{...d}))))))))}function lD({guild:e,roleId:t,onClose:o}){return n(L.Menu,{navId:oo("role-context-menu"),onClose:Yt.closeContextMenu,"aria-label":"Role Options"},n(L.MenuItem,{id:"vc-pw-view-as-role",label:"View As Role",action:()=>{let r=ae.getRole(e.id,t);!r||(o(),B.dispatch({type:"IMPERSONATE_UPDATE",guildId:e.id,data:{type:"ROLES",roles:{[t]:r}}}))}}))}var cD,Vi,wa=g(()=>{"use strict";a();le();Ut();It();mt();Ze();T();xa();Ta();kw();cD=_.wrap(aD),Vi=sD});var Nw=g(()=>{});function Ma({children:e,onMoreClick:t,buttons:o,moreTooltipText:r,defaultState:i=!1,onDropDownClick:s,headerText:l}){let[c,u]=W(i);return n(f,null,n("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"}},n(V,{tag:"h2",variant:"eyebrow",style:{color:"var(--header-primary)",display:"inline"}},l),n("div",{className:dg("center-flex")},o??null,t&&n(ne,{text:r},p=>n("button",{...p,className:dg("btn"),onClick:t},n("svg",{width:"24",height:"24",viewBox:"0 0 24 24"},n("path",{fill:"var(--text-normal)",d:"M7 12.001C7 10.8964 6.10457 10.001 5 10.001C3.89543 10.001 3 10.8964 3 12.001C3 13.1055 3.89543 14.001 5 14.001C6.10457 14.001 7 13.1055 7 12.001ZM14 12.001C14 10.8964 13.1046 10.001 12 10.001C10.8954 10.001 10 10.8964 10 12.001C10 13.1055 10.8954 14.001 12 14.001C13.1046 14.001 14 13.1055 14 12.001ZM19 10.001C20.1046 10.001 21 10.8964 21 12.001C21 13.1055 20.1046 14.001 19 14.001C17.8954 14.001 17 13.1055 17 12.001C17 10.8964 17.8954 10.001 19 10.001Z"})))),n(ne,{text:c?"Hide "+l:"Show "+l},p=>n("button",{...p,className:dg("btn"),onClick:()=>{u(d=>!d),s?.(c)}},n("svg",{width:"24",height:"24",viewBox:"0 0 24 24",transform:c?"scale(1 -1)":"scale(1 1)"},n("path",{fill:"var(--text-normal)",d:"M16.59 8.59003L12 13.17L7.41 8.59003L6 10L12 16L18 10L16.59 8.59003Z"})))))),c&&e)}var dg,mg=g(()=>{"use strict";a();Qe();T();Nw();dg=ve("vc-expandableheader-")});function pD({guild:e,guildMember:t,showBorder:o}){let r=_n.use(["permissionsSortOrder"]),[i,s]=Rt(()=>{let w=[],C=Cc(e,t),R=C.map(A=>({type:0,...A}));if(e.ownerId===t.userId){R.push({type:2,permissions:Object.values(me).reduce((F,z)=>F|z,0n)});let A=Ye.Messages.GUILD_OWNER||"Server Owner";w.push({permission:A,roleColor:"var(--primary-300)",rolePosition:1/0})}Aw(C);for(let[A,F]of Object.entries(me))for(let{permissions:z,colorString:Y,position:J}of C)if((z&F)===F){w.push({permission:Ac(A),roleColor:Y||"var(--primary-300)",rolePosition:J});break}return w.sort((A,F)=>F.rolePosition-A.rolePosition),[R,w]},[r.permissionsSortOrder]),{root:l,role:c,roleRemoveButton:u,roleNameOverflow:p,roles:d,rolePill:h,rolePillBorder:v,roleCircle:b,roleName:M}=uD;return n(Ma,{headerText:"Permissions",moreTooltipText:"Role Details",onMoreClick:()=>Vi(i,e,t.nick||E.getUser(t.userId).username),onDropDownClick:w=>_n.store.defaultPermissionsDropdownState=!w,defaultState:_n.store.defaultPermissionsDropdownState,buttons:[n(ne,{text:`Sorting by ${r.permissionsSortOrder===0?"Highest Role":"Lowest Role"}`},w=>n("button",{...w,className:oo("userperms-sortorder-btn"),onClick:()=>{r.permissionsSortOrder=r.permissionsSortOrder===0?1:0}},n("svg",{width:"20",height:"20",viewBox:"0 96 960 960",transform:r.permissionsSortOrder===0?"scale(1 1)":"scale(1 -1)"},n("path",{fill:"var(--text-normal)",d:"M440 896V409L216 633l-56-57 320-320 320 320-56 57-224-224v487h-80Z"}))))]},s.length>0&&n("div",{className:Q(l,d)},s.map(({permission:w,roleColor:C})=>n("div",{className:Q(c,h,o?v:null)},n("div",{className:u},n("span",{className:b,style:{backgroundColor:C}})),n("div",{className:M},n(V,{className:p,variant:"text-xs/medium"},w))))))}var uD,Dw,Lw=g(()=>{"use strict";a();le();mg();we();H();T();xa();Ta();wa();uD=go(()=>Object.assign({},...Dr(Ce.byProps("roles","rolePill","rolePillBorder"),Ce.byProps("roleCircle","dotBorderBase","dotBorderColor"),Ce.byProps("roleNameOverflow","root","roleName","roleRemoveButton"))));Dw=_.wrap(pD,{noop:!0})});function fg(e,t,o){return o===0&&!Ge.isMember(e,t)?null:n(L.MenuItem,{id:"perm-viewer-permissions",label:"Permissions",action:()=>{let r=ae.getGuild(e),i,s;switch(o){case 0:{let l=Ge.getMember(e,t);i=Cc(r,l).map(c=>({type:0,...c})),r.ownerId===t&&i.push({type:2,permissions:Object.values(me).reduce((c,u)=>c|u,0n)}),s=l.nick??E.getUser(l.userId).username;break}case 1:{let l=ee.getChannel(t);i=Rc(Object.values(l.permissionOverwrites).map(({id:c,allow:u,deny:p,type:d})=>({type:d,id:c,overwriteAllow:u,overwriteDeny:p})),e),s=l.name;break}default:{i=Object.values(ae.getRoles(r.id)).map(l=>({type:0,...l})),s=r.name;break}}Vi(i,r,s)}})}function kc(e,t){return(o,r)=>{if(!r||t===0&&!r.user||t===2&&!r.guild||t===1&&(!r.channel||!r.guild))return;let i=ut(e,o),s=(()=>{switch(t){case 0:return fg(r.guildId,r.user.id,t);case 1:return fg(r.guild.id,r.channel.id,t);case 2:return fg(r.guild.id);default:return null}})();s!=null&&(i?i.push(s):e==="roles"&&r.guildId&&o.splice(-1,0,n(L.MenuGroup,null,s)))}}var _n,gg,xa=g(()=>{"use strict";a();Mw();Eo();$();P();I();T();wa();Lw();Ta();_n=N({permissionsSortOrder:{description:"The sort method used for defining which role grants an user a certain permission",type:4,options:[{label:"Highest Role",value:0,default:!0},{label:"Lowest Role",value:1}]},defaultPermissionsDropdownState:{description:"Whether the permissions dropdown on user popouts should be open by default",type:3,default:!1}});gg=y({name:"PermissionsViewer",description:"View the permissions a user or channel has, and the roles of a server",authors:[m.Nuckyz,m.Ven],settings:_n,patches:[{find:".popularApplicationCommandIds,",replacement:{match:/showBorder:(.{0,60})}\),(?<=guild:(\i),guildMember:(\i),.+?)/,replace:(e,t,o,r)=>`${e}$self.UserPermissions(${o},${r},${t}),`}}],UserPermissions:(e,t,o)=>!!t&&n(Dw,{guild:e,guildMember:t,showBorder:o}),contextMenus:{"user-context":kc("roles",0),"channel-context":kc(["mute-channel","unmute-channel"],1),"guild-context":kc("privacy",2),"guild-header-popout":kc("privacy",2)}})});function Ow(e){let t=e instanceof File,o=t?URL.createObjectURL(e):e;return new Promise((r,i)=>{let s=new Image;s.onload=()=>{t&&URL.revokeObjectURL(o),r(s)},s.onerror=(l,c,u,p,d)=>i(d||l),s.crossOrigin="Anonymous",s.src=o})}async function hD(e,t,o){for(let r of e)switch(r.name){case"image":let i=gD.getUploads(t.channel.id,Ew)[0];if(i){if(!i.isImage)throw"Upload is not an image";return i.item.file}break;case"url":return r.value;case"user":try{return(await Bt.getUser(r.value)).getAvatarURL(o?void 0:t.guild?.id,2048).replace(/\?size=\d+$/,"?size=2048")}catch(s){throw console.error(`[petpet] Failed to fetch user -`,s),"Failed to fetch user. Check the console for more info."}}return null}var es,Ew,dD,mD,Nc,fD,gD,hg,_w=g(()=>{"use strict";a();uo();P();Uo();I();H();T();es=Ka(Rm()),Ew=0,dD=20,mD=128,Nc=10,fD=Jn(()=>Promise.all(Array.from({length:Nc},(e,t)=>Ow(`https://raw.githubusercontent.com/VenPlugs/petpet/main/frames/pet${t}.gif`)))),gD=x("getUploads");hg=y({name:"petpet",description:"Adds a /petpet slash command to create headpet gifs from any image",authors:[m.Ven],dependencies:["CommandsAPI"],commands:[{inputType:0,name:"petpet",description:"Create a petpet gif. You can only specify one of the image options",options:[{name:"delay",description:"The delay between each frame. Defaults to 20.",type:4},{name:"resolution",description:"Resolution for the gif. Defaults to 120. If you enter an insane number and it freezes Discord that's your fault.",type:4},{name:"image",description:"Image attachment to use",type:11},{name:"url",description:"URL to fetch image from",type:3},{name:"user",description:"User whose avatar to use as image",type:6},{name:"no-server-pfp",description:"Use the normal avatar instead of the server specific one when using the 'user' option",type:5}],execute:async(e,t)=>{let o=await fD(),r=ht(e,"no-server-pfp",!1);try{var i=await hD(e,t,r);if(!i)throw"No Image specified!"}catch(v){ge(t.channel.id,{content:String(v)});return}let s=await Ow(i),l=ht(e,"delay",dD),c=ht(e,"resolution",mD),u=(0,es.GIFEncoder)(),p=document.createElement("canvas");p.width=p.height=c;let d=p.getContext("2d");for(let v=0;vAs.promptToUpload([h],t.channel,Ew),10)}}]})});var Bw=g(()=>{});var Fw,yg,Uw=g(()=>{"use strict";a();Bw();$();le();P();I();T();Fw=N({loop:{description:"Whether to make the PiP video loop or not",type:3,default:!0,restartNeeded:!1}}),yg=y({name:"PictureInPicture",description:"Adds picture in picture to videos (next to the Download button)",authors:[m.Nobody],settings:Fw,patches:[{find:".nonMediaAttachment]",replacement:{match:/\.nonMediaAttachment\]:!(\i).{0,10}children:\[(\S)/,replace:"$&,$1&&$2&&$self.renderPiPButton(),"}}],renderPiPButton:_.wrap(()=>n(ne,{text:"Toggle Picture in Picture"},e=>n("div",{...e,className:"vc-pip-button",role:"button",style:{cursor:"pointer",paddingTop:"4px",paddingLeft:"4px",paddingRight:"4px"},onClick:t=>{let o=t.currentTarget.parentNode.parentNode.querySelector("video"),r=document.body.appendChild(o.cloneNode(!0));r.loop=Fw.store.loop,r.style.display="none",r.onleavepictureinpicture=()=>r.remove();function i(){r.currentTime=o.currentTime,r.requestPictureInPicture(),o.pause(),r.play()}r.readyState===4?i():r.onloadedmetadata=i}},n("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24"},n("path",{fill:"currentColor",d:"M21 3a1 1 0 0 1 1 1v7h-2V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h18zm0 10a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1h8zm-1 2h-6v4h6v-4z"})))),{noop:!0})})});var $w=g(()=>{});var Gw,Dc=g(()=>{"use strict";a();Gw=[1752220,3066993,3447003,10181046,15277667,15844367,15105570,15158332,9807270,6323595,1146986,2067276,2123412,7419530,11342935,12745742,11027200,10038562,9936031,5533306]});async function Bn(e){let{id:t}=E.getCurrentUser();await kt(Hw+t,e)}async function bg(){let e=E.getCurrentUser()?.id;await vD(e),await wD(e),Wt()}async function vD(e){pe=await dt(Hw+e)??[]}function jw(e){return pe.find(t=>t.id===e)}async function Ww(e){pe.push(e),await Bn(pe)}async function qw(e){let t=pe.findIndex(o=>o.id===e.id);t!==-1&&(pe[t]=e,await Bn(pe))}async function Kw(e,t){let o=pe.find(r=>r.id===t);!o||o.channels.includes(e)||(o.channels.push(e),await Bn(pe))}async function Yw(e){let t=pe.find(o=>o.channels.includes(e));!t||(t.channels=t.channels.filter(o=>o!==e),await Bn(pe))}async function Zw(e){!pe.find(o=>o.id===e)||(pe=pe.filter(o=>o.id!==e),await Bn(pe))}async function Xw(e,t=!0){let o=pe.find(r=>r.id===e);!o||(o.collapsed=t,await Bn(pe))}function Pa(e){return pe.some(t=>t.channels.includes(e))}function Jw(){return pe.length}function Qw(){return pe.filter(e=>!e.collapsed).map(e=>e.channels).flat()}function Vw(){return pe.reduce((e,t)=>(e.push(t.channels.length===0?1:t.channels.length),e),[])}function o2(e,t,o){!e[t]||!e[o]||([e[t],e[o]]=[e[o],e[t]])}async function wg(e,t){let o=pe.findIndex(i=>i.id===e),r=o+t;o2(pe,o,r),await Bn(pe)}async function xg(e,t){let o=pe.find(s=>s.channels.includes(e));if(!o)return;let r=o.channels.indexOf(e),i=r+t;o2(o.channels,r,i),await Bn(pe)}async function bD(){if(pe.some(o=>o.id==="oldPins"))return await kt(vg,!0);let e=SD(),t=[...new Set(e)].filter(o=>!pe.some(r=>r.channels.includes(o)));t?.length&&pe.push({id:"oldPins",name:"Pins",color:10070709,channels:t}),await kt(vg,!0)}async function TD(e){let t=await dt(yD+e);pe.length===0&&t?.length&&pe.push(...t.filter(o=>o.id!=="oldPins")),await kt(zw,!0)}async function wD(e){let t=await dt(zw),o=await dt(vg);t&&o||(t||await TD(e),o||await bD(),await Bn(pe))}var Hw,vg,zw,yD,pe,e2,Ia,t2,Tg,SD,Lc=g(()=>{"use strict";a();Xo();$();T();Dc();Aa();Hw="PinDMsCategories-",vg="PinDMsMigratedPinDMs",zw="PinDMsMigratedOldCategories",yD="BetterPinDMsCategories-",pe=[];e2=(e,t,o)=>{let r=e[t],i=e[t+o];return r&&i},Ia=(e,t)=>{let o=pe.findIndex(r=>r.id===e);return e2(pe,o,t)},t2=e=>Ia(e,-1)||Ia(e,1),Tg=(e,t)=>{let o=pe.find(i=>i.channels.includes(e));if(!o)return!1;let r=o.channels.indexOf(e);return e2(o.channels,r,t)};SD=()=>(G.plugins.PinDMs.pinnedDMs||void 0)?.split(",")});function PD(e,t){let[o,r]=W(null);return se(()=>{e?r(jw(e)):t&&r({id:X.genId(),name:`Pin Category ${pe.length+1}`,color:10070709,collapsed:!1,channels:[t]})},[e,t]),{category:o,setCategory:r}}function AD({categoryId:e,modalProps:t,initalChannelId:o}){let{category:r,setCategory:i}=PD(e,o);if(!r)return null;let s=async l=>{l.preventDefault(),e?await qw(r):await Ww(r),Wt(),t.onClose()};return n(ye,{...t},n(Le,null,n(V,{variant:"heading-lg/semibold",style:{flexGrow:1}},e?"Edit":"New"," Category")),n("form",{onSubmit:s},n(ke,{className:ID("content")},n(S.FormSection,null,n(S.FormTitle,null,"Name"),n(Je,{value:r.name,onChange:l=>i({...r,name:l})})),n(S.FormDivider,null),n(S.FormSection,null,n(S.FormTitle,null,"Color"),n(MD,{key:r.name,defaultColor:10070709,colors:Gw,onChange:l=>i({...r,color:l}),value:r.color,renderDefaultButton:()=>null,renderCustomButton:()=>n(xD,{color:r.color,onChange:l=>i({...r,color:l}),key:r.name,showEyeDropper:!1})}))),n(ct,null,n(k,{type:"submit",onClick:s,disabled:!r.name},e?"Save":"Create"))))}var xD,MD,Mg,ID,Ec,Ig=g(()=>{"use strict";a();Qe();Ze();H();T();Dc();Lc();Aa();xD=Ne(".Messages.USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR",".BACKGROUND_PRIMARY)"),MD=Ne(".presets,","customColor:"),Mg=vi(['name:"UserSettings"'],/createPromise:.{0,20}el\("(.+?)"\).{0,50}"UserSettings"/),ID=ve("vc-pindms-modal-");Ec=(e,t)=>Hr(async()=>(await Mg(),o=>n(AD,{categoryId:e,modalProps:o,initalChannelId:t})))});function n2(e){let t=Pa(e);return n(L.MenuItem,{id:"pin-dm",label:"Pin DMs"},!t&&n(f,null,n(L.MenuItem,{id:"vc-add-category",label:"Add Category",color:"brand",action:()=>Ec(null,e)}),n(L.MenuSeparator,null),pe.map(o=>n(L.MenuItem,{id:`pin-category-${o.name}`,label:o.name,action:()=>Kw(e,o.id).then(Wt)}))),t&&n(f,null,n(L.MenuItem,{id:"unpin-dm",label:"Unpin DM",color:"danger",action:()=>Yw(e).then(Wt)}),!vn.store.sortDmsByNewestMessage&&Tg(e,-1)&&n(L.MenuItem,{id:"move-up",label:"Move Up",action:()=>xg(e,-1).then(Wt)}),!vn.store.sortDmsByNewestMessage&&Tg(e,1)&&n(L.MenuItem,{id:"move-down",label:"Move Down",action:()=>xg(e,1).then(Wt)})))}var CD,RD,r2,i2=g(()=>{"use strict";a();Eo();T();Lc();Aa();Ig();CD=(e,t)=>{ut("leave-channel",e)?.unshift(n2(t.channel.id))},RD=(e,t)=>{let o=ut("close-dm",e);if(o){let r=o.findIndex(i=>i?.props?.id==="close-dm");o.splice(r,0,n2(t.channel.id))}},r2={"gdm-context":CD,"user-context":RD}});var s2,ND,a2,Wt,vn,Pg,Aa=g(()=>{"use strict";a();$w();$();le();P();we();I();H();T();i2();Ig();Dc();Lc();s2=x("privateChannelsHeaderContainer"),ND=Re("PrivateChannelSortStore"),Wt=()=>a2?.props?._forceUpdate?.(),vn=N({sortDmsByNewestMessage:{type:3,description:"Sort DMs by newest message",default:!1,onChange:()=>Wt()},dmSectioncollapsed:{type:3,description:"Collapse DM sections",default:!1,onChange:()=>Wt()}}),Pg=y({name:"PinDMs",description:"Allows you to pin private channels to the top of your DM list. To pin/unpin or reorder pins, right click DMs",authors:[m.Ven,m.Aria],settings:vn,contextMenus:r2,patches:[{find:".privateChannelsHeaderContainer,",replacement:[{match:/(?<=componentDidMount\(\){).{1,100}scrollToChannel/,replace:"$self._instance = this;$&"},{match:/(?<=\i,{channels:\i,)privateChannelIds:(\i)/,replace:"privateChannelIds:$1.filter(c=>!$self.isPinned(c))"},{match:/(?<=renderRow:this\.renderRow,)sections:\[.+?1\)]/,replace:"...$self.makeProps(this,{$&})"},{match:/this\.renderDM=\(.+?(\i\.default),{channel.+?this.renderRow=(\i)=>{/,replace:"$&if($self.isChannelIndex($2.section, $2.row))return $self.renderChannel($2.section,$2.row,$1);"},{match:/this\.renderSection=(\i)=>{/,replace:"$&if($self.isCategoryIndex($1.section))return $self.renderCategory($1);"},{match:/(?<=span",{)className:\i\.headerText,/,replace:"...$self.makeSpanProps(),$&"},{match:/(?<=this\.getRowHeight=.{1,100}return 1===)\i/,replace:"($&-$self.categoryLen())"},{match:/this.getRowHeight=\((\i),(\i)\)=>{/,replace:"$&if($self.isChannelHidden($1,$2))return 0;"},{match:/(?<=scrollTo\(\{to:\i\}\):\(\i\+=)(\d+)\*\(.+?(?=,)/,replace:"$self.getScrollOffset(arguments[0],$1,this.props.padding,this.state.preRenderedChildren,$&)"},{match:/(?<=scrollToChannel\(\i\){.{1,300})this\.props\.privateChannelIds/,replace:"[...$&,...$self.getAllUncollapsedChannels()]"}]},{find:'.FRIENDS},"friends"',replacement:{match:/(?<=\i=\i=>{).{1,100}premiumTabSelected.{1,800}showDMHeader:.+?,/,replace:"let forceUpdate = Vencord.Util.useForceUpdater();$&_forceUpdate:forceUpdate,"}},{find:".Routes.APPLICATION_STORE&&",replacement:{match:/(?<=\i=__OVERLAY__\?\i:\[\.\.\.\i\(\),\.\.\.)\i/,replace:"$self.getAllUncollapsedChannels().concat($&.filter(c=>!$self.isPinned(c)))"}},{find:".getFlattenedGuildIds()],",replacement:{match:/(?<=\i===\i\.ME\?)\i\.\i\.getPrivateChannelIds\(\)/,replace:"$self.getAllUncollapsedChannels().concat($&.filter(c=>!$self.isPinned(c)))"}}],sections:null,set _instance(e){this.instance=e,a2=e},startAt:"WebpackReady",start:bg,flux:{CONNECTION_OPEN:bg},isPinned:Pa,categoryLen:Jw,getSections:Vw,getAllUncollapsedChannels:Qw,requireSettingsMenu:Mg,makeProps(e,{sections:t}){return this.sections=t,this.sections.splice(1,0,...this.getPinCount(e.props.privateChannelIds||[])),this.instance?.props?.privateChannelIds?.length===0&&(this.sections[this.sections.length-1]=0),{sections:this.sections,chunkSize:this.getChunkSize()}},makeSpanProps(){return{onClick:()=>this.collapseDMList(),role:"button",style:{cursor:"pointer"}}},getChunkSize(){let e=this.getSections();return(e.length*40+e.reduce((o,r)=>o+=r+44,0)+256)*1.5},getPinCount(e){return e.length?this.getSections():[]},isCategoryIndex(e){return this.sections&&e>0&&e{let t=pe[e-1];return t?n("h2",{className:Q(s2.privateChannelsHeaderContainer,"vc-pindms-section-container",t.collapsed?"vc-pindms-collapsed":""),style:{color:`#${t.color.toString(16).padStart(6,"0")}`},onClick:async()=>{await Xw(t.id,!t.collapsed),Wt()},onContextMenu:o=>{Yt.openContextMenu(o,()=>n(L.Menu,{navId:"vc-pindms-header-menu",onClose:()=>B.dispatch({type:"CONTEXT_MENU_CLOSE"}),color:"danger","aria-label":"Pin DMs Category Menu"},n(L.MenuItem,{id:"vc-pindms-edit-category",label:"Edit Category",action:()=>Ec(t.id,null)}),t2(t.id)&&n(f,null,Ia(t.id,-1)&&n(L.MenuItem,{id:"vc-pindms-move-category-up",label:"Move Up",action:()=>wg(t.id,-1).then(()=>Wt())}),Ia(t.id,1)&&n(L.MenuItem,{id:"vc-pindms-move-category-down",label:"Move Down",action:()=>wg(t.id,1).then(()=>Wt())})),n(L.MenuSeparator,null),n(L.MenuItem,{id:"vc-pindms-delete-category",color:"danger",label:"Delete Category",action:()=>Zw(t.id).then(()=>Wt())})))}},n("span",{className:s2.headerText},t?.name??"uh oh"),n("svg",{className:"vc-pindms-collapse-icon","aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},n("path",{fill:"currentColor",d:"M9.3 5.3a1 1 0 0 0 0 1.4l5.29 5.3-5.3 5.3a1 1 0 1 0 1.42 1.4l6-6a1 1 0 0 0 0-1.4l-6-6a1 1 0 0 0-1.42 0Z"}))):null}),renderChannel(e,t,o){let{channel:r,category:i}=this.getChannel(e,t,this.instance.props.channels);return!r||!i||this.isChannelHidden(e,t)?null:n(o,{channel:r,selected:this.instance.props.selectedChannelId===r.id},r.id)},getChannel(e,t,o){let r=pe[e-1];if(!r)return{channel:null,category:null};let i=this.getCategoryChannels(r)[t];return{channel:o[i],category:r}},getCategoryChannels(e){return e.channels.length===0?[]:vn.store.sortDmsByNewestMessage?ND.getPrivateChannelIds().filter(t=>e.channels.includes(t)):e?.channels??[]}})});var Ag,l2=g(()=>{"use strict";a();P();I();Ag=y({name:"PlainFolderIcon",description:"Doesn't show the small guild icons in folders",authors:[m.botato],patches:[{find:".expandedFolderIconWrapper",replacement:[{match:/\(\w\|\|\w\)&&(\(.{0,40}\(.{1,3}\.animated)/,replace:"$1"}]}]})});var kg={};qe(kg,{__getDecorators:()=>DD,addDecorator:()=>Cg,decorators:()=>Oc,removeDecorator:()=>Rg});function Cg(e,t,o){Oc.set(e,{decorator:t,onlyIn:o})}function Rg(e){Oc.delete(e)}function DD(e){let t=!!e.guildId;return Array.from(Oc.values(),o=>{let{decorator:r,onlyIn:i}=o;return!i||i==="guilds"&&t||i==="dms"&&!t?r(e):null})}var Oc,Ng=g(()=>{"use strict";a();Oc=new Map});var Eg={};qe(Eg,{__addDecorationsToMessage:()=>LD,addDecoration:()=>Dg,decorations:()=>_c,removeDecoration:()=>Lg});function Dg(e,t){_c.set(e,t)}function Lg(e){_c.delete(e)}function LD(e){return[..._c.values()].map(t=>t(e))}var _c,Og=g(()=>{"use strict";a();_c=new Map});function Bc(e,t){return({color:o,tooltip:r,small:i})=>n(ne,{text:r},s=>n("svg",{...s,height:(t?.height??20)-(i?3:0),width:(t?.width??20)-(i?3:0),viewBox:t?.viewBox??"0 0 24 24",fill:o},n("path",{d:e})))}var ED,c2,OD,_D,BD,Bg,u2,_g,Fg,p2=g(()=>{"use strict";a();fl();Ng();Og();$();le();P();I();H();T();ED=Re("SessionsStore");c2={desktop:Bc("M4 2.5c-1.103 0-2 .897-2 2v11c0 1.104.897 2 2 2h7v2H7v2h10v-2h-4v-2h7c1.103 0 2-.896 2-2v-11c0-1.103-.897-2-2-2H4Zm16 2v9H4v-9h16Z"),web:Bc("M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2Zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93Zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39Z"),mobile:Bc("M 187 0 L 813 0 C 916.277 0 1000 83.723 1000 187 L 1000 1313 C 1000 1416.277 916.277 1500 813 1500 L 187 1500 C 83.723 1500 0 1416.277 0 1313 L 0 187 C 0 83.723 83.723 0 187 0 Z M 125 1000 L 875 1000 L 875 250 L 125 250 Z M 500 1125 C 430.964 1125 375 1180.964 375 1250 C 375 1319.036 430.964 1375 500 1375 C 569.036 1375 625 1319.036 625 1250 C 625 1180.964 569.036 1125 500 1125 Z",{viewBox:"0 0 1000 1500",height:17,width:17}),console:Bc("M14.8 2.7 9 3.1V47h3.3c1.7 0 6.2.3 10 .7l6.7.6V2l-4.2.2c-2.4.1-6.9.3-10 .5zm1.8 6.4c1 1.7-1.3 3.6-2.7 2.2C12.7 10.1 13.5 8 15 8c.5 0 1.2.5 1.6 1.1zM16 33c0 6-.4 10-1 10s-1-4-1-10 .4-10 1-10 1 4 1 10zm15-8v23.3l3.8-.7c2-.3 4.7-.6 6-.6H43V3h-2.2c-1.3 0-4-.3-6-.6L31 1.7V25z",{viewBox:"0 0 50 50"})},OD=x("useStatusFillColor","StatusTypes"),_D=({platform:e,status:t,small:o})=>{let r=e[0].toUpperCase()+e.slice(1),i=c2[e]??c2.desktop;return n(i,{color:OD.useStatusFillColor(t),tooltip:r,small:o})},BD=e=>cn.getState()?.clientStatuses?.[e],Bg=({user:e,wantMargin:t=!0,wantTopMargin:o=!1,small:r=!1})=>{if(!e||e.bot)return null;if(e.id===E.getCurrentUser().id){let l=ED.getSessions();if(typeof l!="object")return null;let c=Object.values(l).sort(({status:d},{status:h})=>d===h?0:d==="online"?1:h==="online"?-1:d==="idle"?1:h==="idle"?-1:0),u=Object.values(c).reduce((d,h)=>(h.clientInfo.client!=="unknown"&&(d[h.clientInfo.client]=h.status),d),{}),{clientStatuses:p}=cn.getState();p[E.getCurrentUser().id]=u}let i=cn.getState()?.clientStatuses?.[e.id];if(!i)return null;let s=Object.entries(i).map(([l,c])=>n(_D,{key:l,platform:l,status:c,small:r}));return s.length?n("span",{className:"vc-platform-indicator",style:{display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:t?4:0,verticalAlign:"top",position:"relative",top:o?2:0,padding:t?0:1,gap:2}},s):null},u2={component:e=>n(Bg,{...e,wantMargin:!1}),position:0,shouldShow:e=>!!Object.keys(BD(e.user.id)??{}).length,key:"indicator"},_g={list:{description:"In the member list",onEnable:()=>Cg("platform-indicator",e=>n(_,{noop:!0},n(Bg,{user:e.user,small:!0}))),onDisable:()=>Rg("platform-indicator")},badges:{description:"In user profiles, as badges",onEnable:()=>Ug(u2),onDisable:()=>$g(u2)},messages:{description:"Inside messages",onEnable:()=>Dg("platform-indicator",e=>n(_,{noop:!0},n(Bg,{user:e.message?.author,wantTopMargin:!0}))),onDisable:()=>Lg("platform-indicator")}},Fg=y({name:"PlatformIndicators",description:"Adds platform indicators (Desktop, Mobile, Web...) to users",authors:[m.kemo,m.TheSun,m.Nuckyz,m.Ven],dependencies:["MessageDecorationsAPI","MemberListDecoratorsAPI"],start(){let e=G.plugins.PlatformIndicators,{displayMode:t}=e;t&&(t!=="both"?e[t]=!0:(e.list=!0,e.badges=!0),e.messages=!0,delete e.displayMode),Object.entries(_g).forEach(([o,r])=>{e[o]&&r.onEnable()})},stop(){Object.entries(_g).forEach(([e,t])=>{t.onDisable()})},patches:[{find:".Masks.STATUS_ONLINE_MOBILE",predicate:()=>G.plugins.PlatformIndicators.colorMobileIndicator,replacement:[{match:/\.STATUS_TYPING;switch(?=.+?(if\(\i\)return \i\.\i\.Masks\.STATUS_ONLINE_MOBILE))/,replace:".STATUS_TYPING;$1;switch"},{match:/switch\(\i\)\{case \i\.\i\.ONLINE:(if\(\i\)return\{[^}]+\})/,replace:"$1;$&"}]},{find:".AVATAR_STATUS_MOBILE_16;",predicate:()=>G.plugins.PlatformIndicators.colorMobileIndicator,replacement:[{match:/\i===\i\.\i\.ONLINE&&(?=.{0,70}\.AVATAR_STATUS_MOBILE_16;)/,replace:""},{match:/(?<=\(\i\.status,)(\i)(?=,(\i),\i\))/,replace:(e,t,o)=>`${o}?"online":${t}`},{match:/(?<=\i&&!\i)&&\i===\i\.\i\.ONLINE/,replace:""}]},{find:"}isMobileOnline(",predicate:()=>G.plugins.PlatformIndicators.colorMobileIndicator,replacement:{match:/(?<=\i\[\i\.\i\.MOBILE\])===\i\.\i\.ONLINE/,replace:"!= null"}}],options:{...Object.fromEntries(Object.entries(_g).map(([e,t])=>[e,{type:3,description:`Show indicators ${t.description.toLowerCase()}`,restartNeeded:!0,default:!0}])),colorMobileIndicator:{type:3,description:"Whether to make the mobile indicator match the color of the user status.",default:!0,restartNeeded:!0}}})});var m2,d2,FD,UD,$D,Gg,f2=g(()=>{"use strict";a();En();uo();P();I();H();T();m2=x("getUploads"),d2=e=>Ps.getDraft(e,0),FD=e=>new Promise(t=>{let o=new Image;o.onload=()=>t({width:o.width,height:o.height}),o.onerror=()=>t(null),o.src=e}),UD=async e=>await Promise.all(m2.getUploads(e,0).map(async t=>{let{isImage:o,filename:r,spoiler:i,item:{file:s}}=t,l=URL.createObjectURL(s),c={id:Ks(),filename:i?"SPOILER_"+r:r,content_type:void 0,size:await t.getSize(),spoiler:i,url:l+"#",proxy_url:l+"#"};if(o){let u=await FD(l);if(!u)return c;c.width=u.width,c.height=u.height}return c})),$D=({isMainChat:e,isEmpty:t,type:{attachments:o}})=>{let r=Ie.getChannelId(),i=Be([Ps],()=>d2(r));if(!e)return null;let s=o&&m2.getUploads(r,0).length>0;return!(!t&&i?.length>0)&&!s?null:n(xo,{tooltip:"Preview Message",onClick:async()=>ge(r,{content:d2(r),author:E.getCurrentUser(),attachments:s?await UD(r):void 0}),buttonProps:{style:{translate:"0 2px"}}},n("svg",{fill:"currentColor",fillRule:"evenodd",width:"24",height:"24",viewBox:"0 0 24 24",style:{scale:"1.096",translate:"0 -1px"}},n("path",{d:"M22.89 11.7c.07.2.07.4 0 .6C22.27 13.9 19.1 21 12 21c-7.11 0-10.27-7.11-10.89-8.7a.83.83 0 0 1 0-.6C1.73 10.1 4.9 3 12 3c7.11 0 10.27 7.11 10.89 8.7Zm-4.5-3.62A15.11 15.11 0 0 1 20.85 12c-.38.88-1.18 2.47-2.46 3.92C16.87 17.62 14.8 19 12 19c-2.8 0-4.87-1.38-6.39-3.08A15.11 15.11 0 0 1 3.15 12c.38-.88 1.18-2.47 2.46-3.92C7.13 6.38 9.2 5 12 5c2.8 0 4.87 1.38 6.39 3.08ZM15.56 11.77c.2-.1.44.02.44.23a4 4 0 1 1-4-4c.21 0 .33.25.23.44a2.5 2.5 0 0 0 3.32 3.32Z"})))},Gg=y({name:"PreviewMessage",description:"Lets you preview your message before sending it.",authors:[m.Aria],dependencies:["ChatInputButtonAPI"],startAt:"Init",start:()=>wo("previewMessage",$D),stop:()=>nn("previewMessage")})});var g2=g(()=>{});function Hg(){return n(U.Fragment,null,n(S.FormTitle,{tag:"h3"},"More Information"),n(S.FormText,null,"To add your own pronouns, visit"," ",n(je,{href:"https://pronoundb.org"},"pronoundb.org")),n(S.FormDivider,null),n(S.FormText,null,"The two pronoun formats are lowercase and capitalized. Example:",n("ul",null,n("li",null,"Lowercase: they/them"),n("li",null,"Capitalized: They/Them")),'Text like "Ask me my pronouns" or "Any pronouns" will always be capitalized. ',n("br",null),n("br",null),"You can also configure whether or not to display pronouns for the current user (since you probably already know them)"))}var h2=g(()=>{"use strict";a();To();T()});var zg,y2=g(()=>{a();zg="Vendicated/Vencord"});var v2,S2=g(()=>{"use strict";a();ki();y2();v2=`Vencord/${No}${zg?` (https://github.com/${zg})`:""}`});var Fn,Fc=g(()=>{"use strict";a();$();I();Uc();Fn=N({pronounsFormat:{type:4,description:"The format for pronouns to appear in chat",options:[{label:"Lowercase",value:"LOWERCASE",default:!0},{label:"Capitalized",value:"CAPITALIZED"}]},pronounSource:{type:4,description:"Where to source pronouns from",options:[{label:"Prefer PronounDB, fall back to Discord",value:0,default:!0},{label:"Prefer Discord, fall back to PronounDB (might lead to inconsistency between pronouns in chat and profile)",value:1}]},showSelf:{type:3,description:"Enable or disable showing pronouns for the current user",default:!0},showInMessages:{type:3,description:"Show in messages",default:!0},showInProfile:{type:3,description:"Show in profile",default:!0}})});var $c,b2=g(()=>{"use strict";a();$c={hh:"He/Him",hi:"He/It",hs:"He/She",ht:"He/They",ih:"It/Him",ii:"It/Its",is:"It/She",it:"It/They",shh:"She/He",sh:"She/Her",si:"She/It",st:"She/They",th:"They/He",ti:"They/It",ts:"They/She",tt:"They/Them",any:"Any pronouns",other:"Other pronouns",ask:"Ask me my pronouns",avoid:"Avoid pronouns, use my name",unspecified:"Unspecified"}});function HD(e,t=!1){let o=ho.getUserProfile(e)?.pronouns;return t?o:ho.getGuildMemberProfile(e,Bi()?.guild_id)?.pronouns||o}function Gc(e,t=!1){let o=HD(e,t)?.trim().replace(zD," "),[r]=st(()=>jD(e),{fallbackValue:x2(e),onError:i=>console.error("Fetching pronouns failed: ",i)});return Fn.store.pronounSource===1&&o?[o,"Discord"]:r&&r!=="unspecified"?[qD(r),"PronounDB"]:[o,"Discord"]}function w2(e,t=!1){let o=Gc(e,t);return!Fn.store.showInProfile||!Fn.store.showSelf&&e===E.getCurrentUser().id?T2:o}function x2(e){let t=jg[e];return t&&t!=="unspecified"?t:t||null}function jD(e){return new Promise(t=>{let o=x2(e);if(o)return t(o);if(e in ts)return ts[e].push(t);ts[e]=[t],GD()})}async function WD(e){let t=new URLSearchParams;t.append("platform","discord"),t.append("ids",e.join(","));try{return await(await fetch("https://pronoundb.org/api/v1/lookup-bulk?"+t.toString(),{method:"GET",headers:{Accept:"application/json","X-PronounDB-Source":v2}})).json().then(r=>(Object.assign(jg,r),r))}catch(o){console.error("PronounDB fetching failed: ",o);let r=Object.fromEntries(e.map(i=>[i,"unspecified"]));return Object.assign(jg,r),r}}function qD(e){let{pronounsFormat:t}=G.plugins.PronounDB;return t==="CAPITALIZED"?$c[e]:t==="LOWERCASE"&&["any","ask","avoid","other"].includes(e)?$c[e]:$c[e].toLowerCase()}var T2,jg,ts,GD,zD,Uc=g(()=>{"use strict";a();$();zr();S2();mt();lt();T();Fc();b2();T2=[null,""],jg={},ts={},GD=lo(async()=>{let e=Object.keys(ts),t=await WD(e);for(let o of e)ts[o]?.forEach(r=>r(t[o])),delete ts[o]});zD=/\n+/g});function M2(e){return!(!Fn.store.showInMessages||e.author.bot||e.author.system||e.type===KD||!Fn.store.showSelf&&e.author.id===E.getCurrentUser().id)}function YD({message:e}){let[t]=Gc(e.author.id);return t?n("span",{className:Q(Hc.timestampInline,Hc.timestamp)},"\u2022 ",t):null}var Hc,KD,I2,P2,ZD,A2=g(()=>{"use strict";a();le();we();H();T();Uc();Fc();Hc=x("timestampInline"),KD=24;I2=_.wrap(({message:e})=>M2(e)?n(YD,{message:e}):null,{noop:!0}),P2=_.wrap(({message:e})=>M2(e)?n(ZD,{message:e}):null,{noop:!0});ZD=_.wrap(({message:e})=>{let[t]=Gc(e.author.id);return t?n("span",{className:Q(Hc.timestampInline,Hc.timestamp,"vc-pronoundb-compact")},"\u2022 ",t):null},{noop:!0})});var C2,Wg,R2=g(()=>{"use strict";a();g2();P();I();h2();A2();Uc();Fc();C2={match:/text:(.{0,10}.Messages\.USER_PROFILE_PRONOUNS)(?=,)/,replace:'$& + (typeof vcPronounSource !== "undefined" ? ` (${vcPronounSource})` : "")'},Wg=y({name:"PronounDB",authors:[m.Tyman,m.TheKodeToad,m.Ven],description:"Adds pronouns to user messages using pronoundb",patches:[{find:"showCommunicationDisabledStyles",replacement:{match:/("span",{id:\i,className:\i,children:\i}\))/,replace:"$1, $self.CompactPronounsChatComponentWrapper(arguments[0])"}},{find:"showCommunicationDisabledStyles",replacement:{match:/(?<=return\s*\(0,\i\.jsxs?\)\(.+!\i&&)(\(0,\i.jsxs?\)\(.+?\{.+?\}\))/,replace:"[$1, $self.PronounsChatComponentWrapper(arguments[0])]"}},{find:".userTagNoNickname",replacement:[{match:/{user:(\i),[^}]*,pronouns:(\i),[^}]*}=\i;/,replace:"$&let vcPronounSource;[$2,vcPronounSource]=$self.useProfilePronouns($1.id);"},C2]},{find:".nameTagSmall)",replacement:[{match:/\.getName\(\i\);(?<=displayProfile.{0,200})/,replace:"$&const [vcPronounce,vcPronounSource]=$self.useProfilePronouns(arguments[0].user.id,true);if(arguments[0].displayProfile&&vcPronounce)arguments[0].displayProfile.pronouns=vcPronounce;"},C2]}],settings:Fn,settingsAboutComponent:Hg,PronounsChatComponentWrapper:I2,CompactPronounsChatComponentWrapper:P2,useProfilePronouns:w2})});var qg,k2=g(()=>{"use strict";a();li();P();mt();I();T();qg=y({name:"QuickMention",authors:[m.kemo],description:"Adds a quick mention button to the message actions bar",dependencies:["MessagePopoverAPI"],start(){on("QuickMention",e=>{let t=ee.getChannel(e.channel_id);return t.guild_id&&!_e.can(me.SEND_MESSAGES,t)?null:{label:"Quick Mention",icon:this.Icon,message:e,channel:t,onClick:()=>kn(`<@${e.author.id}> `)}})},stop(){Oo("QuickMention")},Icon:()=>n("svg",{className:"icon",height:"24",width:"24",viewBox:"0 0 24 24",fill:"currentColor"},n("path",{d:"M12 2C6.486 2 2 6.486 2 12C2 17.515 6.486 22 12 22C14.039 22 15.993 21.398 17.652 20.259L16.521 18.611C15.195 19.519 13.633 20 12 20C7.589 20 4 16.411 4 12C4 7.589 7.589 4 12 4C16.411 4 20 7.589 20 12V12.782C20 14.17 19.402 15 18.4 15L18.398 15.018C18.338 15.005 18.273 15 18.209 15H18C17.437 15 16.6 14.182 16.6 13.631V12C16.6 9.464 14.537 7.4 12 7.4C9.463 7.4 7.4 9.463 7.4 12C7.4 14.537 9.463 16.6 12 16.6C13.234 16.6 14.35 16.106 15.177 15.313C15.826 16.269 16.93 17 18 17L18.002 16.981C18.064 16.994 18.129 17 18.195 17H18.4C20.552 17 22 15.306 22 12.782V12C22 6.486 17.514 2 12 2ZM12 14.599C10.566 14.599 9.4 13.433 9.4 11.999C9.4 10.565 10.566 9.399 12 9.399C13.434 9.399 14.6 10.565 14.6 11.999C14.6 13.433 13.434 14.599 12 14.599Z"}))})});function F2(e,t){let o=e.findIndex(r=>r.id===t);return o===-1?o:e.length-o-1}function L2({channelId:e,messageId:t,_isQuickEdit:o}){if(o)return;let r=E.getCurrentUser().id,i=zo.getMessages(e)._array.filter(s=>s.author.id===r);jc=F2(i,t)}function E2({message:e,_isQuickReply:t}){t||(zc=F2(zo.getMessages(e.channel_id)._array,e.id))}function O2(e){let t=e.key==="ArrowUp";!t&&e.key!=="ArrowDown"||!JD(e)||QD(e)||(e.shiftKey?tL(t):eL(t))}function U2(e,t){let o=document.getElementById("message-content-"+t);if(!o)return;let r=Math.max(document.documentElement.clientHeight,window.innerHeight),i=o.getBoundingClientRect();(i.bottom<200||i.top-r>=-200)&&XD.jumpToMessage({channelId:e,messageId:t,flash:!1,jumpType:"INSTANT"})}function $2(e,t){let o=zo.getMessages(Ie.getChannelId())._array;if(!t){let l=E.getCurrentUser().id;o=o.filter(c=>c.author.id===l)}let r=l=>e?Math.min(o.length-1,l+1):Math.max(-1,l-1),i=l=>{do l=r(l);while(l!==-1&&o[o.length-l-1]?.deleted===!0);return l},s;return t?zc=s=i(zc):jc=s=i(jc),s===-1?void 0:o[o.length-s-1]}function VD(e){let{enabled:t,userList:o,shouldPingListed:r}=G.plugins.NoReplyMention,i=!t||r===o.includes(e.author.id);switch(B2.store.shouldMention){case 2:return i;case 0:return!1;default:return!0}}function eL(e){let t=ee.getChannel(Ie.getChannelId());if(t.guild_id&&!_e.can(me.SEND_MESSAGES,t))return;let o=$2(e,!0);if(!o)return void B.dispatch({type:"DELETE_PENDING_REPLY",channelId:Ie.getChannelId()});let r=ee.getChannel(o.channel_id),i=E.getCurrentUser().id;B.dispatch({type:"CREATE_PENDING_REPLY",channel:r,message:o,shouldMention:VD(o),showMentionToggle:r.guild_id!==null&&o.author.id!==i,_isQuickReply:!0}),U2(r.id,o.id)}function tL(e){let t=ee.getChannel(Ie.getChannelId());if(t.guild_id&&!_e.can(me.SEND_MESSAGES,t))return;let o=$2(e,!1);if(!o)return B.dispatch({type:"MESSAGE_END_EDIT",channelId:Ie.getChannelId()});B.dispatch({type:"MESSAGE_START_EDIT",channelId:o.channel_id,messageId:o.id,content:o.content,_isQuickEdit:!0}),U2(o.channel_id,o.id)}var XD,_2,zc,jc,B2,Kg,N2,D2,JD,QD,G2=g(()=>{"use strict";a();$();P();I();H();T();XD=x("jumpToMessage"),_2=navigator.platform.includes("Mac"),zc=-1,jc=-1,B2=N({shouldMention:{type:4,description:"Ping reply by default",options:[{label:"Follow NoReplyMention",value:2,default:!0},{label:"Enabled",value:1},{label:"Disabled",value:0}]}}),Kg=y({name:"QuickReply",authors:[m.fawn,m.Ven,m.pylix],description:"Reply to (ctrl + up/down) and edit (ctrl + shift + up/down) messages via keybinds",settings:B2,start(){B.subscribe("DELETE_PENDING_REPLY",N2),B.subscribe("MESSAGE_END_EDIT",D2),B.subscribe("MESSAGE_START_EDIT",L2),B.subscribe("CREATE_PENDING_REPLY",E2),document.addEventListener("keydown",O2)},stop(){B.unsubscribe("DELETE_PENDING_REPLY",N2),B.unsubscribe("MESSAGE_END_EDIT",D2),B.unsubscribe("MESSAGE_START_EDIT",L2),B.unsubscribe("CREATE_PENDING_REPLY",E2),document.removeEventListener("keydown",O2)}}),N2=()=>zc=-1,D2=()=>jc=-1;JD=e=>_2?e.metaKey:e.ctrlKey,QD=e=>e.altKey||!_2&&e.metaKey});var Yg,Zg,H2=g(()=>{"use strict";a();P();I();T();Zg=y({name:"ReactErrorDecoder",description:'Replaces "Minifed React Error" with the actual error.',authors:[m.Cyn,m.maisymoe],patches:[{find:'"https://reactjs.org/docs/error-decoder.html?invariant="',replacement:{match:/(function .\(.\)){(for\(var .="https:\/\/reactjs\.org\/docs\/error-decoder\.html\?invariant="\+.,.=1;.`${t}{var decoded=$self.decodeError.apply(null, arguments);if(decoded)return decoded;${o}}`}}],async start(){let e=`https://raw.githubusercontent.com/facebook/react/v${U.version}/scripts/error-codes/codes.json`;Yg=await fetch(e).then(t=>t.json()).catch(t=>console.error(`[ReactErrorDecoder] Failed to fetch React error codes -`,t))},stop(){Yg=void 0},decodeError(e,...t){let o=0;return Yg?.[e]?.replace(/%s/g,()=>{let r=t[o];return o++,r})}})});var Jg={};qe(Jg,{ServerListRenderPosition:()=>Wc,addServerListElement:()=>Ca,removeServerListElement:()=>Ra,renderAll:()=>iL});function Xg(e){return e===0?nL:rL}function Ca(e,t){Xg(e).add(t)}function Ra(e,t){Xg(e).delete(t)}var oL,Wc,nL,rL,iL,qc=g(()=>{"use strict";a();Ke();oL=new oe("ServerListAPI"),Wc=(o=>(o[o.Above=0]="Above",o[o.In=1]="In",o))(Wc||{}),nL=new Set,rL=new Set;iL=e=>{let t=[];for(let o of Xg(e))try{t.unshift(o())}catch(r){oL.error("Failed to render server list element:",r)}return t}});function sL(){let e=[];Object.values(ae.getGuilds()).forEach(t=>{wn.getChannels(t.id).SELECTABLE.concat(wn.getChannels(t.id).VOCAL).forEach(o=>{!_r.hasUnread(o.channel.id)||e.push({channelId:o.channel.id,messageId:_r.lastMessageId(o.channel.id),readStateType:0})})}),B.dispatch({type:"BULK_ACK",context:"APP",channels:e})}var aL,Qg,z2=g(()=>{"use strict";a();qc();P();I();T();aL=()=>n(k,{onClick:sL,size:k.Sizes.MIN,color:k.Colors.BRAND,style:{marginTop:"2px",marginBottom:"8px",marginLeft:"9px"}},"Read all"),Qg=y({name:"ReadAllNotificationsButton",description:"Read all server notifications with a single button click!",authors:[m.kemo],dependencies:["ServerListAPI"],renderReadAllButton:()=>n(aL,null),start(){Ca(0,this.renderReadAllButton)},stop(){Ra(0,this.renderReadAllButton)}})});var mo,Kc=g(()=>{"use strict";a();$();I();mo=N({notices:{type:3,description:"Also show a notice at the top of your screen when removed (use this if you don't want to miss any notifications).",default:!1},offlineRemovals:{type:3,description:"Notify you when starting discord if you were removed while offline.",default:!0},friends:{type:3,description:"Notify when a friend removes you",default:!0},friendRequestCancels:{type:3,description:"Notify when a friend request is cancelled",default:!0},servers:{type:3,description:"Notify when removed from a server",default:!0},groups:{type:3,description:"Notify when removed from a group chat",default:!0}})});var Vg=g(()=>{"use strict";a()});async function uL(){yt.delMany(["relationship-notifier-guilds","relationship-notifier-groups","relationship-notifier-friends"])}async function eh(){await uL();let[e,t,o]=await yt.getMany([j2(),W2(),q2()]);if(await Promise.all([Zc(),Xc(),ka()]),mo.store.offlineRemovals){if(mo.store.groups&&t?.size)for(let[r,i]of t)ns.has(r)||Un(`You are no longer in the group ${i.name}.`,i.iconURL);if(mo.store.servers&&e?.size)for(let[r,i]of e)os.has(r)||Un(`You are no longer in the server ${i.name}.`,i.iconURL);if(mo.store.friends&&o?.friends.length)for(let r of o.friends){if(ui.friends.includes(r))continue;let i=await Bt.getUser(r).catch(()=>{});i&&Un(`You are no longer friends with ${Nn(i)}.`,i.getAvatarURL(void 0,void 0,!1),()=>bo(i.id))}if(mo.store.friendRequestCancels&&o?.requests?.length)for(let r of o.requests){if(ui.requests.includes(r)||[1,2,4].includes(it.getRelationshipType(r)))continue;let i=await Bt.getUser(r).catch(()=>{});i&&Un(`Friend request from ${Nn(i)} has been revoked.`,i.getAvatarURL(void 0,void 0,!1),()=>bo(i.id))}}}function Un(e,t,o){mo.store.notices&&Yc.showNotice(e,"OK",()=>Yc.popNotice()),Fe({title:"Relationship Notifier",body:e,icon:t,onClick:o})}function K2(e){return os.get(e)}function th(e){os.delete(e),Zc()}async function Zc(){os.clear();let e=E.getCurrentUser().id;for(let[t,{name:o,icon:r}]of Object.entries(ae.getGuilds()))Ge.isMember(t,e)&&os.set(t,{id:t,name:o,iconURL:r&&`https://cdn.discordapp.com/icons/${t}/${r}.png`});await yt.set(j2(),os)}function Y2(e){return ns.get(e)}function oh(e){ns.delete(e),Xc()}async function Xc(){ns.clear();for(let{type:e,id:t,name:o,rawRecipients:r,icon:i}of ee.getSortedPrivateChannels())e===3&&ns.set(t,{id:t,name:o||r.map(s=>s.username).join(", "),iconURL:i&&`https://cdn.discordapp.com/channel-icons/${t}/${i}.png`});await yt.set(W2(),ns)}async function ka(){ui.friends=[],ui.requests=[];let e=it.getRelationships();for(let t in e)switch(e[t]){case 1:ui.friends.push(t);break;case 3:ui.requests.push(t);break}await yt.set(q2(),ui)}var os,ns,ui,j2,W2,q2,nh=g(()=>{"use strict";a();ei();er();mt();T();Kc();Vg();os=new Map,ns=new Map,ui={friends:[],requests:[]},j2=()=>`relationship-notifier-guilds-${E.getCurrentUser().id}`,W2=()=>`relationship-notifier-groups-${E.getCurrentUser().id}`,q2=()=>`relationship-notifier-friends-${E.getCurrentUser().id}`});async function Q2({relationship:{type:e,id:t}}){if(rh===t){rh=void 0;return}let o=await Bt.getUser(t).catch(()=>null);if(!!o)switch(e){case 1:mo.store.friends&&Un(`${Nn(o)} removed you as a friend.`,o.getAvatarURL(void 0,void 0,!1),()=>bo(o.id));break;case 3:mo.store.friendRequestCancels&&Un(`A friend request from ${Nn(o)} has been removed.`,o.getAvatarURL(void 0,void 0,!1),()=>bo(o.id));break}}function V2({guild:{id:e,unavailable:t}}){if(!mo.store.servers||t)return;if(ih===e){th(e),ih=void 0;return}let o=K2(e);o&&(th(e),Un(`You were removed from the server ${o.name}.`,o.iconURL))}function ex({channel:{id:e,type:t}}){if(!mo.store.groups||t!==3)return;if(sh===e){oh(e),sh=void 0;return}let o=Y2(e);o&&(oh(e),Un(`You were removed from the group ${o.name}.`,o.iconURL))}var rh,ih,sh,Z2,X2,J2,tx=g(()=>{"use strict";a();mt();T();Kc();Vg();nh();Z2=e=>rh=e,X2=e=>ih=e,J2=e=>sh=e});var ah,ox=g(()=>{"use strict";a();P();I();tx();Kc();nh();ah=y({name:"RelationshipNotifier",description:"Notifies you when a friend, group chat, or server removes you.",authors:[m.nick],settings:mo,patches:[{find:"removeRelationship:(",replacement:{match:/(removeRelationship:\((\i),\i,\i\)=>)/,replace:"$1($self.removeFriend($2),0)||"}},{find:"async leaveGuild(",replacement:{match:/(leaveGuild\((\i)\){)/,replace:"$1$self.removeGuild($2);"}},{find:"},closePrivateChannel(",replacement:{match:/(closePrivateChannel\((\i)\){)/,replace:"$1$self.removeGroup($2);"}}],flux:{GUILD_CREATE:Zc,GUILD_DELETE:V2,CHANNEL_CREATE:Xc,CHANNEL_DELETE:ex,RELATIONSHIP_ADD:ka,RELATIONSHIP_UPDATE:ka,RELATIONSHIP_REMOVE(e){Q2(e),ka()},CONNECTION_OPEN:eh},async start(){setTimeout(()=>{eh()},5e3)},removeFriend:Z2,removeGroup:J2,removeGuild:X2})});function nx(){let{forceServerHome:e}=lh.use(["forceServerHome"]);return e}var lh,ch,rx=g(()=>{"use strict";a();Eo();$();P();I();T();lh=N({forceServerHome:{type:3,description:"Force the Server Guide to be the Server Home tab when it is enabled.",default:!1}});ch=y({name:"ResurrectHome",description:"Re-enables the Server Home tab when there isn't a Server Guide. Also has an option to force the Server Home over the Server Guide, which is accessible through right-clicking the Server Guide.",authors:[m.Dolfies,m.Nuckyz],settings:lh,patches:[{find:"GuildFeatures.GUILD_HOME_DEPRECATION_OVERRIDE",all:!0,replacement:[{match:/\i\.hasFeature\(\i\.GuildFeatures\.GUILD_HOME_DEPRECATION_OVERRIDE\)/g,replace:"true"}]},{find:"GuildHomeFeedbackExperiment.definition.id",replacement:[{match:/return{showFeedback:\i,setOnDismissedFeedback:(\i)}/,replace:"return{showFeedback:false,setOnDismissedFeedback:$1}"}]},{find:'"MessageActionCreators"',replacement:{match:/(?<=focusMessage\(\i\){.+?)(?=focus:{messageId:(\i)})/,replace:"before:$1,"}},{find:"61eef9_2",replacement:{match:/(?<=getMutableGuildChannelsForGuild\(\i\)\);)(?=if\(null==\i\|\|)/,replace:"if($self.useForceServerHome())return false;"}}],useForceServerHome:nx,contextMenus:{"guild-context"(e,t){let o=nx();if(!t?.guild)return;ut("hide-muted-channels",e)?.unshift(n(L.MenuCheckboxItem,{key:"force-server-home",id:"force-server-home",label:"Force Server Home",checked:o,action:()=>lh.store.forceServerHome=!o}))}}})});var pL,dL,uh,ix=g(()=>{"use strict";a();P();I();H();pL=x("spoilerContent"),dL=x("messagesWrapper","messages"),uh=y({name:"RevealAllSpoilers",description:"Reveal all spoilers in a message by Ctrl-clicking a spoiler, or in the chat with Ctrl+Shift-click",authors:[m.whqwert],patches:[{find:".removeObscurity=",replacement:{match:/(?<=\.removeObscurity=(\i)=>{)/,replace:(e,t)=>`$self.reveal(${t});`}}],reveal(e){let{ctrlKey:t,shiftKey:o,target:r}=e;if(!t)return;let{spoilerContent:i,hidden:s}=pL,{messagesWrapper:l}=dL,c=o?document.querySelector(`div.${l}`):r.parentElement;for(let u of c.querySelectorAll(`span.${i}.${s}`))u.click()}})});function sx(e,t){open(t+encodeURIComponent(e),"_blank")}function ax(e){return n(L.MenuItem,{label:"Search Image",key:"search-image",id:"search-image"},Object.keys(Jc).map((t,o)=>{let r="search-image-"+t;return n(L.MenuItem,{key:r,id:r,label:n(fe,{style:{alignItems:"center",gap:"0.5em"}},n("img",{style:{borderRadius:o>=3?"50%":void 0},"aria-hidden":"true",height:16,width:16,src:new URL("/favicon.ico",Jc[t]).toString().replace("lens.","")}),t),action:()=>sx(e,Jc[t])})}),n(L.MenuItem,{key:"search-image-all",id:"search-image-all",label:n(fe,{style:{alignItems:"center",gap:"0.5em"}},n(Xr,{height:16,width:16}),"All"),action:()=>Object.values(Jc).forEach(t=>sx(e,t))}))}var Jc,mL,fL,ph,lx=g(()=>{"use strict";a();Eo();Ut();It();P();I();T();Jc={Google:"https://lens.google.com/uploadbyurl?url=",Yandex:"https://yandex.com/images/search?rpt=imageview&url=",SauceNAO:"https://saucenao.com/search.php?url=",IQDB:"https://iqdb.org/?url=",TinEye:"https://www.tineye.com/search?url=",ImgOps:"https://imgops.com/start?url="};mL=(e,t)=>{if(t?.reverseImageSearchType!=="img")return;let o=t.itemHref??t.itemSrc;ut("copy-link",e)?.push(ax(o))},fL=(e,t)=>{if(!t?.src)return;(ut("copy-native-link",e)??e).push(ax(t.src))},ph=y({name:"ReverseImageSearch",description:"Adds ImageSearch to image context menus",authors:[m.Ven,m.Nuckyz],tags:["ImageUtilities"],patches:[{find:".Messages.MESSAGE_ACTIONS_MENU_LABEL",replacement:{match:/favoriteableType:\i,(?<=(\i)\.getAttribute\("data-type"\).+?)/,replace:(e,t)=>`${e}reverseImageSearchType:${t}.getAttribute("data-role"),`}}],contextMenus:{message:mL,"image-context":fL}})});var cx=g(()=>{});async function dh(){ft=await px()??{}}async function px(){return(await yt.get(ux))?.[E.getCurrentUser()?.id]}async function $n(){return(await px())?.token}async function rs(e){return yt.update(ux,t=>(t??={},ft=t[E.getCurrentUser().id]??={},e.token&&(ft.token=e.token),e.user&&(ft.user=e.user),t))}function is(e){de(t=>n(gL,{...t,scopes:["identify"],responseType:"code",redirectUri:"https://manti.vendicated.dev/api/reviewdb/auth",permissions:0n,clientId:"915703782174752809",cancelCompletesFlow:!1,callback:async o=>{try{let r=new URL(o.location);r.searchParams.append("clientMod","vencord");let i=await fetch(r,{headers:{Accept:"application/json"}});if(!i.ok){let{message:l}=await i.json();Mt(l||"An error occured while authorizing",X.Type.FAILURE);return}let{token:s}=await i.json();rs({token:s}),Mt("Successfully logged in!",X.Type.SUCCESS),e?.()}catch(r){new oe("ReviewDB").error("Failed to authorize",r)}}}))}var ux,gL,ft,Gn=g(()=>{"use strict";a();ei();Ke();Ze();H();T();ux="rdb-auth",{OAuth2AuthorizeModal:gL}=x("OAuth2AuthorizeModal"),ft={}});var Na=g(()=>{"use strict";a()});function dx(e,t){let o=E.getCurrentUser().id;return o===e||t.sender.discordID===o||ft.user?.type===1}function mx(e,t){let o=E.getCurrentUser().id;return e===o&&t.sender.discordID!==o}function fx(e){return e.sender.discordID!==E.getCurrentUser().id}function qt(e,t=X.Type.MESSAGE){X.show({id:X.genId(),message:e,type:t,options:{position:X.Position.BOTTOM}})}var vt,Hn=g(()=>{"use strict";a();Qe();T();Gn();Na();vt=ve("vc-rdb-")});function hL(e){return n(ne,{text:"Unblock user"},t=>n("div",{...t,role:"button",onClick:e.onClick,className:vt("block-modal-unblock")},n("svg",{height:"20",viewBox:"0 -960 960 960",width:"20",fill:"var(--status-danger)"},n("path",{d:"M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q54 0 104-17.5t92-50.5L228-676q-33 42-50.5 92T160-480q0 134 93 227t227 93Zm252-124q33-42 50.5-92T800-480q0-134-93-227t-227-93q-54 0-104 17.5T284-732l448 448Z"}))))}function yL({user:e,isBusy:t,setIsBusy:o}){let[r,i]=W(!1);return r?null:n("div",{className:vt("block-modal-row")},n("img",{src:e.profilePhoto,alt:""}),n(S.FormText,{className:vt("block-modal-username")},e.username),n(hL,{onClick:t?void 0:async()=>{o(!0);try{await Vc(e.discordID),i(!0)}finally{o(!1)}}}))}function vL(){let[e,t]=W(!1),[o,r,i]=st(gx,{onError:s=>new oe("ReviewDB").error("Failed to fetch blocks",s),fallbackValue:[]});return i?null:r?n(S.FormText,null,"Failed to fetch blocks: $",String(r)):o.length?n(f,null,o.map(s=>n(yL,{key:s.discordID,user:s,isBusy:e,setIsBusy:t}))):n(S.FormText,null,"No blocked users.")}function Qc(){de(e=>n(ye,{...e},n(Le,{className:vt("block-modal-header")},n(S.FormTitle,{style:{margin:0}},"Blocked Users"),n(pt,{onClick:e.onClose})),n(ke,{className:vt("block-modal")},ft.token?n(vL,null):n(S.FormText,null,"You are not logged into ReviewDB!"))))}var mh=g(()=>{"use strict";a();Ke();Ze();lt();T();Gn();ss();Hn()});var rn,Da=g(()=>{"use strict";a();$();I();T();Gn();mh();Hn();rn=N({authorize:{type:6,description:"Authorize with ReviewDB",component:()=>n(k,{onClick:()=>is()},"Authorize with ReviewDB")},notifyReviews:{type:3,description:"Notify about new reviews on startup",default:!0},showWarning:{type:3,description:"Display warning to be respectful at the top of the reviews list",default:!0},hideTimestamps:{type:3,description:"Hide timestamps on reviews",default:!1},hideBlockedUsers:{type:3,description:"Hide reviews from blocked users",default:!0},buttons:{type:6,description:"ReviewDB buttons",component:()=>n("div",{className:vt("button-grid")},n(k,{onClick:Qc},"Manage Blocked Users"),n(k,{color:k.Colors.GREEN,onClick:()=>{VencordNative.native.openExternal("https://github.com/sponsors/mantikafasi")}},"Support ReviewDB development"),n(k,{onClick:async()=>{let e="https://reviewdb.mantikafasi.dev/",t=await $n();t&&(e+="/api/redirect?token="+encodeURIComponent(t)),VencordNative.native.openExternal(e)}},"ReviewDB website"),n(k,{onClick:()=>{VencordNative.native.openExternal("https://discord.gg/eWPBSbvznt")}},"ReviewDB Support Server"))}}).withPrivateSettings()});async function pi(e,t={}){return fetch(hx+e,{...t,headers:{...t.headers,Authorization:await $n()||""}})}async function yx(e,t=0){let o=0;rn.store.showWarning||(o|=bL);let r=new URLSearchParams({flags:String(o),offset:String(t)}),i=await fetch(`${hx}/users/${e}/reviews?${r}`),s=i.ok?await i.json():{message:i.status===429?"You are sending requests too fast. Wait a few seconds and try again.":"An Error occured while fetching reviews. Please try again later.",reviews:[],updated:!1,hasNextPage:!1,reviewCount:0};return i.ok?s:(qt(s.message,X.Type.FAILURE),{...s,reviews:[{id:0,comment:s.message,star:0,timestamp:0,type:3,sender:{id:0,username:"ReviewDB",profilePhoto:"https://cdn.discordapp.com/avatars/1134864775000629298/3f87ad315b32ee464d84f1270c8d1b37.png?size=256&format=webp&quality=lossless",discordID:"1134864775000629298",badges:[]}}]})}async function vx(e){return await $n()?await pi(`/users/${e.userid}/reviews`,{method:"PUT",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}).then(async o=>{let r=await o.json();return qt(r.message),o.ok?r:null}):(qt("Please authorize to add a review."),is(),null)}async function Sx(e){return await pi(`/users/${e}/reviews`,{method:"DELETE",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({reviewid:e})}).then(async t=>{let o=await t.json();return qt(o.message),t.ok?o:null})}async function bx(e){let t=await pi("/reports",{method:"PUT",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({reviewid:e})}).then(o=>o.json());qt(t.message)}async function Tx(e,t){if(!(await pi("/blocks",{method:"PATCH",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({action:e,discordId:t})})).ok)qt(`Failed to ${e} user`,X.Type.FAILURE);else if(qt(`Successfully ${e}ed user`,X.Type.SUCCESS),ft?.user?.blockedUsers){let r=e==="block"?[...ft.user.blockedUsers,t]:ft.user.blockedUsers.filter(i=>i!==t);rs({user:{...ft.user,blockedUsers:r}})}}async function gx(){let e=await pi("/blocks",{method:"GET",headers:{Accept:"application/json"}});if(!e.ok)throw new Error(`${e.status}: ${e.statusText}`);return e.json()}function xx(e){return pi("/users",{method:"POST"}).then(t=>t.json())}async function Mx(e){return pi(`/notifications?id=${e}`,{method:"PATCH"})}var hx,eu,bL,wx,Vc,ss=g(()=>{"use strict";a();T();Gn();Na();Da();Hn();hx="https://manti.vendicated.dev/api/reviewdb",eu=50,bL=2;wx=e=>Tx("block",e),Vc=e=>Tx("unblock",e)});function Ix({onClick:e}){return n(ne,{text:"Delete Review"},t=>n("div",{...t,className:Q(tu.button,tu.dangerous),onClick:e,role:"button"},n(Oi,{width:"20",height:"20"})))}function Px({onClick:e}){return n(ne,{text:"Report Review"},t=>n("div",{...t,className:tu.button,onClick:e,role:"button"},n("svg",{width:"20",height:"20",viewBox:"0 0 24 24"},n("path",{fill:"currentColor",d:"M20,6.002H14V3.002C14,2.45 13.553,2.002 13,2.002H4C3.447,2.002 3,2.45 3,3.002V22.002H5V14.002H10.586L8.293,16.295C8.007,16.581 7.922,17.011 8.076,17.385C8.23,17.759 8.596,18.002 9,18.002H20C20.553,18.002 21,17.554 21,17.002V7.002C21,6.45 20.553,6.002 20,6.002Z"}))))}function Ax({onClick:e,isBlocked:t}){return n(ne,{text:`${t?"Unblock":"Block"} user`},o=>n("div",{...o,className:tu.button,onClick:e,role:"button"},n("svg",{height:"20",viewBox:"0 -960 960 960",width:"20",fill:"currentColor"},t?n("path",{d:"M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"}):n("path",{d:"M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q54 0 104-17.5t92-50.5L228-676q-33 42-50.5 92T160-480q0 134 93 227t227 93Zm252-124q33-42 50.5-92T800-480q0-134-93-227t-227-93q-54 0-104 17.5T284-732l448 448Z"}))))}var tu,Cx=g(()=>{"use strict";a();It();we();H();T();tu=x("button","wrapper","disabled","separator")});function ou(e){let t=e.redirectURL?Vn:o=>n("span",{...o,role:"button"},o.children);return n(ne,{text:e.name},({onMouseEnter:o,onMouseLeave:r})=>n(t,{className:vt("blocked-badge"),href:e.redirectURL,onClick:e.onClick},n("img",{className:vt("badge"),width:"22px",height:"22px",onMouseEnter:o,onMouseLeave:r,src:e.icon,alt:e.description})))}var Rx=g(()=>{"use strict";a();T();Hn()});var nu,fh=g(()=>{"use strict";a();mt();we();lt();H();T();Gn();Na();ss();Da();Hn();mh();Cx();Rx();nu=bt(()=>{let e=Ce.byProps,[{cozyMessage:t,buttons:o,message:r,buttonsInner:i,groupStart:s},{container:l,isHeader:c},{avatar:u,clickable:p,username:d,wrapper:h,cozy:v},b,M]=Dr(e("cozyMessage"),e("container","isHeader"),e("avatar","zalgo"),e("button","wrapper","selected"),e("botTag","botTagRegular")),w=new Intl.DateTimeFormat;return function({review:R,refetch:A,profileId:F}){let[z,Y]=W(!1);function J(){bo(R.sender.discordID)}function Z(){et.show({title:"Are you sure?",body:"Do you really want to delete this review?",confirmText:"Delete",cancelText:"Nevermind",onConfirm:async()=>{if(await $n())Sx(R.id).then(Se=>{Se&&A()});else return qt("You must be logged in to delete reviews.")}})}function O(){et.show({title:"Are you sure?",body:"Do you really you want to report this review?",confirmText:"Report",cancelText:"Nevermind",onConfirm:async()=>{if(await $n())bx(R.id);else return qt("You must be logged in to report reviews.")}})}let te=ft?.user?.blockedUsers?.includes(R.sender.discordID)??!1;function re(){if(te)return Vc(R.sender.discordID);et.show({title:"Are you sure?",body:"Do you really you want to block this user? They will be unable to leave further reviews on your profile. You can unblock users in the plugin settings.",confirmText:"Block",cancelText:"Nevermind",onConfirm:async()=>{if(await $n())wx(R.sender.discordID);else return qt("You must be logged in to block users.")}})}return n("div",{className:Q(vt("review"),t,h,r,s,v),style:{marginLeft:"0px",paddingLeft:"52px"}},n("img",{className:Q(u,p),onClick:J,src:R.sender.profilePhoto||"/assets/1f0bfc0865d324c2587920a7d80c609b.png?size=128",style:{left:"0px",zIndex:0}}),n("div",{style:{display:"inline-flex",justifyContent:"center",alignItems:"center"}},n("span",{className:Q(p,d),style:{color:"var(--channels-default)",fontSize:"14px"},onClick:()=>J()},R.sender.username),R.type===3&&n("span",{className:Q(M.botTagVerified,M.botTagRegular,M.botTag,M.px,M.rem),style:{marginLeft:"4px"}},n("span",{className:M.botText},"System"))),te&&n(ou,{name:"You have blocked this user",description:"You have blocked this user",icon:"/assets/aaee57e0090991557b66.svg",type:0,onClick:()=>Qc()}),R.sender.badges.map(Se=>n(ou,{...Se})),!rn.store.hideTimestamps&&R.type!==3&&n(Po,{timestamp:new Date(R.timestamp*1e3)},w.format(R.timestamp*1e3)),n("div",{className:vt("review-comment")},R.comment.length>200&&!z?[Pe.parseGuildEventDescription(R.comment.substring(0,200)),"...",n("br",null),n("a",{onClick:()=>Y(!0)},"Read more")]:Pe.parseGuildEventDescription(R.comment)),R.id!==0&&n("div",{className:Q(l,c,o),style:{padding:"0px"}},n("div",{className:Q(b.wrapper,i)},fx(R)&&n(Px,{onClick:O}),mx(F,R)&&n(Ax,{isBlocked:te,onClick:re}),dx(F,R)&&n(Ix,{onClick:Z}))))}})});function La({discordId:e,name:t,onFetchReviews:o,refetchSignal:r,scrollToTop:i,page:s=1,showInput:l=!1,hideOwnReview:c=!1}){let[u,p]=Co(!0),[d]=st(()=>yx(e,(s-1)*eu),{fallbackValue:null,deps:[r,u,s],onSuccess:h=>{rn.store.hideBlockedUsers&&(h.reviews=h.reviews?.filter(v=>!it.isBlocked(v.sender.discordID))),i?.(),o(h)}});return d?n(f,null,n(IL,{refetch:p,reviews:d.reviews,hideOwnReview:c,profileId:e}),l&&n(gh,{name:t,discordId:e,refetch:p,isAuthor:d.reviews?.some(h=>h.sender.discordID===E.getCurrentUser().id)})):null}function IL({refetch:e,reviews:t,hideOwnReview:o,profileId:r}){let i=E.getCurrentUser().id;return n("div",{className:vt("view")},t?.map(s=>(s.sender.discordID!==i||!o)&&n(nu,{key:s.id,review:s,refetch:e,profileId:r})),t?.length===0&&n(S.FormText,{className:vt("placeholder")},"Looks like nobody reviewed this user yet. You could be the first!"))}function gh({discordId:e,isAuthor:t,refetch:o,name:r}){let{token:i}=ft,s=xt(null),l=wL.FORM;l.disableAutoFocus=!0;let c=ML({id:"0",type:1});return n(f,null,n("div",{onClick:()=>{i||(qt("Opening authorization window..."),is())}},n(xL,{className:vt("input"),channel:c,placeholder:i?t?`Update review for @${r}`:`Review @${r}`:"You need to authorize to review users!",type:l,disableThemedBackground:!0,setEditorRef:u=>s.current=u,textValue:"",onSubmit:async u=>{if(await vx({userid:e,comment:u.value})){o();let d=s.current.ref.current.getSlateEditor();TL.delete(d,{at:{anchor:kx.start(d,[]),focus:kx.end(d,[])}})}return{shouldClear:!1,shouldRefocus:!0}}})))}var kx,TL,wL,xL,ML,hh=g(()=>{"use strict";a();lt();H();T();Gn();ss();Da();Hn();fh();({Editor:kx,Transforms:TL}=x("Editor","Transforms")),{ChatInputTypes:wL}=x("ChatInputTypes"),xL=Ne("default.CHANNEL_TEXT_AREA","input"),{createChannelRecordFromServer:ML}=x("createChannelRecordFromServer")});function PL({modalProps:e,discordId:t,name:o}){let[r,i]=W(),[s,l]=Co(!0),[c,u]=W(1),p=xt(null),d=r?.reviewCount,h=r?.reviews.find(v=>v.sender.discordID===ft.user?.discordID);return n(_,null,n(ye,{...e,size:"medium"},n(Le,null,n(V,{variant:"heading-lg/semibold",className:vt("modal-header")},o,"'s Reviews",!!d&&n("span",null," (",d," Reviews)")),n(pt,{onClick:e.onClose})),n(ke,{scrollerRef:p},n("div",{className:vt("modal-reviews")},n(La,{discordId:t,name:o,page:c,refetchSignal:s,onFetchReviews:i,scrollToTop:()=>p.current?.scrollTo({top:0,behavior:"smooth"}),hideOwnReview:!0}))),n(ct,{className:vt("modal-footer")},n("div",null,h&&n(nu,{refetch:l,review:h,profileId:t}),n(gh,{isAuthor:h!=null,discordId:t,name:o,refetch:l}),!!d&&n(al,{currentPage:c,maxVisiblePages:5,pageSize:eu,totalCount:d,onPageChange:u})))))}function yh(e,t){de(o=>n(PL,{modalProps:o,discordId:e,name:t}))}var Nx=g(()=>{"use strict";a();le();Ze();lt();T();Gn();ss();Hn();fh();hh()});var AL,vh,Dx=g(()=>{"use strict";a();cx();le();mg();It();P();Ke();I();T();Gn();Nx();hh();Na();ss();Da();Hn();AL=(e,t)=>{e.push(n(L.MenuItem,{label:"View Reviews",id:"vc-rdb-server-reviews",icon:Xr,action:()=>yh(t.guild.id,t.guild.name)}))},vh=y({name:"ReviewDB",description:"Review other users (Adds a new settings to profiles)",authors:[m.mantikafasi,m.Ven],settings:rn,contextMenus:{"guild-header-popout":AL},patches:[{find:"showBorder:null",replacement:{match:/user:(\i),setNote:\i,canDM.+?\}\)/,replace:"$&,$self.getReviewsComponent($1)"}}],flux:{CONNECTION_OPEN:dh},async start(){let e=rn.store,{lastReviewId:t,notifyReviews:o}=e,r=e;r.token&&(await rs({token:r.token}),r.token=void 0,new oe("ReviewDB").info("Migrated legacy settings")),await dh(),setTimeout(async()=>{if(!ft.token)return;let i=await xx(ft.token);if(rs({user:i}),o&&t&&tVencordNative.native.openExternal("https://reviewdb.mantikafasi.dev/api/redirect?"+new URLSearchParams({token:ft.token,page:"dashboard/appeal"}))}:{};et.show({title:i.notification.title,body:Pe.parse(i.notification.content,!1),...s}),Mx(i.notification.id)}},4e3)},getReviewsComponent:_.wrap(e=>{let[t,o]=W();return n(Ma,{headerText:"User Reviews",onMoreClick:()=>yh(e.id,e.username),moreTooltipText:t&&t>50?`View all ${t} reviews`:"Open Review Modal",onDropDownClick:r=>rn.store.reviewsDropdownState=!r,defaultState:rn.store.reviewsDropdownState},n(La,{discordId:e.id,name:e.username,onFetchReviews:r=>o(r.reviewCount),showInput:!0}))},{message:"Failed to render Reviews"})})});var as,Sh,Lx=g(()=>{"use strict";a();$();le();P();I();T();as=N({chatMentions:{type:3,default:!0,description:"Show role colors in chat mentions (including in the message box)",restartNeeded:!0},memberList:{type:3,default:!0,description:"Show role colors in member list role headers",restartNeeded:!0},voiceUsers:{type:3,default:!0,description:"Show role colors in the voice chat user list",restartNeeded:!0}}),Sh=y({name:"RoleColorEverywhere",authors:[m.KingFish,m.lewisakura,m.AutumnVN],description:"Adds the top role color anywhere possible",patches:[{find:"CLYDE_AI_MENTION_COLOR:null,",replacement:[{match:/user:(\i),channel:(\i).{0,400}?"@"\.concat\(.+?\)/,replace:"$&,color:$self.getUserColor($1?.id,{channelId:$2?.id})"}],predicate:()=>as.store.chatMentions},{find:".userTooltip,children",replacement:[{match:/let\{id:(\i),guildId:(\i)[^}]*\}.*?\.default,{(?=children)/,replace:"$&color:$self.getUserColor($1,{guildId:$2}),"}],predicate:()=>as.store.chatMentions},{find:'tutorialId:"whos-online',replacement:[{match:/null,\i," — ",\i\]/,replace:"null,$self.roleGroupColor(arguments[0])]"}],predicate:()=>as.store.memberList},{find:".Messages.THREAD_BROWSER_PRIVATE",replacement:[{match:/children:\[\i," — ",\i\]/,replace:"children:[$self.roleGroupColor(arguments[0])]"}],predicate:()=>as.store.memberList},{find:"renderPrioritySpeaker",replacement:[{match:/renderName\(\).{0,100}speaking:.{50,100}jsx.{5,10}{/,replace:"$&...$self.getVoiceProps(this.props),"}],predicate:()=>as.store.voiceUsers}],settings:as,getColor(e,{channelId:t,guildId:o}){return(o??=ee.getChannel(t)?.guild_id)?Ge.getMember(o,e)?.colorString??null:null},getUserColor(e,t){let o=this.getColor(e,t);return o&&parseInt(o.slice(1),16)},roleGroupColor:_.wrap(({id:e,count:t,title:o,guildId:r,label:i})=>{let s=ae.getRole(r,e);return n("span",{style:{color:s?.colorString,fontWeight:"unset",letterSpacing:".05em"}},o??i," \u2014 ",t)},{noop:!0}),getVoiceProps({user:{id:e},guildId:t}){return{style:{color:this.getColor(e,{guildId:t})}}}})});var Ex,CL,bh,Ox=g(()=>{"use strict";a();Eo();It();P();I();H();T();Ex=x("replyToMessage"),CL=(e,{message:t})=>{if(Ie.getChannelId()!==t.channel_id)return;let o=ee.getChannel(t?.channel_id);if(!o||o.guild_id&&!_e.can(me.SEND_MESSAGES,o))return;let r=ut("pin",e);if(r&&!r.some(s=>s?.props?.id==="reply")){let s=r.findIndex(l=>l?.props.id==="pin");r.splice(s+1,0,n(L.MenuItem,{id:"reply",label:Ye.Messages.MESSAGE_ACTION_REPLY,icon:Gp,action:l=>Ex.replyToMessage(o,t,l)}));return}let i=ut("mark-unread",e);if(i&&!i.some(s=>s?.props?.id==="reply")){i.unshift(n(L.MenuItem,{id:"reply",label:Ye.Messages.MESSAGE_ACTION_REPLY,icon:Gp,action:s=>Ex.replyToMessage(o,t,s)}));return}},bh=y({name:"SearchReply",description:"Adds a reply button to search results",authors:[m.Aria],contextMenus:{message:CL}})});var Th,_x=g(()=>{"use strict";a();P();I();Th=y({name:"SecretRingToneEnabler",description:"Always play the secret version of the discord ringtone (except during special ringtone events)",authors:[m.AndrewDLO,m.FieryFlames],patches:[{find:'call_ringing_beat"',replacement:{match:/500===\i\.random\(1,1e3\)/,replace:"true"}}]})});var Bx=g(()=>{});function Ux(e){let t=e.slice(1,-1).replace(/(\d)(AM|PM)$/i,"$1 $2"),o=new Date(`${new Date().toDateString()} ${t}`).getTime()/1e3;return isNaN(o)?e:(Date.now()/1e3>o&&(o+=86400),``)}function kL({rootProps:e,close:t}){let[o,r]=W(),[i,s]=W(""),l=Math.round((new Date(o).getTime()||Date.now())/1e3),c=(d,h)=>``,[u,p]=Rt(()=>{let d=c(l,i);return[d,Pe.parse(d)]},[l,i]);return n(ye,{...e},n(Le,{className:ru("modal-header")},n(S.FormTitle,{tag:"h2"},"Timestamp Picker"),n(pt,{onClick:t})),n(ke,{className:ru("modal-content")},n("input",{type:"datetime-local",value:o,onChange:d=>r(d.currentTarget.value),style:{colorScheme:Fi()===2?"light":"dark"}}),n(S.FormTitle,null,"Timestamp Format"),n(Io,{options:RL.map(d=>({label:d,value:d})),isSelected:d=>d===i,select:d=>s(d),serialize:d=>d,renderOptionLabel:d=>n("div",{className:ru("format-label")},Pe.parse(c(l,d.value))),renderOptionValue:()=>p}),n(S.FormTitle,{className:j.bottom8},"Preview"),n(S.FormText,{className:ru("preview-text")},p," (",u,")")),n(ct,null,n(k,{onClick:()=>{kn(u+" "),t()}},"Insert")))}var Fx,RL,ru,NL,wh,$x=g(()=>{"use strict";a();Bx();En();gn();$();Qe();P();mt();ot();Ze();I();T();Fx=N({replaceMessageContents:{description:"Replace timestamps in message contents",type:3,default:!0}});RL=["","t","T","d","D","f","F","R"],ru=ve("vc-st-");NL=({isMainChat:e})=>e?n(xo,{tooltip:"Insert Timestamp",onClick:()=>{let t=de(o=>n(kL,{rootProps:o,close:()=>xn(t)}))},buttonProps:{"aria-haspopup":"dialog"}},n("svg",{"aria-hidden":"true",role:"img",width:"24",height:"24",viewBox:"0 0 24 24",style:{scale:"1.2"}},n("g",{fill:"none","fill-rule":"evenodd"},n("path",{fill:"currentColor",d:"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7v-5z"}),n("rect",{width:"24",height:"24"})))):null,wh=y({name:"SendTimestamps",description:"Send timestamps easily via chat box button & text shortcuts. Read the extended description!",authors:[m.Ven,m.Tyler,m.Grzesiek11],dependencies:["MessageEventsAPI","ChatInputButtonAPI"],settings:Fx,start(){wo("SendTimestamps",NL),this.listener=Vt((e,t)=>{Fx.store.replaceMessageContents&&(t.content=t.content.replace(/`\d{1,2}:\d{2} ?(?:AM|PM)?`/gi,Ux))})},stop(){nn("SendTimestamps"),eo(this.listener)},settingsAboutComponent(){let e=["12:00","3:51","17:59","24:00","12:00 AM","0:13PM"].map(t=>`\`${t}\``);return n(f,null,n(S.FormText,null,"To quickly send send time only timestamps, include timestamps formatted as `HH:MM` (including the backticks!) in your message"),n(S.FormText,null,"See below for examples. If you need anything more specific, use the Date button in the chat bar!"),n(S.FormText,null,"Examples:",n("ul",null,e.map(t=>n("li",{key:t},n("code",null,t)," ","->"," ",Pe.parse(Ux(t)))))))}})});function DL(){return zx=Co(),n("span",{id:"vc-friendcount",style:{display:"inline-block",width:"100%",fontSize:"12px",fontWeight:"600",color:"var(--header-secondary)",textTransform:"uppercase",textAlign:"center"}},Mh," online")}function LL(){return jx=Co(),n("span",{id:"vc-guildcount",style:{display:"inline-block",width:"100%",fontSize:"12px",fontWeight:"600",color:"var(--header-secondary)",textTransform:"uppercase",textAlign:"center"}},Hx," servers")}function Gx(){Mh=0;let e=it.getRelationships();for(let t of Object.keys(e))e[t]===1&&cn.getStatus(t)!=="offline"&&(Mh+=1);zx?.()}function xh(){Hx=ae.getGuildCount(),jx?.()}var Mh,Hx,zx,jx,Ih,Wx=g(()=>{"use strict";a();qc();$();le();P();lt();I();T();Mh=0,Hx=0;Ih=y({name:"ServerListIndicators",description:"Add online friend count or server count in the server list",authors:[m.dzshn],dependencies:["ServerListAPI"],options:{mode:{description:"mode",type:4,options:[{label:"Only online friend count",value:2,default:!0},{label:"Only server count",value:1},{label:"Both server and online friend counts",value:3}]}},renderIndicator:()=>{let{mode:e}=G.plugins.ServerListIndicators;return n(_,{noop:!0},n("div",{style:{marginBottom:"4px"}},!!(e&2)&&n(DL,null),!!(e&1)&&n(LL,null)))},flux:{PRESENCE_UPDATES:Gx,GUILD_CREATE:xh,GUILD_DELETE:xh},start(){Ca(0,this.renderIndicator),Gx(),xh()},stop(){Ra(0,this.renderIndicator)}})});var qx=g(()=>{});function Zx(e){de(t=>n(ye,{...t,size:"medium"},n(OL,{guild:e})))}function Yx(e){return n(Po,{timestamp:new Date(e)})}function OL({guild:e}){let[t,o]=W(),[r,i]=W();se(()=>{iu.friends=!1,iu.blocked=!1},[]);let[s,l]=W(0),c=e.banner&&Gt.getGuildBannerURL(e,!0).replace(/\?size=\d+$/,"?size=1024"),u=e.icon&&Gt.getGuildIconURL({id:e.id,icon:e.icon,canAnimate:!0,size:512});return n("div",{className:fo("root")},c&&s===0&&n("img",{className:fo("banner"),src:c,alt:"",onClick:()=>tn(c)}),n("div",{className:fo("header")},u?n("img",{src:u,alt:"",onClick:()=>tn(u)}):n("div",{"aria-hidden":!0,className:Q(Kx.childWrapper,Kx.acronym)},e.acronym),n("div",{className:fo("name-and-description")},n(S.FormTitle,{tag:"h5",className:fo("name")},e.name),e.description&&n(S.FormText,null,e.description))),n(Ho,{type:"top",look:"brand",className:fo("tab-bar"),selectedItem:s,onItemSelect:l},n(Ho.Item,{className:fo("tab",{selected:s===0}),id:0},"Server Info"),n(Ho.Item,{className:fo("tab",{selected:s===1}),id:1},"Friends",t!==void 0?` (${t})`:""),n(Ho.Item,{className:fo("tab",{selected:s===2}),id:2},"Blocked Users",r!==void 0?` (${r})`:"")),n("div",{className:fo("tab-content")},s===0&&n(BL,{guild:e}),s===1&&n(FL,{guild:e,setCount:o}),s===2&&n(UL,{guild:e,setCount:i})))}function _L(e,t){let o=Ge.getMember(e,t.id)?.avatar,r=o?Gt.getGuildMemberAvatarURLSimple({userId:t.id,avatar:o,guildId:e,canAnimate:!0}):Gt.getUserAvatarURL(t,!0);return n("div",{className:fo("owner")},n("img",{src:r,alt:"",onClick:()=>tn(r)}),Pe.parse(`<@${t.id}>`))}function BL({guild:e}){let[t]=st(()=>Bt.getUser(e.ownerId),{deps:[e.ownerId],fallbackValue:null}),o={"Server Owner":t?_L(e.id,t):"Loading...","Created At":Yx(un.extractTimestamp(e.id)),"Joined At":e.joinedAt?Yx(e.joinedAt.getTime()):"-","Vanity Link":e.vanityURLCode?n("a",null,`discord.gg/${e.vanityURLCode}`):"-","Preferred Locale":e.preferredLocale||"-","Verification Level":["None","Low","Medium","High","Highest"][e.verificationLevel]||"?","Nitro Boosts":`${e.premiumSubscriberCount??0} (Level ${e.premiumTier??0})`,Channels:wn.getChannels(e.id)?.count-1||"?",Roles:Object.keys(ae.getRoles(e.id)).length-1};return n("div",{className:fo("info")},Object.entries(o).map(([r,i])=>n("div",{className:fo("server-info-pair"),key:r},n(S.FormTitle,{tag:"h5"},r),typeof i=="string"?n("span",null,i):i)))}function FL({guild:e,setCount:t}){return Xx("friends",e,it.getFriendIDs(),t)}function UL({guild:e,setCount:t}){let o=Object.keys(it.getRelationships()).filter(r=>it.isBlocked(r));return Xx("blocked",e,o,t)}function Xx(e,t,o,r){let i=[],s=[];for(let l of o)Ge.isMember(t.id,l)?s.push(l):i.push(l);return Be([Ge],()=>Ge.getMemberIds(t.id),null,(l,c)=>l.length===c.length),se(()=>{!iu[e]&&i.length&&(iu[e]=!0,B.dispatch({type:"GUILD_MEMBERS_REQUEST",guildIds:[t.id],userIds:i}))},[]),se(()=>r(s.length),[s.length]),n(Si,{fade:!0,className:fo("scroller")},s.map(l=>n(EL,{user:E.getUser(l),status:cn.getStatus(l)||"offline",onSelect:()=>bo(l),onContextMenu:()=>{}})))}var Kx,EL,fo,iu,Jx=g(()=>{"use strict";a();qx();Qe();mt();we();Ze();lt();H();T();Kx=x("icon","acronym","childWrapper"),EL=Tn("FriendRow"),fo=ve("vc-gp-");iu={friends:!1,blocked:!1}});var Qx,Ph,Vx=g(()=>{"use strict";a();Eo();P();I();T();Jx();Qx=(e,{guild:t})=>{ut("privacy",e)?.push(n(L.MenuItem,{id:"vc-server-profile",label:"Server Info",action:()=>Zx(t)}))},Ph=y({name:"ServerProfile",description:"Allows you to view info about a server by right clicking it in the server list",authors:[m.Ven,m.Nuckyz],tags:["guild","info"],contextMenus:{"guild-context":Qx,"guild-header-popout":Qx}})});var eM=g(()=>{});var tM,oM=g(()=>{a();tM=`/* eslint-disable simple-header/header */ -import React from "react"; - -const handleClick = async () => - console.log((await import("@webpack/common")).Clipboard.copy("\\u200b")); - -export const Example: React.FC<{ - real: boolean, - shigged?: number, -}> = ({ real, shigged }) => <> -

{\`Shigg\${real ? \`ies\${shigged === 0x1B ? "t" : ""}\` : "y"}\`}

- -; -`});var rM=kr((Nae,Ah)=>{"use strict";a();var $L=Object.prototype.hasOwnProperty,no="~";function Ea(){}Object.create&&(Ea.prototype=Object.create(null),new Ea().__proto__||(no=!1));function GL(e,t,o){this.fn=e,this.context=t,this.once=o||!1}function nM(e,t,o,r,i){if(typeof o!="function")throw new TypeError("The listener must be a function");var s=new GL(o,r||e,i),l=no?no+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function su(e,t){--e._eventsCount===0?e._events=new Ea:delete e._events[t]}function Kt(){this._events=new Ea,this._eventsCount=0}Kt.prototype.eventNames=function(){var t=[],o,r;if(this._eventsCount===0)return t;for(r in o=this._events)$L.call(o,r)&&t.push(no?r.slice(1):r);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(o)):t};Kt.prototype.listeners=function(t){var o=no?no+t:t,r=this._events[o];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,l=new Array(s);i{"use strict";a();Object.defineProperty(ls,"__esModule",{value:!0});ls.Channel=ls.ChannelPort=void 0;var HL=rM(),au="vapIpc",Ch=Symbol.for("vapIpc.edgeCreate"),Rh=class{_pipes=new Map;_listeners=new Map;_createListenerMap(){return new Map}_emit(t,o,...r){for(let[i,s]of this._listeners.entries()){if(i===t)continue;let l=s.get(o);l&&l(...r)}}createPipe(t){let o=this.getPipe(t);if(o)return o;let r=this._createListenerMap();this._listeners.set(t,r);let i={emit:this._emit.bind(this,t),listen:(s,l)=>void r.set(s,l)};return this._pipes.set(t,i),i}getPipe(t){return this._pipes.get(t)??null}};ls.ChannelPort=Rh;var kh=class{id;_edges=new Map;_callbacks=new Map;_callers=new Map;_edgePipes=new Map;_pipes=[];_emitter=new HL.EventEmitter;_logger;_destroyed=!1;constructor(t){this.id=t}addPipe(t){t.listen(`${au}:handshake`,o=>{this._handleHandshake(t,o)}),t.listen(`${au}:message`,o=>{this._handleMessage(t,o)}),this._pipes.push(t),this._logger?.log(`Adding pipe to channel "${this.id}"`)}setLogger(t){this._logger=t}_handleHandshake(t,o){if(this.id===o.id)return;this._logger?.log(`\u{1F91D} "${o.id}" -> "${this.id}" (edges: [${o.channelIds.join(", ")}])`);let r=this._edges.get(o.id);if(r){let i=o.channelIds.filter(s=>!r?.channelIds.includes(s));if(i.includes(this.id)&&i.splice(i.indexOf(this.id),1),!i.length)return;this._edges.set(o.id,{...o,channelIds:[...r.channelIds,...i]})}else{let i=[...o.channelIds].filter(s=>s!==this.id);this._edges.set(o.id,{...o,channelIds:i}),this._edgePipes.set(o.id,t)}this._emitter.emit(Ch,o),this.handshakeAll()}_handleMessage(t,o){if(o.proxiedBy===this.id)return;if(o.destination!==this.id)return this._emitMessage({...o,proxiedBy:this.id});if(!o.nonce)return void this._emitter.emit(o.name,o.data);let r=this._callbacks.get(o.nonce);if(r)return void r(o.data);let i=this._callers.get(o.name);if(i){i(o.data).catch(s=>(console.error(s),new Error(s?.message??`${s}`))).then(s=>{this._emitMessage({name:o.name,source:this.id,destination:o.source,data:s,nonce:o.nonce})});return}}_emitHandshake(t){let o=this.getEdge();t.emit(`${au}:handshake`,o)}_emitMessage(t){let o=this.findEdgeId(t.destination);if(!o)return;this._edgePipes.get(o)?.emit(`${au}:message`,t)}getEdge(){let t=[...this._edges.keys(),...[...this._edges.values()].map(o=>o.channelIds).flat()].filter((o,r,i)=>i.indexOf(o)===r);return{id:this.id,channelIds:t}}findEdgeId(t){for(let o of this._edges.values())if(o.id===t||o.channelIds.includes(t))return o.id;return null}waitForEdge(t){let o=this.findEdgeId(t);return o?Promise.resolve(o):new Promise(r=>{let i=s=>{(s.id===t||s.channelIds.includes(t))&&(this._emitter.off(Ch,i),r(s.id))};this._emitter.on(Ch,i)})}createNonce(){return Math.random().toString(16).slice(2)}send(t){this._emitMessage({...t,source:this.id})}call(t,o={timeout:1e4}){let r=this.createNonce(),i=new Promise((s,l)=>{let c=setTimeout(()=>{this._callbacks.delete(r),l(new Error("Call timed out"))},o.timeout);this._callbacks.set(r,u=>{this._callbacks.delete(r),clearTimeout(c),o.signal?.aborted?o.signal.reason instanceof Error&&l(o.signal.reason):u instanceof Error?l(u):s(u)})});return this._emitMessage({...t,source:this.id,nonce:r}),i}on(t,o){return this._emitter.on(t,o),this}off(t,o){return this._emitter.off(t,o),this}once(t,o){this._emitter.once(t,o)}onCall(t,o){this._callers.set(t,async(...r)=>await o(...r))}removeCaller(){}handshakeAll(){this._pipes.forEach(t=>this._emitHandshake(t))}destroy(){this._emitter.removeAllListeners(),this._callbacks.clear(),this._callers.clear(),this._edgePipes.clear(),this._pipes=[],this._destroyed=!0}};ls.Channel=kh});var Eh=kr(cs=>{"use strict";a();Object.defineProperty(cs,"__esModule",{value:!0});cs.RemoteClient=cs.RemoteHost=void 0;var Dh=class{channel;constructor(t,o){this.channel=t;for(let[r,i]of Object.entries(o))t.onCall(r,async s=>await i(...s));t.handshakeAll()}};cs.RemoteHost=Dh;var Lh=class{hostName;channel;constructor(t,o){this.hostName=t,this.channel=o}async connect(){await this.channel.waitForEdge(this.hostName)}run(t,...o){return this.channel.call({name:t,destination:this.hostName,data:o})}};cs.RemoteClient=Lh});var aM=kr(us=>{"use strict";a();Object.defineProperty(us,"__esModule",{value:!0});us.WorkerClient=us.createWorkerHost=void 0;var iM=Nh(),sM=Eh(),zL=(e,t)=>{let o=new iM.Channel(e);return o.addPipe({emit:(r,i)=>postMessage({event:r,data:i}),listen:(r,i)=>addEventListener("message",({data:s})=>{s.event===r&&i(s.data)})}),new sM.RemoteHost(o,t)};us.createWorkerHost=zL;var Oh=class extends sM.RemoteClient{workerOpts;worker;workerListeners=[];url;constructor(t,o,r,i={}){let s=new iM.Channel(t);if(super(o,s),this.workerOpts=i,r instanceof Blob){let l=new Blob([r],{type:"text/javascript"});this.url=URL.createObjectURL(l)}else this.url=r}async init(){let t=this.worker=new Worker(this.url,this.workerOpts);this.channel.addPipe({emit:(o,r)=>t.postMessage({event:o,data:r}),listen:(o,r)=>{let i=s=>{let{event:l,data:c}=s.data;l===o&&r(c)};this.workerListeners.push(i),t.addEventListener("message",i)}}),await this.connect()}destroy(){if(this.worker){for(let t of this.workerListeners)this.worker.removeEventListener("message",t);this.worker.terminate()}this.channel.destroy(),this.url.startsWith("blob:")&&URL.revokeObjectURL(this.url)}};us.WorkerClient=Oh});var lM=kr(zn=>{"use strict";a();var jL=zn&&zn.__createBinding||(Object.create?function(e,t,o,r){r===void 0&&(r=o);var i=Object.getOwnPropertyDescriptor(t,o);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,r,i)}:function(e,t,o,r){r===void 0&&(r=o),e[r]=t[o]}),_h=zn&&zn.__exportStar||function(e,t){for(var o in e)o!=="default"&&!Object.prototype.hasOwnProperty.call(t,o)&&jL(t,e,o)};Object.defineProperty(zn,"__esModule",{value:!0});_h(Nh(),zn);_h(Eh(),zn);_h(aM(),zn)});function Fh(e){lu.id!==e.id&&(Object.assign(lu,e),Bh.forEach(t=>t(e)))}var lu,Bh,cM,Uh=g(()=>{"use strict";a();T();lu={id:null,theme:null},Bh=new Set,cM=()=>{let[,e]=U.useState(lu);return U.useEffect(()=>(Bh.add(e),()=>void Bh.delete(e)),[]),lu}});function di(e){if(Object.prototype.hasOwnProperty.call(ps,e))return ps[e];let t=Object.values(ps).find(o=>o.aliases?.includes(e));return t?(ZL.set(e,t),t):null}var WL,qL,uM,KL,YL,ps,pM,dM,ZL,cu=g(()=>{"use strict";a();WL="Vap0r1ze/vapcord",qL="88a7032a59cca40da170926651b08201ea3b965a",uM=`https://raw.githubusercontent.com/${WL}/${qL}/assets/shiki-codeblocks`,KL=e=>`${uM}/${e}`,YL=`${uM}/languages.json`,ps={},pM=async()=>{let e=await fetch(YL).then(o=>o.json()),t=Object.fromEntries(e.map(o=>[o.id,{...o,grammarUrl:KL(o.fileName)}]));Object.assign(ps,t)},dM=e=>e.grammar?Promise.resolve(e.grammar):fetch(e.grammarUrl).then(t=>t.json()),ZL=new Map});var XL,JL,tt,jn,$h=g(()=>{"use strict";a();XL="shikijs/shiki",JL="0b28ad8ccfbf2615f2d9d38ea8255416b8ac3043",tt=e=>`https://raw.githubusercontent.com/${XL}/${JL}/packages/shiki/themes/${e}.json`,jn={DarkPlus:tt("dark-plus"),MaterialCandy:"https://raw.githubusercontent.com/millsp/material-candy/master/material-candy.json",DraculaSoft:tt("dracula-soft"),Dracula:tt("dracula"),GithubDarkDimmed:tt("github-dark-dimmed"),GithubDark:tt("github-dark"),GithubLight:tt("github-light"),LightPlus:tt("light-plus"),MaterialDarker:tt("material-darker"),MaterialDefault:tt("material-default"),MaterialLighter:tt("material-lighter"),MaterialOcean:tt("material-ocean"),MaterialPalenight:tt("material-palenight"),MinDark:tt("min-dark"),MinLight:tt("min-light"),Monokai:tt("monokai"),Nord:tt("nord"),OneDarkPro:tt("one-dark-pro"),Poimandres:tt("poimandres"),RosePineDawn:tt("rose-pine-dawn"),RosePineMoon:tt("rose-pine-moon"),RosePine:tt("rose-pine"),SlackDark:tt("slack-dark"),SlackOchin:tt("slack-ochin"),SolarizedDark:tt("solarized-dark"),SolarizedLight:tt("solarized-light"),VitesseDark:tt("vitesse-dark"),VitesseLight:tt("vitesse-light"),CssVariables:tt("css-variables")}});var fM,Gh,mM,xe,Oa=g(()=>{"use strict";a();sc();fM=Ka(lM());Uh();cu();$h();Gh=Object.values(jn),xe={client:null,currentTheme:null,currentThemeUrl:null,timeoutMs:1e4,languages:ps,themes:jn,loadedThemes:new Set,loadedLangs:new Set,clientPromise:new Promise(e=>mM=e),init:async e=>{let t=await fetch(mb).then(i=>i.blob()),o=xe.client=new fM.WorkerClient("shiki-client","shiki-host",t,{name:"ShikiWorker"});await o.init();let r=e||Gh[0];await pM(),await o.run("setOnigasm",{wasm:fb}),await o.run("setHighlighter",{theme:r,langs:[]}),xe.loadedThemes.add(r),await xe._setTheme(r),mM(o)},_setTheme:async e=>{xe.currentThemeUrl=e;let{themeData:t}=await xe.client.run("getTheme",{theme:e});xe.currentTheme=JSON.parse(t),Fh({id:e,theme:xe.currentTheme})},loadTheme:async e=>{let t=await xe.clientPromise;xe.loadedThemes.has(e)||(await t.run("loadTheme",{theme:e}),xe.loadedThemes.add(e))},setTheme:async e=>{await xe.clientPromise,e||=Gh[0],xe.loadedThemes.has(e)||await xe.loadTheme(e),await xe._setTheme(e)},loadLang:async e=>{let t=await xe.clientPromise,o=di(e);!o||xe.loadedLangs.has(o.id)||(await t.run("loadLanguage",{lang:{...o,grammar:o.grammar??await dM(o)}}),xe.loadedLangs.add(o.id))},tokenizeCode:async(e,t)=>{let o=await xe.clientPromise,r=di(t);return r?(xe.loadedLangs.has(r.id)||await xe.loadLang(r.id),await o.run("codeToThemedTokens",{code:e,lang:t,theme:xe.currentThemeUrl??Gh[0]})):[]},destroy(){xe.currentTheme=null,xe.currentThemeUrl=null,Fh({id:null,theme:null}),xe.client?.destroy()}}});var _a,Hh=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/shikiCodeblocks.desktop/devicon.css",{name:"src/plugins/shikiCodeblocks.desktop/devicon.css",source:`@import url("https://cdn.jsdelivr.net/gh/devicons/devicon@v2.10.1/devicon.min.css"); -`,classNames:{},dom:null});_a="src/plugins/shikiCodeblocks.desktop/devicon.css"});var Ba=g(()=>{"use strict";a()});var VL,wr,zh=g(()=>{"use strict";a();$();Qe();we();Cn();I();Oa();$h();Hh();Ba();VL=Object.keys(jn),wr=N({theme:{type:4,description:"Default themes",options:VL.map(e=>({label:An(zp(e)),value:jn[e],default:jn[e]===jn.DarkPlus})),onChange:xe.setTheme},customTheme:{type:0,description:"A link to a custom vscode theme",placeholder:jn.MaterialCandy,onChange:e=>{xe.setTheme(e||wr.store.theme)}},tryHljs:{type:4,description:"Use the more lightweight default Discord highlighter and theme.",options:[{label:"Never",value:"NEVER"},{label:"Prefer Shiki instead of Highlight.js",value:"SECONDARY",default:!0},{label:"Prefer Highlight.js instead of Shiki",value:"PRIMARY"},{label:"Always",value:"ALWAYS"}]},useDevIcon:{type:4,description:"How to show language icons on codeblocks",options:[{label:"Disabled",value:"DISABLED"},{label:"Colorless",value:"GREYSCALE",default:!0},{label:"Colored",value:"COLOR"}],onChange:e=>{e==="DISABLED"?Xt(_a):Nt(_a)}},bgOpacity:{type:5,description:"Background opacity",markers:[0,20,40,60,80,100],default:100,componentProps:{stickToMarkers:!1,onValueRender:null}}},{theme:{disabled(){return!!this.store.customTheme}},customTheme:{isValid(e){if(!e)return!0;let t=zu(e);return t?t.pathname.endsWith(".json")?!0:"Must be a json file":"Must be a valid URL"}}})});function hM(e,t){let o=wr.use(e),[r,i]=U.useState(!1),s={...o,...t},l=s.customTheme||s.theme;if(t){let c=xe.currentThemeUrl&&l&&l!==xe.currentThemeUrl,u=Object.keys(t).length===0;r&&(!c||u)&&i(!1),!r&&c&&(i(!0),xe.setTheme(l))}return{...s,isThemeLoading:l!==xe.currentThemeUrl}}var yM=g(()=>{"use strict";a();T();Oa();zh()});function vM(e){return e=e.slice(1),e.length<6&&(e=e.split("").map(t=>t+t).join("")),e.length===6&&(e+="ff"),e.length>6&&(e=e.slice(0,6)),e.split(/(..)/).filter(Boolean).map(t=>parseInt(t,16))}var SM=g(()=>{"use strict";a()});var sn,bM,Fa=g(()=>{"use strict";a();Qe();T();cu();Ba();sn=ve("shiki-"),bM=({lang:e,tryHljs:t})=>{let o=e?Br?.getLanguage?.(e):null,i=(e?di(e):null)?.name;switch(t){case"ALWAYS":return!0;case"PRIMARY":return!!o||e==="";case"SECONDARY":return!i&&!!o;case"NEVER":return!1;default:return!1}}});function TM(e){let[t,o]=U.useState(!1);function r(i){Ft.copy(i),o(!0),setTimeout(()=>{o(!1)},e)}return[t,r]}var wM=g(()=>{"use strict";a();T()});function xM({content:e,...t}){let[o,r]=TM(1e3);return n("button",{...t,style:{...t.style,cursor:o?"default":void 0},onClick:()=>r(e)},o?"Copied!":"Copy")}var MM=g(()=>{"use strict";a();wM()});function IM({content:e,theme:t}){let o=[];return Ft.SUPPORTS_COPY&&o.push(n(xM,{content:e,className:sn("btn"),style:{backgroundColor:t.accentBgColor,color:t.accentFgColor}})),n("div",{className:sn("btns")},o)}var PM=g(()=>{"use strict";a();T();Fa();MM()});var AM,CM=g(()=>{"use strict";a();T();Fa();AM=({theme:e,useHljs:t,lang:o,content:r,tokens:i})=>{let s;if(t)try{let{value:c}=Br.highlight(o,r,!0);s=c.split(` -`).map((u,p)=>n("span",{key:p,dangerouslySetInnerHTML:{__html:u}}))}catch{s=r.split(` -`).map(c=>n("span",null,c))}else s=(i??r.split(` -`).map(u=>[{color:e.plainColor,content:u}])).map(u=>u.length===0?n("span",null,` -`):n(f,null,u.map(({content:p,color:d,fontStyle:h},v)=>n("span",{key:v,style:{color:d,fontStyle:(h??0)&1?"italic":void 0,fontWeight:(h??0)&2?"bold":void 0,textDecoration:(h??0)&4?"underline":void 0}},p))));let l=s.map((c,u)=>n("tr",{key:u},n("td",{style:{color:e.plainColor}},u+1),n("td",null,c)));return n("table",{className:sn("table")},...l)}});function RM({langName:e,useDevIcon:t,shikiLang:o}){return e?n("div",{className:sn("lang")},t!=="DISABLED"&&o?.devicon&&n("i",{className:`${sn("devicon")} devicon-${o.devicon}${t==="COLOR"?" colored":""}`}),e):n(f,null)}var kM=g(()=>{"use strict";a();Ba();Fa()});var uu,e5,NM=g(()=>{"use strict";a();le();lt();T();cu();Oa();yM();Uh();SM();Fa();PM();CM();kM();uu=e=>n("pre",{className:sn("container")},n(_,null,n(e5,{...e}))),e5=({lang:e,content:t,isPreview:o,tempSettings:r})=>{let{tryHljs:i,useDevIcon:s,bgOpacity:l}=hM(["tryHljs","useDevIcon","bgOpacity"],r),{id:c,theme:u}=cM(),p=e?di(e):null,d=bM({lang:e,tryHljs:i}),[h,v]=Wu(!0),[b]=st(async()=>!p||d||!v?null:await xe.tokenizeCode(t,e),{fallbackValue:null,deps:[e,t,c,v]}),M={plainColor:u?.fg||"var(--text-normal)",accentBgColor:u?.colors?.["statusBar.background"]||(d?"#7289da":"#007BC8"),accentFgColor:u?.colors?.["statusBar.foreground"]||"#FFF",backgroundColor:u?.colors?.["editor.background"]||"var(--background-secondary)"},w;return e&&(w=d?Br?.getLanguage?.(e)?.name:p?.name),n("div",{ref:h,className:sn("root",{plain:!w,preview:o}),style:{backgroundColor:d?M.backgroundColor:`rgba(${vM(M.backgroundColor).concat(l/100).join(", ")})`,color:M.plainColor}},n("code",null,n(RM,{langName:w,useDevIcon:s,shikiLang:p}),n(AM,{theme:M,useHljs:d,lang:e,content:t,tokens:b}),!o&&n(IM,{content:t,theme:M})))}});var DM,LM,EM=g(()=>{"use strict";a();DM=new Map,LM=()=>{DM.forEach(e=>e.remove()),DM.clear()}});var jh,OM=g(()=>{"use strict";a();eM();Qe();P();I();oM();Oa();NM();Hh();zh();Ba();EM();jh=y({name:"ShikiCodeblocks",description:"Brings vscode-style codeblocks into Discord, powered by Shiki",authors:[m.Vap],patches:[{find:"codeBlock:{react(",replacement:{match:/codeBlock:\{react\((\i),(\i),(\i)\)\{/,replace:"$&return $self.renderHighlighter($1,$2,$3);"}},{find:".PREVIEW_NUM_LINES",replacement:{match:/(?<=function \i\((\i)\)\{)(?=let\{text:\i,language:)/,replace:"return $self.renderHighlighter({lang:$1.language,content:$1.text});"}}],start:async()=>{wr.store.useDevIcon!=="DISABLED"&&Nt(_a),await xe.init(wr.store.customTheme||wr.store.theme)},stop:()=>{xe.destroy(),LM()},settingsAboutComponent:({tempSettings:e})=>uu({lang:"tsx",content:tM,isPreview:!0,tempSettings:e}),settings:wr,shiki:xe,createHighlighter:uu,renderHighlighter:({lang:e,content:t})=>uu({lang:e?.toLowerCase(),content:t,isPreview:!1})})});var Wh,_M=g(()=>{"use strict";a();P();I();Wh=y({name:"ShowAllMessageButtons",description:"Always show all message buttons no matter if you are holding the shift key or not.",authors:[m.Nuckyz],patches:[{find:".Messages.MESSAGE_UTILITIES_A11Y_LABEL",replacement:{match:/isExpanded:\i&&(.+?),/,replace:"isExpanded:$1,"}}]})});var BM=g(()=>{});function UM(){let e=Ss(FM.colors.INTERACTIVE_MUTED).hex(),t=Ss(FM.colors.INTERACTIVE_ACTIVE).hex();return n(t5,{color:e,forcedIconColor:t,size:16,tooltipText:Ye.Messages.CONNECTION_VERIFIED})}var FM,t5,$M=g(()=>{"use strict";a();H();T();FM=so(e=>e.colors?.INTERACTIVE_MUTED?.css),t5=Ne(".CONNECTIONS_ROLE_OFFICIAL_ICON_TOOLTIP")});function GM({id:e,theme:t}){let o=ho.getUserProfile(e);if(!o)return null;let r=o.connectedAccounts;return r?.length?n(o5,null,n(V,{tag:"h2",variant:"eyebrow",style:{color:"var(--header-primary)"}},"Connections"),n(fe,{style:{marginTop:"8px",gap:a5(pu.store.iconSpacing),flexWrap:"wrap"}},r.map(i=>n(u5,{connection:i,theme:t})))):null}function u5({connection:e,theme:t}){let o=i5.get(r5.useLegacyPlatformType(e.type)),r=o.getPlatformUserUrl?.(e),i=n("img",{"aria-label":e.name,src:t==="light"?o.icon.lightSVG:o.icon.darkSVG,style:{width:pu.store.iconSize,height:pu.store.iconSize}}),s=r?Ei:Dl;return n(ne,{text:n("span",{className:"vc-sc-tooltip"},e.name,e.verified&&n(UM,null),n(s,{height:16,width:16})),key:e.id},l=>r?n("a",{...l,className:"vc-user-connection",href:r,target:"_blank",onClick:c=>{Vencord.Plugins.isPluginEnabled("OpenInApp")&&Vencord.Plugins.plugins.OpenInApp.handleLink(c.currentTarget,c)}},i):n("button",{...l,className:"vc-user-connection",onClick:()=>Ao(e.name)},i))}var o5,n5,r5,i5,s5,a5,pu,l5,c5,qh,HM=g(()=>{"use strict";a();BM();$();le();Ut();It();P();we();I();H();T();$M();o5=Ne(".lastSection","children:"),n5=Re("ThemeStore"),r5=x("useLegacyPlatformType"),i5=x("isSupported","getByUrl"),s5=Go(',"--profile-gradient-primary-color"'),a5=e=>(e??0)*2+4,pu=N({iconSize:{type:1,description:"Icon size (px)",default:32},iconSpacing:{type:4,description:"Icon margin",default:1,options:[{label:"Compact",value:0},{label:"Cozy",value:1},{label:"Roomy",value:2}]}}),l5=_.wrap(({user:e,displayProfile:t})=>n(GM,{id:e.id,theme:s5(e,t).profileTheme})),c5=_.wrap(({id:e})=>n(GM,{id:e,theme:n5.theme}));qh=y({name:"ShowConnections",description:"Show connected accounts in user popouts",authors:[m.TheKodeToad],patches:[{find:"{isUsingGuildBio:null!==(",replacement:{match:/,theme:\i\}\)(?=,.{0,150}setNote:)/,replace:"$&,$self.profilePopoutComponent({ user: arguments[0].user, displayProfile: arguments[0].displayProfile })"}},{find:'"Profile Panel: user cannot be undefined"',replacement:{match:/\(0,\i\.jsx\)\(\i\.\i,\{\}\).{0,100}setNote:(?=.+?channelId:(\i).id)/,replace:"$self.profilePanelComponent({ id: $1.recipients[0] }),$&"}}],settings:pu,profilePopoutComponent:l5,profilePanelComponent:c5})});var zM=g(()=>{});function T5({channel:e}){let{defaultAllowedUsersAndRolesDropdownState:t}=Wn.use(["defaultAllowedUsersAndRolesDropdownState"]),[o,r]=W([]),{type:i,topic:s,lastMessageId:l,defaultForumLayout:c,lastPinTimestamp:u,defaultAutoArchiveDuration:p,availableTags:d,id:h,rateLimitPerUser:v,defaultThreadRateLimitPerUser:b,defaultSortOrder:M,defaultReactionEmoji:w,bitrate:C,rtcRegion:R,videoQualityMode:A,permissionOverwrites:F,guild_id:z}=e;return se(()=>{let Y=[],J=ae.getGuild(z).ownerId;Ge.getMember(z,J)||Y.push(J),Object.values(F).forEach(({type:Z,id:O})=>{Z===1&&!Ge.getMember(z,O)&&Y.push(O)}),Y.length>0&&B.dispatch({type:"GUILD_MEMBERS_REQUEST",guildIds:[z],userIds:Y}),G.plugins.PermissionsViewer.enabled&&r(Rc(Object.values(F).map(Z=>({type:Z.type,id:Z.id,overwriteAllow:Z.allow,overwriteDeny:Z.deny})),z))},[h]),n("div",{className:jM.auto+" "+jM.customTheme+" "+p5.chatContent+" shc-lock-screen-outer-container"},n("div",{className:"shc-lock-screen-container"},n("img",{className:"shc-lock-screen-logo",src:b5}),n("div",{className:"shc-lock-screen-heading-container"},n(V,{variant:"heading-xxl/bold"},"This is a ",_e.can(me.VIEW_CHANNEL,e)?"locked":"hidden"," ",h5[i]," channel."),e.isNSFW()&&n(ne,{text:"NSFW"},({onMouseLeave:Y,onMouseEnter:J})=>n("svg",{onMouseLeave:Y,onMouseEnter:J,className:"shc-lock-screen-heading-nsfw-icon",width:"32",height:"32",viewBox:"0 0 48 48","aria-hidden":!0,role:"img"},n("path",{fill:"currentColor",d:"M.7 43.05 24 2.85l23.3 40.2Zm23.55-6.25q.75 0 1.275-.525.525-.525.525-1.275 0-.75-.525-1.3t-1.275-.55q-.8 0-1.325.55-.525.55-.525 1.3t.55 1.275q.55.525 1.3.525Zm-1.85-6.1h3.65V19.4H22.4Z"})))),!e.isGuildVoice()&&!e.isGuildStageVoice()&&n(V,{variant:"text-lg/normal"},"You can not see the ",e.isForumChannel()?"posts":"messages"," of this channel.",e.isForumChannel()&&s&&s.length>0&&" However you may see its guidelines:"),e.isForumChannel()&&s&&s.length>0&&n("div",{className:"shc-lock-screen-topic-container"},Pe.parseTopic(s,!1,{channelId:h})),l&&n(V,{variant:"text-md/normal"},"Last ",e.isForumChannel()?"post":"message"," created:",n(Po,{timestamp:new Date(un.extractTimestamp(l))})),u&&n(V,{variant:"text-md/normal"},"Last message pin: ",n(Po,{timestamp:new Date(u)})),(v??0)>0&&n(V,{variant:"text-md/normal"},"Slowmode: ",Ws(v,"seconds")),(b??0)>0&&n(V,{variant:"text-md/normal"},"Default thread slowmode: ",Ws(b,"seconds")),(e.isGuildVoice()||e.isGuildStageVoice())&&C!=null&&n(V,{variant:"text-md/normal"},"Bitrate: ",C," bits"),R!==void 0&&n(V,{variant:"text-md/normal"},"Region: ",R??"Automatic"),(e.isGuildVoice()||e.isGuildStageVoice())&&n(V,{variant:"text-md/normal"},"Video quality mode: ",S5[A??1]),(p??0)>0&&n(V,{variant:"text-md/normal"},"Default inactivity duration before archiving ",e.isForumChannel()?"posts":"threads",":"," "+Ws(p,"minutes")),c!=null&&n(V,{variant:"text-md/normal"},"Default layout: ",v5[c]),M!=null&&n(V,{variant:"text-md/normal"},"Default sort order: ",y5[M]),w!=null&&n("div",{className:"shc-lock-screen-default-emoji-container"},n(V,{variant:"text-md/normal"},"Default reaction emoji:"),Pe.defaultRules[w.emojiName?"emoji":"customEmoji"].react({name:w.emojiName?f5.convertSurrogateToName(w.emojiName):jo.getCustomEmojiById(w.emojiId)?.name??"",emojiId:w.emojiId??void 0,surrogate:w.emojiName??void 0,src:w.emojiName?g5.getURL(w.emojiName):void 0},void 0,{key:"0"})),e.hasFlag(16)&&n(V,{variant:"text-md/normal"},"Posts on this forum require a tag to be set."),d&&d.length>0&&n("div",{className:"shc-lock-screen-tags-container"},n(V,{variant:"text-lg/bold"},"Available tags:"),n("div",{className:"shc-lock-screen-tags"},d.map(Y=>n(m5,{tag:Y})))),n("div",{className:"shc-lock-screen-allowed-users-and-roles-container"},n("div",{className:"shc-lock-screen-allowed-users-and-roles-container-title"},G.plugins.PermissionsViewer.enabled&&n(ne,{text:"Permission Details"},({onMouseLeave:Y,onMouseEnter:J})=>n("button",{onMouseLeave:Y,onMouseEnter:J,className:"shc-lock-screen-allowed-users-and-roles-container-permdetails-btn",onClick:()=>Vi(o,ae.getGuild(e.guild_id),e.name)},n("svg",{width:"24",height:"24",viewBox:"0 0 24 24"},n("path",{fill:"currentColor",d:"M7 12.001C7 10.8964 6.10457 10.001 5 10.001C3.89543 10.001 3 10.8964 3 12.001C3 13.1055 3.89543 14.001 5 14.001C6.10457 14.001 7 13.1055 7 12.001ZM14 12.001C14 10.8964 13.1046 10.001 12 10.001C10.8954 10.001 10 10.8964 10 12.001C10 13.1055 10.8954 14.001 12 14.001C13.1046 14.001 14 13.1055 14 12.001ZM19 10.001C20.1046 10.001 21 10.8964 21 12.001C21 13.1055 20.1046 14.001 19 14.001C17.8954 14.001 17 13.1055 17 12.001C17 10.8964 17.8954 10.001 19 10.001Z"})))),n(V,{variant:"text-lg/bold"},"Allowed users and roles:"),n(ne,{text:t?"Hide Allowed Users and Roles":"View Allowed Users and Roles"},({onMouseLeave:Y,onMouseEnter:J})=>n("button",{onMouseLeave:Y,onMouseEnter:J,className:"shc-lock-screen-allowed-users-and-roles-container-toggle-btn",onClick:()=>Wn.store.defaultAllowedUsersAndRolesDropdownState=!t},n("svg",{width:"24",height:"24",viewBox:"0 0 24 24",transform:t?"scale(1 -1)":"scale(1 1)"},n("path",{fill:"currentColor",d:"M16.59 8.59003L12 13.17L7.41 8.59003L6 10L12 16L18 10L16.59 8.59003Z"}))))),t&&n(d5,{channel:e}))))}var jM,p5,d5,m5,f5,g5,h5,y5,v5,S5,b5,WM,qM=g(()=>{"use strict";a();$();le();Cn();H();T();wa();Ta();Kh();jM=x("auto","content","scrollerBase"),p5=x("chat","content","noChat","chatContent"),d5=Ne(".Messages.ROLE_REQUIRED_SINGLE_USER_MESSAGE"),m5=Eu(e=>{if(typeof e!="function")return!1;let t=Function.prototype.toString.call(e);return t.includes(".Messages.FORUM_TAG_A11Y_FILTER_BY_TAG")&&!t.includes("increasedActivityPill")}),f5=x("convertSurrogateToName"),g5=x("getURL","getEmojiColors"),h5={[0]:"text",[5]:"announcement",[15]:"forum",[2]:"voice",[13]:"stage"},y5={[0]:"Latest activity",[1]:"Creation date"},v5={[0]:"Not set",[1]:"List view",[2]:"Gallery view"},S5={[1]:"Automatic",[2]:"720p"},b5="/assets/433e3ec4319a9d11b0cbe39342614982.svg";WM=_.wrap(T5)});var KM,Wn,Yh,Kh=g(()=>{"use strict";a();zM();$();le();P();hi();I();H();T();qM();KM=x("modeMuted","modeSelected","unread","icon"),Wn=N({hideUnreads:{description:"Hide Unreads",type:3,default:!0,restartNeeded:!0},showMode:{description:"The mode used to display hidden channels.",type:4,options:[{label:"Plain style with Lock Icon instead",value:0,default:!0},{label:"Muted style with hidden eye icon on the right",value:1}],restartNeeded:!0},defaultAllowedUsersAndRolesDropdownState:{description:"Whether the allowed users and roles dropdown on hidden channels should be open by default",type:3,default:!0}}),Yh=y({name:"ShowHiddenChannels",description:"Show channels that you do not have access to view.",authors:[m.BigDuck,m.AverageReactEnjoyer,m.D3SOX,m.Ven,m.Nuckyz,m.Nickyux,m.dzshn],settings:Wn,patches:[{find:'"placeholder-channel-id"',replacement:[{match:/if\(!\i\.\i\.can\(\i\.\i\.VIEW_CHANNEL.+?{if\(this\.id===\i\).+?threadIds:\i}}/,replace:""},{match:/(?<=&&)(?=!\i\.\i\.hasUnread\(this\.record\.id\))/,replace:"$self.isHiddenChannel(this.record)||"},{match:/(activeJoinedRelevantThreads:.{0,50}VIEW_CHANNEL.+?renderLevel:(.+?),threadIds.+?renderLevel:).+?(?=,threadIds)/g,replace:(e,t,o)=>`${t}${o}`},{match:/(?<=getRenderLevel\(\i\){.+?return)!\i\.\i\.can\(\i\.\i\.VIEW_CHANNEL,this\.record\)\|\|/,replace:" "}]},{find:"VoiceChannel, transitionTo: Channel does not have a guildId",replacement:[{match:/(?<=getCurrentClientVoiceChannelId\((\i)\.guild_id\);return)/,replace:(e,t)=>`!$self.isHiddenChannel(${t})&&`},{match:/(?=&&\i\.\i\.selectVoiceChannel\((\i)\.id\))/,replace:(e,t)=>`&&!$self.isHiddenChannel(${t})`},{match:/!__OVERLAY__&&\((?<=selectVoiceChannel\((\i)\.id\).+?)/,replace:(e,t)=>`${e}$self.isHiddenChannel(${t},true)||`}]},{find:".MAX_STAGE_VOICE_USER_LIMIT})",replacement:{match:/!(\i)\.isRoleSubscriptionTemplatePreviewChannel\(\)/,replace:(e,t)=>`${e}&&!$self.isHiddenChannel(${t})`}},{find:"ChannelItemEditButton:function(){",replacement:[...["renderEditButton","renderInviteButton"].map(e=>({match:new RegExp(`(?<=${e}\\(\\){)`,"g"),replace:"if($self.isHiddenChannel(this.props.channel))return null;"}))]},{find:"VoiceChannel.renderPopout: There must always be something to render",all:!0,replacement:{match:/(?<=renderOpenChatButton=\(\)=>{)/,replace:"if($self.isHiddenChannel(this.props.channel))return null;"}},{find:".Messages.CHANNEL_TOOLTIP_DIRECTORY",predicate:()=>Wn.store.showMode===0,replacement:{match:/(?=switch\((\i)\.type\).{0,30}\.GUILD_ANNOUNCEMENT.{0,70}\(0,\i\.\i\))/,replace:(e,t)=>`if($self.isHiddenChannel(${t}))return $self.LockIcon;`}},{find:"UNREAD_IMPORTANT:",predicate:()=>Wn.store.showMode===1,replacement:[{match:/(?<={channel:(\i),name:\i,muted:(\i).+?;)/,replace:(e,t,o)=>`${o}=$self.isHiddenChannel(${t})?true:${o};`},{match:/\.name\),.{0,120}\.children.+?:null(?<=,channel:(\i).+?)/,replace:(e,t)=>`${e},$self.isHiddenChannel(${t})?$self.HiddenChannelIcon():null`},{match:/(?<=\.wrapper:\i\.notInteractive,)(.+?)if\((\i)\)return (\i\.MUTED);/,replace:(e,t,o,r)=>`${o}?${r}:"",${t}if(${o})return "";`}]},{find:"UNREAD_IMPORTANT:",replacement:[{predicate:()=>Wn.store.hideUnreads===!1&&Wn.store.showMode===1,match:/\.LOCKED;if\((?<={channel:(\i).+?)/,replace:(e,t)=>`${e}!$self.isHiddenChannel(${t})&&`},{predicate:()=>Wn.store.hideUnreads===!0,match:/(?<={channel:(\i),name:\i,.+?unread:(\i).+?;)/,replace:(e,t,o)=>`${o}=$self.isHiddenChannel(${t})?false:${o};`}]},{find:'.displayName="ChannelListUnreadsStore"',replacement:{match:/(?<=if\(null==(\i))(?=.{0,160}?getHasImportantUnread\)\(\i\))/g,replace:(e,t)=>`||$self.isHiddenChannel(${t})`}},{find:"renderBottomUnread(){",replacement:{match:/(?=&&\(0,\i\.getHasImportantUnread\)\((\i\.record)\))/,replace:"&&!$self.isHiddenChannel($1)"}},{find:".useFlattenedChannelIdListWithThreads)",replacement:{match:/(?=&&\(0,\i\.getHasImportantUnread\)\((\i)\))/,replace:"&&!$self.isHiddenChannel($1)"}},{find:"Missing channel in Channel.renderHeaderToolbar",replacement:[{match:/(?<=renderHeaderToolbar=\(\)=>{.+?case \i\.\i\.GUILD_TEXT:)(?=.+?(\i\.push.{0,50}channel:(\i)},"notifications"\)\)))(?<=isLurking:(\i).+?)/,replace:(e,t,o,r)=>`if(!${r}&&$self.isHiddenChannel(${o})){${t};break;}`},{match:/(?<=renderHeaderToolbar=\(\)=>{.+?case \i\.\i\.GUILD_MEDIA:)(?=.+?(\i\.push.{0,40}channel:(\i)},"notifications"\)\)))(?<=isLurking:(\i).+?)/,replace:(e,t,o,r)=>`if(!${r}&&$self.isHiddenChannel(${o})){${t};break;}`},{match:/renderMobileToolbar=\(\)=>{.+?case \i\.\i\.GUILD_DIRECTORY:(?<=let{channel:(\i).+?)/,replace:(e,t)=>`${e}if($self.isHiddenChannel(${t}))break;`},{match:/(?<=renderHeaderBar=\(\)=>{.+?hideSearch:(\i)\.isDirectory\(\))/,replace:(e,t)=>`||$self.isHiddenChannel(${t})`},{match:/(?<=renderSidebar\(\){)/,replace:"if($self.isHiddenChannel(this.props.channel))return null;"},{match:/(?<=renderChat\(\){)/,replace:"if($self.isHiddenChannel(this.props.channel))return $self.HiddenChannelLockScreen(this.props.channel);"}]},{find:'"MessageManager"',replacement:{match:/"Skipping fetch because channelId is a static route"\);return}(?=.+?getChannel\((\i)\))/,replace:(e,t)=>`${e}if($self.isHiddenChannel({channelId:${t}}))return;`}},{find:'"alt+shift+down"',replacement:{match:/(?<=getChannel\(\i\);return null!=(\i))(?=.{0,150}?getHasImportantUnread\)\(\i\))/,replace:(e,t)=>`&&!$self.isHiddenChannel(${t})`}},{find:".APPLICATION_STORE&&null!=",replacement:{match:/(?<=getState\(\)\.channelId.{0,30}?\(0,\i\.\i\)\(\i\))(?=\.map\()/,replace:".filter(e=>!$self.isHiddenChannel(e))"}},{find:".Messages.ROLE_REQUIRED_SINGLE_USER_MESSAGE",replacement:[{match:/ADMINISTRATOR\)\|\|(?<=context:(\i)}.+?)(?=(.+?)VIEW_CHANNEL)/,replace:(e,t,o)=>`${e}!Vencord.Webpack.Common.PermissionStore.can(${me.CONNECT}n,${t})?${o}CONNECT):`},{match:/permissionOverwrites\[.+?\i=(?<=context:(\i)}.+?)(?=(.+?)VIEW_CHANNEL)/,replace:(e,t,o)=>`${e}!Vencord.Webpack.Common.PermissionStore.can(${me.CONNECT}n,${t})?${o}CONNECT):`},{match:/sortBy.{0,30}?\.filter\(\i=>(?<=channel:(\i).+?)/,replace:(e,t)=>`${e}$self.isHiddenChannel(${t})?true:`},{match:/computePermissionsForRoles.+?.value\(\)(?<=channel:(\i).+?)/,replace:(e,t)=>`${e}.reduce(...$self.makeAllowedRolesReduce(${t}.guild_id))`},{match:/MANAGE_ROLES.{0,90}?return(?=\(.+?(\(0,\i\.jsxs\)\("div",{className:\i\.members.+?guildId:(\i)\.guild_id.+?roleColor.+?\]}\)))/,replace:(e,t,o)=>(t=t.replace(bn(/(?<=users:\i)/),`,shcChannel:${o}`),t=t.replace(bn(/1!==\i\.length/),"true"),`${e} $self.isHiddenChannel(${o},true)?${t}:`)}]},{find:'+1]})},"overflow"))',replacement:[{match:/maxUsers:\i,users:\i.+?}=(\i).*?;/,replace:(e,t)=>`${e}let{shcChannel}=${t};`},{match:/\i>0(?=&&.{0,60}renderPopout)/,replace:e=>`($self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)?true:${e})`},{match:/(?<=\.value\(\),(\i)=.+?length-)1(?=\]=.{0,60}renderPopout)/,replace:(e,t)=>`($self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)&&${t}<=0?0:1)`},{match:/(?<="\+",)(\i)\+1/,replace:(e,t)=>`$self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)&&${t}<=0?"":${e}`}]},{find:".Messages.CHANNEL_CALL_CURRENT_SPEAKER.format",replacement:[{match:/"more-options-popout"\)\),(?<=channel:(\i).+?inCall:(\i).+?)/,replace:(e,t,o)=>`${e}${o}||!$self.isHiddenChannel(${t},true)&&`},{match:/"popup".{0,100}?if\((?<=channel:(\i).+?inCall:(\i).+?)/,replace:(e,t,o)=>`${e}(${o}||!$self.isHiddenChannel(${t},true))&&`}]},{find:".Messages.EMBEDDED_ACTIVITIES_DEVELOPER_ACTIVITY_SHELF_FETCH_ERROR",replacement:[{match:/renderContent\(\i\){.+?this\.renderVoiceChannelEffects.+?children:/,replace:"$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)?$self.HiddenChannelLockScreen(this.props.channel):"},{match:/renderContent\(\i\){.+?disableGradients:/,replace:"$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)||"},{match:/(?:{|,)render(?!Header|ExternalHeader).{0,30}?:/g,replace:"$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)?()=>null:"},{match:/callContainer,(?<=\i\.callContainer,)/,replace:'$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)?"":'}]},{find:'"HasBeenInStageChannel"',replacement:[{match:/"124px".+?children:(?<=let \i,{channel:(\i).+?)(?=.{0,20}?}\)}function)/,replace:(e,t)=>`${e}$self.isHiddenChannel(${t})?$self.HiddenChannelLockScreen(${t}):`},{match:/render(?:BottomLeft|BottomCenter|BottomRight|ChatToasts):\(\)=>(?<=let \i,{channel:(\i).+?)/g,replace:(e,t)=>`${e}$self.isHiddenChannel(${t})?null:`},{match:/"124px".+?disableGradients:(?<=let \i,{channel:(\i).+?)/,replace:(e,t)=>`${e}$self.isHiddenChannel(${t})||`},{match:/"124px".+?style:(?<=let \i,{channel:(\i).+?)/,replace:(e,t)=>`${e}$self.isHiddenChannel(${t})?void 0:`}]},{find:".Messages.STAGE_FULL_MODERATOR_TITLE",replacement:[{match:/\(0,\i\.jsx\)\(\i\.\i\.Divider.+?}\)]}\)(?=.+?:(\i)\.guild_id)/,replace:(e,t)=>`$self.isHiddenChannel(${t})?null:(${e})`},{match:/"recents".+?&&(?=\(.+?channelId:(\i)\.id,showRequestToSpeakSidebar)/,replace:(e,t)=>`${e}!$self.isHiddenChannel(${t})&&`}]},{find:",queryStaticRouteChannels(",replacement:[{match:/(?<=queryChannels\(\i\){.+?getChannels\(\i)(?=\))/,replace:",true"},{match:/(?<=queryChannels\(\i\){.+?isGuildChannelType\)\((\i)\.type\))(?=&&!\i\.\i\.can\()/,replace:"&&!$self.isHiddenChannel($1)"}]},{find:'"^/guild-stages/(\\\\d+)(?:/)?(\\\\d+)?"',replacement:{match:/\i\.\i\.can\(\i\.\i\.VIEW_CHANNEL,\i\)/,replace:"true"}},{find:".shouldCloseDefaultModals",replacement:{match:/(?<=getChannel\(\i\);if\(null!=(\i))(?=.{0,100}?selectVoiceChannel)/,replace:(e,t)=>`&&!$self.isHiddenChannel(${t})`}},{find:'.displayName="GuildChannelStore"',replacement:[{match:/isChannelGated\(.+?\)(?=&&)/,replace:e=>`${e}&&false`},{match:/(?<=getChannels\(\i)(\){.+?)return (.+?)}/,replace:(e,t,o)=>`,shouldIncludeHidden${t}return $self.resolveGuildChannels(${o},shouldIncludeHidden??false);}`}]},{find:".Messages.FORM_LABEL_MUTED",replacement:{match:/(?<=getChannels\(\i)(?=\))/,replace:",true"}},{find:'.displayName="NowPlayingViewStore"',replacement:{match:/(getVoiceStateForUser.{0,150}?)&&\i\.\i\.canWithPartialContext.{0,20}VIEW_CHANNEL.+?}\)(?=\?)/,replace:"$1"}}],isHiddenChannel(e,t=!1){return!e||(e.channelId&&(e=ee.getChannel(e.channelId)),!e||e.isDM()||e.isGroupDM()||e.isMultiUserDM())?!1:!_e.can(me.VIEW_CHANNEL,e)||t&&!_e.can(me.CONNECT,e)},resolveGuildChannels(e,t){if(t)return e;let o={};for(let[r,i]of Object.entries(e)){if(!Array.isArray(i)){o[r]=i;continue}o[r]??=[];for(let s of i)(s.channel.id===null||!this.isHiddenChannel(s.channel))&&o[r].push(s)}return o},makeAllowedRolesReduce(e){return[(t,o,r,i)=>{if(r!==0)return t;let s=i.find(l=>l.id===e);return s?[s]:i},[]]},HiddenChannelLockScreen:e=>n(WM,{channel:e}),LockIcon:_.wrap(()=>n("svg",{className:KM.icon,height:"18",width:"20",viewBox:"0 0 24 24","aria-hidden":!0,role:"img"},n("path",{className:"shc-evenodd-fill-current-color",d:"M17 11V7C17 4.243 14.756 2 12 2C9.242 2 7 4.243 7 7V11C5.897 11 5 11.896 5 13V20C5 21.103 5.897 22 7 22H17C18.103 22 19 21.103 19 20V13C19 11.896 18.103 11 17 11ZM12 18C11.172 18 10.5 17.328 10.5 16.5C10.5 15.672 11.172 15 12 15C12.828 15 13.5 15.672 13.5 16.5C13.5 17.328 12.828 18 12 18ZM15 11H9V7C9 5.346 10.346 4 12 4C13.654 4 15 5.346 15 7V11Z"})),{noop:!0}),HiddenChannelIcon:_.wrap(()=>n(ne,{text:"Hidden Channel"},({onMouseLeave:e,onMouseEnter:t})=>n("svg",{onMouseLeave:e,onMouseEnter:t,className:KM.icon+" shc-hidden-channel-icon",width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":!0,role:"img"},n("path",{className:"shc-evenodd-fill-current-color",d:"m19.8 22.6-4.2-4.15q-.875.275-1.762.413Q12.95 19 12 19q-3.775 0-6.725-2.087Q2.325 14.825 1 11.5q.525-1.325 1.325-2.463Q3.125 7.9 4.15 7L1.4 4.2l1.4-1.4 18.4 18.4ZM12 16q.275 0 .512-.025.238-.025.513-.1l-5.4-5.4q-.075.275-.1.513-.025.237-.025.512 0 1.875 1.312 3.188Q10.125 16 12 16Zm7.3.45-3.175-3.15q.175-.425.275-.862.1-.438.1-.938 0-1.875-1.312-3.188Q13.875 7 12 7q-.5 0-.938.1-.437.1-.862.3L7.65 4.85q1.025-.425 2.1-.638Q10.825 4 12 4q3.775 0 6.725 2.087Q21.675 8.175 23 11.5q-.575 1.475-1.512 2.738Q20.55 15.5 19.3 16.45Zm-4.625-4.6-3-3q.7-.125 1.288.112.587.238 1.012.688.425.45.613 1.038.187.587.087 1.162Z"}))),{noop:!0})})});var YM=g(()=>{});var Ua,Zh,ZM=g(()=>{"use strict";a();YM();$();P();I();Ua=N({mode:{type:4,description:"How to display usernames and nicks",options:[{label:"Username then nickname",value:"user-nick",default:!0},{label:"Nickname then username",value:"nick-user"},{label:"Username only",value:"user"}]},displayNames:{type:3,description:"Use display names in place of usernames",default:!1},inReplies:{type:3,default:!1,description:"Also apply functionality to reply previews"}}),Zh=y({name:"ShowMeYourName",description:"Display usernames next to nicks, or no nicks at all",authors:[m.Rini,m.TheKodeToad],patches:[{find:".useCanSeeRemixBadge)",replacement:{match:/(?<=onContextMenu:\i,children:).*?\}/,replace:"$self.renderUsername(arguments[0])}"}}],settings:Ua,renderUsername:({author:e,message:t,isRepliedMessage:o,withMentionPrefix:r,userOverride:i})=>{try{let s=i??t.author,{username:l}=s;Ua.store.displayNames&&(l=s.globalName||l);let{nick:c}=e,u=r?"@":"";return l===c||o&&!Ua.store.inReplies?u+c:Ua.store.mode==="user-nick"?n(f,null,u,l," ",n("span",{className:"vc-smyn-suffix"},c)):Ua.store.mode==="nick-user"?n(f,null,u,c," ",n("span",{className:"vc-smyn-suffix"},l)):u+l}catch{return e?.nick}}})});var Xh,XM=g(()=>{"use strict";a();P();I();Xh=y({name:"ShowTimeouts",description:"Display member timeout icons in chat regardless of permissions.",authors:[m.Dolfies],patches:[{find:"showCommunicationDisabledStyles",replacement:{match:/&&\i\.\i\.canManageUser\(\i\.\i\.MODERATE_MEMBERS,\i\.author,\i\)/,replace:""}}]})});var Jh,Qh,w5,Vh,JM=g(()=>{"use strict";a();En();gn();$();P();I();T();Jh=!1,Qh=N({persistState:{type:3,description:"Whether to persist the state of the silent message toggle when changing channels",default:!1,onChange(e){e===!1&&(Jh=!1)}},autoDisable:{type:3,description:"Automatically disable the silent message toggle again after sending one",default:!0}}),w5=({isMainChat:e})=>{let[t,o]=W(Jh);function r(i){Qh.store.persistState&&(Jh=i),o(i)}return se(()=>{let i=(s,l)=>{t&&(Qh.store.autoDisable&&r(!1),l.content.startsWith("@silent ")||(l.content="@silent "+l.content))};return Vt(i),()=>void eo(i)},[t]),e?n(xo,{tooltip:t?"Disable Silent Message":"Enable Silent Message",onClick:()=>r(!t)},n("svg",{width:"24",height:"24",viewBox:"0 0 24 24",style:{scale:"1.2"}},n("path",{fill:"currentColor",mask:"url(#_)",d:"M18 10.7101C15.1085 9.84957 13 7.17102 13 4c0-.30736.0198-.6101.0582-.907C12.7147 3.03189 12.3611 3 12 3 8.686 3 6 5.686 6 9v5c0 1.657-1.344 3-3 3v1h18v-1c-1.656 0-3-1.343-3-3v-3.2899ZM8.55493 19c.693 1.19 1.96897 2 3.44497 2s2.752-.81 3.445-2H8.55493ZM18.2624 5.50209 21 2.5V1h-4.9651v1.49791h2.4411L16 5.61088V7h5V5.50209h-2.7376Z"}),!t&&n(f,null,n("mask",{id:"_"},n("path",{fill:"#fff",d:"M0 0h24v24H0Z"}),n("path",{stroke:"#000","stroke-width":"5.99068",d:"M0 24 24 0"})),n("path",{fill:"var(--status-danger)",d:"m21.178 1.70703 1.414 1.414L4.12103 21.593l-1.414-1.415L21.178 1.70703Z"})))):null},Vh=y({name:"SilentMessageToggle",authors:[m.Nuckyz,m.CatNoir],description:"Adds a button to the chat bar to toggle sending a silent message.",dependencies:["MessageEventsAPI","ChatInputButtonAPI"],settings:Qh,start:()=>wo("SilentMessageToggle",w5),stop:()=>nn("SilentMessageToggle")})});var xr,x5,ey,QM=g(()=>{"use strict";a();En();uo();$();P();I();T();xr=N({showIcon:{type:3,default:!1,description:"Show an icon for toggling the plugin",restartNeeded:!0},isEnabled:{type:3,description:"Toggle functionality",default:!0}}),x5=({isMainChat:e})=>{let{isEnabled:t,showIcon:o}=xr.use(["isEnabled","showIcon"]),r=()=>xr.store.isEnabled=!xr.store.isEnabled;return!e||!o?null:n(xo,{tooltip:t?"Disable Silent Typing":"Enable Silent Typing",onClick:r},n("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},n("path",{fill:"currentColor",d:"M528 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h480c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM128 180v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm288 0v-40c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h232c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12z"}),t&&n("path",{d:"M13 432L590 48",stroke:"var(--red-500)","stroke-width":"72","stroke-linecap":"round"})))},ey=y({name:"SilentTyping",authors:[m.Ven,m.Rini],description:"Hide that you are typing",dependencies:["CommandsAPI","ChatInputButtonAPI"],settings:xr,patches:[{find:'.dispatch({type:"TYPING_START_LOCAL"',replacement:{match:/startTyping\(\i\){.+?},stop/,replace:"startTyping:$self.startTyping,stop"}}],commands:[{name:"silenttype",description:"Toggle whether you're hiding that you're typing or not.",inputType:0,options:[{name:"value",description:"whether to hide or not that you're typing (default is toggle)",required:!1,type:5}],execute:async(e,t)=>{xr.store.isEnabled=!!ht(e,"value",!xr.store.isEnabled),ge(t.channel.id,{content:xr.store.isEnabled?"Silent typing enabled!":"Silent typing disabled!"})}}],async startTyping(e){xr.store.isEnabled||B.dispatch({type:"TYPING_START_LOCAL",channelId:e})},start:()=>wo("SilentTyping",x5),stop:()=>nn("SilentTyping")})});var VM,ty,eI=g(()=>{"use strict";a();$();Ut();P();I();T();VM=N({showDates:{type:3,description:"Show dates on friend requests",default:!1,restartNeeded:!0}}),ty=y({name:"SortFriendRequests",authors:[m.Megu],description:"Sorts friend requests by date of receipt",settings:VM,patches:[{find:"getRelationshipCounts(){",replacement:{match:/\.sortBy\(\i=>\i\.comparator\)/,replace:".sortBy((row) => $self.sortList(row))"}},{find:".Messages.FRIEND_REQUEST_CANCEL",replacement:{predicate:()=>VM.store.showDates,match:/subText:(\i)(?=,className:\i\.userInfo}\))(?<=user:(\i).+?)/,replace:(e,t,o)=>`subText:$self.makeSubtext(${t},${o})`}}],sortList(e){return e.type===3||e.type===4?-this.getSince(e.user):e.comparator},getSince(e){return new Date(it.getSince(e.id))},makeSubtext(e,t){let o=this.getSince(t);return n(fe,{flexDirection:"row",style:{gap:0,flexWrap:"wrap",lineHeight:"0.9rem"}},n("span",null,e),!isNaN(o.getTime())&&n("span",null,"Received \u2014 ",o.toDateString()))}})});var tI,oI=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/spotifyControls/hoverOnly.css",{name:"src/plugins/spotifyControls/hoverOnly.css",source:`.vc-spotify-button-row { - height: 0; - opacity: 0; - pointer-events: none; - transition: 0.2s; - transition-property: height; -} - -#vc-spotify-player:hover .vc-spotify-button-row { - opacity: 1; - height: 32px; - pointer-events: auto; - - /* only transition opacity on show to prevent clipping */ - transition-property: height, opacity; -} -`,classNames:{},dom:null});tI="src/plugins/spotifyControls/hoverOnly.css"});var nI=g(()=>{});var Ve,rI=g(()=>{"use strict";a();$();H();T();Ve=go(()=>{let{Store:e}=xs,t=Lr("getActiveSocketAndDevice"),o=Lr("SpotifyAPI"),r="https://api.spotify.com/v1/me/player";class i extends e{mPosition=0;start=0;track=null;device=null;isPlaying=!1;repeat="off";shuffle=!1;volume=0;isSettingPosition=!1;openExternal(c){let u=G.plugins.SpotifyControls.useSpotifyUris||Vencord.Plugins.isPluginEnabled("OpenInApp")?"spotify:"+c.replaceAll("/",(p,d)=>d===0?"":":"):"https://open.spotify.com"+c;VencordNative.native.openExternal(u)}get position(){let c=this.mPosition;return this.isPlaying&&(c+=Date.now()-this.start),c}set position(c){this.mPosition=c,this.start=Date.now()}prev(){this.req("post","/previous")}next(){this.req("post","/next")}setVolume(c){this.req("put","/volume",{query:{volume_percent:Math.round(c)}}).then(()=>{this.volume=c,this.emitChange()})}setPlaying(c){this.req("put",c?"/play":"/pause")}setRepeat(c){this.req("put","/repeat",{query:{state:c}})}setShuffle(c){this.req("put","/shuffle",{query:{state:c}}).then(()=>{this.shuffle=c,this.emitChange()})}seek(c){return this.isSettingPosition?Promise.resolve():(this.isSettingPosition=!0,this.req("put","/seek",{query:{position_ms:Math.round(c)}}).catch(u=>{console.error("[VencordSpotifyControls] Failed to seek",u),this.isSettingPosition=!1}))}req(c,u,p={}){this.device?.is_active&&((p.query??={}).device_id=this.device.id);let{socket:d}=t.getActiveSocketAndDevice();return o.SpotifyAPI[c](d.accountId,d.accessToken,{url:r+u,...p})}}let s=new i(B,{SPOTIFY_PLAYER_STATE(l){s.track=l.track,s.device=l.device??null,s.isPlaying=l.isPlaying??!1,s.volume=l.volumePercent??0,s.repeat=l.actual_repeat||"off",s.position=l.position??0,s.isSettingPosition=!1,s.emitChange()},SPOTIFY_SET_DEVICES({devices:l}){s.device=l.find(c=>c.is_active)??l[0]??null,s.emitChange()}});return s})});function oy(e){let t=e/1e3/60,o=Math.floor(t),r=Math.floor((t-o)*60);return`${o.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`}function ds(e,t){return()=>n("svg",{className:Q(rt("button-icon"),rt(t)),height:"24",width:"24",viewBox:"0 0 24 24",fill:"currentColor","aria-label":t,focusable:!1},n("path",{d:e}))}function $a(e){return n("button",{className:rt("button"),...e},e.children)}function k5({name:e,path:t}){let o=`spotify-copy-${e}`,r=`spotify-open-${e}`;return n(L.Menu,{navId:`spotify-${e}-menu`,onClose:()=>B.dispatch({type:"CONTEXT_MENU_CLOSE"}),"aria-label":`Spotify ${e} Menu`},n(L.MenuItem,{key:o,id:o,label:`Copy ${e} Link`,action:()=>Ao("https://open.spotify.com"+t),icon:Ei}),n(L.MenuItem,{key:r,id:r,label:`Open ${e} in Spotify`,action:()=>Ve.openExternal(t),icon:Xr}))}function N5(e,t){return o=>Yt.openContextMenu(o,()=>n(k5,{name:e,path:t}))}function D5(){let[e,t,o]=Be([Ve],()=>[Ve.isPlaying,Ve.shuffle,Ve.repeat]),[r,i]=(()=>{switch(o){case"off":return["context","repeat-off"];case"context":return["track","repeat-context"];case"track":return["off","repeat-track"];default:throw new Error(`Invalid repeat state ${o}`)}})();return n(fe,{className:rt("button-row"),style:{gap:0}},n($a,{className:Q(rt("button"),rt(t?"shuffle-on":"shuffle-off")),onClick:()=>Ve.setShuffle(!t)},n(R5,null)),n($a,{onClick:()=>Ve.prev()},n(P5,null)),n($a,{onClick:()=>Ve.setPlaying(!e)},e?n(I5,null):n(M5,null)),n($a,{onClick:()=>Ve.next()},n(A5,null)),n($a,{className:Q(rt("button"),rt(i)),onClick:()=>Ve.setRepeat(r),style:{position:"relative"}},o==="track"&&n("span",{className:rt("repeat-1")},"1"),n(C5,null)))}function E5(){let{duration:e}=Ve.track,[t,o,r]=Be([Ve],()=>[Ve.mPosition,Ve.isSettingPosition,Ve.isPlaying]),[i,s]=W(t);return se(()=>{if(r&&!o){s(Ve.position);let l=setInterval(()=>{s(c=>c+1e3)},1e3);return()=>clearInterval(l)}},[t,o,r]),n("div",{id:rt("progress-bar")},n(S.FormText,{variant:"text-xs/medium",className:rt("progress-time")+" "+rt("time-left"),"aria-label":"Progress"},oy(i)),n(L.MenuSliderControl,{minValue:0,maxValue:e,value:i,onChange:l=>{o||(s(l),L5(l))},renderValue:oy}),n(S.FormText,{variant:"text-xs/medium",className:rt("progress-time")+" "+rt("time-right"),"aria-label":"Total Duration"},oy(e)))}function O5({track:e}){let t=Be([Ve],()=>Ve.volume);return n(L.Menu,{navId:"spotify-album-menu",onClose:()=>B.dispatch({type:"CONTEXT_MENU_CLOSE"}),"aria-label":"Spotify Album Menu"},n(L.MenuItem,{key:"open-album",id:"open-album",label:"Open Album",action:()=>Ve.openExternal(`/album/${e.album.id}`),icon:Xr}),n(L.MenuItem,{key:"view-cover",id:"view-cover",label:"View Album Cover",action:()=>tn(e.album.image.url),icon:Jr}),n(L.MenuControlItem,{id:"spotify-volume",key:"spotify-volume",label:"Volume",control:(o,r)=>n(L.MenuSliderControl,{...o,ref:r,value:t,minValue:0,maxValue:100,onChange:lo(i=>Ve.setVolume(i))})}))}function ny(e,t,o){return t?{role:"link",onClick:()=>Ve.openExternal(o),onContextMenu:N5(e,o)}:{}}function _5({track:e}){let t=e?.album?.image,[o,r]=W(!1),i=n(f,null,t&&n("img",{id:rt("album-image"),src:t.url,alt:"Album Image",onClick:()=>r(!o),onContextMenu:s=>{Yt.openContextMenu(s,()=>n(O5,{track:e}))}}));return o&&t?n("div",{id:rt("album-expanded-wrapper")},i):n("div",{id:rt("info-wrapper")},i,n("div",{id:rt("titles")},n(S.FormText,{variant:"text-sm/semibold",id:rt("song-title"),className:rt("ellipoverflow"),title:e.name,...ny("Song",e.id,`/track/${e.id}`)},e.name),e.artists.some(s=>s.name)&&n(S.FormText,{variant:"text-sm/normal",className:rt("ellipoverflow")},"by\xA0",e.artists.map((s,l)=>n(U.Fragment,{key:s.name},n("span",{className:rt("artist"),style:{fontSize:"inherit"},title:s.name,...ny("Artist",s.id,`/artist/${s.id}`)},s.name),l!==e.artists.length-1&&n("span",{className:rt("comma")},", ")))),e.album.name&&n(S.FormText,{variant:"text-sm/normal",className:rt("ellipoverflow")},"on\xA0",n("span",{id:rt("album-title"),className:rt("album"),style:{fontSize:"inherit"},title:e.album.name,...ny("Album",e.album.id,`/album/${e.album.id}`)},e.album.name))))}function iI(){let e=Be([Ve],()=>Ve.track,null,(l,c)=>l?.id?l.id===c?.id:l?.name===c?.name),t=Be([Ve],()=>Ve.device,null,(l,c)=>l?.id===c?.id),o=Be([Ve],()=>Ve.isPlaying),[r,i]=W(!1);if(U.useEffect(()=>{if(i(!1),!o){let l=setTimeout(()=>i(!0),3e5);return()=>clearTimeout(l)}},[o]),!e||!t?.is_active||r)return null;let s={"--vc-spotify-track-image":`url(${e?.album?.image?.url||""})`};return n(_,{fallback:()=>n("div",{className:"vc-spotify-fallback"},n("p",null,"Failed to render Spotify Modal :("),n("p",null,"Check the console for errors"))},n("div",{id:rt("player"),style:s},n(_5,{track:e}),n(E5,null),n(D5,null)))}var rt,M5,I5,P5,A5,C5,R5,L5,sI=g(()=>{"use strict";a();nI();le();Ut();It();zr();mt();we();T();rI();rt=e=>`vc-spotify-${e}`;M5=ds("M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18c.62-.39.62-1.29 0-1.69L9.54 5.98C8.87 5.55 8 6.03 8 6.82z","play"),I5=ds("M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z","pause"),P5=ds("M7 6c.55 0 1 .45 1 1v10c0 .55-.45 1-1 1s-1-.45-1-1V7c0-.55.45-1 1-1zm3.66 6.82l5.77 4.07c.66.47 1.58-.01 1.58-.82V7.93c0-.81-.91-1.28-1.58-.82l-5.77 4.07c-.57.4-.57 1.24 0 1.64z","previous"),A5=ds("M7.58 16.89l5.77-4.07c.56-.4.56-1.24 0-1.63L7.58 7.11C6.91 6.65 6 7.12 6 7.93v8.14c0 .81.91 1.28 1.58.82zM16 7v10c0 .55.45 1 1 1s1-.45 1-1V7c0-.55-.45-1-1-1s-1 .45-1 1z","next"),C5=ds("M7 7h10v1.79c0 .45.54.67.85.35l2.79-2.79c.2-.2.2-.51 0-.71l-2.79-2.79c-.31-.31-.85-.09-.85.36V5H6c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1V7zm10 10H7v-1.79c0-.45-.54-.67-.85-.35l-2.79 2.79c-.2.2-.2.51 0 .71l2.79 2.79c.31.31.85.09.85-.36V19h11c.55 0 1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1v3z","repeat"),R5=ds("M10.59 9.17L6.12 4.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41l4.46 4.46 1.42-1.4zm4.76-4.32l1.19 1.19L4.7 17.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L17.96 7.46l1.19 1.19c.31.31.85.09.85-.36V4.5c0-.28-.22-.5-.5-.5h-3.79c-.45 0-.67.54-.36.85zm-.52 8.56l-1.41 1.41 3.13 3.13-1.2 1.2c-.31.31-.09.85.36.85h3.79c.28 0 .5-.22.5-.5v-3.79c0-.45-.54-.67-.85-.35l-1.19 1.19-3.13-3.14z","shuffle");L5=lo(e=>{Ve.seek(e)})});function aI(e){(e?Nt:Xt)(tI)}var ry,lI=g(()=>{"use strict";a();$();Qe();P();I();oI();sI();ry=y({name:"SpotifyControls",description:"Adds a Spotify player above the account panel",authors:[m.Ven,m.afn,m.KraXen72,m.Av32000],options:{hoverControls:{description:"Show controls on hover",type:3,default:!1,onChange:e=>aI(e)},useSpotifyUris:{type:3,description:"Open Spotify URIs instead of Spotify URLs. Will only work if you have Spotify installed and might not work on all platforms",default:!1}},patches:[{find:"showTaglessAccountPanel:",replacement:{match:/return ?(.{0,30}\(.{1,3},\{[^}]+?,showTaglessAccountPanel:.+?\}\))/,replace:"return [$self.renderPlayer(),$1]"}},{find:".PLAYER_DEVICES",replacement:[{match:/get:(\i)\.bind\(null,(\i\.\i)\.get\)/,replace:"post:$1.bind(null,$2.post),$&"},{match:/202===\i\.status/,replace:"false"}]},{find:'repeat:"off"!==',replacement:{match:/repeat:"off"!==(.{1,3}),/,replace:"actual_repeat:$1,$&"}}],start:()=>aI(G.plugins.SpotifyControls.hoverControls),renderPlayer:()=>n(iI,null)})});var iy,sy,cI=g(()=>{"use strict";a();$();P();I();iy=N({noSpotifyAutoPause:{description:"Disable Spotify auto-pause",type:3,default:!0,restartNeeded:!0},keepSpotifyActivityOnIdle:{description:"Keep Spotify activity playing when idling",type:3,default:!1,restartNeeded:!0}}),sy=y({name:"SpotifyCrack",description:"Free listen along, no auto-pausing in voice chat, and allows activity to continue playing when idling",authors:[m.Cyn,m.Nuckyz],settings:iy,patches:[{find:'dispatch({type:"SPOTIFY_PROFILE_UPDATE"',replacement:{match:/SPOTIFY_PROFILE_UPDATE.+?isPremium:(?="premium"===(\i)\.body\.product)/,replace:(e,t)=>`${e}(${t}.body.product="premium")&&`}},{find:'.displayName="SpotifyStore"',replacement:[{predicate:()=>iy.store.noSpotifyAutoPause,match:/(?<=function \i\(\){)(?=.{0,200}SPOTIFY_AUTO_PAUSED\))/,replace:"return;"},{predicate:()=>iy.store.keepSpotifyActivityOnIdle,match:/(?<=shouldShowActivity\(\){.{0,50})&&!\i\.\i\.isIdle\(\)/,replace:""}]}]})});function ly(e,t){t={invalidEmojis:[],tts:!1,validNonShortcutEmojis:[],...t};let o=B5.getPendingReply(e);ao.sendMessage(e,t,void 0,ao.getSendMessageOptionsForReply(o)).then(()=>{o&&B.dispatch({type:"DELETE_PENDING_REPLY",channelId:e})})}var ay,B5,cy,uI=g(()=>{"use strict";a();uo();P();I();H();T();ay=x("getPlayerState"),B5=x("getPendingReply");cy=y({name:"SpotifyShareCommands",description:"Share your current Spotify track, album or artist via slash command (/track, /album, /artist)",authors:[m.katlyn],dependencies:["CommandsAPI"],commands:[{name:"track",description:"Send your current Spotify track to chat",inputType:0,options:[],execute:(e,t)=>{let o=ay.getTrack();if(o===null){ge(t.channel.id,{content:"You're not listening to any music."});return}ly(t.channel.id,{content:`https://open.spotify.com/track/${o.id}`})}},{name:"album",description:"Send your current Spotify album to chat",inputType:0,options:[],execute:(e,t)=>{let o=ay.getTrack();if(o===null){ge(t.channel.id,{content:"You're not listening to any music."});return}ly(t.channel.id,{content:`https://open.spotify.com/album/${o.album.id}`})}},{name:"artist",description:"Send your current Spotify artist to chat",inputType:0,options:[],execute:(e,t)=>{let o=ay.getTrack();if(o===null){ge(t.channel.id,{content:"You're not listening to any music."});return}ly(t.channel.id,{content:o.artists[0].external_urls.spotify})}}]})});var pI={};qe(pI,{default:()=>H5});function F5({emoji:e,prefix:t,log:o,delta:r,instance:i}){return n(U.Fragment,null,n("span",null,i.sinceStart.toFixed(3),"s"),n("span",null,i.sinceLast.toFixed(3),"s"),n("span",null,r?.toFixed(0)??""),n("span",null,n("pre",null,e," ",t??" ",o)))}function U5({title:e,logs:t,traceEnd:o}){let r=t.find(l=>l.timestamp)?.timestamp??0,i=r,s=t.map(l=>{let c=l.timestamp??i,u=(c-r)/1e3,p=(c-i)/1e3;return i=c,{sinceStart:u,sinceLast:p}});return n(S.FormSection,{title:e,tag:"h1"},n("code",null,o&&n("div",{style:{color:"var(--header-primary)",marginBottom:5,userSelect:"text"}},"Trace ended at: ",new Date(o).toTimeString()),n("div",{style:{color:"var(--header-primary)",display:"grid",gridTemplateColumns:"repeat(3, auto) 1fr",gap:"2px 10px",userSelect:"text"}},n("span",null,"Start"),n("span",null,"Interval"),n("span",null,"Delta"),n("span",{style:{marginBottom:5}},"Event"),Ga.logs.map((l,c)=>n(F5,{key:c,...l,instance:s[c]})))))}function $5({trace:e}){let t=e.split(` -`);return n(S.FormSection,{title:"Server Trace",tag:"h2"},n("code",null,n(fe,{flexDirection:"column",style:{color:"var(--header-primary)",gap:5,userSelect:"text"}},t.map(o=>n("span",null,o)))))}function G5(){if(!Ga?.logs)return n("div",null,"Loading...");let e=Ga.logGroups.find(t=>t.serverTrace)?.serverTrace;return n(U.Fragment,null,n(U5,{title:"Startup Timings",logs:Ga.logs,traceEnd:Ga.endTime_}),n("div",{style:{marginTop:5}},"\xA0"),e&&n($5,{trace:e}))}var Ga,H5,dI=g(()=>{"use strict";a();le();Ut();H();T();Ga=x("markWithDelta","markAndLog","markAt");H5=_.wrap(G5)});var uy,mI=g(()=>{"use strict";a();P();lt();I();uy=y({name:"StartupTimings",description:"Adds Startup Timings to the Settings menu",authors:[m.Megu],patches:[{find:"UserSettingsSections.PAYMENT_FLOW_MODAL_TEST_PAGE,",replacement:{match:/{section:\i\.UserSettingsSections\.PAYMENT_FLOW_MODAL_TEST_PAGE/,replace:'{section:"StartupTimings",label:"Startup Timings",element:$self.StartupTimingPage},$&'}}],StartupTimingPage:bt(()=>(dI(),Xn(pI)).default)})});var du,py,fI=g(()=>{"use strict";a();$();P();I();T();du=N({superReactByDefault:{type:3,description:"Reaction picker will default to Super Reactions",default:!0},unlimitedSuperReactionPlaying:{type:3,description:"Remove the limit on Super Reactions playing at once",default:!1},superReactionPlayingLimit:{description:"Max Super Reactions to play at once",type:5,default:20,markers:[5,10,20,40,60,80,100],stickToMarkers:!0}},{superReactionPlayingLimit:{disabled(){return this.store.unlimitedSuperReactionPlaying}}}),py=y({name:"SuperReactionTweaks",description:"Customize the limit of Super Reactions playing at once, and super react by default",authors:[m.FieryFlames,m.ant0n],patches:[{find:",BURST_REACTION_EFFECT_PLAY",replacement:{match:/(?<=BURST_REACTION_EFFECT_PLAY:\i=>{.{50,100})(\i\(\i,\i\))>=\d+/,replace:"!$self.shouldPlayBurstReaction($1)"}},{find:".trackEmojiSearchEmpty,200",replacement:{match:/(\.trackEmojiSearchEmpty,200(?=.+?isBurstReaction:(\i).+?(\i===\i\.EmojiIntention.REACTION)).+?\[\2,\i\]=\i\.useState\().+?\)/,replace:(e,t,o,r)=>`${t}$self.shouldSuperReactByDefault&&${r})`}}],settings:du,shouldPlayBurstReaction(e){return!!(du.store.unlimitedSuperReactionPlaying||e<=du.store.superReactionPlayingLimit)},get shouldSuperReactByDefault(){return du.store.superReactByDefault&&E.getCurrentUser().premiumType!=null}})});function SI(e){let t=e.match(/^(\/)?(.+?)(?:\/([gimsuy]*))?$/);return t?new RegExp(t[2],t[3]?.split("").filter((o,r,i)=>i.indexOf(o)===r).join("")??"g"):new RegExp(e)}function j5(e){try{return SI(e),null}catch(t){return n("span",{style:{color:"var(--text-danger)"}},String(t))}}function dy({initialValue:e,onChange:t,placeholder:o}){let[r,i]=W(e);return n(Je,{placeholder:o,value:r,onChange:i,spellCheck:!1,onBlur:()=>r!==e&&t(r)})}function gI({title:e,rulesArray:t,rulesKey:o,update:r}){let i=e==="Using Regex";async function s(c){c!==t.length-1&&(t.splice(c,1),await yt.set(o,t),r())}async function l(c,u,p){u===t.length-1&&t.push(vI()),t[u][p]=c,t[u].find===""&&t[u].replace===""&&t[u].onlyIfIncludes===""&&u!==t.length-1&&t.splice(u,1),await yt.set(o,t),r()}return n(f,null,n(S.FormTitle,{tag:"h4"},e),n(fe,{flexDirection:"column",style:{gap:"0.5em"}},t.map((c,u)=>n(U.Fragment,{key:`${c.find}-${u}`},n(fe,{flexDirection:"row",style:{gap:0}},n(fe,{flexDirection:"row",style:{flexGrow:1,gap:"0.5em"}},n(dy,{placeholder:"Find",initialValue:c.find,onChange:p=>l(p,u,"find")}),n(dy,{placeholder:"Replace",initialValue:c.replace,onChange:p=>l(p,u,"replace")}),n(dy,{placeholder:"Only if includes",initialValue:c.onlyIfIncludes,onChange:p=>l(p,u,"onlyIfIncludes")})),n(k,{size:k.Sizes.MIN,onClick:()=>s(u),style:{background:"none",color:"var(--status-danger)",...u===t.length-1?{visibility:"hidden",pointerEvents:"none"}:{}}},n(Oi,null))),i&&j5(c.find)))))}function W5(){let[e,t]=W("");return n(f,null,n(S.FormTitle,{tag:"h4"},"Test Rules"),n(Je,{placeholder:"Type a message",onChange:t}),n(Je,{placeholder:"Message with rules applied",editable:!1,value:bI(e)}))}function bI(e){if(e.length===0)return e;if(fu)for(let t of fu)!t.find||t.onlyIfIncludes&&!e.includes(t.onlyIfIncludes)||(e=` ${e} `.replaceAll(t.find,t.replace.replaceAll("\\n",` -`)).replace(/^\s|\s$/g,""));if(gu){for(let t of gu)if(!!t.find&&!(t.onlyIfIncludes&&!e.includes(t.onlyIfIncludes)))try{let o=SI(t.find);e=e.replace(o,t.replace.replaceAll("\\n",` -`))}catch{new oe("TextReplace").error(`Invalid regex: ${t.find}`)}}return e=e.trim(),e}var hI,yI,vI,mu,fu,gu,z5,q5,my,TI=g(()=>{"use strict";a();ei();gn();$();Ut();It();P();Ke();lt();I();T();hI="TextReplace_rulesString",yI="TextReplace_rulesRegex",vI=()=>({find:"",replace:"",onlyIfIncludes:""}),mu=()=>[vI()],fu=mu(),gu=mu(),z5=N({replace:{type:6,description:"",component:()=>{let e=Co();return n(f,null,n(gI,{title:"Using String",rulesArray:fu,rulesKey:hI,update:e}),n(gI,{title:"Using Regex",rulesArray:gu,rulesKey:yI,update:e}),n(W5,null))}}});q5="1102784112584040479",my=y({name:"TextReplace",description:"Replace text in your messages. You can find pre-made rules in the #textreplace-rules channel in Vencord's Server",authors:[m.AutumnVN,m.TheKodeToad],dependencies:["MessageEventsAPI"],settings:z5,async start(){fu=await yt.get(hI)??mu(),gu=await yt.get(yI)??mu(),this.preSend=Vt((e,t)=>{e!==q5&&(t.content=bI(t.content))})},stop(){eo(this.preSend)}})});var fy,wI=g(()=>{"use strict";a();P();I();T();fy=y({name:"ThemeAttributes",description:"Adds data attributes to various elements for theming purposes",authors:[m.Ven],patches:[{find:".tabBarRef",replacement:{match:/style:this\.getStyle\(\),role:"tab"/,replace:"$&,'data-tab-id':this.props.id"}},{find:".messageListItem",replacement:{match:/\.messageListItem(?=,"aria)/,replace:"$&,...$self.getMessageProps(arguments[0])"}}],getMessageProps(e){let t=e.message?.author?.id;return{"data-author-id":t,"data-is-self":t&&t===E.getCurrentUser()?.id}}})});var gy,xI=g(()=>{"use strict";a();P();I();gy=y({name:"TimeBarAllActivities",description:"Adds the Spotify time bar to all activities if they have start and end timestamps",authors:[m.fawn],patches:[{find:"}renderTimeBar(",replacement:{match:/renderTimeBar\((.{1,3})\){.{0,50}?let/,replace:"renderTimeBar($1){let"}}]})});var MI=g(()=>{});var Dt,Ha=g(()=>{"use strict";a();$();I();Dt=N({receivedInput:{type:0,description:"Input language for received messages",default:"auto",hidden:!0},receivedOutput:{type:0,description:"Output language for received messages",default:"en",hidden:!0},sentInput:{type:0,description:"Input language for sent messages",default:"auto",hidden:!0},sentOutput:{type:0,description:"Output language for sent messages",default:"en",hidden:!0},autoTranslate:{type:3,description:"Automatically translate your messages before sending. You can also shift/right click the translate button to toggle this",default:!1}}).withPrivateSettings()});var hu,hy=g(()=>{"use strict";a();hu={auto:"Detect language",af:"Afrikaans",sq:"Albanian",am:"Amharic",ar:"Arabic",hy:"Armenian",as:"Assamese",ay:"Aymara",az:"Azerbaijani",bm:"Bambara",eu:"Basque",be:"Belarusian",bn:"Bengali",bho:"Bhojpuri",bs:"Bosnian",bg:"Bulgarian",ca:"Catalan",ceb:"Cebuano",ny:"Chichewa","zh-CN":"Chinese (Simplified)","zh-TW":"Chinese (Traditional)",co:"Corsican",hr:"Croatian",cs:"Czech",da:"Danish",dv:"Dhivehi",doi:"Dogri",nl:"Dutch",en:"English",eo:"Esperanto",et:"Estonian",ee:"Ewe",tl:"Filipino",fi:"Finnish",fr:"French",fy:"Frisian",gl:"Galician",ka:"Georgian",de:"German",el:"Greek",gn:"Guarani",gu:"Gujarati",ht:"Haitian Creole",ha:"Hausa",haw:"Hawaiian",iw:"Hebrew",hi:"Hindi",hmn:"Hmong",hu:"Hungarian",is:"Icelandic",ig:"Igbo",ilo:"Ilocano",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese",jw:"Javanese",kn:"Kannada",kk:"Kazakh",km:"Khmer",rw:"Kinyarwanda",gom:"Konkani",ko:"Korean",kri:"Krio",ku:"Kurdish (Kurmanji)",ckb:"Kurdish (Sorani)",ky:"Kyrgyz",lo:"Lao",la:"Latin",lv:"Latvian",ln:"Lingala",lt:"Lithuanian",lg:"Luganda",lb:"Luxembourgish",mk:"Macedonian",mai:"Maithili",mg:"Malagasy",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi","mni-Mtei":"Meiteilon (Manipuri)",lus:"Mizo",mn:"Mongolian",my:"Myanmar (Burmese)",ne:"Nepali",no:"Norwegian",or:"Odia (Oriya)",om:"Oromo",ps:"Pashto",fa:"Persian",pl:"Polish",pt:"Portuguese",pa:"Punjabi",qu:"Quechua",ro:"Romanian",ru:"Russian",sm:"Samoan",sa:"Sanskrit",gd:"Scots Gaelic",nso:"Sepedi",sr:"Serbian",st:"Sesotho",sn:"Shona",sd:"Sindhi",si:"Sinhala",sk:"Slovak",sl:"Slovenian",so:"Somali",es:"Spanish",su:"Sundanese",sw:"Swahili",sv:"Swedish",tg:"Tajik",ta:"Tamil",tt:"Tatar",te:"Telugu",th:"Thai",ti:"Tigrinya",ts:"Tsonga",tr:"Turkish",tk:"Turkmen",ak:"Twi",uk:"Ukrainian",ur:"Urdu",ug:"Uyghur",uz:"Uzbek",vi:"Vietnamese",cy:"Welsh",xh:"Xhosa",yi:"Yiddish",yo:"Yoruba",zu:"Zulu"}});async function za(e,t){let o=Dt.store[e+"Input"],r=Dt.store[e+"Output"],i="https://translate.googleapis.com/translate_a/single?"+new URLSearchParams({client:"gtx",sl:o,tl:r,dt:"t",dj:"1",source:"input",q:t}),s=await fetch(i);if(!s.ok)throw new Error(`Failed to translate "${t}" (${o} -> ${r}) -${s.status} ${s.statusText}`);let{src:l,sentences:c}=await s.json();return{src:l,text:c.map(u=>u?.trans).filter(Boolean).join("")}}var qn,ja=g(()=>{"use strict";a();Qe();Ha();qn=ve("vc-trans-")});function Y5({settingsKey:e,includeAuto:t}){let o=Dt.use([e])[e],r=Rt(()=>{let i=Object.entries(hu).map(([s,l])=>({value:s,label:l}));return t||i.shift(),i},[]);return n("section",{className:j.bottom16},n(S.FormTitle,{tag:"h3"},Dt.def[e].description),n(il,{options:r,value:r.find(i=>i.value===o),placeholder:"Select a language",maxVisibleItems:5,closeOnSelect:!0,onChange:i=>Dt.store[e]=i}))}function Z5(){let e=Dt.use(["autoTranslate"]).autoTranslate;return n(wt,{value:e,onChange:t=>Dt.store.autoTranslate=t,note:Dt.def.autoTranslate.description,hideBorder:!0},"Auto Translate")}function II({rootProps:e}){return n(ye,{...e},n(Le,{className:qn("modal-header")},n(S.FormTitle,{tag:"h2"},"Translate"),n(pt,{onClick:e.onClose})),n(ke,{className:qn("modal-content")},K5.map(t=>n(Y5,{key:t,settingsKey:t,includeAuto:t.endsWith("Input")})),n(S.FormDivider,{className:j.bottom16}),n(Z5,null)))}var K5,PI=g(()=>{"use strict";a();ot();Ze();T();hy();Ha();ja();K5=["receivedInput","receivedOutput","sentInput","sentOutput"]});function ms({height:e=24,width:t=24,className:o}){return n("svg",{viewBox:"0 96 960 960",height:e,width:t,className:Q(qn("icon"),o)},n("path",{fill:"currentColor",d:"m475 976 181-480h82l186 480h-87l-41-126H604l-47 126h-82Zm151-196h142l-70-194h-2l-70 194Zm-466 76-55-55 204-204q-38-44-67.5-88.5T190 416h87q17 33 37.5 62.5T361 539q45-47 75-97.5T487 336H40v-80h280v-80h80v80h280v80H567q-22 69-58.5 135.5T419 598l98 99-30 81-127-122-200 200Z"}))}var AI,yy=g(()=>{"use strict";a();En();ot();we();Ze();T();Ha();PI();ja();AI=({isMainChat:e})=>{let{autoTranslate:t}=Dt.use(["autoTranslate"]);if(!e)return null;let o=()=>{let r=!t;Dt.store.autoTranslate=r,r&&Dt.store.showAutoTranslateAlert!==!1&&et.show({title:"Vencord Auto-Translate Enabled",body:n(f,null,n(S.FormText,null,"You just enabled auto translate (by right clicking the Translate icon). Any message you send will automatically be translated before being sent."),n(S.FormText,{className:j.top16},"If this was an accident, disable it again, or it will change your message content before sending.")),cancelText:"Disable Auto-Translate",confirmText:"Got it",secondaryConfirmText:"Don't show again",onConfirmSecondary:()=>Dt.store.showAutoTranslateAlert=!1,onCancel:()=>Dt.store.autoTranslate=!1})};return n(xo,{tooltip:"Open Translate Modal",onClick:r=>{if(r.shiftKey)return o();de(i=>n(II,{rootProps:i}))},onContextMenu:()=>o(),buttonProps:{"aria-haspopup":"dialog"}},n(ms,{className:qn({"auto-translate":t,"chat-button":!0})}))}});function Sy(e,t){vy.get(e)(t)}function X5({onDismiss:e}){return n("button",{onClick:e,className:qn("dismiss")},"Dismiss")}function CI({message:e}){let[t,o]=W();return se(()=>{if(!e.vencordEmbeddedBy)return vy.set(e.id,o),()=>void vy.delete(e.id)},[]),t?n("span",{className:qn("accessory")},n(ms,{width:16,height:16}),Pe.parse(t.text)," ","(translated from ",hu[t.src]??t.src," - ",n(X5,{onDismiss:()=>o(void 0)}),")"):null}var vy,RI=g(()=>{"use strict";a();T();hy();yy();ja();vy=new Map});var J5,by,kI=g(()=>{"use strict";a();MI();En();Eo();Tc();gn();li();P();I();T();Ha();yy();RI();ja();J5=(e,{message:t})=>{if(!t.content)return;let o=ut("copy-text",e);!o||o.splice(o.findIndex(r=>r?.props?.id==="copy-text")+1,0,n(L.MenuItem,{id:"vc-trans",label:"Translate",icon:ms,action:async()=>{let r=await za("received",t.content);Sy(t.id,r)}}))},by=y({name:"Translate",description:"Translate messages with Google Translate",authors:[m.Ven],dependencies:["MessageAccessoriesAPI","MessagePopoverAPI","MessageEventsAPI","ChatInputButtonAPI"],settings:Dt,contextMenus:{message:J5},translate:za,start(){ya("vc-translation",e=>n(CI,{message:e.message})),wo("vc-translate",AI),on("vc-translate",e=>e.content?{label:"Translate",icon:ms,message:e,channel:ee.getChannel(e.channel_id),onClick:async()=>{let t=await za("received",e.content);Sy(e.id,t)}}:null),this.preSend=Vt(async(e,t)=>{!Dt.store.autoTranslate||!t.content||(t.content=(await za("sent",t.content)).text)})},stop(){eo(this.preSend),nn("vc-translate"),Oo("vc-translate"),xf("vc-translation")}})});function Ty({a:e,b:t,count:o}){return[n("strong",{key:"0"},e),", ",n("strong",{key:"1"},t),`, and ${o} others are typing...`]}var yu,Q5,wy,xy=g(()=>{"use strict";a();$();le();P();mt();I();T();yu=N({showAvatars:{type:3,default:!0,description:"Show avatars in the typing indicator"},showRoleColors:{type:3,default:!0,description:"Show role colors in the typing indicator"},alternativeFormatting:{type:3,default:!0,description:"Show a more useful message when several users are typing"}});Q5=_.wrap(function({user:e,guildId:t}){return n("strong",{role:"button",onClick:()=>{bo(e.id)},style:{display:"grid",gridAutoFlow:"column",gap:"4px",color:yu.store.showRoleColors?Ge.getMember(t,e.id)?.colorString:void 0,cursor:"pointer"}},yu.store.showAvatars&&n("div",{style:{marginTop:"4px"}},n(Ti,{size:"SIZE_16",src:e.getAvatarURL(t,128)})),Ge.getNick(t,e.id)||!t&&it.getNickname(e.id)||e.globalName||e.username)},{noop:!0}),wy=y({name:"TypingTweaks",description:"Show avatars and role colours in the typing indicator",authors:[m.zt],patches:[{find:"getCooldownTextStyle",replacement:{match:/(?<=children:\[(\i)\.length>0.{0,200}?"aria-atomic":!0,children:)\i/,replace:"$self.mutateChildren(this.props, $1, $&), style: $self.TYPING_TEXT_STYLE"}},{find:"getCooldownTextStyle",replacement:{match:/(?<=map\(\i=>)\i\.\i\.getName\(\i,this\.props\.channel\.id,(\i)\)/,replace:"$1"}},{find:"getCooldownTextStyle",replacement:{match:/(?<=(\i)\.length\?\i.\i\.Messages.THREE_USERS_TYPING\.format\({\i:(\i),(?:\i:)?(\i),\i:\i}\):)\i\.\i\.Messages\.SEVERAL_USERS_TYPING/,replace:(e,t,o,r)=>`$self.buildSeveralUsers({ a: ${o}, b: ${r}, count: ${t}.length - 2 })`},predicate:()=>yu.store.alternativeFormatting}],settings:yu,TYPING_TEXT_STYLE:{display:"grid",gridAutoFlow:"column",gridGap:"0.25em"},buildSeveralUsers:Ty,mutateChildren(e,t,o){if(!Array.isArray(o))return o;let r=0;return o.map(i=>i.type==="strong"?n(Q5,{...e,user:t[r++]}):i)}})});function Mr(e,t){let o=E.getUser(t);return Ge.getNick(e,t)??o.globalName??o.username}function t3({channelId:e}){let t=Be([NI],()=>({...NI.getTypingUsers(e)}),null,(c,u)=>{let p=Object.keys(c),d=Object.keys(u);return p.length===d.length&&d.every(h=>c[h]!=null)}),o=Be([Ie],()=>Ie.getChannelId()),r=ee.getChannel(e).guild_id;if(!vu.store.includeMutedChannels&&e3.isChannelMuted(r,e)||!vu.store.includeCurrentChannel&&o===e)return null;let i=E.getCurrentUser()?.id,s=Object.keys(t).filter(c=>c!==i&&!(it.isBlocked(c)&&!vu.store.includeBlockedUsers)),l;switch(s.length){case 0:break;case 1:{l=Ye.Messages.ONE_USER_TYPING.format({a:Mr(r,s[0])});break}case 2:{l=Ye.Messages.TWO_USERS_TYPING.format({a:Mr(r,s[0]),b:Mr(r,s[1])});break}case 3:{l=Ye.Messages.THREE_USERS_TYPING.format({a:Mr(r,s[0]),b:Mr(r,s[1]),c:Mr(r,s[2])});break}default:{l=G.plugins.TypingTweaks.enabled?Ty({a:Mr(r,s[0]),b:Mr(r,s[1]),count:s.length-2}):Ye.Messages.SEVERAL_USERS_TYPING;break}}return s.length>0?n(ne,{text:l},c=>n("div",{...c,style:{marginLeft:6,height:16,display:"flex",alignItems:"center",zIndex:0,cursor:"pointer"}},n(V5,{dotRadius:3,themed:!0}))):null}var V5,NI,e3,vu,My,DI=g(()=>{"use strict";a();$();le();P();I();H();T();xy();V5=Tn("Dots","AnimatedDots"),NI=Re("TypingStore"),e3=Re("UserGuildSettingsStore");vu=N({includeCurrentChannel:{type:3,description:"Whether to show the typing indicator for the currently selected channel",default:!0},includeMutedChannels:{type:3,description:"Whether to show the typing indicator for muted channels.",default:!1},includeBlockedUsers:{type:3,description:"Whether to show the typing indicator for blocked users.",default:!1}}),My=y({name:"TypingIndicator",description:"Adds an indicator if someone is typing on a channel.",authors:[m.Nuckyz,m.fawn],settings:vu,patches:[{find:"UNREAD_IMPORTANT:",replacement:{match:/\.name\),.{0,120}\.children.+?:null(?<=,channel:(\i).+?)/,replace:"$&,$self.TypingIndicator($1.id)"}},{find:"M11 9H4C2.89543 9 2 8.10457 2 7V1C2 0.447715 1.55228 0 1 0C0.447715 0 0 0.447715 0 1V7C0 9.20914 1.79086 11 4 11H11C11.5523 11 12 10.5523 12 10C12 9.44771 11.5523 9 11 9Z",replacement:{match:/mentionsCount:\i.+?null(?<=channel:(\i).+?)/,replace:"$&,$self.TypingIndicator($1.id)"}}],TypingIndicator:e=>n(_,{noop:!0},n(t3,{channelId:e}))})});var Iy,LI=g(()=>{"use strict";a();gn();P();I();Iy=y({name:"Unindent",description:"Trims leading indentation from codeblocks",authors:[m.Ven],dependencies:["MessageEventsAPI"],patches:[{find:"inQuote:",replacement:{match:/,content:([^,]+),inQuote/,replace:(e,t)=>`,content:Vencord.Plugins.plugins.Unindent.unindent(${t}),inQuote`}}],unindent(e){e=e.replace(/\t/g," ");let t=e.match(/^ *(?=\S)/gm)?.reduce((o,r)=>Math.min(o,r.length),1/0)??0;return t?e.replace(new RegExp(`^ {${t}}`,"gm"),""):e},unindentMsg(e){e.content=e.content.replace(/```(.|\n)*?```/g,t=>{let o=t.split(` -`);if(o.length<2)return t;let r="";return o[o.length-1]==="```"&&(r=o.pop()),`${o[0]} -${this.unindent(o.slice(1).join(` -`))} -${r}`})},start(){this.preSend=Vt((e,t)=>this.unindentMsg(t)),this.preEdit=ti((e,t,o)=>this.unindentMsg(o))},stop(){eo(this.preSend),oi(this.preEdit)}})});var Py,o3,Ay,EI=g(()=>{"use strict";a();Eo();It();P();I();T();Py=1<<2,o3=(e,{channel:t,message:{author:o,embeds:r,flags:i,id:s}})=>{let l=(i&Py)!==0;if(!l&&!r.length)return;let c=t.isPrivate()||!!(_e.getChannelPermissions({id:t.id})&me.EMBED_LINKS);if(o.id===E.getCurrentUser().id&&!c)return;let u=ut("delete",e),p=u?.findIndex(d=>d?.props?.id==="delete");!p||!u||u.splice(p-1,0,n(L.MenuItem,{id:"unsuppress-embeds",key:"unsuppress-embeds",label:l?"Unsuppress Embeds":"Suppress Embeds",color:l?void 0:"danger",icon:l?El:Ol,action:()=>_t.patch({url:`/channels/${t.id}/messages/${s}`,body:{flags:l?i&~Py:i|Py}})}))},Ay=y({name:"UnsuppressEmbeds",authors:[m.rad,m.HypedDomi],description:"Allows you to unsuppress embeds in messages",contextMenus:{message:o3}})});var OI,Cy,_I=g(()=>{"use strict";a();uo();_l();$();P();I();OI=N({resultsAmount:{type:1,description:"The amount of results you want to get (more gives better results, but is slower)",default:10}}),Cy=y({name:"UrbanDictionary",description:"Search for a word on Urban Dictionary via /urban slash command",authors:[m.jewdev],dependencies:["CommandsAPI"],settings:OI,commands:[{name:"urban",description:"Returns the definition of a word from Urban Dictionary",inputType:0,options:[{type:3,name:"word",description:"The word to search for on Urban Dictionary",required:!0}],execute:async(e,t)=>{try{let o=encodeURIComponent(e[0].value),{list:r}=await fetch(`https://api.urbandictionary.com/v0/define?term=${o}&per_page=${OI.store.resultsAmount}`).then(l=>l.json());if(!r.length)return void ge(t.channel.id,{content:"No results found."});let i=r.reduce((l,c)=>l.thumbs_up>c.thumbs_up?l:c),s=l=>l.replaceAll(`\r -`,` -`).replace(/([*>_`~\\])/gsi,"\\$1").replace(/\[(.+?)\]/g,(c,u)=>`[${u}](https://www.urbandictionary.com/define.php?term=${encodeURIComponent(u)} "Define '${u}' on Urban Dictionary")`).trim();return void ge(t.channel.id,{embeds:[{type:"rich",author:{name:`Uploaded by "${i.author}"`,url:`https://www.urbandictionary.com/author.php?author=${encodeURIComponent(i.author)}`},title:i.word,url:`https://www.urbandictionary.com/define.php?term=${encodeURIComponent(i.word)}`,description:s(i.definition),fields:[{name:"Example",value:s(i.example)},{name:"Want more definitions?",value:`Check out [more definitions](https://www.urbandictionary.com/define.php?term=${o} "Define "${e[0].value}" on Urban Dictionary") on Urban Dictionary.`}],color:16750848,footer:{text:`\u{1F44D} ${i.thumbs_up.toString()} | \u{1F44E} ${i.thumbs_down.toString()}`,icon_url:"https://www.urbandictionary.com/favicon.ico"},timestamp:new Date(i.written_on).toISOString()}]})}catch(o){ge(t.channel.id,{content:`Something went wrong: \`${o}\``})}}}]})});var BI=g(()=>{});var n3,r3,i3,FI,UI=g(()=>{"use strict";a();BI();H();T();n3=x("selectChannel","selectVoiceChannel"),r3=Go(".lastSection","children:"),i3=1n<<20n,FI=({channel:e,label:t,showHeader:o})=>n(r3,null,o&&n(S.FormTitle,{className:"vc-uvs-header"},"In a voice channel"),n(k,{className:"vc-uvs-button",color:k.Colors.TRANSPARENT,size:k.Sizes.SMALL,onClick:()=>{_e.can(i3,e)?n3.selectVoiceChannel(e.id):X.show({message:"Insufficient permissions to enter the channel.",id:"user-voice-show-insufficient-permissions",type:X.Type.FAILURE,options:{position:X.Position.BOTTOM}})}},t))});var s3,Ry,$I,ky,GI=g(()=>{"use strict";a();$();le();P();I();H();T();UI();s3=Re("VoiceStateStore"),Ry=N({showInUserProfileModal:{type:3,description:"Show a user's voice channel in their profile modal",default:!0},showVoiceChannelSectionHeader:{type:3,description:'Whether to show "IN A VOICE CHANNEL" above the join button',default:!0}}),$I=_.wrap(({user:e})=>{let{channelId:t}=s3.getVoiceStateForUser(e.id)??{};if(!t)return null;let o=ee.getChannel(t);if(!o)return null;let r=ae.getGuild(o.guild_id);if(!r)return null;let i=`${r.name} | ${o.name}`;return n(FI,{channel:o,label:i,showHeader:Ry.store.showVoiceChannelSectionHeader})}),ky=y({name:"UserVoiceShow",description:"Shows whether a User is currently in a voice channel somewhere in their profile",authors:[m.LordElias],settings:Ry,patchModal({user:e}){return Ry.store.showInUserProfileModal?n("div",{className:"vc-uvs-modal-margin"},n($I,{user:e})):null},patchPopout:({user:e})=>{let t=e.id===E.getCurrentUser().id;return n("div",{className:t?"vc-uvs-popout-margin-self":""},n($I,{user:e}))},patches:[{find:".popularApplicationCommandIds,",replacement:{match:/\(0,\i\.jsx\)\(\i\.\i,{user:\i,setNote/,replace:"$self.patchPopout(arguments[0]),$&"}},{find:".USER_PROFILE_MODAL",replacement:{match:/\.body.+?displayProfile:\i}\),/,replace:"$&$self.patchModal(arguments[0]),"}}]})});var HI,zI=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/usrbg/index.css",{name:"src/plugins/usrbg/index.css",source:`:is([class*="userProfile"], [class*="userPopout"]) [class*="bannerPremium"] { - background: center / cover no-repeat; -} - -[class*="NonPremium"]:has([class*="bannerPremium"]) [class*="avatarPositionNormal"], -[class*="PremiumWithoutBanner"]:has([class*="bannerPremium"]) [class*="avatarPositionPremiumNoBanner"] { - top: 76px; -} - -[style*="background-image"] [class*="background_"] { - background-color: transparent !important; -} -`,classNames:{},dom:null});HI="src/plugins/usrbg/index.css"});var a3,Kn,Su,Ny,jI=g(()=>{"use strict";a();$();Qe();To();P();I();zI();a3="https://raw.githubusercontent.com/AutumnVN/usrbg/main/usrbg.json",Kn={},Su=N({nitroFirst:{description:"Banner to use if both Nitro and USRBG banners are present",type:4,options:[{label:"Nitro banner",value:!0,default:!0},{label:"USRBG banner",value:!1}]},voiceBackground:{description:"Use USRBG banners as voice chat backgrounds",type:3,default:!0,restartNeeded:!0}}),Ny=y({name:"USRBG",description:"Displays user banners from USRBG, allowing anyone to get a banner without Nitro",authors:[m.AutumnVN,m.pylix,m.TheKodeToad],settings:Su,patches:[{find:".NITRO_BANNER,",replacement:[{match:/(\i)\.premiumType/,replace:"$self.premiumHook($1)||$&"},{match:/(?<=function \i\((\i)\)\{)(?=var.{30,50},bannerSrc:)/,replace:"$1.bannerSrc=$self.useBannerHook($1);"},{match:/\?\(0,\i\.jsx\)\(\i,{type:\i,shown/,replace:"&&$self.shouldShowBadge(arguments[0])$&"}]},{find:'"data-selenium-video-tile":',predicate:()=>Su.store.voiceBackground,replacement:[{match:/(?<=function\((\i),\i\)\{)(?=let.{20,40},style:)/,replace:"$1.style=$self.voiceBackgroundHook($1);"}]}],data:Kn,settingsAboutComponent:()=>n(je,{href:"https://github.com/AutumnVN/usrbg#how-to-request-your-own-usrbg-banner"},"CLICK HERE TO GET YOUR OWN BANNER"),voiceBackgroundHook({className:e,participantUserId:t}){if(e.includes("tile_")&&Kn[t])return{backgroundImage:`url(${Kn[t]})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}},useBannerHook({displayProfile:e,user:t}){if(!(e?.banner&&Su.store.nitroFirst)&&Kn[t.id])return Kn[t.id]},premiumHook({userId:e}){if(Kn[e])return 2},shouldShowBadge({displayProfile:e,user:t}){return e?.banner&&(!Kn[t.id]||Su.store.nitroFirst)},async start(){Nt(HI);let e=await fetch(a3);e.ok&&(Kn=await e.json(),this.data=Kn)}})});function l3({data:e,UserMention:t,RoleMention:o,parse:r,props:i}){let[s,l]=W(e.userId);if(s)return n(t,{className:"mention",userId:s,channelId:e.channelId,inlinePreview:i.noStyleAndInteraction,key:i.key});let c=r(e.content,i);return n(o,{...e,inlinePreview:i.formatInline},n("span",{onMouseEnter:()=>{let u=c?.[0]?.props?.children;if(typeof u!="string")return;let p=u.match(/<@!?(\d+)>/)?.[1];if(!p||bu.has(p))return;if(E.getUser(p))return l(p);let d=()=>{bu.add(p),WI.unshift(()=>Bt.getUser(p).then(()=>{l(p),bu.delete(p)}).catch(h=>{h?.status===429&&(WI.unshift(()=>Ko(1e3).then(d)),bu.delete(p))}).finally(()=>Ko(300)))};d()}},c))}var bu,WI,Dy,qI=g(()=>{"use strict";a();le();P();we();Wr();I();T();bu=new Set,WI=new vo(5);Dy=y({name:"ValidUser",description:"Fix mentions for unknown users showing up as '<@343383572805058560>' (hover over a mention to fix it)",authors:[m.Ven],tags:["MentionCacheFix"],patches:[{find:'className:"mention"',replacement:{match:/react(?=\(\i,\i,\i\).{0,50}return null==\i\?\(0,\i\.jsx\)\((\i\.\i),.+?jsx\)\((\i\.\i),\{className:"mention")/,replace:"react:(...args)=>$self.renderMention($1,$2,...args),originalReact"}}],renderMention(e,t,o,r,i){return n(_,{noop:!0},n(l3,{RoleMention:e,UserMention:t,data:o,parse:r,props:i}))}})});var Ly,Ey,KI=g(()=>{"use strict";a();P();I();T();Ly={},Ey=y({name:"VoiceChatDoubleClick",description:"Join voice chats via double click instead of single click",authors:[m.Ven,m.D3SOX],patches:[...[".handleVoiceStatusClick",".handleClickChat"].map(e=>({find:e,replacement:[{match:/onClick:\(\)=>\{this.handleClick\(\)/g,replace:"onClick:()=>{$self.schedule(()=>{this.handleClick()},this)"}]})),{find:".shouldCloseDefaultModals",replacement:{match:/onClick:(\i)(?=,.{0,30}className:"channelMention".+?(\i)\.inContent)/,replace:(e,t,o)=>`onClick:(vcDoubleClickEvt)=>$self.shouldRunOnClick(vcDoubleClickEvt,${o})&&${t}()`}}],shouldRunOnClick(e,{channelId:t}){let o=ee.getChannel(t);return!o||![2,13].includes(o.type)?!0:e.detail>=2},schedule(e,t){let o=t.props.channel.id;if(Ie.getVoiceChannelId()===o){e();return}let r=Ly[o]??={timeout:void 0,i:0};clearTimeout(r.timeout),++r.i>=2?(e(),delete Ly[o]):r.timeout=setTimeout(()=>{delete Ly[o]},500)}})});function wu(e,t=G.plugins.VcNarrator){if(!e)return;let o=new SpeechSynthesisUtterance(e),r=speechSynthesis.getVoices().find(i=>i.voiceURI===t.voice);!r&&(new oe("VcNarrator").error(`Voice "${t.voice}" not found. Resetting to default.`),r=speechSynthesis.getVoices().find(i=>i.default),t.voice=r?.voiceURI,!r)||(o.voice=r,o.volume=t.volume,o.rate=t.rate,speechSynthesis.speak(o))}function Tu(e){let t=G.plugins.VcNarrator.latinOnly?/[^\p{Script=Latin}\p{Number}\p{Punctuation}\s]/gu:/[^\p{Letter}\p{Number}\p{Punctuation}\s]/gu;return e.normalize("NFKC").replace(t,"").replace(/_{2,}/g,"_").trim()}function xu(e,t,o,r,i){return e.replaceAll("{{USER}}",Tu(t)||(t?"Someone":"")).replaceAll("{{CHANNEL}}",Tu(o)||"channel").replaceAll("{{DISPLAY_NAME}}",Tu(r)||(r?"Someone":"")).replaceAll("{{NICKNAME}}",Tu(i)||(i?"Someone":""))}function c3({channelId:e,oldChannelId:t},o){if(o&&e!==Oy&&(t=Oy,Oy=e),e!==t){if(e)return[t?"move":"join",e];if(t)return["leave",t]}return["",""]}function u3(e,t){let o=Object.assign({},G.plugins.VcNarrator,e),r=E.getCurrentUser(),i=yo.getGuildId();wu(xu(o[t+"Message"],r.username,"general",r.globalName??r.username,Ge.getNick(i,r.id)??r.username),o)}var YI,Oy,_y,ZI=g(()=>{"use strict";a();$();Pi();P();Ke();ot();Cn();I();H();T();YI=x("getVoiceStatesForChannel","getCurrentClientVoiceChannelId");_y=y({name:"VcNarrator",description:"Announces when users join, leave, or move voice channels via narrator",authors:[m.Ven],flux:{VOICE_STATE_UPDATES({voiceStates:e}){let t=yo.getGuildId(),o=Ie.getVoiceChannelId(),r=E.getCurrentUser().id;if(ee.getChannel(o)?.type!==13)for(let i of e){let{userId:s,channelId:l,oldChannelId:c}=i,u=s===r;if(!u&&(!o||l!==o&&c!==o))continue;let[p,d]=c3(i,u);if(!p)continue;let h=G.plugins.VcNarrator[p+"Message"],v=u&&!G.plugins.VcNarrator.sayOwnName?"":E.getUser(s).username,b=v&&(E.getUser(s).globalName??v),M=v&&(Ge.getNick(t,s)??v),w=ee.getChannel(d).name;wu(xu(h,v,w,b,M))}},AUDIO_TOGGLE_SELF_MUTE(){let e=Ie.getVoiceChannelId(),t=YI.getVoiceStateForChannel(e);if(!t)return;let o=t.mute||t.selfMute?"unmute":"mute";wu(xu(G.plugins.VcNarrator[o+"Message"],"",ee.getChannel(e).name,"",""))},AUDIO_TOGGLE_SELF_DEAF(){let e=Ie.getVoiceChannelId(),t=YI.getVoiceStateForChannel(e);if(!t)return;let o=t.deaf||t.selfDeaf?"undeafen":"deafen";wu(xu(G.plugins.VcNarrator[o+"Message"],"",ee.getChannel(e).name,"",""))}},start(){if(typeof speechSynthesis>"u"||speechSynthesis.getVoices().length===0){new oe("VcNarrator").warn("SpeechSynthesis not supported or no Narrator voices found. Thus, this plugin will not work. Check my Settings for more info");return}},optionsCache:null,get options(){return this.optionsCache??={voice:{type:4,description:"Narrator Voice",options:window.speechSynthesis?.getVoices().map(e=>({label:e.name,value:e.voiceURI,default:e.default}))??[]},volume:{type:5,description:"Narrator Volume",default:1,markers:[0,.25,.5,.75,1],stickToMarkers:!1},rate:{type:5,description:"Narrator Speed",default:1,markers:[.1,.5,1,2,5,10],stickToMarkers:!1},sayOwnName:{description:"Say own name",type:3,default:!1},latinOnly:{description:"Strip non latin characters from names before saying them",type:3,default:!1},joinMessage:{type:0,description:"Join Message",default:"{{USER}} joined"},leaveMessage:{type:0,description:"Leave Message",default:"{{USER}} left"},moveMessage:{type:0,description:"Move Message",default:"{{USER}} moved to {{CHANNEL}}"},muteMessage:{type:0,description:"Mute Message (only self for now)",default:"{{USER}} Muted"},unmuteMessage:{type:0,description:"Unmute Message (only self for now)",default:"{{USER}} unmuted"},deafenMessage:{type:0,description:"Deafen Message (only self for now)",default:"{{USER}} deafened"},undeafenMessage:{type:0,description:"Undeafen Message (only self for now)",default:"{{USER}} undeafened"}}},settingsAboutComponent({tempSettings:e}){let[t,o]=Rt(()=>{let s=speechSynthesis.getVoices();return[s.length!==0,s.some(l=>l.lang.startsWith("en"))]},[]),r=Rt(()=>Object.keys(Vencord.Plugins.plugins.VcNarrator.options).filter(s=>s.endsWith("Message")).map(s=>s.slice(0,-7)),[]),i=null;if(t)o||(i=n(Ro,null,"You don't have any English voices installed, so the narrator might sound weird"));else{let s="No narrator voices found. ";s+=navigator.platform?.toLowerCase().includes("linux")?"Install speech-dispatcher or espeak and run Discord with the --enable-speech-dispatcher flag":"Try installing some in the Narrator settings of your Operating System",i=n(Ro,null,s)}return n(S.FormSection,null,n(S.FormText,null,"You can customise the spoken messages below. You can disable specific messages by setting them to nothing"),n(S.FormText,null,"The special placeholders ",n("code",null,"{{USER}}"),", ",n("code",null,"{{DISPLAY_NAME}}"),", ",n("code",null,"{{NICKNAME}}")," and ",n("code",null,"{{CHANNEL}}")," ","will be replaced with the user's name (nothing if it's yourself), the user's display name, the user's nickname on current server and the channel's name respectively"),o&&n(f,null,n(S.FormTitle,{className:j.top20,tag:"h3"},"Play Example Sounds"),n("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"1rem"},className:"vc-narrator-buttons"},r.map(s=>n(k,{key:s,onClick:()=>u3(e,s)},An([s]))))),i)}})});var XI=g(()=>{});function d3(e){let{useQuickCss:t}=St(["useQuickCss"]),o=[];for(let r of Object.values(Vencord.Plugins.plugins))r.toolboxActions&&Vencord.Plugins.isPluginEnabled(r.name)&&o.push(n(L.MenuGroup,{label:r.name,key:`vc-toolbox-${r.name}`},Object.entries(r.toolboxActions).map(([i,s])=>{let l=`vc-toolbox-${r.name}-${i}`;return n(L.MenuItem,{id:l,key:l,label:i,action:s})})));return n(L.Menu,{navId:"vc-toolbox",onClose:e},n(L.MenuItem,{id:"vc-toolbox-notifications",label:"Open Notification Log",action:Sl}),n(L.MenuCheckboxItem,{id:"vc-toolbox-quickcss-toggle",checked:t,label:"Enable QuickCSS",action:()=>{G.useQuickCss=!t}}),n(L.MenuItem,{id:"vc-toolbox-quickcss",label:"Open QuickCSS",action:()=>VencordNative.quickCss.openEditor()}),...o)}function m3(e){return n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 27 27",width:24,height:24},n("path",{fill:"currentColor",d:e?"M9 0h1v1h1v2h1v2h3V3h1V1h1V0h1v2h1v2h1v7h-1v-1h-3V9h1V6h-1v4h-3v1h1v-1h2v1h3v1h-1v1h-3v2h1v1h1v1h1v3h-1v4h-2v-1h-1v-4h-1v4h-1v1h-2v-4H9v-3h1v-1h1v-1h1v-2H9v-1H8v-1h3V6h-1v3h1v1H8v1H7V4h1V2h1M5 19h2v1h1v1h1v3H4v-1h2v-1H4v-2h1m15-1h2v1h1v2h-2v1h2v1h-5v-3h1v-1h1m4 3h4v1h-4":"M0 0h7v1H6v1H5v1H4v1H3v1H2v1h5v1H0V6h1V5h1V4h1V3h1V2h1V1H0m13 2h5v1h-1v1h-1v1h-1v1h3v1h-5V7h1V6h1V5h1V4h-3m8 5h1v5h1v-1h1v1h-1v1h1v-1h1v1h-1v3h-1v1h-2v1h-1v1h1v-1h2v-1h1v2h-1v1h-2v1h-1v-1h-1v1h-6v-1h-1v-1h-1v-2h1v1h2v1h3v1h1v-1h-1v-1h-3v-1h-4v-4h1v-2h1v-1h1v-1h1v2h1v1h1v-1h1v1h-1v1h2v-2h1v-2h1v-1h1M8 14h2v1H9v4h1v2h1v1h1v1h1v1h4v1h-6v-1H5v-1H4v-5h1v-1h1v-2h2m17 3h1v3h-1v1h-1v1h-1v2h-2v-2h2v-1h1v-1h1m1 0h1v3h-1v1h-2v-1h1v-1h1"}))}function f3(){let[e,t]=W(!1);return n(vs,{position:"bottom",align:"right",animation:vs.Animation.NONE,shouldShow:e,onRequestClose:()=>t(!1),renderPopout:()=>d3(()=>t(!1))},(o,{isShown:r})=>n(p3,{className:"vc-toolbox-btn",onClick:()=>t(i=>!i),tooltip:r?null:"Vencord Toolbox",icon:()=>m3(r),selected:r}))}function g3({children:e}){return e.splice(e.length-1,0,n(_,{noop:!0},n(f3,null))),n(f,null,e)}var p3,By,JI=g(()=>{"use strict";a();XI();bl();$();le();P();I();H();T();p3=Tn("Icon","Divider");By=y({name:"VencordToolbox",description:"Adds a button next to the inbox button in the channel header that houses Vencord quick actions",authors:[m.Ven,m.AutumnVN],patches:[{find:"toolbar:function",replacement:{match:/(?<=toolbar:function.{0,100}\()\i.Fragment,/,replace:"$self.ToolboxFragmentWrapper,"}}],ToolboxFragmentWrapper:_.wrap(g3,{fallback:()=>n("p",{style:{color:"red"}},"Failed to render :(")})})});function Wa(e){let t=e.startsWith("/")?"png":Fy.store.format,o=new URL(e,window.location.href);o.searchParams.set("size",Fy.store.imgSize),o.pathname=o.pathname.replace(/\.(png|jpe?g|webp)$/,`.${t}`),e=o.toString(),o.searchParams.set("size","4096");let r=o.toString();tn(e,{original:r,height:256})}var Fy,h3,y3,Uy,QI=g(()=>{"use strict";a();$();It();P();mt();I();T();Fy=N({format:{type:4,description:"Choose the image format to use for non animated images. Animated images will always use .gif",options:[{label:"webp",value:"webp",default:!0},{label:"png",value:"png"},{label:"jpg",value:"jpg"}]},imgSize:{type:4,description:"The image size to use",options:["128","256","512","1024","2048","4096"].map(e=>({label:e,value:e,default:e==="1024"}))}});h3=(e,{user:t,guildId:o})=>{if(!t)return;let r=Ge.getMember(o,t.id)?.avatar||null;e.splice(-1,0,n(L.MenuGroup,null,n(L.MenuItem,{id:"view-avatar",label:"View Avatar",action:()=>Wa(Gt.getUserAvatarURL(t,!0)),icon:Jr}),r&&n(L.MenuItem,{id:"view-server-avatar",label:"View Server Avatar",action:()=>Wa(Gt.getGuildMemberAvatarURLSimple({userId:t.id,avatar:r,guildId:o,canAnimate:!0})),icon:Jr})))},y3=(e,{guild:t})=>{if(!t)return;let{id:o,icon:r,banner:i}=t;!i&&!r||e.splice(-1,0,n(L.MenuGroup,null,r?n(L.MenuItem,{id:"view-icon",label:"View Icon",action:()=>Wa(Gt.getGuildIconURL({id:o,icon:r,canAnimate:!0})),icon:Jr}):null,i?n(L.MenuItem,{id:"view-banner",label:"View Banner",action:()=>Wa(Gt.getGuildBannerURL(t,!0)),icon:Jr}):null))},Uy=y({name:"ViewIcons",authors:[m.Ven,m.TheKodeToad,m.Nuckyz],description:"Makes avatars and banners in user profiles clickable, and adds View Icon/Banner entries in the user and server context menu",tags:["ImageUtilities"],settings:Fy,openImage:Wa,contextMenus:{"user-context":h3,"guild-context":y3},patches:[{find:"User Profile Modal - Context Menu",replacement:{match:/\{src:(\i)(?=,avatarDecoration)/,replace:"{src:$1,onClick:()=>$self.openImage($1)"}},{find:".NITRO_BANNER,",replacement:{match:/style:\{(?=backgroundImage:(\i)\?"url\("\.concat\((\i),)/,replace:'onClick:ev=>$1&&ev.target.style.backgroundImage&&$self.openImage($2),style:{cursor:$1?"pointer":void 0,'}},{find:".avatarPositionPanel",replacement:{match:/(?<=avatarWrapperNonUserBot.{0,50})onClick:(\i\|\|\i)\?void 0(?<=,avatarSrc:(\i).+?)/,replace:'style:($1)?{cursor:"pointer"}:{},onClick:$1?()=>{$self.openImage($2)}'}}]})});function $y(e){return n("div",{className:v3.markup},Pe.defaultRules.codeBlock.react(e,null,{}))}var v3,VI=g(()=>{"use strict";a();H();T();v3=x("markup","codeContainer")});function S3(e){return Object.fromEntries(Object.entries(e).sort(([t],[o])=>t.localeCompare(o)))}function b3(e){let t=S3(JSON.parse(JSON.stringify(e)));for(let r of["email","phone","mfaEnabled","personalConnectionId"])delete t.author[r];let o=t;return delete o.editHistory,delete o.deleted,o.attachments?.forEach(r=>delete r.deleted),t}function oP(e,t,o){let r=de(i=>n(_,null,n(ye,{...i,size:"large"},n(Le,null,n(V,{variant:"heading-lg/semibold",style:{flexGrow:1}},"View Raw"),n(pt,{onClick:()=>xn(r)})),n(ke,null,n("div",{style:{padding:"16px 0"}},!!o&&n(f,null,n(S.FormTitle,{tag:"h5"},"Content"),n($y,{content:o,lang:""}),n(S.FormDivider,{className:j.bottom20})),n(S.FormTitle,{tag:"h5"},t," Data"),n($y,{content:e,lang:"json"}))),n(ct,null,n(fe,{cellSpacing:10},n(k,{onClick:()=>Ao(e,`${t} data copied to clipboard!`)},"Copy ",t," JSON"),!!o&&n(k,{onClick:()=>Ao(o,"Content copied to clipboard!")},"Copy Raw Content"))))))}function eP(e){e=b3(e);let t=JSON.stringify(e,null,4);return oP(t,"Message",e.content)}function Gy(e){return(t,o)=>{let r=o[e.toLowerCase()];if(!r||o.label===Ye.Messages.CHANNEL_ACTIONS_MENU_LABEL)return;let i=t.at(-1);if(i?.key==="developer-actions"){let s=i.props;Array.isArray(s.children)||(s.children=[s.children]),t=s.children}t.splice(-1,0,n(L.MenuItem,{id:`vc-view-${e.toLowerCase()}-raw`,label:"View Raw",action:()=>oP(JSON.stringify(r,null,4),e),icon:tP}))}}var tP,Mu,Hy,nP=g(()=>{"use strict";a();li();$();VI();le();Ut();P();ot();we();Ze();I();T();tP=()=>n("svg",{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",width:"18",height:"18"},n("path",{d:"M12.9297 3.25007C12.7343 3.05261 12.4154 3.05226 12.2196 3.24928L11.5746 3.89824C11.3811 4.09297 11.3808 4.40733 11.5739 4.60245L16.5685 9.64824C16.7614 9.84309 16.7614 10.1569 16.5685 10.3517L11.5739 15.3975C11.3808 15.5927 11.3811 15.907 11.5746 16.1017L12.2196 16.7507C12.4154 16.9477 12.7343 16.9474 12.9297 16.7499L19.2604 10.3517C19.4532 10.1568 19.4532 9.84314 19.2604 9.64832L12.9297 3.25007Z"}),n("path",{d:"M8.42616 4.60245C8.6193 4.40733 8.61898 4.09297 8.42545 3.89824L7.78047 3.24928C7.58466 3.05226 7.26578 3.05261 7.07041 3.25007L0.739669 9.64832C0.5469 9.84314 0.546901 10.1568 0.739669 10.3517L7.07041 16.7499C7.26578 16.9474 7.58465 16.9477 7.78047 16.7507L8.42545 16.1017C8.61898 15.907 8.6193 15.5927 8.42616 15.3975L3.43155 10.3517C3.23869 10.1569 3.23869 9.84309 3.43155 9.64824L8.42616 4.60245Z"}));Mu=N({clickMethod:{description:"Change the button to view the raw content/data of any message.",type:4,options:[{label:"Left Click to view the raw content.",value:"Left",default:!0},{label:"Right click to view the raw content.",value:"Right"}]}});Hy=y({name:"ViewRaw",description:"Copy and view the raw content/data of any message, channel or guild",authors:[m.KingFish,m.Ven,m.rad,m.ImLvna],dependencies:["MessagePopoverAPI"],settings:Mu,contextMenus:{"guild-context":Gy("Guild"),"channel-context":Gy("Channel"),"user-context":Gy("User")},start(){on("ViewRaw",e=>{let t=()=>{Mu.store.clickMethod==="Right"?Ao(e.content):eP(e)},o=i=>{Mu.store.clickMethod==="Left"?(i.preventDefault(),i.stopPropagation(),Ao(e.content)):(i.preventDefault(),i.stopPropagation(),eP(e))};return{label:Mu.store.clickMethod==="Right"?"Copy Raw (Left Click) / View Raw (Right Click)":"View Raw (Left Click) / Copy Raw (Right Click)",icon:tP,message:e,channel:ee.getChannel(e.channel_id),onClick:t,onContextMenu:o}})},stop(){Oo("ViewRaw")}})});var rP=g(()=>{});var fs,Iu=g(()=>{"use strict";a();$();I();fs=N({noiseSuppression:{type:3,description:"Noise Suppression",default:!0},echoCancellation:{type:3,description:"Echo Cancellation",default:!0}})});var Vge,iP=g(()=>{"use strict";a();T();Iu();Vge=VencordNative.pluginHelpers.VoiceMessages});var Ir,zy=g(()=>{"use strict";a();Qe();Ir=ve("vc-vmsg-")});var T3,sP,aP=g(()=>{"use strict";a();lt();H();zy();T3=Ne("waveform:","onVolumeChange"),sP=({src:e,waveform:t,recording:o})=>{let r=Ns({deps:[o]}),i=o?Math.floor(r/1e3):0,s=Math.floor(i/60)+":"+(i%60).toString().padStart(2,"0");return e&&!o?n(T3,{key:e,src:e,waveform:t}):n("div",{className:Ir("preview",o?"preview-recording":[])},n("div",{className:Ir("preview-indicator")}),n("div",{className:Ir("preview-time")},s),n("div",{className:Ir("preview-label")},o?"RECORDING":"----"))}});var lP,cP=g(()=>{"use strict";a();T();Iu();lP=({setAudioBlob:e,onRecordingChange:t})=>{let[o,r]=W(!1),[i,s]=W(!1),[l,c]=W(),[u,p]=W([]),d=v=>{r(v),t?.(v)};function h(){!o?navigator.mediaDevices.getUserMedia({audio:{echoCancellation:fs.store.echoCancellation,noiseSuppression:fs.store.noiseSuppression}}).then(b=>{let M=[];p(M);let w=new MediaRecorder(b);c(w),w.addEventListener("dataavailable",C=>{M.push(C.data)}),w.start(),d(!0)}):l&&(l.addEventListener("stop",()=>{e(new Blob(u,{type:"audio/ogg; codecs=opus"})),d(!1)}),l.stop())}return n(f,null,n(k,{onClick:h},o?"Stop":"Start"," recording"),n(k,{disabled:!o,onClick:()=>{s(!i),i?l?.resume():l?.pause()}},i?"Resume":"Pause"," recording"))}});function P3(e,t){let o=Ie.getChannelId(),r=x3.getPendingReply(o);r&&B.dispatch({type:"DELETE_PENDING_REPLY",channelId:o});let i=new w3.CloudUpload({file:new File([e],"voice-message.ogg",{type:"audio/ogg; codecs=opus"}),isClip:!1,isThumbnail:!1,platform:1},o,!1,0);i.on("complete",()=>{_t.post({url:`/channels/${o}/messages`,body:{flags:1<<13,channel_id:o,content:"",nonce:un.fromTimestamp(Date.now()),sticker_ids:[],type:0,attachments:[{id:"0",filename:i.filename,uploaded_filename:i.uploadedFilename,waveform:t.waveform,duration_secs:t.duration}],message_reference:r?ao.getSendMessageOptionsForReply(r)?.messageReference:null}})}),i.on("error",()=>Mt("Failed to upload voice message",X.Type.FAILURE)),i.upload()}function A3(){let[e,t]=W();return[e,r=>{e&&URL.revokeObjectURL(e),t(URL.createObjectURL(r))}]}function C3({modalProps:e}){let[t,o]=W(!1),[r,i]=W(),[s,l]=A3();se(()=>()=>{s&&URL.revokeObjectURL(s)},[s]);let[c]=st(async()=>{if(!r)return uP;let d=await new AudioContext().decodeAudioData(await r.arrayBuffer()),h=d.getChannelData(0),v=new Uint8Array(Fr.clamp(Math.floor(d.duration*10),Math.min(32,h.length),256)),b=Math.floor(h.length/v.length);for(let C=0;C{i(p),l(p)},onRecordingChange:o}),n(k,{onClick:async()=>{let p=await Al("audio/*");p&&(i(p),l(p))}},"Upload File")),n(S.FormTitle,null,"Preview"),n(sP,{src:s,waveform:c.waveform,recording:t}),u&&n(Tt,{className:`vc-plugins-restart-card ${j.top16}`},n(S.FormText,null,"Voice Messages have to be OggOpus to be playable on iOS. This file is ",n("code",null,r.type)," so it will not be playable on iOS."),n(S.FormText,{className:j.top8},"To fix it, first convert it to OggOpus, for example using the ",n(je,{href:"https://convertio.co/mp3-opus/"},"convertio web converter")))),n(ct,null,n(k,{disabled:!r,onClick:()=>{P3(r,c),e.onClose(),Mt("Now sending voice message... Please be patient",X.Type.MESSAGE)}},"Send")))}var w3,x3,jy,M3,I3,Wy,uP,pP=g(()=>{"use strict";a();rP();It();To();P();ot();Ze();lt();I();Cl();H();T();iP();Iu();zy();aP();cP();w3=x("CloudUpload"),x3=Re("PendingReplyStore"),jy=x("optionName","optionIcon","optionLabel"),M3=lP,I3=(e,t)=>{t.channel.guild_id&&!(_e.can(me.SEND_VOICE_MESSAGES,t.channel)&&_e.can(me.SEND_MESSAGES,t.channel))||e.push(n(L.MenuItem,{id:"vc-send-vmsg",label:n("div",{className:jy.optionLabel},n(_v,{className:jy.optionIcon,height:24,width:24}),n("div",{className:jy.optionName},"Send voice message")),action:()=>de(o=>n(C3,{modalProps:o}))}))},Wy=y({name:"VoiceMessages",description:"Allows you to send voice messages like on mobile. To do so, right click the upload button and click Send Voice Message",authors:[m.Ven,m.Vap,m.Nickyux],settings:fs,contextMenus:{"channel-attach":I3}}),uP={waveform:"AAAAAAAAAAAA",duration:1}});async function R3(e){let t=await fetch(e);if(t.status===200)return await t.blob()}function mP(e){let t=new URL(e);return t.host===dP?e:(t.searchParams.delete("width"),t.searchParams.delete("height"),t.origin===k3?(t.host=dP,t.searchParams.delete("size"),t.searchParams.delete("quality"),t.searchParams.delete("format")):t.searchParams.set("quality","lossless"),t.toString())}var Pu,mi,k3,dP,qy,fP=g(()=>{"use strict";a();$();P();I();Cl();H();T();Pu=x("contextMenuCallbackNative");mi=N({addBack:{type:3,description:"Add back the Discord context menus for images, links and the chat input bar",default:!0,restartNeeded:!0}}),k3="https://media.discordapp.net",dP="cdn.discordapp.com";qy=y({name:"WebContextMenus",description:"Re-adds context menus missing in the web version of Discord: Links & Images (Copy/Open Link/Image), Text Area (Copy, Cut, Paste, SpellCheck)",authors:[m.Ven],enabledByDefault:!0,required:!0,settings:mi,start(){mi.store.addBack&&(window.removeEventListener("contextmenu",Pu.contextMenuCallbackWeb),window.addEventListener("contextmenu",Pu.contextMenuCallbackNative),this.changedListeners=!0)},stop(){this.changedListeners&&(window.removeEventListener("contextmenu",Pu.contextMenuCallbackNative),window.addEventListener("contextmenu",Pu.contextMenuCallbackWeb))},patches:[{find:"open-native-link",replacement:[{match:/if\(!\i\.\i\|\|null==/,replace:"if(null=="},{match:/\i\.\i\.copy/,replace:"Vencord.Webpack.Common.Clipboard.copy"}]},{find:'id:"copy-image"',replacement:[{match:/!\i\.isPlatformEmbedded/,replace:"false"},{match:/return\s*?\[\i\.\i\.canCopyImage\(\)/,replace:"return [true"},{match:/(?<=COPY_IMAGE_MENU_ITEM,)action:/,replace:"action:()=>$self.copyImage(arguments[0]),oldAction:"},{match:/(?<=SAVE_IMAGE_MENU_ITEM,)action:/,replace:"action:()=>$self.saveImage(arguments[0]),oldAction:"}]},{find:'navId:"image-context"',all:!0,predicate:()=>mi.store.addBack,replacement:{match:/return \i\.\i(?=\?|&&)/,replace:"return true"}},{find:'"interactionUsernameProfile"',predicate:()=>mi.store.addBack,replacement:{match:/if\((?="A"===\i\.tagName&&""!==\i\.textContent)/,replace:"if(false&&"}},{find:'getElementById("slate-toolbar"',predicate:()=>mi.store.addBack,replacement:{match:/(?<=handleContextMenu\(\i\)\{.{0,200}isPlatformEmbedded)\?/,replace:"||true?"}},{find:".SLASH_COMMAND_SUGGESTIONS_TOGGLED,{",predicate:()=>mi.store.addBack,replacement:[{match:/if\(!\i\.\i\)return null;/,replace:""},{match:/\b\i\.\i\.(copy|cut|paste)/g,replace:"$self.$1"}]},{find:'"add-to-dictionary"',predicate:()=>mi.store.addBack,replacement:{match:/let\{text:\i=""/,replace:"return [null,null];$&"}},{find:'.default("MediaEngineWebRTC");',replacement:{match:/supports\(\i\)\{switch\(\i\)\{case (\i).Features/,replace:"$&.DISABLE_VIDEO:return true;case $1.Features"}}],async copyImage(e){e=mP(e);let t=await fetch(e).then(o=>o.blob());if(t.type!=="image/png"){let o=await createImageBitmap(t),r=document.createElement("canvas");r.width=o.width,r.height=o.height,r.getContext("2d").drawImage(o,0,0),await new Promise(i=>{r.toBlob(s=>{t=s,i()},"image/png")})}if(VesktopNative.clipboard){VesktopNative.clipboard.copyImage(await t.arrayBuffer(),e);return}else navigator.clipboard.write([new ClipboardItem({"image/png":t})])},async saveImage(e){e=mP(e);let t=await R3(e);if(!t)return;let o=new URL(e).pathname.split("/").pop(),r=new File([t],o,{type:t.type});Pl(r)},copy(){let e=document.getSelection();!e||Ft.copy(e.toString())},cut(){this.copy(),Wo.dispatch("INSERT_TEXT",{rawText:""})},async paste(){let e=(await navigator.clipboard.read())[0];if(!e)return;let t=new DataTransfer;for(let o of e.types)if(o==="image/png"){let r=new File([await e.getType(o)],"unknown.png",{type:o});t.items.add(r)}else if(o==="text/plain"){let r=await e.getType(o);t.setData(o,await r.text())}document.dispatchEvent(new ClipboardEvent("paste",{clipboardData:t}))}})});var Ky,Yy,gP=g(()=>{"use strict";a();P();I();H();T();Ky=x("JUMP_TO_GUILD","SERVER_NEXT"),Yy=y({name:"WebKeybinds",description:"Re-adds keybinds missing in the web version of Discord: ctrl+t, ctrl+shift+t, ctrl+tab, ctrl+shift+tab, ctrl+1-9, ctrl+,. Only works fully on Vesktop/ArmCord, not inside your browser",authors:[m.Ven],enabledByDefault:!0,onKey(e){if(e.ctrlKey||e.metaKey&&navigator.platform.includes("Mac"))switch(e.key){case"t":case"T":e.preventDefault(),e.shiftKey?(yo.getGuildId()&&qo.transitionToGuild("@me"),Wo.safeDispatch("TOGGLE_DM_CREATE")):B.dispatch({type:"QUICKSWITCHER_SHOW",query:"",queryMode:null});break;case",":e.preventDefault(),$r.open("My Account");break;case"Tab":(e.shiftKey?Ky.SERVER_PREV:Ky.SERVER_NEXT).action(e);break;default:e.key>="1"&&e.key<="9"&&(e.preventDefault(),Ky.JUMP_TO_GUILD.action(e,`mod+${e.key}`));break}},start(){document.addEventListener("keydown",this.onKey)},stop(){document.removeEventListener("keydown",this.onKey)}})});function E3(e,t,o){let r=t.name+(t.id?`:${t.id}`:"");return _t.get({url:`/channels/${e.channel_id}/messages/${e.id}/reactions/${r}`,query:{limit:100,type:o},oldFormErrors:!0}).then(i=>B.dispatch({type:"MESSAGE_REACTION_ADD_USERS",channelId:e.channel_id,messageId:e.id,users:i.body,emoji:t,reactionType:o})).catch(console.error).finally(()=>Ko(250))}function O3(e,t,o){let r=`${e.id}:${t.name}:${t.id??""}:${o}`,i=hP[r]??={fetched:!1,users:{}};return i.fetched||(L3.unshift(()=>E3(e,t,o)),i.fetched=!0),i.users}function _3(e){return function(o,r){return n(ne,{text:e.slice(4).map(i=>i.username).join(", ")},({onMouseEnter:i,onMouseLeave:s})=>n("div",{className:D3.moreUsers,onMouseEnter:i,onMouseLeave:s},"+",e.length-4))}}function B3(e){e.stopPropagation()}var N3,D3,Zy,L3,hP,Xy,yP=g(()=>{"use strict";a();le();P();we();Wr();lt();I();H();T();N3=Ne("defaultRenderUser","showDefaultAvatarsForNullUsers"),D3=x("moreUsers","emptyUser","avatarContainer","clickableAvatar"),Zy=null,L3=new vo;Xy=y({name:"WhoReacted",description:"Renders the avatars of users who reacted to a message",authors:[m.Ven,m.KannaDev,m.newwares],patches:[{find:",reactionRef:",replacement:{match:/(\i)\?null:\(0,\i\.jsx\)\(\i\.\i,{className:\i\.reactionCount,.*?}\),/,replace:"$&$1?null:$self.renderUsers(this.props),"}},{find:'.displayName="MessageReactionsStore";',replacement:{match:/(?<=CONNECTION_OPEN:function\(\){)(\i)={}/,replace:"$&;$self.reactions=$1"}},{find:"cleanAutomaticAnchor(){",replacement:{match:/this\.automaticAnchor=null,this\.messageFetchAnchor=null,/,replace:"$&$self.setScrollObj(this),"}}],setScrollObj(e){Zy=e},renderUsers(e){return e.message.reactions.length>10?null:n(_,{noop:!0},n(this._renderUsers,{...e}))},_renderUsers({message:e,emoji:t,type:o}){let r=Co();U.useLayoutEffect(()=>{Zy?.scrollCounter>0&&Zy.setAutomaticAnchor(null)}),U.useEffect(()=>{let l=c=>{c.messageId===e.id&&r()};return B.subscribe("MESSAGE_REACTION_ADD_USERS",l),()=>B.unsubscribe("MESSAGE_REACTION_ADD_USERS",l)},[e.id]);let i=O3(e,t,o),s=Object.values(i).filter(Boolean);for(let l of s)B.dispatch({type:"USER_UPDATE",user:l});return n("div",{style:{marginLeft:"0.5em",transform:"scale(0.9)"}},n("div",{onClick:B3},n(N3,{users:s,guildId:ee.getChannel(e.channel_id)?.guild_id,renderIcon:!1,max:5,showDefaultAvatarsForNullUsers:!0,showUserPopout:!0,renderMoreUsers:_3(s)})))},set reactions(e){hP=e}})});var Jy,vP=g(()=>{"use strict";a();uo();P();I();Jy=y({name:"Wikisearch",description:"Searches Wikipedia for your requested query. (/wikisearch)",authors:[m.Samu],dependencies:["CommandsAPI"],commands:[{name:"wikisearch",description:"Searches Wikipedia for your request.",inputType:0,options:[{name:"search",description:"Word to search for",type:3,required:!0}],execute:async(e,t)=>{let o=ht(e,"search","");if(!o)return ge(t.channel.id,{content:"No word was defined!"});let r=new URLSearchParams({action:"query",format:"json",list:"search",formatversion:"2",origin:"*",srsearch:o}),i=await fetch("https://en.wikipedia.org/w/api.php?"+r).then(u=>u.json()).catch(u=>(console.log(u),ge(t.channel.id,{content:"There was an error. Check the console for more info"}),null));if(!i)return;if(!i.query?.search?.length)return console.log(i),ge(t.channel.id,{content:"No results given"});let s=await fetch(`https://en.wikipedia.org/w/api.php?action=query&format=json&prop=info%7Cdescription%7Cimages%7Cimageinfo%7Cpageimages&list=&meta=&indexpageids=1&pageids=${i.query.search[0].pageid}&formatversion=2&origin=*`).then(u=>u.json()).then(u=>u.query.pages[0]).catch(u=>(console.log(u),ge(t.channel.id,{content:"There was an error. Check the console for more info"}),null));if(!s)return;let l=s.thumbnail,c=l&&{url:l.source.replace(/(50px-)/ig,"1000px-"),height:l.height*100,width:l.width*100};ge(t.channel.id,{embeds:[{type:"rich",title:i.query.search[0].title,url:`https://wikipedia.org/w/index.php?curid=${i.query.search[0].pageid}`,color:"0x8663BE",description:i.query.search[0].snippet.replace(/( |<([^>]+)>)/ig,"").replace(/(")/ig,'"')+"...",image:c,footer:{text:"Powered by the Wikimedia API"}}]})}}]})});function U3(e,t,o){fetch(`https://cdn.discordapp.com/avatars/${o.author.id}/${o.author.avatar}.png?size=128`).then(r=>r.arrayBuffer()).then(r=>{let i={messageType:1,index:0,timeout:Bo.store.timeout,height:TP(wP(t)),opacity:Bo.store.opacity,volume:Bo.store.volume,audioPath:Bo.store.soundPath,title:e,content:t,useBase64Icon:!0,icon:r,sourceApp:"Vencord"};bP.sendToOverlay(i)})}function $3(e,t){let o={messageType:1,index:0,timeout:Bo.store.timeout,height:TP(wP(e)),opacity:Bo.store.opacity,volume:Bo.store.volume,audioPath:Bo.store.soundPath,title:t,content:e,useBase64Icon:!1,icon:null,sourceApp:"Vencord"};bP.sendToOverlay(o)}function G3(e,t){let o=E.getCurrentUser();return e.author.id===o.id||e.author.bot&&Bo.store.ignoreBots?!1:SP.allowAllMessages(t)||e.mention_everyone&&!SP.isSuppressEveryoneEnabled(e.guild_id)?!0:e.mentions.some(r=>r.id===o.id)}function TP(e){return e.length<=100?100:e.length<=200?150:e.length<=300?200:250}function wP(e){return e.replace(new RegExp("<[^>]*>","g"),"")}var SP,F3,Bo,bP,Qy,xP=g(()=>{"use strict";a();$();Xs();P();Ke();I();H();T();SP=x("isSuppressEveryoneEnabled"),F3=new oe("XSOverlay"),Bo=N({ignoreBots:{type:3,description:"Ignore messages from bots",default:!1},pingColor:{type:0,description:"User mention color",default:"#7289da"},channelPingColor:{type:0,description:"Channel mention color",default:"#8a2be2"},soundPath:{type:0,description:"Notification sound (default/warning/error)",default:"default"},timeout:{type:1,description:"Notif duration (secs)",default:1},opacity:{type:5,description:"Notif opacity",default:1,markers:en(0,1,.1)},volume:{type:5,description:"Volume",default:.2,markers:en(0,1,.1)}}),bP=VencordNative.pluginHelpers.XsOverlay,Qy=y({name:"XSOverlay",description:"Forwards discord notifications to XSOverlay, for easy viewing in VR",authors:[m.Nyako],tags:["vr","notify"],settings:Bo,flux:{CALL_UPDATE({call:e}){if(e?.ringing?.includes(E.getCurrentUser().id)){let t=ee.getChannel(e.channel_id);$3("Incoming call",`${t.name} is calling you...`)}},MESSAGE_CREATE({message:e,optimistic:t}){try{if(t)return;let o=ee.getChannel(e.channel_id);if(!G3(e,o))return;let r=Bo.store.pingColor.replaceAll("#","").trim(),i=Bo.store.channelPingColor.replaceAll("#","").trim(),s=e.content,l="";if(o.guild_id){let d=ae.getGuild(o.guild_id);l=`${e.author.username} (${d.name}, #${o.name})`}switch(o.type){case 1:l=e.author.username.trim();break;case 3:let d=o.name.trim()??o.rawRecipients.map(h=>h.username).join(", ");l=`${e.author.username} (${d})`;break}if(e.referenced_message&&(l+=" (reply)"),e.embeds.length>0&&(s+=" [embed] ",e.content===""&&(s="sent message embed(s)")),e.sticker_items&&(s+=" [sticker] ",e.content===""&&(s="sent a sticker")),e.attachments.filter(d=>typeof d?.content_type=="string"&&d?.content_type.startsWith("image")).forEach(d=>{s+=` [image: ${d.filename}] `}),e.attachments.filter(d=>d&&!d.content_type?.startsWith("image")).forEach(d=>{s+=` [attachment: ${d.filename}] `}),e.mentions.length>0&&(s=s.replace(/<@!?(\d{17,20})>/g,(d,h)=>`@${E.getUser(h)?.username||"unknown-user"}`)),e.mention_roles.length>0)for(let d of e.mention_roles){let h=ae.getRole(o.guild_id,d);if(!h)continue;let v=h.colorString??`#${r}`;s=s.replace(`<@&${d}>`,`@${h.name}`)}let u=s.match(new RegExp("()","g")),p=s.match(new RegExp("<(#\\d+)>","g"));if(u)for(let d of u)s=s.replace(new RegExp(`${d}`,"g"),`:${d.split(":")[1]}:`);if(p)for(let d of p){let h=d.split("<#")[1];h=h.substring(0,h.length-1),s=s.replace(new RegExp(`${d}`,"g"),`#${ee.getChannel(h).name}`)}U3(l,s,e)}catch(o){F3.error(`Failed to catch MESSAGE_CREATE: ${o}`)}}}})});var ze,Kr=g(()=>{a();E1();O1();_1();B1();F1();U1();$1();G1();H1();z1();j1();W1();hd();A0();C0();R0();k0();L0();E0();Md();G0();H0();z0();W0();q0();Y0();Z0();eS();oS();nS();aS();hS();yS();vS();SS();xS();RS();NS();eb();tb();ib();ab();lb();Lb();Fb();Ub();Hb();zb();jb();Wb();qb();Kb();Zb();Qb();Vb();nT();sT();aT();pT();ef();hc();xT();IT();CT();vf();ET();FT();WT();KT();YT();ZT();JT();QT();VT();ew();tw();ow();nw();iw();sw();aw();lw();cw();uw();pw();dw();mw();fw();gw();hw();yw();vw();ww();xw();xa();_w();Uw();Aa();l2();p2();f2();R2();k2();G2();H2();z2();ox();rx();ix();lx();Dx();Lx();Ox();_x();$x();Wx();Vx();OM();_M();HM();Kh();ZM();XM();JM();QM();eI();lI();cI();uI();mI();fI();TI();wI();xI();kI();DI();xy();LI();EI();_I();GI();jI();qI();KI();ZI();JI();QI();nP();pP();fP();gP();yP();vP();xP();ze={[Ju.name]:Ju,[Qu.name]:Qu,[Vu.name]:Vu,[ep.name]:ep,[tp.name]:tp,[op.name]:op,[np.name]:np,[rp.name]:rp,[ip.name]:ip,[sp.name]:sp,[ap.name]:ap,[lp.name]:lp,[na.name]:na,[yd.name]:yd,[vd.name]:vd,[bd.name]:bd,[Td.name]:Td,[wd.name]:wd,[xd.name]:xd,[Ad.name]:Ad,[Cd.name]:Cd,[Rd.name]:Rd,[kd.name]:kd,[Nd.name]:Nd,[Dd.name]:Dd,[Ld.name]:Ld,[Ed.name]:Ed,[Od.name]:Od,[_d.name]:_d,[Bd.name]:Bd,[Wd.name]:Wd,[qd.name]:qd,[Yd.name]:Yd,[Zd.name]:Zd,[Xd.name]:Xd,[em.name]:em,[om.name]:om,[nm.name]:nm,[vm.name]:vm,[Sm.name]:Sm,[Tm.name]:Tm,[xm.name]:xm,[Mm.name]:Mm,[Dm.name]:Dm,[Lm.name]:Lm,[Em.name]:Em,[Om.name]:Om,[_m.name]:_m,[Bm.name]:Bm,[Fm.name]:Fm,[Um.name]:Um,[$m.name]:$m,[Gm.name]:Gm,[zm.name]:zm,[jm.name]:jm,[Wm.name]:Wm,[Km.name]:Km,[Ym.name]:Ym,[Xm.name]:Xm,[of.name]:of,[cf.name]:cf,[uf.name]:uf,[mf.name]:mf,[ff.name]:ff,[bf.name]:bf,[wf.name]:wf,[Af.name]:Af,[kf.name]:kf,[Nf.name]:Nf,[Df.name]:Df,[Lf.name]:Lf,[Of.name]:Of,[Ff.name]:Ff,[Uf.name]:Uf,[$f.name]:$f,[Gf.name]:Gf,[Hf.name]:Hf,[zf.name]:zf,[qf.name]:qf,[Kf.name]:Kf,[Yf.name]:Yf,[Zf.name]:Zf,[Xf.name]:Xf,[Jf.name]:Jf,[Qf.name]:Qf,[Vf.name]:Vf,[eg.name]:eg,[tg.name]:tg,[og.name]:og,[ng.name]:ng,[rg.name]:rg,[sg.name]:sg,[ag.name]:ag,[cg.name]:cg,[gg.name]:gg,[hg.name]:hg,[yg.name]:yg,[Pg.name]:Pg,[Ag.name]:Ag,[Fg.name]:Fg,[Gg.name]:Gg,[Wg.name]:Wg,[qg.name]:qg,[Kg.name]:Kg,[Zg.name]:Zg,[Qg.name]:Qg,[ah.name]:ah,[ch.name]:ch,[uh.name]:uh,[ph.name]:ph,[vh.name]:vh,[Sh.name]:Sh,[bh.name]:bh,[Th.name]:Th,[wh.name]:wh,[Ih.name]:Ih,[Ph.name]:Ph,[jh.name]:jh,[Wh.name]:Wh,[qh.name]:qh,[Yh.name]:Yh,[Zh.name]:Zh,[Xh.name]:Xh,[Vh.name]:Vh,[ey.name]:ey,[ty.name]:ty,[ry.name]:ry,[sy.name]:sy,[cy.name]:cy,[uy.name]:uy,[py.name]:py,[my.name]:my,[fy.name]:fy,[gy.name]:gy,[by.name]:by,[My.name]:My,[wy.name]:wy,[Iy.name]:Iy,[Ay.name]:Ay,[Cy.name]:Cy,[ky.name]:ky,[Ny.name]:Ny,[Dy.name]:Dy,[Ey.name]:Ey,[_y.name]:_y,[By.name]:By,[Uy.name]:Uy,[Hy.name]:Hy,[Wy.name]:Wy,[qy.name]:qy,[Yy.name]:Yy,[Xy.name]:Xy,[Jy.name]:Jy,[Qy.name]:Qy}});var e1={};qe(e1,{BadgePosition:()=>ml,_getBadges:()=>H3,addBadge:()=>Ug,removeBadge:()=>$g});function Ug(e){e.component&&=_.wrap(e.component,{noop:!0}),Vy.add(e)}function $g(e){return Vy.delete(e)}function H3(e){let t=[];for(let r of Vy)(!r.shouldShow||r.shouldShow(e))&&(r.position===0?t.unshift({...r,...e}):t.push({...r,...e}));let o=ze.BadgeAPI.getDonorBadges(e.user.id);return o&&t.unshift(...o),t}var ml,Vy,fl=g(()=>{"use strict";a();le();Kr();ml=(o=>(o[o.START=0]="START",o[o.END=1]="END",o))(ml||{}),Vy=new Set});var t1={};qe(t1,{Badges:()=>K3,ChatButtons:()=>t4,Commands:()=>j3,ContextMenu:()=>e4,DataStore:()=>yt,MemberListDecorators:()=>X3,MessageAccessories:()=>W3,MessageDecorations:()=>Z3,MessageEvents:()=>z3,MessagePopover:()=>q3,Notices:()=>Yc,Notifications:()=>V3,ServerList:()=>Y3,Settings:()=>J3,Styles:()=>Q3});var z3,Yc,j3,yt,W3,q3,K3,Y3,Z3,X3,J3,Q3,V3,e4,t4,ei=g(()=>{"use strict";a();fl();En();uo();Eo();Xo();Ng();Tc();Og();gn();li();Nl();er();qc();$();Qe();z3=jd,Yc=$p,j3=Yp,yt=mn,W3=Mf,q3=qm,K3=e1,Y3=Jg,Z3=Eg,X3=kg,J3=Dp,Q3=gp,V3=yp,e4=cd,t4=sf});var s4={};qe(s4,{Api:()=>t1,PlainSettings:()=>Pn,Plugins:()=>md,QuickCss:()=>i1,Settings:()=>G,Updater:()=>Ep,Util:()=>o1,Webpack:()=>s1});a();ei();jl();var o1={};qe(o1,{ChangeList:()=>Vs,Devs:()=>m,DevsById:()=>Mi,ImageModal:()=>Zu,LazyComponent:()=>bt,Logger:()=>oe,Margins:()=>j,ModalCloseButton:()=>pt,ModalContent:()=>ke,ModalFooter:()=>ct,ModalHeader:()=>Le,ModalRoot:()=>ye,ModalSize:()=>ko,Modals:()=>Yo,NoopComponent:()=>YP,Queue:()=>vo,REACT_GLOBAL:()=>WP,SUPPORT_CHANNEL_ID:()=>ul,Theme:()=>Bl,WEBPACK_CHUNK:()=>pn,canonicalizeDescriptor:()=>Ru,canonicalizeMatch:()=>bn,canonicalizeReplace:()=>Za,canonicalizeReplacement:()=>ys,checkIntersecting:()=>ju,classes:()=>Q,closeAllModals:()=>dn,closeModal:()=>xn,copyWithToast:()=>Ao,debounce:()=>lo,fetchUserProfile:()=>Qp,formatDuration:()=>Ws,getCurrentChannel:()=>Bi,getCurrentGuild:()=>Js,getTheme:()=>Fi,getUniqueUsername:()=>Nn,humanFriendlyJoin:()=>YA,identity:()=>Rs,insertTextIntoChatInputBox:()=>kn,isMobile:()=>KP,isNonNullish:()=>tm,isObject:()=>qP,isObjectEmpty:()=>Cs,isPluginDev:()=>ks,isTruthy:()=>Yl,localStorage:()=>jr,makeCodeblock:()=>qs,makeLazy:()=>Jn,mergeDefaults:()=>Ii,onceDefined:()=>o4,onlyOnce:()=>Op,openImageModal:()=>tn,openInviteModal:()=>Qr,openModal:()=>de,openModalLazy:()=>Hr,openPrivateChannel:()=>eC,openUserProfile:()=>bo,parseUrl:()=>zu,proxyLazy:()=>Ot,sendMessage:()=>tC,sleep:()=>Ko,useAwaiter:()=>st,useForceUpdater:()=>Co,useIntersection:()=>Wu,useTimer:()=>Ns,wordsFromCamel:()=>Hp,wordsFromKebab:()=>GA,wordsFromPascal:()=>zp,wordsFromSnake:()=>$A,wordsFromTitle:()=>HA,wordsToCamel:()=>zA,wordsToKebab:()=>WA,wordsToPascal:()=>qA,wordsToSnake:()=>jA,wordsToTitle:()=>An});a();zr();a();function o4(e,t,o){let r=t;if(t in e)return void o(e[r]);Object.defineProperty(e,t,{set(i){delete e[r],e[r]=i,o(i)},configurable:!0,enumerable:!1})}id();P();mt();Zl();Uo();hl();Ke();ot();we();Ze();_p();hi();Wr();lt();Cn();var i1={};qe(i1,{toggle:()=>n1});a();$();var gs,MP;function r1(e){let t=document.createElement("style");return t.id=e,document.documentElement.append(t),t}async function n4(){let e=await VencordNative.themes.getSystemValues(),t=Object.entries(e).filter(([,o])=>o!=="#").map(([o,r])=>`--${o}: ${r};`).join("");r1("vencord-os-theme-values").textContent=`:root{${t}}`}async function n1(e){gs?gs.disabled=!e:e&&(gs=r1("vencord-custom-css"),VencordNative.quickCss.addChangeListener(t=>{gs.textContent=t,gs.disabled=!G.useQuickCss}),gs.textContent=await VencordNative.quickCss.get())}async function Au(){MP??=r1("vencord-themes");let{themeLinks:e,enabledThemes:t}=G,o=[...e];{let r=t.map(i=>`vencord:///themes/${i}?v=${Date.now()}`);o.push(...r)}MP.textContent=o.map(r=>`@import url("${r.trim()}");`).join(` -`)}document.addEventListener("DOMContentLoaded",()=>{n4(),Au(),n1(G.useQuickCss),jt.addChangeListener("useQuickCss",n1),jt.addChangeListener("themeLinks",Au),jt.addChangeListener("enabledThemes",Au),VencordNative.quickCss.addThemeChangeListener(Au)});Zr();var s1={};qe(s1,{Common:()=>Hu,LazyComponentWebpack:()=>Du,_initWebpack:()=>Qa,_resolveReady:()=>Ja,addListener:()=>FP,cache:()=>ln,extract:()=>el,extractAndLoadChunks:()=>f1,extractAndLoadChunksLazy:()=>vi,filters:()=>Ce,find:()=>$o,findAll:()=>Nr,findBulk:()=>Dr,findByCode:()=>d1,findByCodeLazy:()=>Go,findByProps:()=>Lr,findByPropsLazy:()=>x,findComponentByCode:()=>Lu,findComponentByCodeLazy:()=>Ne,findComponentLazy:()=>Eu,findExportedComponentLazy:()=>Tn,findLazy:()=>so,findModuleFactory:()=>p1,findModuleId:()=>Va,findStore:()=>m1,findStoreLazy:()=>Re,lazyWebpackSearchHistory:()=>BP,listeners:()=>Nu,onceReady:()=>ku,proxyLazyWebpack:()=>go,removeListener:()=>UP,search:()=>Ou,subscriptions:()=>u1,waitFor:()=>gt,wreq:()=>io});a();T();H();a();P();Ke();hi();Xa();var IP,Fo=new oe("WebpackInterceptor","#8caaee");window[pn]?(Fo.info(`Patching ${pn}.push (was already existent, likely from cache!)`),Qa(window[pn]),PP(window[pn])):(Object.defineProperty(window,pn,{get:()=>IP,set:e=>{e?.push&&(e.push.$$vencordOriginal||(Fo.info(`Patching ${pn}.push`),PP(e)),Qa(e)&&(Fo.info("Successfully initialised Vencord webpack"),delete window[pn],window[pn]=e)),IP=e},configurable:!0}),Object.defineProperty(Function.prototype,"m",{set(e){new Error().stack?.includes("discord.com")&&(Fo.info("Found webpack module factory"),AP(e)),Object.defineProperty(this,"m",{value:e,configurable:!0})},configurable:!0}));function PP(e){function t(o){try{AP(o[1])}catch(r){Fo.error("Error in handlePush",r)}return t.$$vencordOriginal.call(e,o)}t.$$vencordOriginal=e.push,t.bind=(...o)=>t.$$vencordOriginal.bind(...o),Object.defineProperty(e,"push",{get:()=>t,set(o){t.$$vencordOriginal=o},configurable:!0})}function AP(e){let{subscriptions:t,listeners:o}=Vencord.Webpack,{patches:r}=Vencord.Plugins;for(let i in e){let s=e[i],l="0,"+s.toString().replaceAll(` -`,""),c=s,u=new Set,p=e[i]=function(d,h,v){try{s(d,h,v)}catch(b){if(s===c)throw b;return Fo.error("Error in patched chunk",b),void c(d,h,v)}if(h=d.exports,!!h){if(h===window&&v.c){Object.defineProperty(v.c,i,{value:v.c[i],enumerable:!1,configurable:!0,writable:!0});return}for(let b of o)try{b(h,i)}catch(M){Fo.error("Error in webpack listener",M)}for(let[b,M]of t)try{b(h)?(t.delete(b),M(h,i)):h.default&&b(h.default)&&(t.delete(b),M(h.default,i))}catch(w){Fo.error("Error while firing callback for webpack chunk",w)}}};p.toString=()=>s.toString(),p.original=c;for(let d=0;dl.replace(b,M));if(!(h.predicate&&!h.predicate())&&l.includes(h.find)){u.add(h.plugin);let b=s,M=l;for(let w of h.replacement){if(w.predicate&&!w.predicate())continue;let C=s,R=l;ys(w,h.plugin);try{let A=v(w.match,w.replace);if(A===l){if(h.noWarn||Fo.warn(`Patch by ${h.plugin} had no effect (Module id is ${i}): ${w.match}`),h.group){Fo.warn(`Undoing patch group ${h.find} by ${h.plugin} because replacement ${w.match} had no effect`),l=M,s=b,u.delete(h.plugin);break}}else l=A,s=(0,eval)(`// Webpack Module ${i} - Patched by ${[...u].join(", ")} -${A} -//# sourceURL=WebpackModule${i}`)}catch(A){if(Fo.error(`Patch by ${h.plugin} errored (Module id is ${i}): ${w.match} -`,A),u.delete(h.plugin),h.group){Fo.warn(`Undoing patch group ${h.find} by ${h.plugin} because replacement ${w.match} errored`),l=M,s=b;break}l=R,s=C}}h.all||r.splice(d--,1)}}}}I();Xo();er();$();jl();hl();rr();Us();Zr();T();async function r4(){if(G.cloud.authenticated&&!await dt("Vencord_cloudSecret")){Fe({title:"Cloud Integrations",body:"We've noticed you have cloud integrations enabled in another client! Due to limitations, you will need to re-authenticate to continue using them. Click here to go to the settings page to do so!",color:"var(--yellow-360)",onClick:()=>$r.open("VencordCloud")});return}G.cloud.settingsSync&&G.cloud.authenticated&&(jr.Vencord_settingsDirty?(await Ri(),delete jr.Vencord_settingsDirty):await Rl(!1)&&Fe({title:"Cloud Settings",body:"Your settings have been updated! Click here to restart to fully apply changes!",color:"var(--green-360)",onClick:So}))}async function i4(){await ku,ta("WebpackReady"),r4();try{if(!await Di())return;if(G.autoUpdate){await Li(),G.autoUpdateNotification&&setTimeout(()=>Fe({title:"Vencord has been updated!",body:"Click here to restart",permanent:!0,noPersist:!0,onClick:So}),1e4);return}G.notifyAboutUpdates&&setTimeout(()=>Fe({title:"A Vencord update is available!",body:"Click here to view the update",permanent:!0,noPersist:!0,onClick(){$r.open("VencordUpdater")}}),1e4)}catch(e){Yr.error("Failed to check for updates",e)}}ta("Init");i4();document.addEventListener("DOMContentLoaded",()=>{ta("DOMContentLoaded")},{once:!0});return Xn(s4);})(); -//# sourceURL=VencordDesktopRenderer -//# sourceMappingURL=vencord://vencordDesktopRenderer.js.map -/*! For license information please see vencordDesktopRenderer.js.LEGAL.txt */ diff --git a/vesktop/vencordDist/vencordDesktopRenderer.js.LEGAL.txt b/vesktop/vencordDist/vencordDesktopRenderer.js.LEGAL.txt deleted file mode 100644 index 9a5264c..0000000 --- a/vesktop/vencordDist/vencordDesktopRenderer.js.LEGAL.txt +++ /dev/null @@ -1,46 +0,0 @@ -/*! - * Vencord, a modification for Discord's desktop app - * Copyright (c) 2022 Vendicated and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . -*/ -/*! - * idb-keyval v6.2.0 - * Copyright 2016, Jake Archibald - * Copyright 2022, Vendicated - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/*! - * virtual-merge - * Copyright (c) 2023 Vendicated - * SPDX-License-Identifier: MIT - */ -/** - * apng-canvas v2.1.2 - * - * @copyright 2011-2019 David Mzareulyan - * @link https://github.com/davidmz/apng-canvas - * @license MIT - */ diff --git a/vesktop/vencordDist/vencordDesktopRenderer.js.map b/vesktop/vencordDist/vencordDesktopRenderer.js.map deleted file mode 100644 index e415146..0000000 --- a/vesktop/vencordDist/vencordDesktopRenderer.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../scripts/build/inject/react.mjs", "../src/utils/Logger.ts", "../src/utils/margins.ts", "../src/utils/lazy.ts", "../src/utils/lazyReact.tsx", "../src/utils/patches.ts", "../src/debug/Tracer.ts", "../src/webpack/webpack.ts", "../src/webpack/common/classes.ts", "../src/webpack/common/internal.tsx", "../src/webpack/common/components.ts", "../src/webpack/common/menu.ts", "../src/webpack/common/react.ts", "../src/webpack/common/settingsStores.ts", "../src/webpack/common/stores.ts", "../src/webpack/common/types/components.d.ts", "../src/webpack/common/types/menu.d.ts", "../src/webpack/common/types/utils.d.ts", "../src/webpack/common/utils.ts", "../src/webpack/common/index.ts", "../src/utils/constants.ts", "../src/utils/misc.tsx", "../src/utils/react.tsx", "../src/components/ErrorCard.tsx", "../src/components/ErrorBoundary.tsx", "../src/components/Heart.tsx", "../src/components/DonateButton.tsx", "../src/components/Flex.tsx", "../src/utils/modal.tsx", "../src/utils/types.ts", "../src/plugins/_api/badges.tsx", "../src/plugins/_api/chatButtons.ts", "../src/plugins/_api/commands.ts", "../src/plugins/_api/contextMenu.ts", "../src/plugins/_api/memberListDecorators.ts", "../src/plugins/_api/messageAccessories.ts", "../src/plugins/_api/messageDecorations.ts", "../src/plugins/_api/messageEvents.ts", "../src/plugins/_api/messagePopover.ts", "../src/plugins/_api/notices.ts", "../src/plugins/_api/serverList.ts", "../src/plugins/_core/noTrack.ts", "../src/shared/debounce.ts", "../src/shared/SettingsStore.ts", "../src/utils/localStorage.ts", "../src/utils/Queue.ts", "../src/api/Notifications/NotificationComponent.tsx", "../src/api/DataStore/index.ts", "../src/api/Styles.ts", "../node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/index.browser.js", "../src/api/Notifications/notificationLog.tsx", "../src/api/Notifications/Notifications.tsx", "../src/api/Notifications/index.ts", "../node_modules/.pnpm/fflate@0.7.4/node_modules/fflate/esm/browser.js", "../src/utils/cloud.tsx", "../src/utils/native.ts", "../src/utils/web.ts", "../src/utils/settingsSync.ts", "../src/api/Settings.ts", "git-hash:~git-hash", "../src/utils/updater.ts", "../src/components/handleComponentFailed.ts", "../src/utils/onlyOnce.ts", "../src/components/VencordSettings/shared.tsx", "../src/components/VencordSettings/VencordTab.tsx", "../src/api/Notices.ts", "../src/components/Icons.tsx", "../src/utils/text.ts", "../src/api/Commands/commandHelpers.ts", "../src/api/Commands/types.ts", "../src/api/Commands/index.ts", "../src/components/Badge.tsx", "../src/components/PluginSettings/components/SettingBooleanComponent.tsx", "../src/components/PluginSettings/components/SettingCustomComponent.tsx", "../src/components/PluginSettings/components/SettingNumericComponent.tsx", "../src/components/PluginSettings/components/SettingSelectComponent.tsx", "../src/components/PluginSettings/components/SettingSliderComponent.tsx", "../src/components/PluginSettings/components/SettingTextComponent.tsx", "../src/components/PluginSettings/components/index.ts", "../src/utils/discord.tsx", "../src/components/PluginSettings/ContributorModal.tsx", "../src/components/PluginSettings/PluginModal.tsx", "../src/components/Switch.tsx", "../src/components/VencordSettings/AddonCard.tsx", "../src/utils/ChangeList.ts", "../src/api/ContextMenu.ts", "../src/plugins/index.ts", "../src/components/PluginSettings/index.tsx", "../src/components/VencordSettings/PluginsTab.tsx", "../src/components/Link.tsx", "../src/components/VencordSettings/ThemesTab.tsx", "../src/components/VencordSettings/UpdaterTab.tsx", "../src/components/CheckedTextInput.tsx", "../src/components/VencordSettings/CloudTab.tsx", "../src/components/VencordSettings/BackupAndRestoreTab.tsx", "../src/plugins/_core/settings.tsx", "../src/plugins/_core/supportHelper.tsx", "../src/plugins/alwaysAnimate/index.ts", "../src/plugins/alwaysTrust/index.ts", "../src/plugins/anonymiseFileNames/index.tsx", "../src/plugins/arRPC.web/index.tsx", "../src/plugins/banger/index.ts", "../src/plugins/betterFolders/FolderSideBar.tsx", "../src/plugins/betterFolders/index.tsx", "../src/plugins/betterGifAltText/index.ts", "../src/plugins/betterGifPicker/index.ts", "../src/plugins/betterNotes/index.tsx", "../src/plugins/betterRoleContext/index.tsx", "../src/plugins/betterRoleDot/index.ts", "../src/plugins/betterSettings/index.tsx", "../src/plugins/betterUploadButton/index.ts", "../src/plugins/biggerStreamPreview/webpack/stores.ts", "../src/plugins/biggerStreamPreview/index.tsx", "../src/plugins/blurNsfw/index.ts", "../src/plugins/callTimer/index.tsx", "../src/api/MessageEvents.ts", "../src/plugins/clearURLs/defaultRules.ts", "../src/plugins/clearURLs/index.ts", "../src/plugins/clientTheme/index.tsx", "../src/plugins/colorSighted/index.ts", "../src/plugins/consoleShortcuts/index.ts", "../src/plugins/copyUserURLs/index.tsx", "../src/plugins/crashHandler/index.ts", "../src/utils/guards.ts", "../src/plugins/customRPC/index.tsx", "../src/plugins/dearrow/index.tsx", "../src/plugins/decor/lib/constants.ts", "../src/plugins/decor/lib/stores/AuthorizationStore.tsx", "../src/plugins/decor/lib/api.ts", "../src/plugins/decor/lib/utils/decoration.ts", "../src/plugins/decor/lib/stores/UsersDecorationsStore.ts", "../src/plugins/decor/lib/stores/CurrentUserDecorationsStore.ts", "../src/plugins/decor/ui/index.ts", "../src/plugins/decor/ui/components/index.ts", "../src/plugins/decor/ui/components/DecorationGridCreate.tsx", "../src/plugins/decor/ui/components/DecorationGridNone.tsx", "../src/plugins/decor/ui/components/DecorationContextMenu.tsx", "../src/plugins/decor/ui/components/DecorDecorationGridDecoration.tsx", "../src/plugins/decor/ui/components/Grid.tsx", "../src/plugins/decor/ui/components/SectionedGridList.tsx", "../src/plugins/decor/ui/modals/CreateDecorationModal.tsx", "../src/plugins/decor/ui/modals/GuidelinesModal.tsx", "../src/plugins/decor/ui/modals/ChangeDecorationModal.tsx", "../src/plugins/decor/ui/components/DecorSection.tsx", "../src/plugins/decor/settings.tsx", "../src/plugins/decor/index.tsx", "../src/plugins/disableCallIdle/index.ts", "../src/plugins/emoteCloner/index.tsx", "../src/plugins/experiments/index.tsx", "../src/plugins/f8break/index.ts", "../src/utils/web-metadata.ts", "../src/utils/apng-canvas.js", "../src/utils/dependencies.ts", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/index.js", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/constants.js", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/stream.js", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/lzwEncode.js", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/rgb-packing.js", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/pnnquant2.js", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/color.js", "../node_modules/.pnpm/github.com+mattdesl+gifenc@64842fca317b112a8590f8fef2bf3825da8f6fe3/node_modules/gifenc/src/palettize.js", "../src/plugins/fakeNitro/index.tsx", "../node_modules/.pnpm/virtual-merge@1.0.1/node_modules/virtual-merge/dist/index.mjs", "../src/plugins/fakeProfileThemes/index.tsx", "../src/plugins/favEmojiFirst/index.ts", "../src/plugins/favGifSearch/index.tsx", "../src/plugins/fixCodeblockGap/index.ts", "../src/plugins/fixSpotifyEmbeds.desktop/index.ts", "../src/plugins/fixYoutubeEmbeds.desktop/index.ts", "../src/plugins/forceOwnerCrown/index.ts", "../src/plugins/friendInvites/index.ts", "../src/plugins/friendsSince/index.tsx", "managed-style:src/plugins/gameActivityToggle/style.css", "../src/plugins/gameActivityToggle/index.tsx", "../src/plugins/gifPaste/index.ts", "../src/plugins/greetStickerPicker/index.tsx", "../src/api/MessagePopover.ts", "../src/plugins/hideAttachments/index.tsx", "../src/plugins/iLoveSpam/index.ts", "../src/plugins/ignoreActivities/index.tsx", "../src/plugins/imageZoom/constants.ts", "../src/plugins/imageZoom/utils/waitFor.ts", "../src/plugins/imageZoom/components/Magnifier.tsx", "managed-style:src/plugins/imageZoom/styles.css", "../src/plugins/imageZoom/index.tsx", "../src/api/ChatButtons.tsx", "../src/plugins/invisibleChat.desktop/components/DecryptionModal.tsx", "../src/plugins/invisibleChat.desktop/components/EncryptionModal.tsx", "../src/plugins/invisibleChat.desktop/index.tsx", "../src/plugins/keepCurrentChannel/index.ts", "../src/plugins/lastfm/index.tsx", "../src/plugins/loadingQuotes/index.ts", "../src/plugins/memberCount/OnlineMemberCountStore.ts", "../src/plugins/memberCount/MemberCount.tsx", "../src/plugins/memberCount/index.tsx", "../src/plugins/messageClickActions/index.ts", "../src/api/MessageAccessories.ts", "../src/plugins/messageLinkEmbeds/index.tsx", "managed-style:src/plugins/messageLogger/deleteStyleOverlay.css", "managed-style:src/plugins/messageLogger/deleteStyleText.css", "../src/plugins/messageLogger/index.tsx", "../src/plugins/messageTags/index.ts", "../src/plugins/moreCommands/index.ts", "../src/plugins/moreKaomoji/index.ts", "../src/plugins/moreUserTags/index.tsx", "../src/plugins/moyai/index.ts", "../src/plugins/mutualGroupDMs/index.tsx", "../src/plugins/newGuildSettings/index.tsx", "../src/plugins/noBlockedMessages/index.ts", "../src/plugins/noDevtoolsWarning/index.ts", "../src/plugins/noF1/index.ts", "managed-style:src/plugins/noMosaic/styles.css", "../src/plugins/noMosaic/index.ts", "../src/plugins/noPendingCount/index.ts", "../src/plugins/noProfileThemes/index.ts", "../src/plugins/noReplyMention/index.tsx", "../src/plugins/noScreensharePreview/index.ts", "../src/plugins/noTypingAnimation/index.ts", "../src/plugins/noUnblockToJump/index.ts", "../src/plugins/normalizeMessageLinks/index.ts", "../src/plugins/notificationVolume/index.ts", "../src/plugins/nsfwGateBypass/index.ts", "../src/plugins/onePingPerDM/index.ts", "../src/plugins/oneko/index.ts", "../src/plugins/openInApp/index.ts", "../src/plugins/overrideForumDefaults/index.tsx", "../src/plugins/partyMode/index.ts", "../src/plugins/permissionFreeWill/index.ts", "../src/plugins/permissionsViewer/utils.ts", "../src/plugins/permissionsViewer/components/icons.tsx", "../src/plugins/permissionsViewer/components/RolesAndUsersPermissions.tsx", "../src/components/ExpandableHeader.tsx", "../src/plugins/permissionsViewer/components/UserPermissions.tsx", "../src/plugins/permissionsViewer/index.tsx", "../src/plugins/petpet/index.ts", "../src/plugins/pictureInPicture/index.tsx", "../src/plugins/pinDms/constants.ts", "../src/plugins/pinDms/data.ts", "../src/plugins/pinDms/components/CreateCategoryModal.tsx", "../src/plugins/pinDms/components/contextMenu.tsx", "../src/plugins/pinDms/index.tsx", "../src/plugins/plainFolderIcon/index.ts", "../src/api/MemberListDecorators.ts", "../src/api/MessageDecorations.ts", "../src/plugins/platformIndicators/index.tsx", "../src/plugins/previewMessage/index.tsx", "../src/plugins/pronoundb/components/PronounsAboutComponent.tsx", "git-remote:~git-remote", "../src/shared/vencordUserAgent.ts", "../src/plugins/pronoundb/settings.ts", "../src/plugins/pronoundb/types.ts", "../src/plugins/pronoundb/pronoundbUtils.ts", "../src/plugins/pronoundb/components/PronounsChatComponent.tsx", "../src/plugins/pronoundb/index.ts", "../src/plugins/quickMention/index.tsx", "../src/plugins/quickReply/index.ts", "../src/plugins/reactErrorDecoder/index.ts", "../src/api/ServerList.ts", "../src/plugins/readAllNotificationsButton/index.tsx", "../src/plugins/relationshipNotifier/settings.ts", "../src/plugins/relationshipNotifier/types.ts", "../src/plugins/relationshipNotifier/utils.ts", "../src/plugins/relationshipNotifier/functions.ts", "../src/plugins/relationshipNotifier/index.ts", "../src/plugins/resurrectHome/index.tsx", "../src/plugins/revealAllSpoilers/index.ts", "../src/plugins/reverseImageSearch/index.tsx", "../src/plugins/reviewDB/auth.tsx", "../src/plugins/reviewDB/entities.ts", "../src/plugins/reviewDB/utils.tsx", "../src/plugins/reviewDB/components/BlockedUserModal.tsx", "../src/plugins/reviewDB/settings.tsx", "../src/plugins/reviewDB/reviewDbApi.ts", "../src/plugins/reviewDB/components/MessageButton.tsx", "../src/plugins/reviewDB/components/ReviewBadge.tsx", "../src/plugins/reviewDB/components/ReviewComponent.tsx", "../src/plugins/reviewDB/components/ReviewsView.tsx", "../src/plugins/reviewDB/components/ReviewModal.tsx", "../src/plugins/reviewDB/index.tsx", "../src/plugins/roleColorEverywhere/index.tsx", "../src/plugins/searchReply/index.tsx", "../src/plugins/secretRingTone/index.ts", "../src/plugins/sendTimestamps/index.tsx", "../src/plugins/serverListIndicators/index.tsx", "../src/plugins/serverProfile/GuildProfileModal.tsx", "../src/plugins/serverProfile/index.tsx", "include-file:~fileContent/previewExample.tsx", "../node_modules/.pnpm/eventemitter3@4.0.7/node_modules/eventemitter3/index.js", "../node_modules/.pnpm/@vap+core@0.0.12/node_modules/@vap/core/ipc/channel.js", "../node_modules/.pnpm/@vap+core@0.0.12/node_modules/@vap/core/ipc/rpc.js", "../node_modules/.pnpm/@vap+core@0.0.12/node_modules/@vap/core/ipc/worker.js", "../node_modules/.pnpm/@vap+core@0.0.12/node_modules/@vap/core/ipc/index.js", "../src/plugins/shikiCodeblocks.desktop/hooks/useTheme.ts", "../src/plugins/shikiCodeblocks.desktop/api/languages.ts", "../src/plugins/shikiCodeblocks.desktop/api/themes.ts", "../src/plugins/shikiCodeblocks.desktop/api/shiki.ts", "managed-style:src/plugins/shikiCodeblocks.desktop/devicon.css", "../src/plugins/shikiCodeblocks.desktop/types.ts", "../src/plugins/shikiCodeblocks.desktop/settings.ts", "../src/plugins/shikiCodeblocks.desktop/hooks/useShikiSettings.ts", "../src/plugins/shikiCodeblocks.desktop/utils/color.ts", "../src/plugins/shikiCodeblocks.desktop/utils/misc.ts", "../src/plugins/shikiCodeblocks.desktop/hooks/useCopyCooldown.ts", "../src/plugins/shikiCodeblocks.desktop/components/CopyButton.tsx", "../src/plugins/shikiCodeblocks.desktop/components/ButtonRow.tsx", "../src/plugins/shikiCodeblocks.desktop/components/Code.tsx", "../src/plugins/shikiCodeblocks.desktop/components/Header.tsx", "../src/plugins/shikiCodeblocks.desktop/components/Highlighter.tsx", "../src/plugins/shikiCodeblocks.desktop/utils/createStyle.ts", "../src/plugins/shikiCodeblocks.desktop/index.ts", "../src/plugins/showAllMessageButtons/index.ts", "../src/plugins/showConnections/VerifiedIcon.tsx", "../src/plugins/showConnections/index.tsx", "../src/plugins/showHiddenChannels/components/HiddenChannelLockScreen.tsx", "../src/plugins/showHiddenChannels/index.tsx", "../src/plugins/showMeYourName/index.tsx", "../src/plugins/showTimeouts/index.ts", "../src/plugins/silentMessageToggle/index.tsx", "../src/plugins/silentTyping/index.tsx", "../src/plugins/sortFriendRequests/index.tsx", "managed-style:src/plugins/spotifyControls/hoverOnly.css", "../src/plugins/spotifyControls/SpotifyStore.ts", "../src/plugins/spotifyControls/PlayerComponent.tsx", "../src/plugins/spotifyControls/index.tsx", "../src/plugins/spotifyCrack/index.ts", "../src/plugins/spotifyShareCommands/index.ts", "../src/plugins/startupTimings/StartupTimingPage.tsx", "../src/plugins/startupTimings/index.tsx", "../src/plugins/superReactionTweaks/index.ts", "../src/plugins/textReplace/index.tsx", "../src/plugins/themeAttributes/index.ts", "../src/plugins/timeBarAllActivities/index.ts", "../src/plugins/translate/settings.ts", "../src/plugins/translate/languages.ts", "../src/plugins/translate/utils.ts", "../src/plugins/translate/TranslateModal.tsx", "../src/plugins/translate/TranslateIcon.tsx", "../src/plugins/translate/TranslationAccessory.tsx", "../src/plugins/translate/index.tsx", "../src/plugins/typingTweaks/index.tsx", "../src/plugins/typingIndicator/index.tsx", "../src/plugins/unindent/index.ts", "../src/plugins/unsuppressEmbeds/index.tsx", "../src/plugins/urbanDictionary/index.ts", "../src/plugins/userVoiceShow/components/VoiceChannelSection.tsx", "../src/plugins/userVoiceShow/index.tsx", "managed-style:src/plugins/usrbg/index.css", "../src/plugins/usrbg/index.tsx", "../src/plugins/validUser/index.tsx", "../src/plugins/vcDoubleClick/index.ts", "../src/plugins/vcNarrator/index.tsx", "../src/plugins/vencordToolbox/index.tsx", "../src/plugins/viewIcons/index.tsx", "../src/components/CodeBlock.tsx", "../src/plugins/viewRaw/index.tsx", "../src/plugins/voiceMessages/settings.ts", "../src/plugins/voiceMessages/DesktopRecorder.tsx", "../src/plugins/voiceMessages/utils.ts", "../src/plugins/voiceMessages/VoicePreview.tsx", "../src/plugins/voiceMessages/WebRecorder.tsx", "../src/plugins/voiceMessages/index.tsx", "../src/plugins/webContextMenus.web/index.ts", "../src/plugins/webKeybinds.web/index.ts", "../src/plugins/whoReacted/index.tsx", "../src/plugins/wikisearch/index.ts", "../src/plugins/xsOverlay.desktop/index.ts", "import-plugins:~plugins", "../src/api/Badges.ts", "../src/api/index.ts", "../src/Vencord.ts", "../src/utils/index.ts", "../src/shared/onceDefined.ts", "../src/utils/quickCss.ts", "../src/webpack/index.ts", "../src/webpack/patchWebpack.ts"], - "sourcesContent": ["/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport const VencordFragment = /* #__PURE__*/ Symbol.for(\"react.fragment\");\nexport let VencordCreateElement =\n (...args) => (VencordCreateElement = Vencord.Webpack.Common.React.createElement)(...args);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport class Logger {\n /**\n * Returns the console format args for a title with the specified background colour and black text\n * @param color Background colour\n * @param title Text\n * @returns Array. Destructure this into {@link Logger}.errorCustomFmt or console.log\n *\n * @example logger.errorCustomFmt(...Logger.makeTitleElements(\"white\", \"Hello\"), \"World\");\n */\n static makeTitle(color: string, title: string): [string, ...string[]] {\n return [\"%c %c %s \", \"\", `background: ${color}; color: black; font-weight: bold; border-radius: 5px;`, title];\n }\n\n constructor(public name: string, public color: string = \"white\") { }\n\n private _log(level: \"log\" | \"error\" | \"warn\" | \"info\" | \"debug\", levelColor: string, args: any[], customFmt = \"\") {\n console[level](\n `%c Vencord %c %c ${this.name} ${customFmt}`,\n `background: ${levelColor}; color: black; font-weight: bold; border-radius: 5px;`,\n \"\",\n `background: ${this.color}; color: black; font-weight: bold; border-radius: 5px;`\n , ...args\n );\n }\n\n public log(...args: any[]) {\n this._log(\"log\", \"#a6d189\", args);\n }\n\n public info(...args: any[]) {\n this._log(\"info\", \"#a6d189\", args);\n }\n\n public error(...args: any[]) {\n this._log(\"error\", \"#e78284\", args);\n }\n\n public errorCustomFmt(fmt: string, ...args: any[]) {\n this._log(\"error\", \"#e78284\", args, fmt);\n }\n\n public warn(...args: any[]) {\n this._log(\"warn\", \"#e5c890\", args);\n }\n\n public debug(...args: any[]) {\n this._log(\"debug\", \"#eebebe\", args);\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nlet styleStr = \"\";\n\nexport const Margins: Record<`${\"top\" | \"bottom\" | \"left\" | \"right\"}${8 | 16 | 20}`, string> = {} as any;\n\nfor (const dir of [\"top\", \"bottom\", \"left\", \"right\"] as const) {\n for (const size of [8, 16, 20] as const) {\n const cl = `vc-m-${dir}-${size}`;\n Margins[`${dir}${size}`] = cl;\n styleStr += `.${cl}{margin-${dir}:${size}px;}`;\n }\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", () =>\n document.head.append(Object.assign(document.createElement(\"style\"), {\n textContent: styleStr,\n id: \"vencord-margins\"\n })), { once: true });\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function makeLazy(factory: () => T, attempts = 5): () => T {\n let tries = 0;\n let cache: T;\n return () => {\n if (!cache && attempts > tries++) {\n cache = factory();\n if (!cache && attempts === tries)\n console.error(\"Lazy factory failed:\", factory);\n }\n return cache;\n };\n}\n\n// Proxies demand that these properties be unmodified, so proxyLazy\n// will always return the function default for them.\nconst unconfigurable = [\"arguments\", \"caller\", \"prototype\"];\n\nconst handler: ProxyHandler = {};\n\nconst kGET = Symbol.for(\"vencord.lazy.get\");\nconst kCACHE = Symbol.for(\"vencord.lazy.cached\");\n\nfor (const method of [\n \"apply\",\n \"construct\",\n \"defineProperty\",\n \"deleteProperty\",\n \"getOwnPropertyDescriptor\",\n \"getPrototypeOf\",\n \"has\",\n \"isExtensible\",\n \"ownKeys\",\n \"preventExtensions\",\n \"set\",\n \"setPrototypeOf\"\n]) {\n handler[method] =\n (target: any, ...args: any[]) => Reflect[method](target[kGET](), ...args);\n}\n\nhandler.ownKeys = target => {\n const v = target[kGET]();\n const keys = Reflect.ownKeys(v);\n for (const key of unconfigurable) {\n if (!keys.includes(key)) keys.push(key);\n }\n return keys;\n};\n\nhandler.getOwnPropertyDescriptor = (target, p) => {\n if (typeof p === \"string\" && unconfigurable.includes(p))\n return Reflect.getOwnPropertyDescriptor(target, p);\n\n const descriptor = Reflect.getOwnPropertyDescriptor(target[kGET](), p);\n\n if (descriptor) Object.defineProperty(target, p, descriptor);\n return descriptor;\n};\n\n/**\n * Wraps the result of {@link makeLazy} in a Proxy you can consume as if it wasn't lazy.\n * On first property access, the lazy is evaluated\n * @param factory lazy factory\n * @param attempts how many times to try to evaluate the lazy before giving up\n * @returns Proxy\n *\n * Note that the example below exists already as an api, see {@link findByPropsLazy}\n * @example const mod = proxyLazy(() => findByProps(\"blah\")); console.log(mod.blah);\n */\nexport function proxyLazy(factory: () => T, attempts = 5, isChild = false): T {\n let isSameTick = true;\n if (!isChild)\n setTimeout(() => isSameTick = false, 0);\n\n let tries = 0;\n const proxyDummy = Object.assign(function () { }, {\n [kCACHE]: void 0 as T | undefined,\n [kGET]() {\n if (!proxyDummy[kCACHE] && attempts > tries++) {\n proxyDummy[kCACHE] = factory();\n if (!proxyDummy[kCACHE] && attempts === tries)\n console.error(\"Lazy factory failed:\", factory);\n }\n return proxyDummy[kCACHE];\n }\n });\n\n return new Proxy(proxyDummy, {\n ...handler,\n get(target, p, receiver) {\n // if we're still in the same tick, it means the lazy was immediately used.\n // thus, we lazy proxy the get access to make things like destructuring work as expected\n // meow here will also be a lazy\n // `const { meow } = findByPropsLazy(\"meow\");`\n if (!isChild && isSameTick)\n return proxyLazy(\n () => Reflect.get(target[kGET](), p, receiver),\n attempts,\n true\n );\n\n return Reflect.get(target[kGET](), p, receiver);\n }\n }) as any;\n}\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { ComponentType } from \"react\";\n\nimport { makeLazy } from \"./lazy\";\n\nconst NoopComponent = () => null;\n\n/**\n * A lazy component. The factory method is called on first render.\n * @param factory Function returning a Component\n * @param attempts How many times to try to get the component before giving up\n * @returns Result of factory function\n */\nexport function LazyComponent(factory: () => React.ComponentType, attempts = 5) {\n const get = makeLazy(factory, attempts);\n const LazyComponent = (props: T) => {\n const Component = get() ?? NoopComponent;\n return ;\n };\n\n LazyComponent.$$vencordInternal = get;\n\n return LazyComponent as ComponentType;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { PatchReplacement, ReplaceFn } from \"./types\";\n\nexport function canonicalizeMatch(match: RegExp | string) {\n if (typeof match === \"string\") return match;\n const canonSource = match.source\n .replaceAll(\"\\\\i\", \"[A-Za-z_$][\\\\w$]*\");\n return new RegExp(canonSource, match.flags);\n}\n\nexport function canonicalizeReplace(replace: string | ReplaceFn, pluginName: string): string | ReplaceFn {\n const self = `Vencord.Plugins.plugins[${JSON.stringify(pluginName)}]`;\n\n if (typeof replace !== \"function\")\n return replace.replaceAll(\"$self\", self);\n\n return (...args) => replace(...args).replaceAll(\"$self\", self);\n}\n\nexport function canonicalizeDescriptor(descriptor: TypedPropertyDescriptor, canonicalize: (value: T) => T) {\n if (descriptor.get) {\n const original = descriptor.get;\n descriptor.get = function () {\n return canonicalize(original.call(this));\n };\n } else if (descriptor.value) {\n descriptor.value = canonicalize(descriptor.value);\n }\n return descriptor;\n}\n\nexport function canonicalizeReplacement(replacement: Pick, plugin: string) {\n const descriptors = Object.getOwnPropertyDescriptors(replacement);\n descriptors.match = canonicalizeDescriptor(descriptors.match, canonicalizeMatch);\n descriptors.replace = canonicalizeDescriptor(\n descriptors.replace,\n replace => canonicalizeReplace(replace, plugin),\n );\n Object.defineProperties(replacement, descriptors);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Logger } from \"@utils/Logger\";\n\nif (IS_DEV) {\n var traces = {} as Record;\n var logger = new Logger(\"Tracer\", \"#FFD166\");\n}\n\nconst noop = function () { };\n\nexport const beginTrace = !IS_DEV ? noop :\n function beginTrace(name: string, ...args: any[]) {\n if (name in traces)\n throw new Error(`Trace ${name} already exists!`);\n\n traces[name] = [performance.now(), args];\n };\n\nexport const finishTrace = !IS_DEV ? noop : function finishTrace(name: string) {\n const end = performance.now();\n\n const [start, args] = traces[name];\n delete traces[name];\n\n logger.debug(`${name} took ${end - start}ms`, args);\n};\n\ntype Func = (...args: any[]) => any;\ntype TraceNameMapper = (...args: Parameters) => string;\n\nconst noopTracer =\n (name: string, f: F, mapper?: TraceNameMapper) => f;\n\nexport const traceFunction = !IS_DEV\n ? noopTracer\n : function traceFunction(name: string, f: F, mapper?: TraceNameMapper): F {\n return function (this: any, ...args: Parameters) {\n const traceName = mapper?.(...args) ?? name;\n\n beginTrace(traceName, ...arguments);\n try {\n return f.apply(this, args);\n } finally {\n finishTrace(traceName);\n }\n } as F;\n };\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { proxyLazy } from \"@utils/lazy\";\nimport { LazyComponent } from \"@utils/lazyReact\";\nimport { Logger } from \"@utils/Logger\";\nimport { canonicalizeMatch } from \"@utils/patches\";\nimport type { WebpackInstance } from \"discord-types/other\";\n\nimport { traceFunction } from \"../debug/Tracer\";\n\nconst logger = new Logger(\"Webpack\");\n\nexport let _resolveReady: () => void;\n/**\n * Fired once a gateway connection to Discord has been established.\n * This indicates that the core webpack modules have been initialised\n */\nexport const onceReady = new Promise(r => _resolveReady = r);\n\nexport let wreq: WebpackInstance;\nexport let cache: WebpackInstance[\"c\"];\n\nexport type FilterFn = (mod: any) => boolean;\n\nexport const filters = {\n byProps: (...props: string[]): FilterFn =>\n props.length === 1\n ? m => m[props[0]] !== void 0\n : m => props.every(p => m[p] !== void 0),\n\n byCode: (...code: string[]): FilterFn => m => {\n if (typeof m !== \"function\") return false;\n const s = Function.prototype.toString.call(m);\n for (const c of code) {\n if (!s.includes(c)) return false;\n }\n return true;\n },\n byStoreName: (name: string): FilterFn => m =>\n m.constructor?.displayName === name,\n\n componentByCode: (...code: string[]): FilterFn => {\n const filter = filters.byCode(...code);\n return m => {\n if (filter(m)) return true;\n if (!m.$$typeof) return false;\n if (m.type && m.type.render) return filter(m.type.render); // memo + forwardRef\n if (m.type) return filter(m.type); // memos\n if (m.render) return filter(m.render); // forwardRefs\n return false;\n };\n }\n};\n\nexport const subscriptions = new Map();\nexport const listeners = new Set();\n\nexport type CallbackFn = (mod: any, id: string) => void;\n\nexport function _initWebpack(instance: typeof window.webpackChunkdiscord_app) {\n if (cache !== void 0) throw \"no.\";\n\n instance.push([[Symbol(\"Vencord\")], {}, r => wreq = r]);\n instance.pop();\n if (!wreq) return false;\n\n cache = wreq.c;\n return true;\n}\n\nlet devToolsOpen = false;\nif (IS_DEV && IS_DISCORD_DESKTOP) {\n // At this point in time, DiscordNative has not been exposed yet, so setImmediate is needed\n setTimeout(() => {\n DiscordNative/* just to make sure */?.window.setDevtoolsCallbacks(() => devToolsOpen = true, () => devToolsOpen = false);\n }, 0);\n}\n\nfunction handleModuleNotFound(method: string, ...filter: unknown[]) {\n const err = new Error(`webpack.${method} found no module`);\n logger.error(err, \"Filter:\", filter);\n\n // Strict behaviour in DevBuilds to fail early and make sure the issue is found\n if (IS_DEV && !devToolsOpen)\n throw err;\n}\n\n/**\n * Find the first module that matches the filter\n */\nexport const find = traceFunction(\"find\", function find(filter: FilterFn, { isIndirect = false, isWaitFor = false }: { isIndirect?: boolean; isWaitFor?: boolean; } = {}) {\n if (typeof filter !== \"function\")\n throw new Error(\"Invalid filter. Expected a function got \" + typeof filter);\n\n for (const key in cache) {\n const mod = cache[key];\n if (!mod?.exports) continue;\n\n if (filter(mod.exports)) {\n return isWaitFor ? [mod.exports, key] : mod.exports;\n }\n\n if (mod.exports.default && filter(mod.exports.default)) {\n const found = mod.exports.default;\n return isWaitFor ? [found, key] : found;\n }\n }\n\n if (!isIndirect) {\n handleModuleNotFound(\"find\", filter);\n }\n\n return isWaitFor ? [null, null] : null;\n});\n\nexport function findAll(filter: FilterFn) {\n if (typeof filter !== \"function\")\n throw new Error(\"Invalid filter. Expected a function got \" + typeof filter);\n\n const ret = [] as any[];\n for (const key in cache) {\n const mod = cache[key];\n if (!mod?.exports) continue;\n\n if (filter(mod.exports))\n ret.push(mod.exports);\n\n if (mod.exports.default && filter(mod.exports.default))\n ret.push(mod.exports.default);\n }\n\n return ret;\n}\n\n/**\n * Same as {@link find} but in bulk\n * @param filterFns Array of filters. Please note that this array will be modified in place, so if you still\n * need it afterwards, pass a copy.\n * @returns Array of results in the same order as the passed filters\n */\nexport const findBulk = traceFunction(\"findBulk\", function findBulk(...filterFns: FilterFn[]) {\n if (!Array.isArray(filterFns))\n throw new Error(\"Invalid filters. Expected function[] got \" + typeof filterFns);\n\n const { length } = filterFns;\n\n if (length === 0)\n throw new Error(\"Expected at least two filters.\");\n\n if (length === 1) {\n if (IS_DEV) {\n throw new Error(\"bulk called with only one filter. Use find\");\n }\n return find(filterFns[0]);\n }\n\n const filters = filterFns as Array;\n\n let found = 0;\n const results = Array(length);\n\n outer:\n for (const key in cache) {\n const mod = cache[key];\n if (!mod?.exports) continue;\n\n for (let j = 0; j < length; j++) {\n const filter = filters[j];\n // Already done\n if (filter === undefined) continue;\n\n if (filter(mod.exports)) {\n results[j] = mod.exports;\n filters[j] = undefined;\n if (++found === length) break outer;\n break;\n }\n\n if (mod.exports.default && filter(mod.exports.default)) {\n results[j] = mod.exports.default;\n filters[j] = undefined;\n if (++found === length) break outer;\n break;\n }\n }\n }\n\n if (found !== length) {\n const err = new Error(`Got ${length} filters, but only found ${found} modules!`);\n if (IS_DEV) {\n if (!devToolsOpen)\n // Strict behaviour in DevBuilds to fail early and make sure the issue is found\n throw err;\n } else {\n logger.warn(err);\n }\n }\n\n return results;\n});\n\n/**\n * Find the id of the first module factory that includes all the given code\n * @returns string or null\n */\nexport const findModuleId = traceFunction(\"findModuleId\", function findModuleId(...code: string[]) {\n outer:\n for (const id in wreq.m) {\n const str = wreq.m[id].toString();\n\n for (const c of code) {\n if (!str.includes(c)) continue outer;\n }\n return id;\n }\n\n const err = new Error(\"Didn't find module with code(s):\\n\" + code.join(\"\\n\"));\n if (IS_DEV) {\n if (!devToolsOpen)\n // Strict behaviour in DevBuilds to fail early and make sure the issue is found\n throw err;\n } else {\n logger.warn(err);\n }\n\n return null;\n});\n\n/**\n * Find the first module factory that includes all the given code\n * @returns The module factory or null\n */\nexport function findModuleFactory(...code: string[]) {\n const id = findModuleId(...code);\n if (!id) return null;\n\n return wreq.m[id];\n}\n\nexport const lazyWebpackSearchHistory = [] as Array<[\"find\" | \"findByProps\" | \"findByCode\" | \"findStore\" | \"findComponent\" | \"findComponentByCode\" | \"findExportedComponent\" | \"waitFor\" | \"waitForComponent\" | \"waitForStore\" | \"proxyLazyWebpack\" | \"LazyComponentWebpack\" | \"extractAndLoadChunks\", any[]]>;\n\n/**\n * This is just a wrapper around {@link proxyLazy} to make our reporter test for your webpack finds.\n *\n * Wraps the result of {@link makeLazy} in a Proxy you can consume as if it wasn't lazy.\n * On first property access, the lazy is evaluated\n * @param factory lazy factory\n * @param attempts how many times to try to evaluate the lazy before giving up\n * @returns Proxy\n *\n * Note that the example below exists already as an api, see {@link findByPropsLazy}\n * @example const mod = proxyLazy(() => findByProps(\"blah\")); console.log(mod.blah);\n */\nexport function proxyLazyWebpack(factory: () => any, attempts?: number) {\n if (IS_DEV) lazyWebpackSearchHistory.push([\"proxyLazyWebpack\", [factory]]);\n\n return proxyLazy(factory, attempts);\n}\n\n/**\n * This is just a wrapper around {@link LazyComponent} to make our reporter test for your webpack finds.\n *\n * A lazy component. The factory method is called on first render.\n * @param factory Function returning a Component\n * @param attempts How many times to try to get the component before giving up\n * @returns Result of factory function\n */\nexport function LazyComponentWebpack(factory: () => any, attempts?: number) {\n if (IS_DEV) lazyWebpackSearchHistory.push([\"LazyComponentWebpack\", [factory]]);\n\n return LazyComponent(factory, attempts);\n}\n\n/**\n * Find the first module that matches the filter, lazily\n */\nexport function findLazy(filter: FilterFn) {\n if (IS_DEV) lazyWebpackSearchHistory.push([\"find\", [filter]]);\n\n return proxyLazy(() => find(filter));\n}\n\n/**\n * Find the first module that has the specified properties\n */\nexport function findByProps(...props: string[]) {\n const res = find(filters.byProps(...props), { isIndirect: true });\n if (!res)\n handleModuleNotFound(\"findByProps\", ...props);\n return res;\n}\n\n/**\n * Find the first module that has the specified properties, lazily\n */\nexport function findByPropsLazy(...props: string[]) {\n if (IS_DEV) lazyWebpackSearchHistory.push([\"findByProps\", props]);\n\n return proxyLazy(() => findByProps(...props));\n}\n\n/**\n * Find the first function that includes all the given code\n */\nexport function findByCode(...code: string[]) {\n const res = find(filters.byCode(...code), { isIndirect: true });\n if (!res)\n handleModuleNotFound(\"findByCode\", ...code);\n return res;\n}\n\n/**\n * Find the first function that includes all the given code, lazily\n */\nexport function findByCodeLazy(...code: string[]) {\n if (IS_DEV) lazyWebpackSearchHistory.push([\"findByCode\", code]);\n\n return proxyLazy(() => findByCode(...code));\n}\n\n/**\n * Find a store by its displayName\n */\nexport function findStore(name: string) {\n const res = find(filters.byStoreName(name), { isIndirect: true });\n if (!res)\n handleModuleNotFound(\"findStore\", name);\n return res;\n}\n\n/**\n * Find a store by its displayName, lazily\n */\nexport function findStoreLazy(name: string) {\n if (IS_DEV) lazyWebpackSearchHistory.push([\"findStore\", [name]]);\n\n return proxyLazy(() => findStore(name));\n}\n\n/**\n * Finds the component which includes all the given code. Checks for plain components, memos and forwardRefs\n */\nexport function findComponentByCode(...code: string[]) {\n const res = find(filters.componentByCode(...code), { isIndirect: true });\n if (!res)\n handleModuleNotFound(\"findComponentByCode\", ...code);\n return res;\n}\n\n/**\n * Finds the first component that matches the filter, lazily.\n */\nexport function findComponentLazy(filter: FilterFn) {\n if (IS_DEV) lazyWebpackSearchHistory.push([\"findComponent\", [filter]]);\n\n\n return LazyComponent(() => {\n const res = find(filter, { isIndirect: true });\n if (!res)\n handleModuleNotFound(\"findComponent\", filter);\n return res;\n });\n}\n\n/**\n * Finds the first component that includes all the given code, lazily\n */\nexport function findComponentByCodeLazy(...code: string[]) {\n if (IS_DEV) lazyWebpackSearchHistory.push([\"findComponentByCode\", code]);\n\n return LazyComponent(() => {\n const res = find(filters.componentByCode(...code), { isIndirect: true });\n if (!res)\n handleModuleNotFound(\"findComponentByCode\", ...code);\n return res;\n });\n}\n\n/**\n * Finds the first component that is exported by the first prop name, lazily\n */\nexport function findExportedComponentLazy(...props: string[]) {\n if (IS_DEV) lazyWebpackSearchHistory.push([\"findExportedComponent\", props]);\n\n return LazyComponent(() => {\n const res = find(filters.byProps(...props), { isIndirect: true });\n if (!res)\n handleModuleNotFound(\"findExportedComponent\", ...props);\n return res[props[0]];\n });\n}\n\n/**\n * Extract and load chunks using their entry point\n * @param code An array of all the code the module factory containing the entry point (as of using it to load chunks) must include\n * @param matcher A RegExp that returns the entry point id as the first capture group. Defaults to a matcher that captures the first entry point found in the module factory\n */\nexport async function extractAndLoadChunks(code: string[], matcher: RegExp = /\\.el\\(\"(.+?)\"\\)(?<=(\\i)\\.el.+?)\\.then\\(\\2\\.bind\\(\\2,\"\\1\"\\)\\)/) {\n const module = findModuleFactory(...code);\n if (!module) {\n const err = new Error(\"extractAndLoadChunks: Couldn't find module factory\");\n logger.warn(err, \"Code:\", code, \"Matcher:\", matcher);\n\n return;\n }\n\n const match = module.toString().match(canonicalizeMatch(matcher));\n if (!match) {\n const err = new Error(\"extractAndLoadChunks: Couldn't find entry point id in module factory code\");\n logger.warn(err, \"Code:\", code, \"Matcher:\", matcher);\n\n // Strict behaviour in DevBuilds to fail early and make sure the issue is found\n if (IS_DEV && !devToolsOpen)\n throw err;\n\n return;\n }\n\n const [, id] = match;\n if (!id || !Number(id)) {\n const err = new Error(\"extractAndLoadChunks: Matcher didn't return a capturing group with the entry point, or the entry point returned wasn't a number\");\n logger.warn(err, \"Code:\", code, \"Matcher:\", matcher);\n\n // Strict behaviour in DevBuilds to fail early and make sure the issue is found\n if (IS_DEV && !devToolsOpen)\n throw err;\n\n return;\n }\n\n await (wreq as any).el(id);\n return wreq(id as any);\n}\n\n/**\n * This is just a wrapper around {@link extractAndLoadChunks} to make our reporter test for your webpack finds.\n *\n * Extract and load chunks using their entry point\n * @param code An array of all the code the module factory containing the entry point (as of using it to load chunks) must include\n * @param matcher A RegExp that returns the entry point id as the first capture group. Defaults to a matcher that captures the first entry point found in the module factory\n * @returns A function that loads the chunks on first call\n */\nexport function extractAndLoadChunksLazy(code: string[], matcher: RegExp = /\\.el\\(\"(.+?)\"\\)(?<=(\\i)\\.el.+?)\\.then\\(\\2\\.bind\\(\\2,\"\\1\"\\)\\)/) {\n if (IS_DEV) lazyWebpackSearchHistory.push([\"extractAndLoadChunks\", [code, matcher]]);\n\n return () => extractAndLoadChunks(code, matcher);\n}\n\n/**\n * Wait for a module that matches the provided filter to be registered,\n * then call the callback with the module as the first argument\n */\nexport function waitFor(filter: string | string[] | FilterFn, callback: CallbackFn, { isIndirect = false }: { isIndirect?: boolean; } = {}) {\n if (IS_DEV && !isIndirect) lazyWebpackSearchHistory.push([\"waitFor\", Array.isArray(filter) ? filter : [filter]]);\n\n if (typeof filter === \"string\")\n filter = filters.byProps(filter);\n else if (Array.isArray(filter))\n filter = filters.byProps(...filter);\n else if (typeof filter !== \"function\")\n throw new Error(\"filter must be a string, string[] or function, got \" + typeof filter);\n\n if (cache != null) {\n const [existing, id] = find(filter, { isIndirect: true, isWaitFor: true });\n if (existing) return void callback(existing, id);\n }\n\n subscriptions.set(filter, callback);\n}\n\nexport function addListener(callback: CallbackFn) {\n listeners.add(callback);\n}\n\nexport function removeListener(callback: CallbackFn) {\n listeners.delete(callback);\n}\n\n/**\n * Search modules by keyword. This searches the factory methods,\n * meaning you can search all sorts of things, displayName, methodName, strings somewhere in the code, etc\n * @param filters One or more strings or regexes\n * @returns Mapping of found modules\n */\nexport function search(...filters: Array) {\n const results = {} as Record;\n const factories = wreq.m;\n outer:\n for (const id in factories) {\n const factory = factories[id].original ?? factories[id];\n const str: string = factory.toString();\n for (const filter of filters) {\n if (typeof filter === \"string\" && !str.includes(filter)) continue outer;\n if (filter instanceof RegExp && !filter.test(str)) continue outer;\n }\n results[id] = factory;\n }\n\n return results;\n}\n\n/**\n * Extract a specific module by id into its own Source File. This has no effect on\n * the code, it is only useful to be able to look at a specific module without having\n * to view a massive file. extract then returns the extracted module so you can jump to it.\n * As mentioned above, note that this extracted module is not actually used,\n * so putting breakpoints or similar will have no effect.\n * @param id The id of the module to extract\n */\nexport function extract(id: string | number) {\n const mod = wreq.m[id] as Function;\n if (!mod) return null;\n\n const code = `\n// [EXTRACTED] WebpackModule${id}\n// WARNING: This module was extracted to be more easily readable.\n// This module is NOT ACTUALLY USED! This means putting breakpoints will have NO EFFECT!!\n\n0,${mod.toString()}\n//# sourceURL=ExtractedWebpackModule${id}\n`;\n const extracted = (0, eval)(code);\n return extracted as Function;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { findByPropsLazy, findLazy } from \"@webpack\";\n\nimport * as t from \"./types/classes\";\n\nexport const ModalImageClasses: t.ImageModalClasses = findLazy(m => m.image && m.modal && !m.applicationIcon);\nexport const ButtonWrapperClasses: t.ButtonWrapperClasses = findByPropsLazy(\"buttonWrapper\", \"buttonContent\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { LazyComponent } from \"@utils/react\";\n\n// eslint-disable-next-line path-alias/no-relative\nimport { FilterFn, filters, lazyWebpackSearchHistory, waitFor } from \"../webpack\";\n\nexport function waitForComponent = React.ComponentType & Record>(name: string, filter: FilterFn | string | string[]): T {\n if (IS_DEV) lazyWebpackSearchHistory.push([\"waitForComponent\", Array.isArray(filter) ? filter : [filter]]);\n\n let myValue: T = function () {\n throw new Error(`Vencord could not find the ${name} Component`);\n } as any;\n\n const lazyComponent = LazyComponent(() => myValue) as T;\n waitFor(filter, (v: any) => {\n myValue = v;\n Object.assign(lazyComponent, v);\n }, { isIndirect: true });\n\n return lazyComponent;\n}\n\nexport function waitForStore(name: string, cb: (v: any) => void) {\n if (IS_DEV) lazyWebpackSearchHistory.push([\"waitForStore\", [name]]);\n\n waitFor(filters.byStoreName(name), cb, { isIndirect: true });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n// eslint-disable-next-line path-alias/no-relative\nimport { filters, findByPropsLazy, waitFor } from \"@webpack\";\n\nimport { waitForComponent } from \"./internal\";\nimport * as t from \"./types/components\";\n\nexport let Forms = {} as {\n FormTitle: t.FormTitle,\n FormSection: t.FormSection,\n FormDivider: t.FormDivider,\n FormText: t.FormText,\n};\n\nexport let Card: t.Card;\nexport let Button: t.Button;\nexport let Switch: t.Switch;\nexport let Tooltip: t.Tooltip;\nexport let TextInput: t.TextInput;\nexport let TextArea: t.TextArea;\nexport let Text: t.Text;\nexport let Select: t.Select;\nexport let SearchableSelect: t.SearchableSelect;\nexport let Slider: t.Slider;\nexport let ButtonLooks: t.ButtonLooks;\nexport let Popout: t.Popout;\nexport let Dialog: t.Dialog;\nexport let TabBar: any;\nexport let Paginator: t.Paginator;\nexport let ScrollerThin: t.ScrollerThin;\nexport let Clickable: t.Clickable;\nexport let Avatar: t.Avatar;\nexport let FocusLock: t.FocusLock;\n// token lagger real\n/** css colour resolver stuff, no clue what exactly this does, just copied usage from Discord */\nexport let useToken: t.useToken;\n\nexport const MaskedLink = waitForComponent(\"MaskedLink\", filters.componentByCode(\"MASKED_LINK)\"));\nexport const Timestamp = waitForComponent(\"Timestamp\", filters.byCode(\".Messages.MESSAGE_EDITED_TIMESTAMP_A11Y_LABEL.format\"));\nexport const Flex = waitForComponent(\"Flex\", [\"Justify\", \"Align\", \"Wrap\"]);\n\nexport const { OAuth2AuthorizeModal } = findByPropsLazy(\"OAuth2AuthorizeModal\");\n\nwaitFor([\"FormItem\", \"Button\"], m => {\n ({ useToken, Card, Button, FormSwitch: Switch, Tooltip, TextInput, TextArea, Text, Select, SearchableSelect, Slider, ButtonLooks, TabBar, Popout, Dialog, Paginator, ScrollerThin, Clickable, Avatar, FocusLock } = m);\n Forms = m;\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n// eslint-disable-next-line path-alias/no-relative\nimport { findByPropsLazy, waitFor } from \"../webpack\";\nimport type * as t from \"./types/menu\";\n\nexport let Menu = {} as t.Menu;\n\nwaitFor([\"MenuItem\", \"MenuSliderControl\"], m => Menu = m);\n\nexport const ContextMenuApi: t.ContextMenuApi = findByPropsLazy(\"closeContextMenu\", \"openContextMenu\");\n\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n// eslint-disable-next-line path-alias/no-relative\nimport { findByPropsLazy, waitFor } from \"../webpack\";\n\nexport let React: typeof import(\"react\");\nexport let useState: typeof React.useState;\nexport let useEffect: typeof React.useEffect;\nexport let useMemo: typeof React.useMemo;\nexport let useRef: typeof React.useRef;\nexport let useReducer: typeof React.useReducer;\nexport let useCallback: typeof React.useCallback;\n\nexport const ReactDOM: typeof import(\"react-dom\") & typeof import(\"react-dom/client\") = findByPropsLazy(\"createPortal\", \"render\");\n\nwaitFor(\"useState\", m => {\n React = m;\n ({ useEffect, useState, useMemo, useRef, useReducer, useCallback } = React);\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { findByPropsLazy } from \"@webpack\";\n\nimport * as t from \"./types/settingsStores\";\n\n\nexport const TextAndImagesSettingsStores = findByPropsLazy(\"MessageDisplayCompact\") as Record;\nexport const StatusSettingsStores = findByPropsLazy(\"ShowCurrentGame\") as Record;\n\nexport const UserSettingsActionCreators = findByPropsLazy(\"PreloadedUserSettingsActionCreators\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type * as Stores from \"discord-types/stores\";\n\n// eslint-disable-next-line path-alias/no-relative\nimport { findByPropsLazy } from \"../webpack\";\nimport { waitForStore } from \"./internal\";\nimport * as t from \"./types/stores\";\n\nexport const Flux: t.Flux = findByPropsLazy(\"connectStores\");\n\nexport type GenericStore = t.FluxStore & Record;\n\nexport enum DraftType {\n ChannelMessage = 0,\n ThreadSettings = 1,\n FirstThreadMessage = 2,\n ApplicationLauncherCommand = 3\n}\n\nexport let MessageStore: Omit & {\n getMessages(chanId: string): any;\n};\n\n// this is not actually a FluxStore\nexport const PrivateChannelsStore = findByPropsLazy(\"openPrivateChannel\");\nexport let PermissionStore: GenericStore;\nexport let GuildChannelStore: GenericStore;\nexport let ReadStateStore: GenericStore;\nexport let PresenceStore: GenericStore;\nexport let PoggerModeSettingsStore: GenericStore;\n\nexport let GuildStore: t.GuildStore;\nexport let UserStore: Stores.UserStore & t.FluxStore;\nexport let UserProfileStore: GenericStore;\nexport let SelectedChannelStore: Stores.SelectedChannelStore & t.FluxStore;\nexport let SelectedGuildStore: t.FluxStore & Record;\nexport let ChannelStore: Stores.ChannelStore & t.FluxStore;\nexport let GuildMemberStore: Stores.GuildMemberStore & t.FluxStore;\nexport let RelationshipStore: Stores.RelationshipStore & t.FluxStore & {\n /** Get the date (as a string) that the relationship was created */\n getSince(userId: string): string;\n};\n\nexport let EmojiStore: t.EmojiStore;\nexport let WindowStore: t.WindowStore;\nexport let DraftStore: t.DraftStore;\n\n/**\n * React hook that returns stateful data for one or more stores\n * You might need a custom comparator (4th argument) if your store data is an object\n *\n * @param stores The stores to listen to\n * @param mapper A function that returns the data you need\n * @param idk some thing, idk just pass null\n * @param isEqual A custom comparator for the data returned by mapper\n *\n * @example const user = useStateFromStores([UserStore], () => UserStore.getCurrentUser(), null, (old, current) => old.id === current.id);\n */\nexport const { useStateFromStores }: {\n useStateFromStores: (\n stores: t.FluxStore[],\n mapper: () => T,\n idk?: any,\n isEqual?: (old: T, newer: T) => boolean\n ) => T;\n}\n = findByPropsLazy(\"useStateFromStores\");\n\nwaitForStore(\"DraftStore\", s => DraftStore = s);\nwaitForStore(\"UserStore\", s => UserStore = s);\nwaitForStore(\"UserProfileStore\", m => UserProfileStore = m);\nwaitForStore(\"ChannelStore\", m => ChannelStore = m);\nwaitForStore(\"SelectedChannelStore\", m => SelectedChannelStore = m);\nwaitForStore(\"SelectedGuildStore\", m => SelectedGuildStore = m);\nwaitForStore(\"GuildStore\", m => GuildStore = m);\nwaitForStore(\"GuildMemberStore\", m => GuildMemberStore = m);\nwaitForStore(\"RelationshipStore\", m => RelationshipStore = m);\nwaitForStore(\"PermissionStore\", m => PermissionStore = m);\nwaitForStore(\"PresenceStore\", m => PresenceStore = m);\nwaitForStore(\"ReadStateStore\", m => ReadStateStore = m);\nwaitForStore(\"GuildChannelStore\", m => GuildChannelStore = m);\nwaitForStore(\"MessageStore\", m => MessageStore = m);\nwaitForStore(\"WindowStore\", m => WindowStore = m);\nwaitForStore(\"EmojiStore\", m => EmojiStore = m);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type { ComponentType, CSSProperties, FunctionComponent, HtmlHTMLAttributes, HTMLProps, KeyboardEvent, MouseEvent, PropsWithChildren, PropsWithRef, ReactNode, Ref } from \"react\";\n\nexport type TextVariant = \"heading-sm/normal\" | \"heading-sm/medium\" | \"heading-sm/semibold\" | \"heading-sm/bold\" | \"heading-md/normal\" | \"heading-md/medium\" | \"heading-md/semibold\" | \"heading-md/bold\" | \"heading-lg/normal\" | \"heading-lg/medium\" | \"heading-lg/semibold\" | \"heading-lg/bold\" | \"heading-xl/normal\" | \"heading-xl/medium\" | \"heading-xl/bold\" | \"heading-xxl/normal\" | \"heading-xxl/medium\" | \"heading-xxl/bold\" | \"eyebrow\" | \"heading-deprecated-14/normal\" | \"heading-deprecated-14/medium\" | \"heading-deprecated-14/bold\" | \"text-xxs/normal\" | \"text-xxs/medium\" | \"text-xxs/semibold\" | \"text-xxs/bold\" | \"text-xs/normal\" | \"text-xs/medium\" | \"text-xs/semibold\" | \"text-xs/bold\" | \"text-sm/normal\" | \"text-sm/medium\" | \"text-sm/semibold\" | \"text-sm/bold\" | \"text-md/normal\" | \"text-md/medium\" | \"text-md/semibold\" | \"text-md/bold\" | \"text-lg/normal\" | \"text-lg/medium\" | \"text-lg/semibold\" | \"text-lg/bold\" | \"display-sm\" | \"display-md\" | \"display-lg\" | \"code\";\nexport type FormTextTypes = Record<\"DEFAULT\" | \"INPUT_PLACEHOLDER\" | \"DESCRIPTION\" | \"LABEL_BOLD\" | \"LABEL_SELECTED\" | \"LABEL_DESCRIPTOR\" | \"ERROR\" | \"SUCCESS\", string>;\nexport type Heading = `h${1 | 2 | 3 | 4 | 5 | 6}`;\n\nexport type Margins = Record<\"marginTop16\" | \"marginTop8\" | \"marginBottom8\" | \"marginTop20\" | \"marginBottom20\", string>;\nexport type ButtonLooks = Record<\"FILLED\" | \"INVERTED\" | \"OUTLINED\" | \"LINK\" | \"BLANK\", string>;\n\nexport type TextProps = PropsWithChildren & {\n variant?: TextVariant;\n tag?: \"div\" | \"span\" | \"p\" | \"strong\" | Heading;\n selectable?: boolean;\n lineClamp?: number;\n}>;\n\nexport type Text = ComponentType;\n\nexport type FormTitle = ComponentType & PropsWithChildren<{\n /** default is h5 */\n tag?: Heading;\n faded?: boolean;\n disabled?: boolean;\n required?: boolean;\n error?: ReactNode;\n}>>;\n\nexport type FormSection = ComponentType>;\n\nexport type FormDivider = ComponentType<{\n className?: string;\n style?: CSSProperties;\n}>;\n\n\nexport type FormText = ComponentType & TextProps> & { Types: FormTextTypes; };\n\nexport type Tooltip = ComponentType<{\n text: ReactNode;\n children: FunctionComponent<{\n onClick(): void;\n onMouseEnter(): void;\n onMouseLeave(): void;\n onContextMenu(): void;\n onFocus(): void;\n onBlur(): void;\n \"aria-label\"?: string;\n }>;\n \"aria-label\"?: string;\n\n allowOverflow?: boolean;\n forceOpen?: boolean;\n hide?: boolean;\n hideOnClick?: boolean;\n shouldShow?: boolean;\n spacing?: number;\n\n /** Tooltip.Colors.BLACK */\n color?: string;\n /** TooltipPositions.TOP */\n position?: string;\n\n tooltipClassName?: string;\n tooltipContentClassName?: string;\n}> & {\n Colors: Record<\"BLACK\" | \"BRAND\" | \"CUSTOM\" | \"GREEN\" | \"GREY\" | \"PRIMARY\" | \"RED\" | \"YELLOW\", string>;\n};\n\nexport type TooltipPositions = Record<\"BOTTOM\" | \"CENTER\" | \"LEFT\" | \"RIGHT\" | \"TOP\" | \"WINDOW_CENTER\", string>;\n\nexport type Card = ComponentType & {\n editable?: boolean;\n outline?: boolean;\n /** Card.Types.PRIMARY */\n type?: string;\n}>> & {\n Types: Record<\"BRAND\" | \"CUSTOM\" | \"DANGER\" | \"PRIMARY\" | \"SUCCESS\" | \"WARNING\", string>;\n};\n\nexport type Button = ComponentType, \"size\"> & {\n /** Button.Looks.FILLED */\n look?: string;\n /** Button.Colors.BRAND */\n color?: string;\n /** Button.Sizes.MEDIUM */\n size?: string;\n /** Button.BorderColors.BLACK */\n borderColor?: string;\n\n wrapperClassName?: string;\n className?: string;\n innerClassName?: string;\n\n buttonRef?: Ref;\n focusProps?: any;\n submitting?: boolean;\n\n submittingStartedLabel?: string;\n submittingFinishedLabel?: string;\n}>> & {\n BorderColors: Record<\"BLACK\" | \"BRAND\" | \"BRAND_NEW\" | \"GREEN\" | \"LINK\" | \"PRIMARY\" | \"RED\" | \"TRANSPARENT\" | \"WHITE\" | \"YELLOW\", string>;\n Colors: Record<\"BRAND\" | \"RED\" | \"GREEN\" | \"YELLOW\" | \"PRIMARY\" | \"LINK\" | \"WHITE\" | \"BLACK\" | \"TRANSPARENT\" | \"BRAND_NEW\" | \"CUSTOM\", string>;\n Hovers: Record<\"DEFAULT\" | \"BRAND\" | \"RED\" | \"GREEN\" | \"YELLOW\" | \"PRIMARY\" | \"LINK\" | \"WHITE\" | \"BLACK\" | \"TRANSPARENT\", string>;\n Looks: Record<\"FILLED\" | \"INVERTED\" | \"OUTLINED\" | \"LINK\" | \"BLANK\", string>;\n Sizes: Record<\"NONE\" | \"TINY\" | \"SMALL\" | \"MEDIUM\" | \"LARGE\" | \"XLARGE\" | \"MIN\" | \"MAX\" | \"ICON\", string>;\n\n Link: any;\n};\n\nexport type Switch = ComponentType>;\n\nexport type Timestamp = ComponentType>;\n\nexport type TextInput = ComponentType;\n prefixElement?: ReactNode;\n\n focusProps?: any;\n\n /** TextInput.Sizes.DEFAULT */\n size?: string;\n} & Omit, \"onChange\">>> & {\n Sizes: Record<\"DEFAULT\" | \"MINI\", string>;\n};\n\nexport type TextArea = ComponentType, \"onChange\"> & {\n onChange(v: string): void;\n}>>;\n\ninterface SelectOption {\n disabled?: boolean;\n value: any;\n label: string;\n key?: React.Key;\n default?: boolean;\n}\n\nexport type Select = ComponentType; // TODO\n\n /**\n * - 0 ~ Filled\n * - 1 ~ Custom\n */\n look?: 0 | 1;\n className?: string;\n popoutClassName?: string;\n popoutPosition?: \"top\" | \"left\" | \"right\" | \"bottom\" | \"center\" | \"window_center\";\n optionClassName?: string;\n\n autoFocus?: boolean;\n isDisabled?: boolean;\n clearable?: boolean;\n closeOnSelect?: boolean;\n hideIcon?: boolean;\n\n select(value: any): void;\n isSelected(value: any): boolean;\n serialize(value: any): string;\n clear?(): void;\n\n maxVisibleItems?: number;\n popoutWidth?: number;\n\n onClose?(): void;\n onOpen?(): void;\n\n renderOptionLabel?(option: SelectOption): ReactNode;\n /** discord stupid this gets all options instead of one yeah */\n renderOptionValue?(option: SelectOption[]): ReactNode;\n\n \"aria-label\"?: boolean;\n \"aria-labelledby\"?: boolean;\n}>>;\n\nexport type SearchableSelect = ComponentType; // TODO\n value?: SelectOption;\n\n /**\n * - 0 ~ Filled\n * - 1 ~ Custom\n */\n look?: 0 | 1;\n className?: string;\n popoutClassName?: string;\n wrapperClassName?: string;\n popoutPosition?: \"top\" | \"left\" | \"right\" | \"bottom\" | \"center\" | \"window_center\";\n optionClassName?: string;\n\n autoFocus?: boolean;\n isDisabled?: boolean;\n clearable?: boolean;\n closeOnSelect?: boolean;\n clearOnSelect?: boolean;\n multi?: boolean;\n\n onChange(value: any): void;\n onSearchChange?(value: string): void;\n\n onClose?(): void;\n onOpen?(): void;\n onBlur?(): void;\n\n renderOptionPrefix?(option: SelectOption): ReactNode;\n renderOptionSuffix?(option: SelectOption): ReactNode;\n\n filter?(option: SelectOption[], query: string): SelectOption[];\n\n centerCaret?: boolean;\n debounceTime?: number;\n maxVisibleItems?: number;\n popoutWidth?: number;\n\n \"aria-labelledby\"?: boolean;\n}>>;\n\nexport type Slider = ComponentType>;\n\n// TODO - type maybe idk probably not that useful other than the constants\nexport type Flex = ComponentType> & {\n Align: Record<\"START\" | \"END\" | \"CENTER\" | \"STRETCH\" | \"BASELINE\", string>;\n Direction: Record<\"VERTICAL\" | \"HORIZONTAL\" | \"HORIZONTAL_REVERSE\", string>;\n Justify: Record<\"START\" | \"END\" | \"CENTER\" | \"BETWEEN\" | \"AROUND\", string>;\n Wrap: Record<\"NO_WRAP\" | \"WRAP\" | \"WRAP_REVERSE\", string>;\n};\n\ndeclare enum PopoutAnimation {\n NONE = \"1\",\n TRANSLATE = \"2\",\n SCALE = \"3\",\n FADE = \"4\"\n}\n\nexport type Popout = ComponentType<{\n children(\n thing: {\n \"aria-controls\": string;\n \"aria-expanded\": boolean;\n onClick(event: MouseEvent): void;\n onKeyDown(event: KeyboardEvent): void;\n onMouseDown(event: MouseEvent): void;\n },\n data: {\n isShown: boolean;\n position: string;\n }\n ): ReactNode;\n shouldShow?: boolean;\n renderPopout(args: {\n closePopout(): void;\n isPositioned: boolean;\n nudge: number;\n position: string;\n setPopoutRef(ref: any): void;\n updatePosition(): void;\n }): ReactNode;\n\n onRequestOpen?(): void;\n onRequestClose?(): void;\n\n /** \"center\" and others */\n align?: string;\n /** Popout.Animation */\n animation?: PopoutAnimation;\n autoInvert?: boolean;\n nudgeAlignIntoViewport?: boolean;\n /** \"bottom\" and others */\n position?: string;\n positionKey?: string;\n spacing?: number;\n}> & {\n Animation: typeof PopoutAnimation;\n};\n\nexport type Dialog = ComponentType>;\n\ntype Resolve = (data: { theme: \"light\" | \"dark\", saturation: number; }) => {\n hex(): string;\n hsl(): string;\n int(): number;\n spring(): string;\n};\n\nexport type useToken = (color: {\n css: string;\n resolve: Resolve;\n}) => ReturnType;\n\nexport type Paginator = ComponentType<{\n currentPage: number;\n maxVisiblePages: number;\n pageSize: number;\n totalCount: number;\n\n onPageChange?(page: number): void;\n hideMaxPage?: boolean;\n}>;\n\nexport type MaskedLink = ComponentType>;\n\nexport type ScrollerThin = ComponentType>;\n\nexport type Clickable = ComponentType>;\n\nexport type Avatar = ComponentType>;\n\ntype FocusLock = ComponentType\n}>>;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type { ComponentType, CSSProperties, MouseEvent, PropsWithChildren, ReactNode, UIEvent } from \"react\";\n\ntype RC = ComponentType>>;\n\nexport interface Menu {\n Menu: RC<{\n navId: string;\n onClose(): void;\n className?: string;\n style?: CSSProperties;\n hideScroller?: boolean;\n onSelect?(): void;\n }>;\n MenuSeparator: ComponentType;\n MenuGroup: RC<{\n label?: string;\n }>;\n MenuItem: RC<{\n id: string;\n label: ReactNode;\n action?(e: MouseEvent): void;\n icon?: ComponentType;\n\n color?: string;\n render?: ComponentType;\n onChildrenScroll?: Function;\n childRowHeight?: number;\n listClassName?: string;\n disabled?: boolean;\n }>;\n MenuCheckboxItem: RC<{\n id: string;\n label: string;\n checked: boolean;\n action?(e: MouseEvent): void;\n disabled?: boolean;\n }>;\n MenuRadioItem: RC<{\n id: string;\n group: string;\n label: string;\n checked: boolean;\n action?(e: MouseEvent): void;\n disabled?: boolean;\n }>;\n MenuControlItem: RC<{\n id: string;\n interactive?: boolean;\n }>;\n MenuSliderControl: RC<{\n minValue: number,\n maxValue: number,\n value: number,\n onChange(value: number): void,\n renderValue?(value: number): string,\n }>;\n}\n\nexport interface ContextMenuApi {\n closeContextMenu(): void;\n openContextMenu(\n event: UIEvent,\n render?: Menu[\"Menu\"],\n options?: { enableSpellCheck?: boolean; },\n renderLazy?: () => Promise\n ): void;\n openContextMenuLazy(\n event: UIEvent,\n renderLazy?: () => Promise,\n options?: { enableSpellCheck?: boolean; }\n ): void;\n}\n\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Guild, GuildMember } from \"discord-types/general\";\nimport type { ReactNode } from \"react\";\n\nimport type { FluxEvents } from \"./fluxEvents\";\nimport { i18nMessages } from \"./i18nMessages\";\n\nexport { FluxEvents };\n\nexport interface FluxDispatcher {\n _actionHandlers: any;\n _subscriptions: any;\n dispatch(event: { [key: string]: unknown; type: FluxEvents; }): Promise;\n isDispatching(): boolean;\n subscribe(event: FluxEvents, callback: (data: any) => void): void;\n unsubscribe(event: FluxEvents, callback: (data: any) => void): void;\n wait(callback: () => void): void;\n}\n\nexport type Parser = Record<\n | \"parse\"\n | \"parseTopic\"\n | \"parseEmbedTitle\"\n | \"parseInlineReply\"\n | \"parseGuildVerificationFormRule\"\n | \"parseGuildEventDescription\"\n | \"parseAutoModerationSystemMessage\"\n | \"parseForumPostGuidelines\"\n | \"parseForumPostMostRecentMessage\",\n (content: string, inline?: boolean, state?: Record) => ReactNode[]\n> & Record<\"defaultRules\" | \"guildEventRules\", Record>>;\n\nexport interface Alerts {\n show(alert: {\n title: any;\n body: React.ReactNode;\n className?: string;\n confirmColor?: string;\n cancelText?: string;\n confirmText?: string;\n secondaryConfirmText?: string;\n onCancel?(): void;\n onConfirm?(): void;\n onConfirmSecondary?(): void;\n onCloseCallback?(): void;\n }): void;\n /** This is a noop, it does nothing. */\n close(): void;\n}\n\nexport interface SnowflakeUtils {\n fromTimestamp(timestamp: number): string;\n extractTimestamp(snowflake: string): number;\n age(snowflake: string): number;\n atPreviousMillisecond(snowflake: string): string;\n compare(snowflake1?: string, snowflake2?: string): number;\n}\n\ninterface RestRequestData {\n url: string;\n query?: Record;\n body?: Record;\n oldFormErrors?: boolean;\n retries?: number;\n}\n\nexport type RestAPI = Record<\"delete\" | \"get\" | \"patch\" | \"post\" | \"put\", (data: RestRequestData) => Promise>;\n\nexport type Permissions = \"CREATE_INSTANT_INVITE\"\n | \"KICK_MEMBERS\"\n | \"BAN_MEMBERS\"\n | \"ADMINISTRATOR\"\n | \"MANAGE_CHANNELS\"\n | \"MANAGE_GUILD\"\n | \"CHANGE_NICKNAME\"\n | \"MANAGE_NICKNAMES\"\n | \"MANAGE_ROLES\"\n | \"MANAGE_WEBHOOKS\"\n | \"MANAGE_GUILD_EXPRESSIONS\"\n | \"CREATE_GUILD_EXPRESSIONS\"\n | \"VIEW_AUDIT_LOG\"\n | \"VIEW_CHANNEL\"\n | \"VIEW_GUILD_ANALYTICS\"\n | \"VIEW_CREATOR_MONETIZATION_ANALYTICS\"\n | \"MODERATE_MEMBERS\"\n | \"SEND_MESSAGES\"\n | \"SEND_TTS_MESSAGES\"\n | \"MANAGE_MESSAGES\"\n | \"EMBED_LINKS\"\n | \"ATTACH_FILES\"\n | \"READ_MESSAGE_HISTORY\"\n | \"MENTION_EVERYONE\"\n | \"USE_EXTERNAL_EMOJIS\"\n | \"ADD_REACTIONS\"\n | \"USE_APPLICATION_COMMANDS\"\n | \"MANAGE_THREADS\"\n | \"CREATE_PUBLIC_THREADS\"\n | \"CREATE_PRIVATE_THREADS\"\n | \"USE_EXTERNAL_STICKERS\"\n | \"SEND_MESSAGES_IN_THREADS\"\n | \"SEND_VOICE_MESSAGES\"\n | \"CONNECT\"\n | \"SPEAK\"\n | \"MUTE_MEMBERS\"\n | \"DEAFEN_MEMBERS\"\n | \"MOVE_MEMBERS\"\n | \"USE_VAD\"\n | \"PRIORITY_SPEAKER\"\n | \"STREAM\"\n | \"USE_EMBEDDED_ACTIVITIES\"\n | \"USE_SOUNDBOARD\"\n | \"USE_EXTERNAL_SOUNDS\"\n | \"REQUEST_TO_SPEAK\"\n | \"MANAGE_EVENTS\"\n | \"CREATE_EVENTS\";\n\nexport type PermissionsBits = Record;\n\nexport interface Locale {\n name: string;\n value: string;\n localizedName: string;\n}\n\nexport interface LocaleInfo {\n code: string;\n enabled: boolean;\n name: string;\n englishName: string;\n postgresLang: string;\n}\n\nexport interface i18n {\n getAvailableLocales(): Locale[];\n getLanguages(): LocaleInfo[];\n getDefaultLocale(): string;\n getLocale(): string;\n getLocaleInfo(): LocaleInfo;\n setLocale(locale: string): void;\n\n loadPromise: Promise;\n\n Messages: Record;\n}\n\nexport interface Clipboard {\n copy(text: string): void;\n SUPPORTS_COPY: boolean;\n}\n\nexport interface NavigationRouter {\n back(): void;\n forward(): void;\n hasNavigated(): boolean;\n getHistory(): {\n action: string;\n length: 50;\n [key: string]: any;\n };\n transitionTo(path: string, ...args: unknown[]): void;\n transitionToGuild(guildId: string, ...args: unknown[]): void;\n replaceWith(...args: unknown[]): void;\n getLastRouteChangeSource(): any;\n getLastRouteChangeSourceLocationStack(): any;\n}\n\nexport interface IconUtils {\n getUserAvatarURL(user: User, canAnimate?: boolean, size?: number, format?: string): string;\n getDefaultAvatarURL(id: string, discriminator?: string): string;\n getUserBannerURL(data: { id: string, banner: string, canAnimate?: boolean, size: number; }): string | undefined;\n getAvatarDecorationURL(dara: { avatarDecoration: string, size: number; canCanimate?: boolean; }): string | undefined;\n\n getGuildMemberAvatarURL(member: GuildMember, canAnimate?: string): string | null;\n getGuildMemberAvatarURLSimple(data: { guildId: string, userId: string, avatar: string, canAnimate?: boolean; size?: number; }): string;\n getGuildMemberBannerURL(data: { id: string, guildId: string, banner: string, canAnimate?: boolean, size: number; }): string | undefined;\n\n getGuildIconURL(data: { id: string, icon?: string, size?: number, canAnimate?: boolean; }): string | undefined;\n getGuildBannerURL(guild: Guild, canAnimate?: boolean): string | null;\n\n getChannelIconURL(data: { id: string; icon?: string; applicationId?: string; size?: number; }): string | undefined;\n getEmojiURL(data: { id: string, animated: boolean, size: number, forcePNG?: boolean; }): string;\n\n hasAnimatedGuildIcon(guild: Guild): boolean;\n isAnimatedIconHash(hash: string): boolean;\n\n getGuildSplashURL: any;\n getGuildDiscoverySplashURL: any;\n getGuildHomeHeaderURL: any;\n getResourceChannelIconURL: any;\n getNewMemberActionIconURL: any;\n getGuildTemplateIconURL: any;\n getApplicationIconURL: any;\n getGameAssetURL: any;\n getVideoFilterAssetURL: any;\n\n getGuildMemberAvatarSource: any;\n getUserAvatarSource: any;\n getGuildSplashSource: any;\n getGuildDiscoverySplashSource: any;\n makeSource: any;\n getGameAssetSource: any;\n getGuildIconSource: any;\n getGuildTemplateIconSource: any;\n getGuildBannerSource: any;\n getGuildHomeHeaderSource: any;\n getChannelIconSource: any;\n getApplicationIconSource: any;\n getAnimatableSourceWithFallback: any;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type { Channel, User } from \"discord-types/general\";\n\n// eslint-disable-next-line path-alias/no-relative\nimport { _resolveReady, filters, findByCodeLazy, findByProps, findByPropsLazy, findLazy, proxyLazyWebpack, waitFor } from \"../webpack\";\nimport type * as t from \"./types/utils\";\n\nexport let FluxDispatcher: t.FluxDispatcher;\n\nwaitFor([\"dispatch\", \"subscribe\"], m => {\n FluxDispatcher = m;\n const cb = () => {\n m.unsubscribe(\"CONNECTION_OPEN\", cb);\n _resolveReady();\n };\n m.subscribe(\"CONNECTION_OPEN\", cb);\n});\n\nexport let ComponentDispatch;\nwaitFor([\"ComponentDispatch\", \"ComponentDispatcher\"], m => ComponentDispatch = m.ComponentDispatch);\n\n\nexport const RestAPI: t.RestAPI = proxyLazyWebpack(() => {\n const mod = findByProps(\"getAPIBaseURL\");\n return mod.HTTP ?? mod;\n});\nexport const moment: typeof import(\"moment\") = findByPropsLazy(\"parseTwoDigitYear\");\n\nexport const hljs: typeof import(\"highlight.js\") = findByPropsLazy(\"highlight\", \"registerLanguage\");\n\nexport const lodash: typeof import(\"lodash\") = findByPropsLazy(\"debounce\", \"cloneDeep\");\n\nexport const i18n: t.i18n = findLazy(m => m.Messages?.[\"en-US\"]);\n\nexport let SnowflakeUtils: t.SnowflakeUtils;\nwaitFor([\"fromTimestamp\", \"extractTimestamp\"], m => SnowflakeUtils = m);\n\nexport let Parser: t.Parser;\nwaitFor(\"parseTopic\", m => Parser = m);\nexport let Alerts: t.Alerts;\nwaitFor([\"show\", \"close\"], m => Alerts = m);\n\nconst ToastType = {\n MESSAGE: 0,\n SUCCESS: 1,\n FAILURE: 2,\n CUSTOM: 3\n};\nconst ToastPosition = {\n TOP: 0,\n BOTTOM: 1\n};\n\nexport const Toasts = {\n Type: ToastType,\n Position: ToastPosition,\n // what's less likely than getting 0 from Math.random()? Getting it twice in a row\n genId: () => (Math.random() || Math.random()).toString(36).slice(2),\n\n // hack to merge with the following interface, dunno if there's a better way\n ...{} as {\n show(data: {\n message: string,\n id: string,\n /**\n * Toasts.Type\n */\n type: number,\n options?: {\n /**\n * Toasts.Position\n */\n position?: number;\n component?: React.ReactNode,\n duration?: number;\n };\n }): void;\n pop(): void;\n }\n};\n\n// This is the same module but this is easier\nwaitFor(\"showToast\", m => {\n Toasts.show = m.showToast;\n Toasts.pop = m.popToast;\n});\n\n\n/**\n * Show a simple toast. If you need more options, use Toasts.show manually\n */\nexport function showToast(message: string, type = ToastType.MESSAGE) {\n Toasts.show({\n id: Toasts.genId(),\n message,\n type\n });\n}\n\nexport const UserUtils = findByPropsLazy(\"getUser\", \"fetchCurrentUser\") as { getUser: (id: string) => Promise; };\nexport const UploadHandler = findByPropsLazy(\"showUploadFileSizeExceededError\", \"promptToUpload\") as {\n promptToUpload: (files: File[], channel: Channel, draftType: Number) => void;\n};\n\nexport const ApplicationAssetUtils = findByPropsLazy(\"fetchAssetIds\", \"getAssetImage\") as {\n fetchAssetIds: (applicationId: string, e: string[]) => Promise;\n};\n\nexport const Clipboard: t.Clipboard = findByPropsLazy(\"SUPPORTS_COPY\", \"copy\");\n\nexport const NavigationRouter: t.NavigationRouter = findByPropsLazy(\"transitionTo\", \"replaceWith\", \"transitionToGuild\");\n\nexport let SettingsRouter: any;\nwaitFor([\"open\", \"saveAccountChanges\"], m => SettingsRouter = m);\n\nexport const { Permissions: PermissionsBits } = findLazy(m => typeof m.Permissions?.ADMINISTRATOR === \"bigint\") as { Permissions: t.PermissionsBits; };\n\nexport const zustandCreate: typeof import(\"zustand\").default = findByCodeLazy(\"will be removed in v4\");\n\nconst persistFilter = filters.byCode(\"[zustand persist middleware]\");\nexport const { persist: zustandPersist }: typeof import(\"zustand/middleware\") = findLazy(m => m.persist && persistFilter(m.persist));\n\nexport const MessageActions = findByPropsLazy(\"editMessage\", \"sendMessage\");\nexport const UserProfileActions = findByPropsLazy(\"openUserProfileModal\", \"closeUserProfileModal\");\nexport const InviteActions = findByPropsLazy(\"resolveInvite\");\n\nexport const IconUtils: t.IconUtils = findByPropsLazy(\"getGuildBannerURL\", \"getUserAvatarURL\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport * from \"./classes\";\nexport * from \"./components\";\nexport * from \"./menu\";\nexport * from \"./react\";\nexport * from \"./settingsStores\";\nexport * from \"./stores\";\nexport * as ComponentTypes from \"./types/components.d\";\nexport * as MenuTypes from \"./types/menu.d\";\nexport * as UtilTypes from \"./types/utils.d\";\nexport * from \"./utils\";\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport const WEBPACK_CHUNK = \"webpackChunkdiscord_app\";\nexport const REACT_GLOBAL = \"Vencord.Webpack.Common.React\";\nexport const SUPPORT_CHANNEL_ID = \"1026515880080842772\";\n\nexport interface Dev {\n name: string;\n id: bigint;\n badge?: boolean;\n}\n\n/**\n * If you made a plugin or substantial contribution, add yourself here.\n * This object is used for the plugin author list, as well as to add a contributor badge to your profile.\n * If you wish to stay fully anonymous, feel free to set ID to 0n.\n * If you are fine with attribution but don't want the badge, add badge: false\n */\nexport const Devs = /* #__PURE__*/ Object.freeze({\n Nobody: {\n name: \"Nobody\",\n id: 0n,\n },\n Ven: {\n name: \"Vendicated\",\n id: 343383572805058560n\n },\n Arjix: {\n name: \"ArjixWasTaken\",\n id: 674710789138939916n\n },\n Cyn: {\n name: \"Cynosphere\",\n id: 150745989836308480n\n },\n Trwy: {\n name: \"trey\",\n id: 354427199023218689n\n },\n Megu: {\n name: \"Megumin\",\n id: 545581357812678656n\n },\n botato: {\n name: \"botato\",\n id: 440990343899643943n\n },\n fawn: {\n name: \"fawn\",\n id: 336678828233588736n,\n },\n rushii: {\n name: \"rushii\",\n id: 295190422244950017n\n },\n Glitch: {\n name: \"Glitchy\",\n id: 269567451199569920n\n },\n Samu: {\n name: \"Samu\",\n id: 702973430449832038n,\n },\n Nyako: {\n name: \"nyako\",\n id: 118437263754395652n\n },\n MaiKokain: {\n name: \"Mai\",\n id: 722647978577363026n\n },\n echo: {\n name: \"ECHO\",\n id: 712639419785412668n\n },\n katlyn: {\n name: \"katlyn\",\n id: 250322741406859265n\n },\n nea: {\n name: \"nea\",\n id: 310702108997320705n,\n },\n Nuckyz: {\n name: \"Nuckyz\",\n id: 235834946571337729n\n },\n D3SOX: {\n name: \"D3SOX\",\n id: 201052085641281538n\n },\n Nickyux: {\n name: \"Nickyux\",\n id: 427146305651998721n\n },\n mantikafasi: {\n name: \"mantikafasi\",\n id: 287555395151593473n\n },\n Xinto: {\n name: \"Xinto\",\n id: 423915768191647755n\n },\n JacobTm: {\n name: \"Jacob.Tm\",\n id: 302872992097107991n\n },\n DustyAngel47: {\n name: \"DustyAngel47\",\n id: 714583473804935238n\n },\n BanTheNons: {\n name: \"BanTheNons\",\n id: 460478012794863637n\n },\n BigDuck: {\n name: \"BigDuck\",\n id: 1024588272623681609n\n },\n AverageReactEnjoyer: {\n name: \"Average React Enjoyer\",\n id: 1004904120056029256n\n },\n adryd: {\n name: \"adryd\",\n id: 0n\n },\n Tyman: {\n name: \"Tyman\",\n id: 487443883127472129n\n },\n afn: {\n name: \"afn\",\n id: 420043923822608384n\n },\n KraXen72: {\n name: \"KraXen72\",\n id: 379304073515499530n\n },\n kemo: {\n name: \"kemo\",\n id: 299693897859465228n\n },\n dzshn: {\n name: \"dzshn\",\n id: 310449948011528192n\n },\n Ducko: {\n name: \"Ducko\",\n id: 506482395269169153n\n },\n jewdev: {\n name: \"jewdev\",\n id: 222369866529636353n\n },\n Luna: {\n name: \"Luny\",\n id: 821472922140803112n\n },\n Vap: {\n name: \"Vap0r1ze\",\n id: 454072114492866560n\n },\n KingFish: {\n name: \"King Fish\",\n id: 499400512559382538n\n },\n Commandtechno: {\n name: \"Commandtechno\",\n id: 296776625432035328n,\n },\n TheSun: {\n name: \"ActuallyTheSun\",\n id: 406028027768733696n\n },\n axyie: {\n name: \"'ax\",\n id: 273562710745284628n,\n },\n pointy: {\n name: \"pointy\",\n id: 99914384989519872n\n },\n SammCheese: {\n name: \"Samm-Cheese\",\n id: 372148345894076416n\n },\n zt: {\n name: \"zt\",\n id: 289556910426816513n\n },\n captain: {\n name: \"Captain\",\n id: 347366054806159360n\n },\n nick: {\n name: \"nick\",\n id: 347884694408265729n,\n badge: false\n },\n whqwert: {\n name: \"whqwert\",\n id: 586239091520176128n\n },\n lewisakura: {\n name: \"lewisakura\",\n id: 96269247411400704n\n },\n RuiNtD: {\n name: \"RuiNtD\",\n id: 157917665162297344n\n },\n hunt: {\n name: \"hunt-g\",\n id: 222800179697287168n\n },\n cloudburst: {\n name: \"cloudburst\",\n id: 892128204150685769n\n },\n Aria: {\n name: \"Syncxv\",\n id: 549244932213309442n,\n },\n TheKodeToad: {\n name: \"TheKodeToad\",\n id: 706152404072267788n\n },\n LordElias: {\n name: \"LordElias\",\n id: 319460781567639554n\n },\n juby: {\n name: \"Juby210\",\n id: 324622488644616195n\n },\n Alyxia: {\n name: \"Alyxia Sother\",\n id: 952185386350829688n\n },\n Remty: {\n name: \"Remty\",\n id: 335055032204656642n\n },\n skyevg: {\n name: \"skyevg\",\n id: 1090310844283363348n\n },\n Dziurwa: {\n name: \"Dziurwa\",\n id: 1001086404203389018n\n },\n F53: {\n name: \"F53\",\n id: 280411966126948353n\n },\n AutumnVN: {\n name: \"AutumnVN\",\n id: 393694671383166998n\n },\n pylix: {\n name: \"pylix\",\n id: 492949202121261067n\n },\n Tyler: {\n name: \"\\\\\\\\GGTyler\\\\\\\\\",\n id: 143117463788191746n\n },\n RyanCaoDev: {\n name: \"RyanCaoDev\",\n id: 952235800110694471n,\n },\n FieryFlames: {\n name: \"Fiery\",\n id: 890228870559698955n\n },\n KannaDev: {\n name: \"Kanna\",\n id: 317728561106518019n\n },\n carince: {\n name: \"carince\",\n id: 818323528755314698n\n },\n PandaNinjas: {\n name: \"PandaNinjas\",\n id: 455128749071925248n\n },\n CatNoir: {\n name: \"CatNoir\",\n id: 260371016348336128n\n },\n outfoxxed: {\n name: \"outfoxxed\",\n id: 837425748435796060n\n },\n UwUDev: {\n name: \"UwU\",\n id: 691413039156690994n,\n },\n amia: {\n name: \"amia\",\n id: 142007603549962240n\n },\n phil: {\n name: \"phil\",\n id: 305288513941667851n\n },\n ImLvna: {\n name: \"Luna <3\",\n id: 799319081723232267n\n },\n rad: {\n name: \"rad\",\n id: 610945092504780823n\n },\n AndrewDLO: {\n name: \"Andrew-DLO\",\n id: 434135504792059917n\n },\n HypedDomi: {\n name: \"HypedDomi\",\n id: 354191516979429376n\n },\n Rini: {\n name: \"Rini\",\n id: 1079479184478441643n\n },\n castdrian: {\n name: \"castdrian\",\n id: 224617799434108928n\n },\n Arrow: {\n name: \"arrow\",\n id: 958158495302176778n\n },\n bb010g: {\n name: \"bb010g\",\n id: 72791153467990016n,\n },\n Dolfies: {\n name: \"Dolfies\",\n id: 852892297661906993n,\n },\n RuukuLada: {\n name: \"RuukuLada\",\n id: 119705748346241027n,\n },\n blahajZip: {\n name: \"blahaj.zip\",\n id: 683954422241427471n,\n },\n archeruwu: {\n name: \"archer_uwu\",\n id: 160068695383736320n\n },\n ProffDea: {\n name: \"ProffDea\",\n id: 609329952180928513n\n },\n ant0n: {\n name: \"ant0n\",\n id: 145224646868860928n\n },\n philipbry: {\n name: \"philipbry\",\n id: 554994003318276106n\n },\n Korbo: {\n name: \"Korbo\",\n id: 455856406420258827n\n },\n maisymoe: {\n name: \"maisy\",\n id: 257109471589957632n,\n },\n Mopi: {\n name: \"Mopi\",\n id: 1022189106614243350n\n },\n Grzesiek11: {\n name: \"Grzesiek11\",\n id: 368475654662127616n,\n },\n Samwich: {\n name: \"Samwich\",\n id: 976176454511509554n,\n },\n coolelectronics: {\n name: \"coolelectronics\",\n id: 696392247205298207n,\n },\n Av32000: {\n name: \"Av32000\",\n id: 593436735380127770n,\n },\n Kyuuhachi: {\n name: \"Kyuuhachi\",\n id: 236588665420251137n,\n },\n Elvyra: {\n name: \"Elvyra\",\n id: 708275751816003615n,\n },\n Inbestigator: {\n name: \"Inbestigator\",\n id: 761777382041714690n\n },\n newwares: {\n name: \"newwares\",\n id: 421405303951851520n\n }\n} satisfies Record);\n\n// iife so #__PURE__ works correctly\nexport const DevsById = /* #__PURE__*/ (() =>\n Object.freeze(Object.fromEntries(\n Object.entries(Devs)\n .filter(d => d[1].id !== 0n)\n .map(([_, v]) => [v.id, v] as const)\n ))\n)() as Record;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Clipboard, Toasts } from \"@webpack/common\";\n\nimport { DevsById } from \"./constants\";\n\n/**\n * Recursively merges defaults into an object and returns the same object\n * @param obj Object\n * @param defaults Defaults\n * @returns obj\n */\nexport function mergeDefaults(obj: T, defaults: T): T {\n for (const key in defaults) {\n const v = defaults[key];\n if (typeof v === \"object\" && !Array.isArray(v)) {\n obj[key] ??= {} as any;\n mergeDefaults(obj[key], v);\n } else {\n obj[key] ??= v;\n }\n }\n return obj;\n}\n\n/**\n * Calls .join(\" \") on the arguments\n * classes(\"one\", \"two\") => \"one two\"\n */\nexport function classes(...classes: Array) {\n return classes.filter(Boolean).join(\" \");\n}\n\n/**\n * Returns a promise that resolves after the specified amount of time\n */\nexport function sleep(ms: number): Promise {\n return new Promise(r => setTimeout(r, ms));\n}\n\nexport function copyWithToast(text: string, toastMessage = \"Copied to clipboard!\") {\n if (Clipboard.SUPPORTS_COPY) {\n Clipboard.copy(text);\n } else {\n toastMessage = \"Your browser does not support copying to clipboard\";\n }\n Toasts.show({\n message: toastMessage,\n id: Toasts.genId(),\n type: Toasts.Type.SUCCESS\n });\n}\n\n/**\n * Check if obj is a true object: of type \"object\" and not null or array\n */\nexport function isObject(obj: unknown): obj is object {\n return typeof obj === \"object\" && obj !== null && !Array.isArray(obj);\n}\n\n/**\n * Check if an object is empty or in other words has no own properties\n */\nexport function isObjectEmpty(obj: object) {\n for (const k in obj)\n if (Object.hasOwn(obj, k)) return false;\n\n return true;\n}\n\n/**\n * Returns null if value is not a URL, otherwise return URL object.\n * Avoids having to wrap url checks in a try/catch\n */\nexport function parseUrl(urlString: string): URL | null {\n try {\n return new URL(urlString);\n } catch {\n return null;\n }\n}\n\n/**\n * Checks whether an element is on screen\n */\nexport const checkIntersecting = (el: Element) => {\n const elementBox = el.getBoundingClientRect();\n const documentHeight = Math.max(document.documentElement.clientHeight, window.innerHeight);\n return !(elementBox.bottom < 0 || elementBox.top - documentHeight >= 0);\n};\n\nexport function identity(value: T): T {\n return value;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#mobile_tablet_or_desktop\n// \"In summary, we recommend looking for the string Mobi anywhere in the User Agent to detect a mobile device.\"\nexport const isMobile = navigator.userAgent.includes(\"Mobi\");\n\nexport const isPluginDev = (id: string) => Object.hasOwn(DevsById, id);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { React, useEffect, useMemo, useReducer, useState } from \"@webpack/common\";\n\nimport { checkIntersecting } from \"./misc\";\n\nexport * from \"./lazyReact\";\n\nexport const NoopComponent = () => null;\n\n/**\n * Check if an element is on screen\n * @param intersectOnly If `true`, will only update the state when the element comes into view\n * @returns [refCallback, isIntersecting]\n */\nexport const useIntersection = (intersectOnly = false): [\n refCallback: React.RefCallback,\n isIntersecting: boolean,\n] => {\n const observerRef = React.useRef(null);\n const [isIntersecting, setIntersecting] = useState(false);\n\n const refCallback = (element: Element | null) => {\n observerRef.current?.disconnect();\n observerRef.current = null;\n\n if (!element) return;\n\n if (checkIntersecting(element)) {\n setIntersecting(true);\n if (intersectOnly) return;\n }\n\n observerRef.current = new IntersectionObserver(entries => {\n for (const entry of entries) {\n if (entry.target !== element) continue;\n if (entry.isIntersecting && intersectOnly) {\n setIntersecting(true);\n observerRef.current?.disconnect();\n observerRef.current = null;\n } else {\n setIntersecting(entry.isIntersecting);\n }\n }\n });\n observerRef.current.observe(element);\n };\n\n return [refCallback, isIntersecting];\n};\n\ntype AwaiterRes = [T, any, boolean];\ninterface AwaiterOpts {\n fallbackValue: T;\n deps?: unknown[];\n onError?(e: any): void;\n onSuccess?(value: T): void;\n}\n/**\n * Await a promise\n * @param factory Factory\n * @param fallbackValue The fallback value that will be used until the promise resolved\n * @returns [value, error, isPending]\n */\nexport function useAwaiter(factory: () => Promise): AwaiterRes;\nexport function useAwaiter(factory: () => Promise, providedOpts: AwaiterOpts): AwaiterRes;\nexport function useAwaiter(factory: () => Promise, providedOpts?: AwaiterOpts): AwaiterRes {\n const opts: Required> = Object.assign({\n fallbackValue: null,\n deps: [],\n onError: null,\n }, providedOpts);\n const [state, setState] = useState({\n value: opts.fallbackValue,\n error: null,\n pending: true\n });\n\n useEffect(() => {\n let isAlive = true;\n if (!state.pending) setState({ ...state, pending: true });\n\n factory()\n .then(value => {\n if (!isAlive) return;\n setState({ value, error: null, pending: false });\n opts.onSuccess?.(value);\n })\n .catch(error => {\n if (!isAlive) return;\n setState({ value: null, error, pending: false });\n opts.onError?.(error);\n });\n\n return () => void (isAlive = false);\n }, opts.deps);\n\n return [state.value, state.error, state.pending];\n}\n\n/**\n * Returns a function that can be used to force rerender react components\n */\nexport function useForceUpdater(): () => void;\nexport function useForceUpdater(withDep: true): [unknown, () => void];\nexport function useForceUpdater(withDep?: true) {\n const r = useReducer(x => x + 1, 0);\n return withDep ? r : r[1];\n}\n\ninterface TimerOpts {\n interval?: number;\n deps?: unknown[];\n}\n\nexport function useTimer({ interval = 1000, deps = [] }: TimerOpts) {\n const [time, setTime] = useState(0);\n const start = useMemo(() => Date.now(), deps);\n\n useEffect(() => {\n const intervalId = setInterval(() => setTime(Date.now() - start), interval);\n\n return () => {\n setTime(0);\n clearInterval(intervalId);\n };\n }, deps);\n\n return time;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./ErrorCard.css\";\n\nimport { classes } from \"@utils/misc\";\nimport type { HTMLProps } from \"react\";\n\nexport function ErrorCard(props: React.PropsWithChildren>) {\n return (\n
\n {props.children}\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Logger } from \"@utils/Logger\";\nimport { Margins } from \"@utils/margins\";\nimport { LazyComponent } from \"@utils/react\";\nimport { React } from \"@webpack/common\";\n\nimport { ErrorCard } from \"./ErrorCard\";\n\ninterface Props {\n /** Render nothing if an error occurs */\n noop?: boolean;\n /** Fallback component to render if an error occurs */\n fallback?: React.ComponentType>;\n /** called when an error occurs. The props property is only available if using .wrap */\n onError?(data: { error: Error, errorInfo: React.ErrorInfo, props: T; }): void;\n /** Custom error message */\n message?: string;\n\n /** The props passed to the wrapped component. Only used by wrap */\n wrappedProps?: T;\n}\n\nconst color = \"#e78284\";\n\nconst logger = new Logger(\"React ErrorBoundary\", color);\n\nconst NO_ERROR = {};\n\n// We might want to import this in a place where React isn't ready yet.\n// Thus, wrap in a LazyComponent\nconst ErrorBoundary = LazyComponent(() => {\n return class ErrorBoundary extends React.PureComponent> {\n state = {\n error: NO_ERROR as any,\n stack: \"\",\n message: \"\"\n };\n\n static getDerivedStateFromError(error: any) {\n let stack = error?.stack ?? \"\";\n let message = error?.message || String(error);\n\n if (error instanceof Error && stack) {\n const eolIdx = stack.indexOf(\"\\n\");\n if (eolIdx !== -1) {\n message = stack.slice(0, eolIdx);\n stack = stack.slice(eolIdx + 1).replace(/https:\\/\\/\\S+\\/assets\\//g, \"\");\n }\n }\n\n return { error, stack, message };\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n this.props.onError?.({ error, errorInfo, props: this.props.wrappedProps });\n logger.error(\"A component threw an Error\\n\", error);\n logger.error(\"Component Stack\", errorInfo.componentStack);\n }\n\n render() {\n if (this.state.error === NO_ERROR) return this.props.children;\n\n if (this.props.noop) return null;\n\n if (this.props.fallback)\n return ;\n\n const msg = this.props.message || \"An error occurred while rendering this Component. More info can be found below and in your console.\";\n\n return (\n \n

Oh no!

\n

{msg}

\n \n {this.state.message}\n {!!this.state.stack && (\n
\n                                {this.state.stack}\n                            
\n )}\n
\n
\n );\n }\n };\n}) as\n React.ComponentType> & {\n wrap(Component: React.ComponentType, errorBoundaryProps?: Omit, \"wrappedProps\">): React.FunctionComponent;\n };\n\nErrorBoundary.wrap = (Component, errorBoundaryProps) => props => (\n \n \n \n);\n\nexport default ErrorBoundary;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function Heart() {\n return (\n \n \n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Button } from \"@webpack/common\";\n\nimport { Heart } from \"./Heart\";\n\nexport default function DonateButton(props: any) {\n return (\n VencordNative.native.openExternal(\"https://github.com/sponsors/Vendicated\")}\n >\n \n Donate\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type { React } from \"@webpack/common\";\n\nexport function Flex(props: React.PropsWithChildren<{\n flexDirection?: React.CSSProperties[\"flexDirection\"];\n style?: React.CSSProperties;\n className?: string;\n} & React.HTMLProps>) {\n props.style ??= {};\n props.style.display = \"flex\";\n // TODO(ven): Remove me, what was I thinking??\n props.style.gap ??= \"1em\";\n props.style.flexDirection ||= props.flexDirection;\n delete props.flexDirection;\n return (\n
\n {props.children}\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { findByPropsLazy, findExportedComponentLazy } from \"@webpack\";\nimport type { ComponentType, PropsWithChildren, ReactNode, Ref } from \"react\";\n\nimport { LazyComponent } from \"./react\";\n\nexport const enum ModalSize {\n SMALL = \"small\",\n MEDIUM = \"medium\",\n LARGE = \"large\",\n DYNAMIC = \"dynamic\",\n}\n\nconst enum ModalTransitionState {\n ENTERING,\n ENTERED,\n EXITING,\n EXITED,\n HIDDEN,\n}\n\nexport interface ModalProps {\n transitionState: ModalTransitionState;\n onClose(): Promise;\n}\n\nexport interface ModalOptions {\n modalKey?: string;\n onCloseRequest?: (() => void);\n onCloseCallback?: (() => void);\n}\n\ntype RenderFunction = (props: ModalProps) => ReactNode;\n\nexport const Modals = findByPropsLazy(\"ModalRoot\", \"ModalCloseButton\") as {\n ModalRoot: ComponentType>;\n ModalHeader: ComponentType>;\n /** This also accepts Scroller props but good luck with that */\n ModalContent: ComponentType;\n [prop: string]: any;\n }>>;\n ModalFooter: ComponentType>;\n ModalCloseButton: ComponentType<{\n focusProps?: any;\n onClick(): void;\n withCircleBackground?: boolean;\n hideOnFullscreen?: boolean;\n className?: string;\n }>;\n};\n\nexport type ImageModal = ComponentType<{\n className?: string;\n src: string;\n placeholder: string;\n original: string;\n width?: number;\n height?: number;\n animated?: boolean;\n responsive?: boolean;\n renderLinkComponent(props: any): ReactNode;\n maxWidth?: number;\n maxHeight?: number;\n shouldAnimate?: boolean;\n onClose?(): void;\n shouldHideMediaOptions?: boolean;\n}>;\n\nexport const ImageModal = findExportedComponentLazy(\"ImageModal\") as ImageModal;\n\nexport const ModalRoot = LazyComponent(() => Modals.ModalRoot);\nexport const ModalHeader = LazyComponent(() => Modals.ModalHeader);\nexport const ModalContent = LazyComponent(() => Modals.ModalContent);\nexport const ModalFooter = LazyComponent(() => Modals.ModalFooter);\nexport const ModalCloseButton = LazyComponent(() => Modals.ModalCloseButton);\n\nconst ModalAPI = findByPropsLazy(\"openModalLazy\");\n\n/**\n * Wait for the render promise to resolve, then open a modal with it.\n * This is equivalent to render().then(openModal)\n * You should use the Modal components exported by this file\n */\nexport function openModalLazy(render: () => Promise, options?: ModalOptions & { contextKey?: string; }): Promise {\n return ModalAPI.openModalLazy(render, options);\n}\n\n/**\n * Open a Modal with the given render function.\n * You should use the Modal components exported by this file\n */\nexport function openModal(render: RenderFunction, options?: ModalOptions, contextKey?: string): string {\n return ModalAPI.openModal(render, options, contextKey);\n}\n\n/**\n * Close a modal by its key\n */\nexport function closeModal(modalKey: string, contextKey?: string): void {\n return ModalAPI.closeModal(modalKey, contextKey);\n}\n\n/**\n * Close all open modals\n */\nexport function closeAllModals(): void {\n return ModalAPI.closeAllModals();\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Command } from \"@api/Commands\";\nimport { NavContextMenuPatchCallback } from \"@api/ContextMenu\";\nimport { FluxEvents } from \"@webpack/types\";\nimport { Promisable } from \"type-fest\";\n\n// exists to export default definePlugin({...})\nexport default function definePlugin

(p: P & Record) {\n return p;\n}\n\nexport type ReplaceFn = (match: string, ...groups: string[]) => string;\n\nexport interface PatchReplacement {\n match: string | RegExp;\n replace: string | ReplaceFn;\n predicate?(): boolean;\n}\n\nexport interface Patch {\n plugin: string;\n find: string;\n replacement: PatchReplacement | PatchReplacement[];\n /** Whether this patch should apply to multiple modules */\n all?: boolean;\n /** Do not warn if this patch did no changes */\n noWarn?: boolean;\n /** Only apply this set of replacements if all of them succeed. Use this if your replacements depend on each other */\n group?: boolean;\n predicate?(): boolean;\n}\n\nexport interface PluginAuthor {\n name: string;\n id: BigInt;\n}\n\nexport interface Plugin extends PluginDef {\n patches?: Patch[];\n started: boolean;\n isDependency?: boolean;\n}\n\nexport interface PluginDef {\n name: string;\n description: string;\n authors: PluginAuthor[];\n start?(): void;\n stop?(): void;\n patches?: Omit[];\n /**\n * List of commands. If you specify these, you must add CommandsAPI to dependencies\n */\n commands?: Command[];\n /**\n * A list of other plugins that your plugin depends on.\n * These will automatically be enabled and loaded before your plugin\n * Common examples are CommandsAPI, MessageEventsAPI...\n */\n dependencies?: string[],\n /**\n * Whether this plugin is required and forcefully enabled\n */\n required?: boolean;\n /**\n * Whether this plugin should be enabled by default, but can be disabled\n */\n enabledByDefault?: boolean;\n /**\n * When to call the start() method\n * @default StartAt.WebpackReady\n */\n startAt?: StartAt,\n /**\n * Optionally provide settings that the user can configure in the Plugins tab of settings.\n * @deprecated Use `settings` instead\n */\n // TODO: Remove when everything is migrated to `settings`\n options?: Record;\n /**\n * Optionally provide settings that the user can configure in the Plugins tab of settings.\n */\n settings?: DefinedSettings;\n /**\n * Check that this returns true before allowing a save to complete.\n * If a string is returned, show the error to the user.\n */\n beforeSave?(options: Record): Promisable;\n /**\n * Allows you to specify a custom Component that will be rendered in your\n * plugin's settings page\n */\n settingsAboutComponent?: React.ComponentType<{\n tempSettings?: Record;\n }>;\n /**\n * Allows you to subscribe to Flux events\n */\n flux?: {\n [E in FluxEvents]?: (event: any) => void;\n };\n /**\n * Allows you to manipulate context menus\n */\n contextMenus?: Record;\n /**\n * Allows you to add custom actions to the Vencord Toolbox.\n * The key will be used as text for the button\n */\n toolboxActions?: Record void>;\n\n tags?: string[];\n}\n\nexport const enum StartAt {\n /** Right away, as soon as Vencord initialised */\n Init = \"Init\",\n /** On the DOMContentLoaded event, so once the document is ready */\n DOMContentLoaded = \"DOMContentLoaded\",\n /** Once Discord's core webpack modules have finished loading, so as soon as things like react and flux are available */\n WebpackReady = \"WebpackReady\"\n}\n\nexport const enum OptionType {\n STRING,\n NUMBER,\n BIGINT,\n BOOLEAN,\n SELECT,\n SLIDER,\n COMPONENT,\n}\n\nexport type SettingsDefinition = Record;\nexport type SettingsChecks = {\n [K in keyof D]?: D[K] extends PluginSettingComponentDef ? IsDisabled> :\n (IsDisabled> & IsValid, DefinedSettings>);\n};\n\nexport type PluginSettingDef = (\n | PluginSettingStringDef\n | PluginSettingNumberDef\n | PluginSettingBooleanDef\n | PluginSettingSelectDef\n | PluginSettingSliderDef\n | PluginSettingComponentDef\n | PluginSettingBigIntDef\n) & PluginSettingCommon;\n\nexport interface PluginSettingCommon {\n description: string;\n placeholder?: string;\n onChange?(newValue: any): void;\n /**\n * Whether changing this setting requires a restart\n */\n restartNeeded?: boolean;\n componentProps?: Record;\n /**\n * Hide this setting from the settings UI\n */\n hidden?: boolean;\n /**\n * Set this if the setting only works on Browser or Desktop, not both\n */\n target?: \"WEB\" | \"DESKTOP\" | \"BOTH\";\n}\ninterface IsDisabled {\n /**\n * Checks if this setting should be disabled\n */\n disabled?(this: D): boolean;\n}\ninterface IsValid {\n /**\n * Prevents the user from saving settings if this is false or a string\n */\n isValid?(this: D, value: T): boolean | string;\n}\n\nexport interface PluginSettingStringDef {\n type: OptionType.STRING;\n default?: string;\n}\nexport interface PluginSettingNumberDef {\n type: OptionType.NUMBER;\n default?: number;\n}\nexport interface PluginSettingBigIntDef {\n type: OptionType.BIGINT;\n default?: BigInt;\n}\nexport interface PluginSettingBooleanDef {\n type: OptionType.BOOLEAN;\n default?: boolean;\n}\n\nexport interface PluginSettingSelectDef {\n type: OptionType.SELECT;\n options: readonly PluginSettingSelectOption[];\n}\nexport interface PluginSettingSelectOption {\n label: string;\n value: string | number | boolean;\n default?: boolean;\n}\n\nexport interface PluginSettingSliderDef {\n type: OptionType.SLIDER;\n /**\n * All the possible values in the slider. Needs at least two values.\n */\n markers: number[];\n /**\n * Default value to use\n */\n default: number;\n /**\n * If false, allow users to select values in-between your markers.\n */\n stickToMarkers?: boolean;\n}\n\ninterface IPluginOptionComponentProps {\n /**\n * Run this when the value changes.\n *\n * NOTE: The user will still need to click save to apply these changes.\n */\n setValue(newValue: any): void;\n /**\n * Set to true to prevent the user from saving.\n *\n * NOTE: This will not show the error to the user. It will only stop them saving.\n * Make sure to show the error in your component.\n */\n setError(error: boolean): void;\n /**\n * The options object\n */\n option: PluginSettingComponentDef;\n}\n\nexport interface PluginSettingComponentDef {\n type: OptionType.COMPONENT;\n component: (props: IPluginOptionComponentProps) => JSX.Element;\n}\n\n/** Maps a `PluginSettingDef` to its value type */\ntype PluginSettingType = O extends PluginSettingStringDef ? string :\n O extends PluginSettingNumberDef ? number :\n O extends PluginSettingBigIntDef ? BigInt :\n O extends PluginSettingBooleanDef ? boolean :\n O extends PluginSettingSelectDef ? O[\"options\"][number][\"value\"] :\n O extends PluginSettingSliderDef ? number :\n O extends PluginSettingComponentDef ? any :\n never;\ntype PluginSettingDefaultType = O extends PluginSettingSelectDef ? (\n O[\"options\"] extends { default?: boolean; }[] ? O[\"options\"][number][\"value\"] : undefined\n) : O extends { default: infer T; } ? T : undefined;\n\ntype SettingsStore = {\n [K in keyof D]: PluginSettingType | PluginSettingDefaultType;\n};\n\n/** An instance of defined plugin settings */\nexport interface DefinedSettings<\n Def extends SettingsDefinition = SettingsDefinition,\n Checks extends SettingsChecks = {},\n PrivateSettings extends object = {}\n> {\n /** Shorthand for `Vencord.Settings.plugins.PluginName`, but with typings */\n store: SettingsStore & PrivateSettings;\n /**\n * React hook for getting the settings for this plugin\n * @param filter optional filter to avoid rerenders for irrelevent settings\n */\n use>(filter?: F[]): Pick & PrivateSettings, F>;\n /** Definitions of each setting */\n def: Def;\n /** Setting methods with return values that could rely on other settings */\n checks: Checks;\n /**\n * Name of the plugin these settings belong to,\n * will be an empty string until plugin is initialized\n */\n pluginName: string;\n\n withPrivateSettings(): DefinedSettings;\n}\n\nexport type PartialExcept = Partial & Required>;\n\nexport type IpcRes = { ok: true; value: V; } | { ok: false, error: any; };\n\n/* -------------------------------------------- */\n/* Legacy Options Types */\n/* -------------------------------------------- */\n\nexport type PluginOptionBase = PluginSettingCommon & IsDisabled;\nexport type PluginOptionsItem =\n | PluginOptionString\n | PluginOptionNumber\n | PluginOptionBoolean\n | PluginOptionSelect\n | PluginOptionSlider\n | PluginOptionComponent;\nexport type PluginOptionString = PluginSettingStringDef & PluginSettingCommon & IsDisabled & IsValid;\nexport type PluginOptionNumber = (PluginSettingNumberDef | PluginSettingBigIntDef) & PluginSettingCommon & IsDisabled & IsValid;\nexport type PluginOptionBoolean = PluginSettingBooleanDef & PluginSettingCommon & IsDisabled & IsValid;\nexport type PluginOptionSelect = PluginSettingSelectDef & PluginSettingCommon & IsDisabled & IsValid;\nexport type PluginOptionSlider = PluginSettingSliderDef & PluginSettingCommon & IsDisabled & IsValid;\nexport type PluginOptionComponent = PluginSettingComponentDef & PluginSettingCommon;\n\nexport type PluginNative any>> = {\n [key in keyof PluginExports]:\n PluginExports[key] extends (event: Electron.IpcMainInvokeEvent, ...args: infer Args) => infer Return\n ? (...args: Args) => Return extends Promise ? Return : Promise\n : never;\n};\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { BadgePosition, BadgeUserArgs, ProfileBadge } from \"@api/Badges\";\nimport DonateButton from \"@components/DonateButton\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Flex } from \"@components/Flex\";\nimport { Heart } from \"@components/Heart\";\nimport { Devs } from \"@utils/constants\";\nimport { Margins } from \"@utils/margins\";\nimport { isPluginDev } from \"@utils/misc\";\nimport { closeModal, Modals, openModal } from \"@utils/modal\";\nimport definePlugin from \"@utils/types\";\nimport { Forms, Toasts } from \"@webpack/common\";\n\nconst CONTRIBUTOR_BADGE = \"https://vencord.dev/assets/favicon.png\";\n\nconst ContributorBadge: ProfileBadge = {\n description: \"Vencord Contributor\",\n image: CONTRIBUTOR_BADGE,\n position: BadgePosition.START,\n props: {\n style: {\n borderRadius: \"50%\",\n transform: \"scale(0.9)\" // The image is a bit too big compared to default badges\n }\n },\n shouldShow: ({ user }) => isPluginDev(user.id),\n link: \"https://github.com/Vendicated/Vencord\"\n};\n\nlet DonorBadges = {} as Record>>;\n\nasync function loadBadges(noCache = false) {\n DonorBadges = {};\n\n const init = {} as RequestInit;\n if (noCache)\n init.cache = \"no-cache\";\n\n DonorBadges = await fetch(\"https://badges.vencord.dev/badges.json\", init)\n .then(r => r.json());\n}\n\nexport default definePlugin({\n name: \"BadgeAPI\",\n description: \"API to add badges to users.\",\n authors: [Devs.Megu, Devs.Ven, Devs.TheSun],\n required: true,\n patches: [\n /* Patch the badge list component on user profiles */\n {\n find: \"Messages.PROFILE_USER_BADGES,role:\",\n replacement: [\n {\n match: /&&(\\i)\\.push\\(\\{id:\"premium\".+?\\}\\);/,\n replace: \"$&$1.unshift(...Vencord.Api.Badges._getBadges(arguments[0]));\",\n },\n {\n // alt: \"\", aria-hidden: false, src: originalSrc\n match: /alt:\" \",\"aria-hidden\":!0,src:(?=(\\i)\\.src)/,\n // ...badge.props, ..., src: badge.image ?? ...\n replace: \"...$1.props,$& $1.image??\"\n },\n // replace their component with ours if applicable\n {\n match: /(?<=text:(\\i)\\.description,spacing:12,)children:/,\n replace: \"children:$1.component ? () => $self.renderBadgeComponent($1) :\"\n },\n // conditionally override their onClick with badge.onClick if it exists\n {\n match: /href:(\\i)\\.link/,\n replace: \"...($1.onClick && { onClick: $1.onClick }),$&\"\n }\n ]\n }\n ],\n\n toolboxActions: {\n async \"Refetch Badges\"() {\n await loadBadges(true);\n Toasts.show({\n id: Toasts.genId(),\n message: \"Successfully refetched badges!\",\n type: Toasts.Type.SUCCESS\n });\n }\n },\n\n async start() {\n Vencord.Api.Badges.addBadge(ContributorBadge);\n await loadBadges();\n },\n\n renderBadgeComponent: ErrorBoundary.wrap((badge: ProfileBadge & BadgeUserArgs) => {\n const Component = badge.component!;\n return ;\n }, { noop: true }),\n\n\n getDonorBadges(userId: string) {\n return DonorBadges[userId]?.map(badge => ({\n image: badge.badge,\n description: badge.tooltip,\n position: BadgePosition.START,\n props: {\n style: {\n borderRadius: \"50%\",\n transform: \"scale(0.9)\" // The image is a bit too big compared to default badges\n }\n },\n onClick() {\n const modalKey = openModal(props => (\n {\n closeModal(modalKey);\n VencordNative.native.openExternal(\"https://github.com/sponsors/Vendicated\");\n }}>\n \n \n \n \n \n Vencord Donor\n \n \n \n \n \n \n \n \n

\n \n This Badge is a special perk for Vencord Donors\n \n \n Please consider supporting the development of Vencord by becoming a donor. It would mean a lot!!\n \n
\n \n \n \n \n \n \n \n \n ));\n },\n }));\n }\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2024 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"ChatInputButtonAPI\",\n description: \"API to add buttons to the chat input\",\n authors: [Devs.Ven],\n\n patches: [{\n find: 'location:\"ChannelTextAreaButtons\"',\n replacement: {\n match: /if\\(!\\i\\.isMobile\\)\\{(?=.+?&&(\\i)\\.push\\(.{0,50}\"gift\")/,\n replace: \"$&Vencord.Api.ChatButtons._injectButtons($1,arguments[0]);\"\n }\n }]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"CommandsAPI\",\n authors: [Devs.Arjix],\n description: \"Api required by anything that uses commands\",\n patches: [\n // obtain BUILT_IN_COMMANDS instance\n {\n find: ',\"tenor\"',\n replacement: [\n {\n // Matches BUILT_IN_COMMANDS. This is not exported so this is\n // the only way. _init() just returns the same object to make the\n // patch simpler\n\n // textCommands = builtInCommands.filter(...)\n match: /(?<=\\w=)(\\w)(\\.filter\\(.{0,60}tenor)/,\n replace: \"Vencord.Api.Commands._init($1)$2\",\n }\n ],\n },\n // command error handling\n {\n find: \"Unexpected value for option\",\n replacement: {\n // return [2, cmd.execute(args, ctx)]\n match: /,(\\i)\\.execute\\((\\i),(\\i)\\)/,\n replace: (_, cmd, args, ctx) => `,Vencord.Api.Commands._handleCommand(${cmd}, ${args}, ${ctx})`\n }\n },\n // Show plugin name instead of \"Built-In\"\n {\n find: \".source,children\",\n replacement: {\n // ...children: p?.name\n match: /(?<=:(.{1,3})\\.displayDescription\\}.{0,200}\\.source,children:)[^}]+/,\n replace: \"$1.plugin||($&)\"\n }\n }\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"ContextMenuAPI\",\n description: \"API for adding/removing items to/from context menus.\",\n authors: [Devs.Nuckyz, Devs.Ven, Devs.Kyuuhachi],\n required: true,\n\n patches: [\n {\n find: \"\u266B (\u3064\uFF61\u25D5\u203F\u203F\u25D5\uFF61)\u3064 \u266A\",\n replacement: {\n match: /(?=let{navId:)(?<=function \\i\\((\\i)\\).+?)/,\n replace: \"$1=Vencord.Api.ContextMenu._usePatchContextMenu($1);\"\n }\n },\n {\n find: \".Menu,{\",\n all: true,\n replacement: {\n match: /Menu,{(?<=\\.jsxs?\\)\\(\\i\\.Menu,{)/g,\n replace: \"$&contextMenuApiArguments:typeof arguments!=='undefined'?arguments:[],\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"MemberListDecoratorsAPI\",\n description: \"API to add decorators to member list (both in servers and DMs)\",\n authors: [Devs.TheSun, Devs.Ven],\n patches: [\n {\n find: \".lostPermission)\",\n replacement: [\n {\n match: /let\\{[^}]*lostPermissionTooltipText:\\i[^}]*\\}=(\\i),/,\n replace: \"$&vencordProps=$1,\"\n }, {\n match: /decorators:.{0,100}?children:\\[/,\n replace: \"$&...(typeof vencordProps=='undefined'?[]:Vencord.Api.MemberListDecorators.__getDecorators(vencordProps)),\"\n }\n ]\n },\n {\n find: \"PrivateChannel.renderAvatar\",\n replacement: {\n match: /decorators:(\\i\\.isSystemDM\\(\\))\\?(.+?):null/,\n replace: \"decorators:[...Vencord.Api.MemberListDecorators.__getDecorators(arguments[0]), $1?$2:null]\"\n }\n }\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"MessageAccessoriesAPI\",\n description: \"API to add message accessories.\",\n authors: [Devs.Cyn],\n patches: [\n {\n find: \".Messages.REMOVE_ATTACHMENT_BODY\",\n replacement: {\n match: /(?<=.container\\)?,children:)(\\[.+?\\])/,\n replace: \"Vencord.Api.MessageAccessories._modifyAccessories($1,this.props)\",\n },\n },\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"MessageDecorationsAPI\",\n description: \"API to add decorations to messages\",\n authors: [Devs.TheSun],\n patches: [\n {\n find: '\"Message Username\"',\n replacement: {\n match: /\\.Messages\\.GUILD_COMMUNICATION_DISABLED_BOTTOM_SHEET_TITLE.+?}\\),\\i(?=\\])/,\n replace: \"$&,...Vencord.Api.MessageDecorations.__addDecorationsToMessage(arguments[0])\"\n }\n }\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"MessageEventsAPI\",\n description: \"Api required by anything using message events.\",\n authors: [Devs.Arjix, Devs.hunt, Devs.Ven],\n patches: [\n {\n find: \".Messages.EDIT_TEXTAREA_HELP\",\n replacement: {\n match: /(?<=,channel:\\i\\}\\)\\.then\\().+?(?=return \\i\\.content!==this\\.props\\.message\\.content&&\\i\\((.+?)\\))/,\n replace: (match, args) => \"\" +\n `async ${match}` +\n `if(await Vencord.Api.MessageEvents._handlePreEdit(${args}))` +\n \"return Promise.resolve({shoudClear:true,shouldRefocus:true});\"\n }\n },\n {\n find: \".handleSendMessage=\",\n replacement: {\n // props.chatInputType...then((function(isMessageValid)... var parsedMessage = b.c.parse(channel,... var replyOptions = f.g.getSendMessageOptionsForReply(pendingReply);\n // Lookbehind: validateMessage)({openWarningPopout:..., type: i.props.chatInputType, content: t, stickers: r, ...}).then((function(isMessageValid)\n match: /(type:this\\.props\\.chatInputType.+?\\.then\\()(\\i=>\\{.+?let (\\i)=\\i\\.\\i\\.parse\\((\\i),.+?let (\\i)=\\i\\.\\i\\.getSendMessageOptionsForReply\\(\\i\\);)(?<=\\)\\(({.+?})\\)\\.then.+?)/,\n // props.chatInputType...then((async function(isMessageValid)... var replyOptions = f.g.getSendMessageOptionsForReply(pendingReply); if(await Vencord.api...) return { shoudClear:true, shouldRefocus:true };\n replace: (_, rest1, rest2, parsedMessage, channel, replyOptions, extra) => \"\" +\n `${rest1}async ${rest2}` +\n `if(await Vencord.Api.MessageEvents._handlePreSend(${channel}.id,${parsedMessage},${extra},${replyOptions}))` +\n \"return{shoudClear:true,shouldRefocus:true};\"\n }\n },\n {\n find: '(\"interactionUsernameProfile',\n replacement: {\n match: /let\\{id:\\i}=(\\i),{id:\\i}=(\\i);return \\i\\.useCallback\\((\\i)=>\\{/,\n replace: (m, message, channel, event) =>\n // the message param is shadowed by the event param, so need to alias them\n `const vcMsg=${message},vcChan=${channel};${m}Vencord.Api.MessageEvents._handleClick(vcMsg, vcChan, ${event});`\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"MessagePopoverAPI\",\n description: \"API to add buttons to message popovers.\",\n authors: [Devs.KingFish, Devs.Ven, Devs.Nuckyz],\n patches: [{\n find: \"Messages.MESSAGE_UTILITIES_A11Y_LABEL\",\n replacement: {\n // foo && !bar ? createElement(reactionStuffs)... createElement(blah,...makeElement(reply-other))\n match: /\\i&&!\\i\\?\\(0,\\i\\.jsxs?\\)\\(.{0,200}renderEmojiPicker:.{0,500}\\?(\\i)\\(\\{key:\"reply-other\"/,\n replace: (m, makeElement) => {\n const msg = m.match(/message:(.{1,3}),/)?.[1];\n if (!msg) throw new Error(\"Could not find message variable\");\n return `...Vencord.Api.MessagePopover._buildPopoverElements(${msg},${makeElement}),${m}`;\n }\n }\n }],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"NoticesAPI\",\n description: \"Fixes notices being automatically dismissed\",\n authors: [Devs.Ven],\n required: true,\n patches: [\n {\n find: 'displayName=\"NoticeStore\"',\n replacement: [\n {\n match: /\\i=null;(?=.{0,80}getPremiumSubscription\\(\\))/g,\n replace: \"if(Vencord.Api.Notices.currentNotice)return false;$&\"\n },\n {\n match: /(?<=,NOTICE_DISMISS:function\\(\\i\\){)return null!=(\\i)/,\n replace: \"if($1.id==\\\"VencordNotice\\\")return($1=null,Vencord.Api.Notices.nextNotice(),true);$&\"\n }\n ]\n }\n ],\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"ServerListAPI\",\n authors: [Devs.kemo],\n description: \"Api required for plugins that modify the server list\",\n patches: [\n {\n find: \"Messages.DISCODO_DISABLED\",\n replacement: {\n match: /(?<=Messages\\.DISCODO_DISABLED.+?return)(\\(.{0,75}?tutorialContainer.+?}\\))(?=}function)/,\n replace: \"[$1].concat(Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.Above))\"\n }\n },\n {\n find: \"Messages.SERVERS,children\",\n replacement: {\n match: /(?<=Messages\\.SERVERS,children:).+?default:return null\\}\\}\\)/,\n replace: \"Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.In).concat($&)\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"NoTrack\",\n description: \"Disable Discord's tracking ('science'), metrics and Sentry crash reporting\",\n authors: [Devs.Cyn, Devs.Ven, Devs.Nuckyz, Devs.Arrow],\n required: true,\n patches: [\n {\n find: \"AnalyticsActionHandlers.handle\",\n replacement: {\n match: /^.+$/,\n replace: \"()=>{}\",\n },\n },\n {\n find: \"window.DiscordSentry=\",\n replacement: {\n match: /^.+$/,\n replace: \"()=>{}\",\n }\n },\n {\n find: \".METRICS,\",\n replacement: [\n {\n match: /this\\._intervalId=/,\n replace: \"this._intervalId=undefined&&\"\n },\n {\n match: /(increment\\(\\i\\){)/,\n replace: \"$1return;\"\n }\n ]\n },\n {\n find: \".installedLogHooks)\",\n replacement: {\n // if getDebugLogging() returns false, the hooks don't get installed.\n match: \"getDebugLogging(){\",\n replace: \"getDebugLogging(){return false;\"\n }\n },\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n/**\n * Returns a new function that will call the wrapped function\n * after the specified delay. If the function is called again\n * within the delay, the timer will be reset.\n * @param func The function to wrap\n * @param delay The delay in milliseconds\n */\nexport function debounce(func: T, delay = 300): T {\n let timeout: NodeJS.Timeout;\n return function (...args: any[]) {\n clearTimeout(timeout);\n timeout = setTimeout(() => { func(...args); }, delay);\n } as any;\n}\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2024 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { LiteralUnion } from \"type-fest\";\n\n// Resolves a possibly nested prop in the form of \"some.nested.prop\" to type of T.some.nested.prop\ntype ResolvePropDeep = P extends `${infer Pre}.${infer Suf}`\n ? Pre extends keyof T\n ? ResolvePropDeep\n : any\n : P extends keyof T\n ? T[P]\n : any;\n\ninterface SettingsStoreOptions {\n readOnly?: boolean;\n getDefaultValue?: (data: {\n target: any;\n key: string;\n root: any;\n path: string;\n }) => any;\n}\n\n// merges the SettingsStoreOptions type into the class\nexport interface SettingsStore extends SettingsStoreOptions { }\n\n/**\n * The SettingsStore allows you to easily create a mutable store that\n * has support for global and path-based change listeners.\n */\nexport class SettingsStore {\n private pathListeners = new Map void>>();\n private globalListeners = new Set<(newData: T, path: string) => void>();\n\n /**\n * The store object. Making changes to this object will trigger the applicable change listeners\n */\n public declare store: T;\n /**\n * The plain data. Changes to this object will not trigger any change listeners\n */\n public declare plain: T;\n\n public constructor(plain: T, options: SettingsStoreOptions = {}) {\n this.plain = plain;\n this.store = this.makeProxy(plain);\n Object.assign(this, options);\n }\n\n private makeProxy(object: any, root: T = object, path: string = \"\") {\n const self = this;\n\n return new Proxy(object, {\n get(target, key: string) {\n let v = target[key];\n\n if (!(key in target) && self.getDefaultValue) {\n v = self.getDefaultValue({\n target,\n key,\n root,\n path\n });\n }\n\n if (typeof v === \"object\" && v !== null && !Array.isArray(v))\n return self.makeProxy(v, root, `${path}${path && \".\"}${key}`);\n\n return v;\n },\n set(target, key: string, value) {\n if (target[key] === value) return true;\n\n Reflect.set(target, key, value);\n const setPath = `${path}${path && \".\"}${key}`;\n\n self.globalListeners.forEach(cb => cb(value, setPath));\n self.pathListeners.get(setPath)?.forEach(cb => cb(value));\n\n return true;\n }\n });\n }\n\n /**\n * Set the data of the store.\n * This will update this.store and this.plain (and old references to them will be stale! Avoid storing them in variables)\n *\n * Additionally, all global listeners (and those for pathToNotify, if specified) will be called with the new data\n * @param value New data\n * @param pathToNotify Optional path to notify instead of globally. Used to transfer path via ipc\n */\n public setData(value: T, pathToNotify?: string) {\n if (this.readOnly) throw new Error(\"SettingsStore is read-only\");\n\n this.plain = value;\n this.store = this.makeProxy(value);\n\n if (pathToNotify) {\n let v = value;\n\n const path = pathToNotify.split(\".\");\n for (const p of path) {\n if (!v) {\n console.warn(\n `Settings#setData: Path ${pathToNotify} does not exist in new data. Not dispatching update`\n );\n return;\n }\n v = v[p];\n }\n\n this.pathListeners.get(pathToNotify)?.forEach(cb => cb(v));\n }\n\n this.markAsChanged();\n }\n\n /**\n * Add a global change listener, that will fire whenever any setting is changed\n *\n * @param data The new data. This is either the new value set on the path, or the new root object if it was changed\n * @param path The path of the setting that was changed. Empty string if the root object was changed\n */\n public addGlobalChangeListener(cb: (data: any, path: string) => void) {\n this.globalListeners.add(cb);\n }\n\n /**\n * Add a scoped change listener that will fire whenever a setting matching the specified path is changed.\n *\n * For example if path is `\"foo.bar\"`, the listener will fire on\n * ```js\n * Setting.store.foo.bar = \"hi\"\n * ```\n * but not on\n * ```js\n * Setting.store.foo.baz = \"hi\"\n * ```\n * @param path\n * @param cb\n */\n public addChangeListener

>(\n path: P,\n cb: (data: ResolvePropDeep) => void\n ) {\n const listeners = this.pathListeners.get(path as string) ?? new Set();\n listeners.add(cb);\n this.pathListeners.set(path as string, listeners);\n }\n\n /**\n * Remove a global listener\n * @see {@link addGlobalChangeListener}\n */\n public removeGlobalChangeListener(cb: (data: any, path: string) => void) {\n this.globalListeners.delete(cb);\n }\n\n /**\n * Remove a scoped listener\n * @see {@link addChangeListener}\n */\n public removeChangeListener(path: LiteralUnion, cb: (data: any) => void) {\n const listeners = this.pathListeners.get(path as string);\n if (!listeners) return;\n\n listeners.delete(cb);\n if (!listeners.size) this.pathListeners.delete(path as string);\n }\n\n /**\n * Call all global change listeners\n */\n public markAsChanged() {\n this.globalListeners.forEach(cb => cb(this.plain, \"\"));\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport const { localStorage } = window;\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Promisable } from \"type-fest\";\n\n/**\n * A queue that can be used to run tasks consecutively.\n * Highly recommended for things like fetching data from Discord\n */\nexport class Queue {\n /**\n * @param maxSize The maximum amount of functions that can be queued at once.\n * If the queue is full, the oldest function will be removed.\n */\n constructor(public readonly maxSize = Infinity) { }\n\n private queue = [] as Array<() => Promisable>;\n\n private promise?: Promise;\n\n private next() {\n const func = this.queue.shift();\n if (func)\n this.promise = Promise.resolve()\n .then(func)\n .finally(() => this.next());\n else\n this.promise = undefined;\n }\n\n private run() {\n if (!this.promise)\n this.next();\n }\n\n /**\n * Append a task at the end of the queue. This task will be executed after all other tasks\n * If the queue exceeds the specified maxSize, the first task in queue will be removed.\n * @param func Task\n */\n push(func: () => Promisable) {\n if (this.size >= this.maxSize)\n this.queue.shift();\n\n this.queue.push(func);\n this.run();\n }\n\n /**\n * Prepend a task at the beginning of the queue. This task will be executed next\n * If the queue exceeds the specified maxSize, the last task in queue will be removed.\n * @param func Task\n */\n unshift(func: () => Promisable) {\n if (this.size >= this.maxSize)\n this.queue.pop();\n\n this.queue.unshift(func);\n this.run();\n }\n\n /**\n * The amount of tasks in the queue\n */\n get size() {\n return this.queue.length;\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./styles.css\";\n\nimport { useSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { classes } from \"@utils/misc\";\nimport { React, useEffect, useMemo, useState, useStateFromStores, WindowStore } from \"@webpack/common\";\n\nimport { NotificationData } from \"./Notifications\";\n\nexport default ErrorBoundary.wrap(function NotificationComponent({\n title,\n body,\n richBody,\n color,\n icon,\n onClick,\n onClose,\n image,\n permanent,\n className,\n dismissOnClick\n}: NotificationData & { className?: string; }) {\n const { timeout, position } = useSettings([\"notifications.timeout\", \"notifications.position\"]).notifications;\n const hasFocus = useStateFromStores([WindowStore], () => WindowStore.isFocused());\n\n const [isHover, setIsHover] = useState(false);\n const [elapsed, setElapsed] = useState(0);\n\n const start = useMemo(() => Date.now(), [timeout, isHover, hasFocus]);\n\n useEffect(() => {\n if (isHover || !hasFocus || timeout === 0 || permanent) return void setElapsed(0);\n\n const intervalId = setInterval(() => {\n const elapsed = Date.now() - start;\n if (elapsed >= timeout)\n onClose!();\n else\n setElapsed(elapsed);\n }, 10);\n\n return () => clearInterval(intervalId);\n }, [timeout, isHover, hasFocus]);\n\n const timeoutProgress = elapsed / timeout;\n\n return (\n {\n onClick?.();\n if (dismissOnClick !== false)\n onClose!();\n }}\n onContextMenu={e => {\n e.preventDefault();\n e.stopPropagation();\n onClose!();\n }}\n onMouseEnter={() => setIsHover(true)}\n onMouseLeave={() => setIsHover(false)}\n >\n

\n {icon && \"\"}\n
\n
\n

{title}

\n {\n e.preventDefault();\n e.stopPropagation();\n onClose!();\n }}\n >\n \n Dismiss Notification\n \n \n \n
\n
\n {richBody ??

{body}

}\n
\n
\n
\n {image && \"\"}\n {timeout !== 0 && !permanent && (\n \n )}\n \n );\n}, {\n onError: ({ props }) => props.onClose!()\n});\n", "/* eslint-disable simple-header/header */\n\n/*!\n * idb-keyval v6.2.0\n * Copyright 2016, Jake Archibald\n * Copyright 2022, Vendicated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function promisifyRequest(\n request: IDBRequest | IDBTransaction,\n): Promise {\n return new Promise((resolve, reject) => {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-ignore - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}\n\nexport function createStore(dbName: string, storeName: string): UseStore {\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n const dbp = promisifyRequest(request);\n\n return (txMode, callback) =>\n dbp.then(db =>\n callback(db.transaction(storeName, txMode).objectStore(storeName)),\n );\n}\n\nexport type UseStore = (\n txMode: IDBTransactionMode,\n callback: (store: IDBObjectStore) => T | PromiseLike,\n) => Promise;\n\nlet defaultGetStoreFunc: UseStore | undefined;\n\nfunction defaultGetStore() {\n if (!defaultGetStoreFunc) {\n defaultGetStoreFunc = createStore(\"VencordData\", \"VencordStore\");\n }\n return defaultGetStoreFunc;\n}\n\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function get(\n key: IDBValidKey,\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\"readonly\", store => promisifyRequest(store.get(key)));\n}\n\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function set(\n key: IDBValidKey,\n value: any,\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\"readwrite\", store => {\n store.put(value, key);\n return promisifyRequest(store.transaction);\n });\n}\n\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic \u2013 if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function setMany(\n entries: [IDBValidKey, any][],\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\"readwrite\", store => {\n entries.forEach(entry => store.put(entry[1], entry[0]));\n return promisifyRequest(store.transaction);\n });\n}\n\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function getMany(\n keys: IDBValidKey[],\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\"readonly\", store =>\n Promise.all(keys.map(key => promisifyRequest(store.get(key)))),\n );\n}\n\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function update(\n key: IDBValidKey,\n updater: (oldValue: T | undefined) => T,\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\n \"readwrite\",\n store =>\n // Need to create the promise manually.\n // If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise((resolve, reject) => {\n store.get(key).onsuccess = function () {\n try {\n store.put(updater(this.result), key);\n resolve(promisifyRequest(store.transaction));\n } catch (err) {\n reject(err);\n }\n };\n }),\n );\n}\n\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function del(\n key: IDBValidKey,\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\"readwrite\", store => {\n store.delete(key);\n return promisifyRequest(store.transaction);\n });\n}\n\n/**\n * Delete multiple keys at once.\n *\n * @param keys List of keys to delete.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function delMany(\n keys: IDBValidKey[],\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\"readwrite\", (store: IDBObjectStore) => {\n keys.forEach((key: IDBValidKey) => store.delete(key));\n return promisifyRequest(store.transaction);\n });\n}\n\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function clear(customStore = defaultGetStore()): Promise {\n return customStore(\"readwrite\", store => {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}\n\nfunction eachCursor(\n store: IDBObjectStore,\n callback: (cursor: IDBCursorWithValue) => void,\n): Promise {\n store.openCursor().onsuccess = function () {\n if (!this.result) return;\n callback(this.result);\n this.result.continue();\n };\n return promisifyRequest(store.transaction);\n}\n\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function keys(\n customStore = defaultGetStore(),\n): Promise {\n return customStore(\"readonly\", store => {\n // Fast path for modern browsers\n if (store.getAllKeys) {\n return promisifyRequest(\n store.getAllKeys() as unknown as IDBRequest,\n );\n }\n\n const items: KeyType[] = [];\n\n return eachCursor(store, cursor =>\n items.push(cursor.key as KeyType),\n ).then(() => items);\n });\n}\n\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function values(customStore = defaultGetStore()): Promise {\n return customStore(\"readonly\", store => {\n // Fast path for modern browsers\n if (store.getAll) {\n return promisifyRequest(store.getAll() as IDBRequest);\n }\n\n const items: T[] = [];\n\n return eachCursor(store, cursor => items.push(cursor.value as T)).then(\n () => items,\n );\n });\n}\n\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nexport function entries(\n customStore = defaultGetStore(),\n): Promise<[KeyType, ValueType][]> {\n return customStore(\"readonly\", store => {\n // Fast path for modern browsers\n // (although, hopefully we'll get a simpler path some day)\n if (store.getAll && store.getAllKeys) {\n return Promise.all([\n promisifyRequest(\n store.getAllKeys() as unknown as IDBRequest,\n ),\n promisifyRequest(store.getAll() as IDBRequest),\n ]).then(([keys, values]) => keys.map((key, i) => [key, values[i]]));\n }\n\n const items: [KeyType, ValueType][] = [];\n\n return customStore(\"readonly\", store =>\n eachCursor(store, cursor =>\n items.push([cursor.key as KeyType, cursor.value]),\n ).then(() => items),\n );\n });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport type { MapValue } from \"type-fest/source/entry\";\n\nexport type Style = MapValue;\n\nexport const styleMap = window.VencordStyles ??= new Map();\n\nexport function requireStyle(name: string) {\n const style = styleMap.get(name);\n if (!style) throw new Error(`Style \"${name}\" does not exist`);\n return style;\n}\n\n/**\n * A style's name can be obtained from importing a stylesheet with `?managed` at the end of the import\n * @param name The name of the style\n * @returns `false` if the style was already enabled, `true` otherwise\n * @example\n * import pluginStyle from \"./plugin.css?managed\";\n *\n * // Inside some plugin method like \"start()\" or \"[option].onChange()\"\n * enableStyle(pluginStyle);\n */\nexport function enableStyle(name: string) {\n const style = requireStyle(name);\n\n if (style.dom?.isConnected)\n return false;\n\n if (!style.dom) {\n style.dom = document.createElement(\"style\");\n style.dom.dataset.vencordName = style.name;\n }\n compileStyle(style);\n\n document.head.appendChild(style.dom);\n return true;\n}\n\n/**\n * @param name The name of the style\n * @returns `false` if the style was already disabled, `true` otherwise\n * @see {@link enableStyle} for info on getting the name of an imported style\n */\nexport function disableStyle(name: string) {\n const style = requireStyle(name);\n if (!style.dom?.isConnected)\n return false;\n\n style.dom.remove();\n style.dom = null;\n return true;\n}\n\n/**\n * @param name The name of the style\n * @returns `true` in most cases, may return `false` in some edge cases\n * @see {@link enableStyle} for info on getting the name of an imported style\n */\nexport const toggleStyle = (name: string) => isStyleEnabled(name) ? disableStyle(name) : enableStyle(name);\n\n/**\n * @param name The name of the style\n * @returns Whether the style is enabled\n * @see {@link enableStyle} for info on getting the name of an imported style\n */\nexport const isStyleEnabled = (name: string) => requireStyle(name).dom?.isConnected ?? false;\n\n/**\n * Sets the variables of a style\n * ```ts\n * // -- plugin.ts --\n * import pluginStyle from \"./plugin.css?managed\";\n * import { setStyleVars } from \"@api/Styles\";\n * import { findByPropsLazy } from \"@webpack\";\n * const classNames = findByPropsLazy(\"thin\", \"scrollerBase\"); // { thin: \"thin-31rlnD scrollerBase-_bVAAt\", ... }\n *\n * // Inside some plugin method like \"start()\"\n * setStyleClassNames(pluginStyle, classNames);\n * enableStyle(pluginStyle);\n * ```\n * ```scss\n * // -- plugin.css --\n * .plugin-root [--thin]::-webkit-scrollbar { ... }\n * ```\n * ```scss\n * // -- final stylesheet --\n * .plugin-root .thin-31rlnD.scrollerBase-_bVAAt::-webkit-scrollbar { ... }\n * ```\n * @param name The name of the style\n * @param classNames An object where the keys are the variable names and the values are the variable values\n * @param recompile Whether to recompile the style after setting the variables, defaults to `true`\n * @see {@link enableStyle} for info on getting the name of an imported style\n */\nexport const setStyleClassNames = (name: string, classNames: Record, recompile = true) => {\n const style = requireStyle(name);\n style.classNames = classNames;\n if (recompile && isStyleEnabled(style.name))\n compileStyle(style);\n};\n\n/**\n * Updates the stylesheet after doing the following to the sourcecode:\n * - Interpolate style classnames\n * @param style **_Must_ be a style with a DOM element**\n * @see {@link setStyleClassNames} for more info on style classnames\n */\nexport const compileStyle = (style: Style) => {\n if (!style.dom) throw new Error(\"Style has no DOM element\");\n\n style.dom.textContent = style.source\n .replace(/\\[--(\\w+)\\]/g, (match, name) => {\n const className = style.classNames[name];\n return className ? classNameToSelector(className) : match;\n });\n};\n\n/**\n * @param name The classname\n * @param prefix A prefix to add each class, defaults to `\"\"`\n * @return A css selector for the classname\n * @example\n * classNameToSelector(\"foo bar\") // => \".foo.bar\"\n */\nexport const classNameToSelector = (name: string, prefix = \"\") => name.split(\" \").map(n => `.${prefix}${n}`).join(\"\");\n\ntype ClassNameFactoryArg = string | string[] | Record | false | null | undefined | 0 | \"\";\n/**\n * @param prefix The prefix to add to each class, defaults to `\"\"`\n * @returns A classname generator function\n * @example\n * const cl = classNameFactory(\"plugin-\");\n *\n * cl(\"base\", [\"item\", \"editable\"], { selected: null, disabled: true })\n * // => \"plugin-base plugin-item plugin-editable plugin-disabled\"\n */\nexport const classNameFactory = (prefix: string = \"\") => (...args: ClassNameFactoryArg[]) => {\n const classNames = new Set();\n for (const arg of args) {\n if (arg && typeof arg === \"string\") classNames.add(arg);\n else if (Array.isArray(arg)) arg.forEach(name => classNames.add(name));\n else if (arg && typeof arg === \"object\") Object.entries(arg).forEach(([name, value]) => value && classNames.add(name));\n }\n return Array.from(classNames, name => prefix + name).join(\" \");\n};\n", "export { urlAlphabet } from './url-alphabet/index.js'\nexport let random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\nexport let customRandom = (alphabet, defaultSize, getRandom) => {\n let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1\n let step = -~((1.6 * mask * defaultSize) / alphabet.length)\n return (size = defaultSize) => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\nexport let customAlphabet = (alphabet, size = 21) =>\n customRandom(alphabet, size, random)\nexport let nanoid = (size = 21) =>\n crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {\n byte &= 63\n if (byte < 36) {\n id += byte.toString(36)\n } else if (byte < 62) {\n id += (byte - 26).toString(36).toUpperCase()\n } else if (byte > 62) {\n id += '-'\n } else {\n id += '_'\n }\n return id\n }, '')\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport * as DataStore from \"@api/DataStore\";\nimport { Settings } from \"@api/Settings\";\nimport { classNameFactory } from \"@api/Styles\";\nimport { closeModal, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from \"@utils/modal\";\nimport { useAwaiter } from \"@utils/react\";\nimport { Alerts, Button, Forms, React, Text, Timestamp, useEffect, useReducer, useState } from \"@webpack/common\";\nimport { nanoid } from \"nanoid\";\nimport type { DispatchWithoutAction } from \"react\";\n\nimport NotificationComponent from \"./NotificationComponent\";\nimport type { NotificationData } from \"./Notifications\";\n\ninterface PersistentNotificationData extends Pick {\n timestamp: number;\n id: string;\n}\n\nconst KEY = \"notification-log\";\n\nconst getLog = async () => {\n const log = await DataStore.get(KEY) as PersistentNotificationData[] | undefined;\n return log ?? [];\n};\n\nconst cl = classNameFactory(\"vc-notification-log-\");\nconst signals = new Set();\n\nexport async function persistNotification(notification: NotificationData) {\n if (notification.noPersist) return;\n\n const limit = Settings.notifications.logLimit;\n if (limit === 0) return;\n\n await DataStore.update(KEY, (old: PersistentNotificationData[] | undefined) => {\n const log = old ?? [];\n\n // Omit stuff we don't need\n const {\n onClick, onClose, richBody, permanent, noPersist, dismissOnClick,\n ...pureNotification\n } = notification;\n\n log.unshift({\n ...pureNotification,\n timestamp: Date.now(),\n id: nanoid()\n });\n\n if (log.length > limit && limit !== 200)\n log.length = limit;\n\n return log;\n });\n\n signals.forEach(x => x());\n}\n\nexport async function deleteNotification(timestamp: number) {\n const log = await getLog();\n const index = log.findIndex(x => x.timestamp === timestamp);\n if (index === -1) return;\n\n log.splice(index, 1);\n await DataStore.set(KEY, log);\n signals.forEach(x => x());\n}\n\nexport function useLogs() {\n const [signal, setSignal] = useReducer(x => x + 1, 0);\n\n useEffect(() => {\n signals.add(setSignal);\n return () => void signals.delete(setSignal);\n }, []);\n\n const [log, _, pending] = useAwaiter(getLog, {\n fallbackValue: [],\n deps: [signal]\n });\n\n return [log, pending] as const;\n}\n\nfunction NotificationEntry({ data }: { data: PersistentNotificationData; }) {\n const [removing, setRemoving] = useState(false);\n const ref = React.useRef(null);\n\n useEffect(() => {\n const div = ref.current!;\n\n const setHeight = () => {\n if (div.clientHeight === 0) return requestAnimationFrame(setHeight);\n div.style.height = `${div.clientHeight}px`;\n };\n\n setHeight();\n }, []);\n\n return (\n
\n {\n if (removing) return;\n setRemoving(true);\n\n setTimeout(() => deleteNotification(data.timestamp), 200);\n }}\n richBody={\n
\n {data.body}\n \n
\n }\n />\n
\n );\n}\n\nexport function NotificationLog({ log, pending }: { log: PersistentNotificationData[], pending: boolean; }) {\n if (!log.length && !pending)\n return (\n
\n
\n \n No notifications yet\n \n
\n );\n\n return (\n
\n {log.map(n => )}\n
\n );\n}\n\nfunction LogModal({ modalProps, close }: { modalProps: ModalProps; close(): void; }) {\n const [log, pending] = useLogs();\n\n return (\n \n \n Notification Log\n \n \n\n \n \n \n\n \n {\n Alerts.show({\n title: \"Are you sure?\",\n body: `This will permanently remove ${log.length} notification${log.length === 1 ? \"\" : \"s\"}. This action cannot be undone.`,\n async onConfirm() {\n await DataStore.set(KEY, []);\n signals.forEach(x => x());\n },\n confirmText: \"Do it!\",\n confirmColor: \"vc-notification-log-danger-btn\",\n cancelText: \"Nevermind\"\n });\n }}\n >\n Clear Notification Log\n \n \n \n );\n}\n\nexport function openNotificationLogModal() {\n const key = openModal(modalProps => (\n closeModal(key)}\n />\n ));\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { Queue } from \"@utils/Queue\";\nimport { ReactDOM } from \"@webpack/common\";\nimport type { ReactNode } from \"react\";\nimport type { Root } from \"react-dom/client\";\n\nimport NotificationComponent from \"./NotificationComponent\";\nimport { persistNotification } from \"./notificationLog\";\n\nconst NotificationQueue = new Queue();\n\nlet reactRoot: Root;\nlet id = 42;\n\nfunction getRoot() {\n if (!reactRoot) {\n const container = document.createElement(\"div\");\n container.id = \"vc-notification-container\";\n document.body.append(container);\n reactRoot = ReactDOM.createRoot(container);\n }\n return reactRoot;\n}\n\nexport interface NotificationData {\n title: string;\n body: string;\n /**\n * Same as body but can be a custom component.\n * Will be used over body if present.\n * Not supported on desktop notifications, those will fall back to body */\n richBody?: ReactNode;\n /** Small icon. This is for things like profile pictures and should be square */\n icon?: string;\n /** Large image. Optimally, this should be around 16x9 but it doesn't matter much. Desktop Notifications might not support this */\n image?: string;\n onClick?(): void;\n onClose?(): void;\n color?: string;\n /** Whether this notification should not have a timeout */\n permanent?: boolean;\n /** Whether this notification should not be persisted in the Notification Log */\n noPersist?: boolean;\n /** Whether this notification should be dismissed when clicked (defaults to true) */\n dismissOnClick?: boolean;\n}\n\nfunction _showNotification(notification: NotificationData, id: number) {\n const root = getRoot();\n return new Promise(resolve => {\n root.render(\n {\n notification.onClose?.();\n root.render(null);\n resolve();\n }} />,\n );\n });\n}\n\nfunction shouldBeNative() {\n if (typeof Notification === \"undefined\") return false;\n\n const { useNative } = Settings.notifications;\n if (useNative === \"always\") return true;\n if (useNative === \"not-focused\") return !document.hasFocus();\n return false;\n}\n\nexport async function requestPermission() {\n return (\n Notification.permission === \"granted\" ||\n (Notification.permission !== \"denied\" && (await Notification.requestPermission()) === \"granted\")\n );\n}\n\nexport async function showNotification(data: NotificationData) {\n persistNotification(data);\n\n if (shouldBeNative() && await requestPermission()) {\n const { title, body, icon, image, onClick = null, onClose = null } = data;\n const n = new Notification(title, {\n body,\n icon,\n image\n });\n n.onclick = onClick;\n n.onclose = onClose;\n } else {\n NotificationQueue.push(() => _showNotification(data, id++));\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport * from \"./Notifications\";\n", "// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, u32 = Uint32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\n// see fleb note\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new u32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = ((j - b[i]) << 5) | i;\n }\n }\n return [b, r];\n};\nvar _a = freb(fleb, 2), fl = _a[0], revfl = _a[1];\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b[0], revfd = _b[1];\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n // reverse table algorithm from SO\n var x = ((i & 0xAAAA) >>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i) {\n if (cd[i])\n ++l[cd[i] - 1];\n }\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v.BYTES_PER_ELEMENT == 2 ? u16 : v.BYTES_PER_ELEMENT == 4 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n if (!sl || (st && st.f && !st.l))\n return buf || new u8(0);\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [et, 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e >= s) {\n // write final block\n w[pos >> 3] = lst;\n }\n pos = wfblk(w, pos + 1, dat.subarray(i, e));\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n // deopt when i > s - 3 - at end, deopt acceptable\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst && pos & 7)\n pos = wfblk(w, pos + 1, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/\\s+/g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k].buffer) {\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += d[10] | (d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if (d[1] & 32)\n err(6, 'invalid zlib data: preset dictionaries not supported');\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.d = final;\n this.p(chunk, final || false);\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n var s = this.p.length > 3 ? gzs(this.p) : 4;\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n err(6, 'invalid gzip data');\n this.p = this.p.subarray(0, -8);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k, op = o;\n if (Array.isArray(val))\n op = mrg(o, val[1]), val = val[0];\n if (val instanceof u8)\n t[n] = [val, op];\n else {\n t[n += '/'] = [new u8(0), op];\n fltn(val, n, t, o);\n }\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return [r, slc(d, i - 1)];\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), ch = _a[0], np = _a[1];\n if (final) {\n if (np.length)\n err(8);\n this.p = null;\n }\n else\n this.p = np;\n this.ondata(ch, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td)\n return td.decode(dat);\n else {\n var _a = dutf8(dat), out = _a[0], ext = _a[1];\n if (ext.length)\n err(8);\n return out;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c < 0 && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;\n if (c != -1) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c < 0 ? -c - 2 : c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this_1 = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u, -1);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this_1.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this_1.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this_1.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this_1.ondata(err, dat, final);\n _this_1.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this_1 = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this_1.d & 1))\n return;\n _this_1.u.splice(-1, 1);\n _this_1.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this_1 = this;\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this_1 = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this_1 = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this_1.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this_1.k[0] == chks_3 && _this_1.c)\n _this_1.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = lft = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, new u8(su)));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport * as DataStore from \"@api/DataStore\";\nimport { showNotification } from \"@api/Notifications\";\nimport { Settings } from \"@api/Settings\";\nimport { OAuth2AuthorizeModal, UserStore } from \"@webpack/common\";\n\nimport { Logger } from \"./Logger\";\nimport { openModal } from \"./modal\";\n\nexport const cloudLogger = new Logger(\"Cloud\", \"#39b7e0\");\nexport const getCloudUrl = () => new URL(Settings.cloud.url);\n\nconst cloudUrlOrigin = () => getCloudUrl().origin;\nconst getUserId = () => {\n const id = UserStore.getCurrentUser()?.id;\n if (!id) throw new Error(\"User not yet logged in\");\n return id;\n};\n\nexport async function getAuthorization() {\n const secrets = await DataStore.get>(\"Vencord_cloudSecret\") ?? {};\n\n const origin = cloudUrlOrigin();\n\n // we need to migrate from the old format here\n if (secrets[origin]) {\n await DataStore.update>(\"Vencord_cloudSecret\", secrets => {\n secrets ??= {};\n // use the current user ID\n secrets[`${origin}:${getUserId()}`] = secrets[origin];\n delete secrets[origin];\n return secrets;\n });\n\n // since this doesn't update the original object, we'll early return the existing authorization\n return secrets[origin];\n }\n\n return secrets[`${origin}:${getUserId()}`];\n}\n\nasync function setAuthorization(secret: string) {\n await DataStore.update>(\"Vencord_cloudSecret\", secrets => {\n secrets ??= {};\n secrets[`${cloudUrlOrigin()}:${getUserId()}`] = secret;\n return secrets;\n });\n}\n\nexport async function deauthorizeCloud() {\n await DataStore.update>(\"Vencord_cloudSecret\", secrets => {\n secrets ??= {};\n delete secrets[`${cloudUrlOrigin()}:${getUserId()}`];\n return secrets;\n });\n}\n\nexport async function authorizeCloud() {\n if (await getAuthorization() !== undefined) {\n Settings.cloud.authenticated = true;\n return;\n }\n\n try {\n const oauthConfiguration = await fetch(new URL(\"/v1/oauth/settings\", getCloudUrl()));\n var { clientId, redirectUri } = await oauthConfiguration.json();\n } catch {\n showNotification({\n title: \"Cloud Integration\",\n body: \"Setup failed (couldn't retrieve OAuth configuration).\"\n });\n Settings.cloud.authenticated = false;\n return;\n }\n\n openModal((props: any) => {\n if (!location) {\n Settings.cloud.authenticated = false;\n return;\n }\n\n try {\n const res = await fetch(location, {\n headers: { Accept: \"application/json\" }\n });\n const { secret } = await res.json();\n if (secret) {\n cloudLogger.info(\"Authorized with secret\");\n await setAuthorization(secret);\n showNotification({\n title: \"Cloud Integration\",\n body: \"Cloud integrations enabled!\"\n });\n Settings.cloud.authenticated = true;\n } else {\n showNotification({\n title: \"Cloud Integration\",\n body: \"Setup failed (no secret returned?).\"\n });\n Settings.cloud.authenticated = false;\n }\n } catch (e: any) {\n cloudLogger.error(\"Failed to authorize\", e);\n showNotification({\n title: \"Cloud Integration\",\n body: `Setup failed (${e.toString()}).`\n });\n Settings.cloud.authenticated = false;\n }\n }\n }\n />);\n}\n\nexport async function getCloudAuth() {\n const secret = await getAuthorization();\n\n return window.btoa(`${secret}:${getUserId()}`);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function relaunch() {\n if (IS_DISCORD_DESKTOP)\n window.DiscordNative.app.relaunch();\n else\n window.VesktopNative.app.relaunch();\n}\n\nexport function showItemInFolder(path: string) {\n if (IS_DISCORD_DESKTOP)\n window.DiscordNative.fileManager.showItemInFolder(path);\n else\n window.VesktopNative.fileManager.showItemInFolder(path);\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\n/**\n * Prompts the user to save a file to their system\n * @param file The file to save\n */\nexport function saveFile(file: File) {\n const a = document.createElement(\"a\");\n a.href = URL.createObjectURL(file);\n a.download = file.name;\n\n document.body.appendChild(a);\n a.click();\n setImmediate(() => {\n URL.revokeObjectURL(a.href);\n document.body.removeChild(a);\n });\n}\n\n/**\n * Prompts the user to choose a file from their system\n * @param mimeTypes A comma separated list of mime types to accept, see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept#unique_file_type_specifiers\n * @returns A promise that resolves to the chosen file or null if the user cancels\n */\nexport function chooseFile(mimeTypes: string) {\n return new Promise(resolve => {\n const input = document.createElement(\"input\");\n input.type = \"file\";\n input.style.display = \"none\";\n input.accept = mimeTypes;\n input.onchange = async () => {\n resolve(input.files?.[0] ?? null);\n };\n\n document.body.appendChild(input);\n input.click();\n setImmediate(() => document.body.removeChild(input));\n });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { showNotification } from \"@api/Notifications\";\nimport { PlainSettings, Settings } from \"@api/Settings\";\nimport { Toasts } from \"@webpack/common\";\nimport { deflateSync, inflateSync } from \"fflate\";\n\nimport { getCloudAuth, getCloudUrl } from \"./cloud\";\nimport { Logger } from \"./Logger\";\nimport { relaunch } from \"./native\";\nimport { chooseFile, saveFile } from \"./web\";\n\nexport async function importSettings(data: string) {\n try {\n var parsed = JSON.parse(data);\n } catch (err) {\n console.log(data);\n throw new Error(\"Failed to parse JSON: \" + String(err));\n }\n\n if (\"settings\" in parsed && \"quickCss\" in parsed) {\n Object.assign(PlainSettings, parsed.settings);\n await VencordNative.settings.set(parsed.settings);\n await VencordNative.quickCss.set(parsed.quickCss);\n } else\n throw new Error(\"Invalid Settings. Is this even a Vencord Settings file?\");\n}\n\nexport async function exportSettings({ minify }: { minify?: boolean; } = {}) {\n const settings = VencordNative.settings.get();\n const quickCss = await VencordNative.quickCss.get();\n return JSON.stringify({ settings, quickCss }, null, minify ? undefined : 4);\n}\n\nexport async function downloadSettingsBackup() {\n const filename = \"vencord-settings-backup.json\";\n const backup = await exportSettings();\n const data = new TextEncoder().encode(backup);\n\n if (IS_DISCORD_DESKTOP) {\n DiscordNative.fileManager.saveWithDialog(data, filename);\n } else {\n saveFile(new File([data], filename, { type: \"application/json\" }));\n }\n}\n\nconst toast = (type: number, message: string) =>\n Toasts.show({\n type,\n message,\n id: Toasts.genId()\n });\n\nconst toastSuccess = () =>\n toast(Toasts.Type.SUCCESS, \"Settings successfully imported. Restart to apply changes!\");\n\nconst toastFailure = (err: any) =>\n toast(Toasts.Type.FAILURE, `Failed to import settings: ${String(err)}`);\n\nexport async function uploadSettingsBackup(showToast = true): Promise {\n if (IS_DISCORD_DESKTOP) {\n const [file] = await DiscordNative.fileManager.openFiles({\n filters: [\n { name: \"Vencord Settings Backup\", extensions: [\"json\"] },\n { name: \"all\", extensions: [\"*\"] }\n ]\n });\n\n if (file) {\n try {\n await importSettings(new TextDecoder().decode(file.data));\n if (showToast) toastSuccess();\n } catch (err) {\n new Logger(\"SettingsSync\").error(err);\n if (showToast) toastFailure(err);\n }\n }\n } else {\n const file = await chooseFile(\"application/json\");\n if (!file) return;\n\n const reader = new FileReader();\n reader.onload = async () => {\n try {\n await importSettings(reader.result as string);\n if (showToast) toastSuccess();\n } catch (err) {\n new Logger(\"SettingsSync\").error(err);\n if (showToast) toastFailure(err);\n }\n };\n reader.readAsText(file);\n }\n}\n\n// Cloud settings\nconst cloudSettingsLogger = new Logger(\"Cloud:Settings\", \"#39b7e0\");\n\nexport async function putCloudSettings(manual?: boolean) {\n const settings = await exportSettings({ minify: true });\n\n try {\n const res = await fetch(new URL(\"/v1/settings\", getCloudUrl()), {\n method: \"PUT\",\n headers: {\n Authorization: await getCloudAuth(),\n \"Content-Type\": \"application/octet-stream\"\n },\n body: deflateSync(new TextEncoder().encode(settings))\n });\n\n if (!res.ok) {\n cloudSettingsLogger.error(`Failed to sync up, API returned ${res.status}`);\n showNotification({\n title: \"Cloud Settings\",\n body: `Could not synchronize settings to cloud (API returned ${res.status}).`,\n color: \"var(--red-360)\"\n });\n return;\n }\n\n const { written } = await res.json();\n PlainSettings.cloud.settingsSyncVersion = written;\n VencordNative.settings.set(PlainSettings);\n\n cloudSettingsLogger.info(\"Settings uploaded to cloud successfully\");\n\n if (manual) {\n showNotification({\n title: \"Cloud Settings\",\n body: \"Synchronized settings to the cloud!\",\n noPersist: true,\n });\n }\n } catch (e: any) {\n cloudSettingsLogger.error(\"Failed to sync up\", e);\n showNotification({\n title: \"Cloud Settings\",\n body: `Could not synchronize settings to the cloud (${e.toString()}).`,\n color: \"var(--red-360)\"\n });\n }\n}\n\nexport async function getCloudSettings(shouldNotify = true, force = false) {\n try {\n const res = await fetch(new URL(\"/v1/settings\", getCloudUrl()), {\n method: \"GET\",\n headers: {\n Authorization: await getCloudAuth(),\n Accept: \"application/octet-stream\",\n \"If-None-Match\": Settings.cloud.settingsSyncVersion.toString()\n },\n });\n\n if (res.status === 404) {\n cloudSettingsLogger.info(\"No settings on the cloud\");\n if (shouldNotify)\n showNotification({\n title: \"Cloud Settings\",\n body: \"There are no settings in the cloud.\",\n noPersist: true\n });\n return false;\n }\n\n if (res.status === 304) {\n cloudSettingsLogger.info(\"Settings up to date\");\n if (shouldNotify)\n showNotification({\n title: \"Cloud Settings\",\n body: \"Your settings are up to date.\",\n noPersist: true\n });\n return false;\n }\n\n if (!res.ok) {\n cloudSettingsLogger.error(`Failed to sync down, API returned ${res.status}`);\n showNotification({\n title: \"Cloud Settings\",\n body: `Could not synchronize settings from the cloud (API returned ${res.status}).`,\n color: \"var(--red-360)\"\n });\n return false;\n }\n\n const written = Number(res.headers.get(\"etag\")!);\n const localWritten = Settings.cloud.settingsSyncVersion;\n\n // don't need to check for written > localWritten because the server will return 304 due to if-none-match\n if (!force && written < localWritten) {\n if (shouldNotify)\n showNotification({\n title: \"Cloud Settings\",\n body: \"Your local settings are newer than the cloud ones.\",\n noPersist: true,\n });\n return;\n }\n\n const data = await res.arrayBuffer();\n\n const settings = new TextDecoder().decode(inflateSync(new Uint8Array(data)));\n await importSettings(settings);\n\n // sync with server timestamp instead of local one\n PlainSettings.cloud.settingsSyncVersion = written;\n VencordNative.settings.set(PlainSettings);\n\n cloudSettingsLogger.info(\"Settings loaded from cloud successfully\");\n if (shouldNotify)\n showNotification({\n title: \"Cloud Settings\",\n body: \"Your settings have been updated! Click here to restart to fully apply changes!\",\n color: \"var(--green-360)\",\n onClick: IS_WEB ? () => location.reload() : relaunch,\n noPersist: true\n });\n\n return true;\n } catch (e: any) {\n cloudSettingsLogger.error(\"Failed to sync down\", e);\n showNotification({\n title: \"Cloud Settings\",\n body: `Could not synchronize settings from the cloud (${e.toString()}).`,\n color: \"var(--red-360)\"\n });\n\n return false;\n }\n}\n\nexport async function deleteCloudSettings() {\n try {\n const res = await fetch(new URL(\"/v1/settings\", getCloudUrl()), {\n method: \"DELETE\",\n headers: { Authorization: await getCloudAuth() },\n });\n\n if (!res.ok) {\n cloudSettingsLogger.error(`Failed to delete, API returned ${res.status}`);\n showNotification({\n title: \"Cloud Settings\",\n body: `Could not delete settings (API returned ${res.status}).`,\n color: \"var(--red-360)\"\n });\n return;\n }\n\n cloudSettingsLogger.info(\"Settings deleted from cloud successfully\");\n showNotification({\n title: \"Cloud Settings\",\n body: \"Settings deleted from cloud!\",\n color: \"var(--green-360)\"\n });\n } catch (e: any) {\n cloudSettingsLogger.error(\"Failed to delete\", e);\n showNotification({\n title: \"Cloud Settings\",\n body: `Could not delete settings (${e.toString()}).`,\n color: \"var(--red-360)\"\n });\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { debounce } from \"@shared/debounce\";\nimport { SettingsStore as SettingsStoreClass } from \"@shared/SettingsStore\";\nimport { localStorage } from \"@utils/localStorage\";\nimport { Logger } from \"@utils/Logger\";\nimport { mergeDefaults } from \"@utils/misc\";\nimport { putCloudSettings } from \"@utils/settingsSync\";\nimport { DefinedSettings, OptionType, SettingsChecks, SettingsDefinition } from \"@utils/types\";\nimport { React } from \"@webpack/common\";\n\nimport plugins from \"~plugins\";\n\nconst logger = new Logger(\"Settings\");\nexport interface Settings {\n notifyAboutUpdates: boolean;\n autoUpdate: boolean;\n autoUpdateNotification: boolean,\n useQuickCss: boolean;\n enableReactDevtools: boolean;\n themeLinks: string[];\n enabledThemes: string[];\n frameless: boolean;\n transparent: boolean;\n winCtrlQ: boolean;\n macosVibrancyStyle:\n | \"content\"\n | \"fullscreen-ui\"\n | \"header\"\n | \"hud\"\n | \"menu\"\n | \"popover\"\n | \"selection\"\n | \"sidebar\"\n | \"titlebar\"\n | \"tooltip\"\n | \"under-page\"\n | \"window\"\n | undefined;\n disableMinSize: boolean;\n winNativeTitleBar: boolean;\n plugins: {\n [plugin: string]: {\n enabled: boolean;\n [setting: string]: any;\n };\n };\n\n notifications: {\n timeout: number;\n position: \"top-right\" | \"bottom-right\";\n useNative: \"always\" | \"never\" | \"not-focused\";\n logLimit: number;\n };\n\n cloud: {\n authenticated: boolean;\n url: string;\n settingsSync: boolean;\n settingsSyncVersion: number;\n };\n}\n\nconst DefaultSettings: Settings = {\n notifyAboutUpdates: true,\n autoUpdate: false,\n autoUpdateNotification: true,\n useQuickCss: true,\n themeLinks: [],\n enabledThemes: [],\n enableReactDevtools: false,\n frameless: false,\n transparent: false,\n winCtrlQ: false,\n macosVibrancyStyle: undefined,\n disableMinSize: false,\n winNativeTitleBar: false,\n plugins: {},\n\n notifications: {\n timeout: 5000,\n position: \"bottom-right\",\n useNative: \"not-focused\",\n logLimit: 50\n },\n\n cloud: {\n authenticated: false,\n url: \"https://api.vencord.dev/\",\n settingsSync: false,\n settingsSyncVersion: 0\n }\n};\n\nconst settings = VencordNative.settings.get();\nmergeDefaults(settings, DefaultSettings);\n\nconst saveSettingsOnFrequentAction = debounce(async () => {\n if (Settings.cloud.settingsSync && Settings.cloud.authenticated) {\n await putCloudSettings();\n delete localStorage.Vencord_settingsDirty;\n }\n}, 60_000);\n\n\nexport const SettingsStore = new SettingsStoreClass(settings, {\n readOnly: true,\n getDefaultValue({\n target,\n key,\n path\n }) {\n const v = target[key];\n if (!plugins) return v; // plugins not initialised yet. this means this path was reached by being called on the top level\n\n if (path === \"plugins\" && key in plugins)\n return target[key] = {\n enabled: plugins[key].required ?? plugins[key].enabledByDefault ?? false\n };\n\n // Since the property is not set, check if this is a plugin's setting and if so, try to resolve\n // the default value.\n if (path.startsWith(\"plugins.\")) {\n const plugin = path.slice(\"plugins.\".length);\n if (plugin in plugins) {\n const setting = plugins[plugin].options?.[key];\n if (!setting) return v;\n\n if (\"default\" in setting)\n // normal setting with a default value\n return (target[key] = setting.default);\n\n if (setting.type === OptionType.SELECT) {\n const def = setting.options.find(o => o.default);\n if (def)\n target[key] = def.value;\n return def?.value;\n }\n }\n }\n return v;\n }\n});\n\nSettingsStore.addGlobalChangeListener((_, path) => {\n SettingsStore.plain.cloud.settingsSyncVersion = Date.now();\n localStorage.Vencord_settingsDirty = true;\n saveSettingsOnFrequentAction();\n VencordNative.settings.set(SettingsStore.plain, path);\n});\n\n/**\n * Same as {@link Settings} but unproxied. You should treat this as readonly,\n * as modifying properties on this will not save to disk or call settings\n * listeners.\n * WARNING: default values specified in plugin.options will not be ensured here. In other words,\n * settings for which you specified a default value may be uninitialised. If you need proper\n * handling for default values, use {@link Settings}\n */\nexport const PlainSettings = settings;\n/**\n * A smart settings object. Altering props automagically saves\n * the updated settings to disk.\n * This recursively proxies objects. If you need the object non proxied, use {@link PlainSettings}\n */\nexport const Settings = SettingsStore.store;\n\n/**\n * Settings hook for React components. Returns a smart settings\n * object that automagically triggers a rerender if any properties\n * are altered\n * @param paths An optional list of paths to whitelist for rerenders\n * @returns Settings\n */\n// TODO: Representing paths as essentially \"string[].join('.')\" wont allow dots in paths, change to \"paths?: string[][]\" later\nexport function useSettings(paths?: UseSettings[]) {\n const [, forceUpdate] = React.useReducer(() => ({}), {});\n\n React.useEffect(() => {\n if (paths) {\n paths.forEach(p => SettingsStore.addChangeListener(p, forceUpdate));\n return () => paths.forEach(p => SettingsStore.removeChangeListener(p, forceUpdate));\n } else {\n SettingsStore.addGlobalChangeListener(forceUpdate);\n return () => SettingsStore.removeGlobalChangeListener(forceUpdate);\n }\n }, []);\n\n return SettingsStore.store;\n}\n\nexport function migratePluginSettings(name: string, ...oldNames: string[]) {\n const { plugins } = SettingsStore.plain;\n if (name in plugins) return;\n\n for (const oldName of oldNames) {\n if (oldName in plugins) {\n logger.info(`Migrating settings from old name ${oldName} to ${name}`);\n plugins[name] = plugins[oldName];\n delete plugins[oldName];\n SettingsStore.markAsChanged();\n break;\n }\n }\n}\n\nexport function definePluginSettings<\n Def extends SettingsDefinition,\n Checks extends SettingsChecks,\n PrivateSettings extends object = {}\n>(def: Def, checks?: Checks) {\n const definedSettings: DefinedSettings = {\n get store() {\n if (!definedSettings.pluginName) throw new Error(\"Cannot access settings before plugin is initialized\");\n return Settings.plugins[definedSettings.pluginName] as any;\n },\n use: settings => useSettings(\n settings?.map(name => `plugins.${definedSettings.pluginName}.${name}`) as UseSettings[]\n ).plugins[definedSettings.pluginName] as any,\n def,\n checks: checks ?? {} as any,\n pluginName: \"\",\n\n withPrivateSettings() {\n return this as DefinedSettings;\n }\n };\n\n return definedSettings;\n}\n\ntype UseSettings = ResolveUseSettings[keyof T];\n\ntype ResolveUseSettings = {\n [Key in keyof T]:\n Key extends string\n ? T[Key] extends Record\n // @ts-ignore \"Type instantiation is excessively deep and possibly infinite\"\n ? UseSettings extends string ? `${Key}.${UseSettings}` : never\n : Key\n : never;\n};\n", "export default \"ca18b6e\"", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport gitHash from \"~git-hash\";\n\nimport { Logger } from \"./Logger\";\nimport { relaunch } from \"./native\";\nimport { IpcRes } from \"./types\";\n\nexport const UpdateLogger = /* #__PURE__*/ new Logger(\"Updater\", \"white\");\nexport let isOutdated = false;\nexport let isNewer = false;\nexport let updateError: any;\nexport let changes: Record<\"hash\" | \"author\" | \"message\", string>[];\n\nasync function Unwrap(p: Promise>) {\n const res = await p;\n\n if (res.ok) return res.value;\n\n updateError = res.error;\n throw res.error;\n}\n\nexport async function checkForUpdates() {\n changes = await Unwrap(VencordNative.updater.getUpdates());\n if (changes.some(c => c.hash === gitHash)) {\n isNewer = true;\n return (isOutdated = false);\n }\n return (isOutdated = changes.length > 0);\n}\n\nexport async function update() {\n if (!isOutdated) return true;\n\n const res = await Unwrap(VencordNative.updater.update());\n\n if (res) {\n isOutdated = false;\n if (!await Unwrap(VencordNative.updater.rebuild()))\n throw new Error(\"The Build failed. Please try manually building the new update\");\n }\n\n return res;\n}\n\nexport const getRepo = () => Unwrap(VencordNative.updater.getRepo());\n\nexport async function maybePromptToUpdate(confirmMessage: string, checkForDev = false) {\n if (IS_WEB || IS_UPDATER_DISABLED) return;\n if (checkForDev && IS_DEV) return;\n\n try {\n const isOutdated = await checkForUpdates();\n if (isOutdated) {\n const wantsUpdate = confirm(confirmMessage);\n if (wantsUpdate && isNewer) return alert(\"Your local copy has more recent commits. Please stash or reset them.\");\n if (wantsUpdate) {\n await update();\n relaunch();\n }\n }\n } catch (err) {\n UpdateLogger.error(err);\n alert(\"That also failed :( Try updating or re-installing with the installer!\");\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { maybePromptToUpdate } from \"@utils/updater\";\n\nexport function handleComponentFailed() {\n maybePromptToUpdate(\n \"Uh Oh! Failed to render this Page.\" +\n \" However, there is an update available that might fix it.\" +\n \" Would you like to update and restart now?\"\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function onlyOnce(f: F): F {\n let called = false;\n let result: any;\n return function onlyOnceWrapper(this: unknown) {\n if (called) return result;\n\n called = true;\n\n return (result = f.apply(this, arguments));\n } as unknown as F;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./settingsStyles.css\";\nimport \"./themesStyles.css\";\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { handleComponentFailed } from \"@components/handleComponentFailed\";\nimport { Margins } from \"@utils/margins\";\nimport { onlyOnce } from \"@utils/onlyOnce\";\nimport { Forms, Text } from \"@webpack/common\";\nimport type { ComponentType, PropsWithChildren } from \"react\";\n\nexport function SettingsTab({ title, children }: PropsWithChildren<{ title: string; }>) {\n return (\n \n \n {title}\n \n\n {children}\n \n );\n}\n\nconst onError = onlyOnce(handleComponentFailed);\n\nexport function wrapTab(component: ComponentType, tab: string) {\n return ErrorBoundary.wrap(component, {\n message: `Failed to render the ${tab} tab. If this issue persists, try using the installer to reinstall!`,\n onError,\n });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { openNotificationLogModal } from \"@api/Notifications/notificationLog\";\nimport { Settings, useSettings } from \"@api/Settings\";\nimport { classNameFactory } from \"@api/Styles\";\nimport DonateButton from \"@components/DonateButton\";\nimport { ErrorCard } from \"@components/ErrorCard\";\nimport { Margins } from \"@utils/margins\";\nimport { identity } from \"@utils/misc\";\nimport { relaunch, showItemInFolder } from \"@utils/native\";\nimport { useAwaiter } from \"@utils/react\";\nimport { Button, Card, Forms, React, Select, Slider, Switch } from \"@webpack/common\";\n\nimport { SettingsTab, wrapTab } from \"./shared\";\n\nconst cl = classNameFactory(\"vc-settings-\");\n\nconst DEFAULT_DONATE_IMAGE = \"https://cdn.discordapp.com/emojis/1026533090627174460.png\";\nconst SHIGGY_DONATE_IMAGE = \"https://media.discordapp.net/stickers/1039992459209490513.png\";\n\ntype KeysOfType = {\n [K in keyof Object]: Object[K] extends Type ? K : never;\n}[keyof Object];\n\nfunction VencordSettings() {\n const [settingsDir, , settingsDirPending] = useAwaiter(VencordNative.settings.getSettingsDir, {\n fallbackValue: \"Loading...\"\n });\n const settings = useSettings();\n\n const donateImage = React.useMemo(() => Math.random() > 0.5 ? DEFAULT_DONATE_IMAGE : SHIGGY_DONATE_IMAGE, []);\n\n const isWindows = navigator.platform.toLowerCase().startsWith(\"win\");\n const isMac = navigator.platform.toLowerCase().startsWith(\"mac\");\n const needsVibrancySettings = IS_DISCORD_DESKTOP && isMac;\n\n const Switches: Array;\n title: string;\n note: string;\n }> =\n [\n {\n key: \"useQuickCss\",\n title: \"Enable Custom CSS\",\n note: \"Loads your Custom CSS\"\n },\n !IS_WEB && {\n key: \"enableReactDevtools\",\n title: \"Enable React Developer Tools\",\n note: \"Requires a full restart\"\n },\n !IS_WEB && (!IS_DISCORD_DESKTOP || !isWindows ? {\n key: \"frameless\",\n title: \"Disable the window frame\",\n note: \"Requires a full restart\"\n } : {\n key: \"winNativeTitleBar\",\n title: \"Use Windows' native title bar instead of Discord's custom one\",\n note: \"Requires a full restart\"\n }),\n !IS_WEB && {\n key: \"transparent\",\n title: \"Enable window transparency.\",\n note: \"You need a theme that supports transparency or this will do nothing. Will stop the window from being resizable. Requires a full restart\"\n },\n !IS_WEB && isWindows && {\n key: \"winCtrlQ\",\n title: \"Register Ctrl+Q as shortcut to close Discord (Alternative to Alt+F4)\",\n note: \"Requires a full restart\"\n },\n IS_DISCORD_DESKTOP && {\n key: \"disableMinSize\",\n title: \"Disable minimum window size\",\n note: \"Requires a full restart\"\n },\n ];\n\n return (\n \n \n \n \n \n {!IS_WEB && (\n \n Restart Client\n \n )}\n VencordNative.quickCss.openEditor()}\n size={Button.Sizes.SMALL}\n disabled={settingsDir === \"Loading...\"}>\n Open QuickCSS File\n \n {!IS_WEB && (\n showItemInFolder(settingsDir)}\n size={Button.Sizes.SMALL}\n disabled={settingsDirPending}>\n Open Settings Folder\n \n )}\n VencordNative.native.openExternal(\"https://github.com/Vendicated/Vencord\")}\n size={Button.Sizes.SMALL}\n disabled={settingsDirPending}>\n Open in GitHub\n \n \n \n \n\n \n\n \n \n Hint: You can change the position of this settings section in the settings of the \"Settings\" plugin!\n \n {Switches.map(s => s && (\n settings[s.key] = v}\n note={s.note}\n >\n {s.title}\n \n ))}\n \n\n\n {needsVibrancySettings && <>\n Window vibrancy style (requires restart)\n settings.macosVibrancyStyle = v}\n isSelected={v => settings.macosVibrancyStyle === v}\n serialize={identity} />\n }\n\n {typeof Notification !== \"undefined\" && }\n \n );\n}\n\nfunction NotificationSection({ settings }: { settings: typeof Settings[\"notifications\"]; }) {\n return (\n <>\n Notification Style\n {settings.useNative !== \"never\" && Notification?.permission === \"denied\" && (\n \n Desktop Notification Permission denied\n You have denied Notification Permissions. Thus, Desktop notifications will not work!\n \n )}\n \n Some plugins may show you notifications. These come in two styles:\n
    \n
  • Vencord Notifications: These are in-app notifications
  • \n
  • Desktop Notifications: Native Desktop notifications (like when you get a ping)
  • \n
\n
\n >}\n closeOnSelect={true}\n select={v => settings.useNative = v}\n isSelected={v => v === settings.useNative}\n serialize={identity}\n />\n\n Notification Position\n >}\n select={v => settings.position = v}\n isSelected={v => v === settings.position}\n serialize={identity}\n />\n\n Notification Timeout\n Set to 0s to never automatically time out\n settings.timeout = v}\n onValueRender={v => (v / 1000).toFixed(2) + \"s\"}\n onMarkerRender={v => (v / 1000) + \"s\"}\n stickToMarkers={false}\n />\n\n Notification Log Limit\n \n The amount of notifications to save in the log until old ones are removed.\n Set to 0 to disable Notification log and \u221E to never automatically remove old Notifications\n \n settings.logLimit = v}\n onValueRender={v => v === 200 ? \"\u221E\" : v}\n onMarkerRender={v => v === 200 ? \"\u221E\" : v}\n />\n\n \n Open Notification Log\n \n \n );\n}\n\ninterface DonateCardProps {\n image: string;\n}\n\nfunction DonateCard({ image }: DonateCardProps) {\n return (\n \n
\n Support the Project\n Please consider supporting the development of Vencord by donating!\n \n
\n \n
\n );\n}\n\nexport default wrapTab(VencordSettings, \"Vencord Settings\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { waitFor } from \"@webpack\";\n\nlet NoticesModule: any;\nwaitFor(m => m.show && m.dismiss && !m.suppressAll, m => NoticesModule = m);\n\nexport const noticesQueue = [] as any[];\nexport let currentNotice: any = null;\n\nexport function popNotice() {\n NoticesModule.dismiss();\n}\n\nexport function nextNotice() {\n currentNotice = noticesQueue.shift();\n\n if (currentNotice) {\n NoticesModule.show(...currentNotice, \"VencordNotice\");\n }\n}\n\nexport function showNotice(message: string, buttonText: string, onOkClick: () => void) {\n noticesQueue.push([\"GENERIC\", message, buttonText, onOkClick]);\n if (!currentNotice) nextNotice();\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./iconStyles.css\";\n\nimport { classes } from \"@utils/misc\";\nimport { i18n } from \"@webpack/common\";\nimport type { PropsWithChildren, SVGProps } from \"react\";\n\ninterface BaseIconProps extends IconProps {\n viewBox: string;\n}\n\ninterface IconProps extends SVGProps {\n className?: string;\n height?: string | number;\n width?: string | number;\n}\n\nfunction Icon({ height = 24, width = 24, className, children, viewBox, ...svgProps }: PropsWithChildren) {\n return (\n \n {children}\n \n );\n}\n\n/**\n * Discord's link icon, as seen in the Message context menu \"Copy Message Link\" option\n */\nexport function LinkIcon({ height = 24, width = 24, className }: IconProps) {\n return (\n \n \n \n \n \n \n );\n}\n\n/**\n * Discord's copy icon, as seen in the user popout right of the username when clicking\n * your own username in the bottom left user panel\n */\nexport function CopyIcon(props: IconProps) {\n return (\n \n \n \n \n \n \n );\n}\n\n/**\n * Discord's open external icon, as seen in the user profile connections\n */\nexport function OpenExternalIcon(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function ImageIcon(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function InfoIcon(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function OwnerCrownIcon(props: IconProps) {\n return (\n \n \n \n );\n}\n\n/**\n * Discord's screenshare icon, as seen in the connection panel\n */\nexport function ScreenshareIcon(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function ImageVisible(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function ImageInvisible(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function Microphone(props: IconProps) {\n return (\n \n \n \n \n );\n}\n\nexport function CogWheel(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function ReplyIcon(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function DeleteIcon(props: IconProps) {\n return (\n \n \n \n \n );\n}\n\nexport function PlusIcon(props: IconProps) {\n return (\n \n \n \n );\n}\n\nexport function NoEntrySignIcon(props: IconProps) {\n return (\n \n \n \n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { moment } from \"@webpack/common\";\n\n// Utils for readable text transformations eg: `toTitle(fromKebab())`\n\n// Case style to words\nexport const wordsFromCamel = (text: string) => text.split(/(?=[A-Z])/).map(w => w.toLowerCase());\nexport const wordsFromSnake = (text: string) => text.toLowerCase().split(\"_\");\nexport const wordsFromKebab = (text: string) => text.toLowerCase().split(\"-\");\nexport const wordsFromPascal = (text: string) => text.split(/(?=[A-Z])/).map(w => w.toLowerCase());\nexport const wordsFromTitle = (text: string) => text.toLowerCase().split(\" \");\n\n// Words to case style\nexport const wordsToCamel = (words: string[]) =>\n words.map((w, i) => (i ? w[0].toUpperCase() + w.slice(1) : w)).join(\"\");\nexport const wordsToSnake = (words: string[]) => words.join(\"_\").toUpperCase();\nexport const wordsToKebab = (words: string[]) => words.join(\"-\").toLowerCase();\nexport const wordsToPascal = (words: string[]) =>\n words.map(w => w[0].toUpperCase() + w.slice(1)).join(\"\");\nexport const wordsToTitle = (words: string[]) =>\n words.map(w => w[0].toUpperCase() + w.slice(1)).join(\" \");\n\nconst units = [\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\"] as const;\ntype Units = typeof units[number];\n\nfunction getUnitStr(unit: Units, isOne: boolean, short: boolean) {\n if (short === false) return isOne ? unit.slice(0, -1) : unit;\n\n return unit[0];\n}\n\n/**\n * Forms time into a human readable string link \"1 day, 2 hours, 3 minutes and 4 seconds\"\n * @param time The time on the specified unit\n * @param unit The unit the time is on\n * @param short Whether to use short units like \"d\" instead of \"days\"\n */\nexport function formatDuration(time: number, unit: Units, short: boolean = false) {\n const dur = moment.duration(time, unit);\n\n let unitsAmounts = units.map(unit => ({ amount: dur[unit](), unit }));\n\n let amountsToBeRemoved = 0;\n\n outer:\n for (let i = 0; i < unitsAmounts.length; i++) {\n if (unitsAmounts[i].amount === 0 || !(i + 1 < unitsAmounts.length)) continue;\n for (let v = i + 1; v < unitsAmounts.length; v++) {\n if (unitsAmounts[v].amount !== 0) continue outer;\n }\n\n amountsToBeRemoved = unitsAmounts.length - (i + 1);\n }\n unitsAmounts = amountsToBeRemoved === 0 ? unitsAmounts : unitsAmounts.slice(0, -amountsToBeRemoved);\n\n const daysAmountIndex = unitsAmounts.findIndex(({ unit }) => unit === \"days\");\n if (daysAmountIndex !== -1) {\n const daysAmount = unitsAmounts[daysAmountIndex];\n\n const daysMod = daysAmount.amount % 7;\n if (daysMod === 0) unitsAmounts.splice(daysAmountIndex, 1);\n else daysAmount.amount = daysMod;\n }\n\n let res: string = \"\";\n while (unitsAmounts.length) {\n const { amount, unit } = unitsAmounts.shift()!;\n\n if (res.length) res += unitsAmounts.length ? \", \" : \" and \";\n\n if (amount > 0 || res.length) {\n res += `${amount} ${getUnitStr(unit, amount === 1, short)}`;\n }\n }\n\n return res.length ? res : `0 ${getUnitStr(unit, false, short)}`;\n}\n\n/**\n * Join an array of strings in a human readable way (1, 2 and 3)\n * @param elements Elements\n */\nexport function humanFriendlyJoin(elements: string[]): string;\n/**\n * Join an array of strings in a human readable way (1, 2 and 3)\n * @param elements Elements\n * @param mapper Function that converts elements to a string\n */\nexport function humanFriendlyJoin(elements: T[], mapper: (e: T) => string): string;\nexport function humanFriendlyJoin(elements: any[], mapper: (e: any) => string = s => s): string {\n const { length } = elements;\n if (length === 0)\n return \"\";\n if (length === 1)\n return mapper(elements[0]);\n\n let s = \"\";\n\n for (let i = 0; i < length; i++) {\n s += mapper(elements[i]);\n if (length - i > 2)\n s += \", \";\n else if (length - i > 1)\n s += \" and \";\n }\n\n return s;\n}\n\n/**\n * Wrap the text in ``` with an optional language\n */\nexport function makeCodeblock(text: string, language?: string) {\n const chars = \"```\";\n return `${chars}${language || \"\"}\\n${text.replaceAll(\"```\", \"\\\\`\\\\`\\\\`\")}\\n${chars}`;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { mergeDefaults } from \"@utils/misc\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { MessageActions, SnowflakeUtils } from \"@webpack/common\";\nimport { Message } from \"discord-types/general\";\nimport type { PartialDeep } from \"type-fest\";\n\nimport { Argument } from \"./types\";\n\nconst MessageCreator = findByPropsLazy(\"createBotMessage\");\n\nexport function generateId() {\n return `-${SnowflakeUtils.fromTimestamp(Date.now())}`;\n}\n\n/**\n * Send a message as Clyde\n * @param {string} channelId ID of channel to send message to\n * @param {Message} message Message to send\n * @returns {Message}\n */\nexport function sendBotMessage(channelId: string, message: PartialDeep): Message {\n const botMessage = MessageCreator.createBotMessage({ channelId, content: \"\", embeds: [] });\n\n MessageActions.receiveMessage(channelId, mergeDefaults(message, botMessage));\n\n return message as Message;\n}\n\n/**\n * Get the value of an option by name\n * @param args Arguments array (first argument passed to execute)\n * @param name Name of the argument\n * @param fallbackValue Fallback value in case this option wasn't passed\n * @returns Value\n */\nexport function findOption(args: Argument[], name: string): T & {} | undefined;\nexport function findOption(args: Argument[], name: string, fallbackValue: T): T & {};\nexport function findOption(args: Argument[], name: string, fallbackValue?: any) {\n return (args.find(a => a.name === name)?.value || fallbackValue) as any;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Channel, Guild } from \"discord-types/general\";\nimport { Promisable } from \"type-fest\";\n\nexport interface CommandContext {\n channel: Channel;\n guild?: Guild;\n}\n\nexport const enum ApplicationCommandOptionType {\n SUB_COMMAND = 1,\n SUB_COMMAND_GROUP = 2,\n STRING = 3,\n INTEGER = 4,\n BOOLEAN = 5,\n USER = 6,\n CHANNEL = 7,\n ROLE = 8,\n MENTIONABLE = 9,\n NUMBER = 10,\n ATTACHMENT = 11,\n}\n\nexport const enum ApplicationCommandInputType {\n BUILT_IN = 0,\n BUILT_IN_TEXT = 1,\n BUILT_IN_INTEGRATION = 2,\n BOT = 3,\n PLACEHOLDER = 4,\n}\n\nexport interface Option {\n name: string;\n displayName?: string;\n type: ApplicationCommandOptionType;\n description: string;\n displayDescription?: string;\n required?: boolean;\n options?: Option[];\n choices?: Array;\n}\n\nexport interface ChoicesOption {\n label: string;\n value: string;\n name: string;\n displayName?: string;\n}\n\nexport const enum ApplicationCommandType {\n CHAT_INPUT = 1,\n USER = 2,\n MESSAGE = 3,\n}\n\nexport interface CommandReturnValue {\n content: string;\n /** TODO: implement */\n cancel?: boolean;\n}\n\nexport interface Argument {\n type: ApplicationCommandOptionType;\n name: string;\n value: string;\n focused: undefined;\n options: Argument[];\n}\n\nexport interface Command {\n id?: string;\n applicationId?: string;\n type?: ApplicationCommandType;\n inputType?: ApplicationCommandInputType;\n plugin?: string;\n isVencordCommand?: boolean;\n\n name: string;\n displayName?: string;\n description: string;\n displayDescription?: string;\n\n options?: Option[];\n predicate?(ctx: CommandContext): boolean;\n\n execute(args: Argument[], ctx: CommandContext): Promisable;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { makeCodeblock } from \"@utils/text\";\n\nimport { sendBotMessage } from \"./commandHelpers\";\nimport { ApplicationCommandInputType, ApplicationCommandOptionType, ApplicationCommandType, Argument, Command, CommandContext, Option } from \"./types\";\n\nexport * from \"./commandHelpers\";\nexport * from \"./types\";\n\nexport let BUILT_IN: Command[];\nexport const commands = {} as Record;\n\n// hack for plugins being evaluated before we can grab these from webpack\nconst OptPlaceholder = Symbol(\"OptionalMessageOption\") as any as Option;\nconst ReqPlaceholder = Symbol(\"RequiredMessageOption\") as any as Option;\n/**\n * Optional message option named \"message\" you can use in commands.\n * Used in \"tableflip\" or \"shrug\"\n * @see {@link RequiredMessageOption}\n */\nexport let OptionalMessageOption: Option = OptPlaceholder;\n/**\n * Required message option named \"message\" you can use in commands.\n * Used in \"me\"\n * @see {@link OptionalMessageOption}\n */\nexport let RequiredMessageOption: Option = ReqPlaceholder;\n\nexport const _init = function (cmds: Command[]) {\n try {\n BUILT_IN = cmds;\n OptionalMessageOption = cmds.find(c => c.name === \"shrug\")!.options![0];\n RequiredMessageOption = cmds.find(c => c.name === \"me\")!.options![0];\n } catch (e) {\n console.error(\"Failed to load CommandsApi\");\n }\n return cmds;\n} as never;\n\nexport const _handleCommand = function (cmd: Command, args: Argument[], ctx: CommandContext) {\n if (!cmd.isVencordCommand)\n return cmd.execute(args, ctx);\n\n const handleError = (err: any) => {\n // TODO: cancel send if cmd.inputType === BUILT_IN_TEXT\n const msg = `An Error occurred while executing command \"${cmd.name}\"`;\n const reason = err instanceof Error ? err.stack || err.message : String(err);\n\n console.error(msg, err);\n sendBotMessage(ctx.channel.id, {\n content: `${msg}:\\n${makeCodeblock(reason)}`,\n author: {\n username: \"Vencord\"\n }\n });\n };\n\n try {\n const res = cmd.execute(args, ctx);\n return res instanceof Promise ? res.catch(handleError) : res;\n } catch (err) {\n return handleError(err);\n }\n} as never;\n\n\n/**\n * Prepare a Command Option for Discord by filling missing fields\n * @param opt\n */\nexport function prepareOption(opt: O): O {\n opt.displayName ||= opt.name;\n opt.displayDescription ||= opt.description;\n opt.options?.forEach((opt, i, opts) => {\n // See comment above Placeholders\n if (opt === OptPlaceholder) opts[i] = OptionalMessageOption;\n else if (opt === ReqPlaceholder) opts[i] = RequiredMessageOption;\n opt.choices?.forEach(x => x.displayName ||= x.name);\n\n prepareOption(opts[i]);\n });\n return opt;\n}\n\n// Yes, Discord registers individual commands for each subcommand\n// TODO: This probably doesn't support nested subcommands. If that is ever needed,\n// investigate\nfunction registerSubCommands(cmd: Command, plugin: string) {\n cmd.options?.forEach(o => {\n if (o.type !== ApplicationCommandOptionType.SUB_COMMAND)\n throw new Error(\"When specifying sub-command options, all options must be sub-commands.\");\n const subCmd = {\n ...cmd,\n ...o,\n type: ApplicationCommandType.CHAT_INPUT,\n name: `${cmd.name} ${o.name}`,\n id: `${o.name}-${cmd.id}`,\n displayName: `${cmd.name} ${o.name}`,\n subCommandPath: [{\n name: o.name,\n type: o.type,\n displayName: o.name\n }],\n rootCommand: cmd\n };\n registerCommand(subCmd as any, plugin);\n });\n}\n\nexport function registerCommand(command: C, plugin: string) {\n if (!BUILT_IN) {\n console.warn(\n \"[CommandsAPI]\",\n `Not registering ${command.name} as the CommandsAPI hasn't been initialised.`,\n \"Please restart to use commands\"\n );\n return;\n }\n\n if (BUILT_IN.some(c => c.name === command.name))\n throw new Error(`Command '${command.name}' already exists.`);\n\n command.isVencordCommand = true;\n command.id ??= `-${BUILT_IN.length + 1}`;\n command.applicationId ??= \"-1\"; // BUILT_IN;\n command.type ??= ApplicationCommandType.CHAT_INPUT;\n command.inputType ??= ApplicationCommandInputType.BUILT_IN_TEXT;\n command.plugin ||= plugin;\n\n prepareOption(command);\n\n if (command.options?.[0]?.type === ApplicationCommandOptionType.SUB_COMMAND) {\n registerSubCommands(command, plugin);\n return;\n }\n\n commands[command.name] = command;\n BUILT_IN.push(command);\n}\n\nexport function unregisterCommand(name: string) {\n const idx = BUILT_IN.findIndex(c => c.name === name);\n if (idx === -1)\n return false;\n\n BUILT_IN.splice(idx, 1);\n delete commands[name];\n\n return true;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport function Badge({ text, color }): JSX.Element {\n return (\n
\n {text}\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { wordsFromCamel, wordsToTitle } from \"@utils/text\";\nimport { PluginOptionBoolean } from \"@utils/types\";\nimport { Forms, React, Switch } from \"@webpack/common\";\n\nimport { ISettingElementProps } from \".\";\n\nexport function SettingBooleanComponent({ option, pluginSettings, definedSettings, id, onChange, onError }: ISettingElementProps) {\n const def = pluginSettings[id] ?? option.default;\n\n const [state, setState] = React.useState(def ?? false);\n const [error, setError] = React.useState(null);\n\n React.useEffect(() => {\n onError(error !== null);\n }, [error]);\n\n function handleChange(newValue: boolean): void {\n const isValid = option.isValid?.call(definedSettings, newValue) ?? true;\n if (typeof isValid === \"string\") setError(isValid);\n else if (!isValid) setError(\"Invalid input provided.\");\n else {\n setError(null);\n setState(newValue);\n onChange(newValue);\n }\n }\n\n return (\n \n \n {wordsToTitle(wordsFromCamel(id))}\n \n {error && {error}}\n \n );\n}\n\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { PluginOptionComponent } from \"@utils/types\";\n\nimport { ISettingElementProps } from \".\";\n\nexport function SettingCustomComponent({ option, onChange, onError }: ISettingElementProps) {\n return option.component({ setValue: onChange, setError: onError, option });\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { OptionType, PluginOptionNumber } from \"@utils/types\";\nimport { Forms, React, TextInput } from \"@webpack/common\";\n\nimport { ISettingElementProps } from \".\";\n\nconst MAX_SAFE_NUMBER = BigInt(Number.MAX_SAFE_INTEGER);\n\nexport function SettingNumericComponent({ option, pluginSettings, definedSettings, id, onChange, onError }: ISettingElementProps) {\n function serialize(value: any) {\n if (option.type === OptionType.BIGINT) return BigInt(value);\n return Number(value);\n }\n\n const [state, setState] = React.useState(`${pluginSettings[id] ?? option.default ?? 0}`);\n const [error, setError] = React.useState(null);\n\n React.useEffect(() => {\n onError(error !== null);\n }, [error]);\n\n function handleChange(newValue) {\n const isValid = option.isValid?.call(definedSettings, newValue) ?? true;\n\n setError(null);\n if (typeof isValid === \"string\") setError(isValid);\n else if (!isValid) setError(\"Invalid input provided.\");\n\n if (option.type === OptionType.NUMBER && BigInt(newValue) >= MAX_SAFE_NUMBER) {\n setState(`${Number.MAX_SAFE_INTEGER}`);\n onChange(serialize(newValue));\n } else {\n setState(newValue);\n onChange(serialize(newValue));\n }\n }\n\n return (\n \n {option.description}\n \n {error && {error}}\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { PluginOptionSelect } from \"@utils/types\";\nimport { Forms, React, Select } from \"@webpack/common\";\n\nimport { ISettingElementProps } from \".\";\n\nexport function SettingSelectComponent({ option, pluginSettings, definedSettings, onChange, onError, id }: ISettingElementProps) {\n const def = pluginSettings[id] ?? option.options?.find(o => o.default)?.value;\n\n const [state, setState] = React.useState(def ?? null);\n const [error, setError] = React.useState(null);\n\n React.useEffect(() => {\n onError(error !== null);\n }, [error]);\n\n function handleChange(newValue) {\n const isValid = option.isValid?.call(definedSettings, newValue) ?? true;\n if (typeof isValid === \"string\") setError(isValid);\n else if (!isValid) setError(\"Invalid input provided.\");\n else {\n setError(null);\n setState(newValue);\n onChange(newValue);\n }\n }\n\n return (\n \n {option.description}\n v === state}\n serialize={v => String(v)}\n {...option.componentProps}\n />\n {error && {error}}\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { PluginOptionSlider } from \"@utils/types\";\nimport { Forms, React, Slider } from \"@webpack/common\";\n\nimport { ISettingElementProps } from \".\";\n\nexport function makeRange(start: number, end: number, step = 1) {\n const ranges: number[] = [];\n for (let value = start; value <= end; value += step) {\n ranges.push(Math.round(value * 100) / 100);\n }\n return ranges;\n}\n\nexport function SettingSliderComponent({ option, pluginSettings, definedSettings, id, onChange, onError }: ISettingElementProps) {\n const def = pluginSettings[id] ?? option.default;\n\n const [error, setError] = React.useState(null);\n\n React.useEffect(() => {\n onError(error !== null);\n }, [error]);\n\n function handleChange(newValue: number): void {\n const isValid = option.isValid?.call(definedSettings, newValue) ?? true;\n if (typeof isValid === \"string\") setError(isValid);\n else if (!isValid) setError(\"Invalid input provided.\");\n else {\n setError(null);\n onChange(newValue);\n }\n }\n\n return (\n \n {option.description}\n String(v.toFixed(2))}\n stickToMarkers={option.stickToMarkers ?? true}\n {...option.componentProps}\n />\n \n );\n}\n\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { PluginOptionString } from \"@utils/types\";\nimport { Forms, React, TextInput } from \"@webpack/common\";\n\nimport { ISettingElementProps } from \".\";\n\nexport function SettingTextComponent({ option, pluginSettings, definedSettings, id, onChange, onError }: ISettingElementProps) {\n const [state, setState] = React.useState(pluginSettings[id] ?? option.default ?? null);\n const [error, setError] = React.useState(null);\n\n React.useEffect(() => {\n onError(error !== null);\n }, [error]);\n\n function handleChange(newValue) {\n const isValid = option.isValid?.call(definedSettings, newValue) ?? true;\n if (typeof isValid === \"string\") setError(isValid);\n else if (!isValid) setError(\"Invalid input provided.\");\n else setError(null);\n\n setState(newValue);\n onChange(newValue);\n }\n\n return (\n \n {option.description}\n \n {error && {error}}\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { DefinedSettings, PluginOptionBase } from \"@utils/types\";\n\nexport interface ISettingElementProps {\n option: T;\n onChange(newValue: any): void;\n pluginSettings: {\n [setting: string]: any;\n enabled: boolean;\n };\n id: string;\n onError(hasError: boolean): void;\n definedSettings?: DefinedSettings;\n}\n\nexport * from \"../../Badge\";\nexport * from \"./SettingBooleanComponent\";\nexport * from \"./SettingCustomComponent\";\nexport * from \"./SettingNumericComponent\";\nexport * from \"./SettingSelectComponent\";\nexport * from \"./SettingSliderComponent\";\nexport * from \"./SettingTextComponent\";\n\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { MessageObject } from \"@api/MessageEvents\";\nimport { ChannelStore, ComponentDispatch, FluxDispatcher, GuildStore, InviteActions, MaskedLink, MessageActions, ModalImageClasses, PrivateChannelsStore, RestAPI, SelectedChannelStore, SelectedGuildStore, UserProfileActions, UserProfileStore, UserSettingsActionCreators, UserUtils } from \"@webpack/common\";\nimport { Guild, Message, User } from \"discord-types/general\";\n\nimport { ImageModal, ModalRoot, ModalSize, openModal } from \"./modal\";\n\n/**\n * Open the invite modal\n * @param code The invite code\n * @returns Whether the invite was accepted\n */\nexport async function openInviteModal(code: string) {\n const { invite } = await InviteActions.resolveInvite(code, \"Desktop Modal\");\n if (!invite) throw new Error(\"Invalid invite: \" + code);\n\n FluxDispatcher.dispatch({\n type: \"INVITE_MODAL_OPEN\",\n invite,\n code,\n context: \"APP\"\n });\n\n return new Promise(r => {\n let onClose: () => void, onAccept: () => void;\n let inviteAccepted = false;\n\n FluxDispatcher.subscribe(\"INVITE_ACCEPT\", onAccept = () => {\n inviteAccepted = true;\n });\n\n FluxDispatcher.subscribe(\"INVITE_MODAL_CLOSE\", onClose = () => {\n FluxDispatcher.unsubscribe(\"INVITE_MODAL_CLOSE\", onClose);\n FluxDispatcher.unsubscribe(\"INVITE_ACCEPT\", onAccept);\n r(inviteAccepted);\n });\n });\n}\n\nexport function getCurrentChannel() {\n return ChannelStore.getChannel(SelectedChannelStore.getChannelId());\n}\n\nexport function getCurrentGuild(): Guild | undefined {\n return GuildStore.getGuild(getCurrentChannel()?.guild_id);\n}\n\nexport function openPrivateChannel(userId: string) {\n PrivateChannelsStore.openPrivateChannel(userId);\n}\n\nexport const enum Theme {\n Dark = 1,\n Light = 2\n}\n\nexport function getTheme(): Theme {\n return UserSettingsActionCreators.PreloadedUserSettingsActionCreators.getCurrentValue()?.appearance?.theme;\n}\n\nexport function insertTextIntoChatInputBox(text: string) {\n ComponentDispatch.dispatchToLastSubscribed(\"INSERT_TEXT\", {\n rawText: text,\n plainText: text\n });\n}\n\ninterface MessageExtra {\n messageReference: Message[\"messageReference\"];\n allowedMentions: {\n parse: string[];\n replied_user: boolean;\n };\n stickerIds: string[];\n}\n\nexport function sendMessage(\n channelId: string,\n data: Partial,\n waitForChannelReady?: boolean,\n extra?: Partial\n) {\n const messageData = {\n content: \"\",\n invalidEmojis: [],\n tts: false,\n validNonShortcutEmojis: [],\n ...data\n };\n\n return MessageActions.sendMessage(channelId, messageData, waitForChannelReady, extra);\n}\n\nexport function openImageModal(url: string, props?: Partial>): string {\n return openModal(modalProps => (\n \n }\n shouldHideMediaOptions={false}\n shouldAnimate\n {...props}\n />\n \n ));\n}\n\nexport async function openUserProfile(id: string) {\n const user = await UserUtils.getUser(id);\n if (!user) throw new Error(\"No such user: \" + id);\n\n const guildId = SelectedGuildStore.getGuildId();\n UserProfileActions.openUserProfileModal({\n userId: id,\n guildId,\n channelId: SelectedChannelStore.getChannelId(),\n analyticsLocation: {\n page: guildId ? \"Guild Channel\" : \"DM Channel\",\n section: \"Profile Popout\"\n }\n });\n}\n\ninterface FetchUserProfileOptions {\n friend_token?: string;\n connections_role_id?: string;\n guild_id?: string;\n with_mutual_guilds?: boolean;\n with_mutual_friends_count?: boolean;\n}\n\n/**\n * Fetch a user's profile\n */\nexport async function fetchUserProfile(id: string, options?: FetchUserProfileOptions) {\n const cached = UserProfileStore.getUserProfile(id);\n if (cached) return cached;\n\n FluxDispatcher.dispatch({ type: \"USER_PROFILE_FETCH_START\", userId: id });\n\n const { body } = await RestAPI.get({\n url: `/users/${id}/profile`,\n query: {\n with_mutual_guilds: false,\n with_mutual_friends_count: false,\n ...options\n },\n oldFormErrors: true,\n });\n\n FluxDispatcher.dispatch({ type: \"USER_UPDATE\", user: body.user });\n await FluxDispatcher.dispatch({ type: \"USER_PROFILE_FETCH_SUCCESS\", ...body });\n if (options?.guild_id && body.guild_member)\n FluxDispatcher.dispatch({ type: \"GUILD_MEMBER_PROFILE_UPDATE\", guildId: options.guild_id, guildMember: body.guild_member });\n\n return UserProfileStore.getUserProfile(id);\n}\n\n/**\n * Get the unique username for a user. Returns user.username for pomelo people, user.tag otherwise\n */\nexport function getUniqueUsername(user: User) {\n return user.discriminator === \"0\" ? user.username : user.tag;\n}\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2023 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport \"./contributorModal.css\";\n\nimport { useSettings } from \"@api/Settings\";\nimport { classNameFactory } from \"@api/Styles\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { DevsById } from \"@utils/constants\";\nimport { fetchUserProfile, getTheme, Theme } from \"@utils/discord\";\nimport { ModalContent, ModalRoot, openModal } from \"@utils/modal\";\nimport { Forms, MaskedLink, showToast, useEffect, useMemo, UserProfileStore, useStateFromStores } from \"@webpack/common\";\nimport { User } from \"discord-types/general\";\n\nimport Plugins from \"~plugins\";\n\nimport { PluginCard } from \".\";\n\nconst WebsiteIconDark = \"/assets/e1e96d89e192de1997f73730db26e94f.svg\";\nconst WebsiteIconLight = \"/assets/730f58bcfd5a57a5e22460c445a0c6cf.svg\";\nconst GithubIconLight = \"/assets/3ff98ad75ac94fa883af5ed62d17c459.svg\";\nconst GithubIconDark = \"/assets/6a853b4c87fce386cbfef4a2efbacb09.svg\";\n\nconst cl = classNameFactory(\"vc-author-modal-\");\n\nexport function openContributorModal(user: User) {\n openModal(modalProps =>\n \n \n \n \n \n \n \n );\n}\n\nfunction GithubIcon() {\n const src = getTheme() === Theme.Light ? GithubIconLight : GithubIconDark;\n return \"GitHub\";\n}\n\nfunction WebsiteIcon() {\n const src = getTheme() === Theme.Light ? WebsiteIconLight : WebsiteIconDark;\n return \"Website\";\n}\n\nfunction ContributorModal({ user }: { user: User; }) {\n useSettings();\n\n const profile = useStateFromStores([UserProfileStore], () => UserProfileStore.getUserProfile(user.id));\n\n useEffect(() => {\n if (!profile && !user.bot && user.id)\n fetchUserProfile(user.id);\n }, [user.id]);\n\n const githubName = profile?.connectedAccounts?.find(a => a.type === \"github\")?.name;\n const website = profile?.connectedAccounts?.find(a => a.type === \"domain\")?.name;\n\n const plugins = useMemo(() => {\n const allPlugins = Object.values(Plugins);\n const pluginsByAuthor = DevsById[user.id]\n ? allPlugins.filter(p => p.authors.includes(DevsById[user.id]))\n : allPlugins.filter(p => p.authors.some(a => a.name === user.username));\n\n return pluginsByAuthor\n .filter(p => !p.name.endsWith(\"API\"))\n .sort((a, b) => Number(a.required ?? false) - Number(b.required ?? false));\n }, [user.id, user.username]);\n\n return (\n <>\n
\n \n {user.username}\n\n
\n {website && (\n \n \n \n )}\n {githubName && (\n \n \n \n )}\n
\n
\n\n
\n {plugins.map(p =>\n showToast(\"Restart to apply changes!\")}\n />\n )}\n
\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { generateId } from \"@api/Commands\";\nimport { useSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Flex } from \"@components/Flex\";\nimport { proxyLazy } from \"@utils/lazy\";\nimport { Margins } from \"@utils/margins\";\nimport { classes, isObjectEmpty } from \"@utils/misc\";\nimport { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize } from \"@utils/modal\";\nimport { OptionType, Plugin } from \"@utils/types\";\nimport { findByPropsLazy, findComponentByCodeLazy } from \"@webpack\";\nimport { Button, Clickable, FluxDispatcher, Forms, React, Text, Tooltip, UserStore, UserUtils } from \"@webpack/common\";\nimport { User } from \"discord-types/general\";\nimport { Constructor } from \"type-fest\";\n\nimport {\n ISettingElementProps,\n SettingBooleanComponent,\n SettingCustomComponent,\n SettingNumericComponent,\n SettingSelectComponent,\n SettingSliderComponent,\n SettingTextComponent\n} from \"./components\";\nimport { openContributorModal } from \"./ContributorModal\";\n\nconst UserSummaryItem = findComponentByCodeLazy(\"defaultRenderUser\", \"showDefaultAvatarsForNullUsers\");\nconst AvatarStyles = findByPropsLazy(\"moreUsers\", \"emptyUser\", \"avatarContainer\", \"clickableAvatar\");\nconst UserRecord: Constructor> = proxyLazy(() => UserStore.getCurrentUser().constructor) as any;\n\ninterface PluginModalProps extends ModalProps {\n plugin: Plugin;\n onRestartNeeded(): void;\n}\n\nfunction makeDummyUser(user: { username: string; id?: string; avatar?: string; }) {\n const newUser = new UserRecord({\n username: user.username,\n id: user.id ?? generateId(),\n avatar: user.avatar,\n /** To stop discord making unwanted requests... */\n bot: true,\n });\n FluxDispatcher.dispatch({\n type: \"USER_UPDATE\",\n user: newUser,\n });\n return newUser;\n}\n\nconst Components: Record>> = {\n [OptionType.STRING]: SettingTextComponent,\n [OptionType.NUMBER]: SettingNumericComponent,\n [OptionType.BIGINT]: SettingNumericComponent,\n [OptionType.BOOLEAN]: SettingBooleanComponent,\n [OptionType.SELECT]: SettingSelectComponent,\n [OptionType.SLIDER]: SettingSliderComponent,\n [OptionType.COMPONENT]: SettingCustomComponent\n};\n\nexport default function PluginModal({ plugin, onRestartNeeded, onClose, transitionState }: PluginModalProps) {\n const [authors, setAuthors] = React.useState[]>([]);\n\n const pluginSettings = useSettings().plugins[plugin.name];\n\n const [tempSettings, setTempSettings] = React.useState>({});\n\n const [errors, setErrors] = React.useState>({});\n const [saveError, setSaveError] = React.useState(null);\n\n const canSubmit = () => Object.values(errors).every(e => !e);\n\n const hasSettings = Boolean(pluginSettings && plugin.options && !isObjectEmpty(plugin.options));\n\n React.useEffect(() => {\n (async () => {\n for (const user of plugin.authors.slice(0, 6)) {\n const author = user.id\n ? await UserUtils.getUser(`${user.id}`)\n .catch(() => makeDummyUser({ username: user.name }))\n : makeDummyUser({ username: user.name });\n\n setAuthors(a => [...a, author]);\n }\n })();\n }, []);\n\n async function saveAndClose() {\n if (!plugin.options) {\n onClose();\n return;\n }\n\n if (plugin.beforeSave) {\n const result = await Promise.resolve(plugin.beforeSave(tempSettings));\n if (result !== true) {\n setSaveError(result);\n return;\n }\n }\n\n let restartNeeded = false;\n for (const [key, value] of Object.entries(tempSettings)) {\n const option = plugin.options[key];\n pluginSettings[key] = value;\n option?.onChange?.(value);\n if (option?.restartNeeded) restartNeeded = true;\n }\n if (restartNeeded) onRestartNeeded();\n onClose();\n }\n\n function renderSettings() {\n if (!hasSettings || !plugin.options) {\n return There are no settings for this plugin.;\n } else {\n const options = Object.entries(plugin.options).map(([key, setting]) => {\n if (setting.hidden) return null;\n\n function onChange(newValue: any) {\n setTempSettings(s => ({ ...s, [key]: newValue }));\n }\n\n function onError(hasError: boolean) {\n setErrors(e => ({ ...e, [key]: hasError }));\n }\n\n const Component = Components[setting.type];\n return (\n \n );\n });\n\n return {options};\n }\n }\n\n function renderMoreUsers(_label: string, count: number) {\n const sliceCount = plugin.authors.length - count;\n const sliceStart = plugin.authors.length - sliceCount;\n const sliceEnd = sliceStart + plugin.authors.length - count;\n\n return (\n u.name).join(\", \")}>\n {({ onMouseEnter, onMouseLeave }) => (\n \n +{sliceCount}\n
\n )}\n \n );\n }\n\n return (\n \n \n {plugin.name}\n \n \n \n \n About {plugin.name}\n {plugin.description}\n Authors\n
\n (\n openContributorModal(user)}\n >\n \n \n )}\n />\n
\n
\n {!!plugin.settingsAboutComponent && (\n
\n \n \n \n \n \n
\n )}\n \n Settings\n {renderSettings()}\n \n
\n {hasSettings && \n \n \n \n Cancel\n \n \n {({ onMouseEnter, onMouseLeave }) => (\n \n Save & Close\n \n )}\n \n \n {saveError && Error while saving: {saveError}}\n \n }\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./Switch.css\";\n\nimport { classes } from \"@utils/misc\";\nimport { findByPropsLazy } from \"@webpack\";\n\ninterface SwitchProps {\n checked: boolean;\n onChange: (checked: boolean) => void;\n disabled?: boolean;\n}\n\nconst SWITCH_ON = \"var(--green-360)\";\nconst SWITCH_OFF = \"var(--primary-400)\";\nconst SwitchClasses = findByPropsLazy(\"slider\", \"input\", \"container\");\n\nexport function Switch({ checked, onChange, disabled }: SwitchProps) {\n return (\n
\n
\n \n \n \n {checked ? (\n <>\n \n \n \n ) : (\n <>\n \n \n \n )}\n\n \n \n onChange(e.currentTarget.checked)}\n />\n
\n
\n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./addonCard.css\";\n\nimport { classNameFactory } from \"@api/Styles\";\nimport { Badge } from \"@components/Badge\";\nimport { Switch } from \"@components/Switch\";\nimport { Text } from \"@webpack/common\";\nimport type { MouseEventHandler, ReactNode } from \"react\";\n\nconst cl = classNameFactory(\"vc-addon-\");\n\ninterface Props {\n name: ReactNode;\n description: ReactNode;\n enabled: boolean;\n setEnabled: (enabled: boolean) => void;\n disabled?: boolean;\n isNew?: boolean;\n onMouseEnter?: MouseEventHandler;\n onMouseLeave?: MouseEventHandler;\n\n infoButton?: ReactNode;\n footer?: ReactNode;\n author?: ReactNode;\n}\n\nexport function AddonCard({ disabled, isNew, name, infoButton, footer, author, enabled, setEnabled, description, onMouseEnter, onMouseLeave }: Props) {\n return (\n \n
\n
\n \n {name}{isNew && }\n \n {!!author && (\n \n {author}\n \n )}\n
\n\n {infoButton}\n\n \n
\n\n {description}\n\n {footer}\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nexport class ChangeList{\n private set = new Set();\n\n public get changeCount() {\n return this.set.size;\n }\n\n public get hasChanges() {\n return this.changeCount > 0;\n }\n\n public handleChange(item: T) {\n if (!this.set.delete(item))\n this.set.add(item);\n }\n\n public add(item: T) {\n return this.set.add(item);\n }\n\n public remove(item: T) {\n return this.set.delete(item);\n }\n\n public getChanges() {\n return this.set.values();\n }\n\n public map(mapper: (v: T, idx: number, arr: T[]) => R): R[] {\n return [...this.getChanges()].map(mapper);\n }\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Logger } from \"@utils/Logger\";\nimport { Menu, React } from \"@webpack/common\";\nimport type { ReactElement } from \"react\";\n\n/**\n * @param children The rendered context menu elements\n * @param args Any arguments passed into making the context menu, like the guild, channel, user or message for example\n */\nexport type NavContextMenuPatchCallback = (children: Array, ...args: Array) => void;\n/**\n * @param navId The navId of the context menu being patched\n * @param children The rendered context menu elements\n * @param args Any arguments passed into making the context menu, like the guild, channel, user or message for example\n */\nexport type GlobalContextMenuPatchCallback = (navId: string, children: Array, ...args: Array) => void;\n\nconst ContextMenuLogger = new Logger(\"ContextMenu\");\n\nexport const navPatches = new Map>();\nexport const globalPatches = new Set();\n\n/**\n * Add a context menu patch\n * @param navId The navId(s) for the context menu(s) to patch\n * @param patch The patch to be applied\n */\nexport function addContextMenuPatch(navId: string | Array, patch: NavContextMenuPatchCallback) {\n if (!Array.isArray(navId)) navId = [navId];\n for (const id of navId) {\n let contextMenuPatches = navPatches.get(id);\n if (!contextMenuPatches) {\n contextMenuPatches = new Set();\n navPatches.set(id, contextMenuPatches);\n }\n\n contextMenuPatches.add(patch);\n }\n}\n\n/**\n * Add a global context menu patch that fires the patch for all context menus\n * @param patch The patch to be applied\n */\nexport function addGlobalContextMenuPatch(patch: GlobalContextMenuPatchCallback) {\n globalPatches.add(patch);\n}\n\n/**\n * Remove a context menu patch\n * @param navId The navId(s) for the context menu(s) to remove the patch\n * @param patch The patch to be removed\n * @returns Whether the patch was successfully removed from the context menu(s)\n */\nexport function removeContextMenuPatch>(navId: T, patch: NavContextMenuPatchCallback): T extends string ? boolean : Array {\n const navIds = Array.isArray(navId) ? navId : [navId as string];\n\n const results = navIds.map(id => navPatches.get(id)?.delete(patch) ?? false);\n\n return (Array.isArray(navId) ? results : results[0]) as T extends string ? boolean : Array;\n}\n\n/**\n * Remove a global context menu patch\n * @param patch The patch to be removed\n * @returns Whether the patch was successfully removed\n */\nexport function removeGlobalContextMenuPatch(patch: GlobalContextMenuPatchCallback): boolean {\n return globalPatches.delete(patch);\n}\n\n/**\n * A helper function for finding the children array of a group nested inside a context menu based on the id(s) of its children\n * @param id The id of the child. If an array is specified, all ids will be tried\n * @param children The context menu children\n */\nexport function findGroupChildrenByChildId(id: string | string[], children: Array): Array | null {\n for (const child of children) {\n if (child == null) continue;\n\n if (Array.isArray(child)) {\n const found = findGroupChildrenByChildId(id, child);\n if (found !== null) return found;\n }\n\n if (\n (Array.isArray(id) && id.some(id => child.props?.id === id))\n || child.props?.id === id\n ) return children;\n\n let nextChildren = child.props?.children;\n if (nextChildren) {\n if (!Array.isArray(nextChildren)) {\n nextChildren = [nextChildren];\n child.props.children = nextChildren;\n }\n\n const found = findGroupChildrenByChildId(id, nextChildren);\n if (found !== null) return found;\n }\n }\n\n return null;\n}\n\ninterface ContextMenuProps {\n contextMenuApiArguments?: Array;\n navId: string;\n children: Array;\n \"aria-label\": string;\n onSelect: (() => void) | undefined;\n onClose: (callback: (...args: Array) => any) => void;\n}\n\nexport function _usePatchContextMenu(props: ContextMenuProps) {\n props = {\n ...props,\n children: cloneMenuChildren(props.children),\n };\n\n props.contextMenuApiArguments ??= [];\n const contextMenuPatches = navPatches.get(props.navId);\n\n if (!Array.isArray(props.children)) props.children = [props.children];\n\n if (contextMenuPatches) {\n for (const patch of contextMenuPatches) {\n try {\n patch(props.children, ...props.contextMenuApiArguments);\n } catch (err) {\n ContextMenuLogger.error(`Patch for ${props.navId} errored,`, err);\n }\n }\n }\n\n for (const patch of globalPatches) {\n try {\n patch(props.navId, props.children, ...props.contextMenuApiArguments);\n } catch (err) {\n ContextMenuLogger.error(\"Global patch errored,\", err);\n }\n }\n\n return props;\n}\n\nfunction cloneMenuChildren(obj: ReactElement | Array | null) {\n if (Array.isArray(obj)) {\n return obj.map(cloneMenuChildren);\n }\n\n if (React.isValidElement(obj)) {\n obj = React.cloneElement(obj);\n\n if (\n obj?.props?.children &&\n (obj.type !== Menu.MenuControlItem || obj.type === Menu.MenuControlItem && obj.props.control != null)\n ) {\n obj.props.children = cloneMenuChildren(obj.props.children);\n }\n }\n\n return obj;\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { registerCommand, unregisterCommand } from \"@api/Commands\";\nimport { addContextMenuPatch, removeContextMenuPatch } from \"@api/ContextMenu\";\nimport { Settings } from \"@api/Settings\";\nimport { Logger } from \"@utils/Logger\";\nimport { Patch, Plugin, StartAt } from \"@utils/types\";\nimport { FluxDispatcher } from \"@webpack/common\";\nimport { FluxEvents } from \"@webpack/types\";\n\nimport Plugins from \"~plugins\";\n\nimport { traceFunction } from \"../debug/Tracer\";\n\nconst logger = new Logger(\"PluginManager\", \"#a6d189\");\n\nexport const PMLogger = logger;\nexport const plugins = Plugins;\nexport const patches = [] as Patch[];\n\nconst settings = Settings.plugins;\n\nexport function isPluginEnabled(p: string) {\n return (\n Plugins[p]?.required ||\n Plugins[p]?.isDependency ||\n settings[p]?.enabled\n ) ?? false;\n}\n\nconst pluginsValues = Object.values(Plugins);\n\n// First roundtrip to mark and force enable dependencies (only for enabled plugins)\n//\n// FIXME: might need to revisit this if there's ever nested (dependencies of dependencies) dependencies since this only\n// goes for the top level and their children, but for now this works okay with the current API plugins\nfor (const p of pluginsValues) if (settings[p.name]?.enabled) {\n p.dependencies?.forEach(d => {\n const dep = Plugins[d];\n if (dep) {\n settings[d].enabled = true;\n dep.isDependency = true;\n }\n else {\n const error = new Error(`Plugin ${p.name} has unresolved dependency ${d}`);\n if (IS_DEV)\n throw error;\n logger.warn(error);\n }\n });\n}\n\nfor (const p of pluginsValues) {\n if (p.settings) {\n p.settings.pluginName = p.name;\n p.options ??= {};\n for (const [name, def] of Object.entries(p.settings.def)) {\n const checks = p.settings.checks?.[name];\n p.options[name] = { ...def, ...checks };\n }\n }\n\n if (p.patches && isPluginEnabled(p.name)) {\n for (const patch of p.patches) {\n patch.plugin = p.name;\n if (!Array.isArray(patch.replacement))\n patch.replacement = [patch.replacement];\n patches.push(patch);\n }\n }\n}\n\nexport const startAllPlugins = traceFunction(\"startAllPlugins\", function startAllPlugins(target: StartAt) {\n logger.info(`Starting plugins (stage ${target})`);\n for (const name in Plugins)\n if (isPluginEnabled(name)) {\n const p = Plugins[name];\n\n const startAt = p.startAt ?? StartAt.WebpackReady;\n if (startAt !== target) continue;\n\n startPlugin(Plugins[name]);\n }\n});\n\nexport function startDependenciesRecursive(p: Plugin) {\n let restartNeeded = false;\n const failures: string[] = [];\n p.dependencies?.forEach(dep => {\n if (!Settings.plugins[dep].enabled) {\n startDependenciesRecursive(Plugins[dep]);\n // If the plugin has patches, don't start the plugin, just enable it.\n Settings.plugins[dep].enabled = true;\n if (Plugins[dep].patches) {\n logger.warn(`Enabling dependency ${dep} requires restart.`);\n restartNeeded = true;\n return;\n }\n const result = startPlugin(Plugins[dep]);\n if (!result) failures.push(dep);\n }\n });\n return { restartNeeded, failures };\n}\n\nexport const startPlugin = traceFunction(\"startPlugin\", function startPlugin(p: Plugin) {\n const { name, commands, flux, contextMenus } = p;\n\n if (p.start) {\n logger.info(\"Starting plugin\", name);\n if (p.started) {\n logger.warn(`${name} already started`);\n return false;\n }\n try {\n p.start();\n p.started = true;\n } catch (e) {\n logger.error(`Failed to start ${name}\\n`, e);\n return false;\n }\n }\n\n if (commands?.length) {\n logger.info(\"Registering commands of plugin\", name);\n for (const cmd of commands) {\n try {\n registerCommand(cmd, name);\n } catch (e) {\n logger.error(`Failed to register command ${cmd.name}\\n`, e);\n return false;\n }\n }\n }\n\n if (flux) {\n for (const event in flux) {\n FluxDispatcher.subscribe(event as FluxEvents, flux[event]);\n }\n }\n\n if (contextMenus) {\n for (const navId in contextMenus) {\n addContextMenuPatch(navId, contextMenus[navId]);\n }\n }\n\n return true;\n}, p => `startPlugin ${p.name}`);\n\nexport const stopPlugin = traceFunction(\"stopPlugin\", function stopPlugin(p: Plugin) {\n const { name, commands, flux, contextMenus } = p;\n if (p.stop) {\n logger.info(\"Stopping plugin\", name);\n if (!p.started) {\n logger.warn(`${name} already stopped`);\n return false;\n }\n try {\n p.stop();\n p.started = false;\n } catch (e) {\n logger.error(`Failed to stop ${name}\\n`, e);\n return false;\n }\n }\n\n if (commands?.length) {\n logger.info(\"Unregistering commands of plugin\", name);\n for (const cmd of commands) {\n try {\n unregisterCommand(cmd.name);\n } catch (e) {\n logger.error(`Failed to unregister command ${cmd.name}\\n`, e);\n return false;\n }\n }\n }\n\n if (flux) {\n for (const event in flux) {\n FluxDispatcher.unsubscribe(event as FluxEvents, flux[event]);\n }\n }\n\n if (contextMenus) {\n for (const navId in contextMenus) {\n removeContextMenuPatch(navId, contextMenus[navId]);\n }\n }\n\n return true;\n}, p => `stopPlugin ${p.name}`);\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport \"./styles.css\";\n\nimport * as DataStore from \"@api/DataStore\";\nimport { showNotice } from \"@api/Notices\";\nimport { Settings, useSettings } from \"@api/Settings\";\nimport { classNameFactory } from \"@api/Styles\";\nimport { CogWheel, InfoIcon } from \"@components/Icons\";\nimport PluginModal from \"@components/PluginSettings/PluginModal\";\nimport { AddonCard } from \"@components/VencordSettings/AddonCard\";\nimport { SettingsTab } from \"@components/VencordSettings/shared\";\nimport { ChangeList } from \"@utils/ChangeList\";\nimport { Logger } from \"@utils/Logger\";\nimport { Margins } from \"@utils/margins\";\nimport { classes, isObjectEmpty } from \"@utils/misc\";\nimport { openModalLazy } from \"@utils/modal\";\nimport { useAwaiter } from \"@utils/react\";\nimport { Plugin } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { Alerts, Button, Card, Forms, lodash, Parser, React, Select, Text, TextInput, Toasts, Tooltip } from \"@webpack/common\";\n\nimport Plugins from \"~plugins\";\n\nimport { startDependenciesRecursive, startPlugin, stopPlugin } from \"../../plugins\";\n\n\nconst cl = classNameFactory(\"vc-plugins-\");\nconst logger = new Logger(\"PluginSettings\", \"#a6d189\");\n\nconst InputStyles = findByPropsLazy(\"inputDefault\", \"inputWrapper\");\nconst ButtonClasses = findByPropsLazy(\"button\", \"disabled\", \"enabled\");\n\n\nfunction showErrorToast(message: string) {\n Toasts.show({\n message,\n type: Toasts.Type.FAILURE,\n id: Toasts.genId(),\n options: {\n position: Toasts.Position.BOTTOM\n }\n });\n}\n\nfunction ReloadRequiredCard({ required }: { required: boolean; }) {\n return (\n \n {required ? (\n <>\n Restart required!\n \n Restart now to apply new plugins and their settings\n \n \n \n ) : (\n <>\n Plugin Management\n Press the cog wheel or info icon to get more info on a plugin\n Plugins with a cog wheel have settings you can modify!\n \n )}\n \n );\n}\n\ninterface PluginCardProps extends React.HTMLProps {\n plugin: Plugin;\n disabled: boolean;\n onRestartNeeded(name: string): void;\n isNew?: boolean;\n}\n\nexport function PluginCard({ plugin, disabled, onRestartNeeded, onMouseEnter, onMouseLeave, isNew }: PluginCardProps) {\n const settings = Settings.plugins[plugin.name];\n\n const isEnabled = () => settings.enabled ?? false;\n\n function openModal() {\n openModalLazy(async () => {\n return modalProps => {\n return onRestartNeeded(plugin.name)} />;\n };\n });\n }\n\n function toggleEnabled() {\n const wasEnabled = isEnabled();\n\n // If we're enabling a plugin, make sure all deps are enabled recursively.\n if (!wasEnabled) {\n const { restartNeeded, failures } = startDependenciesRecursive(plugin);\n if (failures.length) {\n logger.error(`Failed to start dependencies for ${plugin.name}: ${failures.join(\", \")}`);\n showNotice(\"Failed to start dependencies: \" + failures.join(\", \"), \"Close\", () => null);\n return;\n } else if (restartNeeded) {\n // If any dependencies have patches, don't start the plugin yet.\n settings.enabled = true;\n onRestartNeeded(plugin.name);\n return;\n }\n }\n\n // if the plugin has patches, dont use stopPlugin/startPlugin. Wait for restart to apply changes.\n if (plugin.patches?.length) {\n settings.enabled = !wasEnabled;\n onRestartNeeded(plugin.name);\n return;\n }\n\n // If the plugin is enabled, but hasn't been started, then we can just toggle it off.\n if (wasEnabled && !plugin.started) {\n settings.enabled = !wasEnabled;\n return;\n }\n\n const result = wasEnabled ? stopPlugin(plugin) : startPlugin(plugin);\n\n if (!result) {\n settings.enabled = false;\n\n const msg = `Error while ${wasEnabled ? \"stopping\" : \"starting\"} plugin ${plugin.name}`;\n logger.error(msg);\n showErrorToast(msg);\n return;\n }\n\n settings.enabled = !wasEnabled;\n }\n\n return (\n openModal()} className={classes(ButtonClasses.button, cl(\"info-button\"))}>\n {plugin.options && !isObjectEmpty(plugin.options)\n ? \n : }\n \n }\n />\n );\n}\n\nconst enum SearchStatus {\n ALL,\n ENABLED,\n DISABLED,\n NEW\n}\n\nexport default function PluginSettings() {\n const settings = useSettings();\n const changes = React.useMemo(() => new ChangeList(), []);\n\n React.useEffect(() => {\n return () => void (changes.hasChanges && Alerts.show({\n title: \"Restart required\",\n body: (\n <>\n

The following plugins require a restart:

\n
{changes.map((s, i) => (\n <>\n {i > 0 && \", \"}\n {Parser.parse(\"`\" + s + \"`\")}\n \n ))}
\n \n ),\n confirmText: \"Restart now\",\n cancelText: \"Later!\",\n onConfirm: () => location.reload()\n }));\n }, []);\n\n const depMap = React.useMemo(() => {\n const o = {} as Record;\n for (const plugin in Plugins) {\n const deps = Plugins[plugin].dependencies;\n if (deps) {\n for (const dep of deps) {\n o[dep] ??= [];\n o[dep].push(plugin);\n }\n }\n }\n return o;\n }, []);\n\n const sortedPlugins = React.useMemo(() => Object.values(Plugins)\n .sort((a, b) => a.name.localeCompare(b.name)), []);\n\n const [searchValue, setSearchValue] = React.useState({ value: \"\", status: SearchStatus.ALL });\n\n const onSearch = (query: string) => setSearchValue(prev => ({ ...prev, value: query }));\n const onStatusChange = (status: SearchStatus) => setSearchValue(prev => ({ ...prev, status }));\n\n const pluginFilter = (plugin: typeof Plugins[keyof typeof Plugins]) => {\n const enabled = settings.plugins[plugin.name]?.enabled;\n if (enabled && searchValue.status === SearchStatus.DISABLED) return false;\n if (!enabled && searchValue.status === SearchStatus.ENABLED) return false;\n if (searchValue.status === SearchStatus.NEW && !newPlugins?.includes(plugin.name)) return false;\n if (!searchValue.value.length) return true;\n\n const v = searchValue.value.toLowerCase();\n return (\n plugin.name.toLowerCase().includes(v) ||\n plugin.description.toLowerCase().includes(v) ||\n plugin.tags?.some(t => t.toLowerCase().includes(v))\n );\n };\n\n const [newPlugins] = useAwaiter(() => DataStore.get(\"Vencord_existingPlugins\").then((cachedPlugins: Record | undefined) => {\n const now = Date.now() / 1000;\n const existingTimestamps: Record = {};\n const sortedPluginNames = Object.values(sortedPlugins).map(plugin => plugin.name);\n\n const newPlugins: string[] = [];\n for (const { name: p } of sortedPlugins) {\n const time = existingTimestamps[p] = cachedPlugins?.[p] ?? now;\n if ((time + 60 * 60 * 24 * 2) > now) {\n newPlugins.push(p);\n }\n }\n DataStore.set(\"Vencord_existingPlugins\", existingTimestamps);\n\n return lodash.isEqual(newPlugins, sortedPluginNames) ? [] : newPlugins;\n }));\n\n type P = JSX.Element | JSX.Element[];\n let plugins: P, requiredPlugins: P;\n if (sortedPlugins?.length) {\n plugins = [];\n requiredPlugins = [];\n\n for (const p of sortedPlugins) {\n if (!p.options && p.name.endsWith(\"API\") && searchValue.value !== \"API\")\n continue;\n\n if (!pluginFilter(p)) continue;\n\n const isRequired = p.required || depMap[p.name]?.some(d => settings.plugins[d].enabled);\n\n if (isRequired) {\n const tooltipText = p.required\n ? \"This plugin is required for Vencord to function.\"\n : makeDependencyList(depMap[p.name]?.filter(d => settings.plugins[d].enabled));\n\n requiredPlugins.push(\n \n {({ onMouseLeave, onMouseEnter }) => (\n changes.handleChange(name)}\n disabled={true}\n plugin={p}\n />\n )}\n \n );\n } else {\n plugins.push(\n changes.handleChange(name)}\n disabled={false}\n plugin={p}\n isNew={newPlugins?.includes(p.name)}\n key={p.name}\n />\n );\n }\n\n }\n } else {\n plugins = requiredPlugins = No plugins meet search criteria.;\n }\n\n return (\n \n \n\n \n Filters\n \n\n
\n \n
\n v === searchValue.status}\n closeOnSelect={true}\n />\n
\n
\n\n Plugins\n\n
\n {plugins}\n
\n\n \n\n \n Required Plugins\n \n
\n {requiredPlugins}\n
\n
\n );\n}\n\nfunction makeDependencyList(deps: string[]) {\n return (\n \n This plugin is required by:\n {deps.map((dep: string) => {dep})}\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport PluginSettings from \"@components/PluginSettings\";\n\nimport { wrapTab } from \"./shared\";\n\nexport default wrapTab(PluginSettings, \"Plugins\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { React } from \"@webpack/common\";\n\ninterface Props extends React.DetailedHTMLProps, HTMLAnchorElement> {\n disabled?: boolean;\n}\n\nexport function Link(props: React.PropsWithChildren) {\n if (props.disabled) {\n props.style ??= {};\n props.style.pointerEvents = \"none\";\n props[\"aria-disabled\"] = true;\n }\n return (\n \n {props.children}\n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { useSettings } from \"@api/Settings\";\nimport { classNameFactory } from \"@api/Styles\";\nimport { Flex } from \"@components/Flex\";\nimport { DeleteIcon } from \"@components/Icons\";\nimport { Link } from \"@components/Link\";\nimport PluginModal from \"@components/PluginSettings/PluginModal\";\nimport type { UserThemeHeader } from \"@main/themes\";\nimport { openInviteModal } from \"@utils/discord\";\nimport { Margins } from \"@utils/margins\";\nimport { classes } from \"@utils/misc\";\nimport { openModal } from \"@utils/modal\";\nimport { showItemInFolder } from \"@utils/native\";\nimport { useAwaiter } from \"@utils/react\";\nimport { findByPropsLazy, findLazy } from \"@webpack\";\nimport { Button, Card, Forms, React, showToast, TabBar, TextArea, useEffect, useRef, useState } from \"@webpack/common\";\nimport type { ComponentType, Ref, SyntheticEvent } from \"react\";\n\nimport { AddonCard } from \"./AddonCard\";\nimport { SettingsTab, wrapTab } from \"./shared\";\n\ntype FileInput = ComponentType<{\n ref: Ref;\n onChange: (e: SyntheticEvent) => void;\n multiple?: boolean;\n filters?: { name?: string; extensions: string[]; }[];\n}>;\n\nconst InviteActions = findByPropsLazy(\"resolveInvite\");\nconst FileInput: FileInput = findLazy(m => m.prototype?.activateUploadDialogue && m.prototype.setRef);\nconst TextAreaProps = findLazy(m => typeof m.textarea === \"string\");\n\nconst cl = classNameFactory(\"vc-settings-theme-\");\n\nfunction Validator({ link }: { link: string; }) {\n const [res, err, pending] = useAwaiter(() => fetch(link).then(res => {\n if (res.status > 300) throw `${res.status} ${res.statusText}`;\n const contentType = res.headers.get(\"Content-Type\");\n if (!contentType?.startsWith(\"text/css\") && !contentType?.startsWith(\"text/plain\"))\n throw \"Not a CSS file. Remember to use the raw link!\";\n\n return \"Okay!\";\n }));\n\n const text = pending\n ? \"Checking...\"\n : err\n ? `Error: ${err instanceof Error ? err.message : String(err)}`\n : \"Valid!\";\n\n return {text};\n}\n\nfunction Validators({ themeLinks }: { themeLinks: string[]; }) {\n if (!themeLinks.length) return null;\n\n return (\n <>\n Validator\n This section will tell you whether your themes can successfully be loaded\n
\n {themeLinks.map(link => (\n \n \n {link}\n \n \n \n ))}\n
\n \n );\n}\n\ninterface ThemeCardProps {\n theme: UserThemeHeader;\n enabled: boolean;\n onChange: (enabled: boolean) => void;\n onDelete: () => void;\n}\n\nfunction ThemeCard({ theme, enabled, onChange, onDelete }: ThemeCardProps) {\n return (\n \n \n \n )\n }\n footer={\n \n {!!theme.website && Website}\n {!!(theme.website && theme.invite) && \" \u2022 \"}\n {!!theme.invite && (\n {\n e.preventDefault();\n theme.invite != null && openInviteModal(theme.invite).catch(() => showToast(\"Invalid or expired invite\"));\n }}\n >\n Discord Server\n \n )}\n \n }\n />\n );\n}\n\nenum ThemeTab {\n LOCAL,\n ONLINE\n}\n\nfunction ThemesTab() {\n const settings = useSettings([\"themeLinks\", \"enabledThemes\"]);\n\n const fileInputRef = useRef(null);\n const [currentTab, setCurrentTab] = useState(ThemeTab.LOCAL);\n const [themeText, setThemeText] = useState(settings.themeLinks.join(\"\\n\"));\n const [userThemes, setUserThemes] = useState(null);\n const [themeDir, , themeDirPending] = useAwaiter(VencordNative.themes.getThemesDir);\n\n useEffect(() => {\n refreshLocalThemes();\n }, []);\n\n async function refreshLocalThemes() {\n const themes = await VencordNative.themes.getThemesList();\n setUserThemes(themes);\n }\n\n // When a local theme is enabled/disabled, update the settings\n function onLocalThemeChange(fileName: string, value: boolean) {\n if (value) {\n if (settings.enabledThemes.includes(fileName)) return;\n settings.enabledThemes = [...settings.enabledThemes, fileName];\n } else {\n settings.enabledThemes = settings.enabledThemes.filter(f => f !== fileName);\n }\n }\n\n async function onFileUpload(e: SyntheticEvent) {\n e.stopPropagation();\n e.preventDefault();\n if (!e.currentTarget?.files?.length) return;\n const { files } = e.currentTarget;\n\n const uploads = Array.from(files, file => {\n const { name } = file;\n if (!name.endsWith(\".css\")) return;\n\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n VencordNative.themes.uploadTheme(name, reader.result as string)\n .then(resolve)\n .catch(reject);\n };\n reader.readAsText(file);\n });\n });\n\n await Promise.all(uploads);\n refreshLocalThemes();\n }\n\n function renderLocalThemes() {\n return (\n <>\n \n Find Themes:\n
\n \n BetterDiscord Themes\n \n GitHub\n
\n If using the BD site, click on \"Download\" and place the downloaded .theme.css file into your themes folder.\n
\n\n \n \n <>\n {IS_WEB ?\n (\n \n Upload Theme\n \n \n ) : (\n showItemInFolder(themeDir!)}\n size={Button.Sizes.SMALL}\n disabled={themeDirPending}\n >\n Open Themes Folder\n \n )}\n \n Load missing Themes\n \n VencordNative.quickCss.openEditor()}\n size={Button.Sizes.SMALL}\n >\n Edit QuickCSS\n \n\n {Vencord.Settings.plugins.ClientTheme.enabled && (\n openModal(modalProps => (\n { }}\n />\n ))}\n size={Button.Sizes.SMALL}\n >\n Edit ClientTheme\n \n )}\n \n \n\n
\n {userThemes?.map(theme => (\n onLocalThemeChange(theme.fileName, enabled)}\n onDelete={async () => {\n onLocalThemeChange(theme.fileName, false);\n await VencordNative.themes.deleteTheme(theme.fileName);\n refreshLocalThemes();\n }}\n theme={theme}\n />\n ))}\n
\n
\n \n );\n }\n\n // When the user leaves the online theme textbox, update the settings\n function onBlur() {\n settings.themeLinks = [...new Set(\n themeText\n .trim()\n .split(/\\n+/)\n .map(s => s.trim())\n .filter(Boolean)\n )];\n }\n\n function renderOnlineThemes() {\n return (\n <>\n \n Paste links to css files here\n One link per line\n Make sure to use direct links to files (raw or github.io)!\n \n\n \n \n \n \n \n );\n }\n\n return (\n \n \n \n Local Themes\n \n \n Online Themes\n \n \n\n {currentTab === ThemeTab.LOCAL && renderLocalThemes()}\n {currentTab === ThemeTab.ONLINE && renderOnlineThemes()}\n \n );\n}\n\nexport default wrapTab(ThemesTab, \"Themes\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { useSettings } from \"@api/Settings\";\nimport { ErrorCard } from \"@components/ErrorCard\";\nimport { Flex } from \"@components/Flex\";\nimport { Link } from \"@components/Link\";\nimport { Margins } from \"@utils/margins\";\nimport { classes } from \"@utils/misc\";\nimport { relaunch } from \"@utils/native\";\nimport { useAwaiter } from \"@utils/react\";\nimport { changes, checkForUpdates, getRepo, isNewer, update, updateError, UpdateLogger } from \"@utils/updater\";\nimport { Alerts, Button, Card, Forms, Parser, React, Switch, Toasts } from \"@webpack/common\";\n\nimport gitHash from \"~git-hash\";\n\nimport { SettingsTab, wrapTab } from \"./shared\";\n\nfunction withDispatcher(dispatcher: React.Dispatch>, action: () => any) {\n return async () => {\n dispatcher(true);\n try {\n await action();\n } catch (e: any) {\n UpdateLogger.error(\"Failed to update\", e);\n if (!e) {\n var err = \"An unknown error occurred (error is undefined).\\nPlease try again.\";\n } else if (e.code && e.cmd) {\n const { code, path, cmd, stderr } = e;\n\n if (code === \"ENOENT\")\n var err = `Command \\`${path}\\` not found.\\nPlease install it and try again`;\n else {\n var err = `An error occurred while running \\`${cmd}\\`:\\n`;\n err += stderr || `Code \\`${code}\\`. See the console for more info`;\n }\n\n } else {\n var err = \"An unknown error occurred. See the console for more info.\";\n }\n Alerts.show({\n title: \"Oops!\",\n body: (\n \n {err.split(\"\\n\").map(line =>
{Parser.parse(line)}
)}\n
\n )\n });\n }\n finally {\n dispatcher(false);\n }\n };\n}\n\ninterface CommonProps {\n repo: string;\n repoPending: boolean;\n}\n\nfunction HashLink({ repo, hash, disabled = false }: { repo: string, hash: string, disabled?: boolean; }) {\n return \n {hash}\n ;\n}\n\nfunction Changes({ updates, repo, repoPending }: CommonProps & { updates: typeof changes; }) {\n return (\n \n {updates.map(({ hash, author, message }) => (\n
\n \n {message} - {author}\n
\n ))}\n
\n );\n}\n\nfunction Updatable(props: CommonProps) {\n const [updates, setUpdates] = React.useState(changes);\n const [isChecking, setIsChecking] = React.useState(false);\n const [isUpdating, setIsUpdating] = React.useState(false);\n\n const isOutdated = (updates?.length ?? 0) > 0;\n\n return (\n <>\n {!updates && updateError ? (\n <>\n Failed to check updates. Check the console for more info\n \n

{updateError.stderr || updateError.stdout || \"An unknown error occurred\"}

\n
\n \n ) : (\n \n {isOutdated ? (updates.length === 1 ? \"There is 1 Update\" : `There are ${updates.length} Updates`) : \"Up to Date!\"}\n \n )}\n\n {isOutdated && }\n\n \n {isOutdated && {\n if (await update()) {\n setUpdates([]);\n await new Promise(r => {\n Alerts.show({\n title: \"Update Success!\",\n body: \"Successfully updated. Restart now to apply the changes?\",\n confirmText: \"Restart\",\n cancelText: \"Not now!\",\n onConfirm() {\n relaunch();\n r();\n },\n onCancel: r\n });\n });\n }\n })}\n >\n Update Now\n }\n {\n const outdated = await checkForUpdates();\n if (outdated) {\n setUpdates(changes);\n } else {\n setUpdates([]);\n Toasts.show({\n message: \"No updates found!\",\n id: Toasts.genId(),\n type: Toasts.Type.MESSAGE,\n options: {\n position: Toasts.Position.BOTTOM\n }\n });\n }\n })}\n >\n Check for Updates\n \n \n \n );\n}\n\nfunction Newer(props: CommonProps) {\n return (\n <>\n \n Your local copy has more recent commits. Please stash or reset them.\n \n \n \n );\n}\n\nfunction Updater() {\n const settings = useSettings([\"notifyAboutUpdates\", \"autoUpdate\", \"autoUpdateNotification\"]);\n\n const [repo, err, repoPending] = useAwaiter(getRepo, { fallbackValue: \"Loading...\" });\n\n React.useEffect(() => {\n if (err)\n UpdateLogger.error(\"Failed to retrieve repo\", err);\n }, [err]);\n\n const commonProps: CommonProps = {\n repo,\n repoPending\n };\n\n return (\n \n Updater Settings\n settings.notifyAboutUpdates = v}\n note=\"Shows a notification on startup\"\n disabled={settings.autoUpdate}\n >\n Get notified about new updates\n \n settings.autoUpdate = v}\n note=\"Automatically update Vencord without confirmation prompt\"\n >\n Automatically update\n \n settings.autoUpdateNotification = v}\n note=\"Shows a notification when Vencord automatically updates\"\n disabled={!settings.autoUpdate}\n >\n Get notified when an automatic update completes\n \n\n Repo\n\n \n {repoPending\n ? repo\n : err\n ? \"Failed to retrieve - check console\"\n : (\n \n {repo.split(\"/\").slice(-2).join(\"/\")}\n \n )\n }\n {\" \"}()\n \n\n \n\n Updates\n\n {isNewer ? : }\n \n );\n}\n\nexport default IS_UPDATER_DISABLED ? null : wrapTab(Updater, \"Updater\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { React, TextInput } from \"@webpack/common\";\n\n// TODO: Refactor settings to use this as well\ninterface TextInputProps {\n /**\n * WARNING: Changing this between renders will have no effect!\n */\n value: string;\n /**\n * This will only be called if the new value passed validate()\n */\n onChange(newValue: string): void;\n /**\n * Optionally validate the user input\n * Return true if the input is valid\n * Otherwise, return a string containing the reason for this input being invalid\n */\n validate(v: string): true | string;\n}\n\n/**\n * A very simple wrapper around Discord's TextInput that validates input and shows\n * the user an error message and only calls your onChange when the input is valid\n */\nexport function CheckedTextInput({ value: initialValue, onChange, validate }: TextInputProps) {\n const [value, setValue] = React.useState(initialValue);\n const [error, setError] = React.useState();\n\n function handleChange(v: string) {\n setValue(v);\n const res = validate(v);\n if (res === true) {\n setError(void 0);\n onChange(v);\n } else {\n setError(res);\n }\n }\n\n return (\n <>\n \n \n );\n}\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { showNotification } from \"@api/Notifications\";\nimport { Settings, useSettings } from \"@api/Settings\";\nimport { CheckedTextInput } from \"@components/CheckedTextInput\";\nimport { Link } from \"@components/Link\";\nimport { authorizeCloud, cloudLogger, deauthorizeCloud, getCloudAuth, getCloudUrl } from \"@utils/cloud\";\nimport { Margins } from \"@utils/margins\";\nimport { deleteCloudSettings, getCloudSettings, putCloudSettings } from \"@utils/settingsSync\";\nimport { Alerts, Button, Forms, Switch, Tooltip } from \"@webpack/common\";\n\nimport { SettingsTab, wrapTab } from \"./shared\";\n\nfunction validateUrl(url: string) {\n try {\n new URL(url);\n return true;\n } catch {\n return \"Invalid URL\";\n }\n}\n\nasync function eraseAllData() {\n const res = await fetch(new URL(\"/v1/\", getCloudUrl()), {\n method: \"DELETE\",\n headers: { Authorization: await getCloudAuth() }\n });\n\n if (!res.ok) {\n cloudLogger.error(`Failed to erase data, API returned ${res.status}`);\n showNotification({\n title: \"Cloud Integrations\",\n body: `Could not erase all data (API returned ${res.status}), please contact support.`,\n color: \"var(--red-360)\"\n });\n return;\n }\n\n Settings.cloud.authenticated = false;\n await deauthorizeCloud();\n\n showNotification({\n title: \"Cloud Integrations\",\n body: \"Successfully erased all data.\",\n color: \"var(--green-360)\"\n });\n}\n\nfunction SettingsSyncSection() {\n const { cloud } = useSettings([\"cloud.authenticated\", \"cloud.settingsSync\"]);\n const sectionEnabled = cloud.authenticated && cloud.settingsSync;\n\n return (\n \n \n Synchronize your settings to the cloud. This allows easy synchronization across multiple devices with\n minimal effort.\n \n { cloud.settingsSync = v; }}\n >\n Settings Sync\n \n
\n putCloudSettings(true)}\n >Sync to Cloud\n \n {({ onMouseLeave, onMouseEnter }) => (\n getCloudSettings(true, true)}\n >Sync from Cloud\n )}\n \n deleteCloudSettings()}\n >Delete Cloud Settings\n
\n
\n );\n}\n\nfunction CloudTab() {\n const settings = useSettings([\"cloud.authenticated\", \"cloud.url\"]);\n\n return (\n \n \n \n Vencord comes with a cloud integration that adds goodies like settings sync across devices.\n It respects your privacy, and\n the source code is AGPL 3.0 licensed so you\n can host it yourself.\n \n { v && authorizeCloud(); if (!v) settings.cloud.authenticated = v; }}\n note=\"This will request authorization if you have not yet set up cloud integrations.\"\n >\n Enable Cloud Integrations\n \n Backend URL\n \n Which backend to use when using cloud integrations.\n \n { settings.cloud.url = v; settings.cloud.authenticated = false; deauthorizeCloud(); }}\n validate={validateUrl}\n />\n Alerts.show({\n title: \"Are you sure?\",\n body: \"Once your data is erased, we cannot recover it. There's no going back!\",\n onConfirm: eraseAllData,\n confirmText: \"Erase it!\",\n confirmColor: \"vc-cloud-erase-data-danger-btn\",\n cancelText: \"Nevermind\"\n })}\n >Erase All Data\n \n \n \n \n );\n}\n\nexport default wrapTab(CloudTab, \"Cloud\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Flex } from \"@components/Flex\";\nimport { Margins } from \"@utils/margins\";\nimport { classes } from \"@utils/misc\";\nimport { downloadSettingsBackup, uploadSettingsBackup } from \"@utils/settingsSync\";\nimport { Button, Card, Text } from \"@webpack/common\";\n\nimport { SettingsTab, wrapTab } from \"./shared\";\n\nfunction BackupRestoreTab() {\n return (\n \n \n \n Warning\n Importing a settings file will overwrite your current settings.\n \n \n \n You can import and export your Vencord settings as a JSON file.\n This allows you to easily transfer your settings to another device,\n or recover your settings after reinstalling Vencord or Discord.\n \n \n Settings Export contains:\n
    \n
  • — Custom QuickCSS
  • \n
  • — Theme Links
  • \n
  • — Plugin Settings
  • \n
\n
\n \n uploadSettingsBackup()}\n size={Button.Sizes.SMALL}\n >\n Import Settings\n \n \n Export Settings\n \n \n
\n );\n}\n\nexport default wrapTab(BackupRestoreTab, \"Backup & Restore\");\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and Megumin\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { React } from \"@webpack/common\";\n\nimport gitHash from \"~git-hash\";\n\nexport default definePlugin({\n name: \"Settings\",\n description: \"Adds Settings UI and debug info\",\n authors: [Devs.Ven, Devs.Megu],\n required: true,\n\n patches: [{\n find: \".versionHash\",\n replacement: [\n {\n match: /\\[\\(0,.{1,3}\\.jsxs?\\)\\((.{1,10}),(\\{[^{}}]+\\{.{0,20}.versionHash,.+?\\})\\),\" \"/,\n replace: (m, component, props) => {\n props = props.replace(/children:\\[.+\\]/, \"\");\n return `${m},Vencord.Plugins.plugins.Settings.makeInfoElements(${component}, ${props})`;\n }\n }\n ]\n }, {\n find: \"Messages.ACTIVITY_SETTINGS\",\n replacement: {\n get match() {\n switch (Settings.plugins.Settings.settingsLocation) {\n case \"top\": return /\\{section:(\\i\\.\\i)\\.HEADER,\\s*label:(\\i)\\.\\i\\.Messages\\.USER_SETTINGS\\}/;\n case \"aboveNitro\": return /\\{section:(\\i\\.\\i)\\.HEADER,\\s*label:(\\i)\\.\\i\\.Messages\\.BILLING_SETTINGS\\}/;\n case \"belowNitro\": return /\\{section:(\\i\\.\\i)\\.HEADER,\\s*label:(\\i)\\.\\i\\.Messages\\.APP_SETTINGS\\}/;\n case \"belowActivity\": return /(?<=\\{section:(\\i\\.\\i)\\.DIVIDER},)\\{section:\"changelog\"/;\n case \"bottom\": return /\\{section:(\\i\\.\\i)\\.CUSTOM,\\s*element:.+?}/;\n case \"aboveActivity\":\n default:\n return /\\{section:(\\i\\.\\i)\\.HEADER,\\s*label:(\\i)\\.\\i\\.Messages\\.ACTIVITY_SETTINGS\\}/;\n }\n },\n replace: \"...$self.makeSettingsCategories($1),$&\"\n }\n }, {\n find: \"Messages.USER_SETTINGS_ACTIONS_MENU_LABEL\",\n replacement: {\n match: /(?<=function\\((\\i),\\i\\)\\{)(?=let \\i=Object.values\\(\\i.UserSettingsSections\\).*?(\\i)\\.default\\.open\\()/,\n replace: \"$2.default.open($1);return;\"\n }\n }],\n\n customSections: [] as ((SectionTypes: Record) => any)[],\n\n makeSettingsCategories(SectionTypes: Record) {\n return [\n {\n section: SectionTypes.HEADER,\n label: \"Vencord\",\n className: \"vc-settings-header\"\n },\n {\n section: \"VencordSettings\",\n label: \"Vencord\",\n element: require(\"@components/VencordSettings/VencordTab\").default,\n className: \"vc-settings\"\n },\n {\n section: \"VencordPlugins\",\n label: \"Plugins\",\n element: require(\"@components/VencordSettings/PluginsTab\").default,\n className: \"vc-plugins\"\n },\n {\n section: \"VencordThemes\",\n label: \"Themes\",\n element: require(\"@components/VencordSettings/ThemesTab\").default,\n className: \"vc-themes\"\n },\n !IS_UPDATER_DISABLED && {\n section: \"VencordUpdater\",\n label: \"Updater\",\n element: require(\"@components/VencordSettings/UpdaterTab\").default,\n className: \"vc-updater\"\n },\n {\n section: \"VencordCloud\",\n label: \"Cloud\",\n element: require(\"@components/VencordSettings/CloudTab\").default,\n className: \"vc-cloud\"\n },\n {\n section: \"VencordSettingsSync\",\n label: \"Backup & Restore\",\n element: require(\"@components/VencordSettings/BackupAndRestoreTab\").default,\n className: \"vc-backup-restore\"\n },\n IS_DEV && {\n section: \"VencordPatchHelper\",\n label: \"Patch Helper\",\n element: require(\"@components/VencordSettings/PatchHelperTab\").default,\n className: \"vc-patch-helper\"\n },\n ...this.customSections.map(func => func(SectionTypes)),\n {\n section: SectionTypes.DIVIDER\n }\n ].filter(Boolean);\n },\n\n options: {\n settingsLocation: {\n type: OptionType.SELECT,\n description: \"Where to put the Vencord settings section\",\n options: [\n { label: \"At the very top\", value: \"top\" },\n { label: \"Above the Nitro section\", value: \"aboveNitro\" },\n { label: \"Below the Nitro section\", value: \"belowNitro\" },\n { label: \"Above Activity Settings\", value: \"aboveActivity\", default: true },\n { label: \"Below Activity Settings\", value: \"belowActivity\" },\n { label: \"At the very bottom\", value: \"bottom\" },\n ],\n restartNeeded: true\n },\n },\n\n get electronVersion() {\n return VencordNative.native.getVersions().electron || window.armcord?.electron || null;\n },\n\n get chromiumVersion() {\n try {\n return VencordNative.native.getVersions().chrome\n // @ts-ignore Typescript will add userAgentData IMMEDIATELY\n || navigator.userAgentData?.brands?.find(b => b.brand === \"Chromium\" || b.brand === \"Google Chrome\")?.version\n || null;\n } catch { // inb4 some stupid browser throws unsupported error for navigator.userAgentData, it's only in chromium\n return null;\n }\n },\n\n get additionalInfo() {\n if (IS_DEV) return \" (Dev)\";\n if (IS_WEB) return \" (Web)\";\n if (IS_VESKTOP) return ` (Vesktop v${VesktopNative.app.getVersion()})`;\n if (IS_STANDALONE) return \" (Standalone)\";\n return \"\";\n },\n\n makeInfoElements(Component: React.ComponentType, props: React.PropsWithChildren) {\n const { electronVersion, chromiumVersion, additionalInfo } = this;\n\n return (\n <>\n Vencord {gitHash}{additionalInfo}\n {electronVersion && Electron {electronVersion}}\n {chromiumVersion && Chromium {chromiumVersion}}\n \n );\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { DataStore } from \"@api/index\";\nimport { Devs, SUPPORT_CHANNEL_ID } from \"@utils/constants\";\nimport { isPluginDev } from \"@utils/misc\";\nimport { makeCodeblock } from \"@utils/text\";\nimport definePlugin from \"@utils/types\";\nimport { isOutdated } from \"@utils/updater\";\nimport { Alerts, Forms, UserStore } from \"@webpack/common\";\n\nimport gitHash from \"~git-hash\";\nimport plugins from \"~plugins\";\n\nimport settings from \"./settings\";\n\nconst REMEMBER_DISMISS_KEY = \"Vencord-SupportHelper-Dismiss\";\n\nconst AllowedChannelIds = [\n SUPPORT_CHANNEL_ID,\n \"1024286218801926184\", // Vencord > #bot-spam\n \"1033680203433660458\", // Vencord > #v\n];\n\nexport default definePlugin({\n name: \"SupportHelper\",\n required: true,\n description: \"Helps us provide support to you\",\n authors: [Devs.Ven],\n dependencies: [\"CommandsAPI\"],\n\n commands: [{\n name: \"vencord-debug\",\n description: \"Send Vencord Debug info\",\n predicate: ctx => AllowedChannelIds.includes(ctx.channel.id),\n async execute() {\n const { RELEASE_CHANNEL } = window.GLOBAL_ENV;\n\n const client = (() => {\n if (IS_DISCORD_DESKTOP) return `Discord Desktop v${DiscordNative.app.getVersion()}`;\n if (IS_VESKTOP) return `Vesktop v${VesktopNative.app.getVersion()}`;\n if (\"armcord\" in window) return `ArmCord v${window.armcord.version}`;\n\n // @ts-expect-error\n const name = typeof unsafeWindow !== \"undefined\" ? \"UserScript\" : \"Web\";\n return `${name} (${navigator.userAgent})`;\n })();\n\n const isApiPlugin = (plugin: string) => plugin.endsWith(\"API\") || plugins[plugin].required;\n\n const enabledPlugins = Object.keys(plugins).filter(p => Vencord.Plugins.isPluginEnabled(p) && !isApiPlugin(p));\n const enabledApiPlugins = Object.keys(plugins).filter(p => Vencord.Plugins.isPluginEnabled(p) && isApiPlugin(p));\n\n const info = {\n Vencord: `v${VERSION} \u2022 ${gitHash}${settings.additionalInfo} - ${Intl.DateTimeFormat(\"en-GB\", { dateStyle: \"medium\" }).format(BUILD_TIMESTAMP)}`,\n \"Discord Branch\": RELEASE_CHANNEL,\n Client: client,\n Platform: window.navigator.platform,\n Outdated: isOutdated,\n OpenAsar: \"openasar\" in window,\n };\n\n if (IS_DISCORD_DESKTOP) {\n info[\"Last Crash Reason\"] = (await DiscordNative.processUtils.getLastCrash())?.rendererCrashReason ?? \"N/A\";\n }\n\n const debugInfo = `\n**Vencord Debug Info**\n>>> ${Object.entries(info).map(([k, v]) => `${k}: ${v}`).join(\"\\n\")}\n\nEnabled Plugins (${enabledPlugins.length + enabledApiPlugins.length}):\n${makeCodeblock(enabledPlugins.join(\", \") + \"\\n\\n\" + enabledApiPlugins.join(\", \"))}\n`;\n\n return {\n content: debugInfo.trim().replaceAll(\"```\\n\", \"```\")\n };\n }\n }],\n\n flux: {\n async CHANNEL_SELECT({ channelId }) {\n if (channelId !== SUPPORT_CHANNEL_ID) return;\n\n if (isPluginDev(UserStore.getCurrentUser().id)) return;\n\n if (isOutdated && gitHash !== await DataStore.get(REMEMBER_DISMISS_KEY)) {\n const rememberDismiss = () => DataStore.set(REMEMBER_DISMISS_KEY, gitHash);\n\n Alerts.show({\n title: \"Hold on!\",\n body:
\n You are using an outdated version of Vencord! Chances are, your issue is already fixed.\n \n Please first update using the Updater Page in Settings, or use the VencordInstaller (Update Vencord Button)\n to do so, in case you can't access the Updater page.\n \n
,\n onCancel: rememberDismiss,\n onConfirm: rememberDismiss\n });\n }\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"AlwaysAnimate\",\n description: \"Animates anything that can be animated\",\n authors: [Devs.FieryFlames],\n\n patches: [\n {\n find: \"canAnimate:\",\n all: true,\n // Some modules match the find but the replacement is returned untouched\n noWarn: true,\n replacement: {\n match: /canAnimate:.+?(?=([,}].*?\\)))/g,\n replace: (m, rest) => {\n const destructuringMatch = rest.match(/}=.+/);\n if (destructuringMatch == null) return \"canAnimate:!0\";\n return m;\n }\n }\n },\n {\n // Status emojis\n find: \".Messages.GUILD_OWNER,\",\n replacement: {\n match: /(?<=\\.activityEmoji,.+?animate:)\\i/,\n replace: \"!0\"\n }\n },\n {\n // Guild Banner\n find: \".animatedBannerHoverLayer,onMouseEnter:\",\n replacement: {\n match: /(?<=guildBanner:\\i,animate:)\\i(?=}\\))/,\n replace: \"!0\"\n }\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nconst settings = definePluginSettings({\n domain: {\n type: OptionType.BOOLEAN,\n default: true,\n description: \"Remove the untrusted domain popup when opening links\",\n restartNeeded: true\n },\n file: {\n type: OptionType.BOOLEAN,\n default: true,\n description: \"Remove the 'Potentially Dangerous Download' popup when opening links\",\n restartNeeded: true\n }\n});\n\nexport default definePlugin({\n name: \"AlwaysTrust\",\n description: \"Removes the annoying untrusted domain and suspicious file popup\",\n authors: [Devs.zt, Devs.Trwy],\n patches: [\n {\n find: \".displayName=\\\"MaskedLinkStore\\\"\",\n replacement: {\n match: /(?<=isTrustedDomain\\(\\i\\){)return \\i\\(\\i\\)/,\n replace: \"return true\"\n },\n predicate: () => settings.store.domain\n },\n {\n find: \"isSuspiciousDownload:\",\n replacement: {\n match: /function \\i\\(\\i\\){(?=.{0,60}\\.parse\\(\\i\\))/,\n replace: \"$&return null;\"\n },\n predicate: () => settings.store.file\n }\n ],\n settings\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Upload } from \"@api/MessageEvents\";\nimport { definePluginSettings } from \"@api/Settings\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByCodeLazy, findByPropsLazy } from \"@webpack\";\n\ntype AnonUpload = Upload & { anonymise?: boolean; };\n\nconst ActionBarIcon = findByCodeLazy(\".actionBarIcon)\");\nconst UploadDraft = findByPropsLazy(\"popFirstFile\", \"update\");\n\nconst enum Methods {\n Random,\n Consistent,\n Timestamp,\n}\n\nconst tarExtMatcher = /\\.tar\\.\\w+$/;\n\nconst settings = definePluginSettings({\n anonymiseByDefault: {\n description: \"Whether to anonymise file names by default\",\n type: OptionType.BOOLEAN,\n default: true,\n },\n method: {\n description: \"Anonymising method\",\n type: OptionType.SELECT,\n options: [\n { label: \"Random Characters\", value: Methods.Random, default: true },\n { label: \"Consistent\", value: Methods.Consistent },\n { label: \"Timestamp\", value: Methods.Timestamp },\n ],\n },\n randomisedLength: {\n description: \"Random characters length\",\n type: OptionType.NUMBER,\n default: 7,\n disabled: () => settings.store.method !== Methods.Random,\n },\n consistent: {\n description: \"Consistent filename\",\n type: OptionType.STRING,\n default: \"image\",\n disabled: () => settings.store.method !== Methods.Consistent,\n },\n});\n\nexport default definePlugin({\n name: \"AnonymiseFileNames\",\n authors: [Devs.fawn],\n description: \"Anonymise uploaded file names\",\n patches: [\n {\n find: \"instantBatchUpload:function\",\n replacement: {\n match: /uploadFiles:(.{1,2}),/,\n replace:\n \"uploadFiles:(...args)=>(args[0].uploads.forEach(f=>f.filename=$self.anonymise(f)),$1(...args)),\",\n },\n },\n {\n find: \"message.attachments\",\n replacement: {\n match: /(\\i.uploadFiles\\((\\i),)/,\n replace: \"$2.forEach(f=>f.filename=$self.anonymise(f)),$1\"\n }\n },\n {\n find: \".Messages.ATTACHMENT_UTILITIES_SPOILER\",\n replacement: {\n match: /(?<=children:\\[)(?=.{10,80}tooltip:.{0,100}\\i\\.\\i\\.Messages\\.ATTACHMENT_UTILITIES_SPOILER)/,\n replace: \"arguments[0].canEdit!==false?$self.renderIcon(arguments[0]):null,\"\n },\n },\n ],\n settings,\n\n renderIcon: ErrorBoundary.wrap(({ upload, channelId, draftType }: { upload: AnonUpload; draftType: unknown; channelId: string; }) => {\n const anonymise = upload.anonymise ?? settings.store.anonymiseByDefault;\n return (\n {\n upload.anonymise = !anonymise;\n UploadDraft.update(channelId, upload.id, draftType, {}); // dummy update so component rerenders\n }}\n >\n {anonymise\n ? \n : \n }\n \n );\n }, { noop: true }),\n\n anonymise(upload: AnonUpload) {\n if ((upload.anonymise ?? settings.store.anonymiseByDefault) === false) return upload.filename;\n\n const file = upload.filename;\n const tarMatch = tarExtMatcher.exec(file);\n const extIdx = tarMatch?.index ?? file.lastIndexOf(\".\");\n const ext = extIdx !== -1 ? file.slice(extIdx) : \"\";\n\n switch (settings.store.method) {\n case Methods.Random:\n const chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n return Array.from(\n { length: settings.store.randomisedLength },\n () => chars[Math.floor(Math.random() * chars.length)]\n ).join(\"\") + ext;\n case Methods.Consistent:\n return settings.store.consistent + ext;\n case Methods.Timestamp:\n return Date.now() + ext;\n }\n },\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 OpenAsar\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { popNotice, showNotice } from \"@api/Notices\";\nimport { Link } from \"@components/Link\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { ApplicationAssetUtils, FluxDispatcher, Forms, Toasts } from \"@webpack/common\";\n\nconst RpcUtils = findByPropsLazy(\"fetchApplicationsRPC\", \"getRemoteIconURL\");\n\nasync function lookupAsset(applicationId: string, key: string): Promise {\n return (await ApplicationAssetUtils.fetchAssetIds(applicationId, [key]))[0];\n}\n\nconst apps: any = {};\nasync function lookupApp(applicationId: string): Promise {\n const socket: any = {};\n await RpcUtils.fetchApplicationsRPC(socket, applicationId);\n return socket.application;\n}\n\nlet ws: WebSocket;\nexport default definePlugin({\n name: \"WebRichPresence (arRPC)\",\n description: \"Client plugin for arRPC to enable RPC on Discord Web (experimental)\",\n authors: [Devs.Ducko],\n\n settingsAboutComponent: () => (\n <>\n How to use arRPC\n \n Follow the instructions in the GitHub repo to get the server running, and then enable the plugin.\n \n \n ),\n\n async handleEvent(e: MessageEvent) {\n const data = JSON.parse(e.data);\n\n const { activity } = data;\n const assets = activity?.assets;\n\n if (assets?.large_image) assets.large_image = await lookupAsset(activity.application_id, assets.large_image);\n if (assets?.small_image) assets.small_image = await lookupAsset(activity.application_id, assets.small_image);\n\n if (activity) {\n const appId = activity.application_id;\n apps[appId] ||= await lookupApp(appId);\n\n const app = apps[appId];\n activity.name ||= app.name;\n }\n\n FluxDispatcher.dispatch({ type: \"LOCAL_ACTIVITY_UPDATE\", ...data });\n },\n\n async start() {\n // ArmCord comes with its own arRPC implementation, so this plugin just confuses users\n if (\"armcord\" in window) return;\n\n if (ws) ws.close();\n ws = new WebSocket(\"ws://127.0.0.1:1337\"); // try to open WebSocket\n\n ws.onmessage = this.handleEvent;\n\n const connectionSuccessful = await new Promise(res => setTimeout(() => res(ws.readyState === WebSocket.OPEN), 1000)); // check if open after 1s\n if (!connectionSuccessful) {\n showNotice(\"Failed to connect to arRPC, is it running?\", \"Retry\", () => { // show notice about failure to connect, with retry/ignore\n popNotice();\n this.start();\n });\n return;\n }\n\n Toasts.show({ // show toast on success\n message: \"Connected to arRPC\",\n type: Toasts.Type.SUCCESS,\n id: Toasts.genId(),\n options: {\n duration: 1000,\n position: Toasts.Position.BOTTOM\n }\n });\n },\n\n stop() {\n FluxDispatcher.dispatch({ type: \"LOCAL_ACTIVITY_UPDATE\", activity: null }); // clear status\n ws?.close(); // close WebSocket\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\n\nexport default definePlugin({\n name: \"BANger\",\n description: \"Replaces the GIF in the ban dialogue with a custom one.\",\n authors: [Devs.Xinto, Devs.Glitch],\n patches: [\n {\n find: \"BAN_CONFIRM_TITLE.\",\n replacement: {\n match: /src:\\i\\(\"\\d+\"\\)/g,\n replace: \"src: Vencord.Settings.plugins.BANger.source\"\n }\n }\n ],\n options: {\n source: {\n description: \"Source to replace ban GIF with (Video or Gif)\",\n type: OptionType.STRING,\n default: \"https://i.imgur.com/wp5q52C.mp4\",\n restartNeeded: true,\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { findByPropsLazy, findComponentByCodeLazy, findStoreLazy } from \"@webpack\";\nimport { useStateFromStores } from \"@webpack/common\";\nimport type { CSSProperties } from \"react\";\n\nimport { ExpandedGuildFolderStore, settings } from \".\";\n\nconst ChannelRTCStore = findStoreLazy(\"ChannelRTCStore\");\nconst Animations = findByPropsLazy(\"a\", \"animated\", \"useTransition\");\nconst GuildsBar = findComponentByCodeLazy('(\"guildsnav\")');\n\nexport default ErrorBoundary.wrap(guildsBarProps => {\n const expandedFolders = useStateFromStores([ExpandedGuildFolderStore], () => ExpandedGuildFolderStore.getExpandedFolders());\n const isFullscreen = useStateFromStores([ChannelRTCStore], () => ChannelRTCStore.isFullscreenInContext());\n\n const Sidebar = (\n \n );\n\n const visible = !!expandedFolders.size;\n const guilds = document.querySelector(guildsBarProps.className.split(\" \").map(c => `.${c}`).join(\"\"));\n\n // We need to display none if we are in fullscreen. Yes this seems horrible doing with css, but it's literally how Discord does it.\n // Also display flex otherwise to fix scrolling\n const barStyle = {\n display: isFullscreen ? \"none\" : \"flex\",\n } as CSSProperties;\n\n if (!guilds || !settings.store.sidebarAnim) {\n return visible\n ?
{Sidebar}
\n : null;\n }\n\n return (\n \n {(animationStyle, show) =>\n show && (\n \n {Sidebar}\n \n )\n }\n \n );\n}, { noop: true });\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2023 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy, findStoreLazy } from \"@webpack\";\nimport { FluxDispatcher, i18n } from \"@webpack/common\";\n\nimport FolderSideBar from \"./FolderSideBar\";\n\nenum FolderIconDisplay {\n Never,\n Always,\n MoreThanOneFolderExpanded\n}\n\nconst { GuildsTree } = findByPropsLazy(\"GuildsTree\");\nconst SortedGuildStore = findStoreLazy(\"SortedGuildStore\");\nexport const ExpandedGuildFolderStore = findStoreLazy(\"ExpandedGuildFolderStore\");\nconst FolderUtils = findByPropsLazy(\"move\", \"toggleGuildFolderExpand\");\n\nlet lastGuildId = null as string | null;\nlet dispatchingFoldersClose = false;\n\nfunction getGuildFolder(id: string) {\n return SortedGuildStore.getGuildFolders().find(folder => folder.guildIds.includes(id));\n}\n\nfunction closeFolders() {\n for (const id of ExpandedGuildFolderStore.getExpandedFolders())\n FolderUtils.toggleGuildFolderExpand(id);\n}\n\nexport const settings = definePluginSettings({\n sidebar: {\n type: OptionType.BOOLEAN,\n description: \"Display servers from folder on dedicated sidebar\",\n restartNeeded: true,\n default: true\n },\n sidebarAnim: {\n type: OptionType.BOOLEAN,\n description: \"Animate opening the folder sidebar\",\n default: true\n },\n closeAllFolders: {\n type: OptionType.BOOLEAN,\n description: \"Close all folders when selecting a server not in a folder\",\n default: false\n },\n closeAllHomeButton: {\n type: OptionType.BOOLEAN,\n description: \"Close all folders when clicking on the home button\",\n restartNeeded: true,\n default: false\n },\n closeOthers: {\n type: OptionType.BOOLEAN,\n description: \"Close other folders when opening a folder\",\n default: false\n },\n forceOpen: {\n type: OptionType.BOOLEAN,\n description: \"Force a folder to open when switching to a server of that folder\",\n default: false\n },\n keepIcons: {\n type: OptionType.BOOLEAN,\n description: \"Keep showing guild icons in the primary guild bar folder when it's open in the BetterFolders sidebar\",\n restartNeeded: true,\n default: false\n },\n showFolderIcon: {\n type: OptionType.SELECT,\n description: \"Show the folder icon above the folder guilds in the BetterFolders sidebar\",\n options: [\n { label: \"Never\", value: FolderIconDisplay.Never },\n { label: \"Always\", value: FolderIconDisplay.Always, default: true },\n { label: \"When more than one folder is expanded\", value: FolderIconDisplay.MoreThanOneFolderExpanded }\n ],\n restartNeeded: true\n }\n});\n\nexport default definePlugin({\n name: \"BetterFolders\",\n description: \"Shows server folders on dedicated sidebar and adds folder related improvements\",\n authors: [Devs.juby, Devs.AutumnVN, Devs.Nuckyz],\n\n settings,\n\n patches: [\n {\n find: '(\"guildsnav\")',\n predicate: () => settings.store.sidebar,\n replacement: [\n // Create the isBetterFolders variable in the GuildsBar component\n {\n match: /(?<=let{disableAppDownload:\\i=\\i\\.isPlatformEmbedded,isOverlay:.+?)(?=}=\\i,)/,\n replace: \",isBetterFolders\"\n },\n // If we are rendering the Better Folders sidebar, we filter out guilds that are not in folders and unexpanded folders\n {\n match: /(useStateFromStoresArray\\).{0,25}let \\i)=(\\i\\.\\i.getGuildsTree\\(\\))/,\n replace: (_, rest, guildsTree) => `${rest}=$self.getGuildTree(!!arguments[0].isBetterFolders,${guildsTree},arguments[0].betterFoldersExpandedIds)`\n },\n // If we are rendering the Better Folders sidebar, we filter out everything but the servers and folders from the GuildsBar Guild List children\n {\n match: /lastTargetNode:\\i\\[\\i\\.length-1\\].+?Fragment.+?\\]}\\)\\]/,\n replace: \"$&.filter($self.makeGuildsBarGuildListFilter(!!arguments[0].isBetterFolders))\"\n },\n // If we are rendering the Better Folders sidebar, we filter out everything but the scroller for the guild list from the GuildsBar Tree children\n {\n match: /unreadMentionsIndicatorBottom,barClassName.+?}\\)\\]/,\n replace: \"$&.filter($self.makeGuildsBarTreeFilter(!!arguments[0].isBetterFolders))\"\n },\n // Export the isBetterFolders variable to the folders component\n {\n match: /(?<=\\.Messages\\.SERVERS.+?switch\\((\\i)\\.type\\){case \\i\\.\\i\\.FOLDER:.+?folderNode:\\i,)/,\n replace: 'isBetterFolders:typeof isBetterFolders!==\"undefined\"?isBetterFolders:false,'\n }\n ]\n },\n {\n // This is the parent folder component\n find: \".MAX_GUILD_FOLDER_NAME_LENGTH,\",\n predicate: () => settings.store.sidebar && settings.store.showFolderIcon !== FolderIconDisplay.Always,\n replacement: [\n {\n // Modify the expanded state to instead return the list of expanded folders\n match: /(useStateFromStores\\).{0,20}=>)(\\i\\.\\i)\\.isFolderExpanded\\(\\i\\)/,\n replace: (_, rest, ExpandedGuildFolderStore) => `${rest}${ExpandedGuildFolderStore}.getExpandedFolders()`,\n },\n {\n // Modify the expanded prop to use the boolean if the above patch fails, or check if the folder is expanded from the list if it succeeds\n // Also export the list of expanded folders to the child folder component if the patch above succeeds, else export undefined\n match: /(?<=folderNode:(\\i),expanded:)\\i(?=,)/,\n replace: (isExpandedOrExpandedIds, folderNote) => \"\"\n + `typeof ${isExpandedOrExpandedIds}===\"boolean\"?${isExpandedOrExpandedIds}:${isExpandedOrExpandedIds}.has(${folderNote}.id),`\n + `betterFoldersExpandedIds:${isExpandedOrExpandedIds} instanceof Set?${isExpandedOrExpandedIds}:void 0`\n }\n ]\n },\n {\n find: \".FOLDER_ITEM_GUILD_ICON_MARGIN);\",\n predicate: () => settings.store.sidebar,\n replacement: [\n // We use arguments[0] to access the isBetterFolders variable in this nested folder component (the parent exports all the props so we don't have to patch it)\n\n // If we are rendering the normal GuildsBar sidebar, we make Discord think the folder is always collapsed to show better icons (the mini guild icons) and avoid transitions\n {\n predicate: () => settings.store.keepIcons,\n match: /(?<=let{folderNode:\\i,setNodeRef:\\i,.+?expanded:(\\i),.+?;)(?=let)/,\n replace: (_, isExpanded) => `${isExpanded}=!!arguments[0].isBetterFolders&&${isExpanded};`\n },\n // Disable expanding and collapsing folders transition in the normal GuildsBar sidebar\n {\n predicate: () => !settings.store.keepIcons,\n match: /(?<=\\.Messages\\.SERVER_FOLDER_PLACEHOLDER.+?useTransition\\)\\()/,\n replace: \"!!arguments[0].isBetterFolders&&\"\n },\n // If we are rendering the normal GuildsBar sidebar, we avoid rendering guilds from folders that are expanded\n {\n predicate: () => !settings.store.keepIcons,\n match: /expandedFolderBackground,.+?,(?=\\i\\(\\(\\i,\\i,\\i\\)=>{let{key.{0,45}ul)(?<=selected:\\i,expanded:(\\i),.+?)/,\n replace: (m, isExpanded) => `${m}!arguments[0].isBetterFolders&&${isExpanded}?null:`\n },\n {\n // Decide if we should render the expanded folder background if we are rendering the Better Folders sidebar\n predicate: () => settings.store.showFolderIcon !== FolderIconDisplay.Always,\n match: /(?<=\\.wrapper,children:\\[)/,\n replace: \"$self.shouldShowFolderIconAndBackground(!!arguments[0].isBetterFolders,arguments[0].betterFoldersExpandedIds)&&\"\n },\n {\n // Decide if we should render the expanded folder icon if we are rendering the Better Folders sidebar\n predicate: () => settings.store.showFolderIcon !== FolderIconDisplay.Always,\n match: /(?<=\\.expandedFolderBackground.+?}\\),)(?=\\i,)/,\n replace: \"!$self.shouldShowFolderIconAndBackground(!!arguments[0].isBetterFolders,arguments[0].betterFoldersExpandedIds)?null:\"\n }\n ]\n },\n {\n find: \"APPLICATION_LIBRARY,render\",\n predicate: () => settings.store.sidebar,\n replacement: {\n // Render the Better Folders sidebar\n match: /(?<=({className:\\i\\.guilds,themeOverride:\\i})\\))/,\n replace: \",$self.FolderSideBar($1)\"\n }\n },\n {\n find: \".Messages.DISCODO_DISABLED\",\n predicate: () => settings.store.closeAllHomeButton,\n replacement: {\n // Close all folders when clicking the home button\n match: /(?<=onClick:\\(\\)=>{)(?=.{0,200}\"discodo\")/,\n replace: \"$self.closeFolders();\"\n }\n }\n ],\n\n flux: {\n CHANNEL_SELECT(data) {\n if (!settings.store.closeAllFolders && !settings.store.forceOpen)\n return;\n\n if (lastGuildId !== data.guildId) {\n lastGuildId = data.guildId;\n const guildFolder = getGuildFolder(data.guildId);\n\n if (guildFolder?.folderId) {\n if (settings.store.forceOpen && !ExpandedGuildFolderStore.isFolderExpanded(guildFolder.folderId)) {\n FolderUtils.toggleGuildFolderExpand(guildFolder.folderId);\n }\n } else if (settings.store.closeAllFolders) {\n closeFolders();\n }\n }\n },\n\n TOGGLE_GUILD_FOLDER_EXPAND(data) {\n if (settings.store.closeOthers && !dispatchingFoldersClose) {\n dispatchingFoldersClose = true;\n\n FluxDispatcher.wait(() => {\n const expandedFolders = ExpandedGuildFolderStore.getExpandedFolders();\n\n if (expandedFolders.size > 1) {\n for (const id of expandedFolders) if (id !== data.folderId)\n FolderUtils.toggleGuildFolderExpand(id);\n }\n\n dispatchingFoldersClose = false;\n });\n }\n }\n },\n\n getGuildTree(isBetterFolders: boolean, oldTree: any, expandedFolderIds?: Set) {\n if (!isBetterFolders || expandedFolderIds == null) return oldTree;\n\n const newTree = new GuildsTree();\n // Children is every folder and guild which is not in a folder, this filters out only the expanded folders\n newTree.root.children = oldTree.root.children.filter(guildOrFolder => expandedFolderIds.has(guildOrFolder.id));\n // Nodes is every folder and guild, even if it's in a folder, this filters out only the expanded folders and guilds inside them\n newTree.nodes = Object.fromEntries(\n Object.entries(oldTree.nodes)\n .filter(([_, guildOrFolder]: any[]) => expandedFolderIds.has(guildOrFolder.id) || expandedFolderIds.has(guildOrFolder.parentId))\n );\n\n return newTree;\n },\n\n makeGuildsBarGuildListFilter(isBetterFolders: boolean) {\n return child => {\n if (isBetterFolders) {\n return child?.props?.[\"aria-label\"] === i18n.Messages.SERVERS;\n }\n return true;\n };\n },\n\n makeGuildsBarTreeFilter(isBetterFolders: boolean) {\n return child => {\n if (isBetterFolders) {\n return \"onScroll\" in child.props;\n }\n return true;\n };\n },\n\n shouldShowFolderIconAndBackground(isBetterFolders: boolean, expandedFolderIds?: Set) {\n if (!isBetterFolders) return true;\n\n switch (settings.store.showFolderIcon) {\n case FolderIconDisplay.Never:\n return false;\n case FolderIconDisplay.Always:\n return true;\n case FolderIconDisplay.MoreThanOneFolderExpanded:\n return (expandedFolderIds?.size ?? 0) > 1;\n default:\n return true;\n }\n },\n\n FolderSideBar: guildsBarProps => ,\n\n closeFolders\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"BetterGifAltText\",\n authors: [Devs.Ven],\n description:\n \"Change GIF alt text from simply being 'GIF' to containing the gif tags / filename\",\n patches: [\n {\n find: \"onCloseImage=\",\n replacement: {\n match: /(return.{0,10}\\.jsx.{0,50}isWindowFocused)/,\n replace:\n \"$self.altify(e);$1\",\n },\n },\n {\n find: \".Messages.GIF,\",\n replacement: {\n match: /alt:(\\i)=(\\i\\.default\\.Messages\\.GIF)(?=,[^}]*\\}=(\\i))/,\n replace:\n // rename prop so we can always use default value\n \"alt_$$:$1=$self.altify($3)||$2\",\n },\n },\n ],\n\n altify(props: any) {\n props.alt ??= \"GIF\";\n if (props.alt !== \"GIF\") return props.alt;\n\n let url: string = props.original || props.src;\n try {\n url = decodeURI(url);\n } catch { }\n\n let name = url\n .slice(url.lastIndexOf(\"/\") + 1)\n .replace(/\\d/g, \"\") // strip numbers\n .replace(/.gif$/, \"\") // strip extension\n .split(/[,\\-_ ]+/g)\n .slice(0, 20)\n .join(\" \");\n if (name.length > 300) {\n name = name.slice(0, 300) + \"...\";\n }\n\n if (name) props.alt += ` - ${name}`;\n\n return props.alt;\n },\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2024 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { Devs } from \"@utils/constants\";\nimport definePlugin from \"@utils/types\";\n\nexport default definePlugin({\n name: \"BetterGifPicker\",\n description: \"Makes the gif picker open the favourite category by default\",\n authors: [Devs.Samwich],\n patches: [\n {\n find: \".GIFPickerResultTypes.SEARCH\",\n replacement: [{\n match: \"this.state={resultType:null}\",\n replace: 'this.state={resultType:\"Favorites\"}'\n }]\n }\n ]\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\n\nconst UserPopoutSectionCssClasses = findByPropsLazy(\"section\", \"lastSection\");\n\nexport default definePlugin({\n name: \"BetterNotesBox\",\n description: \"Hide notes or disable spellcheck (Configure in settings!!)\",\n authors: [Devs.Ven],\n\n patches: [\n {\n find: \"hideNote:\",\n all: true,\n // Some modules match the find but the replacement is returned untouched\n noWarn: true,\n predicate: () => Vencord.Settings.plugins.BetterNotesBox.hide,\n replacement: {\n match: /hideNote:.+?(?=([,}].*?\\)))/g,\n replace: (m, rest) => {\n const destructuringMatch = rest.match(/}=.+/);\n if (destructuringMatch == null) return \"hideNote:!0\";\n return m;\n }\n }\n },\n {\n find: \"Messages.NOTE_PLACEHOLDER\",\n replacement: {\n match: /\\.NOTE_PLACEHOLDER,/,\n replace: \"$&spellCheck:!Vencord.Settings.plugins.BetterNotesBox.noSpellCheck,\"\n }\n },\n {\n find: \".Messages.NOTE}\",\n replacement: {\n match: /(?<=return \\i\\?)null(?=:\\(0,\\i\\.jsxs)/,\n replace: \"$self.patchPadding(arguments[0])\"\n }\n }\n ],\n\n options: {\n hide: {\n type: OptionType.BOOLEAN,\n description: \"Hide notes\",\n default: false,\n restartNeeded: true\n },\n noSpellCheck: {\n type: OptionType.BOOLEAN,\n description: \"Disable spellcheck in notes\",\n disabled: () => Settings.plugins.BetterNotesBox.hide,\n default: false\n }\n },\n\n patchPadding(e: any) {\n if (!e.lastSection) return;\n return (\n
\n );\n }\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2024 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { Devs } from \"@utils/constants\";\nimport { getCurrentGuild } from \"@utils/discord\";\nimport definePlugin from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { Clipboard, GuildStore, Menu, PermissionStore, TextAndImagesSettingsStores } from \"@webpack/common\";\n\nconst GuildSettingsActions = findByPropsLazy(\"open\", \"selectRole\", \"updateGuild\");\n\nfunction PencilIcon() {\n return (\n \n \n \n );\n}\n\nfunction AppearanceIcon() {\n return (\n \n \n \n );\n}\n\nexport default definePlugin({\n name: \"BetterRoleContext\",\n description: \"Adds options to copy role color / edit role when right clicking roles in the user profile\",\n authors: [Devs.Ven],\n\n start() {\n // DeveloperMode needs to be enabled for the context menu to be shown\n TextAndImagesSettingsStores.DeveloperMode.updateSetting(true);\n },\n\n contextMenus: {\n \"dev-context\"(children, { id }: { id: string; }) {\n const guild = getCurrentGuild();\n if (!guild) return;\n\n const role = GuildStore.getRole(guild.id, id);\n if (!role) return;\n\n if (role.colorString) {\n children.push(\n Clipboard.copy(role.colorString!)}\n icon={AppearanceIcon}\n />\n );\n }\n\n if (PermissionStore.getGuildPermissionProps(guild).canManageRoles) {\n children.push(\n {\n await GuildSettingsActions.open(guild.id, \"ROLES\");\n GuildSettingsActions.selectRole(id);\n }}\n icon={PencilIcon}\n />\n );\n }\n }\n }\n});\n", "/*\n * Vencord, a modification for Discord's desktop app\n * Copyright (c) 2022 Vendicated and contributors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n*/\n\nimport { Settings } from \"@api/Settings\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { Clipboard, Toasts } from \"@webpack/common\";\n\nexport default definePlugin({\n name: \"BetterRoleDot\",\n authors: [Devs.Ven, Devs.AutumnVN],\n description:\n \"Copy role colour on RoleDot (accessibility setting) click. Also allows using both RoleDot and coloured names simultaneously\",\n\n patches: [\n {\n find: \".dotBorderBase\",\n replacement: {\n match: /,viewBox:\"0 0 20 20\"/,\n replace: \"$&,onClick:()=>$self.copyToClipBoard(arguments[0].color),style:{cursor:'pointer'}\",\n },\n },\n {\n find: '\"dot\"===',\n all: true,\n noWarn: true,\n predicate: () => Settings.plugins.BetterRoleDot.bothStyles,\n replacement: {\n match: /\"(?:username|dot)\"===\\i(?!\\.\\i)/g,\n replace: \"true\",\n },\n },\n\n {\n find: \".ADD_ROLE_A11Y_LABEL\",\n predicate: () => Settings.plugins.BetterRoleDot.copyRoleColorInProfilePopout && !Settings.plugins.BetterRoleDot.bothStyles,\n noWarn: true,\n replacement: {\n match: /\"dot\"===\\i/,\n replace: \"true\"\n }\n },\n {\n find: \".roleVerifiedIcon\",\n predicate: () => Settings.plugins.BetterRoleDot.copyRoleColorInProfilePopout && !Settings.plugins.BetterRoleDot.bothStyles,\n noWarn: true,\n replacement: {\n match: /\"dot\"===\\i/,\n replace: \"true\"\n }\n }\n ],\n\n options: {\n bothStyles: {\n type: OptionType.BOOLEAN,\n description: \"Show both role dot and coloured names\",\n restartNeeded: true,\n default: false,\n },\n copyRoleColorInProfilePopout: {\n type: OptionType.BOOLEAN,\n description: \"Allow click on role dot in profile popout to copy role color\",\n restartNeeded: true,\n default: false\n }\n },\n\n copyToClipBoard(color: string) {\n Clipboard.copy(color);\n Toasts.show({\n message: \"Copied to Clipboard!\",\n type: Toasts.Type.SUCCESS,\n id: Toasts.genId(),\n options: {\n duration: 1000,\n position: Toasts.Position.BOTTOM\n }\n });\n },\n});\n", "/*\n * Vencord, a Discord client mod\n * Copyright (c) 2024 Vendicated and contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n\nimport { definePluginSettings } from \"@api/Settings\";\nimport { classNameFactory } from \"@api/Styles\";\nimport ErrorBoundary from \"@components/ErrorBoundary\";\nimport { Devs } from \"@utils/constants\";\nimport definePlugin, { OptionType } from \"@utils/types\";\nimport { findByPropsLazy } from \"@webpack\";\nimport { ComponentDispatch, FocusLock, i18n, Menu, useEffect, useRef } from \"@webpack/common\";\nimport type { HTMLAttributes, ReactElement } from \"react\";\n\ntype SettingsEntry = { section: string, label: string; };\n\nconst cl = classNameFactory(\"\");\nconst Classes = findByPropsLazy(\"animating\", \"baseLayer\", \"bg\", \"layer\", \"layers\");\n\nconst settings = definePluginSettings({\n disableFade: {\n description: \"Disable the crossfade animation\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: true\n },\n organizeMenu: {\n description: \"Organizes the settings cog context menu into categories\",\n type: OptionType.BOOLEAN,\n default: true\n },\n eagerLoad: {\n description: \"Removes the loading delay when opening the menu for the first time\",\n type: OptionType.BOOLEAN,\n default: true,\n restartNeeded: true\n }\n});\n\ninterface LayerProps extends HTMLAttributes {\n mode: \"SHOWN\" | \"HIDDEN\";\n baseLayer?: boolean;\n}\n\nfunction Layer({ mode, baseLayer = false, ...props }: LayerProps) {\n const hidden = mode === \"HIDDEN\";\n const containerRef = useRef(null);\n\n useEffect(() => () => {\n ComponentDispatch.dispatch(\"LAYER_POP_START\");\n ComponentDispatch.dispatch(\"LAYER_POP_COMPLETE\");\n }, []);\n\n const node = (\n